@sap-ux/abap-deploy-config-sub-generator 0.0.53 → 0.0.54

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.
@@ -46,5 +46,5 @@ export default class extends DeploymentGenerator {
46
46
  export { AbapDeployConfigQuestion, AbapDeployConfigAnswersInternal };
47
47
  export { getAbapQuestions } from './questions';
48
48
  export { indexHtmlExists } from '../utils';
49
- export { AbapDeployConfigOptions, DeployProjectType } from './types';
49
+ export { AbapDeployConfigOptions, DeployProjectType, AbapDeployConfigPromptOptions } from './types';
50
50
  //# sourceMappingURL=index.d.ts.map
@@ -132,15 +132,29 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
132
132
  return;
133
133
  }
134
134
  if (!this.launchDeployConfigAsSubGenerator) {
135
+ const appType = await (0, project_access_1.getAppType)(this.destinationPath());
136
+ const isAdp = appType === 'Fiori Adaptation';
137
+ const promptOptions = {
138
+ ui5AbapRepo: { hideIfOnPremise: isAdp },
139
+ transportInputChoice: { hideIfOnPremise: isAdp },
140
+ packageAutocomplete: {
141
+ shouldValidatePackageForStartingPrefix: isAdp,
142
+ shouldValidatePackageType: isAdp
143
+ },
144
+ packageManual: { shouldValidatePackageForStartingPrefix: isAdp, shouldValidatePackageType: isAdp },
145
+ targetSystem: { shouldRestrictDifferentSystemType: isAdp }
146
+ };
147
+ const indexGenerationAllowed = this.indexGenerationAllowed && !isAdp;
135
148
  const { prompts: abapDeployConfigPrompts, answers: abapAnswers = {} } = await (0, questions_1.getAbapQuestions)({
136
149
  appRootPath: this.destinationRoot(),
137
150
  connectedSystem: this.options.connectedSystem,
138
151
  backendConfig: this.backendConfig,
139
152
  configFile: this.options.config,
140
- indexGenerationAllowed: this.indexGenerationAllowed,
153
+ indexGenerationAllowed,
141
154
  showOverwriteQuestion: (0, deploy_config_generator_shared_1.showOverwriteQuestion)(this.launchDeployConfigAsSubGenerator, this.launchStandaloneFromYui, this.options.overwrite, this.configExists),
142
155
  projectType: this.projectType,
143
- logger: deploy_config_generator_shared_1.DeploymentGenerator.logger
156
+ logger: deploy_config_generator_shared_1.DeploymentGenerator.logger,
157
+ promptOptions
144
158
  });
145
159
  const prompAnswers = await this.prompt(abapDeployConfigPrompts);
146
160
  this.answers = (0, abap_deploy_config_inquirer_1.reconcileAnswers)(prompAnswers, abapAnswers);
@@ -2,7 +2,7 @@ import type { ILogWrapper } from '@sap-ux/fiori-generator-shared';
2
2
  import type { AbapDeployConfigAnswersInternal, AbapDeployConfigQuestion } from '@sap-ux/abap-deploy-config-inquirer';
3
3
  import type { FioriToolsProxyConfigBackend } from '@sap-ux/ui5-config';
4
4
  import type { ConnectedSystem } from '@sap-ux/deploy-config-generator-shared';
5
- import { DeployProjectType } from './types';
5
+ import { DeployProjectType, type AbapDeployConfigPromptOptions } from './types';
6
6
  /**
7
7
  * Retrieves the ABAP prompt questions from the inquirer.
8
8
  *
@@ -15,9 +15,10 @@ import { DeployProjectType } from './types';
15
15
  * @param params.showOverwriteQuestion - whether the overwrite question should be shown
16
16
  * @param params.projectType - the project type
17
17
  * @param params.logger - the logger
18
+ * @param params.promptOptions - A set of optional feature flags to prompts behavior.
18
19
  * @returns - the prompts and answers
19
20
  */
20
- export declare function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, configFile, indexGenerationAllowed, showOverwriteQuestion, projectType, logger }: {
21
+ export declare function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, configFile, indexGenerationAllowed, showOverwriteQuestion, projectType, promptOptions, logger }: {
21
22
  appRootPath: string;
22
23
  connectedSystem?: ConnectedSystem;
23
24
  backendConfig?: FioriToolsProxyConfigBackend;
@@ -25,6 +26,7 @@ export declare function getAbapQuestions({ appRootPath, connectedSystem, backend
25
26
  indexGenerationAllowed?: boolean;
26
27
  showOverwriteQuestion?: boolean;
27
28
  projectType?: DeployProjectType;
29
+ promptOptions?: AbapDeployConfigPromptOptions;
28
30
  logger?: ILogWrapper;
29
31
  }): Promise<{
30
32
  prompts: AbapDeployConfigQuestion[];
@@ -65,9 +65,10 @@ function getAbapTarget(destination, backendSystem, existingAbapDeployTask, backe
65
65
  * @param params.showOverwriteQuestion - whether the overwrite question should be shown
66
66
  * @param params.projectType - the project type
67
67
  * @param params.logger - the logger
68
+ * @param params.promptOptions - A set of optional feature flags to prompts behavior.
68
69
  * @returns - the prompts and answers
69
70
  */
70
- async function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, configFile = project_access_1.FileName.UI5DeployYaml, indexGenerationAllowed = false, showOverwriteQuestion = false, projectType = types_1.DeployProjectType.Application, logger }) {
71
+ async function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, configFile = project_access_1.FileName.UI5DeployYaml, indexGenerationAllowed = false, showOverwriteQuestion = false, projectType = types_1.DeployProjectType.Application, promptOptions = {}, logger }) {
71
72
  const { backendSystem, serviceProvider, destination } = connectedSystem || {};
72
73
  let existingAbapDeployTask;
73
74
  try {
@@ -89,13 +90,34 @@ async function getAbapQuestions({ appRootPath, connectedSystem, backendConfig, c
89
90
  serviceProvider,
90
91
  type: projectType
91
92
  },
92
- ui5AbapRepo: { default: deployAppConfig?.name },
93
+ ui5AbapRepo: {
94
+ default: deployAppConfig?.name,
95
+ hideIfOnPremise: promptOptions?.ui5AbapRepo?.hideIfOnPremise ?? false
96
+ },
93
97
  description: { default: deployAppConfig?.description },
94
- packageManual: { default: deployAppConfig?.package },
98
+ packageManual: {
99
+ default: deployAppConfig?.package,
100
+ additionalValidation: {
101
+ shouldValidatePackageType: promptOptions?.packageAutocomplete?.shouldValidatePackageType ?? false,
102
+ shouldValidatePackageForStartingPrefix: promptOptions?.packageAutocomplete?.shouldValidatePackageForStartingPrefix ?? false
103
+ }
104
+ },
95
105
  transportManual: { default: deployAppConfig?.transport },
96
106
  index: { indexGenerationAllowed },
97
- packageAutocomplete: { useAutocomplete: true },
98
- overwrite: { hide: !showOverwriteQuestion }
107
+ packageAutocomplete: {
108
+ useAutocomplete: true,
109
+ additionalValidation: {
110
+ shouldValidatePackageType: promptOptions?.packageAutocomplete?.shouldValidatePackageType ?? false,
111
+ shouldValidatePackageForStartingPrefix: promptOptions?.packageAutocomplete?.shouldValidatePackageForStartingPrefix ?? false
112
+ }
113
+ },
114
+ overwrite: { hide: !showOverwriteQuestion },
115
+ transportInputChoice: { hideIfOnPremise: promptOptions?.transportInputChoice?.hideIfOnPremise ?? false },
116
+ targetSystem: {
117
+ additionalValidation: {
118
+ shouldRestrictDifferentSystemType: promptOptions?.targetSystem?.shouldRestrictDifferentSystemType ?? false
119
+ }
120
+ }
99
121
  }, logger, (0, fiori_generator_shared_1.getHostEnvironment)() !== fiori_generator_shared_1.hostEnvironment.cli);
100
122
  }
