@bluecopa/core 0.1.95 → 0.1.97

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.
Files changed (34) hide show
  1. package/dist/api/databox/dropFileToDatabox.d.ts +22 -0
  2. package/dist/api/databox/getDataboxFile.d.ts +12 -0
  3. package/dist/api/databox/getDataboxFileDownloadUrl.d.ts +13 -0
  4. package/dist/api/databox/getDataboxFileRuns.d.ts +12 -0
  5. package/dist/api/databox/getDataboxFileStatus.d.ts +13 -0
  6. package/dist/api/databox/getDataboxFolder.d.ts +12 -0
  7. package/dist/api/databox/getDataboxFolderDatasets.d.ts +14 -0
  8. package/dist/api/databox/getDataboxFolderDuplicates.d.ts +15 -0
  9. package/dist/api/databox/getDataboxFolderFiles.d.ts +12 -0
  10. package/dist/api/databox/getDataboxFolderSchema.d.ts +14 -0
  11. package/dist/api/databox/getDataboxSchemaHistory.d.ts +13 -0
  12. package/dist/api/databox/getDataboxTrashFiles.d.ts +12 -0
  13. package/dist/api/databox/index.d.ts +18 -0
  14. package/dist/api/databox/permanentDeleteDataboxFiles.d.ts +11 -0
  15. package/dist/api/databox/restoreDataboxFile.d.ts +12 -0
  16. package/dist/api/databox/runDataboxFolder.d.ts +16 -0
  17. package/dist/api/databox/trashDataboxFiles.d.ts +12 -0
  18. package/dist/api/databox/types.d.ts +74 -0
  19. package/dist/api/databox/updateDataboxFolderSchema.d.ts +16 -0
  20. package/dist/api/dataset/getDatasetDuplicates.d.ts +28 -0
  21. package/dist/api/dataset/getDatasetExceptions.d.ts +20 -0
  22. package/dist/api/dataset/index.d.ts +2 -0
  23. package/dist/api/definition/runPublishedDefinition.d.ts +5 -0
  24. package/dist/api/index.d.ts +1 -0
  25. package/dist/api/metric/getData.d.ts +5 -0
  26. package/dist/api/reconV2/createReconV2.d.ts +4 -1
  27. package/dist/api/reconV2/getReconV2Templates.d.ts +9 -0
  28. package/dist/api/reconV2/getReconV2Workflow.d.ts +14 -0
  29. package/dist/api/reconV2/index.d.ts +2 -0
  30. package/dist/api/reconV2/updateReconV2.d.ts +4 -1
  31. package/dist/index.d.ts +24 -0
  32. package/dist/index.es.js +638 -82
  33. package/dist/index.es.js.map +1 -1
  34. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -143,7 +143,7 @@ async function getAllUsers() {
143
143
  throw { message, status };
144
144
  }
145
145
  }
146
- const index$p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
146
+ const index$q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
147
147
  __proto__: null,
148
148
  getAllUsers,
149
149
  getLoggedInUserDetails
@@ -219,7 +219,7 @@ async function getAllHttpTriggers() {
219
219
  throw { message, status };
220
220
  }
221
221
  }
222
- const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
222
+ const index$p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
223
223
  __proto__: null,
224
224
  WorkflowStatus,
225
225
  getAllHttpTriggers,
@@ -347,7 +347,7 @@ async function getFileByFolderIdAndName({
347
347
  throw data !== void 0 ? { message, status, data } : { message, status };
348
348
  }
349
349
  }
350
- const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
350
+ const index$o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
351
351
  __proto__: null,
352
352
  fileDownload,
353
353
  fileUpload,
@@ -355,7 +355,7 @@ const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
355
355
  getFileUrlByFileId
356
356
  }, Symbol.toStringTag, { value: "Module" }));
357
357
  const runPublishedDefinition = async (props) => {
358
- const { sheet, variable, inputs, describe, solutionBindings, source } = props;
358
+ const { sheet, variable, inputs, describe, solutionBindings, limit, source } = props;
359
359
  if (!sheet) {
360
360
  throw { message: "Definition is null", status: 400 };
361
361
  }
@@ -372,7 +372,9 @@ const runPublishedDefinition = async (props) => {
372
372
  describe,
373
373
  // Only include when non-empty — empty/missing tells the BFF to
374
374
  // skip hydration and pass through to fx_api `published/run`.
375
- ...solutionBindings && Object.keys(solutionBindings).length > 0 ? { solutionBindings } : {}
375
+ ...solutionBindings && Object.keys(solutionBindings).length > 0 ? { solutionBindings } : {},
376
+ // Only include when provided — the BFF falls back to ROW_LIMIT.
377
+ ...typeof limit === "number" ? { limit } : {}
376
378
  },
377
379
  { cancelToken: source?.token }
378
380
  );
@@ -440,7 +442,7 @@ const runDefinition = async (props) => {
440
442
  };
441
443
  }
442
444
  };
443
- const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
445
+ const index$n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
444
446
  __proto__: null,
445
447
  runDefinition,
