@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.
Files changed (56) hide show
  1. package/README.md +36 -9
  2. package/cjs/index.cjs +279 -125
  3. package/cjs/package.json +2 -2
  4. package/cjs/src/dynamodb/dynamodb.d.ts +23 -4
  5. package/cjs/src/dynamodb/dynamodb.d.ts.map +1 -1
  6. package/cjs/src/s3/s3.d.ts +6 -1
  7. package/cjs/src/s3/s3.d.ts.map +1 -1
  8. package/cjs/src/secrets-manager/secrets-manager.d.ts +3 -1
  9. package/cjs/src/secrets-manager/secrets-manager.d.ts.map +1 -1
  10. package/cjs/src/sns/sns.d.ts +8 -5
  11. package/cjs/src/sns/sns.d.ts.map +1 -1
  12. package/cjs/src/sqs/sqs.d.ts +7 -3
  13. package/cjs/src/sqs/sqs.d.ts.map +1 -1
  14. package/cjs/src/ssm/ssm.d.ts +3 -1
  15. package/cjs/src/ssm/ssm.d.ts.map +1 -1
  16. package/cjs/src/util/batch-operation-error.d.ts +19 -2
  17. package/cjs/src/util/batch-operation-error.d.ts.map +1 -1
  18. package/cjs/src/util/json.d.ts +14 -0
  19. package/cjs/src/util/json.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 +15 -6
  23. package/docs/index/classes/DynamoDBService.md +39 -16
  24. package/docs/index/classes/EventBridgeService.md +3 -3
  25. package/docs/index/classes/LambdaFunctionError.md +7 -7
  26. package/docs/index/classes/LambdaService.md +3 -3
  27. package/docs/index/classes/S3Service.md +24 -16
  28. package/docs/index/classes/SESService.md +4 -4
  29. package/docs/index/classes/SNSService.md +12 -9
  30. package/docs/index/classes/SQSService.md +14 -10
  31. package/docs/index/classes/SSMService.md +10 -8
  32. package/docs/index/classes/SchedulerService.md +11 -11
  33. package/docs/index/classes/SecretsManagerService.md +11 -9
  34. package/docs/index/classes/StepFunctionsService.md +6 -6
  35. package/docs/index/interfaces/BatchFailedEntry.md +6 -5
  36. package/docs/index/interfaces/EmptyBucketPageResult.md +2 -2
  37. package/docs/testing/testing/functions/createMockService.md +1 -1
  38. package/esm/index.mjs +280 -126
  39. package/esm/package.json +2 -2
  40. package/esm/src/dynamodb/dynamodb.d.ts +23 -4
  41. package/esm/src/dynamodb/dynamodb.d.ts.map +1 -1
  42. package/esm/src/s3/s3.d.ts +6 -1
  43. package/esm/src/s3/s3.d.ts.map +1 -1
  44. package/esm/src/secrets-manager/secrets-manager.d.ts +3 -1
  45. package/esm/src/secrets-manager/secrets-manager.d.ts.map +1 -1
  46. package/esm/src/sns/sns.d.ts +8 -5
  47. package/esm/src/sns/sns.d.ts.map +1 -1
  48. package/esm/src/sqs/sqs.d.ts +7 -3
  49. package/esm/src/sqs/sqs.d.ts.map +1 -1
  50. package/esm/src/ssm/ssm.d.ts +3 -1
  51. package/esm/src/ssm/ssm.d.ts.map +1 -1
  52. package/esm/src/util/batch-operation-error.d.ts +19 -2
  53. package/esm/src/util/batch-operation-error.d.ts.map +1 -1
  54. package/esm/src/util/json.d.ts +14 -0
  55. package/esm/src/util/json.d.ts.map +1 -0
  56. package/package.json +2 -2
package/esm/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { ApiGatewayV2Client, GetRouteCommand, GetApisCommand, GetRoutesCommand }
3
3
  import xray from 'aws-xray-sdk-core';
4
4
  import { APIGatewayClient, paginateGetRestApis, paginateGetApiKeys, GetApiKeyCommand, paginateGetResources } from '@aws-sdk/client-api-gateway';
5
5
  import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
6
- import { DynamoDBDocumentClient, GetCommand, PutCommand, UpdateCommand, DeleteCommand, QueryCommand, ScanCommand, BatchGetCommand, BatchWriteCommand, paginateQuery, paginateScan } from '@aws-sdk/lib-dynamodb';
6
+ import { DynamoDBDocumentClient, GetCommand, PutCommand, UpdateCommand, DeleteCommand, QueryCommand, ScanCommand, paginateQuery, paginateScan, BatchGetCommand, BatchWriteCommand } from '@aws-sdk/lib-dynamodb';
7
7
  import { EventBridgeClient, PutEventsCommand } from '@aws-sdk/client-eventbridge';
