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

Function rowToConnection

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

Source from the content-addressed store, hash-verified

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

Callers 4

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

Calls 2

connectionAddressFunction · 0.85

Tested by

no test coverage detected