UNPKG

@aws-lambda-powertools/parser

Version:
42 lines (41 loc) 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.APIGatewayHttpMethod = exports.APIGatewayStringArray = exports.APIGatewayRecord = exports.APIGatewayCert = void 0; const zod_1 = require("zod"); /** * A zod schema for an API Gateway Certificate */ const APIGatewayCert = zod_1.z.object({ clientCertPem: zod_1.z.string(), subjectDN: zod_1.z.string(), issuerDN: zod_1.z.string(), serialNumber: zod_1.z.string(), validity: zod_1.z.object({ notBefore: zod_1.z.string(), notAfter: zod_1.z.string(), }), }); exports.APIGatewayCert = APIGatewayCert; /** * A zod schema for an object with string keys and string values */ const APIGatewayRecord = zod_1.z.record(zod_1.z.string(), zod_1.z.string()); exports.APIGatewayRecord = APIGatewayRecord; /** * A zod schema for an array of strings */ const APIGatewayStringArray = zod_1.z.array(zod_1.z.string()); exports.APIGatewayStringArray = APIGatewayStringArray; /** * A zod schema for API Gateway HTTP methods */ const APIGatewayHttpMethod = zod_1.z.enum([ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', ]); exports.APIGatewayHttpMethod = APIGatewayHttpMethod;