forked from Lilly-Protocol/lily-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
37 lines (33 loc) · 1.11 KB
/
Copy pathtypes.ts
File metadata and controls
37 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { RetryPolicy } from '../http/types';
export interface LilySdkConfig {
baseUrl?: string | URL;
apiKey?: string;
authToken?: string;
timeoutMs?: number;
retry?: Partial<RetryPolicy>;
defaultHeaders?: Record<string, string>;
userAgent?: string;
fetch?: typeof globalThis.fetch;
/** Enable runtime response validation for known models. Default: false. */
validateResponses?: boolean;
}
export interface LilySdkCreateOptions extends Omit<LilySdkConfig, 'baseUrl'> {
baseUrl?: string;
}
export interface ResolvedRetryPolicy extends RetryPolicy {}
export interface ResolvedLilySdkConfig {
readonly baseUrl: URL;
readonly apiKey?: string;
readonly authToken?: string;
readonly timeoutMs: number;
readonly retry: ResolvedRetryPolicy;
readonly defaultHeaders: Readonly<Record<string, string>>;
readonly userAgent: string;
readonly fetch: typeof globalThis.fetch;
readonly validateResponses?: boolean;
/**
* Serializes the resolved auth credentials plus default headers into a
* plain header object. Returns a fresh object on every call.
*/
toHeaders?(): Record<string, string>;
}