Skip to content

Commit

Permalink
typing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bartes committed Dec 22, 2022
1 parent f6a809e commit 2158b3f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
22 changes: 17 additions & 5 deletions src/payload/models/filter_payload.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { IncomingHttpHeaders } from 'http2';

export interface FilterPayload {
export type FilterPayload = {
request_token: string;
event: string;
status?: string;
// deprecated
user?: {
id?: string;
email?: string;
phone?: string;
};
properties?: object;
properties?: { [key: string]: any };
context: {
ip: string;
headers: IncomingHttpHeaders | { [key: string]: string | boolean };
Expand All @@ -19,4 +19,16 @@ export interface FilterPayload {
phone?: string;
username?: string;
};
}
product?: any;
session?: {
id: string;
created_at?: string;
};
created_at?: string;
authentication_method?: {
type: string;
variant?: string;
email?: string;
phone?: string;
};
} & ({ event: string } | { type: string; status?: string });
24 changes: 18 additions & 6 deletions src/payload/models/log_payload.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
import type { IncomingHttpHeaders } from 'http2';

export interface LogPayload {
export type LogPayload = {
request_token?: string;
event: string;
status?: string;
// deprecated
user?: {
id?: string;
phone?: string;
email?: string;
registered_at?: string;
traits?: object;
traits?: { [key: string]: any };
name?: string;
address?: { [key: string]: any };
};
created_at?: string;
properties?: object;
properties?: { [key: string]: any };
context?: {
ip?: string;
headers: IncomingHttpHeaders | { [key: string]: string | boolean };
};
}
product?: any;
session?: {
id: string;
created_at?: string;
};
authentication_method?: {
type: string;
variant?: string;
email?: string;
phone?: string;
};
} & ({ event: string } | { type: string; status?: string });
22 changes: 17 additions & 5 deletions src/payload/models/risk_payload.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
import type { IncomingHttpHeaders } from 'http2';

export interface RiskPayload {
export type RiskPayload = {
request_token: string;
event: string;
status: string;
user: {
id: string;
phone?: string;
email?: string;
registered_at?: string;
traits?: object;
traits?: { [key: string]: any };
name?: string;
address?: { [key: string]: any };
};
properties?: object;
context: {
ip: string;
headers: IncomingHttpHeaders | { [key: string]: string | boolean };
};
}
created_at?: string;
product?: any;
session?: {
id: string;
created_at?: string;
};
authentication_method?: {
type: string;
variant?: string;
email?: string;
phone?: string;
};
} & ({ event: string } | { type: string; status?: string });

0 comments on commit 2158b3f

Please sign in to comment.