@bluecopa/core 0.1.57 → 0.1.58

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
@@ -125,7 +125,7 @@ async function getAllUsers() {
125
125
  throw { message, status };
126
126
  }
127
127
  }
128
- const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
128
+ const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
129
129
  __proto__: null,
130
130
  getAllUsers,
131
131
  getLoggedInUserDetails
@@ -147,7 +147,7 @@ async function triggerHttpWorkflowById({
147
147
  throw { message, status };
148
148
  }
149
149
  }
150
- async function triggerWorkflowById({
150
+ async function triggerWorkflowById$1({
151
151
  parentId,
152
152
  triggerBy
153
153
  }) {
@@ -205,13 +205,13 @@ async function getAllHttpTriggers() {
205
205
  throw { message, status };
206
206
  }
207
207
  }
208
- const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
208
+ const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
209
209
  __proto__: null,
210
210
  WorkflowStatus,
211
211
  getAllHttpTriggers,
212
212
  getWorkflowInstanceStatusById,
213
213
  triggerHttpWorkflowById,
214
- triggerWorkflowById
214
+ triggerWorkflowById: triggerWorkflowById$1
215
215
  }, Symbol.toStringTag, { value: "Module" }));
216
216
  async function getFileUrlByFileId({
217
217
  key,
@@ -311,7 +311,7 @@ async function fileDownload({
311
311
  throw { message, status };
312
312
  }
313
313
  }
314
- const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
314
+ const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
315
315
  __proto__: null,
316
316
  fileDownload,
317
317
  fileUpload,
@@ -387,7 +387,7 @@ const runDefinition = async (props) => {
387
387
  };
388
388
  }
389
389
  };
390
- const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
390
+ const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
391
391
  __proto__: null,
392
392
  runDefinition,
393
393
  runPublishedDefinition,
@@ -425,7 +425,7 @@ const getWorksheetsByType = async (type) => {
425
425
  throw { message, status };
426
426
  }
427
427
  };
428
- const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
428
+ const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
429
429
  __proto__: null,
430
430
  getWorksheets,
431
431
  getWorksheetsByType
@@ -9806,7 +9806,7 @@ const getUniqueDuplicateName = (name, collectionToCheckIn, suffix = "Copy", conc
9806
9806
  }
9807
9807
  return newName.trim();
9808
9808
  };
9809
- const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9809
+ const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9810
9810
  __proto__: null,
9811
9811
  formatDate,
9812
9812
  generatePushID,
@@ -9977,7 +9977,7 @@ const getData$3 = async (metricSheetId, options) => {
9977
9977
  resultData = _.flatten(resultData);
9978
9978
  return { data: resultData };
9979
9979
  };
9980
- const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9980
+ const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9981
9981
  __proto__: null,
9982
9982
  getData: getData$3
9983
9983
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10132,7 +10132,7 @@ async function checkSubscriptionStatus(userId, threadId) {
10132
10132
  throw { message, status };
10133
10133
  }
10134
10134
  }
10135
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10135
+ const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10136
10136
  __proto__: null,
10137
10137
  checkSubscriptionStatus,
10138
10138
  createThread,
@@ -10337,7 +10337,7 @@ const getAllDatasets = async () => {
10337
10337
  throw { message, status };
10338
10338
  }
10339
10339
  };
10340
- const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10340
+ const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10341
10341
  __proto__: null,
10342
10342
  getAllDatasets,
10343
10343
  getData: getData$2,
@@ -10656,7 +10656,7 @@ const deleteRow = async (tableId, rowId, idField = "_copa_id") => {
10656
10656
  throw { message, status };
10657
10657
  }
10658
10658
  };
10659
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10659
+ const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10660
10660
  __proto__: null,
10661
10661
  deleteRow,
10662
10662
  getData: getData$1,
@@ -10750,7 +10750,7 @@ async function publishWorkbook({
10750
10750
  throw { message, status };
10751
10751
  }
10752
10752
  }
