52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
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;
|
|
}
|
|
/**
|
|
* Client config from /auth/skill-credit/client-config
|
|
*/
|
|
export interface ClientConfig {
|
|
clientId: string;
|
|
name: string;
|
|
status: string;
|
|
metadata: Record<string, unknown>;
|
|
}
|
|
/**
|
|
* 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
|