@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.
Files changed (41) hide show
  1. package/README.md +3 -2
  2. package/cjs/index.cjs +130 -144
  3. package/cjs/package.json +1 -1
  4. package/cjs/src/dynamodb/dynamodb.d.ts.map +1 -1
  5. package/cjs/src/s3/s3.d.ts.map +1 -1
  6. package/cjs/src/scheduler/scheduler.d.ts.map +1 -1
  7. package/cjs/src/sns/sns.d.ts +7 -0
  8. package/cjs/src/sns/sns.d.ts.map +1 -1
  9. package/cjs/src/sqs/sqs.d.ts +0 -7
  10. package/cjs/src/sqs/sqs.d.ts.map +1 -1
  11. package/cjs/src/util/batch-operation-error.d.ts +20 -3
  12. package/cjs/src/util/batch-operation-error.d.ts.map +1 -1
  13. package/cjs/src/util/redact.d.ts +17 -18
  14. package/cjs/src/util/redact.d.ts.map +1 -1
  15. package/docs/index/classes/APIGatewayService.md +6 -6
  16. package/docs/index/classes/APIGatewayV2Service.md +5 -5
  17. package/docs/index/classes/BatchOperationError.md +5 -5
  18. package/docs/index/classes/DynamoDBService.md +12 -12
  19. package/docs/index/classes/S3Service.md +15 -15
  20. package/docs/index/classes/SNSService.md +10 -4
  21. package/docs/index/classes/SQSService.md +7 -7
  22. package/docs/index/classes/SSMService.md +7 -7
  23. package/docs/index/classes/SchedulerService.md +11 -11
  24. package/docs/index/classes/SecretsManagerService.md +8 -8
  25. package/docs/index/classes/StepFunctionsService.md +6 -6
  26. package/docs/index/interfaces/BatchFailedEntry.md +4 -4
  27. package/docs/testing/testing/functions/createMockService.md +1 -1
  28. package/esm/index.mjs +130 -144
  29. package/esm/package.json +1 -1
  30. package/esm/src/dynamodb/dynamodb.d.ts.map +1 -1
  31. package/esm/src/s3/s3.d.ts.map +1 -1
  32. package/esm/src/scheduler/scheduler.d.ts.map +1 -1
  33. package/esm/src/sns/sns.d.ts +7 -0
  34. package/esm/src/sns/sns.d.ts.map +1 -1
  35. package/esm/src/sqs/sqs.d.ts +0 -7
  36. package/esm/src/sqs/sqs.d.ts.map +1 -1
  37. package/esm/src/util/batch-operation-error.d.ts +20 -3
  38. package/esm/src/util/batch-operation-error.d.ts.map +1 -1
  39. package/esm/src/util/redact.d.ts +17 -18
  40. package/esm/src/util/redact.d.ts.map +1 -1
  41. package/package.json +1 -1
@@ -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 — see {@link shouldLogFullInput} — the full input is
17
- * returned unchanged: operators who asked for that verbosity have explicitly
18
- * opted into seeing everything, including payloads, secret material and PII.
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
- * At any other level, only the fields listed in `safeFields` are included.
21
- * Missing fields are silently skipped — the result type narrows to
22
- * `Pick<T, K>` accordingly.
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 filterFieldsForLogLevel<T extends object, K extends keyof T>(logger: LoggerInterface, input: T, safeFields: readonly K[]): T | Pick<T, K>;
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;AAE3E;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAEnE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EACvE,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,SAAS,CAAC,EAAE,GACzB,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAOhB"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligent/aws-wrappers",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
5
5
  "engines": {
6
6
  "node": ">=18"