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

Function connectionToListItem

packages/core/sdk/src/core-tools.ts:386–400  ·  view source on GitHub ↗
(connection: Connection, verbose: boolean)

Source from the content-addressed store, hash-verified

384/** Lean projection for `connections.list`. Summarizes `oauthScope` to a count
385 * unless `verbose`, where the full grant string is included too. */
386const connectionToListItem = (connection: Connection, verbose: boolean) => ({
387 owner: connection.owner,
388 name: String(connection.name),
389 integration: String(connection.integration),
390 template: String(connection.template),
391 provider: String(connection.provider),
392 address: String(connection.address),
393 identityLabel: connection.identityLabel ?? null,
394 description: connection.description ?? null,
395 expiresAt: connection.expiresAt ?? null,
396 oauthClient: connection.oauthClient == null ? null : String(connection.oauthClient),
397 oauthClientOwner: connection.oauthClientOwner ?? null,
398 oauthScopeCount: oauthScopeCount(connection.oauthScope),
399 ...(verbose ? { oauthScope: connection.oauthScope ?? null } : {}),
400});
401
402const toolToOutput = (toolRow: Tool) => ({
403 address: String(toolRow.address),

Callers 1

core-tools.tsFile · 0.85

Calls 1

oauthScopeCountFunction · 0.85

Tested by

no test coverage detected