@aligent/aws-wrappers 0.3.0 → 0.4.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.
- package/README.md +20 -1
- package/cjs/index.cjs +610 -1387
- package/cjs/package.json +4 -1
- package/cjs/src/dynamodb/dynamodb.d.ts +27 -0
- package/cjs/src/s3/s3.d.ts +15 -4
- package/cjs/src/sns/sns.d.ts +7 -0
- package/cjs/src/sqs/sqs.d.ts +7 -0
- package/docs/classes/DynamoDBService.md +37 -12
- package/docs/classes/S3Service.md +29 -19
- package/docs/classes/SNSService.md +4 -4
- package/docs/classes/SQSService.md +7 -7
- package/docs/classes/SSMService.md +7 -7
- package/docs/classes/SchedulerService.md +11 -11
- package/docs/classes/SecretsManagerService.md +8 -8
- package/docs/classes/StepFunctionsService.md +6 -6
- package/esm/index.mjs +611 -1388
- package/esm/package.json +4 -1
- package/esm/src/dynamodb/dynamodb.d.ts +27 -0
- package/esm/src/s3/s3.d.ts +15 -4
- package/esm/src/sns/sns.d.ts +7 -0
- package/esm/src/sqs/sqs.d.ts +7 -0
- package/package.json +4 -1
package/esm/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=18"
|
|
7
|
+
},
|
|
5
8
|
"main": "./cjs/index.cjs",
|
|
6
9
|
"module": "./index.esm.js",
|
|
7
10
|
"types": "./cjs/src/index.d.ts",
|
|
@@ -119,11 +119,38 @@ export declare class DynamoDBService {
|
|
|
119
119
|
batchWrite(input: BatchWriteCommandInput): Promise<BatchWriteCommandOutput>;
|
|
120
120
|
/**
|
|
121
121
|
* Paginate over Query results, yielding one unmarshalled item at a time.
|
|
122
|
+
*
|
|
123
|
+
* **`Limit` is a page size, not a total cap.** DynamoDB applies it per
|
|
124
|
+
* request, and this method walks every page until `LastEvaluatedKey` is
|
|
125
|
+
* exhausted — so `paginateItems({ Limit: 10 })` yields *every* matching
|
|
126
|
+
* item, in pages of 10, not the first 10 items.
|
|
127
|
+
*
|
|
128
|
+
* To bound the number of items, `break` out of the loop. This is an
|
|
129
|
+
* `AsyncGenerator`, so `break` calls its `return()`, which unwinds the
|
|
130
|
+
* pagination and issues no further requests:
|
|
131
|
+
*
|
|
132
|
+
* ```ts
|
|
133
|
+
* const firstTen: Item[] = [];
|
|
134
|
+
* for await (const item of ddb.paginateItems<Item>(input)) {
|
|
135
|
+
* firstTen.push(item);
|
|
136
|
+
* if (firstTen.length === 10) break;
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* `Limit` remains the right knob for tuning per-request consumed capacity
|
|
141
|
+
* and page memory — set it deliberately, just don't expect it to stop the
|
|
142
|
+
* walk.
|
|
143
|
+
*
|
|
122
144
|
* @template T - Expected shape of each yielded item.
|
|
123
145
|
*/
|
|
124
146
|
paginateItems<T extends Record<string, unknown> = Record<string, unknown>>(input: QueryCommandInput): AsyncGenerator<T>;
|
|
125
147
|
/**
|
|
126
148
|
* Paginate over Scan results, yielding one unmarshalled item at a time.
|
|
149
|
+
*
|
|
150
|
+
* **`Limit` is a page size, not a total cap** — see `paginateItems` for the
|
|
151
|
+
* detail. `break` out of the loop to bound the number of items; `Limit`
|
|
152
|
+
* stays the right knob for per-request consumed capacity and page memory.
|
|
153
|
+
*
|
|
127
154
|
* @template T - Expected shape of each yielded item.
|
|
128
155
|
*/
|
|
129
156
|
paginateScan<T extends Record<string, unknown> = Record<string, unknown>>(input: ScanCommandInput): AsyncGenerator<T>;
|
package/esm/src/s3/s3.d.ts
CHANGED
|
@@ -125,10 +125,21 @@ export declare class S3Service {
|
|
|
125
125
|
*/
|
|
126
126
|
deleteObjects(bucket: string, keys: string[]): Promise<DeleteObjectsCommandOutput[]>;
|
|
127
127
|
/**
|
|
128
|
-
* Delete every object in
|
|
129
|
-
* delegates each page's deletion to `deleteObjects`, so
|
|
130
|
-
* bounded by one page (~1000 keys) regardless of bucket
|
|
131
|
-
*
|
|
128
|
+
* Delete every object in an **unversioned** bucket. Streams the listing
|
|
129
|
+
* page-by-page and delegates each page's deletion to `deleteObjects`, so
|
|
130
|
+
* peak memory stays bounded by one page (~1000 keys) regardless of bucket
|
|
131
|
+
* size.
|
|
132
|
+
*
|
|
133
|
+
* **Versioned buckets are out of scope.** This paginates `ListObjectsV2`,
|
|
134
|
+
* which reports only current object versions — never noncurrent versions or
|
|
135
|
+
* delete markers. Against a versioned bucket the call therefore succeeds and
|
|
136
|
+
* the bucket then *looks* empty to `ListObjectsV2`, but the deletes only
|
|
137
|
+
* added delete markers: every object version is still stored, still billed,
|
|
138
|
+
* and `DeleteBucket` will still fail with `BucketNotEmpty`. Emptying a
|
|
139
|
+
* versioned bucket requires `ListObjectVersions` and per-version deletes;
|
|
140
|
+
* use `S3Client` directly for that.
|
|
141
|
+
*
|
|
142
|
+
* @returns The keys this call issued deletes for.
|
|
132
143
|
*/
|
|
133
144
|
emptyBucket(bucket: string): Promise<string[]>;
|
|
134
145
|
}
|
package/esm/src/sns/sns.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export declare class SNSService {
|
|
|
39
39
|
publish(input: PublishCommandInput, opts?: {
|
|
40
40
|
truncate?: boolean;
|
|
41
41
|
}): Promise<PublishCommandOutput>;
|
|
42
|
+
/**
|
|
43
|
+
* The truncation helpers return the input unchanged when it already fits, so
|
|
44
|
+
* a `!==` comparison against their result is what decides whether a field
|
|
45
|
+
* was modified. Don't reintroduce a size guard here: that would state each
|
|
46
|
+
* limit twice, encode the string to a `Buffer` twice, and let the two
|
|
47
|
+
* expressions drift into warning without truncating (or the reverse).
|
|
48
|
+
*/
|
|
42
49
|
private applyTruncation;
|
|
43
50
|
/**
|
|
44
51
|
* Publish a batch of messages to an SNS topic. The SNS API caps
|
package/esm/src/sqs/sqs.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export declare class SQSService {
|
|
|
36
36
|
sendMessage(input: SendMessageCommandInput, opts?: {
|
|
37
37
|
truncate?: boolean;
|
|
38
38
|
}): Promise<SendMessageCommandOutput>;
|
|
39
|
+
/**
|
|
40
|
+
* `truncateUtf8` returns the input unchanged when it already fits, so a
|
|
41
|
+
* `!==` comparison against its result is what decides whether the body was
|
|
42
|
+
* modified. Don't reintroduce a size guard here: that would state the limit
|
|
43
|
+
* twice, encode the string to a `Buffer` twice, and let the two expressions
|
|
44
|
+
* drift into warning without truncating (or the reverse).
|
|
45
|
+
*/
|
|
39
46
|
private applyTruncation;
|
|
40
47
|
/**
|
|
41
48
|
* Receive messages from an SQS queue. Returns an empty array when no
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=18"
|
|
7
|
+
},
|
|
5
8
|
"main": "./cjs/index.cjs",
|
|
6
9
|
"module": "./esm/index.mjs",
|
|
7
10
|
"types": "./cjs/src/index.d.ts",
|