@aligent/aws-wrappers 0.5.5 → 0.5.6
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 +30 -1
- package/cjs/index.cjs +93 -47
- package/cjs/package.json +1 -1
- package/cjs/src/index.d.ts +2 -0
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/s3/s3.d.ts.map +1 -1
- package/cjs/src/scheduler/scheduler.d.ts.map +1 -1
- package/cjs/src/sfn/sfn.d.ts.map +1 -1
- package/cjs/src/sns/sns.d.ts.map +1 -1
- package/cjs/src/sqs/sqs.d.ts +20 -0
- package/cjs/src/sqs/sqs.d.ts.map +1 -1
- package/cjs/src/ssm/ssm.d.ts.map +1 -1
- package/cjs/src/util/batch-operation-error.d.ts +33 -0
- package/cjs/src/util/batch-operation-error.d.ts.map +1 -0
- package/cjs/src/util/chunk.d.ts +6 -0
- package/cjs/src/util/chunk.d.ts.map +1 -0
- package/docs/index/classes/APIGatewayService.md +6 -6
- package/docs/index/classes/APIGatewayV2Service.md +5 -5
- package/docs/index/classes/BatchOperationError.md +261 -0
- package/docs/index/classes/DynamoDBService.md +12 -12
- package/docs/index/classes/S3Service.md +15 -15
- package/docs/index/classes/SNSService.md +4 -4
- package/docs/index/classes/SQSService.md +20 -7
- package/docs/index/classes/SSMService.md +7 -7
- package/docs/index/classes/SchedulerService.md +11 -11
- package/docs/index/classes/SecretsManagerService.md +8 -8
- package/docs/index/classes/StepFunctionsService.md +6 -6
- package/docs/index/interfaces/BatchFailedEntry.md +43 -0
- package/docs/index/modules.md +5 -0
- package/docs/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +93 -48
- package/esm/package.json +1 -1
- package/esm/src/index.d.ts +2 -0
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/s3/s3.d.ts.map +1 -1
- package/esm/src/scheduler/scheduler.d.ts.map +1 -1
- package/esm/src/sfn/sfn.d.ts.map +1 -1
- package/esm/src/sns/sns.d.ts.map +1 -1
- package/esm/src/sqs/sqs.d.ts +20 -0
- package/esm/src/sqs/sqs.d.ts.map +1 -1
- package/esm/src/ssm/ssm.d.ts.map +1 -1
- package/esm/src/util/batch-operation-error.d.ts +33 -0
- package/esm/src/util/batch-operation-error.d.ts.map +1 -0
- package/esm/src/util/chunk.d.ts +6 -0
- package/esm/src/util/chunk.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
[**@aligent/aws-wrappers**](../../modules.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / BatchOperationError
|
|
6
|
+
|
|
7
|
+
# Class: BatchOperationError\<TResult\>
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:23](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L23)
|
|
10
|
+
|
|
11
|
+
Thrown by the batch methods once every chunk has been sent and at least one
|
|
12
|
+
entry was rejected.
|
|
13
|
+
|
|
14
|
+
`results` holds the raw SDK output of every chunk, so the outputs of the
|
|
15
|
+
entries that succeeded (message ids, sequence numbers) stay readable.
|
|
16
|
+
`failed` is the normalised list of rejected entries across all chunks.
|
|
17
|
+
|
|
18
|
+
Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
19
|
+
this package may be loaded in one process.
|
|
20
|
+
|
|
21
|
+
## Extends
|
|
22
|
+
|
|
23
|
+
- `Error`
|
|
24
|
+
|
|
25
|
+
## Type Parameters
|
|
26
|
+
|
|
27
|
+
### TResult
|
|
28
|
+
|
|
29
|
+
`TResult` = `unknown`
|
|
30
|
+
|
|
31
|
+
## Constructors
|
|
32
|
+
|
|
33
|
+
<a id="constructor"></a>
|
|
34
|
+
|
|
35
|
+
### Constructor
|
|
36
|
+
|
|
37
|
+
> **new BatchOperationError**\<`TResult`\>(`results`, `failed`): `BatchOperationError`\<`TResult`\>
|
|
38
|
+
|
|
39
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:26](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L26)
|
|
40
|
+
|
|
41
|
+
#### Parameters
|
|
42
|
+
|
|
43
|
+
##### results
|
|
44
|
+
|
|
45
|
+
`TResult`[]
|
|
46
|
+
|
|
47
|
+
##### failed
|
|
48
|
+
|
|
49
|
+
[`BatchFailedEntry`](../interfaces/BatchFailedEntry.md)[]
|
|
50
|
+
|
|
51
|
+
#### Returns
|
|
52
|
+
|
|
53
|
+
`BatchOperationError`\<`TResult`\>
|
|
54
|
+
|
|
55
|
+
#### Overrides
|
|
56
|
+
|
|
57
|
+
`Error.constructor`
|
|
58
|
+
|
|
59
|
+
## Properties
|
|
60
|
+
|
|
61
|
+
<a id="cause"></a>
|
|
62
|
+
|
|
63
|
+
### cause?
|
|
64
|
+
|
|
65
|
+
> `optional` **cause?**: `unknown`
|
|
66
|
+
|
|
67
|
+
Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24
|
|
68
|
+
|
|
69
|
+
#### Inherited from
|
|
70
|
+
|
|
71
|
+
`Error.cause`
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
<a id="failed"></a>
|
|
76
|
+
|
|
77
|
+
### failed
|
|
78
|
+
|
|
79
|
+
> `readonly` **failed**: [`BatchFailedEntry`](../interfaces/BatchFailedEntry.md)[]
|
|
80
|
+
|
|
81
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:28](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L28)
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
<a id="message"></a>
|
|
86
|
+
|
|
87
|
+
### message
|
|
88
|
+
|
|
89
|
+
> **message**: `string`
|
|
90
|
+
|
|
91
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
|
|
92
|
+
|
|
93
|
+
#### Inherited from
|
|
94
|
+
|
|
95
|
+
`Error.message`
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
<a id="name"></a>
|
|
100
|
+
|
|
101
|
+
### name
|
|
102
|
+
|
|
103
|
+
> `readonly` **name**: `"BatchOperationError"` = `'BatchOperationError'`
|
|
104
|
+
|
|
105
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:24](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L24)
|
|
106
|
+
|
|
107
|
+
#### Overrides
|
|
108
|
+
|
|
109
|
+
`Error.name`
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
<a id="results"></a>
|
|
114
|
+
|
|
115
|
+
### results
|
|
116
|
+
|
|
117
|
+
> `readonly` **results**: `TResult`[]
|
|
118
|
+
|
|
119
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:27](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L27)
|
|
120
|
+
|
|
121
|
+
***
|
|
122
|
+
|
|
123
|
+
<a id="stack"></a>
|
|
124
|
+
|
|
125
|
+
### stack?
|
|
126
|
+
|
|
127
|
+
> `optional` **stack?**: `string`
|
|
128
|
+
|
|
129
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
|
|
130
|
+
|
|
131
|
+
#### Inherited from
|
|
132
|
+
|
|
133
|
+
`Error.stack`
|
|
134
|
+
|
|
135
|
+
***
|
|
136
|
+
|
|
137
|
+
<a id="stacktracelimit"></a>
|
|
138
|
+
|
|
139
|
+
### stackTraceLimit
|
|
140
|
+
|
|
141
|
+
> `static` **stackTraceLimit**: `number`
|
|
142
|
+
|
|
143
|
+
Defined in: node\_modules/@types/node/globals.d.ts:68
|
|
144
|
+
|
|
145
|
+
The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
146
|
+
collected by a stack trace (whether generated by `new Error().stack` or
|
|
147
|
+
`Error.captureStackTrace(obj)`).
|
|
148
|
+
|
|
149
|
+
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
150
|
+
will affect any stack trace captured _after_ the value has been changed.
|
|
151
|
+
|
|
152
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
153
|
+
not capture any frames.
|
|
154
|
+
|
|
155
|
+
#### Inherited from
|
|
156
|
+
|
|
157
|
+
`Error.stackTraceLimit`
|
|
158
|
+
|
|
159
|
+
## Methods
|
|
160
|
+
|
|
161
|
+
<a id="capturestacktrace"></a>
|
|
162
|
+
|
|
163
|
+
### captureStackTrace()
|
|
164
|
+
|
|
165
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
166
|
+
|
|
167
|
+
Defined in: node\_modules/@types/node/globals.d.ts:52
|
|
168
|
+
|
|
169
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
170
|
+
a string representing the location in the code at which
|
|
171
|
+
`Error.captureStackTrace()` was called.
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
const myObject = {};
|
|
175
|
+
Error.captureStackTrace(myObject);
|
|
176
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The first line of the trace will be prefixed with
|
|
180
|
+
`${myObject.name}: ${myObject.message}`.
|
|
181
|
+
|
|
182
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
183
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
184
|
+
generated stack trace.
|
|
185
|
+
|
|
186
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
187
|
+
details of error generation from the user. For instance:
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
function a() {
|
|
191
|
+
b();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function b() {
|
|
195
|
+
c();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function c() {
|
|
199
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
200
|
+
const { stackTraceLimit } = Error;
|
|
201
|
+
Error.stackTraceLimit = 0;
|
|
202
|
+
const error = new Error();
|
|
203
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
204
|
+
|
|
205
|
+
// Capture the stack trace above function b
|
|
206
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
a();
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
#### Parameters
|
|
214
|
+
|
|
215
|
+
##### targetObject
|
|
216
|
+
|
|
217
|
+
`object`
|
|
218
|
+
|
|
219
|
+
##### constructorOpt?
|
|
220
|
+
|
|
221
|
+
`Function`
|
|
222
|
+
|
|
223
|
+
#### Returns
|
|
224
|
+
|
|
225
|
+
`void`
|
|
226
|
+
|
|
227
|
+
#### Inherited from
|
|
228
|
+
|
|
229
|
+
`Error.captureStackTrace`
|
|
230
|
+
|
|
231
|
+
***
|
|
232
|
+
|
|
233
|
+
<a id="preparestacktrace"></a>
|
|
234
|
+
|
|
235
|
+
### prepareStackTrace()
|
|
236
|
+
|
|
237
|
+
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
|
|
238
|
+
|
|
239
|
+
Defined in: node\_modules/@types/node/globals.d.ts:56
|
|
240
|
+
|
|
241
|
+
#### Parameters
|
|
242
|
+
|
|
243
|
+
##### err
|
|
244
|
+
|
|
245
|
+
`Error`
|
|
246
|
+
|
|
247
|
+
##### stackTraces
|
|
248
|
+
|
|
249
|
+
`CallSite`[]
|
|
250
|
+
|
|
251
|
+
#### Returns
|
|
252
|
+
|
|
253
|
+
`any`
|
|
254
|
+
|
|
255
|
+
#### See
|
|
256
|
+
|
|
257
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
258
|
+
|
|
259
|
+
#### Inherited from
|
|
260
|
+
|
|
261
|
+
`Error.prepareStackTrace`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: DynamoDBService
|
|
8
8
|
|
|
9
|
-
Defined in: [dynamodb/dynamodb.ts:155](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:155](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L155)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS DynamoDB Document client providing structured
|
|
12
12
|
Powertools logging and X-Ray tracing by default.
|
|
@@ -26,7 +26,7 @@ callers work with plain TypeScript objects in both directions.
|
|
|
26
26
|
|
|
27
27
|
> **new DynamoDBService**(`opts?`): `DynamoDBService`
|
|
28
28
|
|
|
29
|
-
Defined in: [dynamodb/dynamodb.ts:168](https://github.com/aligent/microservice-development-utilities/blob/
|
|
29
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:168](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L168)
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
@@ -61,7 +61,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
61
61
|
|
|
62
62
|
> **batchGet**(`input`): `Promise`\<`BatchGetCommandOutput`\>
|
|
63
63
|
|
|
64
|
-
Defined in: [dynamodb/dynamodb.ts:322](https://github.com/aligent/microservice-development-utilities/blob/
|
|
64
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:322](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L322)
|
|
65
65
|
|
|
66
66
|
Batch-get items from one or more DynamoDB tables, retrying
|
|
67
67
|
`UnprocessedKeys` with jittered exponential backoff. Up to 5 attempts
|
|
@@ -91,7 +91,7 @@ Callers should narrow the result type at the call site.
|
|
|
91
91
|
|
|
92
92
|
> **batchWrite**(`input`): `Promise`\<`BatchWriteCommandOutput`\>
|
|
93
93
|
|
|
94
|
-
Defined in: [dynamodb/dynamodb.ts:359](https://github.com/aligent/microservice-development-utilities/blob/
|
|
94
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:359](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L359)
|
|
95
95
|
|
|
96
96
|
Batch-write items to DynamoDB, retrying `UnprocessedItems` with jittered
|
|
97
97
|
exponential backoff. Up to 5 attempts (200ms base delay). Throws when
|
|
@@ -115,7 +115,7 @@ items remain unprocessed after the final attempt.
|
|
|
115
115
|
|
|
116
116
|
> **deleteItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`DeleteCommandOutput`, `"Attributes"`\> & `object`\>
|
|
117
117
|
|
|
118
|
-
Defined in: [dynamodb/dynamodb.ts:249](https://github.com/aligent/microservice-development-utilities/blob/
|
|
118
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:249](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L249)
|
|
119
119
|
|
|
120
120
|
Delete an item from DynamoDB. The `Attributes` field on the response is
|
|
121
121
|
typed as `R` — relevant when `ReturnValues: 'ALL_OLD'` is set.
|
|
@@ -152,7 +152,7 @@ Expected shape of the returned `Attributes`.
|
|
|
152
152
|
|
|
153
153
|
> **getItem**\<`K`, `R`\>(`input`): `Promise`\<`R` \| `undefined`\>
|
|
154
154
|
|
|
155
|
-
Defined in: [dynamodb/dynamodb.ts:183](https://github.com/aligent/microservice-development-utilities/blob/
|
|
155
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:183](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L183)
|
|
156
156
|
|
|
157
157
|
Get an item from DynamoDB.
|
|
158
158
|
|
|
@@ -190,7 +190,7 @@ The item, or `undefined` if not found.
|
|
|
190
190
|
|
|
191
191
|
> **paginateItems**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
192
192
|
|
|
193
|
-
Defined in: [dynamodb/dynamodb.ts:410](https://github.com/aligent/microservice-development-utilities/blob/
|
|
193
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:410](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L410)
|
|
194
194
|
|
|
195
195
|
Paginate over Query results, yielding one unmarshalled item at a time.
|
|
196
196
|
|
|
@@ -241,7 +241,7 @@ Expected shape of each yielded item.
|
|
|
241
241
|
|
|
242
242
|
> **paginateScan**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
243
243
|
|
|
244
|
-
Defined in: [dynamodb/dynamodb.ts:432](https://github.com/aligent/microservice-development-utilities/blob/
|
|
244
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:432](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L432)
|
|
245
245
|
|
|
246
246
|
Paginate over Scan results, yielding one unmarshalled item at a time.
|
|
247
247
|
|
|
@@ -275,7 +275,7 @@ Expected shape of each yielded item.
|
|
|
275
275
|
|
|
276
276
|
> **putItem**\<`T`\>(`input`): `Promise`\<`PutCommandOutput`\>
|
|
277
277
|
|
|
278
|
-
Defined in: [dynamodb/dynamodb.ts:203](https://github.com/aligent/microservice-development-utilities/blob/
|
|
278
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:203](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L203)
|
|
279
279
|
|
|
280
280
|
Put an item into DynamoDB. The caller's `Item` is typed as `T`, which
|
|
281
281
|
the document client marshalls automatically.
|
|
@@ -306,7 +306,7 @@ Type of the item being stored.
|
|
|
306
306
|
|
|
307
307
|
> **query**\<`T`\>(`input`): `Promise`\<`Omit`\<`QueryCommandOutput`, `"Items"`\> & `object`\>
|
|
308
308
|
|
|
309
|
-
Defined in: [dynamodb/dynamodb.ts:272](https://github.com/aligent/microservice-development-utilities/blob/
|
|
309
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:272](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L272)
|
|
310
310
|
|
|
311
311
|
Execute a DynamoDB Query. The full `QueryCommandOutput` is returned with
|
|
312
312
|
`Items` typed as `T[]` so callers retain pagination metadata
|
|
@@ -338,7 +338,7 @@ Expected shape of each unmarshalled item.
|
|
|
338
338
|
|
|
339
339
|
> **scan**\<`T`\>(`input`): `Promise`\<`Omit`\<`ScanCommandOutput`, `"Items"`\> & `object`\>
|
|
340
340
|
|
|
341
|
-
Defined in: [dynamodb/dynamodb.ts:301](https://github.com/aligent/microservice-development-utilities/blob/
|
|
341
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:301](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L301)
|
|
342
342
|
|
|
343
343
|
Scan a DynamoDB table. The full `ScanCommandOutput` is returned with
|
|
344
344
|
`Items` typed as `T[]` so callers retain pagination metadata.
|
|
@@ -382,7 +382,7 @@ Expected shape of each unmarshalled item.
|
|
|
382
382
|
|
|
383
383
|
> **updateItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`UpdateCommandOutput`, `"Attributes"`\> & `object`\>
|
|
384
384
|
|
|
385
|
-
Defined in: [dynamodb/dynamodb.ts:226](https://github.com/aligent/microservice-development-utilities/blob/
|
|
385
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:226](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L226)
|
|
386
386
|
|
|
387
387
|
Update an item in DynamoDB. The `Attributes` field on the response is
|
|
388
388
|
typed as `R` — the caller should choose `R` to match their
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: S3Service
|
|
8
8
|
|
|
9
|
-
Defined in: [s3/s3.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:72](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L72)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS S3 client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -27,7 +27,7 @@ tagging, version IDs) should use `S3Client` directly.
|
|
|
27
27
|
|
|
28
28
|
> **new S3Service**(`opts?`): `S3Service`
|
|
29
29
|
|
|
30
|
-
Defined in: [s3/s3.ts:
|
|
30
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:82](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L82)
|
|
31
31
|
|
|
32
32
|
#### Parameters
|
|
33
33
|
|
|
@@ -59,7 +59,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
59
59
|
|
|
60
60
|
> **copyObject**(`input`): `Promise`\<`CopyObjectCommandOutput`\>
|
|
61
61
|
|
|
62
|
-
Defined in: [s3/s3.ts:
|
|
62
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:177](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L177)
|
|
63
63
|
|
|
64
64
|
Copy an object within S3.
|
|
65
65
|
|
|
@@ -81,7 +81,7 @@ Copy an object within S3.
|
|
|
81
81
|
|
|
82
82
|
> **deleteObject**(`input`): `Promise`\<`DeleteObjectCommandOutput`\>
|
|
83
83
|
|
|
84
|
-
Defined in: [s3/s3.ts:
|
|
84
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:265](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L265)
|
|
85
85
|
|
|
86
86
|
Delete a single object from S3.
|
|
87
87
|
|
|
@@ -103,7 +103,7 @@ Delete a single object from S3.
|
|
|
103
103
|
|
|
104
104
|
> **deleteObjects**(`bucket`, `keys`): `Promise`\<`DeleteObjectsCommandOutput`[]\>
|
|
105
105
|
|
|
106
|
-
Defined in: [s3/s3.ts:
|
|
106
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:277](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L277)
|
|
107
107
|
|
|
108
108
|
Delete multiple objects from S3, auto-chunking the request into batches
|
|
109
109
|
of 1000 keys (the S3-enforced DeleteObjects limit). Returns one output
|
|
@@ -131,7 +131,7 @@ per chunk.
|
|
|
131
131
|
|
|
132
132
|
> **emptyBucket**(`bucket`): `Promise`\<`string`[]\>
|
|
133
133
|
|
|
134
|
-
Defined in: [s3/s3.ts:
|
|
134
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:316](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L316)
|
|
135
135
|
|
|
136
136
|
Delete every object in an **unversioned** bucket. Streams the listing
|
|
137
137
|
page-by-page and delegates each page's deletion to `deleteObjects`, so
|
|
@@ -167,7 +167,7 @@ The keys this call issued deletes for.
|
|
|
167
167
|
|
|
168
168
|
> **getAllObjects**\<`T`\>(`bucket`, `prefix?`): `Promise`\<`T`[]\>
|
|
169
169
|
|
|
170
|
-
Defined in: [s3/s3.ts:
|
|
170
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:203](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L203)
|
|
171
171
|
|
|
172
172
|
List and JSON-parse every object under a bucket and optional prefix.
|
|
173
173
|
Auto-paginated. Objects without a body are skipped.
|
|
@@ -202,7 +202,7 @@ Expected type of each parsed object.
|
|
|
202
202
|
|
|
203
203
|
> **getJsonObject**\<`T`\>(`input`): `Promise`\<`T` \| `undefined`\>
|
|
204
204
|
|
|
205
|
-
Defined in: [s3/s3.ts:
|
|
205
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:155](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L155)
|
|
206
206
|
|
|
207
207
|
Get an object from S3 and parse it as JSON.
|
|
208
208
|
|
|
@@ -238,7 +238,7 @@ If the body is non-empty and not valid JSON.
|
|
|
238
238
|
|
|
239
239
|
> **getObject**(`input`): `Promise`\<`GetObjectCommandOutput`\>
|
|
240
240
|
|
|
241
|
-
Defined in: [s3/s3.ts:
|
|
241
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:129](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L129)
|
|
242
242
|
|
|
243
243
|
Get an object from S3.
|
|
244
244
|
|
|
@@ -260,7 +260,7 @@ Get an object from S3.
|
|
|
260
260
|
|
|
261
261
|
> **getObjectBody**(`input`): `Promise`\<`string` \| `undefined`\>
|
|
262
262
|
|
|
263
|
-
Defined in: [s3/s3.ts:
|
|
263
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:141](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L141)
|
|
264
264
|
|
|
265
265
|
Get an object from S3 and return its body as a string.
|
|
266
266
|
|
|
@@ -285,7 +285,7 @@ has no body.
|
|
|
285
285
|
|
|
286
286
|
> **getPresignedUrl**(`input`): `Promise`\<`string`\>
|
|
287
287
|
|
|
288
|
-
Defined in: [s3/s3.ts:
|
|
288
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:241](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L241)
|
|
289
289
|
|
|
290
290
|
Generate a presigned URL that callers can use to GET or PUT an S3 object
|
|
291
291
|
directly, without going through the wrapper. The signing happens against
|
|
@@ -339,7 +339,7 @@ The S3 object key.
|
|
|
339
339
|
|
|
340
340
|
> **headObject**(`input`): `Promise`\<`HeadObjectCommandOutput`\>
|
|
341
341
|
|
|
342
|
-
Defined in: [s3/s3.ts:
|
|
342
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:167](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L167)
|
|
343
343
|
|
|
344
344
|
Fetch the metadata for an S3 object without downloading its body.
|
|
345
345
|
|
|
@@ -361,7 +361,7 @@ Fetch the metadata for an S3 object without downloading its body.
|
|
|
361
361
|
|
|
362
362
|
> **listObjects**(`bucket`, `prefix?`): `Promise`\<`string`[]\>
|
|
363
363
|
|
|
364
|
-
Defined in: [s3/s3.ts:
|
|
364
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:188](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L188)
|
|
365
365
|
|
|
366
366
|
List object keys under a bucket and optional prefix, auto-paginating
|
|
367
367
|
across all pages.
|
|
@@ -388,7 +388,7 @@ across all pages.
|
|
|
388
388
|
|
|
389
389
|
> **putJsonObject**\<`T`\>(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
390
390
|
|
|
391
|
-
Defined in: [s3/s3.ts:
|
|
391
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:112](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L112)
|
|
392
392
|
|
|
393
393
|
Serialise a value to JSON and store it as an S3 object.
|
|
394
394
|
|
|
@@ -422,7 +422,7 @@ Type of the value being stored.
|
|
|
422
422
|
|
|
423
423
|
> **putObject**(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
424
424
|
|
|
425
|
-
Defined in: [s3/s3.ts:
|
|
425
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:96](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/s3/s3.ts#L96)
|
|
426
426
|
|
|
427
427
|
Put an object into S3.
|
|
428
428
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SNSService
|
|
8
8
|
|
|
9
|
-
Defined in: [sns/sns.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:44](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sns/sns.ts#L44)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SNS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -23,7 +23,7 @@ log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
|
23
23
|
|
|
24
24
|
> **new SNSService**(`opts?`): `SNSService`
|
|
25
25
|
|
|
26
|
-
Defined in: [sns/sns.ts:
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:60](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sns/sns.ts#L60)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -65,7 +65,7 @@ its own `truncate` option.
|
|
|
65
65
|
|
|
66
66
|
> **publish**(`input`, `opts?`): `Promise`\<`PublishCommandOutput`\>
|
|
67
67
|
|
|
68
|
-
Defined in: [sns/sns.ts:
|
|
68
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:74](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sns/sns.ts#L74)
|
|
69
69
|
|
|
70
70
|
Publish a single message to an SNS topic.
|
|
71
71
|
|
|
@@ -98,7 +98,7 @@ PublishCommandInput including TopicArn and Message.
|
|
|
98
98
|
|
|
99
99
|
> **publishBatch**(`input`): `Promise`\<`PublishBatchCommandOutput`[]\>
|
|
100
100
|
|
|
101
|
-
Defined in: [sns/sns.ts:
|
|
101
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:126](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sns/sns.ts#L126)
|
|
102
102
|
|
|
103
103
|
Publish a batch of messages to an SNS topic. The SNS API caps
|
|
104
104
|
PublishBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SQSService
|
|
8
8
|
|
|
9
|
-
Defined in: [sqs/sqs.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:56](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L56)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SQS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -23,7 +23,7 @@ log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
|
23
23
|
|
|
24
24
|
> **new SQSService**(`opts?`): `SQSService`
|
|
25
25
|
|
|
26
|
-
Defined in: [sqs/sqs.ts:
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:71](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L71)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -64,7 +64,7 @@ option.
|
|
|
64
64
|
|
|
65
65
|
> **deleteMessage**(`input`): `Promise`\<`DeleteMessageCommandOutput`\>
|
|
66
66
|
|
|
67
|
-
Defined in: [sqs/sqs.ts:
|
|
67
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:135](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L135)
|
|
68
68
|
|
|
69
69
|
Delete a single message from an SQS queue.
|
|
70
70
|
|
|
@@ -86,12 +86,19 @@ Delete a single message from an SQS queue.
|
|
|
86
86
|
|
|
87
87
|
> **deleteMessageBatch**(`input`): `Promise`\<`DeleteMessageBatchCommandOutput`[]\>
|
|
88
88
|
|
|
89
|
-
Defined in: [sqs/sqs.ts:
|
|
89
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:209](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L209)
|
|
90
90
|
|
|
91
91
|
Delete a batch of messages from an SQS queue. The SQS API caps
|
|
92
92
|
DeleteMessageBatch at 10 entries per request, so this method auto-chunks
|
|
93
93
|
the caller's entries and sends one request per chunk.
|
|
94
94
|
|
|
95
|
+
Every chunk is sent before the outcome is judged. If SQS failed to
|
|
96
|
+
delete any message, a [BatchOperationError](BatchOperationError.md) is then thrown carrying
|
|
97
|
+
the per-chunk results and the failed entries; those messages will be
|
|
98
|
+
redelivered. Request-level SDK exceptions (throttling, access denied)
|
|
99
|
+
propagate unchanged and immediately, so earlier chunks may already have
|
|
100
|
+
been deleted.
|
|
101
|
+
|
|
95
102
|
#### Parameters
|
|
96
103
|
|
|
97
104
|
##### input
|
|
@@ -110,7 +117,7 @@ the caller's entries and sends one request per chunk.
|
|
|
110
117
|
|
|
111
118
|
> **receiveMessages**(`input`): `Promise`\<`Message`[]\>
|
|
112
119
|
|
|
113
|
-
Defined in: [sqs/sqs.ts:
|
|
120
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:126](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L126)
|
|
114
121
|
|
|
115
122
|
Receive messages from an SQS queue. Returns an empty array when no
|
|
116
123
|
messages are available. No automatic deletion is performed — visibility
|
|
@@ -136,7 +143,7 @@ The `Messages` array from the response, or `[]` if absent.
|
|
|
136
143
|
|
|
137
144
|
> **sendMessage**(`input`, `opts?`): `Promise`\<`SendMessageCommandOutput`\>
|
|
138
145
|
|
|
139
|
-
Defined in: [sqs/sqs.ts:
|
|
146
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:83](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L83)
|
|
140
147
|
|
|
141
148
|
Send a single message to an SQS queue.
|
|
142
149
|
|
|
@@ -167,12 +174,18 @@ see `SEND_MESSAGE_SAFE_FIELDS`.
|
|
|
167
174
|
|
|
168
175
|
> **sendMessageBatch**(`input`): `Promise`\<`SendMessageBatchCommandOutput`[]\>
|
|
169
176
|
|
|
170
|
-
Defined in: [sqs/sqs.ts:
|
|
177
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:177](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/sqs/sqs.ts#L177)
|
|
171
178
|
|
|
172
179
|
Send a batch of messages to an SQS queue. The SQS API caps
|
|
173
180
|
SendMessageBatch at 10 entries per request, so this method auto-chunks
|
|
174
181
|
the caller's entries and sends one request per chunk.
|
|
175
182
|
|
|
183
|
+
Every chunk is sent before the outcome is judged. If SQS rejected any
|
|
184
|
+
entry, a [BatchOperationError](BatchOperationError.md) is then thrown carrying the
|
|
185
|
+
per-chunk results and the failed entries. Request-level SDK exceptions
|
|
186
|
+
(throttling, access denied) propagate unchanged and immediately, so
|
|
187
|
+
earlier chunks may already have been sent.
|
|
188
|
+
|
|
176
189
|
#### Parameters
|
|
177
190
|
|
|
178
191
|
##### input
|