8
8
  import { LambdaClient, InvokeCommand } from '@aws-sdk/client-lambda';
9
9
  import { S3Client, PutObjectCommand, GetObjectCommand, HeadObjectCommand, CopyObjectCommand, paginateListObjectsV2, DeleteObjectCommand, DeleteObjectsCommand } from '@aws-sdk/client-s3';
@@ -144,6 +144,110 @@ class APIGatewayService {
144
144
  }
145
145
  }
146
146
 
147
+ /**
148
+ * Thrown by the batch methods once every chunk has been sent and at least one
149
+ * entry was rejected.
150
+ *
151
+ * `results` holds the raw SDK output of every chunk, so the outputs of the
152
+ * entries that succeeded (message ids, sequence numbers) stay readable. The
153
+ * exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
154
+ * `SSM.getParameters`, whose `results` are empty, and the DynamoDB batch
155
+ * methods, whose `results` hold a single output (the last response, with the
156
+ * `Responses` merged so far for `batchGet`) carrying what is still pending.
157
+ * `failed` is the normalised list of rejected entries across all chunks.
158
+ *
159
+ * Do not pass the error object itself to a logger. `results` is an enumerable
160
+ * property and the Powertools logger serialises every enumerable property of
161
+ * an error, so `logger.error('…', error)` writes `results` to the log — which
162
+ * for the DynamoDB batch methods holds the caller's keys and items. Log `name`,
163
+ * `message` and `failed`, which never carry a payload, and read `results` only
164
+ * to retry or recover.
165
+ *
166
+ * Match on `name` rather than `instanceof` if both the CJS and ESM builds of
167
+ * this package may be loaded in one process.
168
+ */
169
+ class BatchOperationError extends Error {
170
+ results;
171
+ failed;
172
+ name = 'BatchOperationError';
173
+ constructor(results, failed) {
174
+ super(failureMessage(failed));
175
+ this.results = results;
176
+ this.failed = failed;
177
+ }
178
+ }
179
+ function failureMessage(failed) {
180
+ const noun = failed.length === 1 ? 'entry' : 'entries';
181
+ const codes = distinctCodes(failed);
182
+ const suffix = codes.length === 0 ? '' : ` (${codes.join(', ')})`;
183
+ return `Batch operation failed for ${failed.length} ${noun}${suffix}`;
184
+ }
185
+ /**
186
+ * SQS and SNS report rejected entries under `Failed` on an otherwise
187
+ * successful response, so a resolved chunk does not mean every entry was
188
+ * accepted. Extracts those entries and delegates to {@link throwIfAny}.
189
+ *
190
+ * Only id, code and message are copied out — never the entry itself — so
191
+ * neither the error nor the warning can leak a payload.
192
+ */
193
+ function throwIfAnyFailed(logger, operation, results) {
194
+ const failed = results.flatMap(result => (result.Failed ?? []).map(({ Id, Code, Message }) => ({
195
+ id: Id,
196
+ code: Code,
197
+ message: Message,
198
+ })));
199
+ return throwIfAny(logger, operation, results, failed);
200
+ }
201
+ /**
202
+ * S3 reports undeleted keys under `Errors` on an otherwise successful
203
+ * `DeleteObjects` response. Same contract as {@link throwIfAnyFailed}; the
204
+ * key is carried as the failed entry's `id`, and `VersionId` is dropped.
205
+ */
206
+ function throwIfAnyDeleteErrors(logger, operation, results) {
207
+ const failed = results.flatMap(result => (result.Errors ?? []).map(({ Key, Code, Message }) => ({
208
+ id: Key,
209
+ code: Code,
210
+ message: Message,
211
+ })));
212
+ return throwIfAny(logger, operation, results, failed);
213
+ }
214
+ /**
215
+ * Warn-and-throw step for services whose responses don't use the SQS/SNS
216
+ * `Failed` shape and so extract their own rejected entries (`EventBridge.putEvents`),
217
+ * or whose `results` aren't a plain list of SDK outputs (`S3.emptyBucket`).
218
+ * Returns `results` untouched when `failed` is empty.
219
+ *
220
+ * Callers must build `failed` by copying id, code and message explicitly —
221
+ * never by spreading the SDK entry — because it goes straight into the error
222
+ * and the warning.
223
+ */
224
+ function throwIfAny(logger, operation, results, failed) {
225
+ if (failed.length === 0)
226
+ return results;
227
+ return throwBatchFailure(logger, operation, results, failed);
228
+ }
229
+ /**
230
+ * The warn-and-throw half of {@link throwIfAny}, for callers that already know
231
+ * `failed` is non-empty and need the compiler to see that the call never
232
+ * returns. The same rule applies: build `failed` by copying id, code and
233
+ * message explicitly.
234
+ */
235
+ function throwBatchFailure(logger, operation, results, failed) {
236
+ logger.warn(`${operation} had rejected entries`, {
237
+ failedCount: failed.length,
238
+ codes: distinctCodes(failed),
239
+ });
240
+ throw new BatchOperationError(results, failed);
241
+ }
242
+ /**
243
+ * Distinct error codes in first-seen order, for the error message and the
244
+ * warning log line.
245
+ */
246
+ function distinctCodes(failed) {
247
+ const codes = failed.flatMap(entry => (entry.code === undefined ? [] : [entry.code]));
248
+ return [...new Set(codes)];
249
+ }
250
+
147
251
  /**
148
252
  * Whether the logger is verbose enough that full SDK inputs may be written to
149
253
  * the log. The unlock rule is documented on {@link redactInput}.
@@ -179,6 +283,29 @@ const BATCH_GET_BASE_DELAY_MS = 200;
179
283
  function summariseTables(input) {
180
284
  return { tables: Object.keys(input.RequestItems ?? {}) };
181
285
  }
286
+ /**
287
+ * The tables that still have unprocessed keys or writes. Tables whose list is
288
+ * empty are dropped, so an empty result means there is nothing left to retry.
289
+ */
290
+ function pendingCounts(unprocessed, countOf) {
291
+ return Object.entries(unprocessed)
292
+ .map(([table, entry]) => ({ table, count: countOf(entry) ?? 0 }))
293
+ .filter(({ count }) => count > 0);
294
+ }
295
+ /**
296
+ * One failed entry per request still unprocessed after the final attempt. The
297
+ * `id` is the table name plus the position within that table's unprocessed
298
+ * list — deliberately not the key or item, which is caller data and must not
299
+ * reach the error message or the warning. The position indexes into the
300
+ * `UnprocessedKeys` / `UnprocessedItems` the error carries in `results`.
301
+ */
302
+ function unprocessedEntries(pending, code, attempts) {
303
+ return pending.flatMap(({ table, count }) => Array.from({ length: count }, (_, index) => ({
304
+ id: `${table}[${index}]`,
305
+ code,
306
+ message: `Still unprocessed after ${attempts} attempts`,
307
+ })));
308
+ }
182
309
  /**
183
310
  * Fields safe to log at INFO. Omits `Key` (may carry customer IDs / tenant IDs).
184
311
  */
