(row: ConnectionRow)
| 836 | Option.getOrNull(decodeOAuthReauthRequiredProviderState(decodeJsonColumn(value))); |
| 837 | |
| 838 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 839 | const owner = row.owner as Owner; |
| 840 | const integration = IntegrationSlug.make(row.integration); |
| 841 | const name = ConnectionName.make(row.name); |
| 842 | return { |
| 843 | owner, |
| 844 | name, |
| 845 | integration, |
| 846 | template: AuthTemplateSlug.make(row.template), |
| 847 | provider: ProviderKey.make(row.provider), |
| 848 | address: connectionAddress(owner, integration, name), |
| 849 | identityLabel: row.identity_label ?? null, |
| 850 | description: row.description ?? null, |
| 851 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 852 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 853 | oauthClientOwner: |
| 854 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 855 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 856 | missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state), |
| 857 | lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)), |
| 858 | }; |
| 859 | }; |
| 860 | |
| 861 | /** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the |
| 862 | * token endpoint) into the credential's `grantedScopes`. Undefined when the |
no test coverage detected