@vatio-ai/cli 0.126.0 → 0.128.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/lib/api-client.mjs +2 -19
- package/lib/commands/channels.mjs +41 -71
- package/lib/commands/chat.mjs +5 -5
- package/lib/commands/webhooks.mjs +44 -5
- package/lib/help.mjs +13 -13
- package/lib/suggest.mjs +0 -1
- package/lib/telemetry.mjs +1 -1
- package/package.json +1 -1
package/lib/api-client.mjs
CHANGED
|
@@ -57,28 +57,10 @@ export class ApiClient extends HttpClient {
|
|
|
57
57
|
return this.get("/whatsapp/team");
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
moveTestPhone(phoneNumber) {
|
|
61
|
-
return this.post(`/test_phones/${encode(phoneNumber)}/move`, {});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
60
|
syncTemplates() {
|
|
65
61
|
return this.post("/templates/sync", {});
|
|
66
62
|
}
|
|
67
63
|
|
|
68
|
-
// The phones verified in Try the agent.
|
|
69
|
-
testPhones() {
|
|
70
|
-
return this.get("/test_phones");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// The code a phone sends to Vatio's shared number to join; it adds nothing by itself.
|
|
74
|
-
testPhoneCode() {
|
|
75
|
-
return this.post("/test_phones", {});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
removeTestPhone(phoneNumber) {
|
|
79
|
-
return this.delete(`/test_phones/${encode(phoneNumber)}`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
64
|
deployedManifest({ environment = "live" } = {}) {
|
|
83
65
|
return this.get("/manifest", { environment });
|
|
84
66
|
}
|
|
@@ -290,9 +272,10 @@ export class ApiClient extends HttpClient {
|
|
|
290
272
|
return this.get("/templates", { environment });
|
|
291
273
|
}
|
|
292
274
|
|
|
293
|
-
createTemplate({ name, language, category, body, examples = [], footer = null }) {
|
|
275
|
+
createTemplate({ name, language, category, body, examples = [], footer = null, buttons = [] }) {
|
|
294
276
|
const payload = { name, language, category, body, examples };
|
|
295
277
|
if (String(footer ?? "").trim() !== "") payload.footer = String(footer).trim();
|
|
278
|
+
if (buttons.length > 0) payload.buttons = buttons;
|
|
296
279
|
return this.post("/templates", payload);
|
|
297
280
|
}
|
|
298
281
|
|
|
@@ -15,7 +15,6 @@ const WHATSAPP_USAGE = [
|
|
|
15
15
|
"Usage: vatio whatsapp [status] [--json]",
|
|
16
16
|
" vatio whatsapp connect | live on|off | check [--pin PIN] | disconnect [--yes] | team",
|
|
17
17
|
" vatio whatsapp invite EMAIL [--code CODE | --recovery-code CODE]",
|
|
18
|
-
" vatio whatsapp phones [list] | add | rm PHONE | move PHONE [--json]",
|
|
19
18
|
" vatio whatsapp templates [list] | create NAME ... | rm NAME | sync",
|
|
20
19
|
" vatio whatsapp failed [--since DATE] [--until DATE] [--error-code CODE] ...",
|
|
21
20
|
].join("\n");
|
|
@@ -29,9 +28,16 @@ const MINE_REMOVED =
|
|
|
29
28
|
"`vatio whatsapp mine` was removed: the team's numbers are the ones each member verified on their account " +
|
|
30
29
|
"(Account in the inbox): vatio whatsapp team. A tool declares which role may use it with " +
|
|
31
30
|
"`access: supervisor`, `developer` or `owner`.";
|
|
31
|
+
// Test phones went the same way: the team reaches the agent on Vatio's number
|
|
32
|
+
// from the WhatsApp each verified on their account, and what is left, a
|
|
33
|
+
// customer's phone, is added in the inbox.
|
|
34
|
+
const phonesRemoved = (name) =>
|
|
35
|
+
`\`vatio whatsapp ${name}\` was removed: everyone on the team reaches the agent on Vatio's number from the ` +
|
|
36
|
+
"WhatsApp they verified on their account (vatio whatsapp team lists them). To try it as a customer, add a " +
|
|
37
|
+
"customer phone in the inbox: Conversations → Try the agent → WhatsApp.";
|
|
32
38
|
|
|
33
39
|
// One noun per thing on the inbox's WhatsApp page, each with the same verbs:
|
|
34
|
-
// the number itself,
|
|
40
|
+
// the number itself, the team on it, its templates and its failed messages.
|
|
35
41
|
export async function whatsapp(config, args = []) {
|
|
36
42
|
const json = takeFlag(args, "--json");
|
|
37
43
|
const sub = args.shift();
|
|
@@ -41,7 +47,7 @@ export async function whatsapp(config, args = []) {
|
|
|
41
47
|
case "status":
|
|
42
48
|
return status(config, client(), { json });
|
|
43
49
|
case "connect":
|
|
44
|
-
return inInbox(config,
|
|
50
|
+
return inInbox(config, WHATSAPP);
|
|
45
51
|
case "live": {
|
|
46
52
|
const value = args.shift();
|
|
47
53
|
if (!["on", "off"].includes(value) || args.length) fail(WHATSAPP_USAGE);
|
|
@@ -65,8 +71,6 @@ export async function whatsapp(config, args = []) {
|
|
|
65
71
|
return invite(client(), args, { json });
|
|
66
72
|
case "team":
|
|
67
73
|
return printTeam(await client().whatsappTeam(), { json });
|
|
68
|
-
case "phones":
|
|
69
|
-
return phones(config, client(), args, { json });
|
|
70
74
|
case "templates":
|
|
71
75
|
return templates(config, json ? [...args, "--json"] : args);
|
|
72
76
|
case "failed":
|
|
@@ -76,15 +80,27 @@ export async function whatsapp(config, args = []) {
|
|
|
76
80
|
return fail(AGENT_NUMBERS_REMOVED);
|
|
77
81
|
case "mine":
|
|
78
82
|
return fail(MINE_REMOVED);
|
|
83
|
+
case "phones":
|
|
79
84
|
case "test-phones":
|
|
80
|
-
return fail(
|
|
85
|
+
return fail(phonesRemoved(sub));
|
|
81
86
|
default:
|
|
82
87
|
return fail(WHATSAPP_USAGE);
|
|
83
88
|
}
|
|
84
89
|
}
|
|
85
90
|
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
const WHATSAPP = {
|
|
92
|
+
key: "whatsapp",
|
|
93
|
+
published: "Connect your own number in the inbox, on the WhatsApp page:",
|
|
94
|
+
draft: "Talk to your agent on WhatsApp with Try the agent in the inbox: verify your phone there once, and it " +
|
|
95
|
+
"reaches your agent on Vatio's number."
|
|
96
|
+
};
|
|
97
|
+
const INSTAGRAM = {
|
|
98
|
+
key: "instagram",
|
|
99
|
+
published: "Connect your own account and manage test accounts in the inbox, under Channels:",
|
|
100
|
+
draft: "Test Instagram with Try the agent in the inbox: verify your account there and talk to your agent."
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const instagram = (config) => inInbox(config, INSTAGRAM);
|
|
88
104
|
|
|
89
105
|
async function inInbox(config, channel) {
|
|
90
106
|
const status = await deployClient(config, config.resolveWorkspaceRequired()).deployStatus();
|
|
@@ -92,11 +108,7 @@ async function inInbox(config, channel) {
|
|
|
92
108
|
// An older server sends no `published`; a live deployment means the same.
|
|
93
109
|
const published = status.published ?? Boolean(status.live);
|
|
94
110
|
|
|
95
|
-
|
|
96
|
-
console.log(`Connect your own ${channel.own} and manage test ${channel.test}s in the inbox, under Channels:`);
|
|
97
|
-
} else {
|
|
98
|
-
console.log(`Test ${channel.name} with Try the agent in the inbox: verify your ${channel.test} there and talk to your agent.`);
|
|
99
|
-
}
|
|
111
|
+
console.log(published ? channel.published : channel.draft);
|
|
100
112
|
console.log(` ${published ? url : (status.try_url ?? url)}`);
|
|
101
113
|
}
|
|
102
114
|
|
|
@@ -110,61 +122,10 @@ async function status(config, client, { json }) {
|
|
|
110
122
|
if (json) return console.log(JSON.stringify(number ?? { connected: false }, null, 2));
|
|
111
123
|
// A number Meta refuses every send from comes before anything else.
|
|
112
124
|
if (number?.issue) printNumber(number);
|
|
113
|
-
await inInbox(config,
|
|
114
|
-
// A server that predates the route answers 404; the link above is enough.
|
|
115
|
-
const phones = await client.testPhones().catch((error) => {
|
|
116
|
-
if (error?.status !== 404 && error?.body?.error?.code !== "not_found") throw error;
|
|
117
|
-
return null;
|
|
118
|
-
});
|
|
119
|
-
if (phones) printPhones(phones);
|
|
125
|
+
await inInbox(config, WHATSAPP);
|
|
120
126
|
if (number && !number.issue) printNumber(number);
|
|
121
127
|
}
|
|
122
128
|
|
|
123
|
-
async function phones(config, client, args, { json }) {
|
|
124
|
-
const action = args.shift() ?? "list";
|
|
125
|
-
const phone = args.shift();
|
|
126
|
-
if (args.length) fail(WHATSAPP_USAGE);
|
|
127
|
-
if (action === "list" && !phone) {
|
|
128
|
-
const list = await client.testPhones();
|
|
129
|
-
return json ? console.log(JSON.stringify(list, null, 2)) : printPhones(list);
|
|
130
|
-
}
|
|
131
|
-
if (action === "add" && !phone) return printJoin(await client.testPhoneCode(), { json });
|
|
132
|
-
if (action === "rm" && phone) {
|
|
133
|
-
await client.removeTestPhone(phone);
|
|
134
|
-
return json ? console.log(JSON.stringify({ removed: phone })) : console.log(`Removed ${phone} from the test phones.`);
|
|
135
|
-
}
|
|
136
|
-
if (action === "move" && phone) {
|
|
137
|
-
const { data } = await client.moveTestPhone(phone);
|
|
138
|
-
return json ? console.log(JSON.stringify(data)) : console.log(`${data.phone_number} now tests this workspace.`);
|
|
139
|
-
}
|
|
140
|
-
fail(WHATSAPP_USAGE);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// The phones that joined by sending Try the agent's code: the ones a preview
|
|
144
|
-
// message can go to.
|
|
145
|
-
function printPhones({ data = [], max, elsewhere = [] }) {
|
|
146
|
-
if (data.length === 0) {
|
|
147
|
-
console.log("\nNo test phones yet. Add yours: vatio whatsapp phones add");
|
|
148
|
-
} else {
|
|
149
|
-
console.log(`\nTest phones (${data.length} of ${max}):`);
|
|
150
|
-
for (const phone of data) console.log(` ${phone.phone_number}`);
|
|
151
|
-
}
|
|
152
|
-
if (elsewhere.length) {
|
|
153
|
-
console.log("Verified on your other workspaces (vatio whatsapp phones move PHONE brings one here):");
|
|
154
|
-
for (const phone of elsewhere) console.log(` ${phone.phone_number} ${phone.workspace}`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// The same code Try the agent shows: the phone joins when it sends it, so the
|
|
159
|
-
// message is the proof that whoever added it holds the phone.
|
|
160
|
-
function printJoin(join, { json }) {
|
|
161
|
-
if (json) return console.log(JSON.stringify(join, null, 2));
|
|
162
|
-
console.log(`From the phone to add, send this to ${join.send_to ?? "Vatio's test number"} on WhatsApp:`);
|
|
163
|
-
console.log(` ${join.message}`);
|
|
164
|
-
if (join.link_url) console.log(`Or open this on the phone, it writes the message:\n ${join.link_url}`);
|
|
165
|
-
console.log(`The code works for ${Math.round((join.expires_in ?? 900) / 60)} minutes. Check with: vatio whatsapp phones`);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
129
|
async function disconnect(client, args, { json }) {
|
|
169
130
|
const yes = takeFlag(args, "--yes");
|
|
170
131
|
if (args.length) fail(WHATSAPP_USAGE);
|
|
@@ -178,9 +139,9 @@ async function disconnect(client, args, { json }) {
|
|
|
178
139
|
console.log("Disconnected. Connect a number again with: vatio whatsapp connect");
|
|
179
140
|
}
|
|
180
141
|
|
|
181
|
-
// The owner's: whoever
|
|
182
|
-
// connects it, and joins as a supervisor.
|
|
183
|
-
// `vatio team invite` is.
|
|
142
|
+
// The owner's: whoever manages the number (often a client) gets the link that
|
|
143
|
+
// connects it from their own Facebook account, and joins as a supervisor.
|
|
144
|
+
// Confirmed with a second factor, as `vatio team invite` is.
|
|
184
145
|
async function invite(client, args, { json }) {
|
|
185
146
|
const code = takeValue(args, "--code");
|
|
186
147
|
const recoveryCode = takeValue(args, "--recovery-code");
|
|
@@ -189,13 +150,22 @@ async function invite(client, args, { json }) {
|
|
|
189
150
|
const answer = await withSecondFactor((body) => client.inviteWhatsappConnector(body),
|
|
190
151
|
{ email, code, recovery_code: recoveryCode });
|
|
191
152
|
if (json) return console.log(JSON.stringify(answer, null, 2));
|
|
192
|
-
console.log(`Emailed ${answer.invited} the link that connects
|
|
153
|
+
console.log(`Emailed ${answer.invited} the link that connects the number (${answer.role} on the team).`);
|
|
154
|
+
console.log("Once they connect it, it arrives paused: vatio whatsapp live on turns it live.");
|
|
193
155
|
}
|
|
194
156
|
|
|
157
|
+
// Everyone on the team who talks to the agent, and the last digits of the
|
|
158
|
+
// WhatsApp each verified on their account: from it the agent knows them, and on
|
|
159
|
+
// Vatio's number it reaches this workspace. `number` is null until they do.
|
|
195
160
|
function printTeam({ members = [] }, { json }) {
|
|
196
161
|
if (json) return console.log(JSON.stringify(members, null, 2));
|
|
197
|
-
|
|
198
|
-
|
|
162
|
+
for (const member of members) {
|
|
163
|
+
const number = member.number ?? paint("cyan", "not verified");
|
|
164
|
+
console.log(` ${member.role.padEnd(11)} ${member.number ? number.padEnd(12) : number} ${member.name}`);
|
|
165
|
+
}
|
|
166
|
+
if (members.some((member) => !member.number)) {
|
|
167
|
+
console.log("Each person verifies their WhatsApp in the inbox, under Account.");
|
|
168
|
+
}
|
|
199
169
|
}
|
|
200
170
|
|
|
201
171
|
function printNumber(number, { json = false, checked = false } = {}) {
|
package/lib/commands/chat.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ever a second answer to keep in step with the true one.
|
|
8
8
|
//
|
|
9
9
|
// What you can be is someone who already proved who they are: `--as-phone`
|
|
10
|
-
// speaks as a phone verified on WhatsApp (yours, or a
|
|
10
|
+
// speaks as a phone verified on WhatsApp (yours, or a customer phone), and
|
|
11
11
|
// `--as-subject` signs the token your backend would, with your identity key,
|
|
12
12
|
// or `--visitor-token` brings one you have. Vatio only verifies them, as it
|
|
13
13
|
// does the widget's and WhatsApp's, so this gives you nothing you did not
|
|
@@ -50,7 +50,7 @@ export async function chat(config, args) {
|
|
|
50
50
|
if (REMOVED_FLAGS.some((flag) => arg === flag || arg.startsWith(`${flag}=`))) {
|
|
51
51
|
fail(
|
|
52
52
|
`\`${arg}\` was removed. A CLI chat is you, the developer holding the token, unless you say who: ` +
|
|
53
|
-
"--as-phone speaks as your verified WhatsApp (me) or a
|
|
53
|
+
"--as-phone speaks as your verified WhatsApp (me) or a customer phone, --as-subject ID signs a visitor in " +
|
|
54
54
|
"with your identity key, and --visitor-token brings a token you have; " +
|
|
55
55
|
"to pick a deployment use --env."
|
|
56
56
|
);
|
|
@@ -153,9 +153,9 @@ conversations running side by side, each command names its own.
|
|
|
153
153
|
|
|
154
154
|
\`--as-phone\` opens a preview chat that speaks as a phone, for tools that
|
|
155
155
|
need $contact.phone_number or a team role (access: supervisor and up): \`me\`
|
|
156
|
-
is your own verified WhatsApp, with your role on the team;
|
|
157
|
-
|
|
158
|
-
to WhatsApp.
|
|
156
|
+
is your own verified WhatsApp, with your role on the team; one of the
|
|
157
|
+
workspace's customer phones (added in the inbox, under Conversations → Try the
|
|
158
|
+
agent → WhatsApp) is a customer. It stays a CLI chat: nothing goes to WhatsApp.
|
|
159
159
|
|
|
160
160
|
\`export\` prints what people said and what they were answered between two
|
|
161
161
|
dates (live unless --env says otherwise), one conversation per line as JSON,
|
|
@@ -18,7 +18,8 @@ function takeAll(args, name) {
|
|
|
18
18
|
|
|
19
19
|
const LIST_USAGE = "vatio whatsapp templates list [--env live] [--json]";
|
|
20
20
|
const CREATE_USAGE = "vatio whatsapp templates create NAME --language CODE --body TEXT [--example VALUE]... " +
|
|
21
|
-
"[--category utility|marketing] [--footer TEXT] [--
|
|
21
|
+
"[--category utility|marketing] [--footer TEXT] [--button-url 'TEXT|URL']... [--button-example VALUE]... " +
|
|
22
|
+
"[--button-phone 'TEXT|PHONE'] [--button-quick-reply TEXT]... [--json]";
|
|
22
23
|
const RM_USAGE = "vatio whatsapp templates rm NAME [--language CODE] [--json]";
|
|
23
24
|
const SYNC_USAGE = "vatio whatsapp templates sync [--json]";
|
|
24
25
|
|
|
@@ -69,14 +70,16 @@ export async function templates(config, args) {
|
|
|
69
70
|
const count = template.parameter_count ?? "?";
|
|
70
71
|
console.log(` ${template.name} (${template.language}) ${template.category} ${status} ${count} param${count === 1 ? "" : "s"}`);
|
|
71
72
|
if (template.body) console.log(` ${template.body.replace(/\n/g, "\n ")}`);
|
|
73
|
+
if (template.buttons?.length) console.log(` buttons: ${template.buttons.map(describeButton).join(" · ")}`);
|
|
72
74
|
if (template.status === "REJECTED" && template.rejected_reason) console.log(` ${paint("red", "rejected:")} ${template.rejected_reason}`);
|
|
73
75
|
if (template.status === "APPROVED") console.log(` "template": ${JSON.stringify(template.example)}`);
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
// On the workspace's own number once it has one, and before that on Vatio's
|
|
78
|
-
// test number, where a preview key sends it to the
|
|
79
|
-
// until Vatio moves it to the number the workspace
|
|
80
|
+
// test number, where a preview key sends it to the team's verified WhatsApps
|
|
81
|
+
// and the customer phones, until Vatio moves it to the number the workspace
|
|
82
|
+
// connects. The backend
|
|
80
83
|
// decides where, so there is no environment to choose.
|
|
81
84
|
async function createTemplate(config, args, json) {
|
|
82
85
|
takeValue(args, "--env");
|
|
@@ -85,12 +88,13 @@ async function createTemplate(config, args, json) {
|
|
|
85
88
|
const category = takeValue(args, "--category") ?? "utility";
|
|
86
89
|
const footer = takeValue(args, "--footer");
|
|
87
90
|
const examples = takeAll(args, "--example");
|
|
91
|
+
const buttons = takeButtons(args);
|
|
88
92
|
const name = args.shift();
|
|
89
93
|
if (!name || !language || !body || args.length > 0) fail(`Usage: ${CREATE_USAGE}`);
|
|
90
94
|
|
|
91
95
|
const workspace = config.resolveWorkspaceRequired();
|
|
92
96
|
const client = deployClient(config, workspace);
|
|
93
|
-
const template = await client.createTemplate({ name, language, category, body, examples, footer });
|
|
97
|
+
const template = await client.createTemplate({ name, language, category, body, examples, footer, buttons });
|
|
94
98
|
if (json) {
|
|
95
99
|
console.log(JSON.stringify(template, null, 2));
|
|
96
100
|
return;
|
|
@@ -104,7 +108,8 @@ async function createTemplate(config, args, json) {
|
|
|
104
108
|
(own ? "" : " --env preview"));
|
|
105
109
|
console.log(own
|
|
106
110
|
? "Once APPROVED, your backend sends it with a live key outside the 24-hour window with:"
|
|
107
|
-
: "Once APPROVED, a preview key sends it to your
|
|
111
|
+
: "Once APPROVED, a preview key sends it on Vatio's test number, to your team's verified WhatsApps and your " +
|
|
112
|
+
"customer phones, outside the 24-hour window with:");
|
|
108
113
|
console.log(` "template": ${JSON.stringify(template.example)}`);
|
|
109
114
|
if (!own) {
|
|
110
115
|
console.log("When you connect your own number, Vatio moves your templates to it, and from then on your backend " +
|
|
@@ -112,6 +117,40 @@ async function createTemplate(config, args, json) {
|
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
|
|
120
|
+
// In the order WhatsApp draws them: links, the phone, then quick replies,
|
|
121
|
+
// which Meta wants together. A link ending in {{1}} takes its value per
|
|
122
|
+
// message, and its --button-example for Meta's review, in order.
|
|
123
|
+
function takeButtons(args) {
|
|
124
|
+
const pair = (flag, value, second) => {
|
|
125
|
+
const at = value.indexOf("|");
|
|
126
|
+
if (at <= 0 || at === value.length - 1) fail(`${flag} takes "TEXT|${second}", like "Ver pedido|https://example.com/orders/{{1}}"`);
|
|
127
|
+
return [value.slice(0, at).trim(), value.slice(at + 1).trim()];
|
|
128
|
+
};
|
|
129
|
+
const urls = takeAll(args, "--button-url").map((value) => {
|
|
130
|
+
const [text, url] = pair("--button-url", value, "URL");
|
|
131
|
+
return { type: "url", text, url };
|
|
132
|
+
});
|
|
133
|
+
const phones = takeAll(args, "--button-phone").map((value) => {
|
|
134
|
+
const [text, phone] = pair("--button-phone", value, "PHONE");
|
|
135
|
+
return { type: "phone_number", text, phone_number: phone };
|
|
136
|
+
});
|
|
137
|
+
const replies = takeAll(args, "--button-quick-reply").map((text) => ({ type: "quick_reply", text }));
|
|
138
|
+
|
|
139
|
+
const examples = takeAll(args, "--button-example");
|
|
140
|
+
const dynamic = urls.filter((button) => button.url.endsWith("{{1}}"));
|
|
141
|
+
if (examples.length !== dynamic.length) {
|
|
142
|
+
fail(`--button-example: ${examples.length} given, ${dynamic.length} needed, one per --button-url ` +
|
|
143
|
+
"ending in {{1}}, in order.");
|
|
144
|
+
}
|
|
145
|
+
dynamic.forEach((button, index) => { button.example = examples[index]; });
|
|
146
|
+
return [...urls, ...phones, ...replies];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function describeButton(button) {
|
|
150
|
+
const target = button.url ?? button.phone_number;
|
|
151
|
+
return target ? `${button.text} (${target})` : button.text;
|
|
152
|
+
}
|
|
153
|
+
|
|
115
154
|
// Where create put it: the workspace's own number, or Vatio's test number
|
|
116
155
|
// before it has one. Every language under the name unless one is given.
|
|
117
156
|
async function deleteTemplate(config, args, json) {
|
package/lib/help.mjs
CHANGED
|
@@ -83,9 +83,10 @@ the two you are in. Commands default as listed.
|
|
|
83
83
|
in a new chat whose id it prints.
|
|
84
84
|
--file attaches an image, PDF, text or audio file
|
|
85
85
|
as a visitor would (up to 4, 8 MB each).
|
|
86
|
-
--as-phone speaks as your verified WhatsApp or
|
|
87
|
-
|
|
88
|
-
your identity key, so \`access: private\`
|
|
86
|
+
--as-phone speaks as your verified WhatsApp or
|
|
87
|
+
a customer phone; --as-subject signs a visitor
|
|
88
|
+
in with your identity key, so \`access: private\`
|
|
89
|
+
tools run
|
|
89
90
|
chat --chat CHAT_ID "message"
|
|
90
91
|
Continue that chat, whatever .vatio-chat.json
|
|
91
92
|
says: for chats running side by side
|
|
@@ -202,9 +203,8 @@ the two you are in. Commands default as listed.
|
|
|
202
203
|
to type the ID; without a terminal, needs --yes
|
|
203
204
|
|
|
204
205
|
WhatsApp (everything on the inbox's WhatsApp page; --json on each):
|
|
205
|
-
whatsapp [status] Your number, whether it is live, its problems
|
|
206
|
-
(first: a Meta error that fails every send)
|
|
207
|
-
and the test phones
|
|
206
|
+
whatsapp [status] Your number, whether it is live, and its problems
|
|
207
|
+
(first: a Meta error that fails every send)
|
|
208
208
|
whatsapp connect Where to connect your number (Meta's consent
|
|
209
209
|
screen only opens in the inbox)
|
|
210
210
|
whatsapp live on|off Answer everyone who writes, or nobody
|
|
@@ -214,17 +214,17 @@ the two you are in. Commands default as listed.
|
|
|
214
214
|
Cloud API again first: the fix for 133010
|
|
215
215
|
whatsapp disconnect [--yes]
|
|
216
216
|
whatsapp invite EMAIL [--code CODE]
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
whatsapp team
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
whatsapp phones rm PHONE | move PHONE
|
|
223
|
-
Remove one, or bring one you verified elsewhere
|
|
217
|
+
Ask whoever manages the number to connect it:
|
|
218
|
+
an email with the link (owner only)
|
|
219
|
+
whatsapp team The team and each person's own WhatsApp: the
|
|
220
|
+
phone the agent knows them by, and that reaches
|
|
221
|
+
it on Vatio's number
|
|
224
222
|
whatsapp templates [list] [--env live]
|
|
225
223
|
The number's templates and the "template" to send
|
|
226
224
|
whatsapp templates create NAME --language CODE --body TEXT [--example VALUE]...
|
|
227
225
|
[--category utility|marketing] [--footer TEXT]
|
|
226
|
+
[--button-url 'TEXT|URL']... [--button-example VALUE]...
|
|
227
|
+
[--button-phone 'TEXT|PHONE'] [--button-quick-reply TEXT]...
|
|
228
228
|
Submit one for Meta's review: on your number, or
|
|
229
229
|
on Vatio's test number until you connect one
|
|
230
230
|
whatsapp templates rm NAME [--language CODE] | sync
|
package/lib/suggest.mjs
CHANGED
package/lib/telemetry.mjs
CHANGED
|
@@ -38,7 +38,7 @@ const SUBCOMMANDS = {
|
|
|
38
38
|
keys: ["list", "create", "origins", "revoke"],
|
|
39
39
|
webhooks: ["list", "create", "test", "deliveries", "enable", "rm"],
|
|
40
40
|
contacts: ["export", "delete"],
|
|
41
|
-
whatsapp: ["status", "connect", "live", "check", "disconnect", "invite", "team", "
|
|
41
|
+
whatsapp: ["status", "connect", "live", "check", "disconnect", "invite", "team", "templates", "failed"],
|
|
42
42
|
config: ["show", "get", "set", "unset"],
|
|
43
43
|
"share-session": ["--should-ask", "--never"],
|
|
44
44
|
test: ["add", "list", "rm"]
|