Skip to content

Commit 5074a52

Browse files
authored
feat: add support for new authenticators in all sdks and add new service features for major release (#946)
BREAKING CHANGE: Passing individual credentials to the service constructor will no longer work. An Authenticator must be initialized and passed in. For more information, see the migration guide.
1 parent 3fa522c commit 5074a52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+11617
-9592
lines changed

UPGRADE-5.0.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,98 @@ _Note: If migrating from a version less than 4.0, also see the [v4 migration gui
66
- [Support for Node v6 and v8 dropped](#support-for-node-v6-and-v8-dropped)
77

88
## Breaking changes
9+
### Authentication mechanism redesigned - READ THIS
10+
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.
11+
12+
An `Authenticator` can either be initialized programmatically or read from the environment using the method `getAuthenticatorFromEnvironment`.
13+
14+
More details to come.
15+
16+
### All parameter names changed to lower camel case - READ THIS
17+
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".
18+
19+
### Detailed response is always returned
20+
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.
21+
22+
#### Promises
23+
The detailed response is always returned. The `return_response` parameter is removed.
24+
```js
25+
const response = await listWorkspaces();
26+
console.log(response.result); // prints the body
27+
console.log(response.headers); // prints the headers
28+
```
29+
30+
#### Callbacks
31+
The detailed response is sent in the second argument position, after the error. There is no third argument position.
32+
```js
33+
listWorkspaces((err, res) => {
34+
console.log(res.result); // prints the body
35+
console.log(res.headers); // prints the headers
36+
});
37+
```
38+
939
### Support for Node v6 and v8 dropped
1040
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.
1141

12-
### WebSocket Methods
42+
### WebSocket methods
1343
- All parameters are now lower camel case
1444
- Support for the `token` parameter has been removed
1545
- Support for the `customization_id` parameter has been removed
1646
- Method `setAuthorizationHeaderToken` has been removed from the WebSocket Stream classes. It now exists as a shared function called `setAuthorizationHeader` in `lib/websocket-utils.ts`.
1747

1848
#### RecognizeStream
1949
- `RecognizeStream.readableObjectMode` will always be a Boolean value - before, it could have been `undefined`. This is to align with the new convention in Node 12.
50+
51+
### Breaking changes by service
52+
#### Assistant v1
53+
- Parameter `include_count` removed from method `listEntities`
54+
- Parameter `include_count` removed from method `listValues`
55+
- Parameter `include_count` removed from method `listSynonyms`
56+
- Parameter `include_count` removed from method `listDialogNodes`
57+
- Parameter `value_type` renamed to `type` in method `createValue`
58+
- Parameter `new_value_type` renamed to `newType` in method `updateValue`
59+
- Parameter `node_type` renamed to `type` in method `createDialogNode`
60+
- Parameter `new_node_type` renamed to `newType`in method `updateDialogNode`
61+
- Interface `DialogRuntimeResponseGeneric` removed
62+
- Interface `DialogSuggestions` removed
63+
- Additional properties no longer supported for interface `LogMessage`
64+
- Additional properties no longer supported for interface `RuntimeEntity`
65+
- Additional properties no longer supported for interface `RuntimeIntent`
66+
- Property `value_type` renamed to `type` in interface `Value`
67+
68+
#### Assistant v2
69+
- Property `action_type` renamed to `type` in interface `DialogNodeAction`
70+
- Interface `DialogRuntimeResponseGeneric` removed
71+
72+
#### Compare Comply
73+
- Parameter `filename` removed from method `convertToHtml`
74+
75+
#### Discovery
76+
- Parameter `return_fields` renamed to `_return` in method `query`
77+
- Parameter `logging_opt_out` renamed to `xWatsonLoggingOptOut` in method `query`
78+
- Parameter `return_fields` renamed to `_return` in method `federatedQuery`
79+
- Parameter `logging_opt_out` renamed to `xWatsonLoggingOptOut` in method `federatedQuery`
80+
- Parameter `return_fields` renamed to `_return` in method `queryNotices`
81+
- Parameter `return_fields` renamed to `_return` in method `federatedQueryNotices`
82+
- Property `field_name` renamed to `field` in interface `Field`
83+
- Property `field_type` renamed to `type` in interface `Field`
84+
85+
#### Language Translator
86+
- Parameter `default_models` renamed to `_default` in method `listModels`
87+
- Property `translation_output` renamed to `translation` in interface `Translation`
88+
89+
#### Natural Language Classifier
90+
- Parameter `metadata` renamed to `trainingMetadata` in method `createClassifier`
91+
92+
#### Text to Speech
93+
- The following voices are removed:
94+
- `DE_DE_BIRGITV2VOICE`
95+
- `DE_DE_DIETERV2VOICE`
96+
- `EN_US_ALLISONV2VOICE`
97+
- `EN_US_LISAV2VOICE`
98+
- `EN_US_MICHAELV2VOICE`
99+
- `IT_IT_FRANCESCAV2VOICE`
100+
101+
#### Visual Recognition
102+
- Property `class_name` renamed to `_class` in interface `ClassResult`
103+

0 commit comments

Comments
 (0)