autoql-fe-utils 1.7.21 → 1.7.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1252,6 +1252,7 @@ __export(src_exports, {
1252
1252
  getCombinedFilters: () => getCombinedFilters,
1253
1253
  getCurrencySymbol: () => getCurrencySymbol,
1254
1254
  getCurrentTimezone: () => getCurrentTimezone,
1255
+ getDashboardRefreshInterval: () => getDashboardRefreshInterval,
1255
1256
  getDataAlertsByLabel: () => getDataAlertsByLabel,
1256
1257
  getDataConfig: () => getDataConfig,
1257
1258
  getDataFormatting: () => getDataFormatting,
@@ -1428,6 +1429,7 @@ __export(src_exports, {
1428
1429
  potentiallySupportsPivot: () => potentiallySupportsPivot,
1429
1430
  previewDataAlert: () => previewDataAlert,
1430
1431
  previewManagementDataAlert: () => previewManagementDataAlert,
1432
+ removeDashboardRefreshInterval: () => removeDashboardRefreshInterval,
1431
1433
  removeElementAtIndex: () => removeElementAtIndex,
1432
1434
  removeFromDOM: () => removeFromDOM,
1433
1435
  removeHiddenLegendLabels: () => removeHiddenLegendLabels,
@@ -1453,6 +1455,7 @@ __export(src_exports, {
1453
1455
  sendTrainingData: () => sendTrainingData,
1454
1456
  setCaretPosition: () => setCaretPosition,
1455
1457
  setColumnVisibility: () => setColumnVisibility,
1458
+ setDashboardRefreshInterval: () => setDashboardRefreshInterval,
1456
1459
  setFilterFunction: () => setFilterFunction,
1457
1460
  setFilters: () => setFilters,
1458
1461
  setHeaderFilterPlaceholder: () => setHeaderFilterPlaceholder,
@@ -11525,8 +11528,61 @@ var removeNotificationChannel = ({ channelId, domain, apiKey, token }) => {
11525
11528
  });
11526
11529
  };
11527
11530
 
11528
- // src/Api/trainingDataCollection.ts
11531
+ // src/Api/dashboardService.ts
11529
11532
  var import_axios4 = __toESM(require("axios"));
11533
+ var getDashboardRefreshInterval = ({ domain, apiKey, token, dashboard, scope = "single" }) => {
11534
+ if (!token || !apiKey || !domain || !(dashboard == null ? void 0 : dashboard.id)) {
11535
+ return Promise.reject(new Error("UNAUTHORIZED"));
11536
+ }
11537
+ const url = `${domain}/autoql/management/api/v1/dashboards/refresh-intervals/${dashboard.id}?key=${apiKey}&scope=${scope}`;
11538
+ const config = {
11539
+ headers: {
11540
+ Authorization: `Bearer ${token}`
11541
+ }
11542
+ };
11543
+ return import_axios4.default.get(url, config).then((response) => Promise.resolve(response)).catch((error) => {
11544
+ var _a;
11545
+ return Promise.reject((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data);
11546
+ });
11547
+ };
11548
+ var removeDashboardRefreshInterval = ({ domain, apiKey, token, dashboard }) => {
11549
+ if (!token || !apiKey || !domain || !(dashboard == null ? void 0 : dashboard.id)) {
11550
+ return Promise.reject(new Error("UNAUTHORIZED"));
11551
+ }
11552
+ const url = `${domain}/autoql/management/api/v1/dashboards/refresh-intervals/${dashboard.id}?key=${apiKey}`;
11553
+ const config = {
11554
+ headers: {
11555
+ Authorization: `Bearer ${token}`
11556
+ }
11557
+ };
11558
+ return import_axios4.default.delete(url, config).then((response) => Promise.resolve(response)).catch((error) => {
11559
+ var _a;
11560
+ return Promise.reject((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data);
11561
+ });
11562
+ };
11563
+ var setDashboardRefreshInterval = ({ domain, apiKey, token, dashboard, refreshInterval }) => {
11564
+ if (!token || !apiKey || !domain || !(dashboard == null ? void 0 : dashboard.id) || refreshInterval === void 0) {
11565
+ return Promise.reject(new Error("UNAUTHORIZED"));
11566
+ }
11567
+ const url = `${domain}/autoql/management/api/v1/dashboards/refresh-intervals?key=${apiKey}`;
11568
+ const body = {
11569
+ interval: refreshInterval,
11570
+ level: "DASHBOARD",
11571
+ levelId: dashboard.id
11572
+ };
11573
+ const config = {
11574
+ headers: {
11575
+ Authorization: `Bearer ${token}`
11576
+ }
11577
+ };
11578
+ return import_axios4.default.post(url, body, config).then((response) => Promise.resolve(response)).catch((error) => {
11579
+ var _a;
11580
+ return Promise.reject((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data);
11581
+ });
11582
+ };
11583
+
11584
+ // src/Api/trainingDataCollection.ts
11585
+ var import_axios5 = __toESM(require("axios"));
11530
11586
  var sendTrainingData = ({
11531
11587
  trainingData,
11532
11588
  apiKey,
@@ -11543,7 +11599,7 @@ var sendTrainingData = ({
11543
11599
  Authorization: `Bearer ${token}`
11544
11600
  }
11545
11601
  };
11546
- return import_axios4.default.post(url, data, config).then((response) => Promise.resolve(response)).catch((error) => {
11602
+ return import_axios5.default.post(url, data, config).then((response) => Promise.resolve(response)).catch((error) => {
11547
11603
  var _a;
11548
11604
  return Promise.reject((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data);
11549
11605
  });
@@ -12444,6 +12500,7 @@ function color() {
12444
12500
  getCombinedFilters,
12445
12501
  getCurrencySymbol,
12446
12502
  getCurrentTimezone,
12503
+ getDashboardRefreshInterval,
12447
12504
  getDataAlertsByLabel,
12448
12505
  getDataConfig,
12449
12506
  getDataFormatting,
@@ -12620,6 +12677,7 @@ function color() {
12620
12677
  potentiallySupportsPivot,
12621
12678
  previewDataAlert,
12622
12679
  previewManagementDataAlert,
12680
+ removeDashboardRefreshInterval,
12623
12681
  removeElementAtIndex,
12624
12682
  removeFromDOM,
12625
12683
  removeHiddenLegendLabels,
@@ -12645,6 +12703,7 @@ function color() {
12645
12703
  sendTrainingData,
12646
12704
  setCaretPosition,
12647
12705
  setColumnVisibility,
12706
+ setDashboardRefreshInterval,
12648
12707
  setFilterFunction,
12649
12708
  setFilters,
12650
12709
  setHeaderFilterPlaceholder,