(row: ConnectionRow)
| 784 | }; |
| 785 | |
| 786 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 787 | const owner = row.owner as Owner; |
| 788 | const integration = IntegrationSlug.make(row.integration); |
| 789 | const name = ConnectionName.make(row.name); |
| 790 | return { |
| 791 | owner, |
| 792 | name, |
| 793 | integration, |
| 794 | template: AuthTemplateSlug.make(row.template), |
| 795 | provider: ProviderKey.make(row.provider), |
| 796 | address: connectionAddress(owner, integration, name), |
| 797 | identityLabel: row.identity_label ?? null, |
| 798 | description: row.description ?? null, |
| 799 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 800 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 801 | oauthClientOwner: |
| 802 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 803 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 804 | missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state), |
| 805 | lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)), |
| 806 | }; |
| 807 | }; |
| 808 | |
| 809 | /** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the |
| 810 | * token endpoint) into the credential's `grantedScopes`. Undefined when the |
no test coverage detected