|  | 
|  | 1 | + | 
|  | 2 | + | 
|  | 3 | +_Note: If migrating from a version less than 5.0, also see the [v5 migration guide wiki](https://github.com/watson-developer-cloud/node-sdk/wiki/v5-Migration-Guide)._ | 
|  | 4 | + | 
|  | 5 | +- [Breaking Changes](#breaking-changes) | 
|  | 6 | +  - [Support for callbacks dropped](#support-for-callbacks-dropped) | 
|  | 7 | +  - [Support for Node v10 dropped](#support-for-node-v10-dropped) | 
|  | 8 | +  - [Breaking changes by service](#breaking-changes-by-service) | 
|  | 9 | + | 
|  | 10 | +- [New Features by Service](#new-features-by-service) | 
|  | 11 | + | 
|  | 12 | +## Breaking changes | 
|  | 13 | +#### Support for Callbacks Dropped | 
|  | 14 | +Support for callbacks has been dropped in favor of promises. All functions will no longer accept a callback parameter. An example of replacing a callback with a promise using `then/catch` and `async/await` syntax is shown below | 
|  | 15 | +```js | 
|  | 16 | +//Callback | 
|  | 17 | +const assistant = new AssistantV2(options); | 
|  | 18 | +assistant.message(params, (err, res) => { | 
|  | 19 | +  if(err){ | 
|  | 20 | +    console.log(err) //Print out error | 
|  | 21 | +    return | 
|  | 22 | +  } | 
|  | 23 | +  console.log(res.result) //Print out body | 
|  | 24 | +}); | 
|  | 25 | +``` | 
|  | 26 | + | 
|  | 27 | +```js | 
|  | 28 | +//Promise with then/catch | 
|  | 29 | +const assistant = new AssistantV2(options); | 
|  | 30 | + | 
|  | 31 | +assistant.message(params) | 
|  | 32 | +.then(res => { | 
|  | 33 | +  console.log(res.result) //Print out body | 
|  | 34 | +}) | 
|  | 35 | +.catch(err => { | 
|  | 36 | +  console.log(err) //Print out error | 
|  | 37 | +}) | 
|  | 38 | +``` | 
|  | 39 | + | 
|  | 40 | +```js | 
|  | 41 | +//Promise with async/await | 
|  | 42 | +//Use of the await keyword must be used within an async function | 
|  | 43 | +async myFunction() { | 
|  | 44 | +  const assistant = new AssistantV2(options); | 
|  | 45 | +  try{ | 
|  | 46 | +    const res = await assistant.message(params); | 
|  | 47 | +    console.log(res.result) //Print out body | 
|  | 48 | +  } catch(err){ | 
|  | 49 | +    console.log(err) //Print out error | 
|  | 50 | +  } | 
|  | 51 | +} | 
|  | 52 | +myFunction() | 
|  | 53 | +``` | 
|  | 54 | + | 
|  | 55 | +### Support for Node v10 Dropped | 
|  | 56 | +The SDK no longer supports Node version 10, as reflected in the `engines` property in the package.json file. Version 10 will reach end of life on 30 April 2021. | 
|  | 57 | + | 
|  | 58 | +### Breaking changes by service | 
|  | 59 | +#### Assistant v1 | 
|  | 60 | +- Parameter `context` type changed from `JsonObject` to `DialogNodeContext` in `createDialogNode()` | 
|  | 61 | +- Parameter `newContext` type changed from `JsonObject` to `DialogNodeContext` in `updateDialogNode()` | 
|  | 62 | +- Interface `Context` property `system` type changed from `SystemResponse` to `JsonObject` | 
|  | 63 | +- Interface `DialogNode` property `context` type changed from `JsonObject` to `DialogNodeContext` | 
|  | 64 | +- Interface `DialogSuggestion` property `output` type changed from `DialogSuggestionOutput` to `JsonObject` | 
|  | 65 | +- Interface `SystemResponse` removed | 
|  | 66 | +- Interface `DialogSuggestionOuput` removed | 
|  | 67 | +- Interface `DialogNodeOutputGeneric` expanded into multiple interfaces | 
|  | 68 | +- Interface `RuntimeResponseGeneric` expanded into multiple interfaces | 
|  | 69 | + | 
|  | 70 | +#### Assistant v2 | 
|  | 71 | +- Interface `MessageContext` property `skills` type changed from `MessageContextSkills` to `JsonObject` | 
|  | 72 | +- Interface `MessageContextStateless` property `skills` type changed from `MessageContextSkills` to `JsonObject` | 
|  | 73 | +- Interface `MessageInputOptions` property `_export` renamed to `export` | 
|  | 74 | +- Interface `MessageContextSkills` removed | 
|  | 75 | +- Interface `RuntimeResponseGeneric` expanded into multiple interfaces | 
|  | 76 | + | 
|  | 77 | +#### Compare Comply | 
|  | 78 | +- Parameter `before` and `after` removed in `listFeedback()` | 
|  | 79 | +- Interface `OriginalLabelsOut` property `modification` removed | 
|  | 80 | +- Interface `UpdatedLabelsOut` property `modification` removed | 
|  | 81 | +- Interface `BatchStatus` property `_function` renamed to `function` | 
|  | 82 | + | 
|  | 83 | +#### Discovery v1 | 
|  | 84 | +- Interface `NluEnrichmentCategories` removed | 
|  | 85 | +- Interface `NluEnrichmentFeatures` property `categories` type changed from `NluEnrichmentCategories` to `JsonObject` | 
|  | 86 | + | 
|  | 87 | +#### Discovery v2 | 
|  | 88 | +- Interface `DefaultQueryParams` property `_return` renamed `return` | 
|  | 89 | + | 
|  | 90 | +#### Natural Language Understanding | 
|  | 91 | +- Interface `AnalysisResults` property `metadata` type changed from `AnalysisResultsMetadata` to `FeaturesResultsMetadata` | 
|  | 92 | +- Interface `Features` property `metadata` type changed from `MetadataOptions` to `JsonObject` | 
|  | 93 | +- Interface `AnalysisResultsMetadata` removed | 
|  | 94 | +- Interface `MetadataOptions` removed | 
|  | 95 | + | 
|  | 96 | +#### Personality Insights | 
|  | 97 | +- Interface `Content` property `content_items` renamed `contentItems` | 
|  | 98 | + | 
|  | 99 | +#### Text to Speech | 
|  | 100 | +- Interface `CreateVoiceModelParams` renamed to `CreateCustomModelParams` | 
|  | 101 | +- Interface `ListVoiceModelParams` renamed to `ListCustomModelParams` | 
|  | 102 | +- Interface `GetVoiceModelParams` renamed to `GetCustomModelParams` | 
|  | 103 | +- Interface `UpdateVoiceModelParams` renamed to `UpdateCustomModelParams` | 
|  | 104 | +- Interface `DeleteVoiceModelParams` renamed to `DeleteCustomModelParams` | 
|  | 105 | +- Interface `CreateVoiceModelConstants` renamed to `CreateCustomModelConstants` | 
|  | 106 | +- Interface `ListVoiceModelConstants` renamed to `ListCustomModelConstants` | 
|  | 107 | +- Interface `VoiceModel` renamed to `CustomModel` | 
|  | 108 | +- Use of `VoiceModel[]` replaced with interface `CustomModels` | 
|  | 109 | + | 
|  | 110 | +#### Visual Recognition v3 | 
|  | 111 | +- Interface `Class` property `_class` renamed `class` | 
|  | 112 | +- Interface `ClassResult` property `_class` renamed `class` | 
|  | 113 | + | 
|  | 114 | +#### Visual Recognition v4 | 
|  | 115 | +- Interface `Collection` property `training_status` type changed from `TrainingStatus` to `CollectionTrainingStatus` | 
|  | 116 | +- Interface `ObjectDetail` property `location` type changed from `Location` to `ObjectDetailLocation` | 
|  | 117 | + | 
|  | 118 | + | 
|  | 119 | +### New Features by Service | 
|  | 120 | + | 
|  | 121 | +#### Assistant v1 | 
|  | 122 | +- `includeCount` parameter added to several methods: Whether to include information about the number of records that satisfy the request, regardless of the page limit. | 
|  | 123 | +- `bulkClassify()` method added: Identify intents and entities in multiple user utterances. | 
|  | 124 | +- Interface `DialogNodeContext` added | 
|  | 125 | +- Interface `DialogNodeOutput` property `integrations` added: Output intended for specific integrations. For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-responses-json) | 
|  | 126 | + | 
|  | 127 | +#### Assistant v2 | 
|  | 128 | +- `bulkClassify()` method added: Identify intents and entities in multiple user utterances. | 
|  | 129 | + | 
|  | 130 | +#### Compare Comply | 
|  | 131 | +- Interface `Category` property `modification` added: The type of modification of the feedback entry in the updated labels response. | 
|  | 132 | +- Interface `TypeLabel` property `modification` added: The type of modification of the feedback entry in the updated labels response. | 
|  | 133 | + | 
|  | 134 | +#### Discovery v2 | 
|  | 135 | +- `analyzeDocument()` method added: Process a document using the specified collection's settings and return it for realtime use. **Note: This method is only supported on IBM Cloud Pak for Data instances of Discovery.** | 
|  | 136 | +- Interface `QueryResponsePassage` added | 
|  | 137 | +- Interface `QueryResponse` property `passages` added: Passages returned by Discovery. | 
|  | 138 | + | 
|  | 139 | +#### Language Translator | 
|  | 140 | +- `translateDocument()` now supports these subtitle/caption formats: `text/sbv`, `text/srt`, and `text/vtt` | 
|  | 141 | + | 
|  | 142 | +#### Natural Language Understanding | 
|  | 143 | +- Interface `FeaturesResultsMetadata` added: Webpage metadata, such as the author and the title of the page. | 
|  | 144 | + | 
|  | 145 | +#### Speech to Text | 
|  | 146 | +- `recognize()` and `createJob()` now support Canadian French broadband and narrowband models | 
|  | 147 | +- `createLanguageModel()` and `createAcousticModel()` now supports Australian English broadband and narrowband models | 
|  | 148 | +- `addGrammar()` parameter `grammarFile` now supports `ReadableStream` and `Buffer` | 
|  | 149 | + | 
|  | 150 | +#### Visual Recognition v4 | 
|  | 151 | +- Interface `CollectionTrainingStatus` added: Training status information for the collection. | 
|  | 152 | +- Interface `ObjectDetailLocation` added: Defines the location of the bounding box around the object. | 
0 commit comments