@aligent/aws-wrappers 0.5.10 → 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 +36 -9
- package/cjs/index.cjs +279 -125
- package/cjs/package.json +2 -2
- package/cjs/src/dynamodb/dynamodb.d.ts +23 -4
- package/cjs/src/dynamodb/dynamodb.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/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/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 +4 -4
- 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/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +280 -126
- package/esm/package.json +2 -2
- package/esm/src/dynamodb/dynamodb.d.ts +23 -4
- package/esm/src/dynamodb/dynamodb.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/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/json.d.ts +14 -0
- package/esm/src/util/json.d.ts.map +1 -0
- package/package.json +2 -2
package/esm/src/s3/s3.d.ts
CHANGED
|
@@ -75,7 +75,9 @@ export declare class S3Service {
|
|
|
75
75
|
* Get an object from S3 and parse it as JSON.
|
|
76
76
|
* @template T - Expected type of the parsed value.
|
|
77
77
|
* @returns The parsed value, or `undefined` if the response has no body.
|
|
78
|
-
* @throws If the body is non-empty and not valid JSON.
|
|
78
|
+
* @throws If the body is non-empty and not valid JSON. The error names the
|
|
79
|
+
* object and never includes any of its content, unlike the native
|
|
80
|
+
* `SyntaxError`.
|
|
79
81
|
*/
|
|
80
82
|
getJsonObject<T>(input: Required<Pick<GetObjectCommandInput, 'Bucket' | 'Key'>>): Promise<T | undefined>;
|
|
81
83
|
/**
|
|
@@ -95,6 +97,9 @@ export declare class S3Service {
|
|
|
95
97
|
* List and JSON-parse every object under a bucket and optional prefix.
|
|
96
98
|
* Auto-paginated. Objects without a body are skipped.
|
|
97
99
|
* @template T - Expected type of each parsed object.
|
|
100
|
+
* @throws If any object is not valid JSON. The error names that object's
|
|
101
|
+
* key and never includes any of its content, unlike the native
|
|
102
|
+
* `SyntaxError`; objects after it are not fetched.
|
|
98
103
|
*/
|
|
99
104
|
getAllObjects<T>(bucket: string, prefix?: string): Promise<T[]>;
|
|
100
105
|
/**
|
package/esm/src/s3/s3.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../../src/s3/s3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,sBAAsB,EACtB,uBAAuB,EAEvB,wBAAwB,EACxB,yBAAyB,EAEzB,0BAA0B,EAE1B,qBAAqB,EACrB,sBAAsB,EAEtB,sBAAsB,EACtB,uBAAuB,EAGvB,qBAAqB,EACrB,sBAAsB,EACtB,QAAQ,EACX,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../../src/s3/s3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,sBAAsB,EACtB,uBAAuB,EAEvB,wBAAwB,EACxB,yBAAyB,EAEzB,0BAA0B,EAE1B,qBAAqB,EACrB,sBAAsB,EAEtB,sBAAsB,EACtB,uBAAuB,EAGvB,qBAAqB,EACrB,sBAAsB,EACtB,QAAQ,EACX,MAAM,oBAAoB,CAAC;AAyB5B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,6CAA6C;IAC7C,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,gDAAgD;AAChD,KAAK,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AAEvF,oDAAoD;AACpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IACzB,MAAM,EAAE,MAAM,CAA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AKnC;;OAEG;IACG,UAAU,CACZ,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAC,CAAC,GAC/E,OAAO,CAAC,uBAAuB,CAAC;IAKnC;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAUrE;;;;;;;OAOG;IACG,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAoBrE;;;;;;;;;;;;;;;;;OAiBG;IACG,eAAe,CAAC,KAAK,EAAE;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBnB;;OAEG;IACG,YAAY,CACd,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC,GAClE,OAAO,CAAC,yBAAyB,CAAC;IAKrC;;;;;;;;;;OAUG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAqB1F;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAgBtC,UAAU;CAgB3B"}
|
|
@@ -42,7 +42,9 @@ export declare class SecretsManagerService {
|
|
|
42
42
|
* @param secretId - The ARN or friendly name of the secret.
|
|
43
43
|
* @template T - Expected shape of the parsed secret.
|
|
44
44
|
* @returns The parsed secret value.
|
|
45
|
-
* @throws If the secret has no `SecretString
|
|
45
|
+
* @throws If the secret has no `SecretString`, or the value is not valid
|
|
46
|
+
* JSON. The latter error names the secret and never includes any of its
|
|
47
|
+
* value, unlike the native `SyntaxError`.
|
|
46
48
|
*/
|
|
47
49
|
getJsonSecret<T>(secretId: string): Promise<T>;
|
|
48
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-manager.d.ts","sourceRoot":"","sources":["../../../../src/secrets-manager/secrets-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,wBAAwB,EACxB,yBAAyB,EAEzB,wBAAwB,EACxB,yBAAyB,EAGzB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EAEpB,wBAAwB,EACxB,yBAAyB,EAC5B,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"secrets-manager.d.ts","sourceRoot":"","sources":["../../../../src/secrets-manager/secrets-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,wBAAwB,EACxB,yBAAyB,EAEzB,wBAAwB,EACxB,yBAAyB,EAGzB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EAEpB,wBAAwB,EACxB,yBAAyB,EAC5B,MAAM,iCAAiC,CAAC;AA2CzC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;;OAMG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,oBAAoB,CAAA;KAAE;IAK9E;;;;;;OAMG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKlD;;;;;;;;OAQG;IACG,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAMpD;;;;;;OAMG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAOvF;;;;;;OAMG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAOvF;;;;;OAKG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAO7F;;;;;OAKG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;YAOzE,iBAAiB;CASlC"}
|
package/esm/src/sns/sns.d.ts
CHANGED
|
@@ -17,11 +17,14 @@ export declare class SNSService {
|
|
|
17
17
|
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
18
18
|
* @param opts.client - Optional pre-configured `SNSClient`. When supplied,
|
|
19
19
|
* the wrapper does not apply X-Ray instrumentation.
|
|
20
|
-
* @param opts.truncate - When `true`, oversized `Message`
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* @param opts.truncate - When `true`, an oversized `Message` (above 256 KiB,
|
|
21
|
+
* the default topic limit — raising a topic's `MaximumMessageSize` does not
|
|
22
|
+
* raise this cut-off) or `Subject` (above 99 characters) is truncated
|
|
23
|
+
* (byte-safe / codepoint-safe) before sending instead of failing at the
|
|
24
|
+
* SDK. Truncating a structured `Message` such as JSON can leave it invalid.
|
|
25
|
+
* Defaults to `false` — the SDK throws on oversize, which is usually the
|
|
26
|
+
* right failure mode. Each `publish` call can override via its own
|
|
27
|
+
* `truncate` option.
|
|
25
28
|
*/
|
|
26
29
|
constructor(opts?: {
|
|
27
30
|
logger?: LoggerInterface;
|
package/esm/src/sns/sns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sns.d.ts","sourceRoot":"","sources":["../../../../src/sns/sns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,wBAAwB,EACxB,yBAAyB,EAGzB,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACZ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sns.d.ts","sourceRoot":"","sources":["../../../../src/sns/sns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,wBAAwB,EACxB,yBAAyB,EAGzB,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAmC7B;;;;;;;GAOG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC;;;;;;;;;;;;;OAaG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;IAMvF;;;;;;;OAOG;IACG,OAAO,CACT,KAAK,EAAE,mBAAmB,EAC1B,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IAShC;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IA0BvB;;;;;;;;;;;;;OAaG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAqB5F"}
|
package/esm/src/sqs/sqs.d.ts
CHANGED
|
@@ -17,9 +17,13 @@ export declare class SQSService {
|
|
|
17
17
|
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
18
18
|
* @param opts.client - Optional pre-configured `SQSClient`. When supplied,
|
|
19
19
|
* the wrapper does not apply X-Ray instrumentation.
|
|
20
|
-
* @param opts.truncate - When `true`,
|
|
21
|
-
* (byte-safe) before sending instead of failing at the SDK.
|
|
22
|
-
*
|
|
20
|
+
* @param opts.truncate - When `true`, a `MessageBody` above 1 MiB is
|
|
21
|
+
* truncated (byte-safe) before sending instead of failing at the SDK. This
|
|
22
|
+
* is the SQS maximum; a queue configured with a lower `MaximumMessageSize`
|
|
23
|
+
* is not known to the wrapper. Message attributes count toward the limit
|
|
24
|
+
* too and are not truncated.
|
|
25
|
+
* Truncating a structured body such as JSON can leave it invalid. Defaults
|
|
26
|
+
* to `false`. Each `sendMessage` call can override via its own `truncate`
|
|
23
27
|
* option.
|
|
24
28
|
*/
|
|
25
29
|
constructor(opts?: {
|
package/esm/src/sqs/sqs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqs.d.ts","sourceRoot":"","sources":["../../../../src/sqs/sqs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,8BAA8B,EAC9B,+BAA+B,EAG/B,yBAAyB,EACzB,0BAA0B,EAC1B,OAAO,EAEP,0BAA0B,EAE1B,4BAA4B,EAC5B,6BAA6B,EAG7B,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACZ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sqs.d.ts","sourceRoot":"","sources":["../../../../src/sqs/sqs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,8BAA8B,EAC9B,+BAA+B,EAG/B,yBAAyB,EACzB,0BAA0B,EAC1B,OAAO,EAEP,0BAA0B,EAE1B,4BAA4B,EAC5B,6BAA6B,EAG7B,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAsC7B;;;;;;;GAOG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC;;;;;;;;;;;;;OAaG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;IAMvF;;;;;OAKG;IACG,WAAW,CACb,KAAK,EAAE,uBAAuB,EAC9B,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9B,OAAO,CAAC,wBAAwB,CAAC;IASpC;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;OAKG;IACG,eAAe,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAM5E;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAK1F;;;;;;;;;;OAUG;IACG,gBAAgB,CAClB,KAAK,EAAE,4BAA4B,GACpC,OAAO,CAAC,6BAA6B,EAAE,CAAC;IAc3C;;;;;;;;;;;OAWG;IACG,kBAAkB,CACpB,KAAK,EAAE,8BAA8B,GACtC,OAAO,CAAC,+BAA+B,EAAE,CAAC;CAahD"}
|
package/esm/src/ssm/ssm.d.ts
CHANGED
|
@@ -66,7 +66,9 @@ export declare class SSMService {
|
|
|
66
66
|
* alias in `message`. Request-level SDK exceptions are not wrapped.
|
|
67
67
|
*
|
|
68
68
|
* @param aliases - Record mapping each desired local alias to its SSM
|
|
69
|
-
* parameter name
|
|
69
|
+
* parameter name, ARN, or a `name:version` / `name:label` selector. The
|
|
70
|
+
* value is matched back to the response by the name, ARN and selector SSM
|
|
71
|
+
* reports, so each of those forms resolves to its own parameter.
|
|
70
72
|
* @param opts.required - Throw when any requested parameter does not
|
|
71
73
|
* exist. Defaults to `false`.
|
|
72
74
|
* @returns A record keyed by the same aliases, mapping each to the
|
package/esm/src/ssm/ssm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssm.d.ts","sourceRoot":"","sources":["../../../../src/ssm/ssm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAKH,SAAS,EAET,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACZ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ssm.d.ts","sourceRoot":"","sources":["../../../../src/ssm/ssm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAKH,SAAS,EAET,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAyD7B;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,CAAA;KAAE;IAKnE;;;;;;;;OAQG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQ7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACG,aAAa,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,EAC1B,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAiCzC;;;;;;OAMG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAOvF;;;;;OAKG;IACG,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD;;;;;;;;;;OAUG;IACG,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAWhG"}
|
|
@@ -3,7 +3,8 @@ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
|
3
3
|
* One entry a batch operation rejected. Deliberately limited to identifier,
|
|
4
4
|
* code and message so the error never carries message bodies, attributes or
|
|
5
5
|
* any other payload the caller sent. For S3 the identifier is the object key;
|
|
6
|
-
* for SSM it is the parameter path
|
|
6
|
+
* for SSM it is the parameter path; for DynamoDB it is `<table>[<index>]`,
|
|
7
|
+
* since a key or item is caller data.
|
|
7
8
|
*/
|
|
8
9
|
export interface BatchFailedEntry {
|
|
9
10
|
id: string | undefined;
|
|
@@ -17,9 +18,18 @@ export interface BatchFailedEntry {
|
|
|
17
18
|
* `results` holds the raw SDK output of every chunk, so the outputs of the
|
|
18
19
|
* entries that succeeded (message ids, sequence numbers) stay readable. The
|
|
19
20
|
* exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
|
|
20
|
-
*
|
|
21
|
+
* `SSM.getParameters`, whose `results` are empty, and the DynamoDB batch
|
|
22
|
+
* methods, whose `results` hold a single output (the last response, with the
|
|
23
|
+
* `Responses` merged so far for `batchGet`) carrying what is still pending.
|
|
21
24
|
* `failed` is the normalised list of rejected entries across all chunks.
|
|
22
25
|
*
|
|
26
|
+
* Do not pass the error object itself to a logger. `results` is an enumerable
|
|
27
|
+
* property and the Powertools logger serialises every enumerable property of
|
|
28
|
+
* an error, so `logger.error('…', error)` writes `results` to the log — which
|
|
29
|
+
* for the DynamoDB batch methods holds the caller's keys and items. Log `name`,
|
|
30
|
+
* `message` and `failed`, which never carry a payload, and read `results` only
|
|
31
|
+
* to retry or recover.
|
|
32
|
+
*
|
|
23
33
|
* Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
24
34
|
* this package may be loaded in one process.
|
|
25
35
|
*/
|
|
@@ -75,5 +85,12 @@ export declare function throwIfAnyDeleteErrors<TResult extends {
|
|
|
75
85
|
* and the warning.
|
|
76
86
|
*/
|
|
77
87
|
export declare function throwIfAny<TResult>(logger: LoggerInterface, operation: string, results: TResult[], failed: BatchFailedEntry[]): TResult[];
|
|
88
|
+
/**
|
|
89
|
+
* The warn-and-throw half of {@link throwIfAny}, for callers that already know
|
|
90
|
+
* `failed` is non-empty and need the compiler to see that the call never
|
|
91
|
+
* returns. The same rule applies: build `failed` by copying id, code and
|
|
92
|
+
* message explicitly.
|
|
93
|
+
*/
|
|
94
|
+
export declare function throwBatchFailure<TResult>(logger: LoggerInterface, operation: string, results: TResult[], failed: BatchFailedEntry[]): never;
|
|
78
95
|
export {};
|
|
79
96
|
//# sourceMappingURL=batch-operation-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-operation-error.d.ts","sourceRoot":"","sources":["../../../../src/util/batch-operation-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E
|
|
1
|
+
{"version":3,"file":"batch-operation-error.d.ts","sourceRoot":"","sources":["../../../../src/util/batch-operation-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,GAAG,SAAS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AAO,EAC9B,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,EAAE,gBAAgB,EAAE,GAC3B,OAAO,EAAE,CAGX;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EACrC,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,EAAE,gBAAgB,EAAE,GAC3B,KAAK,CAMP"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `JSON.parse` that never leaks the parsed text. V8's `SyntaxError` message
|
|
3
|
+
* embeds a snippet of the input (`Unexpected token 'h', ..."assword": hunter2}"
|
|
4
|
+
* is not valid JSON`), and the wrappers parse secrets and stored objects, so
|
|
5
|
+
* letting it through would put that content into the caller's error logs.
|
|
6
|
+
*
|
|
7
|
+
* The original error is deliberately not attached as `cause`: loggers serialise
|
|
8
|
+
* `cause` and its message carries the snippet. `context` should identify the
|
|
9
|
+
* source (a secret id, a bucket and key) so the failure is still diagnosable.
|
|
10
|
+
*
|
|
11
|
+
* @throws An `Error` naming `context`, without any of the input text.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseJson<T>(text: string, context: string): T;
|
|
14
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/util/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAM7D"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=20"
|
|
7
7
|
},
|
|
8
8
|
"main": "./cjs/index.cjs",
|
|
9
9
|
"module": "./esm/index.mjs",
|