From 493b7923fa6c70e0f6c67bbadb6deb976f3d9bec Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Tue, 27 Jul 2021 15:33:11 +0200 Subject: [PATCH 1/3] Option --skipForms for generate Entity --- src/generator/Entity.ts | 22 ++++++++++++++++------ src/generator/Generator.ts | 4 ++-- src/main.ts | 5 +++-- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/generator/Entity.ts b/src/generator/Entity.ts index e3bd097..68988a5 100644 --- a/src/generator/Entity.ts +++ b/src/generator/Entity.ts @@ -9,25 +9,31 @@ import {Enum} from './Enum'; import {AttributeFormContext} from './AttributeFormContext'; import {Form} from './Form'; +interface EntityOptions { + skipForms?: boolean; +} + export class Entity extends AdalRouter { - public static async generateEntity(entityName: string): Promise { + public static async generateEntity(entityName: string, options: EntityOptions): Promise { if (!entityName) { console.log(colors.red('Entity name missing')); } else if(!new RegExp('[A-Z]').test(entityName[0])) { console.log(colors.red(`Entity name must be UpperCamelCase!`)); - } else if (process.argv[5]) { + } else if (!options.skipForms && process.argv[5] || process.argv[6]) { console.log(colors.red(`No spaces allowed!`)); } else { - new Entity(entityName); + new Entity(entityName, options); } return null; } private entityLogicalName: string; private readonly entityName: string; - constructor(entityName: string) { + private readonly options: EntityOptions; + constructor(entityName: string, options: EntityOptions) { super(); this.entityName = entityName; + this.options = options; } protected async onAuthenticated(): Promise { @@ -35,8 +41,12 @@ export class Entity extends AdalRouter { await this.log(`Generating files for Entity '${this.entityName}'
Using entityLogicalName '${this.entityLogicalName}'
`); await Model.generateModel(this.bearer, this.entityName, this.entityLogicalName, async (message: string) => this.log(message)); await Enum.generateEnum(this.bearer, this.entityName, this.entityLogicalName, async (message: string) => this.log(message)); - await AttributeFormContext.generateFormContext(this.bearer, this.entityName, this.entityLogicalName, async (message: string) => this.log(message)); - await Form.generateFormFiles(this.bearer, this.entityName, this.entityLogicalName, async (message: string) => this.log(message)); + if (!this.options.skipForms) { + await AttributeFormContext.generateFormContext(this.bearer, this.entityName, this.entityLogicalName, async (message: string) => this.log(message)); + await Form.generateFormFiles(this.bearer, this.entityName, this.entityLogicalName, async (message: string) => this.log(message)); + } else { + await this.log('Skip generate form files'); + } await this.log('Generating files finished'); } diff --git a/src/generator/Generator.ts b/src/generator/Generator.ts index 33be877..cf9769e 100644 --- a/src/generator/Generator.ts +++ b/src/generator/Generator.ts @@ -7,7 +7,7 @@ import {EnvironmentVariable} from './EnvironmentVariable'; import {LicenseValidator} from './LicenseValidator'; export class Generator { - public static generate(schematic: string, name: string): Promise { + public static generate(schematic: string, name: string, options: unknown): Promise { const supportedSchematics = ['entity', 'webresource', 'model', 'licensevalidator', 'environmentvariable']; if (!shell.test('-e', 'src')) { console.log(colors.red(`You are not inside the project Webresources folder!`)); @@ -16,7 +16,7 @@ export class Generator { } else if (!supportedSchematics.includes(schematic.toLowerCase())) { console.log(colors.red(`Schematic ${schematic} not supported!`)); } else if (schematic.toLowerCase() === 'entity') { - return Entity.generateEntity(name); + return Entity.generateEntity(name, options); } else if (schematic.toLowerCase() === 'webresource') { return Webresource.generateWebresource(name); } else if(schematic.toLocaleLowerCase() === 'model') { diff --git a/src/main.ts b/src/main.ts index 0d69949..2287502 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,9 +27,10 @@ program program .command('generate [name]') .alias('g') + .option('-s, --skipForms', 'Skip generating form files') .description('Generates and/or modifies files bases on a schematic.') - .action((schematic: string, name: string) => { - Generator.generate(schematic, name); + .action((schematic: string, name: string, options) => { + Generator.generate(schematic, name, options); }) .on('--help', () => { Generator.showGenerateHelp(); From a26d813f494837a4e04978c9161807ac16dfb442 Mon Sep 17 00:00:00 2001 From: Niels Steenbeek Date: Tue, 27 Jul 2021 15:34:25 +0200 Subject: [PATCH 2/3] Build 5.1.0 --- bin/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/main.js b/bin/main.js index c9670f5..a58e844 100644 --- a/bin/main.js +++ b/bin/main.js @@ -1 +1 @@ -/*! HSO D365 CLI 5.1.0 | (c) HSO Innovation */!function(){"use strict";var e={194: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]","ig"),e.publisher,t),c.sed("-i",new RegExp("<%= solution %>","ig"),e.solution,t),c.sed("-i",new RegExp("<%= environment %>","ig"),e.environment,t),c.sed("-i",new RegExp("<%= namespace %>","ig"),e.namespace,t)},e.initPackageJson=function(e,t){var n=c.ls("Webresources/package.json")[0];c.sed("-i","<%= projectname %>",e.toLowerCase(),n),c.sed("-i",new RegExp("<%= description %>","ig"),t.solution,n),c.sed("-i",new RegExp("<%= publisher %>","ig"),t.publisher,n)},e.initWebpackConfig=function(e){var t=c.ls("Webresources/webpack.config.ts")[0];c.sed("-i",new RegExp("<%= publisher %>","ig"),e.publisher,t),c.sed("-i",new RegExp("<%= namespace %>","ig"),e.namespace,t),c.sed("-i",new RegExp("<%= description %>","ig"),e.namespace,t)},e.inquirer=function(){return l.prompt([{type:"input",name:"environment",message:"D365 environment url (eg. https://yourproject.crm4.dynamics.com):"},{type:"input",name:"solution",message:"D365 Solution name:"},{type:"input",name:"publisher",message:"D365 Publisher Prefix (3 chars a-z):"},{type:"input",name:"namespace",message:"Namespace (eg. Customer or Product name):"}])},e}();t.Create=f},800: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]")];case 1:return a.sent(),e=this,[4,l.NodeApi.getAttributesMetadata(this.entityLogicalName,this.bearer)];case 2:return e.attributesMetadata=a.sent(),[4,this.getFormContextAttributesString()];case 3:return t=a.sent(),n="src/"+this.entityName+"/"+this.entityName+".formContext.ts",u.cp("-r",__dirname+"/Entity/Entity.attributesContext.ts","src/"+this.entityName),u.cp("-r","src/"+this.entityName+"/Entity.attributesContext.ts",n),u.rm("-rf","src/"+this.entityName+"/Entity.attributesContext.ts"),u.sed("-i",new RegExp("Entity","g"),this.entityName,n),u.exec("git add "+n),r=String(c.readFileSync(n)),i=this.entityName+"FormContext {",o=r.replace(i,i+"\n"+t),u.ShellString(o).to(n),[4,this.log("Generated "+this.entityName+".formContext.ts
")];case 4:return a.sent(),[2]}}))}))},e.prototype.getFormContextAttributesString=function(){return a(this,void 0,void 0,(function(){var t,n,r,i,o,a,u,c,l,f;return s(this,(function(s){switch(s.label){case 0:t="",n=0,r=this.attributesMetadata,s.label=1;case 1:return n"]:[3,3];case 3:return["Picklist","Status","State"].includes(e)?[2,"Xrm.Attributes.OptionSetAttribute"]:[3,4];case 4:return["Integer","Double","BigInt","Decimal","Double","Money"].includes(e)?[2,"Xrm.Attributes.NumberAttribute"]:[3,5];case 5:return["Lookup","Customer","Owner"].includes(e)?[2,"Xrm.Attributes.LookupAttribute"]:[3,6];case 6:return[4,this.log(''+this.entityLogicalName+" attribute "+e+" falls back to Xrm.Attributes.Attribute.
")];case 7:return t.sent(),[2,"Xrm.Attributes.Attribute"]}}))}))},e.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e}();t.AttributeFormContext=f},527: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]")];case 1:return s.sent(),n=this,[4,l.NodeApi.getAttributesMetadata(this.entityLogicalName,this.bearer)];case 2:return n.attributesMetadata=s.sent(),[4,this.getFormContextControlsString(e)];case 3:return r=s.sent(),i="src/"+this.entityName+"/"+t+"/"+t+".formContext.ts",u.cp("-r",__dirname+"/Entity/Entity.formContext.ts","src/"+this.entityName+"/"+t),u.cp("-r","src/"+this.entityName+"/"+t+"/Entity.formContext.ts",i),u.rm("-rf","src/"+this.entityName+"/"+t+"/Entity.formContext.ts"),u.sed("-i",new RegExp("Entity","g"),this.entityName,i),u.sed("-i",new RegExp("FormName","g"),t,i),u.exec("git add "+i),o=String(c.readFileSync(i)),a=t+"FormContext extends "+this.entityName+"FormContext {",f=o.replace(a,a+"\n"+r),u.ShellString(f).to(i),[4,this.log("Generated "+t+"/"+t+".formContext.ts
")];case 4:return s.sent(),[2]}}))}))},e.prototype.getFormContextControlsString=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o;return s(this,(function(a){switch(a.label){case 0:return t="",n=JSON.parse(e.formjson),r=t,[4,this.getTabsString(n.Tabs.$values)];case 1:return t=r+a.sent(),i=t,[4,this.getControlsString(n.Header.Controls.$values)];case 2:return t=i+a.sent(),o=t,[4,this.getControlsString(n.Footer.Controls.$values)];case 3:return[2,t=o+a.sent()]}}))}))},e.prototype.getTabsString=function(t){return a(this,void 0,void 0,(function(){var n,r,i,o,a,u,c;return s(this,(function(s){switch(s.label){case 0:n="",r=0,i=t,s.label=1;case 1:return r'+this.entityLogicalName+" control "+n+" falls back to Xrm.Controls.StandardControl.")];case 4:return i.sent(),[2,"Xrm.Controls.StandardControl"]}}))}))},e.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e}();t.ControlFormContext=f},446:function(e,t,n){var r,i=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])})(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)}),o=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}),s=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)&&o(t,e,n);return a(t,e),t},u=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]Using entityLogicalName '"+this.entityLogicalName+"'
")];case 2:return t.sent(),[4,m.Model.generateModel(this.bearer,this.entityName,this.entityLogicalName,(function(t){return u(e,void 0,void 0,(function(){return c(this,(function(e){return[2,this.log(t)]}))}))}))];case 3:return t.sent(),[4,g.Enum.generateEnum(this.bearer,this.entityName,this.entityLogicalName,(function(t){return u(e,void 0,void 0,(function(){return c(this,(function(e){return[2,this.log(t)]}))}))}))];case 4:return t.sent(),[4,v.AttributeFormContext.generateFormContext(this.bearer,this.entityName,this.entityLogicalName,(function(t){return u(e,void 0,void 0,(function(){return c(this,(function(e){return[2,this.log(t)]}))}))}))];case 5:return t.sent(),[4,w.Form.generateFormFiles(this.bearer,this.entityName,this.entityLogicalName,(function(t){return u(e,void 0,void 0,(function(){return c(this,(function(e){return[2,this.log(t)]}))}))}))];case 6:return t.sent(),[4,this.log("Generating files finished")];case 7:return t.sent(),[2]}}))}))},t.prototype.generateEntity=function(){return u(this,void 0,void 0,(function(){var e,t,n,r,i;return c(this,(function(o){switch(o.label){case 0:return e="src/"+this.entityName+"/"+this.entityName+".service.ts",d.test("-f",e)?[3,7]:[4,p.prompt([{type:"input",name:"entityLogicalName",message:"Entity LogicalName:"}])];case 1:t=o.sent(),this.entityLogicalName=t.entityLogicalName,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,y.NodeApi.getEntityDefinition(this.entityLogicalName,this.bearer,["PrimaryIdAttribute"])];case 3:return o.sent(),[3,5];case 4:throw n=o.sent(),console.log(f.default.red("Failed: Entity "+this.entityName+" has no LogicalName "+this.entityLogicalName)),n;case 5:return d.mkdir("src/"+this.entityName),[4,this.addEntityFiles(this.entityName)];case 6:return o.sent(),[3,8];case 7:r=String(h.readFileSync(e)),i=r.match(new RegExp("private static logicalName = '([a-zA-Z_]*)';")),this.entityLogicalName=i[1],console.log(f.default.green("Entity "+this.entityName+" already exist")),o.label=8;case 8:return[2]}}))}))},t.prototype.addEntityFiles=function(e){return u(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return[4,this.addServiceFile(e)];case 1:return t.sent(),[4,this.addBuildFile()];case 2:return t.sent(),[2]}}))}))},t.prototype.addServiceFile=function(e){return u(this,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return[4,this.log("Adding "+e+"/"+e+".service.ts...")];case 1:return n.sent(),t="src/"+this.entityName+"/"+this.entityName+".service.ts",d.cp("-r",__dirname+"/Entity/Entity.service.ts",t),d.sed("-i",new RegExp("EntityLogicalName","g"),this.entityLogicalName,t),d.sed("-i",new RegExp("Entity","g"),e,t),d.exec("git add "+t),[4,this.log("Added "+e+"/"+e+".service.ts")];case 2:return n.sent(),[2]}}))}))},t.prototype.addBuildFile=function(){return u(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return[4,this.log("Adding "+this.entityName+"/build.json")];case 1:return t.sent(),e="src/"+this.entityName+"/build.json",d.cp("-r",__dirname+"/Entity/build.json",e),d.exec("git add "+e),[4,this.log("Added "+this.entityName+"/build.json")];case 2:return t.sent(),[2]}}))}))},t}(b.AdalRouter);t.Entity=_},172: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]")];case 1:return i.sent(),[4,this.getAttributeNamesEnumString()];case 2:return e=i.sent(),[4,this.getEnumStrings()];case 3:return t=i.sent(),n="src/"+this.entityName+"/"+this.entityName+".enum.ts",u.cp("-r",__dirname+"/Entity/Entity.enum.ts","src/"+this.entityName),u.cp("-r","src/"+this.entityName+"/Entity.enum.ts",n),u.rm("-rf","src/"+this.entityName+"/Entity.enum.ts"),u.exec("git add "+n),r=String(c.readFileSync(n)),[4,this.log("Generated "+this.entityName+".enum.ts
")];case 4:return i.sent(),u.ShellString(r+e+t).to(n),[2]}}))}))},e.prototype.getAttributeNamesEnumString=function(){return a(this,void 0,void 0,(function(){var t,n,r,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t="",[4,l.NodeApi.getAttributesMetadata(this.entityLogicalName,this.bearer)];case 1:for(n=s.sent(),t+="export enum "+this.entityName+"AttributeNames {\n",r=0,i=n;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] {",d="const environmentVariableValue = await EnvironmentVariableService.getEnvironmentVariableValue('"+s.schemaname+"');",h=t.getReturnString(s),e+=f+"\n "+d+"\n "+h+"\n }\n\n";return[2,e]}}))}))},t.getReturnString=function(e){if(1e8===e.type)return"return environmentVariableValue ? environmentVariableValue.value : '"+e.defaultvalue+"';";if(100000001===e.type)return"return environmentVariableValue ? parseFloat(environmentVariableValue.value) : "+e.defaultvalue+";";if(100000002===e.type)return"return environmentVariableValue ? environmentVariableValue.value === 'yes' : "+("yes"===e.defaultvalue)+";";if(100000003===e.type){var t="// eslint-disable-next-line quotes\n ";return t+="return environmentVariableValue ? JSON.parse(environmentVariableValue.value) : "+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"}},t.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},t.prototype.getEnvironmentVariableDefinitions=function(){return u(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,s;return c(this,(function(u){switch(u.label){case 0:return e=[],[4,h.SolutionService.getSolution(["solutionid"],this.bearer)];case 1:return t=u.sent(),[4,b.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:t.solutionid}]},{type:"or",conditions:[{attribute:"componenttype",value:380}]}]},this.bearer)];case 2:n=u.sent(),r=0,i=n,u.label=3;case 3:return r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]","ig"),i,n),c.sed("-i",new RegExp("<%= namespace %>","ig"),o,n),c.sed("-i",new RegExp("<%= formname %>","ig"),e.name,n),c.sed("-i",new RegExp("<%= entity %>","ig"),this.entityName,n),c.exec("git add "+n),[4,this.log("Added "+this.entityName+"/"+t+"/"+t+".ts")];case 3:return a.sent(),[2]}}))}))},e.prototype.addEntityFormFile=function(e){return a(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=e.name.replace(/\W/g,""),[4,this.log("Adding "+this.entityName+"/"+t+"/"+t+".form.ts")];case 1:return r.sent(),n="src/"+this.entityName+"/"+t+"/"+t+".form.ts",c.cp("-r",__dirname+"/Entity/Entity.form.ts",n),c.sed("-i",new RegExp("Entity","g"),t,n),c.exec("git add "+n),[4,this.log("Added "+this.entityName+"/"+t+"/"+t+".form.ts")];case 2:return r.sent(),[2]}}))}))},e.prototype.updateBuildFile=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i;return s(this,(function(o){switch(o.label){case 0:return t=e.name.replace(/\W/g,""),[4,this.log("Updating "+this.entityName+"/build.json")];case 1:return o.sent(),n="src/"+this.entityName+"/build.json",r=String(l.readFileSync(n)),(i=JSON.parse(r)).forms.find((function(e){return e.name===t}))||(i.forms.push({name:t,build:!0}),c.ShellString(JSON.stringify(i,null,2)).to(n),c.exec("git add "+n)),[4,this.log("Updated "+this.entityName+"/build.json")];case 2:return o.sent(),[2]}}))}))},e.prototype.getSystemForms=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return e=[],[4,d.SolutionService.getSolution(["solutionid"],this.bearer)];case 1:return t=s.sent(),[4,p.SolutionComponentService.retrieveMultipleRecords({select:["objectid"],filters:[{conditions:[{attribute:"_solutionid_value",value:t.solutionid}]},{type:"or",conditions:[{attribute:"componenttype",value:24},{attribute:"componenttype",value:60}]}]},this.bearer)];case 2:n=s.sent(),r=0,i=n,s.label=3;case 3:return rForm \''+a.name+"' found")]);case 5:s.sent(),s.label=6;case 6:return r++,[3,3];case 7:return[2,e]}}))}))},e}();t.Form=m},506: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(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 s=a(n(563)),u=o(n(524)),c=n(446),l=n(751),f=n(42),d=n(636),p=n(722),h=function(){function e(){}return e.generate=function(e,t){if(u.test("-e","src"))if(e)if(["entity","webresource","model","licensevalidator","environmentvariable"].includes(e.toLowerCase())){if("entity"===e.toLowerCase())return c.Entity.generateEntity(t);if("webresource"===e.toLowerCase())return l.Webresource.generateWebresource(t);if("model"===e.toLocaleLowerCase())return f.ModelRouter.generateModel(t);if("licensevalidator"===e.toLowerCase())return p.LicenseValidator.generateLicenseValidator(t);if("environmentvariable"===e.toLowerCase())return d.EnvironmentVariable.generateEnvironmentVariable()}else console.log(s.default.red("Schematic "+e+" not supported!"));else console.log(s.default.red("No schematic specified!"));else console.log(s.default.red("You are not inside the project Webresources folder!"))},e.showGenerateHelp=function(){console.log("Arguments:"),console.log(" "+s.default.blue("schematic")),console.log(" The schematic or collection:schematic to generate."),console.log(" Example: Entity, Webresource or LicenseValidator.")},e}();t.Generator=h},722: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]","ig"),e,"src/License/"+o),l.sed("-i",new RegExp("<%= publisher %>","ig"),n,"src/License/"+o),l.sed("-i",new RegExp("<%= namespace %>","ig"),r,"src/License/"+o)})),i=l.ls("webpack.config.ts")[0],l.sed("-i","entry: {",'entry: {\n LicenseValidator: [\n path.resolve(__dirname, "src/License/Validator.ts")\n ],',i),l.exec("git add webpack.config.ts"),console.log("Adding D365 License Validator done"),[2]}}))}))},e}();t.LicenseValidator=d},979: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]")];case 1:return s.sent(),e="src/"+this.entityName+"/"+this.entityName+".model.ts",u.cp("-r",__dirname+"/Entity/Entity.model.ts","src/"+this.entityName),u.cp("-r","src/"+this.entityName+"/Entity.model.ts",e),u.rm("-rf","src/"+this.entityName+"/Entity.model.ts"),u.sed("-i",new RegExp("Entity","g"),this.entityName,e),u.exec("git add "+e),t=String(c.readFileSync(e)),[4,this.getAttributeInterfaceTypes()];case 2:return n=s.sent(),[4,this.getRelationshipInterfaceTypes()];case 3:return r=s.sent(),[4,this.getImportStrings(r)];case 4:return i=s.sent(),[4,this.getTypeStrings()];case 5:return o=s.sent(),[4,this.getAttributesString(n,r)];case 6:return a=s.sent(),l=a,[4,this.getRelationshipsString(r,n)];case 7:return a=l+s.sent(),f=a,[4,this.getCombinedAttributeRelationshipString(n,r)];case 8:return a=f+s.sent(),d=this.entityName+"Model extends Model {",t=t.replace(d,""+d+a),p="interface",t=t.replace(p,""+i+o+p),u.ShellString(t).to(e),[4,this.log("Generated "+this.entityName+".model.ts
")];case 9:return s.sent(),[2]}}))}))},e.prototype.getImportStrings=function(t){return a(this,void 0,void 0,(function(){var n,r,i,o,a,c,l;return s(this,(function(s){switch(s.label){case 0:n="",r=0,i=Object.keys(t),s.label=1;case 1:return rNavigationProperty \''+o+"' generated
\n Referenced model '"+c+"Model' not found.
\n Add referenced entity '"+c+'\' by following cli command:
\n hso-d365 generate Entity '+c+'
\n And regenerate \''+this.entityName+'\' by following cli command:
\n hso-d365 generate Entity '+this.entityName+"
\n ")];case 3:s.sent(),s.label=4;case 4:return r++,[3,1];case 5:return[2,n]}}))}))},e.prototype.getCombinedAttributeRelationshipString=function(t,n){return a(this,void 0,void 0,(function(){var r,i,o,a,c,l,f,d,p,h;return s(this,(function(s){switch(s.label){case 0:r="",i=Object.keys(t),o=0,a=Object.keys(n),s.label=1;case 1:return o")];case 5:s.sent(),s.label=6;case 6:return n++,[3,2];case 7:return[2,t]}}))}))},e.prototype.getInterfaceType=function(e){return a(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=e.AttributeType,n=e.SchemaName,["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,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,l.NodeApi.getStatusOptionSet(this.entityLogicalName,this.bearer)]:[3,6];case 5:return[2,r.sent().map((function(e){return e.value})).join(" | ")];case 6:return["State"].includes(t)?[4,l.NodeApi.getStateOptionSet(this.entityLogicalName,this.bearer)]:[3,8];case 7:return[2,r.sent().map((function(e){return e.value})).join(" | ")];case 8:return[2]}}))}))},e.prototype.getTypeStrings=function(){return a(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,u,c,f;return s(this,(function(s){switch(s.label){case 0:return e="",[4,l.NodeApi.getAttributesMetadata(this.entityLogicalName,this.bearer)];case 1:t=s.sent(),n=0,r=t,s.label=2;case 2:return n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]","ig"),i,"src/"+e+"/"+a),l.sed("-i",new RegExp("<%= namespace %>","ig"),o,"src/"+e+"/"+a),l.exec("git add src/"+e+"/"+a)})),[2]}}))}))},e.addBuildFile=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i;return s(this,(function(o){return console.log("Adding "+e+"/build.json"),n="src/"+e+"/build.json",l.cp("-r",__dirname+"/Entity/build.json",n),r=String(d.readFileSync(n)),(i=JSON.parse(r)).webresources.find((function(t){return t.name===e}))||(i.webresources.push({name:e,build:!0,template:t.template}),l.ShellString(JSON.stringify(i,null,2)).to(n)),l.exec("git add "+n),console.log("Added "+e+"/build.json"),[2]}))}))},e}();t.Webresource=h},497: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] [options]"),l.default.command("new ").alias("n").description("Creates a new workspace and an initial Webresource setup").action((function(e){f.Create.createProject(e)})).on("--help",(function(){f.Create.showCreateHelp()})),l.default.command("generate [name]").alias("g").description("Generates and/or modifies files bases on a schematic.").action((function(e,t){p.Generator.generate(e,t)})).on("--help",(function(){p.Generator.showGenerateHelp()})),l.default.command("extractTranslations").alias("extract").description("Extracts translation to resx files").action((function(){y.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.")})),l.default.command("lint").alias("l").description("Runs linting tools on project code").action((function(){c.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")})),l.default.command("build").alias("b").description("Compiles project into an output directory named dist").action((function(){c.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")})),l.default.command("deploy").option("-f, --force","Force unmodified files as well").description("Invokes the deploy builder").action((function(e){var t=e.force;b.Deploy.deployProject(t)})).on("--help",(function(){console.log("Distributes the project to the D365 environment. You need to run the 'build' command first")})),l.default.command("update").alias("u").description("Updates existing workspace and Webresource setup").action((function(){d.Update.updateProject()})).on("--help",(function(){d.Update.showUpdateHelp()})),l.default.command("setFormCustomizable ").alias("f").description("Sets the Solution forms iscustomizable/canbedeleted true/false").action((function(e){new m.SetFormCustomizable("true"===e)})).on("--help",(function(){console.log("Sets the Solution forms iscustomizable/canbedeleted true/false")})),l.default.command("showFiddlerRule").alias("fiddler").description("Show the Fiddler AutoResponder Rule Editor lines").action((function(){return a(void 0,void 0,void 0,(function(){var e,t,n,r,i,o;return s(this,(function(a){switch(a.label){case 0:return[4,h.Variables.get()];case 1:return e=a.sent(),t=e.publisher,n=e.namespace,r="REGEX:(?insx).+\\/"+t+"_\\/"+n+"\\/(?'foldername'[^?]*)\\/(?'fname'[^?]*.js)",i=process.cwd(),o=i+"\\dist\\"+t+"_\\"+n+"\\${foldername}\\${fname}",console.log("Please add to first Rule Editor line (including REGEX:): \n"+r),console.log("Please add to second Rule Editor line: \n"+o),[2]}}))}))})),l.default.arguments("").action((function(){l.default.outputHelp(),console.log(""),console.log("echo Unknown command!")})),l.default.parse(process.argv)},145: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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=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 i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\n Login\n \n \n