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

Function rowToConnection

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

Source from the content-addressed store, hash-verified

1108};
1109
1110const rowToConnection = (row: ConnectionRow): Connection => {
1111 const owner = row.owner as Owner;
1112 const integration = IntegrationSlug.make(row.integration);
1113 const name = ConnectionName.make(row.name);
1114 return {
1115 owner,
1116 name,
1117 integration,
1118 template: AuthTemplateSlug.make(row.template),
1119 provider: ProviderKey.make(row.provider),
1120 address: connectionAddress(owner, integration, name),
1121 identityLabel: row.identity_label ?? null,
1122 description: row.description ?? null,
1123 expiresAt: row.expires_at == null ? null : Number(row.expires_at),
1124 oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)),
1125 oauthClientOwner:
1126 row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner),
1127 oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope),
1128 missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state),
1129 lastHealth: presentedLastHealth(row),
1130 };
1131};
1132
1133/** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the
1134 * 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 3

presentedLastHealthFunction · 0.85
connectionAddressFunction · 0.70

Tested by

no test coverage detected