(connection: Connection, verbose: boolean)
| 392 | /** Lean projection for `connections.list`. Summarizes `oauthScope` and health |
| 393 | * diagnostics unless `verbose`, where the full grant string is included too. */ |
| 394 | const connectionToListItem = (connection: Connection, verbose: boolean) => ({ |
| 395 | owner: connection.owner, |
| 396 | name: String(connection.name), |
| 397 | integration: String(connection.integration), |
| 398 | template: String(connection.template), |
| 399 | provider: String(connection.provider), |
| 400 | address: String(connection.address), |
| 401 | identityLabel: connection.identityLabel ?? null, |
| 402 | description: connection.description ?? null, |
| 403 | expiresAt: connection.expiresAt ?? null, |
| 404 | oauthClient: connection.oauthClient == null ? null : String(connection.oauthClient), |
| 405 | oauthClientOwner: connection.oauthClientOwner ?? null, |
| 406 | oauthScopeCount: oauthScopeCount(connection.oauthScope), |
| 407 | // Keep full probe diagnostics behind the explicit verbose opt-in. |
| 408 | lastHealth: |
| 409 | connection.lastHealth == null || verbose |
| 410 | ? (connection.lastHealth ?? null) |
| 411 | : { |
| 412 | status: connection.lastHealth.status, |
| 413 | ...(connection.lastHealth.identity !== undefined |
| 414 | ? { identity: connection.lastHealth.identity } |
| 415 | : {}), |
| 416 | checkedAt: connection.lastHealth.checkedAt, |
| 417 | }, |
| 418 | ...(verbose ? { oauthScope: connection.oauthScope ?? null } : {}), |
| 419 | }); |
| 420 | |
| 421 | const toolToOutput = (toolRow: Tool) => ({ |
| 422 | address: String(toolRow.address), |
no test coverage detected