@aligent/aws-wrappers 0.5.7 → 0.5.9

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.
Files changed (56) hide show
  1. package/README.md +106 -4
  2. package/cjs/index.cjs +393 -66
  3. package/cjs/package.json +16 -14
  4. package/cjs/src/eventbridge/eventbridge.d.ts +58 -0
  5. package/cjs/src/eventbridge/eventbridge.d.ts.map +1 -0
  6. package/cjs/src/index.d.ts +4 -0
  7. package/cjs/src/index.d.ts.map +1 -1
  8. package/cjs/src/lambda/lambda.d.ts +54 -0
  9. package/cjs/src/lambda/lambda.d.ts.map +1 -0
  10. package/cjs/src/s3/s3.d.ts +26 -4
  11. package/cjs/src/s3/s3.d.ts.map +1 -1
  12. package/cjs/src/scheduler/scheduler.d.ts +3 -2
  13. package/cjs/src/scheduler/scheduler.d.ts.map +1 -1
  14. package/cjs/src/ssm/ssm.d.ts +18 -3
  15. package/cjs/src/ssm/ssm.d.ts.map +1 -1
  16. package/cjs/src/util/batch-operation-error.d.ts +33 -4
  17. package/cjs/src/util/batch-operation-error.d.ts.map +1 -1
  18. package/cjs/src/util/lambda-function-error.d.ts +36 -0
  19. package/cjs/src/util/lambda-function-error.d.ts.map +1 -0
  20. package/docs/index/classes/APIGatewayService.md +6 -6
  21. package/docs/index/classes/APIGatewayV2Service.md +5 -5
  22. package/docs/index/classes/BatchOperationError.md +10 -6
  23. package/docs/index/classes/DynamoDBService.md +34 -12
  24. package/docs/index/classes/EventBridgeService.md +99 -0
  25. package/docs/index/classes/LambdaFunctionError.md +283 -0
  26. package/docs/index/classes/LambdaService.md +95 -0
  27. package/docs/index/classes/S3Service.md +42 -19
  28. package/docs/index/classes/SNSService.md +4 -4
  29. package/docs/index/classes/SQSService.md +7 -7
  30. package/docs/index/classes/SSMService.md +35 -10
  31. package/docs/index/classes/SchedulerService.md +14 -13
  32. package/docs/index/classes/SecretsManagerService.md +10 -8
  33. package/docs/index/classes/StepFunctionsService.md +6 -6
  34. package/docs/index/interfaces/BatchFailedEntry.md +6 -5
  35. package/docs/index/interfaces/EmptyBucketPageResult.md +23 -0
  36. package/docs/index/modules.md +4 -0
  37. package/docs/testing/testing/functions/createMockService.md +5 -1
  38. package/esm/index.mjs +391 -67
  39. package/esm/package.json +16 -14
  40. package/esm/src/eventbridge/eventbridge.d.ts +58 -0
  41. package/esm/src/eventbridge/eventbridge.d.ts.map +1 -0
  42. package/esm/src/index.d.ts +4 -0
  43. package/esm/src/index.d.ts.map +1 -1
  44. package/esm/src/lambda/lambda.d.ts +54 -0
  45. package/esm/src/lambda/lambda.d.ts.map +1 -0
  46. package/esm/src/s3/s3.d.ts +26 -4
  47. package/esm/src/s3/s3.d.ts.map +1 -1
  48. package/esm/src/scheduler/scheduler.d.ts +3 -2
  49. package/esm/src/scheduler/scheduler.d.ts.map +1 -1
  50. package/esm/src/ssm/ssm.d.ts +18 -3
  51. package/esm/src/ssm/ssm.d.ts.map +1 -1
  52. package/esm/src/util/batch-operation-error.d.ts +33 -4
  53. package/esm/src/util/batch-operation-error.d.ts.map +1 -1
  54. package/esm/src/util/lambda-function-error.d.ts +36 -0
  55. package/esm/src/util/lambda-function-error.d.ts.map +1 -0
  56. package/package.json +16 -14
