@bluecopa/core 0.1.82 → 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
@@ -15,6 +15,7 @@ class ConfigSingleton {
15
15
  workspaceId: "",
16
16
  userId: "",
17
17
  solutionId: void 0,
18
+ deployedSolution: void 0,
18
19
  websocketProvider: void 0
19
20
  };
20
21
  }
@@ -39,6 +40,7 @@ class ConfigSingleton {
39
40
  solutionId: void 0,
40
41
  solutionBranch: void 0,
41
42
  solutionBranchType: void 0,
43
+ deployedSolution: void 0,
42
44
  websocketProvider: void 0
43
45
  };
44
46
  }
@@ -95,6 +97,9 @@ const createApiClient = () => {
95
97
  if (copaConfig.solutionBranchType && config.headers) {
96
98
  config.headers["x-bluecopa-solution-branch-type"] = _.trim(copaConfig.solutionBranchType);
97
99
  }
100
+ if (copaConfig.deployedSolution && config.headers) {
101
+ config.headers["x-bluecopa-deployed-solution"] = "true";
102
+ }
98
103
  return config;
99
104
  },
100
105
  (error) => {
@@ -144,7 +149,7 @@ async function getAllUsers() {
144
149
  throw { message, status };
145
150
  }
146
151
  }
147
- const index$p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152
+ const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
148
153
  __proto__: null,
149
154
  getAllUsers,
150
155
  getLoggedInUserDetails
@@ -166,7 +171,7 @@ async function triggerHttpWorkflowById({
166
171
  throw { message, status };
167
172
  }
168
173
  }
169
- async function triggerWorkflowById$1({
174
+ async function triggerWorkflowById({
170
175
  parentId,
171
176
  triggerBy
172
177
  }) {
@@ -224,13 +229,13 @@ async function getAllHttpTriggers() {
224
229
  throw { message, status };
225
230
  }
226
231
  }
227
- const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
232
+ const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
228
233
  __proto__: null,
229
234
  WorkflowStatus,
230
235
  getAllHttpTriggers,
231
236
  getWorkflowInstanceStatusById,
232
237
  triggerHttpWorkflowById,
233
- triggerWorkflowById: triggerWorkflowById$1
238
+ triggerWorkflowById
234
239
  }, Symbol.toStringTag, { value: "Module" }));
235
240
  async function getFileUrlByFileId({
236
241
  key,
@@ -356,7 +361,7 @@ async function getFileByFolderIdAndName({
356
361
  throw data !== void 0 ? { message, status, data } : { message, status };
357
362
  }
358
363
  }
359
- const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
364
+ const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
360
365
  __proto__: null,
361
366
  fileDownload,
362
367
  fileUpload,
@@ -365,7 +370,7 @@ const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
365
370
  }, Symbol.toStringTag, { value: "Module" }));
366
371
  const runPublishedDefinition = async (props) => {
367
372
  var _a, _b;
368
- const { sheet, variable, inputs, describe, source } = props;
373
+ const { sheet, variable, inputs, describe, solutionBindings, source } = props;
369
374
  if (!sheet) {
370
375
  throw { message: "Definition is null", status: 400 };
371
376
  }
@@ -379,7 +384,10 @@ const runPublishedDefinition = async (props) => {
379
384
  sheet,
380
385
  variable,
381
386
  inputs,
382
- describe
387
+ describe,
388
+ // Only include when non-empty — empty/missing tells the BFF to
389
+ // skip hydration and pass through to fx_api `published/run`.
390
+ ...solutionBindings && Object.keys(solutionBindings).length > 0 ? { solutionBindings } : {}
383
391
  },
384
392
  { cancelToken: source == null ? void 0 : source.token }
385
393
  );
@@ -448,7 +456,7 @@ const runDefinition = async (props) => {
448
456
  };
449
457
  }
450
458
  };
451
- const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
459
+ const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
452
460
  __proto__: null,
453
461
  runDefinition,
454
462
  runPublishedDefinition,
@@ -486,7 +494,7 @@ const getWorksheetsByType = async (type) => {
486
494
  throw { message, status };
487
495
  }
488
496
  };
489
- const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
497
+ const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
490
498
  __proto__: null,
491
499
  getWorksheets,
