@sap/generator-fiori
Version:
Create an SAPUI5 application using SAP Fiori elements or a freestyle approach
1 lines • 92.1 kB
JavaScript
"use strict";exports.id=9808,exports.ids=[9808],exports.modules={11397(e,s,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const r=i(73667),o=i(85393),n=i(10894),p=i(44258),c=i(75595),l=a(i(4426)),d=i(33087);class AddAnnotationsToDataGenerator extends l.default{answers;dataSources;constructor(e,s){super(e,s,c.GeneratorTypes.ADD_ANNOTATIONS_TO_DATA)}async initializing(){await this.onInit()}async prompting(){try{const e=await this.getManifest();this.dataSources=e?.["sap.app"]?.dataSources??{},this.answers=await this.prompt((0,o.getPromptsForAddAnnotationsToOData)(this.projectPath,this.dataSources)),this.logger.log(`Current OData services\n${JSON.stringify(this.answers,null,2)}`)}catch(e){await this.handleRuntimeCrash(e.message)}}async writing(){const e={variant:this.variant,isCommand:!0,annotation:{dataSource:this.answers.id,filePath:this.answers.filePath,serviceUrl:this.dataSources?.[this.answers.id]?.uri}};if(!this.answers.filePath&&!this.isCFProject){const s=await this.manifestService.getDataSourceMetadata(this.answers.id);e.annotation.namespaces=(0,n.getAnnotationNamespaces)({metadata:s})}await(0,o.generateChange)(this.projectPath,"appdescr_app_addAnnotationsToOData",e,this.fs,(0,d.getTemplatesOverwritePath)()),this.logger.log("Change written to changes folder"),2===this.answers.fileSelectOption&&this.appWizard.showInformation((0,p.t)("prompts.emptyAnnotationFile"),r.MessageType.notification)}end(){this.logger.log("Successfully created annotation file!")}}e.exports=AddAnnotationsToDataGenerator},7187(e,s,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const r=i(73667),o=i(85393),n=i(75595),p=i(44258),c=a(i(5053));class AddComponentUsagesGenerator extends c.default{answers;variant;projectPath;constructor(e,s){super(e,s,n.GeneratorTypes.ADD_COMPONENT_USAGES),s.data&&(this.projectPath=s.data.path)}async initializing(){await(0,p.initI18n)();try{this._registerPrompts(new r.Prompts([{name:(0,p.t)("yuiNavSteps.addComponentUsagesName"),description:(0,p.t)("yuiNavSteps.addComponentUsagesDescr")}])),this.variant=await(0,o.getVariant)(this.projectPath)}catch(e){this.appWizard.showError(e.message,r.MessageType.notification),this.validationError=e,this.logger.error(e)}}async prompting(){this.validationError?await this.handleRuntimeCrash(this.validationError.message):(this.answers=await this.prompt((0,o.getPromptsForAddComponentUsages)(this.projectPath,this.variant.layer)),this.logger.log(`Current answers\n${JSON.stringify(this.answers,null,2)}`))}async writing(){await(0,o.generateChange)(this.projectPath,"appdescr_ui5_addComponentUsages",this._createComponentUsageData(),this.fs),this.logger.log("Changes written to changes folder")}end(){this.logger.log("Successfully created change!")}_createComponentUsageData(){const{usageId:e,data:s,settings:i,isLazy:a,name:r,shouldAddLibrary:o}=this.answers;return{variant:this.variant,component:{data:s,usageId:e,settings:i,isLazy:a,name:r},...o&&{library:{reference:this.answers.library,referenceIsLazy:this.answers.libraryIsLazy}}}}}e.exports=AddComponentUsagesGenerator},12337(e,s,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const r=i(73667),o=i(85393),n=i(58012),p=i(75595),c=i(44258),l=a(i(5053));class AddNewModelGenerator extends l.default{answers;variant;cfConfig;projectPath;constructor(e,s){super(e,s,p.GeneratorTypes.ADD_NEW_MODEL),s.data&&(this.projectPath=s.data.path)}async initializing(){await(0,c.initI18n)(),(0,n.setYeomanEnvConflicterForce)(this.env,!0);try{if(await(0,o.isCFEnvironment)(this.projectPath)){this.cfConfig=(0,o.loadCfConfig)(this.logger);if(!await(0,o.isLoggedInCf)(this.cfConfig,this.logger))throw new Error((0,c.t)("error.cfNotLoggedIn"));await this._checkCfTargetMismatch()}this._registerPrompts(new r.Prompts([{name:(0,c.t)("yuiNavSteps.addNewModelName"),description:(0,c.t)("yuiNavSteps.addNewModelDescr")}])),this.variant=await(0,o.getVariant)(this.projectPath)}catch(e){this.appWizard.showError(e.message,r.MessageType.notification),this.validationError=e,this.logger.error(e)}}async _checkCfTargetMismatch(){let e;try{const s=await(0,o.readUi5Config)(this.projectPath,"ui5.yaml");e=(0,o.extractCfBuildTask)(s)}catch(e){throw this.logger.error(e.message),new Error("CF target mismatch check failed. Check the logs for details.")}const s=this.cfConfig?.org.GUID!==e.org,i=this.cfConfig?.space.GUID!==e.space;if(s||i)throw new Error((0,c.t)("error.cfTargetMismatch"))}async prompting(){this.validationError?await this.handleRuntimeCrash(this.validationError.message):(this.answers=await this.prompt(await(0,o.getPromptsForNewModel)(this.projectPath,this.variant.layer,this.logger)),this.logger.log(`Current answers\n${JSON.stringify(this.answers,null,2)}`))}async writing(){await(0,o.generateChange)(this.projectPath,"appdescr_ui5_addNewModel",await(0,o.createNewModelData)(this.projectPath,this.variant,this.answers,this.logger),this.fs),this.logger.log("Change written to changes folder")}end(){this.logger.log("Successfully created change!")}}e.exports=AddNewModelGenerator},48892(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getExtensionProjectData=async function getExtensionProjectData(e,s,i){const{application:o,system:n,username:p,password:c}=e;if(!o)throw new Error((0,r.t)("error.appParameterMissing"));const l=await i.getSystemByName(n);if(!l)throw new Error((0,r.t)("error.destinationInfoMissing"));const{projectName:d,namespace:u,ui5Version:h}=s;return{username:p,password:c,destination:{name:l.Name,basUsage:l.WebIDEUsage,host:l.Host,sapClient:l["sap-client"]},applicationNS:u,applicationName:d,userUI5Ver:(0,a.getFormattedVersion)(h),BSPUrl:o.bspUrl,namespace:o.id}};const a=i(85393),r=i(44258)},21470(e,s,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});const r=a(i(73024)),o=i(76760),n=a(i(91170)),p=i(57197),c=i(73667),l=i(85393),d=i(58012),u=i(76277),h=i(60987),g=i(98434),m=i(26796),y=i(32988),f=i(44258),P=a(i(4398)),v=i(29984),A=i(89540),b=i(46897),S=i(53907),w=i(47405),C=i(33087),j=i(83873),N=i(53407),T=i(62632),E=i(84519),D=i(6482),I=i(95775),O=i(71910),_=i(8531),L=i(29229),U=i(10119),F=i(10736);class default_1 extends n.default{setPromptsCallback;appWizard;vscode;toolsLogger;isCli;shouldInstallDeps;shouldCreateExtProject;prompts;logger;layer;configAnswers;attributeAnswers;systemLookup;prompter;cfPrompter;jsonInput;abapProvider;manifest;projectType;publicVersions;isCustomerBase;targetEnv;isCfEnv=!1;isCfLoggedIn=!1;cfConfig;isMtaYamlFound;cfServicesAnswers;cfInstalled;isCfFeatureEnabled;toolsId;telemetryCollector;keyUserPrompter;constructor(e,s){super(e,s),this.appWizard=s.appWizard??c.AppWizard.create(s),this.shouldInstallDeps=s.shouldInstallDeps??!0,this.toolsLogger=new u.ToolsLogger,this.vscode=s.vscode,this._setupLogging(),this.options=s,this.isMtaYamlFound=(0,l.isMtaProject)(process.cwd()),this.isCfFeatureEnabled=(0,g.isFeatureEnabled)("sap.ux.appGenerator.testBetaFeatures.adpCfExperimental"),this.logger.debug(`isCfFeatureEnabled: ${this.isCfFeatureEnabled}`);const i=(0,A.getFirstArgAsString)(e);this.jsonInput=(0,A.parseJsonInput)(i,this.logger),this.jsonInput||(this.env.lookup({packagePatterns:["@sap/generator-fiori","@bas-dev/generator-extensibility-sub"]}),(0,v.setHeaderTitle)(s,this.logger,"Adaptation Project"),(0,m.initCache)(this.logger,this.appWizard),this.prompts=new c.Prompts([]),this.setPromptsCallback=e=>{this.prompts&&this.prompts.setCallback(e)})}async initializing(){(0,d.setYeomanEnvConflicterForce)(this.env,this.options.force),await(0,f.initI18n)(),this.isCli=(0,d.isCli)(),this.layer=(0,N.getFlexLayer)(),this.isCustomerBase="CUSTOMER_BASE"===this.layer,this.systemLookup=new l.SystemLookup(this.logger),this.cfInstalled=await(0,l.isCfInstalled)(this.logger),this.cfConfig=(0,l.loadCfConfig)(this.logger),this.isCfLoggedIn=await(0,l.isLoggedInCf)(this.cfConfig,this.logger),this.logger.info(`isCfInstalled: ${this.cfInstalled}`);const e=(0,g.isInternalFeaturesSettingEnabled)();if(await(0,F.initTelemetrySettings)({consumerModule:{name:"@sap/generator-fiori:generator-adp",version:this.rootGeneratorVersion()},internalFeature:e,watchTelemetrySettingStore:!1}),this.telemetryCollector=new b.TelemetryCollector,!this.jsonInput){const s=this.cfInstalled&&this.isCfFeatureEnabled;this.prompts.splice(0,0,(0,S.getWizardPages)(s)),this.prompter=this._getOrCreatePrompter(),this.cfPrompter=new E.CFServicesPrompter(e,this.isCfLoggedIn,this.logger)}}async prompting(){if(!this.jsonInput)if(await this._determineTargetEnv(),this.isCfEnv)await this._promptForCfEnvironment();else{const e=(0,d.isExtensionInstalled)(this.vscode,"SAP.vscode-bas-extensibility"),s=this.prompter.getPrompts({projectType:{default:h.AdaptationProjectType.CLOUD_READY},projectTypeCli:{hide:!this.isCli},projectTypeClassicLabel:{hide:this.isCli},appValidationCli:{hide:!this.isCli},systemValidationCli:{hide:!this.isCli},shouldCreateExtProject:{isExtensibilityExtInstalled:e}});this.configAnswers=await this.prompt(s),this.shouldCreateExtProject=!!this.configAnswers.shouldCreateExtProject,this.logger.info(`System: ${this.configAnswers.system}`),this.logger.info(`Application: ${JSON.stringify(this.configAnswers.application,null,2)}`);const{ui5Versions:i,systemVersion:a}=this.prompter.ui5,r={ui5Versions:i,isVersionDetected:!!a,projectType:this.prompter.projectType,systemType:this.prompter.systemType,layer:this.layer,prompts:this.prompts},o={targetFolder:{default:(0,d.getDefaultTargetFolder)(this.options.vscode)??process.cwd(),hide:this.shouldCreateExtProject},ui5ValidationCli:{hide:!this.isCli},enableTypeScript:{hide:this.shouldCreateExtProject},addFlpConfig:{hasBaseAppInbounds:!!this.prompter.baseAppInbounds,hide:this.shouldCreateExtProject},addDeployConfig:{hide:this.shouldCreateExtProject||!this.isCustomerBase},importKeyUserChanges:{hide:this.shouldCreateExtProject}},n=(0,T.getPrompts)(this.destinationPath(),r,o);if(this.attributeAnswers=await this.prompt(n),this._updateWizardStepsAfterNavigation(),this.attributeAnswers.importKeyUserChanges){this.keyUserPrompter=new U.KeyUserImportPrompter(this.systemLookup,this.configAnswers.application.id,this.prompter.provider,this.configAnswers.system,this.logger);const e=this.keyUserPrompter.getPrompts({keyUserSystem:{default:this.configAnswers.system}});await this.prompt(e)}if(this.logger.info(`Project Attributes: ${JSON.stringify(this.attributeAnswers,null,2)}`),this.attributeAnswers.addDeployConfig){const e=await this.systemLookup.getSystemByName(this.configAnswers.system);await(0,w.addDeployGen)({projectName:this.attributeAnswers.projectName,projectPath:this.attributeAnswers.targetFolder,connectedSystem:this.configAnswers.system,projectType:this.prompter.projectType,system:e},this.composeWith.bind(this),this.logger,this.appWizard)}this.attributeAnswers?.addFlpConfig&&await(0,w.addFlpGen)({vscode:this.vscode,projectRootPath:this._getProjectPath(),inbounds:this.prompter.baseAppInbounds,layer:this.layer,prompts:this.prompts},this.composeWith.bind(this),this.logger,this.appWizard)}}async writing(){try{if(this.toolsId=(0,p.v4)(),this.jsonInput&&await this._initFromJson(),this._collectTelemetryData(),this.isCfEnv)return void await this._generateAdpProjectArtifactsCF();if(this.configAnswers.storeCredentials&&await(0,l.storeCredentials)(this.configAnswers,this.systemLookup,this.logger),this.shouldCreateExtProject)return void await(0,w.addExtProjectGen)({configAnswers:this.configAnswers,attributeAnswers:this.attributeAnswers,systemLookup:this.systemLookup},this.composeWith.bind(this),this.logger,this.appWizard);const e=this.jsonInput?this.abapProvider:this.prompter.provider,s=this.jsonInput?this.publicVersions:this.prompter.ui5.publicVersions,i=this.jsonInput?this.manifest:this.prompter.manifest,a=this.jsonInput?this.jsonInput.keyUserChanges:this.keyUserPrompter?.changes,r=this._getProjectType(),o=(0,y.getPackageInfo)(),n=await(0,l.getConfig)({provider:e,configAnswers:this.configAnswers,attributeAnswers:this.attributeAnswers,systemVersion:this.prompter?.ui5?.systemVersion,publicVersions:s,manifest:i,layer:this.layer,packageJson:o,logger:this.toolsLogger,projectType:r,toolsId:this.toolsId,keyUserChanges:a});n.options&&(n.options.templatePathOverwrite=(0,C.getTemplatesOverwritePath)()),await(0,l.generate)(this._getProjectPath(),n,this.fs)}catch(e){throw this.logger.error(`Writing phase failed: ${e}`),new Error((0,f.t)("error.updatingApp"))}finally{(0,m.cacheClear)(this.appWizard,this.logger)}}async install(){if(this.shouldInstallDeps&&!this.shouldCreateExtProject)try{await(0,y.installDependencies)(this._getProjectPath())}catch(e){this.logger.error(`Installation of dependencies failed: ${e.message}`)}}async end(){const e=this._getProjectPath(),s=d.TelemetryHelper.createTelemetryData({appType:"generator-adp",...this.options.telemetryData,...this.telemetryCollector.telemetryData});if(s&&(0,d.sendTelemetry)(b.EventName.ADAPTATION_PROJECT_CREATED,s,e).then(()=>{this.logger.log(`Event ${b.EventName.ADAPTATION_PROJECT_CREATED} successfully sent`)}).catch(e=>{this.logger.error(`Failed to send telemetry: ${e}`)}),!(this.isCli||this.isCfEnv||this.shouldCreateExtProject))try{if(!(0,j.existsInWorkspace)(this.vscode,e)){const s=await(0,j.showWorkspaceFolderWarning)(this.vscode,e);if(!s)return;return void await(0,j.handleWorkspaceFolderChoice)(this.vscode,e,s)}await(this.vscode?.commands?.executeCommand?.("sap.ux.application.info",{fsPath:e}))}catch(e){this.appWizard.showError(e.message,c.MessageType.notification)}}async _promptForCfProjectPath(){if(this.isMtaYamlFound){const e=this.destinationRoot(process.cwd());(0,l.getYamlContent)((0,o.join)(e,"mta.yaml")),this.logger.log(`Project path information: ${e}`)}else{const e=await this.prompt([(0,L.getProjectPathPrompt)(this.logger,this.vscode)]),s=this.destinationRoot(r.default.realpathSync(e.projectLocation,"utf-8"));this.logger.log(`Project path information: ${s}`)}}_collectTelemetryData(){const e={wasFlpConfigDone:this.attributeAnswers?.addFlpConfig??!1,wasTypeScriptChosen:this.attributeAnswers?.enableTypeScript??!1,wasDeployConfigDone:this.attributeAnswers?.addDeployConfig??!1,wasExtProjectGenerated:this.shouldCreateExtProject??!1};if(this.isCfEnv?(e.baseAppTechnicalName=this.cfPrompter?.manifest?.["sap.app"]?.id??"",e.projectType="cf"):(e.projectType=this._getProjectType()===h.AdaptationProjectType.CLOUD_READY?"cloudReady":"onPremise",e.baseAppTechnicalName=this.configAnswers?.application?.id??""),this.jsonInput)e.ui5VersionSelected=(0,l.getLatestVersion)(this.publicVersions);else{const s=this.attributeAnswers?.ui5Version??(0,l.getLatestVersion)(this.prompter?.ui5?.publicVersions)??"";e.ui5VersionSelected=(0,l.getFormattedVersion)(s)}e.systemUI5Version=this.prompter?.ui5?.systemVersion??"",this.telemetryCollector.setBatch(e)}async _determineTargetEnv(){this.isCfFeatureEnabled&&this.cfInstalled?await this._promptForTargetEnvironment():this.targetEnv=_.TargetEnv.ABAP}async _promptForTargetEnvironment(){const e=await this.prompt([(0,L.getTargetEnvPrompt)(this.appWizard,this.cfInstalled,this.isCfLoggedIn,this.cfConfig)]);this.targetEnv=e.targetEnv,this.isCfEnv=this.targetEnv===_.TargetEnv.CF,this.logger.info(`Target environment: ${this.targetEnv}`),(0,S.updateCfWizardSteps)(this.isCfEnv,this.prompts),this.logger.log(`Project organization information: ${JSON.stringify(this.cfConfig.org,null,2)}`),this.logger.log(`Project space information: ${JSON.stringify(this.cfConfig.space,null,2)}`),this.logger.log(`Project apiUrl information: ${JSON.stringify(this.cfConfig.url,null,2)}`)}async _promptForCfEnvironment(){await this._promptForCfProjectPath();const e=this.destinationPath(),s=(0,T.getPrompts)(e,{ui5Versions:[],isVersionDetected:!1,layer:this.layer,prompts:this.prompts,isCfEnv:!0},{targetFolder:{hide:!0},ui5Version:{hide:!0},ui5ValidationCli:{hide:!0},enableTypeScript:{hide:!0},addFlpConfig:{hasBaseAppInbounds:!0},addDeployConfig:{hide:!0},importKeyUserChanges:{hide:!0}});this.attributeAnswers=await this.prompt(s),this.logger.info(`Project Attributes: ${JSON.stringify(this.attributeAnswers,null,2)}`);const i=await this.cfPrompter.getPrompts(e,this.cfConfig);this.cfServicesAnswers=await this.prompt(i),this.logger.info(`CF Services Answers: ${JSON.stringify(this.cfServicesAnswers,null,2)}`);const a=this.cfServicesAnswers.baseApp;if(a&&this.attributeAnswers?.addFlpConfig)try{const e=await(0,l.getCfBaseAppInbounds)(a.appId,a.appHostId,this.cfConfig,this.logger);(0,S.updateFlpWizardSteps)(!!e,this.prompts,this.attributeAnswers.projectName,!0),e&&await(0,w.addFlpGen)({vscode:this.vscode,projectRootPath:this._getProjectPath(),inbounds:e,layer:this.layer,prompts:this.prompts,isCfProject:!0},this.composeWith.bind(this),this.logger,this.appWizard)}catch(e){this.logger.warn(`Could not fetch CF inbounds for FLP configuration: ${e.message}`)}}_getOrCreatePrompter(){const e=(0,m.cacheGet)(this.appWizard,"prompter",this.logger);if(e)return e;const s=new D.ConfigPrompter(this.systemLookup,this.layer,this.logger,this.telemetryCollector);return(0,m.cachePut)(this.appWizard,{prompter:s},this.logger),s}async _generateAdpProjectArtifactsCF(){const e=this.destinationPath(),s=await(0,l.fetchPublicVersions)(this.logger);this.telemetryCollector.setBatch({ui5VersionSelected:(0,l.getLatestVersion)(s)});const i=this.cfPrompter.manifest;if(!i)throw new Error("Manifest not found for base app.");const a=this.cfPrompter.html5RepoRuntimeGuid,r=this.cfPrompter.serviceInstanceGuid,o=this.cfPrompter.backendUrls,n=this.cfPrompter.oauthPaths,p=await(0,l.getOrCreateServiceInstanceKeys)({names:[this.cfServicesAnswers.businessService??""]},this.logger),c=(0,l.getCfConfig)({attributeAnswers:this.attributeAnswers,cfServicesAnswers:this.cfServicesAnswers,cfConfig:this.cfConfig,layer:this.layer,manifest:i,html5RepoRuntimeGuid:a,serviceInstanceGuid:r,backendUrls:o,oauthPaths:n,projectPath:e,publicVersions:s,packageJson:(0,y.getPackageInfo)(),toolsId:this.toolsId,serviceInfo:p,spaceGuid:this.cfConfig.space.GUID});c.options&&(c.options.templatePathOverwrite=(0,C.getTemplatesOverwritePath)()),await(0,l.generateCf)(e,c,this.logger,this.fs)}_getProjectPath(){return this.isCfEnv?(0,o.join)(this.destinationPath(),this.attributeAnswers.projectName):this.shouldCreateExtProject?(0,o.join)(process.cwd(),this.attributeAnswers.projectName):(0,o.join)(this.attributeAnswers.targetFolder,this.attributeAnswers.projectName)}_getProjectType(){return this.jsonInput?this.projectType:this.prompter.projectType}_setupLogging(){P.default.configureLogging(this.options.logger,this.rootGeneratorName(),this.log,this.options.vscode,this.options.logLevel,this.options.logWrapper),this.logger=P.default.logger}async _initFromJson(){if(!this.jsonInput)return;const{system:e,client:s,username:i="",password:a="",projectType:r,application:o,applicationTitle:n,targetFolder:p="/home/user/projects",projectName:c=(0,I.getDefaultProjectName)(p,`${o}.variant`),namespace:d=(0,I.getDefaultNamespace)(c,this.isCustomerBase)}=this.jsonInput;await(0,O.validateJsonInput)(this.systemLookup,this.isCustomerBase,{projectName:c,targetFolder:p,namespace:d,system:e}),this.publicVersions=await(0,l.fetchPublicVersions)(this.logger);const u={system:e,client:s,username:i,password:a};this.abapProvider=await(0,l.getConfiguredProvider)(u,this.logger);const m=await(0,l.getSupportedProject)(this.abapProvider);let y=h.AdaptationProjectType.ON_PREMISE;if(m===l.SupportedProject.CLOUD_READY_AND_ON_PREM){y=(0,g.isInternalFeaturesSettingEnabled)()?h.AdaptationProjectType.ON_PREMISE:r??h.AdaptationProjectType.CLOUD_READY}else m===l.SupportedProject.CLOUD_READY&&(y=h.AdaptationProjectType.CLOUD_READY);this.projectType=y;const P=await(0,l.loadApps)(this.abapProvider,this.isCustomerBase,m);this.telemetryCollector.setBatch({numberOfApplications:P.length});const v=P.find(e=>e.id===o);if(!v)throw new Error((0,f.t)("error.applicationNotFound",{appName:o}));const A=new l.SourceManifest(this.abapProvider,v.id);this.manifest=await A.getManifest(),this.configAnswers={system:e,username:i,password:a,application:v},this.attributeAnswers={projectName:c,title:n??`${v.title} (variant)`,namespace:d,targetFolder:p,ui5Version:"",enableTypeScript:!1}}_updateWizardStepsAfterNavigation(){const e=this.prompts.items,s=e.some(e=>e.name===(0,f.t)("yuiNavSteps.flpConfigName"));e.some(e=>e.name===(0,f.t)("yuiNavSteps.deployConfigName"))||(0,S.updateWizardSteps)(this.prompts,(0,S.getDeployPage)(),(0,f.t)("yuiNavSteps.projectAttributesName"),this.attributeAnswers.addDeployConfig),(0,S.updateWizardSteps)(this.prompts,(0,S.getKeyUserImportPage)(),(0,f.t)("yuiNavSteps.projectAttributesName"),!!this.attributeAnswers.importKeyUserChanges),s||(0,S.updateFlpWizardSteps)(!!this.prompter.baseAppInbounds,this.prompts,this.attributeAnswers.projectName,!!this.attributeAnswers.addFlpConfig)}}s.default=default_1},53407(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getFlexLayer=function getFlexLayer(){return(0,a.isInternalFeaturesSettingEnabled)()?"VENDOR":"CUSTOMER_BASE"};const a=i(98434)},62632(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getPrompts=function getPrompts(e,s,i){const{isVersionDetected:p,ui5Versions:c,systemType:l,projectType:d,layer:u,prompts:h,isCfEnv:g=!1}=s,m="CUSTOMER_BASE"===u,y={[n.attributePromptNames.projectName]:getProjectNamePrompt(e,m,g,i?.[n.attributePromptNames.projectName]),[n.attributePromptNames.title]:(f=i?.[n.attributePromptNames.title],{type:"input",name:n.attributePromptNames.title,message:(0,o.t)("prompts.appTitleLabel"),default:f?.default??(0,o.t)("prompts.appTitleDefault"),guiOptions:{mandatory:!0,breadcrumb:!0,hint:(0,o.t)("prompts.appTitleTooltip")},validate:r.validateEmptyString,store:!1}),[n.attributePromptNames.namespace]:getNamespacePrompt(m,i?.[n.attributePromptNames.namespace]),[n.attributePromptNames.targetFolder]:getTargetFolderPrompt(i?.[n.attributePromptNames.targetFolder]),[n.attributePromptNames.ui5Version]:getUi5VersionPrompt(c,p,l),[n.attributePromptNames.ui5ValidationCli]:{name:n.attributePromptNames.ui5ValidationCli,when:async e=>{if(!e.ui5Version)return!1;const s=await(0,a.validateUI5VersionExists)(e.ui5Version);if("string"==typeof s)throw new Error(s);return!1}},[n.attributePromptNames.enableTypeScript]:(i?.[n.attributePromptNames.enableTypeScript],{type:"confirm",name:n.attributePromptNames.enableTypeScript,message:"Enable TypeScript",default:!1,guiOptions:{breadcrumb:!0}}),[n.attributePromptNames.addDeployConfig]:getAddDeployConfigPrompt(h,i?.[n.attributePromptNames.addDeployConfig]),[n.attributePromptNames.addFlpConfig]:getFlpConfigPrompt(h,d,i?.[n.attributePromptNames.addFlpConfig],g),[n.attributePromptNames.importKeyUserChanges]:getImportKeyUserChangesPrompt(h,i?.[n.attributePromptNames.importKeyUserChanges])};var f;return Object.entries(y).filter(([e])=>{const s=i?.[e];return!(s&&"hide"in s&&s.hide)}).map(([e,s])=>s)},s.getAddDeployConfigPrompt=getAddDeployConfigPrompt,s.getFlpConfigPrompt=getFlpConfigPrompt;const a=i(85393),r=i(57848),o=i(44258),n=i(8531),p=i(89454),c=i(56153),l=i(53907),d=i(95775),u=i(60987);function getProjectNamePrompt(e,s,i,a){return{type:"input",name:n.attributePromptNames.projectName,message:(0,o.t)("prompts.projectNameLabel"),default:s=>(0,d.getDefaultProjectName)(s.targetFolder||e),guiOptions:{mandatory:!0,breadcrumb:!0,hint:(0,p.getProjectNameTooltip)(s)},validate:(a,o)=>(0,r.validateProjectName)(a,o.targetFolder||e,s,i),store:!1}}function getNamespacePrompt(e,s){const i={type:"input",name:n.attributePromptNames.namespace,message:(0,o.t)("prompts.namespaceLabel"),default:i=>s?.default??(0,d.getDefaultNamespace)(i.projectName,e),guiOptions:{applyDefaultWhenDirty:!0},store:!1};return e?(i.guiOptions.mandatory=!0,i.guiOptions.breadcrumb=!0,i.validate=(s,i)=>(0,r.validateNamespaceAdp)(s,i.projectName,e)):(i.guiOptions.type="label",i.when=e=>!!e.projectName),i}function getTargetFolderPrompt(e){return{type:"input",name:"targetFolder",message:(0,o.t)("prompts.projectFolderLabel"),guiOptions:{type:"folder-browser",applyDefaultWhenDirty:!0,mandatory:!0,breadcrumb:(0,o.t)("prompts.projectFolderPath")},validate:(e,s)=>(0,r.validateProjectFolder)(e,s.projectName),default:s=>s.targetFolder||e?.default,store:!1}}function getUi5VersionPrompt(e,s,i){return{type:"list",name:n.attributePromptNames.ui5Version,message:(0,o.t)("prompts.ui5VersionLabel"),when:i!==n.SystemType.CLOUD_READY,choices:e,guiOptions:{applyDefaultWhenDirty:!0,hint:(0,o.t)("prompts.ui5VersionTooltip"),breadcrumb:!0,mandatory:!0},validate:async e=>await(0,a.validateUI5VersionExists)(e),default:async()=>await(0,d.getDefaultVersion)(e),additionalMessages:()=>(0,c.getVersionAdditionalMessages)(s)}}function getAddDeployConfigPrompt(e,s){return{type:"confirm",name:n.attributePromptNames.addDeployConfig,message:(0,o.t)("prompts.addDeployConfig"),default:!1,guiOptions:{breadcrumb:!0},validate:s=>((0,l.updateWizardSteps)(e,(0,l.getDeployPage)(),(0,o.t)("yuiNavSteps.projectAttributesName"),s),!0)}}function getFlpConfigPrompt(e,s,i,a){return{type:"confirm",name:n.attributePromptNames.addFlpConfig,message:(0,o.t)("prompts.addFlpConfig"),default:!1,guiOptions:{breadcrumb:!0},when:()=>a||s===u.AdaptationProjectType.CLOUD_READY,validate:(s,a)=>((0,l.updateFlpWizardSteps)(!!i?.hasBaseAppInbounds,e,a.projectName,s),!0)}}function getImportKeyUserChangesPrompt(e,s){return{type:"confirm",name:n.attributePromptNames.importKeyUserChanges,message:(0,o.t)("prompts.importKeyUserChangesLabel"),default:s?.default??!1,guiOptions:{breadcrumb:!0},validate:s=>((0,l.updateWizardSteps)(e,(0,l.getKeyUserImportPage)(),(0,o.t)("yuiNavSteps.projectAttributesName"),s),!0)}}},84519(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.CFServicesPrompter=void 0;const a=i(85393),r=i(57848),o=i(44258),n=i(71910),p=i(21101),c=i(73983);s.CFServicesPrompter=class CFServicesPrompter{isInternalUsage;logger;isCfLoggedIn=!1;showSolutionNamePrompt=!1;approuter;businessServices=[];businessServiceInfo=null;apps=[];html5RepoServiceInstanceGuid;appManifest;appContentEntries;get manifest(){return this.appManifest}get html5RepoRuntimeGuid(){return this.html5RepoServiceInstanceGuid}get serviceInstanceGuid(){return this.businessServiceInfo?.serviceInstance?.guid}get backendUrls(){const e=this.businessServiceInfo?.serviceKeys??[];return(0,a.getBackendUrlsFromServiceKeys)(e)}get oauthPaths(){return this.appContentEntries?(0,a.getOAuthPathsFromXsApp)(this.appContentEntries):[]}constructor(e=!1,s,i){this.isInternalUsage=e,this.logger=i,this.isCfLoggedIn=s}async getPrompts(e,s,i){this.isCfLoggedIn&&(this.businessServices=await(0,a.getMtaServices)(e,this.logger));const r={[a.cfServicesPromptNames.approuter]:this.getAppRouterPrompt(e,s),[a.cfServicesPromptNames.businessService]:this.getBusinessServicesPrompt(s),[a.cfServicesPromptNames.businessSolutionName]:this.getBusinessSolutionNamePrompt(),[a.cfServicesPromptNames.baseApp]:this.getBaseAppPrompt(s)};return Object.entries(r).filter(([e])=>{const s=i?.[e];return!(s&&"hide"in s&&s.hide)}).map(([e,s])=>s)}getBusinessSolutionNamePrompt(){return{type:"input",name:a.cfServicesPromptNames.businessSolutionName,message:(0,o.t)("prompts.businessSolutionNameLabel"),when:e=>(0,c.showBusinessSolutionNameQuestion)(e,this.isCfLoggedIn,this.showSolutionNamePrompt,e.businessService),validate:e=>(0,n.validateBusinessSolutionName)(e),guiOptions:{mandatory:!0,hint:(0,o.t)("prompts.businessSolutionNameTooltip"),breadcrumb:(0,o.t)("prompts.businessSolutionBreadcrumb")},store:!1}}getAppRouterPrompt(e,s){return{type:"list",name:a.cfServicesPromptNames.approuter,message:(0,o.t)("prompts.approuterLabel"),choices:(0,p.getAppRouterChoices)(this.isInternalUsage),when:()=>{const s=(0,a.getModuleNames)(e),i=(0,a.hasApprouter)(s);return i&&(this.approuter=(0,a.getApprouterType)(e)),!(!this.isCfLoggedIn||i)&&(this.showSolutionNamePrompt=!0,!0)},validate:async e=>{if(this.isCfLoggedIn=await(0,a.isLoggedInCf)(s,this.logger),!this.isCfLoggedIn)return(0,o.t)("error.cfNotLoggedIn");const i=(0,r.validateEmptyString)(e);return"string"!=typeof i||i},guiOptions:{hint:(0,o.t)("prompts.approuterTooltip"),breadcrumb:!0}}}getBaseAppPrompt(e){return{type:"list",name:a.cfServicesPromptNames.baseApp,message:(0,o.t)("prompts.baseAppLabel"),choices:e=>(0,p.getCFAppChoices)(this.apps),validate:async s=>{if(!s)return(0,o.t)("error.baseAppHasToBeSelected");try{const{entries:i,serviceInstanceGuid:r,manifest:o}=await(0,a.downloadAppContent)(e.space.GUID,s,this.logger);this.appManifest=o,this.html5RepoServiceInstanceGuid=r,this.appContentEntries=i,await(0,a.validateSmartTemplateApplication)(o),await(0,a.validateODataEndpoints)(i,this.businessServiceInfo.serviceKeys,this.logger)}catch(e){return e.message}return!0},when:e=>(0,c.shouldShowBaseAppPrompt)(e,this.isCfLoggedIn,this.apps),guiOptions:{hint:(0,o.t)("prompts.baseAppTooltip"),breadcrumb:!0}}}getBusinessServicesPrompt(e){return{type:"list",name:a.cfServicesPromptNames.businessService,message:(0,o.t)("prompts.businessServiceLabel"),choices:this.businessServices,default:e=>1===this.businessServices.length?this.businessServices[0]??"":"",when:e=>this.isCfLoggedIn&&(this.approuter||e.approuter),validate:async s=>{if("string"==typeof(0,r.validateEmptyString)(s))return(0,o.t)("error.businessServiceHasToBeSelected");try{if(this.businessServiceInfo=await(0,a.getBusinessServiceInfo)(s,e,this.logger),null===this.businessServiceInfo)return(0,o.t)("error.businessServiceDoesNotExist");if(this.apps=await(0,a.getCfApps)(this.businessServiceInfo.serviceKeys,e,this.logger),this.logger?.log(`Available applications: ${JSON.stringify(this.apps)}`),0===this.apps.length)return(0,o.t)("error.noAppsFoundForBusinessService")}catch(e){return this.apps=[],this.logger?.error(`Failed to get available applications: ${e.message}`),e.message}return!0},guiOptions:{mandatory:!0,hint:(0,o.t)("prompts.businessServiceTooltip"),breadcrumb:!0}}}}},6482(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.ConfigPrompter=void 0;const a=i(85393),r=i(60987),o=i(75199),n=i(57848),p=i(44258),c=i(8531),l=i(56153),d=i(21101),u=i(73983),h=i(66654),g=i(71910),m=i(98434),y=i(73667);s.ConfigPrompter=class ConfigPrompter{systemLookup;logger;telemetryCollector;CLOUD_DEV_ADP_STATUS_RELEASED="released";isCustomerBase;abapProvider;appManifest;targetApps;isLoginSuccessful;isAuthRequired;flexUICapability;supportedProject;selectedProjectType;selectedSystemType;isApplicationSupported;appValidationErrorMessage;systemAdditionalMessage;containsSyncViews=!1;isV4AppInternalMode=!1;isSupported=!1;isPartiallySupported=!1;ui5Versions;publicVersions;systemVersion;baseApplicationInbounds;get ui5(){return{ui5Versions:this.ui5Versions,systemVersion:this.systemVersion,publicVersions:this.publicVersions}}get projectType(){return this.selectedProjectType}get systemType(){return this.selectedSystemType}get provider(){return this.abapProvider}get manifest(){return this.appManifest}get hasSyncViews(){return this.containsSyncViews}get isAppSupported(){return this.isApplicationSupported}get baseAppInbounds(){return this.baseApplicationInbounds}constructor(e,s,i,a){this.systemLookup=e,this.logger=i,this.telemetryCollector=a,this.isCustomerBase="CUSTOMER_BASE"===s}getPrompts(e){const s={[c.configPromptNames.system]:this.getSystemListPrompt(e?.[c.configPromptNames.system]),[c.configPromptNames.systemValidationCli]:this.getSystemValidationPromptForCli(),[c.configPromptNames.username]:this.getUsernamePrompt(e?.[c.configPromptNames.username]),[c.configPromptNames.password]:this.getPasswordPrompt(e?.[c.configPromptNames.password]),[c.configPromptNames.storeCredentials]:this.getStoreCredentialsPrompt(e?.[c.configPromptNames.storeCredentials]),[c.configPromptNames.application]:this.getApplicationListPrompt(e?.[c.configPromptNames.application]),[c.configPromptNames.appValidationCli]:this.getApplicationValidationPromptForCli(),[c.configPromptNames.projectType]:this.getProjectTypeListPrompt(e?.[c.configPromptNames.projectType]),[c.configPromptNames.projectTypeCli]:this.getProjectTypeListPromptForCli(),[c.configPromptNames.projectTypeClassicLabel]:this.getProjectTypeClassicLabelPrompt(e?.[c.configPromptNames.projectTypeClassicLabel]),[c.configPromptNames.fioriId]:this.getFioriIdPrompt(),[c.configPromptNames.ach]:this.getAchPrompt(),[c.configPromptNames.shouldCreateExtProject]:this.getShouldCreateExtProjectPrompt(e?.[c.configPromptNames.shouldCreateExtProject])};return Object.entries(s).filter(([s,i])=>{const a=e?.[s];return!(a&&"hide"in a&&a.hide)}).map(([e,s])=>s)}getSystemListPrompt(e){return{type:"list",name:c.configPromptNames.system,message:(0,p.t)("prompts.systemLabel"),choices:async()=>{const e=await this.systemLookup.getSystems();return(0,a.getEndpointNames)(e)},guiOptions:{mandatory:!0,breadcrumb:!0,hint:(0,p.t)("prompts.systemTooltip")},default:"",validate:async(e,s)=>await this.validateSystem(e,s),additionalMessages:()=>(this.systemAdditionalMessage=(0,l.getSystemAdditionalMessages)(this.flexUICapability,this.selectedProjectType),this.systemAdditionalMessage)}}getSystemValidationPromptForCli(){return{name:c.configPromptNames.systemValidationCli,when:async e=>{if(!e.system)return!1;const s=await this.validateSystem(e.system,e);if("string"==typeof s)throw new Error(s);return!1}}}getUsernamePrompt(e){return{type:"input",name:c.configPromptNames.username,message:(0,p.t)("prompts.usernameLabel"),guiOptions:{mandatory:!0,breadcrumb:!0,hint:(0,p.t)("prompts.usernameTooltip")},filter:e=>e.trim(),validate:e=>(0,n.validateEmptyString)(e),when:e=>(0,u.showCredentialQuestion)(e,this.isAuthRequired)}}getPasswordPrompt(e){return{type:"password",name:c.configPromptNames.password,message:(0,p.t)("prompts.passwordLabel"),mask:"*",guiOptions:{type:"login",mandatory:!0,hint:(0,p.t)("prompts.passwordTooltip")},validate:async(e,s)=>await this.validatePassword(e,s),when:e=>(0,u.showCredentialQuestion)(e,this.isAuthRequired),additionalMessages:()=>{if(!this.systemAdditionalMessage)return this.systemAdditionalMessage=(0,l.getSystemAdditionalMessages)(this.flexUICapability,this.selectedProjectType),this.systemAdditionalMessage}}}getStoreCredentialsPrompt(e){return{type:"confirm",name:c.configPromptNames.storeCredentials,message:(0,p.t)("prompts.storeCredentialsLabelBreadcrumb"),default:!1,guiOptions:{breadcrumb:(0,p.t)("prompts.storeCredentialsLabelBreadcrumb"),hint:(0,p.t)("prompts.storeCredentialsTooltip")},when:e=>(0,u.showStoreCredentialsQuestion)(e,this.isLoginSuccessful,this.isAuthRequired),additionalMessages:e=>{if(!0===e)return{message:(0,p.t)("warnings.passwordStoreWarning"),severity:y.Severity.warning}}}}getProjectTypeListPrompt(e){return{type:"list",name:c.configPromptNames.projectType,message:(0,p.t)("prompts.projectTypeListLabel"),guiOptions:{mandatory:!0,breadcrumb:!0,applyDefaultWhenDirty:!0},choices:d.getProjectTypeChoices,default:e?.default,when:({application:e})=>this.shouldDisplayProjectTypePrompt(e),validate:async(e,{application:s})=>this.validateProjectTypePrompt(e,s),additionalMessages:(e,s)=>(0,l.getAppAdditionalMessages)(s?.application,{hasSyncViews:this.containsSyncViews,isV4AppInternalMode:this.isV4AppInternalMode,isSupported:this.isSupported&&!this.isPartiallySupported,isPartiallySupported:this.isPartiallySupported},this.isApplicationSupported)}}getProjectTypeListPromptForCli(){return{name:c.configPromptNames.projectTypeCli,when:async({application:e,projectType:s})=>{if(!e||!s)return!1;const i=await this.validateProjectTypePrompt(s,e);if("string"==typeof i)throw new Error(i);return!1}}}getProjectTypeClassicLabelPrompt(e){return{type:"input",name:c.configPromptNames.projectTypeClassicLabel,message:"",guiOptions:{type:"label",mandatory:!1},when:({application:s})=>!e?.hide&&this.shouldDisplayProjectTypeClassicLabel(s),additionalMessages:()=>({message:(0,p.t)("prompts.projectTypeClassicLabel"),severity:y.Severity.information})}}getApplicationListPrompt(e){return{type:"list",name:c.configPromptNames.application,message:(0,p.t)("prompts.applicationListLabel"),guiOptions:{mandatory:!0,breadcrumb:!0,hint:(0,p.t)("prompts.applicationListTooltip"),applyDefaultWhenDirty:!0},choices:()=>(0,d.getApplicationChoices)(this.targetApps),default:e?.default,validate:e=>!!this.shouldDisplayProjectTypePrompt(e)||(this.isClassicAppOnMixedSystem(e)&&(this.selectedProjectType=r.AdaptationProjectType.ON_PREMISE),this.validateAppPrompt(e)),when:e=>(0,u.showApplicationQuestion)(e,!!this.targetApps?.length,this.isAuthRequired,this.isLoginSuccessful),additionalMessages:e=>{const s=e;if(!this.shouldDisplayProjectTypePrompt(s))return(0,l.getAppAdditionalMessages)(s,{hasSyncViews:this.containsSyncViews,isV4AppInternalMode:this.isV4AppInternalMode,isSupported:this.isSupported&&!this.isPartiallySupported,isPartiallySupported:this.isPartiallySupported},this.isApplicationSupported)}}}getApplicationValidationPromptForCli(){return{name:c.configPromptNames.appValidationCli,when:async({application:e})=>{if(!e||this.shouldDisplayProjectTypePrompt(e))return!1;this.isClassicAppOnMixedSystem(e)&&(this.selectedProjectType=r.AdaptationProjectType.ON_PREMISE);const s=await this.validateAppPrompt(e);if("string"==typeof s)throw new Error(s);return!1}}}getFioriIdPrompt(e){return{type:"input",name:"fioriId",message:(0,p.t)("prompts.fioriIdLabel"),guiOptions:{hint:(0,p.t)("prompts.fioriIdHint"),breadcrumb:!0},when:e=>(0,u.showInternalQuestions)(e,this.isCustomerBase,this.isApplicationSupported),default:()=>(0,a.getFioriId)(this.appManifest),store:!1}}getAchPrompt(e){return{type:"input",name:"ach",message:(0,p.t)("prompts.achLabel"),guiOptions:{hint:(0,p.t)("prompts.achHint"),breadcrumb:!0,mandatory:!0},when:e=>(0,u.showInternalQuestions)(e,this.isCustomerBase,this.isApplicationSupported),default:()=>(0,a.getAch)(this.appManifest),validate:e=>(0,n.validateAch)(e,this.isCustomerBase),store:!1}}getShouldCreateExtProjectPrompt(e){return{type:"confirm",name:c.configPromptNames.shouldCreateExtProject,message:()=>(0,h.getExtProjectMessage)(this.isApplicationSupported,this.containsSyncViews,this.appValidationErrorMessage),default:!1,guiOptions:{applyDefaultWhenDirty:!0},when:e=>(0,u.showExtensionProjectQuestion)({projectType:this.selectedProjectType,isApplicationSelected:!!e.application,isApplicationSupported:this.isApplicationSupported,hasSyncViews:this.containsSyncViews,flexUICapability:this.flexUICapability}),validate:s=>(0,g.validateExtensibilityExtension)({value:s,isApplicationSupported:this.isApplicationSupported,hasSyncViews:this.containsSyncViews,isExtensibilityExtInstalled:!!e?.isExtensibilityExtInstalled})}}async validateAppPrompt(e){if(!e)return(0,p.t)("error.selectCannotBeEmptyError",{value:"Application"});const s=await this.validateAppData(e),i=s===(0,p.t)("error.appDoesNotSupportManifest")||s===(0,p.t)("error.appDoesNotSupportFlexibility");if((0,o.isAppStudio)()&&i&&this.selectedProjectType!==r.AdaptationProjectType.CLOUD_READY)return this.logger.error(s),this.appValidationErrorMessage=s,this.isApplicationSupported=!1,!0;if("string"==typeof s)return s;if(this.selectedProjectType===r.AdaptationProjectType.CLOUD_READY)try{this.baseApplicationInbounds=await(0,a.getBaseAppInbounds)(e.id,this.provider)}catch(e){return(0,p.t)("error.fetchBaseInboundsFailed",{error:e.message})}return!0}async validatePassword(e,s){const i=(0,n.validateEmptyString)(e);if("string"==typeof i)return i;if(!s)return!0;if(!s.system||!s.username)return(0,p.t)("error.pleaseProvideAllRequiredData");const r={system:s.system,client:void 0,username:s.username,password:e};try{this.abapProvider=await(0,a.getConfiguredProvider)(r,this.logger);const e=await this.handleSystemDataValidation();return"string"==typeof e?e:(this.telemetryCollector.startTiming("applicationListLoadingTime"),this.targetApps=await(0,a.loadApps)(this.abapProvider,this.isCustomerBase,this.supportedProject),this.telemetryCollector.setBatch({numberOfApplications:this.targetApps.length}),this.telemetryCollector.endTiming("applicationListLoadingTime"),this.isLoginSuccessful=!0,!0)}catch(e){return this.isLoginSuccessful=!1,e.message}}async validateSystem(e,s){const i=(0,n.validateEmptyString)(e);if("string"==typeof i)return i;const r={system:e,client:void 0,username:s.username,password:s.password};try{if(this.targetApps=[],this.flexUICapability=void 0,this.selectedProjectType=void 0,this.selectedSystemType=void 0,this.supportedProject=void 0,this.abapProvider=await(0,a.getConfiguredProvider)(r,this.logger),this.isAuthRequired=await this.systemLookup.getSystemRequiresAuth(e),this.isAuthRequired)return!0;const s=await this.handleSystemDataValidation();return"string"==typeof s?s:(this.telemetryCollector.startTiming("applicationListLoadingTime"),this.targetApps=await(0,a.loadApps)(this.abapProvider,this.isCustomerBase,this.supportedProject),this.telemetryCollector.setBatch({numberOfApplications:this.targetApps.length}),this.telemetryCollector.endTiming("applicationListLoadingTime"),!0)}catch(e){return e.message}}async validateAppData(e){try{this.isApplicationSupported=!1;const s=new a.SourceManifest(this.abapProvider,e.id,this.logger);await(0,a.isAppSupported)(this.abapProvider,e.id,this.logger)&&(this.appManifest=await s.getManifest(),this.validateManifest(),this.evaluateAppSupport(e)),this.isApplicationSupported=!0}catch(e){return this.logger.debug(`Application failed validation. Reason: ${e.message}`),e.message}return!0}evaluateAppSupport(e){const s=!!this.systemVersion&&!(0,a.isFeatureSupportedVersion)("1.96.0",this.systemVersion),i=!!this.systemVersion&&s&&(0,a.isFeatureSupportedVersion)("1.90.0",this.systemVersion);this.setSupportFlags(e,s,i)}async loadSystemData(){try{this.selectedSystemType=await this.provider.isAbapCloud()?c.SystemType.CLOUD_READY:c.SystemType.ON_PREM;const[e,s]=await Promise.all([(0,a.getSupportedProject)(this.abapProvider),(0,a.getFlexUICapability)(this.abapProvider,this.isCustomerBase)]);this.supportedProject=e,this.flexUICapability=s,this.supportedProject===a.SupportedProject.CLOUD_READY?this.selectedProjectType=r.AdaptationProjectType.CLOUD_READY:(this.supportedProject===a.SupportedProject.ON_PREM||this.supportedProject===a.SupportedProject.CLOUD_READY_AND_ON_PREM&&(0,m.isInternalFeaturesSettingEnabled)())&&(this.selectedProjectType=r.AdaptationProjectType.ON_PREMISE)}catch(e){this.handleSystemError(e)}}async loadUI5Versions(){let e;try{e=await(0,a.getSystemUI5Version)(this.abapProvider,this.logger)}catch(e){this.logger.debug(`Could not fetch the system UI5 version: ${e.message}.`)}this.systemVersion=(0,a.checkSystemVersionPattern)(e),this.publicVersions=await(0,a.fetchPublicVersions)(this.logger),this.ui5Versions=await(0,a.getRelevantVersions)(e,this.isCustomerBase,this.publicVersions)}async handleSystemDataValidation(){try{return await this.loadSystemData(),await this.loadUI5Versions(),!(!this.isCustomerBase&&this.selectedProjectType===r.AdaptationProjectType.CLOUD_READY)||(0,p.t)("error.cloudSystemsForInternalUsers")}catch(e){return this.logger.debug(`Validating system failed. Reason: ${e.message}`),e.message}}handleSystemError(e){if(this.logger.debug(`Failed to fetch system information. Reason: ${e.message}`),(0,r.isAxiosError)(e)){if(401===e.response?.status||403===e.response?.status)throw new Error(`Authentication error: ${e.message}`);if(405===e.response?.status||404===e.response?.status)return void(this.selectedProjectType=r.AdaptationProjectType.ON_PREMISE);throw e}}validateManifest(){if(!this.appManifest)throw new Error((0,p.t)("error.manifestCouldNotBeValidated"));const e=this.appManifest?.["sap.ui5"];if(!1===e?.flexEnabled)throw new Error((0,p.t)("error.appDoesNotSupportFlexibility"))}async validateProjectTypePrompt(e,s){this.selectedProjectType=e;const i=await this.validateAppPrompt(s);return"string"!=typeof i||i}setSupportFlags(e,s,i){this.isSupported=!(s&&"appdescr_variant"===e.fileType),this.isPartiallySupported=i&&"appdescr_variant"===e.fileType,this.isV4AppInternalMode=(0,a.isV4Application)(this.appManifest)&&!this.isCustomerBase,this.containsSyncViews=(0,a.isSyncLoadedView)(this.appManifest?.["sap.ui5"])}isReleasedAppOnMixedSystem(e){return e?.cloudDevAdaptationStatus===this.CLOUD_DEV_ADP_STATUS_RELEASED&&this.supportedProject===a.SupportedProject.CLOUD_READY_AND_ON_PREM}isClassicAppOnMixedSystem(e){return this.supportedProject===a.SupportedProject.CLOUD_READY_AND_ON_PREM&&""===e?.cloudDevAdaptationStatus}shouldDisplayProjectTypePrompt(e){return!(0,m.isInternalFeaturesSettingEnabled)()&&this.isReleasedAppOnMixedSystem(e)}shouldDisplayProjectTypeClassicLabel(e){return!(0,m.isInternalFeaturesSettingEnabled)()&&this.isClassicAppOnMixedSystem(e)}}},56153(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getTargetEnvAdditionalMessages=s.getVersionAdditionalMessages=s.getAppAdditionalMessages=s.getSystemAdditionalMessages=void 0;const a=i(73667),r=i(60987),o=i(44258);s.getSystemAdditionalMessages=(e,s)=>{if(!e||!s)return;if(s===r.AdaptationProjectType.CLOUD_READY)return{message:(0,o.t)("prompts.projectTypeCloudReadyLabel"),severity:a.Severity.information};const{isDtaFolderDeploymentSupported:i,isUIFlexSupported:n}=e;return n?i?{message:(0,o.t)("prompts.projectTypeClassicLabel"),severity:a.Severity.information}:{message:(0,o.t)("error.notDeployableSystemError"),severity:a.Severity.error}:i?{message:(0,o.t)("error.notFlexEnabledError"),severity:a.Severity.warning}:{message:(0,o.t)("error.notDeployableNotFlexEnabledSystemError"),severity:a.Severity.warning}};s.getAppAdditionalMessages=(e,{hasSyncViews:s,isSupported:i,isPartiallySupported:r,isV4AppInternalMode:n},p)=>{if(e)return s&&p?{message:(0,o.t)("prompts.appInfoLabel"),severity:a.Severity.information}:i||r||!p?r&&p?{message:(0,o.t)("prompts.isPartiallySupportedAdpOverAdpLabel"),severity:a.Severity.warning}:n?{message:(0,o.t)("prompts.v4AppNotOfficialLabel"),severity:a.Severity.warning}:void 0:{message:(0,o.t)("prompts.notSupportedAdpOverAdpLabel"),severity:a.Severity.warning}};s.getVersionAdditionalMessages=e=>{if(!e)return{message:(0,o.t)("validators.ui5VersionNotDetectedError"),severity:a.Severity.warning}};s.getTargetEnvAdditionalMessages=(e,s,i)=>{if("CF"===e&&s)return{message:`You are logged in to Cloud Foundry: ${i.url} / ${i.org?.Name} / ${i.space?.Name}.`,severity:a.Severity.information}}},21101(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getKeyUserSystemChoices=s.getAdaptationChoices=s.getProjectTypeChoices=s.getAppRouterChoices=s.getCFAppChoices=s.getApplicationChoices=void 0;const a=i(85393),r=i(60987),o=i(44258);s.getApplicationChoices=e=>Array.isArray(e)?e.map(e=>({value:e,name:(e.title?`${e.title} (${e.id}, ${e.registrationIds}, ${e.ach})`:`${e.id} (${e.registrationIds}, ${e.ach})`).replace("(, )","").replace(", , ",", ").replace(", )",")").replace("(, ","(")})):e;s.getCFAppChoices=e=>e.map(e=>({name:`${e.title} (${e.appId} ${e.appVersion})`,value:e}));s.getAppRouterChoices=e=>{const s=[{name:a.AppRouterType.MANAGED,value:a.AppRouterType.MANAGED}];return e&&s.push({name:a.AppRouterType.STANDALONE,value:a.AppRouterType.STANDALONE}),s};s.getProjectTypeChoices=()=>[{name:(0,o.t)("prompts.projectTypeCloudReadyName"),value:r.AdaptationProjectType.CLOUD_READY},{name:(0,o.t)("prompts.projectTypeOnPremName"),value:r.AdaptationProjectType.ON_PREMISE}];s.getAdaptationChoices=e=>e?.map(e=>({name:e.title?`${e.title} (${e.id})`:e.id,value:e}));s.getKeyUserSystemChoices=(e,s)=>(0,a.getEndpointNames)(e).map(e=>({name:e===s?`${e} (Source system)`:e,value:e}))},73983(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.showCredentialQuestion=showCredentialQuestion,s.showApplicationQuestion=function showApplicationQuestion(e,s,i,a){return!!e.system&&s&&(!i||a)},s.showExtensionProjectQuestion=function showExtensionProjectQuestion({isApplicationSelected:e,isApplicationSupported:s,hasSyncViews:i,projectType:r,flexUICapability:n}){if(!e||r===o.AdaptationProjectType.CLOUD_READY)return!1;const p=!!n?.isDtaFolderDeploymentSupported&&(0,a.isAppStudio)(),c=n&&(!n?.isDtaFolderDeploymentSupported||!n?.isUIFlexSupported);return p&&(!s||s&&(c||i))},s.showInternalQuestions=function showInternalQuestions(e,s,i){return!!e.system&&e.application&&!s&&i},s.showBusinessSolutionNameQuestion=function showBusinessSolutionNameQuestion(e,s,i,a){return s&&e.approuter===r.AppRouterType.MANAGED&&i&&!!a},s.shouldShowBaseAppPrompt=function shouldShowBaseAppPrompt(e,s,i){return s&&!!e.businessService&&!!i.length},s.showStoreCredentialsQuestion=function showStoreCredentialsQuestion(e,s,i){return!(0,a.isAppStudio)()&&showCredentialQuestion(e,i)&&s&&!!e.password};const a=i(75199),r=i(85393),o=i(60987);function showCredentialQuestion(e,s){return!!e.system&&s}},95775(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getDefaultNamespace=function getDefaultNamespace(e,s){return s?`customer.${e}`:e},s.getDefaultProjectName=function getDefaultProjectName(e,s="app.variant"){let i=s,o=1;for(;(0,r.existsSync)((0,a.join)(e,i));)o++,i=`${s}${o}`;return i},s.getDefaultVersion=async function getDefaultVersion(e){if(0===e?.length)return"";return!0===await(0,o.validateUI5VersionExists)(e[0])?e[0]:""};const a=i(76760),r=i(73024),o=i(85393)},66654(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getExtProjectMessage=void 0;const a=i(75199),r=i(44258);s.getExtProjectMessage=(e,s,i)=>(0,a.isAppStudio)()&&i?`${i} ${(0,r.t)("prompts.extProjectSuggestion")}`:e&&s?(0,r.t)("prompts.createExtProjectWithSyncViewsLabel"):(0,r.t)("prompts.createExtProjectLabel")},89454(e,s,i){Object.defineProperty(s,"__esModule",{value:!0}),s.getProjectNameTooltip=function getProjectNameTooltip(e){const s=e?"Ext":"Int",i=(0,a.t)(`prompts.projectNameLengthError${s}`),r=(0,a.t)(`prompts.projectNameValidationError${s}`);return`${i} ${r}`};const a=i(44258)},71910(e,s,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.validateExtensibilityExtension=function validateExtensibilityExtension({value:e,isApplicationSupported:s,hasSy