Skip to content

Instantly share code, notes, and snippets.

@michaloo
Forked from unity/interface.js
Created April 23, 2018 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaloo/a6fbbeb4b993a1b6691c89f8779046a1 to your computer and use it in GitHub Desktop.
Save michaloo/a6fbbeb4b993a1b6691c89f8779046a1 to your computer and use it in GitHub Desktop.
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