@aligent/aws-wrappers 0.0.1 → 0.1.1

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 (39) hide show
  1. package/cjs/index.cjs +1911 -0
  2. package/cjs/index.d.ts +1 -0
  3. package/cjs/package.json +51 -0
  4. package/{src → cjs/src}/dynamodb/dynamodb.d.ts +2 -2
  5. package/cjs/src/index.d.ts +7 -0
  6. package/{src → cjs/src}/s3/s3.d.ts +2 -2
  7. package/{src → cjs/src}/secrets-manager/secrets-manager.d.ts +2 -2
  8. package/{src → cjs/src}/sfn/sfn.d.ts +2 -2
  9. package/{src → cjs/src}/sns/sns.d.ts +2 -2
  10. package/{src → cjs/src}/sqs/sqs.d.ts +2 -2
  11. package/{src → cjs/src}/ssm/ssm.d.ts +2 -2
  12. package/{src → cjs/src}/util/redact.d.ts +2 -2
  13. package/esm/index.d.ts +1 -0
  14. package/esm/index.mjs +1903 -0
  15. package/esm/package.json +51 -0
  16. package/esm/src/dynamodb/dynamodb.d.ts +127 -0
  17. package/esm/src/index.d.ts +7 -0
  18. package/esm/src/s3/s3.d.ts +131 -0
  19. package/esm/src/secrets-manager/secrets-manager.d.ts +78 -0
  20. package/esm/src/sfn/sfn.d.ts +38 -0
  21. package/esm/src/sns/sns.d.ts +48 -0
  22. package/esm/src/sqs/sqs.d.ts +60 -0
  23. package/esm/src/ssm/ssm.d.ts +84 -0
  24. package/{src/util/redact.js → esm/src/util/redact.d.ts} +2 -13
  25. package/esm/src/util/truncate.d.ts +15 -0
  26. package/package.json +25 -7
  27. package/CLAUDE.md +0 -172
  28. package/src/dynamodb/dynamodb.js +0 -308
  29. package/src/index.d.ts +0 -7
  30. package/src/index.js +0 -17
  31. package/src/s3/s3.js +0 -244
  32. package/src/secrets-manager/secrets-manager.js +0 -152
  33. package/src/sfn/sfn.js +0 -74
  34. package/src/sns/sns.js +0 -110
  35. package/src/sqs/sqs.js +0 -134
  36. package/src/ssm/ssm.js +0 -144
  37. package/src/util/truncate.js +0 -36
  38. package/tsconfig.lib.tsbuildinfo +0 -1
  39. /package/{src → cjs/src}/util/truncate.d.ts +0 -0
package/cjs/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@aligent/aws-wrappers",
3
+ "version": "0.1.1",
4
+ "description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
5
+ "main": "./index.cjs.js",
6
+ "module": "./esm/index.mjs",
7
+ "types": "./cjs/src/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./esm/src/index.d.ts",
12
+ "default": "./esm/index.mjs"
13
+ },
14
+ "require": {
15
+ "types": "./cjs/src/index.d.ts",
16
+ "default": "./cjs/index.cjs"
17
+ }
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "files": [
22
+ "cjs",
23
+ "esm",
24
+ "README.md",
25
+ "docs"
26
+ ],
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/aligent/microservice-development-utilities.git",
30
+ "directory": "packages/aws-wrappers"
31
+ },
32
+ "dependencies": {
33
+ "@aws-lambda-powertools/logger": "^2.33.0",
34
+ "@aws-sdk/client-dynamodb": "^3.1045.0",
35
+ "@aws-sdk/client-s3": "^3.1045.0",
36
+ "@aws-sdk/client-secrets-manager": "^3.1045.0",
37
+ "@aws-sdk/client-sfn": "^3.1045.0",
38
+ "@aws-sdk/client-sns": "^3.1045.0",
39
+ "@aws-sdk/client-sqs": "^3.1045.0",
40
+ "@aws-sdk/client-ssm": "^3.1045.0",
41
+ "@aws-sdk/lib-dynamodb": "^3.1045.0",
42
+ "@aws-sdk/s3-request-presigner": "^3.1045.0",
43
+ "aws-xray-sdk-core": "^3.12.0"
44
+ },
45
+ "author": "Aligent",
46
+ "license": "MIT",
47
+ "devDependencies": {
48
+ "aws-sdk-client-mock": "^4.1.0"
49
+ },
50
+ "type": "commonjs"
51
+ }
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { BatchGetCommandInput, BatchGetCommandOutput, BatchWriteCommandInput, BatchWriteCommandOutput, DeleteCommandInput, DeleteCommandOutput, DynamoDBDocumentClient, GetCommandInput, PutCommandInput, PutCommandOutput, QueryCommandInput, QueryCommandOutput, ScanCommandInput, ScanCommandOutput, UpdateCommandInput, UpdateCommandOutput } from '@aws-sdk/lib-dynamodb';
3
3
  /**
4
4
  * DynamoDB command input with a typed `Key`. Used to thread a caller-defined
@@ -27,7 +27,7 @@ export declare class DynamoDBService {
27
27
  * tracing captures every DynamoDB call.
28
28
  */
29
29
  constructor(opts?: {
30
- logger?: Logger;
30
+ logger?: LoggerInterface;
31
31
  client?: DynamoDBDocumentClient;
32
32
  });
