(row: ConnectionRow)
| 936 | Option.getOrNull(decodeOAuthReauthRequiredProviderState(decodeJsonColumn(value))); |
| 937 | |
| 938 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 939 | const owner = row.owner as Owner; |
| 940 | const integration = IntegrationSlug.make(row.integration); |
| 941 | const name = ConnectionName.make(row.name); |
| 942 | return { |
| 943 | owner, |
| 944 | name, |
| 945 | integration, |
| 946 | template: AuthTemplateSlug.make(row.template), |
| 947 | provider: ProviderKey.make(row.provider), |
| 948 | address: connectionAddress(owner, integration, name), |
| 949 | identityLabel: row.identity_label ?? null, |
| 950 | description: row.description ?? null, |
| 951 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 952 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 953 | oauthClientOwner: |
| 954 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 955 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 956 | missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state), |
| 957 | lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)), |
| 958 | }; |
| 959 | }; |
| 960 | |
| 961 | /** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the |
| 962 | * token endpoint) into the credential's `grantedScopes`. Undefined when the |
no test coverage detected