@vatio-ai/cli 0.111.0 → 0.112.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/commands/team.mjs +5 -5
- package/package.json +1 -1
package/lib/commands/team.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const ROLES = ["viewer", "supervisor", "developer"];
|
|
|
19
19
|
const USAGE = `Usage: vatio team [list] [--json]\n` +
|
|
20
20
|
` vatio team invite EMAIL --role ${ROLES.join("|")} [--code CODE | --recovery-code CODE] [--json]\n` +
|
|
21
21
|
" With a second factor on your account, --code is the 6-digit code from your authenticator app.\n" +
|
|
22
|
-
" vatio team questions [--to EMAIL...|--
|
|
22
|
+
" vatio team questions [--to EMAIL...|--none] [--template NAME [--language CODE]|--no-template] [--json]";
|
|
23
23
|
|
|
24
24
|
export async function team(config, args) {
|
|
25
25
|
const json = takeFlag(args, "--json");
|
|
@@ -86,16 +86,16 @@ async function questions(client, workspace, args, json) {
|
|
|
86
86
|
const template = takeValue(args, "--template");
|
|
87
87
|
const language = takeValue(args, "--language");
|
|
88
88
|
const noTemplate = takeFlag(args, "--no-template");
|
|
89
|
-
const
|
|
89
|
+
const none = takeFlag(args, "--none");
|
|
90
90
|
const to = [];
|
|
91
91
|
for (let index = args.indexOf("--to"); index !== -1; index = args.indexOf("--to")) {
|
|
92
92
|
args.splice(index, 1);
|
|
93
93
|
while (args.length > index && !args[index].startsWith("--")) to.push(args.splice(index, 1)[0]);
|
|
94
94
|
}
|
|
95
|
-
if (args.length > 0 || (to.length > 0 &&
|
|
95
|
+
if (args.length > 0 || (to.length > 0 && none) || (template && noTemplate)) fail(USAGE);
|
|
96
96
|
|
|
97
97
|
const change = {};
|
|
98
|
-
if (
|
|
98
|
+
if (none) change.emails = [];
|
|
99
99
|
if (to.length > 0) change.emails = to;
|
|
100
100
|
if (template) change.template = { name: template, language: language ?? "es" };
|
|
101
101
|
if (noTemplate) change.template = null;
|
|
@@ -106,7 +106,7 @@ async function questions(client, workspace, args, json) {
|
|
|
106
106
|
if (json) return console.log(JSON.stringify(answer, null, 2));
|
|
107
107
|
if (Object.keys(change).length > 0) console.log(`${paint("green", "✓")} Saved.\n`);
|
|
108
108
|
|
|
109
|
-
console.log(`Who the agent asks on workspace ${workspace}${answer.
|
|
109
|
+
console.log(`Who the agent asks on workspace ${workspace}${answer.recipients.some((row) => row.selected) ? "" : " (nobody: it says it does not know)"}:`);
|
|
110
110
|
for (const row of answer.recipients) {
|
|
111
111
|
const flags = [row.selected ? "asked" : "", row.whatsapp_verified ? "" : "no WhatsApp verified"].filter(Boolean).join(", ");
|
|
112
112
|
console.log(` ${(row.role ?? "").padEnd(11)} ${row.email}${flags ? ` (${flags})` : ""}`);
|