Last active
June 1, 2018 18:25
-
-
Save unity/b701266d10072edf15659235f0c85b33 to your computer and use it in GitHub Desktop.
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
type FirehoseEvent = { | |
claims: FirehoseClaim, | |
params: TrackParams | TraitsParams | AliasParams, | |
context: TrackContext | TrackContext | AliasContext | |
}; | |
type Metric: { | |
[ToBeDetermined]: any | |
}; | |
type LogEntry: { | |
level: "info"|"debug"|"warning"|"error", | |
message: String, | |
human_message?: String, | |
data?: {} | |
}; | |
type ConnectorStatus = { | |
status: "ok"|"error"|"warning", | |
messages: Array<String> | |
}; | |
type Response = { | |
requestId?: String, | |
messages?: Array<Response>, | |
firehose?: Array<FirehoseEvent>, | |
metrics: Array<Metric>, | |
logs: Array<LogEntry>, | |
status?: ConnectorStatus | |
} | |
app.post('/notify', handler({ | |
'user:update': (ctx: Context, messages: Array<UserMessage>) => Promise<Response>, | |
'user:create': (ctx: Context, messages: Array<UserMessage>) => Promise<Response>, | |
'user:delete': (ctx: Context, messages: Array<UserMessage>) => Promise<Response>, | |
'user:batch': (ctx: Context, messages: Array<UserMessage>) => Promise<Response>, | |
'account:update': (ctx: Context, messages: Array<AccountMessage>) => Promise<Response>, | |
'account:batch': (ctx: Context, messages: Array<UserMessage>) => Promise<Response>, | |
'segment:update': (ctx: Context, message: SegmentUpdateMessage) => Promise<Response>, | |
'scheduler:update': (ctx: Context) => Promise<Response>, | |
'status:update': (ctx: Context) => Promise<Response>, | |
//'clearbit:reveal': (ctx: Context, message: Array<UserMessage>, action: ActionParameters) => Promise<Response>, | |
})); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment