24 lines
697 B
TypeScript
24 lines
697 B
TypeScript
/**
|
|
* Generate SHA256 hash for cache key
|
|
*/
|
|
export declare function sha256(input: string): string;
|
|
/**
|
|
* Get cache file path for current AUTH_BASE and CLIENT_KEY
|
|
*/
|
|
export declare function getCacheFile(authBase: string, clientKey: string, cacheDir: string): string;
|
|
/**
|
|
* Read cached token if valid
|
|
*/
|
|
export declare function readCachedToken(cacheFile: string, minTtlSec: number): string | null;
|
|
/**
|
|
* Write token to cache
|
|
*/
|
|
export declare function writeCache(cacheFile: string, sessionJson: {
|
|
accessToken: string;
|
|
expiresIn: number;
|
|
}): void;
|
|
/**
|
|
* Delete cache file if exists
|
|
*/
|
|
export declare function deleteCache(cacheFile: string): void;
|
|
//# sourceMappingURL=cache.d.ts.map
|