@digital-ai/dot-components 5.4.0 → 5.5.1

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 (30) hide show
  1. package/index.esm.js +660 -506
  2. package/package.json +1 -1
  3. package/src/lib/components/analytics/dashboard-actions/DashboardOptionsMenu.d.ts +3 -1
  4. package/src/lib/components/analytics/dashboard-dialog/DashboardDialog.d.ts +2 -2
  5. package/src/lib/components/analytics/metadata-api/openapi/core/ApiError.d.ts +3 -1
  6. package/src/lib/components/analytics/metadata-api/openapi/core/ApiRequestOptions.d.ts +2 -1
  7. package/src/lib/components/analytics/metadata-api/openapi/core/CancelablePromise.d.ts +20 -0
  8. package/src/lib/components/analytics/metadata-api/openapi/core/OpenAPI.d.ts +8 -7
  9. package/src/lib/components/analytics/metadata-api/openapi/core/request.d.ts +25 -4
  10. package/src/lib/components/analytics/metadata-api/openapi/index.d.ts +3 -0
  11. package/src/lib/components/analytics/metadata-api/openapi/models/DashboardCreateBody.d.ts +4 -0
  12. package/src/lib/components/analytics/metadata-api/openapi/models/DashboardPatchBody.d.ts +4 -0
  13. package/src/lib/components/analytics/metadata-api/openapi/models/DashboardPutBody.d.ts +4 -0
  14. package/src/lib/components/analytics/metadata-api/openapi/models/DashboardView.d.ts +5 -1
  15. package/src/lib/components/analytics/metadata-api/openapi/models/HelpContentCreateBody.d.ts +1 -1
  16. package/src/lib/components/analytics/metadata-api/openapi/models/HelpContentPutBody.d.ts +1 -1
  17. package/src/lib/components/analytics/metadata-api/openapi/models/X_Digitalai_Account_ID.d.ts +4 -0
  18. package/src/lib/components/analytics/metadata-api/openapi/services/BiService.d.ts +7 -6
  19. package/src/lib/components/analytics/metadata-api/openapi/services/CategoriesService.d.ts +3 -2
  20. package/src/lib/components/analytics/metadata-api/openapi/services/DashboardsService.d.ts +17 -16
  21. package/src/lib/components/analytics/metadata-api/openapi/services/DatalakeService.d.ts +2 -1
  22. package/src/lib/components/analytics/metadata-api/openapi/services/EntitiesService.d.ts +6 -5
  23. package/src/lib/components/analytics/metadata-api/openapi/services/EntityAttributesService.d.ts +7 -6
  24. package/src/lib/components/analytics/metadata-api/openapi/services/EntityClassService.d.ts +6 -5
  25. package/src/lib/components/analytics/metadata-api/openapi/services/HelpContentService.d.ts +8 -7
  26. package/src/lib/components/analytics/metadata-api/openapi/services/MrProxyService.d.ts +5 -4
  27. package/src/lib/components/analytics/metadata-api/openapi/services/OriginInstancesService.d.ts +6 -5
  28. package/src/lib/components/analytics/metadata-api/openapi/services/OriginsService.d.ts +6 -5
  29. package/src/lib/components/analytics/metadata-api/openapi/services/ProductsService.d.ts +11 -10
  30. package/src/lib/components/analytics/metadata-api/openapi/services/UtilityService.d.ts +7 -6
package/index.esm.js CHANGED
@@ -2076,6 +2076,19 @@ function __awaiter(thisArg, _arguments, P, generator) {
2076
2076
  });
2077
2077
  }
2078
2078
 
2079
+ function __classPrivateFieldGet(receiver, state, kind, f) {
2080
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
2081
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
2082
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2083
+ }
2084
+
2085
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
2086
+ if (kind === "m") throw new TypeError("Private method is not writable");
2087
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
2088
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
2089
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
2090
+ }
2091
+
2079
2092
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
2080
2093
  var e = new Error(message);
2081
2094
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -2260,7 +2273,7 @@ function getResponseBody$1(response) {
2260
2273
  return null;
2261
2274
  });
2262
2275
  }
2263
- function catchErrors$1(options, result) {
2276
+ function catchErrors(options, result) {
2264
2277
  const errors = Object.assign({
2265
2278
  400: 'Bad Request',
2266
2279
  401: 'Unauthorized',
@@ -2297,7 +2310,7 @@ function request$1(options) {
2297
2310
  statusText: response.statusText,
2298
2311
  body: responseHeader || responseBody
2299
2312
  };
2300
- catchErrors$1(options, result);
2313
+ catchErrors(options, result);
2301
2314
  return result;
2302
2315
  });
2303
2316
  }
@@ -9520,25 +9533,126 @@ const DotPill = ({
9520
9533
  };
9521
9534
 
9522
9535
  class ApiError extends Error {
9523
- constructor(response, message) {
9536
+ constructor(request, response, message) {
9524
9537
  super(message);
9538
+ this.name = 'ApiError';
9525
9539
  this.url = response.url;
9526
9540
  this.status = response.status;
9527
9541
  this.statusText = response.statusText;
9528
9542
  this.body = response.body;
9543
+ this.request = request;
9544
+ }
9545
+ }
9546
+
9547
+ var _CancelablePromise_isResolved, _CancelablePromise_isRejected, _CancelablePromise_isCancelled, _CancelablePromise_cancelHandlers, _CancelablePromise_promise, _CancelablePromise_resolve, _CancelablePromise_reject;
9548
+ /* generated using openapi-typescript-codegen -- do not edit */
9549
+ /* istanbul ignore file */
9550
+ /* tslint:disable */
9551
+ /* eslint-disable */
9552
+ class CancelError extends Error {
9553
+ constructor(message) {
9554
+ super(message);
9555
+ this.name = 'CancelError';
9556
+ }
9557
+ get isCancelled() {
9558
+ return true;
9559
+ }
9560
+ }
9561
+ class CancelablePromise {
9562
+ constructor(executor) {
9563
+ _CancelablePromise_isResolved.set(this, void 0);
9564
+ _CancelablePromise_isRejected.set(this, void 0);
9565
+ _CancelablePromise_isCancelled.set(this, void 0);
9566
+ _CancelablePromise_cancelHandlers.set(this, void 0);
9567
+ _CancelablePromise_promise.set(this, void 0);
9568
+ _CancelablePromise_resolve.set(this, void 0);
9569
+ _CancelablePromise_reject.set(this, void 0);
9570
+ __classPrivateFieldSet(this, _CancelablePromise_isResolved, false, "f");
9571
+ __classPrivateFieldSet(this, _CancelablePromise_isRejected, false, "f");
9572
+ __classPrivateFieldSet(this, _CancelablePromise_isCancelled, false, "f");
9573
+ __classPrivateFieldSet(this, _CancelablePromise_cancelHandlers, [], "f");
9574
+ __classPrivateFieldSet(this, _CancelablePromise_promise, new Promise((resolve, reject) => {
9575
+ __classPrivateFieldSet(this, _CancelablePromise_resolve, resolve, "f");
9576
+ __classPrivateFieldSet(this, _CancelablePromise_reject, reject, "f");
9577
+ const onResolve = value => {
9578
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
9579
+ return;
9580
+ }
9581
+ __classPrivateFieldSet(this, _CancelablePromise_isResolved, true, "f");
9582
+ if (__classPrivateFieldGet(this, _CancelablePromise_resolve, "f")) __classPrivateFieldGet(this, _CancelablePromise_resolve, "f").call(this, value);
9583
+ };
9584
+ const onReject = reason => {
9585
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
9586
+ return;
9587
+ }
9588
+ __classPrivateFieldSet(this, _CancelablePromise_isRejected, true, "f");
9589
+ if (__classPrivateFieldGet(this, _CancelablePromise_reject, "f")) __classPrivateFieldGet(this, _CancelablePromise_reject, "f").call(this, reason);
9590
+ };
9591
+ const onCancel = cancelHandler => {
9592
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
9593
+ return;
9594
+ }
9595
+ __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").push(cancelHandler);
9596
+ };
9597
+ Object.defineProperty(onCancel, 'isResolved', {
9598
+ get: () => __classPrivateFieldGet(this, _CancelablePromise_isResolved, "f")
9599
+ });
9600
+ Object.defineProperty(onCancel, 'isRejected', {
9601
+ get: () => __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f")
9602
+ });
9603
+ Object.defineProperty(onCancel, 'isCancelled', {
9604
+ get: () => __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")
9605
+ });
9606
+ return executor(onResolve, onReject, onCancel);
9607
+ }), "f");
9608
+ }
9609
+ get [(_CancelablePromise_isResolved = new WeakMap(), _CancelablePromise_isRejected = new WeakMap(), _CancelablePromise_isCancelled = new WeakMap(), _CancelablePromise_cancelHandlers = new WeakMap(), _CancelablePromise_promise = new WeakMap(), _CancelablePromise_resolve = new WeakMap(), _CancelablePromise_reject = new WeakMap(), Symbol.toStringTag)]() {
9610
+ return 'Cancellable Promise';
9611
+ }
9612
+ then(onFulfilled, onRejected) {
9613
+ return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").then(onFulfilled, onRejected);
9614
+ }
9615
+ catch(onRejected) {
9616
+ return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").catch(onRejected);
9617
+ }
9618
+ finally(onFinally) {
9619
+ return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").finally(onFinally);
9620
+ }
9621
+ cancel() {
9622
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
9623
+ return;
9624
+ }
9625
+ __classPrivateFieldSet(this, _CancelablePromise_isCancelled, true, "f");
9626
+ if (__classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").length) {
9627
+ try {
9628
+ for (const cancelHandler of __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f")) {
9629
+ cancelHandler();
9630
+ }
9631
+ } catch (error) {
9632
+ console.warn('Cancellation threw an error', error);
9633
+ return;
9634
+ }
9635
+ }
9636
+ __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").length = 0;
9637
+ if (__classPrivateFieldGet(this, _CancelablePromise_reject, "f")) __classPrivateFieldGet(this, _CancelablePromise_reject, "f").call(this, new CancelError('Request aborted'));
9638
+ }
9639
+ get isCancelled() {
9640
+ return __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f");
9529
9641
  }
