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

Function connectionToListItem

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

Source from the content-addressed store, hash-verified

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

Callers 1

core-tools.tsFile · 0.85

Calls 1

oauthScopeCountFunction · 0.85

Tested by

no test coverage detected