@aws-sdk/client-cognito-sync 3.1008.0 → 3.1010.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
|
@@ -21,8 +21,9 @@ to make API calls using credentials retrieved with <a href="http://docs.aws.amaz
|
|
|
21
21
|
make API calls via the AWS Mobile SDK. To learn more, see the <a href="http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-sync.html">Developer Guide for Android</a> and the <a href="http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-sync.html">Developer Guide for iOS</a>.</p>
|
|
22
22
|
|
|
23
23
|
## Installing
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
|
|
25
|
+
To install this package, use the CLI of your favorite package manager:
|
|
26
|
+
|
|
26
27
|
- `npm install @aws-sdk/client-cognito-sync`
|
|
27
28
|
- `yarn add @aws-sdk/client-cognito-sync`
|
|
28
29
|
- `pnpm add @aws-sdk/client-cognito-sync`
|
|
@@ -47,15 +48,15 @@ import { CognitoSyncClient, ListIdentityPoolUsageCommand } from "@aws-sdk/client
|
|
|
47
48
|
|
|
48
49
|
### Usage
|
|
49
50
|
|
|
50
|
-
To send a request
|
|
51
|
+
To send a request:
|
|
51
52
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
53
|
+
- Instantiate a client with configuration (e.g. credentials, region).
|
|
54
|
+
- See [docs/CLIENTS](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md) for configuration details.
|
|
55
|
+
- See [@aws-sdk/config](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/config/README.md) for additional options.
|
|
56
|
+
- Instantiate a command with input parameters.
|
|
57
|
+
- Call the `send` operation on the client, providing the command object as input.
|
|
56
58
|
|
|
57
59
|
```js
|
|
58
|
-
// a client can be shared by different commands.
|
|
59
60
|
const client = new CognitoSyncClient({ region: "REGION" });
|
|
60
61
|
|
|
61
62
|
const params = { /** input parameters */ };
|
|
@@ -64,7 +65,7 @@ const command = new ListIdentityPoolUsageCommand(params);
|
|
|
64
65
|
|
|
65
66
|
#### Async/await
|
|
66
67
|
|
|
67
|
-
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
68
|
+
We recommend using the [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
68
69
|
operator to wait for the promise returned by send operation as follows:
|
|
69
70
|
|
|
70
71
|
```js
|
|
@@ -79,26 +80,9 @@ try {
|
|
|
79
80
|
}
|
|
80
81
|
```
|
|
81
82
|
|
|
82
|
-
Async-await is clean, concise, intuitive, easy to debug and has better error handling
|
|
83
|
-
as compared to using Promise chains or callbacks.
|
|
84
|
-
|
|
85
83
|
#### Promises
|
|
86
84
|
|
|
87
|
-
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining)
|
|
88
|
-
to execute send operation.
|
|
89
|
-
|
|
90
|
-
```js
|
|
91
|
-
client.send(command).then(
|
|
92
|
-
(data) => {
|
|
93
|
-
// process data.
|
|
94
|
-
},
|
|
95
|
-
(error) => {
|
|
96
|
-
// error handling.
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Promises can also be called using `.catch()` and `.finally()` as follows:
|
|
85
|
+
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining).
|
|
102
86
|
|
|
103
87
|
```js
|
|
104
88
|
client
|
|
@@ -114,27 +98,21 @@ client
|
|
|
114
98
|
});
|
|
115
99
|
```
|
|
116
100
|
|
|
117
|
-
####
|
|
118
|
-
|
|
119
|
-
We do not recommend using callbacks because of [callback hell](http://callbackhell.com/),
|
|
120
|
-
but they are supported by the send operation.
|
|
101
|
+
#### Aggregated client
|
|
121
102
|
|
|
122
|
-
|
|
123
|
-
// callbacks.
|
|
124
|
-
client.send(command, (err, data) => {
|
|
125
|
-
// process err and data.
|
|
126
|
-
});
|
|
127
|
-
```
|
|
103
|
+
The aggregated client class is exported from the same package, but without the "Client" suffix.
|
|
128
104
|
|
|
129
|
-
|
|
105
|
+
`CognitoSync` extends `CognitoSyncClient` and additionally supports all operations, waiters, and paginators as methods.
|
|
106
|
+
This style may be familiar to you from the AWS SDK for JavaScript v2.
|
|
130
107
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
108
|
+
If you are bundling the AWS SDK, we recommend using only the bare-bones client (`CognitoSyncClient`).
|
|
109
|
+
More details are in the blog post on
|
|
110
|
+
[modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/).
|
|
134
111
|
|
|
135
112
|
```ts
|
|
136
|
-
import
|
|
137
|
-
|
|
113
|
+
import { CognitoSync } from "@aws-sdk/client-cognito-sync";
|
|
114
|
+
|
|
115
|
+
const client = new CognitoSync({ region: "REGION" });
|
|
138
116
|
|
|
139
117
|
// async/await.
|
|
140
118
|
try {
|
|
@@ -154,7 +132,7 @@ client
|
|
|
154
132
|
// error handling.
|
|
155
133
|
});
|
|
156
134
|
|
|
157
|
-
// callbacks.
|
|
135
|
+
// callbacks (not recommended).
|
|
158
136
|
client.listIdentityPoolUsage(params, (err, data) => {
|
|
159
137
|
// process err and data.
|
|
160
138
|
});
|
|
@@ -182,12 +160,14 @@ try {
|
|
|
182
160
|
}
|
|
183
161
|
```
|
|
184
162
|
|
|
163
|
+
See also [docs/ERROR_HANDLING](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/ERROR_HANDLING.md).
|
|
164
|
+
|
|
185
165
|
## Getting Help
|
|
186
166
|
|
|
187
167
|
Please use these community resources for getting help.
|
|
188
|
-
We use
|
|
168
|
+
We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
|
|
189
169
|
|
|
190
|
-
- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
170
|
+
- Visit the [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
191
171
|
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html).
|
|
192
172
|
- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/)
|
|
193
173
|
on AWS Developer Blog.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-cognito-sync",
|
|
3
3
|
"description": "AWS SDK for JavaScript Cognito Sync Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1010.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-cognito-sync",
|
|
@@ -25,41 +25,41 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
27
27
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
28
|
-
"@aws-sdk/core": "^3.973.
|
|
29
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
30
|
-
"@aws-sdk/middleware-host-header": "^3.972.
|
|
31
|
-
"@aws-sdk/middleware-logger": "^3.972.
|
|
32
|
-
"@aws-sdk/middleware-recursion-detection": "^3.972.
|
|
33
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
34
|
-
"@aws-sdk/region-config-resolver": "^3.972.
|
|
35
|
-
"@aws-sdk/types": "^3.973.
|
|
36
|
-
"@aws-sdk/util-endpoints": "^3.996.
|
|
37
|
-
"@aws-sdk/util-user-agent-browser": "^3.972.
|
|
38
|
-
"@aws-sdk/util-user-agent-node": "^3.973.
|
|
39
|
-
"@smithy/config-resolver": "^4.4.
|
|
40
|
-
"@smithy/core": "^3.23.
|
|
41
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
42
|
-
"@smithy/hash-node": "^4.2.
|
|
43
|
-
"@smithy/invalid-dependency": "^4.2.
|
|
44
|
-
"@smithy/middleware-content-length": "^4.2.
|
|
45
|
-
"@smithy/middleware-endpoint": "^4.4.
|
|
46
|
-
"@smithy/middleware-retry": "^4.4.
|
|
47
|
-
"@smithy/middleware-serde": "^4.2.
|
|
48
|
-
"@smithy/middleware-stack": "^4.2.
|
|
49
|
-
"@smithy/node-config-provider": "^4.3.
|
|
50
|
-
"@smithy/node-http-handler": "^4.4.
|
|
51
|
-
"@smithy/protocol-http": "^5.3.
|
|
52
|
-
"@smithy/smithy-client": "^4.12.
|
|
53
|
-
"@smithy/types": "^4.13.
|
|
54
|
-
"@smithy/url-parser": "^4.2.
|
|
28
|
+
"@aws-sdk/core": "^3.973.20",
|
|
29
|
+
"@aws-sdk/credential-provider-node": "^3.972.21",
|
|
30
|
+
"@aws-sdk/middleware-host-header": "^3.972.8",
|
|
31
|
+
"@aws-sdk/middleware-logger": "^3.972.8",
|
|
32
|
+
"@aws-sdk/middleware-recursion-detection": "^3.972.8",
|
|
33
|
+
"@aws-sdk/middleware-user-agent": "^3.972.21",
|
|
34
|
+
"@aws-sdk/region-config-resolver": "^3.972.8",
|
|
35
|
+
"@aws-sdk/types": "^3.973.6",
|
|
36
|
+
"@aws-sdk/util-endpoints": "^3.996.5",
|
|
37
|
+
"@aws-sdk/util-user-agent-browser": "^3.972.8",
|
|
38
|
+
"@aws-sdk/util-user-agent-node": "^3.973.7",
|
|
39
|
+
"@smithy/config-resolver": "^4.4.11",
|
|
40
|
+
"@smithy/core": "^3.23.11",
|
|
41
|
+
"@smithy/fetch-http-handler": "^5.3.15",
|
|
42
|
+
"@smithy/hash-node": "^4.2.12",
|
|
43
|
+
"@smithy/invalid-dependency": "^4.2.12",
|
|
44
|
+
"@smithy/middleware-content-length": "^4.2.12",
|
|
45
|
+
"@smithy/middleware-endpoint": "^4.4.25",
|
|
46
|
+
"@smithy/middleware-retry": "^4.4.42",
|
|
47
|
+
"@smithy/middleware-serde": "^4.2.14",
|
|
48
|
+
"@smithy/middleware-stack": "^4.2.12",
|
|
49
|
+
"@smithy/node-config-provider": "^4.3.12",
|
|
50
|
+
"@smithy/node-http-handler": "^4.4.16",
|
|
51
|
+
"@smithy/protocol-http": "^5.3.12",
|
|
52
|
+
"@smithy/smithy-client": "^4.12.5",
|
|
53
|
+
"@smithy/types": "^4.13.1",
|
|
54
|
+
"@smithy/url-parser": "^4.2.12",
|
|
55
55
|
"@smithy/util-base64": "^4.3.2",
|
|
56
56
|
"@smithy/util-body-length-browser": "^4.2.2",
|
|
57
57
|
"@smithy/util-body-length-node": "^4.2.3",
|
|
58
|
-
"@smithy/util-defaults-mode-browser": "^4.3.
|
|
59
|
-
"@smithy/util-defaults-mode-node": "^4.2.
|
|
60
|
-
"@smithy/util-endpoints": "^3.3.
|
|
61
|
-
"@smithy/util-middleware": "^4.2.
|
|
62
|
-
"@smithy/util-retry": "^4.2.
|
|
58
|
+
"@smithy/util-defaults-mode-browser": "^4.3.41",
|
|
59
|
+
"@smithy/util-defaults-mode-node": "^4.2.44",
|
|
60
|
+
"@smithy/util-endpoints": "^3.3.3",
|
|
61
|
+
"@smithy/util-middleware": "^4.2.12",
|
|
62
|
+
"@smithy/util-retry": "^4.2.12",
|
|
63
63
|
"@smithy/util-utf8": "^4.2.2",
|
|
64
64
|
"tslib": "^2.6.2"
|
|
65
65
|
},
|