446
448
  runPublishedDefinition,
@@ -476,7 +478,7 @@ const getWorksheetsByType = async (type) => {
476
478
  throw { message, status };
477
479
  }
478
480
  };
479
- const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
481
+ const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
480
482
  __proto__: null,
481
483
  getWorksheets,
482
484
  getWorksheetsByType
@@ -10022,7 +10024,7 @@ async function applySolutionBindings(fileRead, definitionType) {
10022
10024
  const bindings = await fetchSolutionBindings();
10023
10025
  return applyBindings(fileRead, bindings, definitionType);
10024
10026
  }
10025
- const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10027
+ const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10026
10028
  __proto__: null,
10027
10029
  applyBindings,
10028
10030
  applySolutionBindings,
@@ -10183,42 +10185,32 @@ const getData$3 = async (metricSheetId, options) => {
10183
10185
  });
10184
10186
  let resultData = [];
10185
10187
  if (!_.isEmpty(valueCols) || !_.isEmpty(metadata.rowGroupCols) || !_.isEmpty(metadata.pivotCols)) {
10188
+ const runArgs = {
10189
+ sheet: {
10190
+ id: hydratedSheet.id,
10191
+ lastModifiedDate: hydratedSheet.lastModifiedDate
10192
+ },
10193
+ variable: variableName,
10194
+ describe: parentTableVariable,
10195
+ solutionBindings: bindings,
10196
+ limit: options?.limit
10197
+ };
10186
10198
  if (!_.isEmpty(definitionInputs)) {
10187
- let promises = [];
10188
- definitionInputs.forEach((input) => {
10189
- promises.push(
10190
- runPublishedDefinition({
10191
- inputs: { ...input },
10192
- sheet: {
10193
- id: hydratedSheet.id,
10194
- lastModifiedDate: hydratedSheet.lastModifiedDate
10195
- },
10196
- variable: variableName,
10197
- describe: parentTableVariable,
10198
- solutionBindings: bindings
10199
- })
10200
- );
10201
- });
10202
- const data = await Promise.all(promises);
10199
+ const data = await Promise.all(
10200
+ definitionInputs.map(
10201
+ (input) => runPublishedDefinition({ ...runArgs, inputs: { ...input } })
10202
+ )
10203
+ );
10203
10204
  resultData = _.map(data, (d) => d.data.data);
10204
10205
  } else {
10205
- const result = (await runPublishedDefinition({
10206
- inputs: { ...inputs },
10207
- sheet: {
10208
- id: hydratedSheet.id,
10209
- lastModifiedDate: hydratedSheet.lastModifiedDate
10210
- },
10211
- variable: variableName,
10212
- describe: parentTableVariable,
10213
- solutionBindings: bindings
10214
- })).data;
10206
+ const result = (await runPublishedDefinition({ ...runArgs, inputs: { ...inputs } })).data;
10215
10207
  resultData = result.data;
10216
10208
  }
10217
10209
  }
10218
10210
  resultData = _.flatten(resultData);
10219
10211
  return { data: resultData };
10220
10212
  };
10221
- const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10213
+ const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10222
10214
  __proto__: null,
10223
10215
  getData: getData$3
10224
10216
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10365,7 +10357,7 @@ async function checkSubscriptionStatus(userId, threadId) {
10365
10357
  throw { message, status };
10366
10358
  }
10367
10359
  }
10368
- const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10360
+ const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10369
10361
  __proto__: null,
10370
10362
  checkSubscriptionStatus,
10371
10363
  createThread,
@@ -10572,10 +10564,56 @@ const getVirtualDatasets = async () => {
10572
10564
  throw { message, status };
10573
10565
  }
10574
10566
  };
10575
- const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10567
+ async function getDatasetExceptions({
10568
+ datasetId
10569
+ }) {
10570
+ try {
10571
+ const id = datasetId?.trim();
10572
+ if (!id) {
10573
+ throw { message: "Dataset ID is required", status: 400 };
10574
+ }
10575
+ const response = await apiClient.get(
10576
+ `/datasets/${encodeURIComponent(id)}/exceptions`
10577
+ );
10578
+ if (!response.data) {
10579
+ throw { message: "Failed to fetch dataset exceptions", status: 500 };
10580
+ }
10581
+ return response.data;
10582
+ } catch (error) {
10583
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching dataset exceptions";
10584
+ const status = error.response?.status || error.status || 500;
10585
+ throw { message, status };
10586
+ }
10587
+ }
10588
+ async function getDatasetDuplicates({
10589
+ datasetId,
10590
+ group
10591
+ }) {
10592
+ try {
10593
+ const id = datasetId?.trim();
10594
+ if (!id) {
10595
+ throw { message: "Dataset ID is required", status: 400 };
10596
+ }
10597
+ const response = await apiClient.get(
10598
+ `/datasets/${encodeURIComponent(id)}/duplicates`,
10599
+ { params: group?.trim() ? { group: group.trim() } : void 0 }
10600
+ );
10601
+ if (!response.data) {
10602
+ throw { message: "Failed to fetch dataset duplicates", status: 500 };
10603
+ }
10604
+ return response.data;
10605
+ } catch (error) {
10606
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching dataset duplicates";
10607
+ const status = error.response?.status || error.status || 500;
10608
+ throw { message, status };
10609
+ }
10610
+ }
10611
+ const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10576
10612
  __proto__: null,