33
33
  /**
@@ -0,0 +1,7 @@
1
+ export { DynamoDBService } from './dynamodb/dynamodb.js';
2
+ export { S3Service } from './s3/s3.js';
3
+ export { SecretsManagerService } from './secrets-manager/secrets-manager.js';
4
+ export { StepFunctionsService } from './sfn/sfn.js';
5
+ export { SNSService } from './sns/sns.js';
6
+ export { SQSService } from './sqs/sqs.js';
7
+ export { SSMService } from './ssm/ssm.js';
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { CopyObjectCommandInput, CopyObjectCommandOutput, DeleteObjectCommandInput, DeleteObjectCommandOutput, DeleteObjectsCommandOutput, GetObjectCommandInput, GetObjectCommandOutput, HeadObjectCommandInput, HeadObjectCommandOutput, PutObjectCommandInput, PutObjectCommandOutput, S3Client } from '@aws-sdk/client-s3';
3
3
  /** Tight wrapper input type for `putObject`. */
4
4
  type PutObjectInput = Required<Pick<PutObjectCommandInput, 'Bucket' | 'Key' | 'Body'>>;
@@ -27,7 +27,7 @@ export declare class S3Service {
27
27
  * the wrapper does not apply X-Ray instrumentation.
28
28
  */
29
29
  constructor(opts?: {
30
- logger?: Logger;
30
+ logger?: LoggerInterface;
31
31
  client?: S3Client;
32
32
  });
33
33
  /**
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { CreateSecretCommandInput, CreateSecretCommandOutput, DeleteSecretCommandInput, DeleteSecretCommandOutput, PutSecretValueCommandInput, PutSecretValueCommandOutput, SecretsManagerClient, UpdateSecretCommandInput, UpdateSecretCommandOutput } from '@aws-sdk/client-secrets-manager';
3
3
  /**
4
4
  * Wrapper around the AWS Secrets Manager client providing structured
@@ -22,7 +22,7 @@ export declare class SecretsManagerService {
22
22
  * owns that decision.
23
23
  */
24
24
  constructor(opts?: {
25
- logger?: Logger;
25
+ logger?: LoggerInterface;
26
26
  client?: SecretsManagerClient;
27
27
  });
28
28
  /**
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { DescribeExecutionCommandInput, DescribeExecutionCommandOutput, ExecutionListItem, ListExecutionsCommandInput, SFNClient, StartExecutionCommandInput, StartExecutionCommandOutput, StopExecutionCommandInput, StopExecutionCommandOutput } from '@aws-sdk/client-sfn';
3
3
  /**
4
4
  * Wrapper around the AWS Step Functions client providing structured
@@ -14,7 +14,7 @@ export declare class StepFunctionsService {
14
14
  * the wrapper does not apply X-Ray instrumentation.
15
15
  */
16
16
  constructor(opts?: {
17
- logger?: Logger;
17
+ logger?: LoggerInterface;
18
18
  client?: SFNClient;
19
19
  });
20
20
  /**
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { PublishBatchCommandInput, PublishBatchCommandOutput, PublishCommandInput, PublishCommandOutput, SNSClient } from '@aws-sdk/client-sns';
3
3
  /**
4
4
  * Wrapper around the AWS SNS client providing structured Powertools logging
@@ -20,7 +20,7 @@ export declare class SNSService {
20
20
  * its own `truncate` option.
21
21
  */
22
22
  constructor(opts?: {
23
- logger?: Logger;
23
+ logger?: LoggerInterface;
24
24
  client?: SNSClient;
25
25
  truncate?: boolean;
26
26
  });
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { DeleteMessageBatchCommandInput, DeleteMessageBatchCommandOutput, DeleteMessageCommandInput, DeleteMessageCommandOutput, Message, ReceiveMessageCommandInput, SendMessageBatchCommandInput, SendMessageBatchCommandOutput, SendMessageCommandInput, SendMessageCommandOutput, SQSClient } from '@aws-sdk/client-sqs';
3
3
  /**
4
4
  * Wrapper around the AWS SQS client providing structured Powertools logging
@@ -19,7 +19,7 @@ export declare class SQSService {
19
19
  * option.
20
20
  */
21
21
  constructor(opts?: {
22
- logger?: Logger;
22
+ logger?: LoggerInterface;
23
23
  client?: SQSClient;
24
24
  truncate?: boolean;
25
25
  });
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  import { Parameter, PutParameterCommandInput, PutParameterCommandOutput, SSMClient } from '@aws-sdk/client-ssm';
3
3
  /**
4
4
  * Wrapper around the AWS SSM Parameter Store client providing structured
@@ -22,7 +22,7 @@ export declare class SSMService {
22
22
  * the wrapper does not apply X-Ray instrumentation.
23
23
  */
24
24
  constructor(opts?: {
25
- logger?: Logger;
25
+ logger?: LoggerInterface;
26
26
  client?: SSMClient;
27
27
  });
28
28
  /**
@@ -1,4 +1,4 @@
1
- import { Logger } from '@aws-lambda-powertools/logger';
1
+ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
2
2
  /**
3
3
  * Return a log-safe projection of `input` based on the logger's configured level.
4
4
  *
@@ -15,4 +15,4 @@ import { Logger } from '@aws-lambda-powertools/logger';
15
15
  * lives in one place. See `packages/aws-wrappers/CLAUDE.md` ("Logging") for
16
16
  * the design rationale and conventions on building the safe-field lists.
17
17
  */
18
- export declare function filterFieldsForLogLevel<T extends object, K extends keyof T>(logger: Logger, input: T, safeFields: readonly K[]): T | Pick<T, K>;
18
+ export declare function filterFieldsForLogLevel<T extends object, K extends keyof T>(logger: LoggerInterface, input: T, safeFields: readonly K[]): T | Pick<T, K>;
package/esm/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";