(
row: ConnectionRow,
)
| 2105 | * not OAuth-backed, or holding no refresh token — so the caller keeps the |
| 2106 | * upstream's own auth failure instead of inventing one. */ |
| 2107 | const forceRefreshConnectionValues = ( |
| 2108 | row: ConnectionRow, |
| 2109 | ): Effect.Effect< |
| 2110 | Record<string, string | null> | null, |
| 2111 | StorageFailure | CredentialResolutionError |
| 2112 | > => |
| 2113 | Effect.gen(function* () { |
| 2114 | if (row.oauth_client == null || row.refresh_item_id == null) return null; |
| 2115 | const provider = credentialProviders.get(row.provider); |
| 2116 | if (!provider) return null; |
| 2117 | const access = yield* refreshConnectionToken(row, provider, "reactive"); |
| 2118 | return { [PRIMARY_INPUT_VARIABLE]: access }; |
| 2119 | }); |
| 2120 | |
| 2121 | /** The primary (`token`) value — the public seam for OAuth + single-input |
| 2122 | * callers that only ever need one value. */ |
no test coverage detected