10753
- const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10753
+ const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10754
10754
  __proto__: null,
10755
10755
  getPublishedWorkbookById,
10756
10756
  getWorkbookDetails,
@@ -11018,7 +11018,7 @@ const getRunResultById = async (runId) => {
11018
11018
  throw { message, status };
11019
11019
  }
11020
11020
  };
11021
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11021
+ const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11022
11022
  __proto__: null,
11023
11023
  createNewRun,
11024
11024
  getData,
@@ -11048,7 +11048,7 @@ async function getTaskDetails({
11048
11048
  throw { message, status };
11049
11049
  }
11050
11050
  }
11051
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11051
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11052
11052
  __proto__: null,
11053
11053
  getTaskDetails
11054
11054
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11094,7 +11094,7 @@ async function getAllReconWorkflows() {
11094
11094
  throw { message, status };
11095
11095
  }
11096
11096
  }
11097
- const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11097
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11098
11098
  __proto__: null,
11099
11099
  getAllReconWorkflows,
11100
11100
  runRecon
@@ -11195,7 +11195,7 @@ async function createOrUpdateForm({
11195
11195
  throw { message, status: status2 };
11196
11196
  }
11197
11197
  }
11198
- const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11198
+ const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11199
11199
  __proto__: null,
11200
11200
  createOrUpdateForm,
11201
11201
  getFormById,
@@ -11236,7 +11236,7 @@ async function createAuditLog(params) {
11236
11236
  throw { message, status };
11237
11237
  }
11238
11238
  }
11239
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11239
+ const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11240
11240
  __proto__: null,
11241
11241
  createAuditLog,
11242
11242
  getAuditLogs
@@ -11255,7 +11255,7 @@ async function getAllTemplatedPipelines() {
11255
11255
  throw { message, status };
11256
11256
  }
11257
11257
  }
11258
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11258
+ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11259
11259
  __proto__: null,
11260
11260
  getAllTemplatedPipelines
11261
11261
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11316,7 +11316,7 @@ async function reassignTask({
11316
11316
  throw { message, status };
11317
11317
  }
11318
11318
  }
11319
- const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11319
+ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11320
11320
  __proto__: null,
11321
11321
  markTaskDone,
11322
11322
  reassignTask
@@ -11393,7 +11393,7 @@ async function markItemAsUnread({
11393
11393
  throw { message, status };
11394
11394
  }
11395
11395
  }
11396
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11396
+ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11397
11397
  __proto__: null,
11398
11398
  getAllInboxItems,
11399
11399
  markItemAsRead,
@@ -11420,7 +11420,7 @@ async function getPermissions(params) {
11420
11420
  throw { message, status };
11421
11421
  }
11422
11422
  }
11423
- const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11423
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11424
11424
  __proto__: null,
11425
11425
  getPermissions
11426
11426
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11438,7 +11438,7 @@ async function getClientIp() {
11438
11438
  throw { message, status };
11439
11439
  }
11440
11440
  }
11441
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11441
+ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11442
11442
  __proto__: null,
11443
11443
  getClientIp
11444
11444
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11573,7 +11573,7 @@ async function getMessageBySenderId(params) {
11573
11573
  throw { message, status };
11574
11574
  }
11575
11575
  }
11576
- const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11576
+ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11577
11577
  __proto__: null,
11578
11578
  createConversation,
11579
11579
  getAllConversations,
@@ -11808,7 +11808,7 @@ async function getCallData(token, callSid) {
11808
11808
  throw { message, status };
11809
11809
  }
11810
11810
  }
11811
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11811
+ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11812
11812
  __proto__: null,
11813
11813
  agentDisconnect,
11814
11814
  agentGetConnectedParty,
@@ -11828,31 +11828,424 @@ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
11828
11828
  processManualDial,
11829
11829
  refreshToken
11830
11830
  }, Symbol.toStringTag, { value: "Module" }));
