@sap-ux/generator-adp 0.10.11 → 1.0.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.
Files changed (58) hide show
  1. package/generators/add-annotations-to-odata/index.d.ts +3 -3
  2. package/generators/add-annotations-to-odata/index.js +15 -19
  3. package/generators/add-component-usages/index.d.ts +3 -3
  4. package/generators/add-component-usages/index.js +16 -20
  5. package/generators/add-new-model/index.d.ts +3 -3
  6. package/generators/add-new-model/index.js +24 -28
  7. package/generators/app/extension-project/index.d.ts +1 -1
  8. package/generators/app/extension-project/index.js +6 -9
  9. package/generators/app/index.d.ts +1 -1
  10. package/generators/app/index.js +129 -135
  11. package/generators/app/layer.js +5 -7
  12. package/generators/app/questions/attributes.d.ts +2 -2
  13. package/generators/app/questions/attributes.js +60 -65
  14. package/generators/app/questions/cf-services.js +48 -52
  15. package/generators/app/questions/configuration.d.ts +3 -3
  16. package/generators/app/questions/configuration.js +125 -129
  17. package/generators/app/questions/helper/additional-messages.js +29 -36
  18. package/generators/app/questions/helper/choices.js +16 -25
  19. package/generators/app/questions/helper/conditions.js +14 -23
  20. package/generators/app/questions/helper/default-values.js +8 -13
  21. package/generators/app/questions/helper/message.js +7 -11
  22. package/generators/app/questions/helper/tooltip.js +4 -7
  23. package/generators/app/questions/helper/validators.js +29 -39
  24. package/generators/app/questions/key-user.d.ts +1 -1
  25. package/generators/app/questions/key-user.js +40 -45
  26. package/generators/app/questions/target-env.d.ts +2 -2
  27. package/generators/app/questions/target-env.js +22 -27
  28. package/generators/app/types.js +13 -16
  29. package/generators/base/questions/credentials.d.ts +1 -1
  30. package/generators/base/questions/credentials.js +15 -18
  31. package/generators/base/sub-gen-auth-base.d.ts +3 -3
  32. package/generators/base/sub-gen-auth-base.js +24 -30
  33. package/generators/base/sub-gen-base.d.ts +5 -6
  34. package/generators/base/sub-gen-base.js +11 -17
  35. package/generators/change-data-source/index.d.ts +3 -3
  36. package/generators/change-data-source/index.js +8 -12
  37. package/generators/telemetry/collector.d.ts +1 -1
  38. package/generators/telemetry/collector.js +6 -10
  39. package/generators/telemetry/events.js +2 -5
  40. package/generators/telemetry/index.d.ts +2 -2
  41. package/generators/telemetry/index.js +2 -18
  42. package/generators/types.js +2 -5
  43. package/generators/utils/appWizardCache.d.ts +1 -1
  44. package/generators/utils/appWizardCache.js +7 -13
  45. package/generators/utils/deps.js +10 -45
  46. package/generators/utils/i18n.js +13 -23
  47. package/generators/utils/logger.js +4 -7
  48. package/generators/utils/opts.js +3 -6
  49. package/generators/utils/parse-json-input.d.ts +1 -1
  50. package/generators/utils/parse-json-input.js +5 -9
  51. package/generators/utils/steps.d.ts +1 -1
  52. package/generators/utils/steps.js +37 -48
  53. package/generators/utils/subgenHelpers.js +9 -14
  54. package/generators/utils/templates.js +7 -8
  55. package/generators/utils/type-guards.d.ts +1 -1
  56. package/generators/utils/type-guards.js +2 -6
  57. package/generators/utils/workspace.js +7 -13
  58. package/package.json +19 -17
