constructor(options) { assert(options.projectFolder, "The 'projecFolder' property must be specified to generate a SuiteCloud Jest configuration"); assert(options.projectType, "The 'projectType' property must be specified to generate a SuiteCloud Jest configuration"); this.projectFolder = this._getProjectFolder(options.projectFolder); this.projectType = options.projectType; this.customStubs = options.customStubs; if (this.customStubs == null) { this.customStubs = []; } this.projectInfoService = new ProjectInfoService(this.projectFolder); }
build() { return new DeployActionResult({ status: this.status, ...(this.data && { data: this.data }), ...(this.resultMessage && { resultMessage: this.resultMessage }), ...(this.errorMessages && { errorMessages: this.errorMessages }), ...(this.isServerValidation && { isServerValidation: this.isServerValidation }), ...(this.appliedContentProtection && { appliedContentProtection: this.appliedContentProtection }), ...(this.projectType && { projectType: this.projectType }), ...(this.projectFolder && { projectFolder: this.projectFolder }), }); }
constructor(parameters) { super(parameters); this._projectType = parameters.projectType; this._projectName = parameters.projectName; this._projectDirectory = parameters.projectDirectory; this._includeUnitTesting = parameters.includeUnitTesting; this._npmPackageInitialized = parameters.npmPackageInitialized; }
validateParameters(parameters) { super.validateParameters(parameters); if (this.isSuccess()) { assert(parameters.projectDirectory, 'projectDirectory is required when ActionResult is a success.'); assert(parameters.projectType, 'projectType is required when ActionResult is a success.'); } }
constructor(parameters) { super(parameters); this._isServerValidation = parameters.isServerValidation ? true : false; this._appliedContentProtection = parameters.appliedContentProtection ? true : false; this._projectType = parameters.projectType; }
_getSuiteScriptFolderPath() { if (this.projectType === PROJECT_TYPE.ACP) { return `${this.projectFolder}/FileCabinet/SuiteScripts$1`; } if (this.projectType === PROJECT_TYPE.SUITEAPP) { let applicationId = this.projectInfoService.getApplicationId(); return `${this.projectFolder}/FileCabinet/SuiteApps/${applicationId}$1`; } throw 'Unrecognized projectType. Please revisit your SuiteCloud Jest configuration'; }
parse(actionResult) { if (actionResult.isServerValidation && Array.isArray(actionResult.data)) { actionResult.data.forEach((resultLine) => { this._log.result(resultLine); }); } else if (!actionResult.isServerValidation) { this._showApplyContentProtectionOptionMessage( actionResult.appliedContentProtection, actionResult.projectType, actionResult.projectFolder ); this._showLocalValidationResultData(actionResult.data); } ActionResultUtils.logResultMessage(actionResult, this._log); return actionResult; }
build() { return new CreateProjectActionResult({ status: this.status, ...(this.data && { data: this.data }), ...(this.resultMessage && { resultMessage: this.resultMessage }), ...(this.errorMessages && { errorMessages: this.errorMessages }), ...(this.projectType && { projectType: this.projectType }), ...(this.projectName && { projectName: this.projectName }), ...(this.projectDirectory && { projectDirectory: this.projectDirectory }), ...(this.includeUnitTesting && { includeUnitTesting: this.includeUnitTesting }), ...(this.npmPackageInitialized && { npmPackageInitialized: this.npmPackageInitialized }), ...(this.projectFolder && { projectFolder: this.projectFolder }), }); }
constructor(options) { assert(options.projectFolder, "The 'projecFolder' property must be specified to generate a SuiteCloud Jest configuration"); assert(options.projectType, "The 'projectType' property must be specified to generate a SuiteCloud Jest configuration"); this.projectFolder = this._getProjectFolder(options.projectFolder); this.projectType = options.projectType; this.customStubs = options.customStubs; if (this.customStubs == null) { this.customStubs = []; } this.projectInfoService = new ProjectInfoService(this.projectFolder); }
validateParameters(parameters) { super.validateParameters(parameters); if (this.isSuccess()) { assert(parameters.projectDirectory, 'projectDirectory is required when ActionResult is a success.'); assert(parameters.projectType, 'projectType is required when ActionResult is a success.'); } }
build() { return new DeployActionResult({ status: this.status, ...(this.data && { data: this.data }), ...(this.resultMessage && { resultMessage: this.resultMessage }), ...(this.errorMessages && { errorMessages: this.errorMessages }), ...(this.isServerValidation && { isServerValidation: this.isServerValidation }), ...(this.appliedContentProtection && { appliedContentProtection: this.appliedContentProtection }), ...(this.projectType && { projectType: this.projectType }), ...(this.projectFolder && { projectFolder: this.projectFolder }), }); }
constructor(parameters) { super(parameters); this._projectType = parameters.projectType; this._projectName = parameters.projectName; this._projectDirectory = parameters.projectDirectory; this._includeUnitTesting = parameters.includeUnitTesting; this._npmPackageInitialized = parameters.npmPackageInitialized; }
constructor(parameters) { super(parameters); this._isServerValidation = parameters.isServerValidation ? true : false; this._appliedContentProtection = parameters.appliedContentProtection ? true : false; this._projectType = parameters.projectType; }
_getSuiteScriptFolderPath() { if (this.projectType === PROJECT_TYPE.ACP) { return `${this.projectFolder}/FileCabinet/SuiteScripts$1`; } if (this.projectType === PROJECT_TYPE.SUITEAPP) { let applicationId = this.projectInfoService.getApplicationId(); return `${this.projectFolder}/FileCabinet/SuiteApps/${applicationId}$1`; } throw 'Unrecognized projectType. Please revisit your SuiteCloud Jest configuration'; }
build() { return new CreateProjectActionResult({ status: this.status, ...(this.data && { data: this.data }), ...(this.resultMessage && { resultMessage: this.resultMessage }), ...(this.errorMessages && { errorMessages: this.errorMessages }), ...(this.projectType && { projectType: this.projectType }), ...(this.projectName && { projectName: this.projectName }), ...(this.projectDirectory && { projectDirectory: this.projectDirectory }), ...(this.includeUnitTesting && { includeUnitTesting: this.includeUnitTesting }), ...(this.npmPackageInitialized && { npmPackageInitialized: this.npmPackageInitialized }), ...(this.projectFolder && { projectFolder: this.projectFolder }), }); }