@erdoai/cli 0.148.2 → 0.149.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 +49 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -691,6 +691,16 @@ var ErdoClient = class {
|
|
|
691
691
|
`/v1/voice/phone-numbers/${encodeURIComponent(number)}/sms`
|
|
692
692
|
);
|
|
693
693
|
}
|
|
694
|
+
// Registering a number for WhatsApp, or with sharedWith ("managed_organizations"
|
|
695
|
+
// or "none") changing only who else may send from an approved WhatsApp
|
|
696
|
+
// sender. Either files the same approval card the gateway files.
|
|
697
|
+
provisionVoicePhoneNumberWhatsApp(number, sharedWith) {
|
|
698
|
+
const qs = sharedWith ? `?shared_with=${encodeURIComponent(sharedWith)}` : "";
|
|
699
|
+
return this.request(
|
|
700
|
+
"POST",
|
|
701
|
+
`/v1/voice/phone-numbers/${encodeURIComponent(number)}/whatsapp${qs}`
|
|
702
|
+
);
|
|
703
|
+
}
|
|
694
704
|
// The organization's caller name and what each number shows when it calls.
|
|
695
705
|
// Read from Erdo's own record; nothing here reaches the provider.
|
|
696
706
|
getVoiceCallerName() {
|
|
@@ -5327,7 +5337,10 @@ function renderAttentionItemReport(item, report) {
|
|
|
5327
5337
|
}
|
|
5328
5338
|
}
|
|
5329
5339
|
}
|
|
5330
|
-
attnCmd.command("list").description("List attention items").option(
|
|
5340
|
+
attnCmd.command("list").description("List attention items").option(
|
|
5341
|
+
"--status <status...>",
|
|
5342
|
+
"open | answered | dismissed (a person closed it) | cleared (the system closed it: the condition went away) | expired"
|
|
5343
|
+
).option("--open", "shorthand for --status open").option("--engine-actions", "only engine-generated items").option("--item <idOrSlug>", "read one item: its slug or its uuid").option("--org <slug>", "read another organization's feed \u2014 yours, or a client you manage").option(
|
|
5331
5344
|
"--subject-kind <kind>",
|
|
5332
5345
|
"only items about this kind of thing: google_ads_campaign | meta_ads_campaign | google_ads_ad_group | google_ads_ad | page | dataset | workstream"
|
|
5333
5346
|
).option("--subject-id <id>", "with --subject-kind, only items about this exact subject").option("-n, --limit <n>", "max items", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).option("--json", "output raw JSON").action(
|
|
@@ -6898,6 +6911,41 @@ voiceNumbersCmd.command("provision-sms <number>").description("Ask for A2P SMS r
|
|
|
6898
6911
|
fail(e);
|
|
6899
6912
|
}
|
|
6900
6913
|
});
|
|
6914
|
+
voiceNumbersCmd.command("provision-whatsapp <number>").description(
|
|
6915
|
+
"Ask for one of the organization's numbers to answer on WhatsApp, or with --share change who else may send from a number that is already a WhatsApp sender"
|
|
6916
|
+
).option(
|
|
6917
|
+
"--share <who>",
|
|
6918
|
+
"managed_organizations: let every organization this one manages fall back to this approved WhatsApp sender; none: stop. Changes only the sharing, never the registration or name"
|
|
6919
|
+
).option("--json", "print the raw JSON result instead of a summary").action(async (number, opts) => {
|
|
6920
|
+
try {
|
|
6921
|
+
const share = opts.share?.trim();
|
|
6922
|
+
if (share !== void 0 && share !== "managed_organizations" && share !== "none") {
|
|
6923
|
+
throw new Error('--share must be "managed_organizations" or "none"');
|
|
6924
|
+
}
|
|
6925
|
+
const res = await new ErdoClient().provisionVoicePhoneNumberWhatsApp(number, share);
|
|
6926
|
+
if (opts.json) {
|
|
6927
|
+
print(res);
|
|
6928
|
+
return;
|
|
6929
|
+
}
|
|
6930
|
+
if (res.status === "pending_approval") {
|
|
6931
|
+
console.log(
|
|
6932
|
+
share ? "Sharing has not changed yet \u2014 an approval card was filed and awaits a decision." : "Nothing has been registered yet \u2014 an approval card was filed and awaits a decision."
|
|
6933
|
+
);
|
|
6934
|
+
if (res.action_display) console.log(`action: ${res.action_display}`);
|
|
6935
|
+
if (res.approval_request_id) {
|
|
6936
|
+
console.log(`approval request: ${res.approval_request_id}`);
|
|
6937
|
+
console.log(` erdo approvals decide ${res.approval_request_id} --approve`);
|
|
6938
|
+
}
|
|
6939
|
+
} else if (res.status === "declined") {
|
|
6940
|
+
console.log("Nothing was filed: a person declined this same change recently.");
|
|
6941
|
+
} else {
|
|
6942
|
+
console.log(share ? `Sharing ${res.status}.` : `Registration ${res.status}.`);
|
|
6943
|
+
if (res.registration) print(res.registration);
|
|
6944
|
+
}
|
|
6945
|
+
} catch (e) {
|
|
6946
|
+
fail(e);
|
|
6947
|
+
}
|
|
6948
|
+
});
|
|
6901
6949
|
function printCallAttestationNote(attestation) {
|
|
6902
6950
|
if (!attestation || attestation.status === "approved") return;
|
|
6903
6951
|
console.log("");
|