(options: KimiOAuthToolkitOptions<TConfig>)
| 115 | private _identityHeaders: Record<string, string> | undefined; |
| 116 | |
| 117 | constructor(options: KimiOAuthToolkitOptions<TConfig>) { |
| 118 | this.identity = |
| 119 | options.identity === undefined ? undefined : assertKimiHostIdentity(options.identity); |
| 120 | this.homeDir = options.homeDir ?? defaultKimiHome(); |
| 121 | const credentialsDir = options.credentialsDir ?? join(this.homeDir, 'credentials'); |
| 122 | this.storage = options.storage ?? new FileTokenStorage(credentialsDir); |
| 123 | this.flowConfig = options.flowConfig ?? KIMI_CODE_FLOW_CONFIG; |
| 124 | this.configAdapter = options.configAdapter; |
| 125 | this.fetchImpl = options.fetchImpl; |
| 126 | this.managerOptions = { |
| 127 | now: options.now, |
| 128 | sleep: options.sleep, |
| 129 | deviceCodeTimeoutMs: options.deviceCodeTimeoutMs, |
| 130 | refreshThreshold: options.refreshThreshold, |
| 131 | onRefresh: options.onRefresh, |
| 132 | }; |
| 133 | } |
| 134 | |
| 135 | async status( |
| 136 | providerName?: string | undefined, |
nothing calls this directly
no test coverage detected