101
123
  //# sourceMappingURL=questions.js.map
@@ -52,4 +52,26 @@ export declare enum DeployProjectType {
52
52
  Application = "application",
53
53
  Library = "library"
54
54
  }
55
+ /**
56
+ * Enum defining prompt names for ABAP deployment configuration.
57
+ */
58
+ declare enum promptNames {
59
+ ui5AbapRepo = "ui5AbapRepo",
60
+ packageManual = "packageManual",
61
+ packageAutocomplete = "packageAutocomplete",
62
+ transportInputChoice = "transportInputChoice",
63
+ targetSystem = "targetSystem"
64
+ }
65
+ type HideIfOnPremisePromptOption = {
66
+ hideIfOnPremise?: boolean;
67
+ };
68
+ type TargetSystemPromptOptions = {
69
+ shouldRestrictDifferentSystemType: boolean;
70
+ };
71
+ type PackageAdditionalValidationPrompOptions = {
72
+ shouldValidatePackageType?: boolean;
73
+ shouldValidatePackageForStartingPrefix?: boolean;
74
+ };
75
+ export type AbapDeployConfigPromptOptions = Partial<Record<promptNames.ui5AbapRepo, HideIfOnPremisePromptOption> & Record<promptNames.transportInputChoice, HideIfOnPremisePromptOption> & Record<promptNames.packageManual, PackageAdditionalValidationPrompOptions> & Record<promptNames.packageAutocomplete, PackageAdditionalValidationPrompOptions> & Record<promptNames.targetSystem, TargetSystemPromptOptions>>;
76
+ export {};
55
77
  //# sourceMappingURL=types.d.ts.map
@@ -6,4 +6,15 @@ var DeployProjectType;
6
6
  DeployProjectType["Application"] = "application";
7
7
  DeployProjectType["Library"] = "library";
8
8
  })(DeployProjectType || (exports.DeployProjectType = DeployProjectType = {}));
9
+ /**
10
+ * Enum defining prompt names for ABAP deployment configuration.
11
+ */
12
+ var promptNames;
13
+ (function (promptNames) {
14
+ promptNames["ui5AbapRepo"] = "ui5AbapRepo";
15
+ promptNames["packageManual"] = "packageManual";
16
+ promptNames["packageAutocomplete"] = "packageAutocomplete";
17
+ promptNames["transportInputChoice"] = "transportInputChoice";
18
+ promptNames["targetSystem"] = "targetSystem";
19
+ })(promptNames || (promptNames = {}));
9
20
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/SAP/open-ux-tools.git",
7
7
  "directory": "packages/abap-deploy-config-sub-generator"
8
8
  },
9
- "version": "0.0.53",
9
+ "version": "0.0.54",
10
10
  "license": "Apache-2.0",
11
11
  "main": "generators/app/index.js",
12
12
  "files": [
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "i18next": "23.5.1",
23
23
  "@sap-devx/yeoman-ui-types": "1.14.4",
24
- "@sap-ux/abap-deploy-config-inquirer": "1.2.33",
24
+ "@sap-ux/abap-deploy-config-inquirer": "1.2.34",
25
25
  "@sap-ux/abap-deploy-config-writer": "0.0.100",
26
26
  "@sap-ux/btp-utils": "1.0.2",
27
27
  "@sap-ux/deploy-config-generator-shared": "0.0.39",