492
500
  getWorksheetsByType
@@ -9844,18 +9852,6 @@ const getUniqueDuplicateName = (name, collectionToCheckIn, suffix = "Copy", conc
9844
9852
  }
9845
9853
  return newName.trim();
9846
9854
  };
9847
- const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9848
- __proto__: null,
9849
- formatDate,
9850
- generatePushID,
9851
- getMetricDefinition,
9852
- getUniqueDuplicateName,
9853
- hydrateStatement,
9854
- inputTableUtils: inputTableDefinition,
9855
- statementFilterConverters: filterConverters,
9856
- statementFilterUtils: filterUtils,
9857
- websocketUtils: websocketProviderFactory
9858
- }, Symbol.toStringTag, { value: "Module" }));
9859
9855
  function resolveBinding(bindingKey, bindings) {
9860
9856
  if (!bindings[bindingKey]) return null;
9861
9857
  const bindingValue = bindings[bindingKey];
@@ -10002,6 +9998,32 @@ function applyWorkbookBindings(fileRead, bindings) {
10002
9998
  }
10003
9999
  return remapped;
10004
10000
  }
10001
+ function applyReconBindings(fileRead, bindings) {
10002
+ if (!fileRead || !Array.isArray(fileRead.imports)) return fileRead;
10003
+ return {
10004
+ ...fileRead,
10005
+ imports: fileRead.imports.map((imp) => {
10006
+ if (!(imp == null ? void 0 : imp.loc)) return imp;
10007
+ const resolved = resolveBinding(imp.loc, bindings);
10008
+ return resolved ? { ...imp, loc: resolved } : imp;
10009
+ })
10010
+ };
10011
+ }
10012
+ function applyDefinitionBindings(fileRead, bindings, definitionType) {
10013
+ if (!fileRead || !bindings || !Object.keys(bindings).length) return fileRead;
10014
+ switch (definitionType) {
10015
+ case "PIPELINE":
10016
+ return applyPipelineBindings(fileRead, bindings);
10017
+ case "SCHEDULE":
10018
+ return applyScheduleBindings(fileRead, bindings);
10019
+ case "WORKBOOK":
10020
+ return applyWorkbookBindings(fileRead, bindings);
10021
+ case "RECON":
10022
+ return applyReconBindings(fileRead, bindings);
10023
+ default:
10024
+ return fileRead;
10025
+ }
10026
+ }
10005
10027
  function applyTargetedBindings(fileRead, bindings) {
10006
10028
  if (!fileRead || !bindings || !Object.keys(bindings).length) return fileRead;
10007
10029
  let result = { ...fileRead };
@@ -10027,8 +10049,32 @@ async function fetchSolutionBindings() {
10027
10049
  }
10028
10050
  function applyBindings(fileRead, bindings, definitionType) {
10029
10051
  if (!fileRead || !Object.keys(bindings).length) return fileRead;
10030
- return applyTargetedBindings(fileRead, bindings);
10052
+ return definitionType ? applyDefinitionBindings(
10053
+ fileRead,
10054
+ bindings,
10055
+ definitionType
10056
+ ) : applyTargetedBindings(fileRead, bindings);
10057
+ }
10058
+ async function applySolutionBindings(fileRead, definitionType) {
10059
+ if (!fileRead) return fileRead;
10060
+ const bindings = await fetchSolutionBindings();
10061
+ return applyBindings(fileRead, bindings, definitionType);
10031
10062
  }
10063
+ const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10064
+ __proto__: null,
10065
+ applyBindings,
10066
+ applySolutionBindings,
10067
+ fetchSolutionBindings,
10068
+ formatDate,
10069
+ generatePushID,
10070
+ getMetricDefinition,
10071
+ getUniqueDuplicateName,
10072
+ hydrateStatement,
10073
+ inputTableUtils: inputTableDefinition,
10074
+ statementFilterConverters: filterConverters,
10075
+ statementFilterUtils: filterUtils,
10076
+ websocketUtils: websocketProviderFactory
10077
+ }, Symbol.toStringTag, { value: "Module" }));
10032
10078
  const hydrateWorksheet = async (sheet, prefetchedBindings) => {
10033
10079
  try {
10034
10080
  if (!sheet) return sheet;
@@ -10079,7 +10125,7 @@ const resolveBoundId = (rawId, bindings) => {
10079
10125
  };
10080
10126
  const getData$3 = async (metricSheetId, options) => {
10081
10127
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
10082
- const bindings = await fetchSolutionBindings();
10128
+ const bindings = (options == null ? void 0 : options.solutionBindings) ?? await fetchSolutionBindings();
10083
10129
  const resolvedMetricSheetId = resolveBoundId(metricSheetId, bindings);
10084
10130
  const worksheets = await getWorksheets([resolvedMetricSheetId]);
10085
10131
  if (_.isEmpty(worksheets)) return {};
@@ -10187,7 +10233,8 @@ const getData$3 = async (metricSheetId, options) => {
10187
10233
  lastModifiedDate: hydratedSheet.lastModifiedDate
10188
10234
  },
10189
10235
  variable: variableName,
10190
- describe: parentTableVariable
10236
+ describe: parentTableVariable,
10237
+ solutionBindings: bindings
10191
10238
  })
10192
10239
  );
