UNPKG

lazada-iop-client

Version:

Lazada IOP Client SDK for Node JS

33 lines (32 loc) 1.07 kB
declare const APIGateway: Record<string, string>; interface LazadaClientOptions { apiKey: string; apiSecret: string; region: keyof typeof APIGateway; callbackUrl: string; debug?: boolean; } declare class LazadaClient { private apiKey; private apiSecret; private region; private callbackUrl; private sysParams; private apiParams; private fileParams; private debug; constructor({ apiKey, apiSecret, region, callbackUrl, debug, }: LazadaClientOptions); private generateTimestamp; private getSysParams; setAccessToken(token: string): this; changeRegion(region: keyof typeof APIGateway): this; addAPIParam(key: string, val: string | number): this; addFileParam(key: string, val: Buffer): this; setCallbackUrl(url: string): void; makeAuthURL(): string; requestToken(code: string): Promise<any>; private sign; private getServerURL; execute(apiPath: string, apiMethod?: "GET" | "POST", bodyParams?: Record<string, string | number>): Promise<any>; } export default LazadaClient;