From cf6a649315774ad7a48b6de5bddc419b90d5196d Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Thu, 9 Feb 2023 13:14:01 +0100 Subject: [PATCH 1/5] Base Entity.form.ts per Entity --- bin/Entity/Entity.attributesContext.ts | 6 ---- bin/Entity/Entity.form.ts | 2 +- bin/Entity/Entity.formContext.ts | 7 ++-- bin/Entity/form/Entity.form.ts | 7 ++++ bin/Entity/form/Entity.formContext.ts | 5 +++ bin/Entity/{ => form}/Entity.ts | 2 +- bin/main.js | 2 +- src/commands/Update.ts | 33 +++++++++++++++---- .../generators/AttributeFormContext.ts | 6 ++-- src/commands/generators/ControlFormContext.ts | 4 +-- src/commands/generators/Entity.ts | 14 ++++++++ src/commands/generators/Form.ts | 4 +-- src/commands/generators/FormTypings.ts | 2 +- src/commands/generators/Model.ts | 2 +- 14 files changed, 68 insertions(+), 28 deletions(-) delete mode 100644 bin/Entity/Entity.attributesContext.ts create mode 100644 bin/Entity/form/Entity.form.ts create mode 100644 bin/Entity/form/Entity.formContext.ts rename bin/Entity/{ => form}/Entity.ts (87%) diff --git a/bin/Entity/Entity.attributesContext.ts b/bin/Entity/Entity.attributesContext.ts deleted file mode 100644 index 581832b..0000000 --- a/bin/Entity/Entity.attributesContext.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* This is a generated file, please regenerate and do not modify */ -/* eslint-disable max-len */ -import {EntityAttributeNames} from './Entity.enum'; - -export class EntityFormContext {} -/* eslint-enable max-len */ diff --git a/bin/Entity/Entity.form.ts b/bin/Entity/Entity.form.ts index 3f8dc83..6073a01 100644 --- a/bin/Entity/Entity.form.ts +++ b/bin/Entity/Entity.form.ts @@ -1,4 +1,4 @@ -import {Translation} from '../../translation/Translation'; +import {Translation} from '../translation/Translation'; import {EntityFormContext} from './Entity.formContext'; export class EntityForm extends EntityFormContext { diff --git a/bin/Entity/Entity.formContext.ts b/bin/Entity/Entity.formContext.ts index 0194915..581832b 100644 --- a/bin/Entity/Entity.formContext.ts +++ b/bin/Entity/Entity.formContext.ts @@ -1,5 +1,6 @@ /* This is a generated file, please regenerate and do not modify */ +/* eslint-disable max-len */ +import {EntityAttributeNames} from './Entity.enum'; -import {EntityFormContext as AttributeFormContext} from '../Entity.formContext'; - -export class FormNameFormContext extends AttributeFormContext {} +export class EntityFormContext {} +/* eslint-enable max-len */ diff --git a/bin/Entity/form/Entity.form.ts b/bin/Entity/form/Entity.form.ts new file mode 100644 index 0000000..a4217a0 --- /dev/null +++ b/bin/Entity/form/Entity.form.ts @@ -0,0 +1,7 @@ +import {EntityFormContext} from './Entity.formContext'; + +export class EntityForm extends EntityFormContext { + static async onLoad(executionContext: Xrm.Events.EventContext): Promise { + await super.onLoad(executionContext); + } +} diff --git a/bin/Entity/form/Entity.formContext.ts b/bin/Entity/form/Entity.formContext.ts new file mode 100644 index 0000000..f4821eb --- /dev/null +++ b/bin/Entity/form/Entity.formContext.ts @@ -0,0 +1,5 @@ +/* This is a generated file, please regenerate and do not modify */ + +import {EntityForm} from '../Entity.form'; + +export class FormNameFormContext extends EntityForm {} diff --git a/bin/Entity/Entity.ts b/bin/Entity/form/Entity.ts similarity index 87% rename from bin/Entity/Entity.ts rename to bin/Entity/form/Entity.ts index f79d484..4983cd3 100644 --- a/bin/Entity/Entity.ts +++ b/bin/Entity/form/Entity.ts @@ -1,7 +1,7 @@ import {EntityForm} from './Entity.form'; export const Form = { - // In D365 Form '<%= formname %>' specify Form onLoad function: <%= publisher %>.<%= namespace %>.<%= entity %>.<%= formname %>.Form.onLoad + //In D365 Form '<%= formname %>' specify Form onLoad function: <%= publisher %>.<%= namespace %>.<%= entity %>.<%= formname %>.Form.onLoad onLoad: async (executionContext: Xrm.Events.EventContext): Promise => { return EntityForm.onLoad(executionContext); } diff --git a/bin/main.js b/bin/main.js index 953d113..bed9553 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 6.0.4 | (c) HSO Innovation */!function(){"use strict";var e={431: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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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},342: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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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(27)),s=a(n(357)),u=i(n(147)),l=a(n(81)),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},982: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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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},152: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},911: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},807: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]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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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/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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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 n"))),[2,"Xrm.Controls.StandardControl"])}))}))},e}();t.FormTypings=p},433: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.Generator=void 0;var c=a(n(357)),s=i(n(27)),u=n(597),l=n(668),f=n(482),d=n(760),p=n(805),h=n(660),b=function(){function e(){}return e.generate=function(e,t,n){if(s.test("-e","src"))if(e)if(["entity","webresource","model","licensevalidator","environmentvariable","globaloptionsets"].includes(e.toLowerCase())){if("entity"===e.toLowerCase())return d.EntityRouter.generateEntity(t,n);if("webresource"===e.toLowerCase())return u.Webresource.generateWebresource(t);if("model"===e.toLocaleLowerCase())return l.ModelRouter.generateModel(t);if("licensevalidator"===e.toLowerCase())return f.LicenseValidator.generateLicenseValidator(t);if("environmentvariable"===e.toLowerCase())return h.EnvironmentVariableRouter.generateEnvironmentVariable();if("globaloptionsets"===e.toLowerCase())return p.GlobalOptionSetRouter.generateGlobalOptionSets()}else console.log(c.default.red("Schematic ".concat(e," not supported!")));else console.log(c.default.red("No schematic specified!"));else console.log(c.default.red("You are not inside the project Webresources folder!"))},e.showGenerateHelp=function(){console.log("Arguments:"),console.log(" ".concat(c.default.blue("schematic"))),console.log(" The schematic or collection:schematic to generate."),console.log(" Example: Entity, Webresource or LicenseValidator.")},e}();t.Generator=b},192: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]","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},160: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]")),c.label=3;case 3:return t++,[3,1];case 4:return[2,e]}}))}))},e.prototype.getInterfaceType=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return c(this,(function(o){switch(o.label){case 0:return t=e.AttributeType,n=e.SchemaName,r=e.AttributeTypeName,["String","Memo","DateTime","Lookup","Customer","Owner","Uniqueidentifier"].includes(t)?[2,"string"]:[3,1];case 1:return["Boolean"].includes(t)?[2,"boolean"]:[3,2];case 2:return["Picklist"].includes(t)?[2,"".concat(this.entityName,"_").concat(n,"Values")]:[3,3];case 3:return["Integer","Double","BigInt","Decimal","Double","Money"].includes(t)?[2,"number"]:[3,4];case 4:return["Status"].includes(t)?[4,f.NodeApi.getStatusOptionSet(this.entityLogicalName,this.bearer)]:[3,6];case 5:return[2,o.sent().Options.map((function(e){return e.Value})).join(" | ")];case 6:return["State"].includes(t)?[4,f.NodeApi.getStateOptionSet(this.entityLogicalName,this.bearer)]:[3,8];case 7:return[2,o.sent().Options.map((function(e){return e.Value})).join(" | ")];case 8:if("MultiSelectPicklistType"===r.Value)return[2,"number[]"];o.label=9;case 9:return[2]}}))}))},e.prototype.getTypeStrings=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,u,l;return c(this,(function(c){switch(c.label){case 0:e="",t=0,n=this.attributesMetadata,c.label=1;case 1:return t0&&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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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},175: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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},471: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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.14.3","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(175)}(); \ No newline at end of file +/*! HSO D365 CLI 6.0.4 | (c) HSO Innovation */!function(){"use strict";var e={431: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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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},342: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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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(27)),s=a(n(357)),u=i(n(147)),l=a(n(81)),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},982: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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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},152: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},911: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},807: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]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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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},160: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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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},175: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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},471: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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.14.3","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(175)}(); \ No newline at end of file diff --git a/src/commands/Update.ts b/src/commands/Update.ts index 978ee2b..9f95101 100644 --- a/src/commands/Update.ts +++ b/src/commands/Update.ts @@ -93,18 +93,37 @@ export class Update { shell.ShellString(newFileData).to(filepath); } }); + + // Add Entity.form.ts file when missing + shell.ls(`src/**/build.json`).forEach(function (buildFilepath) { + const split = buildFilepath.split('/'); + const entityName = split[1]; + if (!fs.existsSync(`src/${entityName}/${entityName}.form.ts`)) { + console.log(`Adding ${entityName}/${entityName}.form.ts...`); + const filepath = `src/${entityName}/${entityName}.form.ts`; + shell.cp('-r', `${__dirname}/Entity/Entity.form.ts`, filepath); + shell.sed('-i', new RegExp('Entity', 'g'), entityName, filepath); + if (shell.test('-e', '../.git')) { + cp.execFileSync('git', ['add', filepath]); + } + console.log(`Added ${entityName}/${entityName}.form.ts`); + } + }); } private static updateFormFiles(): void { console.log(`Updating Form files...`); shell.ls(`src/**/*.form.ts*`).forEach(function (filepath) { - const fileData = String(fs.readFileSync(filepath)); - const match = fileData.match(new RegExp('export class ([a-zA-Z]*)Form {')); - if (match) { - const entityName = match[1]; - const importString = `import {${entityName}FormContext} from './${entityName}.formContext';`; - const newExportString = `export class ${entityName}Form extends ${entityName}FormContext {`; - shell.sed('-i', new RegExp(`export class ${entityName}Form {`, 'i'), `${importString}\n${newExportString}`, filepath); + const split = filepath.split('/'); + if (split.length === 4) { // Entity/EntityForm/EntityForm.form.ts + const fileData = String(fs.readFileSync(filepath)); + const match = fileData.match(new RegExp('export class ([a-zA-Z]*)Form {')); + if (match) { + const entityName = match[1]; + const importString = `import {${entityName}FormContext} from './${entityName}.formContext';`; + const newExportString = `export class ${entityName}Form extends ${entityName}FormContext {`; + shell.sed('-i', new RegExp(`export class ${entityName}Form {`, 'i'), `${importString}\n${newExportString}`, filepath); + } } }); } diff --git a/src/commands/generators/AttributeFormContext.ts b/src/commands/generators/AttributeFormContext.ts index 7082441..aa1fc14 100644 --- a/src/commands/generators/AttributeFormContext.ts +++ b/src/commands/generators/AttributeFormContext.ts @@ -26,9 +26,9 @@ export class AttributeFormContext { this.attributesMetadata = await NodeApi.getAttributesMetadata(this.entityLogicalName, this.bearer); const formContextAttributesString = await this.getFormContextAttributesString(); const formContextFilepath = `src/${this.entityName}/${this.entityName}.formContext.ts`; - shell.cp('-r', `${__dirname}/Entity/Entity.attributesContext.ts`, `src/${this.entityName}`); - shell.cp('-r', `src/${this.entityName}/Entity.attributesContext.ts`, formContextFilepath); - shell.rm('-rf', `src/${this.entityName}/Entity.attributesContext.ts`); + shell.cp('-r', `${__dirname}/Entity/Entity.formContext.ts`, `src/${this.entityName}`); + shell.cp('-r', `src/${this.entityName}/Entity.formContext.ts`, formContextFilepath); + shell.rm('-rf', `src/${this.entityName}/Entity.formContext.ts`); shell.sed('-i', new RegExp('Entity', 'g'), this.entityName, formContextFilepath); // shell.exec(`git add ${formContextFilepath}`); if (shell.test('-e', '../.git')) { diff --git a/src/commands/generators/ControlFormContext.ts b/src/commands/generators/ControlFormContext.ts index ae6e1aa..0fcbab3 100644 --- a/src/commands/generators/ControlFormContext.ts +++ b/src/commands/generators/ControlFormContext.ts @@ -34,7 +34,7 @@ export class ControlFormContext { this.attributesMetadata = await NodeApi.getAttributesMetadata(this.entityLogicalName, this.bearer); const formContextControlsString = await this.getFormContextControlsString(systemForm); const formContextFilepath = `src/${this.entityName}/${formName}/${formName}.formContext.ts`; - shell.cp('-r', `${__dirname}/Entity/Entity.formContext.ts`, `src/${this.entityName}/${formName}`); + shell.cp('-r', `${__dirname}/Entity/form/Entity.formContext.ts`, `src/${this.entityName}/${formName}`); shell.cp('-r', `src/${this.entityName}/${formName}/Entity.formContext.ts`, formContextFilepath); shell.rm('-rf', `src/${this.entityName}/${formName}/Entity.formContext.ts`); shell.sed('-i', new RegExp('Entity', 'g'), this.entityName, formContextFilepath); @@ -44,7 +44,7 @@ export class ControlFormContext { cp.execFileSync('git', ['add', formContextFilepath]); } const fileData = String(fs.readFileSync(formContextFilepath)); - const replaceString = fileData.match(new RegExp(`${formName}FormContext extends AttributeFormContext {`, 'ig'))[0]; + const replaceString = fileData.match(new RegExp(`${formName}FormContext extends ${this.entityName}Form {`, 'ig'))[0]; const newFileData = fileData.replace(replaceString, `${replaceString}\n${formContextControlsString}`); shell.ShellString(newFileData).to(formContextFilepath); console.log(`Generated ${formName}/${formName}.formContext.ts`); diff --git a/src/commands/generators/Entity.ts b/src/commands/generators/Entity.ts index 2c89c34..d93a404 100644 --- a/src/commands/generators/Entity.ts +++ b/src/commands/generators/Entity.ts @@ -76,10 +76,24 @@ export class Entity { // } private async addEntityFiles(entityName: string): Promise { + await this.addFormFile(entityName); await this.addServiceFile(entityName); await this.addBuildFile(); } + private async addFormFile(entityName: string): Promise { + console.log(`Adding ${entityName}/${entityName}.form.ts...`); + const filepath = `src/${this.entityName}/${this.entityName}.form.ts`; + shell.cp('-r', `${__dirname}/Entity/Entity.form.ts`, filepath); + // shell.sed('-i', new RegExp('EntityLogicalName', 'g'), this.entityLogicalName, filepath); + shell.sed('-i', new RegExp('Entity', 'g'), entityName, filepath); + // shell.exec(`git add ${filepath}`); + if (shell.test('-e', '../.git')) { + cp.execFileSync('git', ['add', filepath]); + } + console.log(`Added ${entityName}/${entityName}.form.ts`); + } + private async addServiceFile(entityName: string): Promise { console.log(`Adding ${entityName}/${entityName}.service.ts...`); const filepath = `src/${this.entityName}/${this.entityName}.service.ts`; diff --git a/src/commands/generators/Form.ts b/src/commands/generators/Form.ts index ae470be..6de9d02 100644 --- a/src/commands/generators/Form.ts +++ b/src/commands/generators/Form.ts @@ -58,7 +58,7 @@ export class Form { const filepath = `src/${this.entityName}/${formName}/${formName}.ts`; const settings: CrmJson = JSON.parse(fs.readFileSync('../crm.json', 'utf8')); const {namespace, publisher_prefix} = settings.crm; - shell.cp('-r', `${__dirname}/Entity/Entity.ts`, filepath); + shell.cp('-r', `${__dirname}/Entity/form/Entity.ts`, filepath); shell.sed('-i', new RegExp('Entity', 'g'), formName, filepath); shell.sed('-i', new RegExp('<%= publisher %>', 'ig'), publisher_prefix, filepath); shell.sed('-i', new RegExp('<%= namespace %>', 'ig'), namespace, filepath); @@ -75,7 +75,7 @@ export class Form { const formName = systemForm.name.replace(/\W/g, ''); console.log(`Adding ${this.entityName}/${formName}/${formName}.form.ts`); const filepath = `src/${this.entityName}/${formName}/${formName}.form.ts`; - shell.cp('-r', `${__dirname}/Entity/Entity.form.ts`, filepath); + shell.cp('-r', `${__dirname}/Entity/form/Entity.form.ts`, filepath); shell.sed('-i', new RegExp('Entity', 'g'), formName, filepath); // shell.exec(`git add ${filepath}`); if (shell.test('-e', '../.git')) { diff --git a/src/commands/generators/FormTypings.ts b/src/commands/generators/FormTypings.ts index aa875fa..840b5fc 100644 --- a/src/commands/generators/FormTypings.ts +++ b/src/commands/generators/FormTypings.ts @@ -131,7 +131,7 @@ export class FormTypings { } else if (type === 14) { return 'Xrm.Controls.StandardControl'; } else { - console.log(colors.blue(`${this.entityLogicalName} control ${id} type '${type}' falls back to Xrm.Controls.StandardControl.`)); + console.log(colors.blue(`${this.entityLogicalName} control ${id} type '${type}' falls back to Xrm.Controls.StandardControl.`)); return 'Xrm.Controls.StandardControl'; } } diff --git a/src/commands/generators/Model.ts b/src/commands/generators/Model.ts index d5bb6fd..d09e585 100644 --- a/src/commands/generators/Model.ts +++ b/src/commands/generators/Model.ts @@ -221,7 +221,7 @@ export class Model { if (interfaceType) { attributesInterfaces[LogicalName] = interfaceType; } else { - console.log(`To be implemented: ${AttributeType} for ${LogicalName}
`); + console.log(`To be implemented: ${AttributeType} for ${LogicalName}`); } } return attributesInterfaces; From f818564a0ad3d90a3d628b3c7f20ec911f861c70 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Thu, 9 Feb 2023 13:18:17 +0100 Subject: [PATCH 2/5] Update @babel/core --- package-lock.json | 939 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 551 insertions(+), 390 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8858f30..615702a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,15 @@ { "name": "@hso/d365-cli", - "version": "5.13.1", + "version": "6.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hso/d365-cli", - "version": "5.13.1", + "version": "6.0.4", "license": "MIT", "dependencies": { + "@azure/msal-node": "^1.6.0", "colors": "^1.4.0", "commander": "^6.2.1", "express": "^4.17.1", @@ -22,8 +23,7 @@ "hso-d365": "bin/hso-d365" }, "devDependencies": { - "@azure/msal-node": "^1.6.0", - "@babel/core": "^7.14.3", + "@babel/core": "^7.20.12", "@babel/polyfill": "^7.12.1", "@babel/preset-env": "^7.14.2", "@types/colors": "^1.2.1", @@ -59,11 +59,23 @@ "node": ">=14" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@azure/msal-common": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-6.1.0.tgz", "integrity": "sha512-IGjAHttOgKDPQr0Qxx1NjABR635ZNuN7LHjxI0Y7SEA2thcaRGTccy+oaXTFabM/rZLt4F2VrPKUX4BnR9hW9g==", - "dev": true, "dependencies": { "debug": "^4.1.1" }, @@ -75,7 +87,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.6.0.tgz", "integrity": "sha512-RCPXVWsjqYZh7NB1pAJLn4ypHlLBulOjw5nKPLsJiaJJIXnN8kc6SMkK3S9/80DZCEBstvoRMz6zF50QZJUeOQ==", - "dev": true, "dependencies": { "@azure/msal-common": "^6.1.0", "axios": "^0.21.4", @@ -88,47 +99,47 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", - "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==", + "version": "7.20.14", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.14.tgz", + "integrity": "sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.15.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", - "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-compilation-targets": "^7.15.4", - "@babel/helper-module-transforms": "^7.15.4", - "@babel/helpers": "^7.15.4", - "@babel/parser": "^7.15.5", - "@babel/template": "^7.15.4", - "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.4", + "version": "7.20.12", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", + "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.12", + "@babel/types": "^7.20.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "json5": "^2.2.2", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -139,19 +150,33 @@ } }, "node_modules/@babel/generator": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", - "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", + "version": "7.20.14", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.14.tgz", + "integrity": "sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.20.7", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/helper-annotate-as-pure": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz", @@ -178,14 +203,15 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", - "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.15.0", - "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "@babel/compat-data": "^7.20.5", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", "semver": "^6.3.0" }, "engines": { @@ -195,6 +221,21 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "node_modules/@babel/helper-create-class-features-plugin": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz", @@ -250,51 +291,47 @@ "@babel/core": "^7.4.0-0" } }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz", - "integrity": "sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", "dev": true, - "dependencies": { - "@babel/types": "^7.15.4" - }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-function-name": { + "node_modules/@babel/helper-explode-assignable-expression": { "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", - "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz", + "integrity": "sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", "@babel/types": "^7.15.4" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", - "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "node_modules/@babel/helper-function-name": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", + "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/template": "^7.18.10", + "@babel/types": "^7.19.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", - "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -313,31 +350,31 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", - "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz", - "integrity": "sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw==", + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", + "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.15.4", - "@babel/helper-replace-supers": "^7.15.4", - "@babel/helper-simple-access": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.15.4", - "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.6" + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.20.2", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.10", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" @@ -394,12 +431,12 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", - "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", + "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.20.2" }, "engines": { "node": ">=6.9.0" @@ -418,30 +455,39 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", - "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true, "engines": { "node": ">=6.9.0" @@ -463,26 +509,26 @@ } }, "node_modules/@babel/helpers": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", - "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz", + "integrity": "sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==", "dev": true, "dependencies": { - "@babel/template": "^7.15.4", - "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.13", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -491,9 +537,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.7.tgz", - "integrity": "sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g==", + "version": "7.20.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz", + "integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1575,32 +1621,33 @@ } }, "node_modules/@babel/template": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", - "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", - "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-function-name": "^7.15.4", - "@babel/helper-hoist-variables": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4", + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.13.tgz", + "integrity": "sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.20.7", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.20.13", + "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1609,12 +1656,13 @@ } }, "node_modules/@babel/types": { - "version": "7.15.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", - "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1727,6 +1775,53 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", + "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2558,7 +2653,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, "dependencies": { "debug": "4" }, @@ -2668,7 +2762,6 @@ "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, "dependencies": { "follow-redirects": "^1.14.0" } @@ -2843,26 +2936,31 @@ } }, "node_modules/browserslist": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.3.tgz", - "integrity": "sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ==", + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], "dependencies": { - "caniuse-lite": "^1.0.30001264", - "electron-to-chromium": "^1.3.857", - "escalade": "^3.1.1", - "node-releases": "^1.1.77", - "picocolors": "^0.2.1" + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" } }, "node_modules/buffer": { @@ -2891,8 +2989,7 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", - "dev": true + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, "node_modules/buffer-from": { "version": "1.1.2", @@ -2931,14 +3028,20 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001265", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz", - "integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==", + "version": "1.0.30001451", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001451.tgz", + "integrity": "sha512-XY7UbUpGRatZzoRft//5xOa69/1iGJRBlrieH6QYrkKLIFn3m7OVEJ81dSrKoy2BnKsdbX5cLrOispZNYo9v2w==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] }, "node_modules/chalk": { "version": "2.4.2", @@ -3044,7 +3147,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/colorette": { @@ -3258,7 +3361,6 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -3402,7 +3504,6 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, "dependencies": { "safe-buffer": "^5.0.1" } @@ -3413,9 +3514,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "node_modules/electron-to-chromium": { - "version": "1.3.860", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.860.tgz", - "integrity": "sha512-gWwGZ+Wv4Mou2SJRH6JQzhTPjL5f95SX7n6VkLTQ/Q/INsZLZNQ1vH2GlZjozKyvT0kkFuCmWTwIoCj+/hUDPw==", + "version": "1.4.292", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.292.tgz", + "integrity": "sha512-ESWOSyJy5odDlE8wvh5NNAMORv4r6assPwIPGHEMWrWD0SONXcG/xT+9aD9CQyeRwyYDPo6dJT4Bbeg5uevVQQ==", "dev": true }, "node_modules/emoji-regex": { @@ -4244,7 +4345,6 @@ "version": "1.14.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", - "dev": true, "funding": [ { "type": "individual", @@ -4413,7 +4513,7 @@ "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -4469,7 +4569,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -4917,13 +5016,10 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -4935,7 +5031,6 @@ "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", - "dev": true, "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -4957,7 +5052,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, "bin": { "semver": "bin/semver" } @@ -4966,7 +5060,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dev": true, "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -4977,7 +5070,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dev": true, "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -5066,38 +5158,32 @@ "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", - "dev": true + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" }, "node_modules/lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", - "dev": true + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" }, "node_modules/lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", - "dev": true + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" }, "node_modules/lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", - "dev": true + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -5108,8 +5194,7 @@ "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", - "dev": true + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, "node_modules/log-symbols": { "version": "4.1.0", @@ -5367,8 +5452,7 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mute-stream": { "version": "0.0.8", @@ -5396,9 +5480,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "1.1.77", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz", - "integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", + "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", "dev": true }, "node_modules/normalize-path": { @@ -5733,9 +5817,9 @@ } }, "node_modules/picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "node_modules/picomatch": { @@ -6280,15 +6364,6 @@ "node": ">=8" } }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-support": { "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", @@ -6854,6 +6929,32 @@ "node": ">= 0.8" } }, + "node_modules/update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6880,7 +6981,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, "bin": { "uuid": "dist/bin/uuid" } @@ -7193,11 +7293,20 @@ } }, "dependencies": { + "@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@azure/msal-common": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-6.1.0.tgz", "integrity": "sha512-IGjAHttOgKDPQr0Qxx1NjABR635ZNuN7LHjxI0Y7SEA2thcaRGTccy+oaXTFabM/rZLt4F2VrPKUX4BnR9hW9g==", - "dev": true, "requires": { "debug": "^4.1.1" } @@ -7206,7 +7315,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.6.0.tgz", "integrity": "sha512-RCPXVWsjqYZh7NB1pAJLn4ypHlLBulOjw5nKPLsJiaJJIXnN8kc6SMkK3S9/80DZCEBstvoRMz6zF50QZJUeOQ==", - "dev": true, "requires": { "@azure/msal-common": "^6.1.0", "axios": "^0.21.4", @@ -7216,52 +7324,65 @@ } }, "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "requires": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.18.6" } }, "@babel/compat-data": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", - "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==", + "version": "7.20.14", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.14.tgz", + "integrity": "sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw==", "dev": true }, "@babel/core": { - "version": "7.15.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", - "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-compilation-targets": "^7.15.4", - "@babel/helper-module-transforms": "^7.15.4", - "@babel/helpers": "^7.15.4", - "@babel/parser": "^7.15.5", - "@babel/template": "^7.15.4", - "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.4", + "version": "7.20.12", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", + "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.11", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.12", + "@babel/types": "^7.20.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "json5": "^2.2.2", + "semver": "^6.3.0" } }, "@babel/generator": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", - "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", + "version": "7.20.14", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.14.tgz", + "integrity": "sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg==", "dev": true, "requires": { - "@babel/types": "^7.15.4", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.20.7", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" + }, + "dependencies": { + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + } } }, "@babel/helper-annotate-as-pure": { @@ -7284,15 +7405,33 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", - "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.15.0", - "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "@babel/compat-data": "^7.20.5", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", "semver": "^6.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } } }, "@babel/helper-create-class-features-plugin": { @@ -7335,6 +7474,12 @@ "semver": "^6.1.2" } }, + "@babel/helper-environment-visitor": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "dev": true + }, "@babel/helper-explode-assignable-expression": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz", @@ -7345,32 +7490,22 @@ } }, "@babel/helper-function-name": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", - "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", + "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", - "@babel/types": "^7.15.4" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", - "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", - "dev": true, - "requires": { - "@babel/types": "^7.15.4" + "@babel/template": "^7.18.10", + "@babel/types": "^7.19.0" } }, "@babel/helper-hoist-variables": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", - "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.18.6" } }, "@babel/helper-member-expression-to-functions": { @@ -7383,28 +7518,28 @@ } }, "@babel/helper-module-imports": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", - "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.18.6" } }, "@babel/helper-module-transforms": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz", - "integrity": "sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw==", + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", + "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.15.4", - "@babel/helper-replace-supers": "^7.15.4", - "@babel/helper-simple-access": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.15.4", - "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.6" + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.20.2", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.10", + "@babel/types": "^7.20.7" } }, "@babel/helper-optimise-call-expression": { @@ -7446,12 +7581,12 @@ } }, "@babel/helper-simple-access": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", - "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", + "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.20.2" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -7464,24 +7599,30 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", - "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.18.6" } }, + "@babel/helper-string-parser": { + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true }, "@babel/helper-wrap-function": { @@ -7497,31 +7638,31 @@ } }, "@babel/helpers": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", - "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz", + "integrity": "sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==", "dev": true, "requires": { - "@babel/template": "^7.15.4", - "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.13", + "@babel/types": "^7.20.7" } }, "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.7.tgz", - "integrity": "sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g==", + "version": "7.20.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz", + "integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==", "dev": true }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { @@ -8245,40 +8386,42 @@ } }, "@babel/template": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", - "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/traverse": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", - "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-function-name": "^7.15.4", - "@babel/helper-hoist-variables": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4", + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.13.tgz", + "integrity": "sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.20.7", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.20.13", + "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.15.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", - "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" } }, @@ -8360,6 +8503,44 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", + "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -9051,7 +9232,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, "requires": { "debug": "4" } @@ -9134,7 +9314,6 @@ "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, "requires": { "follow-redirects": "^1.14.0" } @@ -9274,16 +9453,15 @@ } }, "browserslist": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.3.tgz", - "integrity": "sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ==", + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001264", - "electron-to-chromium": "^1.3.857", - "escalade": "^3.1.1", - "node-releases": "^1.1.77", - "picocolors": "^0.2.1" + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" } }, "buffer": { @@ -9298,8 +9476,7 @@ "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", - "dev": true + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, "buffer-from": { "version": "1.1.2", @@ -9329,9 +9506,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001265", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz", - "integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==", + "version": "1.0.30001451", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001451.tgz", + "integrity": "sha512-XY7UbUpGRatZzoRft//5xOa69/1iGJRBlrieH6QYrkKLIFn3m7OVEJ81dSrKoy2BnKsdbX5cLrOispZNYo9v2w==", "dev": true }, "chalk": { @@ -9413,7 +9590,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "colorette": { @@ -9575,7 +9752,6 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -9678,7 +9854,6 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -9689,9 +9864,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.860", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.860.tgz", - "integrity": "sha512-gWwGZ+Wv4Mou2SJRH6JQzhTPjL5f95SX7n6VkLTQ/Q/INsZLZNQ1vH2GlZjozKyvT0kkFuCmWTwIoCj+/hUDPw==", + "version": "1.4.292", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.292.tgz", + "integrity": "sha512-ESWOSyJy5odDlE8wvh5NNAMORv4r6assPwIPGHEMWrWD0SONXcG/xT+9aD9CQyeRwyYDPo6dJT4Bbeg5uevVQQ==", "dev": true }, "emoji-regex": { @@ -10316,8 +10491,7 @@ "follow-redirects": { "version": "1.14.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", - "dev": true + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" }, "forwarded": { "version": "0.2.0", @@ -10433,7 +10607,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "has-symbols": { @@ -10470,7 +10644,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, "requires": { "agent-base": "6", "debug": "4" @@ -10785,19 +10958,15 @@ "dev": true }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true }, "jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", - "dev": true, "requires": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -10814,8 +10983,7 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, @@ -10823,7 +10991,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dev": true, "requires": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -10834,7 +11001,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dev": true, "requires": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -10907,38 +11073,32 @@ "lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", - "dev": true + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" }, "lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", - "dev": true + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" }, "lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", - "dev": true + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" }, "lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", - "dev": true + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, "lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, "lodash.merge": { "version": "4.6.2", @@ -10949,8 +11109,7 @@ "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", - "dev": true + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, "log-symbols": { "version": "4.1.0", @@ -11143,8 +11302,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mute-stream": { "version": "0.0.8", @@ -11169,9 +11327,9 @@ "dev": true }, "node-releases": { - "version": "1.1.77", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz", - "integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", + "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", "dev": true }, "normalize-path": { @@ -11408,9 +11566,9 @@ "dev": true }, "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "picomatch": { @@ -11816,12 +11974,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, "source-map-support": { "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", @@ -12200,6 +12352,16 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -12222,8 +12384,7 @@ "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "v8-compile-cache": { "version": "2.3.0", diff --git a/package.json b/package.json index 846cdb6..6d713f2 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "hso-d365": "bin/hso-d365" }, "devDependencies": { - "@babel/core": "^7.14.3", + "@babel/core": "^7.20.12", "@babel/polyfill": "^7.12.1", "@babel/preset-env": "^7.14.2", "@types/colors": "^1.2.1", From c027d2979dc39600610f7bf14217675f2c50da84 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Thu, 9 Feb 2023 13:19:56 +0100 Subject: [PATCH 3/5] Version 6.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 bed9553..655e3ea 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 6.0.4 | (c) HSO Innovation */!function(){"use strict";var e={431: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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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},342: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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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(27)),s=a(n(357)),u=i(n(147)),l=a(n(81)),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},982: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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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},152: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},911: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},807: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]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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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},160: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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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},175: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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},471: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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.14.3","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(175)}(); \ No newline at end of file +/*! HSO D365 CLI 6.0.5 | (c) HSO Innovation */!function(){"use strict";var e={431: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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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},342: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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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(27)),s=a(n(357)),u=i(n(147)),l=a(n(81)),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},982: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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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},152: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},911: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},807: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]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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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},160: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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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},175: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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},471: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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.20.12","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(175)}(); \ No newline at end of file diff --git a/package.json b/package.json index 6d713f2..a30c4ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hso/d365-cli", - "version": "6.0.4", + "version": "6.0.5", "author": "HSO Innovation (https://www.hso.com)", "description": "Dynamics 365 Command Line Interface for TypeScript projects for Dataverse", "repository": { From aabf32640b49f396d62f436ec9f658e594658a18 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Thu, 9 Feb 2023 17:08:58 +0100 Subject: [PATCH 4/5] Custom Api support --- bin/CustomApis/CustomApis.ts | 7 + bin/main.js | 2 +- src/commands/generators/CustomApis.ts | 176 ++++++++++++++++++ src/commands/generators/Generator.ts | 11 +- src/node/CustomApi/CustomApi.model.ts | 9 + src/node/CustomApi/CustomApi.service.ts | 10 + .../CustomApiRequestParameter.model.ts | 14 ++ .../CustomApiRequestParameter.service.ts | 10 + .../CustomApiResponseProperty.model.ts | 11 ++ .../CustomApiResponseProperty.service.ts | 10 + src/routers/CustomApisRouter.ts | 14 ++ 11 files changed, 269 insertions(+), 5 deletions(-) create mode 100644 bin/CustomApis/CustomApis.ts create mode 100644 src/commands/generators/CustomApis.ts create mode 100644 src/node/CustomApi/CustomApi.model.ts create mode 100644 src/node/CustomApi/CustomApi.service.ts create mode 100644 src/node/CustomApiRequestParameter/CustomApiRequestParameter.model.ts create mode 100644 src/node/CustomApiRequestParameter/CustomApiRequestParameter.service.ts create mode 100644 src/node/CustomApiResponseProperty/CustomApiResponseProperty.model.ts create mode 100644 src/node/CustomApiResponseProperty/CustomApiResponseProperty.service.ts create mode 100644 src/routers/CustomApisRouter.ts diff --git a/bin/CustomApis/CustomApis.ts b/bin/CustomApis/CustomApis.ts new file mode 100644 index 0000000..8cede47 --- /dev/null +++ b/bin/CustomApis/CustomApis.ts @@ -0,0 +1,7 @@ +/* This is a generated file, please regenerate and do not modify */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import {WebApi} from '../WebApi/WebApi'; + diff --git a/bin/main.js b/bin/main.js index 655e3ea..aa61666 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 6.0.5 | (c) HSO Innovation */!function(){"use strict";var e={431: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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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},342: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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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(27)),s=a(n(357)),u=i(n(147)),l=a(n(81)),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},982: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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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},152: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},911: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},807: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]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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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},160: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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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},175: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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},471: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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.20.12","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(175)}(); \ No newline at end of file +/*! HSO D365 CLI 6.0.5 | (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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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,p.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:n.solutionid}]},{type:"or",conditions:[{attribute:"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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},6855: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]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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.20.12","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(6175)}(); \ No newline at end of file diff --git a/src/commands/generators/CustomApis.ts b/src/commands/generators/CustomApis.ts new file mode 100644 index 0000000..47e031d --- /dev/null +++ b/src/commands/generators/CustomApis.ts @@ -0,0 +1,176 @@ +import * as shell from 'shelljs'; +import fs from 'fs'; +import {WebresourcesCrmJson} from '../../root/Webresources/CrmJson'; +import {SolutionService} from '../../node/Solution/Solution.service'; +import {CustomApiService} from '../../node/CustomApi/CustomApi.service'; +import {SolutionComponentService} from '../../node/SolutionComponent/SolutionComponent.service'; +import {CustomApiRequestParameterService} from '../../node/CustomApiRequestParameter/CustomApiRequestParameter.service'; +import {CustomApiResponsePropertyService} from '../../node/CustomApiResponseProperty/CustomApiResponseProperty.service'; +import {CustomApiModel} from '../../node/CustomApi/CustomApi.model'; +import {CustomApiRequestParameterModel} from '../../node/CustomApiRequestParameter/CustomApiRequestParameter.model'; +import {CustomApiResponsePropertyModel} from '../../node/CustomApiResponseProperty/CustomApiResponseProperty.model'; + +export class CustomApis { + private readonly bearer: string; + + constructor(bearer: string) { + this.bearer = bearer; + } + + public async generate(): Promise { + console.log(`Generating Custom Apis`); + await this.writeCustomApisFile(); + console.log('Generated Custom Apis'); + } + + private async writeCustomApisFile(): Promise { + console.log(`Generating CustomApis/CustomApis.ts`); + const customApisString = await this.getCustomApisString(); + shell.cp('-r', `${__dirname}/CustomApis`, `src`); + const customApisFilepath = 'src/CustomApis/CustomApis.ts'; + const fileData = String(fs.readFileSync(customApisFilepath)); + shell.ShellString(fileData + customApisString).to(customApisFilepath); + shell.exec(`git add src/CustomApis`); + console.log(`Generated CustomApis/CustomApis.ts`); + } + + // eslint-disable-next-line max-lines-per-function + private async getCustomApisString(): Promise { + let customApiStrings = ''; + const customApis = await this.getCustomApis(); + + for (const customApi of customApis) { + const pascalSchemaName = CustomApis.capitalize(customApi.uniquename); + + const requestParameters = await this.getRequestParameters(customApi); + + customApiStrings += `// eslint-disable-next-line @typescript-eslint/no-empty-interface\n`; + customApiStrings += `interface ${pascalSchemaName}Request {\n`; + for (const requestParameter of requestParameters) { + customApiStrings += ` // ${requestParameter.name}\n`; + customApiStrings += ` // ${requestParameter.description}\n`; + customApiStrings += ` // ${requestParameter.displayname}\n`; + // eslint-disable-next-line max-len + customApiStrings += ` ${requestParameter.uniquename}${requestParameter.isoptional ? '?' : ''}: ${CustomApis.getTypeString(requestParameter.type)};\n\n`; + } + if (requestParameters.length === 0) { + customApiStrings += ` //\n`; + } + customApiStrings += `}\n`; + + const responseProperties = await this.getResponseProperties(customApi); + + customApiStrings += `// eslint-disable-next-line @typescript-eslint/no-empty-interface\n`; + customApiStrings += `interface ${pascalSchemaName}Response {\n`; + for (const responseProperty of responseProperties) { + customApiStrings += ` // ${responseProperty.name}\n`; + customApiStrings += ` // ${responseProperty.description}\n`; + customApiStrings += ` // ${responseProperty.displayname}\n`; + // eslint-disable-next-line max-len + customApiStrings += ` ${responseProperty.uniquename}: ${CustomApis.getTypeString(responseProperty.type)};\n\n`; + } + customApiStrings += `}\n`; + customApiStrings += `// ${customApi.name}\n`; + customApiStrings += `// ${customApi.description}\n`; + customApiStrings += `// ${customApi.displayname}\n`; + customApiStrings += `export const ${pascalSchemaName} = async (request: ${pascalSchemaName}Request): Promise<${pascalSchemaName}Response> => {\n`; + customApiStrings += ` return WebApi.executeAction('${customApi.uniquename}', request);\n`; + customApiStrings += `};\n\n`; + } + if (customApiStrings) { + customApiStrings += '\n'; + } + return customApiStrings; + } + + private async getCustomApis(): Promise { + const settings: WebresourcesCrmJson = JSON.parse(fs.readFileSync('./crm.json', 'utf8')); + const {solution_name_generate} = settings.crm; + const solution = await SolutionService.getSolution(solution_name_generate, ['solutionid'], this.bearer); + const solutionComponents = await SolutionComponentService.retrieveMultipleRecords({ + select: ['objectid'], + filters: [{ + conditions: [{ + attribute: '_solutionid_value', + value: solution.solutionid + }] + }, { + type: 'or', + conditions: [{ + attribute: 'componenttype', + value: 10051 // CustomApis + }] + }] + }, this.bearer); + const conditions: Condition[] = []; + for (const solutionComponent of solutionComponents) { + const objectid = solutionComponent.objectid; + conditions.push({ + attribute: 'customapiid', + value: objectid, + }); + } + return CustomApiService.retrieveMultipleRecords({ + select: ['customapiid', 'description', 'displayname', 'name', 'solutionid', 'uniquename'], + filters: [{ + type: 'or', + conditions: conditions + }] + }, this.bearer); + } + + private getRequestParameters(customApi: CustomApiModel): Promise { + return CustomApiRequestParameterService.retrieveMultipleRecords({ + select: ['customapirequestparameterid', 'description', 'displayname', 'name', 'solutionid', 'uniquename', 'isoptional', 'type'], + filters: [{ + conditions: [{ + attribute: '_customapiid_value', + value: customApi.customapiid + }] + }] + }, this.bearer); + } + + private getResponseProperties(customApi: CustomApiModel): Promise { + return CustomApiResponsePropertyService.retrieveMultipleRecords({ + select: ['customapiresponsepropertyid', 'description', 'displayname', 'name', 'solutionid', 'uniquename', 'type'], + filters: [{ + conditions: [{ + attribute: '_customapiid_value', + value: customApi.customapiid + }] + }] + }, this.bearer); + } + + private static getTypeString(value: number): string { + if (value === 0) { + return 'boolean'; + } + if (value === 1) { + return 'Date'; + } + if ([2, 6, 7].includes(value)) { + return 'number'; + } + if ([3].includes(value)) { + return 'Model'; + } + if ([4].includes(value)) { + return 'Model[]'; + } + if ([5, 8, 9].includes(value)) { + return 'any'; + } + if ([10, 12].includes(value)) { + return 'string'; + } + if ([11].includes(value)) { + return 'string[]'; + } + } + + private static capitalize(text: string): string { + return text.charAt(0).toUpperCase() + text.slice(1); + } +} diff --git a/src/commands/generators/Generator.ts b/src/commands/generators/Generator.ts index 267426b..d34db3f 100644 --- a/src/commands/generators/Generator.ts +++ b/src/commands/generators/Generator.ts @@ -5,11 +5,12 @@ import {ModelRouter} from '../../routers/ModelRouter'; import {LicenseValidator} from './LicenseValidator'; import {EntityRouter} from '../../routers/EntityRouter'; import {GlobalOptionSetRouter} from '../../routers/GlobalOptionSetRouter'; +import {CustomApisRouter} from '../../routers/CustomApisRouter'; import {EnvironmentVariableRouter} from '../../routers/EnvironmentVariableRouter'; export class Generator { public static generate(schematic: string, name: string, options: unknown): Promise { - const supportedSchematics = ['entity', 'webresource', 'model', 'licensevalidator', 'environmentvariable', 'globaloptionsets']; + const supportedSchematics = ['entity', 'webresource', 'model', 'licensevalidator', 'environmentvariable', 'globaloptionsets', 'customapis']; if (!shell.test('-e', 'src')) { console.log(colors.red(`You are not inside the project Webresources folder!`)); } else if (!schematic) { @@ -20,14 +21,16 @@ export class Generator { return EntityRouter.generateEntity(name, options); } else if (schematic.toLowerCase() === 'webresource') { return Webresource.generateWebresource(name); - } else if(schematic.toLocaleLowerCase() === 'model') { + } else if (schematic.toLocaleLowerCase() === 'model') { return ModelRouter.generateModel(name); } else if (schematic.toLowerCase() === 'licensevalidator') { return LicenseValidator.generateLicenseValidator(name); - } else if(schematic.toLowerCase() === 'environmentvariable') { + } else if (schematic.toLowerCase() === 'environmentvariable') { return EnvironmentVariableRouter.generateEnvironmentVariable(); - } else if(schematic.toLowerCase() === 'globaloptionsets') { + } else if (schematic.toLowerCase() === 'globaloptionsets') { return GlobalOptionSetRouter.generateGlobalOptionSets(); + } else if (schematic.toLowerCase() === 'customapis') { + return CustomApisRouter.generateCustomApis(); } } diff --git a/src/node/CustomApi/CustomApi.model.ts b/src/node/CustomApi/CustomApi.model.ts new file mode 100644 index 0000000..866c80d --- /dev/null +++ b/src/node/CustomApi/CustomApi.model.ts @@ -0,0 +1,9 @@ + +export interface CustomApiModel extends Model { + customapiid?: string; + description?: string; + displayname?: string; + name?: string; + solutionid?: string; + uniquename?: string; +} diff --git a/src/node/CustomApi/CustomApi.service.ts b/src/node/CustomApi/CustomApi.service.ts new file mode 100644 index 0000000..e1a4b6b --- /dev/null +++ b/src/node/CustomApi/CustomApi.service.ts @@ -0,0 +1,10 @@ +import {NodeApi} from '../NodeApi/NodeApi'; +import {CustomApiModel} from './CustomApi.model'; + +export class CustomApiService { + private static entitySetName = 'customapis'; + + public static async retrieveMultipleRecords(multipleSystemQueryOptions: MultipleSystemQueryOptions, bearer: string): Promise { + return NodeApi.retrieveMultipleRecords(CustomApiService.entitySetName, multipleSystemQueryOptions, bearer); + } +} diff --git a/src/node/CustomApiRequestParameter/CustomApiRequestParameter.model.ts b/src/node/CustomApiRequestParameter/CustomApiRequestParameter.model.ts new file mode 100644 index 0000000..13d311f --- /dev/null +++ b/src/node/CustomApiRequestParameter/CustomApiRequestParameter.model.ts @@ -0,0 +1,14 @@ + +// https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/customapirequestparameter?view=dataverse-latest +export type CustomApiType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + +export interface CustomApiRequestParameterModel extends Model { + customapirequestparameterid?: string; + description?: string; + displayname?: string; + name?: string; + solutionid?: string; + uniquename?: string; + isoptional?: boolean; + type?: CustomApiType; +} diff --git a/src/node/CustomApiRequestParameter/CustomApiRequestParameter.service.ts b/src/node/CustomApiRequestParameter/CustomApiRequestParameter.service.ts new file mode 100644 index 0000000..21de415 --- /dev/null +++ b/src/node/CustomApiRequestParameter/CustomApiRequestParameter.service.ts @@ -0,0 +1,10 @@ +import {NodeApi} from '../NodeApi/NodeApi'; +import {CustomApiRequestParameterModel} from './CustomApiRequestParameter.model'; + +export class CustomApiRequestParameterService { + private static entitySetName = 'customapirequestparameters'; + + public static async retrieveMultipleRecords(multipleSystemQueryOptions: MultipleSystemQueryOptions, bearer: string): Promise { + return NodeApi.retrieveMultipleRecords(CustomApiRequestParameterService.entitySetName, multipleSystemQueryOptions, bearer); + } +} diff --git a/src/node/CustomApiResponseProperty/CustomApiResponseProperty.model.ts b/src/node/CustomApiResponseProperty/CustomApiResponseProperty.model.ts new file mode 100644 index 0000000..bc0ad55 --- /dev/null +++ b/src/node/CustomApiResponseProperty/CustomApiResponseProperty.model.ts @@ -0,0 +1,11 @@ +import {CustomApiType} from '../CustomApiRequestParameter/CustomApiRequestParameter.model'; + +export interface CustomApiResponsePropertyModel extends Model { + customapiresponsepropertyid?: string; + description?: string; + displayname?: string; + name?: string; + solutionid?: string; + uniquename?: string; + type?: CustomApiType; +} diff --git a/src/node/CustomApiResponseProperty/CustomApiResponseProperty.service.ts b/src/node/CustomApiResponseProperty/CustomApiResponseProperty.service.ts new file mode 100644 index 0000000..68eef86 --- /dev/null +++ b/src/node/CustomApiResponseProperty/CustomApiResponseProperty.service.ts @@ -0,0 +1,10 @@ +import {NodeApi} from '../NodeApi/NodeApi'; +import {CustomApiResponsePropertyModel} from './CustomApiResponseProperty.model'; + +export class CustomApiResponsePropertyService { + private static entitySetName = 'customapiresponseproperties'; + + public static async retrieveMultipleRecords(multipleSystemQueryOptions: MultipleSystemQueryOptions, bearer: string): Promise { + return NodeApi.retrieveMultipleRecords(CustomApiResponsePropertyService.entitySetName, multipleSystemQueryOptions, bearer); + } +} diff --git a/src/routers/CustomApisRouter.ts b/src/routers/CustomApisRouter.ts new file mode 100644 index 0000000..a647316 --- /dev/null +++ b/src/routers/CustomApisRouter.ts @@ -0,0 +1,14 @@ +import {MsalRouter} from './MsalRouter'; +import {CustomApis} from '../commands/generators/CustomApis'; + +export class CustomApisRouter extends MsalRouter { + public static generateCustomApis(): Promise { + new CustomApisRouter(); + return null; + } + + protected async onAuthenticated(): Promise { + const customApis = new CustomApis(this.bearer); + await customApis.generate(); + } +} From 3820794c6ab2529a41f775ac6f684bada1e70b35 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Thu, 9 Feb 2023 17:09:58 +0100 Subject: [PATCH 5/5] Version 6.1.0 --- 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 aa61666..95c8587 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 6.0.5 | (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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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,p.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:n.solutionid}]},{type:"or",conditions:[{attribute:"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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},6855: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]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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.20.12","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(6175)}(); \ No newline at end of file +/*! HSO D365 CLI 6.1.0 | (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_name_deploy,t),l.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),e.solution_name_generate||e.solution_name_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_name_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_name_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_name_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_name_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=y.ls("dist/**/locales/*.resx"),0===(o=r.map((function(e){return e.substr(5)}))).length&&null===e.dependencyxml?[2,null]:[4,b.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 b.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.webresource.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var t=JSON.parse(f.default.readFileSync("./tools/crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/Webresources/crm.json"),"."),l.default.sed("-i",new RegExp("<%= solution_name_deploy %>","ig"),t.crm.solution_name_deploy,"./crm.json"),l.default.sed("-i",new RegExp("<%= solution_name_generate %>","ig"),t.crm.solution_name_generate,"./crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","./crm.json"]),l.default.rm("-rf","./tools"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["rm","./tools"])}var n=JSON.parse(f.default.readFileSync("../crm.json","utf8"));l.default.cp("-R","".concat(__dirname,"/root/crm.json"),"../"),l.default.sed("-i",new RegExp("<%= publisher_prefix %>","ig"),n.crm.publisher_prefix,"../crm.json"),l.default.sed("-i",new RegExp("<%= environment %>","ig"),n.crm.url,"../crm.json"),l.default.sed("-i",new RegExp("<%= namespace %>","ig"),n.crm.namespace,"../crm.json"),l.default.test("-e","../.git")&&d.default.execFileSync("git",["add","../crm.json"]);var r=l.default.exec("hso-d365 --version").stdout.replace(/\n/gi,"");l.default.sed("-i",new RegExp("<%= version %>","ig"),r,"../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,p.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:n.solutionid}]},{type:"or",conditions:[{attribute:"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,d.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:r.solutionid}]},{type:"or",conditions:[{attribute:"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.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;return c(this,(function(o){switch(o.label){case 0:return[4,p.SystemFormService.getSystemForms(this.entityLogicalName,["objecttypecode","name","formjson"],this.bearer)];case 1:for(e=o.sent(),t=0,n=e;t0&&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?(console.log("hso-d365 generate Entity ".concat(i)),[4,new f.Entity(this.bearer,i,{}).generate()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.regenerateGlobalOptionSets=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate GlobalOptionSets"),[4,new d.GlobalOptionSet(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e.prototype.regenerateEnvironmentVariable=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("hso-d365 generate EnvironmentVariable"),[4,new p.EnvironmentVariable(this.bearer).generate()];case 1:return e.sent(),[2]}}))}))},e}();t.Regenerator=h},597: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"),a,"src/".concat(e,"/").concat(o)),l.sed("-i",new RegExp("<%= namespace %>","ig"),i,"src/".concat(e,"/").concat(o));var c="src/".concat(e,"/").concat(o);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.template}),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").description("Creates a new workspace and an initial Webresource and PCF setup or creates a new PCF component").action((function(e){a.default.test("-e","../pcf")?y.PCF.createComponent(e):s.Create.createProject(e)})).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,b.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").description("Generates and/or modifies files bases on a schematic.").action((function(e,t,n){v()&&l.Generator.generate(e,t,n)})).on("--help",(function(){l.Generator.showGenerateHelp()})),c.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){d.Resx.extract()})).on("--help",(function(){console.log("In translation folder a folder 'locales' will be generated having translation files."),console.log("It will generate one locales.resx file."),console.log("You have to add for each required language a copy yourself like locales.1033.resx."),console.log("Once done, the tooling will keep up-to-date for you.")})),c.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){a.default.exec("npm run lint")})).on("--help",(function(){console.log("Runs linting tools on project code using the configuration as specified in your projects '.eslintrc.json' file")})),c.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){a.default.test("-f","Solutions.cdsproj")?y.PCF.build():a.default.exec("npm run build:prod")})).on("--help",(function(){console.log("The command can be used to build the project to be distributed to the D365 environment using the 'deploy' command")})),c.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;a.default.test("-f","Solutions.cdsproj")||a.default.test("-f","pcfconfig.json")?y.PCF.deploy():f.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),c.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){(function(){if(!a.default.test("-e","src"))return console.log(g.default.red("You are not inside the project Webresources folder!")),!1;var e=a.default.exec("hso-d365 --version").stdout.replace(/\n/gi,""),t=JSON.parse(m.default.readFileSync("../crm.json","utf8"));if(t)for(var n=e.split("."),r=t.version.split("."),o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new p.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),c.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r,i,c;return o(this,(function(o){return e=process.cwd(),t=JSON.parse(m.default.readFileSync("../crm.json","utf8")),a.default.test("-e","Solutions")?(n="REGEX:(?insx).+\\/cc_".concat(t.crm.publisher_prefix,".(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),r="".concat(e,"\\${foldername}\\out\\controls\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(n)),console.log("Please add to second Rule Editor line: \n".concat(r))):(i="REGEX:(?insx).+\\/".concat(t.crm.publisher_prefix,"_\\/").concat(t.crm.namespace,"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)"),c="".concat(e,"\\dist\\").concat(t.crm.publisher_prefix,"_\\").concat(t.crm.namespace,"\\${foldername}\\${fname}"),console.log("Please add to first Rule Editor line (including REGEX:): \n".concat(i)),console.log("Please add to second Rule Editor line: \n".concat(c))),[2]}))}))})),c.default.arguments("").action((function(){c.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),c.default.parse(process.argv)},6855: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]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]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?"?".concat(s.join("&")):""},e.generateSelect=function(e){return void 0===e&&(e=[]),e.length>0?"$select=".concat(e.join(",")):null},e.generateFilter=function(t){void 0===t&&(t=[]);var n=[];if(t.length>0)for(var r=0,o=t;r0?"$filter=".concat(n.join(" and ")):null},e.parseFilter=function(e){for(var t=e.type,n=void 0===t?"and":t,r=[],o=0,i=e.conditions;o0&&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]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]{".concat(e.webresourceid,"}")},[2,i.NodeApi.executeAction("PublishXml",t,n)]}))}))},e.addToSolution=function(e,t,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,i.NodeApi.executeAction("AddSolutionComponent",n,{ComponentId:e.webresourceid,ComponentType:61,SolutionUniqueName:t,AddRequiredComponents:!1,IncludedComponentSettingsValues:null})]}))}))},e.getWebresourcetype=function(t,n){return r(this,void 0,void 0,(function(){var r,a,c,s,u,l,f,d;return o(this,(function(o){switch(o.label){case 0:return[4,i.NodeApi.getPicklistOptionSet(e.logicalName,"webresourcetype",n)];case 1:for(r=o.sent(),s=0,u=r.Options;s0&&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]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]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] (https://www.hso.com)","description":"Dynamics 365 Command Line Interface for TypeScript projects for Dataverse","repository":{"type":"git","url":"https://github.com/hso-nn/d365-cli.git"},"keywords":["dynamics crm","dynamics d365","webapi","xrm","typescript","d365","dataverse","cli","crm","ce","hso"],"files":["bin/"],"license":"MIT","scripts":{"build":"npm run clean && webpack --mode development","build:prod":"npm run clean && webpack --mode production --bail --progress","clean":"IF exist bin\\\\root\\\\deploy (rmdir /s /q bin\\\\root\\\\deploy)"},"engines":{"node":">=14"},"bin":{"hso-d365":"bin/hso-d365"},"devDependencies":{"@babel/core":"^7.20.12","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.14.2","@types/colors":"^1.2.1","@types/commander":"^2.12.2","@types/express":"^4.17.13","@types/express-session":"^1.17.4","@types/inquirer":"^7.3.1","@types/node":"^14.14.14","@types/open":"^6.2.1","@types/sanitize-html":"^2.3.2","@types/shelljs":"^0.8.8","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.2","@types/xml2js":"^0.4.7","@types/xrm":"^9.0.33","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","babel-loader":"^8.2.2","copy-webpack-plugin":"^7.0.0","cross-env":"^7.0.3","eslint":"^8.9.0","eslint-webpack-plugin":"^3.1.1","json-loader":"^0.5.7","terser-webpack-plugin":"^5.0.3","ts-loader":"^8.0.12","ts-node":"^10.1.0","typescript":"^4.5.5","webpack":"^5.44.0","webpack-cli":"^4.7.2","webpack-node-externals":"^2.5.2"},"dependencies":{"@azure/msal-node":"^1.6.0","colors":"^1.4.0","commander":"^6.2.1","express":"^4.17.1","express-session":"^1.17.2","inquirer":"^8.1.5","open":"^7.3.0","shelljs":"^0.8.4","xml2js":"^0.4.23"}}')}},t={};(function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports})(6175)}(); \ No newline at end of file diff --git a/package.json b/package.json index a30c4ec..1d01a75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hso/d365-cli", - "version": "6.0.5", + "version": "6.1.0", "author": "HSO Innovation (https://www.hso.com)", "description": "Dynamics 365 Command Line Interface for TypeScript projects for Dataverse", "repository": {