@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.
@@ -8503,35 +8503,41 @@ var require_browser = __commonJS({
8503
8503
  }
8504
8504
  });
8505
8505
 
8506
- // ../lib/store/node_modules/has-flag/index.js
8506
+ // ../../node_modules/has-flag/index.js
8507
8507
  var require_has_flag = __commonJS({
8508
- "../lib/store/node_modules/has-flag/index.js"(exports2, module2) {
8508
+ "../../node_modules/has-flag/index.js"(exports2, module2) {
8509
8509
  "use strict";
8510
- module2.exports = (flag, argv) => {
8511
- argv = argv || process.argv;
8510
+ module2.exports = (flag, argv = process.argv) => {
8512
8511
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
8513
- const pos = argv.indexOf(prefix + flag);
8514
- const terminatorPos = argv.indexOf("--");
8515
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
8512
+ const position = argv.indexOf(prefix + flag);
8513
+ const terminatorPosition = argv.indexOf("--");
8514
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
8516
8515
  };
8517
8516
  }
8518
8517
  });
8519
8518
 
8520
- // ../lib/store/node_modules/supports-color/index.js
8519
+ // ../../node_modules/supports-color/index.js
8521
8520
  var require_supports_color = __commonJS({
8522
- "../lib/store/node_modules/supports-color/index.js"(exports2, module2) {
8521
+ "../../node_modules/supports-color/index.js"(exports2, module2) {
8523
8522
  "use strict";
8524
8523
  var os = require("os");
8524
+ var tty = require("tty");
8525
8525
  var hasFlag = require_has_flag();
8526
- var env = process.env;
8526
+ var { env } = process;
8527
8527
  var forceColor;
8528
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
8529
- forceColor = false;
8528
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
8529
+ forceColor = 0;
8530
8530
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
8531
- forceColor = true;
8531
+ forceColor = 1;
8532
8532
  }
8533
8533
  if ("FORCE_COLOR" in env) {
8534
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
8534
+ if (env.FORCE_COLOR === "true") {
8535
+ forceColor = 1;
8536
+ } else if (env.FORCE_COLOR === "false") {
8537
+ forceColor = 0;
8538
+ } else {
8539
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
8540
+ }
8535
8541
  }
8536
8542
  function translateLevel(level) {
8537
8543
  if (level === 0) {
@@ -8544,8 +8550,8 @@ var require_supports_color = __commonJS({
8544
8550
  has16m: level >= 3
8545
8551
  };
8546
8552
  }
8547
- function supportsColor(stream) {
8548
- if (forceColor === false) {
8553
+ function supportsColor(haveStream, streamIsTTY) {
8554
+ if (forceColor === 0) {
8549
8555
  return 0;
8550
8556
  }
8551
8557
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
@@ -8554,19 +8560,22 @@ var require_supports_color = __commonJS({
8554
8560
  if (hasFlag("color=256")) {
8555
8561
  return 2;
8556
8562
  }
8557
- if (stream && !stream.isTTY && forceColor !== true) {
8563
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
8558
8564
  return 0;
8559
8565
  }
8560
- const min = forceColor ? 1 : 0;
8566
+ const min = forceColor || 0;
8567
+ if (env.TERM === "dumb") {
8568
+ return min;
8569
+ }
8561
8570
  if (process.platform === "win32") {
8562
8571
  const osRelease = os.release().split(".");
8563
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
8572
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
8564
8573
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
8565
8574
  }
8566
8575
  return 1;
8567
8576
  }
8568
8577
  if ("CI" in env) {
8569
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
8578
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
8570
8579
  return 1;
8571
8580
  }
8572
8581
  return min;
@@ -8595,19 +8604,16 @@ var require_supports_color = __commonJS({
8595
8604
  if ("COLORTERM" in env) {
8596
8605
  return 1;
8597
8606
  }
8598
- if (env.TERM === "dumb") {
8599
- return min;
8600
- }
8601
8607
  return min;
8602
8608
  }
8603
8609
  function getSupportLevel(stream) {
8604
- const level = supportsColor(stream);
8610
+ const level = supportsColor(stream, stream && stream.isTTY);
8605
8611
  return translateLevel(level);
8606
8612
  }
8607
8613
  module2.exports = {
8608
8614
  supportsColor: getSupportLevel,
8609
- stdout: getSupportLevel(process.stdout),
8610
- stderr: getSupportLevel(process.stderr)
8615
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
8616
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
8611
8617
  };
8612
8618
  }
8613
8619
  });
@@ -11999,121 +12005,6 @@ var require_browser2 = __commonJS({
11999
12005
  }
12000
12006
  });
12001
12007
 
12002
- // ../../node_modules/has-flag/index.js
12003
- var require_has_flag2 = __commonJS({
12004
- "../../node_modules/has-flag/index.js"(exports2, module2) {
12005
- "use strict";
12006
- module2.exports = (flag, argv = process.argv) => {
12007
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
12008
- const position = argv.indexOf(prefix + flag);
12009
- const terminatorPosition = argv.indexOf("--");
12010
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
12011
- };
12012
- }
12013
- });
12014
-
12015
- // ../../node_modules/supports-color/index.js
12016
- var require_supports_color2 = __commonJS({
12017
- "../../node_modules/supports-color/index.js"(exports2, module2) {
12018
- "use strict";
12019
- var os = require("os");
12020
- var tty = require("tty");
12021
- var hasFlag = require_has_flag2();
12022
- var { env } = process;
12023
- var forceColor;
12024
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
12025
- forceColor = 0;
12026
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
12027
- forceColor = 1;
12028
- }
12029
- if ("FORCE_COLOR" in env) {
12030
- if (env.FORCE_COLOR === "true") {
12031
- forceColor = 1;
12032
- } else if (env.FORCE_COLOR === "false") {
12033
- forceColor = 0;
12034
- } else {
12035
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
12036
- }
12037
- }
12038
- function translateLevel(level) {
12039
- if (level === 0) {
12040
- return false;
12041
- }
12042
- return {
12043
- level,
12044
- hasBasic: true,
12045
- has256: level >= 2,
12046
- has16m: level >= 3
12047
- };
12048
- }
12049
- function supportsColor(haveStream, streamIsTTY) {
12050
- if (forceColor === 0) {
12051
- return 0;
12052
- }
12053
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
12054
- return 3;
12055
- }
12056
- if (hasFlag("color=256")) {
12057
- return 2;
12058
- }
12059
- if (haveStream && !streamIsTTY && forceColor === void 0) {
12060
- return 0;
12061
- }
12062
- const min = forceColor || 0;
12063
- if (env.TERM === "dumb") {
12064
- return min;
12065
- }
12066
- if (process.platform === "win32") {
12067
- const osRelease = os.release().split(".");
12068
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
12069
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
12070
- }
12071
- return 1;
12072
- }
12073
- if ("CI" in env) {
12074
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
12075
- return 1;
12076
- }
12077
- return min;
12078
- }
12079
- if ("TEAMCITY_VERSION" in env) {
12080
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
12081
- }
12082
- if (env.COLORTERM === "truecolor") {
12083
- return 3;
12084
- }
12085
- if ("TERM_PROGRAM" in env) {
12086
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
12087
- switch (env.TERM_PROGRAM) {
12088
- case "iTerm.app":
12089
- return version >= 3 ? 3 : 2;
12090
- case "Apple_Terminal":
12091
- return 2;
12092
- }
12093
- }
12094
- if (/-256(color)?$/i.test(env.TERM)) {
12095
- return 2;
12096
- }
12097
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
12098
- return 1;
12099
- }
12100
- if ("COLORTERM" in env) {
12101
- return 1;
12102
- }
12103
- return min;
12104
- }
12105
- function getSupportLevel(stream) {
12106
- const level = supportsColor(stream, stream && stream.isTTY);
12107
- return translateLevel(level);
12108
- }
12109
- module2.exports = {
12110
- supportsColor: getSupportLevel,
12111
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
12112
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
12113
- };
12114
- }
12115
- });
12116
-
12117
12008
  // ../../node_modules/debug/src/node.js
12118
12009
  var require_node2 = __commonJS({
12119
12010
  "../../node_modules/debug/src/node.js"(exports2, module2) {
@@ -12127,7 +12018,7 @@ var require_node2 = __commonJS({
12127
12018
  exports2.useColors = useColors;
12128
12019
  exports2.colors = [6, 2, 3, 4, 5, 1];
12129
12020
  try {
12130
- const supportsColor = require_supports_color2();
12021
+ const supportsColor = require_supports_color();
12131
12022
  if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
12132
12023
  exports2.colors = [
12133
12024
  20,
@@ -31022,7 +30913,7 @@ var require_source = __commonJS({
31022
30913
  "../../node_modules/chalk/source/index.js"(exports2, module2) {
31023
30914
  "use strict";
31024
30915
  var ansiStyles = require_ansi_styles();
31025
- var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color2();
30916
+ var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
31026
30917
  var {
31027
30918
  stringReplaceAll,
31028
30919
  stringEncaseCRLFWithFirstIndex
@@ -51900,7 +51791,7 @@ var require_package6 = __commonJS({
51900
51791
  "../lib/telemetry/dist/package.json"(exports2, module2) {
51901
51792
  module2.exports = {
51902
51793
  name: "@sap/ux-telemetry",
51903
- version: "1.7.1",
51794
+ version: "1.7.3",
51904
51795
  description: "SAP Fiori tools telemetry library",
51905
51796
  main: "dist/src/index.js",
51906
51797
  author: "SAP SE",
@@ -51925,10 +51816,10 @@ var require_package6 = __commonJS({
51925
51816
  },
51926
51817
  dependencies: {
51927
51818
  "@sap-ux/store": "0.3.0",
51928
- "@sap/ux-cds": "1.7.1",
51929
- "@sap/ux-common-utils": "1.7.1",
51930
- "@sap/ux-feature-toggle": "1.7.1",
51931
- "@sap/ux-project-access": "1.7.1",
51819
+ "@sap/ux-cds": "1.7.3",
51820
+ "@sap/ux-common-utils": "1.7.3",
51821
+ "@sap/ux-feature-toggle": "1.7.3",
51822
+ "@sap/ux-project-access": "1.7.3",
51932
51823
  applicationinsights: "1.4.1",
51933
51824
  "performance-now": "2.1.0",
51934
51825
  yaml: "2.0.0-10"
@@ -58355,10 +58246,36 @@ var require_yamlFile = __commonJS({
58355
58246
  }
58356
58247
  exports2.readUi5YamlConfig = readUi5YamlConfig;
58357
58248
  async function getParsedUi5YamlConfig(dirPath, filename) {
58249
+ var _a2;
58358
58250
  const contents = await readUi5YamlConfig(dirPath, filename);
58359
58251
  if (contents) {
58360
58252
  try {
58361
- return yaml.parse(contents);
58253
+ const parsed = yaml.parse(contents);
58254
+ if (((_a2 = parsed == null ? void 0 : parsed.server) == null ? void 0 : _a2.customMiddleware) && Array.isArray(parsed.server.customMiddleware)) {
58255
+ for (const middleware of parsed.server.customMiddleware) {
58256
+ const configuration = middleware == null ? void 0 : middleware.configuration;
58257
+ const services = [];
58258
+ if (Array.isArray(configuration == null ? void 0 : configuration.service)) {
58259
+ services.push(...configuration.service);
58260
+ } else if (configuration == null ? void 0 : configuration.service) {
58261
+ services.push(configuration.service);
58262
+ }
58263
+ if (Array.isArray(configuration == null ? void 0 : configuration.services)) {
58264
+ services.push(...configuration.services);
58265
+ } else if (configuration == null ? void 0 : configuration.services) {
58266
+ services.push(configuration.services);
58267
+ }
58268
+ for (const service of services) {
58269
+ if (service.mockdataRootPath) {
58270
+ service.mockdataPath = service.mockdataRootPath;
58271
+ }
58272
+ if (service.metadataXmlPath) {
58273
+ service.metadataPath = service.metadataXmlPath;
58274
+ }
58275
+ }
58276
+ }
58277
+ }
58278
+ return parsed;
58362
58279
  } catch (e) {
58363
58280
  throw new Error(i18n_1.i18n.t("ERROR_UI5_YAML_PARSING", { filePath: path_1.join(dirPath, filename), parsingError: e.message }));
58364
58281
  }
@@ -58446,10 +58363,10 @@ var require_mockServer = __commonJS({
58446
58363
  }
58447
58364
  return (services == null ? void 0 : services.length) ? services : null;
58448
58365
  }
58449
- function matchMockServiceByMetadataPath(mockService, metadataPath) {
58450
- const { metadataXmlPath } = mockService;
58451
- if (metadataXmlPath) {
58452
- return metadataPath.endsWith(path_1.normalize(metadataXmlPath));
58366
+ function matchMockServiceByMetadataPath(mockService, path) {
58367
+ const { metadataPath } = mockService;
58368
+ if (metadataPath) {
58369
+ return path.endsWith(path_1.normalize(metadataPath));
58453
58370
  }
58454
58371
  return false;
58455
58372
  }
@@ -59236,9 +59153,9 @@ var require_utils10 = __commonJS({
59236
59153
  const { services, mockFolder } = await ui5Config_1.getMockServicesConfiguration(configDir, config2);
59237
59154
  if (services) {
59238
59155
  const mockService = ui5Config_1.findMockServiceByMetadataPath(services, serviceMetadataPath);
59239
- if (mockService == null ? void 0 : mockService.mockdataRootPath) {
59156
+ if (mockService == null ? void 0 : mockService.mockdataPath) {
59240
59157
  const servicesConfigFilePath = mockFolder ? path_1.resolve(configDir, mockFolder) : configDir;
59241
- return path_1.resolve(servicesConfigFilePath, mockService.mockdataRootPath);
59158
+ return path_1.resolve(servicesConfigFilePath, mockService.mockdataPath);
59242
59159
  }
59243
59160
  }
59244
59161
  }
@@ -59252,6 +59169,11 @@ var require_types5 = __commonJS({
59252
59169
  "../lib/telemetry/dist/src/toolsSuiteTelemetry/types.js"(exports2) {
59253
59170
  "use strict";
59254
59171
  Object.defineProperty(exports2, "__esModule", { value: true });
59172
+ var ToolsId;
59173
+ (function(ToolsId2) {
59174
+ ToolsId2["UNKNOWN"] = "UNKNOWN";
59175
+ ToolsId2["NO_TOOLS_ID"] = "NO_TOOLS_ID";
59176
+ })(ToolsId = exports2.ToolsId || (exports2.ToolsId = {}));
59255
59177
  var ODataSource;
59256
59178
  (function(ODataSource2) {
59257
59179
  ODataSource2["CAPJava"] = "CAPJava";
@@ -59276,6 +59198,7 @@ var require_types5 = __commonJS({
59276
59198
  CommonProperties2["TemplateType"] = "cmn.template";
59277
59199
  CommonProperties2["DeployTargetType"] = "cmn.deployTarget";
59278
59200
  CommonProperties2["ODataSourceType"] = "cmn.odataSource";
59201
+ CommonProperties2["AppToolsId"] = "cmn.toolsId";
59279
59202
  })(CommonProperties = exports2.CommonProperties || (exports2.CommonProperties = {}));
59280
59203
  }
59281
59204
  });
@@ -59471,10 +59394,12 @@ var require_toolsSuiteTelemetryDataProcessor = __commonJS({
59471
59394
  const templateType = await getTemplateType(appPath);
59472
59395
  const deployTarget = await getDeployTarget(appPath);
59473
59396
  const odataSource = await getODataSource(appPath);
59397
+ const toolsId = await getToolsId(appPath);
59474
59398
  const output3 = {};
59475
59399
  output3[types_1.CommonProperties.TemplateType] = templateType;
59476
59400
  output3[types_1.CommonProperties.DeployTargetType] = deployTarget;
59477
59401
  output3[types_1.CommonProperties.ODataSourceType] = odataSource;
59402
+ output3[types_1.CommonProperties.AppToolsId] = toolsId;
59478
59403
  return output3;
59479
59404
  }
59480
59405
  async function getTemplateType(appPath) {
@@ -59559,6 +59484,20 @@ var require_toolsSuiteTelemetryDataProcessor = __commonJS({
59559
59484
  function getInternalVsExternal() {
59560
59485
  return ux_feature_toggle_1.isInternalFeaturesSettingEnabled() ? "internal" : "external";
59561
59486
  }
59487
+ async function getToolsId(appPath) {
59488
+ var _a2, _b, _c;
59489
+ try {
59490
+ const manifestPath = path_1.default.join(appPath, "webapp", "manifest.json");
59491
+ if (fs_1.default.existsSync(manifestPath)) {
59492
+ const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, "utf-8"));
59493
+ 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;
59494
+ }
59495
+ return types_1.ToolsId.NO_TOOLS_ID;
59496
+ } catch (err) {
59497
+ console.log(`[Telemetry]: ${err.message}`);
59498
+ return types_1.ToolsId.NO_TOOLS_ID;
59499
+ }
59500
+ }
59562
59501
  }
59563
59502
  });
59564
59503
 
@@ -65293,7 +65232,7 @@ var require_styles = __commonJS({
65293
65232
  });
65294
65233
 
65295
65234
  // ../../node_modules/@colors/colors/lib/system/has-flag.js
65296
- var require_has_flag3 = __commonJS({
65235
+ var require_has_flag2 = __commonJS({
65297
65236
  "../../node_modules/@colors/colors/lib/system/has-flag.js"(exports2, module2) {
65298
65237
  "use strict";
65299
65238
  module2.exports = function(flag, argv) {
@@ -65311,7 +65250,7 @@ var require_supports_colors = __commonJS({
65311
65250
  "../../node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
65312
65251
  "use strict";
65313
65252
  var os = require("os");
65314
- var hasFlag = require_has_flag3();
65253
+ var hasFlag = require_has_flag2();
65315
65254
  var env = process.env;
65316
65255
  var forceColor = void 0;
65317
65256
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
@@ -79954,7 +79893,7 @@ var require_source2 = __commonJS({
79954
79893
  "../../node_modules/@sap-ux/store/node_modules/chalk/source/index.js"(exports2, module2) {
79955
79894
  "use strict";
79956
79895
  var ansiStyles = require_ansi_styles();
79957
- var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color2();
79896
+ var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
79958
79897
  var {
79959
79898
  stringReplaceAll,
79960
79899
  stringEncaseCRLFWithFirstIndex