10193
10240
  });
@@ -10201,7 +10248,8 @@ const getData$3 = async (metricSheetId, options) => {
10201
10248
  lastModifiedDate: hydratedSheet.lastModifiedDate
10202
10249
  },
10203
10250
  variable: variableName,
10204
- describe: parentTableVariable
10251
+ describe: parentTableVariable,
10252
+ solutionBindings: bindings
10205
10253
  })).data;
10206
10254
  resultData = result.data;
10207
10255
  }
@@ -10209,7 +10257,7 @@ const getData$3 = async (metricSheetId, options) => {
10209
10257
  resultData = _.flatten(resultData);
10210
10258
  return { data: resultData };
10211
10259
  };
10212
- const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10260
+ const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10213
10261
  __proto__: null,
10214
10262
  getData: getData$3
10215
10263
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10364,7 +10412,7 @@ async function checkSubscriptionStatus(userId, threadId) {
10364
10412
  throw { message, status };
10365
10413
  }
10366
10414
  }
10367
- const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10415
+ const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10368
10416
  __proto__: null,
10369
10417
  checkSubscriptionStatus,
10370
10418
  createThread,
@@ -10569,7 +10617,7 @@ const getAllDatasets = async () => {
10569
10617
  throw { message, status };
10570
10618
  }
10571
10619
  };
10572
- const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10620
+ const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10573
10621
  __proto__: null,
10574
10622
  getAllDatasets,
10575
10623
  getData: getData$2,
@@ -10888,7 +10936,7 @@ const deleteRow = async (tableId, rowId, idField = "_copa_id") => {
10888
10936
  throw { message, status };
10889
10937
  }
10890
10938
  };
10891
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10939
+ const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10892
10940
  __proto__: null,
10893
10941
  deleteRow,
10894
10942
  getData: getData$1,
@@ -10982,7 +11030,7 @@ async function publishWorkbook({
10982
11030
  throw { message, status };
10983
11031
  }
10984
11032
  }
10985
- const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11033
+ const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10986
11034
  __proto__: null,
10987
11035
  getPublishedWorkbookById,
10988
11036
  getWorkbookDetails,
@@ -11250,7 +11298,7 @@ const getRunResultById = async (runId) => {
11250
11298
  throw { message, status };
11251
11299
  }
11252
11300
  };
11253
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11301
+ const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11254
11302
  __proto__: null,
11255
11303
  createNewRun,
11256
11304
  getData,
@@ -11280,7 +11328,7 @@ async function getTaskDetails({
11280
11328
  throw { message, status };
11281
11329
  }
11282
11330
  }
11283
- const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11331
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11284
11332
  __proto__: null,
11285
11333
  getTaskDetails
11286
11334
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11326,7 +11374,7 @@ async function getAllReconWorkflows() {
11326
11374
  throw { message, status };
11327
11375
  }
11328
11376
  }
11329
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11377
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11330
11378
  __proto__: null,
11331
11379
  getAllReconWorkflows,
11332
11380
  runRecon
@@ -11427,7 +11475,7 @@ async function createOrUpdateForm({
11427
11475
  throw { message, status: status2 };
11428
11476
  }
11429
11477
  }
11430
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11478
+ const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11431
11479
  __proto__: null,
