From 7289a95f9aa89dce81bf0179d7194deff01c65be Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Tue, 16 May 2023 12:38:39 +0200 Subject: [PATCH 1/2] Fix --template support for generate Webresources --- src/commands/generators/Webresource.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/generators/Webresource.ts b/src/commands/generators/Webresource.ts index 014a37a..cb51f2d 100644 --- a/src/commands/generators/Webresource.ts +++ b/src/commands/generators/Webresource.ts @@ -22,9 +22,9 @@ export class Webresource { } else if(!new RegExp('[A-Z]').test(webresourcename[0])) { console.log(colors.red(`Webresource name must be UpperCamelCase!`)); } else if (check.stdout !== '\n') { - console.log(colors.red(`echo Webresource ${webresourcename} already exist!`)); - } else if (process.argv[5]) { - console.log(colors.red(`echo No spaces allowed!`)); + console.log(colors.red(`Webresource ${webresourcename} already exist!`)); + } else if (process.argv[7]) { + console.log(colors.red(`No spaces allowed!`)); } else if (options.template && !['React', 'HTML'].includes(options.template)) { console.log(colors.red(`echo Webresource template must be 'React' or 'HTML'`)); } else { From cabbfcac75a3349963493c30704cfc443e61b3d1 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Tue, 16 May 2023 12:41:57 +0200 Subject: [PATCH 2/2] Version 7.0.5 --- bin/main.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/main.js b/bin/main.js index 167de00..5f57971 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 7.0.4 | (c) HSO Innovation */!function(){"use strict";var e={5431:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]","ig"),e.publisher_prefix,t),l.sed("-i",new RegExp("<%= environment %>","ig"),e.environment,t),l.sed("-i",new RegExp("<%= namespace %>","ig"),e.namespace,t);var n=l.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.sed("-i",new RegExp("<%= version %>","ig"),n,t)},e.initWebresourcesCrmJson=function(e){var t=l.ls("Webresources/crm.json")[0];l.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),e.solution_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_generate||e.solution_deploy,t)},e.initWebresourcesPackageJson=function(e,t){var n=l.ls("Webresources/package.json")[0];l.sed("-i","<%= projectname %>",e.toLowerCase(),n),l.sed("-i",new RegExp("<%= description %>","ig"),t.solution_deploy,n)},e.initWebresourcesWebpackConfig=function(e){var t=l.ls("Webresources/webpack.config.ts")[0];l.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),e.publisher_prefix,t),l.sed("-i",new RegExp("<%= namespace %>","ig"),e.namespace,t),l.sed("-i",new RegExp("<%= description %>","ig"),e.namespace,t)},e.inquirer=function(){var e=this;return f.prompt([{type:"input",name:"environment",message:"D365 environment url (eg. https://yourproject.crm4.dynamics.com):",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(!t)throw new Error("You need to provide an environment");if(!new RegExp("https://(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}").test(t))throw new Error("You need to provide a valid url");return[2,!0]}))}))}},{type:"input",name:"solution_deploy",message:"D365 deployment Solution ('Name' column):",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(!t)throw new Error("You need to provide a solution");if(!new RegExp("[a-zA-Z_\\d]*").test(t))throw new Error("You need to provide a valid solution name");return[2,!0]}))}))}},{type:"input",name:"solution_generate",message:"D365 generate Solution ('Name' column)\nIf equal to deployment Solution keep blank:",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(t&&!new RegExp("[a-zA-Z_\\d]*").test(t))throw new Error("You need to provide a valid solution name");return[2,!0]}))}))}},{type:"input",name:"solution_pcf",message:"D365 PCF Solution ('Name' column)\nIf equal to deployment Solution keep blank:",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(t&&!new RegExp("[a-zA-Z_\\d]*").test(t))throw new Error("You need to provide a valid solution name");return[2,!0]}))}))}},{type:"input",name:"publisher_name",message:"D365 Publisher Name (not Display Name):",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(!t)throw new Error("You need to provide a publisher name");if(!new RegExp("[a-zA-Z_0-9]*").test(t))throw new Error("You need to provide a valid publisher");return[2,!0]}))}))}},{type:"input",name:"publisher_prefix",message:"D365 Publisher Prefix (3 chars a-z):",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(!t)throw new Error("You need to provide a publisher");if(!new RegExp("[a-zA-Z_\\d]*").test(t))throw new Error("You need to provide a valid publisher");return[2,!0]}))}))}},{type:"input",name:"namespace",message:"Customer or Product name:",validate:function(t){return a(e,void 0,void 0,(function(){return c(this,(function(e){if(!t)throw new Error("You need to provide a customer or product name");if(!new RegExp("[a-zA-Z_\\d]*").test(t))throw new Error("You need to provide a valid namespace");return[2,!0]}))}))}}])},e}();t.Create=h},6342:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return a(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]"),[2,i=i.substr(a+2)]):[2]}}))}))},Object.defineProperty(t,"defaultDependencyxml",{get:function(){return''},enumerable:!1,configurable:!0}),Object.defineProperty(t,"translationRegex",{get:function(){return/\.translate\(["'](.*)["']\)/gm},enumerable:!1,configurable:!0}),t.prototype.generateWebresourceXmlDoc=function(e,n){return s(this,void 0,void 0,(function(){var r,o,i;return u(this,(function(a){switch(a.label){case 0:return r=b.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,y.parseStringPromise(e.dependencyxml||t.defaultDependencyxml)];case 1:return i=a.sent(),t.translationRegex.test(String(n))?(this.addLibraries(i,o),this.cleanLibraries(i,o)):this.cleanLibraries(i),[2,i]}}))}))},t.prototype.addLibraries=function(e,n){var r=e.Dependencies.Dependency[0];r.Library||(r.Library=[]);for(var o=function(e){r.Library.find((function(t){return t.$.name===e}))||(console.log("Adding dependency: ".concat(e)),r.Library.push({$:t.createLibraryItem(e)}))},i=0,a=n;i=0;o-=1){var i=r.Library[o].$.name;t.localesResxRegex.test(i)&&(n.includes(i)||(console.log("Removing dependency: ".concat(i)),r.Library.splice(o,1)))}},t.createLibraryItem=function(e){return{name:e,displayName:e,languagecode:t.getLanguageCode(e),description:"",libraryUniqueId:t.guid()}},t.getLanguageCode=function(e){var n;return e.endsWith(".resx")&&(n=t.localesResxRegex.exec(e)),n&&n[1]||""},t.guid=function(){return"{xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx}".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},t.xmlBuilder=new y.Builder,t}(p.MsalRouter);t.Deploy=g},883:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PCF=void 0;var c=a(n(7027)),s=a(n(4357)),u=i(n(7147)),l=a(n(2081)),f=function(){function e(){}return e.createComponent=function(t){c.default.test("-e","../pcf")?t?c.default.test("-e",t)?console.log(s.default.red("Control already exists")):c.default.which("pac")?e.create(t):console.log(s.default.red("You need to install pac first: https://aka.ms/PowerAppsCLI")):console.log(s.default.red("No control name specified!")):console.log(s.default.red("You are not inside the project 'pcf' folder!"))},e.create=function(t){c.default.exec("mkdir ".concat(t)),c.default.cd(t),e.pacInit(t),e.addComponentFiles(t),e.addReference(t)},e.pacInit=function(e){c.default.exec("pac install latest");var t=JSON.parse(u.readFileSync("../../crm.json","utf8")).crm.publisher_prefix;t&&c.default.exec("pac pcf init --namespace ".concat(t," --name ").concat(e," --template field"))},e.addComponentFiles=function(e){c.default.cp("-f","".concat(__dirname,"/PCF/*"),"."),c.default.cp("-f","".concat(__dirname,"/PCF/.*"),".");var t="./".concat(e,"/").concat(e,".tsx");c.default.cp("-r","".concat(__dirname,"/PCF/Component/PCFComponent.tsx"),t),c.default.sed("-i",new RegExp("PCFComponent","g"),e,t),c.default.cp("-f","".concat(__dirname,"/PCF/Component/index.ts"),"./".concat(e)),c.default.sed("-i",new RegExp("PCFComponent","g"),e,"./".concat(e,"/index.ts")),c.default.cp("-f","".concat(__dirname,"/PCF/Component/FieldComponent.ts"),"./".concat(e)),c.default.exec("npm install --save-dev @fluentui/react eslint-plugin-react eslint-plugin-react-hooks rxjs"),c.default.test("-e","../../.git")&&l.default.execFileSync("git",["add","../".concat(e)])},e.addReference=function(e){var t=process.cwd();c.default.cd(".."),c.default.cd("Solutions"),l.default.execFileSync("pac",["solution","add-reference","--path",t]);var n="msbuild /t:build /restore";c.default.exec(n),n+=" /p:configuration=Release",c.default.exec(n),c.default.cd(".."),c.default.cd(e)},e.build=function(){if(c.default.test("-f","Solutions.cdsproj")){var e="msbuild /t:build";c.default.exec(e),e+=" /p:configuration=Release",c.default.exec(e)}else console.log(s.default.red("You are not inside the PCF/Solutions folder containing the Solutions.cdsproj file!"))},e.initPcfSolution=function(e,t,n){if(!c.default.test("-e","Solutions")){c.default.exec("mkdir Solutions"),c.default.cd("Solutions");var r="pac solution init --publisher-name ".concat(t," --publisher-prefix ").concat(n);c.default.exec(r);var o=e;c.default.sed("-i",new RegExp("Solutions","ig"),"".concat(o,""),"src/Other/Solution.xml")}},e.deploy=function(){if(c.default.test("-f","Solutions.cdsproj"))console.log(s.default.red("Deployment should be done on component level!"));else{var e=JSON.parse(u.readFileSync("../crm.json","utf8"));c.default.exec("pac pcf push --publisher-prefix ".concat(e.crm.publisher_prefix)),console.log(s.default.red("When getting an error about 'No profiles found' you need to set this up by following command: ")),console.log(s.default.red("pac auth create --url ".concat(e.crm.url)));console.log("See further information here: ".concat("https://docs.microsoft.com/en-us/powerapps/developer/component-framework/import-custom-controls#connecting-to-your-environment"))}},e}();t.PCF=f},4982:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&e.addLocalesFile(),[4,e.processCodeKeys(t)];case 1:return n.sent(),[2,null]}}))}))},e.getCodeKeys=function(){for(var t=new Set,n=0,r=s.ls("src/**/*.ts*");n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]","ig"),e.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),e.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),e.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),t,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"])},e.updatePackageJson=function(){console.log("Updating package.json...");var e=JSON.parse(f.default.readFileSync("./package.json","utf8")),t=e.name,n=e.description,r=e.version,o=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/package.json"),".");var i=l.default.ls("package.json")[0];l.default.sed("-i",new RegExp("<%= projectname %>","ig"),t,i),l.default.sed("-i",new RegExp("<%= description %>","ig"),n,i),l.default.sed("-i",new RegExp("<%= publisher %>","ig"),o.crm.publisher_prefix,i),l.default.sed("-i",new RegExp("<%= version %>","ig"),r,i),console.log("Removing old npm packages. This may take a while..."),l.default.exec("npm prune"),l.default.exec("npm install")},e.updateWebpackConfig=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){return console.log("Updating webpack.config..."),l.default.cp("-R","".concat(__dirname,"/root/Webresources/webpack.config.ts"),"."),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","webpack.config.ts"]),[2]}))}))},e}();t.Update=p},3152:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]"]:["Picklist","Status","State"].includes(t)?(r="".concat(this.entityName,"_").concat(n,"Values"),[2,"Xrm.Attributes.OptionSetAttribute<".concat(r,">")]):["Integer","Double","BigInt","Decimal","Double","Money"].includes(t)?[2,"Xrm.Attributes.NumberAttribute"]:["Lookup","Customer","Owner"].includes(t)?[2,"Xrm.Attributes.LookupAttribute"]:(console.log(p.default.blue("".concat(this.entityLogicalName," attribute ").concat(t," falls back to Xrm.Attributes.Attribute."))),[2,"Xrm.Attributes.Attribute"])}))}))},e.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e}();t.AttributeFormContext=h},7911:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]"]:["Picklist","Status","State"].includes(t)?(r="".concat(this.entityName,"_").concat(n,"Values"),[2,"Xrm.Attributes.OptionSetAttribute<".concat(r,">")]):["Integer","Double","BigInt","Decimal","Double","Money"].includes(t)?[2,"Xrm.Attributes.NumberAttribute"]:["Lookup","Customer","Owner"].includes(t)?[2,"Xrm.Attributes.LookupAttribute"]:(console.log(f.default.blue("".concat(this.entityLogicalName," attribute ").concat(t," falls back to Xrm.Attributes.Attribute."))),[2,"Xrm.Attributes.Attribute"])}))}))},e}();t.AttributeTypings=h},1634:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] => {\n"),t+=" return WebApi.executeAction('".concat(i.uniquename,"', request);\n"),t+="};\n\n",c.label=5;case 5:return r++,[3,2];case 6:return t&&(t+="\n"),[2,t]}}))}))},e.prototype.getCustomApis=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,u;return c(this,(function(c){switch(c.label){case 0:return e=JSON.parse(l.default.readFileSync("./crm.json","utf8")),t=e.crm.solution_name_generate,[4,f.SolutionService.getSolution(t,["solutionid"],this.bearer)];case 1:return n=c.sent(),[4,y.SolutionComponentSummaryService.retrieveMultipleRecords({select:["msdyn_objectid"],filters:[{conditions:[{attribute:"msdyn_solutionid",value:n.solutionid}]},{type:"or",conditions:[{attribute:"msdyn_componenttype",value:10051}]}]},this.bearer)];case 2:for(r=c.sent(),o=[],i=0,a=r;i0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] {"),p="const environmentVariableValue = await EnvironmentVariableService.getEnvironmentVariableValue('".concat(s.schemaname,"');"),h=e.getReturnString(s),t+="".concat(d,"\n ").concat(p,"\n ").concat(h,"\n }\n\n");return[2,t]}}))}))},e.getReturnString=function(e){if(1e8===e.type)return"return environmentVariableValue ? environmentVariableValue.value : '".concat(e.defaultvalue,"';");if(100000001===e.type)return"return environmentVariableValue ? parseFloat(environmentVariableValue.value) : ".concat(e.defaultvalue,";");if(100000002===e.type)return"return environmentVariableValue ? environmentVariableValue.value === 'yes' : ".concat("yes"===e.defaultvalue,";");if(100000003===e.type){var t="// eslint-disable-next-line quotes\n ";return t+="return environmentVariableValue ? JSON.parse(environmentVariableValue.value) : ".concat(e.defaultvalue,";")}if(100000004===e.type){t="// Not supported or go ahead with the value\n ";return t+="return environmentVariable ? environmentVariableValue.value as unknown : null"}},e.getEnvironmentType=function(e){return 1e8===e.type?"string":100000001===e.type?"number":100000002===e.type?"boolean":100000003===e.type?"JSON":100000004===e.type?"unknown":void 0},e.prototype.getEnvironmentVariableDefinitions=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,l,h;return c(this,(function(c){switch(c.label){case 0:return e=[],t=JSON.parse(u.readFileSync("./crm.json","utf8")),n=t.crm.solution_name_generate,[4,f.SolutionService.getSolution(n,["solutionid"],this.bearer)];case 1:return r=c.sent(),[4,p.SolutionComponentSummaryService.retrieveMultipleRecords({select:["msdyn_objectid"],filters:[{conditions:[{attribute:"msdyn_solutionid",value:r.solutionid}]},{type:"or",conditions:[{attribute:"msdyn_componenttype",value:380}]}]},this.bearer)];case 2:o=c.sent(),i=0,a=o,c.label=3;case 3:return i0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]","ig"),a,n),u.sed("-i",new RegExp("<%= namespace %>","ig"),i,n),u.sed("-i",new RegExp("<%= formname %>","ig"),e.name,n),u.sed("-i",new RegExp("<%= entity %>","ig"),this.entityName,n),u.test("-e","../.git")&&f.default.execFileSync("git",["add",n]),console.log("Added ".concat(this.entityName,"/").concat(t,"/").concat(t,".ts")),[2]}))}))},e.prototype.addEntityFormFile=function(e){return a(this,void 0,void 0,(function(){var t,n;return c(this,(function(r){return t=e.name.replace(/\W/g,""),console.log("Adding ".concat(this.entityName,"/").concat(t,"/").concat(t,".form.ts")),n="src/".concat(this.entityName,"/").concat(t,"/").concat(t,".form.ts"),u.cp("-r","".concat(__dirname,"/Entity/form/Entity.form.ts"),n),u.sed("-i",new RegExp("Entity","g"),t,n),u.test("-e","../.git")&&f.default.execFileSync("git",["add",n]),console.log("Added ".concat(this.entityName,"/").concat(t,"/").concat(t,".form.ts")),[2]}))}))},e.prototype.updateBuildFile=function(e){return a(this,void 0,void 0,(function(){var t,n,r,o;return c(this,(function(i){return t=e.name.replace(/\W/g,""),console.log("Updating ".concat(this.entityName,"/build.json")),n="src/".concat(this.entityName,"/build.json"),r=String(l.default.readFileSync(n)),(o=JSON.parse(r)).forms.find((function(e){return e.name===t}))||(o.forms.push({name:t,build:!0}),u.ShellString(JSON.stringify(o,null,2)).to(n),u.test("-e","../.git")&&f.default.execFileSync("git",["add",n])),console.log("Updated ".concat(this.entityName,"/build.json")),[2]}))}))},e.prototype.getSystemForms=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,u,f,d,h;return c(this,(function(c){switch(c.label){case 0:return e=JSON.parse(l.default.readFileSync("./crm.json","utf8")),t=e.crm,n=t.solution_name_generate,r=t.only_solution_forms,o=[{type:"or",conditions:[{attribute:"msdyn_componenttype",value:24},{attribute:"msdyn_componenttype",value:60}]},{conditions:[{attribute:"msdyn_primaryentityname",value:this.entityLogicalName}]}],r?[4,y.SolutionService.getSolution(n,["solutionid"],this.bearer)]:[3,2];case 1:i=c.sent(),o.push({conditions:[{attribute:"msdyn_solutionid",value:i.solutionid}]}),c.label=2;case 2:return[4,b.SolutionComponentSummaryService.retrieveMultipleRecords({select:["msdyn_objectid"],filters:o},this.bearer)];case 3:for(a=c.sent(),s=[],u=0,f=a;u0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] & ").concat(this.entityName).concat(r,"Controls;\n\n"),n+=" interface ".concat(this.entityName).concat(r,"Controls {\n"),o=n,[4,this.getFormTypingsControlsString(e)];case 2:return n=o+c.sent(),n+=" }\n}",i="src/".concat(this.entityName,"/").concat(this.entityName,".d.ts"),a=String(l.readFileSync(i)),u.ShellString("".concat(a,"\n").concat(n)).to(i),console.log("Updated ".concat(this.entityName,".d.ts")),[2]}}))}))},e.prototype.getFormTypingsControlsString=function(t){return a(this,void 0,void 0,(function(){var n,r,o,i,a;return c(this,(function(c){switch(c.label){case 0:return n="",e.usedControlNames=[],r=JSON.parse(t.formjson),o=n,[4,this.getTabsString(r.Tabs.$values)];case 1:return n=o+c.sent(),i=n,[4,this.getControlsString(r.Header.Controls.$values)];case 2:return n=i+c.sent(),a=n,[4,this.getControlsString(r.Footer.Controls.$values)];case 3:return[2,n=a+c.sent()]}}))}))},e.prototype.getTabsString=function(e){return a(this,void 0,void 0,(function(){var t,n,r,o,i;return c(this,(function(a){switch(a.label){case 0:t="",n=0,r=e,a.label=1;case 1:return n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]","ig"),e,"src/License/Validator/".concat(i)),l.sed("-i",new RegExp("<%= publisher %>","ig"),o,"src/License/Validator/".concat(i)),l.sed("-i",new RegExp("<%= namespace %>","ig"),r,"src/License/Validator/".concat(i))})),l.test("-e","../.git")&&p.default.execFileSync("git",["add","src/License"]),console.log("Adding D365 License Validator done"),[2]}))}))},e}();t.LicenseValidator=h},9160:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]","ig"),i,"src/".concat(e,"/").concat(a)),l.sed("-i",new RegExp("<%= namespace %>","ig"),o,"src/".concat(e,"/").concat(a));var c="src/".concat(e,"/").concat(a);l.test("-e","../.git")&&p.default.execFileSync("git",["add",c])})),[2]}))}))},e.addBuildFile=function(e,t){return a(this,void 0,void 0,(function(){var n,r,o;return c(this,(function(i){return console.log("Adding ".concat(e,"/build.json")),n="src/".concat(e,"/build.json"),l.cp("-r","".concat(__dirname,"/Entity/build.json"),n),r=String(d.readFileSync(n)),(o=JSON.parse(r)).webresources.find((function(t){return t.name===e}))||(o.webresources.push({name:e,build:!0,template:t}),l.ShellString(JSON.stringify(o,null,2)).to(n)),l.test("-e","../.git")&&p.default.execFileSync("git",["add",n]),console.log("Added ".concat(e,"/build.json")),[2]}))}))},e}();t.Webresource=h},6175:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] [options]"),c.default.command("new ").alias("n").option("--environment","Environment").option("--solution_deploy","Deploy Solution").option("--solution_generate","Generate Solution").option("--solution_pcf","PCF Solution").option("--publisher_name","Publisher name").option("--publisher_prefix","Publisher prefix").option("--namespace","Namespace").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e,t){a.default.test("-e","../pcf")?b.PCF.createComponent(e):s.Create.createProject(e,t)})).on("--help",(function(){s.Create.showCreateHelp()})),c.default.command("regenerate").alias("rg").description("Regenerates files").action((function(){return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return v()?[4,y.RegeneratorRouter.regenerate()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})).on("--help",(function(){console.log("Regenerates files")})),c.default.command("generate [name]").alias("g").option("-s, --skipForms","Skip generating form files").option("-logicalName, --entityLogicalName ","LogicalName of the Entity").option("-t, --template