(row: ConnectionRow)
| 559 | }; |
| 560 | |
| 561 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 562 | const owner = row.owner as Owner; |
| 563 | const integration = IntegrationSlug.make(row.integration); |
| 564 | const name = ConnectionName.make(row.name); |
| 565 | return { |
| 566 | owner, |
| 567 | name, |
| 568 | integration, |
| 569 | template: AuthTemplateSlug.make(row.template), |
| 570 | provider: ProviderKey.make(row.provider), |
| 571 | address: connectionAddress(owner, integration, name), |
| 572 | identityLabel: row.identity_label ?? null, |
| 573 | description: row.description ?? null, |
| 574 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 575 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 576 | oauthClientOwner: |
| 577 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 578 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 579 | missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state), |
| 580 | lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)), |
| 581 | }; |
| 582 | }; |
| 583 | |
| 584 | /** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the |
| 585 | * token endpoint) into the credential's `grantedScopes`. Undefined when the |
no test coverage detected