@bluecopa/core 0.1.33 → 0.1.35
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/README.md +57 -46
- package/dist/api/audit/getAuditLogs.d.ts +1 -1
- package/dist/api/chat/index.d.ts +7 -7
- package/dist/api/clientIp/getClientIp.d.ts +9 -0
- package/dist/api/clientIp/index.d.ts +1 -0
- package/dist/api/emailEngine/createConversation.d.ts +29 -0
- package/dist/api/emailEngine/getAllConversations.d.ts +23 -0
- package/dist/api/emailEngine/getConversation.d.ts +12 -0
- package/dist/api/emailEngine/index.d.ts +4 -0
- package/dist/api/emailEngine/replyToConversation.d.ts +26 -0
- package/dist/api/file/getFileUrlByFileId.d.ts +1 -1
- package/dist/api/index.d.ts +3 -0
- package/dist/api/permissions/getPermissions.d.ts +21 -0
- package/dist/api/permissions/index.d.ts +1 -0
- package/dist/api/user/index.d.ts +1 -1
- package/dist/index.d.ts +16 -10
- package/dist/index.es.js +389 -124
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.d.ts +7 -0
- package/dist/types/statement.d.ts +1 -0
- package/dist/utils/inputTable/inputTableDefinition.d.ts +2 -2
- package/dist/utils/metric/analysisMethods.d.ts +3 -2
- package/dist/utils/metric/filterUtils.d.ts +1 -1
- package/dist/utils/websockets/pusherWebsocket.d.ts +1 -1
- package/package.json +4 -3
package/dist/index.es.js
CHANGED
|
@@ -114,7 +114,7 @@ async function getAllUsers() {
|
|
|
114
114
|
throw { message, status };
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
const index$
|
|
117
|
+
const index$m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
118
118
|
__proto__: null,
|
|
119
119
|
getAllUsers,
|
|
120
120
|
getLoggedInUserDetails
|
|
@@ -142,7 +142,10 @@ async function triggerWorkflowById({
|
|
|
142
142
|
}) {
|
|
143
143
|
var _a, _b, _c;
|
|
144
144
|
try {
|
|
145
|
-
const response = await apiClient.post("/workflow/trigger", {
|
|
145
|
+
const response = await apiClient.post("/workflow/trigger", {
|
|
146
|
+
parentId,
|
|
147
|
+
triggerBy
|
|
148
|
+
});
|
|
146
149
|
if (!response.data) {
|
|
147
150
|
throw { message: "Failed to trigger workflow", status: 500 };
|
|
148
151
|
}
|
|
@@ -163,7 +166,10 @@ var WorkflowStatus = /* @__PURE__ */ ((WorkflowStatus2) => {
|
|
|
163
166
|
const getWorkflowInstanceStatusById = async (request) => {
|
|
164
167
|
var _a, _b, _c;
|
|
165
168
|
try {
|
|
166
|
-
const response = await apiClient.post(
|
|
169
|
+
const response = await apiClient.post(
|
|
170
|
+
"/workflow/instances/status",
|
|
171
|
+
request
|
|
172
|
+
);
|
|
167
173
|
if (!response.data) {
|
|
168
174
|
throw { message: "Failed to fetch workflow statuses", status: 500 };
|
|
169
175
|
}
|
|
@@ -188,7 +194,7 @@ async function getAllHttpTriggers() {
|
|
|
188
194
|
throw { message, status };
|
|
189
195
|
}
|
|
190
196
|
}
|
|
191
|
-
const index$
|
|
197
|
+
const index$l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
192
198
|
__proto__: null,
|
|
193
199
|
WorkflowStatus,
|
|
194
200
|
getAllHttpTriggers,
|
|
@@ -203,7 +209,11 @@ async function getFileUrlByFileId({
|
|
|
203
209
|
}) {
|
|
204
210
|
var _a, _b, _c;
|
|
205
211
|
try {
|
|
206
|
-
const response = await apiClient.post("/file/url", {
|
|
212
|
+
const response = await apiClient.post("/file/url", {
|
|
213
|
+
key,
|
|
214
|
+
contentType,
|
|
215
|
+
method
|
|
216
|
+
});
|
|
207
217
|
if (!response.data) {
|
|
208
218
|
throw { message: "Failed to get file URL", status: 500 };
|
|
209
219
|
}
|
|
@@ -290,7 +300,7 @@ async function fileDownload({
|
|
|
290
300
|
throw { message, status };
|
|
291
301
|
}
|
|
292
302
|
}
|
|
293
|
-
const index$
|
|
303
|
+
const index$k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
294
304
|
__proto__: null,
|
|
295
305
|
fileDownload,
|
|
296
306
|
fileUpload,
|
|
@@ -323,10 +333,12 @@ const runSampleDefinition = async (props) => {
|
|
|
323
333
|
if (!dataFilter) {
|
|
324
334
|
throw new Error(`Data filter is null`);
|
|
325
335
|
}
|
|
326
|
-
return apiClient.post(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
336
|
+
return apiClient.post("/definition/run-sample", {
|
|
337
|
+
datasetId,
|
|
338
|
+
dataFilter,
|
|
339
|
+
duplicateColGroups,
|
|
340
|
+
datasetType
|
|
341
|
+
});
|
|
330
342
|
};
|
|
331
343
|
const runDefinition = async (props) => {
|
|
332
344
|
var _a, _b, _c, _d;
|
|
@@ -364,7 +376,7 @@ const runDefinition = async (props) => {
|
|
|
364
376
|
};
|
|
365
377
|
}
|
|
366
378
|
};
|
|
367
|
-
const index$
|
|
379
|
+
const index$j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
368
380
|
__proto__: null,
|
|
369
381
|
runDefinition,
|
|
370
382
|
runPublishedDefinition,
|
|
@@ -402,7 +414,7 @@ const getWorksheetsByType = async (type) => {
|
|
|
402
414
|
throw { message, status };
|
|
403
415
|
}
|
|
404
416
|
};
|
|
405
|
-
const index$
|
|
417
|
+
const index$i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
406
418
|
__proto__: null,
|
|
407
419
|
getWorksheets,
|
|
408
420
|
getWorksheetsByType
|
|
@@ -447,7 +459,9 @@ const filterToSelectOptionType = (filter, columns) => {
|
|
|
447
459
|
const getSelectionOptionsFromFilter = (rule, columns) => {
|
|
448
460
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
449
461
|
if (_.isEmpty(rule == null ? void 0 : rule.rules)) {
|
|
450
|
-
const col2 = columns.find(
|
|
462
|
+
const col2 = columns.find(
|
|
463
|
+
(column) => column.label === rule.col || column.value === rule.col
|
|
464
|
+
);
|
|
451
465
|
return {
|
|
452
466
|
label: (col2 == null ? void 0 : col2.label) || "",
|
|
453
467
|
value: (col2 == null ? void 0 : col2.value) || "",
|
|
@@ -559,7 +573,10 @@ const getFilterRuleFromSelectionOptions = (rule, filterColumnsBy) => {
|
|
|
559
573
|
rules: [
|
|
560
574
|
{
|
|
561
575
|
col: rule.value,
|
|
562
|
-
value: _.map(
|
|
576
|
+
value: _.map(
|
|
577
|
+
((_c = rule == null ? void 0 : rule.option) == null ? void 0 : _c.uniqueValues) || [],
|
|
578
|
+
(r) => r.option.uniqueValue
|
|
579
|
+
),
|
|
563
580
|
operator: "in_op",
|
|
564
581
|
rule_type: "cond",
|
|
565
582
|
is_not: false,
|
|
@@ -582,17 +599,19 @@ const getFilterRuleFromSelectionOptions = (rule, filterColumnsBy) => {
|
|
|
582
599
|
}
|
|
583
600
|
return {
|
|
584
601
|
rule_type: (_m = rule == null ? void 0 : rule.option) == null ? void 0 : _m.ruleType,
|
|
585
|
-
rules: (((_n = rule == null ? void 0 : rule.option) == null ? void 0 : _n.uniqueValues) || []).map(
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
602
|
+
rules: (((_n = rule == null ? void 0 : rule.option) == null ? void 0 : _n.uniqueValues) || []).map(
|
|
603
|
+
(r) => {
|
|
604
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
605
|
+
return {
|
|
606
|
+
col: r.value,
|
|
607
|
+
value: (_a2 = r.option) == null ? void 0 : _a2.uniqueValue,
|
|
608
|
+
operator: (_b2 = r.option) == null ? void 0 : _b2.operator,
|
|
609
|
+
rule_type: ((_c2 = r.option) == null ? void 0 : _c2.ruleType) ?? "cond",
|
|
610
|
+
is_not: ((_d2 = r.option) == null ? void 0 : _d2.isNot) ?? false,
|
|
611
|
+
is_case_sensitive: ((_e2 = r.option) == null ? void 0 : _e2.caseSensitive) ?? true
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
),
|
|
596
615
|
is_not: false
|
|
597
616
|
};
|
|
598
617
|
};
|
|
@@ -600,7 +619,9 @@ const getColumnFilterRuleFromCombinedFilterRule = (combinedFilterRule, valueCols
|
|
|
600
619
|
const filterRules = (combinedFilterRule == null ? void 0 : combinedFilterRule.rules) ?? [];
|
|
601
620
|
const columnFilterRules = [];
|
|
602
621
|
_.forEach(filterRules, (rule) => {
|
|
603
|
-
const valueCol = valueCols == null ? void 0 : valueCols.find(
|
|
622
|
+
const valueCol = valueCols == null ? void 0 : valueCols.find(
|
|
623
|
+
(valueCol2) => (rule == null ? void 0 : rule.col) === (valueCol2 == null ? void 0 : valueCol2.label)
|
|
624
|
+
);
|
|
604
625
|
if (!valueCol) {
|
|
605
626
|
columnFilterRules.push(rule);
|
|
606
627
|
}
|
|
@@ -661,7 +682,10 @@ const findParentIsMetricSeries = (childId, variables) => {
|
|
|
661
682
|
if (((_a = parentTableVariable == null ? void 0 : parentTableVariable.transforms[0]) == null ? void 0 : _a.type) === "MetricSeries") {
|
|
662
683
|
return true;
|
|
663
684
|
} else if (parentTableVariable == null ? void 0 : parentTableVariable.transforms[0]) {
|
|
664
|
-
return findParentIsMetricSeries(
|
|
685
|
+
return findParentIsMetricSeries(
|
|
686
|
+
(_b = parentTableVariable == null ? void 0 : parentTableVariable.transforms[0]) == null ? void 0 : _b.table,
|
|
687
|
+
variables
|
|
688
|
+
);
|
|
665
689
|
}
|
|
666
690
|
return false;
|
|
667
691
|
};
|
|
@@ -690,7 +714,9 @@ const getDrilldownFiltersMap = (props) => {
|
|
|
690
714
|
if (ftba.operator) {
|
|
691
715
|
let uniqueValuesForNegationOperator, uniqueValuesForOperator;
|
|
692
716
|
if (ftba.operator.includes("not")) {
|
|
693
|
-
uniqueValuesForNegationOperator = getValuesForSpecialOperators(
|
|
717
|
+
uniqueValuesForNegationOperator = getValuesForSpecialOperators(
|
|
718
|
+
ftba.operator
|
|
719
|
+
);
|
|
694
720
|
uniqueValuesForOperator = [
|
|
695
721
|
{
|
|
696
722
|
label: col == null ? void 0 : col.label,
|
|
@@ -746,7 +772,11 @@ const getDrilldownFiltersMap = (props) => {
|
|
|
746
772
|
{
|
|
747
773
|
label: (col == null ? void 0 : col.label) || "",
|
|
748
774
|
value: col == null ? void 0 : col.value,
|
|
749
|
-
option: {
|
|
775
|
+
option: {
|
|
776
|
+
uniqueValue: ftba.key,
|
|
777
|
+
ruleType: "cond",
|
|
778
|
+
operator: "equal"
|
|
779
|
+
}
|
|
750
780
|
}
|
|
751
781
|
];
|
|
752
782
|
uniqueValues.push(...uniqueValuesForSelection);
|
|
@@ -773,7 +803,9 @@ const getDrilldownFiltersMap = (props) => {
|
|
|
773
803
|
const getFiltersToBeAppliedOnDrilldown = (props) => {
|
|
774
804
|
const { rowGroups, groupKeys } = props;
|
|
775
805
|
const filtersToBeApplied = [];
|
|
776
|
-
groupKeys == null ? void 0 : groupKeys.forEach(
|
|
806
|
+
groupKeys == null ? void 0 : groupKeys.forEach(
|
|
807
|
+
(key, index2) => filtersToBeApplied.push({ field: rowGroups[index2], key })
|
|
808
|
+
);
|
|
777
809
|
return filtersToBeApplied;
|
|
778
810
|
};
|
|
779
811
|
const getMetricFilterRule = (inputs) => {
|
|
@@ -813,28 +845,34 @@ const getUpdatedDefinitionCustomModel = (props) => {
|
|
|
813
845
|
removeSort
|
|
814
846
|
} = props;
|
|
815
847
|
const parentTableVariable = parentCustomModel.variable;
|
|
816
|
-
const metricNewColumns = _.filter(
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
848
|
+
const metricNewColumns = _.filter(
|
|
849
|
+
metricDefinitionModel.variables ?? [],
|
|
850
|
+
(v) => {
|
|
851
|
+
if (!v.transforms || !v.transforms[0]) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
if (removeSort) {
|
|
855
|
+
return findParentIsMetricSeries(
|
|
856
|
+
v.transforms[0].table,
|
|
857
|
+
metricDefinitionModel.variables ?? []
|
|
858
|
+
) && v.transforms[0].type !== "Sort";
|
|
859
|
+
}
|
|
821
860
|
return findParentIsMetricSeries(
|
|
822
861
|
v.transforms[0].table,
|
|
823
862
|
metricDefinitionModel.variables ?? []
|
|
824
|
-
)
|
|
863
|
+
);
|
|
825
864
|
}
|
|
826
|
-
|
|
827
|
-
v.transforms[0].table,
|
|
828
|
-
metricDefinitionModel.variables ?? []
|
|
829
|
-
);
|
|
830
|
-
});
|
|
865
|
+
);
|
|
831
866
|
const definitionVariables = metricDefinitionModel.variables ?? [];
|
|
832
867
|
const analysisVariable = _.find(
|
|
833
868
|
definitionVariables,
|
|
834
869
|
(v) => !!_.find(v.transforms, (t) => t.type === "MetricSeries")
|
|
835
870
|
);
|
|
836
871
|
metricDefinitionModel.imports = _.uniqBy(
|
|
837
|
-
[
|
|
872
|
+
[
|
|
873
|
+
...parentDefinitionModel.imports ?? [],
|
|
874
|
+
...metricDefinitionModel.imports ?? []
|
|
875
|
+
],
|
|
838
876
|
"to"
|
|
839
877
|
);
|
|
840
878
|
const parentDefinitionAliases = parentDefinitionModel.aliases ?? {};
|
|
@@ -847,7 +885,10 @@ const getUpdatedDefinitionCustomModel = (props) => {
|
|
|
847
885
|
if (!parentDefinitionAliases[tableId]) {
|
|
848
886
|
const metricTableAlias = metricDefinitionAliases[tableId];
|
|
849
887
|
for (const [columnName, columnId] of Object.entries(metricTableAlias)) {
|
|
850
|
-
const pColName = _.findKey(
|
|
888
|
+
const pColName = _.findKey(
|
|
889
|
+
parentTableVariableAlias,
|
|
890
|
+
(pColId) => pColId === columnId
|
|
891
|
+
);
|
|
851
892
|
if (pColName && pColName !== columnName) {
|
|
852
893
|
delete metricTableAlias[columnName];
|
|
853
894
|
metricTableAlias[pColName] = parentTableVariableAlias[pColName];
|
|
@@ -862,15 +903,22 @@ const getUpdatedDefinitionCustomModel = (props) => {
|
|
|
862
903
|
);
|
|
863
904
|
const previousVariables = metricDefinitionModel.variables;
|
|
864
905
|
metricDefinitionModel.variables = [...variables];
|
|
865
|
-
const variableNames = (_a = metricDefinitionModel.variables) == null ? void 0 : _a.map(
|
|
906
|
+
const variableNames = (_a = metricDefinitionModel.variables) == null ? void 0 : _a.map(
|
|
907
|
+
(v) => v == null ? void 0 : v.name
|
|
908
|
+
);
|
|
866
909
|
metricDefinitionModel.variables.push(
|
|
867
|
-
..._.filter(
|
|
910
|
+
..._.filter(
|
|
911
|
+
previousVariables,
|
|
912
|
+
(v) => variableNames == null ? void 0 : variableNames.includes(v.name)
|
|
913
|
+
)
|
|
868
914
|
);
|
|
869
915
|
const filterVariable = _.find(
|
|
870
916
|
definitionVariables,
|
|
871
917
|
(v) => {
|
|
872
918
|
var _a2;
|
|
873
|
-
return (_a2 = v.transforms) == null ? void 0 : _a2.some(
|
|
919
|
+
return (_a2 = v.transforms) == null ? void 0 : _a2.some(
|
|
920
|
+
(t) => t.type === "RuleFilter" && t.rule === "${rule_pivot}"
|
|
921
|
+
);
|
|
874
922
|
}
|
|
875
923
|
);
|
|
876
924
|
if (filterVariable && parentTableVariable) {
|
|
@@ -896,7 +944,10 @@ const getUpdatedDefinitionCustomModel = (props) => {
|
|
|
896
944
|
metricDefinitionModel.variables.push(analysisVariable);
|
|
897
945
|
metricCustomModel.variable = analysisVariable.name;
|
|
898
946
|
}
|
|
899
|
-
metricCustomModel.inputs = {
|
|
947
|
+
metricCustomModel.inputs = {
|
|
948
|
+
...parentCustomModel.inputs,
|
|
949
|
+
...metricCustomModel.inputs
|
|
950
|
+
};
|
|
900
951
|
if (!_.isEmpty(metricNewColumns)) {
|
|
901
952
|
metricDefinitionModel.variables.push(...metricNewColumns);
|
|
902
953
|
metricCustomModel.variable = metricNewColumns[metricNewColumns.length - 1].name;
|
|
@@ -922,7 +973,10 @@ const getUpdatedDefinitionCustomModel = (props) => {
|
|
|
922
973
|
if (parentTableVariable) {
|
|
923
974
|
metricCustomModel.parentTableVariable = parentTableVariable;
|
|
924
975
|
}
|
|
925
|
-
return {
|
|
976
|
+
return {
|
|
977
|
+
definitionModel: metricDefinitionModel,
|
|
978
|
+
customModel: metricCustomModel
|
|
979
|
+
};
|
|
926
980
|
};
|
|
927
981
|
class MergeFilterService {
|
|
928
982
|
getColumnSettingsForCommonFilters(cf) {
|
|
@@ -944,19 +998,28 @@ class MergeFilterService {
|
|
|
944
998
|
mergeCommonFilters(props) {
|
|
945
999
|
const { commonFilters, rule, id, condition } = props;
|
|
946
1000
|
let replacedFr = [];
|
|
947
|
-
if (_.isEmpty(commonFilters))
|
|
1001
|
+
if (_.isEmpty(commonFilters))
|
|
1002
|
+
return { defaultType: condition, rules: rule };
|
|
948
1003
|
_.forEach(commonFilters, (f) => {
|
|
949
1004
|
const columnSettingsSelectOption = this.getColumnSettingsForCommonFilters(f);
|
|
950
|
-
const appliedOnLine = _.find(
|
|
1005
|
+
const appliedOnLine = _.find(
|
|
1006
|
+
f == null ? void 0 : f.appliedOnBlocks,
|
|
1007
|
+
(l) => l.blockId === id
|
|
1008
|
+
);
|
|
951
1009
|
if (appliedOnLine && appliedOnLine.applied) {
|
|
952
1010
|
const commonRule = f.rule;
|
|
953
|
-
const fr = filterToSelectOptionType(
|
|
1011
|
+
const fr = filterToSelectOptionType(
|
|
1012
|
+
commonRule,
|
|
1013
|
+
columnSettingsSelectOption
|
|
1014
|
+
);
|
|
954
1015
|
const columnSetting = _.find(
|
|
955
1016
|
appliedOnLine.columnSettings,
|
|
956
1017
|
(c) => c.value === appliedOnLine.column
|
|
957
1018
|
);
|
|
958
1019
|
if (columnSetting) {
|
|
959
|
-
replacedFr.push(
|
|
1020
|
+
replacedFr.push(
|
|
1021
|
+
replaceFilterColumn({ fr: fr.rules, column: columnSetting })
|
|
1022
|
+
);
|
|
960
1023
|
}
|
|
961
1024
|
}
|
|
962
1025
|
});
|
|
@@ -966,7 +1029,10 @@ class MergeFilterService {
|
|
|
966
1029
|
getApplicablePromotedFilters(props) {
|
|
967
1030
|
const { id, datasetIds, promotedFilters } = props;
|
|
968
1031
|
return _.filter(promotedFilters, (pf) => {
|
|
969
|
-
const appliedBlock = _.find(
|
|
1032
|
+
const appliedBlock = _.find(
|
|
1033
|
+
pf.appliedOnBlocks,
|
|
1034
|
+
(aob) => aob.blockId === id
|
|
1035
|
+
);
|
|
970
1036
|
const isApplied = (appliedBlock == null ? void 0 : appliedBlock.applied) ?? false;
|
|
971
1037
|
return isApplied && _.includes(datasetIds, pf.datasetId);
|
|
972
1038
|
});
|
|
@@ -974,7 +1040,10 @@ class MergeFilterService {
|
|
|
974
1040
|
getUnion(promotedFilters, metricFilters, columnSettings) {
|
|
975
1041
|
const pfSelectOptions = _.map(promotedFilters, (pf) => {
|
|
976
1042
|
var _a;
|
|
977
|
-
return ((_a = filterToSelectOptionType(
|
|
1043
|
+
return ((_a = filterToSelectOptionType(
|
|
1044
|
+
pf.rule,
|
|
1045
|
+
getColumnSettingsToSelectOptions(pf.blockColumnSettings)
|
|
1046
|
+
)) == null ? void 0 : _a.rules) ?? [];
|
|
978
1047
|
}).flat();
|
|
979
1048
|
const mFilterModel = filterToSelectOptionType(
|
|
980
1049
|
metricFilters,
|
|
@@ -996,7 +1065,11 @@ class MergeFilterService {
|
|
|
996
1065
|
datasetIds: props.datasetIds,
|
|
997
1066
|
promotedFilters
|
|
998
1067
|
});
|
|
999
|
-
return this.getUnion(
|
|
1068
|
+
return this.getUnion(
|
|
1069
|
+
applicablePromotedFilters,
|
|
1070
|
+
metricFilters,
|
|
1071
|
+
columnSettings
|
|
1072
|
+
);
|
|
1000
1073
|
}
|
|
1001
1074
|
mergeFilters(props) {
|
|
1002
1075
|
const { commonFilters } = props;
|
|
@@ -1053,7 +1126,7 @@ const updatePromotedFiltersAndDateRangeToMetadataAndInputs = (props) => {
|
|
|
1053
1126
|
});
|
|
1054
1127
|
const updateCurrencyFilterValue = updateCurrencyFilter({
|
|
1055
1128
|
blockId,
|
|
1056
|
-
blockCurrencyFilter: metadata.currency
|
|
1129
|
+
blockCurrencyFilter: (inputs == null ? void 0 : inputs.to_currency) ?? metadata.currency ?? "",
|
|
1057
1130
|
currencyModel: props.currencyModel
|
|
1058
1131
|
});
|
|
1059
1132
|
const updatedInputs = {
|
|
@@ -1066,6 +1139,7 @@ const updatePromotedFiltersAndDateRangeToMetadataAndInputs = (props) => {
|
|
|
1066
1139
|
["rule_pivot"]: updatedFilterRule,
|
|
1067
1140
|
date_range: updatedDateRange,
|
|
1068
1141
|
to_currency: updateCurrencyFilterValue,
|
|
1142
|
+
rate_type: (inputs == null ? void 0 : inputs.rate_type) ?? "",
|
|
1069
1143
|
showDimensionMappingValues: metadata.showDimensionMappingValues ?? false,
|
|
1070
1144
|
showBinSortOrderValues: ((_a = metadata == null ? void 0 : metadata.inputs) == null ? void 0 : _a.showBinSortOrderValues) ?? false,
|
|
1071
1145
|
groupsSortOrder: (inputs == null ? void 0 : inputs.groupsSortOrder) ?? inputs.groupByInput.map((r) => [r, "asc"])
|
|
@@ -1351,7 +1425,10 @@ const getGroupByDefinition = ({
|
|
|
1351
1425
|
rowGroups: rowGroupCols
|
|
1352
1426
|
});
|
|
1353
1427
|
const columnSelectOptions = getColumnSettingsToSelectOptions(columnSettings);
|
|
1354
|
-
const metricFilterRuleSelectOptions = filterToSelectOptionType(
|
|
1428
|
+
const metricFilterRuleSelectOptions = filterToSelectOptionType(
|
|
1429
|
+
filterRules,
|
|
1430
|
+
columnSelectOptions
|
|
1431
|
+
);
|
|
1355
1432
|
const crossFilterMap = getDrilldownFiltersMap({
|
|
1356
1433
|
filtersToBeApplied,
|
|
1357
1434
|
columnSelectOptions
|
|
@@ -1396,7 +1473,13 @@ const generateDefinitionModel = ({
|
|
|
1396
1473
|
};
|
|
1397
1474
|
};
|
|
1398
1475
|
const sortConfigFromValue = (sortBy) => {
|
|
1399
|
-
const sortValueObj = !_.isNil(sortBy == null ? void 0 : sortBy.sortByField) ? {
|
|
1476
|
+
const sortValueObj = !_.isNil(sortBy == null ? void 0 : sortBy.sortByField) ? {
|
|
1477
|
+
[sortBy.sortByField.value]: _.get(
|
|
1478
|
+
sortBy,
|
|
1479
|
+
"sortByOrder",
|
|
1480
|
+
"asc"
|
|
1481
|
+
).toUpperCase()
|
|
1482
|
+
} : void 0;
|
|
1400
1483
|
return sortValueObj;
|
|
1401
1484
|
};
|
|
1402
1485
|
const getMetricSeries = (props) => {
|
|
@@ -1462,7 +1545,9 @@ const generateTransformations = (tableName, filters, sort, metricSeries) => {
|
|
|
1462
1545
|
if (sortEntries.length > 0) {
|
|
1463
1546
|
const newSort = {};
|
|
1464
1547
|
for (const [sortKey, sortOrder] of sortEntries) {
|
|
1465
|
-
const matchingAggregate = metricSeries.aggregates.find(
|
|
1548
|
+
const matchingAggregate = metricSeries.aggregates.find(
|
|
1549
|
+
(agg) => agg[1] === sortKey
|
|
1550
|
+
);
|
|
1466
1551
|
if (matchingAggregate) {
|
|
1467
1552
|
newSort[matchingAggregate[0]] = sortOrder;
|
|
1468
1553
|
}
|
|
@@ -5001,7 +5086,12 @@ class CentrifugoWebsocket {
|
|
|
5001
5086
|
throw new Error("Centrifuge is not initialized. Call connect() first.");
|
|
5002
5087
|
}
|
|
5003
5088
|
if (!this.subscriptions[channelName]) {
|
|
5004
|
-
|
|
5089
|
+
const existingSubscription = this.centrifuge.getSubscription(channelName);
|
|
5090
|
+
if (existingSubscription) {
|
|
5091
|
+
this.subscriptions[channelName] = existingSubscription;
|
|
5092
|
+
} else {
|
|
5093
|
+
this.subscriptions[channelName] = this.centrifuge.newSubscription(channelName);
|
|
5094
|
+
}
|
|
5005
5095
|
}
|
|
5006
5096
|
const subscription = this.subscriptions[channelName];
|
|
5007
5097
|
subscription.on("publication", (data) => {
|
|
@@ -9098,10 +9188,18 @@ class PusherWebsocket {
|
|
|
9098
9188
|
userAuthentication: { endpoint: "/pusher/auth", transport: "ajax" }
|
|
9099
9189
|
});
|
|
9100
9190
|
}
|
|
9101
|
-
this.notebookChannel = this.pusher.subscribe(
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
this.
|
|
9191
|
+
this.notebookChannel = this.pusher.subscribe(
|
|
9192
|
+
"private-notebook-" + this.userId
|
|
9193
|
+
);
|
|
9194
|
+
this.notificationChannel = this.pusher.subscribe(
|
|
9195
|
+
`user-notification-${this.userId}`
|
|
9196
|
+
);
|
|
9197
|
+
this.reconResultChannel = this.pusher.subscribe(
|
|
9198
|
+
`private-recon-result-${this.userId}`
|
|
9199
|
+
);
|
|
9200
|
+
this.statementResultChannel = this.pusher.subscribe(
|
|
9201
|
+
"private-report-result-" + this.userId
|
|
9202
|
+
);
|
|
9105
9203
|
this.pusher.connection.bind("error", (err) => {
|
|
9106
9204
|
console.error("Pusher Error!", err);
|
|
9107
9205
|
this.isConnected = false;
|
|
@@ -9213,7 +9311,9 @@ class PusherWebsocket {
|
|
|
9213
9311
|
throw new Error("Failed to subscribe to presence channel");
|
|
9214
9312
|
}
|
|
9215
9313
|
if (!presenceChannel.members) {
|
|
9216
|
-
throw new Error(
|
|
9314
|
+
throw new Error(
|
|
9315
|
+
"Channel is not a presence channel or subscription not ready"
|
|
9316
|
+
);
|
|
9217
9317
|
}
|
|
9218
9318
|
const membersMap = {};
|
|
9219
9319
|
const membersList = [];
|
|
@@ -9240,7 +9340,11 @@ class WebsocketContextFactory {
|
|
|
9240
9340
|
if (!args.token) {
|
|
9241
9341
|
throw new Error("Token is required");
|
|
9242
9342
|
}
|
|
9243
|
-
websocketProvider = new CentrifugoWebsocket(
|
|
9343
|
+
websocketProvider = new CentrifugoWebsocket(
|
|
9344
|
+
args.connectionUrl,
|
|
9345
|
+
args.token,
|
|
9346
|
+
args.userId
|
|
9347
|
+
);
|
|
9244
9348
|
} else if (mechanism === "pusher") {
|
|
9245
9349
|
if (!args.pusherKey) {
|
|
9246
9350
|
throw new Error("Pusher key is required");
|
|
@@ -9248,12 +9352,21 @@ class WebsocketContextFactory {
|
|
|
9248
9352
|
if (!args.pusherCluster) {
|
|
9249
9353
|
throw new Error("Pusher cluster is required");
|
|
9250
9354
|
}
|
|
9251
|
-
websocketProvider = new PusherWebsocket(
|
|
9355
|
+
websocketProvider = new PusherWebsocket(
|
|
9356
|
+
args.userId,
|
|
9357
|
+
args.pusherKey,
|
|
9358
|
+
args.pusherCluster,
|
|
9359
|
+
args.authenticationEndpoint
|
|
9360
|
+
);
|
|
9252
9361
|
} else {
|
|
9253
|
-
throw new Error(
|
|
9362
|
+
throw new Error(
|
|
9363
|
+
`Unsupported mechanism: ${mechanism}. Supported mechanisms are: pusher, centrifugo`
|
|
9364
|
+
);
|
|
9254
9365
|
}
|
|
9255
9366
|
if (!websocketProvider) {
|
|
9256
|
-
throw new Error(
|
|
9367
|
+
throw new Error(
|
|
9368
|
+
`Failed to create websocket provider for mechanism: ${mechanism}`
|
|
9369
|
+
);
|
|
9257
9370
|
}
|
|
9258
9371
|
websocketProvider.connect();
|
|
9259
9372
|
return websocketProvider;
|
|
@@ -9744,7 +9857,7 @@ const getUniqueDuplicateName = (name, collectionToCheckIn, suffix = "Copy", conc
|
|
|
9744
9857
|
}
|
|
9745
9858
|
return newName.trim();
|
|
9746
9859
|
};
|
|
9747
|
-
const index$
|
|
9860
|
+
const index$h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9748
9861
|
__proto__: null,
|
|
9749
9862
|
formatDate,
|
|
9750
9863
|
generatePushID,
|
|
@@ -9769,8 +9882,14 @@ const hydrateWorksheet = async (sheet) => {
|
|
|
9769
9882
|
let customModel = {};
|
|
9770
9883
|
const sheetId = sheet.id;
|
|
9771
9884
|
if (definitionModelId && customModelId) {
|
|
9772
|
-
definitionModel = await downloadFile(
|
|
9773
|
-
|
|
9885
|
+
definitionModel = await downloadFile(
|
|
9886
|
+
definitionModelId,
|
|
9887
|
+
"application/json"
|
|
9888
|
+
);
|
|
9889
|
+
customModel = await downloadFile(
|
|
9890
|
+
customModelId,
|
|
9891
|
+
"application/json"
|
|
9892
|
+
);
|
|
9774
9893
|
}
|
|
9775
9894
|
if (!definitionModel || !definitionModel[sheetId]) {
|
|
9776
9895
|
return sheet;
|
|
@@ -9909,7 +10028,7 @@ const getData$3 = async (metricSheetId, options) => {
|
|
|
9909
10028
|
resultData = _.flatten(resultData);
|
|
9910
10029
|
return { data: resultData };
|
|
9911
10030
|
};
|
|
9912
|
-
const index$
|
|
10031
|
+
const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9913
10032
|
__proto__: null,
|
|
9914
10033
|
getData: getData$3
|
|
9915
10034
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -9936,7 +10055,9 @@ async function getCommentsByThreadId(threadId) {
|
|
|
9936
10055
|
if (!threadId) {
|
|
9937
10056
|
throw { message: "Thread ID is required", status: 400 };
|
|
9938
10057
|
}
|
|
9939
|
-
const response = await apiClient.get(
|
|
10058
|
+
const response = await apiClient.get(
|
|
10059
|
+
`/chat/get-comments-by-thread-id?threadId=${threadId}`
|
|
10060
|
+
);
|
|
9940
10061
|
if (!response.data) {
|
|
9941
10062
|
throw { message: "Failed to fetch comments", status: 500 };
|
|
9942
10063
|
}
|
|
@@ -9993,7 +10114,9 @@ async function deleteComment(commentId) {
|
|
|
9993
10114
|
if (!commentId) {
|
|
9994
10115
|
throw { message: "Comment ID is required", status: 400 };
|
|
9995
10116
|
}
|
|
9996
|
-
const response = await apiClient.delete(
|
|
10117
|
+
const response = await apiClient.delete(
|
|
10118
|
+
`/chat/delete-comment?commentId=${commentId}`
|
|
10119
|
+
);
|
|
9997
10120
|
return {
|
|
9998
10121
|
success: true,
|
|
9999
10122
|
data: response.data
|
|
@@ -10060,7 +10183,7 @@ async function checkSubscriptionStatus(userId, threadId) {
|
|
|
10060
10183
|
throw { message, status };
|
|
10061
10184
|
}
|
|
10062
10185
|
}
|
|
10063
|
-
const index$
|
|
10186
|
+
const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10064
10187
|
__proto__: null,
|
|
10065
10188
|
checkSubscriptionStatus,
|
|
10066
10189
|
createThread,
|
|
@@ -10265,7 +10388,7 @@ const getAllDatasets = async () => {
|
|
|
10265
10388
|
throw { message, status };
|
|
10266
10389
|
}
|
|
10267
10390
|
};
|
|
10268
|
-
const index$
|
|
10391
|
+
const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10269
10392
|
__proto__: null,
|
|
10270
10393
|
getAllDatasets,
|
|
10271
10394
|
getData: getData$2,
|
|
@@ -10277,10 +10400,13 @@ const getPublishedWorkbookById = async ({
|
|
|
10277
10400
|
}) => {
|
|
10278
10401
|
var _a, _b, _c;
|
|
10279
10402
|
try {
|
|
10280
|
-
const response = await apiClient.post(
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10403
|
+
const response = await apiClient.post(
|
|
10404
|
+
"/workbook/get-published-workbook-by-id",
|
|
10405
|
+
{
|
|
10406
|
+
type,
|
|
10407
|
+
id
|
|
10408
|
+
}
|
|
10409
|
+
);
|
|
10284
10410
|
if (!response.data) {
|
|
10285
10411
|
throw { message: "Failed to fetch workbook details", status: 500 };
|
|
10286
10412
|
}
|
|
@@ -10308,9 +10434,7 @@ var WorkbookTypeEnum = /* @__PURE__ */ ((WorkbookTypeEnum2) => {
|
|
|
10308
10434
|
const getTableById = async (tableId) => {
|
|
10309
10435
|
var _a, _b, _c;
|
|
10310
10436
|
try {
|
|
10311
|
-
const response = await apiClient.get(
|
|
10312
|
-
`/input-table/get-table/${tableId}`
|
|
10313
|
-
);
|
|
10437
|
+
const response = await apiClient.get(`/input-table/get-table/${tableId}`);
|
|
10314
10438
|
if (!response.data) {
|
|
10315
10439
|
throw { message: "Failed to fetch table details", status: 500 };
|
|
10316
10440
|
}
|
|
@@ -10466,10 +10590,9 @@ const getRows = async (tableId, options) => {
|
|
|
10466
10590
|
}
|
|
10467
10591
|
});
|
|
10468
10592
|
}
|
|
10469
|
-
const response = await apiClient.get(
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
);
|
|
10593
|
+
const response = await apiClient.get(`/input-table/${tableId}/rows`, {
|
|
10594
|
+
params
|
|
10595
|
+
});
|
|
10473
10596
|
if (!response.data) {
|
|
10474
10597
|
throw { message: "Failed to fetch rows", status: 500 };
|
|
10475
10598
|
}
|
|
@@ -10584,7 +10707,7 @@ const deleteRow = async (tableId, rowId, idField = "_copa_id") => {
|
|
|
10584
10707
|
throw { message, status };
|
|
10585
10708
|
}
|
|
10586
10709
|
};
|
|
10587
|
-
const index$
|
|
10710
|
+
const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10588
10711
|
__proto__: null,
|
|
10589
10712
|
deleteRow,
|
|
10590
10713
|
getData: getData$1,
|
|
@@ -10676,7 +10799,7 @@ async function publishWorkbook({
|
|
|
10676
10799
|
throw { message, status };
|
|
10677
10800
|
}
|
|
10678
10801
|
}
|
|
10679
|
-
const index$
|
|
10802
|
+
const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10680
10803
|
__proto__: null,
|
|
10681
10804
|
getPublishedWorkbookById,
|
|
10682
10805
|
getWorkbookDetails,
|
|
@@ -10944,7 +11067,7 @@ const getRunResultById = async (runId) => {
|
|
|
10944
11067
|
throw { message, status };
|
|
10945
11068
|
}
|
|
10946
11069
|
};
|
|
10947
|
-
const index$
|
|
11070
|
+
const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10948
11071
|
__proto__: null,
|
|
10949
11072
|
createNewRun,
|
|
10950
11073
|
getData,
|
|
@@ -10974,7 +11097,7 @@ async function getTaskDetails({
|
|
|
10974
11097
|
throw { message, status };
|
|
10975
11098
|
}
|
|
10976
11099
|
}
|
|
10977
|
-
const index$
|
|
11100
|
+
const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10978
11101
|
__proto__: null,
|
|
10979
11102
|
getTaskDetails
|
|
10980
11103
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11020,7 +11143,7 @@ async function getAllReconWorkflows() {
|
|
|
11020
11143
|
throw { message, status };
|
|
11021
11144
|
}
|
|
11022
11145
|
}
|
|
11023
|
-
const index$
|
|
11146
|
+
const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11024
11147
|
__proto__: null,
|
|
11025
11148
|
getAllReconWorkflows,
|
|
11026
11149
|
runRecon
|
|
@@ -11032,7 +11155,10 @@ async function getFormSchema({
|
|
|
11032
11155
|
var _a, _b, _c;
|
|
11033
11156
|
try {
|
|
11034
11157
|
if (!formInstanceId || !formRevision) {
|
|
11035
|
-
throw {
|
|
11158
|
+
throw {
|
|
11159
|
+
message: "Form instance ID and revision are required",
|
|
11160
|
+
status: 400
|
|
11161
|
+
};
|
|
11036
11162
|
}
|
|
11037
11163
|
const response = await apiClient.get(
|
|
11038
11164
|
`/form/get-form-schema?formInstanceId=${encodeURIComponent(formInstanceId)}&formRevision=${encodeURIComponent(formRevision)}`
|
|
@@ -11118,7 +11244,7 @@ async function createOrUpdateForm({
|
|
|
11118
11244
|
throw { message, status: status2 };
|
|
11119
11245
|
}
|
|
11120
11246
|
}
|
|
11121
|
-
const index$
|
|
11247
|
+
const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11122
11248
|
__proto__: null,
|
|
11123
11249
|
createOrUpdateForm,
|
|
11124
11250
|
getFormById,
|
|
@@ -11131,10 +11257,7 @@ async function getAuditLogs(params) {
|
|
|
11131
11257
|
if (!params.limit) {
|
|
11132
11258
|
throw { message: "Limit is required", status: 400 };
|
|
11133
11259
|
}
|
|
11134
|
-
const response = await apiClient.post(
|
|
11135
|
-
"/audit/get-audit-logs",
|
|
11136
|
-
params
|
|
11137
|
-
);
|
|
11260
|
+
const response = await apiClient.post("/audit/get-audit-logs", params);
|
|
11138
11261
|
if (!response.data) {
|
|
11139
11262
|
throw { message: "Failed to fetch audit logs", status: 500 };
|
|
11140
11263
|
}
|
|
@@ -11162,7 +11285,7 @@ async function createAuditLog(params) {
|
|
|
11162
11285
|
throw { message, status };
|
|
11163
11286
|
}
|
|
11164
11287
|
}
|
|
11165
|
-
const index$
|
|
11288
|
+
const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11166
11289
|
__proto__: null,
|
|
11167
11290
|
createAuditLog,
|
|
11168
11291
|
getAuditLogs
|
|
@@ -11181,7 +11304,7 @@ async function getAllTemplatedPipelines() {
|
|
|
11181
11304
|
throw { message, status };
|
|
11182
11305
|
}
|
|
11183
11306
|
}
|
|
11184
|
-
const index$
|
|
11307
|
+
const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11185
11308
|
__proto__: null,
|
|
11186
11309
|
getAllTemplatedPipelines
|
|
11187
11310
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11242,7 +11365,7 @@ async function reassignTask({
|
|
|
11242
11365
|
throw { message, status };
|
|
11243
11366
|
}
|
|
11244
11367
|
}
|
|
11245
|
-
const index$
|
|
11368
|
+
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11246
11369
|
__proto__: null,
|
|
11247
11370
|
markTaskDone,
|
|
11248
11371
|
reassignTask
|
|
@@ -11285,7 +11408,10 @@ async function markItemAsRead({
|
|
|
11285
11408
|
inboxItemIds
|
|
11286
11409
|
});
|
|
11287
11410
|
if (response.status >= 400) {
|
|
11288
|
-
throw {
|
|
11411
|
+
throw {
|
|
11412
|
+
message: "Failed to mark items as read",
|
|
11413
|
+
status: response.status
|
|
11414
|
+
};
|
|
11289
11415
|
}
|
|
11290
11416
|
} catch (error) {
|
|
11291
11417
|
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while marking items as read";
|
|
@@ -11305,7 +11431,10 @@ async function markItemAsUnread({
|
|
|
11305
11431
|
inboxItemIds
|
|
11306
11432
|
});
|
|
11307
11433
|
if (response.status >= 400) {
|
|
11308
|
-
throw {
|
|
11434
|
+
throw {
|
|
11435
|
+
message: "Failed to mark items as unread",
|
|
11436
|
+
status: response.status
|
|
11437
|
+
};
|
|
11309
11438
|
}
|
|
11310
11439
|
} catch (error) {
|
|
11311
11440
|
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while marking items as unread";
|
|
@@ -11313,33 +11442,169 @@ async function markItemAsUnread({
|
|
|
11313
11442
|
throw { message, status };
|
|
11314
11443
|
}
|
|
11315
11444
|
}
|
|
11316
|
-
const index$
|
|
11445
|
+
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11317
11446
|
__proto__: null,
|
|
11318
11447
|
getAllInboxItems,
|
|
11319
11448
|
markItemAsRead,
|
|
11320
11449
|
markItemAsUnread
|
|
11321
11450
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11451
|
+
async function getPermissions(params) {
|
|
11452
|
+
var _a, _b, _c;
|
|
11453
|
+
try {
|
|
11454
|
+
const { objectId, objectType, user, userType, relations } = params;
|
|
11455
|
+
const response = await apiClient.post("/permissions/check", {
|
|
11456
|
+
objectId,
|
|
11457
|
+
objectType,
|
|
11458
|
+
user,
|
|
11459
|
+
userType,
|
|
11460
|
+
relations
|
|
11461
|
+
});
|
|
11462
|
+
if (!response.data || typeof response.data !== "object") {
|
|
11463
|
+
throw { message: "Failed to fetch permissions", status: 500 };
|
|
11464
|
+
}
|
|
11465
|
+
return response.data;
|
|
11466
|
+
} catch (error) {
|
|
11467
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching permissions";
|
|
11468
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
11469
|
+
throw { message, status };
|
|
11470
|
+
}
|
|
11471
|
+
}
|
|
11472
|
+
const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11473
|
+
__proto__: null,
|
|
11474
|
+
getPermissions
|
|
11475
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11476
|
+
async function getClientIp() {
|
|
11477
|
+
var _a, _b, _c;
|
|
11478
|
+
try {
|
|
11479
|
+
const response = await apiClient.get("/client-ip");
|
|
11480
|
+
if (!response.data) {
|
|
11481
|
+
throw { message: "Failed to fetch client IP", status: 500 };
|
|
11482
|
+
}
|
|
11483
|
+
return response.data;
|
|
11484
|
+
} catch (error) {
|
|
11485
|
+
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching client IP";
|
|
11486
|
+
const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
11487
|
+
throw { message, status };
|
|
11488
|
+
}
|
|
11489
|
+
}
|
|
11490
|
+
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11491
|
+
__proto__: null,
|
|
11492
|
+
getClientIp
|
|
11493
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11494
|
+
async function getAllConversations() {
|
|
11495
|
+
var _a, _b, _c, _d;
|
|
11496
|
+
try {
|
|
11497
|
+
const response = await apiClient.get("/email/conversations");
|
|
11498
|
+
return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
|
|
11499
|
+
} catch (error) {
|
|
11500
|
+
const message = ((_c = (_b = error.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || error.message || "An unexpected error occurred while fetching conversations";
|
|
11501
|
+
const status = ((_d = error.response) == null ? void 0 : _d.status) || 500;
|
|
11502
|
+
throw { message, status };
|
|
11503
|
+
}
|
|
11504
|
+
}
|
|
11505
|
+
async function getConversation(params) {
|
|
11506
|
+
var _a, _b, _c, _d;
|
|
11507
|
+
try {
|
|
11508
|
+
if (!params.conversationId) {
|
|
11509
|
+
throw { message: "Conversation ID is required", status: 400 };
|
|
11510
|
+
}
|
|
11511
|
+
const response = await apiClient.get(
|
|
11512
|
+
`/email/conversations/${params.conversationId}/detail`
|
|
11513
|
+
);
|
|
11514
|
+
return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;
|
|
11515
|
+
} catch (error) {
|
|
11516
|
+
const message = ((_c = (_b = error.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || error.message || "An unexpected error occurred while fetching conversation";
|
|
11517
|
+
const status = ((_d = error.response) == null ? void 0 : _d.status) || 500;
|
|
11518
|
+
throw { message, status };
|
|
11519
|
+
}
|
|
11520
|
+
}
|
|
11521
|
+
async function createConversation(params) {
|
|
11522
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
11523
|
+
try {
|
|
11524
|
+
const trimmed = {
|
|
11525
|
+
...params,
|
|
11526
|
+
toEmail: (_a = params.toEmail) == null ? void 0 : _a.trim(),
|
|
11527
|
+
subject: (_b = params.subject) == null ? void 0 : _b.trim(),
|
|
11528
|
+
bodyText: (_c = params.bodyText) == null ? void 0 : _c.trim(),
|
|
11529
|
+
accountId: (_d = params.accountId) == null ? void 0 : _d.trim(),
|
|
11530
|
+
senderId: (_e = params.senderId) == null ? void 0 : _e.trim()
|
|
11531
|
+
};
|
|
11532
|
+
if (!trimmed.toEmail || !trimmed.subject || !trimmed.accountId || !trimmed.senderId || !trimmed.bodyText) {
|
|
11533
|
+
throw {
|
|
11534
|
+
message: "toEmail, subject, bodyText, accountId, and senderId are required",
|
|
11535
|
+
status: 400
|
|
11536
|
+
};
|
|
11537
|
+
}
|
|
11538
|
+
const response = await apiClient.post("/email/conversations", trimmed);
|
|
11539
|
+
return ((_f = response.data) == null ? void 0 : _f.data) ?? response.data;
|
|
11540
|
+
} catch (error) {
|
|
11541
|
+
const message = ((_h = (_g = error.response) == null ? void 0 : _g.data) == null ? void 0 : _h.message) || error.message || "An unexpected error occurred while creating conversation";
|
|
11542
|
+
const status = ((_i = error.response) == null ? void 0 : _i.status) || 500;
|
|
11543
|
+
throw { message, status };
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
async function replyToConversation(params) {
|
|
11547
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11548
|
+
try {
|
|
11549
|
+
const trimmedId = (_a = params.conversationId) == null ? void 0 : _a.trim();
|
|
11550
|
+
const trimmedAccountId = (_b = params.accountId) == null ? void 0 : _b.trim();
|
|
11551
|
+
const trimmedSenderId = (_c = params.senderId) == null ? void 0 : _c.trim();
|
|
11552
|
+
const trimmedBodyText = (_d = params.bodyText) == null ? void 0 : _d.trim();
|
|
11553
|
+
if (!trimmedId || !trimmedAccountId || !trimmedSenderId || !trimmedBodyText) {
|
|
11554
|
+
throw {
|
|
11555
|
+
message: "conversationId, accountId, senderId, and bodyText are required",
|
|
11556
|
+
status: 400
|
|
11557
|
+
};
|
|
11558
|
+
}
|
|
11559
|
+
const { conversationId, ...body } = {
|
|
11560
|
+
...params,
|
|
11561
|
+
conversationId: trimmedId,
|
|
11562
|
+
accountId: trimmedAccountId,
|
|
11563
|
+
senderId: trimmedSenderId,
|
|
11564
|
+
bodyText: trimmedBodyText
|
|
11565
|
+
};
|
|
11566
|
+
const response = await apiClient.post(
|
|
11567
|
+
`/email/conversations/${conversationId}/reply`,
|
|
11568
|
+
body
|
|
11569
|
+
);
|
|
11570
|
+
return ((_e = response.data) == null ? void 0 : _e.data) ?? response.data;
|
|
11571
|
+
} catch (error) {
|
|
11572
|
+
const message = ((_g = (_f = error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || error.message || "An unexpected error occurred while replying to conversation";
|
|
11573
|
+
const status = ((_h = error.response) == null ? void 0 : _h.status) || 500;
|
|
11574
|
+
throw { message, status };
|
|
11575
|
+
}
|
|
11576
|
+
}
|
|
11577
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11578
|
+
__proto__: null,
|
|
11579
|
+
createConversation,
|
|
11580
|
+
getAllConversations,
|
|
11581
|
+
getConversation,
|
|
11582
|
+
replyToConversation
|
|
11583
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11322
11584
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11323
11585
|
__proto__: null,
|
|
11324
11586
|
apiClient,
|
|
11325
|
-
audit: index$
|
|
11326
|
-
chat: index$
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
|
|
11341
|
-
|
|
11342
|
-
|
|
11587
|
+
audit: index$7,
|
|
11588
|
+
chat: index$f,
|
|
11589
|
+
clientIp: index$2,
|
|
11590
|
+
dataset: index$e,
|
|
11591
|
+
definition: index$j,
|
|
11592
|
+
emailEngine: index$1,
|
|
11593
|
+
files: index$k,
|
|
11594
|
+
form: index$8,
|
|
11595
|
+
inboxItems: index$4,
|
|
11596
|
+
inputTable: index$d,
|
|
11597
|
+
metric: index$g,
|
|
11598
|
+
permissions: index$3,
|
|
11599
|
+
process: index$5,
|
|
11600
|
+
recon: index$9,
|
|
11601
|
+
statement: index$b,
|
|
11602
|
+
task: index$a,
|
|
11603
|
+
templatedPipeline: index$6,
|
|
11604
|
+
user: index$m,
|
|
11605
|
+
workbook: index$c,
|
|
11606
|
+
workflow: index$l,
|
|
11607
|
+
worksheet: index$i
|
|
11343
11608
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11344
11609
|
const bluecopaTailwindConfig = {
|
|
11345
11610
|
darkMode: "class",
|
|
@@ -11503,6 +11768,6 @@ export {
|
|
|
11503
11768
|
getConfig as copaGetConfig,
|
|
11504
11769
|
setConfig as copaSetConfig,
|
|
11505
11770
|
bluecopaTailwindConfig as copaTailwindConfig,
|
|
11506
|
-
index$
|
|
11771
|
+
index$h as copaUtils
|
|
11507
11772
|
};
|
|
11508
11773
|
//# sourceMappingURL=index.es.js.map
|