@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/cjs/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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,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/cjs/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/cjs/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/cjs/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/cjs/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;AAC3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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/cjs/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/cjs/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,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,mBAAmB,CAAC,OAAO,GAAG,OAAO,CAAE,SAAQ,KAAK;IAIzD,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE;IAC3B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE;IAJvC,SAAkB,IAAI,yBAAyB;gBAGlC,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,EAAE,gBAAgB,EAAE;CAI1C;AASD;;GAEG;AACH,UAAU,aAAa;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS;IAAE,MAAM,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;CAAE,EACrF,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,GACnB,OAAO,EAAE,CASX;AAED;;GAEG;AACH,UAAU,WAAW;IACjB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,SAAS;IAAE,MAAM,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAAA;CAAE,EACzF,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,GACnB,OAAO,EAAE,CASX;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,OAAO,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"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: APIGatewayService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:30](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:30](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L30)
|
|
10
10
|
|
|
11
11
|
Read-only wrapper around the API Gateway (REST API, v1) control-plane client
|
|
12
12
|
providing structured Powertools logging and X-Ray tracing by default.
|
|
@@ -24,7 +24,7 @@ output; the wrapper never logs output, and no input carries secrets.
|
|
|
24
24
|
|
|
25
25
|
> **new APIGatewayService**(`opts?`): `APIGatewayService`
|
|
26
26
|
|
|
27
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:40](https://github.com/aligent/microservice-development-utilities/blob/
|
|
27
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:40](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L40)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -56,7 +56,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
56
56
|
|
|
57
57
|
> **getApiKey**(`input`): `Promise`\<`GetApiKeyCommandOutput`\>
|
|
58
58
|
|
|
59
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:71](https://github.com/aligent/microservice-development-utilities/blob/
|
|
59
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:71](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L71)
|
|
60
60
|
|
|
61
61
|
Fetch a single API key, including its secret value.
|
|
62
62
|
|
|
@@ -82,7 +82,7 @@ NotFoundException when the key does not exist.
|
|
|
82
82
|
|
|
83
83
|
> **getApiKeys**(`input?`): `Promise`\<`ApiKey`[]\>
|
|
84
84
|
|
|
85
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:59](https://github.com/aligent/microservice-development-utilities/blob/
|
|
85
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:59](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L59)
|
|
86
86
|
|
|
87
87
|
List API keys, including their secret values. Auto-paginated.
|
|
88
88
|
|
|
@@ -104,7 +104,7 @@ List API keys, including their secret values. Auto-paginated.
|
|
|
104
104
|
|
|
105
105
|
> **getResources**(`input`): `Promise`\<`Resource`[]\>
|
|
106
106
|
|
|
107
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:83](https://github.com/aligent/microservice-development-utilities/blob/
|
|
107
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:83](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L83)
|
|
108
108
|
|
|
109
109
|
List every resource (path) of a REST API, which is how REST APIs expose
|
|
110
110
|
their routes. Pass `embed: ['methods']` to include each resource's
|
|
@@ -128,7 +128,7 @@ methods. Auto-paginated.
|
|
|
128
128
|
|
|
129
129
|
> **getRestApis**(`input?`): `Promise`\<`RestApi`[]\>
|
|
130
130
|
|
|
131
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:48](https://github.com/aligent/microservice-development-utilities/blob/
|
|
131
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:48](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L48)
|
|
132
132
|
|
|
133
133
|
List every REST API in the account and region. Auto-paginated.
|
|
134
134
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: APIGatewayV2Service
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:26](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:26](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L26)
|
|
10
10
|
|
|
11
11
|
Read-only wrapper around the API Gateway v2 (HTTP and WebSocket APIs)
|
|
12
12
|
control-plane client providing structured Powertools logging and X-Ray
|
|
@@ -23,7 +23,7 @@ follow `NextToken` manually.
|
|
|
23
23
|
|
|
24
24
|
> **new APIGatewayV2Service**(`opts?`): `APIGatewayV2Service`
|
|
25
25
|
|
|
26
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:36](https://github.com/aligent/microservice-development-utilities/blob/
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:36](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L36)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -55,7 +55,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
55
55
|
|
|
56
56
|
> **getApis**(`input?`): `Promise`\<`Api`[]\>
|
|
57
57
|
|
|
58
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:45](https://github.com/aligent/microservice-development-utilities/blob/
|
|
58
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:45](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L45)
|
|
59
59
|
|
|
60
60
|
List every HTTP and WebSocket API in the account and region.
|
|
61
61
|
Auto-paginated.
|
|
@@ -78,7 +78,7 @@ Auto-paginated.
|
|
|
78
78
|
|
|
79
79
|
> **getRoute**(`input`): `Promise`\<`GetRouteCommandOutput`\>
|
|
80
80
|
|
|
81
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:58](https://github.com/aligent/microservice-development-utilities/blob/
|
|
81
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:58](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L58)
|
|
82
82
|
|
|
83
83
|
Fetch a single route of an HTTP or WebSocket API.
|
|
84
84
|
|
|
@@ -104,7 +104,7 @@ NotFoundException when the route does not exist.
|
|
|
104
104
|
|
|
105
105
|
> **getRoutes**(`input`): `Promise`\<`Route`[]\>
|
|
106
106
|
|
|
107
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:66](https://github.com/aligent/microservice-development-utilities/blob/
|
|
107
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:66](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L66)
|
|
108
108
|
|
|
109
109
|
List every route of an HTTP or WebSocket API. Auto-paginated.
|
|
110
110
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BatchOperationError\<TResult\>
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:38](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/batch-operation-error.ts#L38)
|
|
10
10
|
|
|
11
11
|
Thrown by the batch methods once every chunk has been sent and at least one
|
|
12
12
|
entry was rejected.
|
|
@@ -14,9 +14,18 @@ entry was rejected.
|
|
|
14
14
|
`results` holds the raw SDK output of every chunk, so the outputs of the
|
|
15
15
|
entries that succeeded (message ids, sequence numbers) stay readable. The
|
|
16
16
|
exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
|
|
17
|
-
|
|
17
|
+
`SSM.getParameters`, whose `results` are empty, and the DynamoDB batch
|
|
18
|
+
methods, whose `results` hold a single output (the last response, with the
|
|
19
|
+
`Responses` merged so far for `batchGet`) carrying what is still pending.
|
|
18
20
|
`failed` is the normalised list of rejected entries across all chunks.
|
|
19
21
|
|
|
22
|
+
Do not pass the error object itself to a logger. `results` is an enumerable
|
|
23
|
+
property and the Powertools logger serialises every enumerable property of
|
|
24
|
+
an error, so `logger.error('…', error)` writes `results` to the log — which
|
|
25
|
+
for the DynamoDB batch methods holds the caller's keys and items. Log `name`,
|
|
26
|
+
`message` and `failed`, which never carry a payload, and read `results` only
|
|
27
|
+
to retry or recover.
|
|
28
|
+
|
|
20
29
|
Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
21
30
|
this package may be loaded in one process.
|
|
22
31
|
|
|
@@ -40,7 +49,7 @@ this package may be loaded in one process.
|
|
|
40
49
|
|
|
41
50
|
> **new BatchOperationError**\<`TResult`\>(`results`, `failed`): `BatchOperationError`\<`TResult`\>
|
|
42
51
|
|
|
43
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
52
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:41](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/batch-operation-error.ts#L41)
|
|
44
53
|
|
|
45
54
|
#### Parameters
|
|
46
55
|
|
|
@@ -82,7 +91,7 @@ Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24
|
|
|
82
91
|
|
|
83
92
|
> `readonly` **failed**: [`BatchFailedEntry`](../interfaces/BatchFailedEntry.md)[]
|
|
84
93
|
|
|
85
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
94
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:43](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/batch-operation-error.ts#L43)
|
|
86
95
|
|
|
87
96
|
***
|
|
88
97
|
|
|
@@ -106,7 +115,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
|
|
|
106
115
|
|
|
107
116
|
> `readonly` **name**: `"BatchOperationError"` = `'BatchOperationError'`
|
|
108
117
|
|
|
109
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
118
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:39](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/batch-operation-error.ts#L39)
|
|
110
119
|
|
|
111
120
|
#### Overrides
|
|
112
121
|
|
|
@@ -120,7 +129,7 @@ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:29](https:/
|
|
|
120
129
|
|
|
121
130
|
> `readonly` **results**: `TResult`[]
|
|
122
131
|
|
|
123
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
132
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:42](https://github.com/aligent/microservice-development-utilities/blob/27475744987d7ba5a02f8568491326793a14edb4/packages/aws-wrappers/src/util/batch-operation-error.ts#L42)
|
|
124
133
|
|
|
125
134
|
***
|
|
126
135
|
|
|
@@ -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:60](https://github.com/aligent/microservice-development-utilities/blob/
|
|
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:70](https://github.com/aligent/microservice-development-utilities/blob/
|
|
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:104](https://github.com/aligent/microservice-development-utilities/blob/
|
|
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
|
|