@@ -1,7 +1,10 @@
1
1
  export { APIGatewayV2Service } from './api-gateway-v2/api-gateway-v2.js';
2
2
  export { APIGatewayService } from './api-gateway/api-gateway.js';
3
3
  export { DynamoDBService } from './dynamodb/dynamodb.js';
4
+ export { EventBridgeService } from './eventbridge/eventbridge.js';
5
+ export { LambdaService } from './lambda/lambda.js';
4
6
  export { S3Service } from './s3/s3.js';
7
+ export type { EmptyBucketPageResult } from './s3/s3.js';
5
8
  export { SchedulerService } from './scheduler/scheduler.js';
6
9
  export { SecretsManagerService } from './secrets-manager/secrets-manager.js';
7
10
  export { StepFunctionsService } from './sfn/sfn.js';
@@ -10,4 +13,5 @@ export { SQSService } from './sqs/sqs.js';
10
13
  export { SSMService } from './ssm/ssm.js';
11
14
  export { BatchOperationError } from './util/batch-operation-error.js';
12
15
  export type { BatchFailedEntry } from './util/batch-operation-error.js';
16
+ export { LambdaFunctionError } from './util/lambda-function-error.js';
13
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
+ import { InvokeCommandInput, InvokeCommandOutput, LambdaClient } from '@aws-sdk/client-lambda';
3
+ /**
4
+ * Wrapper around the AWS Lambda client providing structured Powertools logging
5
+ * and X-Ray tracing by default.
6
+ *
7
+ * Where a method's input carries payloads, secret material or PII, the INFO
8
+ * log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
9
+ * `TRACE`) log full SDK inputs.
10
+ *
11
+ * Covers `invoke` only.
12
+ */
13
+ export declare class LambdaService {
14
+ private readonly client;
15
+ private readonly logger;
16
+ /**
17
+ * @param opts.logger - Optional Powertools logger. Defaults to `new Logger()`,
18
+ * which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
19
+ * @param opts.client - Optional pre-configured `LambdaClient`. When
20
+ * supplied, the wrapper does not apply X-Ray instrumentation.
21
+ */
22
+ constructor(opts?: {
23
+ logger?: LoggerInterface;
24
+ client?: LambdaClient;
25
+ });
26
+ /**
27
+ * Invoke a Lambda function. The input is the SDK input unchanged and the
28
+ * output is the SDK output unchanged: `Payload` stays a `Uint8Array` you
29
+ * decode yourself. Choose synchronous, asynchronous or dry-run invocation
30
+ * with `InvocationType`; omitting it means synchronous (`RequestResponse`).
31
+ *
32
+ * Lambda answers HTTP 200 even when the invoked function threw, flagging it
33
+ * with `FunctionError` on the response. If that marker is present this
34
+ * method warns and throws a {@link LambdaFunctionError} carrying the
35
+ * function name, the marker, and the error type and message parsed from the
36
+ * payload when it has the usual JSON shape. The raw output and the stack
37
+ * trace are deliberately left off the error.
38
+ *
39
+ * The marker only appears on synchronous responses, so the check is
40
+ * unconditional: asynchronous (`Event`) and `DryRun` responses return
41
+ * without throwing. Failures of asynchronous invocations are therefore not
42
+ * observable here; they belong to dead-letter queues and destinations on
43
+ * the invoked function. No status code check is added; service-level
44
+ * errors such as throttling are thrown by the SDK and propagate unwrapped.
45
+ *
46
+ * At INFO level the log line includes only the function name, invocation
47
+ * type, qualifier, log type and tenant id. `Payload` and `ClientContext` are
48
+ * omitted, and responses are never logged.
49
+ *
50
+ * @param input - InvokeCommandInput including FunctionName.
51
+ */
52
+ invoke(input: InvokeCommandInput): Promise<InvokeCommandOutput>;
53
+ }
54
+ //# sourceMappingURL=lambda.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lambda.d.ts","sourceRoot":"","sources":["../../../../src/lambda/lambda.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACf,MAAM,wBAAwB,CAAC;AAkBhC;;;;;;;;;GASG;AACH,qBAAa,aAAa;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE;IAKtE;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAiBxE"}
@@ -1,5 +1,12 @@
1
1
  import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { CopyObjectCommandInput, CopyObjectCommandOutput, DeleteObjectCommandInput, DeleteObjectCommandOutput, DeleteObjectsCommandOutput, GetObjectCommandInput, GetObjectCommandOutput, HeadObjectCommandInput, HeadObjectCommandOutput, PutObjectCommandInput, PutObjectCommandOutput, S3Client } from '@aws-sdk/client-s3';
