(jwt: JWT, forceRefresh = false)
| 80 | } |
| 81 | |
| 82 | async function getAccessToken(jwt: JWT, forceRefresh = false): Promise<string> { |
| 83 | if (forceRefresh) { |
| 84 | /** Clearing `credentials` forces `getAccessToken` to mint a new token instead of returning the cached one. */ |
| 85 | jwt.credentials = {} |
| 86 | } |
| 87 | const { token } = await jwt.getAccessToken() |
| 88 | if (!token) throw new Error('Failed to obtain BigQuery access token') |
| 89 | return token |
| 90 | } |
| 91 | |
| 92 | interface InsertAllInput { |
| 93 | config: BigQueryDestinationConfig |
no outgoing calls