ordercloud-javascript-sdk
Version:
The offical Javascript SDK for the Ordercloud ecommerce API
58 lines (57 loc) • 1.78 kB
TypeScript
declare class Tokens {
private accessTokenCookieName;
private impersonationTokenCookieName;
private refreshTokenCookieName;
private identityTokenCookieName;
private identityProviderAccessTokenCookieName;
private accessToken?;
private impersonationToken?;
private refreshToken?;
private identityToken?;
private identityProviderAccessToken?;
/**
* @ignore
* not part of public api, don't include in generated docs
*/
constructor();
/**
* Manage Access Tokens
*/
GetAccessToken(): string | undefined;
SetAccessToken(token: string): void;
RemoveAccessToken(): void;
/**
* Manage Impersonation Tokens
*/
GetImpersonationToken(): string | undefined;
SetImpersonationToken(token: string): void;
RemoveImpersonationToken(): void;
/**
* Manage Refresh Tokens
*/
GetRefreshToken(): string | undefined;
SetRefreshToken(token: string): void;
RemoveRefreshToken(): void;
/**
* Manage Identity Tokens
*/
GetIdentityToken(): string | undefined;
SetIdentityToken(token: string): void;
RemoveIdentityToken(): void;
/**
* Manage Identity Provider Tokens
*/
GetIdpAccessToken(): string | undefined;
SetIdpAccessToken(token: string): void;
RemoveIdpAccessToken(): void;
/**
* If no token is provided will attempt to get and validate token
* stored in sdk. If token is invalid or missing it will also attempt
* to refresh the token if possible
*/
GetValidToken(tokenToValidate?: string): Promise<string>;
private _isTokenExpired;
private _tryRefreshToken;
}
declare const _default: Tokens;
export default _default;