@sap-ux/generator-adp 0.8.18 → 0.9.1

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.
@@ -64,6 +64,10 @@ export default class extends Generator {
64
64
  * Application manifest.
65
65
  */
66
66
  private manifest;
67
+ /**
68
+ * The Adaptation project type.
69
+ */
70
+ private projectType?;
67
71
  /**
68
72
  * Publicly available UI5 versions.
69
73
  */
@@ -165,6 +169,13 @@ export default class extends Generator {
165
169
  * @returns {string} The project path from the answers.
166
170
  */
167
171
  private _getProjectPath;
172
+ /**
173
+ * Use this method to get the correct Adaptation project type, no matter how we start
174
+ * the generator - from Yeoman UI or the CLI.
175
+ *
176
+ * @returns {AdaptationProjectType | undefined} The Adaptation project type.
177
+ */
178
+ private _getProjectType;
168
179
  /**
169
180
  * Configures logging for the generator.
170
181
  */
@@ -11,15 +11,15 @@ const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
11
11
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
12
12
  const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
13
13
  const logger_1 = require("@sap-ux/logger");
14
+ const axios_extension_1 = require("@sap-ux/axios-extension");
14
15
  const feature_toggle_1 = require("@sap-ux/feature-toggle");
15
- const telemetry_1 = require("@sap-ux/telemetry");
16
16
  const appWizardCache_1 = require("../utils/appWizardCache");
17
17
  const deps_1 = require("../utils/deps");
18
18
  const i18n_1 = require("../utils/i18n");
19
19
  const logger_2 = __importDefault(require("../utils/logger"));
20
20
  const opts_1 = require("../utils/opts");
21
21
  const parse_json_input_1 = require("../utils/parse-json-input");
22
- const telemetry_2 = require("../telemetry");
22
+ const telemetry_1 = require("../telemetry");
23
23
  const steps_1 = require("../utils/steps");
24
24
  const subgenHelpers_1 = require("../utils/subgenHelpers");
25
25
  const templates_1 = require("../utils/templates");
@@ -33,6 +33,7 @@ const validators_1 = require("./questions/helper/validators");
33
33
  const types_1 = require("./types");
34
34
  const target_env_1 = require("./questions/target-env");
35
35
  const key_user_1 = require("./questions/key-user");
36
+ const telemetry_2 = require("@sap-ux/telemetry");
36
37
  const generatorTitle = 'Adaptation Project';
37
38
  /**
38
39
  * Generator for creating an Adaptation Project.
@@ -98,6 +99,10 @@ class default_1 extends yeoman_generator_1.default {
98
99
  * Application manifest.
99
100
  */
100
101
  manifest;
102
+ /**
103
+ * The Adaptation project type.
104
+ */
105
+ projectType;
101
106
  /**
102
107
  * Publicly available UI5 versions.
103
108
  */
@@ -196,7 +201,7 @@ class default_1 extends yeoman_generator_1.default {
196
201
  this.isCfLoggedIn = await (0, adp_tooling_1.isLoggedInCf)(this.cfConfig, this.logger);
197
202
  this.logger.info(`isCfInstalled: ${this.cfInstalled}`);
198
203
  const isInternalUsage = (0, feature_toggle_1.isInternalFeaturesSettingEnabled)();
199
- await (0, telemetry_1.initTelemetrySettings)({
204
+ await (0, telemetry_2.initTelemetrySettings)({
200
205
  consumerModule: {
201
206
  name: '@sap/generator-fiori:generator-adp',
202
207
  version: this.rootGeneratorVersion()
@@ -204,7 +209,7 @@ class default_1 extends yeoman_generator_1.default {
204
209
  internalFeature: isInternalUsage,
205
210
  watchTelemetrySettingStore: false
206
211
  });
207
- this.telemetryCollector = new telemetry_2.TelemetryCollector();
212
+ this.telemetryCollector = new telemetry_1.TelemetryCollector();
208
213
  if (!this.jsonInput) {
209
214
  const shouldShowTargetEnv = this.cfInstalled && this.isCfFeatureEnabled;
210
215
  this.prompts.splice(0, 0, (0, steps_1.getWizardPages)(shouldShowTargetEnv));
@@ -222,7 +227,11 @@ class default_1 extends yeoman_generator_1.default {
222
227
  }
223
228
  else {
224
229
  const isExtensibilityExtInstalled = (0, fiori_generator_shared_1.isExtensionInstalled)(this.vscode, 'SAP.vscode-bas-extensibility');
230
+ const isInternalUsage = (0, feature_toggle_1.isInternalFeaturesSettingEnabled)();
225
231
  const configQuestions = this.prompter.getPrompts({
232
+ projectType: {
233
+ default: isInternalUsage ? axios_extension_1.AdaptationProjectType.ON_PREMISE : axios_extension_1.AdaptationProjectType.CLOUD_READY
234
+ },
226
235
  appValidationCli: { hide: !this.isCli },
227
236
  systemValidationCli: { hide: !this.isCli },
228
237
  shouldCreateExtProject: { isExtensibilityExtInstalled }
@@ -232,10 +241,11 @@ class default_1 extends yeoman_generator_1.default {
232
241
  this.logger.info(`System: ${this.configAnswers.system}`);
233
242
  this.logger.info(`Application: ${JSON.stringify(this.configAnswers.application, null, 2)}`);
234
243
  const { ui5Versions, systemVersion } = this.prompter.ui5;
235
- const promptConfig = {
244
+ const optionalPromptsConfig = {
236
245
  ui5Versions,
237
246
  isVersionDetected: !!systemVersion,
238
- isCloudProject: this.prompter.isCloud,
247
+ projectType: this.prompter.projectType,
248
+ systemType: this.prompter.systemType,
239
249
  layer: this.layer,
240
250
  prompts: this.prompts
241
251
  };
@@ -251,7 +261,7 @@ class default_1 extends yeoman_generator_1.default {
251
261
  addDeployConfig: { hide: this.shouldCreateExtProject || !this.isCustomerBase },
252
262
  importKeyUserChanges: { hide: this.shouldCreateExtProject }
253
263
  };
254
- const attributesQuestions = (0, attributes_1.getPrompts)(this.destinationPath(), promptConfig, options);
264
+ const attributesQuestions = (0, attributes_1.getPrompts)(this.destinationPath(), optionalPromptsConfig, options);
255
265
  this.attributeAnswers = await this.prompt(attributesQuestions);
256
266
  // Steps need to be updated here to be available after back navigation in Yeoman UI.
257
267
  this._updateWizardStepsAfterNavigation();
@@ -269,6 +279,7 @@ class default_1 extends yeoman_generator_1.default {
269
279
  projectName: this.attributeAnswers.projectName,
270
280
  projectPath: this.attributeAnswers.targetFolder,
271
281
  connectedSystem: this.configAnswers.system,
282
+ projectType: this.prompter.projectType,
272
283
  system
273
284
  }, this.composeWith.bind(this), this.logger, this.appWizard);
274
285
  }
@@ -308,6 +319,7 @@ class default_1 extends yeoman_generator_1.default {
308
319
  const provider = this.jsonInput ? this.abapProvider : this.prompter.provider;
309
320
  const publicVersions = this.jsonInput ? this.publicVersions : this.prompter.ui5.publicVersions;
310
321
  const manifest = this.jsonInput ? this.manifest : this.prompter.manifest;
322
+ const projectType = this._getProjectType();
311
323
  const packageJson = (0, deps_1.getPackageInfo)();
312
324
  const config = await (0, adp_tooling_1.getConfig)({
313
325
  provider,
@@ -319,6 +331,7 @@ class default_1 extends yeoman_generator_1.default {
319
331
  layer: this.layer,
320
332
  packageJson,
321
333
  logger: this.toolsLogger,
334
+ projectType,
322
335
  toolsId: this.toolsId,
323
336
  keyUserChanges: this.keyUserPrompter?.changes
324
337
  });
@@ -354,9 +367,9 @@ class default_1 extends yeoman_generator_1.default {
354
367
  ...this.telemetryCollector.telemetryData
355
368
  });
356
369
  if (data) {
357
- (0, fiori_generator_shared_1.sendTelemetry)(telemetry_2.EventName.ADAPTATION_PROJECT_CREATED, data, projectPath)
370
+ (0, fiori_generator_shared_1.sendTelemetry)(telemetry_1.EventName.ADAPTATION_PROJECT_CREATED, data, projectPath)
358
371
  .then(() => {
359
- this.logger.log(`Event ${telemetry_2.EventName.ADAPTATION_PROJECT_CREATED} successfully sent`);
372
+ this.logger.log(`Event ${telemetry_1.EventName.ADAPTATION_PROJECT_CREATED} successfully sent`);
360
373
  })
361
374
  .catch((error) => {
362
375
  this.logger.error(`Failed to send telemetry: ${error}`);
@@ -410,8 +423,8 @@ class default_1 extends yeoman_generator_1.default {
410
423
  telemetryData.projectType = 'cf';
411
424
  }
412
425
  else {
413
- const isCloud = this.prompter?.isCloud ?? false;
414
- telemetryData.projectType = isCloud ? 'cloudReady' : 'onPremise';
426
+ telemetryData.projectType =
427
+ this._getProjectType() === axios_extension_1.AdaptationProjectType.CLOUD_READY ? 'cloudReady' : 'onPremise';
415
428
  telemetryData.baseAppTechnicalName = this.configAnswers?.application?.id ?? '';
416
429
  }
417
430
  if (this.jsonInput) {
@@ -470,7 +483,6 @@ class default_1 extends yeoman_generator_1.default {
470
483
  const attributesQuestions = (0, attributes_1.getPrompts)(projectPath, {
471
484
  ui5Versions: [],
472
485
  isVersionDetected: false,
473
- isCloudProject: false,
474
486
  layer: this.layer,
475
487
  prompts: this.prompts,
476
488
  isCfEnv: true
@@ -548,6 +560,15 @@ class default_1 extends yeoman_generator_1.default {
548
560
  }
549
561
  return (0, node_path_1.join)(this.attributeAnswers.targetFolder, this.attributeAnswers.projectName);
550
562
  }
563
+ /**
564
+ * Use this method to get the correct Adaptation project type, no matter how we start
565
+ * the generator - from Yeoman UI or the CLI.
566
+ *
567
+ * @returns {AdaptationProjectType | undefined} The Adaptation project type.
568
+ */
569
+ _getProjectType() {
570
+ return this.jsonInput ? this.projectType : this.prompter.projectType;
571
+ }
551
572
  /**
552
573
  * Configures logging for the generator.
553
574
  */
@@ -562,7 +583,7 @@ class default_1 extends yeoman_generator_1.default {
562
583
  if (!this.jsonInput) {
563
584
  return;
564
585
  }
565
- const { system, client, username = '', password = '', application: baseApplicationName, applicationTitle, targetFolder = '/home/user/projects', projectName = (0, default_values_1.getDefaultProjectName)(targetFolder, `${baseApplicationName}.variant`), namespace = (0, default_values_1.getDefaultNamespace)(projectName, this.isCustomerBase) } = this.jsonInput;
586
+ const { system, client, username = '', password = '', projectType, application: baseApplicationName, applicationTitle, targetFolder = '/home/user/projects', projectName = (0, default_values_1.getDefaultProjectName)(targetFolder, `${baseApplicationName}.variant`), namespace = (0, default_values_1.getDefaultNamespace)(projectName, this.isCustomerBase) } = this.jsonInput;
566
587
  await (0, validators_1.validateJsonInput)(this.systemLookup, this.isCustomerBase, {
567
588
  projectName,
568
589
  targetFolder,
@@ -577,7 +598,16 @@ class default_1 extends yeoman_generator_1.default {
577
598
  password
578
599
  };
579
600
  this.abapProvider = await (0, adp_tooling_1.getConfiguredProvider)(providerOptions, this.logger);
580
- const applications = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase);
601
+ const supportedProject = await (0, adp_tooling_1.getSupportedProject)(this.abapProvider);
602
+ let selectedProjectType = axios_extension_1.AdaptationProjectType.ON_PREMISE;
603
+ if (supportedProject === adp_tooling_1.SupportedProject.CLOUD_READY_AND_ON_PREM) {
604
+ selectedProjectType = projectType ?? axios_extension_1.AdaptationProjectType.CLOUD_READY;
605
+ }
606
+ else if (supportedProject === adp_tooling_1.SupportedProject.CLOUD_READY) {
607
+ selectedProjectType = axios_extension_1.AdaptationProjectType.CLOUD_READY;
608
+ }
609
+ this.projectType = selectedProjectType;
610
+ const applications = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, selectedProjectType);
581
611
  this.telemetryCollector.setBatch({ numberOfApplications: applications.length });
582
612
  const application = applications.find((application) => application.id === baseApplicationName);
583
613
  if (!application) {
@@ -1,23 +1,15 @@
1
1
  import { type Prompts as YeomanUiSteps } from '@sap-devx/yeoman-ui-types';
2
- import { FlexLayer } from '@sap-ux/adp-tooling';
3
- import type { AttributesQuestion, AttributePromptOptions, AddDeployConfigPromptOptions, AddFlpConfigPromptOptions } from '../types';
4
- interface Config {
5
- isCloudProject: boolean;
6
- layer: FlexLayer;
7
- ui5Versions: string[];
8
- isVersionDetected: boolean;
9
- prompts: YeomanUiSteps;
10
- isCfEnv?: boolean;
11
- }
2
+ import type { AttributesQuestion, AttributePromptOptions, AddDeployConfigPromptOptions, AddFlpConfigPromptOptions, OptionalPromptsConfig } from '../types';
3
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
12
4
  /**
13
5
  * Returns all project attribute prompts, filtering based on promptOptions.
14
6
  *
15
7
  * @param {string} path - The project base path.
16
- * @param {Config} config - Configuration values needed for conditional prompt logic.
8
+ * @param {OptionalPromptsConfig} config - Configuration values needed for conditional prompt logic.
17
9
  * @param {AttributePromptOptions} [promptOptions] - Optional settings to control visibility and defaults.
18
10
  * @returns {AttributesQuestion[]} An array of prompt objects for basic info input.
19
11
  */
20
- export declare function getPrompts(path: string, config: Config, promptOptions?: AttributePromptOptions): AttributesQuestion[];
12
+ export declare function getPrompts(path: string, config: OptionalPromptsConfig, promptOptions?: AttributePromptOptions): AttributesQuestion[];
21
13
  /**
22
14
  * Creates the Add Deployment Config confirm prompt.
23
15
  *
@@ -30,10 +22,9 @@ export declare function getAddDeployConfigPrompt(prompts: YeomanUiSteps, _?: Add
30
22
  * Creates the Add FLP Config confirm prompt.
31
23
  *
32
24
  * @param {YeomanUiSteps} prompts - The Yeoman UI pages.
33
- * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
25
+ * @param {boolean} projectType - The project type.
34
26
  * @param {AddFlpConfigPromptOptions} options - Optional prompt options to control visibility.
35
27
  * @returns {AttributesQuestion} The prompt configuration for Add FLP config confirmation.
36
28
  */
37
- export declare function getFlpConfigPrompt(prompts: YeomanUiSteps, isCloudProject: boolean, options?: AddFlpConfigPromptOptions): AttributesQuestion;
38
- export {};
29
+ export declare function getFlpConfigPrompt(prompts: YeomanUiSteps, projectType?: AdaptationProjectType, options?: AddFlpConfigPromptOptions): AttributesQuestion;
39
30
  //# sourceMappingURL=attributes.d.ts.map
@@ -11,27 +11,28 @@ const tooltip_1 = require("./helper/tooltip");
11
11
  const additional_messages_1 = require("./helper/additional-messages");
12
12
  const steps_1 = require("../../utils/steps");
13
13
  const default_values_1 = require("./helper/default-values");
14
+ const axios_extension_1 = require("@sap-ux/axios-extension");
14
15
  /**
15
16
  * Returns all project attribute prompts, filtering based on promptOptions.
16
17
  *
17
18
  * @param {string} path - The project base path.
18
- * @param {Config} config - Configuration values needed for conditional prompt logic.
19
+ * @param {OptionalPromptsConfig} config - Configuration values needed for conditional prompt logic.
19
20
  * @param {AttributePromptOptions} [promptOptions] - Optional settings to control visibility and defaults.
20
21
  * @returns {AttributesQuestion[]} An array of prompt objects for basic info input.
21
22
  */
22
23
  function getPrompts(path, config, promptOptions) {
23
- const { isVersionDetected, ui5Versions, isCloudProject, layer, prompts, isCfEnv = false } = config;
24
+ const { isVersionDetected, ui5Versions, systemType, projectType, layer, prompts, isCfEnv = false } = config;
24
25
  const isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
25
26
  const keyedPrompts = {
26
27
  [types_1.attributePromptNames.projectName]: getProjectNamePrompt(path, isCustomerBase, isCfEnv, promptOptions?.[types_1.attributePromptNames.projectName]),
27
28
  [types_1.attributePromptNames.title]: getApplicationTitlePrompt(promptOptions?.[types_1.attributePromptNames.title]),
28
29
  [types_1.attributePromptNames.namespace]: getNamespacePrompt(isCustomerBase, promptOptions?.[types_1.attributePromptNames.namespace]),
29
30
  [types_1.attributePromptNames.targetFolder]: getTargetFolderPrompt(promptOptions?.[types_1.attributePromptNames.targetFolder]),
30
- [types_1.attributePromptNames.ui5Version]: getUi5VersionPrompt(ui5Versions, isVersionDetected, isCloudProject),
31
+ [types_1.attributePromptNames.ui5Version]: getUi5VersionPrompt(ui5Versions, isVersionDetected, systemType),
31
32
  [types_1.attributePromptNames.ui5ValidationCli]: getUi5VersionValidationPromptForCli(),
32
33
  [types_1.attributePromptNames.enableTypeScript]: getEnableTypeScriptPrompt(promptOptions?.[types_1.attributePromptNames.enableTypeScript]),
33
34
  [types_1.attributePromptNames.addDeployConfig]: getAddDeployConfigPrompt(prompts, promptOptions?.[types_1.attributePromptNames.addDeployConfig]),
34
- [types_1.attributePromptNames.addFlpConfig]: getFlpConfigPrompt(prompts, isCloudProject, promptOptions?.[types_1.attributePromptNames.addFlpConfig]),
35
+ [types_1.attributePromptNames.addFlpConfig]: getFlpConfigPrompt(prompts, projectType, promptOptions?.[types_1.attributePromptNames.addFlpConfig]),
35
36
  [types_1.attributePromptNames.importKeyUserChanges]: getImportKeyUserChangesPrompt(prompts, promptOptions?.[types_1.attributePromptNames.importKeyUserChanges])
36
37
  };
37
38
  const questions = Object.entries(keyedPrompts)
@@ -143,15 +144,15 @@ function getTargetFolderPrompt(options) {
143
144
  *
144
145
  * @param {string[]} ui5Versions - Array of available UI5 versions.
145
146
  * @param {boolean} isVersionDetected - Whether a UI5 version was detected from the system.
146
- * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
147
+ * @param {boolean} systemType - The system type.
147
148
  * @returns {AttributesQuestion} The prompt configuration for UI5 version.
148
149
  */
149
- function getUi5VersionPrompt(ui5Versions, isVersionDetected, isCloudProject) {
150
+ function getUi5VersionPrompt(ui5Versions, isVersionDetected, systemType) {
150
151
  return {
151
152
  type: 'list',
152
153
  name: types_1.attributePromptNames.ui5Version,
153
154
  message: (0, i18n_1.t)('prompts.ui5VersionLabel'),
154
- when: !isCloudProject,
155
+ when: systemType !== types_1.SystemType.CLOUD_READY,
155
156
  choices: ui5Versions,
156
157
  guiOptions: {
157
158
  applyDefaultWhenDirty: true,
@@ -227,11 +228,11 @@ function getAddDeployConfigPrompt(prompts, _) {
227
228
  * Creates the Add FLP Config confirm prompt.
228
229
  *
229
230
  * @param {YeomanUiSteps} prompts - The Yeoman UI pages.
230
- * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
231
+ * @param {boolean} projectType - The project type.
231
232
  * @param {AddFlpConfigPromptOptions} options - Optional prompt options to control visibility.
232
233
  * @returns {AttributesQuestion} The prompt configuration for Add FLP config confirmation.
233
234
  */
234
- function getFlpConfigPrompt(prompts, isCloudProject, options) {
235
+ function getFlpConfigPrompt(prompts, projectType, options) {
235
236
  return {
236
237
  type: 'confirm',
237
238
  name: types_1.attributePromptNames.addFlpConfig,
@@ -240,7 +241,7 @@ function getFlpConfigPrompt(prompts, isCloudProject, options) {
240
241
  guiOptions: {
241
242
  breadcrumb: true
242
243
  },
243
- when: () => isCloudProject,
244
+ when: () => projectType === axios_extension_1.AdaptationProjectType.CLOUD_READY,
244
245
  validate: (value, answers) => {
245
246
  (0, steps_1.updateFlpWizardSteps)(!!options?.hasBaseAppInbounds, prompts, answers.projectName, value);
246
247
  return true;
@@ -1,10 +1,11 @@
1
1
  import type { SystemLookup, UI5Version } from '@sap-ux/adp-tooling';
2
2
  import { FlexLayer } from '@sap-ux/adp-tooling';
3
- import { type AbapServiceProvider } from '@sap-ux/axios-extension';
3
+ import { AdaptationProjectType, type AbapServiceProvider } from '@sap-ux/axios-extension';
4
4
  import type { ToolsLogger } from '@sap-ux/logger';
5
5
  import type { Manifest, ManifestNamespace } from '@sap-ux/project-access';
6
6
  import type { TelemetryCollector } from '../../telemetry';
7
7
  import type { ConfigPromptOptions, ConfigQuestion } from '../types';
8
+ import { SystemType } from '../types';
8
9
  /**
9
10
  * A stateful prompter class that creates configuration questions.
10
11
  * It exposes a single public method {@link getPrompts} to retrieve the configuration questions.
@@ -40,11 +41,20 @@ export declare class ConfigPrompter {
40
41
  /**
41
42
  * Cached UI flexibility information from the system.
42
43
  */
43
- private flexUISystem;
44
+ private flexUICapability?;
44
45
  /**
45
- * Flag indicating if the project is a cloud project.
46
+ * The supported project type for the system.
46
47
  */
47
- private isCloudProject;
48
+ private supportedProject?;
49
+ /**
50
+ * The selected project type by the user. For a mixed system only
51
+ * the user may select from a cloudReady or an OnPremise project types.
52
+ */
53
+ private selectedProjectType?;
54
+ /**
55
+ * The system type for the selected system.
56
+ */
57
+ private selectedSystemType?;
48
58
  /**
49
59
  * Flag indicating whether the selected application is supported.
50
60
  */
@@ -56,7 +66,7 @@ export declare class ConfigPrompter {
56
66
  /**
57
67
  * System additional message.
58
68
  */
59
- private systemAdditionalMessage;
69
+ private systemAdditionalMessage?;
60
70
  /**
61
71
  * Indicates whether views are loaded synchronously.
62
72
  */
@@ -100,11 +110,13 @@ export declare class ConfigPrompter {
100
110
  publicVersions: UI5Version;
101
111
  };
102
112
  /**
103
- * Returns flag indicating if the project is a cloud project.
104
- *
105
- * @returns Whether system is cloud-ready.
113
+ * @returns {AdaptationProjectType | undefined} The project type.
106
114
  */
107
- get isCloud(): boolean;
115
+ get projectType(): AdaptationProjectType | undefined;
116
+ /**
117
+ * @returns {SystemType | undefined} The system type.
118
+ */
119
+ get systemType(): SystemType | undefined;
108
120
  /**
109
121
  * Returns the configured abap provider instance.
110
122
  *
@@ -186,6 +198,13 @@ export declare class ConfigPrompter {
186
198
  * @returns The store credentials prompt as a {@link ConfigQuestion}.
187
199
  */
188
200
  private getStoreCredentialsPrompt;
201
+ /**
202
+ * Creates the project type prompt configuration.
203
+ *
204
+ * @param {ApplicationPromptOptions | undefined} options - The prompt options.
205
+ * @returns {ListQuestion<ConfigAnswers>} The project type prompt configuration.
206
+ */
207
+ private getProjectTypeListPrompt;
189
208
  /**
190
209
  * Creates the application list prompt configuration.
191
210
  *
@@ -262,7 +281,7 @@ export declare class ConfigPrompter {
262
281
  */
263
282
  private evaluateAppSupport;
264
283
  /**
265
- * Fetches system data including cloud project and UI flexibility information.
284
+ * Fetches the system type, supported project type and the UI flexibility information.
266
285
  *
267
286
  * @returns A promise that resolves when system data is fetched.
268
287
  */
@@ -12,6 +12,7 @@ const choices_1 = require("./helper/choices");
12
12
  const conditions_1 = require("./helper/conditions");
13
13
  const message_1 = require("./helper/message");
14
14
  const validators_1 = require("./helper/validators");
15
+ const feature_toggle_1 = require("@sap-ux/feature-toggle");
15
16
  const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
16
17
  /**
17
18
  * A stateful prompter class that creates configuration questions.
@@ -48,11 +49,20 @@ class ConfigPrompter {
48
49
  /**
49
50
  * Cached UI flexibility information from the system.
50
51
  */
51
- flexUISystem;
52
+ flexUICapability;
52
53
  /**
53
- * Flag indicating if the project is a cloud project.
54
+ * The supported project type for the system.
54
55
  */
55
- isCloudProject;
56
+ supportedProject;
57
+ /**
58
+ * The selected project type by the user. For a mixed system only
59
+ * the user may select from a cloudReady or an OnPremise project types.
60
+ */
61
+ selectedProjectType;
62
+ /**
63
+ * The system type for the selected system.
64
+ */
65
+ selectedSystemType;
56
66
  /**
57
67
  * Flag indicating whether the selected application is supported.
58
68
  */
@@ -110,12 +120,16 @@ class ConfigPrompter {
110
120
  };
111
121
  }
112
122
  /**
113
- * Returns flag indicating if the project is a cloud project.
114
- *
115
- * @returns Whether system is cloud-ready.
123
+ * @returns {AdaptationProjectType | undefined} The project type.
116
124
  */
117
- get isCloud() {
118
- return !!this.isCloudProject;
125
+ get projectType() {
126
+ return this.selectedProjectType;
127
+ }
128
+ /**
129
+ * @returns {SystemType | undefined} The system type.
130
+ */
131
+ get systemType() {
132
+ return this.selectedSystemType;
119
133
  }
120
134
  /**
121
135
  * Returns the configured abap provider instance.
@@ -185,6 +199,7 @@ class ConfigPrompter {
185
199
  [types_1.configPromptNames.username]: this.getUsernamePrompt(promptOptions?.[types_1.configPromptNames.username]),
186
200
  [types_1.configPromptNames.password]: this.getPasswordPrompt(promptOptions?.[types_1.configPromptNames.password]),
187
201
  [types_1.configPromptNames.storeCredentials]: this.getStoreCredentialsPrompt(promptOptions?.[types_1.configPromptNames.storeCredentials]),
202
+ [types_1.configPromptNames.projectType]: this.getProjectTypeListPrompt(promptOptions?.[types_1.configPromptNames.projectType]),
188
203
  [types_1.configPromptNames.application]: this.getApplicationListPrompt(promptOptions?.[types_1.configPromptNames.application]),
189
204
  [types_1.configPromptNames.appValidationCli]: this.getApplicationValidationPromptForCli(),
190
205
  [types_1.configPromptNames.fioriId]: this.getFioriIdPrompt(),
@@ -222,7 +237,7 @@ class ConfigPrompter {
222
237
  default: '',
223
238
  validate: async (value, answers) => await this.validateSystem(value, answers),
224
239
  additionalMessages: () => {
225
- this.systemAdditionalMessage = (0, additional_messages_1.getSystemAdditionalMessages)(this.flexUISystem, this.isCloud);
240
+ this.systemAdditionalMessage = (0, additional_messages_1.getSystemAdditionalMessages)(this.flexUICapability, this.selectedProjectType);
226
241
  return this.systemAdditionalMessage;
227
242
  }
228
243
  };
@@ -289,7 +304,7 @@ class ConfigPrompter {
289
304
  when: (answers) => (0, conditions_1.showCredentialQuestion)(answers, this.isAuthRequired),
290
305
  additionalMessages: () => {
291
306
  if (!this.systemAdditionalMessage) {
292
- this.systemAdditionalMessage = (0, additional_messages_1.getSystemAdditionalMessages)(this.flexUISystem, this.isCloud);
307
+ this.systemAdditionalMessage = (0, additional_messages_1.getSystemAdditionalMessages)(this.flexUICapability, this.selectedProjectType);
293
308
  return this.systemAdditionalMessage;
294
309
  }
295
310
  return undefined;
@@ -323,6 +338,45 @@ class ConfigPrompter {
323
338
  }
324
339
  };
325
340
  }
341
+ /**
342
+ * Creates the project type prompt configuration.
343
+ *
344
+ * @param {ApplicationPromptOptions | undefined} options - The prompt options.
345
+ * @returns {ListQuestion<ConfigAnswers>} The project type prompt configuration.
346
+ */
347
+ getProjectTypeListPrompt(options) {
348
+ return {
349
+ type: 'list',
350
+ name: types_1.configPromptNames.projectType,
351
+ message: (0, i18n_1.t)('prompts.projectTypeListLabel'),
352
+ guiOptions: {
353
+ mandatory: true,
354
+ breadcrumb: true,
355
+ applyDefaultWhenDirty: true
356
+ },
357
+ choices: choices_1.getProjectTypeChoices,
358
+ default: options?.default,
359
+ // We include the system in the validation to avoid prompt appearance
360
+ // after pressing start over from the template wizard. This is needed
361
+ // because the prompter is cached adn we do not want to reset cached data, because
362
+ // back/forward navigation will be affected if we do so.
363
+ when: ({ system }) => !!system && this.supportedProject === adp_tooling_1.SupportedProject.CLOUD_READY_AND_ON_PREM,
364
+ validate: async (projectType) => {
365
+ this.selectedProjectType = projectType;
366
+ const isInternalUsage = (0, feature_toggle_1.isInternalFeaturesSettingEnabled)();
367
+ if (this.selectedProjectType === axios_extension_1.AdaptationProjectType.CLOUD_READY && isInternalUsage) {
368
+ return (0, i18n_1.t)('error.cloudSystemsForInternalUsers');
369
+ }
370
+ try {
371
+ this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.selectedProjectType);
372
+ }
373
+ catch (error) {
374
+ return error.message;
375
+ }
376
+ return true;
377
+ }
378
+ };
379
+ }
326
380
  /**
327
381
  * Creates the application list prompt configuration.
328
382
  *
@@ -430,7 +484,13 @@ class ConfigPrompter {
430
484
  guiOptions: {
431
485
  applyDefaultWhenDirty: true
432
486
  },
433
- when: (answers) => (0, conditions_1.showExtensionProjectQuestion)(answers, this.flexUISystem, this.isCloudProject, this.isApplicationSupported, this.containsSyncViews),
487
+ when: (answers) => (0, conditions_1.showExtensionProjectQuestion)({
488
+ projectType: this.selectedProjectType,
489
+ isApplicationSelected: !!answers.application,
490
+ isApplicationSupported: this.isApplicationSupported,
491
+ hasSyncViews: this.containsSyncViews,
492
+ flexUICapability: this.flexUICapability
493
+ }),
434
494
  validate: (value) => (0, validators_1.validateExtensibilityExtension)({
435
495
  value,
436
496
  isApplicationSupported: this.isApplicationSupported,
@@ -454,7 +514,7 @@ class ConfigPrompter {
454
514
  const validationResult = await this.validateAppData(app);
455
515
  const isKnownUnsupported = validationResult === (0, i18n_1.t)('error.appDoesNotSupportManifest') ||
456
516
  validationResult === (0, i18n_1.t)('error.appDoesNotSupportFlexibility');
457
- if ((0, btp_utils_1.isAppStudio)() && isKnownUnsupported && !this.isCloud) {
517
+ if ((0, btp_utils_1.isAppStudio)() && isKnownUnsupported && this.selectedProjectType !== axios_extension_1.AdaptationProjectType.CLOUD_READY) {
458
518
  this.logger.error(validationResult);
459
519
  this.appValidationErrorMessage = validationResult;
460
520
  this.isApplicationSupported = false;
@@ -464,7 +524,7 @@ class ConfigPrompter {
464
524
  if (typeof validationResult === 'string') {
465
525
  return validationResult;
466
526
  }
467
- if (this.isCloud) {
527
+ if (this.selectedProjectType === axios_extension_1.AdaptationProjectType.CLOUD_READY) {
468
528
  try {
469
529
  this.baseApplicationInbounds = await (0, adp_tooling_1.getBaseAppInbounds)(app.id, this.provider);
470
530
  }
@@ -506,7 +566,7 @@ class ConfigPrompter {
506
566
  return validationResult;
507
567
  }
508
568
  this.telemetryCollector.startTiming('applicationListLoadingTime');
509
- this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase);
569
+ this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.selectedProjectType);
510
570
  this.telemetryCollector.setBatch({ numberOfApplications: this.targetApps.length });
511
571
  this.telemetryCollector.endTiming('applicationListLoadingTime');
512
572
  this.isLoginSuccessful = true;
@@ -538,20 +598,23 @@ class ConfigPrompter {
538
598
  };
539
599
  try {
540
600
  this.targetApps = [];
541
- this.flexUISystem = undefined;
542
- this.isCloudProject = undefined;
601
+ this.flexUICapability = undefined;
602
+ this.selectedProjectType = undefined;
603
+ this.selectedSystemType = undefined;
604
+ this.supportedProject = undefined;
543
605
  this.abapProvider = await (0, adp_tooling_1.getConfiguredProvider)(options, this.logger);
544
606
  this.isAuthRequired = await this.systemLookup.getSystemRequiresAuth(system);
545
- if (!this.isAuthRequired) {
546
- const validationResult = await this.handleSystemDataValidation();
547
- if (typeof validationResult === 'string') {
548
- return validationResult;
549
- }
550
- this.telemetryCollector.startTiming('applicationListLoadingTime');
551
- this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase);
552
- this.telemetryCollector.setBatch({ numberOfApplications: this.targetApps.length });
553
- this.telemetryCollector.endTiming('applicationListLoadingTime');
607
+ if (this.isAuthRequired) {
608
+ return true;
554
609
  }
610
+ const validationResult = await this.handleSystemDataValidation();
611
+ if (typeof validationResult === 'string') {
612
+ return validationResult;
613
+ }
614
+ this.telemetryCollector.startTiming('applicationListLoadingTime');
615
+ this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase, this.selectedProjectType);
616
+ this.telemetryCollector.setBatch({ numberOfApplications: this.targetApps.length });
617
+ this.telemetryCollector.endTiming('applicationListLoadingTime');
555
618
  return true;
556
619
  }
557
620
  catch (e) {
@@ -592,17 +655,31 @@ class ConfigPrompter {
592
655
  this.setSupportFlags(application, isFullSupport, isPartialSupport);
593
656
  }
594
657
  /**
595
- * Fetches system data including cloud project and UI flexibility information.
658
+ * Fetches the system type, supported project type and the UI flexibility information.
596
659
  *
597
660
  * @returns A promise that resolves when system data is fetched.
598
661
  */
599
662
  async loadSystemData() {
600
663
  try {
601
- this.isCloudProject = await this.abapProvider.isAbapCloud();
602
- this.flexUISystem = await (0, adp_tooling_1.getFlexUISupportedSystem)(this.abapProvider, this.isCustomerBase);
664
+ // Do not include the ato settings retreival in the parallel calls because we need to first login
665
+ // before executing any other call. A provider works like this - with the first api call it authenticates the user.
666
+ this.selectedSystemType = (await this.provider.isAbapCloud()) ? types_1.SystemType.CLOUD_READY : types_1.SystemType.ON_PREM;
667
+ const [supportedProject, flexUICapability] = await Promise.all([
668
+ (0, adp_tooling_1.getSupportedProject)(this.abapProvider),
669
+ (0, adp_tooling_1.getFlexUICapability)(this.abapProvider, this.isCustomerBase)
670
+ ]);
671
+ this.supportedProject = supportedProject;
672
+ this.flexUICapability = flexUICapability;
673
+ // Set selected project type based on the supported project.
674
+ if (this.supportedProject === adp_tooling_1.SupportedProject.CLOUD_READY) {
675
+ this.selectedProjectType = axios_extension_1.AdaptationProjectType.CLOUD_READY;
676
+ }
677
+ else if (this.supportedProject === adp_tooling_1.SupportedProject.ON_PREM) {
678
+ this.selectedProjectType = axios_extension_1.AdaptationProjectType.ON_PREMISE;
679
+ }
603
680
  }
604
- catch (e) {
605
- this.handleSystemError(e);
681
+ catch (error) {
682
+ this.handleSystemError(error);
606
683
  }
607
684
  }
608
685
  /**
@@ -631,7 +708,7 @@ class ConfigPrompter {
631
708
  try {
632
709
  await this.loadSystemData();
633
710
  await this.loadUI5Versions();
634
- if (!this.isCustomerBase && this.isCloudProject) {
711
+ if (!this.isCustomerBase && this.selectedProjectType === axios_extension_1.AdaptationProjectType.CLOUD_READY) {
635
712
  return (0, i18n_1.t)('error.cloudSystemsForInternalUsers');
636
713
  }
637
714
  return true;
@@ -654,9 +731,10 @@ class ConfigPrompter {
654
731
  }
655
732
  if (error.response?.status === 405 || error.response?.status === 404) {
656
733
  // Handle the case where the API is not available and continue to standard onPremise flow
657
- this.isCloudProject = false;
734
+ this.selectedProjectType = axios_extension_1.AdaptationProjectType.ON_PREMISE;
658
735
  return;
659
736
  }
737
+ throw error;
660
738
  }
661
739
  }
662
740
  /**
@@ -1,5 +1,6 @@
1
1
  import type { IMessageSeverity } from '@sap-devx/yeoman-ui-types';
2
- import type { FlexUISupportedSystem, SourceApplication } from '@sap-ux/adp-tooling';
2
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
3
+ import type { FlexUICapability, SourceApplication } from '@sap-ux/adp-tooling';
3
4
  interface SupportFlags {
4
5
  hasSyncViews: boolean;
5
6
  isV4AppInternalMode: boolean;
@@ -9,12 +10,12 @@ interface SupportFlags {
9
10
  /**
10
11
  * Evaluates a system's deployment and flexibility capabilities to generate relevant messages based on the system's characteristics.
11
12
  *
12
- * @param {FlexUISupportedSystem | undefined} flexUISystem - An optional object containing flags indicating if the system
13
+ * @param {FlexUICapability | undefined} flexUICapability - An optional object containing flags indicating if the system
13
14
  * is on-premise and whether UI Flex is enabled.
14
- * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
15
+ * @param {AdaptationProjectType|undefined} projectType - The project type.
15
16
  * @returns {IMessageSeverity | undefined} An object containing a message and its severity level.
16
17
  */
17
- export declare const getSystemAdditionalMessages: (flexUISystem: FlexUISupportedSystem | undefined, isCloudProject: boolean) => IMessageSeverity | undefined;
18
+ export declare const getSystemAdditionalMessages: (flexUICapability?: FlexUICapability, projectType?: AdaptationProjectType) => IMessageSeverity | undefined;
18
19
  /**
19
20
  * Provides an additional contextual message for the selected application, based on its compatibility,
20
21
  * feature support, or sync-loading behavior.
@@ -7,47 +7,42 @@ const i18n_1 = require("../../../utils/i18n");
7
7
  /**
8
8
  * Evaluates a system's deployment and flexibility capabilities to generate relevant messages based on the system's characteristics.
9
9
  *
10
- * @param {FlexUISupportedSystem | undefined} flexUISystem - An optional object containing flags indicating if the system
10
+ * @param {FlexUICapability | undefined} flexUICapability - An optional object containing flags indicating if the system
11
11
  * is on-premise and whether UI Flex is enabled.
12
- * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
12
+ * @param {AdaptationProjectType|undefined} projectType - The project type.
13
13
  * @returns {IMessageSeverity | undefined} An object containing a message and its severity level.
14
14
  */
15
- const getSystemAdditionalMessages = (flexUISystem, isCloudProject) => {
16
- const isOnPremise = flexUISystem?.isOnPremise;
17
- const isUIFlex = flexUISystem?.isUIFlex;
18
- if (isCloudProject) {
15
+ const getSystemAdditionalMessages = (flexUICapability, projectType) => {
16
+ if (!flexUICapability || !projectType) {
17
+ return undefined;
18
+ }
19
+ if (projectType === axios_extension_1.AdaptationProjectType.CLOUD_READY) {
19
20
  return {
20
21
  message: `${(0, i18n_1.t)('prompts.projectTypeLabel')}: ${axios_extension_1.AdaptationProjectType.CLOUD_READY}`,
21
22
  severity: yeoman_ui_types_1.Severity.information
22
23
  };
23
24
  }
24
- if (!flexUISystem) {
25
- return undefined;
26
- }
27
- if (!isOnPremise) {
28
- if (!isUIFlex) {
29
- return {
30
- message: (0, i18n_1.t)('error.notDeployableNotFlexEnabledSystemError'),
31
- severity: yeoman_ui_types_1.Severity.warning
32
- };
33
- }
34
- else {
35
- return {
25
+ const { isDtaFolderDeploymentSupported, isUIFlexSupported } = flexUICapability;
26
+ if (isUIFlexSupported) {
27
+ return isDtaFolderDeploymentSupported
28
+ ? {
29
+ message: `${(0, i18n_1.t)('prompts.projectTypeLabel')}: ${axios_extension_1.AdaptationProjectType.ON_PREMISE}`,
30
+ severity: yeoman_ui_types_1.Severity.information
31
+ }
32
+ : {
36
33
  message: (0, i18n_1.t)('error.notDeployableSystemError'),
37
34
  severity: yeoman_ui_types_1.Severity.error
38
35
  };
39
- }
40
36
  }
41
- if (isOnPremise && !isUIFlex) {
42
- return {
37
+ return isDtaFolderDeploymentSupported
38
+ ? {
43
39
  message: (0, i18n_1.t)('error.notFlexEnabledError'),
44
40
  severity: yeoman_ui_types_1.Severity.warning
41
+ }
42
+ : {
43
+ message: (0, i18n_1.t)('error.notDeployableNotFlexEnabledSystemError'),
44
+ severity: yeoman_ui_types_1.Severity.warning
45
45
  };
46
- }
47
- return {
48
- message: `${(0, i18n_1.t)('prompts.projectTypeLabel')}: ${axios_extension_1.AdaptationProjectType.ON_PREMISE}`,
49
- severity: yeoman_ui_types_1.Severity.information
50
- };
51
46
  };
52
47
  exports.getSystemAdditionalMessages = getSystemAdditionalMessages;
53
48
  /**
@@ -1,5 +1,6 @@
1
1
  import { AppRouterType } from '@sap-ux/adp-tooling';
2
2
  import type { CFApp, Endpoint, SourceApplication } from '@sap-ux/adp-tooling';
3
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
3
4
  import type { AdaptationDescriptor } from '@sap-ux/axios-extension';
4
5
  interface Choice {
5
6
  name: string;
@@ -33,6 +34,15 @@ export declare const getAppRouterChoices: (isInternalUsage: boolean) => {
33
34
  name: AppRouterType;
34
35
  value: AppRouterType;
35
36
  }[];
37
+ /**
38
+ * Creates the list of choices for the project type prompt.
39
+ *
40
+ * @returns {{ name: string; value: AdaptationProjectType }[]} The localized project type choices.
41
+ */
42
+ export declare const getProjectTypeChoices: () => {
43
+ name: string;
44
+ value: AdaptationProjectType;
45
+ }[];
36
46
  /**
37
47
  * Returns the choices for the adaptation prompt.
38
48
  *
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getKeyUserSystemChoices = exports.getAdaptationChoices = exports.getAppRouterChoices = exports.getCFAppChoices = exports.getApplicationChoices = void 0;
3
+ exports.getKeyUserSystemChoices = exports.getAdaptationChoices = exports.getProjectTypeChoices = exports.getAppRouterChoices = exports.getCFAppChoices = exports.getApplicationChoices = void 0;
4
4
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
5
+ const axios_extension_1 = require("@sap-ux/axios-extension");
6
+ const i18n_1 = require("../../../utils/i18n");
5
7
  /**
6
8
  * Creates a list of choices from a list of applications, formatted for display or selection in a UI.
7
9
  * Each choice consists of an application's title (or ID if no title), followed by its registration IDs and ACH, formatted for easy reading.
@@ -58,6 +60,16 @@ const getAppRouterChoices = (isInternalUsage) => {
58
60
  return options;
59
61
  };
60
62
  exports.getAppRouterChoices = getAppRouterChoices;
63
+ /**
64
+ * Creates the list of choices for the project type prompt.
65
+ *
66
+ * @returns {{ name: string; value: AdaptationProjectType }[]} The localized project type choices.
67
+ */
68
+ const getProjectTypeChoices = () => [
69
+ { name: (0, i18n_1.t)('prompts.projectTypeCloudReadyName'), value: axios_extension_1.AdaptationProjectType.CLOUD_READY },
70
+ { name: (0, i18n_1.t)('prompts.projectTypeOnPremName'), value: axios_extension_1.AdaptationProjectType.ON_PREMISE }
71
+ ];
72
+ exports.getProjectTypeChoices = getProjectTypeChoices;
61
73
  /**
62
74
  * Returns the choices for the adaptation prompt.
63
75
  *
@@ -1,4 +1,5 @@
1
- import type { ConfigAnswers, FlexUISupportedSystem, CfServicesAnswers, CFApp } from '@sap-ux/adp-tooling';
1
+ import type { ConfigAnswers, FlexUICapability, CfServicesAnswers, CFApp } from '@sap-ux/adp-tooling';
2
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
2
3
  /**
3
4
  * Determines if a credential question should be shown.
4
5
  * In this simplified approach, we show credentials if a system is provided and the login was not successful.
@@ -21,14 +22,21 @@ export declare function showApplicationQuestion(answers: ConfigAnswers, appsLoad
21
22
  /**
22
23
  * Determines if an extension project is allowed based on the system and application conditions.
23
24
  *
24
- * @param {ConfigAnswers} answers - The user-provided answers containing application details.
25
- * @param {FlexUISupportedSystem} flexUISystem - The system type info (e.g., onPremise/UIFlex).
26
- * @param {boolean} isCloudProject - Whether the system is a cloud-based system.
27
- * @param {boolean} isApplicationSupported - Whether the selected application is supported.
28
- * @param {boolean} hasSyncViews - Whether synchronized views exist for the app.
29
- * @returns {boolean | undefined} True if an extension project is allowed, otherwise false or undefined.
25
+ * @param params - Function parameters as an object literal.
26
+ * @param {boolean} params.isApplicationSelected - True if the user has selected an application.
27
+ * @param {boolean} params.isApplicationSupported - Whether the selected application is supported.
28
+ * @param {boolean} params.hasSyncViews - Whether synchronized views exist for the app.
29
+ * @param {AdaptationProjectType|undefined} params.projectType - The project type.
30
+ * @param {FlexUICapability | undefined} params.flexUICapability - The system type info (e.g., onPremise/UIFlex).
31
+ * @returns {boolean} True if an extension project is allowed, otherwise false or undefined.
30
32
  */
31
- export declare function showExtensionProjectQuestion(answers: ConfigAnswers, flexUISystem: FlexUISupportedSystem | undefined, isCloudProject: boolean | undefined, isApplicationSupported: boolean, hasSyncViews: boolean): boolean;
33
+ export declare function showExtensionProjectQuestion({ isApplicationSelected, isApplicationSupported, hasSyncViews, projectType, flexUICapability }: {
34
+ isApplicationSelected: boolean;
35
+ isApplicationSupported: boolean;
36
+ hasSyncViews: boolean;
37
+ projectType?: AdaptationProjectType;
38
+ flexUICapability?: FlexUICapability;
39
+ }): boolean;
32
40
  /**
33
41
  * Determines if an internal question for ACH and FioriId will be shown based on the answers and specific conditions.
34
42
  *
@@ -9,6 +9,7 @@ exports.shouldShowBaseAppPrompt = shouldShowBaseAppPrompt;
9
9
  exports.showStoreCredentialsQuestion = showStoreCredentialsQuestion;
10
10
  const btp_utils_1 = require("@sap-ux/btp-utils");
11
11
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
12
+ const axios_extension_1 = require("@sap-ux/axios-extension");
12
13
  /**
13
14
  * Determines if a credential question should be shown.
14
15
  * In this simplified approach, we show credentials if a system is provided and the login was not successful.
@@ -35,23 +36,21 @@ function showApplicationQuestion(answers, appsLoaded, isAuthRequired, isLoginSuc
35
36
  /**
36
37
  * Determines if an extension project is allowed based on the system and application conditions.
37
38
  *
38
- * @param {ConfigAnswers} answers - The user-provided answers containing application details.
39
- * @param {FlexUISupportedSystem} flexUISystem - The system type info (e.g., onPremise/UIFlex).
40
- * @param {boolean} isCloudProject - Whether the system is a cloud-based system.
41
- * @param {boolean} isApplicationSupported - Whether the selected application is supported.
42
- * @param {boolean} hasSyncViews - Whether synchronized views exist for the app.
43
- * @returns {boolean | undefined} True if an extension project is allowed, otherwise false or undefined.
39
+ * @param params - Function parameters as an object literal.
40
+ * @param {boolean} params.isApplicationSelected - True if the user has selected an application.
41
+ * @param {boolean} params.isApplicationSupported - Whether the selected application is supported.
42
+ * @param {boolean} params.hasSyncViews - Whether synchronized views exist for the app.
43
+ * @param {AdaptationProjectType|undefined} params.projectType - The project type.
44
+ * @param {FlexUICapability | undefined} params.flexUICapability - The system type info (e.g., onPremise/UIFlex).
45
+ * @returns {boolean} True if an extension project is allowed, otherwise false or undefined.
44
46
  */
45
- function showExtensionProjectQuestion(answers, flexUISystem, isCloudProject, isApplicationSupported, hasSyncViews) {
46
- if (!answers.application) {
47
- return false;
48
- }
49
- if (isCloudProject) {
47
+ function showExtensionProjectQuestion({ isApplicationSelected, isApplicationSupported, hasSyncViews, projectType, flexUICapability }) {
48
+ if (!isApplicationSelected || projectType === axios_extension_1.AdaptationProjectType.CLOUD_READY) {
50
49
  return false;
51
50
  }
52
- const isOnPremiseAppStudio = !!flexUISystem?.isOnPremise && (0, btp_utils_1.isAppStudio)();
53
- const nonFlexOrNonOnPremise = flexUISystem && (!flexUISystem?.isOnPremise || !flexUISystem?.isUIFlex);
54
- return (isOnPremiseAppStudio &&
51
+ const isDtaDeploymentSupportedAppStudio = !!flexUICapability?.isDtaFolderDeploymentSupported && (0, btp_utils_1.isAppStudio)();
52
+ const nonFlexOrNonOnPremise = flexUICapability && (!flexUICapability?.isDtaFolderDeploymentSupported || !flexUICapability?.isUIFlexSupported);
53
+ return (isDtaDeploymentSupportedAppStudio &&
55
54
  (!isApplicationSupported || (isApplicationSupported && (nonFlexOrNonOnPremise || hasSyncViews))));
56
55
  }
57
56
  /**
@@ -1,9 +1,9 @@
1
1
  import type Generator from 'yeoman-generator';
2
- import type { AppWizard } from '@sap-devx/yeoman-ui-types';
2
+ import type { AppWizard, Prompts as YeomanUiSteps } from '@sap-devx/yeoman-ui-types';
3
3
  import type { YUIQuestion } from '@sap-ux/inquirer-common';
4
4
  import type { TelemetryData } from '@sap-ux/fiori-generator-shared';
5
- import type { AdaptationDescriptor } from '@sap-ux/axios-extension';
6
- import type { AttributesAnswers, ConfigAnswers } from '@sap-ux/adp-tooling';
5
+ import type { AdaptationDescriptor, AdaptationProjectType } from '@sap-ux/axios-extension';
6
+ import type { AttributesAnswers, ConfigAnswers, FlexLayer } from '@sap-ux/adp-tooling';
7
7
  export interface AdpGeneratorOptions extends Generator.GeneratorOptions {
8
8
  /**
9
9
  * VSCode instance
@@ -35,6 +35,7 @@ export declare enum configPromptNames {
35
35
  username = "username",
36
36
  password = "password",
37
37
  storeCredentials = "storeCredentials",
38
+ projectType = "projectType",
38
39
  application = "application",
39
40
  appValidationCli = "appValidationCli",
40
41
  fioriId = "fioriId",
@@ -64,6 +65,10 @@ export interface PasswordPromptOptions {
64
65
  export interface StoreCredentialsPromptOptions {
65
66
  hide?: boolean;
66
67
  }
68
+ export interface ProjectTypePromptOptions {
69
+ default?: string;
70
+ hide?: boolean;
71
+ }
67
72
  export interface ApplicationPromptOptions {
68
73
  default?: string;
69
74
  hide?: boolean;
@@ -87,6 +92,7 @@ export type ConfigPromptOptions = Partial<{
87
92
  [configPromptNames.username]: UsernamePromptOptions;
88
93
  [configPromptNames.password]: PasswordPromptOptions;
89
94
  [configPromptNames.storeCredentials]: StoreCredentialsPromptOptions;
95
+ [configPromptNames.projectType]: ProjectTypePromptOptions;
90
96
  [configPromptNames.application]: ApplicationPromptOptions;
91
97
  [configPromptNames.appValidationCli]: CliValidationPromptOptions;
92
98
  [configPromptNames.fioriId]: FioriIdPromptOptions;
@@ -249,5 +255,19 @@ export interface JsonInput {
249
255
  targetFolder?: string;
250
256
  projectName?: string;
251
257
  namespace?: string;
258
+ projectType?: AdaptationProjectType;
259
+ }
260
+ export declare enum SystemType {
261
+ CLOUD_READY = "cloudReady",
262
+ ON_PREM = "onPremise"
263
+ }
264
+ export interface OptionalPromptsConfig {
265
+ projectType?: AdaptationProjectType;
266
+ systemType?: SystemType;
267
+ layer: FlexLayer;
268
+ ui5Versions: string[];
269
+ isVersionDetected: boolean;
270
+ prompts: YeomanUiSteps;
271
+ isCfEnv?: boolean;
252
272
  }
253
273
  //# sourceMappingURL=types.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cfLoginPromptNames = exports.TargetEnv = exports.targetEnvPromptNames = exports.keyUserPromptNames = exports.attributePromptNames = exports.configPromptNames = void 0;
3
+ exports.SystemType = exports.cfLoginPromptNames = exports.TargetEnv = exports.targetEnvPromptNames = exports.keyUserPromptNames = exports.attributePromptNames = exports.configPromptNames = void 0;
4
4
  /**
5
5
  * Enumeration of prompt names used in the configuration.
6
6
  */
@@ -11,6 +11,7 @@ var configPromptNames;
11
11
  configPromptNames["username"] = "username";
12
12
  configPromptNames["password"] = "password";
13
13
  configPromptNames["storeCredentials"] = "storeCredentials";
14
+ configPromptNames["projectType"] = "projectType";
14
15
  configPromptNames["application"] = "application";
15
16
  configPromptNames["appValidationCli"] = "appValidationCli";
16
17
  configPromptNames["fioriId"] = "fioriId";
@@ -55,4 +56,9 @@ var cfLoginPromptNames;
55
56
  cfLoginPromptNames["cfExternalLogin"] = "cfExternalLogin";
56
57
  cfLoginPromptNames["cfExternalLoginSuccessMessage"] = "cfExternalLoginSuccessMessage";
57
58
  })(cfLoginPromptNames || (exports.cfLoginPromptNames = cfLoginPromptNames = {}));
59
+ var SystemType;
60
+ (function (SystemType) {
61
+ SystemType["CLOUD_READY"] = "cloudReady";
62
+ SystemType["ON_PREM"] = "onPremise";
63
+ })(SystemType || (exports.SystemType = SystemType = {}));
58
64
  //# sourceMappingURL=types.js.map
@@ -42,6 +42,9 @@
42
42
  "projectTypeLabel": "Project Type",
43
43
  "projectNameLabel": "Project Name",
44
44
  "projectNameTooltip": "Enter the project name for your application variant.",
45
+ "projectTypeListLabel": "Select Project Type",
46
+ "projectTypeCloudReadyName": "Cloud Ready",
47
+ "projectTypeOnPremName": "onPremise",
45
48
  "appTitleLabel": "Application Title",
46
49
  "appTitleTooltip": "Enter the application title for your application variant.",
47
50
  "appTitleDefault": "App Variant Title",
@@ -3,6 +3,7 @@ import type { AppWizard, Prompts } from '@sap-devx/yeoman-ui-types';
3
3
  import type { ToolsLogger } from '@sap-ux/logger';
4
4
  import type { ManifestNamespace } from '@sap-ux/project-access';
5
5
  import type { ConfigAnswers, AttributesAnswers, SystemLookup, FlexLayer, Endpoint } from '@sap-ux/adp-tooling';
6
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
6
7
  /**
7
8
  * Parameters required for composing the extension project generator.
8
9
  */
@@ -29,6 +30,7 @@ interface DeployGenOptions {
29
30
  projectPath: string;
30
31
  connectedSystem: string;
31
32
  system?: Endpoint;
33
+ projectType?: AdaptationProjectType;
32
34
  }
33
35
  /**
34
36
  * Composes the FLP config sub-generator using `composeWith`. This generator is used to scaffold
@@ -55,7 +57,7 @@ export declare function addFlpGen({ projectRootPath, vscode, inbounds, layer, pr
55
57
  * @param {ToolsLogger} logger - Logger for info and error output
56
58
  * @param {AppWizard} appWizard - Optional AppWizard instance for displaying UI messages
57
59
  */
58
- export declare function addDeployGen({ projectName, projectPath, connectedSystem, system }: DeployGenOptions, composeWith: Generator['composeWith'], logger: ToolsLogger, appWizard: AppWizard): Promise<void>;
60
+ export declare function addDeployGen({ projectName, projectPath, connectedSystem, system, projectType }: DeployGenOptions, composeWith: Generator['composeWith'], logger: ToolsLogger, appWizard: AppWizard): Promise<void>;
59
61
  /**
60
62
  * Composes the extension project sub-generator if the base app is unsupported.
61
63
  *
@@ -5,6 +5,7 @@ exports.addDeployGen = addDeployGen;
5
5
  exports.addExtProjectGen = addExtProjectGen;
6
6
  const i18n_1 = require("./i18n");
7
7
  const extension_project_1 = require("../app/extension-project");
8
+ const axios_extension_1 = require("@sap-ux/axios-extension");
8
9
  /**
9
10
  * Static validation configuration for package prompts in ADP deployment.
10
11
  */
@@ -58,11 +59,12 @@ async function addFlpGen({ projectRootPath, vscode, inbounds, layer, prompts },
58
59
  * @param {ToolsLogger} logger - Logger for info and error output
59
60
  * @param {AppWizard} appWizard - Optional AppWizard instance for displaying UI messages
60
61
  */
61
- async function addDeployGen({ projectName, projectPath, connectedSystem, system }, composeWith, logger, appWizard) {
62
+ async function addDeployGen({ projectName, projectPath, connectedSystem, system, projectType }, composeWith, logger, appWizard) {
62
63
  try {
64
+ const hideIfOnPremise = projectType === axios_extension_1.AdaptationProjectType.ON_PREMISE;
63
65
  const subGenPromptOptions = {
64
- ui5AbapRepo: { hideIfOnPremise: true },
65
- transportInputChoice: { hideIfOnPremise: true },
66
+ ui5AbapRepo: { hideIfOnPremise },
67
+ transportInputChoice: { hideIfOnPremise },
66
68
  overwriteAbapConfig: { hide: true },
67
69
  packageAutocomplete: {
68
70
  additionalValidation: PACKAGE_ADDITIONAL_VALIDATION
@@ -70,12 +72,13 @@ async function addDeployGen({ projectName, projectPath, connectedSystem, system
70
72
  packageManual: {
71
73
  additionalValidation: PACKAGE_ADDITIONAL_VALIDATION
72
74
  },
73
- targetSystem: { additionalValidation: { shouldRestrictDifferentSystemType: true } }
75
+ adpProjectType: projectType
74
76
  };
75
77
  const generatorOptions = {
76
78
  launchDeployConfigAsSubGenerator: true,
77
79
  projectName,
78
80
  projectPath,
81
+ adpProjectType: projectType,
79
82
  telemetryData: { appType: 'Fiori Adaptation' },
80
83
  appWizard,
81
84
  logWrapper: logger,
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.8.18",
6
+ "version": "0.9.1",
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": "25.8.0",
31
31
  "yeoman-generator": "5.10.0",
32
32
  "uuid": "10.0.0",
33
- "@sap-ux/adp-tooling": "0.18.63",
34
- "@sap-ux/axios-extension": "1.25.11",
35
- "@sap-ux/btp-utils": "1.1.8",
33
+ "@sap-ux/adp-tooling": "0.18.65",
34
+ "@sap-ux/axios-extension": "1.25.13",
35
+ "@sap-ux/btp-utils": "1.1.9",
36
36
  "@sap-ux/feature-toggle": "0.3.6",
37
- "@sap-ux/inquirer-common": "0.11.5",
37
+ "@sap-ux/inquirer-common": "0.11.7",
38
38
  "@sap-ux/logger": "0.8.1",
39
- "@sap-ux/project-access": "1.35.3",
39
+ "@sap-ux/project-access": "1.35.4",
40
40
  "@sap-ux/store": "1.5.6",
41
- "@sap-ux/system-access": "0.6.51",
42
- "@sap-ux/project-input-validator": "0.6.55",
43
- "@sap-ux/fiori-generator-shared": "0.13.71",
44
- "@sap-ux/odata-service-writer": "0.29.18",
45
- "@sap-ux/telemetry": "0.6.72"
41
+ "@sap-ux/system-access": "0.6.53",
42
+ "@sap-ux/project-input-validator": "0.6.56",
43
+ "@sap-ux/fiori-generator-shared": "0.13.73",
44
+ "@sap-ux/odata-service-writer": "0.29.19",
45
+ "@sap-ux/telemetry": "0.6.74"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@jest/types": "30.0.1",
@@ -57,7 +57,7 @@
57
57
  "fs-extra": "10.0.0",
58
58
  "rimraf": "6.1.2",
59
59
  "yeoman-test": "6.3.0",
60
- "@sap-ux/deploy-config-sub-generator": "0.5.78"
60
+ "@sap-ux/deploy-config-sub-generator": "0.5.80"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=20.x"