@bluecopa/core 0.1.95 → 0.1.96

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 (29) 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/index.d.ts +21 -0
  27. package/dist/index.es.js +518 -78
  28. package/dist/index.es.js.map +1 -1
  29. 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
@@ -11625,7 +11663,7 @@ async function getReconV2Explanation({
11625
11663
  throw { message, status };
11626
11664
  }
11627
11665
  }
11628
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11666
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11629
11667
  __proto__: null,
11630
11668
  createReconV2,
11631
11669
  deleteReconV2,
@@ -11734,7 +11772,7 @@ async function createOrUpdateForm({
11734
11772
  throw { message, status: status2 };
11735
11773
  }
11736
11774
  }
11737
- const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11775
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11738
11776
  __proto__: null,
11739
11777
  createOrUpdateForm,
11740
11778
  getFormById,
@@ -11773,7 +11811,7 @@ async function createAuditLog(params) {
11773
11811
  throw { message, status };
11774
11812
  }
11775
11813
  }
11776
- const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11814
+ const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11777
11815
  __proto__: null,
11778
11816
  createAuditLog,
11779
11817
  getAuditLogs
@@ -11791,7 +11829,7 @@ async function getAllTemplatedPipelines() {
11791
11829
  throw { message, status };
11792
11830
  }
11793
11831
  }
11794
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11832
+ const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11795
11833
  __proto__: null,
11796
11834
  getAllTemplatedPipelines
11797
11835
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11991,7 +12029,7 @@ async function executeNow(triggerId, scheduleName) {
11991
12029
  throw { message, status };
11992
12030
  }
11993
12031
  }
11994
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12032
+ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11995
12033
  __proto__: null,
11996
12034
  deleteProcessTrigger,
11997
12035
  executeNow,
@@ -12089,7 +12127,7 @@ async function createInboxItemPerUser(data) {
12089
12127
  throw { message, status };
12090
12128
  }
12091
12129
  }
12092
- const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12130
+ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12093
12131
  __proto__: null,
12094
12132
  createInboxItemPerUser,
12095
12133
  getAllInboxItems,
@@ -12116,7 +12154,7 @@ async function getPermissions(params) {
12116
12154
  throw { message, status };
12117
12155
  }
12118
12156
  }
12119
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12157
+ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12120
12158
  __proto__: null,
12121
12159
  getPermissions
12122
12160
  }, Symbol.toStringTag, { value: "Module" }));
@@ -12133,7 +12171,7 @@ async function getClientIp() {
12133
12171
  throw { message, status };
12134
12172
  }
12135
12173
  }
12136
- const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12174
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12137
12175
  __proto__: null,
12138
12176
  getClientIp
12139
12177
  }, Symbol.toStringTag, { value: "Module" }));
@@ -12277,7 +12315,7 @@ async function searchMessages(body) {
12277
12315
  throw { message, status };
12278
12316
  }
12279
12317
  }
12280
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12318
+ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12281
12319
  __proto__: null,
12282
12320
  createConversation,
12283
12321
  getAllConversations,
@@ -12538,7 +12576,7 @@ async function ftpManualDialReport(token, templateNumber, groupSid) {
12538
12576
  throw { message, status };
12539
12577
  }
12540
12578
  }
12541
- const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12579
+ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12542
12580
  __proto__: null,
12543
12581
  agentDisconnect,
12544
12582
  agentGetCallFromHold,
@@ -12583,37 +12621,438 @@ const renderTemplate = async (body) => {
12583
12621
  throw { message, status };
12584
12622
  }
12585
12623
  };
12586
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12624
+ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12587
12625
  __proto__: null,
12588
12626
  renderTemplate
12589
12627
  }, Symbol.toStringTag, { value: "Module" }));
