@aligent/aws-wrappers 0.5.3 → 0.5.5
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 +27 -1
- package/cjs/index.cjs +133 -1
- package/cjs/package.json +3 -1
- package/cjs/src/api-gateway/api-gateway.d.ts +45 -0
- package/cjs/src/api-gateway/api-gateway.d.ts.map +1 -0
- package/cjs/src/api-gateway-v2/api-gateway-v2.d.ts +39 -0
- package/cjs/src/api-gateway-v2/api-gateway-v2.d.ts.map +1 -0
- package/cjs/src/index.d.ts +2 -0
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/util/pagination.d.ts +12 -0
- package/cjs/src/util/pagination.d.ts.map +1 -0
- package/docs/index/classes/APIGatewayService.md +143 -0
- package/docs/index/classes/APIGatewayV2Service.md +119 -0
- package/docs/index/classes/DynamoDBService.md +12 -12
- package/docs/index/classes/S3Service.md +15 -15
- package/docs/index/classes/SNSService.md +4 -4
- package/docs/index/classes/SQSService.md +7 -7
- package/docs/index/classes/SSMService.md +7 -7
- package/docs/index/classes/SchedulerService.md +11 -11
- package/docs/index/classes/SecretsManagerService.md +8 -8
- package/docs/index/classes/StepFunctionsService.md +6 -6
- package/docs/index/modules.md +2 -0
- package/docs/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +133 -3
- package/esm/package.json +3 -1
- package/esm/src/api-gateway/api-gateway.d.ts +45 -0
- package/esm/src/api-gateway/api-gateway.d.ts.map +1 -0
- package/esm/src/api-gateway-v2/api-gateway-v2.d.ts +39 -0
- package/esm/src/api-gateway-v2/api-gateway-v2.d.ts.map +1 -0
- package/esm/src/index.d.ts +2 -0
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/util/pagination.d.ts +12 -0
- package/esm/src/util/pagination.d.ts.map +1 -0
- package/package.json +3 -1
package/docs/index/modules.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
## Classes
|
|
10
10
|
|
|
11
|
+
- [APIGatewayService](classes/APIGatewayService.md)
|
|
12
|
+
- [APIGatewayV2Service](classes/APIGatewayV2Service.md)
|
|
11
13
|
- [DynamoDBService](classes/DynamoDBService.md)
|
|
12
14
|
- [S3Service](classes/S3Service.md)
|
|
13
15
|
- [SchedulerService](classes/SchedulerService.md)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **createMockService**\<`T`, `O`\>(`service`, `overrides`): `T` & `O`
|
|
10
10
|
|
|
11
|
-
Defined in: [testing/testing.ts:66](https://github.com/aligent/microservice-development-utilities/blob/
|
|
11
|
+
Defined in: [testing/testing.ts:66](https://github.com/aligent/microservice-development-utilities/blob/4b7a8331206e0f1a082391738f45ac3fcf87a1b3/packages/aws-wrappers/src/testing/testing.ts#L66)
|
|
12
12
|
|
|
13
13
|
Build a stand-in for a service class from an object of method overrides, for
|
|
14
14
|
use in unit tests of code that depends on the service.
|
package/esm/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Logger, LogLevelThreshold } from '@aws-lambda-powertools/logger';
|
|
2
|
+
import { ApiGatewayV2Client, GetRouteCommand, GetApisCommand, GetRoutesCommand } from '@aws-sdk/client-apigatewayv2';
|
|
3
|
+
import xray from 'aws-xray-sdk-core';
|
|
4
|
+
import { APIGatewayClient, paginateGetRestApis, paginateGetApiKeys, GetApiKeyCommand, paginateGetResources } from '@aws-sdk/client-api-gateway';
|
|
2
5
|
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
3
6
|
import { DynamoDBDocumentClient, GetCommand, PutCommand, UpdateCommand, DeleteCommand, QueryCommand, ScanCommand, BatchGetCommand, BatchWriteCommand, paginateQuery, paginateScan } from '@aws-sdk/lib-dynamodb';
|
|
4
|
-
import xray from 'aws-xray-sdk-core';
|
|
5
7
|
import { S3Client, PutObjectCommand, GetObjectCommand, HeadObjectCommand, CopyObjectCommand, paginateListObjectsV2, DeleteObjectCommand, DeleteObjectsCommand } from '@aws-sdk/client-s3';
|
|
6
8
|
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
7
9
|
import { SchedulerClient, CreateScheduleCommand, GetScheduleCommand, UpdateScheduleCommand, DeleteScheduleCommand, paginateListSchedules, CreateScheduleGroupCommand, GetScheduleGroupCommand, DeleteScheduleGroupCommand, paginateListScheduleGroups } from '@aws-sdk/client-scheduler';
|
|
@@ -11,6 +13,134 @@ import { SNSClient, PublishCommand, PublishBatchCommand } from '@aws-sdk/client-
|
|
|
11
13
|
import { SQSClient, SendMessageCommand, ReceiveMessageCommand, DeleteMessageCommand, SendMessageBatchCommand, DeleteMessageBatchCommand } from '@aws-sdk/client-sqs';
|
|
12
14
|
import { SSMClient, GetParameterCommand, GetParametersCommand, PutParameterCommand, DeleteParameterCommand, paginateGetParametersByPath } from '@aws-sdk/client-ssm';
|
|
13
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Flatten the items of every page of an SDK paginator (`paginateXxx`).
|
|
18
|
+
* `getItems` picks the data-bearing field, which differs per operation.
|
|
19
|
+
*/
|
|
20
|
+
async function collectItems(pages, getItems) {
|
|
21
|
+
const items = [];
|
|
22
|
+
for await (const page of pages) {
|
|
23
|
+
items.push(...(getItems(page) ?? []));
|
|
24
|
+
}
|
|
25
|
+
return items;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Flatten the items of every page of an operation the SDK ships no paginator
|
|
29
|
+
* for, following its continuation token until the response stops returning one.
|
|
30
|
+
* `fetchPage` receives `undefined` on the first call.
|
|
31
|
+
*/
|
|
32
|
+
async function collectPages(fetchPage, getItems, getNextToken) {
|
|
33
|
+
const items = [];
|
|
34
|
+
let token;
|
|
35
|
+
do {
|
|
36
|
+
const page = await fetchPage(token);
|
|
37
|
+
items.push(...(getItems(page) ?? []));
|
|
38
|
+
token = getNextToken(page);
|
|
39
|
+
} while (token);
|
|
40
|
+
return items;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Read-only wrapper around the API Gateway v2 (HTTP and WebSocket APIs)
|
|
45
|
+
* control-plane client providing structured Powertools logging and X-Ray
|
|
46
|
+
* tracing by default.
|
|
47
|
+
*
|
|
48
|
+
* The v2 SDK ships no paginators for `GetApis` or `GetRoutes`, so list methods
|
|
49
|
+
* follow `NextToken` manually.
|
|
50
|
+
*/
|
|
51
|
+
class APIGatewayV2Service {
|
|
52
|
+
client;
|
|
53
|
+
logger;
|
|
54
|
+
/**
|
|
55
|
+
* @param opts.logger - Optional Powertools logger. Defaults to `new Logger()`,
|
|
56
|
+
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
57
|
+
* @param opts.client - Optional pre-configured `ApiGatewayV2Client`. When
|
|
58
|
+
* supplied, the wrapper does not apply X-Ray instrumentation.
|
|
59
|
+
*/
|
|
60
|
+
constructor(opts) {
|
|
61
|
+
this.client = opts?.client ?? xray.captureAWSv3Client(new ApiGatewayV2Client());
|
|
62
|
+
this.logger = opts?.logger ?? new Logger();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* List every HTTP and WebSocket API in the account and region.
|
|
66
|
+
* Auto-paginated.
|
|
67
|
+
*/
|
|
68
|
+
async getApis(input = {}) {
|
|
69
|
+
this.logger.info('Fetching APIs', { input });
|
|
70
|
+
return collectPages(NextToken => this.client.send(new GetApisCommand({ ...input, NextToken })), page => page.Items, page => page.NextToken);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Fetch a single route of an HTTP or WebSocket API.
|
|
74
|
+
* @throws NotFoundException when the route does not exist.
|
|
75
|
+
*/
|
|
76
|
+
async getRoute(input) {
|
|
77
|
+
this.logger.info('Fetching API route', { input });
|
|
78
|
+
return this.client.send(new GetRouteCommand(input));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* List every route of an HTTP or WebSocket API. Auto-paginated.
|
|
82
|
+
*/
|
|
83
|
+
async getRoutes(input) {
|
|
84
|
+
this.logger.info('Fetching API routes', { input });
|
|
85
|
+
return collectPages(NextToken => this.client.send(new GetRoutesCommand({ ...input, NextToken })), page => page.Items, page => page.NextToken);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Read-only wrapper around the API Gateway (REST API, v1) control-plane client
|
|
91
|
+
* providing structured Powertools logging and X-Ray tracing by default.
|
|
92
|
+
*
|
|
93
|
+
* `getApiKeys` and `getApiKey` always request key values (`includeValues` /
|
|
94
|
+
* `includeValue` is `true`, with no opt-out) — callers needing metadata only
|
|
95
|
+
* should use `APIGatewayClient` directly. Key values appear only in method
|
|
96
|
+
* output; the wrapper never logs output, and no input carries secrets.
|
|
97
|
+
*/
|
|
98
|
+
class APIGatewayService {
|
|
99
|
+
client;
|
|
100
|
+
logger;
|
|
101
|
+
/**
|
|
102
|
+
* @param opts.logger - Optional Powertools logger. Defaults to `new Logger()`,
|
|
103
|
+
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
104
|
+
* @param opts.client - Optional pre-configured `APIGatewayClient`. When
|
|
105
|
+
* supplied, the wrapper does not apply X-Ray instrumentation.
|
|
106
|
+
*/
|
|
107
|
+
constructor(opts) {
|
|
108
|
+
this.client = opts?.client ?? xray.captureAWSv3Client(new APIGatewayClient());
|
|
109
|
+
this.logger = opts?.logger ?? new Logger();
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* List every REST API in the account and region. Auto-paginated.
|
|
113
|
+
*/
|
|
114
|
+
async getRestApis(input = {}) {
|
|
115
|
+
this.logger.info('Fetching REST APIs', { input });
|
|
116
|
+
return collectItems(paginateGetRestApis({ client: this.client }, input), page => page.items);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* List API keys, including their secret values. Auto-paginated.
|
|
120
|
+
*/
|
|
121
|
+
async getApiKeys(input = {}) {
|
|
122
|
+
this.logger.info('Fetching API keys', { input });
|
|
123
|
+
return collectItems(paginateGetApiKeys({ client: this.client }, { ...input, includeValues: true }), page => page.items);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Fetch a single API key, including its secret value.
|
|
127
|
+
* @throws NotFoundException when the key does not exist.
|
|
128
|
+
*/
|
|
129
|
+
async getApiKey(input) {
|
|
130
|
+
this.logger.info('Fetching API key', { input });
|
|
131
|
+
return this.client.send(new GetApiKeyCommand({ ...input, includeValue: true }));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* List every resource (path) of a REST API, which is how REST APIs expose
|
|
135
|
+
* their routes. Pass `embed: ['methods']` to include each resource's
|
|
136
|
+
* methods. Auto-paginated.
|
|
137
|
+
*/
|
|
138
|
+
async getResources(input) {
|
|
139
|
+
this.logger.info('Fetching REST API resources', { input });
|
|
140
|
+
return collectItems(paginateGetResources({ client: this.client }, input), page => page.items);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
14
144
|
/**
|
|
15
145
|
* Whether the logger is verbose enough that full SDK inputs — payloads, secret
|
|
16
146
|
* material and PII — may be written to the log.
|
|
@@ -1450,4 +1580,4 @@ class SSMService {
|
|
|
1450
1580
|
}
|
|
1451
1581
|
}
|
|
1452
1582
|
|
|
1453
|
-
export { DynamoDBService, S3Service, SNSService, SQSService, SSMService, SchedulerService, SecretsManagerService, StepFunctionsService };
|
|
1583
|
+
export { APIGatewayService, APIGatewayV2Service, DynamoDBService, S3Service, SNSService, SQSService, SSMService, SchedulerService, SecretsManagerService, StepFunctionsService };
|
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@aws-lambda-powertools/logger": "^2.33.1",
|
|
47
|
+
"@aws-sdk/client-api-gateway": "^3.1127.0",
|
|
48
|
+
"@aws-sdk/client-apigatewayv2": "^3.1127.0",
|
|
47
49
|
"@aws-sdk/client-dynamodb": "^3.1127.0",
|
|
48
50
|
"@aws-sdk/client-s3": "^3.1127.0",
|
|
49
51
|
"@aws-sdk/client-scheduler": "^3.1127.0",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
2
|
+
import { APIGatewayClient, ApiKey, GetApiKeyCommandInput, GetApiKeyCommandOutput, GetApiKeysCommandInput, GetResourcesCommandInput, GetRestApisCommandInput, Resource, RestApi } from '@aws-sdk/client-api-gateway';
|
|
3
|
+
/**
|
|
4
|
+
* Read-only wrapper around the API Gateway (REST API, v1) control-plane client
|
|
5
|
+
* providing structured Powertools logging and X-Ray tracing by default.
|
|
6
|
+
*
|
|
7
|
+
* `getApiKeys` and `getApiKey` always request key values (`includeValues` /
|
|
8
|
+
* `includeValue` is `true`, with no opt-out) — callers needing metadata only
|
|
9
|
+
* should use `APIGatewayClient` directly. Key values appear only in method
|
|
10
|
+
* output; the wrapper never logs output, and no input carries secrets.
|
|
11
|
+
*/
|
|
12
|
+
export declare class APIGatewayService {
|
|
13
|
+
private readonly client;
|
|
14
|
+
private readonly logger;
|
|
15
|
+
/**
|
|
16
|
+
* @param opts.logger - Optional Powertools logger. Defaults to `new Logger()`,
|
|
17
|
+
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
18
|
+
* @param opts.client - Optional pre-configured `APIGatewayClient`. When
|
|
19
|
+
* supplied, the wrapper does not apply X-Ray instrumentation.
|
|
20
|
+
*/
|
|
21
|
+
constructor(opts?: {
|
|
22
|
+
logger?: LoggerInterface;
|
|
23
|
+
client?: APIGatewayClient;
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* List every REST API in the account and region. Auto-paginated.
|
|
27
|
+
*/
|
|
28
|
+
getRestApis(input?: GetRestApisCommandInput): Promise<RestApi[]>;
|
|
29
|
+
/**
|
|
30
|
+
* List API keys, including their secret values. Auto-paginated.
|
|
31
|
+
*/
|
|
32
|
+
getApiKeys(input?: Omit<GetApiKeysCommandInput, 'includeValues'>): Promise<ApiKey[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch a single API key, including its secret value.
|
|
35
|
+
* @throws NotFoundException when the key does not exist.
|
|
36
|
+
*/
|
|
37
|
+
getApiKey(input: Omit<GetApiKeyCommandInput, 'includeValue'>): Promise<GetApiKeyCommandOutput>;
|
|
38
|
+
/**
|
|
39
|
+
* List every resource (path) of a REST API, which is how REST APIs expose
|
|
40
|
+
* their routes. Pass `embed: ['methods']` to include each resource's
|
|
41
|
+
* methods. Auto-paginated.
|
|
42
|
+
*/
|
|
43
|
+
getResources(input: GetResourcesCommandInput): Promise<Resource[]>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=api-gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-gateway.d.ts","sourceRoot":"","sources":["../../../../src/api-gateway/api-gateway.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EACH,gBAAgB,EAChB,MAAM,EAEN,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EAIvB,QAAQ,EACR,OAAO,EACV,MAAM,6BAA6B,CAAC;AAIrC;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;KAAE;IAK1E;;OAEG;IACG,WAAW,CAAC,KAAK,GAAE,uBAA4B,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAQ1E;;OAEG;IACG,UAAU,CAAC,KAAK,GAAE,IAAI,CAAC,sBAAsB,EAAE,eAAe,CAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ9F;;;OAGG;IACG,SAAS,CACX,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,GACnD,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;OAIG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAO3E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
2
|
+
import { Api, ApiGatewayV2Client, GetApisCommandInput, GetRouteCommandInput, GetRouteCommandOutput, GetRoutesCommandInput, Route } from '@aws-sdk/client-apigatewayv2';
|
|
3
|
+
/**
|
|
4
|
+
* Read-only wrapper around the API Gateway v2 (HTTP and WebSocket APIs)
|
|
5
|
+
* control-plane client providing structured Powertools logging and X-Ray
|
|
6
|
+
* tracing by default.
|
|
7
|
+
*
|
|
8
|
+
* The v2 SDK ships no paginators for `GetApis` or `GetRoutes`, so list methods
|
|
9
|
+
* follow `NextToken` manually.
|
|
10
|
+
*/
|
|
11
|
+
export declare class APIGatewayV2Service {
|
|
12
|
+
private readonly client;
|
|
13
|
+
private readonly logger;
|
|
14
|
+
/**
|
|
15
|
+
* @param opts.logger - Optional Powertools logger. Defaults to `new Logger()`,
|
|
16
|
+
* which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
17
|
+
* @param opts.client - Optional pre-configured `ApiGatewayV2Client`. When
|
|
18
|
+
* supplied, the wrapper does not apply X-Ray instrumentation.
|
|
19
|
+
*/
|
|
20
|
+
constructor(opts?: {
|
|
21
|
+
logger?: LoggerInterface;
|
|
22
|
+
client?: ApiGatewayV2Client;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* List every HTTP and WebSocket API in the account and region.
|
|
26
|
+
* Auto-paginated.
|
|
27
|
+
*/
|
|
28
|
+
getApis(input?: Omit<GetApisCommandInput, 'NextToken'>): Promise<Api[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a single route of an HTTP or WebSocket API.
|
|
31
|
+
* @throws NotFoundException when the route does not exist.
|
|
32
|
+
*/
|
|
33
|
+
getRoute(input: GetRouteCommandInput): Promise<GetRouteCommandOutput>;
|
|
34
|
+
/**
|
|
35
|
+
* List every route of an HTTP or WebSocket API. Auto-paginated.
|
|
36
|
+
*/
|
|
37
|
+
getRoutes(input: Omit<GetRoutesCommandInput, 'NextToken'>): Promise<Route[]>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=api-gateway-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-gateway-v2.d.ts","sourceRoot":"","sources":["../../../../src/api-gateway-v2/api-gateway-v2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EACH,GAAG,EACH,kBAAkB,EAElB,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,EAErB,qBAAqB,EACrB,KAAK,EACR,MAAM,8BAA8B,CAAC;AAItC;;;;;;;GAOG;AACH,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,kBAAkB,CAAA;KAAE;IAK5E;;;OAGG;IACG,OAAO,CAAC,KAAK,GAAE,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IASjF;;;OAGG;IACG,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAK3E;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAQrF"}
|
package/esm/src/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { APIGatewayV2Service } from './api-gateway-v2/api-gateway-v2.js';
|
|
2
|
+
export { APIGatewayService } from './api-gateway/api-gateway.js';
|
|
1
3
|
export { DynamoDBService } from './dynamodb/dynamodb.js';
|
|
2
4
|
export { S3Service } from './s3/s3.js';
|
|
3
5
|
export { SchedulerService } from './scheduler/scheduler.js';
|
package/esm/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flatten the items of every page of an SDK paginator (`paginateXxx`).
|
|
3
|
+
* `getItems` picks the data-bearing field, which differs per operation.
|
|
4
|
+
*/
|
|
5
|
+
export declare function collectItems<TPage, TItem>(pages: AsyncIterable<TPage>, getItems: (page: TPage) => TItem[] | undefined): Promise<TItem[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Flatten the items of every page of an operation the SDK ships no paginator
|
|
8
|
+
* for, following its continuation token until the response stops returning one.
|
|
9
|
+
* `fetchPage` receives `undefined` on the first call.
|
|
10
|
+
*/
|
|
11
|
+
export declare function collectPages<TPage, TItem>(fetchPage: (token: string | undefined) => Promise<TPage>, getItems: (page: TPage) => TItem[] | undefined, getNextToken: (page: TPage) => string | undefined): Promise<TItem[]>;
|
|
12
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../src/util/pagination.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,EAC3C,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,EAAE,GAAG,SAAS,GAC/C,OAAO,CAAC,KAAK,EAAE,CAAC,CAMlB;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,EAC3C,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,KAAK,CAAC,EACxD,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,EAAE,GAAG,SAAS,EAC9C,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,GAClD,OAAO,CAAC,KAAK,EAAE,CAAC,CASlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/aws-wrappers",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Opinionated AWS SDK wrappers with Powertools logging and X-Ray tracing",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@aws-lambda-powertools/logger": "^2.33.1",
|
|
47
|
+
"@aws-sdk/client-api-gateway": "^3.1127.0",
|
|
48
|
+
"@aws-sdk/client-apigatewayv2": "^3.1127.0",
|
|
47
49
|
"@aws-sdk/client-dynamodb": "^3.1127.0",
|
|
48
50
|
"@aws-sdk/client-s3": "^3.1127.0",
|
|
49
51
|
"@aws-sdk/client-scheduler": "^3.1127.0",
|