@aligent/aws-wrappers 0.5.9 → 0.5.11
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 +78 -10
- package/cjs/index.cjs +427 -133
- package/cjs/package.json +3 -2
- package/cjs/src/dynamodb/dynamodb.d.ts +23 -4
- package/cjs/src/dynamodb/dynamodb.d.ts.map +1 -1
- package/cjs/src/eventbridge/eventbridge.d.ts.map +1 -1
- package/cjs/src/index.d.ts +1 -0
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/s3/s3.d.ts +6 -1
- package/cjs/src/s3/s3.d.ts.map +1 -1
- package/cjs/src/secrets-manager/secrets-manager.d.ts +3 -1
- package/cjs/src/secrets-manager/secrets-manager.d.ts.map +1 -1
- package/cjs/src/ses/ses.d.ts +64 -0
- package/cjs/src/ses/ses.d.ts.map +1 -0
- package/cjs/src/sns/sns.d.ts +8 -5
- package/cjs/src/sns/sns.d.ts.map +1 -1
- package/cjs/src/sqs/sqs.d.ts +7 -3
- package/cjs/src/sqs/sqs.d.ts.map +1 -1
- package/cjs/src/ssm/ssm.d.ts +3 -1
- package/cjs/src/ssm/ssm.d.ts.map +1 -1
- package/cjs/src/util/batch-operation-error.d.ts +19 -2
- package/cjs/src/util/batch-operation-error.d.ts.map +1 -1
- package/cjs/src/util/chunk.d.ts +8 -0
- package/cjs/src/util/chunk.d.ts.map +1 -1
- package/cjs/src/util/json.d.ts +14 -0
- package/cjs/src/util/json.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 +15 -6
- package/docs/index/classes/DynamoDBService.md +39 -16
- package/docs/index/classes/EventBridgeService.md +3 -3
- package/docs/index/classes/LambdaFunctionError.md +7 -7
- package/docs/index/classes/LambdaService.md +3 -3
- package/docs/index/classes/S3Service.md +24 -16
- package/docs/index/classes/SESService.md +123 -0
- package/docs/index/classes/SNSService.md +12 -9
- package/docs/index/classes/SQSService.md +14 -10
- package/docs/index/classes/SSMService.md +10 -8
- package/docs/index/classes/SchedulerService.md +11 -11
- package/docs/index/classes/SecretsManagerService.md +11 -9
- package/docs/index/classes/StepFunctionsService.md +6 -6
- package/docs/index/interfaces/BatchFailedEntry.md +6 -5
- package/docs/index/interfaces/EmptyBucketPageResult.md +2 -2
- package/docs/index/modules.md +1 -0
- package/docs/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +428 -135
- package/esm/package.json +3 -2
- package/esm/src/dynamodb/dynamodb.d.ts +23 -4
- package/esm/src/dynamodb/dynamodb.d.ts.map +1 -1
- package/esm/src/eventbridge/eventbridge.d.ts.map +1 -1
- package/esm/src/index.d.ts +1 -0
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/s3/s3.d.ts +6 -1
- package/esm/src/s3/s3.d.ts.map +1 -1
- package/esm/src/secrets-manager/secrets-manager.d.ts +3 -1
- package/esm/src/secrets-manager/secrets-manager.d.ts.map +1 -1
- package/esm/src/ses/ses.d.ts +64 -0
- package/esm/src/ses/ses.d.ts.map +1 -0
- package/esm/src/sns/sns.d.ts +8 -5
- package/esm/src/sns/sns.d.ts.map +1 -1
- package/esm/src/sqs/sqs.d.ts +7 -3
- package/esm/src/sqs/sqs.d.ts.map +1 -1
- package/esm/src/ssm/ssm.d.ts +3 -1
- package/esm/src/ssm/ssm.d.ts.map +1 -1
- package/esm/src/util/batch-operation-error.d.ts +19 -2
- package/esm/src/util/batch-operation-error.d.ts.map +1 -1
- package/esm/src/util/chunk.d.ts +8 -0
- package/esm/src/util/chunk.d.ts.map +1 -1
- package/esm/src/util/json.d.ts +14 -0
- package/esm/src/util/json.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: DynamoDBService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:206](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L206)
|
|
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: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
29
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:219](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L219)
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
@@ -61,12 +61,12 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
61
61
|
|
|
62
62
|
> **batchGet**(`input`): `Promise`\<`BatchGetCommandOutput`\>
|
|
63
63
|
|
|
64
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
64
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:367](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L367)
|
|
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
|
|
68
|
-
(200ms base delay).
|
|
69
|
-
|
|
68
|
+
(200ms base delay). `Responses` are merged across attempts, keyed by
|
|
69
|
+
table name.
|
|
70
70
|
|
|
71
71
|
Note: this method is intentionally **not** generic. `BatchGet`'s
|
|
72
72
|
`Responses` field is a multi-table `Record<string, item[]>` whose item
|
|
@@ -83,6 +83,18 @@ Callers should narrow the result type at the call site.
|
|
|
83
83
|
|
|
84
84
|
`Promise`\<`BatchGetCommandOutput`\>
|
|
85
85
|
|
|
86
|
+
#### Throws
|
|
87
|
+
|
|
88
|
+
[BatchOperationError](BatchOperationError.md) when keys remain unprocessed after
|
|
89
|
+
the final attempt. `results` holds one output: the merged `Responses`
|
|
90
|
+
retrieved so far, plus the still-pending `UnprocessedKeys` to retry.
|
|
91
|
+
`failed` has one entry per pending key with `code: 'UnprocessedKeys'`
|
|
92
|
+
and an `id` of `<table>[<index>]`, the key's position in
|
|
93
|
+
`results[0].UnprocessedKeys[<table>].Keys`. The `failed` list never
|
|
94
|
+
carries key values; `results` does, as it is data the caller requested,
|
|
95
|
+
so don't log the error object itself (see [BatchOperationError](BatchOperationError.md)).
|
|
96
|
+
Request-level SDK exceptions propagate unchanged.
|
|
97
|
+
|
|
86
98
|
***
|
|
87
99
|
|
|
88
100
|
<a id="batchwrite"></a>
|
|
@@ -91,11 +103,10 @@ Callers should narrow the result type at the call site.
|
|
|
91
103
|
|
|
92
104
|
> **batchWrite**(`input`): `Promise`\<`BatchWriteCommandOutput`\>
|
|
93
105
|
|
|
94
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
106
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:422](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L422)
|
|
95
107
|
|
|
96
108
|
Batch-write items to DynamoDB, retrying `UnprocessedItems` with jittered
|
|
97
|
-
exponential backoff. Up to 5 attempts (200ms base delay).
|
|
98
|
-
items remain unprocessed after the final attempt.
|
|
109
|
+
exponential backoff. Up to 5 attempts (200ms base delay).
|
|
99
110
|
|
|
100
111
|
#### Parameters
|
|
101
112
|
|
|
@@ -107,6 +118,18 @@ items remain unprocessed after the final attempt.
|
|
|
107
118
|
|
|
108
119
|
`Promise`\<`BatchWriteCommandOutput`\>
|
|
109
120
|
|
|
121
|
+
#### Throws
|
|
122
|
+
|
|
123
|
+
[BatchOperationError](BatchOperationError.md) when items remain unprocessed after
|
|
124
|
+
the final attempt. `results` holds one output: the last response, whose
|
|
125
|
+
`UnprocessedItems` are the writes still to retry. `failed` has one entry
|
|
126
|
+
per pending write with `code: 'UnprocessedItems'` and an `id` of
|
|
127
|
+
`<table>[<index>]`, the write's position in
|
|
128
|
+
`results[0].UnprocessedItems[<table>]`. The `failed` list never carries
|
|
129
|
+
item data; `results` does, as it is data the caller supplied, so don't
|
|
130
|
+
log the error object itself (see [BatchOperationError](BatchOperationError.md)).
|
|
131
|
+
Request-level SDK exceptions propagate unchanged.
|
|
132
|
+
|
|
110
133
|
***
|
|
111
134
|
|
|
112
135
|
<a id="deleteitem"></a>
|
|
@@ -115,7 +138,7 @@ items remain unprocessed after the final attempt.
|
|
|
115
138
|
|
|
116
139
|
> **deleteItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`DeleteCommandOutput`, `"Attributes"`\> & `object`\>
|
|
117
140
|
|
|
118
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
141
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:288](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L288)
|
|
119
142
|
|
|
120
143
|
Delete an item from DynamoDB. The `Attributes` field on the response is
|
|
121
144
|
typed as `R` — relevant when `ReturnValues: 'ALL_OLD'` is set.
|
|
@@ -156,7 +179,7 @@ Expected shape of the returned `Attributes`.
|
|
|
156
179
|
|
|
157
180
|
> **getItem**\<`K`, `R`\>(`input`): `Promise`\<`R` \| `undefined`\>
|
|
158
181
|
|
|
159
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
182
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:234](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L234)
|
|
160
183
|
|
|
161
184
|
Get an item from DynamoDB.
|
|
162
185
|
|
|
@@ -198,7 +221,7 @@ The item, or `undefined` if not found.
|
|
|
198
221
|
|
|
199
222
|
> **paginateItems**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
200
223
|
|
|
201
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
224
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:484](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L484)
|
|
202
225
|
|
|
203
226
|
Paginate over Query results, yielding one unmarshalled item at a time.
|
|
204
227
|
|
|
@@ -251,7 +274,7 @@ Expected shape of each yielded item.
|
|
|
251
274
|
|
|
252
275
|
> **paginateScan**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
253
276
|
|
|
254
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
277
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:506](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L506)
|
|
255
278
|
|
|
256
279
|
Paginate over Scan results, yielding one unmarshalled item at a time.
|
|
257
280
|
|
|
@@ -287,7 +310,7 @@ Expected shape of each yielded item.
|
|
|
287
310
|
|
|
288
311
|
> **putItem**\<`T`\>(`input`): `Promise`\<`PutCommandOutput`\>
|
|
289
312
|
|
|
290
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
313
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:250](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L250)
|
|
291
314
|
|
|
292
315
|
Put an item into DynamoDB. The caller's `Item` is typed as `T`, which
|
|
293
316
|
the document client marshalls automatically.
|
|
@@ -320,7 +343,7 @@ Type of the item being stored.
|
|
|
320
343
|
|
|
321
344
|
> **query**\<`T`\>(`input`): `Promise`\<`Omit`\<`QueryCommandOutput`, `"Items"`\> & `object`\>
|
|
322
345
|
|
|
323
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
346
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:307](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L307)
|
|
324
347
|
|
|
325
348
|
Execute a DynamoDB Query. The full `QueryCommandOutput` is returned with
|
|
326
349
|
`Items` typed as `T[]` so callers retain pagination metadata
|
|
@@ -354,7 +377,7 @@ Expected shape of each unmarshalled item.
|
|
|
354
377
|
|
|
355
378
|
> **scan**\<`T`\>(`input`): `Promise`\<`Omit`\<`ScanCommandOutput`, `"Items"`\> & `object`\>
|
|
356
379
|
|
|
357
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
380
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:336](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L336)
|
|
358
381
|
|
|
359
382
|
Scan a DynamoDB table. The full `ScanCommandOutput` is returned with
|
|
360
383
|
`Items` typed as `T[]` so callers retain pagination metadata.
|
|
@@ -400,7 +423,7 @@ Expected shape of each unmarshalled item.
|
|
|
400
423
|
|
|
401
424
|
> **updateItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`UpdateCommandOutput`, `"Attributes"`\> & `object`\>
|
|
402
425
|
|
|
403
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:
|
|
426
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:269](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L269)
|
|
404
427
|
|
|
405
428
|
Update an item in DynamoDB. The `Attributes` field on the response is
|
|
406
429
|
typed as `R` — the caller should choose `R` to match their
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: EventBridgeService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:60](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/eventbridge/eventbridge.ts#L60)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS EventBridge client providing structured Powertools
|
|
12
12
|
logging and X-Ray tracing by default.
|
|
@@ -26,7 +26,7 @@ schedules live in `SchedulerService`.
|
|
|
26
26
|
|
|
27
27
|
> **new EventBridgeService**(`opts?`): `EventBridgeService`
|
|
28
28
|
|
|
29
|
-
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:
|
|
29
|
+
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:70](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/eventbridge/eventbridge.ts#L70)
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
@@ -58,7 +58,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
58
58
|
|
|
59
59
|
> **putEvents**(`input`): `Promise`\<`PutEventsCommandOutput`[]\>
|
|
60
60
|
|
|
61
|
-
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:
|
|
61
|
+
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:104](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/eventbridge/eventbridge.ts#L104)
|
|
62
62
|
|
|
63
63
|
Publish events to an event bus. The EventBridge API caps `PutEvents` at
|
|
64
64
|
10 entries per request, so this method auto-chunks the caller's `Entries`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: LambdaFunctionError
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:21](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:21](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L21)
|
|
10
10
|
|
|
11
11
|
Thrown by `LambdaService.invoke` when a synchronous invocation reached the
|
|
12
12
|
function but the function itself failed. Lambda reports that as an HTTP 200
|
|
@@ -34,7 +34,7 @@ this package may be loaded in one process.
|
|
|
34
34
|
|
|
35
35
|
> **new LambdaFunctionError**(`functionName`, `functionError`, `payload`): `LambdaFunctionError`
|
|
36
36
|
|
|
37
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:26](https://github.com/aligent/microservice-development-utilities/blob/
|
|
37
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:26](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L26)
|
|
38
38
|
|
|
39
39
|
#### Parameters
|
|
40
40
|
|
|
@@ -80,7 +80,7 @@ Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24
|
|
|
80
80
|
|
|
81
81
|
> `readonly` **errorMessage**: `string` \| `undefined`
|
|
82
82
|
|
|
83
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:24](https://github.com/aligent/microservice-development-utilities/blob/
|
|
83
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:24](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L24)
|
|
84
84
|
|
|
85
85
|
***
|
|
86
86
|
|
|
@@ -90,7 +90,7 @@ Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:24](https:/
|
|
|
90
90
|
|
|
91
91
|
> `readonly` **errorType**: `string` \| `undefined`
|
|
92
92
|
|
|
93
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:23](https://github.com/aligent/microservice-development-utilities/blob/
|
|
93
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:23](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L23)
|
|
94
94
|
|
|
95
95
|
***
|
|
96
96
|
|
|
@@ -100,7 +100,7 @@ Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:23](https:/
|
|
|
100
100
|
|
|
101
101
|
> `readonly` **functionError**: `string`
|
|
102
102
|
|
|
103
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:28](https://github.com/aligent/microservice-development-utilities/blob/
|
|
103
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:28](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L28)
|
|
104
104
|
|
|
105
105
|
***
|
|
106
106
|
|
|
@@ -110,7 +110,7 @@ Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:28](https:/
|
|
|
110
110
|
|
|
111
111
|
> `readonly` **functionName**: `string` \| `undefined`
|
|
112
112
|
|
|
113
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:27](https://github.com/aligent/microservice-development-utilities/blob/
|
|
113
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:27](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L27)
|
|
114
114
|
|
|
115
115
|
***
|
|
116
116
|
|
|
@@ -134,7 +134,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
|
|
|
134
134
|
|
|
135
135
|
> `readonly` **name**: `"LambdaFunctionError"` = `'LambdaFunctionError'`
|
|
136
136
|
|
|
137
|
-
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:22](https://github.com/aligent/microservice-development-utilities/blob/
|
|
137
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:22](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/lambda-function-error.ts#L22)
|
|
138
138
|
|
|
139
139
|
#### Overrides
|
|
140
140
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: LambdaService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:36](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:36](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/lambda/lambda.ts#L36)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS Lambda client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -25,7 +25,7 @@ Covers `invoke` only.
|
|
|
25
25
|
|
|
26
26
|
> **new LambdaService**(`opts?`): `LambdaService`
|
|
27
27
|
|
|
28
|
-
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:46](https://github.com/aligent/microservice-development-utilities/blob/
|
|
28
|
+
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:46](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/lambda/lambda.ts#L46)
|
|
29
29
|
|
|
30
30
|
#### Parameters
|
|
31
31
|
|
|
@@ -57,7 +57,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
57
57
|
|
|
58
58
|
> **invoke**(`input`): `Promise`\<`InvokeCommandOutput`\>
|
|
59
59
|
|
|
60
|
-
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:77](https://github.com/aligent/microservice-development-utilities/blob/
|
|
60
|
+
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:77](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/lambda/lambda.ts#L77)
|
|
61
61
|
|
|
62
62
|
Invoke a Lambda function. The input is the SDK input unchanged and the
|
|
63
63
|
output is the SDK output unchanged: `Payload` stays a `Uint8Array` you
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: S3Service
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:94](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L94)
|
|
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: [packages/aws-wrappers/src/s3/s3.ts:
|
|
30
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:104](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L104)
|
|
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: [packages/aws-wrappers/src/s3/s3.ts:
|
|
62
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:201](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L201)
|
|
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: [packages/aws-wrappers/src/s3/s3.ts:
|
|
84
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:292](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L292)
|
|
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: [packages/aws-wrappers/src/s3/s3.ts:
|
|
106
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:310](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L310)
|
|
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
|
|
@@ -137,7 +137,7 @@ immediately, so earlier chunks may already have been deleted.
|
|
|
137
137
|
|
|
138
138
|
> **emptyBucket**(`bucket`): `Promise`\<`string`[]\>
|
|
139
139
|
|
|
140
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
140
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:356](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L356)
|
|
141
141
|
|
|
142
142
|
Delete every object in an **unversioned** bucket. Streams the listing
|
|
143
143
|
page-by-page and delegates each page's deletion to `deleteObjects`, so no
|
|
@@ -184,7 +184,7 @@ If S3 could not delete one or more keys.
|
|
|
184
184
|
|
|
185
185
|
> **getAllObjects**\<`T`\>(`bucket`, `prefix?`): `Promise`\<`T`[]\>
|
|
186
186
|
|
|
187
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
187
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:230](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L230)
|
|
188
188
|
|
|
189
189
|
List and JSON-parse every object under a bucket and optional prefix.
|
|
190
190
|
Auto-paginated. Objects without a body are skipped.
|
|
@@ -213,6 +213,12 @@ Expected type of each parsed object.
|
|
|
213
213
|
|
|
214
214
|
`Promise`\<`T`[]\>
|
|
215
215
|
|
|
216
|
+
#### Throws
|
|
217
|
+
|
|
218
|
+
If any object is not valid JSON. The error names that object's
|
|
219
|
+
key and never includes any of its content, unlike the native
|
|
220
|
+
`SyntaxError`; objects after it are not fetched.
|
|
221
|
+
|
|
216
222
|
***
|
|
217
223
|
|
|
218
224
|
<a id="getjsonobject"></a>
|
|
@@ -221,7 +227,7 @@ Expected type of each parsed object.
|
|
|
221
227
|
|
|
222
228
|
> **getJsonObject**\<`T`\>(`input`): `Promise`\<`T` \| `undefined`\>
|
|
223
229
|
|
|
224
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
230
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:179](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L179)
|
|
225
231
|
|
|
226
232
|
Get an object from S3 and parse it as JSON.
|
|
227
233
|
|
|
@@ -249,7 +255,9 @@ The parsed value, or `undefined` if the response has no body.
|
|
|
249
255
|
|
|
250
256
|
#### Throws
|
|
251
257
|
|
|
252
|
-
If the body is non-empty and not valid JSON.
|
|
258
|
+
If the body is non-empty and not valid JSON. The error names the
|
|
259
|
+
object and never includes any of its content, unlike the native
|
|
260
|
+
`SyntaxError`.
|
|
253
261
|
|
|
254
262
|
***
|
|
255
263
|
|
|
@@ -259,7 +267,7 @@ If the body is non-empty and not valid JSON.
|
|
|
259
267
|
|
|
260
268
|
> **getObject**(`input`): `Promise`\<`GetObjectCommandOutput`\>
|
|
261
269
|
|
|
262
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
270
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:151](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L151)
|
|
263
271
|
|
|
264
272
|
Get an object from S3.
|
|
265
273
|
|
|
@@ -281,7 +289,7 @@ Get an object from S3.
|
|
|
281
289
|
|
|
282
290
|
> **getObjectBody**(`input`): `Promise`\<`string` \| `undefined`\>
|
|
283
291
|
|
|
284
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
292
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:163](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L163)
|
|
285
293
|
|
|
286
294
|
Get an object from S3 and return its body as a string.
|
|
287
295
|
|
|
@@ -306,7 +314,7 @@ has no body.
|
|
|
306
314
|
|
|
307
315
|
> **getPresignedUrl**(`input`): `Promise`\<`string`\>
|
|
308
316
|
|
|
309
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
317
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:268](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L268)
|
|
310
318
|
|
|
311
319
|
Generate a presigned URL that callers can use to GET or PUT an S3 object
|
|
312
320
|
directly, without going through the wrapper. The signing happens against
|
|
@@ -360,7 +368,7 @@ The S3 object key.
|
|
|
360
368
|
|
|
361
369
|
> **headObject**(`input`): `Promise`\<`HeadObjectCommandOutput`\>
|
|
362
370
|
|
|
363
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
371
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:191](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L191)
|
|
364
372
|
|
|
365
373
|
Fetch the metadata for an S3 object without downloading its body.
|
|
366
374
|
|
|
@@ -382,7 +390,7 @@ Fetch the metadata for an S3 object without downloading its body.
|
|
|
382
390
|
|
|
383
391
|
> **listObjects**(`bucket`, `prefix?`): `Promise`\<`string`[]\>
|
|
384
392
|
|
|
385
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
393
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:212](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L212)
|
|
386
394
|
|
|
387
395
|
List object keys under a bucket and optional prefix, auto-paginating
|
|
388
396
|
across all pages.
|
|
@@ -409,7 +417,7 @@ across all pages.
|
|
|
409
417
|
|
|
410
418
|
> **putJsonObject**\<`T`\>(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
411
419
|
|
|
412
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
420
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:134](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L134)
|
|
413
421
|
|
|
414
422
|
Serialise a value to JSON and store it as an S3 object.
|
|
415
423
|
|
|
@@ -445,7 +453,7 @@ Type of the value being stored.
|
|
|
445
453
|
|
|
446
454
|
> **putObject**(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
447
455
|
|
|
448
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:
|
|
456
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:118](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/s3/s3.ts#L118)
|
|
449
457
|
|
|
450
458
|
Put an object into S3.
|
|
451
459
|
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
[**@aligent/aws-wrappers**](../../modules.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / SESService
|
|
6
|
+
|
|
7
|
+
# Class: SESService
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/ses/ses.ts:116](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/ses/ses.ts#L116)
|
|
10
|
+
|
|
11
|
+
Wrapper around the AWS SES v2 client providing structured Powertools logging
|
|
12
|
+
and X-Ray tracing by default.
|
|
13
|
+
|
|
14
|
+
Wraps SES v2 (`@aws-sdk/client-sesv2`), not the legacy v1 API. No defaults
|
|
15
|
+
are baked in: every send option, including `FromEmailAddress` and
|
|
16
|
+
`ConfigurationSetName`, comes from the caller.
|
|
17
|
+
|
|
18
|
+
Where a method's input carries payloads or PII, the INFO log line omits
|
|
19
|
+
them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or `TRACE`) log full
|
|
20
|
+
SDK inputs.
|
|
21
|
+
|
|
22
|
+
## Constructors
|
|
23
|
+
|
|
24
|
+
<a id="constructor"></a>
|
|
25
|
+
|
|
26
|
+
### Constructor
|
|
27
|
+
|
|
28
|
+
> **new SESService**(`opts?`): `SESService`
|
|
29
|
+
|
|
30
|
+
Defined in: [packages/aws-wrappers/src/ses/ses.ts:126](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/ses/ses.ts#L126)
|
|
31
|
+
|
|
32
|
+
#### Parameters
|
|
33
|
+
|
|
34
|
+
##### opts?
|
|
35
|
+
|
|
36
|
+
###### client?
|
|
37
|
+
|
|
38
|
+
`SESv2Client`
|
|
39
|
+
|
|
40
|
+
Optional pre-configured `SESv2Client`. When supplied,
|
|
41
|
+
the wrapper does not apply X-Ray instrumentation.
|
|
42
|
+
|
|
43
|
+
###### logger?
|
|
44
|
+
|
|
45
|
+
`LoggerInterface`
|
|
46
|
+
|
|
47
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
48
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
49
|
+
|
|
50
|
+
#### Returns
|
|
51
|
+
|
|
52
|
+
`SESService`
|
|
53
|
+
|
|
54
|
+
## Methods
|
|
55
|
+
|
|
56
|
+
<a id="sendbulkemail"></a>
|
|
57
|
+
|
|
58
|
+
### sendBulkEmail()
|
|
59
|
+
|
|
60
|
+
> **sendBulkEmail**(`input`): `Promise`\<`SendBulkEmailCommandOutput`[]\>
|
|
61
|
+
|
|
62
|
+
Defined in: [packages/aws-wrappers/src/ses/ses.ts:171](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/ses/ses.ts#L171)
|
|
63
|
+
|
|
64
|
+
Send a templated email to many destinations. SES caps `SendBulkEmail`
|
|
65
|
+
at 50 entries per request, so this method auto-chunks `BulkEmailEntries`
|
|
66
|
+
and sends one request per chunk, in order. Every chunk shares the other
|
|
67
|
+
input fields.
|
|
68
|
+
|
|
69
|
+
At INFO level the log line includes only routing metadata, the template
|
|
70
|
+
name and an entry count; see `summariseSendBulkEmail`.
|
|
71
|
+
|
|
72
|
+
SES answers HTTP 200 even when entries fail, so every chunk is sent
|
|
73
|
+
before the outcome is judged. If any entry's `Status` isn't `SUCCESS`
|
|
74
|
+
(or SES returned no result for it), a [BatchOperationError](BatchOperationError.md) is thrown whose
|
|
75
|
+
`failed[].id` is the entry's original index in `BulkEmailEntries` as a
|
|
76
|
+
string, and whose `results` are the per-chunk outputs — so a caller can
|
|
77
|
+
retry only the failed indexes. Request-level SDK exceptions are not
|
|
78
|
+
wrapped.
|
|
79
|
+
|
|
80
|
+
Sending is not idempotent: retrying the whole batch after a throw
|
|
81
|
+
re-sends the entries that succeeded.
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
##### input
|
|
86
|
+
|
|
87
|
+
`SendBulkEmailCommandInput`
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`Promise`\<`SendBulkEmailCommandOutput`[]\>
|
|
92
|
+
|
|
93
|
+
One SDK output per request sent.
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
<a id="sendemail"></a>
|
|
98
|
+
|
|
99
|
+
### sendEmail()
|
|
100
|
+
|
|
101
|
+
> **sendEmail**(`input`): `Promise`\<`SendEmailCommandOutput`\>
|
|
102
|
+
|
|
103
|
+
Defined in: [packages/aws-wrappers/src/ses/ses.ts:142](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/ses/ses.ts#L142)
|
|
104
|
+
|
|
105
|
+
Send a single email (Simple, Raw or Template content).
|
|
106
|
+
|
|
107
|
+
At INFO level the log line includes only routing metadata and a
|
|
108
|
+
recipient count; see `summariseSendEmail`.
|
|
109
|
+
|
|
110
|
+
Pass-through: SDK exceptions (`MessageRejected`, `SendingPausedException`,
|
|
111
|
+
…) propagate unwrapped.
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
##### input
|
|
116
|
+
|
|
117
|
+
`SendEmailCommandInput`
|
|
118
|
+
|
|
119
|
+
#### Returns
|
|
120
|
+
|
|
121
|
+
`Promise`\<`SendEmailCommandOutput`\>
|
|
122
|
+
|
|
123
|
+
The SDK output, including `MessageId`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SNSService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:55](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/sns/sns.ts#L55)
|
|
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: [packages/aws-wrappers/src/sns/sns.ts:
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:74](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/sns/sns.ts#L74)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -47,11 +47,14 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
47
47
|
|
|
48
48
|
`boolean`
|
|
49
49
|
|
|
50
|
-
When `true`, oversized `Message`
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
When `true`, an oversized `Message` (above 256 KiB,
|
|
51
|
+
the default topic limit — raising a topic's `MaximumMessageSize` does not
|
|
52
|
+
raise this cut-off) or `Subject` (above 99 characters) is truncated
|
|
53
|
+
(byte-safe / codepoint-safe) before sending instead of failing at the
|
|
54
|
+
SDK. Truncating a structured `Message` such as JSON can leave it invalid.
|
|
55
|
+
Defaults to `false` — the SDK throws on oversize, which is usually the
|
|
56
|
+
right failure mode. Each `publish` call can override via its own
|
|
57
|
+
`truncate` option.
|
|
55
58
|
|
|
56
59
|
#### Returns
|
|
57
60
|
|
|
@@ -65,7 +68,7 @@ its own `truncate` option.
|
|
|
65
68
|
|
|
66
69
|
> **publish**(`input`, `opts?`): `Promise`\<`PublishCommandOutput`\>
|
|
67
70
|
|
|
68
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:
|
|
71
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:88](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/sns/sns.ts#L88)
|
|
69
72
|
|
|
70
73
|
Publish a single message to an SNS topic.
|
|
71
74
|
|
|
@@ -98,7 +101,7 @@ PublishCommandInput including TopicArn and Message.
|
|
|
98
101
|
|
|
99
102
|
> **publishBatch**(`input`): `Promise`\<`PublishBatchCommandOutput`[]\>
|
|
100
103
|
|
|
101
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:
|
|
104
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:147](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/sns/sns.ts#L147)
|
|
102
105
|
|
|
103
106
|
Publish a batch of messages to an SNS topic. The SNS API caps
|
|
104
107
|
PublishBatch at 10 entries per request, so this method auto-chunks
|