12628
+ const DATABOX_SUPPORTED_EXTENSIONS = [
12629
+ "csv",
12630
+ "xlsx",
12631
+ "xls",
12632
+ "xlsb",
12633
+ "json"
12634
+ ];
12635
+ async function getDataboxFolder({
12636
+ folderId
12637
+ }) {
12638
+ try {
12639
+ const id = folderId?.trim();
12640
+ if (!id) {
12641
+ throw { message: "Folder ID is required", status: 400 };
12642
+ }
12643
+ const response = await apiClient.get(
12644
+ `/databox/folders/${encodeURIComponent(id)}`
12645
+ );
12646
+ if (!response.data) {
12647
+ throw { message: "Failed to fetch databox folder", status: 500 };
12648
+ }
12649
+ return response.data;
12650
+ } catch (error) {
12651
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder";
12652
+ const status = error.response?.status || error.status || 500;
12653
+ throw { message, status };
12654
+ }
12655
+ }
12656
+ async function getDataboxFolderFiles({
12657
+ folderId
12658
+ }) {
12659
+ try {
12660
+ const id = folderId?.trim();
12661
+ if (!id) {
12662
+ throw { message: "Folder ID is required", status: 400 };
12663
+ }
12664
+ const response = await apiClient.get(
12665
+ `/databox/folders/${encodeURIComponent(id)}/files`
12666
+ );
12667
+ if (!response.data) {
12668
+ throw { message: "Failed to fetch databox folder files", status: 500 };
12669
+ }
12670
+ return response.data;
12671
+ } catch (error) {
12672
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder files";
12673
+ const status = error.response?.status || error.status || 500;
12674
+ throw { message, status };
12675
+ }
12676
+ }
12677
+ async function getDataboxFolderDatasets({
12678
+ folderId
12679
+ }) {
12680
+ try {
12681
+ const id = folderId?.trim();
12682
+ if (!id) {
12683
+ throw { message: "Folder ID is required", status: 400 };
12684
+ }
12685
+ const response = await apiClient.get(
12686
+ `/databox/folders/${encodeURIComponent(id)}/datasets`
12687
+ );
12688
+ if (!response.data) {
12689
+ throw { message: "Failed to fetch databox folder datasets", status: 500 };
12690
+ }
12691
+ return response.data;
12692
+ } catch (error) {
12693
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder datasets";
12694
+ const status = error.response?.status || error.status || 500;
12695
+ throw { message, status };
12696
+ }
12697
+ }
12698
+ async function getDataboxFolderDuplicates({
12699
+ folderId
12700
+ }) {
12701
+ try {
12702
+ const id = folderId?.trim();
12703
+ if (!id) {
12704
+ throw { message: "Folder ID is required", status: 400 };
12705
+ }
12706
+ const response = await apiClient.get(
12707
+ `/databox/folders/${encodeURIComponent(id)}/duplicates`
12708
+ );
12709
+ if (!response.data) {
12710
+ throw {
12711
+ message: "Failed to fetch databox folder duplicates",
12712
+ status: 500
12713
+ };
12714
+ }
12715
+ return response.data;
12716
+ } catch (error) {
12717
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder duplicates";
12718
+ const status = error.response?.status || error.status || 500;
12719
+ throw { message, status };
12720
+ }
12721
+ }
12722
+ async function dropFileToDatabox({
12723
+ folderId,
12724
+ file,
12725
+ delimiter
12726
+ }) {
12727
+ try {
12728
+ const id = folderId?.trim();
12729
+ if (!id) {
12730
+ throw { message: "Folder ID is required", status: 400 };
12731
+ }
12732
+ if (!file || !file.name) {
12733
+ throw { message: "File is required", status: 400 };
12734
+ }
12735
+ const extension = file.name.split(".").pop()?.toLowerCase() ?? "";
12736
+ if (!DATABOX_SUPPORTED_EXTENSIONS.includes(extension)) {
12737
+ throw {
12738
+ message: `Unsupported file type ".${extension}". Supported types: ${DATABOX_SUPPORTED_EXTENSIONS.join(", ")}`,
12739
+ status: 400
12740
+ };
12741
+ }
12742
+ const formData = new FormData();
12743
+ formData.append("file", file);
12744
+ if (delimiter?.trim()) {
12745
+ formData.append("delimiter", delimiter.trim());
12746
+ }
12747
+ const response = await apiClient.post(
12748
+ `/databox/folders/${encodeURIComponent(id)}/files`,
12749
+ formData,
12750
+ { headers: { "Content-Type": "multipart/form-data" } }
12751
+ );
12752
+ if (!response.data) {
12753
+ throw { message: "Failed to drop file to databox", status: 500 };
12754
+ }
12755
+ return response.data;
12756
+ } catch (error) {
12757
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while dropping file to databox";
12758
+ const status = error.response?.status || error.status || 500;
12759
+ throw { message, status };
12760
+ }
12761
+ }
12762
+ async function runDataboxFolder({
12763
+ folderId,
12764
+ force
12765
+ }) {
12766
+ try {
12767
+ const id = folderId?.trim();
12768
+ if (!id) {
12769
+ throw { message: "Folder ID is required", status: 400 };
12770
+ }
12771
+ await apiClient.post(
12772
+ `/databox/folders/${encodeURIComponent(id)}/run`,
12773
+ void 0,
12774
+ { params: force ? { force: "true" } : void 0 }
12775
+ );
12776
+ } catch (error) {
12777
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while running databox folder";
12778
+ const status = error.response?.status || error.status || 500;
12779
+ throw { message, status };
12780
+ }
12781
+ }
12782
+ async function getDataboxFolderSchema({
12783
+ folderId
12784
+ }) {
12785
+ try {
12786
+ const id = folderId?.trim();
12787
+ if (!id) {
12788
+ throw { message: "Folder ID is required", status: 400 };
12789
+ }
12790
+ const response = await apiClient.get(
12791
+ `/databox/folders/${encodeURIComponent(id)}/schema`
12792
+ );
12793
+ if (!response.data) {
12794
+ throw { message: "Failed to fetch databox folder schema", status: 500 };
12795
+ }
12796
+ return response.data;
12797
+ } catch (error) {
12798
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox folder schema";
12799
+ const status = error.response?.status || error.status || 500;
12800
+ throw { message, status };
12801
+ }
12802
+ }
12803
+ async function updateDataboxFolderSchema({
12804
+ folderId,
12805
+ streams
12806
+ }) {
12807
+ try {
12808
+ const id = folderId?.trim();
12809
+ if (!id) {
12810
+ throw { message: "Folder ID is required", status: 400 };
12811
+ }
12812
+ if (!Array.isArray(streams) || streams.length === 0) {
12813
+ throw { message: "Schema streams are required", status: 400 };
12814
+ }
12815
+ const response = await apiClient.post(
12816
+ `/databox/folders/${encodeURIComponent(id)}/schema`,
12817
+ { folderId: id, catalog: { streams } }
12818
+ );
12819
+ return response.data;
12820
+ } catch (error) {
12821
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while updating databox folder schema";
12822
+ const status = error.response?.status || error.status || 500;
12823
+ throw { message, status };
12824
+ }
12825
+ }
12826
+ async function getDataboxSchemaHistory({
12827
+ folderId
12828
+ }) {
12829
+ try {
12830
+ const id = folderId?.trim();
12831
+ if (!id) {
12832
+ throw { message: "Folder ID is required", status: 400 };
12833
+ }
12834
+ const response = await apiClient.get(
12835
+ `/databox/folders/${encodeURIComponent(id)}/schema/history`
12836
+ );
12837
+ if (!response.data) {
12838
+ throw { message: "Failed to fetch databox schema history", status: 500 };
12839
+ }
12840
+ return response.data;
12841
+ } catch (error) {
12842
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox schema history";
12843
+ const status = error.response?.status || error.status || 500;
12844
+ throw { message, status };
12845
+ }
12846
+ }
12847
+ async function getDataboxTrashFiles({
12848
+ folderId
12849
+ }) {
12850
+ try {
12851
+ const id = folderId?.trim();
12852
+ if (!id) {
12853
+ throw { message: "Folder ID is required", status: 400 };
12854
+ }
12855
+ const response = await apiClient.get(
12856
+ `/databox/folders/${encodeURIComponent(id)}/trash`
12857
+ );
12858
+ if (!response.data) {
12859
+ throw { message: "Failed to fetch databox trash files", status: 500 };
12860
+ }
12861
+ return response.data;
12862
+ } catch (error) {
12863
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox trash files";
12864
+ const status = error.response?.status || error.status || 500;
12865
+ throw { message, status };
12866
+ }
12867
+ }
12868
+ async function getDataboxFile({
12869
+ fileId
12870
+ }) {
12871
+ try {
12872
+ const id = fileId?.trim();
12873
+ if (!id) {
12874
+ throw { message: "File ID is required", status: 400 };
12875
+ }
12876
+ const response = await apiClient.get(
12877
+ `/databox/files/${encodeURIComponent(id)}`
12878
+ );
12879
+ if (!response.data) {
12880
+ throw { message: "Failed to fetch databox file", status: 500 };
12881
+ }
12882
+ return response.data;
12883
+ } catch (error) {
12884
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file";
12885
+ const status = error.response?.status || error.status || 500;
12886
+ throw { message, status };
12887
+ }
12888
+ }
12889
+ async function getDataboxFileStatus({
12890
+ fileId
12891
+ }) {
12892
+ try {
12893
+ const id = fileId?.trim();
12894
+ if (!id) {
12895
+ throw { message: "File ID is required", status: 400 };
12896
+ }
12897
+ const response = await apiClient.get(
12898
+ `/databox/files/${encodeURIComponent(id)}/status`
12899
+ );
12900
+ if (!response.data) {
12901
+ throw { message: "Failed to fetch databox file status", status: 500 };
12902
+ }
12903
+ return response.data;
12904
+ } catch (error) {
12905
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file status";
12906
+ const status = error.response?.status || error.status || 500;
12907
+ throw { message, status };
12908
+ }
12909
+ }
12910
+ async function getDataboxFileRuns({
12911
+ fileId
12912
+ }) {
12913
+ try {
12914
+ const id = fileId?.trim();
12915
+ if (!id) {
12916
+ throw { message: "File ID is required", status: 400 };
12917
+ }
12918
+ const response = await apiClient.get(
12919
+ `/databox/files/${encodeURIComponent(id)}/runs`
12920
+ );
12921
+ if (!response.data) {
12922
+ throw { message: "Failed to fetch databox file runs", status: 500 };
12923
+ }
12924
+ return response.data;
12925
+ } catch (error) {
12926
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file runs";
12927
+ const status = error.response?.status || error.status || 500;
12928
+ throw { message, status };
12929
+ }
12930
+ }
12931
+ async function getDataboxFileDownloadUrl({
12932
+ fileId
12933
+ }) {
12934
+ try {
12935
+ const id = fileId?.trim();
12936
+ if (!id) {
12937
+ throw { message: "File ID is required", status: 400 };
12938
+ }
12939
+ const response = await apiClient.get(
12940
+ `/databox/files/${encodeURIComponent(id)}/download`
12941
+ );
12942
+ if (!response.data?.url) {
12943
+ throw {
12944
+ message: "Failed to fetch databox file download URL",
12945
+ status: 500
12946
+ };
12947
+ }
12948
+ return response.data;
12949
+ } catch (error) {
12950
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while fetching databox file download URL";
12951
+ const status = error.response?.status || error.status || 500;
12952
+ throw { message, status };
12953
+ }
12954
+ }
12955
+ async function trashDataboxFiles({
12956
+ fileIds
12957
+ }) {
12958
+ try {
12959
+ if (!Array.isArray(fileIds) || fileIds.length === 0) {
12960
+ throw { message: "File IDs are required", status: 400 };
12961
+ }
12962
+ const response = await apiClient.delete("/databox/files", {
12963
+ data: fileIds
12964
+ });
12965
+ return response.data;
12966
+ } catch (error) {
12967
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while trashing databox files";
12968
+ const status = error.response?.status || error.status || 500;
12969
+ throw { message, status };
12970
+ }
12971
+ }
12972
+ async function restoreDataboxFile({
12973
+ fileId
12974
+ }) {
12975
+ try {
12976
+ const id = fileId?.trim();
12977
+ if (!id) {
12978
+ throw { message: "File ID is required", status: 400 };
12979
+ }
12980
+ const response = await apiClient.post(
12981
+ `/databox/files/${encodeURIComponent(id)}/restore`
12982
+ );
12983
+ return response.data;
12984
+ } catch (error) {
12985
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while restoring databox file";
12986
+ const status = error.response?.status || error.status || 500;
12987
+ throw { message, status };
12988
+ }
12989
+ }
12990
+ async function permanentDeleteDataboxFiles({
12991
+ fileIds
12992
+ }) {
12993
+ try {
12994
+ if (!Array.isArray(fileIds) || fileIds.length === 0) {
12995
+ throw { message: "File IDs are required", status: 400 };
12996
+ }
12997
+ const response = await apiClient.delete("/databox/files/permanent", {
12998
+ data: fileIds
12999
+ });
13000
+ return response.data;
13001
+ } catch (error) {
13002
+ const message = error.response?.data?.message || error.message || "An unexpected error occurred while permanently deleting databox files";
13003
+ const status = error.response?.status || error.status || 500;
13004
+ throw { message, status };
13005
+ }
13006
+ }
13007
+ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13008
+ __proto__: null,
13009
+ DATABOX_SUPPORTED_EXTENSIONS,
13010
+ dropFileToDatabox,
13011
+ getDataboxFile,
13012
+ getDataboxFileDownloadUrl,
13013
+ getDataboxFileRuns,
13014
+ getDataboxFileStatus,
13015
+ getDataboxFolder,
13016
+ getDataboxFolderDatasets,
13017
+ getDataboxFolderDuplicates,
13018
+ getDataboxFolderFiles,
13019
+ getDataboxFolderSchema,
13020
+ getDataboxSchemaHistory,
13021
+ getDataboxTrashFiles,
13022
+ permanentDeleteDataboxFiles,
13023
+ restoreDataboxFile,
13024
+ runDataboxFolder,
13025
+ trashDataboxFiles,
13026
+ updateDataboxFolderSchema
13027
+ }, Symbol.toStringTag, { value: "Module" }));
12590
13028
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12591
13029
  __proto__: null,
