@bluecopa/core 0.1.16 → 0.1.18
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/api/audit/createAuditLog.d.ts +27 -0
- package/dist/api/audit/getAuditLogs.d.ts +32 -0
- package/dist/api/audit/index.d.ts +2 -0
- package/dist/api/file/fileDownload.d.ts +11 -0
- package/dist/api/file/fileUpload.d.ts +22 -0
- package/dist/api/file/index.d.ts +2 -0
- package/dist/api/form/createOrUpdateForm.d.ts +15 -0
- package/dist/api/form/getFormById.d.ts +14 -0
- package/dist/api/form/getFormData.d.ts +11 -0
- package/dist/api/form/getFormSchema.d.ts +13 -0
- package/dist/api/form/index.d.ts +4 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/process/index.d.ts +2 -0
- package/dist/api/process/markTaskDone.d.ts +22 -0
- package/dist/api/process/reassignTask.d.ts +19 -0
- package/dist/api/recon/getAllReconWorkflows.d.ts +9 -0
- package/dist/api/recon/index.d.ts +2 -0
- package/dist/api/recon/runRecon.d.ts +20 -0
- package/dist/api/task/getTaskDetails.d.ts +12 -0
- package/dist/api/task/index.d.ts +1 -0
- package/dist/api/templatedPipeline/getAllTemplatedPipelines.d.ts +12 -0
- package/dist/api/templatedPipeline/index.d.ts +1 -0
- package/dist/api/workbook/getWorkbookDetails.d.ts +12 -0
- package/dist/api/workbook/index.d.ts +3 -0
- package/dist/api/workbook/publishWorkbook.d.ts +12 -0
- package/dist/api/workbook/saveWorkbook.d.ts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.es.js +440 -26
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -42,7 +42,8 @@ function getConfig() {
|
|
|
42
42
|
}
|
|
43
43
|
const createApiClient = () => {
|
|
44
44
|
const client = axios.create({
|
|
45
|
-
timeout:
|
|
45
|
+
timeout: 12e4,
|
|
46
|
+
// Increased to 120 seconds for audit log queries
|
|
46
47
|
headers: {
|
|
47
48
|
"Content-Type": "application/json"
|
|
48
49
|
}
|
|
@@ -99,7 +100,7 @@ async function getLoggedInUserDetails() {
|
|
|
99
100
|
throw { message, status };
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
const index$
|
|
103
|
+
const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
103
104
|
__proto__: null,
|
|
104
105
|
getLoggedInUserDetails
|
|
105
106
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -158,7 +159,7 @@ const getWorkflowInstanceStatusById = async (request) => {
|
|
|
158
159
|
throw { message, status };
|
|
159
160
|
}
|
|
160
161
|
};
|
|
161
|
-
const index$
|
|
162
|
+
const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
162
163
|
__proto__: null,
|
|
163
164
|
WorkflowStatus,
|
|
164
165
|
getWorkflowInstanceStatusById,
|
|
@@ -183,8 +184,60 @@ async function getFileUrlByFileId({
|
|
|
183
184
|
throw { message, status };
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
|
-
|
|
187
|
+
async function fileUpload({
|
|
188
|
+
path,
|
|
189
|
+
contentType,
|
|
190
|
+
method,
|
|
191
|
+
data,
|
|
192
|
+
uploadType
|
|
193
|
+
}) {
|
|
194
|
+
var _a, _b, _c;
|
|
195
|
+
try {
|
|
196
|
+
if (!data) {
|
|
197
|
+
throw { message: "Data is required", status: 400 };
|
|
198
|
+
}
|
|
199
|
+
const response = await apiClient.post("/api/v1/file/file-upload", {
|
|
200
|
+
path,
|
|
201
|
+
contentType,
|
|
202
|
+
method,
|
|
203
|
+
data,
|
|
204
|
+
uploadType
|
|
205
|
+
});
|
|
206
|
+
if (!response.data || !response.data.data) {
|
|
207
|
+
throw { message: "Failed to upload file", status: 500 };
|
|
208
|
+
}
|
|
209
|
+
return response.data.data;
|
|
210
|
+
} catch (error) {
|
|
211
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while uploading file";
|
|
212
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
213
|
+
throw { message, status };
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
async function fileDownload({
|
|
217
|
+
fileId
|
|
218
|
+
}) {
|
|
219
|
+
var _a, _b, _c;
|
|
220
|
+
try {
|
|
221
|
+
if (!fileId) {
|
|
222
|
+
throw { message: "File ID is required", status: 400 };
|
|
223
|
+
}
|
|
224
|
+
const response = await apiClient.get(
|
|
225
|
+
`/api/v1/file/file-download?fileId=${encodeURIComponent(fileId)}`
|
|
226
|
+
);
|
|
227
|
+
if (!response.data || !response.data.data) {
|
|
228
|
+
throw { message: "Failed to download file", status: 500 };
|
|
229
|
+
}
|
|
230
|
+
return response.data.data;
|
|
231
|
+
} catch (error) {
|
|
232
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while downloading file";
|
|
233
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
234
|
+
throw { message, status };
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
187
238
|
__proto__: null,
|
|
239
|
+
fileDownload,
|
|
240
|
+
fileUpload,
|
|
188
241
|
getFileUrlByFileId
|
|
189
242
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
190
243
|
const runPublishedDefinition = async (props) => {
|
|
@@ -255,7 +308,7 @@ const runDefinition = async (props) => {
|
|
|
255
308
|
};
|
|
256
309
|
}
|
|
257
310
|
};
|
|
258
|
-
const index$
|
|
311
|
+
const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
259
312
|
__proto__: null,
|
|
260
313
|
runDefinition,
|
|
261
314
|
runPublishedDefinition,
|
|
@@ -293,7 +346,7 @@ const getWorksheetsByType = async (type) => {
|
|
|
293
346
|
throw { message, status };
|
|
294
347
|
}
|
|
295
348
|
};
|
|
296
|
-
const index$
|
|
349
|
+
const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
297
350
|
__proto__: null,
|
|
298
351
|
getWorksheets,
|
|
299
352
|
getWorksheetsByType
|
|
@@ -5435,7 +5488,7 @@ const getUniqueDuplicateName = (name, collectionToCheckIn, suffix = "Copy", conc
|
|
|
5435
5488
|
}
|
|
5436
5489
|
return newName.trim();
|
|
5437
5490
|
};
|
|
5438
|
-
const index$
|
|
5491
|
+
const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5439
5492
|
__proto__: null,
|
|
5440
5493
|
formatDate,
|
|
5441
5494
|
generatePushID,
|
|
@@ -5600,7 +5653,7 @@ const getData$3 = async (metricSheetId, options) => {
|
|
|
5600
5653
|
resultData = _.flatten(resultData);
|
|
5601
5654
|
return { data: resultData };
|
|
5602
5655
|
};
|
|
5603
|
-
const index$
|
|
5656
|
+
const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5604
5657
|
__proto__: null,
|
|
5605
5658
|
getData: getData$3
|
|
5606
5659
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -5751,7 +5804,7 @@ async function checkSubscriptionStatus(userId, threadId) {
|
|
|
5751
5804
|
throw { message, status };
|
|
5752
5805
|
}
|
|
5753
5806
|
}
|
|
5754
|
-
const index$
|
|
5807
|
+
const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5755
5808
|
__proto__: null,
|
|
5756
5809
|
checkSubscriptionStatus,
|
|
5757
5810
|
createThread,
|
|
@@ -5955,7 +6008,7 @@ const getAllDatasets = async () => {
|
|
|
5955
6008
|
throw { message, status };
|
|
5956
6009
|
}
|
|
5957
6010
|
};
|
|
5958
|
-
const index$
|
|
6011
|
+
const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5959
6012
|
__proto__: null,
|
|
5960
6013
|
getAllDatasets,
|
|
5961
6014
|
getData: getData$2,
|
|
@@ -6142,7 +6195,7 @@ const getInputTables = async () => {
|
|
|
6142
6195
|
throw { message, status };
|
|
6143
6196
|
}
|
|
6144
6197
|
};
|
|
6145
|
-
const index$
|
|
6198
|
+
const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6146
6199
|
__proto__: null,
|
|
6147
6200
|
getData: getData$1,
|
|
6148
6201
|
getInputTables,
|
|
@@ -6164,10 +6217,79 @@ const getWorkbooksByType = async (type) => {
|
|
|
6164
6217
|
throw { message, status };
|
|
6165
6218
|
}
|
|
6166
6219
|
};
|
|
6167
|
-
|
|
6220
|
+
async function getWorkbookDetails({
|
|
6221
|
+
workbookId
|
|
6222
|
+
}) {
|
|
6223
|
+
var _a, _b, _c;
|
|
6224
|
+
try {
|
|
6225
|
+
if (!workbookId) {
|
|
6226
|
+
throw { message: "Workbook ID is required", status: 400 };
|
|
6227
|
+
}
|
|
6228
|
+
console.log("workbookId", workbookId);
|
|
6229
|
+
const response = await apiClient.get(
|
|
6230
|
+
`/api/v1/workbook/get-workbook-details?workbookId=${encodeURIComponent(workbookId)}`
|
|
6231
|
+
);
|
|
6232
|
+
if (!response.data) {
|
|
6233
|
+
throw { message: "Failed to fetch workbook details", status: 500 };
|
|
6234
|
+
}
|
|
6235
|
+
return response.data;
|
|
6236
|
+
} catch (error) {
|
|
6237
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching workbook details";
|
|
6238
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6239
|
+
throw { message, status };
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
async function saveWorkbook({
|
|
6243
|
+
workbook,
|
|
6244
|
+
sheetInputs = []
|
|
6245
|
+
}) {
|
|
6246
|
+
var _a, _b, _c;
|
|
6247
|
+
try {
|
|
6248
|
+
if (!workbook || !workbook.id) {
|
|
6249
|
+
throw { message: "Workbook with ID is required", status: 400 };
|
|
6250
|
+
}
|
|
6251
|
+
const response = await apiClient.put("/api/v1/workbook/save-workbook", {
|
|
6252
|
+
workbook,
|
|
6253
|
+
sheetInputs
|
|
6254
|
+
});
|
|
6255
|
+
if (!response.data) {
|
|
6256
|
+
throw { message: "Failed to save workbook", status: 500 };
|
|
6257
|
+
}
|
|
6258
|
+
return response.data;
|
|
6259
|
+
} catch (error) {
|
|
6260
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while saving workbook";
|
|
6261
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6262
|
+
throw { message, status };
|
|
6263
|
+
}
|
|
6264
|
+
}
|
|
6265
|
+
async function publishWorkbook({
|
|
6266
|
+
workbookId
|
|
6267
|
+
}) {
|
|
6268
|
+
var _a, _b, _c;
|
|
6269
|
+
try {
|
|
6270
|
+
if (!workbookId) {
|
|
6271
|
+
throw { message: "Workbook ID is required", status: 400 };
|
|
6272
|
+
}
|
|
6273
|
+
const response = await apiClient.post("/api/v1/workbook/publish-workbook", {
|
|
6274
|
+
workbookId
|
|
6275
|
+
});
|
|
6276
|
+
if (!response.data) {
|
|
6277
|
+
throw { message: "Failed to publish workbook", status: 500 };
|
|
6278
|
+
}
|
|
6279
|
+
return response.data;
|
|
6280
|
+
} catch (error) {
|
|
6281
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while publishing workbook";
|
|
6282
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6283
|
+
throw { message, status };
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6168
6287
|
__proto__: null,
|
|
6169
6288
|
getPublishedWorkbookById,
|
|
6170
|
-
|
|
6289
|
+
getWorkbookDetails,
|
|
6290
|
+
getWorkbooksByType,
|
|
6291
|
+
publishWorkbook,
|
|
6292
|
+
saveWorkbook
|
|
6171
6293
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6172
6294
|
const getViewsBySheetId = async (sheetId) => {
|
|
6173
6295
|
var _a, _b, _c;
|
|
@@ -6429,7 +6551,7 @@ const getRunResultById = async (runId) => {
|
|
|
6429
6551
|
throw { message, status };
|
|
6430
6552
|
}
|
|
6431
6553
|
};
|
|
6432
|
-
const index$
|
|
6554
|
+
const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6433
6555
|
__proto__: null,
|
|
6434
6556
|
createNewRun,
|
|
6435
6557
|
getData,
|
|
@@ -6438,20 +6560,312 @@ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
6438
6560
|
getViewById,
|
|
6439
6561
|
getViewsBySheetId
|
|
6440
6562
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6563
|
+
async function getTaskDetails({
|
|
6564
|
+
taskId
|
|
6565
|
+
}) {
|
|
6566
|
+
var _a, _b, _c;
|
|
6567
|
+
try {
|
|
6568
|
+
if (!taskId) {
|
|
6569
|
+
throw { message: "Task ID is required", status: 400 };
|
|
6570
|
+
}
|
|
6571
|
+
const response = await apiClient.get(
|
|
6572
|
+
`/api/v1/task/get-task-details?taskId=${encodeURIComponent(taskId)}`
|
|
6573
|
+
);
|
|
6574
|
+
if (!response.data) {
|
|
6575
|
+
throw { message: "Failed to fetch task details", status: 500 };
|
|
6576
|
+
}
|
|
6577
|
+
return response.data;
|
|
6578
|
+
} catch (error) {
|
|
6579
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching task details";
|
|
6580
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6581
|
+
throw { message, status };
|
|
6582
|
+
}
|
|
6583
|
+
}
|
|
6584
|
+
const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6585
|
+
__proto__: null,
|
|
6586
|
+
getTaskDetails
|
|
6587
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
6588
|
+
async function runRecon({
|
|
6589
|
+
workflowId,
|
|
6590
|
+
runId,
|
|
6591
|
+
fullRefresh = false
|
|
6592
|
+
}) {
|
|
6593
|
+
var _a, _b, _c;
|
|
6594
|
+
try {
|
|
6595
|
+
if (!workflowId) {
|
|
6596
|
+
throw { message: "Workflow ID is required", status: 400 };
|
|
6597
|
+
}
|
|
6598
|
+
const response = await apiClient.post("/api/v1/recon/run-recon", {
|
|
6599
|
+
workflowId,
|
|
6600
|
+
runId,
|
|
6601
|
+
fullRefresh
|
|
6602
|
+
});
|
|
6603
|
+
if (!response.data) {
|
|
6604
|
+
throw { message: "Failed to run recon workflow", status: 500 };
|
|
6605
|
+
}
|
|
6606
|
+
return {
|
|
6607
|
+
success: true,
|
|
6608
|
+
data: response.data
|
|
6609
|
+
};
|
|
6610
|
+
} catch (error) {
|
|
6611
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while running recon workflow";
|
|
6612
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6613
|
+
throw { message, status };
|
|
6614
|
+
}
|
|
6615
|
+
}
|
|
6616
|
+
async function getAllReconWorkflows() {
|
|
6617
|
+
var _a, _b, _c;
|
|
6618
|
+
try {
|
|
6619
|
+
const response = await apiClient.get("/api/v1/recon/get-all");
|
|
6620
|
+
if (!response.data || !response.data.data) {
|
|
6621
|
+
throw { message: "Failed to fetch recon workflows", status: 500 };
|
|
6622
|
+
}
|
|
6623
|
+
return response.data.data;
|
|
6624
|
+
} catch (error) {
|
|
6625
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching recon workflows";
|
|
6626
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6627
|
+
throw { message, status };
|
|
6628
|
+
}
|
|
6629
|
+
}
|
|
6630
|
+
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6631
|
+
__proto__: null,
|
|
6632
|
+
getAllReconWorkflows,
|
|
6633
|
+
runRecon
|
|
6634
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
6635
|
+
async function getFormSchema({
|
|
6636
|
+
formInstanceId,
|
|
6637
|
+
formRevision
|
|
6638
|
+
}) {
|
|
6639
|
+
var _a, _b, _c;
|
|
6640
|
+
try {
|
|
6641
|
+
if (!formInstanceId || !formRevision) {
|
|
6642
|
+
throw { message: "Form instance ID and revision are required", status: 400 };
|
|
6643
|
+
}
|
|
6644
|
+
const response = await apiClient.get(
|
|
6645
|
+
`/api/v1/form/get-form-schema?formInstanceId=${encodeURIComponent(formInstanceId)}&formRevision=${encodeURIComponent(formRevision)}`
|
|
6646
|
+
);
|
|
6647
|
+
if (!response.data) {
|
|
6648
|
+
throw { message: "Failed to fetch form schema", status: 500 };
|
|
6649
|
+
}
|
|
6650
|
+
return response.data;
|
|
6651
|
+
} catch (error) {
|
|
6652
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching form schema";
|
|
6653
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6654
|
+
throw { message, status };
|
|
6655
|
+
}
|
|
6656
|
+
}
|
|
6657
|
+
async function getFormData({
|
|
6658
|
+
formId
|
|
6659
|
+
}) {
|
|
6660
|
+
var _a, _b, _c;
|
|
6661
|
+
try {
|
|
6662
|
+
if (!formId) {
|
|
6663
|
+
throw { message: "Form ID is required", status: 400 };
|
|
6664
|
+
}
|
|
6665
|
+
const response = await apiClient.get(
|
|
6666
|
+
`/api/v1/form/get-form-data?formId=${encodeURIComponent(formId)}`
|
|
6667
|
+
);
|
|
6668
|
+
if (!response.data) {
|
|
6669
|
+
throw { message: "Failed to fetch form data", status: 500 };
|
|
6670
|
+
}
|
|
6671
|
+
return response.data;
|
|
6672
|
+
} catch (error) {
|
|
6673
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching form data";
|
|
6674
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6675
|
+
throw { message, status };
|
|
6676
|
+
}
|
|
6677
|
+
}
|
|
6678
|
+
async function getFormById({
|
|
6679
|
+
formId
|
|
6680
|
+
}) {
|
|
6681
|
+
var _a, _b, _c;
|
|
6682
|
+
try {
|
|
6683
|
+
if (!formId) {
|
|
6684
|
+
throw { message: "Form ID is required", status: 400 };
|
|
6685
|
+
}
|
|
6686
|
+
const response = await apiClient.get(
|
|
6687
|
+
`/api/v1/form/get-form-by-id?formId=${encodeURIComponent(formId)}`
|
|
6688
|
+
);
|
|
6689
|
+
if (!response.data || !response.data.data) {
|
|
6690
|
+
throw { message: "Failed to fetch form", status: 500 };
|
|
6691
|
+
}
|
|
6692
|
+
return response.data.data;
|
|
6693
|
+
} catch (error) {
|
|
6694
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching form";
|
|
6695
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6696
|
+
throw { message, status };
|
|
6697
|
+
}
|
|
6698
|
+
}
|
|
6699
|
+
async function createOrUpdateForm({
|
|
6700
|
+
data
|
|
6701
|
+
}) {
|
|
6702
|
+
var _a, _b, _c;
|
|
6703
|
+
try {
|
|
6704
|
+
if (!data) {
|
|
6705
|
+
throw { message: "Form data is required", status: 400 };
|
|
6706
|
+
}
|
|
6707
|
+
const response = await apiClient.post("/api/v1/form/create-or-update-form", {
|
|
6708
|
+
data
|
|
6709
|
+
});
|
|
6710
|
+
if (!response.data || !response.data.data) {
|
|
6711
|
+
throw { message: "Failed to create or update form", status: 500 };
|
|
6712
|
+
}
|
|
6713
|
+
return response.data.data;
|
|
6714
|
+
} catch (error) {
|
|
6715
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while creating or updating form";
|
|
6716
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6717
|
+
throw { message, status };
|
|
6718
|
+
}
|
|
6719
|
+
}
|
|
6720
|
+
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6721
|
+
__proto__: null,
|
|
6722
|
+
createOrUpdateForm,
|
|
6723
|
+
getFormById,
|
|
6724
|
+
getFormData,
|
|
6725
|
+
getFormSchema
|
|
6726
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
6727
|
+
async function getAuditLogs(params) {
|
|
6728
|
+
var _a, _b, _c;
|
|
6729
|
+
try {
|
|
6730
|
+
if (!params.limit) {
|
|
6731
|
+
throw { message: "Limit is required", status: 400 };
|
|
6732
|
+
}
|
|
6733
|
+
const response = await apiClient.post(
|
|
6734
|
+
"/api/v1/audit/get-audit-logs",
|
|
6735
|
+
params
|
|
6736
|
+
);
|
|
6737
|
+
if (!response.data) {
|
|
6738
|
+
throw { message: "Failed to fetch audit logs", status: 500 };
|
|
6739
|
+
}
|
|
6740
|
+
return response.data.data;
|
|
6741
|
+
} catch (error) {
|
|
6742
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching audit logs";
|
|
6743
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6744
|
+
throw { message, status };
|
|
6745
|
+
}
|
|
6746
|
+
}
|
|
6747
|
+
async function createAuditLog(params) {
|
|
6748
|
+
var _a, _b, _c;
|
|
6749
|
+
try {
|
|
6750
|
+
if (!params.auditRecords || !Array.isArray(params.auditRecords) || params.auditRecords.length === 0) {
|
|
6751
|
+
throw { message: "Audit records array is required", status: 400 };
|
|
6752
|
+
}
|
|
6753
|
+
const response = await apiClient.post(
|
|
6754
|
+
"/api/v1/audit/create-audit-log",
|
|
6755
|
+
params.auditRecords
|
|
6756
|
+
);
|
|
6757
|
+
return { success: response.data.success || true };
|
|
6758
|
+
} catch (error) {
|
|
6759
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while creating audit log";
|
|
6760
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6761
|
+
throw { message, status };
|
|
6762
|
+
}
|
|
6763
|
+
}
|
|
6764
|
+
const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6765
|
+
__proto__: null,
|
|
6766
|
+
createAuditLog,
|
|
6767
|
+
getAuditLogs
|
|
6768
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
6769
|
+
async function getAllTemplatedPipelines() {
|
|
6770
|
+
var _a, _b, _c;
|
|
6771
|
+
try {
|
|
6772
|
+
const response = await apiClient.get("/api/v1/templated-pipeline/get-all");
|
|
6773
|
+
if (!response.data || !response.data.data) {
|
|
6774
|
+
throw { message: "Failed to fetch templated pipelines", status: 500 };
|
|
6775
|
+
}
|
|
6776
|
+
return response.data.data;
|
|
6777
|
+
} catch (error) {
|
|
6778
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching templated pipelines";
|
|
6779
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6780
|
+
throw { message, status };
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6784
|
+
__proto__: null,
|
|
6785
|
+
getAllTemplatedPipelines
|
|
6786
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
6787
|
+
async function markTaskDone({
|
|
6788
|
+
taskId,
|
|
6789
|
+
data
|
|
6790
|
+
}) {
|
|
6791
|
+
var _a, _b, _c;
|
|
6792
|
+
try {
|
|
6793
|
+
if (!taskId) {
|
|
6794
|
+
throw { message: "Task ID is required", status: 400 };
|
|
6795
|
+
}
|
|
6796
|
+
if (!data) {
|
|
6797
|
+
throw { message: "Task completion data is required", status: 400 };
|
|
6798
|
+
}
|
|
6799
|
+
const response = await apiClient.post("/api/v1/process/mark-task-done", {
|
|
6800
|
+
taskId,
|
|
6801
|
+
data
|
|
6802
|
+
});
|
|
6803
|
+
if (!response.data || !response.data.data) {
|
|
6804
|
+
throw { message: "Failed to mark task as done", status: 500 };
|
|
6805
|
+
}
|
|
6806
|
+
return response.data.data;
|
|
6807
|
+
} catch (error) {
|
|
6808
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while marking task as done";
|
|
6809
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6810
|
+
throw { message, status };
|
|
6811
|
+
}
|
|
6812
|
+
}
|
|
6813
|
+
async function reassignTask({
|
|
6814
|
+
taskId,
|
|
6815
|
+
newAssignee,
|
|
6816
|
+
assigneeType
|
|
6817
|
+
}) {
|
|
6818
|
+
var _a, _b, _c;
|
|
6819
|
+
try {
|
|
6820
|
+
if (!taskId) {
|
|
6821
|
+
throw { message: "Task ID is required", status: 400 };
|
|
6822
|
+
}
|
|
6823
|
+
if (!newAssignee) {
|
|
6824
|
+
throw { message: "New assignee is required", status: 400 };
|
|
6825
|
+
}
|
|
6826
|
+
if (!assigneeType || !["USER", "TEAM"].includes(assigneeType)) {
|
|
6827
|
+
throw { message: "Assignee type must be USER or TEAM", status: 400 };
|
|
6828
|
+
}
|
|
6829
|
+
const response = await apiClient.post("/api/v1/process/reassign-task", {
|
|
6830
|
+
taskId,
|
|
6831
|
+
newAssignee,
|
|
6832
|
+
assigneeType
|
|
6833
|
+
});
|
|
6834
|
+
if (!response.data || !response.data.data) {
|
|
6835
|
+
throw { message: "Failed to reassign task", status: 500 };
|
|
6836
|
+
}
|
|
6837
|
+
return response.data.data;
|
|
6838
|
+
} catch (error) {
|
|
6839
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while reassigning task";
|
|
6840
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6841
|
+
throw { message, status };
|
|
6842
|
+
}
|
|
6843
|
+
}
|
|
6844
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6845
|
+
__proto__: null,
|
|
6846
|
+
markTaskDone,
|
|
6847
|
+
reassignTask
|
|
6848
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
6441
6849
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6442
6850
|
__proto__: null,
|
|
6443
6851
|
apiClient,
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6852
|
+
audit: index$3,
|
|
6853
|
+
chat: index$b,
|
|
6854
|
+
dataset: index$a,
|
|
6855
|
+
definition: index$f,
|
|
6856
|
+
files: index$g,
|
|
6857
|
+
form: index$4,
|
|
6858
|
+
inputTable: index$9,
|
|
6859
|
+
metric: index$c,
|
|
6860
|
+
process: index$1,
|
|
6861
|
+
recon: index$5,
|
|
6862
|
+
statement: index$7,
|
|
6863
|
+
task: index$6,
|
|
6864
|
+
templatedPipeline: index$2,
|
|
6865
|
+
user: index$i,
|
|
6866
|
+
workbook: index$8,
|
|
6867
|
+
workflow: index$h,
|
|
6868
|
+
worksheet: index$e
|
|
6455
6869
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6456
6870
|
const bluecopaTailwindConfig = {
|
|
6457
6871
|
darkMode: "class",
|
|
@@ -6615,6 +7029,6 @@ export {
|
|
|
6615
7029
|
getConfig as copaGetConfig,
|
|
6616
7030
|
setConfig as copaSetConfig,
|
|
6617
7031
|
bluecopaTailwindConfig as copaTailwindConfig,
|
|
6618
|
-
index$
|
|
7032
|
+
index$d as copaUtils
|
|
6619
7033
|
};
|
|
6620
7034
|
//# sourceMappingURL=index.es.js.map
|