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

Function rowToConnection

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

Source from the content-addressed store, hash-verified

797};
798
799const rowToConnection = (row: ConnectionRow): Connection => {
800 const owner = row.owner as Owner;
801 const integration = IntegrationSlug.make(row.integration);
802 const name = ConnectionName.make(row.name);
803 return {
804 owner,
805 name,
806 integration,
807 template: AuthTemplateSlug.make(row.template),
808 provider: ProviderKey.make(row.provider),
809 address: connectionAddress(owner, integration, name),
810 identityLabel: row.identity_label ?? null,
811 description: row.description ?? null,
812 expiresAt: row.expires_at == null ? null : Number(row.expires_at),
813 oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)),
814 oauthClientOwner:
815 row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner),
816 oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope),
817 missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state),
818 lastHealth: Option.getOrNull(decodeLastHealth(row.last_health)),
819 };
820};
821
822/** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the
823 * 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.70

Tested by

no test coverage detected