9530
9642
  }
9531
9643
 
9532
9644
  const OpenAPI = {
9533
9645
  BASE: '',
9646
+ VERSION: '0.1',
9647
+ WITH_CREDENTIALS: false,
9648
+ CREDENTIALS: 'include',
9534
9649
  TOKEN: undefined,
9535
9650
  USERNAME: undefined,
9536
9651
  PASSWORD: undefined,
9537
- HEADERS: undefined};
9652
+ HEADERS: undefined,
9653
+ ENCODE_PATH: undefined
9654
+ };
9538
9655
 
9539
- /* istanbul ignore file */
9540
- /* tslint:disable */
9541
- /* eslint-disable */
9542
9656
  var DashboardCreateBody;
9543
9657
  (function (DashboardCreateBody) {
9544
9658
  (function (lifecycle_state) {
@@ -9551,9 +9665,6 @@ var DashboardCreateBody;
9551
9665
  })(DashboardCreateBody.bi_type || (DashboardCreateBody.bi_type = {}));
9552
9666
  })(DashboardCreateBody || (DashboardCreateBody = {}));
9553
9667
 
9554
- /* istanbul ignore file */
9555
- /* tslint:disable */
9556
- /* eslint-disable */
9557
9668
  var DashboardPatchBody;
9558
9669
  (function (DashboardPatchBody) {
9559
9670
  (function (lifecycle_state) {
@@ -9566,9 +9677,6 @@ var DashboardPatchBody;
9566
9677
  })(DashboardPatchBody.bi_type || (DashboardPatchBody.bi_type = {}));
9567
9678
  })(DashboardPatchBody || (DashboardPatchBody = {}));
9568
9679
 
9569
- /* istanbul ignore file */
9570
- /* tslint:disable */
9571
- /* eslint-disable */
9572
9680
  var DashboardPutBody;
9573
9681
  (function (DashboardPutBody) {
9574
9682
  (function (lifecycle_state) {
@@ -9581,9 +9689,6 @@ var DashboardPutBody;
9581
9689
  })(DashboardPutBody.bi_type || (DashboardPutBody.bi_type = {}));
9582
9690
  })(DashboardPutBody || (DashboardPutBody = {}));
9583
9691
 
9584
- /* istanbul ignore file */
9585
- /* tslint:disable */
9586
- /* eslint-disable */
9587
9692
  var DashboardView;
9588
9693
  (function (DashboardView) {
9589
9694
  (function (lifecycle_state) {
@@ -9596,159 +9701,180 @@ var DashboardView;
9596
9701
  })(DashboardView.bi_type || (DashboardView.bi_type = {}));
9597
9702
  })(DashboardView || (DashboardView = {}));
9598
9703
 
