@dodgeball/trust-sdk-server
Version:
83 lines (82 loc) • 2.05 kB
TypeScript
import { DodgeballLogLevel } from "./logger";
export declare enum DodgeballApiVersion {
v1 = "v1"
}
export declare enum VerificationStatus {
PENDING = "PENDING",
BLOCKED = "BLOCKED",
COMPLETE = "COMPLETE",
FAILED = "FAILED"
}
export declare enum VerificationOutcome {
APPROVED = "APPROVED",
DENIED = "DENIED",
PENDING = "PENDING",
ERROR = "ERROR"
}
export interface IDodgeballConfig {
apiVersion: DodgeballApiVersion;
apiUrl?: string;
logLevel?: DodgeballLogLevel;
isEnabled?: boolean;
}
export interface ICheckpointEvent {
ip: string;
data: {
[key: string]: any;
};
}
export interface ITrackEvent {
type: string;
data: {
[key: string]: any;
};
eventTime?: number;
}
export interface ITrackOptions {
event: ITrackEvent;
sessionId?: string;
userId?: string;
sourceToken?: string;
}
export interface ICheckpointResponseOptions {
sync?: boolean;
timeout?: number;
webhook?: {
url: string;
};
}
export interface ICheckpointOptions {
checkpointName: string;
event: ICheckpointEvent;
sourceToken?: string;
sessionId?: string;
userId?: string;
useVerificationId?: string;
options?: ICheckpointResponseOptions;
}
export interface IDodgeballVerification {
id: string;
status: VerificationStatus;
outcome: VerificationOutcome;
}
export interface IDodgeballCheckpointResponse {
success: boolean;
errors: IDodgeballApiError[];
version: DodgeballApiVersion;
verification?: IDodgeballVerification;
isTimeout?: boolean;
}
export interface IDodgeballApiError {
code: number;
message: string;
}
export declare class DodgeballMissingConfigError extends Error {
constructor(configName: string, value: any);
}
export declare class DodgeballInvalidConfigError extends Error {
constructor(configName: string, value: any, allowedValues: any[]);
}
export declare class DodgeballMissingParameterError extends Error {
constructor(parameter: string, value: any);
}