(
row: ConnectionRow,
)
| 2165 | * not OAuth-backed, or holding no refresh token — so the caller keeps the |
| 2166 | * upstream's own auth failure instead of inventing one. */ |
| 2167 | const forceRefreshConnectionValues = ( |
| 2168 | row: ConnectionRow, |
| 2169 | ): Effect.Effect< |
| 2170 | Record<string, string | null> | null, |
| 2171 | StorageFailure | CredentialResolutionError |
| 2172 | > => |
| 2173 | Effect.gen(function* () { |
| 2174 | if (row.oauth_client == null || row.refresh_item_id == null) return null; |
| 2175 | const provider = credentialProviders.get(row.provider); |
| 2176 | if (!provider) return null; |
| 2177 | const access = yield* refreshConnectionToken(row, provider, "reactive"); |
| 2178 | return { [PRIMARY_INPUT_VARIABLE]: access }; |
| 2179 | }); |
| 2180 | |
| 2181 | /** The primary (`token`) value — the public seam for OAuth + single-input |
| 2182 | * callers that only ever need one value. */ |
no test coverage detected