@dodgeball/trust-sdk-client
Version:
Dodgeball Client SDK
57 lines (56 loc) • 2.35 kB
TypeScript
import { Method } from "axios";
import { IDodgeballVerifyResponse, IFingerprint, IInitConfig, IStepResponse, IVerification } from "./types";
interface IRequestParams {
url: string;
method: Method;
headers: any;
data: any;
}
interface IGetInitializationConfigParams {
url: string;
version: string;
token: string;
}
interface IGetSourceTokenParams {
url: string;
version: string;
token: string;
sourceToken?: string | null;
fingerprints: IFingerprint[];
}
interface IExpireSourceTokenParams {
url: string;
version: string;
token: string;
sourceToken: string;
}
interface IAttachSourceTokenMetadata {
url: string;
version: string;
token: string;
sourceToken: string;
metadata: {
[key: string]: any;
};
}
export declare const sleep: (ms: number) => Promise<unknown>;
export declare const makeRequest: ({ url, method, headers, data, }: IRequestParams) => Promise<any>;
export declare const constructApiUrl: (url: string, version: string) => string;
export declare const constructApiHeaders: (token: string, sourceToken?: string | null | undefined) => {
[key: string]: string;
};
export declare const getInitializationConfig: ({ url, token, version, }: IGetInitializationConfigParams) => Promise<IInitConfig>;
export declare const sendGetSourceToken: ({ url, token, version, sourceToken, fingerprints, }: IGetSourceTokenParams) => Promise<{
token: string;
expiry: number;
}>;
export declare const sendExpireSourceToken: ({ url, token, version, sourceToken, }: IExpireSourceTokenParams) => Promise<{
token: string;
expiry: number;
}>;
export declare const attachSourceTokenMetadata: ({ url, token, version, sourceToken, metadata, }: IAttachSourceTokenMetadata) => Promise<any>;
export declare const queryVerification: (url: string, token: string, version: string, verification: IVerification) => Promise<IDodgeballVerifyResponse>;
export declare const setVerificationResponse: (url: string, token: string, sourceToken: string, version: string, verification: IVerification, verificationStepId: string, stepResponse: IStepResponse) => Promise<any>;
export declare const loadScript: (url: string) => Promise<void>;
export declare const getMd5: (str: string | string[]) => string;
export {};