@sap-ux/generator-adp 0.7.13 → 0.7.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.
|
@@ -59,14 +59,13 @@ function getPasswordPrompt(abapTarget, logger) {
|
|
|
59
59
|
return (0, i18n_1.t)('error.pleaseProvideAllRequiredData');
|
|
60
60
|
}
|
|
61
61
|
try {
|
|
62
|
-
const
|
|
62
|
+
const credentials = {
|
|
63
63
|
system,
|
|
64
64
|
client: abapTarget.client ?? '',
|
|
65
65
|
username: answers.username,
|
|
66
66
|
password: value
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
await (0, adp_tooling_1.getSystemUI5Version)(abapProvider, logger);
|
|
68
|
+
await assertAuthenticated(credentials, logger);
|
|
70
69
|
return true;
|
|
71
70
|
}
|
|
72
71
|
catch (e) {
|
|
@@ -75,4 +74,19 @@ function getPasswordPrompt(abapTarget, logger) {
|
|
|
75
74
|
}
|
|
76
75
|
};
|
|
77
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Helper function which asserts whether a client is authenticated on an ABAP system or throws.
|
|
79
|
+
* Since we do not have a dedicated api call to detect if a client is authenticated we use the
|
|
80
|
+
* {@link LayeredRepositoryService.getSystemInfo} call which is a protected one.
|
|
81
|
+
*
|
|
82
|
+
* @param {ClientCredentials} credentials - Object containing client credentials to a specific ABAP system.
|
|
83
|
+
* @param {ToolsLogger} logger - The logger instance.
|
|
84
|
+
* @returns {Promise<void>} A promise resolved if the client is authenticated, otherwise rejected with
|
|
85
|
+
* an error.
|
|
86
|
+
*/
|
|
87
|
+
async function assertAuthenticated(credentials, logger) {
|
|
88
|
+
const abapProvider = await (0, adp_tooling_1.getConfiguredProvider)(credentials, logger);
|
|
89
|
+
const layeredRepositoryService = abapProvider.getLayeredRepository();
|
|
90
|
+
await layeredRepositoryService.getSystemInfo();
|
|
91
|
+
}
|
|
78
92
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -63,15 +63,10 @@ class SubGeneratorWithAuthBase extends sub_gen_base_1.default {
|
|
|
63
63
|
constructor(args, opts, type) {
|
|
64
64
|
super(args, opts, type);
|
|
65
65
|
this.generatorType = type;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.projectPath = opts.data.path;
|
|
69
|
-
}
|
|
70
|
-
this.vscode = opts.vscode;
|
|
71
|
-
}
|
|
72
|
-
catch (e) {
|
|
73
|
-
this.validationError = e;
|
|
66
|
+
if (opts.data) {
|
|
67
|
+
this.projectPath = opts.data.path;
|
|
74
68
|
}
|
|
69
|
+
this.vscode = opts.vscode;
|
|
75
70
|
}
|
|
76
71
|
/**
|
|
77
72
|
* Executes logic that should happen during Yeoman's `initializing` phase.
|
|
@@ -79,22 +74,12 @@ class SubGeneratorWithAuthBase extends sub_gen_base_1.default {
|
|
|
79
74
|
*/
|
|
80
75
|
async onInit() {
|
|
81
76
|
await (0, i18n_1.initI18n)();
|
|
82
|
-
if (this.validationError) {
|
|
83
|
-
this._registerPrompts(new yeoman_ui_types_1.Prompts((0, steps_1.getSubGenErrorPage)(this.generatorType)));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
this._registerPrompts(new yeoman_ui_types_1.Prompts((0, steps_1.getSubGenAuthPages)(this.generatorType, this.system)));
|
|
87
|
-
}
|
|
88
77
|
this.systemLookup = new adp_tooling_1.SystemLookup(this.logger);
|
|
89
78
|
const adpConfig = await (0, adp_tooling_1.getAdpConfig)(this.projectPath, node_path_1.default.join(this.projectPath, 'ui5.yaml'));
|
|
90
79
|
this.abapTarget = adpConfig.target;
|
|
91
80
|
this.system = ((0, btp_utils_1.isAppStudio)() ? this.abapTarget.destination : this.abapTarget.url) ?? '';
|
|
92
81
|
this.logger.log(`Successfully retrieved abap target\n${JSON.stringify(this.abapTarget, null, 2)}`);
|
|
93
|
-
|
|
94
|
-
this.appWizard.showError(this.validationError.message, yeoman_ui_types_1.MessageType.notification);
|
|
95
|
-
await this.handleRuntimeCrash(this.validationError.message);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
82
|
+
this._registerPrompts(new yeoman_ui_types_1.Prompts((0, steps_1.getSubGenAuthPages)(this.generatorType, this.system)));
|
|
98
83
|
try {
|
|
99
84
|
this.requiresAuth = await this.systemLookup.getSystemRequiresAuth(this.system);
|
|
100
85
|
this.logger.log(`System ${this.system} requires authentication: ${this.requiresAuth}`);
|
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": "0.7.
|
|
6
|
+
"version": "0.7.15",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"i18next": "25.3.0",
|
|
31
31
|
"yeoman-generator": "5.10.0",
|
|
32
32
|
"uuid": "10.0.0",
|
|
33
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
34
|
-
"@sap-ux/axios-extension": "1.24.
|
|
35
|
-
"@sap-ux/feature-toggle": "0.3.4",
|
|
33
|
+
"@sap-ux/adp-tooling": "0.18.15",
|
|
34
|
+
"@sap-ux/axios-extension": "1.24.4",
|
|
36
35
|
"@sap-ux/btp-utils": "1.1.5",
|
|
37
|
-
"@sap-ux/
|
|
36
|
+
"@sap-ux/feature-toggle": "0.3.4",
|
|
37
|
+
"@sap-ux/inquirer-common": "0.9.10",
|
|
38
38
|
"@sap-ux/logger": "0.7.1",
|
|
39
39
|
"@sap-ux/project-access": "1.32.12",
|
|
40
40
|
"@sap-ux/store": "1.3.3",
|
|
41
|
-
"@sap-ux/system-access": "0.6.
|
|
42
|
-
"@sap-ux/fiori-generator-shared": "0.13.37",
|
|
41
|
+
"@sap-ux/system-access": "0.6.30",
|
|
43
42
|
"@sap-ux/project-input-validator": "0.6.34",
|
|
43
|
+
"@sap-ux/fiori-generator-shared": "0.13.38",
|
|
44
44
|
"@sap-ux/odata-service-writer": "0.27.33"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"fs-extra": "10.0.0",
|
|
57
57
|
"rimraf": "6.0.1",
|
|
58
58
|
"yeoman-test": "6.3.0",
|
|
59
|
-
"@sap-ux/deploy-config-sub-generator": "0.5.
|
|
59
|
+
"@sap-ux/deploy-config-sub-generator": "0.5.12"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20.x"
|