10577
10613
  getAllDatasets,
10578
10614
  getData: getData$2,
10615
+ getDatasetDuplicates,
10616
+ getDatasetExceptions,
10579
10617
  getSampleData,
10580
10618
  getVirtualDatasets
10581
10619
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10884,7 +10922,7 @@ const deleteRow = async (tableId, rowId, idField = "_copa_id") => {
10884
10922
  throw { message, status };
10885
10923
  }
10886
10924
  };
10887
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10925
+ const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10888
10926
  __proto__: null,
10889
10927
  deleteRow,
10890
10928
  getData: getData$1,
@@ -10974,7 +11012,7 @@ async function publishWorkbook({
10974
11012
  throw { message, status };
10975
11013
  }
10976
11014
  }
10977
- const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11015
+ const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10978
11016
  __proto__: null,
10979
11017
  getPublishedWorkbookById,
10980
11018
  getWorkbookDetails,
@@ -11230,7 +11268,7 @@ const getRunResultById = async (runId) => {
11230
11268
  throw { message, status };
11231
11269
  }
11232
11270
  };
11233
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11271
+ const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11234
11272
  __proto__: null,
11235
11273
  createNewRun,
11236
11274
  getData,
@@ -11259,7 +11297,7 @@ async function getTaskDetails({
11259
11297
  throw { message, status };
11260
11298
  }
11261
11299
  }
11262
- const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11300
+ const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11263
11301
  __proto__: null,
11264
11302
  getTaskDetails
11265
11303
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11303,7 +11341,7 @@ async function getAllReconWorkflows() {
11303
11341
  throw { message, status };
11304
11342
  }
11305
11343
  }
11306
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11344
+ const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11307
11345
  __proto__: null,
11308
11346
  getAllReconWorkflows,
11309
11347
  runRecon
