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
41 lines (36 loc) · 1.19 KB
/
Copy pathtypes.ts
File metadata and controls
41 lines (36 loc) · 1.19 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
38
39
40
41
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 type ResolvedRetryPolicy = RetryPolicy;
export interface ResolvedLilySdkConfig {
baseUrl: URL;
apiKey?: string;
authToken?: string;
timeoutMs: number;
retry: ResolvedRetryPolicy;
defaultHeaders: Record<string, string>;
userAgent: string;
fetch: typeof globalThis.fetch;
validateResponses?: boolean;
/**
* Serializes the resolved auth credentials plus default headers into a
* plain header object. Returns a fresh object on every call.
* Optional so mock configs and older custom clients stay compatible;
* `resolveLilySdkConfig` always provides it.
*/
toHeaders?(): Record<string, string>;
}
export { resolveLilySdkConfig } from './resolve-config';