@aligent/aws-wrappers 0.3.0 → 0.4.1
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 +20 -1
- package/cjs/index.cjs +610 -1387
- package/cjs/package.json +4 -1
- package/cjs/src/dynamodb/dynamodb.d.ts +27 -0
- package/cjs/src/s3/s3.d.ts +15 -4
- package/cjs/src/sns/sns.d.ts +7 -0
- package/cjs/src/sqs/sqs.d.ts +7 -0
- package/docs/classes/DynamoDBService.md +37 -12
- package/docs/classes/S3Service.md +29 -19
- package/docs/classes/SNSService.md +4 -4
- package/docs/classes/SQSService.md +7 -7
- package/docs/classes/SSMService.md +7 -7
- package/docs/classes/SchedulerService.md +11 -11
- package/docs/classes/SecretsManagerService.md +8 -8
- package/docs/classes/StepFunctionsService.md +6 -6
- package/esm/index.mjs +611 -1388
- package/esm/package.json +4 -1
- package/esm/src/dynamodb/dynamodb.d.ts +27 -0
- package/esm/src/s3/s3.d.ts +15 -4
- package/esm/src/sns/sns.d.ts +7 -0
- package/esm/src/sqs/sqs.d.ts +7 -0
- package/package.json +4 -1
package/cjs/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=18"
|
|
7
|
+
},
|
|
5
8
|
"main": "./index.cjs.js",
|
|
6
9
|
"module": "./esm/index.mjs",
|
|
7
10
|
"types": "./cjs/src/index.d.ts",
|
|
@@ -119,11 +119,38 @@ export declare class DynamoDBService {
|
|
|
119
119
|
batchWrite(input: BatchWriteCommandInput): Promise<BatchWriteCommandOutput>;
|
|
120
120
|
/**
|
|
121
121
|
* Paginate over Query results, yielding one unmarshalled item at a time.
|
|
122
|
+
*
|
|
123
|
+
* **`Limit` is a page size, not a total cap.** DynamoDB applies it per
|
|
124
|
+
* request, and this method walks every page until `LastEvaluatedKey` is
|
|
125
|
+
* exhausted — so `paginateItems({ Limit: 10 })` yields *every* matching
|
|
126
|
+
* item, in pages of 10, not the first 10 items.
|
|
127
|
+
*
|
|
128
|
+
* To bound the number of items, `break` out of the loop. This is an
|
|
129
|
+
* `AsyncGenerator`, so `break` calls its `return()`, which unwinds the
|
|
130
|
+
* pagination and issues no further requests:
|
|
131
|
+
*
|
|
132
|
+
* ```ts
|
|
133
|
+
* const firstTen: Item[] = [];
|
|
134
|
+
* for await (const item of ddb.paginateItems<Item>(input)) {
|
|
135
|
+
* firstTen.push(item);
|
|
136
|
+
* if (firstTen.length === 10) break;
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* `Limit` remains the right knob for tuning per-request consumed capacity
|
|
141
|
+
* and page memory — set it deliberately, just don't expect it to stop the
|
|
142
|
+
* walk.
|
|
143
|
+
*
|
|
122
144
|
* @template T - Expected shape of each yielded item.
|
|
123
145
|
*/
|
|
124
146
|
paginateItems<T extends Record<string, unknown> = Record<string, unknown>>(input: QueryCommandInput): AsyncGenerator<T>;
|
|
125
147
|
/**
|
|
126
148
|
* Paginate over Scan results, yielding one unmarshalled item at a time.
|
|
149
|
+
*
|
|
150
|
+
* **`Limit` is a page size, not a total cap** — see `paginateItems` for the
|
|
151
|
+
* detail. `break` out of the loop to bound the number of items; `Limit`
|
|
152
|
+
* stays the right knob for per-request consumed capacity and page memory.
|
|
153
|
+
*
|
|
127
154
|
* @template T - Expected shape of each yielded item.
|
|
128
155
|
*/
|
|
129
156
|
paginateScan<T extends Record<string, unknown> = Record<string, unknown>>(input: ScanCommandInput): AsyncGenerator<T>;
|
package/cjs/src/s3/s3.d.ts
CHANGED
|
@@ -125,10 +125,21 @@ export declare class S3Service {
|
|
|
125
125
|
*/
|
|
126
126
|
deleteObjects(bucket: string, keys: string[]): Promise<DeleteObjectsCommandOutput[]>;
|
|
127
127
|
/**
|
|
128
|
-
* Delete every object in
|
|
129
|
-
* delegates each page's deletion to `deleteObjects`, so
|
|
130
|
-
* bounded by one page (~1000 keys) regardless of bucket
|
|
131
|
-
*
|
|
128
|
+
* Delete every object in an **unversioned** bucket. Streams the listing
|
|
129
|
+
* page-by-page and delegates each page's deletion to `deleteObjects`, so
|
|
130
|
+
* peak memory stays bounded by one page (~1000 keys) regardless of bucket
|
|
131
|
+
* size.
|
|
132
|
+
*
|
|
133
|
+
* **Versioned buckets are out of scope.** This paginates `ListObjectsV2`,
|
|
134
|
+
* which reports only current object versions — never noncurrent versions or
|
|
135
|
+
* delete markers. Against a versioned bucket the call therefore succeeds and
|
|
136
|
+
* the bucket then *looks* empty to `ListObjectsV2`, but the deletes only
|
|
137
|
+
* added delete markers: every object version is still stored, still billed,
|
|
138
|
+
* and `DeleteBucket` will still fail with `BucketNotEmpty`. Emptying a
|
|
139
|
+
* versioned bucket requires `ListObjectVersions` and per-version deletes;
|
|
140
|
+
* use `S3Client` directly for that.
|
|
141
|
+
*
|
|
142
|
+
* @returns The keys this call issued deletes for.
|
|
132
143
|
*/
|
|
133
144
|
emptyBucket(bucket: string): Promise<string[]>;
|
|
134
145
|
}
|
package/cjs/src/sns/sns.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export declare class SNSService {
|
|
|
39
39
|
publish(input: PublishCommandInput, opts?: {
|
|
40
40
|
truncate?: boolean;
|
|
41
41
|
}): Promise<PublishCommandOutput>;
|
|
42
|
+
/**
|
|
43
|
+
* The truncation helpers return the input unchanged when it already fits, so
|
|
44
|
+
* a `!==` comparison against their result is what decides whether a field
|
|
45
|
+
* was modified. Don't reintroduce a size guard here: that would state each
|
|
46
|
+
* limit twice, encode the string to a `Buffer` twice, and let the two
|
|
47
|
+
* expressions drift into warning without truncating (or the reverse).
|
|
48
|
+
*/
|
|
42
49
|
private applyTruncation;
|
|
43
50
|
/**
|
|
44
51
|
* Publish a batch of messages to an SNS topic. The SNS API caps
|
package/cjs/src/sqs/sqs.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export declare class SQSService {
|
|
|
36
36
|
sendMessage(input: SendMessageCommandInput, opts?: {
|
|
37
37
|
truncate?: boolean;
|
|
38
38
|
}): Promise<SendMessageCommandOutput>;
|
|
39
|
+
/**
|
|
40
|
+
* `truncateUtf8` returns the input unchanged when it already fits, so a
|
|
41
|
+
* `!==` comparison against its result is what decides whether the body was
|
|
42
|
+
* modified. Don't reintroduce a size guard here: that would state the limit
|
|
43
|
+
* twice, encode the string to a `Buffer` twice, and let the two expressions
|
|
44
|
+
* drift into warning without truncating (or the reverse).
|
|
45
|
+
*/
|
|
39
46
|
private applyTruncation;
|
|
40
47
|
/**
|
|
41
48
|
* Receive messages from an SQS queue. Returns an empty array when no
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: DynamoDBService
|
|
8
8
|
|
|
9
|
-
Defined in: [dynamodb/dynamodb.ts:153](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [dynamodb/dynamodb.ts:153](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L153)
|
|
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:166](https://github.com/aligent/microservice-development-utilities/blob/
|
|
29
|
+
Defined in: [dynamodb/dynamodb.ts:166](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L166)
|
|
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:317](https://github.com/aligent/microservice-development-utilities/blob/
|
|
64
|
+
Defined in: [dynamodb/dynamodb.ts:317](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L317)
|
|
65
65
|
|
|
66
66
|
Batch-get items from one or more DynamoDB tables.
|
|
67
67
|
|
|
@@ -88,7 +88,7 @@ Callers should narrow the result type at the call site.
|
|
|
88
88
|
|
|
89
89
|
> **batchWrite**(`input`): `Promise`\<`BatchWriteCommandOutput`\>
|
|
90
90
|
|
|
91
|
-
Defined in: [dynamodb/dynamodb.ts:334](https://github.com/aligent/microservice-development-utilities/blob/
|
|
91
|
+
Defined in: [dynamodb/dynamodb.ts:334](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L334)
|
|
92
92
|
|
|
93
93
|
Batch-write items to DynamoDB, retrying `UnprocessedItems` with jittered
|
|
94
94
|
exponential backoff. Up to 5 attempts (200ms base delay). Throws when
|
|
@@ -112,7 +112,7 @@ items remain unprocessed after the final attempt.
|
|
|
112
112
|
|
|
113
113
|
> **deleteItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`DeleteCommandOutput`, `"Attributes"`\> & `object`\>
|
|
114
114
|
|
|
115
|
-
Defined in: [dynamodb/dynamodb.ts:247](https://github.com/aligent/microservice-development-utilities/blob/
|
|
115
|
+
Defined in: [dynamodb/dynamodb.ts:247](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L247)
|
|
116
116
|
|
|
117
117
|
Delete an item from DynamoDB. The `Attributes` field on the response is
|
|
118
118
|
typed as `R` — relevant when `ReturnValues: 'ALL_OLD'` is set.
|
|
@@ -149,7 +149,7 @@ Expected shape of the returned `Attributes`.
|
|
|
149
149
|
|
|
150
150
|
> **getItem**\<`K`, `R`\>(`input`): `Promise`\<`R` \| `undefined`\>
|
|
151
151
|
|
|
152
|
-
Defined in: [dynamodb/dynamodb.ts:181](https://github.com/aligent/microservice-development-utilities/blob/
|
|
152
|
+
Defined in: [dynamodb/dynamodb.ts:181](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L181)
|
|
153
153
|
|
|
154
154
|
Get an item from DynamoDB.
|
|
155
155
|
|
|
@@ -187,10 +187,31 @@ The item, or `undefined` if not found.
|
|
|
187
187
|
|
|
188
188
|
> **paginateItems**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
189
189
|
|
|
190
|
-
Defined in: [dynamodb/dynamodb.ts:
|
|
190
|
+
Defined in: [dynamodb/dynamodb.ts:384](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L384)
|
|
191
191
|
|
|
192
192
|
Paginate over Query results, yielding one unmarshalled item at a time.
|
|
193
193
|
|
|
194
|
+
**`Limit` is a page size, not a total cap.** DynamoDB applies it per
|
|
195
|
+
request, and this method walks every page until `LastEvaluatedKey` is
|
|
196
|
+
exhausted — so `paginateItems({ Limit: 10 })` yields *every* matching
|
|
197
|
+
item, in pages of 10, not the first 10 items.
|
|
198
|
+
|
|
199
|
+
To bound the number of items, `break` out of the loop. This is an
|
|
200
|
+
`AsyncGenerator`, so `break` calls its `return()`, which unwinds the
|
|
201
|
+
pagination and issues no further requests:
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
const firstTen: Item[] = [];
|
|
205
|
+
for await (const item of ddb.paginateItems<Item>(input)) {
|
|
206
|
+
firstTen.push(item);
|
|
207
|
+
if (firstTen.length === 10) break;
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
`Limit` remains the right knob for tuning per-request consumed capacity
|
|
212
|
+
and page memory — set it deliberately, just don't expect it to stop the
|
|
213
|
+
walk.
|
|
214
|
+
|
|
194
215
|
#### Type Parameters
|
|
195
216
|
|
|
196
217
|
##### T
|
|
@@ -217,10 +238,14 @@ Expected shape of each yielded item.
|
|
|
217
238
|
|
|
218
239
|
> **paginateScan**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
219
240
|
|
|
220
|
-
Defined in: [dynamodb/dynamodb.ts:
|
|
241
|
+
Defined in: [dynamodb/dynamodb.ts:406](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L406)
|
|
221
242
|
|
|
222
243
|
Paginate over Scan results, yielding one unmarshalled item at a time.
|
|
223
244
|
|
|
245
|
+
**`Limit` is a page size, not a total cap** — see `paginateItems` for the
|
|
246
|
+
detail. `break` out of the loop to bound the number of items; `Limit`
|
|
247
|
+
stays the right knob for per-request consumed capacity and page memory.
|
|
248
|
+
|
|
224
249
|
#### Type Parameters
|
|
225
250
|
|
|
226
251
|
##### T
|
|
@@ -247,7 +272,7 @@ Expected shape of each yielded item.
|
|
|
247
272
|
|
|
248
273
|
> **putItem**\<`T`\>(`input`): `Promise`\<`PutCommandOutput`\>
|
|
249
274
|
|
|
250
|
-
Defined in: [dynamodb/dynamodb.ts:201](https://github.com/aligent/microservice-development-utilities/blob/
|
|
275
|
+
Defined in: [dynamodb/dynamodb.ts:201](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L201)
|
|
251
276
|
|
|
252
277
|
Put an item into DynamoDB. The caller's `Item` is typed as `T`, which
|
|
253
278
|
the document client marshalls automatically.
|
|
@@ -278,7 +303,7 @@ Type of the item being stored.
|
|
|
278
303
|
|
|
279
304
|
> **query**\<`T`\>(`input`): `Promise`\<`Omit`\<`QueryCommandOutput`, `"Items"`\> & `object`\>
|
|
280
305
|
|
|
281
|
-
Defined in: [dynamodb/dynamodb.ts:270](https://github.com/aligent/microservice-development-utilities/blob/
|
|
306
|
+
Defined in: [dynamodb/dynamodb.ts:270](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L270)
|
|
282
307
|
|
|
283
308
|
Execute a DynamoDB Query. The full `QueryCommandOutput` is returned with
|
|
284
309
|
`Items` typed as `T[]` so callers retain pagination metadata
|
|
@@ -310,7 +335,7 @@ Expected shape of each unmarshalled item.
|
|
|
310
335
|
|
|
311
336
|
> **scan**\<`T`\>(`input`): `Promise`\<`Omit`\<`ScanCommandOutput`, `"Items"`\> & `object`\>
|
|
312
337
|
|
|
313
|
-
Defined in: [dynamodb/dynamodb.ts:299](https://github.com/aligent/microservice-development-utilities/blob/
|
|
338
|
+
Defined in: [dynamodb/dynamodb.ts:299](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L299)
|
|
314
339
|
|
|
315
340
|
Scan a DynamoDB table. The full `ScanCommandOutput` is returned with
|
|
316
341
|
`Items` typed as `T[]` so callers retain pagination metadata.
|
|
@@ -354,7 +379,7 @@ Expected shape of each unmarshalled item.
|
|
|
354
379
|
|
|
355
380
|
> **updateItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`UpdateCommandOutput`, `"Attributes"`\> & `object`\>
|
|
356
381
|
|
|
357
|
-
Defined in: [dynamodb/dynamodb.ts:224](https://github.com/aligent/microservice-development-utilities/blob/
|
|
382
|
+
Defined in: [dynamodb/dynamodb.ts:224](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L224)
|
|
358
383
|
|
|
359
384
|
Update an item in DynamoDB. The `Attributes` field on the response is
|
|
360
385
|
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:70](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [s3/s3.ts:70](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L70)
|
|
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:80](https://github.com/aligent/microservice-development-utilities/blob/
|
|
30
|
+
Defined in: [s3/s3.ts:80](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L80)
|
|
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:175](https://github.com/aligent/microservice-development-utilities/blob/
|
|
62
|
+
Defined in: [s3/s3.ts:175](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L175)
|
|
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:268](https://github.com/aligent/microservice-development-utilities/blob/
|
|
84
|
+
Defined in: [s3/s3.ts:268](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L268)
|
|
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:280](https://github.com/aligent/microservice-development-utilities/blob/
|
|
106
|
+
Defined in: [s3/s3.ts:280](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L280)
|
|
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,11 +131,21 @@ per chunk.
|
|
|
131
131
|
|
|
132
132
|
> **emptyBucket**(`bucket`): `Promise`\<`string`[]\>
|
|
133
133
|
|
|
134
|
-
Defined in: [s3/s3.ts:
|
|
134
|
+
Defined in: [s3/s3.ts:320](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L320)
|
|
135
135
|
|
|
136
|
-
Delete every object in
|
|
137
|
-
delegates each page's deletion to `deleteObjects`, so
|
|
138
|
-
bounded by one page (~1000 keys) regardless of bucket
|
|
136
|
+
Delete every object in an **unversioned** bucket. Streams the listing
|
|
137
|
+
page-by-page and delegates each page's deletion to `deleteObjects`, so
|
|
138
|
+
peak memory stays bounded by one page (~1000 keys) regardless of bucket
|
|
139
|
+
size.
|
|
140
|
+
|
|
141
|
+
**Versioned buckets are out of scope.** This paginates `ListObjectsV2`,
|
|
142
|
+
which reports only current object versions — never noncurrent versions or
|
|
143
|
+
delete markers. Against a versioned bucket the call therefore succeeds and
|
|
144
|
+
the bucket then *looks* empty to `ListObjectsV2`, but the deletes only
|
|
145
|
+
added delete markers: every object version is still stored, still billed,
|
|
146
|
+
and `DeleteBucket` will still fail with `BucketNotEmpty`. Emptying a
|
|
147
|
+
versioned bucket requires `ListObjectVersions` and per-version deletes;
|
|
148
|
+
use `S3Client` directly for that.
|
|
139
149
|
|
|
140
150
|
#### Parameters
|
|
141
151
|
|
|
@@ -147,7 +157,7 @@ bounded by one page (~1000 keys) regardless of bucket size.
|
|
|
147
157
|
|
|
148
158
|
`Promise`\<`string`[]\>
|
|
149
159
|
|
|
150
|
-
The keys
|
|
160
|
+
The keys this call issued deletes for.
|
|
151
161
|
|
|
152
162
|
***
|
|
153
163
|
|
|
@@ -157,7 +167,7 @@ The keys of every deleted object.
|
|
|
157
167
|
|
|
158
168
|
> **getAllObjects**\<`T`\>(`bucket`, `prefix?`): `Promise`\<`T`[]\>
|
|
159
169
|
|
|
160
|
-
Defined in: [s3/s3.ts:206](https://github.com/aligent/microservice-development-utilities/blob/
|
|
170
|
+
Defined in: [s3/s3.ts:206](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L206)
|
|
161
171
|
|
|
162
172
|
List and JSON-parse every object under a bucket and optional prefix.
|
|
163
173
|
Auto-paginated. Objects without a body are skipped.
|
|
@@ -192,7 +202,7 @@ Expected type of each parsed object.
|
|
|
192
202
|
|
|
193
203
|
> **getJsonObject**\<`T`\>(`input`): `Promise`\<`T` \| `undefined`\>
|
|
194
204
|
|
|
195
|
-
Defined in: [s3/s3.ts:153](https://github.com/aligent/microservice-development-utilities/blob/
|
|
205
|
+
Defined in: [s3/s3.ts:153](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L153)
|
|
196
206
|
|
|
197
207
|
Get an object from S3 and parse it as JSON.
|
|
198
208
|
|
|
@@ -228,7 +238,7 @@ If the body is non-empty and not valid JSON.
|
|
|
228
238
|
|
|
229
239
|
> **getObject**(`input`): `Promise`\<`GetObjectCommandOutput`\>
|
|
230
240
|
|
|
231
|
-
Defined in: [s3/s3.ts:127](https://github.com/aligent/microservice-development-utilities/blob/
|
|
241
|
+
Defined in: [s3/s3.ts:127](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L127)
|
|
232
242
|
|
|
233
243
|
Get an object from S3.
|
|
234
244
|
|
|
@@ -250,7 +260,7 @@ Get an object from S3.
|
|
|
250
260
|
|
|
251
261
|
> **getObjectBody**(`input`): `Promise`\<`string` \| `undefined`\>
|
|
252
262
|
|
|
253
|
-
Defined in: [s3/s3.ts:139](https://github.com/aligent/microservice-development-utilities/blob/
|
|
263
|
+
Defined in: [s3/s3.ts:139](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L139)
|
|
254
264
|
|
|
255
265
|
Get an object from S3 and return its body as a string.
|
|
256
266
|
|
|
@@ -275,7 +285,7 @@ has no body.
|
|
|
275
285
|
|
|
276
286
|
> **getPresignedUrl**(`input`): `Promise`\<`string`\>
|
|
277
287
|
|
|
278
|
-
Defined in: [s3/s3.ts:244](https://github.com/aligent/microservice-development-utilities/blob/
|
|
288
|
+
Defined in: [s3/s3.ts:244](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L244)
|
|
279
289
|
|
|
280
290
|
Generate a presigned URL that callers can use to GET or PUT an S3 object
|
|
281
291
|
directly, without going through the wrapper. The signing happens against
|
|
@@ -329,7 +339,7 @@ The S3 object key.
|
|
|
329
339
|
|
|
330
340
|
> **headObject**(`input`): `Promise`\<`HeadObjectCommandOutput`\>
|
|
331
341
|
|
|
332
|
-
Defined in: [s3/s3.ts:165](https://github.com/aligent/microservice-development-utilities/blob/
|
|
342
|
+
Defined in: [s3/s3.ts:165](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L165)
|
|
333
343
|
|
|
334
344
|
Fetch the metadata for an S3 object without downloading its body.
|
|
335
345
|
|
|
@@ -351,7 +361,7 @@ Fetch the metadata for an S3 object without downloading its body.
|
|
|
351
361
|
|
|
352
362
|
> **listObjects**(`bucket`, `prefix?`): `Promise`\<`string`[]\>
|
|
353
363
|
|
|
354
|
-
Defined in: [s3/s3.ts:186](https://github.com/aligent/microservice-development-utilities/blob/
|
|
364
|
+
Defined in: [s3/s3.ts:186](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L186)
|
|
355
365
|
|
|
356
366
|
List object keys under a bucket and optional prefix, auto-paginating
|
|
357
367
|
across all pages.
|
|
@@ -378,7 +388,7 @@ across all pages.
|
|
|
378
388
|
|
|
379
389
|
> **putJsonObject**\<`T`\>(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
380
390
|
|
|
381
|
-
Defined in: [s3/s3.ts:110](https://github.com/aligent/microservice-development-utilities/blob/
|
|
391
|
+
Defined in: [s3/s3.ts:110](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L110)
|
|
382
392
|
|
|
383
393
|
Serialise a value to JSON and store it as an S3 object.
|
|
384
394
|
|
|
@@ -412,7 +422,7 @@ Type of the value being stored.
|
|
|
412
422
|
|
|
413
423
|
> **putObject**(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
414
424
|
|
|
415
|
-
Defined in: [s3/s3.ts:94](https://github.com/aligent/microservice-development-utilities/blob/
|
|
425
|
+
Defined in: [s3/s3.ts:94](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/s3/s3.ts#L94)
|
|
416
426
|
|
|
417
427
|
Put an object into S3.
|
|
418
428
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SNSService
|
|
8
8
|
|
|
9
|
-
Defined in: [sns/sns.ts:43](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [sns/sns.ts:43](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sns/sns.ts#L43)
|
|
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:59](https://github.com/aligent/microservice-development-utilities/blob/
|
|
26
|
+
Defined in: [sns/sns.ts:59](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sns/sns.ts#L59)
|
|
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:73](https://github.com/aligent/microservice-development-utilities/blob/
|
|
68
|
+
Defined in: [sns/sns.ts:73](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sns/sns.ts#L73)
|
|
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: [sns/sns.ts:125](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sns/sns.ts#L125)
|
|
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:49](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [sqs/sqs.ts:49](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L49)
|
|
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:64](https://github.com/aligent/microservice-development-utilities/blob/
|
|
26
|
+
Defined in: [sqs/sqs.ts:64](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L64)
|
|
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: [sqs/sqs.ts:128](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L128)
|
|
68
68
|
|
|
69
69
|
Delete a single message from an SQS queue.
|
|
70
70
|
|
|
@@ -86,7 +86,7 @@ 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: [sqs/sqs.ts:164](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L164)
|
|
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
|
|
@@ -110,7 +110,7 @@ the caller's entries and sends one request per chunk.
|
|
|
110
110
|
|
|
111
111
|
> **receiveMessages**(`input`): `Promise`\<`Message`[]\>
|
|
112
112
|
|
|
113
|
-
Defined in: [sqs/sqs.ts:
|
|
113
|
+
Defined in: [sqs/sqs.ts:119](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L119)
|
|
114
114
|
|
|
115
115
|
Receive messages from an SQS queue. Returns an empty array when no
|
|
116
116
|
messages are available. No automatic deletion is performed — visibility
|
|
@@ -136,7 +136,7 @@ The `Messages` array from the response, or `[]` if absent.
|
|
|
136
136
|
|
|
137
137
|
> **sendMessage**(`input`, `opts?`): `Promise`\<`SendMessageCommandOutput`\>
|
|
138
138
|
|
|
139
|
-
Defined in: [sqs/sqs.ts:76](https://github.com/aligent/microservice-development-utilities/blob/
|
|
139
|
+
Defined in: [sqs/sqs.ts:76](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L76)
|
|
140
140
|
|
|
141
141
|
Send a single message to an SQS queue.
|
|
142
142
|
|
|
@@ -167,7 +167,7 @@ see `SEND_MESSAGE_SAFE_FIELDS`.
|
|
|
167
167
|
|
|
168
168
|
> **sendMessageBatch**(`input`): `Promise`\<`SendMessageBatchCommandOutput`[]\>
|
|
169
169
|
|
|
170
|
-
Defined in: [sqs/sqs.ts:
|
|
170
|
+
Defined in: [sqs/sqs.ts:138](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/sqs/sqs.ts#L138)
|
|
171
171
|
|
|
172
172
|
Send a batch of messages to an SQS queue. The SQS API caps
|
|
173
173
|
SendMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SSMService
|
|
8
8
|
|
|
9
|
-
Defined in: [ssm/ssm.ts:50](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [ssm/ssm.ts:50](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L50)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SSM Parameter Store client providing structured
|
|
12
12
|
Powertools logging and X-Ray tracing by default. All read operations enable
|
|
@@ -31,7 +31,7 @@ mutate within the application.
|
|
|
31
31
|
|
|
32
32
|
> **new SSMService**(`opts?`): `SSMService`
|
|
33
33
|
|
|
34
|
-
Defined in: [ssm/ssm.ts:60](https://github.com/aligent/microservice-development-utilities/blob/
|
|
34
|
+
Defined in: [ssm/ssm.ts:60](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L60)
|
|
35
35
|
|
|
36
36
|
#### Parameters
|
|
37
37
|
|
|
@@ -63,7 +63,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
63
63
|
|
|
64
64
|
> **deleteParameter**(`name`): `Promise`\<`void`\>
|
|
65
65
|
|
|
66
|
-
Defined in: [ssm/ssm.ts:139](https://github.com/aligent/microservice-development-utilities/blob/
|
|
66
|
+
Defined in: [ssm/ssm.ts:139](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L139)
|
|
67
67
|
|
|
68
68
|
Delete an SSM parameter by name.
|
|
69
69
|
|
|
@@ -88,7 +88,7 @@ runtime cleanup only.
|
|
|
88
88
|
|
|
89
89
|
> **getParameter**(`name`): `Promise`\<`string` \| `undefined`\>
|
|
90
90
|
|
|
91
|
-
Defined in: [ssm/ssm.ts:71](https://github.com/aligent/microservice-development-utilities/blob/
|
|
91
|
+
Defined in: [ssm/ssm.ts:71](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L71)
|
|
92
92
|
|
|
93
93
|
Fetch a single SSM parameter's value.
|
|
94
94
|
|
|
@@ -115,7 +115,7 @@ value set.
|
|
|
115
115
|
|
|
116
116
|
> **getParameters**\<`K`\>(`aliases`): `Promise`\<`Record`\<`K`, `string` \| `undefined`\>\>
|
|
117
117
|
|
|
118
|
-
Defined in: [ssm/ssm.ts:98](https://github.com/aligent/microservice-development-utilities/blob/
|
|
118
|
+
Defined in: [ssm/ssm.ts:98](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L98)
|
|
119
119
|
|
|
120
120
|
Fetch multiple SSM parameters in a single request. Callers supply an
|
|
121
121
|
alias-to-path record, and the returned record is keyed by the same
|
|
@@ -160,7 +160,7 @@ no value.
|
|
|
160
160
|
|
|
161
161
|
> **getParametersByPath**(`path`, `opts?`): `Promise`\<`Parameter`[]\>
|
|
162
162
|
|
|
163
|
-
Defined in: [ssm/ssm.ts:155](https://github.com/aligent/microservice-development-utilities/blob/
|
|
163
|
+
Defined in: [ssm/ssm.ts:155](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L155)
|
|
164
164
|
|
|
165
165
|
Fetch all parameters under an SSM hierarchy path, auto-paginating across
|
|
166
166
|
all pages. `Recursive` defaults to `true` (overriding the AWS SDK
|
|
@@ -199,7 +199,7 @@ The full `Parameter` objects (including `Version`,
|
|
|
199
199
|
|
|
200
200
|
> **putParameter**(`input`): `Promise`\<`PutParameterCommandOutput`\>
|
|
201
201
|
|
|
202
|
-
Defined in: [ssm/ssm.ts:126](https://github.com/aligent/microservice-development-utilities/blob/
|
|
202
|
+
Defined in: [ssm/ssm.ts:126](https://github.com/aligent/microservice-development-utilities/blob/3860e26dc8e334564280b82de4b1089851885046/packages/aws-wrappers/src/ssm/ssm.ts#L126)
|
|
203
203
|
|
|
204
204
|
Create or update an SSM parameter. The log line omits `Value` to avoid
|
|
205
205
|
leaking secret material.
|