@@ -1,17 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPrompts = getPrompts;
4
- exports.getAddDeployConfigPrompt = getAddDeployConfigPrompt;
5
- exports.getFlpConfigPrompt = getFlpConfigPrompt;
6
- const adp_tooling_1 = require("@sap-ux/adp-tooling");
7
- const project_input_validator_1 = require("@sap-ux/project-input-validator");
8
- const i18n_1 = require("../../utils/i18n");
9
- const types_1 = require("../types");
10
- const tooltip_1 = require("./helper/tooltip");
11
- const additional_messages_1 = require("./helper/additional-messages");
12
- const steps_1 = require("../../utils/steps");
13
- const default_values_1 = require("./helper/default-values");
14
- const axios_extension_1 = require("@sap-ux/axios-extension");
1
+ import { FlexLayer, validateUI5VersionExists } from '@sap-ux/adp-tooling';
2
+ import { validateEmptyString, validateNamespaceAdp, validateProjectFolder, validateProjectName } from '@sap-ux/project-input-validator';
3
+ import { t } from '../../utils/i18n.js';
4
+ import { attributePromptNames, SystemType } from '../types.js';
5
+ import { getProjectNameTooltip } from './helper/tooltip.js';
6
+ import { getVersionAdditionalMessages } from './helper/additional-messages.js';
7
+ import { updateWizardSteps, getDeployPage, updateFlpWizardSteps, getKeyUserImportPage } from '../../utils/steps.js';
8
+ import { getDefaultProjectName, getDefaultNamespace, getDefaultVersion } from './helper/default-values.js';
9
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
15
10
  /**
16
11
  * Returns all project attribute prompts, filtering based on promptOptions.
17
12
  *
@@ -20,20 +15,20 @@ const axios_extension_1 = require("@sap-ux/axios-extension");
20
15
  * @param {AttributePromptOptions} [promptOptions] - Optional settings to control visibility and defaults.
21
16
  * @returns {AttributesQuestion[]} An array of prompt objects for basic info input.
22
17
  */
