@erdoai/cli 0.84.0 → 0.85.0

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 +23 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1737,6 +1737,12 @@ async function resolveSecretInput(options) {
1737
1737
  return void 0;
1738
1738
  }
1739
1739
 
1740
+ // src/integrations.ts
1741
+ function formatIntegrationListRow(i) {
1742
+ const provided = i.provided_by_organization_slug ? ` provided by ${i.provided_by_organization_slug}` : "";
1743
+ return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${provided}`;
1744
+ }
1745
+
1740
1746
  // src/scope.ts
1741
1747
  import { Option } from "commander";
1742
1748
  var ORG_ENV = "ERDO_ORG";
@@ -6029,13 +6035,10 @@ filterCmd.command("list <slug>").description("List the default filters on a data
6029
6035
  }
6030
6036
  });
6031
6037
  var integrationsCmd = program.command("integrations").description("Connect and inspect integrations");
6032
- integrationsCmd.command("list").description("List connected integrations").action(async () => {
6038
+ integrationsCmd.command("list").description("List connected integrations \u2014 app, status, auth type, name, then the connection's id (what --from-connection takes)").action(async () => {
6033
6039
  try {
6034
6040
  const { integrations } = await new ErdoClient().listIntegrations();
6035
- for (const i of integrations) {
6036
- const provided = i.provided_by_organization_slug ? ` provided by ${i.provided_by_organization_slug}` : "";
6037
- console.log(`${i.app} ${i.status} ${i.auth_type} ${i.name}${provided}`);
6038
- }
6041
+ for (const i of integrations) console.log(formatIntegrationListRow(i));
6039
6042
  } catch (e) {
6040
6043
  fail(e);
6041
6044
  }
@@ -6051,8 +6054,21 @@ integrationsCmd.command("apps [query]").description("Search connectable apps (na
6051
6054
  integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass its API key or other credentials with -c, or omit them to get a browser connect URL for OAuth apps").option("-c, --credential <key=value...>", "credential field, e.g. -c api_key=\u2026 (repeatable); rejected by OAuth apps, which have no credential to pass", (v, acc) => acc.concat(v), []).option("-n, --name <name>", "display name for the connection").option("--rotate", "replace the credentials of the app's existing connection instead of adding a second one \u2014 for a key that was rotated at the provider; requires -c").option("--share", "share the connection with the whole organization instead of keeping it private to you \u2014 for org-level credentials teammates and agents should see").option(
6052
6055
  "--provide-to-managed",
6053
6056
  "let the organizations you manage use this connection as if it were their own \u2014 for a vendor key your agency pays for. Key-authenticated native integrations only, connected in a manager organization"
6057
+ ).option(
6058
+ "--from-connection <integration-id>",
6059
+ "reuse a credential you verifiably supplied \u2014 find its connection id in column 5 of `erdo integrations list --org <that-org>`. The credential is copied inside Erdo and never shown. Legacy keys without supplier records require an authenticated credential update"
6054
6060
  ).action(async (app, opts) => {
6055
6061
  try {
6062
+ if (opts.fromConnection && opts.credential.length) {
6063
+ fail(new Error("pass either -c or --from-connection, not both \u2014 otherwise the connection would hold a credential you did not choose"));
6064
+ }
6065
+ if (opts.fromConnection && opts.rotate) {
6066
+ fail(
6067
+ new Error(
6068
+ "--from-connection creates a new connection from a credential you already hold, so it cannot be combined with --rotate, which replaces the credential on an existing one"
6069
+ )
6070
+ );
6071
+ }
6056
6072
  let credentials;
6057
6073
  if (opts.credential.length) {
6058
6074
  credentials = {};
@@ -6068,7 +6084,8 @@ integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass
6068
6084
  credentials,
6069
6085
  rotate_credentials: opts.rotate || void 0,
6070
6086
  share_with_org: opts.share || void 0,
6071
- managed_access: opts.provideToManaged ? "managed_organizations" : void 0
6087
+ managed_access: opts.provideToManaged ? "managed_organizations" : void 0,
6088
+ credentials_from_integration_id: opts.fromConnection || void 0
6072
6089
  });
6073
6090
  print(res);
6074
6091
  const notes = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.84.0",
3
+ "version": "0.85.0",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {