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

Function rowToConnection

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

Source from the content-addressed store, hash-verified

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