@sap-ux/generator-adp 1.2.2 → 1.3.0
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.
- package/generators/app/headless/cf.js +2 -2
- package/generators/app/index.js +7 -5
- package/generators/app/questions/cf-services.js +2 -2
- package/generators/app/questions/configuration.js +17 -7
- package/generators/app/questions/helper/validators.d.ts +0 -36
- package/generators/app/questions/helper/validators.js +0 -94
- package/generators/app/questions/target-env.js +2 -2
- package/generators/translations/generator-adp.i18n.json +3 -3
- package/package.json +8 -8
|
@@ -26,12 +26,12 @@ const validators_js_1 = require("../questions/helper/validators.js");
|
|
|
26
26
|
* @returns {string} The resolved absolute project path.
|
|
27
27
|
*/
|
|
28
28
|
function resolveCfProjectPath(mtaMode, targetFolder, logger, cfConfig, mtaId) {
|
|
29
|
-
(0, validators_js_1.assertValidationPassed)((0,
|
|
29
|
+
(0, validators_js_1.assertValidationPassed)((0, adp_tooling_1.validateProjectPath)(targetFolder, logger, mtaMode, cfConfig));
|
|
30
30
|
if (mtaMode === types_js_1.MtaMode.New) {
|
|
31
31
|
if (!mtaId) {
|
|
32
32
|
throw new Error((0, i18n_js_1.t)('error.mtaIdRequired'));
|
|
33
33
|
}
|
|
34
|
-
(0, validators_js_1.assertValidationPassed)((0,
|
|
34
|
+
(0, validators_js_1.assertValidationPassed)((0, adp_tooling_1.validateMtaId)(mtaId, targetFolder));
|
|
35
35
|
return (0, node_path_1.join)(targetFolder, mtaId);
|
|
36
36
|
}
|
|
37
37
|
return node_fs_1.default.realpathSync(targetFolder, 'utf-8');
|
package/generators/app/index.js
CHANGED
|
@@ -514,9 +514,11 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
514
514
|
this.isCfEnv = this.targetEnv === types_js_1.TargetEnv.CF;
|
|
515
515
|
this.logger.info(`Target environment: ${this.targetEnv}`);
|
|
516
516
|
(0, steps_js_1.updateCfWizardSteps)(this.isCfEnv, this.prompts);
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
517
|
+
if (this.targetEnv === 'CF') {
|
|
518
|
+
this.logger.log(`Project organization information: ${JSON.stringify(this.cfConfig.org, null, 2)}`);
|
|
519
|
+
this.logger.log(`Project space information: ${JSON.stringify(this.cfConfig.space, null, 2)}`);
|
|
520
|
+
this.logger.log(`Project apiUrl information: ${JSON.stringify(this.cfConfig.url, null, 2)}`);
|
|
521
|
+
}
|
|
520
522
|
}
|
|
521
523
|
/**
|
|
522
524
|
* Prompts the user for the CF environment.
|
|
@@ -726,7 +728,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
726
728
|
selectedProjectType = axios_extension_1.AdaptationProjectType.CLOUD_READY;
|
|
727
729
|
}
|
|
728
730
|
this.projectType = selectedProjectType;
|
|
729
|
-
const applications = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, supportedProject);
|
|
731
|
+
const applications = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, supportedProject, this.logger);
|
|
730
732
|
this.telemetryCollector.setBatch({ numberOfApplications: applications.length });
|
|
731
733
|
const application = applications.find((application) => application.id === baseApplicationName);
|
|
732
734
|
if (!application) {
|
|
@@ -776,7 +778,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
776
778
|
let businessSolution = businessSolutionName?.trim() ?? '';
|
|
777
779
|
if (resolvedApprouter === adp_tooling_1.AppRouterType.MANAGED && !(0, cf_js_1.hasExistingApprouter)(mtaMode, projectPath)) {
|
|
778
780
|
if (businessSolution) {
|
|
779
|
-
(0, validators_js_1.assertValidationPassed)((0,
|
|
781
|
+
(0, validators_js_1.assertValidationPassed)((0, adp_tooling_1.validateBusinessSolutionName)(businessSolution));
|
|
780
782
|
}
|
|
781
783
|
else {
|
|
782
784
|
businessSolution = (0, default_values_js_1.generateBusinessSolutionName)();
|
|
@@ -5,7 +5,6 @@ const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
|
5
5
|
const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
|
|
6
6
|
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
7
7
|
const i18n_js_1 = require("../../utils/i18n.js");
|
|
8
|
-
const validators_js_1 = require("./helper/validators.js");
|
|
9
8
|
const choices_js_1 = require("./helper/choices.js");
|
|
10
9
|
const conditions_js_1 = require("./helper/conditions.js");
|
|
11
10
|
/**
|
|
@@ -263,7 +262,7 @@ class CFServicesPrompter {
|
|
|
263
262
|
answers.serviceInstance?.name ||
|
|
264
263
|
this.reachableBusinessService ||
|
|
265
264
|
this.serviceInstances[0]?.name),
|
|
266
|
-
validate: (value) => (0,
|
|
265
|
+
validate: (value) => (0, adp_tooling_1.validateBusinessSolutionName)(value),
|
|
267
266
|
guiOptions: {
|
|
268
267
|
mandatory: true,
|
|
269
268
|
hint: (0, i18n_js_1.t)('prompts.businessSolutionNameTooltip'),
|
|
@@ -486,6 +485,7 @@ class CFServicesPrompter {
|
|
|
486
485
|
// The picker is FDC-filtered to services with adaptable apps, so an empty app list or a
|
|
487
486
|
// discovery failure here is a real error: the writer needs the selected base app's manifest.
|
|
488
487
|
try {
|
|
488
|
+
this.logger.info(`Getting CF apps for business service: ${instance.name}`);
|
|
489
489
|
this.apps = await (0, adp_tooling_1.getCfApps)(this.businessServiceInfo.serviceKeys, cfConfig, this.logger);
|
|
490
490
|
this.logger?.log(`Available applications: ${JSON.stringify(this.apps)}`);
|
|
491
491
|
if (this.apps.length === 0) {
|
|
@@ -582,7 +582,7 @@ class ConfigPrompter {
|
|
|
582
582
|
}
|
|
583
583
|
if (this.selectedProjectType === axios_extension_1.AdaptationProjectType.CLOUD_READY) {
|
|
584
584
|
try {
|
|
585
|
-
this.baseApplicationInbounds = await (0, adp_tooling_1.getBaseAppInbounds)(app.id, this.provider);
|
|
585
|
+
this.baseApplicationInbounds = await (0, adp_tooling_1.getBaseAppInbounds)(app.id, this.provider, this.logger);
|
|
586
586
|
}
|
|
587
587
|
catch (error) {
|
|
588
588
|
return (0, i18n_js_1.t)('error.fetchBaseInboundsFailed', { error: error.message });
|
|
@@ -622,7 +622,7 @@ class ConfigPrompter {
|
|
|
622
622
|
return validationResult;
|
|
623
623
|
}
|
|
624
624
|
this.telemetryCollector.startTiming('applicationListLoadingTime');
|
|
625
|
-
this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.supportedProject);
|
|
625
|
+
this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.supportedProject, this.logger);
|
|
626
626
|
this.telemetryCollector.setBatch({ numberOfApplications: this.targetApps.length });
|
|
627
627
|
this.telemetryCollector.endTiming('applicationListLoadingTime');
|
|
628
628
|
this.isLoginSuccessful = true;
|
|
@@ -677,7 +677,7 @@ class ConfigPrompter {
|
|
|
677
677
|
return validationResult;
|
|
678
678
|
}
|
|
679
679
|
this.telemetryCollector.startTiming('applicationListLoadingTime');
|
|
680
|
-
this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.supportedProject);
|
|
680
|
+
this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.supportedProject, this.logger);
|
|
681
681
|
this.telemetryCollector.setBatch({ numberOfApplications: this.targetApps.length });
|
|
682
682
|
this.telemetryCollector.endTiming('applicationListLoadingTime');
|
|
683
683
|
return true;
|
|
@@ -693,6 +693,7 @@ class ConfigPrompter {
|
|
|
693
693
|
* @returns {Promise<boolean | string>} True if the application is valid, otherwise an error message.
|
|
694
694
|
*/
|
|
695
695
|
async validateAppData(app) {
|
|
696
|
+
this.logger.debug(`Validating application data for app with id: ${app.id}`);
|
|
696
697
|
try {
|
|
697
698
|
// Reset the flag when we are selecting a new application from the list.
|
|
698
699
|
this.isApplicationSupported = false;
|
|
@@ -706,7 +707,7 @@ class ConfigPrompter {
|
|
|
706
707
|
this.isApplicationSupported = true;
|
|
707
708
|
}
|
|
708
709
|
catch (e) {
|
|
709
|
-
this.logger.debug(`Application failed
|
|
710
|
+
this.logger.debug(`Application validation failed. Reason: ${e.message}`);
|
|
710
711
|
return e.message;
|
|
711
712
|
}
|
|
712
713
|
return true;
|
|
@@ -727,13 +728,16 @@ class ConfigPrompter {
|
|
|
727
728
|
* @returns A promise that resolves when system data is fetched.
|
|
728
729
|
*/
|
|
729
730
|
async loadSystemData() {
|
|
731
|
+
this.logger.info(`Try to load system data.`);
|
|
730
732
|
try {
|
|
731
733
|
// Do not include the ato settings retreival in the parallel calls because we need to first login
|
|
732
734
|
// before executing any other call. A provider works like this - with the first api call it authenticates the user.
|
|
735
|
+
this.logger.info(`Try to determine system type.`);
|
|
733
736
|
this.selectedSystemType = (await this.provider.isAbapCloud()) ? types_js_1.SystemType.CLOUD_READY : types_js_1.SystemType.ON_PREM;
|
|
737
|
+
this.logger.info(`selectedSystemType: ${this.selectedSystemType}`);
|
|
734
738
|
const [supportedProject, flexUICapability] = await Promise.all([
|
|
735
|
-
(0, adp_tooling_1.getSupportedProject)(this.abapProvider),
|
|
736
|
-
(0, adp_tooling_1.getFlexUICapability)(this.abapProvider, this.isCustomerBase)
|
|
739
|
+
(0, adp_tooling_1.getSupportedProject)(this.abapProvider, this.logger),
|
|
740
|
+
(0, adp_tooling_1.getFlexUICapability)(this.abapProvider, this.isCustomerBase, this.logger)
|
|
737
741
|
]);
|
|
738
742
|
this.supportedProject = supportedProject;
|
|
739
743
|
this.flexUICapability = flexUICapability;
|
|
@@ -760,8 +764,10 @@ class ConfigPrompter {
|
|
|
760
764
|
*/
|
|
761
765
|
async loadUI5Versions() {
|
|
762
766
|
let version;
|
|
767
|
+
this.logger.info(`Try to loadUI5Versions.`);
|
|
763
768
|
try {
|
|
764
769
|
version = await (0, adp_tooling_1.getSystemUI5Version)(this.abapProvider, this.logger);
|
|
770
|
+
this.logger.info(`version: ${version}`);
|
|
765
771
|
}
|
|
766
772
|
catch (error) {
|
|
767
773
|
this.logger.debug(`Could not fetch the system UI5 version: ${error.message}.`);
|
|
@@ -776,6 +782,7 @@ class ConfigPrompter {
|
|
|
776
782
|
* @returns {Promise<boolean | string>} True if successful, or an error message if an error occurs.
|
|
777
783
|
*/
|
|
778
784
|
async handleSystemDataValidation() {
|
|
785
|
+
this.logger.info(`Starting system validation.`);
|
|
779
786
|
try {
|
|
780
787
|
await this.loadSystemData();
|
|
781
788
|
await this.loadUI5Versions();
|
|
@@ -785,7 +792,10 @@ class ConfigPrompter {
|
|
|
785
792
|
return true;
|
|
786
793
|
}
|
|
787
794
|
catch (e) {
|
|
788
|
-
|
|
795
|
+
if ((0, axios_extension_1.isAxiosError)(e) && e.config) {
|
|
796
|
+
this.logger.error(`Failed for request URL: ${e.config.url}`);
|
|
797
|
+
}
|
|
798
|
+
this.logger.error(`Validating system failed. Reason: ${e.message}`);
|
|
789
799
|
return e.message;
|
|
790
800
|
}
|
|
791
801
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
1
|
import type { CfConfig, SystemLookup } from '@sap-ux/adp-tooling';
|
|
3
|
-
import { MtaMode } from '../../types.js';
|
|
4
2
|
interface JsonInputParams {
|
|
5
3
|
projectName: string;
|
|
6
4
|
targetFolder: string;
|
|
@@ -51,33 +49,6 @@ export declare function validateJsonInput(systemLookup: SystemLookup, isCustomer
|
|
|
51
49
|
* @returns {Promise<string | boolean>} Returns true if the environment is valid, otherwise returns an error message.
|
|
52
50
|
*/
|
|
53
51
|
export declare function validateEnvironment(value: string, isCFLoggedIn: boolean, cfConfig?: CfConfig): Promise<string | boolean>;
|
|
54
|
-
/**
|
|
55
|
-
* Validates the project path for the CF Project Path page.
|
|
56
|
-
*
|
|
57
|
-
* In `existing` mode the path must be an existing MTA project; a missing service definition is no
|
|
58
|
-
* longer an error since the new service-instance dropdown lets the developer bind one. In `new`
|
|
59
|
-
* mode the path is the parent folder in which a new MTA project will be scaffolded, so it only has
|
|
60
|
-
* to exist (the MTA name/uniqueness is validated by the dedicated name prompt).
|
|
61
|
-
*
|
|
62
|
-
* @param {string} projectPath - The path to the project (existing MTA root, or parent folder for new).
|
|
63
|
-
* @param {ToolsLogger} logger - The logger.
|
|
64
|
-
* @param {MtaMode} [mtaMode] - The selected MTA mode defaults to `existing`.
|
|
65
|
-
* @param {CfConfig} [cfConfig] - The current CF config used to block binding an MTA from a different space.
|
|
66
|
-
* @returns {string | boolean} Returns true if the project path is valid, otherwise returns an error message.
|
|
67
|
-
*/
|
|
68
|
-
export declare function validateProjectPath(projectPath: string, logger: ToolsLogger, mtaMode?: MtaMode, cfConfig?: CfConfig): string | boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Validates the MTA project name entered when creating a new MTA project.
|
|
71
|
-
*
|
|
72
|
-
* Ensures the name is non-empty, at most 20 characters, uses only allowed characters (letters,
|
|
73
|
-
* numbers, dots, underscores, hyphens; starting with a letter or number) and that no folder with
|
|
74
|
-
* that name already exists in the selected parent location.
|
|
75
|
-
*
|
|
76
|
-
* @param {string} value - The MTA project name to validate.
|
|
77
|
-
* @param {string} [parentPath] - The parent folder the new MTA project will be created in.
|
|
78
|
-
* @returns {string | boolean} Returns true if valid, otherwise an error message.
|
|
79
|
-
*/
|
|
80
|
-
export declare function validateMtaId(value: string, parentPath?: string): string | boolean;
|
|
81
52
|
/**
|
|
82
53
|
* Throws the error message of a failed validator result; does nothing when the result is `true`.
|
|
83
54
|
*
|
|
@@ -85,12 +56,5 @@ export declare function validateMtaId(value: string, parentPath?: string): strin
|
|
|
85
56
|
* @throws {Error} When the result is an error message string.
|
|
86
57
|
*/
|
|
87
58
|
export declare function assertValidationPassed(result: string | boolean): void;
|
|
88
|
-
/**
|
|
89
|
-
* Validate business solution name.
|
|
90
|
-
*
|
|
91
|
-
* @param {string} value - Value to validate.
|
|
92
|
-
* @returns {string | boolean} Validation result.
|
|
93
|
-
*/
|
|
94
|
-
export declare function validateBusinessSolutionName(value: string): string | boolean;
|
|
95
59
|
export {};
|
|
96
60
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.validateExtensibilityExtension = validateExtensibilityExtension;
|
|
7
4
|
exports.validateJsonInput = validateJsonInput;
|
|
8
5
|
exports.validateEnvironment = validateEnvironment;
|
|
9
|
-
exports.validateProjectPath = validateProjectPath;
|
|
10
|
-
exports.validateMtaId = validateMtaId;
|
|
11
6
|
exports.assertValidationPassed = assertValidationPassed;
|
|
12
|
-
exports.validateBusinessSolutionName = validateBusinessSolutionName;
|
|
13
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
|
-
const node_path_1 = require("node:path");
|
|
15
|
-
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
16
7
|
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
17
8
|
const i18n_js_1 = require("../../../utils/i18n.js");
|
|
18
|
-
const types_js_1 = require("../../types.js");
|
|
19
9
|
const type_guards_js_1 = require("../../../utils/type-guards.js");
|
|
20
10
|
/**
|
|
21
11
|
* Validates whether the extensibility extension is available. If the extension is not found,
|
|
@@ -84,74 +74,6 @@ async function validateEnvironment(value, isCFLoggedIn, cfConfig) {
|
|
|
84
74
|
}
|
|
85
75
|
return true;
|
|
86
76
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Validates the project path for the CF Project Path page.
|
|
89
|
-
*
|
|
90
|
-
* In `existing` mode the path must be an existing MTA project; a missing service definition is no
|
|
91
|
-
* longer an error since the new service-instance dropdown lets the developer bind one. In `new`
|
|
92
|
-
* mode the path is the parent folder in which a new MTA project will be scaffolded, so it only has
|
|
93
|
-
* to exist (the MTA name/uniqueness is validated by the dedicated name prompt).
|
|
94
|
-
*
|
|
95
|
-
* @param {string} projectPath - The path to the project (existing MTA root, or parent folder for new).
|
|
96
|
-
* @param {ToolsLogger} logger - The logger.
|
|
97
|
-
* @param {MtaMode} [mtaMode] - The selected MTA mode defaults to `existing`.
|
|
98
|
-
* @param {CfConfig} [cfConfig] - The current CF config used to block binding an MTA from a different space.
|
|
99
|
-
* @returns {string | boolean} Returns true if the project path is valid, otherwise returns an error message.
|
|
100
|
-
*/
|
|
101
|
-
function validateProjectPath(projectPath, logger, mtaMode = types_js_1.MtaMode.Existing, cfConfig) {
|
|
102
|
-
const validationResult = (0, project_input_validator_1.validateEmptyString)(projectPath);
|
|
103
|
-
if (typeof validationResult === 'string') {
|
|
104
|
-
return validationResult;
|
|
105
|
-
}
|
|
106
|
-
if (!node_fs_1.default.existsSync(projectPath)) {
|
|
107
|
-
return (0, i18n_js_1.t)('error.projectDoesNotExist');
|
|
108
|
-
}
|
|
109
|
-
if (mtaMode === types_js_1.MtaMode.New) {
|
|
110
|
-
// New mode scaffolds a new MTA inside the selected folder an already-MTA folder is a conflicting
|
|
111
|
-
// choice (it would nest or silently reuse the MTA), so block it and point the user at Existing mode.
|
|
112
|
-
if ((0, adp_tooling_1.isMtaProject)(projectPath)) {
|
|
113
|
-
return (0, i18n_js_1.t)('error.newModeFolderAlreadyMta');
|
|
114
|
-
}
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
if (!(0, adp_tooling_1.isMtaProject)(projectPath)) {
|
|
118
|
-
return (0, i18n_js_1.t)('error.projectDoesNotExistMta');
|
|
119
|
-
}
|
|
120
|
-
// Block reusing an MTA that was created for a different CF space than the current login. The space the
|
|
121
|
-
// MTA targets is persisted in its ui5.yaml an unknown space (non-CF project) is not treated as a mismatch.
|
|
122
|
-
const projectSpaceGuid = (0, adp_tooling_1.getCfProjectSpaceGuid)(projectPath, logger);
|
|
123
|
-
if (projectSpaceGuid && cfConfig && projectSpaceGuid !== cfConfig.space.GUID) {
|
|
124
|
-
return (0, i18n_js_1.t)('error.projectSpaceMismatch');
|
|
125
|
-
}
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Validates the MTA project name entered when creating a new MTA project.
|
|
130
|
-
*
|
|
131
|
-
* Ensures the name is non-empty, at most 20 characters, uses only allowed characters (letters,
|
|
132
|
-
* numbers, dots, underscores, hyphens; starting with a letter or number) and that no folder with
|
|
133
|
-
* that name already exists in the selected parent location.
|
|
134
|
-
*
|
|
135
|
-
* @param {string} value - The MTA project name to validate.
|
|
136
|
-
* @param {string} [parentPath] - The parent folder the new MTA project will be created in.
|
|
137
|
-
* @returns {string | boolean} Returns true if valid, otherwise an error message.
|
|
138
|
-
*/
|
|
139
|
-
function validateMtaId(value, parentPath) {
|
|
140
|
-
const validationResult = (0, project_input_validator_1.validateEmptyString)(value);
|
|
141
|
-
if (typeof validationResult === 'string') {
|
|
142
|
-
return validationResult;
|
|
143
|
-
}
|
|
144
|
-
if (value.length > 20) {
|
|
145
|
-
return (0, i18n_js_1.t)('error.mtaIdTooLong');
|
|
146
|
-
}
|
|
147
|
-
if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(value)) {
|
|
148
|
-
return (0, i18n_js_1.t)('error.mtaIdInvalid');
|
|
149
|
-
}
|
|
150
|
-
if (parentPath && node_fs_1.default.existsSync((0, node_path_1.join)(parentPath, value))) {
|
|
151
|
-
return (0, i18n_js_1.t)('error.mtaIdAlreadyExists');
|
|
152
|
-
}
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
77
|
/**
|
|
156
78
|
* Throws the error message of a failed validator result; does nothing when the result is `true`.
|
|
157
79
|
*
|
|
@@ -163,20 +85,4 @@ function assertValidationPassed(result) {
|
|
|
163
85
|
throw new Error(result);
|
|
164
86
|
}
|
|
165
87
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Validate business solution name.
|
|
168
|
-
*
|
|
169
|
-
* @param {string} value - Value to validate.
|
|
170
|
-
* @returns {string | boolean} Validation result.
|
|
171
|
-
*/
|
|
172
|
-
function validateBusinessSolutionName(value) {
|
|
173
|
-
const validationResult = (0, project_input_validator_1.validateEmptyString)(value);
|
|
174
|
-
if (typeof validationResult === 'string') {
|
|
175
|
-
return validationResult;
|
|
176
|
-
}
|
|
177
|
-
if (/^[a-z0-9][a-z0-9._-]*$/.test(value)) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
return (0, i18n_js_1.t)('error.businessSolutionNameInvalid');
|
|
181
|
-
}
|
|
182
88
|
//# sourceMappingURL=validators.js.map
|
|
@@ -95,7 +95,7 @@ function getProjectPathPrompt(logger, vscode, cfConfig) {
|
|
|
95
95
|
breadcrumb: (0, i18n_js_1.t)('prompts.projectLocationBreadcrumb')
|
|
96
96
|
},
|
|
97
97
|
message: (0, i18n_js_1.t)('prompts.projectLocationLabel'),
|
|
98
|
-
validate: (value, answers) => (0,
|
|
98
|
+
validate: (value, answers) => (0, adp_tooling_1.validateProjectPath)(value, logger, answers?.mtaMode, cfConfig),
|
|
99
99
|
default: () => (0, fiori_generator_shared_1.getDefaultTargetFolder)(vscode),
|
|
100
100
|
store: false
|
|
101
101
|
};
|
|
@@ -113,7 +113,7 @@ function getMtaIdPrompt() {
|
|
|
113
113
|
name: 'mtaId',
|
|
114
114
|
message: (0, i18n_js_1.t)('prompts.mtaIdLabel'),
|
|
115
115
|
when: (answers) => answers.mtaMode === types_js_1.MtaMode.New && !!answers.projectLocation && !(0, adp_tooling_1.isMtaProject)(answers.projectLocation),
|
|
116
|
-
validate: (value, answers) => (0,
|
|
116
|
+
validate: (value, answers) => (0, adp_tooling_1.validateMtaId)(value, answers?.projectLocation),
|
|
117
117
|
guiOptions: {
|
|
118
118
|
mandatory: true,
|
|
119
119
|
hint: (0, i18n_js_1.t)('prompts.mtaIdTooltip'),
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"mtaModeLabel": "MTA Project",
|
|
72
72
|
"mtaModeTooltip": "Choose whether to create a new MTA project or use an existing one for your Adaptation Project.",
|
|
73
73
|
"mtaModeBreadcrumb": "MTA Project",
|
|
74
|
-
"mtaModeNewLabel": "
|
|
75
|
-
"mtaModeExistingLabel": "
|
|
74
|
+
"mtaModeNewLabel": "Use a New MTA Project for Creating an Adaptation Project",
|
|
75
|
+
"mtaModeExistingLabel": "Use an Existing MTA Project for Creating an Adaptation Project",
|
|
76
76
|
"mtaIdLabel": "MTA Project Name",
|
|
77
77
|
"mtaIdTooltip": "Enter the name of the new MTA project to create. It must be unique within the selected folder, be 20 characters or fewer, and use letters, numbers, dots (.), underscores (_), and hyphens (-) only.",
|
|
78
78
|
"mtaIdBreadcrumb": "MTA Project Name",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"projectDoesNotExist": "The project does not exist. Please select an MTA project.",
|
|
145
145
|
"projectDoesNotExistMta": "Provide the path to the MTA project where you want to have your Adaptation Project created.",
|
|
146
146
|
"projectSpaceMismatch": "The selected MTA project was created for a different Cloud Foundry space. Log in to that space, or choose another project.",
|
|
147
|
-
"newModeFolderAlreadyMta": "The selected folder is already an MTA project. Choose an empty folder to create a new MTA project, or select '
|
|
147
|
+
"newModeFolderAlreadyMta": "The selected folder is already an MTA project. Choose an empty folder to create a new MTA project, or select 'Use an Existing MTA Project for Creating an Adaptation Project'.",
|
|
148
148
|
"noAdaptableBusinessServiceFoundInMta": "No adaptable business service found in the MTA.",
|
|
149
149
|
"noAppsFoundForBusinessService": "No applications were found for the selected business service. Please check the service configuration.",
|
|
150
150
|
"fetchBaseInboundsFailed": "Fetching base application inbounds failed: {{error}}.",
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "SAPUI5 Adaptation Project",
|
|
4
4
|
"homepage": "https://help.sap.com/viewer/584e0bcbfd4a4aff91c815cefa0bce2d/Cloud/en-US/ada9567b767941aba8d49fdb4fdedea7.html",
|
|
5
5
|
"description": "Adaptation project allows you to create an app variant for an existing SAP Fiori elements-based or SAPUI5 freestyle application, without changing the original application.",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.3.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
"i18next": "26.5.11",
|
|
31
31
|
"uuid": "14.0.3",
|
|
32
32
|
"yeoman-generator": "5.10.0",
|
|
33
|
-
"@sap-ux/adp-tooling": "1.
|
|
34
|
-
"@sap-ux/axios-extension": "2.1.
|
|
33
|
+
"@sap-ux/adp-tooling": "1.3.0",
|
|
34
|
+
"@sap-ux/axios-extension": "2.1.9",
|
|
35
35
|
"@sap-ux/btp-utils": "2.0.9",
|
|
36
36
|
"@sap-ux/feature-toggle": "1.0.5",
|
|
37
|
-
"@sap-ux/fiori-generator-shared": "1.4.
|
|
37
|
+
"@sap-ux/fiori-generator-shared": "1.4.3",
|
|
38
|
+
"@sap-ux/inquirer-common": "1.0.58",
|
|
38
39
|
"@sap-ux/logger": "1.0.3",
|
|
39
40
|
"@sap-ux/odata-service-writer": "1.0.31",
|
|
40
|
-
"@sap-ux/inquirer-common": "1.0.57",
|
|
41
41
|
"@sap-ux/project-access": "2.3.6",
|
|
42
42
|
"@sap-ux/project-input-validator": "1.0.29",
|
|
43
43
|
"@sap-ux/store": "2.0.9",
|
|
44
|
-
"@sap-ux/
|
|
45
|
-
"@sap-ux/
|
|
44
|
+
"@sap-ux/system-access": "1.0.23",
|
|
45
|
+
"@sap-ux/telemetry": "2.0.17"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@jest/globals": "30.5.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"fs-extra": "11.4.1",
|
|
58
58
|
"rimraf": "6.1.3",
|
|
59
59
|
"yeoman-test": "6.3.0",
|
|
60
|
-
"@sap-ux/deploy-config-sub-generator": "1.0.
|
|
60
|
+
"@sap-ux/deploy-config-sub-generator": "1.0.98"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=22.x"
|