@questlabs/core
Version:
This is the quest SDK
52 lines (51 loc) • 1.95 kB
TypeScript
import { IConstructor, IMakeRequest, ISetApiKeys, ISetEntity, ISetEntityAuthenticationToken, ISetEnvironment, ISetUser, ISetUserAgent, UserAgent } from "./types/questSdk.types";
import * as Core from "./modules/core";
import * as Abstract from "./modules/abstract";
import * as Social from "./modules/social";
export default class QuestSdk {
private apiKey;
private baseUrl;
private userAgent;
private stagingEnvironment;
private apiSecret?;
private userId?;
private token?;
private entityId?;
private entityAuthenticationToken?;
constructor({ apiKey, apiSecret, entityAuthenticationToken, stagingEnvironment, userAgent, entityId, platform, }: IConstructor);
makeRequest({ url, method, headers, queryParams, body, timeout }: IMakeRequest): Promise<any>;
setEntityId({ entityId }: ISetEntity): void;
getEntityId(): string | undefined;
setUser({ userId, token }: ISetUser): void;
getUser(): {
userId: string | undefined;
token: string | undefined;
};
setEnvironment({ stagingEnvironment }: ISetEnvironment): void;
getEnvironment(): {
stagingEnvironment: boolean;
};
isStagingEnvironment(): boolean;
setUserAgent({ userAgent }: ISetUserAgent): void;
getUserAgent(): UserAgent;
setEntityAuthenticationToken({ token }: ISetEntityAuthenticationToken): void;
getEntityAuthenticationToken(): string | undefined;
setApiKeys({ apiKey, apiSecret }: ISetApiKeys): void;
getApiKeys(): {
apiKey: string;
apiSecret: string | undefined;
};
getBaseUrl(): string;
captureSentryException(error: Error): void;
getDistinctId(): string;
generateDistinctId(): string;
getUrlInformation(): {
href: string;
host: string;
hostname: string;
origin: string;
pathname: string;
} | undefined;
getUserInfo(): Promise<any>;
}
export { Core, Abstract, Social };