@erdoai/cli 0.178.1 → 0.179.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 +22 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -124,7 +124,7 @@ function parseCSV(text) {
124
124
 
125
125
  // src/index.ts
126
126
  import { password, select } from "@inquirer/prompts";
127
- import { Command as Command2, Option as Option2 } from "commander";
127
+ import { Argument, Command as Command2, Option as Option2 } from "commander";
128
128
 
129
129
  // src/config.ts
130
130
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -223,6 +223,7 @@ function resolveOrgId(account, override) {
223
223
  }
224
224
 
225
225
  // src/client.ts
226
+ var MEMBER_ACCESS_LEVELS = ["read_only", "full"];
226
227
  function formatOrg(name, slug) {
227
228
  if (name && slug) return `${name} (${slug})`;
228
229
  return name || slug || "";
@@ -1840,6 +1841,15 @@ var ErdoClient = class {
1840
1841
  listIntegrations() {
1841
1842
  return this.request("GET", "/v1/integrations");
1842
1843
  }
1844
+ // What teammates may do through a shared connection made with someone's own
1845
+ // login: `read_only` (the default) or `full`. The owner always has full access.
1846
+ setIntegrationMemberAccess(integrationId, memberAccess) {
1847
+ return this.request(
1848
+ "POST",
1849
+ `/v1/integrations/${encodeURIComponent(integrationId)}/member-access`,
1850
+ { member_access: memberAccess }
1851
+ );
1852
+ }
1843
1853
  // Start or stop lending a connection to the organizations this one manages.
1844
1854
  // `managed_organizations` names the orgs it now serves — empty when this org
1845
1855
  // manages nobody yet, which is a truthful answer rather than a failure.
@@ -2476,7 +2486,8 @@ function formatIntegrationListRow(i) {
2476
2486
  const unreadable = i.identity_unreadable ? " identity unreadable" : "";
2477
2487
  const unchecked = i.identity_unchecked ? " identity not checked" : "";
2478
2488
  const connectorAccount = i.connector_account_id ? ` connector_account_id=${i.connector_account_id}` : "";
2479
- return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${connectorAccount}${provided}${unreadable}${unchecked}`;
2489
+ const memberAccess = i.member_access ? ` members: ${i.member_access}` : "";
2490
+ return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${connectorAccount}${provided}${memberAccess}${unreadable}${unchecked}`;
2480
2491
  }
2481
2492
  function identityNotes(rows) {
2482
2493
  const notes = [];
@@ -9699,6 +9710,15 @@ Provided to ${orgs.length} organization${orgs.length === 1 ? "" : "s"}:`);
9699
9710
  fail(e);
9700
9711
  }
9701
9712
  });
9713
+ integrationsCmd.command("member-access").argument("<integration-id>").addArgument(new Argument("<member-access>", "read_only or full").choices(MEMBER_ACCESS_LEVELS)).description(
9714
+ "Set what teammates can do through a shared connection made with your login (connected apps and MCP servers such as GitHub): read_only lets them look things up, full also lets them make changes. You always keep full access"
9715
+ ).action(async (integrationId, memberAccess) => {
9716
+ try {
9717
+ print(await new ErdoClient().setIntegrationMemberAccess(integrationId, memberAccess));
9718
+ } catch (e) {
9719
+ fail(e);
9720
+ }
9721
+ });
9702
9722
  integrationsCmd.command("disconnect <app>").description("Disconnect an app \u2014 releases the stored credential and removes the connection; org admins can disconnect any of the org's connections").action(async (app) => {
9703
9723
  try {
9704
9724
  const client = new ErdoClient();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.178.1",
3
+ "version": "0.179.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {