@bluecopa/core 0.1.83 → 0.1.84

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/index.es.js CHANGED
@@ -149,7 +149,7 @@ async function getAllUsers() {
149
149
  throw { message, status };
150
150
  }
151
151
  }
152
- const index$p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152
+ const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
153
153
  __proto__: null,
154
154
  getAllUsers,
155
155
  getLoggedInUserDetails
@@ -171,7 +171,7 @@ async function triggerHttpWorkflowById({
171
171
  throw { message, status };
172
172
  }
173
173
  }
174
- async function triggerWorkflowById$1({
174
+ async function triggerWorkflowById({
175
175
  parentId,
176
176
  triggerBy
177
177
  }) {
@@ -229,13 +229,13 @@ async function getAllHttpTriggers() {
229
229
  throw { message, status };
230
230
  }
231
231
  }
232
- const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
232
+ const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
233
233
  __proto__: null,
234
234
  WorkflowStatus,
235
235
  getAllHttpTriggers,
236
236
  getWorkflowInstanceStatusById,
237
237
  triggerHttpWorkflowById,
238
- triggerWorkflowById: triggerWorkflowById$1
238
+ triggerWorkflowById
239
239
  }, Symbol.toStringTag, { value: "Module" }));
240
240
  async function getFileUrlByFileId({
241
241
  key,
@@ -361,7 +361,7 @@ async function getFileByFolderIdAndName({
361
361
  throw data !== void 0 ? { message, status, data } : { message, status };
362
362
  }
363
363
  }
364
- const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
364
+ const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
365
365
  __proto__: null,
366
366
  fileDownload,
367
367
  fileUpload,
@@ -456,7 +456,7 @@ const runDefinition = async (props) => {
456
456
  };
457
457
  }
458
458
  };
459
- const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
459
+ const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
460
460
  __proto__: null,
461
461
  runDefinition,
462
462
  runPublishedDefinition,
@@ -494,7 +494,7 @@ const getWorksheetsByType = async (type) => {
494
494
  throw { message, status };
495
495
  }
496
496
  };
497
- const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
497
+ const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
498
498
  __proto__: null,
499
499
  getWorksheets,
500
500
  getWorksheetsByType
@@ -10060,7 +10060,7 @@ async function applySolutionBindings(fileRead, definitionType) {
10060
10060
  const bindings = await fetchSolutionBindings();
10061
10061
  return applyBindings(fileRead, bindings, definitionType);
10062
10062
  }
10063
- const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10063
+ const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10064
10064
  __proto__: null,
10065
10065
  applyBindings,
10066
10066
  applySolutionBindings,
@@ -10125,7 +10125,7 @@ const resolveBoundId = (rawId, bindings) => {
10125
10125
  };
10126
10126
  const getData$3 = async (metricSheetId, options) => {
10127
10127
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
10128
- const bindings = await fetchSolutionBindings();
10128
+ const bindings = (options == null ? void 0 : options.solutionBindings) ?? await fetchSolutionBindings();
10129
10129
  const resolvedMetricSheetId = resolveBoundId(metricSheetId, bindings);
10130
10130
  const worksheets = await getWorksheets([resolvedMetricSheetId]);
10131
10131
  if (_.isEmpty(worksheets)) return {};
@@ -10233,7 +10233,8 @@ const getData$3 = async (metricSheetId, options) => {
10233
10233
  lastModifiedDate: hydratedSheet.lastModifiedDate
10234
10234
  },
10235
10235
  variable: variableName,
10236
- describe: parentTableVariable
10236
+ describe: parentTableVariable,
10237
+ solutionBindings: bindings
10237
10238
  })
10238
10239
  );
10239
10240
  });
@@ -10247,7 +10248,8 @@ const getData$3 = async (metricSheetId, options) => {
10247
10248
  lastModifiedDate: hydratedSheet.lastModifiedDate
10248
10249
  },
10249
10250
  variable: variableName,
10250
- describe: parentTableVariable
10251
+ describe: parentTableVariable,
10252
+ solutionBindings: bindings
10251
10253
  })).data;
10252
10254
  resultData = result.data;
10253
10255
  }
@@ -10255,7 +10257,7 @@ const getData$3 = async (metricSheetId, options) => {
10255
10257
  resultData = _.flatten(resultData);
10256
10258
  return { data: resultData };
10257
10259
  };
10258
- const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10260
+ const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10259
10261
  __proto__: null,
10260
10262
  getData: getData$3
10261
10263
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10410,7 +10412,7 @@ async function checkSubscriptionStatus(userId, threadId) {
10410
10412
  throw { message, status };
10411
10413
  }
10412
10414
  }
10413
- const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10415
+ const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10414
10416
  __proto__: null,
10415
10417
  checkSubscriptionStatus,
10416
10418
  createThread,
@@ -10615,7 +10617,7 @@ const getAllDatasets = async () => {
10615
10617
  throw { message, status };
10616
10618
  }
10617
10619
  };
10618
- const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10620
+ const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10619
10621
  __proto__: null,
10620
10622
  getAllDatasets,
10621
10623
  getData: getData$2,
@@ -10934,7 +10936,7 @@ const deleteRow = async (tableId, rowId, idField = "_copa_id") => {
10934
10936
  throw { message, status };
10935
10937
  }
10936
10938
  };
10937
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10939
+ const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10938
10940
  __proto__: null,
10939
10941
  deleteRow,
10940
10942
  getData: getData$1,
@@ -11028,7 +11030,7 @@ async function publishWorkbook({
11028
11030
  throw { message, status };
11029
11031
  }
11030
11032
  }
11031
- const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11033
+ const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11032
11034
  __proto__: null,
11033
11035
  getPublishedWorkbookById,
11034
11036
  getWorkbookDetails,
@@ -11296,7 +11298,7 @@ const getRunResultById = async (runId) => {
11296
11298
  throw { message, status };
11297
11299
  }
11298
11300
  };
11299
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11301
+ const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11300
11302
  __proto__: null,
11301
11303
  createNewRun,
11302
11304
  getData,
@@ -11326,7 +11328,7 @@ async function getTaskDetails({
11326
11328
  throw { message, status };
11327
11329
  }
11328
11330
  }
11329
- const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11331
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11330
11332
  __proto__: null,
11331
11333
  getTaskDetails
11332
11334
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11372,7 +11374,7 @@ async function getAllReconWorkflows() {
11372
11374
  throw { message, status };
11373
11375
  }
11374
11376
  }
11375
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11377
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11376
11378
  __proto__: null,
11377
11379
  getAllReconWorkflows,
11378
11380
  runRecon
@@ -11473,7 +11475,7 @@ async function createOrUpdateForm({
11473
11475
  throw { message, status: status2 };
11474
11476
  }
11475
11477
  }
11476
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11478
+ const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11477
11479
  __proto__: null,
11478
11480
  createOrUpdateForm,
11479
11481
  getFormById,
@@ -11514,7 +11516,7 @@ async function createAuditLog(params) {
11514
11516
  throw { message, status };
11515
11517
  }
11516
11518
  }
11517
- const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11519
+ const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11518
11520
  __proto__: null,
11519
11521
  createAuditLog,
11520
11522
  getAuditLogs
@@ -11533,7 +11535,7 @@ async function getAllTemplatedPipelines() {
11533
11535
  throw { message, status };
11534
11536
  }
11535
11537
  }
11536
- const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11538
+ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11537
11539
  __proto__: null,
11538
11540
  getAllTemplatedPipelines
11539
11541
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11658,7 +11660,7 @@ async function deleteProcessTrigger(id) {
11658
11660
  throw { message, status };
11659
11661
  }
11660
11662
  }
11661
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11663
+ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11662
11664
  __proto__: null,
11663
11665
  deleteProcessTrigger,
11664
11666
  getTriggersBySheet,
@@ -11756,7 +11758,7 @@ async function createInboxItemPerUser(data) {
11756
11758
  throw { message, status };
11757
11759
  }
11758
11760
  }
11759
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11761
+ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11760
11762
  __proto__: null,
11761
11763
  createInboxItemPerUser,
11762
11764
  getAllInboxItems,
@@ -11784,7 +11786,7 @@ async function getPermissions(params) {
11784
11786
  throw { message, status };
11785
11787
  }
11786
11788
  }
11787
- const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11789
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11788
11790
  __proto__: null,
11789
11791
  getPermissions
