@aws-sdk/client-comprehend 3.1007.0 → 3.1009.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -46
- package/package.json +33 -33
package/README.md
CHANGED
|
@@ -12,8 +12,9 @@ discuss, the predominant sentiment expressed in them, the predominant language u
|
|
|
12
12
|
more.</p>
|
|
13
13
|
|
|
14
14
|
## Installing
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
To install this package, use the CLI of your favorite package manager:
|
|
17
|
+
|
|
17
18
|
- `npm install @aws-sdk/client-comprehend`
|
|
18
19
|
- `yarn add @aws-sdk/client-comprehend`
|
|
19
20
|
- `pnpm add @aws-sdk/client-comprehend`
|
|
@@ -38,15 +39,15 @@ import { ComprehendClient, ListDatasetsCommand } from "@aws-sdk/client-comprehen
|
|
|
38
39
|
|
|
39
40
|
### Usage
|
|
40
41
|
|
|
41
|
-
To send a request
|
|
42
|
+
To send a request:
|
|
42
43
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
44
|
+
- Instantiate a client with configuration (e.g. credentials, region).
|
|
45
|
+
- See [docs/CLIENTS](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md) for configuration details.
|
|
46
|
+
- See [@aws-sdk/config](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/config/README.md) for additional options.
|
|
47
|
+
- Instantiate a command with input parameters.
|
|
48
|
+
- Call the `send` operation on the client, providing the command object as input.
|
|
47
49
|
|
|
48
50
|
```js
|
|
49
|
-
// a client can be shared by different commands.
|
|
50
51
|
const client = new ComprehendClient({ region: "REGION" });
|
|
51
52
|
|
|
52
53
|
const params = { /** input parameters */ };
|
|
@@ -55,7 +56,7 @@ const command = new ListDatasetsCommand(params);
|
|
|
55
56
|
|
|
56
57
|
#### Async/await
|
|
57
58
|
|
|
58
|
-
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
59
|
+
We recommend using the [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
59
60
|
operator to wait for the promise returned by send operation as follows:
|
|
60
61
|
|
|
61
62
|
```js
|
|
@@ -70,26 +71,9 @@ try {
|
|
|
70
71
|
}
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
Async-await is clean, concise, intuitive, easy to debug and has better error handling
|
|
74
|
-
as compared to using Promise chains or callbacks.
|
|
75
|
-
|
|
76
74
|
#### Promises
|
|
77
75
|
|
|
78
|
-
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining)
|
|
79
|
-
to execute send operation.
|
|
80
|
-
|
|
81
|
-
```js
|
|
82
|
-
client.send(command).then(
|
|
83
|
-
(data) => {
|
|
84
|
-
// process data.
|
|
85
|
-
},
|
|
86
|
-
(error) => {
|
|
87
|
-
// error handling.
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Promises can also be called using `.catch()` and `.finally()` as follows:
|
|
76
|
+
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining).
|
|
93
77
|
|
|
94
78
|
```js
|
|
95
79
|
client
|
|
@@ -105,27 +89,21 @@ client
|
|
|
105
89
|
});
|
|
106
90
|
```
|
|
107
91
|
|
|
108
|
-
####
|
|
109
|
-
|
|
110
|
-
We do not recommend using callbacks because of [callback hell](http://callbackhell.com/),
|
|
111
|
-
but they are supported by the send operation.
|
|
92
|
+
#### Aggregated client
|
|
112
93
|
|
|
113
|
-
|
|
114
|
-
// callbacks.
|
|
115
|
-
client.send(command, (err, data) => {
|
|
116
|
-
// process err and data.
|
|
117
|
-
});
|
|
118
|
-
```
|
|
94
|
+
The aggregated client class is exported from the same package, but without the "Client" suffix.
|
|
119
95
|
|
|
120
|
-
|
|
96
|
+
`Comprehend` extends `ComprehendClient` and additionally supports all operations, waiters, and paginators as methods.
|
|
97
|
+
This style may be familiar to you from the AWS SDK for JavaScript v2.
|
|
121
98
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
99
|
+
If you are bundling the AWS SDK, we recommend using only the bare-bones client (`ComprehendClient`).
|
|
100
|
+
More details are in the blog post on
|
|
101
|
+
[modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/).
|
|
125
102
|
|
|
126
103
|
```ts
|
|
127
|
-
import
|
|
128
|
-
|
|
104
|
+
import { Comprehend } from "@aws-sdk/client-comprehend";
|
|
105
|
+
|
|
106
|
+
const client = new Comprehend({ region: "REGION" });
|
|
129
107
|
|
|
130
108
|
// async/await.
|
|
131
109
|
try {
|
|
@@ -145,7 +123,7 @@ client
|
|
|
145
123
|
// error handling.
|
|
146
124
|
});
|
|
147
125
|
|
|
148
|
-
// callbacks.
|
|
126
|
+
// callbacks (not recommended).
|
|
149
127
|
client.listDatasets(params, (err, data) => {
|
|
150
128
|
// process err and data.
|
|
151
129
|
});
|
|
@@ -173,12 +151,14 @@ try {
|
|
|
173
151
|
}
|
|
174
152
|
```
|
|
175
153
|
|
|
154
|
+
See also [docs/ERROR_HANDLING](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/ERROR_HANDLING.md).
|
|
155
|
+
|
|
176
156
|
## Getting Help
|
|
177
157
|
|
|
178
158
|
Please use these community resources for getting help.
|
|
179
|
-
We use
|
|
159
|
+
We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
|
|
180
160
|
|
|
181
|
-
- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
161
|
+
- Visit the [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
182
162
|
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html).
|
|
183
163
|
- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/)
|
|
184
164
|
on AWS Developer Blog.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-comprehend",
|
|
3
3
|
"description": "AWS SDK for JavaScript Comprehend Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1009.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-comprehend",
|
|
@@ -21,41 +21,41 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
24
|
-
"@aws-sdk/core": "^3.973.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
26
|
-
"@aws-sdk/middleware-host-header": "^3.972.
|
|
27
|
-
"@aws-sdk/middleware-logger": "^3.972.
|
|
28
|
-
"@aws-sdk/middleware-recursion-detection": "^3.972.
|
|
29
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
30
|
-
"@aws-sdk/region-config-resolver": "^3.972.
|
|
31
|
-
"@aws-sdk/types": "^3.973.
|
|
32
|
-
"@aws-sdk/util-endpoints": "^3.996.
|
|
33
|
-
"@aws-sdk/util-user-agent-browser": "^3.972.
|
|
34
|
-
"@aws-sdk/util-user-agent-node": "^3.973.
|
|
35
|
-
"@smithy/config-resolver": "^4.4.
|
|
36
|
-
"@smithy/core": "^3.23.
|
|
37
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
38
|
-
"@smithy/hash-node": "^4.2.
|
|
39
|
-
"@smithy/invalid-dependency": "^4.2.
|
|
40
|
-
"@smithy/middleware-content-length": "^4.2.
|
|
41
|
-
"@smithy/middleware-endpoint": "^4.4.
|
|
42
|
-
"@smithy/middleware-retry": "^4.4.
|
|
43
|
-
"@smithy/middleware-serde": "^4.2.
|
|
44
|
-
"@smithy/middleware-stack": "^4.2.
|
|
45
|
-
"@smithy/node-config-provider": "^4.3.
|
|
46
|
-
"@smithy/node-http-handler": "^4.4.
|
|
47
|
-
"@smithy/protocol-http": "^5.3.
|
|
48
|
-
"@smithy/smithy-client": "^4.12.
|
|
49
|
-
"@smithy/types": "^4.13.
|
|
50
|
-
"@smithy/url-parser": "^4.2.
|
|
24
|
+
"@aws-sdk/core": "^3.973.20",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "^3.972.21",
|
|
26
|
+
"@aws-sdk/middleware-host-header": "^3.972.8",
|
|
27
|
+
"@aws-sdk/middleware-logger": "^3.972.8",
|
|
28
|
+
"@aws-sdk/middleware-recursion-detection": "^3.972.8",
|
|
29
|
+
"@aws-sdk/middleware-user-agent": "^3.972.21",
|
|
30
|
+
"@aws-sdk/region-config-resolver": "^3.972.8",
|
|
31
|
+
"@aws-sdk/types": "^3.973.6",
|
|
32
|
+
"@aws-sdk/util-endpoints": "^3.996.5",
|
|
33
|
+
"@aws-sdk/util-user-agent-browser": "^3.972.8",
|
|
34
|
+
"@aws-sdk/util-user-agent-node": "^3.973.7",
|
|
35
|
+
"@smithy/config-resolver": "^4.4.11",
|
|
36
|
+
"@smithy/core": "^3.23.11",
|
|
37
|
+
"@smithy/fetch-http-handler": "^5.3.15",
|
|
38
|
+
"@smithy/hash-node": "^4.2.12",
|
|
39
|
+
"@smithy/invalid-dependency": "^4.2.12",
|
|
40
|
+
"@smithy/middleware-content-length": "^4.2.12",
|
|
41
|
+
"@smithy/middleware-endpoint": "^4.4.25",
|
|
42
|
+
"@smithy/middleware-retry": "^4.4.42",
|
|
43
|
+
"@smithy/middleware-serde": "^4.2.14",
|
|
44
|
+
"@smithy/middleware-stack": "^4.2.12",
|
|
45
|
+
"@smithy/node-config-provider": "^4.3.12",
|
|
46
|
+
"@smithy/node-http-handler": "^4.4.16",
|
|
47
|
+
"@smithy/protocol-http": "^5.3.12",
|
|
48
|
+
"@smithy/smithy-client": "^4.12.5",
|
|
49
|
+
"@smithy/types": "^4.13.1",
|
|
50
|
+
"@smithy/url-parser": "^4.2.12",
|
|
51
51
|
"@smithy/util-base64": "^4.3.2",
|
|
52
52
|
"@smithy/util-body-length-browser": "^4.2.2",
|
|
53
53
|
"@smithy/util-body-length-node": "^4.2.3",
|
|
54
|
-
"@smithy/util-defaults-mode-browser": "^4.3.
|
|
55
|
-
"@smithy/util-defaults-mode-node": "^4.2.
|
|
56
|
-
"@smithy/util-endpoints": "^3.3.
|
|
57
|
-
"@smithy/util-middleware": "^4.2.
|
|
58
|
-
"@smithy/util-retry": "^4.2.
|
|
54
|
+
"@smithy/util-defaults-mode-browser": "^4.3.41",
|
|
55
|
+
"@smithy/util-defaults-mode-node": "^4.2.44",
|
|
56
|
+
"@smithy/util-endpoints": "^3.3.3",
|
|
57
|
+
"@smithy/util-middleware": "^4.2.12",
|
|
58
|
+
"@smithy/util-retry": "^4.2.12",
|
|
59
59
|
"@smithy/util-utf8": "^4.2.2",
|
|
60
60
|
"tslib": "^2.6.2"
|
|
61
61
|
},
|