11831
+ const BASE$4 = "/api/v1/webcron/webhooks";
11832
+ async function listWebhooks() {
11833
+ var _a, _b, _c, _d;
11834
+ try {
11835
+ const response = await apiClient.get(BASE$4);
11836
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11837
+ } catch (error) {
11838
+ const e = error;
11839
+ 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 };
11840
+ }
11841
+ }
11842
+ async function createWebhook(data) {
11843
+ var _a, _b, _c, _d, _e, _f;
11844
+ if (!((_a = data.name) == null ? void 0 : _a.trim())) throw { message: "name is required", status: 400 };
11845
+ if (!((_b = data.url) == null ? void 0 : _b.trim())) throw { message: "url is required", status: 400 };
11846
+ try {
11847
+ const response = await apiClient.post(BASE$4, data);
11848
+ return ((_c = response.data) == null ? void 0 : _c.data) ?? response.data;
11849
+ } catch (error) {
11850
+ const e = error;
11851
+ 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 };
11852
+ }
11853
+ }
11854
+ async function getWebhook(id) {
11855
+ var _a, _b, _c, _d;
11856
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11857
+ try {
11858
+ const response = await apiClient.get(`${BASE$4}/${id}`);
11859
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11860
+ } catch (error) {
11861
+ const e = error;
11862
+ 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 };
11863
+ }
11864
+ }
11865
+ async function updateWebhook(id, data) {
11866
+ var _a, _b, _c, _d;
11867
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11868
+ try {
11869
+ const response = await apiClient.put(`${BASE$4}/${id}`, data);
11870
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11871
+ } catch (error) {
11872
+ const e = error;
11873
+ 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 };
11874
+ }
11875
+ }
11876
+ async function deleteWebhook(id) {
11877
+ var _a, _b, _c;
11878
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11879
+ try {
11880
+ await apiClient.delete(`${BASE$4}/${id}`);
11881
+ } catch (error) {
11882
+ const e = error;
11883
+ 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 };
11884
+ }
11885
+ }
11886
+ async function testWebhook(id) {
11887
+ var _a, _b, _c, _d;
11888
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11889
+ try {
11890
+ const response = await apiClient.post(`${BASE$4}/${id}/test`);
11891
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11892
+ } catch (error) {
11893
+ const e = error;
11894
+ 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 };
11895
+ }
11896
+ }
11897
+ async function getWebhookExecutions(id, params) {
11898
+ var _a, _b, _c, _d;
11899
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11900
+ try {
11901
+ const response = await apiClient.get(`${BASE$4}/${id}/executions`, { params });
11902
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11903
+ } catch (error) {
11904
+ const e = error;
11905
+ 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 };
11906
+ }
11907
+ }
11908
+ async function getWebhookSchedules(id) {
11909
+ var _a, _b, _c, _d;
11910
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11911
+ try {
11912
+ const response = await apiClient.get(`${BASE$4}/${id}/schedules`);
11913
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11914
+ } catch (error) {
11915
+ const e = error;
11916
+ 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 };
11917
+ }
11918
+ }
11919
+ async function createWebhookSchedule(webhookId, data) {
11920
+ var _a, _b, _c, _d;
11921
+ if (!(webhookId == null ? void 0 : webhookId.trim())) throw { message: "webhookId is required", status: 400 };
11922
+ try {
11923
+ const response = await apiClient.post(`${BASE$4}/${webhookId}/schedules`, data);
11924
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11925
+ } catch (error) {
11926
+ const e = error;
11927
+ 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 };
11928
+ }
11929
+ }
11930
+ const BASE$3 = "/api/v1/webcron/schedules";
11931
+ async function getSchedule(id) {
11932
+ var _a, _b, _c, _d;
11933
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11934
+ try {
11935
+ const response = await apiClient.get(`${BASE$3}/${id}`);
11936
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11937
+ } catch (error) {
11938
+ const e = error;
11939
+ 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 };
11940
+ }
11941
+ }
11942
+ async function updateSchedule(id, data) {
11943
+ var _a, _b, _c, _d;
11944
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11945
+ try {
11946
+ const response = await apiClient.put(`${BASE$3}/${id}`, data);
11947
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11948
+ } catch (error) {
11949
+ const e = error;
11950
+ 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 };
11951
+ }
11952
+ }
11953
+ async function deleteSchedule(id) {
11954
+ var _a, _b, _c;
11955
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11956
+ try {
11957
+ await apiClient.delete(`${BASE$3}/${id}`);
11958
+ } catch (error) {
11959
+ const e = error;
11960
+ 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 };
11961
+ }
11962
+ }
11963
+ async function pauseSchedule(id) {
11964
+ var _a, _b, _c, _d;
11965
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11966
+ try {
11967
+ const response = await apiClient.post(`${BASE$3}/${id}/pause`);
11968
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11969
+ } catch (error) {
11970
+ const e = error;
11971
+ 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 };
11972
+ }
11973
+ }
11974
+ async function resumeSchedule(id) {
11975
+ var _a, _b, _c, _d;
11976
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11977
+ try {
11978
+ const response = await apiClient.post(`${BASE$3}/${id}/resume`);
11979
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11980
+ } catch (error) {
11981
+ const e = error;
11982
+ 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 };
11983
+ }
11984
+ }
11985
+ async function triggerSchedule(id) {
11986
+ var _a, _b, _c, _d;
11987
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
11988
+ try {
11989
+ const response = await apiClient.post(`${BASE$3}/${id}/trigger`);
11990
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
11991
+ } catch (error) {
11992
+ const e = error;
11993
+ 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 };
11994
+ }
11995
+ }
11996
+ const BASE$2 = "/api/v1/webcron/executions";
11997
+ async function listExecutions(params) {
11998
+ var _a, _b, _c, _d;
11999
+ try {
12000
+ const response = await apiClient.get(BASE$2, { params });
12001
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12002
+ } catch (error) {
12003
+ const e = error;
12004
+ 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 };
12005
+ }
12006
+ }
12007
+ async function getExecution(id) {
12008
+ var _a, _b, _c, _d;
12009
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12010
+ try {
12011
+ const response = await apiClient.get(`${BASE$2}/${id}`);
12012
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12013
+ } catch (error) {
12014
+ const e = error;
12015
+ 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 };
12016
+ }
12017
+ }
12018
+ async function retryExecution(id) {
12019
+ var _a, _b, _c, _d;
12020
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12021
+ try {
12022
+ const response = await apiClient.post(`${BASE$2}/${id}/retry`);
12023
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12024
+ } catch (error) {
12025
+ const e = error;
12026
+ 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 };
12027
+ }
12028
+ }
12029
+ const BASE$1 = "/api/v1/webcron/tasks";
12030
+ async function listTasks() {
12031
+ var _a, _b, _c, _d;
12032
+ try {
12033
+ const response = await apiClient.get(BASE$1);
12034
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12035
+ } catch (error) {
12036
+ const e = error;
12037
+ 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 };
12038
+ }
12039
+ }
12040
+ async function createTask(data) {
12041
+ var _a, _b, _c, _d, _e;
12042
+ if (!((_a = data.webhookId) == null ? void 0 : _a.trim())) throw { message: "webhookId is required", status: 400 };
12043
+ try {
12044
+ const response = await apiClient.post(BASE$1, data);
12045
+ return ((_b = response.data) == null ? void 0 : _b.data) ?? response.data;
12046
+ } catch (error) {
12047
+ const e = error;
12048
+ 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 };
12049
+ }
12050
+ }
12051
+ async function getTask(id) {
12052
+ var _a, _b, _c, _d;
12053
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12054
+ try {
12055
+ const response = await apiClient.get(`${BASE$1}/${id}`);
12056
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12057
+ } catch (error) {
12058
+ const e = error;
12059
+ 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 };
12060
+ }
12061
+ }
12062
+ async function cancelTask(id) {
12063
+ var _a, _b, _c, _d;
12064
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12065
+ try {
12066
+ const response = await apiClient.post(`${BASE$1}/${id}/cancel`);
12067
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12068
+ } catch (error) {
12069
+ const e = error;
12070
+ 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 };
12071
+ }
12072
+ }
12073
+ async function retryTask(id) {
12074
+ var _a, _b, _c, _d;
12075
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12076
+ try {
12077
+ const response = await apiClient.post(`${BASE$1}/${id}/retry`);
12078
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12079
+ } catch (error) {
12080
+ const e = error;
12081
+ 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 };
12082
+ }
12083
+ }
12084
+ async function progressTask(id, data) {
12085
+ var _a, _b, _c;
12086
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12087
+ try {
12088
+ await apiClient.post(`${BASE$1}/${id}/progress`, data);
12089
+ } catch (error) {
12090
+ const e = error;
12091
+ 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 };
12092
+ }
12093
+ }
12094
+ async function signalTask(id, data, branchId) {
12095
+ var _a, _b, _c, _d;
12096
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12097
+ try {
12098
+ const params = branchId ? { branchId } : void 0;
12099
+ const response = await apiClient.post(`${BASE$1}/${id}/signal`, data, { params });
12100
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12101
+ } catch (error) {
12102
+ const e = error;
12103
+ 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 };
12104
+ }
12105
+ }
12106
+ const BASE = "/api/v1/webcron/inspection/bins";
12107
+ async function listBins() {
12108
+ var _a, _b, _c, _d;
12109
+ try {
12110
+ const response = await apiClient.get(BASE);
12111
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12112
+ } catch (error) {
12113
+ const e = error;
12114
+ 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 };
12115
+ }
12116
+ }
12117
+ async function createBin(data) {
12118
+ var _a, _b, _c, _d, _e;
12119
+ if (!((_a = data.name) == null ? void 0 : _a.trim())) throw { message: "name is required", status: 400 };
12120
+ try {
12121
+ const response = await apiClient.post(BASE, data);
12122
+ return ((_b = response.data) == null ? void 0 : _b.data) ?? response.data;
12123
+ } catch (error) {
12124
+ const e = error;
12125
+ 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 };
12126
+ }
12127
+ }
12128
+ async function getBin(id) {
12129
+ var _a, _b, _c, _d;
12130
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12131
+ try {
12132
+ const response = await apiClient.get(`${BASE}/${id}`);
12133
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12134
+ } catch (error) {
12135
+ const e = error;
12136
+ 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 };
12137
+ }
12138
+ }
12139
+ async function deleteBin(id) {
12140
+ var _a, _b, _c;
12141
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12142
+ try {
12143
+ await apiClient.delete(`${BASE}/${id}`);
12144
+ } catch (error) {
12145
+ const e = error;
12146
+ 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 };
12147
+ }
12148
+ }
12149
+ async function getBinRequests(id, params) {
12150
+ var _a, _b, _c, _d;
12151
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12152
+ try {
12153
+ const response = await apiClient.get(`${BASE}/${id}/requests`, { params });
12154
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12155
+ } catch (error) {
12156
+ const e = error;
12157
+ 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 };
12158
+ }
12159
+ }
12160
+ async function clearBinRequests(id) {
12161
+ var _a, _b, _c;
12162
+ if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12163
+ try {
12164
+ await apiClient.delete(`${BASE}/${id}/requests`);
12165
+ } catch (error) {
12166
+ const e = error;
12167
+ 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 };
12168
+ }
12169
+ }
12170
+ async function triggerWorkflowById(id, data) {
12171
+ var _a, _b, _c, _d;
12172
+ if (!(id == null ? void 0 : id.trim())) {
12173
+ throw { message: "id is required", status: 400 };
12174
+ }
12175
+ try {
12176
+ const response = await apiClient.post(
12177
+ `/api/v1/workflow/trigger/${id.trim()}`,
12178
+ data ?? {}
12179
+ );
12180
+ return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12181
+ } catch (error) {
12182
+ const e = error;
12183
+ const message = ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || e.message || "Failed to trigger workflow";
12184
+ const status = ((_d = e.response) == null ? void 0 : _d.status) || 500;
12185
+ throw { message, status };
12186
+ }
12187
+ }
12188
+ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12189
+ __proto__: null,
12190
+ cancelTask,
12191
+ clearBinRequests,
12192
+ createBin,
12193
+ createTask,
12194
+ createWebhook,
12195
+ createWebhookSchedule,
12196
+ deleteBin,
12197
+ deleteSchedule,
12198
+ deleteWebhook,
12199
+ getBin,
12200
+ getBinRequests,
12201
+ getExecution,
12202
+ getSchedule,
12203
+ getTask,
12204
+ getWebhook,
12205
+ getWebhookExecutions,
12206
+ getWebhookSchedules,
12207
+ listBins,
12208
+ listExecutions,
12209
+ listTasks,
12210
+ listWebhooks,
12211
+ pauseSchedule,
12212
+ progressTask,
12213
+ resumeSchedule,
12214
+ retryExecution,
12215
+ retryTask,
12216
+ signalTask,
12217
+ testWebhook,
12218
+ triggerSchedule,
12219
+ triggerWorkflowById,
12220
+ updateSchedule,
12221
+ updateWebhook
12222
+ }, Symbol.toStringTag, { value: "Module" }));
11831
12223
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11832
12224
  __proto__: null,
