(row: ConnectionRow)
| 549 | const decodeHealthCheckSpec = Schema.decodeUnknownOption(HealthCheckSpec); |
| 550 | |
| 551 | const rowToConnection = (row: ConnectionRow): Connection => { |
| 552 | const owner = row.owner as Owner; |
| 553 | const integration = IntegrationSlug.make(row.integration); |
| 554 | const name = ConnectionName.make(row.name); |
| 555 | return { |
| 556 | owner, |
| 557 | name, |
| 558 | integration, |
| 559 | template: AuthTemplateSlug.make(row.template), |
| 560 | provider: ProviderKey.make(row.provider), |
| 561 | address: connectionAddress(owner, integration, name), |
| 562 | identityLabel: row.identity_label ?? null, |
| 563 | description: row.description ?? null, |
| 564 | expiresAt: row.expires_at == null ? null : Number(row.expires_at), |
| 565 | oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)), |
| 566 | oauthClientOwner: |
| 567 | row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner), |
| 568 | oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope), |
| 569 | lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)), |
| 570 | }; |
| 571 | }; |
| 572 | |
| 573 | /** The canonical credential variable for a single-secret connection. OAuth tokens |
| 574 | * and the primary apiKey value resolve through it. */ |
no test coverage detected