@aligent/aws-wrappers 0.5.5 → 0.5.7
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 +32 -2
- package/cjs/index.cjs +171 -139
- package/cjs/package.json +1 -1
- package/cjs/src/dynamodb/dynamodb.d.ts.map +1 -1
- package/cjs/src/index.d.ts +2 -0
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/s3/s3.d.ts.map +1 -1
- package/cjs/src/scheduler/scheduler.d.ts.map +1 -1
- package/cjs/src/sfn/sfn.d.ts.map +1 -1
- package/cjs/src/sns/sns.d.ts +7 -0
- package/cjs/src/sns/sns.d.ts.map +1 -1
- package/cjs/src/sqs/sqs.d.ts +13 -0
- package/cjs/src/sqs/sqs.d.ts.map +1 -1
- package/cjs/src/ssm/ssm.d.ts.map +1 -1
- package/cjs/src/util/batch-operation-error.d.ts +50 -0
- package/cjs/src/util/batch-operation-error.d.ts.map +1 -0
- package/cjs/src/util/chunk.d.ts +6 -0
- package/cjs/src/util/chunk.d.ts.map +1 -0
- package/cjs/src/util/redact.d.ts +17 -18
- package/cjs/src/util/redact.d.ts.map +1 -1
- package/docs/index/classes/APIGatewayService.md +6 -6
- package/docs/index/classes/APIGatewayV2Service.md +5 -5
- package/docs/index/classes/BatchOperationError.md +261 -0
- package/docs/index/classes/DynamoDBService.md +12 -12
- package/docs/index/classes/S3Service.md +15 -15
- package/docs/index/classes/SNSService.md +10 -4
- package/docs/index/classes/SQSService.md +20 -7
- package/docs/index/classes/SSMService.md +7 -7
- package/docs/index/classes/SchedulerService.md +11 -11
- package/docs/index/classes/SecretsManagerService.md +8 -8
- package/docs/index/classes/StepFunctionsService.md +6 -6
- package/docs/index/interfaces/BatchFailedEntry.md +43 -0
- package/docs/index/modules.md +5 -0
- package/docs/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +171 -140
- package/esm/package.json +1 -1
- package/esm/src/dynamodb/dynamodb.d.ts.map +1 -1
- package/esm/src/index.d.ts +2 -0
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/s3/s3.d.ts.map +1 -1
- package/esm/src/scheduler/scheduler.d.ts.map +1 -1
- package/esm/src/sfn/sfn.d.ts.map +1 -1
- package/esm/src/sns/sns.d.ts +7 -0
- package/esm/src/sns/sns.d.ts.map +1 -1
- package/esm/src/sqs/sqs.d.ts +13 -0
- package/esm/src/sqs/sqs.d.ts.map +1 -1
- package/esm/src/ssm/ssm.d.ts.map +1 -1
- package/esm/src/util/batch-operation-error.d.ts +50 -0
- package/esm/src/util/batch-operation-error.d.ts.map +1 -0
- package/esm/src/util/chunk.d.ts +6 -0
- package/esm/src/util/chunk.d.ts.map +1 -0
- package/esm/src/util/redact.d.ts +17 -18
- package/esm/src/util/redact.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
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,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,eAAe,CAAA;KAAE;IAKzE;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAO7F;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAKpF;;;;;;;;;;;;OAYG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAO7F;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAK7F;;;;OAIG;IACG,aAAa,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAMlF;;;OAGG;IACG,mBAAmB,CACrB,KAAK,EAAE,+BAA+B,GACvC,OAAO,CAAC,gCAAgC,CAAC;IAK5C;;OAEG;IACG,gBAAgB,CAClB,KAAK,EAAE,4BAA4B,GACpC,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;OAIG;IACG,mBAAmB,CACrB,KAAK,EAAE,+BAA+B,GACvC,OAAO,CAAC,gCAAgC,CAAC;IAK5C;;;OAGG;IACG,kBAAkB,CACpB,KAAK,CAAC,EAAE,8BAA8B,GACvC,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAKrC"}
|
package/esm/src/sfn/sfn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sfn.d.ts","sourceRoot":"","sources":["../../../../src/sfn/sfn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,EACjB,0BAA0B,EAE1B,SAAS,EAET,0BAA0B,EAC1B,2BAA2B,EAE3B,yBAAyB,EACzB,0BAA0B,EAC7B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sfn.d.ts","sourceRoot":"","sources":["../../../../src/sfn/sfn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,EACjB,0BAA0B,EAE1B,SAAS,EAET,0BAA0B,EAC1B,2BAA2B,EAE3B,yBAAyB,EACzB,0BAA0B,EAC7B,MAAM,qBAAqB,CAAC;AAgB7B;;;;;;;GAOG;AACH,qBAAa,oBAAoB;IAC7B,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;;;;OAIG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAMrF;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAO7F;;OAEG;IACG,iBAAiB,CACnB,KAAK,EAAE,6BAA6B,GACrC,OAAO,CAAC,8BAA8B,CAAC;IAK1C;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAI7F"}
|
package/esm/src/sns/sns.d.ts
CHANGED
|
@@ -52,6 +52,13 @@ export declare class SNSService {
|
|
|
52
52
|
* PublishBatch at 10 entries per request, so this method auto-chunks
|
|
53
53
|
* the caller's `PublishBatchRequestEntries` and sends one request per
|
|
54
54
|
* chunk, returning the array of outputs.
|
|
55
|
+
*
|
|
56
|
+
* Every chunk is sent before the outcome is judged. If SNS rejected any
|
|
57
|
+
* entry, a {@link BatchOperationError} is then thrown carrying the
|
|
58
|
+
* per-chunk results and the failed entries. Request-level SDK exceptions
|
|
59
|
+
* (throttling, access denied) propagate unchanged and immediately, so
|
|
60
|
+
* earlier chunks may already have been published.
|
|
61
|
+
*
|
|
55
62
|
* @param input - PublishBatchCommandInput including TopicArn and entries.
|
|
56
63
|
*/
|
|
57
64
|
publishBatch(input: PublishBatchCommandInput): Promise<PublishBatchCommandOutput[]>;
|
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;AAyB7B;;;;;;;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;;;;;;;;;;OAUG;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
|
@@ -59,12 +59,25 @@ export declare class SQSService {
|
|
|
59
59
|
* Send a batch of messages to an SQS queue. The SQS API caps
|
|
60
60
|
* SendMessageBatch at 10 entries per request, so this method auto-chunks
|
|
61
61
|
* the caller's entries and sends one request per chunk.
|
|
62
|
+
*
|
|
63
|
+
* Every chunk is sent before the outcome is judged. If SQS rejected any
|
|
64
|
+
* entry, a {@link BatchOperationError} is then thrown carrying the
|
|
65
|
+
* per-chunk results and the failed entries. Request-level SDK exceptions
|
|
66
|
+
* (throttling, access denied) propagate unchanged and immediately, so
|
|
67
|
+
* earlier chunks may already have been sent.
|
|
62
68
|
*/
|
|
63
69
|
sendMessageBatch(input: SendMessageBatchCommandInput): Promise<SendMessageBatchCommandOutput[]>;
|
|
64
70
|
/**
|
|
65
71
|
* Delete a batch of messages from an SQS queue. The SQS API caps
|
|
66
72
|
* DeleteMessageBatch at 10 entries per request, so this method auto-chunks
|
|
67
73
|
* the caller's entries and sends one request per chunk.
|
|
74
|
+
*
|
|
75
|
+
* Every chunk is sent before the outcome is judged. If SQS failed to
|
|
76
|
+
* delete any message, a {@link BatchOperationError} is then thrown carrying
|
|
77
|
+
* the per-chunk results and the failed entries; those messages will be
|
|
78
|
+
* redelivered. Request-level SDK exceptions (throttling, access denied)
|
|
79
|
+
* propagate unchanged and immediately, so earlier chunks may already have
|
|
80
|
+
* been deleted.
|
|
68
81
|
*/
|
|
69
82
|
deleteMessageBatch(input: DeleteMessageBatchCommandInput): Promise<DeleteMessageBatchCommandOutput[]>;
|
|
70
83
|
}
|
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;AAgC7B;;;;;;;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;;;;;;;;;OASG;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.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;AAyB7B;;;;;;;;;;;;;;;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;;;;;OAKG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQ7D;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,aAAa,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAsBzC;;;;;;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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
2
|
+
/**
|
|
3
|
+
* One entry a batch operation rejected. Deliberately limited to identifier,
|
|
4
|
+
* code and message so the error never carries message bodies, attributes or
|
|
5
|
+
* any other payload the caller sent.
|
|
6
|
+
*/
|
|
7
|
+
export interface BatchFailedEntry {
|
|
8
|
+
id: string | undefined;
|
|
9
|
+
code: string | undefined;
|
|
10
|
+
message: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Thrown by the batch methods once every chunk has been sent and at least one
|
|
14
|
+
* entry was rejected.
|
|
15
|
+
*
|
|
16
|
+
* `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
|
+
* `failed` is the normalised list of rejected entries across all chunks.
|
|
19
|
+
*
|
|
20
|
+
* Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
21
|
+
* this package may be loaded in one process.
|
|
22
|
+
*/
|
|
23
|
+
export declare class BatchOperationError<TResult = unknown> extends Error {
|
|
24
|
+
readonly results: TResult[];
|
|
25
|
+
readonly failed: BatchFailedEntry[];
|
|
26
|
+
readonly name = "BatchOperationError";
|
|
27
|
+
constructor(results: TResult[], failed: BatchFailedEntry[]);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The shape SQS and SNS share for a rejected entry in a batch response.
|
|
31
|
+
*/
|
|
32
|
+
interface RejectedEntry {
|
|
33
|
+
Id?: string | undefined;
|
|
34
|
+
Code?: string | undefined;
|
|
35
|
+
Message?: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* SQS and SNS report rejected entries under `Failed` on an otherwise
|
|
39
|
+
* 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}.
|
|
42
|
+
*
|
|
43
|
+
* Only id, code and message are copied out — never the entry itself — so
|
|
44
|
+
* neither the error nor the warning can leak a payload.
|
|
45
|
+
*/
|
|
46
|
+
export declare function throwIfAnyFailed<TResult extends {
|
|
47
|
+
Failed?: RejectedEntry[] | undefined;
|
|
48
|
+
}>(logger: LoggerInterface, operation: string, results: TResult[]): TResult[];
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=batch-operation-error.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../../../src/util/chunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAMjE"}
|
package/esm/src/util/redact.d.ts
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
2
|
-
/**
|
|
3
|
-
* Whether the logger is verbose enough that full SDK inputs — payloads, secret
|
|
4
|
-
* material and PII — may be written to the log.
|
|
5
|
-
*
|
|
6
|
-
* **This is the only place in the package that reads the log level.** Never
|
|
7
|
-
* compare `logger.getLevelName()` yourself: Powertools orders `TRACE` as *more*
|
|
8
|
-
* verbose than `DEBUG` (thresholds 6 and 8), so the obvious
|
|
9
|
-
* `getLevelName() === 'DEBUG'` check silently redacts at the most verbose level
|
|
10
|
-
* available. Route every disclosure decision through this predicate instead.
|
|
11
|
-
*/
|
|
12
|
-
export declare function shouldLogFullInput(logger: LoggerInterface): boolean;
|
|
13
2
|
/**
|
|
14
3
|
* Return a log-safe projection of `input` based on the logger's configured level.
|
|
15
4
|
*
|
|
16
|
-
* At the verbose levels
|
|
17
|
-
*
|
|
18
|
-
*
|
|
5
|
+
* At the verbose levels (`TRACE` and `DEBUG`) the full input is returned
|
|
6
|
+
* unchanged: operators who asked for that verbosity have explicitly opted into
|
|
7
|
+
* seeing everything, including payloads, secret material and PII. At any other
|
|
8
|
+
* level the projection is returned instead.
|
|
9
|
+
*
|
|
10
|
+
* **This module is the only place in the package that reads the log level.**
|
|
11
|
+
* Never compare `logger.getLevelName()` yourself: Powertools orders `TRACE` as
|
|
12
|
+
* *more* verbose than `DEBUG` (thresholds 6 and 8), so the obvious
|
|
13
|
+
* `getLevelName() === 'DEBUG'` check silently redacts at the most verbose level
|
|
14
|
+
* available. Route every disclosure decision through this function instead.
|
|
19
15
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
16
|
+
* `project` is either a list of top-level keys to keep (absent keys are
|
|
17
|
+
* silently skipped, so the result narrows to `Pick<T, K>`) or a function from
|
|
18
|
+
* the input to a safe shape. Prefer the key list: it is safe by default, since
|
|
19
|
+
* a new SDK field is not logged until someone allowlists it. Use a function
|
|
20
|
+
* only for computed shapes such as counts, and keep it small.
|
|
23
21
|
*
|
|
24
22
|
* Used across the package so that the "what's safe to log at INFO" decision
|
|
25
23
|
* lives in one place. See `packages/aws-wrappers/CLAUDE.md` ("Logging") for
|
|
26
24
|
* the design rationale and conventions on building the safe-field lists.
|
|
27
25
|
*/
|
|
28
|
-
export declare function
|
|
26
|
+
export declare function redactInput<T extends object, K extends keyof T>(logger: LoggerInterface, input: T, project: readonly K[]): T | Pick<T, K>;
|
|
27
|
+
export declare function redactInput<T extends object, R>(logger: LoggerInterface, input: T, project: (input: T) => R): T | R;
|
|
29
28
|
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../../../src/util/redact.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../../../src/util/redact.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAU3E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAC3D,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,SAAS,CAAC,EAAE,GACtB,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAC3C,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACzB,CAAC,GAAG,CAAC,CAAC"}
|