@@ -11313,7 +11351,8 @@ async function createReconV2({
11313
11351
  type,
11314
11352
  leftDataset,
11315
11353
  rightDataset,
11316
- config
11354
+ config,
11355
+ customFields
11317
11356
  }) {
11318
11357
  try {
11319
11358
  if (!name) {
@@ -11324,7 +11363,8 @@ async function createReconV2({
11324
11363
  type,
11325
11364
  leftDataset,
11326
11365
  rightDataset,
11327
- config
11366
+ config,
11367
+ customFields
11328
11368
  });
11329
11369
  if (!response.data) {
11330
11370
  throw { message: "Failed to create recon v2 workflow", status: 500 };
@@ -11339,7 +11379,8 @@ async function createReconV2({
11339
11379
  async function updateReconV2({
11340
11380
  reconWorkflow,
11341
11381
  leftDataset,
11342
- rightDataset
11382
+ rightDataset,
11383
+ customFields
11343
11384
  }) {
11344
11385
  try {
11345
11386
  if (!reconWorkflow?.id) {
@@ -11348,7 +11389,8 @@ async function updateReconV2({
11348
11389
  const response = await apiClient.put("/recon-v2/update", {
11349
11390
  reconWorkflow,
11350
11391
  leftDataset,
11351
- rightDataset
11392
+ rightDataset,
11393
+ customFields
11352
11394
  });
11353
11395
  if (!response.data) {
11354
11396
  throw { message: "Failed to update recon v2 workflow", status: 500 };
@@ -11421,6 +11463,27 @@ async function getAllReconV2Workflows() {
11421
11463
  throw { message, status };
11422
11464
  }
11423
11465
  }
11466
+ async function getReconV2Workflow({
11467
+ id
11468
+ }) {
11469
+ try {
11470
+ const trimmedId = id?.trim();
11471
+ if (!trimmedId) {
11472
+ throw { message: "Workflow id is required", status: 400 };
11473
+ }
11474
+ const response = await apiClient.get(
11475
+ `/recon-v2/get/${encodeURIComponent(trimmedId)}`
11476
+ );
11477
+ if (!response.data) {
11478
+ throw { message: "Failed to fetch recon v2 workflow", status: 500 };
11479
+ }
11480
+ return response.data;
11481
+ } catch (error) {
11482
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching recon v2 workflow";
11483
+ const status = error.response?.status || 500;
11484
+ throw { message, status };
11485
+ }
11486
+ }
11424
11487
  async function getReconV2Runs({
11425
11488
  workflowId
11426
11489
  }) {
@@ -11625,7 +11688,95 @@ async function getReconV2Explanation({
11625
11688
  throw { message, status };
11626
11689
  }
11627
11690
  }
11628
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11691
+ const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
11692
+ const asString = (v, fallback = "") => typeof v === "string" ? v : fallback;
11693
+ const asBool = (v, fallback = false) => typeof v === "boolean" ? v : fallback;
11694
+ const asStringOrNull = (v) => typeof v === "string" ? v : null;
11695
+ function parseSignalRule(raw) {
11696
+ if (!isObject(raw)) return null;
11697
+ const value = typeof raw.value === "string" || typeof raw.value === "number" ? raw.value : null;
11698
+ return {
11699
+ ruleType: asString(raw.ruleType),
11700
+ col: asStringOrNull(raw.col),
11701
+ operator: asStringOrNull(raw.operator),
11702
+ value,
11703
+ isNot: asBool(raw.isNot),
11704
+ isCaseSensitive: asBool(raw.isCaseSensitive, true),
11705
+ rules: Array.isArray(raw.rules) ? raw.rules.map(parseSignalRule).filter((r) => r !== null) : null,
11706
+ ignoreIfColNotExists: asBool(raw.ignoreIfColNotExists)
11707
+ };
11708
+ }
11709
+ function parseFlags(raw) {
11710
+ if (!isObject(raw)) return null;
11711
+ const flags = {};
11712
+ for (const [k, v] of Object.entries(raw)) {
11713
+ if (typeof v === "boolean") flags[k] = v;
11714
+ }
11715
+ return flags;
11716
+ }
11717
+ function parseTypeMapping(raw) {
11718
+ if (!isObject(raw)) return null;
11719
+ return {
11720
+ exceptionType: asString(raw.exceptionType),
11721
+ agingGate: asStringOrNull(raw.agingGate),
11722
+ flags: parseFlags(raw.flags)
11723
+ };
11724
+ }
11725
+ function parseItem(raw) {
11726
+ if (!isObject(raw)) return null;
11727
+ return {
11728
+ name: asString(raw.name),
11729
+ description: asString(raw.description),
11730
+ typeMappings: Array.isArray(raw.typeMappings) ? raw.typeMappings.map(parseTypeMapping).filter((m) => m !== null) : [],
11731
+ mappingMode: asString(raw.mappingMode, "single"),
11732
+ signals: parseSignalRule(raw.signals),
11733
+ actionOverride: isObject(raw.actionOverride) ? raw.actionOverride : null,
11734
+ agingNote: asStringOrNull(raw.agingNote)
11735
+ };
11736
+ }
11737
+ function parseDomain(raw) {
11738
+ if (!isObject(raw)) return null;
11739
+ return {
11740
+ domainId: asString(raw.domainId),
11741
+ domainName: asString(raw.domainName),
11742
+ leftLabel: asString(raw.leftLabel),
11743
+ rightLabel: asString(raw.rightLabel),
11744
+ items: Array.isArray(raw.items) ? raw.items.map(parseItem).filter((i) => i !== null) : []
11745
+ };
11746
+ }
11747
+ function parseDomainTemplate(raw) {
11748
+ if (!isObject(raw)) return null;
11749
+ const domain = parseDomain(raw.domain);
11750
+ if (!domain) return null;
11751
+ return {
11752
+ domain,
11753
+ signalColumns: isObject(raw.signalColumns) ? raw.signalColumns : null,
11754
+ thresholds: isObject(raw.thresholds) ? raw.thresholds : null
11755
+ };
11756
+ }
11757
+ function parseReconV2Templates(raw) {
11758
+ if (!isObject(raw)) return {};
11759
+ const catalog = {};
11760
+ for (const [domainId, entry] of Object.entries(raw)) {
11761
+ const parsed = parseDomainTemplate(entry);
11762
+ if (parsed) catalog[domainId] = parsed;
11763
+ }
11764
+ return catalog;
11765
+ }
11766
+ async function getReconV2Templates() {
11767
+ try {
11768
+ const response = await apiClient.get("/recon-v2/templates");
11769
+ if (!response.data) {
11770
+ throw { message: "Failed to fetch recon v2 templates", status: 500 };
11771
+ }
11772
+ return parseReconV2Templates(response.data);
11773
+ } catch (error) {
11774
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching recon v2 templates";
11775
+ const status = error.response?.status || 500;
11776
+ throw { message, status };
11777
+ }
11778
+ }
11779
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11629
11780
  __proto__: null,
11630
11781
  createReconV2,
11631
11782
  deleteReconV2,
@@ -11637,6 +11788,8 @@ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
11637
11788
  getReconV2RunResult,
11638
11789
  getReconV2Runs,
11639
11790
  getReconV2SmartResult,
11791
+ getReconV2Templates,
11792
+ getReconV2Workflow,
11640
11793
  runReconV2,
11641
11794
  startReconV2Clean,
11642
11795
  startReconV2Profile,
@@ -11734,7 +11887,7 @@ async function createOrUpdateForm({
11734
11887
  throw { message, status: status2 };
11735
11888
  }
11736
11889
  }
11737
- const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11890
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11738
11891
  __proto__: null,
11739
11892
  createOrUpdateForm,
11740
11893
  getFormById,
@@ -11773,7 +11926,7 @@ async function createAuditLog(params) {
11773
11926
  throw { message, status };
11774
11927
  }
11775
11928
  }
11776
- const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11929
+ const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11777
11930
  __proto__: null,
11778
11931
  createAuditLog,
11779
11932
  getAuditLogs
@@ -11791,7 +11944,7 @@ async function getAllTemplatedPipelines() {
11791
11944
  throw { message, status };
11792
11945
  }
11793
11946
  }
11794
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11947
+ const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11795
11948
  __proto__: null,
11796
11949
  getAllTemplatedPipelines
11797
11950
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11991,7 +12144,7 @@ async function executeNow(triggerId, scheduleName) {
11991
12144
  throw { message, status };
11992
12145
  }
11993
12146
  }
11994
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12147
+ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11995
12148
  __proto__: null,
11996
12149
  deleteProcessTrigger,
11997
12150
  executeNow,
@@ -12089,7 +12242,7 @@ async function createInboxItemPerUser(data) {
12089
12242
  throw { message, status };
12090
12243
  }
12091
12244
  }
12092
- const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12245
+ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12093
12246
  __proto__: null,
12094
12247
  createInboxItemPerUser,
12095
12248
  getAllInboxItems,
@@ -12116,7 +12269,7 @@ async function getPermissions(params) {
12116
12269
  throw { message, status };
12117
12270
  }
12118
12271
  }
12119
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12272
+ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12120
12273
  __proto__: null,
12121
12274
  getPermissions
12122
12275
  }, Symbol.toStringTag, { value: "Module" }));
@@ -12133,7 +12286,7 @@ async function getClientIp() {
12133
12286
  throw { message, status };
12134
12287
  }
12135
12288
  }
12136
- const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12289
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12137
12290
  __proto__: null,
12138
12291
  getClientIp
12139
12292
  }, Symbol.toStringTag, { value: "Module" }));
