This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: upgrade dependencies * feat: add apigateway schemas * feat: add eventbridge schemas * feat: add firehose schemas * feat: add lambda schemas * feat: add kinesis schemas * feat: add s3 schemas * feat: add s3 batch schemas * feat: add secret rotation schemas * feat: add sns schemas * feat: add sqs schemas
- Loading branch information
1 parent
d8aea06
commit 3aa8b77
Showing
7 changed files
with
145 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export * from './apigateway' | ||
export * from './eventbridge' | ||
export * from './firehose' | ||
export * from './kinesis' | ||
export * from './lambda' | ||
export * from './s3' | ||
export * from './s3-batch' | ||
export * from './secret-rotation' | ||
export * from './sns' | ||
export * from './sqs' |
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 @@ | ||
export * from './sqs.type' |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,38 @@ | ||
import { $array, $dict, $enum, $object, $optional, $ref, $string, $validator, $union } from '@skyleague/therefore' | ||
|
||
export const SQSMessageAttribute = $object({ | ||
stringValue: $optional($string, 'explicit'), | ||
binaryValue: $optional($string, 'explicit'), | ||
stringListValues: $optional($array($string), 'explicit'), | ||
binaryListValues: $optional($array($string), 'explicit'), | ||
dataType: $union([$enum(['String', 'Number', 'Binary']), $string]), | ||
}) | ||
|
||
export const SQSMessageAttributes = $dict($ref(SQSMessageAttribute)) | ||
|
||
export const SQSRecordAttributes = $object({ | ||
AWSTraceHeader: $optional($string, 'explicit'), | ||
ApproximateReceiveCount: $string, | ||
SentTimestamp: $string, | ||
SenderId: $string, | ||
ApproximateFirstReceiveTimestamp: $string, | ||
SequenceNumber: $optional($string, 'explicit'), | ||
MessageGroupId: $optional($string, 'explicit'), | ||
MessageDeduplicationId: $optional($string, 'explicit'), | ||
}) | ||
|
||
export const SQSRecord = $validator( | ||
$object({ | ||
messageId: $string, | ||
receiptHandle: $string, | ||
body: $string, | ||
attributes: $ref(SQSRecordAttributes), | ||
messageAttributes: $ref(SQSMessageAttributes), | ||
md5OfBody: $string, | ||
eventSource: $string, | ||
eventSourceARN: $string, | ||
awsRegion: $string, | ||
}) | ||
) | ||
|
||
export const SQSEvent = $validator($object({ Records: $array($ref(SQSRecord)) })) |
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,8 @@ | ||
import type { SQSRecord } from './sqs.type' | ||
|
||
import type { SQSRecord as LambdaSqsRecord } from 'aws-lambda' | ||
|
||
test('type is compatible', () => { | ||
const _test: SQSRecord = {} as unknown as LambdaSqsRecord | ||
// const _test2: LambdaSqsRecord = {} as unknown as SQSRecord | ||
}) |
Oops, something went wrong.