@sasjs/cli
Version:
Command line interface for SASjs
29 lines (28 loc) • 1.53 kB
TypeScript
import { ServerType, Target } from '@sasjs/utils';
import SASjs from '@sasjs/adapter/node';
export declare const getAuthUrl: (serverType: ServerType, serverUrl: string, clientId: string) => string;
export declare function getAuthCode(authUrl: string): Promise<string>;
/**
* Checks if the Access Token is expired or is expiring in 1 hour. A default Access Token
* lasts 12 hours. If the Access Token expires, the Refresh Token is used to fetch a new
* Access Token. In the case that the Refresh Token is expired, 1 hour is enough to let
* most jobs finish.
* @param {string} token- token string that will be evaluated
*/
export declare function isAccessTokenExpiring(token: string): boolean;
/**
* Checks if the Refresh Token is expired or expiring in 30 secs. A default Refresh Token
* lasts 30 days. Once the Refresh Token expires, the user must re-authenticate (provide
* credentials in a browser to obtain an authorisation code). 30 seconds is enough time
* to make a request for a final Access Token.
* @param {string} token- token string that will be evaluated
*/
export declare function isRefreshTokenExpiring(token?: string): boolean;
export declare function refreshTokens(sasjsInstance: SASjs, clientId: string, clientSecret: string, refreshToken: string): Promise<{
access_token: string;
refresh_token: string;
}>;
export declare function getNewAccessToken(sasjsInstance: SASjs, clientId: string, clientSecret: string, target: Target): Promise<{
access_token: string;
refresh_token: string;
}>;