@aligent/aws-wrappers 0.0.1 → 0.1.0

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/CLAUDE.md CHANGED
@@ -31,9 +31,10 @@ These are non-negotiable across every service in the package — change them onl
31
31
  ### Constructor
32
32
 
33
33
  ```ts
34
- constructor(opts?: { logger?: Logger; client?: <ServiceClient> })
34
+ constructor(opts?: { logger?: LoggerInterface; client?: <ServiceClient> })
35
35
  ```
36
36
 
37
+ - `logger` is typed as `LoggerInterface` (from `@aws-lambda-powertools/logger/types`), **not** the concrete `Logger` class. This avoids the dual-package hazard for ESM consumers — TS treats the ESM and CJS builds of the `Logger` class as nominally distinct (each has its own `#private` field), but `LoggerInterface` is a structural type alias so both builds are mutually assignable. The wrapper still defaults to `new Logger()` internally; only the public type widens.
37
38
  - `logger` defaults to `new Logger()`, which picks up `POWERTOOLS_SERVICE_NAME` from the environment. Do **not** pass `serviceName` in the default — env-driven service naming is the Powertools convention.
38
39
  - `client` defaults to `captureAWSv3Client(new <ServiceClient>())`. When the caller supplies a client, the wrapper does **not** apply X-Ray instrumentation — that's the caller's call.
39
40
  - No `clientConfig` / `region` / `endpoint` options. Callers needing those construct their own client and pass it via `client`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligent/aws-wrappers",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.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 { 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
  /**
package/src/s3/s3.d.ts CHANGED
@@ -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
  /**
package/src/sfn/sfn.d.ts CHANGED
@@ -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
  /**
package/src/sns/sns.d.ts CHANGED
@@ -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
  });
package/src/sqs/sqs.d.ts CHANGED
@@ -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
  });
package/src/ssm/ssm.d.ts CHANGED
@@ -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>;