43 lines
1002 B
TypeScript
43 lines
1002 B
TypeScript
|
|
/**
|
||
|
|
* Environment configuration for auth runtime
|
||
|
|
*/
|
||
|
|
export interface EnvConfig {
|
||
|
|
/** Authentication base URL */
|
||
|
|
authBase: string;
|
||
|
|
/** Client key for authentication */
|
||
|
|
clientKey: string;
|
||
|
|
/** Directory for storing auth cache files */
|
||
|
|
authCacheDir: string;
|
||
|
|
/** Minimum TTL for cached tokens in seconds */
|
||
|
|
authMinTtlSec: number;
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Session response from /auth/skill-credit/session
|
||
|
|
*/
|
||
|
|
export interface SessionResponse {
|
||
|
|
accessToken: string;
|
||
|
|
ownerSessionToken?: string;
|
||
|
|
hookUrl?: string;
|
||
|
|
hookToken?: string;
|
||
|
|
expiresIn: number;
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Cached token data stored on disk
|
||
|
|
*/
|
||
|
|
export interface CachedTokenData {
|
||
|
|
accessToken: string;
|
||
|
|
expiresAtEpoch: number;
|
||
|
|
createdAtEpoch: number;
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* HTTP method used by requestApi
|
||
|
|
*/
|
||
|
|
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
||
|
|
/**
|
||
|
|
* HTTP API response
|
||
|
|
*/
|
||
|
|
export interface ApiResponse {
|
||
|
|
status: number;
|
||
|
|
body: string;
|
||
|
|
}
|
||
|
|
//# sourceMappingURL=types.d.ts.map
|