(options: SetupOptions)
| 134 | } |
| 135 | |
| 136 | async function resolveAuth(options: SetupOptions): Promise<AuthOptions | null> { |
| 137 | if (options.apiKey) return { mode: "api-key", apiKey: options.apiKey }; |
| 138 | if (options.oauth) return { mode: "oauth" }; |
| 139 | |
| 140 | const apiKey = await authenticateAndGenerateKey(); |
| 141 | if (!apiKey) return null; |
| 142 | return { mode: "api-key", apiKey }; |
| 143 | } |
| 144 | |
| 145 | async function resolveMode(options: SetupOptions): Promise<SetupMode> { |
| 146 | if (options.cli) return "cli"; |
no test coverage detected