-
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
484 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,158 @@ | ||
/* | ||
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 const S3Event = 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,71 @@ | ||
/* | ||
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 const SnsNotification = 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
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.