@vatio-ai/cli 0.62.0 → 0.62.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/lib/commands/channels.mjs +16 -6
- package/lib/help.mjs +3 -2
- package/package.json +1 -1
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
// whatsapp / instagram -- both are set up in the console now: connecting your
|
|
2
2
|
// own number or account needs Meta's consent screen, and test phones and
|
|
3
|
-
// accounts are a form with a code. The CLI only says where
|
|
3
|
+
// accounts are a form with a code. The CLI only says where, and that depends
|
|
4
|
+
// on whether the workspace has published: before, only the Test page is in the
|
|
5
|
+
// console's sidebar; after, the channel's own page under Integrations.
|
|
4
6
|
|
|
5
7
|
import { deployClient } from "./deploy.mjs";
|
|
6
8
|
|
|
7
|
-
export const whatsapp = (config) =>
|
|
8
|
-
|
|
9
|
+
export const whatsapp = (config) =>
|
|
10
|
+
inConsole(config, { name: "WhatsApp", key: "whatsapp", own: "number", test: "phone" });
|
|
11
|
+
export const instagram = (config) =>
|
|
12
|
+
inConsole(config, { name: "Instagram", key: "instagram", own: "account", test: "account" });
|
|
9
13
|
|
|
10
14
|
async function inConsole(config, channel) {
|
|
11
15
|
const status = await deployClient(config, config.resolveWorkspaceRequired()).deployStatus();
|
|
12
|
-
const url = status.integrations_url ?? `${config.resolveBaseUrl()}/workspaces`;
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
const url = status[`${channel.key}_url`] ?? status.integrations_url ?? `${config.resolveBaseUrl()}/workspaces`;
|
|
17
|
+
// An older server sends no `published`; a live deployment means the same.
|
|
18
|
+
const published = status.published ?? Boolean(status.live);
|
|
19
|
+
|
|
20
|
+
if (published) {
|
|
21
|
+
console.log(`Connect your own ${channel.own} and manage test ${channel.test}s in the console:`);
|
|
22
|
+
} else {
|
|
23
|
+
console.log(`Test ${channel.name} on the console's Test page: verify your ${channel.test} there and talk to your agent.`);
|
|
24
|
+
}
|
|
15
25
|
console.log(` ${url}`);
|
|
16
26
|
}
|
package/lib/help.mjs
CHANGED
|
@@ -107,8 +107,9 @@ and the one its pull request deploys to. Elsewhere commands default as listed.
|
|
|
107
107
|
Where Vatio tells your backend what happened
|
|
108
108
|
|
|
109
109
|
Channels:
|
|
110
|
-
whatsapp Set up in the console; prints the link
|
|
111
|
-
|
|
110
|
+
whatsapp Set up in the console; prints the link (Test page
|
|
111
|
+
until you publish, then Integrations)
|
|
112
|
+
instagram The same, for Instagram
|
|
112
113
|
|
|
113
114
|
Everything else:
|
|
114
115
|
config show|get KEY|set KEY VALUE|unset KEY
|