@sap/ux-ui5-tooling 1.7.1 → 1.7.3

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.
@@ -7457,35 +7457,41 @@ var require_browser = __commonJS({
7457
7457
  }
7458
7458
  });
7459
7459
 
7460
- // ../lib/store/node_modules/has-flag/index.js
7460
+ // ../../node_modules/has-flag/index.js
7461
7461
  var require_has_flag = __commonJS({
7462
- "../lib/store/node_modules/has-flag/index.js"(exports2, module2) {
7462
+ "../../node_modules/has-flag/index.js"(exports2, module2) {
7463
7463
  "use strict";
7464
- module2.exports = (flag, argv) => {
7465
- argv = argv || process.argv;
7464
+ module2.exports = (flag, argv = process.argv) => {
7466
7465
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7467
- const pos = argv.indexOf(prefix + flag);
7468
- const terminatorPos = argv.indexOf("--");
7469
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
7466
+ const position = argv.indexOf(prefix + flag);
7467
+ const terminatorPosition = argv.indexOf("--");
7468
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
7470
7469
  };
7471
7470
  }
7472
7471
  });
7473
7472
 
7474
- // ../lib/store/node_modules/supports-color/index.js
7473
+ // ../../node_modules/supports-color/index.js
7475
7474
  var require_supports_color = __commonJS({
7476
- "../lib/store/node_modules/supports-color/index.js"(exports2, module2) {
7475
+ "../../node_modules/supports-color/index.js"(exports2, module2) {
7477
7476
  "use strict";
7478
7477
  var os = require("os");
7478
+ var tty = require("tty");
7479
7479
  var hasFlag = require_has_flag();
7480
- var env = process.env;
7480
+ var { env } = process;
7481
7481
  var forceColor;
7482
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
7483
- forceColor = false;
7482
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
7483
+ forceColor = 0;
7484
7484
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
7485
- forceColor = true;
7485
+ forceColor = 1;
7486
7486
  }
7487
7487
  if ("FORCE_COLOR" in env) {
7488
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
7488
+ if (env.FORCE_COLOR === "true") {
7489
+ forceColor = 1;
7490
+ } else if (env.FORCE_COLOR === "false") {
7491
+ forceColor = 0;
7492
+ } else {
7493
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
7494
+ }
7489
7495
  }
7490
7496
  function translateLevel(level) {
7491
7497
  if (level === 0) {
@@ -7498,8 +7504,8 @@ var require_supports_color = __commonJS({
7498
7504
  has16m: level >= 3
7499
7505
  };
7500
7506
  }
7501
- function supportsColor(stream) {
7502
- if (forceColor === false) {
7507
+ function supportsColor(haveStream, streamIsTTY) {
7508
+ if (forceColor === 0) {
7503
7509
  return 0;
7504
7510
  }
7505
7511
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
@@ -7508,19 +7514,22 @@ var require_supports_color = __commonJS({
7508
7514
  if (hasFlag("color=256")) {
7509
7515
  return 2;
7510
7516
  }
7511
- if (stream && !stream.isTTY && forceColor !== true) {
7517
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
7512
7518
  return 0;
7513
7519
  }
7514
- const min = forceColor ? 1 : 0;
7520
+ const min = forceColor || 0;
7521
+ if (env.TERM === "dumb") {
7522
+ return min;
7523
+ }
7515
7524
  if (process.platform === "win32") {
7516
7525
  const osRelease = os.release().split(".");
7517
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7526
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7518
7527
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
7519
7528
  }
7520
7529
  return 1;
7521
7530
  }
7522
7531
  if ("CI" in env) {
7523
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
7532
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
7524
7533
  return 1;
7525
7534
  }
7526
7535
  return min;
@@ -7549,19 +7558,16 @@ var require_supports_color = __commonJS({
7549
7558
  if ("COLORTERM" in env) {
7550
7559
  return 1;
7551
7560
  }
7552
- if (env.TERM === "dumb") {
7553
- return min;
7554
- }
7555
7561
  return min;
7556
7562
  }
7557
7563
  function getSupportLevel(stream) {
7558
- const level = supportsColor(stream);
7564
+ const level = supportsColor(stream, stream && stream.isTTY);
7559
7565
  return translateLevel(level);
7560
7566
  }
7561
7567
  module2.exports = {
7562
7568
  supportsColor: getSupportLevel,
7563
- stdout: getSupportLevel(process.stdout),
7564
- stderr: getSupportLevel(process.stderr)
7569
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
7570
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
7565
7571
  };
7566
7572
  }
7567
7573
  });
@@ -10834,121 +10840,6 @@ var require_browser2 = __commonJS({
10834
10840
  }
10835
10841
  });
10836
10842
 
10837
- // ../../node_modules/has-flag/index.js
10838
- var require_has_flag2 = __commonJS({
10839
- "../../node_modules/has-flag/index.js"(exports2, module2) {
10840
- "use strict";
10841
- module2.exports = (flag, argv = process.argv) => {
10842
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
10843
- const position = argv.indexOf(prefix + flag);
10844
- const terminatorPosition = argv.indexOf("--");
10845
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
10846
- };
10847
- }
10848
- });
10849
-
10850
- // ../../node_modules/supports-color/index.js
10851
- var require_supports_color2 = __commonJS({
10852
- "../../node_modules/supports-color/index.js"(exports2, module2) {
10853
- "use strict";
10854
- var os = require("os");
10855
- var tty = require("tty");
10856
- var hasFlag = require_has_flag2();
10857
- var { env } = process;
10858
- var forceColor;
10859
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
10860
- forceColor = 0;
10861
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
10862
- forceColor = 1;
10863
- }
10864
- if ("FORCE_COLOR" in env) {
10865
- if (env.FORCE_COLOR === "true") {
10866
- forceColor = 1;
10867
- } else if (env.FORCE_COLOR === "false") {
10868
- forceColor = 0;
10869
- } else {
10870
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
10871
- }
10872
- }
10873
- function translateLevel(level) {
10874
- if (level === 0) {
10875
- return false;
10876
- }
10877
- return {
10878
- level,
10879
- hasBasic: true,
10880
- has256: level >= 2,
10881
- has16m: level >= 3
10882
- };
10883
- }
10884
- function supportsColor(haveStream, streamIsTTY) {
10885
- if (forceColor === 0) {
10886
- return 0;
10887
- }
10888
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
10889
- return 3;
10890
- }
10891
- if (hasFlag("color=256")) {
10892
- return 2;
10893
- }
10894
- if (haveStream && !streamIsTTY && forceColor === void 0) {
10895
- return 0;
10896
- }
10897
- const min = forceColor || 0;
10898
- if (env.TERM === "dumb") {
10899
- return min;
10900
- }
10901
- if (process.platform === "win32") {
10902
- const osRelease = os.release().split(".");
10903
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
10904
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
10905
- }
10906
- return 1;
10907
- }
10908
- if ("CI" in env) {
10909
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
10910
- return 1;
10911
- }
10912
- return min;
10913
- }
10914
- if ("TEAMCITY_VERSION" in env) {
10915
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
10916
- }
10917
- if (env.COLORTERM === "truecolor") {
10918
- return 3;
10919
- }
10920
- if ("TERM_PROGRAM" in env) {
10921
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
10922
- switch (env.TERM_PROGRAM) {
10923
- case "iTerm.app":
10924
- return version >= 3 ? 3 : 2;
10925
- case "Apple_Terminal":
10926
- return 2;
10927
- }
10928
- }
10929
- if (/-256(color)?$/i.test(env.TERM)) {
10930
- return 2;
10931
- }
10932
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
10933
- return 1;
10934
- }
10935
- if ("COLORTERM" in env) {
10936
- return 1;
10937
- }
10938
- return min;
10939
- }
10940
- function getSupportLevel(stream) {
10941
- const level = supportsColor(stream, stream && stream.isTTY);
10942
- return translateLevel(level);
10943
- }
10944
- module2.exports = {
10945
- supportsColor: getSupportLevel,
10946
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
10947
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
10948
- };
10949
- }
10950
- });
10951
-
10952
10843
  // ../../node_modules/debug/src/node.js
10953
10844
  var require_node2 = __commonJS({
10954
10845
  "../../node_modules/debug/src/node.js"(exports2, module2) {
@@ -10962,7 +10853,7 @@ var require_node2 = __commonJS({
10962
10853
  exports2.useColors = useColors;
10963
10854
  exports2.colors = [6, 2, 3, 4, 5, 1];
10964
10855
  try {
10965
- const supportsColor = require_supports_color2();
10856
+ const supportsColor = require_supports_color();
10966
10857
  if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
10967
10858
  exports2.colors = [
10968
10859
  20,
@@ -29857,7 +29748,7 @@ var require_source = __commonJS({
29857
29748
  "../../node_modules/chalk/source/index.js"(exports2, module2) {
29858
29749
  "use strict";
29859
29750
  var ansiStyles = require_ansi_styles();
29860
- var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color2();
29751
+ var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
29861
29752
  var {
29862
29753
  stringReplaceAll,
29863
29754
  stringEncaseCRLFWithFirstIndex
@@ -61361,7 +61252,7 @@ var require_package5 = __commonJS({
61361
61252
  "../lib/telemetry/dist/package.json"(exports2, module2) {
61362
61253
  module2.exports = {
61363
61254
  name: "@sap/ux-telemetry",
61364
- version: "1.7.1",
61255
+ version: "1.7.3",
61365
61256
  description: "SAP Fiori tools telemetry library",
61366
61257
  main: "dist/src/index.js",
61367
61258
  author: "SAP SE",
@@ -61386,10 +61277,10 @@ var require_package5 = __commonJS({
61386
61277
  },
61387
61278
  dependencies: {
61388
61279
  "@sap-ux/store": "0.3.0",
61389
- "@sap/ux-cds": "1.7.1",
61390
- "@sap/ux-common-utils": "1.7.1",
61391
- "@sap/ux-feature-toggle": "1.7.1",
61392
- "@sap/ux-project-access": "1.7.1",
61280
+ "@sap/ux-cds": "1.7.3",
61281
+ "@sap/ux-common-utils": "1.7.3",
61282
+ "@sap/ux-feature-toggle": "1.7.3",
61283
+ "@sap/ux-project-access": "1.7.3",
61393
61284
  applicationinsights: "1.4.1",
61394
61285
  "performance-now": "2.1.0",
61395
61286
  yaml: "2.0.0-10"
@@ -67816,10 +67707,36 @@ var require_yamlFile = __commonJS({
67816
67707
  }
67817
67708
  exports2.readUi5YamlConfig = readUi5YamlConfig;
67818
67709
  async function getParsedUi5YamlConfig(dirPath, filename) {
67710
+ var _a2;
67819
67711
  const contents = await readUi5YamlConfig(dirPath, filename);
67820
67712
  if (contents) {
67821
67713
  try {
67822
- return yaml.parse(contents);
67714
+ const parsed = yaml.parse(contents);
67715
+ if (((_a2 = parsed == null ? void 0 : parsed.server) == null ? void 0 : _a2.customMiddleware) && Array.isArray(parsed.server.customMiddleware)) {
67716
+ for (const middleware of parsed.server.customMiddleware) {
67717
+ const configuration = middleware == null ? void 0 : middleware.configuration;
67718
+ const services = [];
67719
+ if (Array.isArray(configuration == null ? void 0 : configuration.service)) {
67720
+ services.push(...configuration.service);
67721
+ } else if (configuration == null ? void 0 : configuration.service) {
67722
+ services.push(configuration.service);
67723
+ }
67724
+ if (Array.isArray(configuration == null ? void 0 : configuration.services)) {
67725
+ services.push(...configuration.services);
67726
+ } else if (configuration == null ? void 0 : configuration.services) {
67727
+ services.push(configuration.services);
67728
+ }
67729
+ for (const service of services) {
67730
+ if (service.mockdataRootPath) {
67731
+ service.mockdataPath = service.mockdataRootPath;
67732
+ }
67733
+ if (service.metadataXmlPath) {
67734
+ service.metadataPath = service.metadataXmlPath;
67735
+ }
67736
+ }
67737
+ }
67738
+ }
67739
+ return parsed;
67823
67740
  } catch (e) {
67824
67741
  throw new Error(i18n_1.i18n.t("ERROR_UI5_YAML_PARSING", { filePath: path_1.join(dirPath, filename), parsingError: e.message }));
67825
67742
  }
@@ -67907,10 +67824,10 @@ var require_mockServer = __commonJS({
67907
67824
  }
67908
67825
  return (services == null ? void 0 : services.length) ? services : null;
67909
67826
  }
67910
- function matchMockServiceByMetadataPath(mockService, metadataPath) {
67911
- const { metadataXmlPath } = mockService;
67912
- if (metadataXmlPath) {
67913
- return metadataPath.endsWith(path_1.normalize(metadataXmlPath));
67827
+ function matchMockServiceByMetadataPath(mockService, path3) {
67828
+ const { metadataPath } = mockService;
67829
+ if (metadataPath) {
67830
+ return path3.endsWith(path_1.normalize(metadataPath));
67914
67831
  }
67915
67832
  return false;
67916
67833
  }
@@ -68697,9 +68614,9 @@ var require_utils9 = __commonJS({
68697
68614
  const { services, mockFolder } = await ui5Config_1.getMockServicesConfiguration(configDir, config2);
68698
68615
  if (services) {
68699
68616
  const mockService = ui5Config_1.findMockServiceByMetadataPath(services, serviceMetadataPath);
68700
- if (mockService == null ? void 0 : mockService.mockdataRootPath) {
68617
+ if (mockService == null ? void 0 : mockService.mockdataPath) {
68701
68618
  const servicesConfigFilePath = mockFolder ? path_1.resolve(configDir, mockFolder) : configDir;
68702
- return path_1.resolve(servicesConfigFilePath, mockService.mockdataRootPath);
68619
+ return path_1.resolve(servicesConfigFilePath, mockService.mockdataPath);
68703
68620
  }
68704
68621
  }
68705
68622
  }
@@ -68713,6 +68630,11 @@ var require_types4 = __commonJS({
68713
68630
  "../lib/telemetry/dist/src/toolsSuiteTelemetry/types.js"(exports2) {
68714
68631
  "use strict";
68715
68632
  Object.defineProperty(exports2, "__esModule", { value: true });
68633
+ var ToolsId;
68634
+ (function(ToolsId2) {
68635
+ ToolsId2["UNKNOWN"] = "UNKNOWN";
68636
+ ToolsId2["NO_TOOLS_ID"] = "NO_TOOLS_ID";
68637
+ })(ToolsId = exports2.ToolsId || (exports2.ToolsId = {}));
68716
68638
  var ODataSource;
68717
68639
  (function(ODataSource2) {
68718
68640
  ODataSource2["CAPJava"] = "CAPJava";
@@ -68737,6 +68659,7 @@ var require_types4 = __commonJS({
68737
68659
  CommonProperties2["TemplateType"] = "cmn.template";
68738
68660
  CommonProperties2["DeployTargetType"] = "cmn.deployTarget";
68739
68661
  CommonProperties2["ODataSourceType"] = "cmn.odataSource";
68662
+ CommonProperties2["AppToolsId"] = "cmn.toolsId";
68740
68663
  })(CommonProperties = exports2.CommonProperties || (exports2.CommonProperties = {}));
68741
68664
  }
68742
68665
  });
@@ -68932,10 +68855,12 @@ var require_toolsSuiteTelemetryDataProcessor = __commonJS({
68932
68855
  const templateType = await getTemplateType(appPath);
68933
68856
  const deployTarget = await getDeployTarget(appPath);
68934
68857
  const odataSource = await getODataSource(appPath);
68858
+ const toolsId = await getToolsId(appPath);
68935
68859
  const output3 = {};
68936
68860
  output3[types_1.CommonProperties.TemplateType] = templateType;
68937
68861
  output3[types_1.CommonProperties.DeployTargetType] = deployTarget;
68938
68862
  output3[types_1.CommonProperties.ODataSourceType] = odataSource;
68863
+ output3[types_1.CommonProperties.AppToolsId] = toolsId;
68939
68864
  return output3;
68940
68865
  }
68941
68866
  async function getTemplateType(appPath) {
@@ -69020,6 +68945,20 @@ var require_toolsSuiteTelemetryDataProcessor = __commonJS({
69020
68945
  function getInternalVsExternal() {
69021
68946
  return ux_feature_toggle_1.isInternalFeaturesSettingEnabled() ? "internal" : "external";
69022
68947
  }
68948
+ async function getToolsId(appPath) {
68949
+ var _a2, _b, _c;
68950
+ try {
68951
+ const manifestPath = path_1.default.join(appPath, "webapp", "manifest.json");
68952
+ if (fs_1.default.existsSync(manifestPath)) {
68953
+ const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, "utf-8"));
68954
+ return (_c = (_b = (_a2 = manifest["sap.app"]) == null ? void 0 : _a2.sourceTemplate) == null ? void 0 : _b.toolsId) != null ? _c : types_1.ToolsId.NO_TOOLS_ID;
68955
+ }
68956
+ return types_1.ToolsId.NO_TOOLS_ID;
68957
+ } catch (err) {
68958
+ console.log(`[Telemetry]: ${err.message}`);
68959
+ return types_1.ToolsId.NO_TOOLS_ID;
68960
+ }
68961
+ }
69023
68962
  }
69024
68963
  });
69025
68964
 
@@ -74754,7 +74693,7 @@ var require_styles = __commonJS({
74754
74693
  });
74755
74694
 
74756
74695
  // ../../node_modules/@colors/colors/lib/system/has-flag.js
74757
- var require_has_flag3 = __commonJS({
74696
+ var require_has_flag2 = __commonJS({
74758
74697
  "../../node_modules/@colors/colors/lib/system/has-flag.js"(exports2, module2) {
74759
74698
  "use strict";
74760
74699
  module2.exports = function(flag, argv) {
@@ -74772,7 +74711,7 @@ var require_supports_colors = __commonJS({
74772
74711
  "../../node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
74773
74712
  "use strict";
74774
74713
  var os = require("os");
74775
- var hasFlag = require_has_flag3();
74714
+ var hasFlag = require_has_flag2();
74776
74715
  var env = process.env;
74777
74716
  var forceColor = void 0;
74778
74717
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
@@ -89316,7 +89255,7 @@ var require_source2 = __commonJS({
89316
89255
  "../../node_modules/@sap-ux/store/node_modules/chalk/source/index.js"(exports2, module2) {
89317
89256
  "use strict";
89318
89257
  var ansiStyles = require_ansi_styles();
89319
- var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color2();
89258
+ var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
89320
89259
  var {
89321
89260
  stringReplaceAll,
89322
89261
  stringEncaseCRLFWithFirstIndex