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

Function connectionToListItem

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

Source from the content-addressed store, hash-verified

393/** Lean projection for `connections.list`. Summarizes `oauthScope` and health
394 * diagnostics unless `verbose`, where the full grant string is included too. */
395const connectionToListItem = (connection: Connection, verbose: boolean) => ({
396 owner: connection.owner,
397 name: String(connection.name),
398 integration: String(connection.integration),
399 template: String(connection.template),
400 provider: String(connection.provider),
401 address: String(connection.address),
402 identityLabel: connection.identityLabel ?? null,
403 description: connection.description ?? null,
404 expiresAt: connection.expiresAt ?? null,
405 oauthClient: connection.oauthClient == null ? null : String(connection.oauthClient),
406 oauthClientOwner: connection.oauthClientOwner ?? null,
407 oauthScopeCount: oauthScopeCount(connection.oauthScope),
408 // Keep full probe diagnostics behind the explicit verbose opt-in.
409 lastHealth:
410 connection.lastHealth == null || verbose
411 ? (connection.lastHealth ?? null)
412 : {
413 status: connection.lastHealth.status,
414 ...(connection.lastHealth.identity !== undefined
415 ? { identity: connection.lastHealth.identity }
416 : {}),
417 checkedAt: connection.lastHealth.checkedAt,
418 },
419 ...(verbose ? { oauthScope: connection.oauthScope ?? null } : {}),
420});
421
422/** How long a non-healthy persisted verdict may be served to an agent before
423 * it is re-verified. Verdicts are sticky — nothing re-probes them between UI

Callers 1

core-tools.tsFile · 0.85

Calls 1

oauthScopeCountFunction · 0.85

Tested by

no test coverage detected