11833
12225
  apiClient,
11834
- audit: index$8,
11835
- chat: index$g,
11836
- clientIp: index$3,
11837
- dataset: index$f,
11838
- definition: index$k,
11839
- emailEngine: index$2,
11840
- files: index$l,
11841
- form: index$9,
11842
- inboxItems: index$5,
11843
- inputTable: index$e,
11844
- metric: index$h,
11845
- permissions: index$4,
11846
- process: index$6,
11847
- recon: index$a,
11848
- statement: index$c,
11849
- task: index$b,
11850
- tcn: index$1,
11851
- templatedPipeline: index$7,
11852
- user: index$n,
11853
- workbook: index$d,
11854
- workflow: index$m,
11855
- worksheet: index$j
12226
+ audit: index$9,
12227
+ chat: index$h,
12228
+ clientIp: index$4,
12229
+ dataset: index$g,
12230
+ definition: index$l,
12231
+ emailEngine: index$3,
12232
+ files: index$m,
12233
+ form: index$a,
12234
+ inboxItems: index$6,
12235
+ inputTable: index$f,
12236
+ metric: index$i,
12237
+ permissions: index$5,
12238
+ process: index$7,
12239
+ recon: index$b,
12240
+ statement: index$d,
12241
+ task: index$c,
12242
+ tcn: index$2,
12243
+ templatedPipeline: index$8,
12244
+ user: index$o,
12245
+ webcron: index$1,
12246
+ workbook: index$e,
12247
+ workflow: index$n,
12248
+ worksheet: index$k
11856
12249
  }, Symbol.toStringTag, { value: "Module" }));
11857
12250
  var InputTableColumnType = /* @__PURE__ */ ((InputTableColumnType2) => {
11858
12251
  InputTableColumnType2["UUID"] = "uuid";
@@ -12857,6 +13250,6 @@ export {
12857
13250
  copaInputTableDb,
12858
13251
  setConfig as copaSetConfig,
12859
13252
  bluecopaTailwindConfig as copaTailwindConfig,
12860
- index$i as copaUtils
13253
+ index$j as copaUtils
12861
13254
  };
12862
13255
  //# sourceMappingURL=index.es.js.map