@dxatscale/sfpowerscripts.core
Advanced tools
Comparing version 0.0.14 to 0.0.21-beta.0
@@ -1,1 +0,1 @@ | ||
"use strict";function delay(t){return __awaiter(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}var __awaiter=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function u(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(u,a)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.delay=delay; | ||
"use strict";function delay(t){return __awaiter(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}var __awaiter=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function u(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(u,a)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.delay=delay; |
@@ -1,1 +0,1 @@ | ||
"use strict";function extract(t,e){return __awaiter(this,void 0,void 0,function*(){return new Promise((r,n)=>{fs.createReadStream(t).pipe(unzipper.Extract({path:`${e}`})).on("close",()=>{r()}).on("error",t=>n(t))})})}var __awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof r?t:new r(function(e){e(t)})}(t.value).then(o,c)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const fs=require("fs-extra");var unzipper=require("unzip-stream");exports.extract=extract; | ||
"use strict";function extract(e,t){return __awaiter(this,void 0,void 0,function*(){return new Promise((r,n)=>{fs.createReadStream(e).pipe(unzipper.Extract({path:`${t}`})).on("close",()=>{r()}).on("error",e=>n(e))})})}var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function c(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(o,c)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const fs=require("fs-extra");var unzipper=require("unzip-stream");exports.extract=extract; |
@@ -1,1 +0,1 @@ | ||
"use strict";function onExit(t){return __awaiter(this,void 0,void 0,function*(){return new Promise((n,e)=>{t.once("exit",(t,r)=>{0===t?n(void 0):e(new Error("Exit with error code: "+t))}),t.once("error",t=>{e(t)})})})}var __awaiter=this&&this.__awaiter||function(t,n,e,r){return new(e||(e=Promise))(function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function u(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):function(t){return t instanceof e?t:new e(function(n){n(t)})}(t.value).then(c,u)}a((r=r.apply(t,n||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.onExit=onExit; | ||
"use strict";function onExit(t){return __awaiter(this,void 0,void 0,function*(){return new Promise((e,n)=>{t.once("exit",(t,r)=>{0===t?e(void 0):n(new Error("Exit with error code: "+t))}),t.once("error",t=>{n(t)})})})}var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function u(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(c,u)}a((r=r.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.onExit=onExit; |
@@ -13,6 +13,6 @@ { | ||
"homepage": "https://github.com/azlamsalam/sfpowerscripts#readme", | ||
"version": "0.0.13", | ||
"version": "0.0.21-beta.0", | ||
"scripts": { | ||
"build": "npm install && node buildpackage.js", | ||
"package": "npm run build && cd dist && npm publish" | ||
"prepare": "node buildpackage.js", | ||
"postpublish": "echo published" | ||
}, | ||
@@ -29,3 +29,4 @@ "dependencies": { | ||
], | ||
"author": "dxatscale" | ||
"author": "dxatscale", | ||
"gitHead": "fbe966a387b68419d67cc0ee775d8930c4dbbe9b" | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))(function(n,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function u(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){t.done?n(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,u)}l((r=r.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),util_1=require("util");class AnalyzeWithPMDImpl{constructor(t,e,i,r,n,o){this.project_directory=t,this.directory=e,this.ruleset=i,this.format=r,this.ouputPath=n,this.version=o}exec(t){return __awaiter(this,void 0,void 0,function*(){let e=child_process.exec(t,{encoding:"utf8",maxBuffer:5242880,cwd:this.project_directory},(t,e,i)=>{if(t)throw t});e.stdout.on("data",t=>{console.log(t.toString())}),e.stderr.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let t;return t="npx sfdx sfpowerkit:source:pmd",util_1.isNullOrUndefined(this.directory)||(t+=` -d ${this.directory}`),util_1.isNullOrUndefined(this.format)||(t+=` -f ${this.format}`),util_1.isNullOrUndefined(this.ouputPath)||(t+=` -o ${this.ouputPath}`),!util_1.isNullOrUndefined(this.ruleset)&&this.ruleset.length>0&&(t+=` -r ${this.ruleset}`),util_1.isNullOrUndefined(this.version)||(t+=` --version=${this.version}`),t+=" --loglevel INFO",console.log(t),t})}}exports.default=AnalyzeWithPMDImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))(function(o,n){function s(t){try{u(r.next(t))}catch(t){n(t)}}function l(t){try{u(r.throw(t))}catch(t){n(t)}}function u(t){t.done?o(t.value):new i(function(e){e(t.value)}).then(s,l)}u((r=r.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),util_1=require("util");class AnalyzeWithPMDImpl{constructor(t,e,i,r,o,n){this.project_directory=t,this.directory=e,this.ruleset=i,this.format=r,this.ouputPath=o,this.version=n}exec(t){return __awaiter(this,void 0,void 0,function*(){let e=child_process.exec(t,{encoding:"utf8",maxBuffer:5242880,cwd:this.project_directory},(t,e,i)=>{if(t)throw t});e.stdout.on("data",t=>{console.log(t.toString())}),e.stderr.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let t;return t="npx sfdx sfpowerkit:source:pmd",util_1.isNullOrUndefined(this.directory)||(t+=` -d ${this.directory}`),util_1.isNullOrUndefined(this.format)||(t+=` -f ${this.format}`),util_1.isNullOrUndefined(this.ouputPath)||(t+=` -o ${this.ouputPath}`),!util_1.isNullOrUndefined(this.ruleset)&&this.ruleset.length>0&&(t+=` -r ${this.ruleset}`),util_1.isNullOrUndefined(this.version)||(t+=` --version=${this.version}`),t+=" --loglevel INFO",console.log(t),t})}}exports.default=AnalyzeWithPMDImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(i,t,e,o){return new(e||(e=Promise))(function(n,s){function r(i){try{a(o.next(i))}catch(i){s(i)}}function c(i){try{a(o.throw(i))}catch(i){s(i)}}function a(i){i.done?n(i.value):function(i){return i instanceof e?i:new e(function(t){t(i)})}(i.value).then(r,c)}a((o=o.apply(i,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),util_1=require("util");class CreateDeltaPackageImpl{constructor(i,t,e,o,n,s){this.projectDirectory=i,this.sfdx_package=t,this.revisionFrom=e,this.revisionTo=o,this.generateDestructiveManifest=n,this.options=s}exec(i){return __awaiter(this,void 0,void 0,function*(){let t=child_process.exec(i,{encoding:"utf8",cwd:this.projectDirectory},(i,t,e)=>{if(i)throw i});t.stdout.on("data",i=>{console.log(i.toString())}),t.stderr.on("data",i=>{console.log(i.toString())}),yield OnExit_1.onExit(t)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let i;return i="npx sfdx sfpowerkit:project:diff",util_1.isNullOrUndefined(this.revisionTo)||(i+=` -t ${this.revisionTo}`),util_1.isNullOrUndefined(this.revisionFrom)||(i+=` -r ${this.revisionFrom}`),this.generateDestructiveManifest&&(i+=" -x"),i+=` -d ${this.sfdx_package}_src_delta`,util_1.isNullOrUndefined(this.options.bypass_directories)||(i+=` -b ${this.options.bypass_directories}`),util_1.isNullOrUndefined(this.options.only_diff_for)||(i+=` -p ${this.options.only_diff_for}`),util_1.isNullOrUndefined(this.options.apiversion)||(i+=` --apiversion ${this.options.apiversion}`),i})}}exports.default=CreateDeltaPackageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(i,t,e,o){return new(e||(e=Promise))(function(s,r){function n(i){try{a(o.next(i))}catch(i){r(i)}}function c(i){try{a(o.throw(i))}catch(i){r(i)}}function a(i){i.done?s(i.value):new e(function(t){t(i.value)}).then(n,c)}a((o=o.apply(i,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),util_1=require("util");class CreateDeltaPackageImpl{constructor(i,t,e,o,s,r){this.projectDirectory=i,this.sfdx_package=t,this.revisionFrom=e,this.revisionTo=o,this.generateDestructiveManifest=s,this.options=r}exec(i){return __awaiter(this,void 0,void 0,function*(){let t=child_process.exec(i,{encoding:"utf8",cwd:this.projectDirectory},(i,t,e)=>{if(i)throw i});t.stdout.on("data",i=>{console.log(i.toString())}),t.stderr.on("data",i=>{console.log(i.toString())}),yield OnExit_1.onExit(t)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let i;return i="npx sfdx sfpowerkit:project:diff",util_1.isNullOrUndefined(this.revisionTo)||(i+=` -t ${this.revisionTo}`),util_1.isNullOrUndefined(this.revisionFrom)||(i+=` -r ${this.revisionFrom}`),this.generateDestructiveManifest&&(i+=" -x"),i+=` -d ${this.sfdx_package}_src_delta`,util_1.isNullOrUndefined(this.options.bypass_directories)||(i+=` -b ${this.options.bypass_directories}`),util_1.isNullOrUndefined(this.options.only_diff_for)||(i+=` -p ${this.options.only_diff_for}`),util_1.isNullOrUndefined(this.options.apiversion)||(i+=` --apiversion ${this.options.apiversion}`),i})}}exports.default=CreateDeltaPackageImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,i,e,n){return new(e||(e=Promise))(function(r,o){function c(t){try{a(n.next(t))}catch(t){o(t)}}function s(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?r(t.value):function(t){return t instanceof e?t:new e(function(i){i(t)})}(t.value).then(c,s)}a((n=n.apply(t,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");class CreateScratchOrgImpl{constructor(t,i,e,n,r){this.working_directory=t,this.config_file_path=i,this.devhub=e,this.alias=n,this.daysToMaintain=r}exec(t){return __awaiter(this,void 0,void 0,function*(){let i=child_process.exec(t,{cwd:this.working_directory,encoding:"utf8"},(t,e,n)=>{if(t)throw i.stderr.on("data",t=>{console.log(t.toString())}),t}),e="";i.stdout.on("data",t=>{console.log(t.toString()),e+=t.toString()}),yield OnExit_1.onExit(i);return JSON.parse(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx force:org:create -v ${this.devhub} -s -f ${this.config_file_path} --json -a ${this.alias} -d ${this.daysToMaintain}`})}}exports.default=CreateScratchOrgImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,i,e,r){return new(e||(e=Promise))(function(n,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?n(t.value):new e(function(i){i(t.value)}).then(s,a)}c((r=r.apply(t,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");class CreateScratchOrgImpl{constructor(t,i,e,r,n){this.working_directory=t,this.config_file_path=i,this.devhub=e,this.alias=r,this.daysToMaintain=n}exec(t){return __awaiter(this,void 0,void 0,function*(){let i=child_process.exec(t,{cwd:this.working_directory,encoding:"utf8"},(t,e,r)=>{if(t)throw i.stderr.on("data",t=>{console.log(t.toString())}),t}),e="";i.stdout.on("data",t=>{console.log(t.toString()),e+=t.toString()}),yield OnExit_1.onExit(i);return JSON.parse(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx force:org:create -v ${this.devhub} -s -f ${this.config_file_path} --json -a ${this.alias} -d ${this.daysToMaintain}`})}}exports.default=CreateScratchOrgImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(s,a){function r(i){try{c(n.next(i))}catch(i){a(i)}}function o(i){try{c(n.throw(i))}catch(i){a(i)}}function c(i){i.done?s(i.value):function(i){return i instanceof e?i:new e(function(t){t(i)})}(i.value).then(r,o)}c((n=n.apply(i,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),util_1=require("util"),OnExit_1=require("../OnExit");class CreateUnlockedPackageImpl{constructor(i,t,e,n,s,a,r,o,c,l,u){this.sfdx_package=i,this.version_number=t,this.tag=e,this.config_file_path=n,this.installationkeybypass=s,this.installationkey=a,this.project_directory=r,this.devhub_alias=o,this.wait_time=c,this.isCoverageEnabled=l,this.isSkipValidation=u}exec(i){return __awaiter(this,void 0,void 0,function*(){let t=child_process.exec(i,{cwd:this.project_directory,encoding:"utf8"},(i,t,e)=>{if(i)throw i}),e="";t.stdout.on("data",i=>{console.log(i.toString()),e+=i.toString()}),yield OnExit_1.onExit(t);return JSON.parse(e).result.SubscriberPackageVersionId})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let i=`npx sfdx force:package:version:create -p ${this.sfdx_package} -w ${this.wait_time} --definitionfile ${this.config_file_path} --json`;return util_1.isNullOrUndefined(this.version_number)||(i+=` --versionnumber ${this.version_number}`),this.installationkeybypass?i+=" -x":i+=` -k ${this.installationkey}`,util_1.isNullOrUndefined(this.tag)||(i+=` -t ${this.tag}`),this.isCoverageEnabled&&(i+=" -c"),this.isSkipValidation&&(i+=" --skipvalidation"),i+=` -v ${this.devhub_alias}`})}}exports.default=CreateUnlockedPackageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(s,a){function r(i){try{c(n.next(i))}catch(i){a(i)}}function o(i){try{c(n.throw(i))}catch(i){a(i)}}function c(i){i.done?s(i.value):new e(function(t){t(i.value)}).then(r,o)}c((n=n.apply(i,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),util_1=require("util"),OnExit_1=require("../OnExit");class CreateUnlockedPackageImpl{constructor(i,t,e,n,s,a,r,o,c,l,h){this.sfdx_package=i,this.version_number=t,this.tag=e,this.config_file_path=n,this.installationkeybypass=s,this.installationkey=a,this.project_directory=r,this.devhub_alias=o,this.wait_time=c,this.isCoverageEnabled=l,this.isSkipValidation=h}exec(i){return __awaiter(this,void 0,void 0,function*(){let t=child_process.exec(i,{cwd:this.project_directory,encoding:"utf8"},(i,t,e)=>{if(i)throw i}),e="";t.stdout.on("data",i=>{console.log(i.toString()),e+=i.toString()}),yield OnExit_1.onExit(t);return JSON.parse(e).result.SubscriberPackageVersionId})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let i=`npx sfdx force:package:version:create -p ${this.sfdx_package} -w ${this.wait_time} --definitionfile ${this.config_file_path} --json`;return util_1.isNullOrUndefined(this.version_number)||(i+=` --versionnumber ${this.version_number}`),this.installationkeybypass?i+=" -x":i+=` -k ${this.installationkey}`,util_1.isNullOrUndefined(this.tag)||(i+=` -t ${this.tag}`),this.isCoverageEnabled&&(i+=" -c"),this.isSkipValidation&&(i+=" --skipvalidation"),i+=` -v ${this.devhub_alias}`})}}exports.default=CreateUnlockedPackageImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(c,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?c(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(i,s)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process");class DeleteScratchOrgImpl{constructor(e,t){this.target_org=e,this.devhub=t}exec(e){return __awaiter(this,void 0,void 0,function*(){let t=child_process.execSync(e,{encoding:"utf8"});console.log(t)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx force:org:delete -u ${this.target_org} -v ${this.devhub} -p`})}}exports.default=DeleteScratchOrgImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,c){return new(r||(r=Promise))(function(n,o){function i(e){try{u(c.next(e))}catch(e){o(e)}}function s(e){try{u(c.throw(e))}catch(e){o(e)}}function u(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(i,s)}u((c=c.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process");class DeleteScratchOrgImpl{constructor(e,t){this.target_org=e,this.devhub=t}exec(e){return __awaiter(this,void 0,void 0,function*(){let t=child_process.execSync(e,{encoding:"utf8"});console.log(t)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx force:org:delete -u ${this.target_org} -v ${this.devhub} -p`})}}exports.default=DeleteScratchOrgImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function c(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?r(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(s,c)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");class DeployDestructiveManifestToOrgImpl{constructor(t,e){this.target_org=t,this.destructiveManifestPath=e}exec(t){return __awaiter(this,void 0,void 0,function*(){let e=child_process.exec(t,{encoding:"utf8"},(t,e,i)=>{if(t)throw t});e.stdout.on("data",t=>{console.log(t.toString())}),e.stderr.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx sfpowerkit:org:destruct -u ${this.target_org} -m ${this.destructiveManifestPath}`})}}exports.default=DeployDestructiveManifestToOrgImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))(function(o,n){function s(t){try{a(r.next(t))}catch(t){n(t)}}function c(t){try{a(r.throw(t))}catch(t){n(t)}}function a(t){t.done?o(t.value):new i(function(e){e(t.value)}).then(s,c)}a((r=r.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");class DeployDestructiveManifestToOrgImpl{constructor(t,e){this.target_org=t,this.destructiveManifestPath=e}exec(t){return __awaiter(this,void 0,void 0,function*(){let e=child_process.exec(t,{encoding:"utf8"},(t,e,i)=>{if(t)throw t});e.stdout.on("data",t=>{console.log(t.toString())}),e.stderr.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx sfpowerkit:org:destruct -u ${this.target_org} -m ${this.destructiveManifestPath}`})}}exports.default=DeployDestructiveManifestToOrgImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))(function(s,r){function n(e){try{c(i.next(e))}catch(e){r(e)}}function l(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){e.done?s(e.value):function(e){return e instanceof o?e:new o(function(t){t(e)})}(e.value).then(n,l)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),Delay_1=require("../Delay"),rimraf=require("rimraf"),fs_1=require("fs"),util_1=require("util"),OnExit_1=require("../OnExit");let path=require("path");class DeploySourceToOrgImpl{constructor(e,t,o,i,s){this.target_org=e,this.project_directory=t,this.source_directory=o,this.deployment_options=i,this.isToBreakBuildIfEmpty=s}exec(){return __awaiter(this,void 0,void 0,function*(){let e=!1,t={};rimraf.sync("sfpowerscripts_mdapi");let o=this.isToBreakBuildForEmptyDirectory();if("break"==o.result)return t.result=!1,t.message=o.message,t;if("skip"==o.result)return t.result=!0,t.message=o.message,t;console.log("Converting source to mdapi"),yield this.convertSourceToMDAPI();try{this.deployment_options.checkonly&&fs_1.copyFileSync(this.deployment_options.validation_ignore,path.join(this.project_directory,".forceignore"))}catch(e){console.error(e),console.log("Validation Ignore not found, using .forceignore")}let i="";try{let e=yield this.buildExecCommand();console.log(e);let o=child_process.execSync(e,{cwd:this.project_directory,encoding:"utf8"});i=JSON.parse(o).result.id}catch(e){return t.result=!1,t.message=JSON.parse(e.stdout).message,t}this.deployment_options.checkonly?console.log("Validation is in progress.... Unleashing the power of your code!"):console.log("Deployment is in progress.... Unleashing the power of your code!");let s;for(;;){try{s=child_process.execSync(`npx sfdx force:mdapi:deploy:report --json -i ${i} -u ${this.target_org}`,{cwd:this.project_directory,encoding:"utf8",stdio:["pipe","pipe","ignore"]})}catch(e){this.deployment_options.checkonly?console.log("Validation Failed"):console.log("Deployment Failed");break}let t=JSON.parse(s);if(1==t.status){console.log("Validation/Deployment Failed"),e=!1;break}if("InProgress"==t.result.status||"Pending"==t.result.status)console.log(`Processing ${t.result.numberComponentsDeployed} out of ${t.result.numberComponentsTotal}`);else if("Succeeded"==t.result.status){console.log("Validation/Deployment Succeeded"),e=!0;break}yield Delay_1.delay(3e4)}return t.message=yield this.getFinalDeploymentStatus(i),t.result=e,t.deploy_id=i,t})}isToBreakBuildForEmptyDirectory(){let e,t={message:"",result:""};e=util_1.isNullOrUndefined(this.project_directory)?this.source_directory:path.join(this.project_directory,this.source_directory);try{return fs_1.existsSync(e)?this.isEmptyFolder(e)?(this.isToBreakBuildIfEmpty?(t.message=`Folder is Empty , Stopping build as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="break"):(t.message=`Folder is Empty, Skipping task as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="skip"),t):(t.result="continue",t):(this.isToBreakBuildIfEmpty?(t.message=`Folder not Found , Stopping build as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="break"):(t.message=`Folder not Found , Skipping task as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="skip"),t)}catch(o){if(this.isToBreakBuildIfEmpty)throw o;return t.message=`Something wrong with the path provided ${e},,but skipping `,t.result="skip",t}}getFinalDeploymentStatus(e){return __awaiter(this,void 0,void 0,function*(){let t="";try{let o=child_process.exec(`npx sfdx force:mdapi:deploy:report -i ${e} -u ${this.target_org}`,{cwd:this.project_directory,encoding:"utf8"},(e,t,o)=>{});return o.stdout.on("data",e=>{t+=e.toString()}),yield OnExit_1.onExit(o),t}catch(e){return t}})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let e,t=`npx sfdx force:mdapi:deploy -u ${this.target_org}`;return this.deployment_options.checkonly&&(t+=" -c"),t+=" -d sfpowerscripts_mdapi",t+=" --json","RunApexTestSuite"==this.deployment_options.testlevel?(t+=" -l RunSpecifiedTests",t+=` -r ${e=yield this.convertApexTestSuiteToListOfApexClasses(this.deployment_options.apextestsuite)}`):"RunSpecifiedTests"==this.deployment_options.testlevel?(t+=" -l RunSpecifiedTests",t+=` -r ${e=this.deployment_options.specified_tests}`):t+=` -l ${this.deployment_options.testlevel}`,t})}convertApexTestSuiteToListOfApexClasses(e){return __awaiter(this,void 0,void 0,function*(){console.log(`Converting an apex test suite ${e} to its consituent apex test classes`);let t=child_process.execSync(`npx sfdx sfpowerkit:source:apextestsuite:convert -n ${e} --json`,{cwd:this.project_directory,encoding:"utf8"}),o=JSON.parse(t);if(0==o.status)return o.result;throw new Error(`Unable to convert apex test suite ${e} ${o.message}`)})}convertSourceToMDAPI(){return __awaiter(this,void 0,void 0,function*(){try{util_1.isNullOrUndefined(this.project_directory)?console.log(`Converting to Source Format ${this.source_directory} in project directory`):console.log(`Converting to Source Format ${this.source_directory} in project directory ${this.project_directory}`),child_process.execSync(`npx sfdx force:source:convert -r ${this.source_directory} -d sfpowerscripts_mdapi`,{cwd:this.project_directory,encoding:"utf8"}),console.log("Converting to Source Format Completed")}catch(e){throw console.log("Unable to convert source, exiting"+e.code),e}})}isEmptyFolder(e){let t=fs_1.readdirSync(e);return null==t||0===t.length}}exports.default=DeploySourceToOrgImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))(function(s,r){function n(e){try{c(i.next(e))}catch(e){r(e)}}function l(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){e.done?s(e.value):new o(function(t){t(e.value)}).then(n,l)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),Delay_1=require("../Delay"),rimraf=require("rimraf"),fs_1=require("fs"),util_1=require("util"),OnExit_1=require("../OnExit");let path=require("path");class DeploySourceToOrgImpl{constructor(e,t,o,i,s){this.target_org=e,this.project_directory=t,this.source_directory=o,this.deployment_options=i,this.isToBreakBuildIfEmpty=s}exec(){return __awaiter(this,void 0,void 0,function*(){let e=!1,t={};rimraf.sync("sfpowerscripts_mdapi");let o=this.isToBreakBuildForEmptyDirectory();if("break"==o.result)return t.result=!1,t.message=o.message,t;if("skip"==o.result)return t.result=!0,t.message=o.message,t;console.log("Converting source to mdapi"),yield this.convertSourceToMDAPI();try{this.deployment_options.checkonly&&fs_1.copyFileSync(this.deployment_options.validation_ignore,path.join(this.project_directory,".forceignore"))}catch(e){console.error(e),console.log("Validation Ignore not found, using .forceignore")}let i="";try{let e=yield this.buildExecCommand();console.log(e);let o=child_process.execSync(e,{cwd:this.project_directory,encoding:"utf8"});i=JSON.parse(o).result.id}catch(e){return t.result=!1,t.message=JSON.parse(e.stdout).message,t}this.deployment_options.checkonly?console.log("Validation is in progress.... Unleashing the power of your code!"):console.log("Deployment is in progress.... Unleashing the power of your code!");let s;for(;;){try{s=child_process.execSync(`npx sfdx force:mdapi:deploy:report --json -i ${i} -u ${this.target_org}`,{cwd:this.project_directory,encoding:"utf8",stdio:["pipe","pipe","ignore"]})}catch(e){this.deployment_options.checkonly?console.log("Validation Failed"):console.log("Deployment Failed");break}let t=JSON.parse(s);if(1==t.status){console.log("Validation/Deployment Failed"),e=!1;break}if("InProgress"==t.result.status||"Pending"==t.result.status)console.log(`Processing ${t.result.numberComponentsDeployed} out of ${t.result.numberComponentsTotal}`);else if("Succeeded"==t.result.status){console.log("Validation/Deployment Succeeded"),e=!0;break}yield Delay_1.delay(3e4)}return t.message=yield this.getFinalDeploymentStatus(i),t.result=e,t.deploy_id=i,t})}isToBreakBuildForEmptyDirectory(){let e,t={message:"",result:""};e=util_1.isNullOrUndefined(this.project_directory)?this.source_directory:path.join(this.project_directory,this.source_directory);try{return fs_1.existsSync(e)?this.isEmptyFolder(e)?(this.isToBreakBuildIfEmpty?(t.message=`Folder is Empty , Stopping build as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="break"):(t.message=`Folder is Empty, Skipping task as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="skip"),t):(t.result="continue",t):(this.isToBreakBuildIfEmpty?(t.message=`Folder not Found , Stopping build as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="break"):(t.message=`Folder not Found , Skipping task as isToBreakBuildIfEmpty is ${this.isToBreakBuildIfEmpty}`,t.result="skip"),t)}catch(o){if(this.isToBreakBuildIfEmpty)throw o;return t.message=`Something wrong with the path provided ${e},,but skipping `,t.result="skip",t}}getFinalDeploymentStatus(e){return __awaiter(this,void 0,void 0,function*(){let t="";try{let o=child_process.exec(`npx sfdx force:mdapi:deploy:report -i ${e} -u ${this.target_org}`,{cwd:this.project_directory,encoding:"utf8"},(e,t,o)=>{});return o.stdout.on("data",e=>{t+=e.toString()}),yield OnExit_1.onExit(o),t}catch(e){return t}})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let e,t=`npx sfdx force:mdapi:deploy -u ${this.target_org}`;return this.deployment_options.checkonly&&(t+=" -c"),t+=" -d sfpowerscripts_mdapi",t+=" --json","RunApexTestSuite"==this.deployment_options.testlevel?(t+=" -l RunSpecifiedTests",t+=` -r ${e=yield this.convertApexTestSuiteToListOfApexClasses(this.deployment_options.apextestsuite)}`):"RunSpecifiedTests"==this.deployment_options.testlevel?(t+=" -l RunSpecifiedTests",t+=` -r ${e=this.deployment_options.specified_tests}`):t+=` -l ${this.deployment_options.testlevel}`,t})}convertApexTestSuiteToListOfApexClasses(e){return __awaiter(this,void 0,void 0,function*(){console.log(`Converting an apex test suite ${e} to its consituent apex test classes`);let t=child_process.execSync(`npx sfdx sfpowerkit:source:apextestsuite:convert -n ${e} --json`,{cwd:this.project_directory,encoding:"utf8"}),o=JSON.parse(t);if(0==o.status)return o.result;throw new Error(`Unable to convert apex test suite ${e} ${o.message}`)})}convertSourceToMDAPI(){return __awaiter(this,void 0,void 0,function*(){try{util_1.isNullOrUndefined(this.project_directory)?console.log(`Converting to Source Format ${this.source_directory} in project directory`):console.log(`Converting to Source Format ${this.source_directory} in project directory ${this.project_directory}`),child_process.execSync(`npx sfdx force:source:convert -r ${this.source_directory} -d sfpowerscripts_mdapi`,{cwd:this.project_directory,encoding:"utf8"}),console.log("Converting to Source Format Completed")}catch(e){throw console.log("Unable to convert source, exiting"+e.code),e}})}isEmptyFolder(e){let t=fs_1.readdirSync(e);return null==t||0===t.length}}exports.default=DeploySourceToOrgImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(o,n){function s(e){try{a(i.next(e))}catch(e){n(e)}}function c(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){e.done?o(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(s,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),Extract_1=require("../Extract"),path=require("path"),fs=require("fs-extra");class ExportSourceFromAnOrgImpl{constructor(e,t,r,i,o){this.target_org=e,this.source_directory=t,this.filter=r,this.isManagedPackageToBeExclued=i,this.isUnzipEnabled=o}exec(){return __awaiter(this,void 0,void 0,function*(){fs.ensureDirSync(this.source_directory);let e=yield this.buildManifestBuildCommand(),t=child_process.exec(e,{encoding:"utf8"});return t.stdout.on("data",e=>{console.log(e.toString())}),t.stderr.on("data",e=>{console.log(e.toString())}),yield OnExit_1.onExit(t),e=yield this.buildMDAPIRetrieveCommand(),(t=child_process.exec(e,{encoding:"utf8"})).stdout.on("data",e=>{console.log(e.toString())}),t.stderr.on("data",e=>{console.log(e.toString())}),yield OnExit_1.onExit(t),this.isUnzipEnabled?(yield Extract_1.extract(path.join(this.source_directory,"unpackaged.zip"),this.source_directory),fs.unlinkSync(path.join(this.source_directory,"unpackaged.zip")),fs.copySync(path.join(this.source_directory,"unpackaged"),this.source_directory,{overwrite:!0}),fs.removeSync(path.join(this.source_directory,"unpackaged")),this.source_directory):path.resolve(this.source_directory,"unpackaged.zip")})}buildManifestBuildCommand(){let e=`npx sfdx sfpowerkit:org:manifest:build -u ${this.target_org}`;return this.isManagedPackageToBeExclued&&(e+=" -x"),this.filter&&(e+=` -q ${this.filter}`),this.source_directory&&(e+=` -o ${path.join(this.source_directory,"package.xml")}`),console.log("Generated Command"),console.log(e),e}buildMDAPIRetrieveCommand(){let e=`sfdx force:mdapi:retrieve -u ${this.target_org}`;return e+=` -k ${path.join(this.source_directory,"package.xml")}`,e+=` -r ${path.join(this.source_directory)}`,console.log("Generated Command"),console.log(e),e}}exports.default=ExportSourceFromAnOrgImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(o,n){function s(e){try{a(i.next(e))}catch(e){n(e)}}function c(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(s,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),Extract_1=require("../Extract"),path=require("path"),fs=require("fs-extra");class ExportSourceFromAnOrgImpl{constructor(e,t,r,i,o){this.target_org=e,this.source_directory=t,this.filter=r,this.isManagedPackageToBeExclued=i,this.isUnzipEnabled=o}exec(){return __awaiter(this,void 0,void 0,function*(){fs.ensureDirSync(this.source_directory);let e=yield this.buildManifestBuildCommand(),t=child_process.exec(e,{encoding:"utf8"});return t.stdout.on("data",e=>{console.log(e.toString())}),t.stderr.on("data",e=>{console.log(e.toString())}),yield OnExit_1.onExit(t),e=yield this.buildMDAPIRetrieveCommand(),(t=child_process.exec(e,{encoding:"utf8"})).stdout.on("data",e=>{console.log(e.toString())}),t.stderr.on("data",e=>{console.log(e.toString())}),yield OnExit_1.onExit(t),this.isUnzipEnabled?(yield Extract_1.extract(path.join(this.source_directory,"unpackaged.zip"),this.source_directory),fs.unlinkSync(path.join(this.source_directory,"unpackaged.zip")),fs.copySync(path.join(this.source_directory,"unpackaged"),this.source_directory,{overwrite:!0}),fs.removeSync(path.join(this.source_directory,"unpackaged")),this.source_directory):path.resolve(this.source_directory,"unpackaged.zip")})}buildManifestBuildCommand(){let e=`npx sfdx sfpowerkit:org:manifest:build -u ${this.target_org}`;return this.isManagedPackageToBeExclued&&(e+=" -x"),this.filter&&(e+=` -q ${this.filter}`),this.source_directory&&(e+=` -o ${path.join(this.source_directory,"package.xml")}`),console.log("Generated Command"),console.log(e),e}buildMDAPIRetrieveCommand(){let e=`sfdx force:mdapi:retrieve -u ${this.target_org}`;return e+=` -k ${path.join(this.source_directory,"package.xml")}`,e+=` -r ${path.join(this.source_directory)}`,console.log("Generated Command"),console.log(e),e}}exports.default=ExportSourceFromAnOrgImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function u(e){try{a(i.next(e))}catch(e){s(e)}}function o(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){e.done?n(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(u,o)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const util_1=require("util"),fs=require("fs"),path=require("path");class IncrementProjectBuildNumberImpl{constructor(e,t,r,i,n){this.project_directory=e,this.sfdx_package=t,this.segment=r,this.appendBuildNumber=i,this.buildNumber=n}exec(){return __awaiter(this,void 0,void 0,function*(){let e;e=util_1.isNullOrUndefined(this.project_directory)?"sfdx-project.json":path.join(this.project_directory,"sfdx-project.json");let t=JSON.parse(fs.readFileSync(e));util_1.isNullOrUndefined(this.sfdx_package)&&(this.sfdx_package="default");let r;t.packageDirectories.forEach(e=>{"default"!=this.sfdx_package||1!=e.default?this.sfdx_package!=e.package||(r=e):r=e}),console.log(`Package : ${r.package}`),console.log(`Version : ${r.versionNumber}`);let i=r.versionNumber.split(".");if("Major"==this.segment&&(i[0]+=String(Number(i[0])+1)),"Minor"==this.segment&&(i[1]+=String(Number(i[1])+1)),"Patch"==this.segment&&(i[2]=String(Number(i[2])+1)),"NEXT"==i[3])throw new Error("NEXT not supported for this task, Please keep as the build version, which then this task can manipulate");if("BuildNumber"!=this.segment||this.appendBuildNumber||(i[3]=String(Number(i[3])+1)),this.appendBuildNumber){let e=parseInt(this.buildNumber);if(isNaN(e))throw new Error("BuildNumber should be a number");if(e>999)throw new Error("BuildNumber should be less than 999");i[3]=this.buildNumber}return r.versionNumber=`${i[0]}.${i[1]}.${i[2]}.${i[3]}`,console.log(`Updated Version : ${r.versionNumber}`),this.appendBuildNumber||fs.writeFileSync(e,JSON.stringify(t,null,4)),r.versionNumber})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){})}}exports.default=IncrementProjectBuildNumberImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function u(e){try{a(i.next(e))}catch(e){n(e)}}function o(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){e.done?s(e.value):new r(function(t){t(e.value)}).then(u,o)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const util_1=require("util"),fs=require("fs"),path=require("path");class IncrementProjectBuildNumberImpl{constructor(e,t,r,i,s){this.project_directory=e,this.sfdx_package=t,this.segment=r,this.appendBuildNumber=i,this.buildNumber=s}exec(){return __awaiter(this,void 0,void 0,function*(){let e;e=util_1.isNullOrUndefined(this.project_directory)?"sfdx-project.json":path.join(this.project_directory,"sfdx-project.json");let t=JSON.parse(fs.readFileSync(e));util_1.isNullOrUndefined(this.sfdx_package)&&(this.sfdx_package="default");let r;t.packageDirectories.forEach(e=>{"default"!=this.sfdx_package||1!=e.default?this.sfdx_package!=e.package||(r=e):r=e}),console.log(`Package : ${r.package}`),console.log(`Version : ${r.versionNumber}`);let i=r.versionNumber.split(".");if("Major"==this.segment&&(i[0]+=String(Number(i[0])+1)),"Minor"==this.segment&&(i[1]+=String(Number(i[1])+1)),"Patch"==this.segment&&(i[2]=String(Number(i[2])+1)),"NEXT"==i[3])throw new Error("NEXT not supported for this task, Please keep as the build version, which then this task can manipulate");if("BuildNumber"!=this.segment||this.appendBuildNumber||(i[3]=String(Number(i[3])+1)),this.appendBuildNumber){let e=parseInt(this.buildNumber);if(isNaN(e))throw new Error("BuildNumber should be a number");if(e>999)throw new Error("BuildNumber should be less than 999");i[3]=this.buildNumber}return r.versionNumber=`${i[0]}.${i[1]}.${i[2]}.${i[3]}`,console.log(`Updated Version : ${r.versionNumber}`),this.appendBuildNumber||fs.writeFileSync(e,JSON.stringify(t,null,4)),r.versionNumber})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){})}}exports.default=IncrementProjectBuildNumberImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,i,e,n){return new(e||(e=Promise))(function(o,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function r(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){t.done?o(t.value):function(t){return t instanceof e?t:new e(function(i){i(t)})}(t.value).then(a,r)}l((n=n.apply(t,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),util_1=require("util"),OnExit_1=require("../OnExit");class InstallUnlockedPackageImpl{constructor(t,i,e,n,o){this.package_version_id=t,this.targetusername=i,this.options=e,this.wait_time=n,this.publish_wait_time=o}exec(){return __awaiter(this,void 0,void 0,function*(){let t=yield this.buildExecCommand(),i=child_process.exec(t,(t,i,e)=>{if(t)throw t});i.stdout.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(i)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let t=`npx sfdx force:package:install --package ${this.package_version_id} -u ${this.targetusername} --noprompt`;return t+=` --publishwait=${this.publish_wait_time}`,t+=` --wait=${this.wait_time}`,t+=` --securitytype=${this.options.securitytype}`,t+=` --upgradetype=${this.options.upgradetype}`,t+=` --apexcompile=${this.options.apexcompile}`,util_1.isNullOrUndefined(this.options.installationkey)||(t+=` --installationkey=${this.options.installationkey}`),console.log(`Generated Command ${t}`),t})}}exports.default=InstallUnlockedPackageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,i,e,n){return new(e||(e=Promise))(function(o,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function r(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){t.done?o(t.value):new e(function(i){i(t.value)}).then(a,r)}l((n=n.apply(t,i||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),util_1=require("util"),OnExit_1=require("../OnExit");class InstallUnlockedPackageImpl{constructor(t,i,e,n,o){this.package_version_id=t,this.targetusername=i,this.options=e,this.wait_time=n,this.publish_wait_time=o}exec(){return __awaiter(this,void 0,void 0,function*(){let t=yield this.buildExecCommand(),i=child_process.exec(t,(t,i,e)=>{if(t)throw t});i.stdout.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(i)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let t=`npx sfdx force:package:install --package ${this.package_version_id} -u ${this.targetusername} --noprompt`;return t+=` --publishwait=${this.publish_wait_time}`,t+=` --wait=${this.wait_time}`,t+=` --securitytype=${this.options.securitytype}`,t+=` --upgradetype=${this.options.upgradetype}`,t+=` --apexcompile=${this.options.apexcompile}`,util_1.isNullOrUndefined(this.options.installationkey)||(t+=` --installationkey=${this.options.installationkey}`),console.log(`Generated Command ${t}`),t})}}exports.default=InstallUnlockedPackageImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function c(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){e.done?o(e.value):function(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(c,a)}s((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");class PromoteUnlockedPackageImpl{constructor(e,t){this.package_version_id=e,this.devhub_alias=t}exec(){return __awaiter(this,void 0,void 0,function*(){let e=yield this.buildExecCommand();console.log(`Triggering Command: ${e}`);let t=child_process.exec(e,(e,t,i)=>{if(e)throw e});t.stdout.on("data",e=>{console.log(e.toString())}),yield OnExit_1.onExit(t)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let e=`npx sfdx force:package:version:promote -v ${this.devhub_alias}`;return e+=` -p ${this.package_version_id}`,e+=" -n"})}}exports.default=PromoteUnlockedPackageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,o){return new(i||(i=Promise))(function(n,r){function c(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(c,a)}s((o=o.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");class PromoteUnlockedPackageImpl{constructor(e,t){this.package_version_id=e,this.devhub_alias=t}exec(){return __awaiter(this,void 0,void 0,function*(){let e=yield this.buildExecCommand();console.log(`Triggering Command: ${e}`);let t=child_process.exec(e,(e,t,i)=>{if(e)throw e});t.stdout.on("data",e=>{console.log(e.toString())}),yield OnExit_1.onExit(t)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let e=`npx sfdx force:package:version:promote -v ${this.devhub_alias}`;return e+=` -p ${this.package_version_id}`,e+=" -n"})}}exports.default=PromoteUnlockedPackageImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,s,o){return new(s||(s=Promise))(function(i,r){function n(t){try{u(o.next(t))}catch(t){r(t)}}function a(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof s?t:new s(function(e){e(t)})}(t.value).then(n,a)}u((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");let fs=require("fs-extra"),path=require("path");class TriggerApexTestImpl{constructor(t,e){this.target_org=t,this.test_options=e}exec(){return __awaiter(this,void 0,void 0,function*(){let t={id:"",result:!1,message:""},e="",s="";try{let t=child_process.exec(this.buildExecCommand(),{maxBuffer:5242880,encoding:"utf8"},(t,e,s)=>{});t.stdout.on("data",t=>{e+=t.toString()}),t.stderr.on("data",t=>{s+=t.toString()}),yield OnExit_1.onExit(t)}catch(t){}console.log(e);try{let o=fs.readFileSync(path.join(this.test_options.outputdir,"test-run-id.txt")).toString();console.log("test_id",o);let i=fs.readFileSync(path.join(this.test_options.outputdir,`test-result-${o}.json`)).toString(),r=JSON.parse(i);return t.id=o,(r.summary.outcome="Failed")?(t.message=`${r.summary.failing} Tests failed with overall Test Run Coverage of ${r.summary.testRunCoverage}`,t.message+="\nFailed Test Cases:",r.tests.forEach(e=>{"Fail"==e.Outcome&&(t.message+="\n"+`${e.MethodName} ${e.Message} ${e.StackTrace}`)}),t.result=!1,console.error(e)):(t.message=`${r.summary.passing} Tests passed with overall Test Run Coverage of ${r.summary.testRunCoverage}`,t.result=!0,console.log(e)),t}catch(e){return t.result=!1,t.message=s,t}})}buildExecCommand(){let t=`npx sfdx force:apex:test:run -u ${this.target_org}`;return 1==this.test_options.synchronous&&(t+=" -y"),t+=" -c",t+=" -r human",t+=` -w ${this.test_options.wait_time}`,t+=` -d ${this.test_options.outputdir}`,"RunApexTestSuite"!==this.test_options.testlevel&&(t+=` -l ${this.test_options.testlevel}`),"RunSpecifiedTests"==this.test_options.testlevel?t+=` -t ${this.test_options.specified_tests}`:"RunApexTestSuite"==this.test_options.testlevel&&(t+=` -s ${this.test_options.apextestsuite}`),console.log(`Generated Command: ${t}`),t}}exports.default=TriggerApexTestImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,s,o){return new(s||(s=Promise))(function(i,r){function n(t){try{u(o.next(t))}catch(t){r(t)}}function a(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){t.done?i(t.value):new s(function(e){e(t.value)}).then(n,a)}u((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit");let fs=require("fs-extra"),path=require("path");class TriggerApexTestImpl{constructor(t,e){this.target_org=t,this.test_options=e}exec(){return __awaiter(this,void 0,void 0,function*(){let t={id:"",result:!1,message:""},e="",s="";try{let t=child_process.exec(this.buildExecCommand(),{maxBuffer:5242880,encoding:"utf8"},(t,e,s)=>{});t.stdout.on("data",t=>{e+=t.toString()}),t.stderr.on("data",t=>{s+=t.toString()}),yield OnExit_1.onExit(t)}catch(t){}console.log(e);try{let o=fs.readFileSync(path.join(this.test_options.outputdir,"test-run-id.txt")).toString();console.log("test_id",o);let i=fs.readFileSync(path.join(this.test_options.outputdir,`test-result-${o}.json`)).toString(),r=JSON.parse(i);return t.id=o,(r.summary.outcome="Failed")?(t.message=`${r.summary.failing} Tests failed with overall Test Run Coverage of ${r.summary.testRunCoverage}`,t.message+="\nFailed Test Cases:",r.tests.forEach(e=>{"Fail"==e.Outcome&&(t.message+="\n"+`${e.MethodName} ${e.Message} ${e.StackTrace}`)}),t.result=!1,console.error(e)):(t.message=`${r.summary.passing} Tests passed with overall Test Run Coverage of ${r.summary.testRunCoverage}`,t.result=!0,console.log(e)),t}catch(e){return t.result=!1,t.message=s,t}})}buildExecCommand(){let t=`npx sfdx force:apex:test:run -u ${this.target_org}`;return 1==this.test_options.synchronous&&(t+=" -y"),t+=" -c",t+=" -r human",t+=` -w ${this.test_options.wait_time}`,t+=` -d ${this.test_options.outputdir}`,"RunApexTestSuite"!==this.test_options.testlevel&&(t+=` -l ${this.test_options.testlevel}`),"RunSpecifiedTests"==this.test_options.testlevel?t+=` -t ${this.test_options.specified_tests}`:"RunApexTestSuite"==this.test_options.testlevel&&(t+=` -s ${this.test_options.apextestsuite}`),console.log(`Generated Command: ${t}`),t}}exports.default=TriggerApexTestImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,o){return new(t||(t=Promise))(function(i,n){function c(e){try{s(o.next(e))}catch(e){n(e)}}function a(e){try{s(o.throw(e))}catch(e){n(e)}}function s(e){e.done?i(e.value):function(e){return e instanceof t?e:new t(function(r){r(e)})}(e.value).then(c,a)}s((o=o.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process");class ValidateApexCoverageImpl{constructor(e,r){this.target_org=e,this.required_coverage=r}exec(e){return __awaiter(this,void 0,void 0,function*(){let r=child_process.execSync(e,{encoding:"utf8"}),t=JSON.parse(r);if(Number(t.result.coverage)<this.required_coverage)throw new Error(`Org Coverage is currently at ${t.result.coverage}, which is less than the required coverage ${this.required_coverage} `);console.log(`Org Coverage is currently at ${t.result.coverage}`)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx sfpowerkit:org:orgcoverage -u ${this.target_org} --json`})}}exports.default=ValidateApexCoverageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,o){return new(t||(t=Promise))(function(i,c){function a(e){try{s(o.next(e))}catch(e){c(e)}}function n(e){try{s(o.throw(e))}catch(e){c(e)}}function s(e){e.done?i(e.value):new t(function(r){r(e.value)}).then(a,n)}s((o=o.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process");class ValidateApexCoverageImpl{constructor(e,r){this.target_org=e,this.required_coverage=r}exec(e){return __awaiter(this,void 0,void 0,function*(){let r=child_process.execSync(e,{encoding:"utf8"}),t=JSON.parse(r);if(Number(t.result.coverage)<this.required_coverage)throw new Error(`Org Coverage is currently at ${t.result.coverage}, which is less than the required coverage ${this.required_coverage} `);console.log(`Org Coverage is currently at ${t.result.coverage}`)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx sfpowerkit:org:orgcoverage -u ${this.target_org} --json`})}}exports.default=ValidateApexCoverageImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(a,o){function r(t){try{s(n.next(t))}catch(t){o(t)}}function c(t){try{s(n.throw(t))}catch(t){o(t)}}function s(t){t.done?a(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(r,c)}s((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),util_1=require("util");class ValidateDXUnlockedPackageImpl{constructor(t,e,i){this.validate_package=t,this.bypass=e,this.project_directory=i}exec(t){return __awaiter(this,void 0,void 0,function*(){let e=child_process.exec(t,{encoding:"utf8",cwd:this.project_directory},(t,e,i)=>{if(t)throw t});e.stdout.on("data",t=>{console.log(t.toString())}),e.stderr.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let t;return t="npx sfdx sfpowerkit:package:valid",util_1.isNullOrUndefined(this.validate_package)||(t+=` -n ${this.validate_package}`),util_1.isNullOrUndefined(this.bypass)||(t+=` -b ${this.bypass}`),t})}}exports.default=ValidateDXUnlockedPackageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(a,o){function r(t){try{s(n.next(t))}catch(t){o(t)}}function c(t){try{s(n.throw(t))}catch(t){o(t)}}function s(t){t.done?a(t.value):new i(function(e){e(t.value)}).then(r,c)}s((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process"),OnExit_1=require("../OnExit"),util_1=require("util");class ValidateDXUnlockedPackageImpl{constructor(t,e,i){this.validate_package=t,this.bypass=e,this.project_directory=i}exec(t){return __awaiter(this,void 0,void 0,function*(){let e=child_process.exec(t,{encoding:"utf8",cwd:this.project_directory},(t,e,i)=>{if(t)throw t});e.stdout.on("data",t=>{console.log(t.toString())}),e.stderr.on("data",t=>{console.log(t.toString())}),yield OnExit_1.onExit(e)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){let t;return t="npx sfdx sfpowerkit:package:valid",util_1.isNullOrUndefined(this.validate_package)||(t+=` -n ${this.validate_package}`),util_1.isNullOrUndefined(this.bypass)||(t+=` -b ${this.bypass}`),t})}}exports.default=ValidateDXUnlockedPackageImpl; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,o){return new(t||(t=Promise))(function(i,a){function c(e){try{s(o.next(e))}catch(e){a(e)}}function n(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):function(e){return e instanceof t?e:new t(function(r){r(e)})}(e.value).then(c,n)}s((o=o.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process");class ValidateTestCoveragePackageImpl{constructor(e,r,t){this.target_org=e,this.required_coverage=r,this.package_version_id=t}exec(e){return __awaiter(this,void 0,void 0,function*(){let r=child_process.execSync(e,{encoding:"utf8"}),t=JSON.parse(r);if(console.log(t),Number(t.result.coverage)<this.required_coverage)throw new Error(`Package Code Coverage is currently at ${t.result.coverage}, which is less than the required coverage ${this.required_coverage} `);console.log(`Package Code Coverage is currently at ${t.result.coverage}`)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx sfpowerkit:package:version:codecoverage -u ${this.target_org} -i ${this.package_version_id} --json`})}}exports.default=ValidateTestCoveragePackageImpl; | ||
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,o){return new(t||(t=Promise))(function(a,i){function c(e){try{n(o.next(e))}catch(e){i(e)}}function s(e){try{n(o.throw(e))}catch(e){i(e)}}function n(e){e.done?a(e.value):new t(function(r){r(e.value)}).then(c,s)}n((o=o.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});const child_process=require("child_process");class ValidateTestCoveragePackageImpl{constructor(e,r,t){this.target_org=e,this.required_coverage=r,this.package_version_id=t}exec(e){return __awaiter(this,void 0,void 0,function*(){let r=child_process.execSync(e,{encoding:"utf8"}),t=JSON.parse(r);if(console.log(t),Number(t.result.coverage)<this.required_coverage)throw new Error(`Package Code Coverage is currently at ${t.result.coverage}, which is less than the required coverage ${this.required_coverage} `);console.log(`Package Code Coverage is currently at ${t.result.coverage}`)})}buildExecCommand(){return __awaiter(this,void 0,void 0,function*(){return`npx sfdx sfpowerkit:package:version:codecoverage -u ${this.target_org} -i ${this.package_version_id} --json`})}}exports.default=ValidateTestCoveragePackageImpl; |
@@ -13,6 +13,6 @@ { | ||
"homepage": "https://github.com/azlamsalam/sfpowerscripts#readme", | ||
"version": "0.0.14", | ||
"version": "0.0.21-beta.0", | ||
"scripts": { | ||
"build": "npm install && node buildpackage.js", | ||
"package": "npm run build && cd dist && npm publish" | ||
"prepare": "node buildpackage.js", | ||
"postpublish": "echo published" | ||
}, | ||
@@ -30,3 +30,3 @@ "dependencies": { | ||
"author": "dxatscale", | ||
"gitHead": "bdfe952444293427ca23e4c720551c7c45f01228" | ||
"gitHead": "fbe966a387b68419d67cc0ee775d8930c4dbbe9b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
73193