-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
550 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
/* | ||
undefined | ||
AWS S3 Event JSON Payload | ||
!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! | ||
See https://www.npmjs.com/package/io-ts-from-json-schema | ||
*/ | ||
|
||
import * as t from 'io-ts'; | ||
import * as Units_ from '../../core/components/units'; | ||
|
||
export const schemaId = 'http://maasglobal.com/aws/s3/event.json'; | ||
|
||
// S3Event | ||
// The default export. More information at the top. | ||
export type S3Event = t.Branded< | ||
{ | ||
eventVersion?: number; | ||
eventSource?: string & 'aws:s3'; | ||
awsRegion?: string; | ||
eventTime?: Units_.IsoDateTime; | ||
eventName?: unknown; | ||
userIdentity?: { | ||
principalId?: string; | ||
}; | ||
requestParameters?: { | ||
sourceIPAddress?: string; | ||
}; | ||
responseElements?: { | ||
'x-amz-request-id'?: string; | ||
'x-amz-id-2'?: string; | ||
}; | ||
s3?: { | ||
s3SchemaVersion?: number; | ||
configurationId?: string; | ||
bucket?: { | ||
name?: string; | ||
ownerIdentity?: { | ||
principalId?: string; | ||
}; | ||
arn?: Units_.Arn; | ||
}; | ||
object?: { | ||
key?: string; | ||
size?: number; | ||
eTag?: string; | ||
versionId?: string; | ||
sequencer?: string; | ||
}; | ||
}; | ||
glacierEventData?: { | ||
restoreEventData?: { | ||
lifecycleRestorationExpiryTime?: Units_.IsoDateTime; | ||
lifecycleRestoreStorageClass?: string; | ||
}; | ||
}; | ||
}, | ||
S3EventBrand | ||
>; | ||
export type S3EventC = t.BrandC< | ||
t.PartialC<{ | ||
eventVersion: t.NumberC; | ||
eventSource: t.IntersectionC<[t.StringC, t.LiteralC<'aws:s3'>]>; | ||
awsRegion: t.StringC; | ||
eventTime: typeof Units_.IsoDateTime; | ||
eventName: t.UnknownC; | ||
userIdentity: t.PartialC<{ | ||
principalId: t.StringC; | ||
}>; | ||
requestParameters: t.PartialC<{ | ||
sourceIPAddress: t.StringC; | ||
}>; | ||
responseElements: t.PartialC<{ | ||
'x-amz-request-id': t.StringC; | ||
'x-amz-id-2': t.StringC; | ||
}>; | ||
s3: t.PartialC<{ | ||
s3SchemaVersion: t.NumberC; | ||
configurationId: t.StringC; | ||
bucket: t.PartialC<{ | ||
name: t.StringC; | ||
ownerIdentity: t.PartialC<{ | ||
principalId: t.StringC; | ||
}>; | ||
arn: typeof Units_.Arn; | ||
}>; | ||
object: t.PartialC<{ | ||
key: t.StringC; | ||
size: t.NumberC; | ||
eTag: t.StringC; | ||
versionId: t.StringC; | ||
sequencer: t.StringC; | ||
}>; | ||
}>; | ||
glacierEventData: t.PartialC<{ | ||
restoreEventData: t.PartialC<{ | ||
lifecycleRestorationExpiryTime: typeof Units_.IsoDateTime; | ||
lifecycleRestoreStorageClass: t.StringC; | ||
}>; | ||
}>; | ||
}>, | ||
S3EventBrand | ||
>; | ||
export const S3Event: S3EventC = t.brand( | ||
t.partial({ | ||
eventVersion: t.number, | ||
eventSource: t.intersection([t.string, t.literal('aws:s3')]), | ||
awsRegion: t.string, | ||
eventTime: Units_.IsoDateTime, | ||
eventName: t.unknown, | ||
userIdentity: t.partial({ | ||
principalId: t.string, | ||
}), | ||
requestParameters: t.partial({ | ||
sourceIPAddress: t.string, | ||
}), | ||
responseElements: t.partial({ | ||
'x-amz-request-id': t.string, | ||
'x-amz-id-2': t.string, | ||
}), | ||
s3: t.partial({ | ||
s3SchemaVersion: t.number, | ||
configurationId: t.string, | ||
bucket: t.partial({ | ||
name: t.string, | ||
ownerIdentity: t.partial({ | ||
principalId: t.string, | ||
}), | ||
arn: Units_.Arn, | ||
}), | ||
object: t.partial({ | ||
key: t.string, | ||
size: t.number, | ||
eTag: t.string, | ||
versionId: t.string, | ||
sequencer: t.string, | ||
}), | ||
}), | ||
glacierEventData: t.partial({ | ||
restoreEventData: t.partial({ | ||
lifecycleRestorationExpiryTime: Units_.IsoDateTime, | ||
lifecycleRestoreStorageClass: t.string, | ||
}), | ||
}), | ||
}), | ||
( | ||
x, | ||
): x is t.Branded< | ||
{ | ||
eventVersion?: number; | ||
eventSource?: string & 'aws:s3'; | ||
awsRegion?: string; | ||
eventTime?: Units_.IsoDateTime; | ||
eventName?: unknown; | ||
userIdentity?: { | ||
principalId?: string; | ||
}; | ||
requestParameters?: { | ||
sourceIPAddress?: string; | ||
}; | ||
responseElements?: { | ||
'x-amz-request-id'?: string; | ||
'x-amz-id-2'?: string; | ||
}; | ||
s3?: { | ||
s3SchemaVersion?: number; | ||
configurationId?: string; | ||
bucket?: { | ||
name?: string; | ||
ownerIdentity?: { | ||
principalId?: string; | ||
}; | ||
arn?: Units_.Arn; | ||
}; | ||
object?: { | ||
key?: string; | ||
size?: number; | ||
eTag?: string; | ||
versionId?: string; | ||
sequencer?: string; | ||
}; | ||
}; | ||
glacierEventData?: { | ||
restoreEventData?: { | ||
lifecycleRestorationExpiryTime?: Units_.IsoDateTime; | ||
lifecycleRestoreStorageClass?: string; | ||
}; | ||
}; | ||
}, | ||
S3EventBrand | ||
> => true, | ||
'S3Event', | ||
); | ||
export interface S3EventBrand { | ||
readonly S3Event: unique symbol; | ||
} | ||
|
||
export default S3Event; | ||
|
||
// Success |
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,86 @@ | ||
/* | ||
undefined | ||
AWS SNS Notification JSON Payload | ||
!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! | ||
See https://www.npmjs.com/package/io-ts-from-json-schema | ||
*/ | ||
|
||
import * as t from 'io-ts'; | ||
import * as Units_ from '../../core/components/units'; | ||
|
||
export const schemaId = 'http://maasglobal.com/aws/sns/notification.json'; | ||
|
||
// SnsNotification | ||
// The default export. More information at the top. | ||
export type SnsNotification = t.Branded< | ||
{ | ||
Type?: string & 'Notification'; | ||
MessageId?: Units_.Uuid; | ||
TopicArn?: Units_.Arn; | ||
Subject?: string; | ||
Message?: string; | ||
Timestamp?: Units_.IsoDateTime; | ||
SignatureVersion?: number; | ||
Signature?: string; | ||
SigningCertURL?: Units_.Url; | ||
UnsubscribeURL?: Units_.Url; | ||
}, | ||
SnsNotificationBrand | ||
>; | ||
export type SnsNotificationC = t.BrandC< | ||
t.PartialC<{ | ||
Type: t.IntersectionC<[t.StringC, t.LiteralC<'Notification'>]>; | ||
MessageId: typeof Units_.Uuid; | ||
TopicArn: typeof Units_.Arn; | ||
Subject: t.StringC; | ||
Message: t.StringC; | ||
Timestamp: typeof Units_.IsoDateTime; | ||
SignatureVersion: t.NumberC; | ||
Signature: t.StringC; | ||
SigningCertURL: typeof Units_.Url; | ||
UnsubscribeURL: typeof Units_.Url; | ||
}>, | ||
SnsNotificationBrand | ||
>; | ||
export const SnsNotification: SnsNotificationC = t.brand( | ||
t.partial({ | ||
Type: t.intersection([t.string, t.literal('Notification')]), | ||
MessageId: Units_.Uuid, | ||
TopicArn: Units_.Arn, | ||
Subject: t.string, | ||
Message: t.string, | ||
Timestamp: Units_.IsoDateTime, | ||
SignatureVersion: t.number, | ||
Signature: t.string, | ||
SigningCertURL: Units_.Url, | ||
UnsubscribeURL: Units_.Url, | ||
}), | ||
( | ||
x, | ||
): x is t.Branded< | ||
{ | ||
Type?: string & 'Notification'; | ||
MessageId?: Units_.Uuid; | ||
TopicArn?: Units_.Arn; | ||
Subject?: string; | ||
Message?: string; | ||
Timestamp?: Units_.IsoDateTime; | ||
SignatureVersion?: number; | ||
Signature?: string; | ||
SigningCertURL?: Units_.Url; | ||
UnsubscribeURL?: Units_.Url; | ||
}, | ||
SnsNotificationBrand | ||
> => true, | ||
'SnsNotification', | ||
); | ||
export interface SnsNotificationBrand { | ||
readonly SnsNotification: unique symbol; | ||
} | ||
|
||
export default SnsNotification; | ||
|
||
// Success |
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
Oops, something went wrong.