- 
                Notifications
    You must be signed in to change notification settings 
- Fork 661
Migration Guide
This guide will highlight the major changes in the SDK and how to update your code accordingly. This release contains new usage patterns for a lot of service. Old usage patterns should still be functional in this release; however, in the next major release, your code will be mandated to use those new usage patterns.
In this major release, several services have been generated from the Swagger specifications of our services. Furthermore, the language has changed from NodeJS to TypeScript for these services. The change of language to TypeScript will not have an impact on NodeJS usage because the published public package contains NodeJS that is the result of transpiling the TypeScript code.
The following services are now being generated programmatically:
- Conversation
- Discovery
- Language Translator
- Natural Language Classifier
- Natural Language Understanding
- Personality Insights
- Text to Speech
- Tone Analyzer
- Speech to Text
- Visual Recognition
It's important to note that with so many of the services being moved to automated generation, there are many minor changes to method names, parameter names, etc. Therefore, this list is not exhaustive. However, we hope that this new approach will result in more consistent, maintainable code going forward.
In each specific project directory the previous structure was something like
- node-sdk/discovery
- v1.js
 
This has been replaced with something like
- node-sdk/discovery
- v1.ts
- v1-generated.ts
 
Where v1.ts is an adapter and v1-generated.ts is the new generated code. After building, there will be compiled files v1.js and v1-generated.js which are the JavaScript compilations of the TypeScript files.
Non generated code and helper methods are found in the /lib folder.
Adapters are provided to ensure your old code will not break. These adapters follow the conventions of the v2 NodeSDK such as method names, parameters, etc. and call upon the generated code.
These are named for example for discovery: v1.ts Generated files follow the convention v1-generated.ts
These adapters should not be relied on and will not be supported for future versions and your code should be migrated to use the generated code.
getIntents
- 
getIntentsis nowlistIntents
getExamples
- 
getExamplesis nowlistExamples
getEntities
- 
getEntitiesis nowlistEntities
getValues
- 
getValuesis nowlistValues
getSynonyms
- 
getSynonymsis nowlistSynonyms
getDialogNodes
- 
getDialogNodesis nowlistDialogNodes
getLogs
- 
getLogsis nowlistLogs
getCounterExamples
- 
getCounterExamplesis nowlistCounterExamples
updateIntent
- parameter old_intentis nowintent
- parameter intentis nownew_intent
- parameter descriptionis nownew_description
- parameter examplesis nownew_examples
updateEntity
- parameter old_entityis nowentity
- parameter entityis nownew_entity
- parameter descriptionis nownew_description
- parameter metadatais nownew_metadata
- parameter fuzzy_matchis nownew_fuzzy_match
- parameter valuesis nownew_values
updateValue
- parameter old_valueis nowvalue
- parameter valueis nownew value
- parameter metadatais nownew_metadata
- parameter synonymsis nownew_synonyms
updateSynonym
- parameter old_synonymis nowsynonym
- parameter synonymis nownew_synonym
updateDialogNode
- parameter old_dialog_nodeis nowdialog_node
- parameter dialog_nodeis nownew_dialog_node
- parameter descriptionis nownew_description
- parameter conditionsis nownew_conditions
- parameter parentis nownew_parent
- parameter previous_siblingis nownew_previous_sibling
- parameter outputis nownew_output
- parameter contextis nownew_context
- parameter metadatais nownew_metadata
- parameter next_stepis nownew_next_step
- parameter titleis nownew_title
- parameter typeis nownew_type
- parameter event_nameis nownew_event_name
- parameter variableis nownew_variable
- parameter actionsis nownew_action
- parameter old_textis nowtext
- parameter textis nownew_text
getEnvironments
- 
getEnvironmentsis nowlistEnvironments
- parameter added name
getConfigurations
- 
getConfigurationsis nowlistConfigurations
- parameter added name
getCollectionFields
- 
getCollectionFieldsis nowlistCollectionFields
getCollections
- 
getCollectionsis nowlistCollections
- parameter added name
createConfiguration
- required parameter added name
- optional parameter added description
- 
fileis now decomposed into three top-level parameters, namely,conversions,enrichments, andnormalizations.
updateConfiguration
- required parameter added name
- optional parameter added description
- 
fileis now decomposed into three top-level parameters, namely,conversions,enrichments, andnormalizations.
createCollection
- parameter language_codeis nowlanguage
updateCollection
- parameter collection_nameis nowname
- parameter language_codeis removed
addDocument
- new optional parameter file_content_type
New Supported Methods
- new supported method queryNotices
- new supported method federatedQueryNotices
- new supported method federatedQuery
- new supported method addTrainingData
- new supported method createTrainingExample
- new supported method deleteAllTrainingData
- new supported method deleteTrainingData
- new supported method deleteTrainingExample
- new supported method getTrainingData
- new supported method getTrainingExample
- new supported method listTrainingData
- new supported method listTrainingExamples
- new supported method updateTrainingExample
getModels
- 
getModelsis nowlistModels
- parameter defaultis nowdefault_models
getIdentifiableLanguages
- 
getIdentifiableLanguagesis nowlistIdentifiableLanguages
create
- 
createis nowcreateClassifier
- required parameter added metadata
status
- 
statusis nowgetClassifier
list
- 
listis nowlistClassifiers
remove
- 
removeis nowdeleteClassifier
analyze
- parameter headersremoved
- optional parameters added clean,xpath,fallback_to_raw,return_analyzed_text,language,limit_text_characters
- 
featuresis now a required parameter
deleteModel
- parameter headersremoved
listModels
- parameter headersremoved
profile
- required parameters have changed from either textorcontent_itemstocontent
- header parameters content_type,accept_language,content-languageare now top-level parameters and no longer encapsulated in aheadersobject
- 
content_typeis now required
Method Name Changes
- 
voiceis nowgetVoice
- 
voicesis nowlistVoices
- 
pronunciationis nowgetPronunciation
- 
createCustomizationis nowcreateVoiceModel
- 
updateCustomizationis nowupdateVoiceModel
- 
getCustomizationis nowgetVoiceModel
- 
getCustomizationsis nowlistVoiceModel
- 
deleteCustomizationrenamed todeleteVoiceModel
- 
getWordsrenamed tolistWords
tone_chat
- 
tone_chatmethod is nowtoneChat
- 
utterancesare now a top level parameter
- new optional parameter accept_language
tone
- required parameter added content_type
- required parameter textis nowtone_input
- removed parameter isHTML
getModels
- 
getModelsis nowlistModels
getCustomizaition
- 
getCustomizationis nowgetLanguageModel
getCustomizations
- 
getCustomizationsis nowlistLanguageModels
getRecognizeStatus
- 
getRecognizeStatusis nowgetSessionStatus
getRecognitionJob
- 
getRecognitionJobis nowcheckJob
getRecognitionJobs
- 
getRecognitionJobsis nowcheckJobs
createRecognitionJob
- 
createRecognitionJobis nowcreateJob
deleteRecognitionJob
- 
deleteRecognitionJobis nowdeleteJob
createCustomization
- 
createCustomizationis nowcreateLanguageModel
- new required parameter content_type
addCorpus
- parameter nameis nowcorpus_name
- parameter corpusis nowcorpus_file
getCorpus
- parameter nameis nowcorpus_name
deleteCorpus
- parameter nameis nowcorpus_name
getCorpora
- 
getCorporais nowlistCorpora
addWords
- new required parameter content_type
addWord
- parameter wordis nowword_name
- new require parameter content_type
getWords
- 
getWordsis nowlistWords
deleteWord
- parameter wordis nowword_name
trainCustomization
- 
trainCustomizationis nowtrainLanguageModel
resetCustomization
- 
resetCustomizationis nowresetLanguageModel
createSession
- parameters added customization_id,acoustic_customization_id,customization_weight
retrainClassifier
- 
retrainClassifieris nowupdateClassifier
recognizeText
- method is no longer supported
Similarity Search Methods
- The similary search beta is closed. The following methods are no longer available:
- createCollection
- getCollection
- listCollections
- deleteCollection
- addImage
- listImages
- getImage
- deleteImage
- setImageData
- getImageData
- deleteImageData
- findSimilar
 
classify
- parameters url,classifier_ids,owners, andthresholdare now encapsulated in a new JSON parameterparameters
detectFaces
- parameter urlis now encapsulated in a new JSON parameterparameters