@aws-sdk/client-sqs 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 +65 -46
- package/package.json +36 -36
package/README.md
CHANGED
|
@@ -79,8 +79,9 @@ Endpoints</a>
|
|
|
79
79
|
</ul>
|
|
80
80
|
|
|
81
81
|
## Installing
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
|
|
83
|
+
To install this package, use the CLI of your favorite package manager:
|
|
84
|
+
|
|
84
85
|
- `npm install @aws-sdk/client-sqs`
|
|
85
86
|
- `yarn add @aws-sdk/client-sqs`
|
|
86
87
|
- `pnpm add @aws-sdk/client-sqs`
|
|
@@ -105,24 +106,63 @@ import { SQSClient, ListQueuesCommand } from "@aws-sdk/client-sqs";
|
|
|
105
106
|
|
|
106
107
|
### Usage
|
|
107
108
|
|
|
108
|
-
To send a request
|
|
109
|
+
To send a request:
|
|
109
110
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
111
|
+
- Instantiate a client with configuration (e.g. credentials, region).
|
|
112
|
+
- See [docs/CLIENTS](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md) for configuration details.
|
|
113
|
+
- See [@aws-sdk/config](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/config/README.md) for additional options.
|
|
114
|
+
- Instantiate a command with input parameters.
|
|
115
|
+
- Call the `send` operation on the client, providing the command object as input.
|
|
114
116
|
|
|
115
117
|
```js
|
|
116
|
-
// a client can be shared by different commands.
|
|
117
118
|
const client = new SQSClient({ region: "REGION" });
|
|
118
119
|
|
|
119
120
|
const params = { /** input parameters */ };
|
|
120
121
|
const command = new ListQueuesCommand(params);
|
|
121
122
|
```
|
|
122
123
|
|
|
124
|
+
#### Supported Message Protocols
|
|
125
|
+
|
|
126
|
+
This client supports multiple protocols.
|
|
127
|
+
|
|
128
|
+
The default for this client is **AWS JSON (RPC) 1.0**.
|
|
129
|
+
|
|
130
|
+
We have selected this default based on our evaluation of the
|
|
131
|
+
performance characteristics of this protocol format in JavaScript. You don't need to change it,
|
|
132
|
+
but you have the option to do so, for example to support existing integrations or tests.
|
|
133
|
+
Selecting a non-default protocol changes the format
|
|
134
|
+
of the data sent over the network, but does not affect how you interact with the
|
|
135
|
+
client using JavaScript objects.
|
|
136
|
+
|
|
137
|
+
Install the `@aws-sdk/config` package to access alternate protocols.
|
|
138
|
+
|
|
139
|
+
See [AWS Protocols](https://smithy.io/2.0/aws/protocols/index.html) for more information.
|
|
140
|
+
|
|
141
|
+
##### AWS JSON (RPC) 1.0
|
|
142
|
+
|
|
143
|
+
This protocol uses JSON payloads.
|
|
144
|
+
```js
|
|
145
|
+
import { AwsJson1_0Protocol } from "@aws-sdk/config/protocol";
|
|
146
|
+
|
|
147
|
+
const client = new SQSClient({
|
|
148
|
+
protocol: AwsJson1_0Protocol
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
##### AWS Query
|
|
153
|
+
|
|
154
|
+
This protocol uses query format requests and XML responses.
|
|
155
|
+
```js
|
|
156
|
+
import { AwsQueryProtocol } from "@aws-sdk/config/protocol";
|
|
157
|
+
|
|
158
|
+
const client = new SQSClient({
|
|
159
|
+
protocol: AwsQueryProtocol
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
123
163
|
#### Async/await
|
|
124
164
|
|
|
125
|
-
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
165
|
+
We recommend using the [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
126
166
|
operator to wait for the promise returned by send operation as follows:
|
|
127
167
|
|
|
128
168
|
```js
|
|
@@ -137,26 +177,9 @@ try {
|
|
|
137
177
|
}
|
|
138
178
|
```
|
|
139
179
|
|
|
140
|
-
Async-await is clean, concise, intuitive, easy to debug and has better error handling
|
|
141
|
-
as compared to using Promise chains or callbacks.
|
|
142
|
-
|
|
143
180
|
#### Promises
|
|
144
181
|
|
|
145
|
-
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining)
|
|
146
|
-
to execute send operation.
|
|
147
|
-
|
|
148
|
-
```js
|
|
149
|
-
client.send(command).then(
|
|
150
|
-
(data) => {
|
|
151
|
-
// process data.
|
|
152
|
-
},
|
|
153
|
-
(error) => {
|
|
154
|
-
// error handling.
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Promises can also be called using `.catch()` and `.finally()` as follows:
|
|
182
|
+
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining).
|
|
160
183
|
|
|
161
184
|
```js
|
|
162
185
|
client
|
|
@@ -172,27 +195,21 @@ client
|
|
|
172
195
|
});
|
|
173
196
|
```
|
|
174
197
|
|
|
175
|
-
####
|
|
176
|
-
|
|
177
|
-
We do not recommend using callbacks because of [callback hell](http://callbackhell.com/),
|
|
178
|
-
but they are supported by the send operation.
|
|
198
|
+
#### Aggregated client
|
|
179
199
|
|
|
180
|
-
|
|
181
|
-
// callbacks.
|
|
182
|
-
client.send(command, (err, data) => {
|
|
183
|
-
// process err and data.
|
|
184
|
-
});
|
|
185
|
-
```
|
|
200
|
+
The aggregated client class is exported from the same package, but without the "Client" suffix.
|
|
186
201
|
|
|
187
|
-
|
|
202
|
+
`SQS` extends `SQSClient` and additionally supports all operations, waiters, and paginators as methods.
|
|
203
|
+
This style may be familiar to you from the AWS SDK for JavaScript v2.
|
|
188
204
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
205
|
+
If you are bundling the AWS SDK, we recommend using only the bare-bones client (`SQSClient`).
|
|
206
|
+
More details are in the blog post on
|
|
207
|
+
[modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/).
|
|
192
208
|
|
|
193
209
|
```ts
|
|
194
|
-
import
|
|
195
|
-
|
|
210
|
+
import { SQS } from "@aws-sdk/client-sqs";
|
|
211
|
+
|
|
212
|
+
const client = new SQS({ region: "REGION" });
|
|
196
213
|
|
|
197
214
|
// async/await.
|
|
198
215
|
try {
|
|
@@ -212,7 +229,7 @@ client
|
|
|
212
229
|
// error handling.
|
|
213
230
|
});
|
|
214
231
|
|
|
215
|
-
// callbacks.
|
|
232
|
+
// callbacks (not recommended).
|
|
216
233
|
client.listQueues(params, (err, data) => {
|
|
217
234
|
// process err and data.
|
|
218
235
|
});
|
|
@@ -240,12 +257,14 @@ try {
|
|
|
240
257
|
}
|
|
241
258
|
```
|
|
242
259
|
|
|
260
|
+
See also [docs/ERROR_HANDLING](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/ERROR_HANDLING.md).
|
|
261
|
+
|
|
243
262
|
## Getting Help
|
|
244
263
|
|
|
245
264
|
Please use these community resources for getting help.
|
|
246
|
-
We use
|
|
265
|
+
We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
|
|
247
266
|
|
|
248
|
-
- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
267
|
+
- Visit the [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
249
268
|
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html).
|
|
250
269
|
- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/)
|
|
251
270
|
on AWS Developer Blog.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-sqs",
|
|
3
3
|
"description": "AWS SDK for JavaScript Sqs 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-sqs",
|
|
@@ -29,48 +29,48 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
31
31
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
32
|
-
"@aws-sdk/core": "^3.973.
|
|
33
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
34
|
-
"@aws-sdk/middleware-host-header": "^3.972.
|
|
35
|
-
"@aws-sdk/middleware-logger": "^3.972.
|
|
36
|
-
"@aws-sdk/middleware-recursion-detection": "^3.972.
|
|
37
|
-
"@aws-sdk/middleware-sdk-sqs": "^3.972.
|
|
38
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
39
|
-
"@aws-sdk/region-config-resolver": "^3.972.
|
|
40
|
-
"@aws-sdk/types": "^3.973.
|
|
41
|
-
"@aws-sdk/util-endpoints": "^3.996.
|
|
42
|
-
"@aws-sdk/util-user-agent-browser": "^3.972.
|
|
43
|
-
"@aws-sdk/util-user-agent-node": "^3.973.
|
|
44
|
-
"@smithy/config-resolver": "^4.4.
|
|
45
|
-
"@smithy/core": "^3.23.
|
|
46
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
47
|
-
"@smithy/hash-node": "^4.2.
|
|
48
|
-
"@smithy/invalid-dependency": "^4.2.
|
|
49
|
-
"@smithy/md5-js": "^4.2.
|
|
50
|
-
"@smithy/middleware-content-length": "^4.2.
|
|
51
|
-
"@smithy/middleware-endpoint": "^4.4.
|
|
52
|
-
"@smithy/middleware-retry": "^4.4.
|
|
53
|
-
"@smithy/middleware-serde": "^4.2.
|
|
54
|
-
"@smithy/middleware-stack": "^4.2.
|
|
55
|
-
"@smithy/node-config-provider": "^4.3.
|
|
56
|
-
"@smithy/node-http-handler": "^4.4.
|
|
57
|
-
"@smithy/protocol-http": "^5.3.
|
|
58
|
-
"@smithy/smithy-client": "^4.12.
|
|
59
|
-
"@smithy/types": "^4.13.
|
|
60
|
-
"@smithy/url-parser": "^4.2.
|
|
32
|
+
"@aws-sdk/core": "^3.973.20",
|
|
33
|
+
"@aws-sdk/credential-provider-node": "^3.972.21",
|
|
34
|
+
"@aws-sdk/middleware-host-header": "^3.972.8",
|
|
35
|
+
"@aws-sdk/middleware-logger": "^3.972.8",
|
|
36
|
+
"@aws-sdk/middleware-recursion-detection": "^3.972.8",
|
|
37
|
+
"@aws-sdk/middleware-sdk-sqs": "^3.972.15",
|
|
38
|
+
"@aws-sdk/middleware-user-agent": "^3.972.21",
|
|
39
|
+
"@aws-sdk/region-config-resolver": "^3.972.8",
|
|
40
|
+
"@aws-sdk/types": "^3.973.6",
|
|
41
|
+
"@aws-sdk/util-endpoints": "^3.996.5",
|
|
42
|
+
"@aws-sdk/util-user-agent-browser": "^3.972.8",
|
|
43
|
+
"@aws-sdk/util-user-agent-node": "^3.973.7",
|
|
44
|
+
"@smithy/config-resolver": "^4.4.11",
|
|
45
|
+
"@smithy/core": "^3.23.11",
|
|
46
|
+
"@smithy/fetch-http-handler": "^5.3.15",
|
|
47
|
+
"@smithy/hash-node": "^4.2.12",
|
|
48
|
+
"@smithy/invalid-dependency": "^4.2.12",
|
|
49
|
+
"@smithy/md5-js": "^4.2.12",
|
|
50
|
+
"@smithy/middleware-content-length": "^4.2.12",
|
|
51
|
+
"@smithy/middleware-endpoint": "^4.4.25",
|
|
52
|
+
"@smithy/middleware-retry": "^4.4.42",
|
|
53
|
+
"@smithy/middleware-serde": "^4.2.14",
|
|
54
|
+
"@smithy/middleware-stack": "^4.2.12",
|
|
55
|
+
"@smithy/node-config-provider": "^4.3.12",
|
|
56
|
+
"@smithy/node-http-handler": "^4.4.16",
|
|
57
|
+
"@smithy/protocol-http": "^5.3.12",
|
|
58
|
+
"@smithy/smithy-client": "^4.12.5",
|
|
59
|
+
"@smithy/types": "^4.13.1",
|
|
60
|
+
"@smithy/url-parser": "^4.2.12",
|
|
61
61
|
"@smithy/util-base64": "^4.3.2",
|
|
62
62
|
"@smithy/util-body-length-browser": "^4.2.2",
|
|
63
63
|
"@smithy/util-body-length-node": "^4.2.3",
|
|
64
|
-
"@smithy/util-defaults-mode-browser": "^4.3.
|
|
65
|
-
"@smithy/util-defaults-mode-node": "^4.2.
|
|
66
|
-
"@smithy/util-endpoints": "^3.3.
|
|
67
|
-
"@smithy/util-middleware": "^4.2.
|
|
68
|
-
"@smithy/util-retry": "^4.2.
|
|
64
|
+
"@smithy/util-defaults-mode-browser": "^4.3.41",
|
|
65
|
+
"@smithy/util-defaults-mode-node": "^4.2.44",
|
|
66
|
+
"@smithy/util-endpoints": "^3.3.3",
|
|
67
|
+
"@smithy/util-middleware": "^4.2.12",
|
|
68
|
+
"@smithy/util-retry": "^4.2.12",
|
|
69
69
|
"@smithy/util-utf8": "^4.2.2",
|
|
70
70
|
"tslib": "^2.6.2"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@smithy/snapshot-testing": "^2.0.
|
|
73
|
+
"@smithy/snapshot-testing": "^2.0.2",
|
|
74
74
|
"@tsconfig/node20": "20.1.8",
|
|
75
75
|
"@types/node": "^20.14.8",
|
|
76
76
|
"concurrently": "7.0.0",
|