@sap-ux/cf-deploy-config-inquirer 0.3.13 → 0.3.15

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.
@@ -7,6 +7,7 @@ exports.validateAbapService = validateAbapService;
7
7
  const i18n_1 = require("../i18n");
8
8
  const fs_1 = require("fs");
9
9
  const path_1 = require("path");
10
+ const project_input_validator_1 = require("@sap-ux/project-input-validator");
10
11
  /**
11
12
  *
12
13
  * @param input The input string to check for emptiness.
@@ -79,15 +80,22 @@ function validateMtaId(input, previousAnswers) {
79
80
  return (0, i18n_1.t)('errors.noMtaIdError');
80
81
  }
81
82
  if (input.length > 100) {
82
- return (0, i18n_1.t)('errors.invalidMtaIdError');
83
+ return (0, i18n_1.t)('errors.mtaIdLengthError');
83
84
  }
84
- const idPattern = /^[a-zA-Z_]+[a-zA-Z0-9_\-.]*$/;
85
+ // The MTA ID must start with a letter (a–z, A–Z). After the first character, any combination of letters, numbers, underscores (_), hyphens (-), or dots (.) is allowed.
86
+ const idPattern = /^[a-zA-Z][a-zA-Z0-9_\-.]*$/;
85
87
  if (!idPattern.exec(input)) {
86
88
  return (0, i18n_1.t)('errors.invalidMtaIdError');
87
89
  }
88
90
  if ((0, fs_1.existsSync)((0, path_1.join)(previousAnswers.mtaPath, input.trim()))) {
89
91
  return (0, i18n_1.t)('errors.mtaIdAlreadyExistError', { mtaPath: previousAnswers.mtaPath });
90
92
  }
93
+ const mtaPath = previousAnswers.mtaPath || '';
94
+ // Windows path length validation
95
+ const winPathResult = (0, project_input_validator_1.validateWindowsPathLength)((0, path_1.join)(mtaPath, input), (0, i18n_1.t)('error.windowsMtaIdPathTooLong'));
96
+ if (winPathResult !== true) {
97
+ return winPathResult;
98
+ }
91
99
  // All checks passed
92
100
  return true;
93
101
  }
@@ -34,10 +34,12 @@
34
34
  "destinationNameLengthError": "Destination name cannot contain more than 200 characters",
35
35
  "folderDoesNotExistError": "Folder path does not exist: {{- filePath}}",
36
36
  "noMtaIdError": "MTA ID cannot be empty",
37
- "invalidMtaIdError": "The ID can only contain letters, numbers, dashes, periods and underscores (but no spaces).",
38
- "mtaIdAlreadyExistError": "A folder with same name already exist at {{- mtaPath}}",
39
- "abapEnvsUnavailable": "ABAP environments unavailable",
40
- "errorScpAbapSourceDiscoveryCheckLog": "Check the Application Wizard console output view for details."
37
+ "mtaIdLengthError": "The MTA ID must not exceed 100 characters.",
38
+ "invalidMtaIdError": "The MTA ID must only contain letters, numbers, dashes, periods, and underscores. It cannot contain spaces or begin with a number.",
39
+ "mtaIdAlreadyExistError": "A folder with the same name already exists at {{- mtaPath}}",
40
+ "abapEnvsUnavailable": "ABAP environments are unavailable",
41
+ "errorScpAbapSourceDiscoveryCheckLog": "Check the Application Wizard console output view for details.",
42
+ "windowsMtaIdPathTooLong": "The combined length {{length}} of the MTA ID and MTA path exceeds the default Windows paths length. This may cause issues with MTA project generation."
41
43
  },
42
44
  "warning": {
43
45
  "btpDestinationListWarning": "BTP destinations are only retrieved on BAS.",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/cf-deploy-config-inquirer",
3
3
  "description": "Prompts module that can provide prompts for cf deployment config writer",
4
- "version": "0.3.13",
4
+ "version": "0.3.15",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -29,7 +29,8 @@
29
29
  "@sap-devx/yeoman-ui-types": "1.14.4",
30
30
  "@types/inquirer-autocomplete-prompt": "2.0.1",
31
31
  "@types/inquirer": "8.2.6",
32
- "inquirer": "8.2.6"
32
+ "inquirer": "8.2.6",
33
+ "@sap-ux/project-input-validator": "0.6.3"
33
34
  },
34
35
  "engines": {
35
36
  "node": ">=20.x"