@aligent/aws-wrappers 0.5.6 → 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 +3 -2
- package/cjs/index.cjs +130 -144
- package/cjs/package.json +1 -1
- package/cjs/src/dynamodb/dynamodb.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/sns/sns.d.ts +7 -0
- package/cjs/src/sns/sns.d.ts.map +1 -1
- package/cjs/src/sqs/sqs.d.ts +0 -7
- package/cjs/src/sqs/sqs.d.ts.map +1 -1
- package/cjs/src/util/batch-operation-error.d.ts +20 -3
- package/cjs/src/util/batch-operation-error.d.ts.map +1 -1
- 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 +5 -5
- 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 +7 -7
- package/docs/index/classes/SSMService.md +7 -7
- package/docs/index/classes/SchedulerService.md +11 -11
- package/docs/index/classes/SecretsManagerService.md +8 -8
- package/docs/index/classes/StepFunctionsService.md +6 -6
- package/docs/index/interfaces/BatchFailedEntry.md +4 -4
- package/docs/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +130 -144
- package/esm/package.json +1 -1
- package/esm/src/dynamodb/dynamodb.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/sns/sns.d.ts +7 -0
- package/esm/src/sns/sns.d.ts.map +1 -1
- package/esm/src/sqs/sqs.d.ts +0 -7
- package/esm/src/sqs/sqs.d.ts.map +1 -1
- package/esm/src/util/batch-operation-error.d.ts +20 -3
- package/esm/src/util/batch-operation-error.d.ts.map +1 -1
- package/esm/src/util/redact.d.ts +17 -18
- package/esm/src/util/redact.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Every wrapper emits one `logger.info` line per SDK call with a per-method safe-f
|
|
|
27
27
|
|
|
28
28
|
### Batch semantics
|
|
29
29
|
|
|
30
|
-
Batch methods split your entries into chunks of the size the AWS API allows and send one request per chunk. AWS reports rejected entries inside an otherwise successful response, so a resolved request does not mean every entry was accepted. Currently covered: `SQSService.sendMessageBatch` and `
|
|
30
|
+
Batch methods split your entries into chunks of the size the AWS API allows and send one request per chunk. AWS reports rejected entries inside an otherwise successful response, so a resolved request does not mean every entry was accepted. Currently covered: `SQSService.sendMessageBatch`, `SQSService.deleteMessageBatch` and `SNSService.publishBatch`.
|
|
31
31
|
|
|
32
32
|
Every chunk is sent first. If any entry was rejected, the method then throws a single `BatchOperationError`. A call where nothing was rejected returns the per-chunk SDK outputs exactly as before.
|
|
33
33
|
|
|
@@ -372,7 +372,8 @@ const sns = new SNSService();
|
|
|
372
372
|
|
|
373
373
|
await sns.publish({ TopicArn, Message: 'hello' });
|
|
374
374
|
|
|
375
|
-
// publishBatch auto-chunks PublishBatchRequestEntries to the SNS-enforced 10-entry limit
|
|
375
|
+
// publishBatch auto-chunks PublishBatchRequestEntries to the SNS-enforced 10-entry limit
|
|
376
|
+
// and throws a BatchOperationError if SNS rejects any entry — see "Batch semantics".
|
|
376
377
|
await sns.publishBatch({ TopicArn, PublishBatchRequestEntries: bigEntryList });
|
|
377
378
|
|
|
378
379
|
// Opt-in truncation — same shape as SQS. Truncates Message (256 KB byte-safe)
|
package/cjs/index.cjs
CHANGED
|
@@ -144,38 +144,22 @@ class APIGatewayService {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* Whether the logger is verbose enough that full SDK inputs
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* **This is the only place in the package that reads the log level.** Never
|
|
151
|
-
* compare `logger.getLevelName()` yourself: Powertools orders `TRACE` as *more*
|
|
152
|
-
* verbose than `DEBUG` (thresholds 6 and 8), so the obvious
|
|
153
|
-
* `getLevelName() === 'DEBUG'` check silently redacts at the most verbose level
|
|
154
|
-
* available. Route every disclosure decision through this predicate instead.
|
|
147
|
+
* Whether the logger is verbose enough that full SDK inputs may be written to
|
|
148
|
+
* the log. The unlock rule is documented on {@link redactInput}.
|
|
155
149
|
*/
|
|
156
150
|
function shouldLogFullInput(logger$1) {
|
|
157
151
|
return logger.LogLevelThreshold[logger$1.getLevelName()] <= logger.LogLevelThreshold.DEBUG;
|
|
158
152
|
}
|
|
159
|
-
|
|
160
|
-
* Return a log-safe projection of `input` based on the logger's configured level.
|
|
161
|
-
*
|
|
162
|
-
* At the verbose levels — see {@link shouldLogFullInput} — the full input is
|
|
163
|
-
* returned unchanged: operators who asked for that verbosity have explicitly
|
|
164
|
-
* opted into seeing everything, including payloads, secret material and PII.
|
|
165
|
-
*
|
|
166
|
-
* At any other level, only the fields listed in `safeFields` are included.
|
|
167
|
-
* Missing fields are silently skipped — the result type narrows to
|
|
168
|
-
* `Pick<T, K>` accordingly.
|
|
169
|
-
*
|
|
170
|
-
* Used across the package so that the "what's safe to log at INFO" decision
|
|
171
|
-
* lives in one place. See `packages/aws-wrappers/CLAUDE.md` ("Logging") for
|
|
172
|
-
* the design rationale and conventions on building the safe-field lists.
|
|
173
|
-
*/
|
|
174
|
-
function filterFieldsForLogLevel(logger, input, safeFields) {
|
|
153
|
+
function redactInput(logger, input, project) {
|
|
175
154
|
if (shouldLogFullInput(logger))
|
|
176
155
|
return input;
|
|
156
|
+
if (typeof project === 'function')
|
|
157
|
+
return project(input);
|
|
158
|
+
return pickKeys(input, project);
|
|
159
|
+
}
|
|
160
|
+
function pickKeys(input, keys) {
|
|
177
161
|
const out = {};
|
|
178
|
-
for (const key of
|
|
162
|
+
for (const key of keys) {
|
|
179
163
|
if (key in input)
|
|
180
164
|
out[key] = input[key];
|
|
181
165
|
}
|
|
@@ -186,6 +170,14 @@ const BATCH_WRITE_MAX_ATTEMPTS = 5;
|
|
|
186
170
|
const BATCH_WRITE_BASE_DELAY_MS = 200;
|
|
187
171
|
const BATCH_GET_MAX_ATTEMPTS = 5;
|
|
188
172
|
const BATCH_GET_BASE_DELAY_MS = 200;
|
|
173
|
+
/**
|
|
174
|
+
* Safe log shape for the batch methods. `RequestItems` is keyed by table name
|
|
175
|
+
* with the payload (`Keys`, `Item`) nested inside each value, so it can't be
|
|
176
|
+
* an allowlisted field and is reduced to the table names instead.
|
|
177
|
+
*/
|
|
178
|
+
function summariseTables(input) {
|
|
179
|
+
return { tables: Object.keys(input.RequestItems ?? {}) };
|
|
180
|
+
}
|
|
189
181
|
/**
|
|
190
182
|
* Fields safe to log at INFO. Omits `Key` (may carry customer IDs / tenant IDs).
|
|
191
183
|
*/
|
|
@@ -314,7 +306,7 @@ class DynamoDBService {
|
|
|
314
306
|
*/
|
|
315
307
|
async getItem(input) {
|
|
316
308
|
this.logger.info('Getting DynamoDB item', {
|
|
317
|
-
input:
|
|
309
|
+
input: redactInput(this.logger, input, GET_ITEM_SAFE_FIELDS),
|
|
318
310
|
});
|
|
319
311
|
const response = await this.client.send(new libDynamodb.GetCommand(input));
|
|
320
312
|
return response.Item;
|
|
@@ -326,7 +318,7 @@ class DynamoDBService {
|
|
|
326
318
|
*/
|
|
327
319
|
async putItem(input) {
|
|
328
320
|
this.logger.info('Putting DynamoDB item', {
|
|
329
|
-
input:
|
|
321
|
+
input: redactInput(this.logger, input, PUT_ITEM_SAFE_FIELDS),
|
|
330
322
|
});
|
|
331
323
|
return this.client.send(new libDynamodb.PutCommand(input));
|
|
332
324
|
}
|
|
@@ -342,7 +334,7 @@ class DynamoDBService {
|
|
|
342
334
|
*/
|
|
343
335
|
async updateItem(input) {
|
|
344
336
|
this.logger.info('Updating DynamoDB item', {
|
|
345
|
-
input:
|
|
337
|
+
input: redactInput(this.logger, input, UPDATE_ITEM_SAFE_FIELDS),
|
|
346
338
|
});
|
|
347
339
|
const response = await this.client.send(new libDynamodb.UpdateCommand(input));
|
|
348
340
|
return response;
|
|
@@ -355,7 +347,7 @@ class DynamoDBService {
|
|
|
355
347
|
*/
|
|
356
348
|
async deleteItem(input) {
|
|
357
349
|
this.logger.info('Deleting DynamoDB item', {
|
|
358
|
-
input:
|
|
350
|
+
input: redactInput(this.logger, input, DELETE_ITEM_SAFE_FIELDS),
|
|
359
351
|
});
|
|
360
352
|
const response = await this.client.send(new libDynamodb.DeleteCommand(input));
|
|
361
353
|
return response;
|
|
@@ -368,7 +360,7 @@ class DynamoDBService {
|
|
|
368
360
|
*/
|
|
369
361
|
async query(input) {
|
|
370
362
|
this.logger.info('Querying DynamoDB', {
|
|
371
|
-
input:
|
|
363
|
+
input: redactInput(this.logger, input, QUERY_SAFE_FIELDS),
|
|
372
364
|
});
|
|
373
365
|
const response = await this.client.send(new libDynamodb.QueryCommand(input));
|
|
374
366
|
return response;
|
|
@@ -394,7 +386,7 @@ class DynamoDBService {
|
|
|
394
386
|
*/
|
|
395
387
|
async scan(input) {
|
|
396
388
|
this.logger.info('Scanning DynamoDB', {
|
|
397
|
-
input:
|
|
389
|
+
input: redactInput(this.logger, input, SCAN_SAFE_FIELDS),
|
|
398
390
|
});
|
|
399
391
|
const response = await this.client.send(new libDynamodb.ScanCommand(input));
|
|
400
392
|
return response;
|
|
@@ -411,13 +403,8 @@ class DynamoDBService {
|
|
|
411
403
|
* Callers should narrow the result type at the call site.
|
|
412
404
|
*/
|
|
413
405
|
async batchGet(input) {
|
|
414
|
-
// Inline verbosity check rather than `filterFieldsForLogLevel` because
|
|
415
|
-
// `RequestItems` is a `Record<tableName, KeysAndAttributes>` — the
|
|
416
|
-
// payload (`Keys[]`) lives inside the value, not as a top-level key
|
|
417
|
-
// the helper could pick or drop.
|
|
418
|
-
const logFullInput = shouldLogFullInput(this.logger);
|
|
419
406
|
this.logger.info('Batch getting DynamoDB items', {
|
|
420
|
-
input:
|
|
407
|
+
input: redactInput(this.logger, input, summariseTables),
|
|
421
408
|
});
|
|
422
409
|
let current = input;
|
|
423
410
|
const mergedResponses = {};
|
|
@@ -446,13 +433,8 @@ class DynamoDBService {
|
|
|
446
433
|
* items remain unprocessed after the final attempt.
|
|
447
434
|
*/
|
|
448
435
|
async batchWrite(input) {
|
|
449
|
-
// Inline verbosity check rather than `filterFieldsForLogLevel` because
|
|
450
|
-
// `RequestItems` is a `Record<tableName, WriteRequest[]>` — the
|
|
451
|
-
// payload (`PutRequest.Item` / `DeleteRequest.Key`) lives inside the
|
|
452
|
-
// value, not as a top-level key the helper could pick or drop.
|
|
453
|
-
const logFullInput = shouldLogFullInput(this.logger);
|
|
454
436
|
this.logger.info('Batch writing DynamoDB items', {
|
|
455
|
-
input:
|
|
437
|
+
input: redactInput(this.logger, input, summariseTables),
|
|
456
438
|
});
|
|
457
439
|
let current = input;
|
|
458
440
|
for (let attempt = 0; attempt < BATCH_WRITE_MAX_ATTEMPTS; attempt++) {
|
|
@@ -498,7 +480,7 @@ class DynamoDBService {
|
|
|
498
480
|
*/
|
|
499
481
|
async *paginateItems(input) {
|
|
500
482
|
this.logger.info('Paginating DynamoDB query', {
|
|
501
|
-
input:
|
|
483
|
+
input: redactInput(this.logger, input, QUERY_SAFE_FIELDS),
|
|
502
484
|
});
|
|
503
485
|
const paginator = libDynamodb.paginateQuery({ client: this.client }, input);
|
|
504
486
|
for await (const page of paginator) {
|
|
@@ -519,7 +501,7 @@ class DynamoDBService {
|
|
|
519
501
|
*/
|
|
520
502
|
async *paginateScan(input) {
|
|
521
503
|
this.logger.info('Paginating DynamoDB scan', {
|
|
522
|
-
input:
|
|
504
|
+
input: redactInput(this.logger, input, SCAN_SAFE_FIELDS),
|
|
523
505
|
});
|
|
524
506
|
const paginator = libDynamodb.paginateScan({ client: this.client }, input);
|
|
525
507
|
for await (const page of paginator) {
|
|
@@ -594,7 +576,7 @@ class S3Service {
|
|
|
594
576
|
*/
|
|
595
577
|
async putObject(input) {
|
|
596
578
|
this.logger.info('Putting S3 object', {
|
|
597
|
-
input:
|
|
579
|
+
input: redactInput(this.logger, input, PUT_OBJECT_SAFE_FIELDS),
|
|
598
580
|
});
|
|
599
581
|
return this.client.send(new clientS3.PutObjectCommand(input));
|
|
600
582
|
}
|
|
@@ -609,7 +591,7 @@ class S3Service {
|
|
|
609
591
|
*/
|
|
610
592
|
async putJsonObject(input) {
|
|
611
593
|
this.logger.info('Putting S3 JSON object', {
|
|
612
|
-
input:
|
|
594
|
+
input: redactInput(this.logger, input, PUT_JSON_OBJECT_SAFE_FIELDS),
|
|
613
595
|
});
|
|
614
596
|
return this.client.send(new clientS3.PutObjectCommand({
|
|
615
597
|
Bucket: input.Bucket,
|
|
@@ -737,12 +719,11 @@ class S3Service {
|
|
|
737
719
|
* per chunk.
|
|
738
720
|
*/
|
|
739
721
|
async deleteObjects(bucket, keys) {
|
|
740
|
-
// Inline verbosity check rather than `filterFieldsForLogLevel` because the
|
|
741
|
-
// safe log shape includes the computed `keyCount`, which isn't a key
|
|
742
|
-
// on any SDK input type.
|
|
743
|
-
const logFullInput = shouldLogFullInput(this.logger);
|
|
744
722
|
this.logger.info('Deleting S3 objects', {
|
|
745
|
-
input:
|
|
723
|
+
input: redactInput(this.logger, { bucket, keys }, input => ({
|
|
724
|
+
bucket: input.bucket,
|
|
725
|
+
keyCount: input.keys.length,
|
|
726
|
+
})),
|
|
746
727
|
});
|
|
747
728
|
const results = [];
|
|
748
729
|
for (const batch of chunk(keys, DELETE_OBJECTS_BATCH_LIMIT)) {
|
|
@@ -791,21 +772,14 @@ class S3Service {
|
|
|
791
772
|
* PII (customer IDs, order contents, etc.), the same risk profile as SFN's
|
|
792
773
|
* execution `input`.
|
|
793
774
|
*
|
|
794
|
-
* This can't
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
* `
|
|
799
|
-
*
|
|
800
|
-
* `Target.Input`.
|
|
801
|
-
*
|
|
802
|
-
* At the verbose levels — see {@link shouldLogFullInput} — the input is
|
|
803
|
-
* returned unchanged: operators who asked for that verbosity have opted into
|
|
804
|
-
* seeing payloads and PII.
|
|
775
|
+
* This can't be a key allowlist for {@link redactInput}: an allowlist picks
|
|
776
|
+
* **top-level** keys only, and the sensitive field is nested one level down
|
|
777
|
+
* inside `Target`. Allowlisting `Target` would leak `Input`; omitting `Target`
|
|
778
|
+
* would lose operationally-useful fields (`Arn`, `RoleArn`, `RetryPolicy`,
|
|
779
|
+
* `DeadLetterConfig`, the target-type params). So this is a projection
|
|
780
|
+
* function: keep every top-level field and shallow-strip only `Target.Input`.
|
|
805
781
|
*/
|
|
806
|
-
function
|
|
807
|
-
if (shouldLogFullInput(logger))
|
|
808
|
-
return input;
|
|
782
|
+
function stripTargetInput(input) {
|
|
809
783
|
if (input.Target?.Input === undefined)
|
|
810
784
|
return input;
|
|
811
785
|
const { Input: _input, ...safeTarget } = input.Target;
|
|
@@ -845,7 +819,9 @@ class SchedulerService {
|
|
|
845
819
|
* target payload, a PII carrier).
|
|
846
820
|
*/
|
|
847
821
|
async createSchedule(input) {
|
|
848
|
-
this.logger.info('Creating schedule', {
|
|
822
|
+
this.logger.info('Creating schedule', {
|
|
823
|
+
input: redactInput(this.logger, input, stripTargetInput),
|
|
824
|
+
});
|
|
849
825
|
return this.client.send(new clientScheduler.CreateScheduleCommand(input));
|
|
850
826
|
}
|
|
851
827
|
/**
|
|
@@ -869,7 +845,9 @@ class SchedulerService {
|
|
|
869
845
|
* At INFO the log line omits `Target.Input`.
|
|
870
846
|
*/
|
|
871
847
|
async updateSchedule(input) {
|
|
872
|
-
this.logger.info('Updating schedule', {
|
|
848
|
+
this.logger.info('Updating schedule', {
|
|
849
|
+
input: redactInput(this.logger, input, stripTargetInput),
|
|
850
|
+
});
|
|
873
851
|
return this.client.send(new clientScheduler.UpdateScheduleCommand(input));
|
|
874
852
|
}
|
|
875
853
|
/**
|
|
@@ -1019,7 +997,7 @@ class SecretsManagerService {
|
|
|
1019
997
|
*/
|
|
1020
998
|
async createSecret(input) {
|
|
1021
999
|
this.logger.info('Creating secret', {
|
|
1022
|
-
input:
|
|
1000
|
+
input: redactInput(this.logger, input, CREATE_SECRET_SAFE_FIELDS),
|
|
1023
1001
|
});
|
|
1024
1002
|
return this.client.send(new clientSecretsManager.CreateSecretCommand(input));
|
|
1025
1003
|
}
|
|
@@ -1032,7 +1010,7 @@ class SecretsManagerService {
|
|
|
1032
1010
|
*/
|
|
1033
1011
|
async updateSecret(input) {
|
|
1034
1012
|
this.logger.info('Updating secret', {
|
|
1035
|
-
input:
|
|
1013
|
+
input: redactInput(this.logger, input, UPDATE_SECRET_SAFE_FIELDS),
|
|
1036
1014
|
});
|
|
1037
1015
|
return this.client.send(new clientSecretsManager.UpdateSecretCommand(input));
|
|
1038
1016
|
}
|
|
@@ -1044,7 +1022,7 @@ class SecretsManagerService {
|
|
|
1044
1022
|
*/
|
|
1045
1023
|
async putSecretValue(input) {
|
|
1046
1024
|
this.logger.info('Putting secret value', {
|
|
1047
|
-
input:
|
|
1025
|
+
input: redactInput(this.logger, input, PUT_SECRET_VALUE_SAFE_FIELDS),
|
|
1048
1026
|
});
|
|
1049
1027
|
return this.client.send(new clientSecretsManager.PutSecretValueCommand(input));
|
|
1050
1028
|
}
|
|
@@ -1056,7 +1034,7 @@ class SecretsManagerService {
|
|
|
1056
1034
|
*/
|
|
1057
1035
|
async deleteSecret(input) {
|
|
1058
1036
|
this.logger.info('Deleting secret', {
|
|
1059
|
-
input:
|
|
1037
|
+
input: redactInput(this.logger, input, DELETE_SECRET_SAFE_FIELDS),
|
|
1060
1038
|
});
|
|
1061
1039
|
return this.client.send(new clientSecretsManager.DeleteSecretCommand(input));
|
|
1062
1040
|
}
|
|
@@ -1115,7 +1093,7 @@ class StepFunctionsService {
|
|
|
1115
1093
|
*/
|
|
1116
1094
|
async startExecution(input) {
|
|
1117
1095
|
this.logger.info('Starting Step Functions execution', {
|
|
1118
|
-
input:
|
|
1096
|
+
input: redactInput(this.logger, input, START_EXECUTION_SAFE_FIELDS),
|
|
1119
1097
|
});
|
|
1120
1098
|
return this.client.send(new clientSfn.StartExecutionCommand(input));
|
|
1121
1099
|
}
|
|
@@ -1135,6 +1113,59 @@ class StepFunctionsService {
|
|
|
1135
1113
|
}
|
|
1136
1114
|
}
|
|
1137
1115
|
|
|
1116
|
+
/**
|
|
1117
|
+
* Thrown by the batch methods once every chunk has been sent and at least one
|
|
1118
|
+
* entry was rejected.
|
|
1119
|
+
*
|
|
1120
|
+
* `results` holds the raw SDK output of every chunk, so the outputs of the
|
|
1121
|
+
* entries that succeeded (message ids, sequence numbers) stay readable.
|
|
1122
|
+
* `failed` is the normalised list of rejected entries across all chunks.
|
|
1123
|
+
*
|
|
1124
|
+
* Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
1125
|
+
* this package may be loaded in one process.
|
|
1126
|
+
*/
|
|
1127
|
+
class BatchOperationError extends Error {
|
|
1128
|
+
results;
|
|
1129
|
+
failed;
|
|
1130
|
+
name = 'BatchOperationError';
|
|
1131
|
+
constructor(results, failed) {
|
|
1132
|
+
super(`Batch operation failed for ${failed.length} entries (${distinctCodes(failed).join(', ')})`);
|
|
1133
|
+
this.results = results;
|
|
1134
|
+
this.failed = failed;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* SQS and SNS report rejected entries under `Failed` on an otherwise
|
|
1139
|
+
* successful response, so a resolved chunk does not mean every entry was
|
|
1140
|
+
* accepted. Returns `results` untouched when nothing failed; otherwise warns
|
|
1141
|
+
* and throws a {@link BatchOperationError}.
|
|
1142
|
+
*
|
|
1143
|
+
* Only id, code and message are copied out — never the entry itself — so
|
|
1144
|
+
* neither the error nor the warning can leak a payload.
|
|
1145
|
+
*/
|
|
1146
|
+
function throwIfAnyFailed(logger, operation, results) {
|
|
1147
|
+
const failed = results.flatMap(result => (result.Failed ?? []).map(({ Id, Code, Message }) => ({
|
|
1148
|
+
id: Id,
|
|
1149
|
+
code: Code,
|
|
1150
|
+
message: Message,
|
|
1151
|
+
})));
|
|
1152
|
+
if (failed.length === 0)
|
|
1153
|
+
return results;
|
|
1154
|
+
logger.warn(`${operation} had rejected entries`, {
|
|
1155
|
+
failedCount: failed.length,
|
|
1156
|
+
codes: distinctCodes(failed),
|
|
1157
|
+
});
|
|
1158
|
+
throw new BatchOperationError(results, failed);
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Distinct error codes in first-seen order, for the error message and the
|
|
1162
|
+
* warning log line.
|
|
1163
|
+
*/
|
|
1164
|
+
function distinctCodes(failed) {
|
|
1165
|
+
const codes = failed.flatMap(entry => (entry.code === undefined ? [] : [entry.code]));
|
|
1166
|
+
return [...new Set(codes)];
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1138
1169
|
/**
|
|
1139
1170
|
* Truncate a UTF-8 string to fit within `maxBytes` when encoded as UTF-8.
|
|
1140
1171
|
*
|
|
@@ -1224,7 +1255,7 @@ class SNSService {
|
|
|
1224
1255
|
const shouldTruncate = opts?.truncate ?? this.truncate;
|
|
1225
1256
|
const effective = shouldTruncate ? this.applyTruncation(input) : input;
|
|
1226
1257
|
this.logger.info('Publishing SNS message', {
|
|
1227
|
-
input:
|
|
1258
|
+
input: redactInput(this.logger, effective, PUBLISH_SAFE_FIELDS),
|
|
1228
1259
|
});
|
|
1229
1260
|
return this.client.send(new clientSns.PublishCommand(effective));
|
|
1230
1261
|
}
|
|
@@ -1262,16 +1293,22 @@ class SNSService {
|
|
|
1262
1293
|
* PublishBatch at 10 entries per request, so this method auto-chunks
|
|
1263
1294
|
* the caller's `PublishBatchRequestEntries` and sends one request per
|
|
1264
1295
|
* chunk, returning the array of outputs.
|
|
1296
|
+
*
|
|
1297
|
+
* Every chunk is sent before the outcome is judged. If SNS rejected any
|
|
1298
|
+
* entry, a {@link BatchOperationError} is then thrown carrying the
|
|
1299
|
+
* per-chunk results and the failed entries. Request-level SDK exceptions
|
|
1300
|
+
* (throttling, access denied) propagate unchanged and immediately, so
|
|
1301
|
+
* earlier chunks may already have been published.
|
|
1302
|
+
*
|
|
1265
1303
|
* @param input - PublishBatchCommandInput including TopicArn and entries.
|
|
1266
1304
|
*/
|
|
1267
1305
|
async publishBatch(input) {
|
|
1268
1306
|
const entries = input.PublishBatchRequestEntries ?? [];
|
|
1269
|
-
// Inline verbosity check rather than `filterFieldsForLogLevel` because the
|
|
1270
|
-
// safe log shape includes the computed `entryCount`, which isn't a key
|
|
1271
|
-
// on `PublishBatchCommandInput`.
|
|
1272
|
-
const logFullInput = shouldLogFullInput(this.logger);
|
|
1273
1307
|
this.logger.info('Publishing SNS message batch', {
|
|
1274
|
-
input:
|
|
1308
|
+
input: redactInput(this.logger, input, ({ TopicArn }) => ({
|
|
1309
|
+
TopicArn,
|
|
1310
|
+
entryCount: entries.length,
|
|
1311
|
+
})),
|
|
1275
1312
|
});
|
|
1276
1313
|
const results = [];
|
|
1277
1314
|
for (const batch of chunk(entries, PUBLISH_BATCH_LIMIT)) {
|
|
@@ -1280,39 +1317,9 @@ class SNSService {
|
|
|
1280
1317
|
PublishBatchRequestEntries: batch,
|
|
1281
1318
|
})));
|
|
1282
1319
|
}
|
|
1283
|
-
return results;
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
/**
|
|
1288
|
-
* Thrown by the batch methods once every chunk has been sent and at least one
|
|
1289
|
-
* entry was rejected.
|
|
1290
|
-
*
|
|
1291
|
-
* `results` holds the raw SDK output of every chunk, so the outputs of the
|
|
1292
|
-
* entries that succeeded (message ids, sequence numbers) stay readable.
|
|
1293
|
-
* `failed` is the normalised list of rejected entries across all chunks.
|
|
1294
|
-
*
|
|
1295
|
-
* Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
1296
|
-
* this package may be loaded in one process.
|
|
1297
|
-
*/
|
|
1298
|
-
class BatchOperationError extends Error {
|
|
1299
|
-
results;
|
|
1300
|
-
failed;
|
|
1301
|
-
name = 'BatchOperationError';
|
|
1302
|
-
constructor(results, failed) {
|
|
1303
|
-
super(`Batch operation failed for ${failed.length} entries (${distinctCodes(failed).join(', ')})`);
|
|
1304
|
-
this.results = results;
|
|
1305
|
-
this.failed = failed;
|
|
1320
|
+
return throwIfAnyFailed(this.logger, 'SNS publishBatch', results);
|
|
1306
1321
|
}
|
|
1307
1322
|
}
|
|
1308
|
-
/**
|
|
1309
|
-
* Distinct error codes in first-seen order, for the error message and the
|
|
1310
|
-
* warning log line.
|
|
1311
|
-
*/
|
|
1312
|
-
function distinctCodes(failed) {
|
|
1313
|
-
const codes = failed.flatMap(entry => (entry.code === undefined ? [] : [entry.code]));
|
|
1314
|
-
return [...new Set(codes)];
|
|
1315
|
-
}
|
|
1316
1323
|
|
|
1317
1324
|
const SQS_BATCH_LIMIT = 10;
|
|
1318
1325
|
const SQS_MESSAGE_BODY_MAX_BYTES = 256 * 1024;
|
|
@@ -1326,6 +1333,13 @@ const SEND_MESSAGE_SAFE_FIELDS = [
|
|
|
1326
1333
|
'MessageGroupId',
|
|
1327
1334
|
'MessageDeduplicationId',
|
|
1328
1335
|
];
|
|
1336
|
+
/**
|
|
1337
|
+
* Safe log shape for the batch methods. The entries carry message bodies and
|
|
1338
|
+
* receipt handles, so they are reduced to a count.
|
|
1339
|
+
*/
|
|
1340
|
+
function summariseEntries(input) {
|
|
1341
|
+
return { QueueUrl: input.QueueUrl, entryCount: input.Entries?.length ?? 0 };
|
|
1342
|
+
}
|
|
1329
1343
|
/**
|
|
1330
1344
|
* Wrapper around the AWS SQS client providing structured Powertools logging
|
|
1331
1345
|
* and X-Ray tracing by default.
|
|
@@ -1363,7 +1377,7 @@ class SQSService {
|
|
|
1363
1377
|
const shouldTruncate = opts?.truncate ?? this.truncate;
|
|
1364
1378
|
const effective = shouldTruncate ? this.applyTruncation(input) : input;
|
|
1365
1379
|
this.logger.info('Sending SQS message', {
|
|
1366
|
-
input:
|
|
1380
|
+
input: redactInput(this.logger, effective, SEND_MESSAGE_SAFE_FIELDS),
|
|
1367
1381
|
});
|
|
1368
1382
|
return this.client.send(new clientSqs.SendMessageCommand(effective));
|
|
1369
1383
|
}
|
|
@@ -1407,26 +1421,6 @@ class SQSService {
|
|
|
1407
1421
|
this.logger.info('Deleting SQS message', { input });
|
|
1408
1422
|
return this.client.send(new clientSqs.DeleteMessageCommand(input));
|
|
1409
1423
|
}
|
|
1410
|
-
/**
|
|
1411
|
-
* SQS reports rejected entries under `Failed` on an otherwise successful
|
|
1412
|
-
* response, so a resolved chunk does not mean every entry was accepted.
|
|
1413
|
-
* Only id, code and message are copied out — never the entry itself — so
|
|
1414
|
-
* neither the error nor the warning can leak a payload.
|
|
1415
|
-
*/
|
|
1416
|
-
throwIfAnyFailed(operation, results) {
|
|
1417
|
-
const failed = results.flatMap(result => (result.Failed ?? []).map(({ Id, Code, Message }) => ({
|
|
1418
|
-
id: Id,
|
|
1419
|
-
code: Code,
|
|
1420
|
-
message: Message,
|
|
1421
|
-
})));
|
|
1422
|
-
if (failed.length === 0)
|
|
1423
|
-
return results;
|
|
1424
|
-
this.logger.warn(`${operation} had rejected entries`, {
|
|
1425
|
-
failedCount: failed.length,
|
|
1426
|
-
codes: distinctCodes(failed),
|
|
1427
|
-
});
|
|
1428
|
-
throw new BatchOperationError(results, failed);
|
|
1429
|
-
}
|
|
1430
1424
|
/**
|
|
1431
1425
|
* Send a batch of messages to an SQS queue. The SQS API caps
|
|
1432
1426
|
* SendMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -1440,18 +1434,14 @@ class SQSService {
|
|
|
1440
1434
|
*/
|
|
1441
1435
|
async sendMessageBatch(input) {
|
|
1442
1436
|
const entries = input.Entries ?? [];
|
|
1443
|
-
// Inline verbosity check rather than `filterFieldsForLogLevel` because the
|
|
1444
|
-
// safe log shape includes the computed `entryCount`, which isn't a key
|
|
1445
|
-
// on `SendMessageBatchCommandInput`.
|
|
1446
|
-
const logFullInput = shouldLogFullInput(this.logger);
|
|
1447
1437
|
this.logger.info('Sending SQS message batch', {
|
|
1448
|
-
input:
|
|
1438
|
+
input: redactInput(this.logger, input, summariseEntries),
|
|
1449
1439
|
});
|
|
1450
1440
|
const results = [];
|
|
1451
1441
|
for (const batch of chunk(entries, SQS_BATCH_LIMIT)) {
|
|
1452
1442
|
results.push(await this.client.send(new clientSqs.SendMessageBatchCommand({ ...input, Entries: batch })));
|
|
1453
1443
|
}
|
|
1454
|
-
return this.
|
|
1444
|
+
return throwIfAnyFailed(this.logger, 'SQS sendMessageBatch', results);
|
|
1455
1445
|
}
|
|
1456
1446
|
/**
|
|
1457
1447
|
* Delete a batch of messages from an SQS queue. The SQS API caps
|
|
@@ -1467,18 +1457,14 @@ class SQSService {
|
|
|
1467
1457
|
*/
|
|
1468
1458
|
async deleteMessageBatch(input) {
|
|
1469
1459
|
const entries = input.Entries ?? [];
|
|
1470
|
-
// Inline verbosity check rather than `filterFieldsForLogLevel` because the
|
|
1471
|
-
// safe log shape includes the computed `entryCount`, which isn't a key
|
|
1472
|
-
// on `DeleteMessageBatchCommandInput`.
|
|
1473
|
-
const logFullInput = shouldLogFullInput(this.logger);
|
|
1474
1460
|
this.logger.info('Deleting SQS message batch', {
|
|
1475
|
-
input:
|
|
1461
|
+
input: redactInput(this.logger, input, summariseEntries),
|
|
1476
1462
|
});
|
|
1477
1463
|
const results = [];
|
|
1478
1464
|
for (const batch of chunk(entries, SQS_BATCH_LIMIT)) {
|
|
1479
1465
|
results.push(await this.client.send(new clientSqs.DeleteMessageBatchCommand({ ...input, Entries: batch })));
|
|
1480
1466
|
}
|
|
1481
|
-
return this.
|
|
1467
|
+
return throwIfAnyFailed(this.logger, 'SQS deleteMessageBatch', results);
|
|
1482
1468
|
}
|
|
1483
1469
|
}
|
|
1484
1470
|
|
|
@@ -1592,7 +1578,7 @@ class SSMService {
|
|
|
1592
1578
|
*/
|
|
1593
1579
|
async putParameter(input) {
|
|
1594
1580
|
this.logger.info('Putting SSM parameter', {
|
|
1595
|
-
input:
|
|
1581
|
+
input: redactInput(this.logger, input, PUT_PARAMETER_SAFE_FIELDS),
|
|
1596
1582
|
});
|
|
1597
1583
|
return this.client.send(new clientSsm.PutParameterCommand(input));
|
|
1598
1584
|
}
|
package/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../../../src/dynamodb/dynamodb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAEH,oBAAoB,EACpB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EAEvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EAEtB,eAAe,EAIf,eAAe,EACf,gBAAgB,EAEhB,iBAAiB,EACjB,kBAAkB,EAElB,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,mBAAmB,EACtB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../../../src/dynamodb/dynamodb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAEH,oBAAoB,EACpB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EAEvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EAEtB,eAAe,EAIf,eAAe,EACf,gBAAgB,EAEhB,iBAAiB,EACjB,kBAAkB,EAElB,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,mBAAmB,EACtB,MAAM,uBAAuB,CAAC;AAoH/B;;;GAGG;AACH,KAAK,YAAY,CAAC,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG;IACjF,GAAG,EAAE,CAAC,CAAC;CACV,CAAC;AAEF;;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AAC,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/cjs/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/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;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/cjs/src/sqs/sqs.d.ts
CHANGED
|
@@ -55,13 +55,6 @@ export declare class SQSService {
|
|
|
55
55
|
* Delete a single message from an SQS queue.
|
|
56
56
|
*/
|
|
57
57
|
deleteMessage(input: DeleteMessageCommandInput): Promise<DeleteMessageCommandOutput>;
|
|
58
|
-
/**
|
|
59
|
-
* SQS reports rejected entries under `Failed` on an otherwise successful
|
|
60
|
-
* response, so a resolved chunk does not mean every entry was accepted.
|
|
61
|
-
* Only id, code and message are copied out — never the entry itself — so
|
|
62
|
-
* neither the error nor the warning can leak a payload.
|
|
63
|
-
*/
|
|
64
|
-
private throwIfAnyFailed;
|
|
65
58
|
/**
|
|
66
59
|
* Send a batch of messages to an SQS queue. The SQS API caps
|
|
67
60
|
* SendMessageBatch at 10 entries per request, so this method auto-chunks
|
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;AAC3E,OAAO,
|
|
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,w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