@sap/ux-ui5-tooling 1.6.0 → 1.6.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.
@@ -9723,354 +9723,6 @@ var i18next = new I18n();
9723
9723
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (i18next);
9724
9724
 
9725
9725
 
9726
- /***/ }),
9727
-
9728
- /***/ 77793:
9729
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9730
-
9731
- "use strict";
9732
-
9733
- Object.defineProperty(exports, "__esModule", ({ value: true }));
9734
- exports.UI5Config = void 0;
9735
- var ui5config_1 = __webpack_require__(14544);
9736
- Object.defineProperty(exports, "UI5Config", ({ enumerable: true, get: function () { return ui5config_1.UI5Config; } }));
9737
-
9738
-
9739
- /***/ }),
9740
-
9741
- /***/ 63775:
9742
- /***/ ((__unused_webpack_module, exports) => {
9743
-
9744
- "use strict";
9745
-
9746
- Object.defineProperty(exports, "__esModule", ({ value: true }));
9747
- exports.getMockServerMiddlewareConfig = exports.getFioriToolsProxyMiddlewareConfig = exports.getAppReloadMiddlewareConfig = void 0;
9748
- /**
9749
- * Get the configuration for the AppReload middleware.
9750
- *
9751
- * @returns {CustomMiddleware<FioriAppReloadConfig>} the configuration
9752
- */
9753
- function getAppReloadMiddlewareConfig() {
9754
- return {
9755
- name: 'fiori-tools-appreload',
9756
- afterMiddleware: 'compression',
9757
- configuration: {
9758
- port: 35729,
9759
- path: 'webapp',
9760
- delay: 300
9761
- }
9762
- };
9763
- }
9764
- exports.getAppReloadMiddlewareConfig = getAppReloadMiddlewareConfig;
9765
- /**
9766
- * Get the configuration for the Fiori tools middleware.
9767
- *
9768
- * @param backends configuration of backends
9769
- * @param ui5 UI5 configuration
9770
- * @returns {{config, comments}} configuration and comments
9771
- */
9772
- function getFioriToolsProxyMiddlewareConfig(backends, ui5) {
9773
- const fioriToolsProxy = {
9774
- name: 'fiori-tools-proxy',
9775
- afterMiddleware: 'compression',
9776
- configuration: {
9777
- ignoreCertError: false
9778
- }
9779
- };
9780
- const comments = [
9781
- {
9782
- path: 'configuration.ignoreCertError',
9783
- comment: ' If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted'
9784
- }
9785
- ];
9786
- if (backends && backends.length > 0) {
9787
- backends.forEach((element) => {
9788
- element.path = element.path || '/';
9789
- });
9790
- fioriToolsProxy.configuration.backend = backends;
9791
- }
9792
- if (ui5 !== undefined) {
9793
- fioriToolsProxy.configuration['ui5'] = {
9794
- path: ui5.path || ['/resources', '/test-resources'],
9795
- url: ui5.url || 'https://ui5.sap.com'
9796
- };
9797
- if (ui5.version) {
9798
- fioriToolsProxy.configuration['ui5'].version = ui5.version;
9799
- }
9800
- if (ui5.directLoad) {
9801
- fioriToolsProxy.configuration['ui5'].directLoad = true;
9802
- }
9803
- }
9804
- return { config: fioriToolsProxy, comments };
9805
- }
9806
- exports.getFioriToolsProxyMiddlewareConfig = getFioriToolsProxyMiddlewareConfig;
9807
- exports.getMockServerMiddlewareConfig = (path) => {
9808
- path = path === null || path === void 0 ? void 0 : path.replace(/\/$/, ''); // Mockserver is sensitive to trailing '/'
9809
- return {
9810
- name: 'sap-fe-mockserver',
9811
- beforeMiddleware: 'csp',
9812
- configuration: {
9813
- service: {
9814
- urlPath: path || '',
9815
- metadataXmlPath: './webapp/localService/metadata.xml',
9816
- mockdataRootPath: './webapp/localService/data',
9817
- generateMockData: true
9818
- }
9819
- }
9820
- };
9821
- };
9822
-
9823
-
9824
- /***/ }),
9825
-
9826
- /***/ 14544:
9827
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9828
-
9829
- "use strict";
9830
-
9831
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9832
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9833
- return new (P || (P = Promise))(function (resolve, reject) {
9834
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9835
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9836
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9837
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9838
- });
9839
- };
9840
- Object.defineProperty(exports, "__esModule", ({ value: true }));
9841
- exports.UI5Config = void 0;
9842
- const yaml_1 = __webpack_require__(55582);
9843
- const middlewares_1 = __webpack_require__(63775);
9844
- /**
9845
- * Represents a UI5 config file in yaml format (ui5(-*).yaml) with utility functions to manipulate the yaml document.
9846
- *
9847
- * @class UI5Config
9848
- */
9849
- class UI5Config {
9850
- /**
9851
- * Returns a new instance of UI5Config.
9852
- *
9853
- * @static
9854
- * @param {string} serializedYaml - the serialized yaml string
9855
- * @returns {UI5Config} the UI5Config instance
9856
- * @memberof UI5Config
9857
- */
9858
- static newInstance(serializedYaml) {
9859
- return __awaiter(this, void 0, void 0, function* () {
9860
- const instance = new UI5Config();
9861
- instance.document = yield yaml_1.YamlDocument.newInstance(serializedYaml);
9862
- return instance;
9863
- });
9864
- }
9865
- /**
9866
- * Tries reading the resources/configuration object from the config.
9867
- *
9868
- * @returns resources/configuration object from config or an empty object
9869
- * @memberof UI5Config
9870
- */
9871
- getConfiguration() {
9872
- var _a;
9873
- let resources;
9874
- try {
9875
- resources = this.document.getMap({ path: 'resources' }).toJSON();
9876
- }
9877
- catch (error) {
9878
- resources = {};
9879
- }
9880
- return (_a = resources.configuration) !== null && _a !== void 0 ? _a : {};
9881
- }
9882
- /**
9883
- * Adds or replaces the resources/configuration object in the config.
9884
- *
9885
- * @param config configuration object that is to be written to the config
9886
- * @returns {UI5Config} the UI5Config instance
9887
- * @memberof UI5Config
9888
- */
9889
- setConfiguration(config) {
9890
- this.document.setIn({
9891
- path: 'resources',
9892
- value: { configuration: config }
9893
- });
9894
- return this;
9895
- }
9896
- /**
9897
- * Adds a UI5 Framework entry to the yaml file.
9898
- *
9899
- * @param {string} ui5Framework - whether to user SAPUI5 or OpenUI5
9900
- * @param {string} ui5Version - ui5 version
9901
- * @param {string[]} ui5Libraries - a list of libraries
9902
- * @param {string} ui5Theme - optional ui5 theme
9903
- * @returns {UI5Config} the UI5Config instance
9904
- * @memberof UI5Config
9905
- */
9906
- addUI5Framework(ui5Framework, ui5Version, ui5Libraries, ui5Theme = 'sap_fiori_3') {
9907
- const libraryObjs = [];
9908
- for (const library of ui5Libraries) {
9909
- libraryObjs.push({ name: library });
9910
- }
9911
- // Add theme lib (dark theme versions are provided by base theme lib)
9912
- libraryObjs.push({ name: `themelib_${ui5Theme.replace(/_dark$/, '')}` });
9913
- this.document.setIn({
9914
- path: 'framework',
9915
- value: { name: ui5Framework, version: ui5Version, libraries: libraryObjs }
9916
- });
9917
- return this;
9918
- }
9919
- /**
9920
- * Adds a list of custom tasks to the config.
9921
- *
9922
- * @param {CustomTask<any>[]} tasks - the list of custom tasks
9923
- * @param {NodeComment<CustomMiddleware<any>>[]} comments - a list of comments
9924
- * @returns {UI5Config} the UI5Config instance
9925
- * @memberof UI5Config
9926
- */
9927
- addCustomTasks(tasks, comments) {
9928
- for (const task of tasks) {
9929
- this.document.appendTo({ path: 'builder.customTasks', value: task, comments });
9930
- }
9931
- return this;
9932
- }
9933
- /**
9934
- * Adds a list of custom middlewares to the config.
9935
- *
9936
- * @param {CustomMiddleware<any>[]} middlewares - the list of custom middlewares
9937
- * @param {NodeComment<CustomMiddleware<any>>[]} comments - a list of comments
9938
- * @returns {UI5Config} the UI5Config instance
9939
- * @memberof UI5Config
9940
- */
9941
- addCustomMiddleware(middlewares, comments) {
9942
- for (const mw of middlewares) {
9943
- this.document.appendTo({ path: 'server.customMiddleware', value: mw, comments });
9944
- }
9945
- return this;
9946
- }
9947
- /**
9948
- * Adds a instance of the Fiori tools app-reload middleware to the config.
9949
- *
9950
- * @returns {UI5Config} the UI5Config instance
9951
- * @memberof UI5Config
9952
- */
9953
- addFioriToolsAppReloadMiddleware() {
9954
- this.document.appendTo({
9955
- path: 'server.customMiddleware',
9956
- value: middlewares_1.getAppReloadMiddlewareConfig()
9957
- });
9958
- return this;
9959
- }
9960
- /**
9961
- * Adds a instance of the Fiori tools proxy middleware to the config.
9962
- *
9963
- * @param proxyConfig proxy configuration containing an optional array of backend and an option UI5 host configuration
9964
- * @returns {UI5Config} the UI5Config instance
9965
- * @memberof UI5Config
9966
- */
9967
- addFioriToolsProxydMiddleware(proxyConfig) {
9968
- const { config, comments } = middlewares_1.getFioriToolsProxyMiddlewareConfig(proxyConfig.backend, proxyConfig.ui5);
9969
- this.document.appendTo({
9970
- path: 'server.customMiddleware',
9971
- value: config,
9972
- comments: comments
9973
- });
9974
- return this;
9975
- }
9976
- /**
9977
- * Adds a backend configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.
9978
- *
9979
- * @param backend config of backend that is to be proxied
9980
- * @returns {UI5Config} the UI5Config instance
9981
- * @memberof UI5Config
9982
- */
9983
- addBackendToFioriToolsProxydMiddleware(backend) {
9984
- const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
9985
- const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === 'fiori-tools-proxy');
9986
- if (!proxyMiddleware) {
9987
- throw new Error('Could not find fiori-tools-proxy');
9988
- }
9989
- this.document.getMap({ start: proxyMiddleware, path: 'configuration' }).set('backend', [backend]);
9990
- return this;
9991
- }
9992
- /**
9993
- * Adds a ui configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.
9994
- *
9995
- * @param ui5 config of backend that is to be proxied
9996
- * @returns {UI5Config} the UI5Config instance
9997
- * @memberof UI5Config
9998
- */
9999
- addUi5ToFioriToolsProxydMiddleware(ui5) {
10000
- const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
10001
- const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === 'fiori-tools-proxy');
10002
- if (!proxyMiddleware) {
10003
- throw new Error('Could not find fiori-tools-proxy');
10004
- }
10005
- this.document.getMap({ start: proxyMiddleware, path: 'configuration' }).set('ui5', [ui5]);
10006
- return this;
10007
- }
10008
- /**
10009
- * Adds a instance of the mockserver middleware to the config.
10010
- *
10011
- * @param path option path that is to be mocked
10012
- * @returns {UI5Config} the UI5Config instance
10013
- * @memberof UI5Config
10014
- */
10015
- addMockServerMiddleware(path) {
10016
- this.document.appendTo({
10017
- path: 'server.customMiddleware',
10018
- value: middlewares_1.getMockServerMiddlewareConfig(path)
10019
- });
10020
- return this;
10021
- }
10022
- /**
10023
- * Adds the ABAP deployment task to the config.
10024
- *
10025
- * @param target system that this app is to be deployed to
10026
- * @param app application configuration for the deployment to ABAP
10027
- * @returns {UI5Config} the UI5Config instance
10028
- * @memberof UI5Config
10029
- */
10030
- addAbapDeployTask(target, app) {
10031
- this.document.appendTo({
10032
- path: 'builder.resources',
10033
- value: {
10034
- excludes: ['/test/**', '/localService/**']
10035
- }
10036
- });
10037
- this.document.appendTo({
10038
- path: 'builder.customTasks',
10039
- value: {
10040
- name: 'deploy-to-abap',
10041
- afterTask: 'generateCachebusterInfo',
10042
- configuration: { target, app }
10043
- }
10044
- });
10045
- return this;
10046
- }
10047
- /**
10048
- * Remove a middleware form the UI5 config.
10049
- *
10050
- * @param name name of the middleware that is to be removed
10051
- * @returns {UI5Config} the UI5Config instance
10052
- * @memberof UI5Config
10053
- */
10054
- removeCustomMiddleware(name) {
10055
- this.document.deleteAt({
10056
- path: 'server.customMiddleware',
10057
- matcher: { key: 'name', value: name }
10058
- });
10059
- return this;
10060
- }
10061
- /**
10062
- * Returns a string representation of the config.
10063
- *
10064
- * @returns {string} the string representation
10065
- * @memberof UI5Config
10066
- */
10067
- toString() {
10068
- return this.document.toString();
10069
- }
10070
- }
10071
- exports.UI5Config = UI5Config;
10072
-
10073
-
10074
9726
  /***/ }),
