@erdoai/cli 0.51.0 → 0.52.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.
- package/dist/index.js +15 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -103,6 +103,10 @@ function resolveOrgId(account, override) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// src/client.ts
|
|
106
|
+
function formatOrg(name, slug) {
|
|
107
|
+
if (name && slug) return `${name} (${slug})`;
|
|
108
|
+
return name || slug || "";
|
|
109
|
+
}
|
|
106
110
|
var TERMINAL_RUN_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled", "error"]);
|
|
107
111
|
var POLL_STOP_STATUSES = /* @__PURE__ */ new Set([...TERMINAL_RUN_STATUSES, "awaiting_approval"]);
|
|
108
112
|
var ErdoApiError = class extends Error {
|
|
@@ -1455,7 +1459,8 @@ program.command("logout [account]").description("Log out an account (default: th
|
|
|
1455
1459
|
program.command("whoami").description("Show the active account and org").action(async () => {
|
|
1456
1460
|
try {
|
|
1457
1461
|
const me = await new ErdoClient().me();
|
|
1458
|
-
|
|
1462
|
+
const org2 = formatOrg(me.organization_name, me.organization_slug) || me.organization_id;
|
|
1463
|
+
console.log(`${me.email || me.user_id} \u2014 org: ${org2}`);
|
|
1459
1464
|
} catch (e) {
|
|
1460
1465
|
fail(e);
|
|
1461
1466
|
}
|
|
@@ -3622,10 +3627,14 @@ integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass
|
|
|
3622
3627
|
}
|
|
3623
3628
|
const res = await new ErdoClient().connectIntegration({ app, name: opts.name, credentials });
|
|
3624
3629
|
print(res);
|
|
3630
|
+
const notes = [];
|
|
3631
|
+
const org2 = formatOrg(res.organization_name, res.organization_slug);
|
|
3632
|
+
if (org2) notes.push(`This connection belongs to ${org2}.`);
|
|
3625
3633
|
if (res.connect_url) {
|
|
3626
|
-
|
|
3627
|
-
Open this URL in a browser to authorize, then run: erdo integrations status ${app}`);
|
|
3634
|
+
notes.push(`Open this URL in a browser to authorize, then run: erdo integrations status ${app}`);
|
|
3628
3635
|
}
|
|
3636
|
+
if (notes.length) console.error(`
|
|
3637
|
+
${notes.join("\n")}`);
|
|
3629
3638
|
} catch (e) {
|
|
3630
3639
|
fail(e);
|
|
3631
3640
|
}
|
|
@@ -3703,10 +3712,12 @@ connectLinksCmd.command("create <app>").description("Mint a shareable connect li
|
|
|
3703
3712
|
integration_id: opts.integrationId
|
|
3704
3713
|
});
|
|
3705
3714
|
print(res);
|
|
3715
|
+
const linkOrg = formatOrg(res.organization_name, res.organization_slug);
|
|
3706
3716
|
process.stderr.write(
|
|
3707
3717
|
`
|
|
3708
3718
|
Share link_url with the person who holds the credentials. It expires ${res.expires_at} and completes once. Treat it as a secret \u2014 anyone with it can finish the connection.
|
|
3709
|
-
`
|
|
3719
|
+
` + (linkOrg ? `The connection they make will belong to ${linkOrg}.
|
|
3720
|
+
` : "")
|
|
3710
3721
|
);
|
|
3711
3722
|
} catch (e) {
|
|
3712
3723
|
fail(e);
|