@@ -12277,7 +12430,7 @@ async function searchMessages(body) {
12277
12430
  throw { message, status };
12278
12431
  }
12279
12432
  }
12280
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12433
+ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12281
12434
  __proto__: null,
12282
12435
  createConversation,
12283
12436
  getAllConversations,
@@ -12538,7 +12691,7 @@ async function ftpManualDialReport(token, templateNumber, groupSid) {
12538
12691
  throw { message, status };
12539
12692
  }
12540
12693
  }
12541
- const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12694
+ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12542
12695
  __proto__: null,
12543
12696
  agentDisconnect,
12544
12697
  agentGetCallFromHold,
@@ -12583,37 +12736,438 @@ const renderTemplate = async (body) => {
12583
12736
  throw { message, status };
12584
12737
  }
12585
12738
  };
12586
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12739
+ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12587
12740
  __proto__: null,
12588
12741
  renderTemplate
12589
12742
  }, Symbol.toStringTag, { value: "Module" }));
12743
+ const DATABOX_SUPPORTED_EXTENSIONS = [
12744
+ "csv",
12745
+ "xlsx",
12746
+ "xls",
12747
+ "xlsb",
12748
+ "json"
12749
+ ];
12750
+ async function getDataboxFolder({
12751
+ folderId
12752
+ }) {
12753
+ try {
12754
+ const id = folderId?.trim();
12755
+ if (!id) {
12756
+ throw { message: "Folder ID is required", status: 400 };
12757
+ }
12758
+ const response = await apiClient.get(
12759
+ `/databox/folders/${encodeURIComponent(id)}`
12760
+ );
12761
+ if (!response.data) {
12762
+ throw { message: "Failed to fetch databox folder", status: 500 };
12763
+ }
12764
+ return response.data;
12765
+ } catch (error) {
12766
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder";
12767
+ const status = error.response?.status || error.status || 500;
12768
+ throw { message, status };
12769
+ }
12770
+ }
12771
+ async function getDataboxFolderFiles({
12772
+ folderId
12773
+ }) {
12774
+ try {
12775
+ const id = folderId?.trim();
12776
+ if (!id) {
12777
+ throw { message: "Folder ID is required", status: 400 };
12778
+ }
12779
+ const response = await apiClient.get(
12780
+ `/databox/folders/${encodeURIComponent(id)}/files`
12781
+ );
12782
+ if (!response.data) {
12783
+ throw { message: "Failed to fetch databox folder files", status: 500 };
12784
+ }
12785
+ return response.data;
12786
+ } catch (error) {
12787
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder files";
12788
+ const status = error.response?.status || error.status || 500;
12789
+ throw { message, status };
12790
+ }
12791
+ }
12792
+ async function getDataboxFolderDatasets({
12793
+ folderId
12794
+ }) {
12795
+ try {
12796
+ const id = folderId?.trim();
12797
+ if (!id) {
12798
+ throw { message: "Folder ID is required", status: 400 };
12799
+ }
12800
+ const response = await apiClient.get(
12801
+ `/databox/folders/${encodeURIComponent(id)}/datasets`
12802
+ );
12803
+ if (!response.data) {
12804
+ throw { message: "Failed to fetch databox folder datasets", status: 500 };
12805
+ }
12806
+ return response.data;
12807
+ } catch (error) {
12808
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder datasets";
12809
+ const status = error.response?.status || error.status || 500;
12810
+ throw { message, status };
12811
+ }
12812
+ }
12813
+ async function getDataboxFolderDuplicates({
12814
+ folderId
12815
+ }) {
12816
+ try {
12817
+ const id = folderId?.trim();
12818
+ if (!id) {
12819
+ throw { message: "Folder ID is required", status: 400 };
12820
+ }
12821
+ const response = await apiClient.get(
12822
+ `/databox/folders/${encodeURIComponent(id)}/duplicates`
12823
+ );
12824
+ if (!response.data) {
12825
+ throw {
12826
+ message: "Failed to fetch databox folder duplicates",
12827
+ status: 500
12828
+ };
12829
+ }
12830
+ return response.data;
12831
+ } catch (error) {
12832
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder duplicates";
12833
+ const status = error.response?.status || error.status || 500;
12834
+ throw { message, status };
12835
+ }
12836
+ }
12837
+ async function dropFileToDatabox({
12838
+ folderId,
12839
+ file,
12840
+ delimiter
12841
+ }) {
12842
+ try {
12843
+ const id = folderId?.trim();
12844
+ if (!id) {
12845
+ throw { message: "Folder ID is required", status: 400 };
12846
+ }
12847
+ if (!file || !file.name) {
12848
+ throw { message: "File is required", status: 400 };
12849
+ }
12850
+ const extension = file.name.split(".").pop()?.toLowerCase() ?? "";
12851
+ if (!DATABOX_SUPPORTED_EXTENSIONS.includes(extension)) {
12852
+ throw {
12853
+ message: `Unsupported file type ".${extension}". Supported types: ${DATABOX_SUPPORTED_EXTENSIONS.join(", ")}`,
12854
+ status: 400
12855
+ };
12856
+ }
12857
+ const formData = new FormData();
12858
+ formData.append("file", file);
12859
+ if (delimiter?.trim()) {
12860
+ formData.append("delimiter", delimiter.trim());
12861
+ }
12862
+ const response = await apiClient.post(
12863
+ `/databox/folders/${encodeURIComponent(id)}/files`,
12864
+ formData,
12865
+ { headers: { "Content-Type": "multipart/form-data" } }
12866
+ );
12867
+ if (!response.data) {
12868
+ throw { message: "Failed to drop file to databox", status: 500 };
12869
+ }
12870
+ return response.data;
12871
+ } catch (error) {
12872
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while dropping file to databox";
12873
+ const status = error.response?.status || error.status || 500;
12874
+ throw { message, status };
12875
+ }
12876
+ }
12877
+ async function runDataboxFolder({
12878
+ folderId,
12879
+ force
12880
+ }) {
12881
+ try {
12882
+ const id = folderId?.trim();
12883
+ if (!id) {
12884
+ throw { message: "Folder ID is required", status: 400 };
12885
+ }
12886
+ await apiClient.post(
12887
+ `/databox/folders/${encodeURIComponent(id)}/run`,
12888
+ void 0,
12889
+ { params: force ? { force: "true" } : void 0 }
12890
+ );
12891
+ } catch (error) {
12892
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while running databox folder";
12893
+ const status = error.response?.status || error.status || 500;
12894
+ throw { message, status };
12895
+ }
12896
+ }
12897
+ async function getDataboxFolderSchema({
12898
+ folderId
12899
+ }) {
12900
+ try {
12901
+ const id = folderId?.trim();
12902
+ if (!id) {
12903
+ throw { message: "Folder ID is required", status: 400 };
12904
+ }
12905
+ const response = await apiClient.get(
12906
+ `/databox/folders/${encodeURIComponent(id)}/schema`
12907
+ );
12908
+ if (!response.data) {
12909
+ throw { message: "Failed to fetch databox folder schema", status: 500 };
12910
+ }
12911
+ return response.data;
12912
+ } catch (error) {
12913
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder schema";
12914
+ const status = error.response?.status || error.status || 500;
12915
+ throw { message, status };
12916
+ }
12917
+ }
12918
+ async function updateDataboxFolderSchema({
12919
+ folderId,
12920
+ streams
12921
+ }) {
12922
+ try {
12923
+ const id = folderId?.trim();
12924
+ if (!id) {
12925
+ throw { message: "Folder ID is required", status: 400 };
12926
+ }
12927
+ if (!Array.isArray(streams) || streams.length === 0) {
12928
+ throw { message: "Schema streams are required", status: 400 };
12929
+ }
12930
+ const response = await apiClient.post(
12931
+ `/databox/folders/${encodeURIComponent(id)}/schema`,
12932
+ { folderId: id, catalog: { streams } }
12933
+ );
12934
+ return response.data;
12935
+ } catch (error) {
12936
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while updating databox folder schema";
12937
+ const status = error.response?.status || error.status || 500;
12938
+ throw { message, status };
12939
+ }
12940
+ }
12941
+ async function getDataboxSchemaHistory({
12942
+ folderId
12943
+ }) {
12944
+ try {
12945
+ const id = folderId?.trim();
12946
+ if (!id) {
12947
+ throw { message: "Folder ID is required", status: 400 };
12948
+ }
12949
+ const response = await apiClient.get(
12950
+ `/databox/folders/${encodeURIComponent(id)}/schema/history`
12951
+ );
12952
+ if (!response.data) {
12953
+ throw { message: "Failed to fetch databox schema history", status: 500 };
12954
+ }
12955
+ return response.data;
12956
+ } catch (error) {
12957
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox schema history";
12958
+ const status = error.response?.status || error.status || 500;
12959
+ throw { message, status };
12960
+ }
12961
+ }
12962
+ async function getDataboxTrashFiles({
12963
+ folderId
12964
+ }) {
12965
+ try {
12966
+ const id = folderId?.trim();
12967
+ if (!id) {
12968
+ throw { message: "Folder ID is required", status: 400 };
12969
+ }
12970
+ const response = await apiClient.get(
12971
+ `/databox/folders/${encodeURIComponent(id)}/trash`
12972
+ );
12973
+ if (!response.data) {
12974
+ throw { message: "Failed to fetch databox trash files", status: 500 };
12975
+ }
12976
+ return response.data;
12977
+ } catch (error) {
12978
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox trash files";
12979
+ const status = error.response?.status || error.status || 500;
12980
+ throw { message, status };
12981
+ }
12982
+ }
12983
+ async function getDataboxFile({
12984
+ fileId
12985
+ }) {
12986
+ try {
12987
+ const id = fileId?.trim();
12988
+ if (!id) {
12989
+ throw { message: "File ID is required", status: 400 };
12990
+ }
12991
+ const response = await apiClient.get(
12992
+ `/databox/files/${encodeURIComponent(id)}`
12993
+ );
12994
+ if (!response.data) {
12995
+ throw { message: "Failed to fetch databox file", status: 500 };
12996
+ }
12997
+ return response.data;
12998
+ } catch (error) {
12999
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file";
13000
+ const status = error.response?.status || error.status || 500;
13001
+ throw { message, status };
13002
+ }
13003
+ }
13004
+ async function getDataboxFileStatus({
13005
+ fileId
13006
+ }) {
13007
+ try {
13008
+ const id = fileId?.trim();
13009
+ if (!id) {
13010
+ throw { message: "File ID is required", status: 400 };
13011
+ }
13012
+ const response = await apiClient.get(
13013
+ `/databox/files/${encodeURIComponent(id)}/status`
13014
+ );
13015
+ if (!response.data) {
13016
+ throw { message: "Failed to fetch databox file status", status: 500 };
13017
+ }
13018
+ return response.data;
13019
+ } catch (error) {
13020
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file status";
13021
+ const status = error.response?.status || error.status || 500;
13022
+ throw { message, status };
13023
+ }
13024
+ }
13025
+ async function getDataboxFileRuns({
13026
+ fileId
13027
+ }) {
13028
+ try {
13029
+ const id = fileId?.trim();
13030
+ if (!id) {
13031
+ throw { message: "File ID is required", status: 400 };
13032
+ }
13033
+ const response = await apiClient.get(
13034
+ `/databox/files/${encodeURIComponent(id)}/runs`
13035
+ );
13036
+ if (!response.data) {
13037
+ throw { message: "Failed to fetch databox file runs", status: 500 };
13038
+ }
13039
+ return response.data;
13040
+ } catch (error) {
13041
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file runs";
13042
+ const status = error.response?.status || error.status || 500;
13043
+ throw { message, status };
13044
+ }
13045
+ }
13046
+ async function getDataboxFileDownloadUrl({
13047
+ fileId
13048
+ }) {
13049
+ try {
13050
+ const id = fileId?.trim();
13051
+ if (!id) {
13052
+ throw { message: "File ID is required", status: 400 };
13053
+ }
13054
+ const response = await apiClient.get(
13055
+ `/databox/files/${encodeURIComponent(id)}/download`
13056
+ );
13057
+ if (!response.data?.url) {
13058
+ throw {
13059
+ message: "Failed to fetch databox file download URL",
13060
+ status: 500
13061
+ };
13062
+ }
13063
+ return response.data;
13064
+ } catch (error) {
13065
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file download URL";
13066
+ const status = error.response?.status || error.status || 500;
13067
+ throw { message, status };
13068
+ }
13069
+ }
13070
+ async function trashDataboxFiles({
13071
+ fileIds
13072
+ }) {
13073
+ try {
13074
+ if (!Array.isArray(fileIds) || fileIds.length === 0) {
13075
+ throw { message: "File IDs are required", status: 400 };
13076
+ }
13077
+ const response = await apiClient.delete("/databox/files", {
13078
+ data: fileIds
13079
+ });
13080
+ return response.data;
13081
+ } catch (error) {
13082
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while trashing databox files";
13083
+ const status = error.response?.status || error.status || 500;
13084
+ throw { message, status };
13085
+ }
13086
+ }
13087
+ async function restoreDataboxFile({
13088
+ fileId
13089
+ }) {
13090
+ try {
13091
+ const id = fileId?.trim();
13092
+ if (!id) {
13093
+ throw { message: "File ID is required", status: 400 };
13094
+ }
13095
+ const response = await apiClient.post(
13096
+ `/databox/files/${encodeURIComponent(id)}/restore`
13097
+ );
13098
+ return response.data;
13099
+ } catch (error) {
13100
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while restoring databox file";
13101
+ const status = error.response?.status || error.status || 500;
13102
+ throw { message, status };
13103
+ }
13104
+ }
13105
+ async function permanentDeleteDataboxFiles({
13106
+ fileIds
13107
+ }) {
13108
+ try {
13109
+ if (!Array.isArray(fileIds) || fileIds.length === 0) {
13110
+ throw { message: "File IDs are required", status: 400 };
13111
+ }
13112
+ const response = await apiClient.delete("/databox/files/permanent", {
13113
+ data: fileIds
13114
+ });
13115
+ return response.data;
13116
+ } catch (error) {
13117
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while permanently deleting databox files";
13118
+ const status = error.response?.status || error.status || 500;
13119
+ throw { message, status };
13120
+ }
13121
+ }
13122
+ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13123
+ __proto__: null,
13124
+ DATABOX_SUPPORTED_EXTENSIONS,
13125
+ dropFileToDatabox,
13126
+ getDataboxFile,
13127
+ getDataboxFileDownloadUrl,
13128
+ getDataboxFileRuns,
13129
+ getDataboxFileStatus,
13130
+ getDataboxFolder,
13131
+ getDataboxFolderDatasets,
13132
+ getDataboxFolderDuplicates,
13133
+ getDataboxFolderFiles,
13134
+ getDataboxFolderSchema,
13135
+ getDataboxSchemaHistory,
13136
+ getDataboxTrashFiles,
13137
+ permanentDeleteDataboxFiles,
13138
+ restoreDataboxFile,
13139
+ runDataboxFolder,
13140
+ trashDataboxFiles,
13141
+ updateDataboxFolderSchema
13142
+ }, Symbol.toStringTag, { value: "Module" }));
12590
13143
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12591
13144
  __proto__: null,
