-
Notifications
You must be signed in to change notification settings - Fork 669
v5 Migration Guide
Note: If migrating from a version less than 4.0, also see the v4 migration guide wiki.
The SDK service constructors now accept Authenticator
objects that are used to authenticate requests. The constructors no longer accept individual credentials like username
and password
. Rather, an Authenticator
must be instantiated and passed to the constructor.
An Authenticator
can either be initialized programmatically or read from the environment using the method getAuthenticatorFromEnvironment
.
More details to come.
To maintain a consistent style for the SDK, parameter names will now be formatted with the case convention "lowerCamelCase". For example, the parameter workspace_id
is now workspaceId
. This applies to all top-level parameters passed in to any method or constructor. This does not apply to sub-properties of models, which will still use "lower_snake_case".
The "detailed response" (the full response, including headers and status code) is now always returned. Before we would preferentially return the body. The body is available under the key result
. The key data
is no longer used. This applies to both Promises and Callbacks.
The detailed response is always returned. The return_response
parameter is removed.
const response = await listWorkspaces();
console.log(response.result); // prints the body
console.log(response.headers); // prints the headers
The detailed response is sent in the second argument position, after the error. There is no third argument position.
listWorkspaces((err, res) => {
console.log(res.result); // prints the body
console.log(res.headers); // prints the headers
});
The SDK no longer supports Node versions 6 and 8, as reflected in the engines
property in the package.json file. Version 6 reached end of life in April 2019 and Version 8 reaches end of life on 31 December 2019.
- All parameters are now lower camel case
- Support for the
token
parameter has been removed - Support for the
customization_id
parameter has been removed - Method
setAuthorizationHeaderToken
has been removed from the WebSocket Stream classes. It now exists as a shared function calledsetAuthorizationHeader
inlib/websocket-utils.ts
.
-
RecognizeStream.readableObjectMode
will always be a Boolean value - before, it could have beenundefined
. This is to align with the new convention in Node 12.
The variable name for the stored, URL parameter has been changed from url
to serviceUrl
. Note that url
can still be compatibility passed into the constructor as an alias for serviceUrl
. However, if you try to access the url
property directly in your code, this is a breaking change.
The order of priority has changed to give a file in the current working directory higher priority than one in the home directory. This will only impact your code if you have different files in each location.
- Parameter
include_count
removed from methodlistEntities
- Parameter
include_count
removed from methodlistValues
- Parameter
include_count
removed from methodlistSynonyms
- Parameter
include_count
removed from methodlistDialogNodes
- Parameter
include_count
removed from methodlistWorkspaces
- Parameter
include_count
removed from methodlistIntents
- Parameter
include_count
removed from methodlistExamples
- Parameter
include_count
removed from methodlistCounterexamples
- Parameter
value_type
renamed totype
in methodcreateValue
- Parameter
new_value_type
renamed tonewType
in methodupdateValue
- Parameter
node_type
renamed totype
in methodcreateDialogNode
- Parameter
new_node_type
renamed tonewType
in methodupdateDialogNode
- Interface
DialogRuntimeResponseGeneric
renamed toRuntimeResponseGeneric
- Interface
DialogSuggestions
removed - Additional properties no longer supported for interface
LogMessage
- Additional properties no longer supported for interface
RuntimeEntity
- Additional properties no longer supported for interface
RuntimeIntent
- Property
value_type
renamed totype
in interfaceValue
- Property
value_type
renamed totype
in interfaceCreateValue
- Property
node_type
renamed totype
in interfaceDialogNode
- Property
action_type
renamed totype
in interfaceDialogNodeAction
- Property
output
changed type fromJsonObject
toDialogSuggestionOutput
in interfaceDialogSuggestion
- Property
action_type
renamed totype
in interfaceDialogNodeAction
- Interface
DialogRuntimeResponseGeneric
renamed toRuntimeResponseGeneric
- Parameter
filename
removed from methodconvertToHtml
- Parameter
collectionIds
removed from methodquery
- Parameter
return_fields
renamed to_return
in methodquery
- Parameter
logging_opt_out
renamed toxWatsonLoggingOptOut
in methodquery
- Parameter
return_fields
renamed to_return
in methodfederatedQuery
- Parameter
logging_opt_out
renamed toxWatsonLoggingOptOut
in methodfederatedQuery
- Parameter
return_fields
renamed to_return
in methodqueryNotices
- Parameter
return_fields
renamed to_return
in methodfederatedQueryNotices
- Property
field_name
renamed tofield
in interfaceField
- Property
field_type
renamed totype
in interfaceField
- Property
enrichment_name
renamed toenrichment
in interfaceEnrichment
- Method
queryEntities()
removed - Method
queryRelations()
removed - Method
testConfigurationInEnvironment()
removed
- Parameter
default_models
renamed to_default
in methodlistModels
- Property
translation_output
renamed totranslation
in interfaceTranslation
- Parameter
metadata
renamed totrainingMetadata
in methodcreateClassifier
- Property
final_results
renamed tofinal
in interfaceSpeakerLabelsResult
- Property
final_results
renamed tofinal
in interfaceSpeechRecognitionResult
- The following voices are removed:
DE_DE_BIRGITV2VOICE
DE_DE_DIETERV2VOICE
EN_US_ALLISONV2VOICE
EN_US_LISAV2VOICE
EN_US_MICHAELV2VOICE
IT_IT_FRANCESCAV2VOICE
- Property
class_name
renamed to_class
in interfaceClassResult
- Method
detectFaces()
removed