11790
11792
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11802,7 +11804,7 @@ async function getClientIp() {
11802
11804
  throw { message, status };
11803
11805
  }
11804
11806
  }
11805
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11807
+ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11806
11808
  __proto__: null,
11807
11809
  getClientIp
11808
11810
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11937,7 +11939,7 @@ async function getMessageBySenderId(params) {
11937
11939
  throw { message, status };
11938
11940
  }
11939
11941
  }
11940
- const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11942
+ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11941
11943
  __proto__: null,
11942
11944
  createConversation,
11943
11945
  getAllConversations,
@@ -12202,7 +12204,7 @@ async function agentGetCallFromHold(token, sessionSid, holdType = "SIMPLE") {
12202
12204
  throw { message, status };
12203
12205
  }
12204
12206
  }
12205
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12207
+ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12206
12208
  __proto__: null,
12207
12209
  agentDisconnect,
12208
12210
  agentGetCallFromHold,
@@ -12224,398 +12226,6 @@ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
12224
12226
  processManualDial,
12225
12227
  refreshToken
12226
12228
  }, Symbol.toStringTag, { value: "Module" }));
12227
- const BASE$4 = "/webcron/webhooks";
12228
- async function listWebhooks() {
12229
- var _a, _b, _c, _d;
12230
- try {
12231
- const response = await apiClient.get(BASE$4);
12232
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12233
- } catch (error) {
12234
- const e = error;
12235
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to list webhooks", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12236
- }
12237
- }
12238
- async function createWebhook(data) {
12239
- var _a, _b, _c, _d, _e, _f;
12240
- if (!((_a = data.name) == null ? void 0 : _a.trim())) throw { message: "name is required", status: 400 };
12241
- if (!((_b = data.url) == null ? void 0 : _b.trim())) throw { message: "url is required", status: 400 };
12242
- try {
12243
- const response = await apiClient.post(BASE$4, data);
12244
- return ((_c = response.data) == null ? void 0 : _c.data) ?? response.data;
12245
- } catch (error) {
12246
- const e = error;
12247
- throw { message: ((_e = (_d = e.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || "Failed to create webhook", status: ((_f = e.response) == null ? void 0 : _f.status) || 500 };
12248
- }
12249
- }
12250
- async function getWebhook(id) {
12251
- var _a, _b, _c, _d;
12252
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12253
- try {
12254
- const response = await apiClient.get(`${BASE$4}/${id}`);
12255
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12256
- } catch (error) {
12257
- const e = error;
12258
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get webhook", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12259
- }
12260
- }
12261
- async function updateWebhook(id, data) {
12262
- var _a, _b, _c, _d;
12263
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12264
- try {
12265
- const response = await apiClient.put(`${BASE$4}/${id}`, data);
12266
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12267
- } catch (error) {
12268
- const e = error;
12269
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to update webhook", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12270
- }
12271
- }
12272
- async function deleteWebhook(id) {
12273
- var _a, _b, _c;
12274
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12275
- try {
12276
- await apiClient.delete(`${BASE$4}/${id}`);
12277
- } catch (error) {
12278
- const e = error;
12279
- throw { message: ((_b = (_a = e.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Failed to delete webhook", status: ((_c = e.response) == null ? void 0 : _c.status) || 500 };
12280
- }
12281
- }
12282
- async function testWebhook(id) {
12283
- var _a, _b, _c, _d;
12284
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12285
- try {
12286
- const response = await apiClient.post(`${BASE$4}/${id}/test`);
12287
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12288
- } catch (error) {
12289
- const e = error;
12290
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to test webhook", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12291
- }
12292
- }
12293
- async function getWebhookExecutions(id, params) {
12294
- var _a, _b, _c, _d;
12295
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12296
- try {
12297
- const response = await apiClient.get(`${BASE$4}/${id}/executions`, { params });
12298
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12299
- } catch (error) {
12300
- const e = error;
12301
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get webhook executions", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12302
- }
12303
- }
12304
- async function getWebhookSchedules(id) {
12305
- var _a, _b, _c, _d;
12306
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12307
- try {
12308
- const response = await apiClient.get(`${BASE$4}/${id}/schedules`);
12309
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12310
- } catch (error) {
12311
- const e = error;
12312
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get webhook schedules", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12313
- }
12314
- }
12315
- async function createWebhookSchedule(webhookId, data) {
12316
- var _a, _b, _c, _d;
12317
- if (!(webhookId == null ? void 0 : webhookId.trim())) throw { message: "webhookId is required", status: 400 };
12318
- try {
12319
- const response = await apiClient.post(`${BASE$4}/${webhookId}/schedules`, data);
12320
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12321
- } catch (error) {
12322
- const e = error;
12323
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to create schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12324
- }
12325
- }
12326
- const BASE$3 = "/webcron/schedules";
12327
- async function getSchedule(id) {
12328
- var _a, _b, _c, _d;
12329
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12330
- try {
12331
- const response = await apiClient.get(`${BASE$3}/${id}`);
12332
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12333
- } catch (error) {
12334
- const e = error;
12335
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12336
- }
12337
- }
12338
- async function updateSchedule(id, data) {
12339
- var _a, _b, _c, _d;
12340
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12341
- try {
12342
- const response = await apiClient.put(`${BASE$3}/${id}`, data);
12343
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12344
- } catch (error) {
12345
- const e = error;
12346
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to update schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12347
- }
12348
- }
12349
- async function deleteSchedule(id) {
12350
- var _a, _b, _c;
12351
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12352
- try {
12353
- await apiClient.delete(`${BASE$3}/${id}`);
12354
- } catch (error) {
12355
- const e = error;
12356
- throw { message: ((_b = (_a = e.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Failed to delete schedule", status: ((_c = e.response) == null ? void 0 : _c.status) || 500 };
12357
- }
12358
- }
12359
- async function pauseSchedule(id) {
12360
- var _a, _b, _c, _d;
12361
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12362
- try {
12363
- const response = await apiClient.post(`${BASE$3}/${id}/pause`);
12364
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12365
- } catch (error) {
12366
- const e = error;
12367
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to pause schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12368
- }
12369
- }
12370
- async function resumeSchedule(id) {
12371
- var _a, _b, _c, _d;
12372
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12373
- try {
12374
- const response = await apiClient.post(`${BASE$3}/${id}/resume`);
12375
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12376
- } catch (error) {
12377
- const e = error;
12378
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to resume schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12379
- }
12380
- }
12381
- async function triggerSchedule(id) {
12382
- var _a, _b, _c, _d;
12383
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12384
- try {
12385
- const response = await apiClient.post(`${BASE$3}/${id}/trigger`);
12386
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12387
- } catch (error) {
12388
- const e = error;
12389
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to trigger schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12390
- }
12391
- }
12392
- const BASE$2 = "/webcron/executions";
12393
- async function listExecutions(params) {
12394
- var _a, _b, _c, _d;
12395
- try {
12396
- const response = await apiClient.get(BASE$2, { params });
12397
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12398
- } catch (error) {
12399
- const e = error;
12400
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to list executions", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12401
- }
12402
- }
12403
- async function getExecution(id) {
12404
- var _a, _b, _c, _d;
12405
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12406
- try {
12407
- const response = await apiClient.get(`${BASE$2}/${id}`);
12408
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12409
- } catch (error) {
12410
- const e = error;
12411
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get execution", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12412
- }
12413
- }
12414
- async function retryExecution(id) {
12415
- var _a, _b, _c, _d;
12416
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12417
- try {
12418
- const response = await apiClient.post(`${BASE$2}/${id}/retry`);
12419
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12420
- } catch (error) {
12421
- const e = error;
12422
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to retry execution", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12423
- }
12424
- }
12425
- const BASE$1 = "/webcron/tasks";
12426
- async function listTasks() {
12427
- var _a, _b, _c, _d;
12428
- try {
12429
- const response = await apiClient.get(BASE$1);
12430
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12431
- } catch (error) {
12432
- const e = error;
12433
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to list tasks", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12434
- }
12435
- }
12436
- async function createTask(data) {
12437
- var _a, _b, _c, _d, _e;
12438
- if (!((_a = data.webhookId) == null ? void 0 : _a.trim())) throw { message: "webhookId is required", status: 400 };
12439
- try {
12440
- const response = await apiClient.post(BASE$1, data);
12441
- return ((_b = response.data) == null ? void 0 : _b.data) ?? response.data;
12442
- } catch (error) {
12443
- const e = error;
12444
- throw { message: ((_d = (_c = e.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) || "Failed to create task", status: ((_e = e.response) == null ? void 0 : _e.status) || 500 };
12445
- }
12446
- }
12447
- async function getTask(id) {
12448
- var _a, _b, _c, _d;
12449
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12450
- try {
12451
- const response = await apiClient.get(`${BASE$1}/${id}`);
12452
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12453
- } catch (error) {
12454
- const e = error;
12455
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get task", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12456
- }
12457
- }
12458
- async function cancelTask(id) {
12459
- var _a, _b, _c, _d;
12460
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12461
- try {
12462
- const response = await apiClient.post(`${BASE$1}/${id}/cancel`);
12463
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12464
- } catch (error) {
12465
- const e = error;
12466
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to cancel task", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12467
- }
12468
- }
12469
- async function retryTask(id) {
12470
- var _a, _b, _c, _d;
12471
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12472
- try {
12473
- const response = await apiClient.post(`${BASE$1}/${id}/retry`);
12474
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12475
- } catch (error) {
12476
- const e = error;
12477
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to retry task", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12478
- }
12479
- }
12480
- async function progressTask(id, data) {
12481
- var _a, _b, _c;
12482
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12483
- try {
12484
- await apiClient.post(`${BASE$1}/${id}/progress`, data);
12485
- } catch (error) {
12486
- const e = error;
12487
- throw { message: ((_b = (_a = e.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Failed to log task progress", status: ((_c = e.response) == null ? void 0 : _c.status) || 500 };
12488
- }
12489
- }
12490
- async function signalTask(id, data, branchId) {
12491
- var _a, _b, _c, _d;
12492
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12493
- try {
12494
- const params = branchId ? { branchId } : void 0;
12495
- const response = await apiClient.post(`${BASE$1}/${id}/signal`, data, { params });
12496
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12497
- } catch (error) {
12498
- const e = error;
12499
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to signal task", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12500
- }
12501
- }
12502
- const BASE = "/webcron/inspection/bins";
12503
- async function listBins() {
12504
- var _a, _b, _c, _d;
12505
- try {
12506
- const response = await apiClient.get(BASE);
12507
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12508
- } catch (error) {
12509
- const e = error;
12510
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to list bins", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12511
- }
12512
- }
12513
- async function createBin(data) {
12514
- var _a, _b, _c, _d, _e;
12515
- if (!((_a = data.name) == null ? void 0 : _a.trim())) throw { message: "name is required", status: 400 };
12516
- try {
12517
- const response = await apiClient.post(BASE, data);
12518
- return ((_b = response.data) == null ? void 0 : _b.data) ?? response.data;
12519
- } catch (error) {
12520
- const e = error;
12521
- throw { message: ((_d = (_c = e.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) || "Failed to create bin", status: ((_e = e.response) == null ? void 0 : _e.status) || 500 };
12522
- }
12523
- }
12524
- async function getBin(id) {
12525
- var _a, _b, _c, _d;
12526
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12527
- try {
12528
- const response = await apiClient.get(`${BASE}/${id}`);
12529
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12530
- } catch (error) {
12531
- const e = error;
12532
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get bin", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12533
- }
12534
- }
12535
- async function deleteBin(id) {
12536
- var _a, _b, _c;
12537
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12538
- try {
12539
- await apiClient.delete(`${BASE}/${id}`);
12540
- } catch (error) {
12541
- const e = error;
12542
- throw { message: ((_b = (_a = e.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Failed to delete bin", status: ((_c = e.response) == null ? void 0 : _c.status) || 500 };
12543
- }
12544
- }
12545
- async function getBinRequests(id, params) {
12546
- var _a, _b, _c, _d;
12547
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12548
- try {
12549
- const response = await apiClient.get(`${BASE}/${id}/requests`, { params });
12550
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12551
- } catch (error) {
12552
- const e = error;
12553
- throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to get bin requests", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12554
- }
12555
- }
12556
- async function clearBinRequests(id) {
12557
- var _a, _b, _c;
12558
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12559
- try {
12560
- await apiClient.delete(`${BASE}/${id}/requests`);
12561
- } catch (error) {
12562
- const e = error;
12563
- throw { message: ((_b = (_a = e.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Failed to clear bin requests", status: ((_c = e.response) == null ? void 0 : _c.status) || 500 };
12564
- }
12565
- }
12566
- async function triggerWorkflowById(id, data) {
12567
- var _a, _b, _c, _d;
12568
- if (!(id == null ? void 0 : id.trim())) {
12569
- throw { message: "id is required", status: 400 };
12570
- }
12571
- try {
12572
- const response = await apiClient.post(
12573
- `/workflow/trigger/${id.trim()}`,
12574
- data ?? {}
12575
- );
12576
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12577
- } catch (error) {
12578
- const e = error;
12579
- const message = ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || e.message || "Failed to trigger workflow";
12580
- const status = ((_d = e.response) == null ? void 0 : _d.status) || 500;
12581
- throw { message, status };
12582
- }
12583
- }
12584
- const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12585
- __proto__: null,
12586
- cancelTask,
12587
- clearBinRequests,
12588
- createBin,
12589
- createTask,
12590
- createWebhook,
12591
- createWebhookSchedule,
12592
- deleteBin,
12593
- deleteSchedule,
12594
- deleteWebhook,
12595
- getBin,
12596
- getBinRequests,
12597
- getExecution,
12598
- getSchedule,
12599
- getTask,
12600
- getWebhook,
12601
- getWebhookExecutions,
12602
- getWebhookSchedules,
12603
- listBins,
12604
- listExecutions,
12605
- listTasks,
12606
- listWebhooks,
12607
- pauseSchedule,
12608
- progressTask,
12609
- resumeSchedule,
12610
- retryExecution,
12611
- retryTask,
12612
- signalTask,
12613
- testWebhook,
12614
- triggerSchedule,
12615
- triggerWorkflowById,
12616
- updateSchedule,
12617
- updateWebhook
12618
- }, Symbol.toStringTag, { value: "Module" }));
12619
12229
  const renderTemplate = async (body) => {
12620
12230
  var _a, _b, _c;
12621
12231
  try {
@@ -12646,30 +12256,29 @@ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
12646
12256
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12647
12257
  __proto__: null,
12648
12258
  apiClient,
12649
- audit: index$a,
12650
- chat: index$i,
12651
- clientIp: index$5,
12652
- dataset: index$h,
12653
- definition: index$m,
12654
- emailEngine: index$4,
12655
- files: index$n,
12656
- form: index$b,
12657
- inboxItems: index$7,
12658
- inputTable: index$g,
12659
- metric: index$j,
12660
- permissions: index$6,
12661
- process: index$8,
12662
- recon: index$c,
12663
- statement: index$e,
12664
- task: index$d,
12665
- tcn: index$3,
12666
- templatedPipeline: index$9,
12259
+ audit: index$9,
12260
+ chat: index$h,
12261
+ clientIp: index$4,
12262
+ dataset: index$g,
12263
+ definition: index$l,
12264
+ emailEngine: index$3,
12265
+ files: index$m,
12266
+ form: index$a,
12267
+ inboxItems: index$6,
12268
+ inputTable: index$f,
12269
+ metric: index$i,
12270
+ permissions: index$5,
12271
+ process: index$7,
12272
+ recon: index$b,
12273
+ statement: index$d,
12274
+ task: index$c,
12275
+ tcn: index$2,
12276
+ templatedPipeline: index$8,
12667
12277
  templates: index$1,
12668
- user: index$p,
12669
- webcron: index$2,
12670
- workbook: index$f,
12671
- workflow: index$o,
12672
- worksheet: index$l
12278
+ user: index$o,
12279
+ workbook: index$e,
12280
+ workflow: index$n,
12281
+ worksheet: index$k
12673
12282
  }, Symbol.toStringTag, { value: "Module" }));
12674
12283
  var InputTableColumnType = /* @__PURE__ */ ((InputTableColumnType2) => {
12675
12284
  InputTableColumnType2["UUID"] = "uuid";
@@ -14746,6 +14355,6 @@ export {
14746
14355
  copaInputTableDb,
14747
14356
  setConfig as copaSetConfig,
14748
14357
  bluecopaTailwindConfig as copaTailwindConfig,
14749
- index$k as copaUtils
14358
+ index$j as copaUtils
14750
14359
  };
14751
14360
  //# sourceMappingURL=index.es.js.map