You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+85-1Lines changed: 85 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,98 @@ _Note: If migrating from a version less than 4.0, also see the [v4 migration gui
6
6
-[Support for Node v6 and v8 dropped](#support-for-node-v6-and-v8-dropped)
7
7
8
8
## 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
+
constresponse=awaitlistWorkspaces();
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
+
9
39
### Support for Node v6 and v8 dropped
10
40
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.
11
41
12
-
### WebSocket Methods
42
+
### WebSocket methods
13
43
- All parameters are now lower camel case
14
44
- Support for the `token` parameter has been removed
15
45
- Support for the `customization_id` parameter has been removed
16
46
- Method `setAuthorizationHeaderToken` has been removed from the WebSocket Stream classes. It now exists as a shared function called `setAuthorizationHeader` in `lib/websocket-utils.ts`.
17
47
18
48
#### RecognizeStream
19
49
-`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`
0 commit comments