(row: ConnectionRow)
| 1113 | }; |
| 1114 | |
| 1115 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 1116 | const owner = row.owner as Owner; |
| 1117 | const integration = IntegrationSlug.make(row.integration); |
| 1118 | const name = ConnectionName.make(row.name); |
| 1119 | return { |
| 1120 | owner, |
| 1121 | name, |
| 1122 | integration, |
| 1123 | template: AuthTemplateSlug.make(row.template), |
| 1124 | provider: ProviderKey.make(row.provider), |
| 1125 | address: connectionAddress(owner, integration, name), |
| 1126 | identityLabel: row.identity_label ?? null, |
| 1127 | description: row.description ?? null, |
| 1128 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 1129 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 1130 | oauthClientOwner: |
| 1131 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 1132 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 1133 | missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state), |
| 1134 | lastHealth: presentedLastHealth(row), |
| 1135 | }; |
| 1136 | }; |
| 1137 | |
| 1138 | /** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the |
| 1139 | * token endpoint) into the credential's `grantedScopes`. Undefined when the |
no test coverage detected