11432
11480
  createOrUpdateForm,
11433
11481
  getFormById,
@@ -11468,7 +11516,7 @@ async function createAuditLog(params) {
11468
11516
  throw { message, status };
11469
11517
  }
11470
11518
  }
11471
- const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11519
+ const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11472
11520
  __proto__: null,
11473
11521
  createAuditLog,
11474
11522
  getAuditLogs
@@ -11487,7 +11535,7 @@ async function getAllTemplatedPipelines() {
11487
11535
  throw { message, status };
11488
11536
  }
11489
11537
  }
11490
- const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11538
+ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11491
11539
  __proto__: null,
11492
11540
  getAllTemplatedPipelines
11493
11541
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11612,7 +11660,7 @@ async function deleteProcessTrigger(id) {
11612
11660
  throw { message, status };
11613
11661
  }
11614
11662
  }
11615
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11663
+ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11616
11664
  __proto__: null,
11617
11665
  deleteProcessTrigger,
11618
11666
  getTriggersBySheet,
@@ -11710,7 +11758,7 @@ async function createInboxItemPerUser(data) {
11710
11758
  throw { message, status };
11711
11759
  }
11712
11760
  }
11713
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11761
+ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11714
11762
  __proto__: null,
11715
11763
  createInboxItemPerUser,
11716
11764
  getAllInboxItems,
@@ -11738,7 +11786,7 @@ async function getPermissions(params) {
11738
11786
  throw { message, status };
11739
11787
  }
11740
11788
  }
11741
- const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11789
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11742
11790
  __proto__: null,
11743
11791
  getPermissions
11744
11792
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11756,7 +11804,7 @@ async function getClientIp() {
11756
11804
  throw { message, status };
11757
11805
  }
11758
11806
  }
11759
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11807
+ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11760
11808
  __proto__: null,
11761
11809
  getClientIp
11762
11810
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11891,7 +11939,7 @@ async function getMessageBySenderId(params) {
11891
11939
  throw { message, status };
11892
11940
  }
11893
11941
  }
11894
- const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11942
+ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11895
11943
  __proto__: null,
11896
11944
  createConversation,
11897
11945
  getAllConversations,
@@ -12156,7 +12204,7 @@ async function agentGetCallFromHold(token, sessionSid, holdType = "SIMPLE") {
12156
12204
  throw { message, status };
12157
12205
  }
12158
12206
  }
12159
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12207
+ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12160
12208
  __proto__: null,
12161
12209
  agentDisconnect,
12162
12210
  agentGetCallFromHold,
@@ -12178,398 +12226,6 @@ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
12178
12226
  processManualDial,
12179
12227
  refreshToken
12180
12228
  }, Symbol.toStringTag, { value: "Module" }));