23
- function getPrompts(path, config, promptOptions) {
18
+ export function getPrompts(path, config, promptOptions) {
24
19
  const { isVersionDetected, ui5Versions, systemType, projectType, layer, prompts, isCfEnv = false } = config;
25
- const isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
20
+ const isCustomerBase = layer === FlexLayer.CUSTOMER_BASE;
26
21
  const keyedPrompts = {
27
- [types_1.attributePromptNames.projectName]: getProjectNamePrompt(path, isCustomerBase, isCfEnv, promptOptions?.[types_1.attributePromptNames.projectName]),
28
- [types_1.attributePromptNames.title]: getApplicationTitlePrompt(promptOptions?.[types_1.attributePromptNames.title]),
29
- [types_1.attributePromptNames.namespace]: getNamespacePrompt(isCustomerBase, promptOptions?.[types_1.attributePromptNames.namespace]),
30
- [types_1.attributePromptNames.targetFolder]: getTargetFolderPrompt(promptOptions?.[types_1.attributePromptNames.targetFolder]),
31
- [types_1.attributePromptNames.ui5Version]: getUi5VersionPrompt(ui5Versions, isVersionDetected, systemType),
32
- [types_1.attributePromptNames.ui5ValidationCli]: getUi5VersionValidationPromptForCli(),
33
- [types_1.attributePromptNames.enableTypeScript]: getEnableTypeScriptPrompt(promptOptions?.[types_1.attributePromptNames.enableTypeScript]),
34
- [types_1.attributePromptNames.addDeployConfig]: getAddDeployConfigPrompt(prompts, promptOptions?.[types_1.attributePromptNames.addDeployConfig]),
35
- [types_1.attributePromptNames.addFlpConfig]: getFlpConfigPrompt(prompts, projectType, promptOptions?.[types_1.attributePromptNames.addFlpConfig], isCfEnv),
36
- [types_1.attributePromptNames.importKeyUserChanges]: getImportKeyUserChangesPrompt(prompts, promptOptions?.[types_1.attributePromptNames.importKeyUserChanges])
22
+ [attributePromptNames.projectName]: getProjectNamePrompt(path, isCustomerBase, isCfEnv, promptOptions?.[attributePromptNames.projectName]),
23
+ [attributePromptNames.title]: getApplicationTitlePrompt(promptOptions?.[attributePromptNames.title]),
24
+ [attributePromptNames.namespace]: getNamespacePrompt(isCustomerBase, promptOptions?.[attributePromptNames.namespace]),
25
+ [attributePromptNames.targetFolder]: getTargetFolderPrompt(promptOptions?.[attributePromptNames.targetFolder]),
26
+ [attributePromptNames.ui5Version]: getUi5VersionPrompt(ui5Versions, isVersionDetected, systemType),
27
+ [attributePromptNames.ui5ValidationCli]: getUi5VersionValidationPromptForCli(),
28
+ [attributePromptNames.enableTypeScript]: getEnableTypeScriptPrompt(promptOptions?.[attributePromptNames.enableTypeScript]),
29
+ [attributePromptNames.addDeployConfig]: getAddDeployConfigPrompt(prompts, promptOptions?.[attributePromptNames.addDeployConfig]),
30
+ [attributePromptNames.addFlpConfig]: getFlpConfigPrompt(prompts, projectType, promptOptions?.[attributePromptNames.addFlpConfig], isCfEnv),
31
+ [attributePromptNames.importKeyUserChanges]: getImportKeyUserChangesPrompt(prompts, promptOptions?.[attributePromptNames.importKeyUserChanges])
37
32
  };
38
33
  const questions = Object.entries(keyedPrompts)
39
34
  .filter(([promptName]) => {
@@ -55,15 +50,15 @@ function getPrompts(path, config, promptOptions) {
55
50
  function getProjectNamePrompt(path, isCustomerBase, isCfEnv, _) {
56
51
  return {
57
52
  type: 'input',
58
- name: types_1.attributePromptNames.projectName,
59
- message: (0, i18n_1.t)('prompts.projectNameLabel'),
60
- default: (answers) => (0, default_values_1.getDefaultProjectName)(answers.targetFolder || path),
53
+ name: attributePromptNames.projectName,
54
+ message: t('prompts.projectNameLabel'),
55
+ default: (answers) => getDefaultProjectName(answers.targetFolder || path),
61
56
  guiOptions: {
62
57
  mandatory: true,
63
58
  breadcrumb: true,
64
- hint: (0, tooltip_1.getProjectNameTooltip)(isCustomerBase)
59
+ hint: getProjectNameTooltip(isCustomerBase)
65
60
  },
66
- validate: (value, answers) => (0, project_input_validator_1.validateProjectName)(value, answers.targetFolder || path, isCustomerBase, isCfEnv),
61
+ validate: (value, answers) => validateProjectName(value, answers.targetFolder || path, isCustomerBase, isCfEnv),
67
62
  store: false
68
63
  };
69
64
  }
@@ -76,15 +71,15 @@ function getProjectNamePrompt(path, isCustomerBase, isCfEnv, _) {
76
71
  function getApplicationTitlePrompt(options) {
77
72
  return {
78
73
  type: 'input',
79
- name: types_1.attributePromptNames.title,
80
- message: (0, i18n_1.t)('prompts.appTitleLabel'),
81
- default: options?.default ?? (0, i18n_1.t)('prompts.appTitleDefault'),
74
+ name: attributePromptNames.title,
75
+ message: t('prompts.appTitleLabel'),
76
+ default: options?.default ?? t('prompts.appTitleDefault'),
82
77
  guiOptions: {
83
78
  mandatory: true,
84
79
  breadcrumb: true,
85
- hint: (0, i18n_1.t)('prompts.appTitleTooltip')
80
+ hint: t('prompts.appTitleTooltip')
86
81
  },
87
- validate: project_input_validator_1.validateEmptyString,
82
+ validate: validateEmptyString,
88
83
  store: false
89
84
  };
90
85
  }
@@ -98,9 +93,9 @@ function getApplicationTitlePrompt(options) {
98
93
  function getNamespacePrompt(isCustomerBase, options) {
99
94
  const prompt = {
100
95
  type: 'input',
101
- name: types_1.attributePromptNames.namespace,
102
- message: (0, i18n_1.t)('prompts.namespaceLabel'),
103
- default: (answers) => options?.default ?? (0, default_values_1.getDefaultNamespace)(answers.projectName, isCustomerBase),
96
+ name: attributePromptNames.namespace,
97
+ message: t('prompts.namespaceLabel'),
98
+ default: (answers) => options?.default ?? getDefaultNamespace(answers.projectName, isCustomerBase),
104
99
  guiOptions: {
105
100
  applyDefaultWhenDirty: true
106
101
  },
@@ -113,7 +108,7 @@ function getNamespacePrompt(isCustomerBase, options) {
113
108
  else {
114
109
  prompt.guiOptions.mandatory = true;
115
110
  prompt.guiOptions.breadcrumb = true;
116
- prompt.validate = (value, answers) => (0, project_input_validator_1.validateNamespaceAdp)(value, answers.projectName, isCustomerBase);
111
+ prompt.validate = (value, answers) => validateNamespaceAdp(value, answers.projectName, isCustomerBase);
117
112
  }
118
113
  return prompt;
119
114
  }
@@ -127,14 +122,14 @@ function getTargetFolderPrompt(options) {
127
122
  return {
128
123
  type: 'input',
129
124
  name: 'targetFolder',
130
- message: (0, i18n_1.t)('prompts.projectFolderLabel'),
125
+ message: t('prompts.projectFolderLabel'),
131
126
  guiOptions: {
132
127
  type: 'folder-browser',
133
128
  applyDefaultWhenDirty: true,
134
129
  mandatory: true,
135
- breadcrumb: (0, i18n_1.t)('prompts.projectFolderPath')
130
+ breadcrumb: t('prompts.projectFolderPath')
136
131
  },
137
- validate: (value, answers) => (0, project_input_validator_1.validateProjectFolder)(value, answers.projectName),
132
+ validate: (value, answers) => validateProjectFolder(value, answers.projectName),
138
133
  default: (answers) => answers.targetFolder || options?.default,
139
134
  store: false
140
135
  };
@@ -150,19 +145,19 @@ function getTargetFolderPrompt(options) {
150
145
  function getUi5VersionPrompt(ui5Versions, isVersionDetected, systemType) {
151
146
  return {
152
147
  type: 'list',
153
- name: types_1.attributePromptNames.ui5Version,
154
- message: (0, i18n_1.t)('prompts.ui5VersionLabel'),
155
- when: systemType !== types_1.SystemType.CLOUD_READY,
148
+ name: attributePromptNames.ui5Version,
149
+ message: t('prompts.ui5VersionLabel'),
150
+ when: systemType !== SystemType.CLOUD_READY,
156
151
  choices: ui5Versions,
157
152
  guiOptions: {
158
153
  applyDefaultWhenDirty: true,
159
- hint: (0, i18n_1.t)('prompts.ui5VersionTooltip'),
154
+ hint: t('prompts.ui5VersionTooltip'),
160
155
  breadcrumb: true,
161
156
  mandatory: true
162
157
  },
163
- validate: async (version) => await (0, adp_tooling_1.validateUI5VersionExists)(version),
164
- default: async () => await (0, default_values_1.getDefaultVersion)(ui5Versions),
165
- additionalMessages: () => (0, additional_messages_1.getVersionAdditionalMessages)(isVersionDetected)
158
+ validate: async (version) => await validateUI5VersionExists(version),
159
+ default: async () => await getDefaultVersion(ui5Versions),
160
+ additionalMessages: () => getVersionAdditionalMessages(isVersionDetected)
166
161
  };
167
162
  }
168
163
  /**
@@ -172,12 +167,12 @@ function getUi5VersionPrompt(ui5Versions, isVersionDetected, systemType) {
172
167
  */
173
168
  function getUi5VersionValidationPromptForCli() {
174
169
  return {
175
- name: types_1.attributePromptNames.ui5ValidationCli,
170
+ name: attributePromptNames.ui5ValidationCli,
176
171
  when: async (answers) => {
177
172
  if (!answers.ui5Version) {
178
173
  return false;
179
174
  }
180
- const result = await (0, adp_tooling_1.validateUI5VersionExists)(answers.ui5Version);
175
+ const result = await validateUI5VersionExists(answers.ui5Version);
181
176
  if (typeof result === 'string') {
182
177
  throw new Error(result);
183
178
  }
@@ -194,7 +189,7 @@ function getUi5VersionValidationPromptForCli() {
194
189
  function getEnableTypeScriptPrompt(_) {
195
190
  return {
196
191
  type: 'confirm',
197
- name: types_1.attributePromptNames.enableTypeScript,
192
+ name: attributePromptNames.enableTypeScript,
198
193
  message: 'Enable TypeScript',
199
194
  default: false,
200
195
  guiOptions: {
@@ -209,17 +204,17 @@ function getEnableTypeScriptPrompt(_) {
209
204
  * @param {AddDeployConfigPromptOptions} [_] - Optional prompt options to control visibility.
210
205
  * @returns {AttributesQuestion} The prompt configuration for Add Deployment config confirmation.
211
206
  */
212
- function getAddDeployConfigPrompt(prompts, _) {
207
+ export function getAddDeployConfigPrompt(prompts, _) {
213
208
  return {
214
209
  type: 'confirm',
215
- name: types_1.attributePromptNames.addDeployConfig,
216
- message: (0, i18n_1.t)('prompts.addDeployConfig'),
210
+ name: attributePromptNames.addDeployConfig,
211
+ message: t('prompts.addDeployConfig'),
217
212
  default: false,
218
213
  guiOptions: {
219
214
  breadcrumb: true
220
215
  },
221
216
  validate: (value) => {
222
- (0, steps_1.updateWizardSteps)(prompts, (0, steps_1.getDeployPage)(), (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), value);
217
+ updateWizardSteps(prompts, getDeployPage(), t('yuiNavSteps.projectAttributesName'), value);
223
218
  return true;
224
219
  }
225
220
  };
@@ -233,18 +228,18 @@ function getAddDeployConfigPrompt(prompts, _) {
233
228
  * @param {boolean} isCfEnv - Whether the project targets Cloud Foundry.
234
229
  * @returns {AttributesQuestion} The prompt configuration for Add FLP config confirmation.
235
230
  */
236
- function getFlpConfigPrompt(prompts, projectType, options, isCfEnv) {
231
+ export function getFlpConfigPrompt(prompts, projectType, options, isCfEnv) {
237
232
  return {
238
233
  type: 'confirm',
239
- name: types_1.attributePromptNames.addFlpConfig,
240
- message: (0, i18n_1.t)('prompts.addFlpConfig'),
234
+ name: attributePromptNames.addFlpConfig,
235
+ message: t('prompts.addFlpConfig'),
241
236
  default: false,
242
237
  guiOptions: {
243
238
  breadcrumb: true
244
239
  },
245
- when: () => isCfEnv || projectType === axios_extension_1.AdaptationProjectType.CLOUD_READY,
240
+ when: () => isCfEnv || projectType === AdaptationProjectType.CLOUD_READY,
246
241
  validate: (value, answers) => {
247
- (0, steps_1.updateFlpWizardSteps)(!!options?.hasBaseAppInbounds, prompts, answers.projectName, value);
242
+ updateFlpWizardSteps(!!options?.hasBaseAppInbounds, prompts, answers.projectName, value);
248
243
  return true;
249
244
  }
250
245
  };
@@ -259,14 +254,14 @@ function getFlpConfigPrompt(prompts, projectType, options, isCfEnv) {
259
254
  function getImportKeyUserChangesPrompt(prompts, options) {
260
255
  return {
261
256
  type: 'confirm',
262
- name: types_1.attributePromptNames.importKeyUserChanges,
263
- message: (0, i18n_1.t)('prompts.importKeyUserChangesLabel'),
257
+ name: attributePromptNames.importKeyUserChanges,
258
+ message: t('prompts.importKeyUserChangesLabel'),
264
259
  default: options?.default ?? false,
265
260
  guiOptions: {
266
261
  breadcrumb: true
267
262
  },
268
263
  validate: (value) => {
269
- (0, steps_1.updateWizardSteps)(prompts, (0, steps_1.getKeyUserImportPage)(), (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), value);
264
+ updateWizardSteps(prompts, getKeyUserImportPage(), t('yuiNavSteps.projectAttributesName'), value);
270
265
  return true;
271
266
  }
272
267
  };
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CFServicesPrompter = void 0;
4
- const adp_tooling_1 = require("@sap-ux/adp-tooling");
5
- const project_input_validator_1 = require("@sap-ux/project-input-validator");
6
- const i18n_1 = require("../../utils/i18n");
7
- const validators_1 = require("./helper/validators");
8
- const choices_1 = require("./helper/choices");
9
- const conditions_1 = require("./helper/conditions");
1
+ import { cfServicesPromptNames, getModuleNames, getApprouterType, hasApprouter, isLoggedInCf, getMtaServices, getCfApps, downloadAppContent, validateSmartTemplateApplication, validateODataEndpoints, getBusinessServiceInfo, getOAuthPathsFromXsApp, getBackendUrlsFromServiceKeys } from '@sap-ux/adp-tooling';
2
+ import { validateEmptyString } from '@sap-ux/project-input-validator';
3
+ import { t } from '../../utils/i18n.js';
4
+ import { validateBusinessSolutionName } from './helper/validators.js';
5
+ import { getAppRouterChoices, getCFAppChoices } from './helper/choices.js';
6
+ import { shouldShowBaseAppPrompt, showBusinessSolutionNameQuestion } from './helper/conditions.js';
10
7
  /**
11
8
  * Prompter for CF services.
12
9
  */
13
- class CFServicesPrompter {
10
+ export class CFServicesPrompter {
14
11
  isInternalUsage;
15
12
  logger;
16
13
  /**
@@ -80,7 +77,7 @@ class CFServicesPrompter {
80
77
  */
81
78
  get backendUrls() {
82
79
  const serviceKeys = this.businessServiceInfo?.serviceKeys ?? [];
83
- return (0, adp_tooling_1.getBackendUrlsFromServiceKeys)(serviceKeys);
80
+ return getBackendUrlsFromServiceKeys(serviceKeys);
84
81
  }
85
82
  /**
86
83
  * Returns the OAuth paths extracted from xs-app.json routes that have a source property.
@@ -91,7 +88,7 @@ class CFServicesPrompter {
91
88
  if (!this.appContentEntries) {
92
89
  return [];
93
90
  }
94
- return (0, adp_tooling_1.getOAuthPathsFromXsApp)(this.appContentEntries);
91
+ return getOAuthPathsFromXsApp(this.appContentEntries);
95
92
  }
96
93
  /**
97
94
  * Constructor for CFServicesPrompter.
@@ -115,13 +112,13 @@ class CFServicesPrompter {
115
112
  */
116
113
  async getPrompts(mtaProjectPath, cfConfig, promptOptions) {
117
114
  if (this.isCfLoggedIn) {
118
- this.businessServices = await (0, adp_tooling_1.getMtaServices)(mtaProjectPath, this.logger);
115
+ this.businessServices = await getMtaServices(mtaProjectPath, this.logger);
119
116
  }
120
117
  const keyedPrompts = {
121
- [adp_tooling_1.cfServicesPromptNames.approuter]: this.getAppRouterPrompt(mtaProjectPath, cfConfig),
122
- [adp_tooling_1.cfServicesPromptNames.businessService]: this.getBusinessServicesPrompt(cfConfig),
123
- [adp_tooling_1.cfServicesPromptNames.businessSolutionName]: this.getBusinessSolutionNamePrompt(),
124
- [adp_tooling_1.cfServicesPromptNames.baseApp]: this.getBaseAppPrompt(cfConfig)
118
+ [cfServicesPromptNames.approuter]: this.getAppRouterPrompt(mtaProjectPath, cfConfig),
119
+ [cfServicesPromptNames.businessService]: this.getBusinessServicesPrompt(cfConfig),
120
+ [cfServicesPromptNames.businessSolutionName]: this.getBusinessSolutionNamePrompt(),
121
+ [cfServicesPromptNames.baseApp]: this.getBaseAppPrompt(cfConfig)
125
122
  };
126
123
  const questions = Object.entries(keyedPrompts)
127
124
  .filter(([promptName]) => {
@@ -139,14 +136,14 @@ class CFServicesPrompter {
139
136
  getBusinessSolutionNamePrompt() {
140
137
  return {
141
138
  type: 'input',
142
- name: adp_tooling_1.cfServicesPromptNames.businessSolutionName,
143
- message: (0, i18n_1.t)('prompts.businessSolutionNameLabel'),
144
- when: (answers) => (0, conditions_1.showBusinessSolutionNameQuestion)(answers, this.isCfLoggedIn, this.showSolutionNamePrompt, answers.businessService),
145
- validate: (value) => (0, validators_1.validateBusinessSolutionName)(value),
139
+ name: cfServicesPromptNames.businessSolutionName,
140
+ message: t('prompts.businessSolutionNameLabel'),
141
+ when: (answers) => showBusinessSolutionNameQuestion(answers, this.isCfLoggedIn, this.showSolutionNamePrompt, answers.businessService),
142
+ validate: (value) => validateBusinessSolutionName(value),
146
143
  guiOptions: {
147
144
  mandatory: true,
148
- hint: (0, i18n_1.t)('prompts.businessSolutionNameTooltip'),
149
- breadcrumb: (0, i18n_1.t)('prompts.businessSolutionBreadcrumb')
145
+ hint: t('prompts.businessSolutionNameTooltip'),
146
+ breadcrumb: t('prompts.businessSolutionBreadcrumb')
150
147
  },
151
148
  store: false
152
149
  };
@@ -161,14 +158,14 @@ class CFServicesPrompter {
161
158
  getAppRouterPrompt(mtaProjectPath, cfConfig) {
162
159
  return {
163
160
  type: 'list',
164
- name: adp_tooling_1.cfServicesPromptNames.approuter,
165
- message: (0, i18n_1.t)('prompts.approuterLabel'),
166
- choices: (0, choices_1.getAppRouterChoices)(this.isInternalUsage),
161
+ name: cfServicesPromptNames.approuter,
162
+ message: t('prompts.approuterLabel'),
163
+ choices: getAppRouterChoices(this.isInternalUsage),
167
164
  when: () => {
168
- const modules = (0, adp_tooling_1.getModuleNames)(mtaProjectPath);
169
- const hasRouter = (0, adp_tooling_1.hasApprouter)(modules);
165
+ const modules = getModuleNames(mtaProjectPath);
166
+ const hasRouter = hasApprouter(modules);
170
167
  if (hasRouter) {
171
- this.approuter = (0, adp_tooling_1.getApprouterType)(mtaProjectPath);
168
+ this.approuter = getApprouterType(mtaProjectPath);
172
169
  }
173
170
  if (this.isCfLoggedIn && !hasRouter) {
174
171
  this.showSolutionNamePrompt = true;
@@ -179,18 +176,18 @@ class CFServicesPrompter {
179
176
  }
180
177
  },
181
178
  validate: async (value) => {
182
- this.isCfLoggedIn = await (0, adp_tooling_1.isLoggedInCf)(cfConfig, this.logger);
179
+ this.isCfLoggedIn = await isLoggedInCf(cfConfig, this.logger);
183
180
  if (!this.isCfLoggedIn) {
184
- return (0, i18n_1.t)('error.cfNotLoggedIn');
181
+ return t('error.cfNotLoggedIn');
185
182
  }
186
- const validationResult = (0, project_input_validator_1.validateEmptyString)(value);
183
+ const validationResult = validateEmptyString(value);
187
184
  if (typeof validationResult === 'string') {
188
185
  return validationResult;
189
186
  }
190
187
  return true;
191
188
  },
192
189
  guiOptions: {
193
- hint: (0, i18n_1.t)('prompts.approuterTooltip'),
190
+ hint: t('prompts.approuterTooltip'),
194
191
  breadcrumb: true
195
192
  }
196
193
  };
@@ -204,29 +201,29 @@ class CFServicesPrompter {
204
201
  getBaseAppPrompt(cfConfig) {
205
202
  return {
206
203
  type: 'list',
207
- name: adp_tooling_1.cfServicesPromptNames.baseApp,
208
- message: (0, i18n_1.t)('prompts.baseAppLabel'),
209
- choices: (_) => (0, choices_1.getCFAppChoices)(this.apps),
204
+ name: cfServicesPromptNames.baseApp,
205
+ message: t('prompts.baseAppLabel'),
206
+ choices: (_) => getCFAppChoices(this.apps),
210
207
  validate: async (app) => {
211
208
  if (!app) {
212
- return (0, i18n_1.t)('error.baseAppHasToBeSelected');
209
+ return t('error.baseAppHasToBeSelected');
213
210
  }
214
211
  try {
215
- const { entries, serviceInstanceGuid, manifest } = await (0, adp_tooling_1.downloadAppContent)(cfConfig.space.GUID, app, this.logger);
212
+ const { entries, serviceInstanceGuid, manifest } = await downloadAppContent(cfConfig.space.GUID, app, this.logger);
216
213
  this.appManifest = manifest;
217
214
  this.html5RepoServiceInstanceGuid = serviceInstanceGuid;
218
215
  this.appContentEntries = entries;
219
- await (0, adp_tooling_1.validateSmartTemplateApplication)(manifest);
220
- await (0, adp_tooling_1.validateODataEndpoints)(entries, this.businessServiceInfo.serviceKeys, this.logger);
216
+ await validateSmartTemplateApplication(manifest);
217
+ await validateODataEndpoints(entries, this.businessServiceInfo.serviceKeys, this.logger);
221
218
  }
222
219
  catch (e) {
223
220
  return e.message;
224
221
  }
225
222
  return true;
226
223
  },
227
- when: (answers) => (0, conditions_1.shouldShowBaseAppPrompt)(answers, this.isCfLoggedIn, this.apps),
224
+ when: (answers) => shouldShowBaseAppPrompt(answers, this.isCfLoggedIn, this.apps),
228
225
  guiOptions: {
229
- hint: (0, i18n_1.t)('prompts.baseAppTooltip'),
226
+ hint: t('prompts.baseAppTooltip'),
230
227
  breadcrumb: true
231
228
  }
232
229
  };
@@ -240,25 +237,25 @@ class CFServicesPrompter {
240
237
  getBusinessServicesPrompt(cfConfig) {
241
238
  return {
242
239
  type: 'list',
243
- name: adp_tooling_1.cfServicesPromptNames.businessService,
244
- message: (0, i18n_1.t)('prompts.businessServiceLabel'),
240
+ name: cfServicesPromptNames.businessService,
241
+ message: t('prompts.businessServiceLabel'),
245
242
  choices: this.businessServices,
246
243
  default: (_) => this.businessServices.length === 1 ? (this.businessServices[0] ?? '') : '',
247
244
  when: (answers) => this.isCfLoggedIn && (this.approuter || answers.approuter),
248
245
  validate: async (value) => {
249
- const validationResult = (0, project_input_validator_1.validateEmptyString)(value);
246
+ const validationResult = validateEmptyString(value);
250
247
  if (typeof validationResult === 'string') {
251
- return (0, i18n_1.t)('error.businessServiceHasToBeSelected');
248
+ return t('error.businessServiceHasToBeSelected');
252
249
  }
253
250
  try {
254
- this.businessServiceInfo = await (0, adp_tooling_1.getBusinessServiceInfo)(value, cfConfig, this.logger);
251
+ this.businessServiceInfo = await getBusinessServiceInfo(value, cfConfig, this.logger);
255
252
  if (this.businessServiceInfo === null) {
256
- return (0, i18n_1.t)('error.businessServiceDoesNotExist');
253
+ return t('error.businessServiceDoesNotExist');
257
254
  }
258
- this.apps = await (0, adp_tooling_1.getCfApps)(this.businessServiceInfo.serviceKeys, cfConfig, this.logger);
255
+ this.apps = await getCfApps(this.businessServiceInfo.serviceKeys, cfConfig, this.logger);
259
256
  this.logger?.log(`Available applications: ${JSON.stringify(this.apps)}`);
260
257
  if (this.apps.length === 0) {
261
- return (0, i18n_1.t)('error.noAppsFoundForBusinessService');
258
+ return t('error.noAppsFoundForBusinessService');
262
259
  }
263
260
  }
264
261
  catch (e) {
@@ -270,11 +267,10 @@ class CFServicesPrompter {
270
267
  },
271
268
  guiOptions: {
272
269
  mandatory: true,
273
- hint: (0, i18n_1.t)('prompts.businessServiceTooltip'),
270
+ hint: t('prompts.businessServiceTooltip'),
274
271
  breadcrumb: true
275
272
  }
276
273
  };
277
274
  }
278
275
  }
279
- exports.CFServicesPrompter = CFServicesPrompter;
280
276
  //# sourceMappingURL=cf-services.js.map
@@ -3,9 +3,9 @@ import { FlexLayer } from '@sap-ux/adp-tooling';
3
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
- import type { TelemetryCollector } from '../../telemetry';
7
- import type { ConfigPromptOptions, ConfigQuestion } from '../types';
8
- import { SystemType } from '../types';
6
+ import type { TelemetryCollector } from '../../telemetry/index.js';
7
+ import type { ConfigPromptOptions, ConfigQuestion } from '../types.js';
8
+ import { SystemType } from '../types.js';
9
9
  /**
10
10
  * A stateful prompter class that creates configuration questions.
11
11
  * It exposes a single public method {@link getPrompts} to retrieve the configuration questions.