12592
13145
  apiClient,
12593
- audit: index$9,
12594
- chat: index$i,
12595
- clientIp: index$4,
12596
- dataset: index$h,
12597
- definition: index$m,
12598
- emailEngine: index$3,
12599
- files: index$n,
12600
- form: index$a,
12601
- inboxItems: index$6,
12602
- inputTable: index$g,
12603
- metric: index$j,
12604
- permissions: index$5,
12605
- process: index$7,
12606
- recon: index$c,
12607
- reconV2: index$b,
12608
- statement: index$e,
12609
- task: index$d,
12610
- tcn: index$2,
12611
- templatedPipeline: index$8,
12612
- templates: index$1,
12613
- user: index$p,
12614
- workbook: index$f,
12615
- workflow: index$o,
12616
- worksheet: index$l
13146
+ audit: index$a,
13147
+ chat: index$j,
13148
+ clientIp: index$5,
13149
+ databox: index$1,
13150
+ dataset: index$i,
13151
+ definition: index$n,
13152
+ emailEngine: index$4,
13153
+ files: index$o,
13154
+ form: index$b,
13155
+ inboxItems: index$7,
13156
+ inputTable: index$h,
13157
+ metric: index$k,
13158
+ permissions: index$6,
13159
+ process: index$8,
13160
+ recon: index$d,
13161
+ reconV2: index$c,
13162
+ statement: index$f,
13163
+ task: index$e,
13164
+ tcn: index$3,
13165
+ templatedPipeline: index$9,
13166
+ templates: index$2,
13167
+ user: index$q,
13168
+ workbook: index$g,
13169
+ workflow: index$p,
13170
+ worksheet: index$m
12617
13171
  }, Symbol.toStringTag, { value: "Module" }));
12618
13172
  var InputTableColumnType = /* @__PURE__ */ ((InputTableColumnType2) => {
12619
13173
  InputTableColumnType2["UUID"] = "uuid";
@@ -14672,6 +15226,7 @@ const bluecopaTailwindConfig = {
14672
15226
  }
14673
15227
  };
14674
15228
  export {
15229
+ DATABOX_SUPPORTED_EXTENSIONS,
14675
15230
  InputTableColumnType,
14676
15231
  InputTableError,
14677
15232
  index as copaApi,
@@ -14679,6 +15234,7 @@ export {
14679
15234
  copaInputTableDb,
14680
15235
  setConfig as copaSetConfig,
14681
15236
  bluecopaTailwindConfig as copaTailwindConfig,
14682
- index$k as copaUtils
15237
+ index$l as copaUtils,
15238
+ parseReconV2Templates
14683
15239
  };
14684
15240
  //# sourceMappingURL=index.es.js.map