@withjoy/sdk-js
Version:
Joy Javascript SDK
62 lines (61 loc) • 1.8 kB
TypeScript
import { JWT } from "../jwt";
/**
* Wraps around Auth0 IdToken, but its a access token for our service apis
* @type {Function}
*/
export declare class AccessToken extends JWT {
private tokenObj;
private _clientId;
constructor(clientId: any, tokenObj: any);
static fromAuthorizationHeader(authHeader: any): AccessToken;
/**
* Generate a new access token - auth0 style!
* @param payload
* @param options
* @param secret
* @returns {AccessToken}
*/
fromPayloadOptionsAndSecret(payload: any, options: any, secret: any): AccessToken;
/**
* Gets the internal tokenObj struct which can be used to later reconstrict this object
*/
getTokenObject(): any;
/**
* Returns the type of token, e.g. "Bearer"
* @returns {token_type}
*/
type(): any;
/**
* Returns a string which can be used in as a value in the authorization header
* @returns {string}
*/
authorizationString(): string;
/**
* Returns the client id to which this token belongs.
* @returns {String}
*/
clientId(): string;
getInfo(callback: any): void;
getAppToken(dstClientId: any, apiType: any, callback: any): void;
}
/**
* Wraps around Auth0 RefreshToken
* @type {Function}
*/
export declare class RefreshToken {
private refreshToken;
constructor(refreshToken: any);
/**
* Converts the refreshToken object into a idToken object
* @param srcClientId
* @param dstClientId
* @param callback(err, auth0IdToken)
* @returns {*}
*/
generateIdToken(srcClientId: any, dstClientId: any, callback: any): void;
/**
* Gets the refresh token string
* @returns {*}
*/
token(): any;
}