(row: ConnectionRow)
| 798 | Option.getOrNull(decodeOAuthReauthRequiredProviderState(decodeJsonColumn(value))); |
| 799 | |
| 800 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 801 | const owner = row.owner as Owner; |
| 802 | const integration = IntegrationSlug.make(row.integration); |
| 803 | const name = ConnectionName.make(row.name); |
| 804 | return { |
| 805 | owner, |
| 806 | name, |
| 807 | integration, |
| 808 | template: AuthTemplateSlug.make(row.template), |
| 809 | provider: ProviderKey.make(row.provider), |
| 810 | address: connectionAddress(owner, integration, name), |
| 811 | identityLabel: row.identity_label ?? null, |
| 812 | description: row.description ?? null, |
| 813 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 814 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 815 | oauthClientOwner: |
| 816 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 817 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 818 | missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state), |
| 819 | lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)), |
| 820 | }; |
| 821 | }; |
| 822 | |
| 823 | /** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the |
| 824 | * token endpoint) into the credential's `grantedScopes`. Undefined when the |
no test coverage detected