cdk-drizzle-migrate 1.0.0 → 2.0.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/.jsii +244 -92
- package/API.md +32 -26
- package/CLAUDE.md +79 -0
- package/README.md +20 -6
- package/lib/drizzle-migrate-provider.d.ts +15 -7
- package/lib/drizzle-migrate-provider.js +82 -25
- package/lib/handler/handler.js +23300 -15071
- package/node_modules/@types/aws-lambda/README.md +1 -1
- package/node_modules/@types/aws-lambda/handler.d.ts +96 -0
- package/node_modules/@types/aws-lambda/package.json +3 -3
- package/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +8 -6
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +2 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation-v3.d.ts +50 -0
- package/node_modules/@types/aws-lambda/trigger/guard-duty-event-notification.d.ts +1 -1
- package/package.json +30 -25
- package/.claude/settings.local.json +0 -10
|
@@ -8,7 +8,7 @@ This package contains type definitions for aws-lambda (http://docs.aws.amazon.co
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Sat, 19 Jul 2025 08:38:38 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Writable } from "node:stream";
|
|
1
2
|
/**
|
|
2
3
|
* The interface that AWS Lambda will invoke your handler with.
|
|
3
4
|
* There are more specialized types for many cases where AWS services
|
|
@@ -103,6 +104,7 @@ export interface Context {
|
|
|
103
104
|
logStreamName: string;
|
|
104
105
|
identity?: CognitoIdentity | undefined;
|
|
105
106
|
clientContext?: ClientContext | undefined;
|
|
107
|
+
tenantId?: string | undefined;
|
|
106
108
|
|
|
107
109
|
getRemainingTimeInMillis(): number;
|
|
108
110
|
|
|
@@ -170,3 +172,97 @@ export interface ClientContextEnv {
|
|
|
170
172
|
* Pass `null` or `undefined` for the `error` parameter to use this parameter.
|
|
171
173
|
*/
|
|
172
174
|
export type Callback<TResult = any> = (error?: Error | string | null, result?: TResult) => void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Interface for using response streaming from AWS Lambda.
|
|
178
|
+
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
|
179
|
+
*
|
|
180
|
+
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
|
181
|
+
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
|
182
|
+
*
|
|
183
|
+
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
|
184
|
+
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
|
185
|
+
*
|
|
186
|
+
* @example <caption>Writing to the response stream</caption>
|
|
187
|
+
* import 'aws-lambda';
|
|
188
|
+
*
|
|
189
|
+
* export const handler = awslambda.streamifyResponse(
|
|
190
|
+
* async (event, responseStream, context) => {
|
|
191
|
+
* responseStream.setContentType("text/plain");
|
|
192
|
+
* responseStream.write("Hello, world!");
|
|
193
|
+
* responseStream.end();
|
|
194
|
+
* }
|
|
195
|
+
* );
|
|
196
|
+
*
|
|
197
|
+
* @example <caption>Using pipeline</caption>
|
|
198
|
+
* import 'aws-lambda';
|
|
199
|
+
* import { Readable } from 'stream';
|
|
200
|
+
* import { pipeline } from 'stream/promises';
|
|
201
|
+
* import zlib from 'zlib';
|
|
202
|
+
*
|
|
203
|
+
* export const handler = awslambda.streamifyResponse(
|
|
204
|
+
* async (event, responseStream, context) => {
|
|
205
|
+
* // As an example, convert event to a readable stream.
|
|
206
|
+
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
|
207
|
+
*
|
|
208
|
+
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
|
209
|
+
* }
|
|
210
|
+
* );
|
|
211
|
+
*/
|
|
212
|
+
export type StreamifyHandler<TEvent = any, TResult = any> = (
|
|
213
|
+
event: TEvent,
|
|
214
|
+
responseStream: awslambda.HttpResponseStream,
|
|
215
|
+
context: Context,
|
|
216
|
+
) => TResult | Promise<TResult>;
|
|
217
|
+
|
|
218
|
+
declare global {
|
|
219
|
+
namespace awslambda {
|
|
220
|
+
class HttpResponseStream extends Writable {
|
|
221
|
+
static from(
|
|
222
|
+
writable: Writable,
|
|
223
|
+
metadata: Record<string, unknown>,
|
|
224
|
+
): HttpResponseStream;
|
|
225
|
+
setContentType: (contentType: string) => void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Decorator for using response streaming from AWS Lambda.
|
|
230
|
+
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
|
231
|
+
*
|
|
232
|
+
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
|
233
|
+
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
|
234
|
+
*
|
|
235
|
+
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
|
236
|
+
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
|
237
|
+
*
|
|
238
|
+
* @example <caption>Writing to the response stream</caption>
|
|
239
|
+
* import 'aws-lambda';
|
|
240
|
+
*
|
|
241
|
+
* export const handler = awslambda.streamifyResponse(
|
|
242
|
+
* async (event, responseStream, context) => {
|
|
243
|
+
* responseStream.setContentType("text/plain");
|
|
244
|
+
* responseStream.write("Hello, world!");
|
|
245
|
+
* responseStream.end();
|
|
246
|
+
* }
|
|
247
|
+
* );
|
|
248
|
+
*
|
|
249
|
+
* @example <caption>Using pipeline</caption>
|
|
250
|
+
* import 'aws-lambda';
|
|
251
|
+
* import { Readable } from 'stream';
|
|
252
|
+
* import { pipeline } from 'stream/promises';
|
|
253
|
+
* import zlib from 'zlib';
|
|
254
|
+
*
|
|
255
|
+
* export const handler = awslambda.streamifyResponse(
|
|
256
|
+
* async (event, responseStream, context) => {
|
|
257
|
+
* // As an example, convert event to a readable stream.
|
|
258
|
+
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
|
259
|
+
*
|
|
260
|
+
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
|
261
|
+
* }
|
|
262
|
+
* );
|
|
263
|
+
*/
|
|
264
|
+
function streamifyResponse<TEvent = any, TResult = void>(
|
|
265
|
+
handler: StreamifyHandler<TEvent, TResult>,
|
|
266
|
+
): StreamifyHandler<TEvent, TResult>;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/aws-lambda",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.152",
|
|
4
4
|
"description": "TypeScript definitions for aws-lambda",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda",
|
|
6
6
|
"license": "MIT",
|
|
@@ -221,6 +221,6 @@
|
|
|
221
221
|
"scripts": {},
|
|
222
222
|
"dependencies": {},
|
|
223
223
|
"peerDependencies": {},
|
|
224
|
-
"typesPublisherContentHash": "
|
|
225
|
-
"typeScriptVersion": "5.
|
|
224
|
+
"typesPublisherContentHash": "7ac21f912f5d39e38f9916d81a153b602cba17acc60370d4bd76dbb98d403494",
|
|
225
|
+
"typeScriptVersion": "5.1"
|
|
226
226
|
}
|
|
@@ -4,18 +4,20 @@ import { Callback, Handler } from "../handler";
|
|
|
4
4
|
export type CloudFrontResponseHandler = Handler<CloudFrontResponseEvent, CloudFrontResponseResult>;
|
|
5
5
|
export type CloudFrontResponseCallback = Callback<CloudFrontResponseResult>;
|
|
6
6
|
|
|
7
|
+
export interface CloudFrontResponseEventRecord {
|
|
8
|
+
cf: CloudFrontEvent & {
|
|
9
|
+
readonly request: Pick<CloudFrontRequest, Exclude<keyof CloudFrontRequest, "body">>;
|
|
10
|
+
response: CloudFrontResponse;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
/**
|
|
8
15
|
* CloudFront viewer response or origin response event
|
|
9
16
|
*
|
|
10
17
|
* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response
|
|
11
18
|
*/
|
|
12
19
|
export interface CloudFrontResponseEvent {
|
|
13
|
-
Records:
|
|
14
|
-
cf: CloudFrontEvent & {
|
|
15
|
-
readonly request: Pick<CloudFrontRequest, Exclude<keyof CloudFrontRequest, "body">>;
|
|
16
|
-
response: CloudFrontResponse;
|
|
17
|
-
};
|
|
18
|
-
}>;
|
|
20
|
+
Records: CloudFrontResponseEventRecord[];
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export type CloudFrontResponseResult = undefined | null | CloudFrontResultResponse;
|
|
@@ -30,6 +30,7 @@ export interface CognitoUserPoolTriggerEvent {
|
|
|
30
30
|
| "TokenGeneration_NewPasswordChallenge"
|
|
31
31
|
| "TokenGeneration_AuthenticateDevice"
|
|
32
32
|
| "TokenGeneration_RefreshTokens"
|
|
33
|
+
| "TokenGeneration_ClientCredentials"
|
|
33
34
|
| "UserMigration_Authentication"
|
|
34
35
|
| "UserMigration_ForgotPassword";
|
|
35
36
|
region: string;
|
|
@@ -124,5 +125,6 @@ export * from "./pre-authentication";
|
|
|
124
125
|
export * from "./pre-signup";
|
|
125
126
|
export * from "./pre-token-generation";
|
|
126
127
|
export * from "./pre-token-generation-v2";
|
|
128
|
+
export * from "./pre-token-generation-v3";
|
|
127
129
|
export * from "./user-migration";
|
|
128
130
|
export * from "./verify-auth-challenge-response";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Handler } from "../../handler";
|
|
2
|
+
import { BaseTriggerEvent, StringMap } from "./_common";
|
|
3
|
+
|
|
4
|
+
export interface GroupOverrideDetailsV3 {
|
|
5
|
+
groupsToOverride?: string[];
|
|
6
|
+
iamRolesToOverride?: string[];
|
|
7
|
+
preferredRole?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IdTokenGenerationV3 {
|
|
11
|
+
claimsToAddOrOverride?: StringMap;
|
|
12
|
+
claimsToSuppress?: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AccessTokenGenerationV3 {
|
|
16
|
+
claimsToAddOrOverride?: StringMap;
|
|
17
|
+
claimsToSuppress?: string[];
|
|
18
|
+
scopesToAdd?: string[];
|
|
19
|
+
scopesToSuppress?: string[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ClaimsAndScopeOverrideDetailsV3 {
|
|
23
|
+
idTokenGeneration?: IdTokenGenerationV3;
|
|
24
|
+
accessTokenGeneration?: AccessTokenGenerationV3;
|
|
25
|
+
groupOverrideDetails?: GroupOverrideDetailsV3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html
|
|
30
|
+
*/
|
|
31
|
+
export interface BasePreTokenGenerationV3TriggerEvent<T extends string> extends BaseTriggerEvent<T> {
|
|
32
|
+
version: "3";
|
|
33
|
+
request: {
|
|
34
|
+
userAttributes: StringMap;
|
|
35
|
+
groupConfiguration: GroupOverrideDetailsV3;
|
|
36
|
+
scopes?: string[];
|
|
37
|
+
clientMetadata?: StringMap;
|
|
38
|
+
};
|
|
39
|
+
response: {
|
|
40
|
+
claimsAndScopeOverrideDetails: ClaimsAndScopeOverrideDetailsV3;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type PreTokenGenerationClientCredentialsV3TriggerEvent = BasePreTokenGenerationV3TriggerEvent<
|
|
45
|
+
"TokenGeneration_ClientCredentials"
|
|
46
|
+
>;
|
|
47
|
+
|
|
48
|
+
export type PreTokenGenerationV3TriggerEvent = PreTokenGenerationClientCredentialsV3TriggerEvent;
|
|
49
|
+
|
|
50
|
+
export type PreTokenGenerationV3TriggerHandler = Handler<PreTokenGenerationV3TriggerEvent>;
|
|
@@ -24,7 +24,7 @@ export interface GuardDutyScanResultNotificationEventDetail {
|
|
|
24
24
|
s3Throttled: boolean;
|
|
25
25
|
};
|
|
26
26
|
scanResultDetails: {
|
|
27
|
-
scanResultStatus: "NO_THREATS_FOUND" | "
|
|
27
|
+
scanResultStatus: "NO_THREATS_FOUND" | "THREATS_FOUND" | "UNSUPPORTED" | "ACCESS_DENIED" | "FAILED";
|
|
28
28
|
threats: GuardDutyThreatDetail[] | null;
|
|
29
29
|
};
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -18,16 +18,20 @@
|
|
|
18
18
|
"eject": "npx projen eject",
|
|
19
19
|
"eslint": "npx projen eslint",
|
|
20
20
|
"format": "npx projen format",
|
|
21
|
+
"integ:deploy:dsql": "npx projen integ:deploy:dsql",
|
|
21
22
|
"integ:deploy:mariadb": "npx projen integ:deploy:mariadb",
|
|
22
23
|
"integ:deploy:postgres": "npx projen integ:deploy:postgres",
|
|
23
24
|
"integ:deploy:serverless": "npx projen integ:deploy:serverless",
|
|
25
|
+
"integ:destroy:dsql": "npx projen integ:destroy:dsql",
|
|
24
26
|
"integ:destroy:mariadb": "npx projen integ:destroy:mariadb",
|
|
25
27
|
"integ:destroy:postgres": "npx projen integ:destroy:postgres",
|
|
26
28
|
"integ:destroy:serverless": "npx projen integ:destroy:serverless",
|
|
29
|
+
"integ:generate-migrations:dsql": "npx projen integ:generate-migrations:dsql",
|
|
27
30
|
"integ:generate-migrations:mariadb": "npx projen integ:generate-migrations:mariadb",
|
|
28
31
|
"integ:generate-migrations:postgres": "npx projen integ:generate-migrations:postgres",
|
|
29
32
|
"integ:generate-migrations:serverless": "npx projen integ:generate-migrations:serverless",
|
|
30
33
|
"integ:synth:all": "npx projen integ:synth:all",
|
|
34
|
+
"integ:synth:dsql": "npx projen integ:synth:dsql",
|
|
31
35
|
"integ:synth:mariadb": "npx projen integ:synth:mariadb",
|
|
32
36
|
"integ:synth:postgres": "npx projen integ:synth:postgres",
|
|
33
37
|
"integ:synth:serverless": "npx projen integ:synth:serverless",
|
|
@@ -51,44 +55,45 @@
|
|
|
51
55
|
"organization": false
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
58
|
+
"@aws-sdk/client-secrets-manager": "^3.886.0",
|
|
59
|
+
"@aws-sdk/dsql-signer": "^3.886.0",
|
|
55
60
|
"@types/jest": "^29.5.14",
|
|
56
|
-
"@types/node": "^22.
|
|
61
|
+
"@types/node": "^22.18.1",
|
|
57
62
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
58
63
|
"@typescript-eslint/parser": "^8",
|
|
59
|
-
"aws-cdk": "^2.
|
|
60
|
-
"aws-cdk-lib": "2.
|
|
64
|
+
"aws-cdk": "^2.1029.0",
|
|
65
|
+
"aws-cdk-lib": "2.207.0",
|
|
61
66
|
"commit-and-tag-version": "^12",
|
|
62
|
-
"constructs": "10.
|
|
63
|
-
"drizzle-kit": "^0.
|
|
64
|
-
"drizzle-orm": "^0.
|
|
67
|
+
"constructs": "10.4.2",
|
|
68
|
+
"drizzle-kit": "^0.31.4",
|
|
69
|
+
"drizzle-orm": "^0.44.5",
|
|
65
70
|
"esbuild": "^0.25.1",
|
|
66
71
|
"eslint": "^8",
|
|
67
|
-
"eslint-config-prettier": "^10.1.
|
|
68
|
-
"eslint-import-resolver-typescript": "^3.
|
|
69
|
-
"eslint-plugin-import": "^2.
|
|
70
|
-
"eslint-plugin-prettier": "^5.
|
|
72
|
+
"eslint-config-prettier": "^10.1.8",
|
|
73
|
+
"eslint-import-resolver-typescript": "^3.10.1",
|
|
74
|
+
"eslint-plugin-import": "^2.32.0",
|
|
75
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
71
76
|
"jest": "^29.7.0",
|
|
72
77
|
"jest-junit": "^16",
|
|
73
|
-
"jsii": "~5.
|
|
74
|
-
"jsii-diff": "^1.
|
|
78
|
+
"jsii": "~5.9.0",
|
|
79
|
+
"jsii-diff": "^1.114.1",
|
|
75
80
|
"jsii-docgen": "^10.5.0",
|
|
76
|
-
"jsii-pacmak": "^1.
|
|
77
|
-
"jsii-rosetta": "~5.
|
|
78
|
-
"mysql2": "^3.
|
|
79
|
-
"postgres": "^3.4.
|
|
80
|
-
"prettier": "^3.
|
|
81
|
-
"projen": "^0.
|
|
82
|
-
"ts-jest": "^29.
|
|
81
|
+
"jsii-pacmak": "^1.114.1",
|
|
82
|
+
"jsii-rosetta": "~5.9.0",
|
|
83
|
+
"mysql2": "^3.14.5",
|
|
84
|
+
"postgres": "^3.4.7",
|
|
85
|
+
"prettier": "^3.6.2",
|
|
86
|
+
"projen": "^0.96.1",
|
|
87
|
+
"ts-jest": "^29.4.1",
|
|
83
88
|
"ts-node": "^10.9.2",
|
|
84
|
-
"typescript": "^5.
|
|
89
|
+
"typescript": "^5.9.2"
|
|
85
90
|
},
|
|
86
91
|
"peerDependencies": {
|
|
87
|
-
"aws-cdk-lib": "^2.
|
|
88
|
-
"constructs": "^10.
|
|
92
|
+
"aws-cdk-lib": "^2.207.0",
|
|
93
|
+
"constructs": "^10.4.2"
|
|
89
94
|
},
|
|
90
95
|
"dependencies": {
|
|
91
|
-
"@types/aws-lambda": "^8.10.
|
|
96
|
+
"@types/aws-lambda": "^8.10.152"
|
|
92
97
|
},
|
|
93
98
|
"bundledDependencies": [
|
|
94
99
|
"@types/aws-lambda"
|
|
@@ -108,7 +113,7 @@
|
|
|
108
113
|
"publishConfig": {
|
|
109
114
|
"access": "public"
|
|
110
115
|
},
|
|
111
|
-
"version": "
|
|
116
|
+
"version": "2.0.0",
|
|
112
117
|
"jest": {
|
|
113
118
|
"coverageProvider": "v8",
|
|
114
119
|
"testMatch": [
|