10075
9727
 
10076
9728
  /***/ 70277:
@@ -10188,7 +9840,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10188
9840
  };
10189
9841
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10190
9842
  exports.filterCompressedHtmlFiles = exports.injectScripts = exports.injectUI5Url = exports.resolveUI5Version = exports.getUI5VersionFromManifest = exports.getManifest = exports.setHtmlResponse = exports.getWebAppFolderFromYaml = exports.getYamlFile = exports.getHtmlFile = exports.isHostExcludedFromProxy = exports.hideProxyCredentials = exports.getCorporateProxyServer = exports.proxyRequestHandler = exports.proxyResponseHandler = void 0;
10191
- const ui5_config_1 = __webpack_require__(77793);
9843
+ const ui5_config_1 = __webpack_require__(20382);
10192
9844
  const fs_1 = __webpack_require__(57147);
10193
9845
  const path_1 = __webpack_require__(71017);
10194
9846
  const constants_1 = __webpack_require__(70277);
@@ -11112,6 +10764,354 @@ function getVSCodeInstance() {
11112
10764
  }
11113
10765
 
11114
10766
 
10767
+ /***/ }),
10768
+
10769
+ /***/ 20382:
10770
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10771
+
10772
+ "use strict";
10773
+
10774
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
10775
+ exports.UI5Config = void 0;
10776
+ var ui5config_1 = __webpack_require__(97615);
10777
+ Object.defineProperty(exports, "UI5Config", ({ enumerable: true, get: function () { return ui5config_1.UI5Config; } }));
10778
+
10779
+
10780
+ /***/ }),
10781
+
10782
+ /***/ 35356:
10783
+ /***/ ((__unused_webpack_module, exports) => {
10784
+
10785
+ "use strict";
10786
+
10787
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
10788
+ exports.getMockServerMiddlewareConfig = exports.getFioriToolsProxyMiddlewareConfig = exports.getAppReloadMiddlewareConfig = void 0;
10789
+ /**
10790
+ * Get the configuration for the AppReload middleware.
10791
+ *
10792
+ * @returns {CustomMiddleware<FioriAppReloadConfig>} the configuration
10793
+ */
10794
+ function getAppReloadMiddlewareConfig() {
10795
+ return {
10796
+ name: 'fiori-tools-appreload',
10797
+ afterMiddleware: 'compression',
10798
+ configuration: {
10799
+ port: 35729,
10800
+ path: 'webapp',
10801
+ delay: 300
10802
+ }
10803
+ };
10804
+ }
10805
+ exports.getAppReloadMiddlewareConfig = getAppReloadMiddlewareConfig;
10806
+ /**
10807
+ * Get the configuration for the Fiori tools middleware.
10808
+ *
10809
+ * @param backends configuration of backends
10810
+ * @param ui5 UI5 configuration
10811
+ * @returns {{config, comments}} configuration and comments
10812
+ */
10813
+ function getFioriToolsProxyMiddlewareConfig(backends, ui5) {
10814
+ const fioriToolsProxy = {
10815
+ name: 'fiori-tools-proxy',
10816
+ afterMiddleware: 'compression',
10817
+ configuration: {
10818
+ ignoreCertError: false
10819
+ }
10820
+ };
10821
+ const comments = [
10822
+ {
10823
+ path: 'configuration.ignoreCertError',
10824
+ comment: ' If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted'
10825
+ }
10826
+ ];
10827
+ if (backends && backends.length > 0) {
10828
+ backends.forEach((element) => {
10829
+ element.path = element.path || '/';
10830
+ });
10831
+ fioriToolsProxy.configuration.backend = backends;
10832
+ }
10833
+ if (ui5 !== undefined) {
10834
+ fioriToolsProxy.configuration['ui5'] = {
10835
+ path: ui5.path || ['/resources', '/test-resources'],
10836
+ url: ui5.url || 'https://ui5.sap.com'
10837
+ };
10838
+ if (ui5.version) {
10839
+ fioriToolsProxy.configuration['ui5'].version = ui5.version;
10840
+ }
10841
+ if (ui5.directLoad) {
10842
+ fioriToolsProxy.configuration['ui5'].directLoad = true;
10843
+ }
10844
+ }
10845
+ return { config: fioriToolsProxy, comments };
10846
+ }
10847
+ exports.getFioriToolsProxyMiddlewareConfig = getFioriToolsProxyMiddlewareConfig;
10848
+ exports.getMockServerMiddlewareConfig = (path) => {
10849
+ path = path === null || path === void 0 ? void 0 : path.replace(/\/$/, ''); // Mockserver is sensitive to trailing '/'
10850
+ return {
10851
+ name: 'sap-fe-mockserver',
10852
+ beforeMiddleware: 'csp',
10853
+ configuration: {
10854
+ service: {
10855
+ urlPath: path || '',
10856
+ metadataXmlPath: './webapp/localService/metadata.xml',
10857
+ mockdataRootPath: './webapp/localService/data',
10858
+ generateMockData: true
10859
+ }
10860
+ }
10861
+ };
10862
+ };
10863
+
10864
+
10865
+ /***/ }),
10866
+
10867
+ /***/ 97615:
10868
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10869
+
10870
+ "use strict";
10871
+
10872
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10873
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10874
+ return new (P || (P = Promise))(function (resolve, reject) {
10875
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10876
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10877
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10878
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10879
+ });
10880
+ };
10881
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
10882
+ exports.UI5Config = void 0;
10883
+ const yaml_1 = __webpack_require__(55582);
10884
+ const middlewares_1 = __webpack_require__(35356);
10885
+ /**
10886
+ * Represents a UI5 config file in yaml format (ui5(-*).yaml) with utility functions to manipulate the yaml document.
10887
+ *
10888
+ * @class UI5Config
10889
+ */
10890
+ class UI5Config {
10891
+ /**
10892
+ * Returns a new instance of UI5Config.
10893
+ *
10894
+ * @static
10895
+ * @param {string} serializedYaml - the serialized yaml string
10896
+ * @returns {UI5Config} the UI5Config instance
10897
+ * @memberof UI5Config
10898
+ */
10899
+ static newInstance(serializedYaml) {
10900
+ return __awaiter(this, void 0, void 0, function* () {
10901
+ const instance = new UI5Config();
10902
+ instance.document = yield yaml_1.YamlDocument.newInstance(serializedYaml);
10903
+ return instance;
10904
+ });
10905
+ }
10906
+ /**
10907
+ * Tries reading the resources/configuration object from the config.
10908
+ *
10909
+ * @returns resources/configuration object from config or an empty object
10910
+ * @memberof UI5Config
10911
+ */
10912
+ getConfiguration() {
10913
+ var _a;
10914
+ let resources;
10915
+ try {
10916
+ resources = this.document.getMap({ path: 'resources' }).toJSON();
10917
+ }
10918
+ catch (error) {
10919
+ resources = {};
10920
+ }
10921
+ return (_a = resources.configuration) !== null && _a !== void 0 ? _a : {};
10922
+ }
10923
+ /**
10924
+ * Adds or replaces the resources/configuration object in the config.
10925
+ *
10926
+ * @param config configuration object that is to be written to the config
10927
+ * @returns {UI5Config} the UI5Config instance
10928
+ * @memberof UI5Config
10929
+ */
10930
+ setConfiguration(config) {
10931
+ this.document.setIn({
10932
+ path: 'resources',
10933
+ value: { configuration: config }
10934
+ });
10935
+ return this;
10936
+ }
10937
+ /**
10938
+ * Adds a UI5 Framework entry to the yaml file.
10939
+ *
10940
+ * @param {string} ui5Framework - whether to user SAPUI5 or OpenUI5
10941
+ * @param {string} ui5Version - ui5 version
10942
+ * @param {string[]} ui5Libraries - a list of libraries
10943
+ * @param {string} ui5Theme - optional ui5 theme
10944
+ * @returns {UI5Config} the UI5Config instance
10945
+ * @memberof UI5Config
10946
+ */
10947
+ addUI5Framework(ui5Framework, ui5Version, ui5Libraries, ui5Theme = 'sap_fiori_3') {
10948
+ const libraryObjs = [];
10949
+ for (const library of ui5Libraries) {
10950
+ libraryObjs.push({ name: library });
10951
+ }
10952
+ // Add theme lib (dark theme versions are provided by base theme lib)
10953
+ libraryObjs.push({ name: `themelib_${ui5Theme.replace(/_dark$/, '')}` });
10954
+ this.document.setIn({
10955
+ path: 'framework',
10956
+ value: { name: ui5Framework, version: ui5Version, libraries: libraryObjs }
10957
+ });
10958
+ return this;
10959
+ }
10960
+ /**
10961
+ * Adds a list of custom tasks to the config.
10962
+ *
10963
+ * @param {CustomTask<any>[]} tasks - the list of custom tasks
10964
+ * @param {NodeComment<CustomMiddleware<any>>[]} comments - a list of comments
10965
+ * @returns {UI5Config} the UI5Config instance
10966
+ * @memberof UI5Config
10967
+ */
10968
+ addCustomTasks(tasks, comments) {
10969
+ for (const task of tasks) {
10970
+ this.document.appendTo({ path: 'builder.customTasks', value: task, comments });
10971
+ }
10972
+ return this;
10973
+ }
10974
+ /**
10975
+ * Adds a list of custom middlewares to the config.
10976
+ *
10977
+ * @param {CustomMiddleware<any>[]} middlewares - the list of custom middlewares
10978
+ * @param {NodeComment<CustomMiddleware<any>>[]} comments - a list of comments
10979
+ * @returns {UI5Config} the UI5Config instance
10980
+ * @memberof UI5Config
10981
+ */
10982
+ addCustomMiddleware(middlewares, comments) {
10983
+ for (const mw of middlewares) {
10984
+ this.document.appendTo({ path: 'server.customMiddleware', value: mw, comments });
10985
+ }
10986
+ return this;
10987
+ }
10988
+ /**
10989
+ * Adds a instance of the Fiori tools app-reload middleware to the config.
10990
+ *
10991
+ * @returns {UI5Config} the UI5Config instance
10992
+ * @memberof UI5Config
10993
+ */
10994
+ addFioriToolsAppReloadMiddleware() {
10995
+ this.document.appendTo({
10996
+ path: 'server.customMiddleware',
10997
+ value: middlewares_1.getAppReloadMiddlewareConfig()
10998
+ });
10999
+ return this;
11000
+ }
11001
+ /**
11002
+ * Adds a instance of the Fiori tools proxy middleware to the config.
11003
+ *
11004
+ * @param proxyConfig proxy configuration containing an optional array of backend and an option UI5 host configuration
11005
+ * @returns {UI5Config} the UI5Config instance
11006
+ * @memberof UI5Config
11007
+ */
11008
+ addFioriToolsProxydMiddleware(proxyConfig) {
11009
+ const { config, comments } = middlewares_1.getFioriToolsProxyMiddlewareConfig(proxyConfig.backend, proxyConfig.ui5);
11010
+ this.document.appendTo({
11011
+ path: 'server.customMiddleware',
11012
+ value: config,
11013
+ comments: comments
11014
+ });
11015
+ return this;
11016
+ }
11017
+ /**
11018
+ * Adds a backend configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.
11019
+ *
11020
+ * @param backend config of backend that is to be proxied
11021
+ * @returns {UI5Config} the UI5Config instance
11022
+ * @memberof UI5Config
11023
+ */
11024
+ addBackendToFioriToolsProxydMiddleware(backend) {
11025
+ const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
11026
+ const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === 'fiori-tools-proxy');
11027
+ if (!proxyMiddleware) {
11028
+ throw new Error('Could not find fiori-tools-proxy');
11029
+ }
11030
+ this.document.getMap({ start: proxyMiddleware, path: 'configuration' }).set('backend', [backend]);
11031
+ return this;
11032
+ }
11033
+ /**
11034
+ * Adds a ui configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.
11035
+ *
11036
+ * @param ui5 config of backend that is to be proxied
11037
+ * @returns {UI5Config} the UI5Config instance
11038
+ * @memberof UI5Config
11039
+ */
11040
+ addUi5ToFioriToolsProxydMiddleware(ui5) {
11041
+ const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
11042
+ const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === 'fiori-tools-proxy');
11043
+ if (!proxyMiddleware) {
11044
+ throw new Error('Could not find fiori-tools-proxy');
11045
+ }
11046
+ this.document.getMap({ start: proxyMiddleware, path: 'configuration' }).set('ui5', [ui5]);
11047
+ return this;
11048
+ }
11049
+ /**
11050
+ * Adds a instance of the mockserver middleware to the config.
11051
+ *
11052
+ * @param path option path that is to be mocked
11053
+ * @returns {UI5Config} the UI5Config instance
11054
+ * @memberof UI5Config
11055
+ */
11056
+ addMockServerMiddleware(path) {
11057
+ this.document.appendTo({
11058
+ path: 'server.customMiddleware',
11059
+ value: middlewares_1.getMockServerMiddlewareConfig(path)
11060
+ });
11061
+ return this;
11062
+ }
11063
+ /**
11064
+ * Adds the ABAP deployment task to the config.
11065
+ *
11066
+ * @param target system that this app is to be deployed to
11067
+ * @param app application configuration for the deployment to ABAP
11068
+ * @returns {UI5Config} the UI5Config instance
11069
+ * @memberof UI5Config
11070
+ */
11071
+ addAbapDeployTask(target, app) {
11072
+ this.document.appendTo({
11073
+ path: 'builder.resources',
11074
+ value: {
11075
+ excludes: ['/test/**', '/localService/**']
11076
+ }
11077
+ });
11078
+ this.document.appendTo({
11079
+ path: 'builder.customTasks',
11080
+ value: {
11081
+ name: 'deploy-to-abap',
11082
+ afterTask: 'generateCachebusterInfo',
11083
+ configuration: { target, app }
11084
+ }
11085
+ });
11086
+ return this;
11087
+ }
11088
+ /**
11089
+ * Remove a middleware form the UI5 config.
11090
+ *
11091
+ * @param name name of the middleware that is to be removed
11092
+ * @returns {UI5Config} the UI5Config instance
11093
+ * @memberof UI5Config
11094
+ */
11095
+ removeCustomMiddleware(name) {
11096
+ this.document.deleteAt({
11097
+ path: 'server.customMiddleware',
11098
+ matcher: { key: 'name', value: name }
11099
+ });
11100
+ return this;
11101
+ }
11102
+ /**
11103
+ * Returns a string representation of the config.
11104
+ *
11105
+ * @returns {string} the string representation
11106
+ * @memberof UI5Config
11107
+ */
11108
+ toString() {
11109
+ return this.document.toString();
11110
+ }
11111
+ }
11112
+ exports.UI5Config = UI5Config;
11113
+
11114
+
11115
11115
  /***/ }),
