@aws-sdk/client-secrets-manager 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 +34 -34
package/README.md
CHANGED
|
@@ -34,8 +34,9 @@ Amazon Web Services Secrets Manager Events with Amazon Web Services CloudTrail</
|
|
|
34
34
|
To learn more about CloudTrail, including enabling it and find your log files, see the <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html">Amazon Web Services CloudTrail User Guide</a>.</p>
|
|
35
35
|
|
|
36
36
|
## Installing
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
|
|
38
|
+
To install this package, use the CLI of your favorite package manager:
|
|
39
|
+
|
|
39
40
|
- `npm install @aws-sdk/client-secrets-manager`
|
|
40
41
|
- `yarn add @aws-sdk/client-secrets-manager`
|
|
41
42
|
- `pnpm add @aws-sdk/client-secrets-manager`
|
|
@@ -60,15 +61,15 @@ import { SecretsManagerClient, ListSecretsCommand } from "@aws-sdk/client-secret
|
|
|
60
61
|
|
|
61
62
|
### Usage
|
|
62
63
|
|
|
63
|
-
To send a request
|
|
64
|
+
To send a request:
|
|
64
65
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
66
|
+
- Instantiate a client with configuration (e.g. credentials, region).
|
|
67
|
+
- See [docs/CLIENTS](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md) for configuration details.
|
|
68
|
+
- See [@aws-sdk/config](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/config/README.md) for additional options.
|
|
69
|
+
- Instantiate a command with input parameters.
|
|
70
|
+
- Call the `send` operation on the client, providing the command object as input.
|
|
69
71
|
|
|
70
72
|
```js
|
|
71
|
-
// a client can be shared by different commands.
|
|
72
73
|
const client = new SecretsManagerClient({ region: "REGION" });
|
|
73
74
|
|
|
74
75
|
const params = { /** input parameters */ };
|
|
@@ -77,7 +78,7 @@ const command = new ListSecretsCommand(params);
|
|
|
77
78
|
|
|
78
79
|
#### Async/await
|
|
79
80
|
|
|
80
|
-
We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
81
|
+
We recommend using the [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
|
|
81
82
|
operator to wait for the promise returned by send operation as follows:
|
|
82
83
|
|
|
83
84
|
```js
|
|
@@ -92,26 +93,9 @@ try {
|
|
|
92
93
|
}
|
|
93
94
|
```
|
|
94
95
|
|
|
95
|
-
Async-await is clean, concise, intuitive, easy to debug and has better error handling
|
|
96
|
-
as compared to using Promise chains or callbacks.
|
|
97
|
-
|
|
98
96
|
#### Promises
|
|
99
97
|
|
|
100
|
-
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining)
|
|
101
|
-
to execute send operation.
|
|
102
|
-
|
|
103
|
-
```js
|
|
104
|
-
client.send(command).then(
|
|
105
|
-
(data) => {
|
|
106
|
-
// process data.
|
|
107
|
-
},
|
|
108
|
-
(error) => {
|
|
109
|
-
// error handling.
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Promises can also be called using `.catch()` and `.finally()` as follows:
|
|
98
|
+
You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining).
|
|
115
99
|
|
|
116
100
|
```js
|
|
117
101
|
client
|
|
@@ -127,27 +111,21 @@ client
|
|
|
127
111
|
});
|
|
128
112
|
```
|
|
129
113
|
|
|
130
|
-
####
|
|
131
|
-
|
|
132
|
-
We do not recommend using callbacks because of [callback hell](http://callbackhell.com/),
|
|
133
|
-
but they are supported by the send operation.
|
|
114
|
+
#### Aggregated client
|
|
134
115
|
|
|
135
|
-
|
|
136
|
-
// callbacks.
|
|
137
|
-
client.send(command, (err, data) => {
|
|
138
|
-
// process err and data.
|
|
139
|
-
});
|
|
140
|
-
```
|
|
116
|
+
The aggregated client class is exported from the same package, but without the "Client" suffix.
|
|
141
117
|
|
|
142
|
-
|
|
118
|
+
`SecretsManager` extends `SecretsManagerClient` and additionally supports all operations, waiters, and paginators as methods.
|
|
119
|
+
This style may be familiar to you from the AWS SDK for JavaScript v2.
|
|
143
120
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
121
|
+
If you are bundling the AWS SDK, we recommend using only the bare-bones client (`SecretsManagerClient`).
|
|
122
|
+
More details are in the blog post on
|
|
123
|
+
[modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/).
|
|
147
124
|
|
|
148
125
|
```ts
|
|
149
|
-
import
|
|
150
|
-
|
|
126
|
+
import { SecretsManager } from "@aws-sdk/client-secrets-manager";
|
|
127
|
+
|
|
128
|
+
const client = new SecretsManager({ region: "REGION" });
|
|
151
129
|
|
|
152
130
|
// async/await.
|
|
153
131
|
try {
|
|
@@ -167,7 +145,7 @@ client
|
|
|
167
145
|
// error handling.
|
|
168
146
|
});
|
|
169
147
|
|
|
170
|
-
// callbacks.
|
|
148
|
+
// callbacks (not recommended).
|
|
171
149
|
client.listSecrets(params, (err, data) => {
|
|
172
150
|
// process err and data.
|
|
173
151
|
});
|
|
@@ -195,12 +173,14 @@ try {
|
|
|
195
173
|
}
|
|
196
174
|
```
|
|
197
175
|
|
|
176
|
+
See also [docs/ERROR_HANDLING](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/ERROR_HANDLING.md).
|
|
177
|
+
|
|
198
178
|
## Getting Help
|
|
199
179
|
|
|
200
180
|
Please use these community resources for getting help.
|
|
201
|
-
We use
|
|
181
|
+
We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
|
|
202
182
|
|
|
203
|
-
- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
183
|
+
- Visit the [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html)
|
|
204
184
|
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html).
|
|
205
185
|
- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/)
|
|
206
186
|
on AWS Developer Blog.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-secrets-manager",
|
|
3
3
|
"description": "AWS SDK for JavaScript Secrets Manager 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-secrets-manager",
|
|
@@ -25,46 +25,46 @@
|
|
|
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
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@smithy/snapshot-testing": "^2.0.
|
|
67
|
+
"@smithy/snapshot-testing": "^2.0.2",
|
|
68
68
|
"@tsconfig/node20": "20.1.8",
|
|
69
69
|
"@types/node": "^20.14.8",
|
|
70
70
|
"concurrently": "7.0.0",
|