@getsupervisor/agents-studio-sdk 1.39.0-patch.1 → 1.40.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/CHANGELOG.md +11 -0
- package/README.md +0 -22
- package/dist/index.cjs +50 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -87
- package/dist/index.d.ts +14 -87
- package/dist/index.js +50 -128
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## v1.34.0
|
|
2
|
+
|
|
3
|
+
## [1.34.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.33.0...v1.34.0) (2025-11-16)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* enhance instruction management by adding active and non-deleted filtering, and integrate instructions into the Retell blueprint mapping ([baadb5f](https://github.com/julio-supervisor/agents-studio-be/commit/baadb5f561749d441c4757435fb920bb48556d7d))
|
|
8
|
+
* implement VoiceBlueprintSyncService for Retell synchronization ([6b8f03f](https://github.com/julio-supervisor/agents-studio-be/commit/6b8f03f77ca1d2b91a9628db055e2799aa039f53))
|
|
9
|
+
* introduce buildClientMock helper for consistent workspaceId handling in tests ([ae6eb30](https://github.com/julio-supervisor/agents-studio-be/commit/ae6eb305b16f677dea03a21bdfc8559c13cc641a))
|
|
10
|
+
|
|
11
|
+
|
|
1
12
|
## v1.33.0
|
|
2
13
|
|
|
3
14
|
## [1.33.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.32.0...v1.33.0) (2025-11-14)
|
package/README.md
CHANGED
|
@@ -73,28 +73,6 @@ await client.tools.uploadResource(tools.data[0].identifier, formData);
|
|
|
73
73
|
|
|
74
74
|
// eliminar un agente
|
|
75
75
|
await client.agents.delete(agent.agentId);
|
|
76
|
-
|
|
77
|
-
// campañas masivas desde CSV
|
|
78
|
-
const campaign = await client.campaigns.create(agent.agentId, versionId, {
|
|
79
|
-
name: 'Holiday follow-up',
|
|
80
|
-
objective: 'Re-engage dormant customers',
|
|
81
|
-
file: new File([csvBlob], 'campaign-rows.csv', { type: 'text/csv' }),
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const recentCampaigns = await client.campaigns.list({ limit: 10 });
|
|
85
|
-
console.log(recentCampaigns.data.map((item) => item.name));
|
|
86
|
-
|
|
87
|
-
// ejecuciones individuales con correlación al toolExecutionId
|
|
88
|
-
const executions = await client.campaigns.listExecutions(campaign.campaignId, {
|
|
89
|
-
limit: 20,
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
executions.data.forEach((row) => {
|
|
93
|
-
console.log(
|
|
94
|
-
`Row ${row.rowNumber} => status=${row.status} agentExecutionId=${row.agentExecutionId}`,
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
// agentExecutionId coincide con el toolExecutionId expuesto por client.tools.execute
|
|
98
76
|
```
|
|
99
77
|
|
|
100
78
|
## Catálogos (Catalogs)
|
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,6 @@ __export(index_exports, {
|
|
|
42
42
|
createAgentVersionsApi: () => createAgentVersionsApi,
|
|
43
43
|
createAgentsApi: () => createAgentsApi,
|
|
44
44
|
createApiKeysApi: () => createApiKeysApi,
|
|
45
|
-
createCampaignsApi: () => createCampaignsApi,
|
|
46
45
|
createCatalogTemplatesApi: () => createCatalogTemplatesApi,
|
|
47
46
|
createCatalogsApi: () => createCatalogsApi,
|
|
48
47
|
createClient: () => createClient,
|
|
@@ -516,56 +515,6 @@ function attachPaginator(response, fetchPage, options) {
|
|
|
516
515
|
});
|
|
517
516
|
}
|
|
518
517
|
|
|
519
|
-
// src/api/agent-schedule.ts
|
|
520
|
-
function createAgentScheduleApi(cfg) {
|
|
521
|
-
const { base, doFetch } = createHttp(cfg);
|
|
522
|
-
const jsonHeaders = { "content-type": "application/json" };
|
|
523
|
-
const fetchSchedulesPage = async (agentId, options = {}) => {
|
|
524
|
-
const query = serializeListOptions({ ...options ?? {} });
|
|
525
|
-
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
526
|
-
method: "GET",
|
|
527
|
-
query
|
|
528
|
-
});
|
|
529
|
-
return res.json();
|
|
530
|
-
};
|
|
531
|
-
return {
|
|
532
|
-
async list(agentId, options = {}) {
|
|
533
|
-
const normalized = { ...options ?? {} };
|
|
534
|
-
const fetchPage = (pageOptions) => fetchSchedulesPage(agentId, pageOptions);
|
|
535
|
-
const response = await fetchPage(normalized);
|
|
536
|
-
return attachPaginator(response, fetchPage, normalized);
|
|
537
|
-
},
|
|
538
|
-
async get(agentId, scheduleId) {
|
|
539
|
-
const res = await doFetch(
|
|
540
|
-
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
541
|
-
{
|
|
542
|
-
method: "GET"
|
|
543
|
-
}
|
|
544
|
-
);
|
|
545
|
-
return res.json();
|
|
546
|
-
},
|
|
547
|
-
async create(agentId, payload) {
|
|
548
|
-
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
549
|
-
method: "POST",
|
|
550
|
-
headers: jsonHeaders,
|
|
551
|
-
body: JSON.stringify(payload)
|
|
552
|
-
});
|
|
553
|
-
return res.json();
|
|
554
|
-
},
|
|
555
|
-
async update(agentId, scheduleId, payload) {
|
|
556
|
-
const res = await doFetch(
|
|
557
|
-
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
558
|
-
{
|
|
559
|
-
method: "PUT",
|
|
560
|
-
headers: jsonHeaders,
|
|
561
|
-
body: JSON.stringify(payload)
|
|
562
|
-
}
|
|
563
|
-
);
|
|
564
|
-
return res.json();
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
|
|
569
518
|
// src/api/agent-schedule-exceptions.ts
|
|
570
519
|
function createAgentScheduleExceptionsApi(cfg) {
|
|
571
520
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -632,6 +581,56 @@ function createAgentScheduleExceptionsApi(cfg) {
|
|
|
632
581
|
};
|
|
633
582
|
}
|
|
634
583
|
|
|
584
|
+
// src/api/agent-schedule.ts
|
|
585
|
+
function createAgentScheduleApi(cfg) {
|
|
586
|
+
const { base, doFetch } = createHttp(cfg);
|
|
587
|
+
const jsonHeaders = { "content-type": "application/json" };
|
|
588
|
+
const fetchSchedulesPage = async (agentId, options = {}) => {
|
|
589
|
+
const query = serializeListOptions({ ...options ?? {} });
|
|
590
|
+
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
591
|
+
method: "GET",
|
|
592
|
+
query
|
|
593
|
+
});
|
|
594
|
+
return res.json();
|
|
595
|
+
};
|
|
596
|
+
return {
|
|
597
|
+
async list(agentId, options = {}) {
|
|
598
|
+
const normalized = { ...options ?? {} };
|
|
599
|
+
const fetchPage = (pageOptions) => fetchSchedulesPage(agentId, pageOptions);
|
|
600
|
+
const response = await fetchPage(normalized);
|
|
601
|
+
return attachPaginator(response, fetchPage, normalized);
|
|
602
|
+
},
|
|
603
|
+
async get(agentId, scheduleId) {
|
|
604
|
+
const res = await doFetch(
|
|
605
|
+
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
606
|
+
{
|
|
607
|
+
method: "GET"
|
|
608
|
+
}
|
|
609
|
+
);
|
|
610
|
+
return res.json();
|
|
611
|
+
},
|
|
612
|
+
async create(agentId, payload) {
|
|
613
|
+
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
614
|
+
method: "POST",
|
|
615
|
+
headers: jsonHeaders,
|
|
616
|
+
body: JSON.stringify(payload)
|
|
617
|
+
});
|
|
618
|
+
return res.json();
|
|
619
|
+
},
|
|
620
|
+
async update(agentId, scheduleId, payload) {
|
|
621
|
+
const res = await doFetch(
|
|
622
|
+
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
623
|
+
{
|
|
624
|
+
method: "PUT",
|
|
625
|
+
headers: jsonHeaders,
|
|
626
|
+
body: JSON.stringify(payload)
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
return res.json();
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
|
|
635
634
|
// src/api/agent-stage-triggers.ts
|
|
636
635
|
function createAgentStageTriggersApi(cfg) {
|
|
637
636
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -1300,82 +1299,6 @@ function createApiKeysApi(cfg) {
|
|
|
1300
1299
|
};
|
|
1301
1300
|
}
|
|
1302
1301
|
|
|
1303
|
-
// src/api/campaigns.ts
|
|
1304
|
-
function createCampaignsApi(cfg) {
|
|
1305
|
-
const { base, doFetch } = createHttp(cfg);
|
|
1306
|
-
const isFormData2 = (value) => {
|
|
1307
|
-
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
1308
|
-
};
|
|
1309
|
-
const fetchCampaignsPage = async (options = {}) => {
|
|
1310
|
-
const query = serializeListOptions(options ?? {});
|
|
1311
|
-
const res = await doFetch(`${base}/campaigns`, {
|
|
1312
|
-
method: "GET",
|
|
1313
|
-
query
|
|
1314
|
-
});
|
|
1315
|
-
return res.json();
|
|
1316
|
-
};
|
|
1317
|
-
const fetchExecutionsPage = async (campaignId, options = {}) => {
|
|
1318
|
-
const query = serializeListOptions({
|
|
1319
|
-
page: options.page,
|
|
1320
|
-
limit: options.limit
|
|
1321
|
-
});
|
|
1322
|
-
const res = await doFetch(`${base}/campaigns/${campaignId}/executions`, {
|
|
1323
|
-
method: "GET",
|
|
1324
|
-
query
|
|
1325
|
-
});
|
|
1326
|
-
return res.json();
|
|
1327
|
-
};
|
|
1328
|
-
const buildMultipart = (payload) => {
|
|
1329
|
-
if (isFormData2(payload)) {
|
|
1330
|
-
return payload;
|
|
1331
|
-
}
|
|
1332
|
-
if (typeof FormData === "undefined") {
|
|
1333
|
-
throw new TypeError(
|
|
1334
|
-
"FormData is not available in this environment. Pass a FormData instance instead."
|
|
1335
|
-
);
|
|
1336
|
-
}
|
|
1337
|
-
const form = new FormData();
|
|
1338
|
-
form.append("name", payload.name);
|
|
1339
|
-
if (payload.objective !== void 0 && payload.objective !== null) {
|
|
1340
|
-
form.append("objective", payload.objective);
|
|
1341
|
-
}
|
|
1342
|
-
form.append("file", payload.file);
|
|
1343
|
-
return form;
|
|
1344
|
-
};
|
|
1345
|
-
return {
|
|
1346
|
-
async list(options = {}) {
|
|
1347
|
-
const normalizedOptions = { ...options ?? {} };
|
|
1348
|
-
const response = await fetchCampaignsPage(normalizedOptions);
|
|
1349
|
-
return attachPaginator(response, fetchCampaignsPage, normalizedOptions);
|
|
1350
|
-
},
|
|
1351
|
-
async get(campaignId) {
|
|
1352
|
-
const res = await doFetch(`${base}/campaigns/${campaignId}`, {
|
|
1353
|
-
method: "GET"
|
|
1354
|
-
});
|
|
1355
|
-
return res.json();
|
|
1356
|
-
},
|
|
1357
|
-
async create(agentId, versionId, payload) {
|
|
1358
|
-
const body = buildMultipart(payload);
|
|
1359
|
-
const res = await doFetch(
|
|
1360
|
-
`${base}/agents/${agentId}/versions/${versionId}/campaigns`,
|
|
1361
|
-
{
|
|
1362
|
-
method: "POST",
|
|
1363
|
-
body
|
|
1364
|
-
}
|
|
1365
|
-
);
|
|
1366
|
-
return res.json();
|
|
1367
|
-
},
|
|
1368
|
-
async listExecutions(campaignId, options = {}) {
|
|
1369
|
-
const normalizedOptions = {
|
|
1370
|
-
...options ?? {}
|
|
1371
|
-
};
|
|
1372
|
-
const response = await fetchExecutionsPage(campaignId, normalizedOptions);
|
|
1373
|
-
const fetchPage = (opts) => fetchExecutionsPage(campaignId, opts);
|
|
1374
|
-
return attachPaginator(response, fetchPage, normalizedOptions);
|
|
1375
|
-
}
|
|
1376
|
-
};
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
1302
|
// src/api/catalog-templates.ts
|
|
1380
1303
|
function createCatalogTemplatesApi(cfg) {
|
|
1381
1304
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -2032,7 +1955,6 @@ function createClient(initialCfg) {
|
|
|
2032
1955
|
...catalogsApi,
|
|
2033
1956
|
templates: catalogTemplatesApi
|
|
2034
1957
|
},
|
|
2035
|
-
campaigns: createCampaignsApi(runtimeCfg),
|
|
2036
1958
|
voices: voicesApi,
|
|
2037
1959
|
apiKeys: apiKeysApi,
|
|
2038
1960
|
webhooks: webhooksApi
|
|
@@ -2117,7 +2039,6 @@ function createClient(initialCfg) {
|
|
|
2117
2039
|
createAgentVersionsApi,
|
|
2118
2040
|
createAgentsApi,
|
|
2119
2041
|
createApiKeysApi,
|
|
2120
|
-
createCampaignsApi,
|
|
2121
2042
|
createCatalogTemplatesApi,
|
|
2122
2043
|
createCatalogsApi,
|
|
2123
2044
|
createClient,
|