11116
11116
 
11117
11117
  /***/ 2505:
@@ -159009,8 +159009,7 @@ function prettyPrintMessage(msg, log, logData) {
159009
159009
  }
159010
159010
  exports.prettyPrintMessage = prettyPrintMessage;
159011
159011
  function printUrl(longtextUrl, frontendUrl, log) {
159012
- const fullLongTextUrl = frontendUrl.concat(longtextUrl);
159013
- log.info('Please copy and paste this link into your browser for more details : ');
159012
+ const fullLongTextUrl = frontendUrl.concat(longtextUrl).replace(/'/g, '%27'); // to make entire link clickable;
159014
159013
  log.info(fullLongTextUrl);
159015
159014
  }
159016
159015
  function logLevel(severity, msg, log, error = false) {
@@ -159171,16 +159170,19 @@ class ODataClient {
159171
159170
  * @param headers - axios headers (optional)
159172
159171
  */
159173
159172
  async get(path, headers) {
159174
- var _a, _b;
159173
+ var _a, _b, _c;
159175
159174
  const httpClient = await this.getClient();
159176
- let response;
159177
- if (headers === undefined) {
159178
- response = await httpClient.get(path);
159179
- }
159180
- else {
159181
- response = await httpClient.get(path, { headers });
159182
- }
159183
- if ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.d) {
159175
+ const response = await ((_a = httpClient
159176
+ .get(path, headers === undefined ? {} : { headers })) === null || _a === void 0 ? void 0 : _a.catch((error) => {
159177
+ var _a, _b, _c;
159178
+ if (((_a = error.request) === null || _a === void 0 ? void 0 : _a._isRedirect) && ((_c = (_b = error.request) === null || _b === void 0 ? void 0 : _b._options) === null || _c === void 0 ? void 0 : _c.path)) {
159179
+ return httpClient.get(error.request._options.path, headers === undefined ? {} : { headers });
159180
+ }
159181
+ else {
159182
+ throw error;
159183
+ }
159184
+ }));
159185
+ if ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.d) {
159184
159186
  if (response.data.d.results) {
159185
159187
  return response.data.d.results;
159186
159188
  }
@@ -159189,7 +159191,7 @@ class ODataClient {
159189
159191
  }
159190
159192
  }
159191
159193
  // Used for v4 Service Groups
159192
- if ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.value) {
159194
+ if ((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.value) {
159193
159195
  return response.data;
159194
159196
  }
159195
159197
  // Allow consumer to process
@@ -190183,7 +190185,7 @@ module.exports = JSON.parse('{"ERROR_SPECIFICATION_MISSING":"Seems specification
190183
190185
  /***/ ((module) => {
190184
190186
 
190185
190187
  "use strict";
190186
- module.exports = JSON.parse('{"name":"@sap/ux-telemetry","version":"1.6.0","description":"SAP Fiori tools telemetry library","main":"dist/src/index.js","author":"SAP SE","license":"MIT","private":true,"azureInstrumentationKey":"0a65e45d-6bf4-421d-b845-61e888c50e9e","azureProdKey":"0a65e45d-6bf4-421d-b845-61e888c50e9e","scripts":{"pre-commit":"lint-staged --quiet","clean":"rimraf ./dist","build":"ts-node ./build-script/ && yarn run clean && tsc --project ./","test":"jest --maxWorkers=1 --silent --ci --forceExit --detectOpenHandles","lint":"eslint . --ext .ts","lint:summary":"eslint . --ext .ts -f summary","lint:fix":"eslint --fix","lint:fix:all":"eslint . --ext .ts --fix","lint:report":"eslint . --ext .ts -f multiple ","format:fix":"prettier --write --loglevel silent --ignore-path ../../../.prettierignore","format:fix:all":"prettier --write \'**/*.{css,scss,html,js,json,ts,tsx,yaml,yml}\' \'!**/{out,dist,node_modules}/**\' \'!**/*.{svg,png,xml}\' --ignore-path ../../../.prettierignore","madge":"madge --warning --circular --extensions ts ./"},"dependencies":{"@sap-ux/store":"0.1.0","@sap/ux-cds":"1.6.0","@sap/ux-common-utils":"1.6.0","@sap/ux-feature-toggle":"1.6.0","@sap/ux-project-access":"1.6.0","applicationinsights":"1.4.1","performance-now":"2.1.0","yaml":"2.0.0-10"},"devDependencies":{"ts-node":"8.5.2","typescript":"3.8.3"},"files":["dist/"],"jestSonar":{"reportPath":"reports/test/unit","reportFile":"test-report.xml"},"eslint-formatter-multiple":{"formatters":[{"name":"stylish","output":"console"},{"name":"json","output":"file","path":"reports/lint/eslint.json"},{"name":"checkstyle","output":"file","path":"reports/lint/eslint.checkstyle.xml"}]}}');
190188
+ module.exports = JSON.parse('{"name":"@sap/ux-telemetry","version":"1.6.1","description":"SAP Fiori tools telemetry library","main":"dist/src/index.js","author":"SAP SE","license":"MIT","private":true,"azureInstrumentationKey":"0a65e45d-6bf4-421d-b845-61e888c50e9e","azureProdKey":"0a65e45d-6bf4-421d-b845-61e888c50e9e","scripts":{"pre-commit":"lint-staged --quiet","clean":"rimraf ./dist","build":"ts-node ./build-script/ && yarn run clean && tsc --project ./","test":"jest --maxWorkers=1 --silent --ci --forceExit --detectOpenHandles","lint":"eslint . --ext .ts","lint:summary":"eslint . --ext .ts -f summary","lint:fix":"eslint --fix","lint:fix:all":"eslint . --ext .ts --fix","lint:report":"eslint . --ext .ts -f multiple ","format:fix":"prettier --write --loglevel silent --ignore-path ../../../.prettierignore","format:fix:all":"prettier --write \'**/*.{css,scss,html,js,json,ts,tsx,yaml,yml}\' \'!**/{out,dist,node_modules}/**\' \'!**/*.{svg,png,xml}\' --ignore-path ../../../.prettierignore","madge":"madge --warning --circular --extensions ts ./"},"dependencies":{"@sap-ux/store":"0.1.0","@sap/ux-cds":"1.6.1","@sap/ux-common-utils":"1.6.1","@sap/ux-feature-toggle":"1.6.1","@sap/ux-project-access":"1.6.1","applicationinsights":"1.4.1","performance-now":"2.1.0","yaml":"2.0.0-10"},"devDependencies":{"ts-node":"8.5.2","typescript":"3.8.3"},"files":["dist/"],"jestSonar":{"reportPath":"reports/test/unit","reportFile":"test-report.xml"},"eslint-formatter-multiple":{"formatters":[{"name":"stylish","output":"console"},{"name":"json","output":"file","path":"reports/lint/eslint.json"},{"name":"checkstyle","output":"file","path":"reports/lint/eslint.checkstyle.xml"}]}}');
190187
190189
 
190188
190190
  /***/ }),
190189
190191