12592
13030
  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
13031
+ audit: index$a,
13032
+ chat: index$j,
13033
+ clientIp: index$5,
13034
+ databox: index$1,
13035
+ dataset: index$i,
13036
+ definition: index$n,
13037
+ emailEngine: index$4,
13038
+ files: index$o,
13039
+ form: index$b,
13040
+ inboxItems: index$7,
13041
+ inputTable: index$h,
13042
+ metric: index$k,
13043
+ permissions: index$6,
13044
+ process: index$8,
13045
+ recon: index$d,
13046
+ reconV2: index$c,
13047
+ statement: index$f,
13048
+ task: index$e,
13049
+ tcn: index$3,
13050
+ templatedPipeline: index$9,
13051
+ templates: index$2,
13052
+ user: index$q,
13053
+ workbook: index$g,
13054
+ workflow: index$p,
13055
+ worksheet: index$m
12617
13056
  }, Symbol.toStringTag, { value: "Module" }));
12618
13057
  var InputTableColumnType = /* @__PURE__ */ ((InputTableColumnType2) => {
12619
13058
  InputTableColumnType2["UUID"] = "uuid";
@@ -14672,6 +15111,7 @@ const bluecopaTailwindConfig = {
14672
15111
  }
14673
15112
  };
14674
15113
  export {
15114
+ DATABOX_SUPPORTED_EXTENSIONS,
14675
15115
  InputTableColumnType,
14676
15116
  InputTableError,
14677
15117
  index as copaApi,
@@ -14679,6 +15119,6 @@ export {
14679
15119
  copaInputTableDb,
14680
15120
  setConfig as copaSetConfig,
14681
15121
  bluecopaTailwindConfig as copaTailwindConfig,
14682
- index$k as copaUtils
15122
+ index$l as copaUtils
14683
15123
  };
14684
15124
  //# sourceMappingURL=index.es.js.map