-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): enhance API Gateway schemas (#2665)
- Loading branch information
1 parent
5634566
commit b3bc1f0
Showing
29 changed files
with
1,958 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* A zod schema for an API Gateway Certificate | ||
*/ | ||
const APIGatewayCert = z.object({ | ||
clientCertPem: z.string(), | ||
subjectDN: z.string(), | ||
issuerDN: z.string(), | ||
serialNumber: z.string(), | ||
validity: z.object({ | ||
notBefore: z.string(), | ||
notAfter: z.string(), | ||
}), | ||
}); | ||
|
||
/** | ||
* A zod schema for an object with string keys and string values | ||
*/ | ||
const APIGatewayRecord = z.record(z.string()); | ||
|
||
/** | ||
* A zod schema for an array of strings | ||
*/ | ||
const APIGatewayStringArray = z.array(z.string()); | ||
|
||
/** | ||
* A zod schema for API Gateway HTTP methods | ||
*/ | ||
const APIGatewayHttpMethod = z.enum([ | ||
'GET', | ||
'POST', | ||
'PUT', | ||
'PATCH', | ||
'DELETE', | ||
'HEAD', | ||
'OPTIONS', | ||
]); | ||
|
||
export { | ||
APIGatewayCert, | ||
APIGatewayRecord, | ||
APIGatewayStringArray, | ||
APIGatewayHttpMethod, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.