callkaro-cli-unofficial 0.8.0 → 0.9.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/commands/admin.js +144 -0
- package/dist/commands/agentVersions.js +39 -0
- package/dist/commands/analyzers.js +50 -0
- package/dist/commands/chatAgents.js +152 -0
- package/dist/commands/chatAuditStrategies.js +24 -1
- package/dist/commands/dashboardApiCmd.js +7 -1
- package/dist/commands/folders.js +75 -0
- package/dist/commands/platformExtras.js +374 -0
- package/dist/commands/update.js +1 -1
- package/dist/commands/voices.js +29 -0
- package/dist/index.js +203 -0
- package/dist/lib/adminApi.js +50 -3
- package/dist/lib/api.js +18 -0
- package/dist/lib/dashboardApi.js +223 -1
- package/dist/lib/updateCheck.js +69 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
38
|
};
|
|
@@ -28,6 +61,8 @@ const calls_1 = require("./commands/calls");
|
|
|
28
61
|
const ongoing_1 = require("./commands/ongoing");
|
|
29
62
|
const transcribers_1 = require("./commands/transcribers");
|
|
30
63
|
const voices_1 = require("./commands/voices");
|
|
64
|
+
const px = __importStar(require("./commands/platformExtras"));
|
|
65
|
+
const folders_1 = require("./commands/folders");
|
|
31
66
|
const secrets_1 = require("./commands/secrets");
|
|
32
67
|
const workflows_1 = require("./commands/workflows");
|
|
33
68
|
const contacts_1 = require("./commands/contacts");
|
|
@@ -46,6 +81,7 @@ const adminAuth_1 = require("./lib/adminAuth");
|
|
|
46
81
|
const admin_1 = require("./commands/admin");
|
|
47
82
|
const auditStrategies_1 = require("./commands/auditStrategies");
|
|
48
83
|
const chatAgents_1 = require("./commands/chatAgents");
|
|
84
|
+
const updateCheck_1 = require("./lib/updateCheck");
|
|
49
85
|
// The command this fork installs as. Deliberately NOT `ck` or `callkaro`:
|
|
50
86
|
// those belong to @callkaro-official/cli, and both packages write to the same
|
|
51
87
|
// global node_modules/.bin, so sharing a name means whichever npm install ran
|
|
@@ -260,6 +296,41 @@ admin
|
|
|
260
296
|
.description('clear the console-wide voice cache')
|
|
261
297
|
.option('--yes', 'skip the confirmation')
|
|
262
298
|
.action(admin_1.adminVoiceCacheCommand);
|
|
299
|
+
admin
|
|
300
|
+
.command('bot-failures <agentId>')
|
|
301
|
+
.description('failed LLM/TTS responses (or --api: failed external API calls) for a bot')
|
|
302
|
+
.option('--api', 'show failed external API responses instead')
|
|
303
|
+
.option('--response <text>', 'drill into one failed response: list its call ids')
|
|
304
|
+
.option('--endpoint <url>', 'with --api --response: narrow to one endpoint')
|
|
305
|
+
.option('--version <id>', 'limit to one agent version')
|
|
306
|
+
.option('--start <YYYY-MM-DD>', 'window start (default: a month ago)')
|
|
307
|
+
.option('--end <YYYY-MM-DD>', 'window end (default: today)')
|
|
308
|
+
.option('--limit <n>', 'max call ids with --response', '20')
|
|
309
|
+
.option('--json', 'raw JSON')
|
|
310
|
+
.action(admin_1.adminBotFailuresCommand);
|
|
311
|
+
admin.command('client-agents <clientId>').description("list a client account's agents")
|
|
312
|
+
.option('--json', 'raw JSON').action(admin_1.adminClientAgentsCommand);
|
|
313
|
+
admin.command('client-versions <agentId>').description("list an agent's versions via the console")
|
|
314
|
+
.option('--json', 'raw JSON').action(admin_1.adminClientAgentVersionsCommand);
|
|
315
|
+
const adminContext = admin.command('context').description('FDE reference agent library & semantic search (fde-api.callkaro.ai)');
|
|
316
|
+
adminContext.command('list').description('list indexed reference versions')
|
|
317
|
+
.option('--search <text>', 'filter by version id, use case, description or tags').option('--json', 'raw JSON')
|
|
318
|
+
.action(admin_1.adminContextListCommand);
|
|
319
|
+
adminContext.command('search <query>').description('semantic search over reference versions')
|
|
320
|
+
.option('--top-k <n>', 'max results', '3').option('--min-score <n>', 'minimum score', '0.5').option('--json', 'raw JSON')
|
|
321
|
+
.action(admin_1.adminContextSearchCommand);
|
|
322
|
+
for (const [name, update] of [['add', false], ['update', true]]) {
|
|
323
|
+
adminContext.command(`${name} <versionId>`).description(`${update ? 'update' : 'index'} a reference version`)
|
|
324
|
+
.option('--description <text>', 'what the agent does (required)')
|
|
325
|
+
.option('--use-case <text>', 'use case label')
|
|
326
|
+
.option('--tags <csv>', 'comma-separated tags')
|
|
327
|
+
.option('--set <json|@file>', 'JSON with description/useCase/tags/metadata')
|
|
328
|
+
.option('--json', 'raw JSON')
|
|
329
|
+
.action((versionId, opts) => (0, admin_1.adminContextSetCommand)(versionId, { ...opts, update }));
|
|
330
|
+
}
|
|
331
|
+
adminContext.command('remove <versionId>').description('remove a reference version from the index')
|
|
332
|
+
.option('--yes', 'skip the confirmation').option('--json', 'raw JSON')
|
|
333
|
+
.action(admin_1.adminContextRemoveCommand);
|
|
263
334
|
admin
|
|
264
335
|
.command('api <method> <path>')
|
|
265
336
|
.description('call any admin route with the stored session (the token never leaves the CLI)')
|
|
@@ -560,6 +631,12 @@ analyzers
|
|
|
560
631
|
.description('per-strategy audit rollup')
|
|
561
632
|
.option('--json', 'output raw JSON')
|
|
562
633
|
.action(analyzers_1.analyzersAuditStrategiesCommand);
|
|
634
|
+
analyzers.command('batches').description('list batch analysis runs').option('--json', 'raw JSON').action(analyzers_1.analyzersBatchListCommand);
|
|
635
|
+
analyzers.command('batch-create').description('start a batch analysis run')
|
|
636
|
+
.requiredOption('--set <json|@file>', 'request body').option('--json', 'raw JSON').action(analyzers_1.analyzersBatchCreateCommand);
|
|
637
|
+
analyzers.command('batch-calls <batchId>').description('calls in a batch analysis run')
|
|
638
|
+
.option('--page <n>', 'page number', '1').option('--export', 'export mode').option('--json', 'raw JSON')
|
|
639
|
+
.action(analyzers_1.analyzersBatchCallsCommand);
|
|
563
640
|
analyzers.command('summary <id>').description('analyzer summary rollup')
|
|
564
641
|
.option('--batch', 'id is a batch audit, not a call analyzer')
|
|
565
642
|
.option('--severity <sev>', 'filter by severity')
|
|
@@ -820,6 +897,12 @@ agents.command('set-whatsapp-outbound <agentId>').description("set/clear an agen
|
|
|
820
897
|
.option('--clear', 'clear the outbound number')
|
|
821
898
|
.action(agentPhone_1.setWhatsappOutboundCommand);
|
|
822
899
|
// Version management: clone, publish, activate, A/B testing
|
|
900
|
+
agents.command('set-languages <agentId>').description('set switchable languages on several versions at once (dashboard session)')
|
|
901
|
+
.requiredOption('--languages <csv>', 'language codes, e.g. en,hi')
|
|
902
|
+
.requiredOption('--versions <ids>', 'comma-separated version ids')
|
|
903
|
+
.option('--json', 'raw JSON').action(agentVersions_1.agentsSetLanguagesCommand);
|
|
904
|
+
agents.command('postcall-info <agentId>').description('post-call variables and drop-off reasons (dashboard session)')
|
|
905
|
+
.option('--json', 'raw JSON').action(agentVersions_1.agentsPostcallInfoCommand);
|
|
823
906
|
agents.command('clone-version <agentId>').description('clone a version with a required target prompt mode and language')
|
|
824
907
|
.option('--versions <id>', 'source version id')
|
|
825
908
|
.option('--name <name>', 'name for the new version')
|
|
@@ -879,6 +962,9 @@ agents.command('duplicate <agentId>').description('duplicate an agent under a ne
|
|
|
879
962
|
.action(agentVersions_1.agentsDuplicateCommand);
|
|
880
963
|
// --- chat agents -----------------------------------------------------------
|
|
881
964
|
const chatAgents = program.command('chat-agents').description('manage chat agents');
|
|
965
|
+
chatAgents.command('diff <chatAgentId>').description('compare two versions or two commits of a chat agent (dashboard session)')
|
|
966
|
+
.option('--versions <vA,vB>', 'two version ids').option('--commits <cA,cB>', 'two commit ids').option('--json', 'raw JSON')
|
|
967
|
+
.action(chatAgents_1.chatAgentsDiffCommand);
|
|
882
968
|
chatAgents.command('models').description('list models available for chat agents')
|
|
883
969
|
.option('--json', 'output raw JSON').option('--file <path>', 'save JSON to a file')
|
|
884
970
|
.action(chatAgents_1.chatAgentsModelsCommand);
|
|
@@ -917,6 +1003,18 @@ chatAgents.command('publish <agentId>').description('publish a chat-agent versio
|
|
|
917
1003
|
.requiredOption('--versions <id>', 'version id to publish')
|
|
918
1004
|
.option('--json', 'output the raw response')
|
|
919
1005
|
.action(chatAgents_1.chatAgentsPublishCommand);
|
|
1006
|
+
chatAgents.command('delete-version <agentId>').description('delete a chat-agent version and its commit history (refused if published or assigned by another version)')
|
|
1007
|
+
.requiredOption('--versions <id>', 'version id to delete').option('--json', 'output the raw response').action(chatAgents_1.chatAgentsDeleteVersionCommand);
|
|
1008
|
+
chatAgents.command('import-versions <agentId>').description('add versions to a chat agent from exported JSON (object or array; repeat --file for several files)')
|
|
1009
|
+
.requiredOption('--file <path>', 'exported JSON file', chatAgents_1.chatAgentsCollectFile).option('--json', 'output the raw response').action(chatAgents_1.chatAgentsImportVersionsCommand);
|
|
1010
|
+
chatAgents.command('import').description('create a chat agent from exported JSON; several versions become one agent (agent-level fields must match)')
|
|
1011
|
+
.requiredOption('--file <path>', 'exported JSON file', chatAgents_1.chatAgentsCollectFile).option('--json', 'output the raw response').action(chatAgents_1.chatAgentsImportCommand);
|
|
1012
|
+
chatAgents.command('commits <agentId>').description("list a chat agent's version commits, newest first")
|
|
1013
|
+
.option('--versions <id>', 'only this version').option('--page <n>', 'page number').option('--json', 'output raw JSON').option('--file <path>', 'save JSON to a file').action(chatAgents_1.chatAgentsCommitsCommand);
|
|
1014
|
+
chatAgents.command('commit <commitId>').description('show a commit (use --json for its full saved state)')
|
|
1015
|
+
.option('--json', 'output raw JSON').option('--file <path>', 'save JSON to a file').action(chatAgents_1.chatAgentsCommitCommand);
|
|
1016
|
+
chatAgents.command('revert <agentId> <commitId>').description("set a version back to a commit's saved state")
|
|
1017
|
+
.option('--json', 'output the raw response').action(chatAgents_1.chatAgentsRevertCommand);
|
|
920
1018
|
// --- skills ----------------------------------------------------------------
|
|
921
1019
|
const skills = program.command('skills').description('AI skill pack for Claude Code & other agents');
|
|
922
1020
|
function addSkillsProviderOptions(command) {
|
|
@@ -1016,6 +1114,105 @@ program
|
|
|
1016
1114
|
.option('--fields', 'show the voice_configuration keys a provider takes (needs --provider)')
|
|
1017
1115
|
.option('--json', 'raw JSON')
|
|
1018
1116
|
.action(voices_1.voicesCommand);
|
|
1117
|
+
program
|
|
1118
|
+
.command('voice-preview')
|
|
1119
|
+
.description('synthesize TTS preview audio to a file (POST /v2/agents/voice-preview)')
|
|
1120
|
+
.requiredOption('--text <text>', 'text to speak')
|
|
1121
|
+
.option('--agent <agentId>', 'read voice_configuration from this agent')
|
|
1122
|
+
.option('--versions <versionId>', 'version of --agent')
|
|
1123
|
+
.option('--set <json|@file>', 'voice_configuration JSON object')
|
|
1124
|
+
.option('--file <path>', 'output audio file (default: voice_preview.mp3)')
|
|
1125
|
+
.action(voices_1.voicesPreviewCommand);
|
|
1126
|
+
const folders = program.command('folders').description('manage agent folders (dashboard session)');
|
|
1127
|
+
folders.command('list').description('list folders with agent counts').option('--json', 'raw JSON').action(folders_1.foldersListCommand);
|
|
1128
|
+
folders.command('create <name>').description('create a folder').option('--json', 'raw JSON').action(folders_1.foldersCreateCommand);
|
|
1129
|
+
folders.command('rename <folderId> <name>').description('rename a folder').option('--json', 'raw JSON').action(folders_1.foldersRenameCommand);
|
|
1130
|
+
folders.command('delete <folderId>').description('delete a folder').option('--yes', 'skip the confirmation').option('--json', 'raw JSON').action(folders_1.foldersDeleteCommand);
|
|
1131
|
+
folders.command('move <folderId>').description('move agents into a folder')
|
|
1132
|
+
.requiredOption('--agents <ids>', 'comma-separated agent ids').option('--json', 'raw JSON').action(folders_1.foldersMoveCommand);
|
|
1133
|
+
// --- Platform extras (dashboard session): inbox, wa-campaigns, finetune, team, compliance, verified-numbers, integrations ---
|
|
1134
|
+
const J = '--json';
|
|
1135
|
+
const JD = 'raw JSON';
|
|
1136
|
+
const YD = 'skip the confirmation';
|
|
1137
|
+
const inbox = program.command('inbox').description('WhatsApp/voice inbox and human handoff (dashboard session)');
|
|
1138
|
+
inbox.command('list').description('list inbox threads')
|
|
1139
|
+
.option('--page <n>', 'page').option('--channel <c>', 'channel filter').option('--search <q>', 'search text')
|
|
1140
|
+
.option('--number <agentPhone>', 'agent phone number').option('--since <date>', 'from date').option('--until <date>', 'to date')
|
|
1141
|
+
.option(J, JD).action(px.inboxListCommand);
|
|
1142
|
+
inbox.command('unread').description('contacts with unread messages').option(J, JD).action(px.inboxUnreadCommand);
|
|
1143
|
+
inbox.command('handoffs').description('chats currently handed to a human')
|
|
1144
|
+
.option('--channel <c>', 'channel filter').option(J, JD).action(px.inboxHandoffsCommand);
|
|
1145
|
+
inbox.command('release <fromId>').description('release a human handoff back to the agent')
|
|
1146
|
+
.requiredOption('--channel <c>', 'channel of the handoff').option('--to-id <id>', 'hand to this id instead').option(J, JD).action(px.inboxReleaseHandoffCommand);
|
|
1147
|
+
inbox.command('contact <phone>').description('message history for one contact')
|
|
1148
|
+
.option('--page <n>', 'page').option('--limit <n>', 'page size (default 25)')
|
|
1149
|
+
.option('--number <agentPhone>', 'agent phone number').option('--channel <c>', 'channel').option(J, JD).action(px.inboxContactCommand);
|
|
1150
|
+
inbox.command('clear <phone>').description('delete a contact\'s chat history')
|
|
1151
|
+
.option('--number <agentPhone>', 'agent phone number').option('--yes', YD).option(J, JD).action(px.inboxClearCommand);
|
|
1152
|
+
inbox.command('deassign <phone>').description('deassign a chat from its agent')
|
|
1153
|
+
.option('--number <agentPhone>', 'agent phone number').option(J, JD).action(px.inboxDeassignCommand);
|
|
1154
|
+
const waCampaigns = program.command('wa-campaigns').description('WhatsApp campaigns (dashboard session)');
|
|
1155
|
+
waCampaigns.command('list').description('list campaigns').option(J, JD).action(px.waCampaignsListCommand);
|
|
1156
|
+
waCampaigns.command('analytics <id>').description('campaign analytics').option(J, JD).action(px.waCampaignAnalyticsCommand);
|
|
1157
|
+
waCampaigns.command('timeseries <id>').description('campaign timeseries')
|
|
1158
|
+
.option('--start <date>', 'from date').option('--end <date>', 'to date').option(J, JD).action(px.waCampaignTimeseriesCommand);
|
|
1159
|
+
waCampaigns.command('export <id>').description('export campaign contacts to CSV')
|
|
1160
|
+
.option('--fields <csv>', 'export_fields').option('--include-chat', 'include chat transcripts')
|
|
1161
|
+
.option('--file <path>', 'output file (default wa_campaign_<id>.csv)').action(px.waCampaignExportCommand);
|
|
1162
|
+
waCampaigns.command('send').description('send a bulk template message')
|
|
1163
|
+
.requiredOption('--set <json|@file>', 'request body').option(J, JD).action(px.waCampaignSendCommand);
|
|
1164
|
+
const finetune = program.command('finetune').description('fine-tuning records, buckets and jobs (dashboard session)');
|
|
1165
|
+
finetune.command('list').description('list fine-tune records').option('--page <n>', 'page').option(J, JD).action(px.finetuneListCommand);
|
|
1166
|
+
finetune.command('buckets').description('list buckets').option(J, JD).action(px.finetuneBucketsCommand);
|
|
1167
|
+
finetune.command('create-bucket <name>').description('create a bucket').option(J, JD).action(px.finetuneCreateBucketCommand);
|
|
1168
|
+
finetune.command('jobs').description('list jobs').option('--page <n>', 'page').option('--limit <n>', 'page size (default 100)').option(J, JD).action(px.finetuneJobsCommand);
|
|
1169
|
+
finetune.command('status <jobId>').description('job status').option(J, JD).action(px.finetuneStatusCommand);
|
|
1170
|
+
finetune.command('start').description('start a fine-tune job')
|
|
1171
|
+
.requiredOption('--set <json|@file>', 'request body').option(J, JD).action(px.finetuneStartCommand);
|
|
1172
|
+
finetune.command('add-model <jobId>').description('register a finished job\'s model').option(J, JD).action(px.finetuneAddModelCommand);
|
|
1173
|
+
finetune.command('cancel <jobId>').description('cancel a job').option(J, JD).action(px.finetuneCancelCommand);
|
|
1174
|
+
finetune.command('delete-record <callId>').description('delete a fine-tune record')
|
|
1175
|
+
.option('--yes', YD).option(J, JD).action(px.finetuneDeleteRecordCommand);
|
|
1176
|
+
const team = program.command('team').description('team members, roles and webhooks (dashboard session)');
|
|
1177
|
+
team.command('members').description('list members').option(J, JD).action(px.teamMembersCommand);
|
|
1178
|
+
team.command('roles').description('list roles').option(J, JD).action(px.teamRolesCommand);
|
|
1179
|
+
team.command('create-role <name>').description('create a role')
|
|
1180
|
+
.requiredOption('--permissions <csv>', 'comma-separated permissions').option(J, JD).action(px.teamCreateRoleCommand);
|
|
1181
|
+
team.command('add-member').description('add a member')
|
|
1182
|
+
.requiredOption('--name <name>', 'name').requiredOption('--email <email>', 'email')
|
|
1183
|
+
.option('--password <pw>', 'password').option('--permissions <csv>', 'comma-separated permissions').option(J, JD).action(px.teamAddMemberCommand);
|
|
1184
|
+
team.command('update-member <id>').description('update a member')
|
|
1185
|
+
.option('--name <name>', 'name').option('--email <email>', 'email').option('--password <pw>', 'password')
|
|
1186
|
+
.option('--permissions <csv>', 'comma-separated permissions').option(J, JD).action(px.teamUpdateMemberCommand);
|
|
1187
|
+
team.command('remove-member <id>').description('remove a member').option('--yes', YD).option(J, JD).action(px.teamRemoveMemberCommand);
|
|
1188
|
+
team.command('set-webhook').description('set the team webhook and/or call-analysis webhook')
|
|
1189
|
+
.option('--url <url>', 'team webhook URL').option('--analysis-url <url>', 'call analysis webhook URL')
|
|
1190
|
+
.option('--headers <k:v,...>', 'webhook headers as Key:Value pairs').option('--events <csv>', 'webhook events').option(J, JD).action(px.teamSetWebhookCommand);
|
|
1191
|
+
const compliance = program.command('compliance').description('compliance records (dashboard session)');
|
|
1192
|
+
compliance.command('list').description('list records').option(J, JD).action(px.complianceListCommand);
|
|
1193
|
+
compliance.command('create').description('create a record')
|
|
1194
|
+
.requiredOption('--gst <number>', 'GST number').requiredOption('--username <name>', 'username').requiredOption('--company <name>', 'company name')
|
|
1195
|
+
.option('--gst-url <url>', 'GST file URL').option('--cin-url <url>', 'CIN file URL').option(J, JD).action(px.complianceCreateCommand);
|
|
1196
|
+
compliance.command('delete <id>').description('delete a record').option('--yes', YD).option(J, JD).action(px.complianceDeleteCommand);
|
|
1197
|
+
const verified = program.command('verified-numbers').description('verified phone numbers (dashboard session)');
|
|
1198
|
+
verified.command('list').description('list numbers').option(J, JD).action(px.verifiedNumbersListCommand);
|
|
1199
|
+
verified.command('add <phoneNumber>').description('add a number (sends an OTP)').option(J, JD).action(px.verifiedNumbersAddCommand);
|
|
1200
|
+
verified.command('verify <phoneNumber>').description('confirm a number with its OTP')
|
|
1201
|
+
.requiredOption('--otp <code>', 'OTP received').option(J, JD).action(px.verifiedNumbersVerifyCommand);
|
|
1202
|
+
verified.command('delete <id>').description('delete a number').option('--yes', YD).option(J, JD).action(px.verifiedNumbersDeleteCommand);
|
|
1203
|
+
const integrations = program.command('integrations').description('third-party integrations (dashboard session)');
|
|
1204
|
+
integrations.command('list').description('list integrations').option(J, JD).action(px.integrationsListCommand);
|
|
1205
|
+
integrations.command('create').description('create an integration')
|
|
1206
|
+
.requiredOption('--type <type>', 'integration type').option('--set <json|@file>', 'credentials JSON').option('--tag <tag>', 'tag').option(J, JD).action(px.integrationsCreateCommand);
|
|
1207
|
+
integrations.command('update <id>').description('update an integration')
|
|
1208
|
+
.option('--type <type>', 'integration type').option('--set <json|@file>', 'credentials JSON').option('--tag <tag>', 'tag').option(J, JD).action(px.integrationsUpdateCommand);
|
|
1209
|
+
integrations.command('delete <id>').description('delete an integration').option('--yes', YD).option(J, JD).action(px.integrationsDeleteCommand);
|
|
1210
|
+
integrations.command('sip').description('list SIP trunks').option(J, JD).action(px.integrationsSipCommand);
|
|
1211
|
+
integrations.command('aisensy').description('list AiSensy campaigns, or link an agent with --agent')
|
|
1212
|
+
.option('--agent <agentId>', 'link this agent').option('--campaigns', 'list campaigns (default)').option(J, JD).action(px.integrationsAisensyCommand);
|
|
1213
|
+
integrations.command('hubspot <agentId>').description('link HubSpot to an agent').option(J, JD).action(px.integrationsHubspotCommand);
|
|
1214
|
+
integrations.command('shopify').description('save Shopify config')
|
|
1215
|
+
.requiredOption('--set <json|@file>', 'config JSON').option(J, JD).action(px.integrationsShopifyCommand);
|
|
1019
1216
|
program
|
|
1020
1217
|
.command('transcribers')
|
|
1021
1218
|
.description('list transcriber providers, models and languages')
|
|
@@ -1269,6 +1466,7 @@ chatAudit.command('create <agentId>').description('create a chat audit strategy'
|
|
|
1269
1466
|
.option('--min-user-messages <n>', 'skip conversations with fewer customer messages (default 1)')
|
|
1270
1467
|
.option('--min-messages <n>', 'skip conversations with fewer total messages (default 2)')
|
|
1271
1468
|
.option('--set <json|@file>', 'JSON for audit_filters/extra_variables/llms; attribute names/values: `cku contacts attributes list`')
|
|
1469
|
+
.option('--chatflow-summary <text>', 'how the conversation should go (stages, required actions, outcome); the auditor judges against this, not the published version')
|
|
1272
1470
|
.action(chatAuditStrategies_1.chatAuditCreateCommand);
|
|
1273
1471
|
chatAudit.command('update <agentId> <strategyId>').description('update a chat audit strategy (only named fields change)')
|
|
1274
1472
|
.option('--name <name>', 'strategy name')
|
|
@@ -1281,7 +1479,11 @@ chatAudit.command('update <agentId> <strategyId>').description('update a chat au
|
|
|
1281
1479
|
.option('--min-user-messages <n>', 'skip conversations with fewer customer messages')
|
|
1282
1480
|
.option('--min-messages <n>', 'skip conversations with fewer total messages')
|
|
1283
1481
|
.option('--set <json|@file>', 'JSON for audit_filters/extra_variables/llms; each replaces the stored value')
|
|
1482
|
+
.option('--chatflow-summary <text>', 'how the conversation should go (stages, required actions, outcome); the auditor judges against this, not the published version')
|
|
1284
1483
|
.action(chatAuditStrategies_1.chatAuditUpdateCommand);
|
|
1484
|
+
chatAudit.command('reports').description('list chat audit report batches (dashboard session)')
|
|
1485
|
+
.option('--agent <id>', 'chat agent id').option('--page <n>', 'page number').option('--json', 'raw JSON')
|
|
1486
|
+
.action(chatAuditStrategies_1.chatAuditReportsCommand);
|
|
1285
1487
|
chatAudit.command('delete <strategyId>').description('delete a chat audit strategy').action(chatAuditStrategies_1.chatAuditDeleteCommand);
|
|
1286
1488
|
chatAudit.command('batch <agentId> <strategyId>')
|
|
1287
1489
|
.description('audit up to N conversations now (uses credits; only messages since each last audit)')
|
|
@@ -1405,6 +1607,7 @@ if (process.argv.length <= 2) {
|
|
|
1405
1607
|
program.outputHelp();
|
|
1406
1608
|
process.exit(0);
|
|
1407
1609
|
}
|
|
1610
|
+
(0, updateCheck_1.notifyIfOutdated)(VERSION, process.argv.slice(2));
|
|
1408
1611
|
program.parseAsync(rewriteGetVersions(process.argv));
|
|
1409
1612
|
/**
|
|
1410
1613
|
* Rewrite `agents get versions <agentId>` → `agents versions <agentId>`.
|
package/dist/lib/adminApi.js
CHANGED
|
@@ -42,6 +42,7 @@ const adminAuth_1 = require("./adminAuth");
|
|
|
42
42
|
* `err.status` the same way on every surface. Extends Error so existing
|
|
43
43
|
* `handleError` paths and message-based assertions keep working.
|
|
44
44
|
*/
|
|
45
|
+
const FDE_URL = process.env.CK_FDE_URL || 'https://fde-api.callkaro.ai';
|
|
45
46
|
class AdminError extends Error {
|
|
46
47
|
status;
|
|
47
48
|
data;
|
|
@@ -68,7 +69,8 @@ class AdminApi {
|
|
|
68
69
|
* per request rather than once at construction: it is what proves the stored
|
|
69
70
|
* 24h session is still valid, and a long-lived client must not outlive it.
|
|
70
71
|
*/
|
|
71
|
-
async request(method, path, body) {
|
|
72
|
+
async request(method, path, body, hostOverride) {
|
|
73
|
+
const base = hostOverride || this.baseUrl;
|
|
72
74
|
// baseUrl + path is the whole URL, so a path that does not start with "/"
|
|
73
75
|
// can rewrite the host ("https://backend.callkaro.ai" + "@evil.com/x") and
|
|
74
76
|
// carry the session cookie with it.
|
|
@@ -81,7 +83,7 @@ class AdminApi {
|
|
|
81
83
|
};
|
|
82
84
|
let res;
|
|
83
85
|
try {
|
|
84
|
-
res = await fetch(`${
|
|
86
|
+
res = await fetch(`${base}${path}`, {
|
|
85
87
|
method,
|
|
86
88
|
headers,
|
|
87
89
|
body: body === undefined ? undefined : JSON.stringify(body),
|
|
@@ -91,7 +93,7 @@ class AdminApi {
|
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
catch (err) {
|
|
94
|
-
throw new Error(`Cannot reach ${
|
|
96
|
+
throw new Error(`Cannot reach ${base} (${err.message})`);
|
|
95
97
|
}
|
|
96
98
|
const text = await res.text();
|
|
97
99
|
let data;
|
|
@@ -196,6 +198,51 @@ class AdminApi {
|
|
|
196
198
|
botFunctions(query = {}) {
|
|
197
199
|
return this.request('GET', `/monitor/bots/functions${qs(query)}`);
|
|
198
200
|
}
|
|
201
|
+
/** List agents belonging to one or more client user_ids (`GET /monitor/agents?user_ids=`). */
|
|
202
|
+
clientAgents(userIds) {
|
|
203
|
+
return this.request('GET', `/monitor/agents${qs({ user_ids: userIds })}`);
|
|
204
|
+
}
|
|
205
|
+
/** List versions of an agent from monitor (`GET /monitor/agents/:agentId/versions`). */
|
|
206
|
+
clientAgentVersions(agentId) {
|
|
207
|
+
return this.request('GET', `/monitor/agents/${encodeURIComponent(agentId)}/versions`);
|
|
208
|
+
}
|
|
209
|
+
/** Failed LLM/TTS response buckets for a bot (`GET /monitor/bots/:agentId/failed-responses`). */
|
|
210
|
+
botFailedResponses(agentId, query = {}) {
|
|
211
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-responses${qs(query)}`);
|
|
212
|
+
}
|
|
213
|
+
/** Call ids that hit a specific failed response (`GET /monitor/bots/:agentId/failed-response-calls`). */
|
|
214
|
+
botFailedResponseCalls(agentId, query) {
|
|
215
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-response-calls${qs(query)}`);
|
|
216
|
+
}
|
|
217
|
+
/** Failed external API endpoints for a bot (`GET /monitor/bots/:agentId/failed-api-responses`). */
|
|
218
|
+
botFailedApiResponses(agentId, query = {}) {
|
|
219
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-api-responses${qs(query)}`);
|
|
220
|
+
}
|
|
221
|
+
/** Call ids that hit a failed API response (`GET /monitor/bots/:agentId/failed-api-response-calls`). */
|
|
222
|
+
botFailedApiResponseCalls(agentId, query) {
|
|
223
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-api-response-calls${qs(query)}`);
|
|
224
|
+
}
|
|
225
|
+
// --- FDE reference library (`https://fde-api.callkaro.ai/monitor/agent-context`) ---
|
|
226
|
+
/** List all curated reference agent versions in the FDE library. */
|
|
227
|
+
listAgentContext() {
|
|
228
|
+
return this.request('GET', '/monitor/agent-context', undefined, FDE_URL);
|
|
229
|
+
}
|
|
230
|
+
/** Semantic search over reference agent versions (`GET .../monitor/agent-context/search`). */
|
|
231
|
+
searchAgentContext(query) {
|
|
232
|
+
return this.request('GET', `/monitor/agent-context/search${qs(query)}`, undefined, FDE_URL);
|
|
233
|
+
}
|
|
234
|
+
/** Index a new reference agent version (`POST .../monitor/agent-context`). */
|
|
235
|
+
createAgentContext(body) {
|
|
236
|
+
return this.request('POST', '/monitor/agent-context', body, FDE_URL);
|
|
237
|
+
}
|
|
238
|
+
/** Update an indexed reference agent version (`PUT .../monitor/agent-context/:versionId`). */
|
|
239
|
+
updateAgentContext(versionId, body) {
|
|
240
|
+
return this.request('PUT', `/monitor/agent-context/${encodeURIComponent(versionId)}`, body, FDE_URL);
|
|
241
|
+
}
|
|
242
|
+
/** Remove a reference agent version from the index (`DELETE .../monitor/agent-context/:versionId`). */
|
|
243
|
+
deleteAgentContext(versionId) {
|
|
244
|
+
return this.request('DELETE', `/monitor/agent-context/${encodeURIComponent(versionId)}`, undefined, FDE_URL);
|
|
245
|
+
}
|
|
199
246
|
// --- observability --------------------------------------------------------
|
|
200
247
|
/** Sentry transactions over the last 24h. */
|
|
201
248
|
sentryTransactions(query = {}) {
|
package/dist/lib/api.js
CHANGED
|
@@ -270,6 +270,24 @@ class Api {
|
|
|
270
270
|
publishChatAgentVersion(agentId, versionId) {
|
|
271
271
|
return this.request('POST', `/cli/chat-agents/${agentId}/publish`, { versionId });
|
|
272
272
|
}
|
|
273
|
+
deleteChatAgentVersion(agentId, versionId) {
|
|
274
|
+
return this.request('DELETE', `/cli/chat-agents/${agentId}/versions/${versionId}`);
|
|
275
|
+
}
|
|
276
|
+
importChatAgentVersions(agentId, entries) {
|
|
277
|
+
return this.request('POST', `/cli/chat-agents/${agentId}/import-versions`, entries);
|
|
278
|
+
}
|
|
279
|
+
importChatAgent(entries) {
|
|
280
|
+
return this.request('POST', '/cli/chat-agents/import-multiple', entries);
|
|
281
|
+
}
|
|
282
|
+
listChatAgentCommits(agentId, opts = {}) {
|
|
283
|
+
return this.request('GET', `/cli/chat-agents/${agentId}/commits${qs(opts)}`);
|
|
284
|
+
}
|
|
285
|
+
getChatAgentCommit(commitId) {
|
|
286
|
+
return this.request('GET', `/cli/chat-agents/commits/${commitId}`);
|
|
287
|
+
}
|
|
288
|
+
revertChatAgentCommit(agentId, commitId) {
|
|
289
|
+
return this.request('POST', `/cli/chat-agents/${agentId}/commits/${commitId}/revert`, {});
|
|
290
|
+
}
|
|
273
291
|
// --- whatsapp numbers -----------------------------------------------------
|
|
274
292
|
// Numbers come from Meta (the linked WhatsApp Business Account), not a
|
|
275
293
|
// platform pool, so there is no buy/catalog counterpart to /cli/numbers.
|
package/dist/lib/dashboardApi.js
CHANGED
|
@@ -487,6 +487,222 @@ class DashboardApi {
|
|
|
487
487
|
generateWorkflowCode(body) {
|
|
488
488
|
return this.request('POST', '/openai-tools/generate-workflow-code', body);
|
|
489
489
|
}
|
|
490
|
+
// --- Voice preview, folders, bulk languages & postcall drop-off ------------
|
|
491
|
+
/** Render TTS audio preview (`POST /v2/agents/voice-preview`). */
|
|
492
|
+
voicePreview(voiceConfiguration, text) {
|
|
493
|
+
return this.requestBinary('POST', '/v2/agents/voice-preview', {
|
|
494
|
+
voice_configuration: voiceConfiguration,
|
|
495
|
+
text,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/** Create an agent folder (`POST /agent-folders`). */
|
|
499
|
+
createAgentFolder(name) {
|
|
500
|
+
return this.request('POST', '/agent-folders', { name });
|
|
501
|
+
}
|
|
502
|
+
/** Rename an agent folder (`PUT /agent-folders/:id`). */
|
|
503
|
+
renameAgentFolder(folderId, name) {
|
|
504
|
+
return this.request('PUT', `/agent-folders/${encodeURIComponent(folderId)}`, { _id: folderId, name });
|
|
505
|
+
}
|
|
506
|
+
/** Delete an agent folder (`DELETE /agent-folders/:id`). */
|
|
507
|
+
deleteAgentFolder(folderId) {
|
|
508
|
+
return this.request('DELETE', `/agent-folders/${encodeURIComponent(folderId)}`);
|
|
509
|
+
}
|
|
510
|
+
/** Move agents into a folder (`POST /agent-folders/move`). */
|
|
511
|
+
moveAgentsToFolder(agentIds, folderId) {
|
|
512
|
+
return this.request('POST', '/agent-folders/move', { agentIds, folderId });
|
|
513
|
+
}
|
|
514
|
+
/** Bulk-update switchable languages across versions (`PUT /v2/agents/:agentId/update-all-switchable-language`). */
|
|
515
|
+
updateAllSwitchableLanguage(agentId, switchableLanguages, versionIds) {
|
|
516
|
+
return this.request('PUT', `/v2/agents/${encodeURIComponent(agentId)}/update-all-switchable-language`, {
|
|
517
|
+
switchableLanguages,
|
|
518
|
+
versionIds,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
/** Post-call variables, drop-off reasons, and versions for an agent (`GET /v2/agents/postcall/:agentId`). */
|
|
522
|
+
agentPostcallInfo(agentId) {
|
|
523
|
+
return this.request('GET', `/v2/agents/postcall/${encodeURIComponent(agentId)}`);
|
|
524
|
+
}
|
|
525
|
+
/** Get or set a custom drop-off reason description (`GET/POST /v2/agents/postcall/:agentId/other-droff-reason`). */
|
|
526
|
+
getOtherDropOffReason(agentId, versionId, dropOffReason) {
|
|
527
|
+
return this.request('GET', `/v2/agents/postcall/${encodeURIComponent(agentId)}/other-droff-reason${qs({ versionId, drop_off_reason: dropOffReason })}`);
|
|
528
|
+
}
|
|
529
|
+
setOtherDropOffReason(agentId, versionId, body) {
|
|
530
|
+
return this.request('POST', `/v2/agents/postcall/${encodeURIComponent(agentId)}/other-droff-reason${qs({ versionId })}`, body);
|
|
531
|
+
}
|
|
532
|
+
// --- Call analyzer batch runs (`/v1/batch-analysis/*`) ---------------------
|
|
533
|
+
/** List batch analysis runs (`GET /v1/batch-analysis/list`). */
|
|
534
|
+
listBatchAnalyses() {
|
|
535
|
+
return this.request('GET', '/v1/batch-analysis/list');
|
|
536
|
+
}
|
|
537
|
+
/** Create a batch analysis run (`POST /v1/batch-analysis/create`). */
|
|
538
|
+
createBatchAnalysis(body) {
|
|
539
|
+
return this.request('POST', '/v1/batch-analysis/create', body);
|
|
540
|
+
}
|
|
541
|
+
/** Calls in a batch analysis run (`GET /v1/batch-analysis/:batchId/calls`). */
|
|
542
|
+
batchAnalysisCalls(batchId, query = {}) {
|
|
543
|
+
return this.request('GET', `/v1/batch-analysis/${encodeURIComponent(batchId)}/calls${qs(query)}`);
|
|
544
|
+
}
|
|
545
|
+
// --- Chat agent commits, compare & chat audit reports ----------------------
|
|
546
|
+
/** Compare two chat agent versions (`POST /v3/chat-agents/compareVersions`). */
|
|
547
|
+
compareChatAgentVersions(versionIds) {
|
|
548
|
+
return this.request('POST', '/v3/chat-agents/compareVersions', { versionIds });
|
|
549
|
+
}
|
|
550
|
+
/** Compare two chat agent commits (`GET /v3/chat-commits/:agentId/compare?commitA=&commitB=`). */
|
|
551
|
+
compareChatAgentCommits(agentId, commitA, commitB) {
|
|
552
|
+
return this.request('GET', `/v3/chat-commits/${encodeURIComponent(agentId)}/compare${qs({ commitA, commitB })}`);
|
|
553
|
+
}
|
|
554
|
+
/** List WhatsApp chat audit report batches (`GET /v1/chat-audit-reports/batches`). */
|
|
555
|
+
chatAuditReportBatches(query = {}) {
|
|
556
|
+
return this.request('GET', `/v1/chat-audit-reports/batches${qs(query)}`);
|
|
557
|
+
}
|
|
558
|
+
// --- Inbox & Human Handoff (`/inbox/*`) ------------------------------------
|
|
559
|
+
inbox(query = {}) {
|
|
560
|
+
return this.request('GET', `/inbox${qs(query)}`);
|
|
561
|
+
}
|
|
562
|
+
inboxUnreadContacts() {
|
|
563
|
+
return this.request('GET', '/inbox/unread-contacts');
|
|
564
|
+
}
|
|
565
|
+
inboxHumanHandoffs(channel) {
|
|
566
|
+
return this.request('GET', `/inbox/human-handoffs${qs({ channel })}`);
|
|
567
|
+
}
|
|
568
|
+
inboxReleaseHandoff(body) {
|
|
569
|
+
return this.request('DELETE', '/inbox/human-handoffs', body);
|
|
570
|
+
}
|
|
571
|
+
inboxContact(phone, query = {}) {
|
|
572
|
+
return this.request('GET', `/inbox/contact/${encodeURIComponent(phone)}${qs(query)}`);
|
|
573
|
+
}
|
|
574
|
+
inboxClearContact(phone, agentPhoneNumber) {
|
|
575
|
+
return this.request('DELETE', `/inbox/contact/${encodeURIComponent(phone)}${qs({ agentPhoneNumber })}`);
|
|
576
|
+
}
|
|
577
|
+
inboxDeassignChat(body) {
|
|
578
|
+
return this.request('POST', '/inbox/deassign-chat', body);
|
|
579
|
+
}
|
|
580
|
+
inboxExport(query = {}) {
|
|
581
|
+
return this.request('GET', `/inbox/export${qs(query)}`);
|
|
582
|
+
}
|
|
583
|
+
inboxTestThreads(agentPhoneNumber) {
|
|
584
|
+
return this.request('GET', `/inbox/test-threads${qs({ agentPhoneNumber })}`);
|
|
585
|
+
}
|
|
586
|
+
// --- WhatsApp Campaigns (`/wa-campaign/*`) ---------------------------------
|
|
587
|
+
listWaCampaigns() {
|
|
588
|
+
return this.request('GET', '/wa-campaign/getWACampaign');
|
|
589
|
+
}
|
|
590
|
+
waCampaignAnalytics(id) {
|
|
591
|
+
return this.request('GET', `/wa-campaign/getWACampaignAnalytics/${encodeURIComponent(id)}`);
|
|
592
|
+
}
|
|
593
|
+
waCampaignTimeseries(id, query = {}) {
|
|
594
|
+
return this.request('GET', `/wa-campaign/getWACampaignTimeseries/${encodeURIComponent(id)}${qs(query)}`);
|
|
595
|
+
}
|
|
596
|
+
exportWaCampaignContacts(id, query = {}) {
|
|
597
|
+
return this.requestBinary('GET', `/wa-campaign/exportWACampaignContacts/${encodeURIComponent(id)}${qs(query)}`);
|
|
598
|
+
}
|
|
599
|
+
sendWaCampaign(body) {
|
|
600
|
+
return this.request('POST', '/wa-campaign/send-bulk-template-message', body);
|
|
601
|
+
}
|
|
602
|
+
// --- Fine-Tuning (`/finetune/*`) -------------------------------------------
|
|
603
|
+
listFinetuneRecords(query = {}) {
|
|
604
|
+
return this.request('GET', `/finetune/list${qs(query)}`);
|
|
605
|
+
}
|
|
606
|
+
listFinetuneBuckets() {
|
|
607
|
+
return this.request('GET', '/finetune/buckets');
|
|
608
|
+
}
|
|
609
|
+
createFinetuneBucket(name) {
|
|
610
|
+
return this.request('POST', '/finetune/buckets', { name });
|
|
611
|
+
}
|
|
612
|
+
listFinetuneJobs(query = {}) {
|
|
613
|
+
return this.request('GET', `/finetune/jobs${qs({ page: query.page || 1, pageSize: query.pageSize || 100 })}`);
|
|
614
|
+
}
|
|
615
|
+
finetuneJobStatus(jobId) {
|
|
616
|
+
return this.request('POST', '/finetune/status', { job_id: jobId });
|
|
617
|
+
}
|
|
618
|
+
startFinetuneProcess(body) {
|
|
619
|
+
return this.request('POST', '/finetune/process', body);
|
|
620
|
+
}
|
|
621
|
+
addFinetunedModel(jobId) {
|
|
622
|
+
return this.request('POST', '/finetune/add-model', { job_id: jobId });
|
|
623
|
+
}
|
|
624
|
+
cancelFinetuneJob(jobId) {
|
|
625
|
+
return this.request('POST', '/finetune/cancel', { job_id: jobId });
|
|
626
|
+
}
|
|
627
|
+
deleteFinetuneRecord(callId) {
|
|
628
|
+
return this.request('DELETE', `/finetune/delete/${encodeURIComponent(callId)}`);
|
|
629
|
+
}
|
|
630
|
+
// --- Team Management (`/team-management/*`) --------------------------------
|
|
631
|
+
listTeamMembers() {
|
|
632
|
+
return this.request('GET', '/team-management/get-members');
|
|
633
|
+
}
|
|
634
|
+
listTeamRoles() {
|
|
635
|
+
return this.request('GET', '/team-management/roles');
|
|
636
|
+
}
|
|
637
|
+
createTeamRole(body) {
|
|
638
|
+
return this.request('POST', '/team-management/roles', body);
|
|
639
|
+
}
|
|
640
|
+
addTeamMember(body) {
|
|
641
|
+
return this.request('POST', '/team-management/add-member', body);
|
|
642
|
+
}
|
|
643
|
+
updateTeamMember(id, body) {
|
|
644
|
+
return this.request('PUT', `/team-management/update-member/${encodeURIComponent(id)}`, body);
|
|
645
|
+
}
|
|
646
|
+
removeTeamMember(id) {
|
|
647
|
+
return this.request('DELETE', `/team-management/remove-member/${encodeURIComponent(id)}`);
|
|
648
|
+
}
|
|
649
|
+
updateTeamWebhook(body) {
|
|
650
|
+
return this.request('PUT', '/team-management/update-webhook', body);
|
|
651
|
+
}
|
|
652
|
+
/** Server typo: body field is `callAalysisWebhook` (missing 'n'). */
|
|
653
|
+
updateCallAnalysisWebhook(callAalysisWebhook) {
|
|
654
|
+
return this.request('PUT', '/team-management/update-call-analysis-webhook', { callAalysisWebhook });
|
|
655
|
+
}
|
|
656
|
+
// --- Compliance & Verified Phone Numbers -----------------------------------
|
|
657
|
+
listCompliance() {
|
|
658
|
+
return this.request('GET', '/compliance');
|
|
659
|
+
}
|
|
660
|
+
createCompliance(body) {
|
|
661
|
+
return this.request('POST', '/compliance', body);
|
|
662
|
+
}
|
|
663
|
+
deleteCompliance(id) {
|
|
664
|
+
return this.request('DELETE', `/compliance/${encodeURIComponent(id)}`);
|
|
665
|
+
}
|
|
666
|
+
listVerifiedNumbers() {
|
|
667
|
+
return this.request('GET', '/verified-phone-numbers');
|
|
668
|
+
}
|
|
669
|
+
addVerifiedNumber(phoneNumber) {
|
|
670
|
+
return this.request('POST', '/verified-phone-numbers/add', { phoneNumber });
|
|
671
|
+
}
|
|
672
|
+
verifyPhoneNumberOtp(phoneNumber, otp) {
|
|
673
|
+
return this.request('POST', '/verified-phone-numbers/verify', { phoneNumber, otp });
|
|
674
|
+
}
|
|
675
|
+
deleteVerifiedNumber(id) {
|
|
676
|
+
return this.request('DELETE', `/verified-phone-numbers/${encodeURIComponent(id)}`);
|
|
677
|
+
}
|
|
678
|
+
// --- Integrations (`/integrations/*`, `/shopify/*`) ------------------------
|
|
679
|
+
listIntegrations() {
|
|
680
|
+
return this.request('GET', '/integrations');
|
|
681
|
+
}
|
|
682
|
+
createIntegration(body) {
|
|
683
|
+
return this.request('POST', '/integrations', body);
|
|
684
|
+
}
|
|
685
|
+
updateIntegration(id, body) {
|
|
686
|
+
return this.request('PUT', `/integrations/${encodeURIComponent(id)}`, body);
|
|
687
|
+
}
|
|
688
|
+
deleteIntegration(id) {
|
|
689
|
+
return this.request('DELETE', `/integrations/${encodeURIComponent(id)}`);
|
|
690
|
+
}
|
|
691
|
+
listSipTrunks() {
|
|
692
|
+
return this.request('GET', '/integrations/sip');
|
|
693
|
+
}
|
|
694
|
+
setAisensyConfig(agentId) {
|
|
695
|
+
return this.request('PUT', '/integrations/aisensy/config', { agentId });
|
|
696
|
+
}
|
|
697
|
+
listAisensyCampaigns() {
|
|
698
|
+
return this.request('GET', '/integrations/aisensy/pro/campaigns');
|
|
699
|
+
}
|
|
700
|
+
setHubspotConfig(agentId) {
|
|
701
|
+
return this.request('PUT', '/integrations/hubspot-plus/config', { agentId });
|
|
702
|
+
}
|
|
703
|
+
setShopifyConfig(body) {
|
|
704
|
+
return this.request('PUT', '/shopify/config', body);
|
|
705
|
+
}
|
|
490
706
|
// --- Call analyzers -------------------------------------------------------
|
|
491
707
|
listAnalyzers() { return this.request('GET', '/v1/call-analyzers'); }
|
|
492
708
|
// --- Audit reports (dashboard side) ---------------------------------------
|
|
@@ -516,7 +732,13 @@ function usesCookieAuth(path) {
|
|
|
516
732
|
// version save `PUT /v2/agents/:id?version=` — takes the cookie and answers
|
|
517
733
|
// the bearer with 401 (probed 21 October 2026 with getAgentVersions).
|
|
518
734
|
const route = path.split('?')[0];
|
|
519
|
-
|
|
735
|
+
if (route === '/v2/agents/' || route === '/v2/agents')
|
|
736
|
+
return false;
|
|
737
|
+
// /knowledge/user takes the cookie, but /knowledge and DELETE /knowledge/:id
|
|
738
|
+
// take the auth-token bearer (probed live: cookie -> 401, bearer -> 200/404).
|
|
739
|
+
if (route === '/knowledge' || (route.startsWith('/knowledge/') && route !== '/knowledge/user'))
|
|
740
|
+
return false;
|
|
741
|
+
return true;
|
|
520
742
|
}
|
|
521
743
|
/** `?a=1&b=2`, skipping undefined and empty. Mirrors the one in api.ts. */
|
|
522
744
|
function qs(params) {
|