UNPKG

@sap/generator-fiori

Version:

Create an SAPUI5 application using SAP Fiori elements or a freestyle approach

1 lines 21.6 kB
"use strict";exports.id=8080,exports.ids=[8080],exports.modules={81525(e,r,o){o.r(r),o.d(r,{PromptNames:()=>n,default:()=>_});var a=o(91170),i=o(94443);class RepoAppDownloadLogger{static _logger=i.DefaultLogger;static get logger(){return RepoAppDownloadLogger._logger}static set logger(e){RepoAppDownloadLogger._logger=e}static configureLogging(e,r,o,a,n,s){const p=o??new i.LogWrapper(e,r,a,n,s);RepoAppDownloadLogger.logger=p}}var n,s=o(73667),p=o(40511),c=o(11278);!function(e){e.selectedApp="selectedApp",e.systemSelection="systemSelection",e.targetFolder="targetFolder"}(n||(n={}));const d="Download ADT deployed app from UI5 ABAP repository",l="@sap-ux/repo-app-import-sub-generator",g="@sap.adt.sevicebinding.deploy:lrop",m="@sap/generator-fiori:lrop",h="qfa.json",u={[n.systemSelection]:{datasourceType:c.cT.sapSystem},[n.selectedApp]:{appId:"",title:"",description:"",repoName:"",url:""},[n.targetFolder]:""},f={"sap.app/sourceTemplate/id":g},w=["sap.app/id","sap.app/title","sap.app/description","sap.app/sourceTemplate/id","repoName","fileType","url"];var y=o(68801);const v=JSON.parse('{"error":{"telemetry":"Failed to send telemetry data after downloading the application from the SAPUI5 ABAP Repository. {{- error}}","qfaJsonNotFound":"The {{- jsonFileName }} file was not found in the downloaded application. Ensure the downloaded application is properly deployed to the ABAP repository.","replaceWebappFilesError":"An error occurred when replacing files in the downloaded application: {{- error}}. For more information, view the logs.","applicationListFetchError":"An error occurred when fetching the application list: {{- error}}. Check if your application is available in the system.","metadataFetchError":"An error occurred when fetching metadata: {{- error}}. For more information, view the logs.","appConfigGenError":"An error occurred when generating the application configuration: {{- error}}. For more information, view the logs.","endPhase":"An error occurred in the end phase: {{- error}}. For more information, view the logs.","errorProcessingJsonFile":"An error occurred when processing the JSON file: {{- error}}. Check the file is valid.","noAppsDeployed":"No applications deployed to this system can be downloaded.","validationErrors":{"invalidMetadataPackage":"Invalid or missing package in the metadata. Check the metadata.","invalidServiceName":"Invalid or missing `serviceName` in `serviceBindingDetails`. Check the `serviceName`.","invalidServiceVersion":"Invalid or missing `serviceVersion` in `serviceBindingDetails`. Check the `serviceVersion`.","invalidMainEntityName":"Invalid or missing `mainEntityName` in `serviceBindingDetails`. Check the `mainEntityName`.","invalidModuleName":"Invalid or missing `moduleName` in serviceBindingDetails. Check the `moduleName`.","invalidRepositoryName":"Invalid or missing `repositoryName` in `serviceBindingDetails`. Check the `repositoryName`."},"installationErrors":{"npmInstall":"An error occurred in the install phase: {{- error}}. For more information, view the logs.","skippedInstallation":"`--skipInstall` option was specified. Installation of dependencies will be skipped."},"appDownloadErrors":{"downloadedFileNotBufferError":"Error: The downloaded file is not a buffer. Check the file.","appDownloadFailure":"An error occurred when downloading the application: {{- error}}. For more information, view the logs.","zipExtractionError":"An error occurred when extracting the zip file: {{- error}}. For more information, view the logs."},"eventHookErrors":{"vscodeInstanceMissing":"Error: Missing VS Code instance in event hook.","postGenCommandMissing":"Error: Missing `postGenCommand` in event hook.","commandExecutionFailed":"Error executing `postGenCommand` in event hook: {{- error}}"},"readManifestErrors":{"manifestFileNotFound":"Error: the `manifest.json` file was not found in the downloaded application. Check the file exists.","readManifestFailed":"Error: Failed to read the `manifest.json` file. Check the file is valid.","sapAppNotDefined":"Error: `sap.app` not defined in the `manifest.json` file. Check `sap.app` is defined.","sourceTemplateNotSupported":"Error: Source template not supported. Use a supported template.","invalidManifestStructureError":"Invalid `manifest.json file` structure: `sap.ui5` or `sap.app` are missing. Check they exist."},"quickDeployedAppDownloadErrors":{"noAppsFound":"No application with the ID {{ appId }} was found in the system. Please check if the application is deployed correctly or select another app.","transportCheckFailed":"Transport request resolution failed with error: {error}."}},"warn":{"extractedFileNotFound":"Extracted file not found: {{- extractedFilePath}}. For more information, view the logs.","requiredFieldsMissing":"Required fields are missing for the {{- appId }} application. Check if the application is deployed correctly."},"prompts":{"appSelection":{"message":"Application","hint":"Select the application to download.","breadcrumb":"Application"},"targetPath":{"message":"Project Folder Path","breadcrumb":"Project Path"}},"readMe":{"appDescription":"This application was converted from an SAP Fiori application that was deployed from ADT using the ADT Quick Fiori Application generator.","launchText":"To launch the generated application, run the following command from the generated app root folder:\\n\\n```\\n npm start\\n```"},"info":{"repoAppDownloadCompleteMsg":"The selected application has been downloaded and updated to support SAP Fiori tools."}}'),A="repo-app-import-sub-generator",S=y.createInstance();function t(e,r){return r?.ns||(r=Object.assign(r??{},{ns:A})),S.t(e,r)}(async function initI18n(){await S.init({lng:"en",fallbackLng:"en",showSupportNotice:!1}),S.addResourceBundle("en",A,v)})().catch(()=>{});var P,D=o(76760),E=o(35817);class PromptState{static _systemSelection={datasourceType:c.cT.sapSystem};static _admZipInstance;static get systemSelection(){return this._systemSelection}static set systemSelection(e){this._systemSelection=e}static set admZip(e){this._admZipInstance=new E(e)}static get admZip(){return this._admZipInstance}static get baseURL(){return this._systemSelection.connectedSystem?.backendSystem?.url??this._systemSelection.connectedSystem?.destination?.Host}static get sapClient(){return this._systemSelection.connectedSystem?.backendSystem?.client??this._systemSelection.connectedSystem?.destination?.["sap-client"]}static get destinationName(){return this._systemSelection.connectedSystem?.destination?.Name}static reset(){PromptState.systemSelection={},PromptState._admZipInstance=void 0}}!function(e){e.GENERATION_SUCCESS="GENERATION_SUCCESS"}(P||(P={}));var N=o(13143);async function fetchAppListForSelectedSystem(e,r){return e?.serviceProvider?(PromptState.systemSelection={connectedSystem:e},await async function getAppList(e,r){try{const o=r?{...f,"sap.app/id":r}:f;return await e.getAppIndex().search(o,w)}catch(e){return RepoAppDownloadLogger.logger?.error(t("error.applicationListFetchError",{error:e.message})),RepoAppDownloadLogger.logger?.debug(t("error.applicationListFetchError",{error:JSON.stringify(e)})),[]}}(e.serviceProvider,r)):[]}var F=o(66113),R=o(67566);const validateQfaJsonFile=e=>{return!(i=e.metadata,(!i.package||"string"!=typeof i.package)&&(RepoAppDownloadLogger.logger?.error(t("error.invalidMetadataPackage")),1)||(a=e.serviceBindingDetails,a.serviceName&&"string"==typeof a.serviceName?a.serviceVersion&&"string"==typeof a.serviceVersion?(!a.mainEntityName||"string"!=typeof a.mainEntityName)&&(RepoAppDownloadLogger.logger?.error(t("error.invalidMainEntityName")),1):(RepoAppDownloadLogger.logger?.error(t("error.invalidServiceVersion")),1):(RepoAppDownloadLogger.logger?.error(t("error.invalidServiceName")),1))||(o=e.projectAttribute,(!o.moduleName||"string"!=typeof o.moduleName)&&(RepoAppDownloadLogger.logger?.error(t("error.invalidModuleName")),1))||(r=e.deploymentDetails,!r.repositoryName&&(RepoAppDownloadLogger.logger?.error(t("error.invalidRepositoryName")),1)));var r,o,a,i};async function generateAppNotFoundHelpLink(){return R.ErrorHandler.getHelpLink(F.OE.ADT_APP_NOT_FOUND_ERROR,R.ERROR_TYPE.INTERNAL_SERVER_ERROR,t("error.noAppsDeployed"))}async function validateAppSelection(e,r,o,a){if(o?.appId&&0===r.length)return await generateAppNotFoundHelpLink();if(0===r.length&&!e?.appId)return await generateAppNotFoundHelpLink();if(e?.appId)try{await async function downloadApp(e){const r=PromptState.systemSelection?.connectedSystem?.serviceProvider,o=await r.getUi5AbapRepository();o.log=RepoAppDownloadLogger.logger,RepoAppDownloadLogger.logger?.debug(`App download started: ${e}`);const a=await o.downloadFiles(e);RepoAppDownloadLogger.logger?.debug(`App download completed: ${e}`),PromptState.admZip=a}(e.repoName);const r=function hasQfaJson(){const e=PromptState.admZip?.getEntries().filter(e=>e.entryName===h);return 1===e?.length}();return r||a?.showError(t("error.qfaJsonNotFound",{jsonFileName:h}),s.MessageType.notification),r}catch(e){return RepoAppDownloadLogger.logger?.debug(`validateAppSelection: Error downloading app: ${e.message}`),t("error.appDownloadErrors.appDownloadFailure",{error:e.message})}return!1}async function getPrompts(e,r,o,a=!1){try{PromptState.reset();const i=await(0,c.Xr)({serviceSelection:{hide:!0,useAutoComplete:a},systemSelection:{defaultChoice:r?.serviceProviderInfo?.name,hideNewSystem:!0}},!a);let s=[];const p=[{when:async e=>(e[n.systemSelection]&&i.answers.connectedSystem?.serviceProvider&&(s=await fetchAppListForSelectedSystem(i.answers.connectedSystem,r?.appId)),!!i.answers.connectedSystem?.serviceProvider),type:"list",name:n.selectedApp,default:()=>r?.appId?0:void 0,guiOptions:{mandatory:!!s.length,breadcrumb:t("prompts.appSelection.breadcrumb"),applyDefaultWhenDirty:!0},message:t("prompts.appSelection.message"),choices:()=>s.length?(e=>e.filter(e=>{RepoAppDownloadLogger.logger?.debug(`formatAppChoices: ${JSON.stringify(e)}`);const r=e["sap.app/id"]&&e.repoName&&e.url&&Object.prototype.hasOwnProperty.call(e,"sap.app/title");return r||RepoAppDownloadLogger.logger?.warn(t("warn.requiredFieldsMissing",{app:e["sap.app/id"]})),r}).map(e=>(e=>{const r=e["sap.app/id"];return{name:r,value:{appId:r,title:e["sap.app/title"],description:e["sap.app/description"]??"",repoName:e.repoName,url:e.url}}})(e)))(s):[],validate:async e=>await validateAppSelection(e,s,r,o)}];a&&p?.push(((e,r,o)=>({type:"input",when:async a=>{if(a?.[n.selectedApp])try{await validateAppSelection(a[n.selectedApp],e,r,o)}catch(e){e instanceof Error?RepoAppDownloadLogger.logger?.error(e.message):RepoAppDownloadLogger.logger?.error(t("error.appDownloadErrors.validationError",{error:e}))}return!1},name:`${n.selectedApp}-validation`}))(s,r,o));const d=((e,r)=>({type:"input",name:n.targetFolder,message:t("prompts.targetPath.message"),guiType:"folder-browser",when:e=>!!r||Boolean(e?.selectedApp?.appId),guiOptions:{applyDefaultWhenDirty:!0,mandatory:!0,breadcrumb:t("prompts.targetPath.breadcrumb")},validate:async(e,o)=>{const a=o.selectedApp?.appId??r;return await(0,N.validateFioriAppTargetFolder)(e,a,!0)},default:()=>e}))(e,r?.appId);return[...i.prompts,...p,d]}catch(e){throw new Error(`Failed to generate prompts: ${e.message}`)}}var L=o(25182),b=o(48161);var I=o(86985),C=o(88242),k=o(76178),T=o(77947),j=o(61820),M=o(43107);function readManifest(e,r){r.exists(e)||RepoAppDownloadLogger.logger?.error(t("error.readManifestErrors.manifestFileNotFound"));const o=r.readJSON(e);return o||RepoAppDownloadLogger.logger?.error(t("error.readManifestErrors.readManifestFailed")),o?.["sap.app"]||RepoAppDownloadLogger.logger?.error(t("error.readManifestErrors.sapAppNotDefined")),o?.["sap.app"]?.sourceTemplate?.id!==g&&RepoAppDownloadLogger.logger?.error(t("error.readManifestErrors.sourceTemplateNotSupported")),o}var x=o(7083);const getAbapDeployConfig=async e=>{const{qfaJson:r}=e,o=await async function resolveTransportRequest(e){const{serviceProvider:r,qfaJson:o}=e,a=o.metadata.package,i=o.deploymentDetails.repositoryName;if("$TMP"===a)return"";try{const e=await(r?.getAdtService(M.TransportChecksService)),o=await(e?.getTransportRequests(a,i));return 1===o?.length?o[0].transportNumber:"REPLACE_WITH_TRANSPORT"}catch(e){if(e.message===M.TransportChecksService.LocalPackageError)return"";const r=t("error.transportCheckFailed",{error:e?.message});throw RepoAppDownloadLogger.logger?.error(r),new Error(r)}}(e);return{target:{url:PromptState.baseURL,client:PromptState.sapClient,destination:PromptState.destinationName},app:{name:r.deploymentDetails.repositoryName,package:r.metadata.package,description:r.deploymentDetails.repositoryDescription,transport:o}}};async function getAppConfig(e,r,o,a,i){try{const a=readManifest((0,D.join)(r,x.o3.Manifest),i),n=PromptState.systemSelection?.connectedSystem?.serviceProvider;o.serviceProvider=n,a?.["sap.app"]?.dataSources||RepoAppDownloadLogger.logger?.error(t("error.dataSourcesNotFound"));const s=a?.["sap.app"]?.dataSources?.mainService?.settings?.odataVersion?.startsWith("4")?c.Yw.v4:c.Yw.v2,p=await(async(e,r)=>{try{const o=await e.service(r).metadata();return RepoAppDownloadLogger.logger?.debug("Metadata fetched successfully"),o}catch(e){RepoAppDownloadLogger.logger?.error(t("error.metadataFetchError",{error:e.message}))}})(n,a?.["sap.app"]?.dataSources?.mainService.uri??""),d=await(0,I.l_)({onlyNpmVersion:!0}),l=d[0]?.version,g={app:{id:e.appId,title:e.title,description:e.description,sourceTemplate:{id:m},projectType:"EDMXBackend",flpAppId:`${e.appId.replace(/[-_.#]/g,"")}-tile`},package:{name:e.appId,description:e.description,devDependencies:{},scripts:{},version:a?.["sap.app"]?.applicationVersion?.version??"0.0.1"},template:{type:L.nY.ListReportObjectPage,settings:{entityConfig:{mainEntityName:o.qfaJson.serviceBindingDetails.mainEntityName}}},service:{path:a?.["sap.app"]?.dataSources?.mainService.uri,version:s,metadata:p,url:PromptState.baseURL,client:PromptState.sapClient},appOptions:{addAnnotations:s===c.Yw.v4,addTests:!0,useVirtualPreviewEndpoints:!0},ui5:{localVersion:l}};return PromptState.destinationName&&(g.service.destination={name:PromptState.destinationName}),g}catch(e){throw RepoAppDownloadLogger.logger?.error(t("error.appConfigGenError",{error:e.message})),e}}const _=class extends a{appWizard;vscode;appRootPath;prompts;answers=u;options;projectPath;extractedProjectPath;debugOptions;setPromptsCallback;constructor(e,r){super(e,r),this.appWizard=r.appWizard??s.AppWizard.create(r),this.vscode=r.vscode,this.appRootPath=r?.appRootPath??(0,i.getDefaultTargetFolder)(this.vscode)??this.destinationRoot(),this.options=r,RepoAppDownloadLogger.configureLogging(this.rootGeneratorName(),this.log,this.options.logWrapper,this.options.logLevel,this.options.logger,this.vscode),this.appWizard.setHeaderTitle(d),this.prompts=new s.Prompts(function getYUIDetails(){return[{name:d,description:"Download an application that was generated with the ADT Quick Fiori Application generator"}]}()),this.setPromptsCallback=e=>{this.prompts&&this.prompts.setCallback(e)}}async initializing(){(0,i.setYeomanEnvConflicterForce)(this.env,this.options.force),await i.TelemetryHelper.initTelemetrySettings({consumerModule:{name:l,version:this.rootGeneratorVersion()},internalFeature:(0,p.isInternalFeaturesSettingEnabled)(),watchTelemetrySettingStore:!1})}async prompting(){const e=this.options?.data?.quickDeployedAppConfig,r=await getPrompts(this.appRootPath,e,this.appWizard,(0,i.isCli)()),o=await this.prompt(r),{targetFolder:a}=o;e?.appId?(this.answers.targetFolder=a,this.answers.systemSelection=PromptState.systemSelection,this.answers.selectedApp=o.selectedApp):Object.assign(this.answers,o),((e,r)=>!!(PromptState.systemSelection.connectedSystem?.serviceProvider&&r&&e))(this.answers.targetFolder,this.answers.selectedApp.appId)&&(this.projectPath=(0,D.join)(this.answers.targetFolder,this.answers.selectedApp.appId),this.extractedProjectPath=(0,D.join)(this.projectPath,"extractedFiles"))}async writing(){await async function extractZip(e,r){try{PromptState.admZip?.getEntries().forEach(function(o){if(!o.isDirectory){const a=o.getData().toString("utf8"),i=(0,D.join)(e,o.entryName);RepoAppDownloadLogger.logger?.debug(`extractZip: Extracting file: "${i}" with contents: "${a}" .`),r.write((0,D.join)(e,o.entryName),a)}})}catch(e){RepoAppDownloadLogger.logger?.error(t("error.appDownloadErrors.zipExtractionError",{error:e.message}))}}(this.extractedProjectPath,this.fs);const e=function makeValidJson(e,r){try{const o=r.read(e);return JSON.parse(o)}catch(e){throw new Error(t("error.errorProcessingJsonFile",{error:e}))}}((0,D.join)(this.extractedProjectPath,h),this.fs);validateQfaJsonFile(e);const r={qfaJson:e},o=await getAppConfig(this.answers.selectedApp,this.extractedProjectPath,r,this.answers.systemSelection,this.fs);await(0,L.cM)(this.projectPath,o,this.fs);const a=await getAbapDeployConfig(r);if(await(0,j.c)(this.projectPath,a,void 0,this.fs),this.vscode){const e=this._getLaunchConfig(o);await(0,C.gR)(this.projectPath,e,this.fs,RepoAppDownloadLogger.logger),(0,T.ll)(this.projectPath)}const n=this._getReadMeConfig(o);(0,i.generateAppGenInfo)(this.projectPath,n,this.fs),await async function replaceWebappFiles(e,r,o){try{const a=(0,D.join)(e,x.Lm.Webapp),i=[{webappFile:x.o3.Manifest,extractedFile:x.o3.Manifest},{webappFile:(0,D.join)("i18n","i18n.properties"),extractedFile:(0,D.join)("i18n","i18n.properties")},{webappFile:"index.html",extractedFile:"index.html"},{webappFile:"Component.js",extractedFile:"component.js"}];for(const{webappFile:e,extractedFile:n}of i){const i=(0,D.join)(a,e),s=(0,D.join)(r,n);if(o.exists(s))if(n===x.o3.Manifest){const e=o.readJSON(s),r=o.readJSON(i);r?.["sap.app"]?.dataSources&&e?.["sap.app"]&&(e["sap.app"].dataSources=r["sap.app"].dataSources),r?.["sap.ui5"]?.models&&e?.["sap.ui5"]&&(e["sap.ui5"].models=r["sap.ui5"]?.models),r?.["sap.ui5"]?.resources&&e?.["sap.ui5"]?.resources&&(e["sap.ui5"].resources=r?.["sap.ui5"].resources),o.writeJSON(i,e,void 0,2)}else o.copy(s,i);else RepoAppDownloadLogger.logger?.warn(t("warn.extractedFileNotFound",{extractedFilePath:s}))}}catch(e){RepoAppDownloadLogger.logger?.error(t("error.replaceWebappFilesError",{error:e}))}}(this.projectPath,this.extractedProjectPath,this.fs),await async function validateAndUpdateManifestUI5Version(e,r){const o=readManifest(e,r);if(!o?.["sap.ui5"]?.dependencies||!o?.["sap.app"]?.sourceTemplate)throw new Error(t("error.readManifestErrors.invalidManifestStructureError"));const a=o["sap.ui5"]?.dependencies?.minUI5Version,i=await(0,I.l_)({includeMaintained:!0});if(i.find(e=>e.version===a));else if((0,p.isInternalFeaturesSettingEnabled)())o["sap.ui5"].dependencies.minUI5Version="${sap.ui5.dist.version}";else{const e=i[0]?.version;o["sap.ui5"].dependencies.minUI5Version=e}o["sap.app"].sourceTemplate.id=m,r.writeJSON(e,o,void 0,2)}((0,D.join)(this.projectPath,x.Lm.Webapp,x.o3.Manifest),this.fs),this.fs.delete(this.extractedProjectPath)}_getReadMeConfig(e){return{appName:e.app.id,appTitle:e.app.title??"",appNamespace:e.app.id.substring(0,e.app.id.lastIndexOf(".")),appDescription:t("readMe.appDescription"),ui5Theme:(0,I.UK)(e.ui5?.version),generatorName:l,generatorVersion:this.rootGeneratorVersion(),ui5Version:e.ui5?.version??"",template:L.nY.ListReportObjectPage,serviceUrl:e.service.url,launchText:t("readMe.launchText")}}_getLaunchConfig(e){const r={vscode:this.vscode,addStartCmd:!0,sapClientParam:PromptState.sapClient,flpAppId:e.app.flpAppId??e.app.id,flpSandboxAvailable:!0,isAppStudio:(0,k.isAppStudio)(),odataVersion:e.service.version===c.Yw.v2?"2.0":"4.0"};this.debugOptions=r;return{name:e.app.id,projectRoot:this.projectPath,enableVSCodeReload:!1,debugOptions:r}}async install(){if(this.options.skipInstall)RepoAppDownloadLogger.logger?.info(t("info.installationErrors.skippedInstallation"));else try{RepoAppDownloadLogger.logger?.debug("Running npm install..."),await this._runNpmInstall(this.projectPath),RepoAppDownloadLogger.logger?.debug("npm install completed successfully.")}catch(e){RepoAppDownloadLogger.logger?.error(t("error.installationErrors.npmInstall",{error:e}))}}async _runNpmInstall(e){const r="win32"===(0,b.platform)()?"npm.cmd":"npm";await this.spawnCommand(r,["install","--no-audit","--no-fund","--silent","--prefer-offline","--no-progress"],{cwd:e})}async _handlePostAppGeneration(){if(this.vscode){const e=this.projectPath,{workspaceFolderUri:r}=(0,C.oM)(e,this.debugOptions),o=r?{uri:r,projectName:(0,D.basename)(e),vscode:this.debugOptions.vscode}:void 0;(0,C.EZ)(o)}this.options.data?.postGenCommand&&await async function runPostAppGenHook(e){try{e.vscodeInstance||RepoAppDownloadLogger.logger?.error(t("error.eventHookErrors.vscodeInstanceMissing")),e.postGenCommand&&""!==e.postGenCommand.trim()||RepoAppDownloadLogger.logger?.error(t("error.eventHookErrors.postGenCommandMissing")),await(e.vscodeInstance?.commands?.executeCommand?.(e.postGenCommand,{fsPath:e.path}))}catch(e){RepoAppDownloadLogger.logger?.error(t("error.eventHookErrors.commandExecutionFailed",e.message))}}({path:this.projectPath,vscodeInstance:this.vscode,postGenCommand:this.options.data?.postGenCommand})}async end(){try{this.appWizard.showInformation(t("info.repoAppDownloadCompleteMsg"),s.MessageType.notification),await this._handlePostAppGeneration(),await(0,i.sendTelemetry)(P.GENERATION_SUCCESS,i.TelemetryHelper.createTelemetryData({appType:"repo-app-import-sub-generator",...this.options.telemetryData})??{}).catch(e=>{RepoAppDownloadLogger.logger?.error(t("error.telemetry",{error:e.message}))})}catch(e){RepoAppDownloadLogger.logger?.error(t("error.endPhase",{error:e.message}))}}}}};