@getsupervisor/agents-studio-sdk 1.17.0 → 1.19.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 CHANGED
@@ -1,3 +1,44 @@
1
+ ## v1.18.0
2
+
3
+ ## [1.18.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.17.0...v1.18.0) (2025-10-23)
4
+
5
+ ### Features
6
+
7
+ * add webhooks management API ([bb1a1fb](https://github.com/julio-supervisor/agents-studio-be/commit/bb1a1fb17f48a7a52e82c07d12d32f57240c8604))
8
+ * **docs:** add webhook terminology and definitions for agent association and URL reuse ([82985e8](https://github.com/julio-supervisor/agents-studio-be/commit/82985e8bbbc7e7cd2d0e15f0e77e0adc859d01a2))
9
+ * **openapi:** enhance webhook descriptions with optional agent association and URL reuse details ([fc9b2d9](https://github.com/julio-supervisor/agents-studio-be/commit/fc9b2d9099116541d841548adf935f9c0f4a0c99))
10
+ * **tests:** add WebhookEventKey setup and teardown for EventSubscriptionTypeormRepository tests ([b7c28c5](https://github.com/julio-supervisor/agents-studio-be/commit/b7c28c51bc86cf4bc08d83e511429a9cb8fab066))
11
+ * **tests:** enhance WebhookEventKey setup and teardown in event subscription tests ([b717c89](https://github.com/julio-supervisor/agents-studio-be/commit/b717c8916c0147b467044387d9e73988454cf74f))
12
+ * **webhooks:** add agent association to webhooks ([d2d5eb1](https://github.com/julio-supervisor/agents-studio-be/commit/d2d5eb175dc5c43c405a93f961ca70f2426f8d3f))
13
+ * **webhooks:** add webhook event catalog and related migrations ([91ceec2](https://github.com/julio-supervisor/agents-studio-be/commit/91ceec203706bc79ce775063f9a9a9ba9eb698ca))
14
+ * **webhooks:** implement event subscription and webhook entities, specifications, and factories ([7ba841e](https://github.com/julio-supervisor/agents-studio-be/commit/7ba841e21697ab2f38dedd8b5243091e250cff98))
15
+
16
+ ### Bug Fixes
17
+
18
+ * update EventSubscription references to use EventSubscriptionDetail ([a1ff2f6](https://github.com/julio-supervisor/agents-studio-be/commit/a1ff2f611748783c87dfe43c8597de0a2ee89ae4))
19
+ * update reference in EventSubscriptionListResponse from EventSubscriptionSummary to EventSubscriptionDetail ([9bc602f](https://github.com/julio-supervisor/agents-studio-be/commit/9bc602f14b36612ba993888e9c0354f6431b824e))
20
+
21
+
22
+ ## v1.17.0
23
+
24
+ ## [1.17.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.16.0...v1.17.0) (2025-10-22)
25
+
26
+ ### Features
27
+
28
+ * actualizar documentación del SDK y especificaciones de API, eliminando referencias a 'retell' y mejorando ejemplos ([362a379](https://github.com/julio-supervisor/agents-studio-be/commit/362a379f4b44123a19f9f8921fe7674994ecbf8c))
29
+ ## v1.16.0
30
+
31
+ ## [1.16.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.15.0...v1.16.0) (2025-10-22)
32
+
33
+ ### Features
34
+
35
+ * add centralized catalogs management API ([4a6cb3e](https://github.com/julio-supervisor/agents-studio-be/commit/4a6cb3ef36e5ed9f1752438df59cf3f7e94083c3))
36
+ * add tests and mappers for catalog items, including CRUD operations and specifications ([f20d939](https://github.com/julio-supervisor/agents-studio-be/commit/f20d939819e4e29bcfb9ae73fa5c0b3c87211bcd))
37
+ * **catalogs:** implement CatalogItem entity and related value objects ([7f06e93](https://github.com/julio-supervisor/agents-studio-be/commit/7f06e93288ed909b3db08380a4c47e4b9616bd04))
38
+ * refactor sorting logic and add unit tests for resolveSingleSort utility ([a8d9812](https://github.com/julio-supervisor/agents-studio-be/commit/a8d981219aaa4f2c91705ee121a08225436f4166))
39
+ * simplify toPrimitives method in CatalogItemMetadata class ([cf8d91c](https://github.com/julio-supervisor/agents-studio-be/commit/cf8d91c61c419cd487967311b1fedeeb8a439993))
40
+
41
+
1
42
  ## v1.15.0
2
43
 
3
44
  ## [1.15.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.14.0...v1.15.0) (2025-10-21)
package/dist/index.cjs CHANGED
@@ -44,6 +44,7 @@ __export(index_exports, {
44
44
  createHttp: () => createHttp,
45
45
  createToolsApi: () => createToolsApi,
46
46
  createVoicesApi: () => createVoicesApi,
47
+ createWebhooksApi: () => createWebhooksApi,
47
48
  createWorkspacesApi: () => createWorkspacesApi
48
49
  });
49
50
  module.exports = __toCommonJS(index_exports);
@@ -1143,6 +1144,27 @@ function createCatalogsApi(cfg) {
1143
1144
  }
1144
1145
 
1145
1146
  // src/api/tools.ts
1147
+ var IDEMPOTENCY_HEADER = "Idempotency-Key";
1148
+ var generateIdempotencyKey = (explicit) => {
1149
+ if (explicit && explicit.length > 0) {
1150
+ return explicit;
1151
+ }
1152
+ const globalRef = globalThis;
1153
+ const cryptoRef = globalRef?.crypto;
1154
+ if (cryptoRef?.randomUUID) {
1155
+ return cryptoRef.randomUUID();
1156
+ }
1157
+ if (cryptoRef?.getRandomValues) {
1158
+ const buffer = new Uint8Array(16);
1159
+ cryptoRef.getRandomValues(buffer);
1160
+ return Array.from(
1161
+ buffer,
1162
+ (byte) => byte.toString(16).padStart(2, "0")
1163
+ ).join("");
1164
+ }
1165
+ const randomChunk = () => Math.random().toString(36).slice(2, 10);
1166
+ return `idemp_${Date.now().toString(36)}_${randomChunk()}${randomChunk()}`;
1167
+ };
1146
1168
  var isFormData = (value) => {
1147
1169
  return typeof FormData !== "undefined" && value instanceof FormData;
1148
1170
  };
@@ -1225,18 +1247,26 @@ function createToolsApi(cfg) {
1225
1247
  );
1226
1248
  return res.json();
1227
1249
  },
1228
- async execute(toolId, payload) {
1250
+ async execute(toolId, payload, options = {}) {
1251
+ const idempotencyKey = generateIdempotencyKey(options.idempotencyKey);
1229
1252
  const res = await doFetch(`${base}/v1/tools/${toolId}/execute`, {
1230
1253
  method: "POST",
1231
- headers: jsonHeaders,
1254
+ headers: {
1255
+ ...jsonHeaders,
1256
+ [IDEMPOTENCY_HEADER]: idempotencyKey
1257
+ },
1232
1258
  body: JSON.stringify(payload)
1233
1259
  });
1234
1260
  return res.json();
1235
1261
  },
1236
- async connect(toolId, payload) {
1237
- const res = await doFetch(`${base}/v1/tools/${toolId}/connect`, {
1262
+ async connect(toolId, payload, options = {}) {
1263
+ const idempotencyKey = generateIdempotencyKey(options.idempotencyKey);
1264
+ const res = await doFetch(`${base}/v1/tools/${toolId}/connections`, {
1238
1265
  method: "POST",
1239
- headers: jsonHeaders,
1266
+ headers: {
1267
+ ...jsonHeaders,
1268
+ [IDEMPOTENCY_HEADER]: idempotencyKey
1269
+ },
1240
1270
  body: JSON.stringify(payload)
1241
1271
  });
1242
1272
  return res.json();
@@ -1282,6 +1312,117 @@ function createVoicesApi(cfg) {
1282
1312
  };
1283
1313
  }
1284
1314
 
1315
+ // src/api/webhooks.ts
1316
+ function createWebhooksApi(cfg) {
1317
+ const { base, doFetch } = createHttp(cfg);
1318
+ const jsonHeaders = { "content-type": "application/json" };
1319
+ const fetchWebhooksPage = async (options = {}) => {
1320
+ const query = serializeListOptions({
1321
+ page: options.page,
1322
+ limit: options.limit,
1323
+ sort: options.sort,
1324
+ fields: options.fields,
1325
+ include: options.include,
1326
+ search: options.search,
1327
+ filter: options.filter
1328
+ });
1329
+ const res = await doFetch(`${base}/v1/webhooks`, {
1330
+ method: "GET",
1331
+ query
1332
+ });
1333
+ return res.json();
1334
+ };
1335
+ return {
1336
+ async list(options = {}) {
1337
+ const normalized = { ...options ?? {} };
1338
+ const response = await fetchWebhooksPage(normalized);
1339
+ return attachPaginator(response, fetchWebhooksPage, normalized);
1340
+ },
1341
+ async create(payload) {
1342
+ const res = await doFetch(`${base}/v1/webhooks`, {
1343
+ method: "POST",
1344
+ headers: jsonHeaders,
1345
+ body: JSON.stringify(payload)
1346
+ });
1347
+ return res.json();
1348
+ },
1349
+ async get(webhookId) {
1350
+ const res = await doFetch(`${base}/v1/webhooks/${webhookId}`, {
1351
+ method: "GET"
1352
+ });
1353
+ return res.json();
1354
+ },
1355
+ async update(webhookId, payload) {
1356
+ const res = await doFetch(`${base}/v1/webhooks/${webhookId}`, {
1357
+ method: "PATCH",
1358
+ headers: jsonHeaders,
1359
+ body: JSON.stringify(payload)
1360
+ });
1361
+ return res.json();
1362
+ },
1363
+ async delete(webhookId) {
1364
+ await doFetch(`${base}/v1/webhooks/${webhookId}`, { method: "DELETE" });
1365
+ },
1366
+ // Subscriptions
1367
+ async listSubscriptions(webhookId, options = {}) {
1368
+ const fetchPage = async (opts) => {
1369
+ const query = serializeListOptions({
1370
+ page: opts.page,
1371
+ limit: opts.limit,
1372
+ sort: opts.sort,
1373
+ fields: opts.fields,
1374
+ include: opts.include,
1375
+ search: opts.search,
1376
+ filter: opts.filter
1377
+ });
1378
+ const res = await doFetch(
1379
+ `${base}/v1/webhooks/${webhookId}/subscriptions`,
1380
+ { method: "GET", query }
1381
+ );
1382
+ return res.json();
1383
+ };
1384
+ const normalized = { ...options ?? {} };
1385
+ const response = await fetchPage(normalized);
1386
+ return attachPaginator(response, fetchPage, normalized);
1387
+ },
1388
+ async createSubscription(webhookId, payload) {
1389
+ const res = await doFetch(
1390
+ `${base}/v1/webhooks/${webhookId}/subscriptions`,
1391
+ {
1392
+ method: "POST",
1393
+ headers: jsonHeaders,
1394
+ body: JSON.stringify(payload)
1395
+ }
1396
+ );
1397
+ return res.json();
1398
+ },
1399
+ async getSubscription(webhookId, subscriptionId) {
1400
+ const res = await doFetch(
1401
+ `${base}/v1/webhooks/${webhookId}/subscriptions/${subscriptionId}`,
1402
+ { method: "GET" }
1403
+ );
1404
+ return res.json();
1405
+ },
1406
+ async updateSubscription(webhookId, subscriptionId, payload) {
1407
+ const res = await doFetch(
1408
+ `${base}/v1/webhooks/${webhookId}/subscriptions/${subscriptionId}`,
1409
+ {
1410
+ method: "PATCH",
1411
+ headers: jsonHeaders,
1412
+ body: JSON.stringify(payload)
1413
+ }
1414
+ );
1415
+ return res.json();
1416
+ },
1417
+ async deleteSubscription(webhookId, subscriptionId) {
1418
+ await doFetch(
1419
+ `${base}/v1/webhooks/${webhookId}/subscriptions/${subscriptionId}`,
1420
+ { method: "DELETE" }
1421
+ );
1422
+ }
1423
+ };
1424
+ }
1425
+
1285
1426
  // src/api/workspaces.ts
1286
1427
  function createWorkspacesApi(cfg) {
1287
1428
  const { base, doFetch } = createHttp(cfg);
@@ -1363,6 +1504,7 @@ function createClient(initialCfg) {
1363
1504
  const voicesApi = createVoicesApi(runtimeCfg);
1364
1505
  const apiKeysApi = createApiKeysApi(runtimeCfg);
1365
1506
  const catalogsApi = createCatalogsApi(runtimeCfg);
1507
+ const webhooksApi = createWebhooksApi(runtimeCfg);
1366
1508
  const agentsApi = createAgentsApi(runtimeCfg, {
1367
1509
  instructionsApi,
1368
1510
  tagsApi,
@@ -1417,7 +1559,8 @@ function createClient(initialCfg) {
1417
1559
  tools: createToolsApi(runtimeCfg),
1418
1560
  catalogs: catalogsApi,
1419
1561
  voices: voicesApi,
1420
- apiKeys: apiKeysApi
1562
+ apiKeys: apiKeysApi,
1563
+ webhooks: webhooksApi
1421
1564
  };
1422
1565
  return {
1423
1566
  ...apis,
@@ -1501,6 +1644,7 @@ function createClient(initialCfg) {
1501
1644
  createHttp,
1502
1645
  createToolsApi,
1503
1646
  createVoicesApi,
1647
+ createWebhooksApi,
1504
1648
  createWorkspacesApi
1505
1649
  });
1506
1650
  //# sourceMappingURL=index.cjs.map