Skip to content

Commit 41bb08e

Browse files
dreamorosiam29d
andauthored
improv(parser): export APIGatewayEventRequestContextSchema (#3507)
Co-authored-by: Alexander Schueren <[email protected]>
1 parent c1ba818 commit 41bb08e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: packages/parser/src/schemas/apigw.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const APIGatewayEventIdentity = z.object({
4343
*
4444
* @see {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference}
4545
*/
46-
const APIGatewayEventRequestContext = z
46+
const APIGatewayEventRequestContextSchema = z
4747
.object({
4848
accountId: z.string(),
4949
apiId: z.string(),
@@ -161,7 +161,7 @@ const APIGatewayProxyEventSchema = z.object({
161161
multiValueQueryStringParameters: z.record(APIGatewayStringArray).nullable(),
162162
pathParameters: APIGatewayRecord.nullish(),
163163
stageVariables: APIGatewayRecord.nullish(),
164-
requestContext: APIGatewayEventRequestContext,
164+
requestContext: APIGatewayEventRequestContextSchema,
165165
body: z.string().nullable(),
166166
isBase64Encoded: z.boolean(),
167167
});
@@ -232,7 +232,7 @@ const APIGatewayRequestAuthorizerEventSchema = z.object({
232232
multiValueQueryStringParameters: z.record(APIGatewayStringArray),
233233
pathParameters: APIGatewayRecord,
234234
stageVariables: APIGatewayRecord,
235-
requestContext: APIGatewayEventRequestContext,
235+
requestContext: APIGatewayEventRequestContextSchema,
236236
domainName: z.string().optional(),
237237
deploymentId: z.string().optional(),
238238
apiId: z.string().optional(),
@@ -262,4 +262,5 @@ export {
262262
APIGatewayProxyEventSchema,
263263
APIGatewayRequestAuthorizerEventSchema,
264264
APIGatewayTokenAuthorizerEventSchema,
265+
APIGatewayEventRequestContextSchema,
265266
};

Diff for: packages/parser/src/schemas/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export {
33
APIGatewayProxyEventSchema,
44
APIGatewayRequestAuthorizerEventSchema,
55
APIGatewayTokenAuthorizerEventSchema,
6+
APIGatewayEventRequestContextSchema,
67
} from './apigw.js';
78
export {
89
AppSyncResolverSchema,

0 commit comments

Comments
 (0)