12181
- const BASE$4 = "/webcron/webhooks";
12182
- async function listWebhooks() {
12183
- var _a, _b, _c, _d;
12184
- try {
12185
- const response = await apiClient.get(BASE$4);
12186
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12187
- } catch (error) {
12188
- const e = error;
12189
- 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 };
12190
- }
12191
- }
12192
- async function createWebhook(data) {
12193
- var _a, _b, _c, _d, _e, _f;
12194
- if (!((_a = data.name) == null ? void 0 : _a.trim())) throw { message: "name is required", status: 400 };
12195
- if (!((_b = data.url) == null ? void 0 : _b.trim())) throw { message: "url is required", status: 400 };
12196
- try {
12197
- const response = await apiClient.post(BASE$4, data);
12198
- return ((_c = response.data) == null ? void 0 : _c.data) ?? response.data;
12199
- } catch (error) {
12200
- const e = error;
12201
- 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 };
12202
- }
12203
- }
12204
- async function getWebhook(id) {
12205
- var _a, _b, _c, _d;
12206
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12207
- try {
12208
- const response = await apiClient.get(`${BASE$4}/${id}`);
12209
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12210
- } catch (error) {
12211
- const e = error;
12212
- 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 };
12213
- }
12214
- }
12215
- async function updateWebhook(id, data) {
12216
- var _a, _b, _c, _d;
12217
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12218
- try {
12219
- const response = await apiClient.put(`${BASE$4}/${id}`, data);
12220
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12221
- } catch (error) {
12222
- const e = error;
12223
- 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 };
12224
- }
12225
- }
12226
- async function deleteWebhook(id) {
12227
- var _a, _b, _c;
12228
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12229
- try {
12230
- await apiClient.delete(`${BASE$4}/${id}`);
12231
- } catch (error) {
12232
- const e = error;
12233
- 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 };
12234
- }
12235
- }
12236
- async function testWebhook(id) {
12237
- var _a, _b, _c, _d;
12238
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12239
- try {
12240
- const response = await apiClient.post(`${BASE$4}/${id}/test`);
12241
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12242
- } catch (error) {
12243
- const e = error;
12244
- 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 };
12245
- }
12246
- }
12247
- async function getWebhookExecutions(id, params) {
12248
- var _a, _b, _c, _d;
12249
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12250
- try {
12251
- const response = await apiClient.get(`${BASE$4}/${id}/executions`, { params });
12252
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12253
- } catch (error) {
12254
- const e = error;
12255
- 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 };
12256
- }
12257
- }
12258
- async function getWebhookSchedules(id) {
12259
- var _a, _b, _c, _d;
12260
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12261
- try {
12262
- const response = await apiClient.get(`${BASE$4}/${id}/schedules`);
12263
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12264
- } catch (error) {
12265
- const e = error;
12266
- 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 };
12267
- }
12268
- }
12269
- async function createWebhookSchedule(webhookId, data) {
12270
- var _a, _b, _c, _d;
12271
- if (!(webhookId == null ? void 0 : webhookId.trim())) throw { message: "webhookId is required", status: 400 };
12272
- try {
12273
- const response = await apiClient.post(`${BASE$4}/${webhookId}/schedules`, data);
12274
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12275
- } catch (error) {
12276
- const e = error;
12277
- 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 };
12278
- }
12279
- }
12280
- const BASE$3 = "/webcron/schedules";
12281
- async function getSchedule(id) {
12282
- var _a, _b, _c, _d;
12283
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12284
- try {
12285
- const response = await apiClient.get(`${BASE$3}/${id}`);
12286
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12287
- } catch (error) {
12288
- const e = error;
12289
- 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 };
12290
- }
12291
- }
12292
- async function updateSchedule(id, data) {
12293
- var _a, _b, _c, _d;
12294
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12295
- try {
12296
- const response = await apiClient.put(`${BASE$3}/${id}`, data);
12297
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12298
- } catch (error) {
12299
- const e = error;
12300
- 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 };
12301
- }
12302
- }
12303
- async function deleteSchedule(id) {
12304
- var _a, _b, _c;
12305
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12306
- try {
12307
- await apiClient.delete(`${BASE$3}/${id}`);
12308
- } catch (error) {
12309
- const e = error;
12310
- 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 };
12311
- }
12312
- }
12313
- async function pauseSchedule(id) {
12314
- var _a, _b, _c, _d;
12315
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12316
- try {
12317
- const response = await apiClient.post(`${BASE$3}/${id}/pause`);
12318
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12319
- } catch (error) {
12320
- const e = error;
12321
- 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 };
12322
- }
12323
- }
12324
- async function resumeSchedule(id) {
12325
- var _a, _b, _c, _d;
12326
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12327
- try {
12328
- const response = await apiClient.post(`${BASE$3}/${id}/resume`);
12329
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12330
- } catch (error) {
12331
- const e = error;
12332
- 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 };
12333
- }
12334
- }
12335
- async function triggerSchedule(id) {
12336
- var _a, _b, _c, _d;
12337
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12338
- try {
12339
- const response = await apiClient.post(`${BASE$3}/${id}/trigger`);
12340
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12341
- } catch (error) {
12342
- const e = error;
12343
- 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 };
12344
- }
12345
- }
12346
- const BASE$2 = "/webcron/executions";
12347
- async function listExecutions(params) {
12348
- var _a, _b, _c, _d;
12349
- try {
12350
- const response = await apiClient.get(BASE$2, { params });
12351
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12352
- } catch (error) {
12353
- const e = error;
12354
- 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 };
12355
- }
12356
- }
12357
- async function getExecution(id) {
12358
- var _a, _b, _c, _d;
12359
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12360
- try {
12361
- const response = await apiClient.get(`${BASE$2}/${id}`);
12362
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12363
- } catch (error) {
12364
- const e = error;
12365
- 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 };
12366
- }
12367
- }
12368
- async function retryExecution(id) {
12369
- var _a, _b, _c, _d;
12370
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12371
- try {
12372
- const response = await apiClient.post(`${BASE$2}/${id}/retry`);
12373
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12374
- } catch (error) {
12375
- const e = error;
12376
- 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 };
12377
- }
12378
- }
12379
- const BASE$1 = "/webcron/tasks";
12380
- async function listTasks() {
12381
- var _a, _b, _c, _d;
12382
- try {
12383
- const response = await apiClient.get(BASE$1);
12384
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12385
- } catch (error) {
12386
- const e = error;
12387
- 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 };
12388
- }
12389
- }
12390
- async function createTask(data) {
12391
- var _a, _b, _c, _d, _e;
12392
- if (!((_a = data.webhookId) == null ? void 0 : _a.trim())) throw { message: "webhookId is required", status: 400 };
12393
- try {
12394
- const response = await apiClient.post(BASE$1, data);
12395
- return ((_b = response.data) == null ? void 0 : _b.data) ?? response.data;
12396
- } catch (error) {
12397
- const e = error;
12398
- 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 };
12399
- }
12400
- }
12401
- async function getTask(id) {
12402
- var _a, _b, _c, _d;
12403
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12404
- try {
12405
- const response = await apiClient.get(`${BASE$1}/${id}`);
12406
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12407
- } catch (error) {
12408
- const e = error;
12409
- 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 };
12410
- }
12411
- }
12412
- async function cancelTask(id) {
12413
- var _a, _b, _c, _d;
12414
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12415
- try {
12416
- const response = await apiClient.post(`${BASE$1}/${id}/cancel`);
12417
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12418
- } catch (error) {
12419
- const e = error;
12420
- 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 };
12421
- }
12422
- }
12423
- async function retryTask(id) {
12424
- var _a, _b, _c, _d;
12425
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12426
- try {
12427
- const response = await apiClient.post(`${BASE$1}/${id}/retry`);
12428
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12429
- } catch (error) {
12430
- const e = error;
12431
- 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 };
12432
- }
12433
- }
12434
- async function progressTask(id, data) {
12435
- var _a, _b, _c;
12436
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12437
- try {
12438
- await apiClient.post(`${BASE$1}/${id}/progress`, data);
12439
- } catch (error) {
12440
- const e = error;
12441
- 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 };
12442
- }
12443
- }
12444
- async function signalTask(id, data, branchId) {
12445
- var _a, _b, _c, _d;
12446
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12447
- try {
12448
- const params = branchId ? { branchId } : void 0;
12449
- const response = await apiClient.post(`${BASE$1}/${id}/signal`, data, { params });
12450
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12451
- } catch (error) {
12452
- const e = error;
12453
- 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 };
12454
- }
12455
- }
12456
- const BASE = "/webcron/inspection/bins";
12457
- async function listBins() {
12458
- var _a, _b, _c, _d;
12459
- try {
12460
- const response = await apiClient.get(BASE);
12461
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12462
- } catch (error) {
12463
- const e = error;
12464
- 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 };
12465
- }
12466
- }
12467
- async function createBin(data) {
12468
- var _a, _b, _c, _d, _e;
12469
- if (!((_a = data.name) == null ? void 0 : _a.trim())) throw { message: "name is required", status: 400 };
12470
- try {
12471
- const response = await apiClient.post(BASE, data);
12472
- return ((_b = response.data) == null ? void 0 : _b.data) ?? response.data;
12473
- } catch (error) {
12474
- const e = error;
12475
- 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 };
12476
- }
12477
- }
12478
- async function getBin(id) {
12479
- var _a, _b, _c, _d;
12480
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12481
- try {
12482
- const response = await apiClient.get(`${BASE}/${id}`);
12483
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12484
- } catch (error) {
12485
- const e = error;
12486
- 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 };
12487
- }
12488
- }
12489
- async function deleteBin(id) {
12490
- var _a, _b, _c;
12491
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12492
- try {
12493
- await apiClient.delete(`${BASE}/${id}`);
12494
- } catch (error) {
12495
- const e = error;
12496
- 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 };
12497
- }
12498
- }
12499
- async function getBinRequests(id, params) {
12500
- var _a, _b, _c, _d;
12501
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12502
- try {
12503
- const response = await apiClient.get(`${BASE}/${id}/requests`, { params });
12504
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12505
- } catch (error) {
12506
- const e = error;
12507
- 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 };
12508
- }
12509
- }
12510
- async function clearBinRequests(id) {
12511
- var _a, _b, _c;
12512
- if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
12513
- try {
12514
- await apiClient.delete(`${BASE}/${id}/requests`);
12515
- } catch (error) {
12516
- const e = error;
12517
- 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 };
12518
- }
12519
- }
12520
- async function triggerWorkflowById(id, data) {
12521
- var _a, _b, _c, _d;
12522
- if (!(id == null ? void 0 : id.trim())) {
12523
- throw { message: "id is required", status: 400 };
12524
- }
12525
- try {
12526
- const response = await apiClient.post(
12527
- `/workflow/trigger/${id.trim()}`,
12528
- data ?? {}
12529
- );
12530
- return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
12531
- } catch (error) {
12532
- const e = error;
12533
- const message = ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || e.message || "Failed to trigger workflow";
12534
- const status = ((_d = e.response) == null ? void 0 : _d.status) || 500;
12535
- throw { message, status };
12536
- }
12537
- }
12538
- const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12539
- __proto__: null,
12540
- cancelTask,
12541
- clearBinRequests,
12542
- createBin,
12543
- createTask,
12544
- createWebhook,
12545
- createWebhookSchedule,
12546
- deleteBin,
12547
- deleteSchedule,
12548
- deleteWebhook,
12549
- getBin,
12550
- getBinRequests,
12551
- getExecution,
12552
- getSchedule,
12553
- getTask,
12554
- getWebhook,
12555
- getWebhookExecutions,
12556
- getWebhookSchedules,
12557
- listBins,
12558
- listExecutions,
12559
- listTasks,
12560
- listWebhooks,
12561
- pauseSchedule,
12562
- progressTask,
12563
- resumeSchedule,
12564
- retryExecution,
12565
- retryTask,
12566
- signalTask,
12567
- testWebhook,
12568
- triggerSchedule,
12569
- triggerWorkflowById,
12570
- updateSchedule,
12571
- updateWebhook
12572
- }, Symbol.toStringTag, { value: "Module" }));
12573
12229
  const renderTemplate = async (body) => {
12574
12230
  var _a, _b, _c;
12575
12231
  try {
@@ -12600,30 +12256,29 @@ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
12600
12256
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12601
12257
  __proto__: null,
12602
12258
  apiClient,
12603
- audit: index$a,
12604
- chat: index$i,
12605
- clientIp: index$5,
12606
- dataset: index$h,
12607
- definition: index$m,
12608
- emailEngine: index$4,
12609
- files: index$n,
12610
- form: index$b,
12611
- inboxItems: index$7,
12612
- inputTable: index$g,
12613
- metric: index$j,
12614
- permissions: index$6,
12615
- process: index$8,
12616
- recon: index$c,
12617
- statement: index$e,
12618
- task: index$d,
12619
- tcn: index$3,
12620
- 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,
12621
12277
  templates: index$1,
12622
- user: index$p,
12623
- webcron: index$2,
12624
- workbook: index$f,
12625
- workflow: index$o,
12626
- worksheet: index$l
12278
+ user: index$o,
12279
+ workbook: index$e,
12280
+ workflow: index$n,
12281
+ worksheet: index$k
12627
12282
  }, Symbol.toStringTag, { value: "Module" }));
12628
12283
  var InputTableColumnType = /* @__PURE__ */ ((InputTableColumnType2) => {
12629
12284
  InputTableColumnType2["UUID"] = "uuid";
@@ -14700,6 +14355,6 @@ export {
14700
14355
  copaInputTableDb,
14701
14356
  setConfig as copaSetConfig,
14702
14357
  bluecopaTailwindConfig as copaTailwindConfig,
14703
- index$k as copaUtils
14358
+ index$j as copaUtils
14704
14359
  };
14705
14360
  //# sourceMappingURL=index.es.js.map