3
+ /**
4
+ * One page of an `emptyBucket` run, as carried in `BatchOperationError.results`.
5
+ */
6
+ export interface EmptyBucketPageResult {
7
+ /** The keys of this page that S3 deleted. */
8
+ deletedKeys: string[];
9
+ }
3
10
  /** Tight wrapper input type for `putObject`. */
4
11
  type PutObjectInput = Required<Pick<PutObjectCommandInput, 'Bucket' | 'Key' | 'Body'>>;
5
12
  /** Tight wrapper input type for `putJsonObject`. */
@@ -122,13 +129,26 @@ export declare class S3Service {
122
129
  * Delete multiple objects from S3, auto-chunking the request into batches
123
130
  * of 1000 keys (the S3-enforced DeleteObjects limit). Returns one output
124
131
  * per chunk.
132
+ *
133
+ * Every chunk is sent before the outcome is judged. If S3 reported a
134
+ * per-key delete error, a {@link BatchOperationError} is then thrown
135
+ * carrying the per-chunk results and the failed keys. Request-level SDK
136
+ * exceptions (throttling, access denied) propagate unchanged and
137
+ * immediately, so earlier chunks may already have been deleted.
125
138
  */
126
139
  deleteObjects(bucket: string, keys: string[]): Promise<DeleteObjectsCommandOutput[]>;
127
140
  /**
128
141
  * Delete every object in an **unversioned** bucket. Streams the listing
129
- * page-by-page and delegates each page's deletion to `deleteObjects`, so
130
- * peak memory stays bounded by one page (~1000 keys) regardless of bucket
131
- * size.
142
+ * page-by-page and delegates each page's deletion to `deleteObjects`, so no
143
+ * more than one page (~1000 keys) of SDK responses is held at a time. The
144
+ * only thing that grows with the bucket is the list of deleted keys this
145
+ * method returns.
146
+ *
147
+ * A page with per-key delete errors does not stop the run: every page is
148
+ * attempted, then one {@link BatchOperationError} is thrown carrying every
149
+ * failed key in `failed` and, per page, the keys that were deleted in
150
+ * `results`. Request-level SDK exceptions propagate unchanged and
151
+ * immediately, so earlier pages may already have been deleted.
132
152
  *
133
153
  * **Versioned buckets are out of scope.** This paginates `ListObjectsV2`,
134
154
  * which reports only current object versions — never noncurrent versions or
@@ -139,9 +159,11 @@ export declare class S3Service {
139
159
  * versioned bucket requires `ListObjectVersions` and per-version deletes;
140
160
  * use `S3Client` directly for that.
141
161
  *
142
- * @returns The keys this call issued deletes for.
162
+ * @returns The keys that were deleted.
163
+ * @throws {BatchOperationError} If S3 could not delete one or more keys.
143
164
  */
144
165
  emptyBucket(bucket: string): Promise<string[]>;
166
+ private deletePage;
145
167
  }
146
168
  export {};
147
169
  //# sourceMappingURL=s3.d.ts.map
@@ -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;AAW5B,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,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC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AqB1F;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAgBtC,UAAU;CAgB3B"}
@@ -9,8 +9,9 @@ import { CreateScheduleCommandInput, CreateScheduleCommandOutput, CreateSchedule
9
9
  * `TRACE`) log full SDK inputs.
