@obelisk/client
Version:
Typescript client to interact with Obelisk on a higher level than the regular ReST API calls.
50 lines (49 loc) • 1.17 kB
TypeScript
export interface Tokens {
/**
* PAT token. Used for communication with the Authorization server API.
*/
pat?: Token;
/**
* Refresh token linked to the PAT token.
*/
patRefresh?: Token;
/**
* RPT token. Used for communication with the Obelisk API.
*/
rpt?: Token;
/**
* Refresh token linked to the RPT token.
*/
rptRefresh?: Token;
/**
* ID token. Contains information about the user, gathered from the authentication process.
*/
idtoken?: Token;
/**
* Refresh token linke to the ID token.
*/
idtokenRefresh?: Token;
}
export declare class Token {
private token;
private parsedToken;
private expires_at;
/**
* Create a Token instance.
* @param token
*/
constructor(token: string);
/**
* Returnt the raw token as a hex string.
*/
getToken(): string;
/**
* Returns the parsed token as a JSON object.
*/
getParsedToken(): any;
/**
* Returns the expiration date in milliseconds.
*/
getExpiresAt(): number;
private decodeToken;
}