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
- Loading branch information
1 parent
9ca2373
commit 7a8982a
Showing
6 changed files
with
99 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 @@ | ||
export * from './s3.type' |
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,23 @@ | ||
import { $array, $const, $object, $ref, $string, $union, $validator } from '@skyleague/therefore' | ||
|
||
export const s3BatchEventTask = $validator( | ||
$object({ | ||
taskId: $string, | ||
s3Key: $string, | ||
s3VersionId: $union([$string, $const(null)]), | ||
s3BucketArn: $string, | ||
}) | ||
) | ||
|
||
export const s3BatchEventJob = $object({ | ||
id: $string, | ||
}) | ||
|
||
export const s3BatchEvent = $validator( | ||
$object({ | ||
invocationSchemaVersion: $string, | ||
invocationId: $string, | ||
job: $ref(s3BatchEventJob), | ||
tasks: $array($ref(s3BatchEventTask)), | ||
}) | ||
) |
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 { S3BatchEvent } from './s3.type' | ||
|
||
import type { S3BatchEvent as LambdaS3BatchEvent } from 'aws-lambda' | ||
|
||
test('type is compatible', () => { | ||
const _test: S3BatchEvent = {} as unknown as LambdaS3BatchEvent | ||
const _test2: LambdaS3BatchEvent = {} as unknown as S3BatchEvent | ||
}) |
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,57 @@ | ||
/** | ||
* Generated by @skyleague/therefore@v1.0.0-local | ||
* Do not manually touch this | ||
*/ | ||
/* eslint-disable */ | ||
import AjvValidator from 'ajv' | ||
import type { ValidateFunction } from 'ajv' | ||
|
||
export interface S3BatchEventTask { | ||
taskId: string | ||
s3Key: string | ||
s3VersionId: string | null | ||
s3BucketArn: string | ||
} | ||
|
||
export const S3BatchEventTask = { | ||
validate: require('./schemas/s3-batch-event-task.schema.js') as ValidateFunction<S3BatchEventTask>, | ||
get schema() { | ||
return S3BatchEventTask.validate.schema | ||
}, | ||
get errors() { | ||
return S3BatchEventTask.validate.errors ?? undefined | ||
}, | ||
is: (o: unknown): o is S3BatchEventTask => S3BatchEventTask.validate(o) === true, | ||
assert: (o: unknown) => { | ||
if (!S3BatchEventTask.validate(o)) { | ||
throw new AjvValidator.ValidationError(S3BatchEventTask.errors ?? []) | ||
} | ||
}, | ||
} as const | ||
|
||
export interface S3BatchEventJob { | ||
id: string | ||
} | ||
|
||
export interface S3BatchEvent { | ||
invocationSchemaVersion: string | ||
invocationId: string | ||
job: S3BatchEventJob | ||
tasks: S3BatchEventTask[] | ||
} | ||
|
||
export const S3BatchEvent = { | ||
validate: require('./schemas/s3-batch-event.schema.js') as ValidateFunction<S3BatchEvent>, | ||
get schema() { | ||
return S3BatchEvent.validate.schema | ||
}, | ||
get errors() { | ||
return S3BatchEvent.validate.errors ?? undefined | ||
}, | ||
is: (o: unknown): o is S3BatchEvent => S3BatchEvent.validate(o) === true, | ||
assert: (o: unknown) => { | ||
if (!S3BatchEvent.validate(o)) { | ||
throw new AjvValidator.ValidationError(S3BatchEvent.errors ?? []) | ||
} | ||
}, | ||
} as const |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.