@erdoai/cli 0.104.0 → 0.104.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +45 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1397,6 +1397,15 @@ var ErdoClient = class {
1397
1397
  // organization lends to you rather than one this org connected. It is usable
1398
1398
  // exactly like your own for as long as the management link lives, and is not
1399
1399
  // yours to rotate or disconnect.
1400
+ //
1401
+ // `identity_unreadable` says why `account_id` is absent: the connection's
1402
+ // stored credential could not be read back, so the account could not be
1403
+ // resolved. An absent `account_id` WITHOUT it is the other fact — the
1404
+ // connection genuinely has no account recorded. Do not treat the two the
1405
+ // same; only the second one is a connection you can fix by setting an
1406
+ // account. `identity_unchecked` is a third fact: the lookup itself failed this
1407
+ // time (a transient failure), so nothing is known about the credential — list
1408
+ // again rather than reconnecting.
1400
1409
  listIntegrations() {
1401
1410
  return this.request("GET", "/v1/integrations");
1402
1411
  }
@@ -1946,7 +1955,40 @@ async function promptLine(question) {
1946
1955
  // src/integrations.ts
1947
1956
  function formatIntegrationListRow(i) {
1948
1957
  const provided = i.provided_by_organization_slug ? ` provided by ${i.provided_by_organization_slug}` : "";
1949
- return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${provided}`;
1958
+ const unreadable = i.identity_unreadable ? " identity unreadable" : "";
1959
+ const unchecked = i.identity_unchecked ? " identity not checked" : "";
1960
+ return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${provided}${unreadable}${unchecked}`;
1961
+ }
1962
+ function identityNotes(rows) {
1963
+ const notes = [];
1964
+ const unreadable = rows.filter((i) => i.identity_unreadable);
1965
+ const owned = unreadable.filter((i) => !i.provided_by_organization_slug);
1966
+ if (owned.length) {
1967
+ notes.push(
1968
+ `The stored credential could not be read for ${owned.length} connection(s): ${owned.map((i) => i.id).join(", ")} \u2014 their account is unknown rather than unset. Reconnect them to restore it.`
1969
+ );
1970
+ }
1971
+ const byManager = /* @__PURE__ */ new Map();
1972
+ for (const i of unreadable) {
1973
+ if (!i.provided_by_organization_slug) continue;
1974
+ const ids = byManager.get(i.provided_by_organization_slug) ?? [];
1975
+ ids.push(i.id);
1976
+ byManager.set(i.provided_by_organization_slug, ids);
1977
+ }
1978
+ for (const [manager, ids] of byManager) {
1979
+ notes.push(
1980
+ `The stored credential could not be read for ${ids.length} connection(s) provided by ${manager}: ${ids.join(
1981
+ ", "
1982
+ )} \u2014 their account is unknown rather than unset. Only ${manager} can reconnect them; ask an admin there.`
1983
+ );
1984
+ }
1985
+ const unchecked = rows.filter((i) => i.identity_unchecked);
1986
+ if (unchecked.length) {
1987
+ notes.push(
1988
+ `The account could not be checked for ${unchecked.length} connection(s) this time: ${unchecked.map((i) => i.id).join(", ")}. Nothing is known to be wrong with them; run the list again.`
1989
+ );
1990
+ }
1991
+ return notes;
1950
1992
  }
1951
1993
 
1952
1994
  // src/scope.ts
@@ -7417,6 +7459,8 @@ integrationsCmd.command("list").description("List connected integrations \u2014
7417
7459
  try {
7418
7460
  const { integrations } = await new ErdoClient().listIntegrations();
7419
7461
  for (const i of integrations) console.log(formatIntegrationListRow(i));
7462
+ for (const note of identityNotes(integrations)) process.stderr.write(`${note}
7463
+ `);
7420
7464
  } catch (e) {
7421
7465
  fail(e);
7422
7466
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.104.0",
3
+ "version": "0.104.1",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {