@erdoai/cli 0.178.0 → 0.178.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.
- package/dist/index.js +16 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1384,6 +1384,7 @@ var ErdoClient = class {
|
|
|
1384
1384
|
if (params?.scope) q.set("scope", params.scope);
|
|
1385
1385
|
if (params?.orderBy) q.set("order_by", params.orderBy);
|
|
1386
1386
|
if (params?.includeAutomation) q.set("include_automation", "true");
|
|
1387
|
+
if (params?.origin) q.set("origin", params.origin);
|
|
1387
1388
|
if (params?.limit !== void 0) q.set("limit", String(params.limit));
|
|
1388
1389
|
if (params?.offset !== void 0) q.set("offset", String(params.offset));
|
|
1389
1390
|
const qs = q.toString();
|
|
@@ -3308,10 +3309,21 @@ managed.command("list").description("List the client orgs your org manages").act
|
|
|
3308
3309
|
fail(e);
|
|
3309
3310
|
}
|
|
3310
3311
|
});
|
|
3311
|
-
managed.command("create").description("Provision a new client org managed by your org").requiredOption("--name <name>", "display name for the new managed org").option("--slug <slug>", "desired slug (a unique suffix is appended if it collides)").
|
|
3312
|
+
managed.command("create").description("Provision a new client org managed by your org").requiredOption("--name <name>", "display name for the new managed org").option("--slug <slug>", "desired slug (a unique suffix is appended if it collides, unless --exact-slug)").option(
|
|
3313
|
+
"--exact-slug",
|
|
3314
|
+
"make the call safe to retry: use --slug exactly as given; if you already manage an org with that slug it is returned and nothing is created, and a slug held by any other org is refused"
|
|
3315
|
+
).option("--timezone <iana>", "IANA timezone for the new org, e.g. Europe/London (default heartbeats run in it; UTC if omitted)").action(async (opts) => {
|
|
3312
3316
|
try {
|
|
3313
|
-
|
|
3314
|
-
|
|
3317
|
+
if (opts.exactSlug && !opts.slug) {
|
|
3318
|
+
throw new Error("--exact-slug needs --slug");
|
|
3319
|
+
}
|
|
3320
|
+
const o = await new ErdoClient().createManagedOrganization({
|
|
3321
|
+
name: opts.name,
|
|
3322
|
+
slug: opts.slug,
|
|
3323
|
+
exact_slug: opts.exactSlug ? true : void 0,
|
|
3324
|
+
timezone: opts.timezone
|
|
3325
|
+
});
|
|
3326
|
+
console.log(o.created ? `Created managed org: ${o.name}` : `Managed org already exists, nothing created: ${o.name}`);
|
|
3315
3327
|
console.log(`slug: ${o.slug}
|
|
3316
3328
|
id: ${o.id}`);
|
|
3317
3329
|
process.stderr.write(
|
|
@@ -4769,7 +4781,7 @@ async function resolveConversationPersona(client, selector) {
|
|
|
4769
4781
|
throw new Error(`No enabled agent matches "${selector}"`);
|
|
4770
4782
|
}
|
|
4771
4783
|
var conversationsCmd = program.command("threads").description("List and open conversations with people and named agents");
|
|
4772
|
-
conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
4784
|
+
conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("--origin <origin>", "person (default) | erdo (automation and Shortcut runs) | all \u2014 scope=org/shared only").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
4773
4785
|
try {
|
|
4774
4786
|
const { threads, total } = await new ErdoClient().listThreads(opts);
|
|
4775
4787
|
for (const thread of threads) {
|