10
10
  *
11
11
  * Covers CRUD on schedules and their groups. Named `SchedulerService` (not
12
- * `EventBridgeSchedulerService`) so it doesn't collide with a future wrapper
13
- * over the separate EventBridge bus/rules API (`@aws-sdk/client-eventbridge`).
12
+ * `EventBridgeSchedulerService`) so it doesn't collide with `EventBridgeService`,
13
+ * the wrapper over the separate EventBridge bus/rules API
14
+ * (`@aws-sdk/client-eventbridge`).
14
15
  *
15
16
  * `FlexibleTimeWindow` is required by `CreateSchedule` and is passed through
16
17
  * untouched — the wrapper bakes in no default, so the caller must state their
@@ -1 +1 @@
1
- {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/scheduler/scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,0BAA0B,EAC1B,2BAA2B,EAE3B,+BAA+B,EAC/B,gCAAgC,EAEhC,0BAA0B,EAC1B,2BAA2B,EAE3B,+BAA+B,EAC/B,gCAAgC,EAEhC,uBAAuB,EACvB,wBAAwB,EAExB,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EAGzB,oBAAoB,EACpB,eAAe,EACf,eAAe,EAGf,0BAA0B,EAC1B,2BAA2B,EAC9B,MAAM,2BAA2B,CAAC;AAwBnC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,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Service {
34
34
  * @param name - The parameter name (or ARN).
35
35
  * @returns The parameter value, or `undefined` if the parameter has no
36
36
  * value set.
37
+ * @throws When the parameter does not exist (the SDK's
38
+ * `ParameterNotFound`). {@link SSMService.getParameters} instead returns
39
+ * `undefined` for a missing parameter unless `required` is set.
37
40
  */
38
41
  getParameter(name: string): Promise<string | undefined>;
39
42
  /**
@@ -54,13 +57,25 @@ export declare class SSMService {
54
57
  * the underlying parameter names and sends one request per chunk,
55
58
  * merging the results before building the alias-keyed return value.
56
59
  *
60
+ * Unlike {@link SSMService.getParameter}, which throws when the parameter
61
+ * does not exist, a missing parameter here maps to `undefined` — so a
62
+ * typo'd path surfaces later as an undefined value. Pass
63
+ * `{ required: true }` to fail fast instead: every chunk is still sent,
64
+ * then a {@link BatchOperationError} is thrown whose `failed` entries
65
+ * carry each missing path as `id`, the code `ParameterNotFound`, and the
66
+ * alias in `message`. Request-level SDK exceptions are not wrapped.
67
+ *
57
68
  * @param aliases - Record mapping each desired local alias to its SSM
58
69
  * parameter name (or ARN).
70
+ * @param opts.required - Throw when any requested parameter does not
71
+ * exist. Defaults to `false`.
59
72
  * @returns A record keyed by the same aliases, mapping each to the
60
- * parameter's value, or `undefined` when the parameter is missing or has
61
- * no value.
73
+ * parameter's value, or `undefined` when the parameter is missing (unless
74
+ * `required` is set) or has no value.
62
75
  */
63
- getParameters<K extends string>(aliases: Record<K, string>): Promise<Record<K, string | undefined>>;
76
+ getParameters<K extends string>(aliases: Record<K, string>, opts?: {
77
+ required?: boolean;
78
+ }): Promise<Record<K, string | undefined>>;
64
79
  /**
65
80
  * Create or update an SSM parameter. The log line omits `Value` to avoid
66
81
  * leaking secret material.
@@ -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,yBAAy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AAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;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"}
@@ -2,7 +2,8 @@ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  /**
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
- * any other payload the caller sent.
5
+ * any other payload the caller sent. For S3 the identifier is the object key;
6
+ * for SSM it is the parameter path.
6
7
  */
7
8
  export interface BatchFailedEntry {
8
9
  id: string | undefined;
@@ -14,7 +15,9 @@ export interface BatchFailedEntry {
14
15
  * entry was rejected.
15
16
  *
16
17
  * `results` holds the raw SDK output of every chunk, so the outputs of the
17
- * entries that succeeded (message ids, sequence numbers) stay readable.
18
+ * entries that succeeded (message ids, sequence numbers) stay readable. The
19
+ * exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
20
+ * and `SSM.getParameters`, whose `results` are empty.
18
21
  * `failed` is the normalised list of rejected entries across all chunks.
19
22
  *
20
23
  * Match on `name` rather than `instanceof` if both the CJS and ESM builds of
@@ -37,8 +40,7 @@ interface RejectedEntry {
37
40
  /**
38
41
  * SQS and SNS report rejected entries under `Failed` on an otherwise
39
42
  * successful response, so a resolved chunk does not mean every entry was
40
- * accepted. Returns `results` untouched when nothing failed; otherwise warns
41
- * and throws a {@link BatchOperationError}.
43
+ * accepted. Extracts those entries and delegates to {@link throwIfAny}.
42
44
  *
43
45
  * Only id, code and message are copied out — never the entry itself — so
44
46
  * neither the error nor the warning can leak a payload.
@@ -46,5 +48,32 @@ interface RejectedEntry {
46
48
  export declare function throwIfAnyFailed<TResult extends {
47
49
  Failed?: RejectedEntry[] | undefined;
48
50
  }>(logger: LoggerInterface, operation: string, results: TResult[]): TResult[];
51
+ /**
52
+ * The shape S3 `DeleteObjects` uses for a key it could not delete.
53
+ */
54
+ interface DeleteError {
55
+ Key?: string | undefined;
56
+ Code?: string | undefined;
57
+ Message?: string | undefined;
58
+ }
59
+ /**
60
+ * S3 reports undeleted keys under `Errors` on an otherwise successful
61
+ * `DeleteObjects` response. Same contract as {@link throwIfAnyFailed}; the
62
+ * key is carried as the failed entry's `id`, and `VersionId` is dropped.
63
+ */
64
+ export declare function throwIfAnyDeleteErrors<TResult extends {
65
+ Errors?: DeleteError[] | undefined;
66
+ }>(logger: LoggerInterface, operation: string, results: TResult[]): TResult[];
67
+ /**
68
+ * Warn-and-throw step for services whose responses don't use the SQS/SNS
69
+ * `Failed` shape and so extract their own rejected entries (`EventBridge.putEvents`),
70
+ * or whose `results` aren't a plain list of SDK outputs (`S3.emptyBucket`).
71
+ * Returns `results` untouched when `failed` is empty.
72
+ *
73
+ * Callers must build `failed` by copying id, code and message explicitly —
74
+ * never by spreading the SDK entry — because it goes straight into the error
75
+ * and the warning.
76
+ */
77
+ export declare function throwIfAny<TResult>(logger: LoggerInterface, operation: string, results: TResult[], failed: BatchFailedEntry[]): TResult[];
49
78
  export {};
50
79
  //# 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;;;;GAIG;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;;;;;;;;;;GAUG;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;CAM1C;AAED;;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;;;;;;;;GAQG;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,CAeX"}
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;;;;;GAKG;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;;;;;;;;;;;;GAYG;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;CAM1C;AAED;;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,CAQX"}
@@ -0,0 +1,36 @@
1
+ interface ParsedErrorPayload {
2
+ errorType: string | undefined;
3
+ errorMessage: string | undefined;
4
+ }
5
+ /**
6
+ * Thrown by `LambdaService.invoke` when a synchronous invocation reached the
7
+ * function but the function itself failed. Lambda reports that as an HTTP 200
8
+ * carrying a function error marker, so the SDK does not throw.
9
+ *
10
+ * `functionError` is the SDK's marker (`Handled` or `Unhandled`).
11
+ * `errorType` and `errorMessage` are parsed from the response payload when it
12
+ * has the usual `{ errorType, errorMessage }` JSON shape, otherwise undefined.
13
+ *
14
+ * Deliberately excludes the raw SDK output and the stack trace: either can
15
+ * contain the caller's payload or PII.
16
+ *
17
+ * Match on `name` rather than `instanceof` if both the CJS and ESM builds of
18
+ * this package may be loaded in one process.
19
+ */
20
+ export declare class LambdaFunctionError extends Error {
21
+ readonly functionName: string | undefined;
22
+ readonly functionError: string;
23
+ readonly name = "LambdaFunctionError";
24
+ readonly errorType: string | undefined;
25
+ readonly errorMessage: string | undefined;
26
+ constructor(functionName: string | undefined, functionError: string, payload: Pick<LambdaFunctionError, 'errorType' | 'errorMessage'>);
27
+ }
28
+ /**
29
+ * Reads `errorType` and `errorMessage` out of a function error payload.
30
+ * Anything that is not a JSON object with string fields yields undefined for
31
+ * that field rather than failing, because the payload is whatever the invoked
32
+ * function (or runtime) chose to return.
33
+ */
34
+ export declare function parseFunctionErrorPayload(payload: Uint8Array | undefined): ParsedErrorPayload;
35
+ export {};
36
+ //# sourceMappingURL=lambda-function-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lambda-function-error.d.ts","sourceRoot":"","sources":["../../../../src/util/lambda-function-error.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IACxB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAMtC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM;IANlC,SAAkB,IAAI,yBAAyB;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG7B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,EAAE,MAAM,EAC9B,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,cAAc,CAAC;CAMvE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAiB7F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligent/aws-wrappers",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -43,19 +43,21 @@
43
43
  "directory": "packages/aws-wrappers"
44
44
  },
45
45
  "dependencies": {
46
- "@aws-lambda-powertools/logger": "^2.33.1",
47
- "@aws-sdk/client-api-gateway": "^3.1127.0",
48
- "@aws-sdk/client-apigatewayv2": "^3.1127.0",
49
- "@aws-sdk/client-dynamodb": "^3.1127.0",
50
- "@aws-sdk/client-s3": "^3.1127.0",
51
- "@aws-sdk/client-scheduler": "^3.1127.0",
52
- "@aws-sdk/client-secrets-manager": "^3.1127.0",
53
- "@aws-sdk/client-sfn": "^3.1127.0",
54
- "@aws-sdk/client-sns": "^3.1127.0",
55
- "@aws-sdk/client-sqs": "^3.1127.0",
56
- "@aws-sdk/client-ssm": "^3.1127.0",
57
- "@aws-sdk/lib-dynamodb": "^3.1127.0",
58
- "@aws-sdk/s3-request-presigner": "^3.1127.0",
46
+ "@aws-lambda-powertools/logger": "^2.36.0",
47
+ "@aws-sdk/client-api-gateway": "^3.1160.0",
48
+ "@aws-sdk/client-apigatewayv2": "^3.1160.0",
49
+ "@aws-sdk/client-dynamodb": "^3.1160.0",
50
+ "@aws-sdk/client-eventbridge": "^3.1160.0",
51
+ "@aws-sdk/client-lambda": "^3.1160.0",
52
+ "@aws-sdk/client-s3": "^3.1160.0",
53
+ "@aws-sdk/client-scheduler": "^3.1160.0",
54
+ "@aws-sdk/client-secrets-manager": "^3.1160.0",
55
+ "@aws-sdk/client-sfn": "^3.1160.0",
56
+ "@aws-sdk/client-sns": "^3.1160.0",
57
+ "@aws-sdk/client-sqs": "^3.1160.0",
58
+ "@aws-sdk/client-ssm": "^3.1160.0",
59
+ "@aws-sdk/lib-dynamodb": "^3.1160.0",
60
+ "@aws-sdk/s3-request-presigner": "^3.1160.0",
59
61
  "aws-xray-sdk-core": "^3.12.0"
60
62
  },
61
63
  "author": "Aligent",