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

Function rowToConnection

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

Source from the content-addressed store, hash-verified

1061};
1062
1063const rowToConnection = (row: ConnectionRow): Connection => {
1064 const owner = row.owner as Owner;
1065 const integration = IntegrationSlug.make(row.integration);
1066 const name = ConnectionName.make(row.name);
1067 return {
1068 owner,
1069 name,
1070 integration,
1071 template: AuthTemplateSlug.make(row.template),
1072 provider: ProviderKey.make(row.provider),
1073 address: connectionAddress(owner, integration, name),
1074 identityLabel: row.identity_label ?? null,
1075 description: row.description ?? null,
1076 expiresAt: row.expires_at == null ? null : Number(row.expires_at),
1077 oauthClient: row.oauth_client == null ? null : OAuthClientSlug.make(String(row.oauth_client)),
1078 oauthClientOwner:
1079 row.oauth_client_owner == null ? null : (String(row.oauth_client_owner) as Owner),
1080 oauthScope: row.oauth_scope == null ? null : String(row.oauth_scope),
1081 missingOAuthScopes: missingOAuthScopesFromProviderState(row.provider_state),
1082 lastHealth: presentedLastHealth(row),
1083 };
1084};
1085
1086/** Parse a connection row's `oauth_scope` (space-delimited, as echoed by the
1087 * 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