@@ -395,63 +522,101 @@ class DynamoDBService {
395
522
  /**
396
523
  * Batch-get items from one or more DynamoDB tables, retrying
397
524
  * `UnprocessedKeys` with jittered exponential backoff. Up to 5 attempts
398
- * (200ms base delay). Throws when keys remain unprocessed after the final
399
- * attempt. `Responses` are merged across attempts, keyed by table name.
525
+ * (200ms base delay). `Responses` are merged across attempts, keyed by
526
+ * table name.
400
527
  *
401
528
  * Note: this method is intentionally **not** generic. `BatchGet`'s
402
529
  * `Responses` field is a multi-table `Record<string, item[]>` whose item
403
530
  * shapes can differ per table — no single `T` can soundly describe it.
404
531
  * Callers should narrow the result type at the call site.
532
+ *
533
+ * @throws {@link BatchOperationError} when keys remain unprocessed after
534
+ * the final attempt. `results` holds one output: the merged `Responses`
535
+ * retrieved so far, plus the still-pending `UnprocessedKeys` to retry.
536
+ * `failed` has one entry per pending key with `code: 'UnprocessedKeys'`
537
+ * and an `id` of `<table>[<index>]`, the key's position in
538
+ * `results[0].UnprocessedKeys[<table>].Keys`. The `failed` list never
539
+ * carries key values; `results` does, as it is data the caller requested,
540
+ * so don't log the error object itself (see {@link BatchOperationError}).
541
+ * Request-level SDK exceptions propagate unchanged.
405
542
  */
406
543
  async batchGet(input) {
407
544
  this.logger.info('Batch getting DynamoDB items', {
408
545
  input: redactInput(this.logger, input, summariseTables),
409
546
  });
410
- let current = input;
411
547
  const mergedResponses = {};
412
- for (let attempt = 0; attempt < BATCH_GET_MAX_ATTEMPTS; attempt++) {
413
- const response = await this.client.send(new BatchGetCommand(current));
548
+ const attempt = async (request) => {
549
+ const response = await this.client.send(new BatchGetCommand(request));
414
550
  for (const [table, items] of Object.entries(response.Responses ?? {})) {
415
551
  mergedResponses[table] = [...(mergedResponses[table] ?? []), ...items];
416
552
  }
417
- const unprocessed = response.UnprocessedKeys;
418
- if (!unprocessed || Object.keys(unprocessed).length === 0) {
419
- return { ...response, Responses: mergedResponses };
420
- }
553
+ const unprocessed = response.UnprocessedKeys ?? {};
554
+ return {
555
+ output: { ...response, Responses: mergedResponses },
556
+ unprocessed,
557
+ pending: pendingCounts(unprocessed, ({ Keys }) => Keys?.length),
558
+ };
559
+ };
560
+ let current = input;
561
+ for (let attemptNumber = 1; attemptNumber < BATCH_GET_MAX_ATTEMPTS; attemptNumber++) {
562
+ const { output, unprocessed, pending } = await attempt(current);
563
+ if (pending.length === 0)
564
+ return output;
421
565
  this.logger.warn('Retrying unprocessed DynamoDB items', {
422
- attempt: attempt + 1,
423
- tables: Object.keys(unprocessed),
566
+ attempt: attemptNumber,
567
+ tables: pending.map(({ table }) => table),
424
568
  });
425
- if (attempt < BATCH_GET_MAX_ATTEMPTS - 1)
426
- await sleep(backoffDelay(attempt, BATCH_GET_BASE_DELAY_MS));
569
+ await sleep(backoffDelay(attemptNumber - 1, BATCH_GET_BASE_DELAY_MS));
427
570
  current = { ...input, RequestItems: unprocessed };
428
571
  }
429
- throw new Error(`batchGet failed after ${BATCH_GET_MAX_ATTEMPTS} attempts`);
572
+ const { output, pending } = await attempt(current);
573
+ if (pending.length === 0)
574
+ return output;
575
+ return throwBatchFailure(this.logger, 'DynamoDB batchGet', [output], unprocessedEntries(pending, 'UnprocessedKeys', BATCH_GET_MAX_ATTEMPTS));
430
576
  }
431
577
  /**
432
578
  * Batch-write items to DynamoDB, retrying `UnprocessedItems` with jittered
433
- * exponential backoff. Up to 5 attempts (200ms base delay). Throws when
434
- * items remain unprocessed after the final attempt.
579
+ * exponential backoff. Up to 5 attempts (200ms base delay).
580
+ *
581
+ * @throws {@link BatchOperationError} when items remain unprocessed after
582
+ * the final attempt. `results` holds one output: the last response, whose
583
+ * `UnprocessedItems` are the writes still to retry. `failed` has one entry
584
+ * per pending write with `code: 'UnprocessedItems'` and an `id` of
585
+ * `<table>[<index>]`, the write's position in
586
+ * `results[0].UnprocessedItems[<table>]`. The `failed` list never carries
587
+ * item data; `results` does, as it is data the caller supplied, so don't
588
+ * log the error object itself (see {@link BatchOperationError}).
589
+ * Request-level SDK exceptions propagate unchanged.
435
590
  */
436
591
  async batchWrite(input) {
437
592
  this.logger.info('Batch writing DynamoDB items', {
438
593
  input: redactInput(this.logger, input, summariseTables),
439
594
  });
595
+ const attempt = async (request) => {
596
+ const response = await this.client.send(new BatchWriteCommand(request));
597
+ const unprocessed = response.UnprocessedItems ?? {};
598
+ return {
599
+ response,
600
+ unprocessed,
601
+ pending: pendingCounts(unprocessed, writes => writes.length),
602
+ };
603
+ };
440
604
  let current = input;
441
- for (let attempt = 0; attempt < BATCH_WRITE_MAX_ATTEMPTS; attempt++) {
442
- const response = await this.client.send(new BatchWriteCommand(current));
443
- const unprocessed = response.UnprocessedItems;
444
- if (!unprocessed || Object.keys(unprocessed).length === 0)
605
+ for (let attemptNumber = 1; attemptNumber < BATCH_WRITE_MAX_ATTEMPTS; attemptNumber++) {
606
+ const { response, unprocessed, pending } = await attempt(current);
607
+ if (pending.length === 0)
445
608
  return response;
446
609
  this.logger.warn('Retrying unprocessed DynamoDB items', {
447
- attempt: attempt + 1,
448
- tables: Object.keys(unprocessed),
610
+ attempt: attemptNumber,
611
+ tables: pending.map(({ table }) => table),
449
612
  });
450
- if (attempt < BATCH_WRITE_MAX_ATTEMPTS - 1)
451
- await sleep(backoffDelay(attempt, BATCH_WRITE_BASE_DELAY_MS));
613
+ await sleep(backoffDelay(attemptNumber - 1, BATCH_WRITE_BASE_DELAY_MS));
452
614
  current = { ...input, RequestItems: unprocessed };
453
615
  }
454
- throw new Error(`batchWrite failed after ${BATCH_WRITE_MAX_ATTEMPTS} attempts`);
616
+ const { response, pending } = await attempt(current);
617
+ if (pending.length === 0)
618
+ return response;
619
+ return throwBatchFailure(this.logger, 'DynamoDB batchWrite', [response], unprocessedEntries(pending, 'UnprocessedItems', BATCH_WRITE_MAX_ATTEMPTS));
455
620
  }
456
621
  /**
457
622
  * Paginate over Query results, yielding one unmarshalled item at a time.
@@ -514,86 +679,6 @@ class DynamoDBService {
514
679
  }
515
680
  }
516
681
 
517
- /**
518
- * Thrown by the batch methods once every chunk has been sent and at least one
519
- * entry was rejected.
520
- *
521
- * `results` holds the raw SDK output of every chunk, so the outputs of the
522
- * entries that succeeded (message ids, sequence numbers) stay readable. The
523
- * exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
524
- * and `SSM.getParameters`, whose `results` are empty.
525
- * `failed` is the normalised list of rejected entries across all chunks.
526
- *
527
- * Match on `name` rather than `instanceof` if both the CJS and ESM builds of
528
- * this package may be loaded in one process.
529
- */
530
- class BatchOperationError extends Error {
531
- results;
532
- failed;
533
- name = 'BatchOperationError';
534
- constructor(results, failed) {
535
- super(`Batch operation failed for ${failed.length} entries (${distinctCodes(failed).join(', ')})`);
536
- this.results = results;
537
- this.failed = failed;
538
- }
539
- }
540
- /**
541
- * SQS and SNS report rejected entries under `Failed` on an otherwise
542
- * successful response, so a resolved chunk does not mean every entry was
543
- * accepted. Extracts those entries and delegates to {@link throwIfAny}.
544
- *
545
- * Only id, code and message are copied out — never the entry itself — so
546
- * neither the error nor the warning can leak a payload.
547
- */
548
- function throwIfAnyFailed(logger, operation, results) {
549
- const failed = results.flatMap(result => (result.Failed ?? []).map(({ Id, Code, Message }) => ({
550
- id: Id,
551
- code: Code,
552
- message: Message,
553
- })));
554
- return throwIfAny(logger, operation, results, failed);
555
- }
556
- /**
557
- * S3 reports undeleted keys under `Errors` on an otherwise successful
558
- * `DeleteObjects` response. Same contract as {@link throwIfAnyFailed}; the
559
- * key is carried as the failed entry's `id`, and `VersionId` is dropped.
560
- */
561
- function throwIfAnyDeleteErrors(logger, operation, results) {
562
- const failed = results.flatMap(result => (result.Errors ?? []).map(({ Key, Code, Message }) => ({
563
- id: Key,
564
- code: Code,
565
- message: Message,
566
- })));
567
- return throwIfAny(logger, operation, results, failed);
568
- }
569
- /**
570
- * Warn-and-throw step for services whose responses don't use the SQS/SNS
571
- * `Failed` shape and so extract their own rejected entries (`EventBridge.putEvents`),
572
- * or whose `results` aren't a plain list of SDK outputs (`S3.emptyBucket`).
573
- * Returns `results` untouched when `failed` is empty.
574
- *
575
- * Callers must build `failed` by copying id, code and message explicitly —
576
- * never by spreading the SDK entry — because it goes straight into the error
577
- * and the warning.
578
- */
579
- function throwIfAny(logger, operation, results, failed) {
580
- if (failed.length === 0)
581
- return results;
582
- logger.warn(`${operation} had rejected entries`, {
583
- failedCount: failed.length,
584
- codes: distinctCodes(failed),
585
- });
586
- throw new BatchOperationError(results, failed);
587
- }
588
- /**
589
- * Distinct error codes in first-seen order, for the error message and the
590
- * warning log line.
591
- */
592
- function distinctCodes(failed) {
593
- const codes = failed.flatMap(entry => (entry.code === undefined ? [] : [entry.code]));
594
- return [...new Set(codes)];
595
- }
596
-
597
682
  /**
598
683
  * Split a list into consecutive chunks of at most `size` items, mirroring the
599
684
  * per-request caps the AWS APIs enforce on batch operations.
@@ -840,8 +925,34 @@ class LambdaService {
840
925
  }
841
926
  }
842
927
 
928
+ /**
929
+ * `JSON.parse` that never leaks the parsed text. V8's `SyntaxError` message
930
+ * embeds a snippet of the input (`Unexpected token 'h', ..."assword": hunter2}"
931
+ * is not valid JSON`), and the wrappers parse secrets and stored objects, so
932
+ * letting it through would put that content into the caller's error logs.
933
+ *
934
+ * The original error is deliberately not attached as `cause`: loggers serialise
935
+ * `cause` and its message carries the snippet. `context` should identify the
936
+ * source (a secret id, a bucket and key) so the failure is still diagnosable.
937
+ *
938
+ * @throws An `Error` naming `context`, without any of the input text.
939
+ */
940
+ function parseJson(text, context) {
941
+ try {
942
+ return JSON.parse(text);
943
+ }
944
+ catch {
945
+ throw new Error(`${context} does not contain valid JSON`);
946
+ }
947
+ }
948
+
843
949
  const DEFAULT_PRESIGNED_URL_EXPIRES_IN_SECONDS = 3600;
844
950
  const DELETE_OBJECTS_BATCH_LIMIT = 1000;
951
+ /**
952
+ * `Key` is `string | undefined` here because the SDK types a required `Key`
953
+ * that way even through `Required<Pick<...>>`.
954
+ */
955
+ const parseJsonObject = (body, bucket, key) => parseJson(body, `S3 object s3://${bucket}/${key}`);
845
956
  /**
846
957
  * Fields safe to log at INFO for `putObject`. Omits `Body` (object payload).
847
958
  */
@@ -936,13 +1047,15 @@ class S3Service {
936
1047
  * Get an object from S3 and parse it as JSON.
937
1048
  * @template T - Expected type of the parsed value.
938
1049
  * @returns The parsed value, or `undefined` if the response has no body.
939
- * @throws If the body is non-empty and not valid JSON.
1050
+ * @throws If the body is non-empty and not valid JSON. The error names the
1051
+ * object and never includes any of its content, unlike the native
1052
+ * `SyntaxError`.
940
1053
  */
941
1054
  async getJsonObject(input) {
942
1055
  this.logger.info('Getting S3 JSON object', { input });
943
1056
  const response = await this.client.send(new GetObjectCommand(input));
944
1057
  const body = await response.Body?.transformToString();
945
- return body ? JSON.parse(body) : undefined;
1058
+ return body ? parseJsonObject(body, input.Bucket, input.Key) : undefined;
946
1059
  }
947
1060
  /**
948
1061
  * Fetch the metadata for an S3 object without downloading its body.
@@ -972,6 +1085,9 @@ class S3Service {
972
1085
  * List and JSON-parse every object under a bucket and optional prefix.
973
1086
  * Auto-paginated. Objects without a body are skipped.
974
1087
  * @template T - Expected type of each parsed object.
1088
+ * @throws If any object is not valid JSON. The error names that object's
1089
+ * key and never includes any of its content, unlike the native
1090
+ * `SyntaxError`; objects after it are not fetched.
975
1091
  */
976
1092
  async getAllObjects(bucket, prefix) {
977
1093
  this.logger.info('Getting all S3 objects', { input: { bucket, prefix } });
@@ -984,7 +1100,7 @@ class S3Service {
984
1100
  const response = await this.client.send(new GetObjectCommand({ Bucket: bucket, Key: object.Key }));
985
1101
  const body = await response.Body?.transformToString();
986
1102
  if (body)
987
- bodies.push(JSON.parse(body));
1103
+ bodies.push(parseJsonObject(body, bucket, object.Key));
988
1104
  }
989
1105
  }
990
1106
  return bodies;
@@ -1329,12 +1445,14 @@ class SecretsManagerService {
1329
1445
  * @param secretId - The ARN or friendly name of the secret.
1330
1446
  * @template T - Expected shape of the parsed secret.
1331
1447
  * @returns The parsed secret value.
1332
- * @throws If the secret has no `SecretString` or the value is not valid JSON.
1448
+ * @throws If the secret has no `SecretString`, or the value is not valid
1449
+ * JSON. The latter error names the secret and never includes any of its
1450
+ * value, unlike the native `SyntaxError`.
1333
1451
  */
1334
1452
  async getJsonSecret(secretId) {
1335
1453
  this.logger.info('Fetching JSON secret', { input: { secretId } });
1336
1454
  const secretString = await this.fetchSecretString(secretId);
1337
- return JSON.parse(secretString);
1455
+ return parseJson(secretString, `Secret '${secretId}'`);
1338
1456
  }
1339
1457
  /**
1340
1458
  * Create a new secret. At INFO level the log line includes only identity
@@ -1628,8 +1746,16 @@ function truncateCodepoints(str, maxChars) {
1628
1746
  }
1629
1747
 
1630
1748
  const PUBLISH_BATCH_LIMIT = 10;
1749
+ /**
1750
+ * The default `MaximumMessageSize` of an SNS topic. Topics can be raised to
1751
+ * 1 MiB, but the wrapper does not know a topic's setting, so it cuts at the
1752
+ * size every topic accepts. Message attributes count toward the topic limit
1753
+ * too and are not truncated, so a message at this size plus attributes can
1754
+ * still be rejected.
1755
+ */
1631
1756
  const SNS_MESSAGE_MAX_BYTES = 256 * 1024;
1632
- const SNS_SUBJECT_MAX_CHARS = 100;
1757
+ /** SNS requires a subject of *less than* 100 characters, so 99 is the maximum. */
1758
+ const SNS_SUBJECT_MAX_CHARS = 99;
1633
1759
  /**
1634
1760
  * Fields safe to log at INFO level for `publish`. Omits `Message`, `Subject`,
1635
1761
  * `MessageAttributes`, and `PhoneNumber` — payloads, user-visible content
@@ -1660,11 +1786,14 @@ class SNSService {
1660
1786
  * which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
1661
1787
  * @param opts.client - Optional pre-configured `SNSClient`. When supplied,
1662
1788
  * the wrapper does not apply X-Ray instrumentation.
1663
- * @param opts.truncate - When `true`, oversized `Message` / `Subject` are
1664
- * truncated (byte-safe / codepoint-safe) before sending instead of failing
1665
- * at the SDK. Defaults to `false` — the SDK throws on oversize, which is
1666
- * usually the right failure mode. Each `publish` call can override via
1667
- * its own `truncate` option.
1789
+ * @param opts.truncate - When `true`, an oversized `Message` (above 256 KiB,
1790
+ * the default topic limit — raising a topic's `MaximumMessageSize` does not
1791
+ * raise this cut-off) or `Subject` (above 99 characters) is truncated
1792
+ * (byte-safe / codepoint-safe) before sending instead of failing at the
1793
+ * SDK. Truncating a structured `Message` such as JSON can leave it invalid.
1794
+ * Defaults to `false` — the SDK throws on oversize, which is usually the
1795
+ * right failure mode. Each `publish` call can override via its own
1796
+ * `truncate` option.
1668
1797
  */
1669
1798
  constructor(opts) {
1670
1799
  this.client = opts?.client ?? xray.captureAWSv3Client(new SNSClient());
@@ -1750,7 +1879,12 @@ class SNSService {
1750
1879
  }
1751
1880
 
1752
1881
  const SQS_BATCH_LIMIT = 10;
1753
- const SQS_MESSAGE_BODY_MAX_BYTES = 256 * 1024;
1882
+ /**
1883
+ * The SQS maximum message size. A queue's own `MaximumMessageSize` may be set
1884
+ * lower, and the wrapper cannot see it, so a queue configured below this still
1885
+ * rejects a body truncated to it.
1886
+ */
1887
+ const SQS_MESSAGE_BODY_MAX_BYTES = 1024 * 1024;
1754
1888
  /**
1755
1889
  * Fields safe to log at INFO level for `sendMessage`. Omits `MessageBody` and
1756
1890
  * `MessageAttributes` — both carry payload content.
@@ -1785,9 +1919,13 @@ class SQSService {
1785
1919
  * which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
1786
1920
  * @param opts.client - Optional pre-configured `SQSClient`. When supplied,
1787
1921
  * the wrapper does not apply X-Ray instrumentation.
1788
- * @param opts.truncate - When `true`, oversized `MessageBody` is truncated
1789
- * (byte-safe) before sending instead of failing at the SDK. Defaults to
1790
- * `false`. Each `sendMessage` call can override via its own `truncate`
1922
+ * @param opts.truncate - When `true`, a `MessageBody` above 1 MiB is
1923
+ * truncated (byte-safe) before sending instead of failing at the SDK. This
1924
+ * is the SQS maximum; a queue configured with a lower `MaximumMessageSize`
1925
+ * is not known to the wrapper. Message attributes count toward the limit
1926
+ * too and are not truncated.
1927
+ * Truncating a structured body such as JSON can leave it invalid. Defaults
1928
+ * to `false`. Each `sendMessage` call can override via its own `truncate`
1791
1929
  * option.
1792
1930
  */
1793
1931
  constructor(opts) {
@@ -1897,6 +2035,20 @@ class SQSService {
1897
2035
  }
1898
2036
 
1899
2037
  const GET_PARAMETERS_LIMIT = 10;
2038
+ /**
2039
+ * Every string a caller may have used to request this parameter. SSM answers
2040
+ * with the plain `Name` whatever was requested, so an ARN or a
2041
+ * `name:version` / `name:label` selector can only be matched through `ARN`
2042
+ * and `Selector`. A response carrying a `Selector` is keyed by its selector
2043
+ * forms only, so it can't shadow a request for the unversioned parameter.
2044
+ * `Selector` already carries its leading colon (`:3`, `:prod`).
2045
+ */
2046
+ function requestKeys({ Name, ARN, Selector }) {
2047
+ const identifiers = [Name, ARN].filter((id) => id !== undefined);
2048
+ if (Selector === undefined)
2049
+ return identifiers;
2050
+ return identifiers.map(id => `${id}${Selector}`);
2051
+ }
1900
2052
  /**
1901
2053
  * One failed entry per alias whose path SSM reported as invalid, so two
1902
2054
  * aliases sharing a missing path are both named.
@@ -1996,7 +2148,9 @@ class SSMService {
1996
2148
  * alias in `message`. Request-level SDK exceptions are not wrapped.
1997
2149
  *
1998
2150
  * @param aliases - Record mapping each desired local alias to its SSM
1999
- * parameter name (or ARN).
2151
+ * parameter name, ARN, or a `name:version` / `name:label` selector. The
2152
+ * value is matched back to the response by the name, ARN and selector SSM
2153
+ * reports, so each of those forms resolves to its own parameter.
2000
2154
  * @param opts.required - Throw when any requested parameter does not
2001
2155
  * exist. Defaults to `false`.
2002
2156
  * @returns A record keyed by the same aliases, mapping each to the
@@ -2006,7 +2160,7 @@ class SSMService {
2006
2160
  async getParameters(aliases, opts) {
2007
2161
  this.logger.info('Fetching SSM parameters', { input: { aliases } });
2008
2162
  const names = Object.values(aliases);
2009
- const byPath = new Map();
2163
+ const byRequest = new Map();
2010
2164
  const invalidPaths = new Set();
2011
2165
  for (const batch of chunk(names, GET_PARAMETERS_LIMIT)) {
2012
2166
  const response = await this.client.send(new GetParametersCommand({
@@ -2014,8 +2168,8 @@ class SSMService {
2014
2168
  WithDecryption: true,
2015
2169
  }));
2016
2170
  for (const parameter of response.Parameters ?? []) {
2017
- if (parameter.Name !== undefined)
2018
- byPath.set(parameter.Name, parameter.Value);
2171
+ for (const key of requestKeys(parameter))
2172
+ byRequest.set(key, parameter.Value);
2019
2173
  }
2020
2174
  for (const name of response.InvalidParameters ?? [])
2021
2175
  invalidPaths.add(name);
@@ -2026,7 +2180,7 @@ class SSMService {
2026
2180
  }
2027
2181
  const result = {};
2028
2182
  for (const alias of Object.keys(aliases)) {
2029
- result[alias] = byPath.get(aliases[alias]);
2183
+ result[alias] = byRequest.get(aliases[alias]);
2030
2184
  }
2031
2185
  return result;
2032
2186
  }
package/esm/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aligent/aws-wrappers",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
5
5
  "engines": {
6
- "node": ">=18"
6
+ "node": ">=20"
7
7
  },
8
8
  "main": "./cjs/index.cjs",
9
9
  "module": "./index.esm.js",
@@ -105,19 +105,38 @@ export declare class DynamoDBService {
105
105
  /**
106
106
  * Batch-get items from one or more DynamoDB tables, retrying
107
107
  * `UnprocessedKeys` with jittered exponential backoff. Up to 5 attempts
108
- * (200ms base delay). Throws when keys remain unprocessed after the final
109
- * attempt. `Responses` are merged across attempts, keyed by table name.
108
+ * (200ms base delay). `Responses` are merged across attempts, keyed by
109
+ * table name.
110
110
  *
111
111
  * Note: this method is intentionally **not** generic. `BatchGet`'s
112
112
  * `Responses` field is a multi-table `Record<string, item[]>` whose item
113
113
  * shapes can differ per table — no single `T` can soundly describe it.
114
114
  * Callers should narrow the result type at the call site.
115
+ *
116
+ * @throws {@link BatchOperationError} when keys remain unprocessed after
117
+ * the final attempt. `results` holds one output: the merged `Responses`
118
+ * retrieved so far, plus the still-pending `UnprocessedKeys` to retry.
119
+ * `failed` has one entry per pending key with `code: 'UnprocessedKeys'`
120
+ * and an `id` of `<table>[<index>]`, the key's position in
121
+ * `results[0].UnprocessedKeys[<table>].Keys`. The `failed` list never
122
+ * carries key values; `results` does, as it is data the caller requested,
123
+ * so don't log the error object itself (see {@link BatchOperationError}).
124
+ * Request-level SDK exceptions propagate unchanged.
115
125
  */
116
126
  batchGet(input: BatchGetCommandInput): Promise<BatchGetCommandOutput>;
117
127
  /**
118
128
  * Batch-write items to DynamoDB, retrying `UnprocessedItems` with jittered
119
- * exponential backoff. Up to 5 attempts (200ms base delay). Throws when
120
- * items remain unprocessed after the final attempt.
129
+ * exponential backoff. Up to 5 attempts (200ms base delay).
130
+ *
131
+ * @throws {@link BatchOperationError} when items remain unprocessed after
132
+ * the final attempt. `results` holds one output: the last response, whose
133
+ * `UnprocessedItems` are the writes still to retry. `failed` has one entry
134
+ * per pending write with `code: 'UnprocessedItems'` and an `id` of
135
+ * `<table>[<index>]`, the write's position in
136
+ * `results[0].UnprocessedItems[<table>]`. The `failed` list never carries
137
+ * item data; `results` does, as it is data the caller supplied, so don't
138
+ * log the error object itself (see {@link BatchOperationError}).
139
+ * Request-level SDK exceptions propagate unchanged.
121
140
  */
122
141
  batchWrite(input: BatchWriteCommandInput): Promise<BatchWriteCommandOutput>;
123
142
  /**
@@ -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;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,CA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