* Resolve the authentication token from options or environment.
(options: IntegrationsPullOptions)
| 41 | * Resolve the authentication token from options or environment. |
| 42 | */ |
| 43 | function resolveToken(options: IntegrationsPullOptions): string { |
| 44 | // Priority: --token flag > DEEPNOTE_TOKEN env var |
| 45 | const token = options.token ?? process.env[DEEPNOTE_TOKEN_ENV] |
| 46 | if (!token) { |
| 47 | throw new MissingTokenError() |
| 48 | } |
| 49 | return token |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Read existing integrations file as a YAML Document. |