cdk-drizzle-migrate 0.0.9
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 +4136 -0
- package/.jsiiignore +0 -0
- package/API.md +249 -0
- package/LICENSE +202 -0
- package/README.md +115 -0
- package/lib/drizzle-migrate-provider.d.ts +58 -0
- package/lib/drizzle-migrate-provider.js +95 -0
- package/lib/handler/handler.js +49302 -0
- package/lib/handler/index.d.ts +8 -0
- package/lib/handler/index.js +8 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/node_modules/@types/aws-lambda/LICENSE +21 -0
- package/node_modules/@types/aws-lambda/README.md +15 -0
- package/node_modules/@types/aws-lambda/common/api-gateway.d.ts +83 -0
- package/node_modules/@types/aws-lambda/common/cloudfront.d.ts +245 -0
- package/node_modules/@types/aws-lambda/handler.d.ts +172 -0
- package/node_modules/@types/aws-lambda/index.d.ts +54 -0
- package/node_modules/@types/aws-lambda/package.json +226 -0
- package/node_modules/@types/aws-lambda/trigger/alb.d.ts +48 -0
- package/node_modules/@types/aws-lambda/trigger/amplify-resolver.d.ts +38 -0
- package/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +246 -0
- package/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +336 -0
- package/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +121 -0
- package/node_modules/@types/aws-lambda/trigger/autoscaling.d.ts +41 -0
- package/node_modules/@types/aws-lambda/trigger/cdk-custom-resource.d.ts +158 -0
- package/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +236 -0
- package/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +22 -0
- package/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +21 -0
- package/node_modules/@types/aws-lambda/trigger/cloudwatch-alarm.d.ts +69 -0
- package/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +8 -0
- package/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +37 -0
- package/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +104 -0
- package/node_modules/@types/aws-lambda/trigger/codecommit.d.ts +35 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +31 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +32 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +23 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +11 -0
- package/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +55 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +41 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +22 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +76 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +52 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-sms-sender.d.ts +51 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +21 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +128 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +15 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +26 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +16 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +31 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation-v2.d.ts +73 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +53 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +40 -0
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +22 -0
- package/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +64 -0
- package/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +55 -0
- package/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +19 -0
- package/node_modules/@types/aws-lambda/trigger/guard-duty-event-notification.d.ts +36 -0
- package/node_modules/@types/aws-lambda/trigger/iot-authorizer.d.ts +48 -0
- package/node_modules/@types/aws-lambda/trigger/iot.d.ts +28 -0
- package/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +51 -0
- package/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +56 -0
- package/node_modules/@types/aws-lambda/trigger/lambda-function-url.d.ts +45 -0
- package/node_modules/@types/aws-lambda/trigger/lex-v2.d.ts +164 -0
- package/node_modules/@types/aws-lambda/trigger/lex.d.ts +120 -0
- package/node_modules/@types/aws-lambda/trigger/msk.d.ts +28 -0
- package/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +41 -0
- package/node_modules/@types/aws-lambda/trigger/s3-event-notification.d.ts +290 -0
- package/node_modules/@types/aws-lambda/trigger/s3.d.ts +60 -0
- package/node_modules/@types/aws-lambda/trigger/secretsmanager.d.ts +15 -0
- package/node_modules/@types/aws-lambda/trigger/self-managed-kafka.d.ts +27 -0
- package/node_modules/@types/aws-lambda/trigger/ses.d.ts +109 -0
- package/node_modules/@types/aws-lambda/trigger/sns.d.ts +39 -0
- package/node_modules/@types/aws-lambda/trigger/sqs.d.ts +58 -0
- package/node_modules/@types/aws-lambda/trigger/transfer-family-authorizer.d.ts +110 -0
- package/package.json +165 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@types/aws-lambda",
|
|
3
|
+
"version": "8.10.147",
|
|
4
|
+
"description": "TypeScript definitions for aws-lambda",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "James Darbyshire",
|
|
10
|
+
"githubUsername": "darbio",
|
|
11
|
+
"url": "https://github.com/darbio"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Michael Skarum",
|
|
15
|
+
"githubUsername": "skarum",
|
|
16
|
+
"url": "https://github.com/skarum"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Stef Heyenrath",
|
|
20
|
+
"githubUsername": "StefH",
|
|
21
|
+
"url": "https://github.com/StefH"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Rich Buggy",
|
|
25
|
+
"githubUsername": "buggy",
|
|
26
|
+
"url": "https://github.com/buggy"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "wwwy3y3",
|
|
30
|
+
"githubUsername": "wwwy3y3",
|
|
31
|
+
"url": "https://github.com/wwwy3y3"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Ishaan Malhi",
|
|
35
|
+
"githubUsername": "OrthoDex",
|
|
36
|
+
"url": "https://github.com/OrthoDex"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Michael Marner",
|
|
40
|
+
"githubUsername": "MichaelMarner",
|
|
41
|
+
"url": "https://github.com/MichaelMarner"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "Daniel Cottone",
|
|
45
|
+
"githubUsername": "daniel-cottone",
|
|
46
|
+
"url": "https://github.com/daniel-cottone"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "Kostya Misura",
|
|
50
|
+
"githubUsername": "kostya-misura",
|
|
51
|
+
"url": "https://github.com/kostya-misura"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "Markus Tacker",
|
|
55
|
+
"githubUsername": "coderbyheart",
|
|
56
|
+
"url": "https://github.com/coderbyheart"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Palmi Valgeirsson",
|
|
60
|
+
"githubUsername": "palmithor",
|
|
61
|
+
"url": "https://github.com/palmithor"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "Danilo Raisi",
|
|
65
|
+
"githubUsername": "daniloraisi",
|
|
66
|
+
"url": "https://github.com/daniloraisi"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "Simon Buchan",
|
|
70
|
+
"githubUsername": "simonbuchan",
|
|
71
|
+
"url": "https://github.com/simonbuchan"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "David Hayden",
|
|
75
|
+
"githubUsername": "Haydabase",
|
|
76
|
+
"url": "https://github.com/Haydabase"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "Chris Redekop",
|
|
80
|
+
"githubUsername": "repl-chris",
|
|
81
|
+
"url": "https://github.com/repl-chris"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "Aneil Mallavarapu",
|
|
85
|
+
"githubUsername": "aneilbaboo",
|
|
86
|
+
"url": "https://github.com/aneilbaboo"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "Jeremy Nagel",
|
|
90
|
+
"githubUsername": "jeznag",
|
|
91
|
+
"url": "https://github.com/jeznag"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "Louis Larry",
|
|
95
|
+
"githubUsername": "louislarry",
|
|
96
|
+
"url": "https://github.com/louislarry"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "Daniel Papukchiev",
|
|
100
|
+
"githubUsername": "dpapukchiev",
|
|
101
|
+
"url": "https://github.com/dpapukchiev"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "Oliver Hookins",
|
|
105
|
+
"githubUsername": "ohookins",
|
|
106
|
+
"url": "https://github.com/ohookins"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "Trevor Leach",
|
|
110
|
+
"githubUsername": "trevor-leach",
|
|
111
|
+
"url": "https://github.com/trevor-leach"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "James Gregory",
|
|
115
|
+
"githubUsername": "jagregory",
|
|
116
|
+
"url": "https://github.com/jagregory"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "Erik Dalén",
|
|
120
|
+
"githubUsername": "dalen",
|
|
121
|
+
"url": "https://github.com/dalen"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "Loïk Gaonac'h",
|
|
125
|
+
"githubUsername": "loikg",
|
|
126
|
+
"url": "https://github.com/loikg"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "Roberto Zen",
|
|
130
|
+
"githubUsername": "skyzenr",
|
|
131
|
+
"url": "https://github.com/skyzenr"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "Grzegorz Redlicki",
|
|
135
|
+
"githubUsername": "redlickigrzegorz",
|
|
136
|
+
"url": "https://github.com/redlickigrzegorz"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "Juan Carbonel",
|
|
140
|
+
"githubUsername": "juancarbonel",
|
|
141
|
+
"url": "https://github.com/juancarbonel"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "Peter McIntyre",
|
|
145
|
+
"githubUsername": "pwmcintyre",
|
|
146
|
+
"url": "https://github.com/pwmcintyre"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "Alex Bolenok",
|
|
150
|
+
"githubUsername": "alex-bolenok-centralreach",
|
|
151
|
+
"url": "https://github.com/alex-bolenok-centralreach"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "Marian Zange",
|
|
155
|
+
"githubUsername": "marianzange",
|
|
156
|
+
"url": "https://github.com/marianzange"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "Alessandro Palumbo",
|
|
160
|
+
"githubUsername": "apalumbo",
|
|
161
|
+
"url": "https://github.com/apalumbo"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "Sachin Shekhar",
|
|
165
|
+
"githubUsername": "SachinShekhar",
|
|
166
|
+
"url": "https://github.com/SachinShekhar"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "Ivan Martos",
|
|
170
|
+
"githubUsername": "ivanmartos",
|
|
171
|
+
"url": "https://github.com/ivanmartos"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "Zach Anthony",
|
|
175
|
+
"githubUsername": "zach-anthony",
|
|
176
|
+
"url": "https://github.com/zach-anthony"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "Peter Savnik",
|
|
180
|
+
"githubUsername": "savnik",
|
|
181
|
+
"url": "https://github.com/savnik"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "Benoit Boure",
|
|
185
|
+
"githubUsername": "bboure",
|
|
186
|
+
"url": "https://github.com/bboure"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "James Lakin",
|
|
190
|
+
"githubUsername": "jamesorlakin",
|
|
191
|
+
"url": "https://github.com/jamesorlakin"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "Ross Gerbasi",
|
|
195
|
+
"githubUsername": "aphex",
|
|
196
|
+
"url": "https://github.com/aphex"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "Joey Kilpatrick",
|
|
200
|
+
"githubUsername": "joeykilpatrick",
|
|
201
|
+
"url": "https://github.com/joeykilpatrick"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "Luciano Manerich Junior",
|
|
205
|
+
"githubUsername": "lmanerich",
|
|
206
|
+
"url": "https://github.com/lmanerich"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "Luciano M. Taranto",
|
|
210
|
+
"githubUsername": "LucianoTaranto",
|
|
211
|
+
"url": "https://github.com/LucianoTaranto"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"main": "",
|
|
215
|
+
"types": "index.d.ts",
|
|
216
|
+
"repository": {
|
|
217
|
+
"type": "git",
|
|
218
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
219
|
+
"directory": "types/aws-lambda"
|
|
220
|
+
},
|
|
221
|
+
"scripts": {},
|
|
222
|
+
"dependencies": {},
|
|
223
|
+
"peerDependencies": {},
|
|
224
|
+
"typesPublisherContentHash": "c61fda39cd2f8e15ec3e08c58f4bbff834919ab754ed2653832203474b96c3b9",
|
|
225
|
+
"typeScriptVersion": "5.0"
|
|
226
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Callback, Handler } from "../handler";
|
|
2
|
+
|
|
3
|
+
export type ALBHandler = Handler<ALBEvent, ALBResult>;
|
|
4
|
+
export type ALBCallback = Callback<ALBResult>;
|
|
5
|
+
|
|
6
|
+
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html
|
|
7
|
+
export interface ALBEventRequestContext {
|
|
8
|
+
elb: {
|
|
9
|
+
targetGroupArn: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ALBEventQueryStringParameters {
|
|
14
|
+
[name: string]: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ALBEventHeaders {
|
|
18
|
+
[name: string]: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ALBEventMultiValueHeaders {
|
|
22
|
+
[name: string]: string[] | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ALBEventMultiValueQueryStringParameters {
|
|
26
|
+
[name: string]: string[] | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ALBEvent {
|
|
30
|
+
requestContext: ALBEventRequestContext;
|
|
31
|
+
httpMethod: string;
|
|
32
|
+
path: string;
|
|
33
|
+
queryStringParameters?: ALBEventQueryStringParameters | undefined; // URL encoded
|
|
34
|
+
headers?: ALBEventHeaders | undefined;
|
|
35
|
+
multiValueQueryStringParameters?: ALBEventMultiValueQueryStringParameters | undefined; // URL encoded
|
|
36
|
+
multiValueHeaders?: ALBEventMultiValueHeaders | undefined;
|
|
37
|
+
body: string | null;
|
|
38
|
+
isBase64Encoded: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ALBResult {
|
|
42
|
+
statusCode: number;
|
|
43
|
+
statusDescription?: string | undefined;
|
|
44
|
+
headers?: { [header: string]: boolean | number | string } | undefined;
|
|
45
|
+
multiValueHeaders?: { [header: string]: Array<boolean | number | string> } | undefined;
|
|
46
|
+
body?: string | undefined;
|
|
47
|
+
isBase64Encoded?: boolean | undefined;
|
|
48
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Handler } from "../handler";
|
|
2
|
+
import { AppSyncIdentity, AppSyncResolverEventHeaders } from "./appsync-resolver";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* An AWS Amplify GraphQL resolver event. It differs slightly from a native ('direct') AppSync resolver event.
|
|
6
|
+
*
|
|
7
|
+
* @see https://docs.amplify.aws/cli/graphql/custom-business-logic/#structure-of-the-function-event
|
|
8
|
+
*/
|
|
9
|
+
export interface AmplifyGraphQlResolverEvent<TArguments = Record<string, any>, TSource = Record<string, any>> {
|
|
10
|
+
/** The name of the parent object type (data model) of the field being resolved. */
|
|
11
|
+
typeName: string;
|
|
12
|
+
/** The field within the given type to resolve. */
|
|
13
|
+
fieldName: string;
|
|
14
|
+
/** A map of GraphQL arguments passed to the field being resolved. */
|
|
15
|
+
arguments: TArguments;
|
|
16
|
+
/** The identity used to authenticate the request to AppSync. */
|
|
17
|
+
identity?: AppSyncIdentity;
|
|
18
|
+
/** The parent object's value if resolving a nested field. */
|
|
19
|
+
source: TSource;
|
|
20
|
+
/** The request headers */
|
|
21
|
+
request: {
|
|
22
|
+
headers: AppSyncResolverEventHeaders;
|
|
23
|
+
domainName: string | null;
|
|
24
|
+
};
|
|
25
|
+
/** The object returned by a possible previous pipeline resolver function. */
|
|
26
|
+
prev: { result: { [key: string]: any } } | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A handler for Amplify GraphQL Lambda resolvers. The returned result will be resolved as the value (no need to convert to a JSON string).
|
|
31
|
+
*
|
|
32
|
+
* @see https://docs.amplify.aws/cli/graphql/custom-business-logic/#structure-of-the-function-event
|
|
33
|
+
*/
|
|
34
|
+
export type AmplifyGraphQlResolverHandler<
|
|
35
|
+
TArguments = Record<string, any>,
|
|
36
|
+
TSource = Record<string, any>,
|
|
37
|
+
TResult = any,
|
|
38
|
+
> = Handler<AmplifyGraphQlResolverEvent<TArguments, TSource>, TResult>;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APIGatewayAuthorizerResultContext,
|
|
3
|
+
APIGatewayEventDefaultAuthorizerContext,
|
|
4
|
+
APIGatewayEventRequestContextWithAuthorizer,
|
|
5
|
+
} from "../common/api-gateway";
|
|
6
|
+
import { Callback, Handler } from "../handler";
|
|
7
|
+
import { APIGatewayEventRequestContextV2 } from "./api-gateway-proxy";
|
|
8
|
+
|
|
9
|
+
export type APIGatewayAuthorizerHandler = Handler<APIGatewayAuthorizerEvent, APIGatewayAuthorizerResult>;
|
|
10
|
+
export type APIGatewayAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
|
|
11
|
+
Handler<APIGatewayAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
|
|
12
|
+
|
|
13
|
+
export type APIGatewayAuthorizerCallback = Callback<APIGatewayAuthorizerResult>;
|
|
14
|
+
export type APIGatewayAuthorizerWithContextCallback<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
|
|
15
|
+
Callback<APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
|
|
16
|
+
|
|
17
|
+
export type APIGatewayTokenAuthorizerHandler = Handler<APIGatewayTokenAuthorizerEvent, APIGatewayAuthorizerResult>;
|
|
18
|
+
export type APIGatewayTokenAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
|
|
19
|
+
Handler<APIGatewayTokenAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
|
|
20
|
+
|
|
21
|
+
export type APIGatewayRequestAuthorizerHandler = Handler<APIGatewayRequestAuthorizerEvent, APIGatewayAuthorizerResult>;
|
|
22
|
+
export type APIGatewayRequestAuthorizerWithContextHandler<
|
|
23
|
+
TAuthorizerContext extends APIGatewayAuthorizerResultContext,
|
|
24
|
+
> = Handler<APIGatewayRequestAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
|
|
25
|
+
|
|
26
|
+
export type APIGatewayAuthorizerEvent = APIGatewayTokenAuthorizerEvent | APIGatewayRequestAuthorizerEvent;
|
|
27
|
+
|
|
28
|
+
export interface APIGatewayTokenAuthorizerEvent {
|
|
29
|
+
type: "TOKEN";
|
|
30
|
+
methodArn: string;
|
|
31
|
+
authorizationToken: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface APIGatewayRequestAuthorizerEventV2 {
|
|
35
|
+
version: string;
|
|
36
|
+
type: "REQUEST";
|
|
37
|
+
routeArn: string;
|
|
38
|
+
identitySource: string[];
|
|
39
|
+
routeKey: string;
|
|
40
|
+
rawPath: string;
|
|
41
|
+
rawQueryString: string;
|
|
42
|
+
cookies: string[];
|
|
43
|
+
headers?: APIGatewayRequestAuthorizerEventHeaders;
|
|
44
|
+
queryStringParameters?: APIGatewayRequestAuthorizerEventQueryStringParameters;
|
|
45
|
+
requestContext: APIGatewayEventRequestContextV2;
|
|
46
|
+
pathParameters?: APIGatewayRequestAuthorizerEventPathParameters;
|
|
47
|
+
stageVariables?: APIGatewayRequestAuthorizerEventStageVariables;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface APIGatewayRequestAuthorizerEventHeaders {
|
|
51
|
+
[name: string]: string | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface APIGatewayRequestAuthorizerEventMultiValueHeaders {
|
|
55
|
+
[name: string]: string[] | undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface APIGatewayRequestAuthorizerEventPathParameters {
|
|
59
|
+
[name: string]: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface APIGatewayRequestAuthorizerEventQueryStringParameters {
|
|
63
|
+
[name: string]: string | undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface APIGatewayRequestAuthorizerEventMultiValueQueryStringParameters {
|
|
67
|
+
[name: string]: string[] | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface APIGatewayRequestAuthorizerEventStageVariables {
|
|
71
|
+
[name: string]: string | undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Note, when invoked by the tester in the AWS web console, the map values can be null,
|
|
75
|
+
// but they will be empty objects in the real object.
|
|
76
|
+
// Worse, it will include "body" and "isBase64Encoded" properties, unlike the real call!
|
|
77
|
+
// See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html for the
|
|
78
|
+
// formal definition.
|
|
79
|
+
export interface APIGatewayRequestAuthorizerEvent {
|
|
80
|
+
type: "REQUEST";
|
|
81
|
+
methodArn: string;
|
|
82
|
+
resource: string;
|
|
83
|
+
path: string;
|
|
84
|
+
httpMethod: string;
|
|
85
|
+
headers: APIGatewayRequestAuthorizerEventHeaders | null;
|
|
86
|
+
multiValueHeaders: APIGatewayRequestAuthorizerEventMultiValueHeaders | null;
|
|
87
|
+
pathParameters: APIGatewayRequestAuthorizerEventPathParameters | null;
|
|
88
|
+
queryStringParameters: APIGatewayRequestAuthorizerEventQueryStringParameters | null;
|
|
89
|
+
multiValueQueryStringParameters: APIGatewayRequestAuthorizerEventMultiValueQueryStringParameters | null;
|
|
90
|
+
stageVariables: APIGatewayRequestAuthorizerEventStageVariables | null;
|
|
91
|
+
requestContext: APIGatewayEventRequestContextWithAuthorizer<undefined>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface APIGatewayAuthorizerResult {
|
|
95
|
+
principalId: string;
|
|
96
|
+
policyDocument: PolicyDocument;
|
|
97
|
+
context?: APIGatewayAuthorizerResultContext | null | undefined;
|
|
98
|
+
usageIdentifierKey?: string | null | undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Separate type so the context property is required, without pulling complex type magic.
|
|
102
|
+
export interface APIGatewayAuthorizerWithContextResult<TAuthorizerContext extends APIGatewayAuthorizerResultContext> {
|
|
103
|
+
principalId: string;
|
|
104
|
+
policyDocument: PolicyDocument;
|
|
105
|
+
context: TAuthorizerContext;
|
|
106
|
+
usageIdentifierKey?: string | null | undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* IAM Authorizer Types
|
|
111
|
+
*/
|
|
112
|
+
export interface APIGatewayIAMAuthorizerResult {
|
|
113
|
+
principalId: string;
|
|
114
|
+
policyDocument: PolicyDocument;
|
|
115
|
+
context?: APIGatewayAuthorizerResultContext | null | undefined;
|
|
116
|
+
usageIdentifierKey?: string | null | undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface APIGatewayIAMAuthorizerWithContextResult<
|
|
120
|
+
TAuthorizerContext extends APIGatewayAuthorizerResultContext,
|
|
121
|
+
> {
|
|
122
|
+
principalId: string;
|
|
123
|
+
policyDocument: PolicyDocument;
|
|
124
|
+
context: TAuthorizerContext;
|
|
125
|
+
usageIdentifierKey?: string | null | undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type APIGatewayRequestIAMAuthorizerHandlerV2 = Handler<
|
|
129
|
+
APIGatewayRequestAuthorizerEventV2,
|
|
130
|
+
APIGatewayIAMAuthorizerResult
|
|
131
|
+
>;
|
|
132
|
+
|
|
133
|
+
export type APIGatewayRequestIAMAuthorizerV2WithContextHandler<
|
|
134
|
+
TAuthorizerContext extends APIGatewayAuthorizerResultContext,
|
|
135
|
+
> = Handler<APIGatewayRequestAuthorizerEventV2, APIGatewayIAMAuthorizerWithContextResult<TAuthorizerContext>>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Simple Lambda Authorizer Types V2 spec with simple response
|
|
139
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
|
|
140
|
+
*/
|
|
141
|
+
export interface APIGatewaySimpleAuthorizerResult {
|
|
142
|
+
isAuthorized: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface APIGatewaySimpleAuthorizerWithContextResult<TAuthorizerContext>
|
|
146
|
+
extends APIGatewaySimpleAuthorizerResult
|
|
147
|
+
{
|
|
148
|
+
context: TAuthorizerContext;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export type APIGatewayRequestSimpleAuthorizerHandlerV2 = Handler<
|
|
152
|
+
APIGatewayRequestAuthorizerEventV2,
|
|
153
|
+
APIGatewaySimpleAuthorizerResult
|
|
154
|
+
>;
|
|
155
|
+
|
|
156
|
+
export type APIGatewayRequestSimpleAuthorizerHandlerV2WithContext<TAuthorizerContext> = Handler<
|
|
157
|
+
APIGatewayRequestAuthorizerEventV2,
|
|
158
|
+
APIGatewaySimpleAuthorizerWithContextResult<TAuthorizerContext>
|
|
159
|
+
>;
|
|
160
|
+
|
|
161
|
+
// Legacy event / names
|
|
162
|
+
|
|
163
|
+
/** @deprecated Use APIGatewayAuthorizerHandler or a subtype */
|
|
164
|
+
export type CustomAuthorizerHandler = Handler<CustomAuthorizerEvent, APIGatewayAuthorizerResult>;
|
|
165
|
+
|
|
166
|
+
// This one is actually fine.
|
|
167
|
+
export type CustomAuthorizerCallback = APIGatewayAuthorizerCallback;
|
|
168
|
+
|
|
169
|
+
/** @deprecated Use APIGatewayAuthorizerEvent or a subtype */
|
|
170
|
+
export interface CustomAuthorizerEvent {
|
|
171
|
+
type: string;
|
|
172
|
+
methodArn: string;
|
|
173
|
+
authorizationToken?: string | undefined;
|
|
174
|
+
resource?: string | undefined;
|
|
175
|
+
path?: string | undefined;
|
|
176
|
+
httpMethod?: string | undefined;
|
|
177
|
+
headers?: { [name: string]: string } | undefined;
|
|
178
|
+
multiValueHeaders?: { [name: string]: string[] } | undefined;
|
|
179
|
+
pathParameters?: { [name: string]: string } | null | undefined;
|
|
180
|
+
queryStringParameters?: { [name: string]: string } | null | undefined;
|
|
181
|
+
multiValueQueryStringParameters?: { [name: string]: string[] } | null | undefined;
|
|
182
|
+
stageVariables?: { [name: string]: string } | undefined;
|
|
183
|
+
requestContext?: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext> | undefined;
|
|
184
|
+
domainName?: string | undefined;
|
|
185
|
+
apiId?: string | undefined;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type CustomAuthorizerResult = APIGatewayAuthorizerResult;
|
|
189
|
+
export type AuthResponse = APIGatewayAuthorizerResult;
|
|
190
|
+
export type AuthResponseContext = APIGatewayAuthorizerResultContext;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.
|
|
194
|
+
* https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
|
|
195
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition
|
|
196
|
+
*/
|
|
197
|
+
export interface PolicyDocument {
|
|
198
|
+
Version: string;
|
|
199
|
+
Id?: string | undefined;
|
|
200
|
+
Statement: Statement[];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Condition.
|
|
205
|
+
* https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html
|
|
206
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html
|
|
207
|
+
*/
|
|
208
|
+
export interface ConditionBlock {
|
|
209
|
+
[condition: string]: Condition | Condition[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface Condition {
|
|
213
|
+
[key: string]: string | string[];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
|
|
218
|
+
* https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html
|
|
219
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html
|
|
220
|
+
*/
|
|
221
|
+
export type Statement = BaseStatement & StatementAction & (StatementResource | StatementPrincipal);
|
|
222
|
+
|
|
223
|
+
export type StatementEffect = "Allow" | "Deny";
|
|
224
|
+
|
|
225
|
+
export interface BaseStatement {
|
|
226
|
+
Effect: StatementEffect;
|
|
227
|
+
Sid?: string | undefined;
|
|
228
|
+
Condition?: ConditionBlock | undefined;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export type PrincipalValue = { [key: string]: string | string[] } | string | string[];
|
|
232
|
+
export interface MaybeStatementPrincipal {
|
|
233
|
+
Principal?: PrincipalValue | undefined;
|
|
234
|
+
NotPrincipal?: PrincipalValue | undefined;
|
|
235
|
+
}
|
|
236
|
+
export interface MaybeStatementResource {
|
|
237
|
+
Resource?: string | string[] | undefined;
|
|
238
|
+
NotResource?: string | string[] | undefined;
|
|
239
|
+
}
|
|
240
|
+
export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] };
|
|
241
|
+
export type StatementResource =
|
|
242
|
+
& MaybeStatementPrincipal
|
|
243
|
+
& ({ Resource: string | string[] } | { NotResource: string | string[] });
|
|
244
|
+
export type StatementPrincipal =
|
|
245
|
+
& MaybeStatementResource
|
|
246
|
+
& ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue });
|