@aligent/aws-wrappers 0.5.9 → 0.5.10
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 +43 -2
- package/cjs/index.cjs +148 -8
- package/cjs/package.json +2 -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/ses/ses.d.ts +64 -0
- package/cjs/src/ses/ses.d.ts.map +1 -0
- package/cjs/src/util/chunk.d.ts +8 -0
- package/cjs/src/util/chunk.d.ts.map +1 -1
- package/docs/index/classes/APIGatewayService.md +6 -6
- package/docs/index/classes/APIGatewayV2Service.md +5 -5
- package/docs/index/classes/BatchOperationError.md +5 -5
- package/docs/index/classes/DynamoDBService.md +12 -12
- 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 +15 -15
- package/docs/index/classes/SESService.md +123 -0
- package/docs/index/classes/SNSService.md +4 -4
- package/docs/index/classes/SQSService.md +7 -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 +4 -4
- 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 +148 -9
- package/esm/package.json +2 -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/ses/ses.d.ts +64 -0
- package/esm/src/ses/ses.d.ts.map +1 -0
- package/esm/src/util/chunk.d.ts +8 -0
- package/esm/src/util/chunk.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
2
|
+
import { SendBulkEmailCommandInput, SendBulkEmailCommandOutput, SendEmailCommandInput, SendEmailCommandOutput, SESv2Client } from '@aws-sdk/client-sesv2';
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper around the AWS SES v2 client providing structured Powertools logging
|
|
5
|
+
* and X-Ray tracing by default.
|
|
6
|
+
*
|
|
7
|
+
* Wraps SES v2 (`@aws-sdk/client-sesv2`), not the legacy v1 API. No defaults
|
|
8
|
+
* are baked in: every send option, including `FromEmailAddress` and
|
|
9
|
+
* `ConfigurationSetName`, comes from the caller.
|
|
10
|
+
*
|
|
11
|
+
* Where a method's input carries payloads or PII, the INFO log line omits
|
|
12
|
+
* them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or `TRACE`) log full
|
|
13
|
+
* SDK inputs.
|
|
14
|
+
*/
|
|
15
|
+
export declare class SESService {
|
|
16
|
+
private readonly client;
|
|
17
|
+
private readonly logger;
|
|
18
|
+
/**
|
|
19
|
+
* @param opts.logger - Optional Powertools logger. Defaults to `new Logger()`,
|
|
20
|
+
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
21
|
+
* @param opts.client - Optional pre-configured `SESv2Client`. When supplied,
|
|
22
|
+
* the wrapper does not apply X-Ray instrumentation.
|
|
23
|
+
*/
|
|
24
|
+
constructor(opts?: {
|
|
25
|
+
logger?: LoggerInterface;
|
|
26
|
+
client?: SESv2Client;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Send a single email (Simple, Raw or Template content).
|
|
30
|
+
*
|
|
31
|
+
* At INFO level the log line includes only routing metadata and a
|
|
32
|
+
* recipient count; see `summariseSendEmail`.
|
|
33
|
+
*
|
|
34
|
+
* Pass-through: SDK exceptions (`MessageRejected`, `SendingPausedException`,
|
|
35
|
+
* …) propagate unwrapped.
|
|
36
|
+
*
|
|
37
|
+
* @returns The SDK output, including `MessageId`.
|
|
38
|
+
*/
|
|
39
|
+
sendEmail(input: SendEmailCommandInput): Promise<SendEmailCommandOutput>;
|
|
40
|
+
/**
|
|
41
|
+
* Send a templated email to many destinations. SES caps `SendBulkEmail`
|
|
42
|
+
* at 50 entries per request, so this method auto-chunks `BulkEmailEntries`
|
|
43
|
+
* and sends one request per chunk, in order. Every chunk shares the other
|
|
44
|
+
* input fields.
|
|
45
|
+
*
|
|
46
|
+
* At INFO level the log line includes only routing metadata, the template
|
|
47
|
+
* name and an entry count; see `summariseSendBulkEmail`.
|
|
48
|
+
*
|
|
49
|
+
* SES answers HTTP 200 even when entries fail, so every chunk is sent
|
|
50
|
+
* before the outcome is judged. If any entry's `Status` isn't `SUCCESS`
|
|
51
|
+
* (or SES returned no result for it), a {@link BatchOperationError} is thrown whose
|
|
52
|
+
* `failed[].id` is the entry's original index in `BulkEmailEntries` as a
|
|
53
|
+
* string, and whose `results` are the per-chunk outputs — so a caller can
|
|
54
|
+
* retry only the failed indexes. Request-level SDK exceptions are not
|
|
55
|
+
* wrapped.
|
|
56
|
+
*
|
|
57
|
+
* Sending is not idempotent: retrying the whole batch after a throw
|
|
58
|
+
* re-sends the entries that succeeded.
|
|
59
|
+
*
|
|
60
|
+
* @returns One SDK output per request sent.
|
|
61
|
+
*/
|
|
62
|
+
sendBulkEmail(input: SendBulkEmailCommandInput): Promise<SendBulkEmailCommandOutput[]>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=ses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ses.d.ts","sourceRoot":"","sources":["../../../../src/ses/ses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAGH,yBAAyB,EACzB,0BAA0B,EAE1B,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACd,MAAM,uBAAuB,CAAC;AA4F/B;;;;;;;;;;;GAWG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE;IAKrE;;;;;;;;;;OAUG;IACG,SAAS,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAO9E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;CAoB/F"}
|
package/esm/src/util/chunk.d.ts
CHANGED
|
@@ -3,4 +3,12 @@
|
|
|
3
3
|
* per-request caps the AWS APIs enforce on batch operations.
|
|
4
4
|
*/
|
|
5
5
|
export declare function chunk<T>(items: readonly T[], size: number): T[][];
|
|
6
|
+
/**
|
|
7
|
+
* The index, as a string, that an entry had in the list `chunk` split, given
|
|
8
|
+
* its chunk number and its position within that chunk. Batch operations whose
|
|
9
|
+
* entries carry no identifier of their own report failures by this index.
|
|
10
|
+
* `chunk` fills every chunk but the last, so the chunk's offset is the chunk
|
|
11
|
+
* number times the chunk size.
|
|
12
|
+
*/
|
|
13
|
+
export declare function originalIndex(chunkIndex: number, chunkSize: number, position: number): string;
|
|
6
14
|
//# sourceMappingURL=chunk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../../../src/util/chunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAMjE"}
|
|
1
|
+
{"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../../../src/util/chunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@aws-sdk/client-s3": "^3.1160.0",
|
|
53
53
|
"@aws-sdk/client-scheduler": "^3.1160.0",
|
|
54
54
|
"@aws-sdk/client-secrets-manager": "^3.1160.0",
|
|
55
|
+
"@aws-sdk/client-sesv2": "^3.1160.0",
|
|
55
56
|
"@aws-sdk/client-sfn": "^3.1160.0",
|
|
56
57
|
"@aws-sdk/client-sns": "^3.1160.0",
|
|
57
58
|
"@aws-sdk/client-sqs": "^3.1160.0",
|