9599
- function isDefined(value) {
9704
+ const isDefined = value => {
9600
9705
  return value !== undefined && value !== null;
9601
- }
9602
- function isString(value) {
9706
+ };
9707
+ const isString = value => {
9603
9708
  return typeof value === 'string';
9604
- }
9605
- function isStringWithValue(value) {
9709
+ };
9710
+ const isStringWithValue = value => {
9606
9711
  return isString(value) && value !== '';
9607
- }
9608
- function isBlob(value) {
9609
- return value instanceof Blob;
9610
- }
9611
- function base64(str) {
9712
+ };
9713
+ const isBlob = value => {
9714
+ return typeof value === 'object' && typeof value.type === 'string' && typeof value.stream === 'function' && typeof value.arrayBuffer === 'function' && typeof value.constructor === 'function' && typeof value.constructor.name === 'string' && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
9715
+ };
9716
+ const isFormData = value => {
9717
+ return value instanceof FormData;
9718
+ };
9719
+ const base64 = str => {
9612
9720
  try {
9613
9721
  return btoa(str);
9614
9722
  } catch (err) {
9723
+ // @ts-ignore
9615
9724
  return Buffer.from(str).toString('base64');
9616
9725
  }
9617
- }
9618
- function getQueryString(params) {
9726
+ };
9727
+ const getQueryString = params => {
9619
9728
  const qs = [];
9620
- Object.keys(params).forEach(key => {
9621
- const value = params[key];
9729
+ const append = (key, value) => {
9730
+ qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
9731
+ };
9732
+ const process = (key, value) => {
9622
9733
  if (isDefined(value)) {
9623
9734
  if (Array.isArray(value)) {
9624
- value.forEach(value => {
9625
- qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
9735
+ value.forEach(v => {
9736
+ process(key, v);
9737
+ });
9738
+ } else if (typeof value === 'object') {
9739
+ Object.entries(value).forEach(([k, v]) => {
9740
+ process(`${key}[${k}]`, v);
9626
9741
  });
9627
9742
  } else {
9628
- qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
9743
+ append(key, value);
9629
9744
  }
9630
9745
  }
9746
+ };
9747
+ Object.entries(params).forEach(([key, value]) => {
9748
+ process(key, value);
9631
9749
  });
9632
9750
  if (qs.length > 0) {
9633
9751
  return `?${qs.join('&')}`;
9634
9752
  }
9635
9753
  return '';
9636
- }
9637
- function getUrl(options) {
9638
- const path = options.path;
9639
- const url = `${OpenAPI.BASE}${path}`;
9754
+ };
9755
+ const getUrl = (config, options) => {
9756
+ const encoder = encodeURI;
9757
+ const path = options.url.replace('{api-version}', config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
9758
+ var _a;
9759
+ if ((_a = options.path) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(group)) {
9760
+ return encoder(String(options.path[group]));
9761
+ }
9762
+ return substring;
9763
+ });
9764
+ const url = `${config.BASE}${path}`;
9640
9765
  if (options.query) {
9641
9766
  return `${url}${getQueryString(options.query)}`;
9642
9767
  }
9643
9768
  return url;
9644
- }
9645
- function getFormData(params) {
9646
- const formData = new FormData();
9647
- Object.keys(params).forEach(key => {
9648
- const value = params[key];
9649
- if (isDefined(value)) {
9650
- formData.append(key, value);
9651
- }
9652
- });
9653
- return formData;
9654
- }
9655
- function resolve(options, resolver) {
9656
- return __awaiter(this, void 0, void 0, function* () {
9657
- if (typeof resolver === 'function') {
9658
- return resolver(options);
9659
- }
9660
- return resolver;
9661
- });
9662
- }
9663
- function getHeaders(options) {
9664
- return __awaiter(this, void 0, void 0, function* () {
9665
- const token = yield resolve(options, OpenAPI.TOKEN);
9666
- const username = yield resolve(options, OpenAPI.USERNAME);
9667
- const password = yield resolve(options, OpenAPI.PASSWORD);
9668
- const additionalHeaders = yield resolve(options, OpenAPI.HEADERS);
9669
- const defaultHeaders = Object.entries(Object.assign(Object.assign({
9670
- Accept: 'application/json'
9671
- }, additionalHeaders), options.headers)).filter(([key, value]) => isDefined(value)).reduce((headers, [key, value]) => Object.assign(Object.assign({}, headers), {
9672
- [key]: value
9673
- }), {});
9674
- const headers = new Headers(defaultHeaders);
9675
- if (isStringWithValue(token)) {
9676
- headers.append('Authorization', `Bearer ${token}`);
9677
- }
9678
- if (isStringWithValue(username) && isStringWithValue(password)) {
9679
- const credentials = base64(`${username}:${password}`);
9680
- headers.append('Authorization', `Basic ${credentials}`);
9681
- }
9682
- if (options.body) {
9683
- if (options.mediaType) {
9684
- headers.append('Content-Type', options.mediaType);
9685
- } else if (isBlob(options.body)) {
9686
- headers.append('Content-Type', options.body.type || 'application/octet-stream');
9687
- } else if (isString(options.body)) {
9688
- headers.append('Content-Type', 'text/plain');
9769
+ };
9770
+ const getFormData = options => {
9771
+ if (options.formData) {
9772
+ const formData = new FormData();
9773
+ const process = (key, value) => {
9774
+ if (isString(value) || isBlob(value)) {
9775
+ formData.append(key, value);
9689
9776
  } else {
9690
- headers.append('Content-Type', 'application/json');
9777
+ formData.append(key, JSON.stringify(value));
9691
9778
  }
9779
+ };
9780
+ Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
9781
+ if (Array.isArray(value)) {
9782
+ value.forEach(v => process(key, v));
9783
+ } else {
9784
+ process(key, value);
9785
+ }
9786
+ });
9787
+ return formData;
9788
+ }
9789
+ return undefined;
9790
+ };
9791
+ const resolve = (options, resolver) => __awaiter(void 0, void 0, void 0, function* () {
9792
+ if (typeof resolver === 'function') {
9793
+ return resolver(options);
9794
+ }
9795
+ return resolver;
9796
+ });
9797
+ const getHeaders = (config, options) => __awaiter(void 0, void 0, void 0, function* () {
9798
+ const [token, username, password, additionalHeaders] = yield Promise.all([resolve(options, config.TOKEN), resolve(options, config.USERNAME), resolve(options, config.PASSWORD), resolve(options, config.HEADERS)]);
9799
+ const headers = Object.entries(Object.assign(Object.assign({
9800
+ Accept: 'application/json'
9801
+ }, additionalHeaders), options.headers)).filter(([_, value]) => isDefined(value)).reduce((headers, [key, value]) => Object.assign(Object.assign({}, headers), {
9802
+ [key]: String(value)
9803
+ }), {});
9804
+ if (isStringWithValue(token)) {
9805
+ headers['Authorization'] = `Bearer ${token}`;
9806
+ }
9807
+ if (isStringWithValue(username) && isStringWithValue(password)) {
9808
+ const credentials = base64(`${username}:${password}`);
9809
+ headers['Authorization'] = `Basic ${credentials}`;
9810
+ }
9811
+ if (options.body !== undefined) {
9812
+ if (options.mediaType) {
9813
+ headers['Content-Type'] = options.mediaType;
9814
+ } else if (isBlob(options.body)) {
9815
+ headers['Content-Type'] = options.body.type || 'application/octet-stream';
9816
+ } else if (isString(options.body)) {
9817
+ headers['Content-Type'] = 'text/plain';
9818
+ } else if (!isFormData(options.body)) {
9819
+ headers['Content-Type'] = 'application/json';
9692
9820
  }
9693
- return headers;
9694
- });
9695
- }
9696
- function getRequestBody(options) {
9697
- var _a;
9698
- if (options.formData) {
9699
- return getFormData(options.formData);
9700
9821
  }
9701
- if (options.body) {
9822
+ return new Headers(headers);
9823
+ });
9824
+ const getRequestBody = options => {
9825
+ var _a;
9826
+ if (options.body !== undefined) {
9702
9827
  if ((_a = options.mediaType) === null || _a === void 0 ? void 0 : _a.includes('/json')) {
9703
9828
  return JSON.stringify(options.body);
9704
- } else if (isString(options.body) || isBlob(options.body)) {
9829
+ } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
9705
9830
  return options.body;
9706
9831
  } else {
9707
9832
  return JSON.stringify(options.body);
9708
9833
  }
9709
9834
  }
9710
9835
  return undefined;
9711
- }
9712
- function sendRequest(options, url) {
9713
- return __awaiter(this, void 0, void 0, function* () {
9714
- const request = {
9715
- method: options.method,
9716
- headers: yield getHeaders(options),
9717
- body: getRequestBody(options)
9718
- };
9719
- return yield fetch(url, request);
9720
- });
9721
- }
9722
- function getResponseHeader(response, responseHeader) {
9836
+ };
9837
+ const sendRequest = (config, options, url, body, formData, headers, onCancel) => __awaiter(void 0, void 0, void 0, function* () {
9838
+ const controller = new AbortController();
9839
+ const request = {
9840
+ headers,
9841
+ body: body !== null && body !== void 0 ? body : formData,
9842
+ method: options.method,
9843
+ signal: controller.signal
9844
+ };
9845
+ onCancel(() => controller.abort());
9846
+ return yield fetch(url, request);
9847
+ });
9848
+ const getResponseHeader = (response, responseHeader) => {
9723
9849
  if (responseHeader) {
9724
9850
  const content = response.headers.get(responseHeader);
9725
9851
  if (isString(content)) {
9726
9852
  return content;
9727
9853
  }
9728
9854
  }
9729
- return null;
9730
- }
9731
- function getResponseBody(response) {
9732
- return __awaiter(this, void 0, void 0, function* () {
9733
- if (response.status !== 204) {
9734
- try {
9735
- const contentType = response.headers.get('Content-Type');
9736
- if (contentType) {
9737
- const isJSON = contentType.toLowerCase().startsWith('application/json');
9738
- if (isJSON) {
9739
- return yield response.json();
9740
- } else {
9741
- return yield response.text();
9742
- }
9855
+ return undefined;
9856
+ };
9857
+ const getResponseBody = response => __awaiter(void 0, void 0, void 0, function* () {
9858
+ if (response.status !== 204) {
9859
+ try {
9860
+ const contentType = response.headers.get('Content-Type');
9861
+ if (contentType) {
9862
+ const jsonTypes = ['application/json', 'application/problem+json'];
9863
+ const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type));
9864
+ if (isJSON) {
9865
+ return yield response.json();
9866
+ } else {
9867
+ return yield response.text();
9743
9868
  }
9744
- } catch (error) {
9745
- console.error(error);
9746
9869
  }
9870
+ } catch (error) {
9871
+ console.error(error);
9747
9872
  }
9748
- return null;
9749
- });
9750
- }
9751
- function catchErrors(options, result) {
9873
+ }
9874
+ return undefined;
9875
+ });
9876
+ const catchErrorCodes = (options, result) => {
9877
+ var _a, _b;
9752
9878
  const errors = Object.assign({
9753
9879
  400: 'Bad Request',
9754
9880
  401: 'Unauthorized',
@@ -9760,35 +9886,54 @@ function catchErrors(options, result) {
9760
9886
  }, options.errors);
9761
9887
  const error = errors[result.status];
9762
9888
  if (error) {
9763
- throw new ApiError(result, error);
9889
+ throw new ApiError(options, result, error);
9764
9890
  }
9765
9891
  if (!result.ok) {
9766
- throw new ApiError(result, 'Generic Error');
9892
+ const errorStatus = (_a = result.status) !== null && _a !== void 0 ? _a : 'unknown';
9893
+ const errorStatusText = (_b = result.statusText) !== null && _b !== void 0 ? _b : 'unknown';
9894
+ const errorBody = (() => {
9895
+ try {
9896
+ return JSON.stringify(result.body, null, 2);
9897
+ } catch (e) {
9898
+ return undefined;
9899
+ }
9900
+ })();
9901
+ throw new ApiError(options, result, `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`);
9767
9902
  }
9768
- }
9903
+ };
9769
9904
  /**
9770
- * Request using fetch client
9771
- * @param options The request options from the the service
9772
- * @returns ApiResult
9905
+ * Request method
9906
+ * @param config The OpenAPI configuration object
9907
+ * @param options The request options from the service
9908
+ * @returns CancelablePromise<T>
9773
9909
  * @throws ApiError
9774
9910
  */
9775
- function request(options) {
9776
- return __awaiter(this, void 0, void 0, function* () {
9777
- const url = getUrl(options);
9778
- const response = yield sendRequest(options, url);
9779
- const responseBody = yield getResponseBody(response);
9780
- const responseHeader = getResponseHeader(response, options.responseHeader);
9781
- const result = {
9782
- url,
9783
- ok: response.ok,
9784
- status: response.status,
9785
- statusText: response.statusText,
9786
- body: responseHeader || responseBody
9787
- };
9788
- catchErrors(options, result);
9789
- return result;
9790
- });
9791
- }
9911
+ const request = (config, options) => {
9912
+ return new CancelablePromise((resolve, reject, onCancel) => __awaiter(void 0, void 0, void 0, function* () {
9913
+ try {
9914
+ const url = getUrl(config, options);
9915
+ const formData = getFormData(options);
9916
+ const body = getRequestBody(options);
9917
+ const headers = yield getHeaders(config, options);
9918
+ if (!onCancel.isCancelled) {
9919
+ const response = yield sendRequest(config, options, url, body, formData, headers, onCancel);
9920
+ const responseBody = yield getResponseBody(response);
9921
+ const responseHeader = getResponseHeader(response, options.responseHeader);
9922
+ const result = {
9923
+ url,
9924
+ ok: response.ok,
9925
+ status: response.status,
9926
+ statusText: response.statusText,
9927
+ body: responseHeader !== null && responseHeader !== void 0 ? responseHeader : responseBody
9928
+ };
9929
+ catchErrorCodes(options, result);
9930
+ resolve(result.body);
9931
+ }
9932
+ } catch (error) {
9933
+ reject(error);
9934
+ }
9935
+ }));
9936
+ };
9792
9937
 
9793
9938
  class DashboardsService {
9794
9939
  /**
@@ -9800,7 +9945,7 @@ class DashboardsService {
9800
9945
  * @param sort Sort ordering to apply to the query.
9801
9946
  * @param filter List of filters (each filter is a separate query param, and they are OR'ed).
9802
9947
  *
9803
- * * **Filterable field names**: author_fullname, author_id, bi_type, categories, created_dt, dataset_id, description, external_embedding_id, external_id, id, is_ootb_dashboard, lifecycle_state, name, target_apps, updated_by_fullname, updated_by_id, updated_dt
9948
+ * * **Filterable field names**: author_fullname, author_id, bi_type, categories, created_dt, dataset_id, description, external_embedding_id, external_id, featured, id, is_ootb_dashboard, lifecycle_state, name, target_apps, updated_by_fullname, updated_by_id, updated_dt
9804
9949
  * * **Searchable field names**: author_fullname, categories, description, name, updated_by_fullname
9805
9950
  *
9806
9951
  * @param favorite Boolean flag to only return dashboards marked as favorites.
@@ -9819,39 +9964,36 @@ class DashboardsService {
9819
9964
  * @returns Error Default error response
9820
9965
  * @throws ApiError
9821
9966
  */
9822
- static getDashboards() {
9823
- return __awaiter(this, arguments, void 0, function* (xDigitalaiAccountId = null, start, count = 20, sort = 'id', filter, favorite = null, q = null, authorFullname = null, authorId = null, biType = 'MICROSTRATEGY', description = null, id = null, isOotbDashboard = null, lifecycleState = null, name = null, targetApp = null, viewModified = false) {
9824
- const result = yield request({
9825
- method: 'GET',
9826
- path: `/metadata/bi/dashboards`,
9827
- headers: {
9828
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
9829
- },
9830
- query: {
9831
- start: start,
9832
- count: count,
9833
- sort: sort,
9834
- filter: filter,
9835
- favorite: favorite,
9836
- q: q,
9837
- author_fullname: authorFullname,
9838
- author_id: authorId,
9839
- bi_type: biType,
9840
- description: description,
9841
- id: id,
9842
- is_ootb_dashboard: isOotbDashboard,
9843
- lifecycle_state: lifecycleState,
9844
- name: name,
9845
- target_app: targetApp,
9846
- view_modified: viewModified
9847
- },
9848
- errors: {
9849
- 400: `An unknown parameter was specified.`,
9850
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
9851
- 422: `Unprocessable Entity`
9852
- }
9853
- });
9854
- return result.body;
9967
+ static getDashboards(xDigitalaiAccountId = null, start, count = 20, sort = 'id', filter, favorite = null, q = null, authorFullname = null, authorId = null, biType = 'MICROSTRATEGY', description = null, id = null, isOotbDashboard = null, lifecycleState = null, name = null, targetApp = null, viewModified = false) {
9968
+ return request(OpenAPI, {
9969
+ method: 'GET',
9970
+ url: '/metadata/bi/dashboards',
9971
+ headers: {
9972
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
9973
+ },
9974
+ query: {
9975
+ start: start,
9976
+ count: count,
9977
+ sort: sort,
9978
+ filter: filter,
9979
+ favorite: favorite,
9980
+ q: q,
9981
+ author_fullname: authorFullname,
9982
+ author_id: authorId,
9983
+ bi_type: biType,
9984
+ description: description,
9985
+ id: id,
9986
+ is_ootb_dashboard: isOotbDashboard,
9987
+ lifecycle_state: lifecycleState,
9988
+ name: name,
9989
+ target_app: targetApp,
9990
+ view_modified: viewModified
9991
+ },
9992
+ errors: {
9993
+ 400: `An unknown parameter was specified.`,
9994
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
9995
+ 422: `Unprocessable Entity`
9996
+ }
9855
9997
  });
9856
9998
  }
9857
9999
  /**
@@ -9863,23 +10005,20 @@ class DashboardsService {
9863
10005
  * @returns Error Default error response
9864
10006
  * @throws ApiError
9865
10007
  */
9866
- static postDashboards(requestBody_1) {
9867
- return __awaiter(this, arguments, void 0, function* (requestBody, xDigitalaiAccountId = null) {
9868
- const result = yield request({
9869
- method: 'POST',
9870
- path: `/metadata/bi/dashboards`,
9871
- headers: {
9872
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
9873
- },
9874
- body: requestBody,
9875
- mediaType: 'application/json',
9876
- errors: {
9877
- 400: `The provided data is not valid.`,
9878
- 404: `The dashboard could not be found.`,
9879
- 422: `Unprocessable Entity`
9880
- }
9881
- });
9882
- return result.body;
10008
+ static postDashboards(requestBody, xDigitalaiAccountId = null) {
10009
+ return request(OpenAPI, {
10010
+ method: 'POST',
10011
+ url: '/metadata/bi/dashboards',
10012
+ headers: {
10013
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10014
+ },
10015
+ body: requestBody,
10016
+ mediaType: 'application/json',
10017
+ errors: {
10018
+ 400: `The provided data is not valid.`,
10019
+ 404: `The dashboard could not be found.`,
10020
+ 422: `Unprocessable Entity`
10021
+ }
9883
10022
  });
9884
10023
  }
9885
10024
  /**
@@ -9891,21 +10030,21 @@ class DashboardsService {
9891
10030
  * @returns Error Default error response
9892
10031
  * @throws ApiError
9893
10032
  */
9894
- static getDashboard(dashboardId_1) {
9895
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null) {
9896
- const result = yield request({
9897
- method: 'GET',
9898
- path: `/metadata/bi/dashboards/${dashboardId}`,
9899
- headers: {
9900
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
9901
- },
9902
- errors: {
9903
- 400: `An unknown parameter was specified.`,
9904
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
9905
- 404: `The dashboard could not be found.`
9906
- }
9907
- });
9908
- return result.body;
10033
+ static getDashboard(dashboardId, xDigitalaiAccountId = null) {
10034
+ return request(OpenAPI, {
10035
+ method: 'GET',
10036
+ url: '/metadata/bi/dashboards/{dashboard_id}',
10037
+ path: {
10038
+ dashboard_id: dashboardId
10039
+ },
10040
+ headers: {
10041
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10042
+ },
10043
+ errors: {
10044
+ 400: `An unknown parameter was specified.`,
10045
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10046
+ 404: `The dashboard could not be found.`
10047
+ }
9909
10048
  });
9910
10049
  }
9911
10050
  /**
@@ -9919,28 +10058,28 @@ class DashboardsService {
9919
10058
  * @returns Error Default error response
9920
10059
  * @throws ApiError
9921
10060
  */
9922
- static putDashboard(dashboardId_1, requestBody_1) {
9923
- return __awaiter(this, arguments, void 0, function* (dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
9924
- const result = yield request({
9925
- method: 'PUT',
9926
- path: `/metadata/bi/dashboards/${dashboardId}`,
9927
- headers: {
9928
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
9929
- },
9930
- query: {
9931
- is_sync: isSync
9932
- },
9933
- body: requestBody,
9934
- mediaType: 'application/json',
9935
- errors: {
9936
- 400: `The provided data is not valid.`,
9937
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
9938
- 404: `The dashboard could not be found.`,
9939
- 409: `Unable to update object because IDs are different.`,
9940
- 422: `Unprocessable Entity`
9941
- }
9942
- });
9943
- return result.body;
10061
+ static putDashboard(dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
10062
+ return request(OpenAPI, {
10063
+ method: 'PUT',
10064
+ url: '/metadata/bi/dashboards/{dashboard_id}',
10065
+ path: {
10066
+ dashboard_id: dashboardId
10067
+ },
10068
+ headers: {
10069
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10070
+ },
10071
+ query: {
10072
+ is_sync: isSync
10073
+ },
10074
+ body: requestBody,
10075
+ mediaType: 'application/json',
10076
+ errors: {
10077
+ 400: `The provided data is not valid.`,
10078
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10079
+ 404: `The dashboard could not be found.`,
10080
+ 409: `Unable to update object because IDs are different.`,
10081
+ 422: `Unprocessable Entity`
10082
+ }
9944
10083
  });
9945
10084
  }
9946
10085
  /**
@@ -9954,28 +10093,28 @@ class DashboardsService {
9954
10093
  * @returns Error Default error response
9955
10094
  * @throws ApiError
9956
10095
  */
9957
- static patchDashboard(dashboardId_1, requestBody_1) {
9958
- return __awaiter(this, arguments, void 0, function* (dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
9959
- const result = yield request({
9960
- method: 'PATCH',
9961
- path: `/metadata/bi/dashboards/${dashboardId}`,
9962
- headers: {
9963
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
9964
- },
9965
- query: {
9966
- is_sync: isSync
9967
- },
9968
- body: requestBody,
9969
- mediaType: 'application/json',
9970
- errors: {
9971
- 400: `The provided data is not valid.`,
9972
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
9973
- 404: `The dashboard could not be found.`,
9974
- 409: `Unable to update object because IDs are different.`,
9975
- 422: `Unprocessable Entity`
9976
- }
9977
- });
9978
- return result.body;
10096
+ static patchDashboard(dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
10097
+ return request(OpenAPI, {
10098
+ method: 'PATCH',
10099
+ url: '/metadata/bi/dashboards/{dashboard_id}',
10100
+ path: {
10101
+ dashboard_id: dashboardId
10102
+ },
10103
+ headers: {
10104
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10105
+ },
10106
+ query: {
10107
+ is_sync: isSync
10108
+ },
10109
+ body: requestBody,
10110
+ mediaType: 'application/json',
10111
+ errors: {
10112
+ 400: `The provided data is not valid.`,
10113
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10114
+ 404: `The dashboard could not be found.`,
10115
+ 409: `Unable to update object because IDs are different.`,
10116
+ 422: `Unprocessable Entity`
10117
+ }
9979
10118
  });
9980
10119
  }
9981
10120
  /**
@@ -9986,16 +10125,16 @@ class DashboardsService {
9986
10125
  * @returns Error Default error response
9987
10126
  * @throws ApiError
9988
10127
  */
9989
- static deleteDashboard(dashboardId_1) {
9990
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null) {
9991
- const result = yield request({
9992
- method: 'DELETE',
9993
- path: `/metadata/bi/dashboards/${dashboardId}`,
9994
- headers: {
9995
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
9996
- }
9997
- });
9998
- return result.body;
10128
+ static deleteDashboard(dashboardId, xDigitalaiAccountId = null) {
10129
+ return request(OpenAPI, {
10130
+ method: 'DELETE',
10131
+ url: '/metadata/bi/dashboards/{dashboard_id}',
10132
+ path: {
10133
+ dashboard_id: dashboardId
10134
+ },
10135
+ headers: {
10136
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10137
+ }
9999
10138
  });
10000
10139
  }
10001
10140
  /**
@@ -10007,21 +10146,21 @@ class DashboardsService {
10007
10146
  * @returns Error Default error response
10008
10147
  * @throws ApiError
10009
10148
  */
10010
- static getInProgressDashboard(dashboardId_1) {
10011
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null) {
10012
- const result = yield request({
10013
- method: 'GET',
10014
- path: `/metadata/bi/dashboards/${dashboardId}/inprogress`,
10015
- headers: {
10016
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10017
- },
10018
- errors: {
10019
- 400: `An unknown parameter was specified.`,
10020
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10021
- 404: `The dashboard could not be found.`
10022
- }
10023
- });
10024
- return result.body;
10149
+ static getInProgressDashboard(dashboardId, xDigitalaiAccountId = null) {
10150
+ return request(OpenAPI, {
10151
+ method: 'GET',
10152
+ url: '/metadata/bi/dashboards/{dashboard_id}/inprogress',
10153
+ path: {
10154
+ dashboard_id: dashboardId
10155
+ },
10156
+ headers: {
10157
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10158
+ },
10159
+ errors: {
10160
+ 400: `An unknown parameter was specified.`,
10161
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10162
+ 404: `The dashboard could not be found.`
10163
+ }
10025
10164
  });
10026
10165
  }
10027
10166
  /**
@@ -10034,24 +10173,24 @@ class DashboardsService {
10034
10173
  * @returns Error Default error response
10035
10174
  * @throws ApiError
10036
10175
  */
10037
- static postInProgressDashboard(dashboardId_1) {
10038
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null, requestBody) {
10039
- const result = yield request({
10040
- method: 'POST',
10041
- path: `/metadata/bi/dashboards/${dashboardId}/inprogress`,
10042
- headers: {
10043
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10044
- },
10045
- body: requestBody,
10046
- mediaType: 'application/json',
10047
- errors: {
10048
- 400: `The provided data is not valid.`,
10049
- 404: `The dashboard could not be found.`,
10050
- 409: `Unable to update object because IDs are different.`,
10051
- 422: `Unprocessable Entity`
10052
- }
10053
- });
10054
- return result.body;
10176
+ static postInProgressDashboard(dashboardId, xDigitalaiAccountId = null, requestBody) {
10177
+ return request(OpenAPI, {
10178
+ method: 'POST',
10179
+ url: '/metadata/bi/dashboards/{dashboard_id}/inprogress',
10180
+ path: {
10181
+ dashboard_id: dashboardId
10182
+ },
10183
+ headers: {
10184
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10185
+ },
10186
+ body: requestBody,
10187
+ mediaType: 'application/json',
10188
+ errors: {
10189
+ 400: `The provided data is not valid.`,
10190
+ 404: `The dashboard could not be found.`,
10191
+ 409: `Unable to update object because IDs are different.`,
10192
+ 422: `Unprocessable Entity`
10193
+ }
10055
10194
  });
10056
10195
  }
10057
10196
  /**
@@ -10065,28 +10204,28 @@ class DashboardsService {
10065
10204
  * @returns Error Default error response
10066
10205
  * @throws ApiError
10067
10206
  */
10068
- static putInProgressDashboard(dashboardId_1, requestBody_1) {
10069
- return __awaiter(this, arguments, void 0, function* (dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
10070
- const result = yield request({
10071
- method: 'PUT',
10072
- path: `/metadata/bi/dashboards/${dashboardId}/inprogress`,
10073
- headers: {
10074
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10075
- },
10076
- query: {
10077
- is_sync: isSync
10078
- },
10079
- body: requestBody,
10080
- mediaType: 'application/json',
10081
- errors: {
10082
- 400: `The provided data is not valid.`,
10083
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10084
- 404: `The dashboard could not be found.`,
10085
- 409: `Unable to update object because IDs are different.`,
10086
- 422: `Unprocessable Entity`
10087
- }
10088
- });
10089
- return result.body;
10207
+ static putInProgressDashboard(dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
10208
+ return request(OpenAPI, {
10209
+ method: 'PUT',
10210
+ url: '/metadata/bi/dashboards/{dashboard_id}/inprogress',
10211
+ path: {
10212
+ dashboard_id: dashboardId
10213
+ },
10214
+ headers: {
10215
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10216
+ },
10217
+ query: {
10218
+ is_sync: isSync
10219
+ },
10220
+ body: requestBody,
10221
+ mediaType: 'application/json',
10222
+ errors: {
10223
+ 400: `The provided data is not valid.`,
10224
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10225
+ 404: `The dashboard could not be found.`,
10226
+ 409: `Unable to update object because IDs are different.`,
10227
+ 422: `Unprocessable Entity`
10228
+ }
10090
10229
  });
10091
10230
  }
10092
10231
  /**
@@ -10100,28 +10239,28 @@ class DashboardsService {
10100
10239
  * @returns Error Default error response
10101
10240
  * @throws ApiError
10102
10241
  */
10103
- static patchInProgressDashboard(dashboardId_1, requestBody_1) {
10104
- return __awaiter(this, arguments, void 0, function* (dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
10105
- const result = yield request({
10106
- method: 'PATCH',
10107
- path: `/metadata/bi/dashboards/${dashboardId}/inprogress`,
10108
- headers: {
10109
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10110
- },
10111
- query: {
10112
- is_sync: isSync
10113
- },
10114
- body: requestBody,
10115
- mediaType: 'application/json',
10116
- errors: {
10117
- 400: `The provided data is not valid.`,
10118
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10119
- 404: `The dashboard could not be found.`,
10120
- 409: `Unable to update object because IDs are different.`,
10121
- 422: `Unprocessable Entity`
10122
- }
10123
- });
10124
- return result.body;
10242
+ static patchInProgressDashboard(dashboardId, requestBody, xDigitalaiAccountId = null, isSync = null) {
10243
+ return request(OpenAPI, {
10244
+ method: 'PATCH',
10245
+ url: '/metadata/bi/dashboards/{dashboard_id}/inprogress',
10246
+ path: {
10247
+ dashboard_id: dashboardId
10248
+ },
10249
+ headers: {
10250
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10251
+ },
10252
+ query: {
10253
+ is_sync: isSync
10254
+ },
10255
+ body: requestBody,
10256
+ mediaType: 'application/json',
10257
+ errors: {
10258
+ 400: `The provided data is not valid.`,
10259
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10260
+ 404: `The dashboard could not be found.`,
10261
+ 409: `Unable to update object because IDs are different.`,
10262
+ 422: `Unprocessable Entity`
10263
+ }
10125
10264
  });
10126
10265
  }
10127
10266
  /**
@@ -10133,22 +10272,22 @@ class DashboardsService {
10133
10272
  * @returns Error Default error response
10134
10273
  * @throws ApiError
10135
10274
  */
10136
- static deleteInProgressDashboard(dashboardId_1) {
10137
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null, publish = false) {
10138
- const result = yield request({
10139
- method: 'DELETE',
10140
- path: `/metadata/bi/dashboards/${dashboardId}/inprogress`,
10141
- headers: {
10142
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10143
- },
10144
- query: {
10145
- publish: publish
10146
- },
10147
- errors: {
10148
- 422: `Unprocessable Entity`
10149
- }
10150
- });
10151
- return result.body;
10275
+ static deleteInProgressDashboard(dashboardId, xDigitalaiAccountId = null, publish = false) {
10276
+ return request(OpenAPI, {
10277
+ method: 'DELETE',
10278
+ url: '/metadata/bi/dashboards/{dashboard_id}/inprogress',
10279
+ path: {
10280
+ dashboard_id: dashboardId
10281
+ },
10282
+ headers: {
10283
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10284
+ },
10285
+ query: {
10286
+ publish: publish
10287
+ },
10288
+ errors: {
10289
+ 422: `Unprocessable Entity`
10290
+ }
10152
10291
  });
10153
10292
  }
10154
10293
  /**
@@ -10161,23 +10300,23 @@ class DashboardsService {
10161
10300
  * @returns Error Default error response
10162
10301
  * @throws ApiError
10163
10302
  */
10164
- static copyDashboard(dashboardId_1) {
10165
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null, requestBody) {
10166
- const result = yield request({
10167
- method: 'POST',
10168
- path: `/metadata/bi/dashboards/${dashboardId}/copy`,
10169
- headers: {
10170
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10171
- },
10172
- body: requestBody,
10173
- mediaType: 'application/json',
10174
- errors: {
10175
- 400: `The provided data is not valid.`,
10176
- 404: `The dashboard could not be found.`,
10177
- 422: `Unprocessable Entity`
10178
- }
10179
- });
10180
- return result.body;
10303
+ static copyDashboard(dashboardId, xDigitalaiAccountId = null, requestBody) {
10304
+ return request(OpenAPI, {
10305
+ method: 'POST',
10306
+ url: '/metadata/bi/dashboards/{dashboard_id}/copy',
10307
+ path: {
10308
+ dashboard_id: dashboardId
10309
+ },
10310
+ headers: {
10311
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10312
+ },
10313
+ body: requestBody,
10314
+ mediaType: 'application/json',
10315
+ errors: {
10316
+ 400: `The provided data is not valid.`,
10317
+ 404: `The dashboard could not be found.`,
10318
+ 422: `Unprocessable Entity`
10319
+ }
10181
10320
  });
10182
10321
  }
10183
10322
  /**
@@ -10189,20 +10328,20 @@ class DashboardsService {
10189
10328
  * @returns Error Default error response
10190
10329
  * @throws ApiError
10191
10330
  */
10192
- static favoriteDashboard(dashboardId_1) {
10193
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null) {
10194
- const result = yield request({
10195
- method: 'POST',
10196
- path: `/metadata/bi/dashboards/${dashboardId}/favorite`,
10197
- headers: {
10198
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10199
- },
10200
- errors: {
10201
- 400: `The provided data is not valid.`,
10202
- 404: `The dashboard could not be found.`
10203
- }
10204
- });
10205
- return result.body;
10331
+ static favoriteDashboard(dashboardId, xDigitalaiAccountId = null) {
10332
+ return request(OpenAPI, {
10333
+ method: 'POST',
10334
+ url: '/metadata/bi/dashboards/{dashboard_id}/favorite',
10335
+ path: {
10336
+ dashboard_id: dashboardId
10337
+ },
10338
+ headers: {
10339
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10340
+ },
10341
+ errors: {
10342
+ 400: `The provided data is not valid.`,
10343
+ 404: `The dashboard could not be found.`
10344
+ }
10206
10345
  });
10207
10346
  }
10208
10347
  /**
@@ -10214,20 +10353,20 @@ class DashboardsService {
10214
10353
  * @returns Error Default error response
10215
10354
  * @throws ApiError
10216
10355
  */
10217
- static unfavoriteDashboard(dashboardId_1) {
10218
- return __awaiter(this, arguments, void 0, function* (dashboardId, xDigitalaiAccountId = null) {
10219
- const result = yield request({
10220
- method: 'DELETE',
10221
- path: `/metadata/bi/dashboards/${dashboardId}/favorite`,
10222
- headers: {
10223
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10224
- },
10225
- errors: {
10226
- 400: `The provided data is not valid.`,
10227
- 404: `The dashboard could not be found.`
10228
- }
10229
- });
10230
- return result.body;
10356
+ static unfavoriteDashboard(dashboardId, xDigitalaiAccountId = null) {
10357
+ return request(OpenAPI, {
10358
+ method: 'DELETE',
10359
+ url: '/metadata/bi/dashboards/{dashboard_id}/favorite',
10360
+ path: {
10361
+ dashboard_id: dashboardId
10362
+ },
10363
+ headers: {
10364
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10365
+ },
10366
+ errors: {
10367
+ 400: `The provided data is not valid.`,
10368
+ 404: `The dashboard could not be found.`
10369
+ }
10231
10370
  });
10232
10371
  }
10233
10372
  /**
@@ -10247,28 +10386,25 @@ class DashboardsService {
10247
10386
  * @returns Error Default error response
10248
10387
  * @throws ApiError
10249
10388
  */
10250
- static getDashboardsMetadata() {
10251
- return __awaiter(this, arguments, void 0, function* (xDigitalaiAccountId = null, filter, targetApp = null, biType = 'MICROSTRATEGY', isOotbDashboard = null, lifecycleState = null) {
10252
- const result = yield request({
10253
- method: 'GET',
10254
- path: `/metadata/bi/dashboards/metadata`,
10255
- headers: {
10256
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10257
- },
10258
- query: {
10259
- filter: filter,
10260
- target_app: targetApp,
10261
- bi_type: biType,
10262
- is_ootb_dashboard: isOotbDashboard,
10263
- lifecycle_state: lifecycleState
10264
- },
10265
- errors: {
10266
- 400: `Given query params are not valid.`,
10267
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10268
- 422: `Unprocessable Entity`
10269
- }
10270
- });
10271
- return result.body;
10389
+ static getDashboardsMetadata(xDigitalaiAccountId = null, filter, targetApp = null, biType = 'MICROSTRATEGY', isOotbDashboard = null, lifecycleState = null) {
10390
+ return request(OpenAPI, {
10391
+ method: 'GET',
10392
+ url: '/metadata/bi/dashboards/metadata',
10393
+ headers: {
10394
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10395
+ },
10396
+ query: {
10397
+ filter: filter,
10398
+ target_app: targetApp,
10399
+ bi_type: biType,
10400
+ is_ootb_dashboard: isOotbDashboard,
10401
+ lifecycle_state: lifecycleState
10402
+ },
10403
+ errors: {
10404
+ 400: `Given query params are not valid.`,
10405
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10406
+ 422: `Unprocessable Entity`
10407
+ }
10272
10408
  });
10273
10409
  }
10274
10410
  }
@@ -10282,47 +10418,42 @@ class HelpContentService {
10282
10418
  * @returns Error Default error response
10283
10419
  * @throws ApiError
10284
10420
  */
10285
- static getHelpContent() {
10286
- return __awaiter(this, arguments, void 0, function* (xDigitalaiAccountId = null) {
10287
- const result = yield request({
10288
- method: 'GET',
10289
- path: `/metadata/bi/helpcontent`,
10290
- headers: {
10291
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10292
- },
10293
- errors: {
10294
- 400: `An unknown parameter was specified.`,
10295
- 401: `Could not resolve a valid Tenant from the provided API Token.`
10296
- }
10297
- });
10298
- return result.body;
10421
+ static getHelpContent(xDigitalaiAccountId = null) {
10422
+ return request(OpenAPI, {
10423
+ method: 'GET',
10424
+ url: '/metadata/bi/helpcontent',
10425
+ headers: {
10426
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10427
+ },
10428
+ errors: {
10429
+ 400: `An unknown parameter was specified.`,
10430
+ 401: `Could not resolve a valid Tenant from the provided API Token.`
10431
+ }
10299
10432
  });
10300
10433
  }
10301
10434
  /**
10302
10435
  * Upload an HTML file to be displayed as help content.
10303
10436
  * Upload help content.
10304
- * @param requestBody
10437
+ * @param formData
10305
10438
  * @param xDigitalaiAccountId Perform the requested operation in the context of the Digital.ai account represented by this GUID. <em>Requires elevated permissions.</em>
10306
10439
  * @returns HelpContent Content uploaded.
10307
10440
  * @returns Error Default error response
10308
10441
  * @throws ApiError
10309
10442
  */
10310
- static createHelpContent(requestBody_1) {
10311
- return __awaiter(this, arguments, void 0, function* (requestBody, xDigitalaiAccountId = null) {
10312
- const result = yield request({
10313
- method: 'POST',
10314
- path: `/metadata/bi/helpcontent`,
10315
- headers: {
10316
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10317
- },
10318
- body: requestBody,
10319
- errors: {
10320
- 400: `The provided data is not valid.`,
10321
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10322
- 422: `Unprocessable Entity`
10323
- }
10324
- });
10325
- return result.body;
10443
+ static createHelpContent(formData, xDigitalaiAccountId = null) {
10444
+ return request(OpenAPI, {
10445
+ method: 'POST',
10446
+ url: '/metadata/bi/helpcontent',
10447
+ headers: {
10448
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10449
+ },
10450
+ formData: formData,
10451
+ mediaType: 'multipart/form-data',
10452
+ errors: {
10453
+ 400: `The provided data is not valid.`,
10454
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10455
+ 422: `Unprocessable Entity`
10456
+ }
10326
10457
  });
10327
10458
  }
10328
10459
  /**
@@ -10334,50 +10465,51 @@ class HelpContentService {
10334
10465
  * @returns Error Default error response
10335
10466
  * @throws ApiError
10336
10467
  */
10337
- static getHelpContentById(helpContentId_1) {
10338
- return __awaiter(this, arguments, void 0, function* (helpContentId, xDigitalaiAccountId = null) {
10339
- const result = yield request({
10340
- method: 'GET',
10341
- path: `/metadata/bi/helpcontent/${helpContentId}`,
10342
- headers: {
10343
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10344
- },
10345
- errors: {
10346
- 400: `An unknown parameter was specified.`,
10347
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10348
- 404: `The help content could not be found.`
10349
- }
10350
- });
10351
- return result.body;
10468
+ static getHelpContentById(helpContentId, xDigitalaiAccountId = null) {
10469
+ return request(OpenAPI, {
10470
+ method: 'GET',
10471
+ url: '/metadata/bi/helpcontent/{help_content_id}',
10472
+ path: {
10473
+ help_content_id: helpContentId
10474
+ },
10475
+ headers: {
10476
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10477
+ },
10478
+ errors: {
10479
+ 400: `An unknown parameter was specified.`,
10480
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10481
+ 404: `The help content could not be found.`
10482
+ }
10352
10483
  });
10353
10484
  }
10354
10485
  /**
10355
10486
  * Update a help content definition.
10356
10487
  * Update a single help content definition, selected by ID.
10357
10488
  * @param helpContentId
10358
- * @param requestBody
10489
+ * @param formData
10359
10490
  * @param xDigitalaiAccountId Perform the requested operation in the context of the Digital.ai account represented by this GUID. <em>Requires elevated permissions.</em>
10360
10491
  * @returns HelpContent OK
10361
10492
  * @returns Error Default error response
10362
10493
  * @throws ApiError
10363
10494
  */
10364
- static putHelpContentById(helpContentId_1, requestBody_1) {
10365
- return __awaiter(this, arguments, void 0, function* (helpContentId, requestBody, xDigitalaiAccountId = null) {
10366
- const result = yield request({
10367
- method: 'PUT',
10368
- path: `/metadata/bi/helpcontent/${helpContentId}`,
10369
- headers: {
10370
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10371
- },
10372
- body: requestBody,
10373
- errors: {
10374
- 400: `An unknown parameter was specified.`,
10375
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10376
- 404: `The help content could not be found.`,
10377
- 422: `Unprocessable Entity`
10378
- }
10379
- });
10380
- return result.body;
10495
+ static putHelpContentById(helpContentId, formData, xDigitalaiAccountId = null) {
10496
+ return request(OpenAPI, {
10497
+ method: 'PUT',
10498
+ url: '/metadata/bi/helpcontent/{help_content_id}',
10499
+ path: {
10500
+ help_content_id: helpContentId
10501
+ },
10502
+ headers: {
10503
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10504
+ },
10505
+ formData: formData,
10506
+ mediaType: 'multipart/form-data',
10507
+ errors: {
10508
+ 400: `An unknown parameter was specified.`,
10509
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10510
+ 404: `The help content could not be found.`,
10511
+ 422: `Unprocessable Entity`
10512
+ }
10381
10513
  });
10382
10514
  }
10383
10515
  /**
@@ -10388,21 +10520,21 @@ class HelpContentService {
10388
10520
  * @returns Error Default error response
10389
10521
  * @throws ApiError
10390
10522
  */
10391
- static deleteHelpContentById(helpContentId_1) {
10392
- return __awaiter(this, arguments, void 0, function* (helpContentId, xDigitalaiAccountId = null) {
10393
- const result = yield request({
10394
- method: 'DELETE',
10395
- path: `/metadata/bi/helpcontent/${helpContentId}`,
10396
- headers: {
10397
- 'X-Digitalai-Account-ID': xDigitalaiAccountId
10398
- },
10399
- errors: {
10400
- 400: `An unknown parameter was specified.`,
10401
- 401: `Could not resolve a valid Tenant from the provided API Token.`,
10402
- 404: `The help content could not be found.`
10403
- }
10404
- });
10405
- return result.body;
10523
+ static deleteHelpContentById(helpContentId, xDigitalaiAccountId = null) {
10524
+ return request(OpenAPI, {
10525
+ method: 'DELETE',
10526
+ url: '/metadata/bi/helpcontent/{help_content_id}',
10527
+ path: {
10528
+ help_content_id: helpContentId
10529
+ },
10530
+ headers: {
10531
+ 'X-Digitalai-Account-ID': xDigitalaiAccountId
10532
+ },
10533
+ errors: {
10534
+ 400: `An unknown parameter was specified.`,
10535
+ 401: `Could not resolve a valid Tenant from the provided API Token.`,
10536
+ 404: `The help content could not be found.`
10537
+ }
10406
10538
  });
10407
10539
  }
10408
10540
  }
@@ -10951,6 +11083,9 @@ const DotMetadataApiProvider = ({
10951
11083
  if (dashboard.in_progress_changes) {
10952
11084
  // If the dashboard is published and has in-progress changes, we need to update the in-progress dashboard
10953
11085
  response = yield DashboardsService.patchInProgressDashboard(dashboard.id, updatePayload, accountId, isSync);
11086
+ } else if (Object.keys(updatePayload).length === 1 && 'featured' in updatePayload) {
11087
+ // If the dashboard is published and only update is related to 'featured' flag, we can update the published dashboard directly
11088
+ response = yield DashboardsService.patchDashboard(dashboard.id, updatePayload, accountId, isSync);
10954
11089
  } else {
10955
11090
  // If the dashboard is published and has no in-progress changes, we need to create an in-progress dashboard
10956
11091
  response = yield DashboardsService.postInProgressDashboard(dashboard.id, accountId, updatePayload);
@@ -12808,6 +12943,7 @@ function DotDashboardOptionsMenu({
12808
12943
  currentUser,
12809
12944
  isEdit = false,
12810
12945
  menuPlacement,
12946
+ onFeature,
12811
12947
  onStartDelete,
12812
12948
  onStartDuplicate,
12813
12949
  onStartStatusChange,
@@ -12870,6 +13006,21 @@ function DotDashboardOptionsMenu({
12870
13006
  const isDraft = !dashboard.parent_id && dashboard.lifecycle_state === DashboardView.lifecycle_state.DRAFT;
12871
13007
  const isPublished = dashboard.parent_id || dashboard.lifecycle_state === DashboardView.lifecycle_state.PUBLISHED;
12872
13008
  const menuItems = [];
13009
+ if (onFeature && isPublished && !dashboard.in_progress_changes) {
13010
+ const label = dashboard.featured ? 'Remove from featured page' : 'Add to featured page';
13011
+ menuItems.push({
13012
+ children: jsx(DotButton, {
13013
+ "data-testid": `feature-dashboard-action-button-${dashboard.id}`,
13014
+ ariaLabel: label,
13015
+ type: "text",
13016
+ startIcon: jsx(DotIcon, {
13017
+ iconId: "add-outlined"
13018
+ }),
13019
+ children: label
13020
+ }, `feature-dashboard-action-button-${dashboard.id}`),
13021
+ key: 'feature'
13022
+ });
13023
+ }
12873
13024
  if (!isEdit && onViewMode && !dashboard.is_ootb_dashboard && !dashboardLocked(dashboard, currentUser)) {
12874
13025
  menuItems.push({
12875
13026
  children: jsx(DotButton, {
@@ -13067,6 +13218,9 @@ function DotDashboardOptionsMenu({
13067
13218
  case 'unpublish':
13068
13219
  onStartStatusChange(dashboard, DashboardView.lifecycle_state.DRAFT);
13069
13220
  break;
13221
+ case 'feature':
13222
+ onFeature(dashboard);
13223
+ break;
13070
13224
  }
13071
13225
  handleMenuClose();
13072
13226
  }, [menuItems, handleMenuClose]);