MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / rowToConnection

Function rowToConnection

packages/core/sdk/src/executor.ts:551–571  ·  view source on GitHub ↗
(row: ConnectionRow)

Source from the content-addressed store, hash-verified

549const decodeHealthCheckSpec = Schema.decodeUnknownOption(HealthCheckSpec);
550
551const 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. */

Callers 4

connectionsCreateFunction · 0.85
mintOAuthConnectionFunction · 0.85
connectionsGetFunction · 0.85
connectionsUpdateFunction · 0.85

Calls 1

connectionAddressFunction · 0.85

Tested by

no test coverage detected