@things-factory/operato-tools 6.1.1 → 6.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';const a0_0x3edf84=a0_0x2cf1;(function(_0x1bf9ac,_0x20763a){const _0x56859c=a0_0x2cf1,_0x26f6c9=_0x1bf9ac();while(!![]){try{const _0x178d1d=parseInt(_0x56859c(0x1f5))/0x1*(parseInt(_0x56859c(0x200))/0x2)+-parseInt(_0x56859c(0x1f7))/0x3+-parseInt(_0x56859c(0x1fc))/0x4*(parseInt(_0x56859c(0x1f9))/0x5)+parseInt(_0x56859c(0x202))/0x6+-parseInt(_0x56859c(0x1fd))/0x7+-parseInt(_0x56859c(0x201))/0x8+-parseInt(_0x56859c(0x1fb))/0x9*(-parseInt(_0x56859c(0x1f4))/0xa);if(_0x178d1d===_0x20763a)break;else _0x26f6c9['push'](_0x26f6c9['shift']());}catch(_0xa8f292){_0x26f6c9['push'](_0x26f6c9['shift']());}}}(a0_0x3f82,0x704d4));Object[a0_0x3edf84(0x204)](exports,a0_0x3edf84(0x205),{'value':!0x0}),exports[a0_0x3edf84(0x1f3)]=void 0x0;const tslib_1=require(a0_0x3edf84(0x1f8)),ERROR_CODES=tslib_1[a0_0x3edf84(0x1ff)](require(a0_0x3edf84(0x1f6)));class LicenseError extends Error{static get['ERROR_CODES'](){return Object['assign']({},ERROR_CODES);}constructor({errorCode:_0x2752d5,detail:_0x101cad}){const _0xfa2261=a0_0x3edf84;super(_0x2752d5),this[_0xfa2261(0x203)]=_0xfa2261(0x1fa),this[_0xfa2261(0x1fe)]=_0x2752d5,this['detail']=_0x101cad;}}function a0_0x2cf1(_0x4571ed,_0x4724b6){const _0x3f8221=a0_0x3f82();return a0_0x2cf1=function(_0x2cf1c2,_0x5ea20f){_0x2cf1c2=_0x2cf1c2-0x1f3;let _0x474a2d=_0x3f8221[_0x2cf1c2];return _0x474a2d;},a0_0x2cf1(_0x4571ed,_0x4724b6);}exports[a0_0x3edf84(0x1f3)]=LicenseError;function a0_0x3f82(){const _0x48fe7e=['4487028JHAaiX','name','defineProperty','__esModule','LicenseError','400eKfarY','1391QzeuIP','../constants/error-code','2675091IoCwvP','tslib','2145xaECWJ','license-error','324783MPVJGq','3444gYXVhW','772590TVkANA','errorCode','__importStar','566AuCCTW','6028376tBMIrr'];a0_0x3f82=function(){return _0x48fe7e;};return a0_0x3f82();}
1
+ 'use strict';function a0_0x594a(_0x11a65c,_0x57bfa9){const _0x38acff=a0_0x38ac();return a0_0x594a=function(_0x594aa9,_0x204532){_0x594aa9=_0x594aa9-0x19c;let _0x5a23c2=_0x38acff[_0x594aa9];return _0x5a23c2;},a0_0x594a(_0x11a65c,_0x57bfa9);}const a0_0x1d1b05=a0_0x594a;function a0_0x38ac(){const _0x4892ef=['18166689xyZqao','LicenseError','__importStar','1402946njfFPk','errorCode','tslib','5657496MchaFg','4DbZSbD','1991794uPcakg','4160105EzduiD','name','defineProperty','1lwmlSq','239823BbDoSk','assign','license-error','detail','__esModule','6516WDoJJe','10JqHAhe','ERROR_CODES'];a0_0x38ac=function(){return _0x4892ef;};return a0_0x38ac();}(function(_0x3389bd,_0x15443a){const _0x4553ee=a0_0x594a,_0x1a3826=_0x3389bd();while(!![]){try{const _0x5b66e2=-parseInt(_0x4553ee(0x1a1))/0x1*(-parseInt(_0x4553ee(0x1ad))/0x2)+parseInt(_0x4553ee(0x1a2))/0x3+parseInt(_0x4553ee(0x19c))/0x4*(parseInt(_0x4553ee(0x19e))/0x5)+parseInt(_0x4553ee(0x1a7))/0x6+parseInt(_0x4553ee(0x19d))/0x7+parseInt(_0x4553ee(0x1b0))/0x8+-parseInt(_0x4553ee(0x1aa))/0x9*(parseInt(_0x4553ee(0x1a8))/0xa);if(_0x5b66e2===_0x15443a)break;else _0x1a3826['push'](_0x1a3826['shift']());}catch(_0x4c49b3){_0x1a3826['push'](_0x1a3826['shift']());}}}(a0_0x38ac,0x8f7d1));Object[a0_0x1d1b05(0x1a0)](exports,a0_0x1d1b05(0x1a6),{'value':!0x0}),exports[a0_0x1d1b05(0x1ab)]=void 0x0;const tslib_1=require(a0_0x1d1b05(0x1af)),ERROR_CODES=tslib_1[a0_0x1d1b05(0x1ac)](require('../constants/error-code'));class LicenseError extends Error{static get[a0_0x1d1b05(0x1a9)](){const _0x3a9926=a0_0x1d1b05;return Object[_0x3a9926(0x1a3)]({},ERROR_CODES);}constructor({errorCode:_0x444a71,detail:_0x416f2d}){const _0x55cd8c=a0_0x1d1b05;super(_0x444a71),this[_0x55cd8c(0x19f)]=_0x55cd8c(0x1a4),this[_0x55cd8c(0x1ae)]=_0x444a71,this[_0x55cd8c(0x1a5)]=_0x416f2d;}}exports[a0_0x1d1b05(0x1ab)]=LicenseError;
package/server/routes.js CHANGED
@@ -1 +1 @@
1
- const a0_0x1dd65d=a0_0x4bb8;(function(_0x2bfeef,_0x316bae){const _0x4d3583=a0_0x4bb8,_0x5d590a=_0x2bfeef();while(!![]){try{const _0xa7531a=-parseInt(_0x4d3583(0x1ad))/0x1*(-parseInt(_0x4d3583(0x1b1))/0x2)+-parseInt(_0x4d3583(0x1b0))/0x3*(-parseInt(_0x4d3583(0x1b6))/0x4)+parseInt(_0x4d3583(0x1af))/0x5+parseInt(_0x4d3583(0x1ac))/0x6+parseInt(_0x4d3583(0x1b7))/0x7*(parseInt(_0x4d3583(0x1b5))/0x8)+-parseInt(_0x4d3583(0x1b4))/0x9+-parseInt(_0x4d3583(0x1ae))/0xa;if(_0xa7531a===_0x316bae)break;else _0x5d590a['push'](_0x5d590a['shift']());}catch(_0x1af5d7){_0x5d590a['push'](_0x5d590a['shift']());}}}(a0_0x1607,0x2ddca));function a0_0x1607(){const _0x212651=['things-factory:operato-tools:routes','bootstrap-module-domain-private-route','2723049fUQGiu','8VUhSHc','4OlSQKs','879347xQLRWH','1795266PqqFAN','1Ppsczo','618850rHtoHz','247280Qojaqa','194853BFVmsp','26114ABRNfh'];a0_0x1607=function(){return _0x212651;};return a0_0x1607();}function a0_0x4bb8(_0x47a726,_0x170d51){const _0x1607af=a0_0x1607();return a0_0x4bb8=function(_0x4bb8f0,_0x2fce31){_0x4bb8f0=_0x4bb8f0-0x1ac;let _0x136f59=_0x1607af[_0x4bb8f0];return _0x136f59;},a0_0x4bb8(_0x47a726,_0x170d51);}const debug=require('debug')(a0_0x1dd65d(0x1b2));process['on']('bootstrap-module-global-public-route',(_0x47cf1d,_0x28367d)=>{}),process['on']('bootstrap-module-global-private-route',(_0x452b91,_0x2a9d13)=>{}),process['on']('bootstrap-module-domain-public-route',(_0xe9e2c2,_0x4f7c5f)=>{}),process['on'](a0_0x1dd65d(0x1b3),(_0x19b3c0,_0x4193a6)=>{});
1
+ const a0_0x5940e4=a0_0x29c5;function a0_0x29c5(_0x1ee573,_0x5167de){const _0x11712e=a0_0x1171();return a0_0x29c5=function(_0x29c55f,_0x3597d4){_0x29c55f=_0x29c55f-0x169;let _0x823b0a=_0x11712e[_0x29c55f];return _0x823b0a;},a0_0x29c5(_0x1ee573,_0x5167de);}(function(_0x21a2cb,_0x5cbedc){const _0x28d265=a0_0x29c5,_0x367f92=_0x21a2cb();while(!![]){try{const _0x589948=parseInt(_0x28d265(0x173))/0x1*(parseInt(_0x28d265(0x16c))/0x2)+-parseInt(_0x28d265(0x170))/0x3*(-parseInt(_0x28d265(0x169))/0x4)+-parseInt(_0x28d265(0x175))/0x5+-parseInt(_0x28d265(0x177))/0x6*(-parseInt(_0x28d265(0x16b))/0x7)+parseInt(_0x28d265(0x16e))/0x8*(parseInt(_0x28d265(0x171))/0x9)+parseInt(_0x28d265(0x16f))/0xa*(parseInt(_0x28d265(0x174))/0xb)+-parseInt(_0x28d265(0x178))/0xc*(parseInt(_0x28d265(0x16a))/0xd);if(_0x589948===_0x5cbedc)break;else _0x367f92['push'](_0x367f92['shift']());}catch(_0x549711){_0x367f92['push'](_0x367f92['shift']());}}}(a0_0x1171,0x9286e));const debug=require(a0_0x5940e4(0x17a))('things-factory:operato-tools:routes');function a0_0x1171(){const _0xa15df=['25821HPMqGd','bootstrap-module-global-private-route','367WvKtVy','3002010CXFYEG','215675lGnDYl','bootstrap-module-global-public-route','119904kwhBjS','60oomiUw','bootstrap-module-domain-private-route','debug','2086892FTcFRc','4756583FzKDfs','273WCKROb','2066KGFOPC','bootstrap-module-domain-public-route','688xrKKyZ','20WEnHBy','3jKMAFr'];a0_0x1171=function(){return _0xa15df;};return a0_0x1171();}process['on'](a0_0x5940e4(0x176),(_0x471bf9,_0x890217)=>{}),process['on'](a0_0x5940e4(0x172),(_0x5a6705,_0x1c7f96)=>{}),process['on'](a0_0x5940e4(0x16d),(_0x139df3,_0x101670)=>{}),process['on'](a0_0x5940e4(0x179),(_0x144847,_0x4611cd)=>{});
@@ -1 +1 @@
1
- 'use strict';const a0_0x19577b=a0_0x5a26;(function(_0x5bdb8e,_0x69f70e){const _0x14e4ee=a0_0x5a26,_0x58495f=_0x5bdb8e();while(!![]){try{const _0x140099=-parseInt(_0x14e4ee(0x19e))/0x1+-parseInt(_0x14e4ee(0x16c))/0x2*(parseInt(_0x14e4ee(0x187))/0x3)+-parseInt(_0x14e4ee(0x196))/0x4+-parseInt(_0x14e4ee(0x156))/0x5*(parseInt(_0x14e4ee(0x165))/0x6)+parseInt(_0x14e4ee(0x189))/0x7+-parseInt(_0x14e4ee(0x172))/0x8*(-parseInt(_0x14e4ee(0x155))/0x9)+parseInt(_0x14e4ee(0x16b))/0xa*(parseInt(_0x14e4ee(0x188))/0xb);if(_0x140099===_0x69f70e)break;else _0x58495f['push'](_0x58495f['shift']());}catch(_0x2493ed){_0x58495f['push'](_0x58495f['shift']());}}}(a0_0xf2bd,0x35814));function a0_0xf2bd(){const _0x3dd3b2=['EntityColumn','createSortCols','gridRank','routing','query','36fyiEoh','2846855bdNnCe','2404444xnDlSD','hex','lodash','aes-256-cfb','push','updater','filter','\x22,\x22hidden\x22:','left','refType','reverseSort','__importDefault','\x22,\x22width\x22:','843332EguWYK','string','{\x22name\x22:\x20\x22','getRepository','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','update','\x22,\x22header\x22:\x20\x22','@transaction','177915zEsQyR','pluralize','SCREEN','parent_menu_id','name','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','defineProperty',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','readonly','from','\x22,\x22operator\x22:\x20\x22','Resolver','design:returntype','aes256','aes-256-ecb','rank','toolCreateMenu','template','createSearchCols','design:paramtypes','hiddenFlag','find','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','Mutation','length','creator','Operato\x20Tool\x20Create\x20Menu','\x27\x20or\x20id\x20=\x20\x27','final','state','\x20,\x22exportable\x22:\x20true','Directive','refName','OperatoToolCreateMenu','split','checkStudioTemplateIsOverLimit','enc','Entity','prototype','substring','9VuKgCH','5gkeVCs',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','__metadata','resourceUrl','replace','design:type','updatedAt','assign','join','searchRank','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','__param','default',',\x22mandatory\x22:\x20','@things-factory/resource-base','1149324exjtKz','aes-256-ctr','./../tool-secret/tool-permission','stringify','updater_id','Menu','10alBLvE','1022rRDcOZ','crypto','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','Arg','hidden','sort','1626344yEjXyD','createCipheriv','sortRank','toString','updated_at','aes-256-ofb','{\x22name\x22:\x22','h1z0q9i9x7q6','utf8','searchOper','createGridColumns','aes-256-cbc','randomBytes','__decorate','created_at','\x22,\x22name\x22:\x20\x22'];a0_0xf2bd=function(){return _0x3dd3b2;};return a0_0xf2bd();}Object[a0_0x19577b(0x1a4)](exports,'__esModule',{'value':!0x0}),exports[a0_0x19577b(0x14e)]=void 0x0;function a0_0x5a26(_0x55b948,_0x52858a){const _0xf2bd48=a0_0xf2bd();return a0_0x5a26=function(_0x5a26a5,_0x9d291d){_0x5a26a5=_0x5a26a5-0x146;let _0x4f82f4=_0xf2bd48[_0x5a26a5];return _0x4f82f4;},a0_0x5a26(_0x55b948,_0x52858a);}const tslib_1=require('tslib'),type_graphql_1=require('type-graphql'),resource_base_1=require(a0_0x19577b(0x164)),menu_base_1=require('@things-factory/menu-base'),tool_permission_1=require(a0_0x19577b(0x167)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x19577b(0x18b)),{plural:plural}=require(a0_0x19577b(0x19f)),crypto_1=tslib_1[a0_0x19577b(0x194)](require(a0_0x19577b(0x16d)));let OperatoToolCreateMenu=class{async[a0_0x19577b(0x1ae)](_0x4f8a4e,_0x572bf5,_0x275bc3){const _0x3ab605=a0_0x19577b,{domain:_0x2ca341,user:_0xa2fb5f,tx:_0x1fc7fd}=_0x275bc3[_0x3ab605(0x14a)];await(0x0,tool_permission_1[_0x3ab605(0x150)])('',_0x275bc3);const _0x4f6ddf=await _0x1fc7fd[_0x3ab605(0x199)](resource_base_1[_0x3ab605(0x152)])['findOne']({'where':{'domain':{'id':_0x2ca341['id']},'id':_0x4f8a4e}}),_0x48da34=await _0x1fc7fd['getRepository'](resource_base_1[_0x3ab605(0x182)])[_0x3ab605(0x1b3)]({'where':{'domain':{'id':_0x2ca341['id']},'entity':{'id':_0x4f6ddf['id']}}});let {name:_0x4d6869=''}=_0x4f6ddf||{},_0xb390df=kebabCase(_0x4d6869),_0x35a557=modelTemplate[_0x3ab605(0x15a)](/{{pascalCase name}}/g,startCase(camelCase(_0x4d6869))['replace'](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x4d6869))[_0x3ab605(0x15a)](/{{snakeCase name}}/g,snakeCase(_0x4d6869))[_0x3ab605(0x15a)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x4d6869)))[_0x3ab605(0x15a)](/ /g,''))[_0x3ab605(0x15a)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x4d6869)))['replace'](/{{name}}/g,_0x4d6869),_0x519f66='';'JSON'==_0x4f6ddf['dataProp']?_0x519f66='\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20':'COPY'==_0x4f6ddf['dataProp']&&(_0x519f66=_0x3ab605(0x1b4)),_0x35a557=_0x35a557[_0x3ab605(0x15a)](/{{HistoryButton}}/g,_0x519f66);let _0x39dea1=this['createSortCols'](_0x48da34);_0x35a557=_0x35a557[_0x3ab605(0x15a)](/{{SortColumns}}/g,_0x39dea1[_0x3ab605(0x15e)](','));let _0x297033=this['createSearchCols'](_0x48da34);_0x35a557=_0x35a557[_0x3ab605(0x15a)](/{{SearchColumns}}/g,_0x297033['join'](','));let _0x4fb33d=this[_0x3ab605(0x17c)](_0x48da34);return _0x35a557=_0x35a557[_0x3ab605(0x15a)](/{{GridColumns}}/g,_0x4fb33d['join'](',')),_0x35a557=this[_0x3ab605(0x151)](_0x35a557),await this['createMenuData'](_0x1fc7fd,_0x2ca341,_0xa2fb5f,_0x572bf5,_0xb390df,_0x35a557),!0x0;}[a0_0x19577b(0x17c)](_0x335be6){const _0x463efc=a0_0x19577b;return _0x335be6[_0x463efc(0x18f)](_0x2b75f6=>'id'!=_0x2b75f6['name']&&_0x2b75f6[_0x463efc(0x184)]>0x0)[_0x463efc(0x171)](function(_0x25ec70,_0x1c6bf7){const _0x115ef3=_0x463efc;return _0x25ec70[_0x115ef3(0x184)]-_0x1c6bf7[_0x115ef3(0x184)];})['map'](_0x1e5ed8=>{const _0x1090ab=_0x463efc;let {gridEditor:_0x246775='string',name:_0x1b3f20,term:_0x5a6bf6,gridWidth:_0x208642=0x0,gridAlign:_0x212f89=_0x1090ab(0x191),nullable:_0x58e1d6=!0x1}=_0x1e5ed8;if(null==_0x246775&&(_0x246775=_0x1090ab(0x197)),null==_0x212f89&&(_0x212f89=_0x1090ab(0x191)),_0x1090ab(0x169)==_0x1b3f20||'creator_id'==_0x1b3f20)return _0x1b3f20='updater_id'==_0x1b3f20?_0x1090ab(0x18e):_0x1090ab(0x146),'{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22'+_0x1b3f20+_0x1090ab(0x19c)+_0x1b3f20+_0x1090ab(0x160);if(_0x1090ab(0x176)==_0x1b3f20||_0x1090ab(0x180)==_0x1b3f20)return'{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22'+('updated_at'==_0x1b3f20?_0x1090ab(0x15c):'createdAt')+_0x1090ab(0x19c)+_0x1b3f20+_0x1090ab(0x19a);let _0x363a61=_0x1090ab(0x1a6)!=_0x246775&&_0x1090ab(0x170)!=_0x246775,_0x33388c='hidden'==_0x246775;0x1!=_0x33388c&&0x0!=_0x363a61||(_0x246775=_0x1090ab(0x197));let _0x3a8c28='{\x22type\x22:\x20\x22'+_0x246775+_0x1090ab(0x181)+camelCase(_0x1b3f20)+_0x1090ab(0x19c)+_0x5a6bf6+_0x1090ab(0x190)+_0x33388c+'\x20,\x22editable\x22:\x20'+_0x363a61+_0x1090ab(0x163)+!_0x58e1d6+_0x1090ab(0x157)+_0x212f89+_0x1090ab(0x195)+_0x208642+_0x1090ab(0x14b);return'code'==_0x1e5ed8[_0x1090ab(0x192)]&&(_0x3a8c28+=_0x1090ab(0x1a5)+_0x1e5ed8[_0x1090ab(0x14d)]+'\x22}'),'scenario'==_0x1e5ed8[_0x1090ab(0x192)]&&(_0x3a8c28+=',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22'+_0x1e5ed8['refName']+'\x22}'),'entity'==_0x1e5ed8[_0x1090ab(0x192)]&&(_0x3a8c28+=',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22'+camelCase(plural(_0x1e5ed8[_0x1090ab(0x14d)]))+_0x1090ab(0x1a3)),_0x3a8c28+='}',_0x3a8c28;});}[a0_0x19577b(0x1b0)](_0x4c6645){const _0x4d384e=a0_0x19577b;return _0x4c6645[_0x4d384e(0x18f)](_0x59a9b1=>_0x59a9b1['searchRank']>0x0)[_0x4d384e(0x171)](function(_0x44f11f,_0x239aa9){const _0x1fc600=_0x4d384e;return _0x44f11f[_0x1fc600(0x15f)]-_0x239aa9[_0x1fc600(0x15f)];})['map'](_0x3e7256=>{const _0x355140=_0x4d384e;let _0x411405=_0x3e7256[_0x355140(0x17b)];return _0x355140(0x18f)==_0x411405?'\x22'+camelCase(_0x3e7256[_0x355140(0x1a2)])+'\x22':(_0x411405||(_0x411405='eq'),_0x355140(0x198)+camelCase(_0x3e7256['name'])+_0x355140(0x1a8)+_0x411405+'\x22}');});}[a0_0x19577b(0x183)](_0xb3cad6){const _0x2803c3=a0_0x19577b;return _0xb3cad6[_0x2803c3(0x18f)](_0x142f10=>_0x142f10[_0x2803c3(0x174)]>0x0)[_0x2803c3(0x171)](function(_0x555246,_0x12a078){const _0x4c2df8=_0x2803c3;return _0x555246[_0x4c2df8(0x174)]-_0x12a078[_0x4c2df8(0x174)];})['map'](_0x788d6e=>_0x2803c3(0x178)+camelCase(_0x788d6e[_0x2803c3(0x1a2)])+'\x22,\x22desc\x22:'+_0x788d6e[_0x2803c3(0x193)]+'}');}async['createMenuData'](_0x30e1a7,_0x3dfa98,_0x4eab51,_0x189f0b,_0x3f70f0,_0x54d092){const _0xb720c9=a0_0x19577b;let _0x1d58c3=await _0x30e1a7[_0xb720c9(0x199)](menu_base_1['Menu'])['findOne']({'where':{'domain':{'id':_0x3dfa98['id']},'id':_0x189f0b}}),_0x5ee579=(await _0x30e1a7[_0xb720c9(0x199)](menu_base_1[_0xb720c9(0x16a)])[_0xb720c9(0x186)](_0xb720c9(0x16e)+_0x189f0b+_0xb720c9(0x148)+_0x189f0b+'\x27'))[0x0][_0xb720c9(0x1ad)]+0xa,_0x2adc55=new menu_base_1[(_0xb720c9(0x16a))]();_0x2adc55[_0xb720c9(0x1a2)]=_0x3f70f0,_0x2adc55['menuType']=_0xb720c9(0x1a0),_0x2adc55['category']='meta-grist-page',_0x2adc55[_0xb720c9(0x1ad)]=_0x5ee579,_0x2adc55[_0xb720c9(0x1b2)]=!0x1,_0x2adc55[_0xb720c9(0x185)]=_0x3f70f0,_0x2adc55[_0xb720c9(0x1af)]=_0x54d092,_0x2adc55[_0xb720c9(0x159)]='@things-factory/meta-ui/client/pages/meta-grist-page',_0x2adc55['parent']=_0x1d58c3,await _0x30e1a7[_0xb720c9(0x199)](menu_base_1[_0xb720c9(0x16a)])['save'](Object[_0xb720c9(0x15d)](Object[_0xb720c9(0x15d)]({},_0x2adc55),{'domain':_0x3dfa98,'creator':_0x4eab51,'updater':_0x4eab51}));}['enc'](_0x1335ed){const _0x13f50f=a0_0x19577b;let _0x23fc18=JSON[_0x13f50f(0x168)](_0x1335ed)[_0x13f50f(0x14f)](/(.{100})/)['filter'](_0x49ae49=>_0x49ae49),_0x383654=[_0x13f50f(0x1ac),_0x13f50f(0x17d),_0x13f50f(0x18c),'aes-256-cfb8','aes-256-cfb1',_0x13f50f(0x177),_0x13f50f(0x166),_0x13f50f(0x1ab)],_0x56594d=crypto_1[_0x13f50f(0x162)][_0x13f50f(0x17e)](0x20)[_0x13f50f(0x175)](_0x13f50f(0x18a)),_0x931a1d=Buffer[_0x13f50f(0x1a7)](_0x56594d,_0x13f50f(0x18a)),_0x50f3bc=_0x56594d[_0x13f50f(0x154)](0x0,0x10),_0x38a30f=['',_0x50f3bc,_0x50f3bc,_0x50f3bc,_0x50f3bc,_0x50f3bc,_0x50f3bc,_0x50f3bc],_0x5728b4=0x0,_0x5300ca=[];_0x5300ca[_0x13f50f(0x18d)](_0x56594d);for(var _0x180525=0x0;_0x180525<_0x23fc18[_0x13f50f(0x1b6)];_0x180525++,_0x5728b4++){_0x5728b4==_0x383654['length']&&(_0x5728b4=0x0);let _0x94525f=crypto_1[_0x13f50f(0x162)][_0x13f50f(0x173)](_0x383654[_0x5728b4],_0x931a1d,_0x38a30f[_0x5728b4]),_0x533cef=_0x94525f[_0x13f50f(0x19b)](_0x23fc18[_0x180525],_0x13f50f(0x17a),_0x13f50f(0x18a));_0x533cef+=_0x94525f[_0x13f50f(0x149)](_0x13f50f(0x18a)),_0x5300ca[_0x13f50f(0x18d)](_0x533cef);}return _0x5300ca['join'](_0x13f50f(0x179));}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x19577b(0x14c)])(a0_0x19577b(0x19d)),(0x0,type_graphql_1[a0_0x19577b(0x1b5)])(_0x5572fe=>Boolean,{'description':a0_0x19577b(0x147)}),tslib_1[a0_0x19577b(0x161)](0x0,(0x0,type_graphql_1[a0_0x19577b(0x16f)])('id')),tslib_1[a0_0x19577b(0x161)](0x1,(0x0,type_graphql_1[a0_0x19577b(0x16f)])(a0_0x19577b(0x1a1))),tslib_1[a0_0x19577b(0x161)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1['__metadata'](a0_0x19577b(0x15b),Function),tslib_1[a0_0x19577b(0x158)](a0_0x19577b(0x1b1),[String,String,Object]),tslib_1[a0_0x19577b(0x158)](a0_0x19577b(0x1aa),Promise)],OperatoToolCreateMenu[a0_0x19577b(0x153)],a0_0x19577b(0x1ae),null),OperatoToolCreateMenu=tslib_1[a0_0x19577b(0x17f)]([(0x0,type_graphql_1[a0_0x19577b(0x1a9)])()],OperatoToolCreateMenu),exports[a0_0x19577b(0x14e)]=OperatoToolCreateMenu;const modelTemplate='\x0a{\x0a\x20\x20\x22menu\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22title\x22:\x20\x22{{name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22\x22,\x0a\x20\x20\x20\x20\x20\x20\x22desc\x22:\x20\x22\x22\x0a\x20\x20},\x0a\x20\x20\x22gql\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22query\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22list_func\x22:\x20\x22{{pluralCamelCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22find_one_func\x22:\x22{{camelCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22mutation\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22updateMultiple{{pascalCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22{{pascalCase\x20name}}Patch\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22delete\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22delete{{pluralPascalCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22button\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22export\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22add\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22delete\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22save\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20],\x0a\x20\x20\x22grid_column\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22string\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22header\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22hidden\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22editable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mandatory\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sortable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22align\x22:\x20\x22left\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22width\x22:\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22exportable\x22:\x20false\x0a\x20\x20\x20\x20\x20\x20},\x0a{{GridColumns}}\x0a\x20\x20],\x0a\x20\x20\x22grid\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22button\x22:[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{HistoryButton}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22option\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mobile_mode\x22:\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22desk_mode\x22:\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22use_row_checker\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22pages\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2020,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20100,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20300\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22view_mode\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22CARD\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sorters\x22:\x20[\x0a{{SortColumns}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20]\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22row\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple_select\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22click\x22:\x20\x22select-row-toggle\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22search\x22:\x20[\x0a{{SearchColumns}}\x0a\x20\x20]\x0a}\x0a';
1
+ 'use strict';const a0_0x1f6c0a=a0_0x3ced;(function(_0x2258b2,_0x12e52f){const _0x250b96=a0_0x3ced,_0x39c80c=_0x2258b2();while(!![]){try{const _0x79107a=parseInt(_0x250b96(0x17c))/0x1*(-parseInt(_0x250b96(0x164))/0x2)+-parseInt(_0x250b96(0x19d))/0x3*(parseInt(_0x250b96(0x16f))/0x4)+-parseInt(_0x250b96(0x188))/0x5*(-parseInt(_0x250b96(0x155))/0x6)+-parseInt(_0x250b96(0x163))/0x7*(parseInt(_0x250b96(0x16b))/0x8)+-parseInt(_0x250b96(0x14e))/0x9+parseInt(_0x250b96(0x17a))/0xa*(-parseInt(_0x250b96(0x152))/0xb)+parseInt(_0x250b96(0x1b7))/0xc*(parseInt(_0x250b96(0x17b))/0xd);if(_0x79107a===_0x12e52f)break;else _0x39c80c['push'](_0x39c80c['shift']());}catch(_0xdadccc){_0x39c80c['push'](_0x39c80c['shift']());}}}(a0_0x1ef0,0xcc819));Object[a0_0x1f6c0a(0x19c)](exports,a0_0x1f6c0a(0x1a7),{'value':!0x0}),exports[a0_0x1f6c0a(0x17d)]=void 0x0;const tslib_1=require(a0_0x1f6c0a(0x1b1)),type_graphql_1=require('type-graphql'),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require('@things-factory/menu-base'),tool_permission_1=require('./../tool-secret/tool-permission'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x1f6c0a(0x184)),{plural:plural}=require(a0_0x1f6c0a(0x156)),crypto_1=tslib_1[a0_0x1f6c0a(0x1ac)](require('crypto'));function a0_0x3ced(_0x12a3ac,_0x290ef4){const _0x1ef0b9=a0_0x1ef0();return a0_0x3ced=function(_0x3ced3c,_0x78d87e){_0x3ced3c=_0x3ced3c-0x148;let _0x51408f=_0x1ef0b9[_0x3ced3c];return _0x51408f;},a0_0x3ced(_0x12a3ac,_0x290ef4);}let OperatoToolCreateMenu=class{async[a0_0x1f6c0a(0x15f)](_0x3fc448,_0x36adcf,_0x3f2626){const _0x2c43a9=a0_0x1f6c0a,{domain:_0x593f18,user:_0x103c55,tx:_0xc8952f}=_0x3f2626[_0x2c43a9(0x14c)];await(0x0,tool_permission_1[_0x2c43a9(0x14f)])('',_0x3f2626);const _0x33b818=await _0xc8952f[_0x2c43a9(0x1b9)](resource_base_1[_0x2c43a9(0x1ab)])['findOne']({'where':{'domain':{'id':_0x593f18['id']},'id':_0x3fc448}}),_0x2c9ff3=await _0xc8952f['getRepository'](resource_base_1[_0x2c43a9(0x16c)])['find']({'where':{'domain':{'id':_0x593f18['id']},'entity':{'id':_0x33b818['id']}}});let {name:_0xeaa00=''}=_0x33b818||{},_0x2ac072=kebabCase(_0xeaa00),_0x3606ff=modelTemplate[_0x2c43a9(0x148)](/{{pascalCase name}}/g,startCase(camelCase(_0xeaa00))['replace'](/ /g,''))[_0x2c43a9(0x148)](/{{camelCase name}}/g,camelCase(_0xeaa00))[_0x2c43a9(0x148)](/{{snakeCase name}}/g,snakeCase(_0xeaa00))[_0x2c43a9(0x148)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0xeaa00)))[_0x2c43a9(0x148)](/ /g,''))['replace'](/{{pluralCamelCase name}}/g,camelCase(plural(_0xeaa00)))[_0x2c43a9(0x148)](/{{name}}/g,_0xeaa00),_0x55f1c1='';_0x2c43a9(0x14b)==_0x33b818[_0x2c43a9(0x16a)]?_0x55f1c1='\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20':'COPY'==_0x33b818[_0x2c43a9(0x16a)]&&(_0x55f1c1=_0x2c43a9(0x154)),_0x3606ff=_0x3606ff['replace'](/{{HistoryButton}}/g,_0x55f1c1);let _0x38c484=this['createSortCols'](_0x2c9ff3);_0x3606ff=_0x3606ff[_0x2c43a9(0x148)](/{{SortColumns}}/g,_0x38c484[_0x2c43a9(0x195)](','));let _0x8b608=this[_0x2c43a9(0x180)](_0x2c9ff3);_0x3606ff=_0x3606ff['replace'](/{{SearchColumns}}/g,_0x8b608[_0x2c43a9(0x195)](','));let _0x3f4185=this[_0x2c43a9(0x177)](_0x2c9ff3);return _0x3606ff=_0x3606ff[_0x2c43a9(0x148)](/{{GridColumns}}/g,_0x3f4185[_0x2c43a9(0x195)](',')),_0x3606ff=this[_0x2c43a9(0x157)](_0x3606ff),await this[_0x2c43a9(0x1b6)](_0xc8952f,_0x593f18,_0x103c55,_0x36adcf,_0x2ac072,_0x3606ff),!0x0;}[a0_0x1f6c0a(0x177)](_0xa8e17f){const _0x1ab8a9=a0_0x1f6c0a;return _0xa8e17f[_0x1ab8a9(0x196)](_0x451119=>'id'!=_0x451119[_0x1ab8a9(0x18a)]&&_0x451119['gridRank']>0x0)[_0x1ab8a9(0x14d)](function(_0x15d430,_0x25855f){const _0x16c718=_0x1ab8a9;return _0x15d430[_0x16c718(0x1aa)]-_0x25855f['gridRank'];})[_0x1ab8a9(0x15e)](_0x597416=>{const _0x1cf8dc=_0x1ab8a9;let {gridEditor:_0x1fcb2f=_0x1cf8dc(0x192),name:_0x50d4b9,term:_0x5e3f02,gridWidth:_0x474141=0x0,gridAlign:_0x1ad682=_0x1cf8dc(0x166),nullable:_0x598007=!0x1}=_0x597416;if(null==_0x1fcb2f&&(_0x1fcb2f=_0x1cf8dc(0x192)),null==_0x1ad682&&(_0x1ad682=_0x1cf8dc(0x166)),_0x1cf8dc(0x19a)==_0x50d4b9||_0x1cf8dc(0x1ae)==_0x50d4b9)return _0x50d4b9=_0x1cf8dc(0x19a)==_0x50d4b9?_0x1cf8dc(0x150):_0x1cf8dc(0x17e),_0x1cf8dc(0x1a5)+_0x50d4b9+'\x22,\x22header\x22:\x20\x22'+_0x50d4b9+_0x1cf8dc(0x15c);if('updated_at'==_0x50d4b9||_0x1cf8dc(0x178)==_0x50d4b9)return'{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22'+(_0x1cf8dc(0x149)==_0x50d4b9?_0x1cf8dc(0x1b5):'createdAt')+_0x1cf8dc(0x18f)+_0x50d4b9+_0x1cf8dc(0x197);let _0x248063=_0x1cf8dc(0x193)!=_0x1fcb2f&&_0x1cf8dc(0x171)!=_0x1fcb2f,_0x5f9461='hidden'==_0x1fcb2f;0x1!=_0x5f9461&&0x0!=_0x248063||(_0x1fcb2f=_0x1cf8dc(0x192));let _0x302593='{\x22type\x22:\x20\x22'+_0x1fcb2f+'\x22,\x22name\x22:\x20\x22'+camelCase(_0x50d4b9)+_0x1cf8dc(0x18f)+_0x5e3f02+_0x1cf8dc(0x198)+_0x5f9461+_0x1cf8dc(0x158)+_0x248063+_0x1cf8dc(0x18e)+!_0x598007+_0x1cf8dc(0x172)+_0x1ad682+_0x1cf8dc(0x165)+_0x474141+_0x1cf8dc(0x1b3);return'code'==_0x597416[_0x1cf8dc(0x173)]&&(_0x302593+=',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22'+_0x597416[_0x1cf8dc(0x1a8)]+'\x22}'),_0x1cf8dc(0x1b2)==_0x597416[_0x1cf8dc(0x173)]&&(_0x302593+=_0x1cf8dc(0x15b)+_0x597416[_0x1cf8dc(0x1a8)]+'\x22}'),_0x1cf8dc(0x182)==_0x597416[_0x1cf8dc(0x173)]&&(_0x302593+=',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22'+camelCase(plural(_0x597416[_0x1cf8dc(0x1a8)]))+'\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}'),_0x302593+='}',_0x302593;});}[a0_0x1f6c0a(0x180)](_0x540045){const _0x3c59df=a0_0x1f6c0a;return _0x540045[_0x3c59df(0x196)](_0x3b593e=>_0x3b593e[_0x3c59df(0x185)]>0x0)['sort'](function(_0x10ca69,_0x482ebc){const _0x5f452f=_0x3c59df;return _0x10ca69[_0x5f452f(0x185)]-_0x482ebc[_0x5f452f(0x185)];})[_0x3c59df(0x15e)](_0x59fa31=>{const _0x34df5b=_0x3c59df;let _0x46fd35=_0x59fa31[_0x34df5b(0x183)];return'filter'==_0x46fd35?'\x22'+camelCase(_0x59fa31[_0x34df5b(0x18a)])+'\x22':(_0x46fd35||(_0x46fd35='eq'),_0x34df5b(0x1a2)+camelCase(_0x59fa31[_0x34df5b(0x18a)])+_0x34df5b(0x16d)+_0x46fd35+'\x22}');});}[a0_0x1f6c0a(0x16e)](_0x211781){const _0x210411=a0_0x1f6c0a;return _0x211781[_0x210411(0x196)](_0x21e683=>_0x21e683['sortRank']>0x0)[_0x210411(0x14d)](function(_0x24e8d0,_0x14938e){const _0xd5cbe6=_0x210411;return _0x24e8d0[_0xd5cbe6(0x1a4)]-_0x14938e['sortRank'];})[_0x210411(0x15e)](_0x2974b2=>'{\x22name\x22:\x22'+camelCase(_0x2974b2[_0x210411(0x18a)])+_0x210411(0x170)+_0x2974b2['reverseSort']+'}');}async[a0_0x1f6c0a(0x1b6)](_0x663b45,_0x50730b,_0x149be0,_0x1bc674,_0x2d3353,_0xdf7850){const _0x18ec43=a0_0x1f6c0a;let _0x1b6c5f=await _0x663b45[_0x18ec43(0x1b9)](menu_base_1[_0x18ec43(0x1a0)])[_0x18ec43(0x18d)]({'where':{'domain':{'id':_0x50730b['id']},'id':_0x1bc674}}),_0x4b2fe6=(await _0x663b45[_0x18ec43(0x1b9)](menu_base_1[_0x18ec43(0x1a0)])[_0x18ec43(0x179)](_0x18ec43(0x176)+_0x1bc674+'\x27\x20or\x20id\x20=\x20\x27'+_0x1bc674+'\x27'))[0x0]['rank']+0xa,_0x3b0202=new menu_base_1[(_0x18ec43(0x1a0))]();_0x3b0202[_0x18ec43(0x18a)]=_0x2d3353,_0x3b0202['menuType']=_0x18ec43(0x15a),_0x3b0202['category']=_0x18ec43(0x194),_0x3b0202[_0x18ec43(0x191)]=_0x4b2fe6,_0x3b0202[_0x18ec43(0x169)]=!0x1,_0x3b0202[_0x18ec43(0x159)]=_0x2d3353,_0x3b0202[_0x18ec43(0x1a1)]=_0xdf7850,_0x3b0202[_0x18ec43(0x167)]='@things-factory/meta-ui/client/pages/meta-grist-page',_0x3b0202[_0x18ec43(0x160)]=_0x1b6c5f,await _0x663b45[_0x18ec43(0x1b9)](menu_base_1[_0x18ec43(0x1a0)])[_0x18ec43(0x151)](Object[_0x18ec43(0x162)](Object[_0x18ec43(0x162)]({},_0x3b0202),{'domain':_0x50730b,'creator':_0x149be0,'updater':_0x149be0}));}['enc'](_0x100881){const _0x5a8aca=a0_0x1f6c0a;let _0x558aac=JSON['stringify'](_0x100881)[_0x5a8aca(0x19f)](/(.{100})/)['filter'](_0x2bffbe=>_0x2bffbe),_0x438ff7=['aes-256-ecb',_0x5a8aca(0x14a),_0x5a8aca(0x1b0),_0x5a8aca(0x1a6),'aes-256-cfb1',_0x5a8aca(0x1a9),_0x5a8aca(0x187),_0x5a8aca(0x175)],_0x210d21=crypto_1['default']['randomBytes'](0x20)[_0x5a8aca(0x161)](_0x5a8aca(0x19e)),_0x21c83a=Buffer['from'](_0x210d21,_0x5a8aca(0x19e)),_0x545b71=_0x210d21['substring'](0x0,0x10),_0x1c549c=['',_0x545b71,_0x545b71,_0x545b71,_0x545b71,_0x545b71,_0x545b71,_0x545b71],_0x165197=0x0,_0x382376=[];_0x382376[_0x5a8aca(0x18c)](_0x210d21);for(var _0x372592=0x0;_0x372592<_0x558aac[_0x5a8aca(0x181)];_0x372592++,_0x165197++){_0x165197==_0x438ff7[_0x5a8aca(0x181)]&&(_0x165197=0x0);let _0x3b952d=crypto_1[_0x5a8aca(0x1af)][_0x5a8aca(0x186)](_0x438ff7[_0x165197],_0x21c83a,_0x1c549c[_0x165197]),_0x3b0183=_0x3b952d['update'](_0x558aac[_0x372592],_0x5a8aca(0x168),_0x5a8aca(0x19e));_0x3b0183+=_0x3b952d['final'](_0x5a8aca(0x19e)),_0x382376[_0x5a8aca(0x18c)](_0x3b0183);}return _0x382376[_0x5a8aca(0x195)](_0x5a8aca(0x199));}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x1f6c0a(0x18b)])('@transaction'),(0x0,type_graphql_1['Mutation'])(_0x2af42e=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Menu'}),tslib_1[a0_0x1f6c0a(0x153)](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1[a0_0x1f6c0a(0x153)](0x1,(0x0,type_graphql_1[a0_0x1f6c0a(0x1b4)])(a0_0x1f6c0a(0x190))),tslib_1[a0_0x1f6c0a(0x153)](0x2,(0x0,type_graphql_1[a0_0x1f6c0a(0x17f)])()),tslib_1[a0_0x1f6c0a(0x1ad)](a0_0x1f6c0a(0x15d),Function),tslib_1[a0_0x1f6c0a(0x1ad)](a0_0x1f6c0a(0x189),[String,String,Object]),tslib_1['__metadata'](a0_0x1f6c0a(0x1b8),Promise)],OperatoToolCreateMenu['prototype'],a0_0x1f6c0a(0x15f),null),OperatoToolCreateMenu=tslib_1[a0_0x1f6c0a(0x174)]([(0x0,type_graphql_1[a0_0x1f6c0a(0x1a3)])()],OperatoToolCreateMenu),exports[a0_0x1f6c0a(0x17d)]=OperatoToolCreateMenu;function a0_0x1ef0(){const _0x934921=['SCREEN',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','design:type','map','toolCreateMenu','parent','toString','assign','1087121nZFaWe','2ZJZWkf','\x22,\x22width\x22:','left','resourceUrl','utf8','hiddenFlag','dataProp','80XRDdUK','EntityColumn','\x22,\x22operator\x22:\x20\x22','createSortCols','68XxGSnk','\x22,\x22desc\x22:','hidden',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','refType','__decorate','aes256','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','createGridColumns','created_at','query','290fGGXXO','91LrsdoB','1544306KEQxES','OperatoToolCreateMenu','creator','Ctx','createSearchCols','length','entity','searchOper','lodash','searchRank','createCipheriv','aes-256-ctr','200OIeTWC','design:paramtypes','name','Directive','push','findOne',',\x22mandatory\x22:\x20','\x22,\x22header\x22:\x20\x22','parent_menu_id','rank','string','readonly','meta-grist-page','join','filter','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','\x22,\x22hidden\x22:','h1z0q9i9x7q6','updater_id','\x0a{\x0a\x20\x20\x22menu\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22title\x22:\x20\x22{{name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22\x22,\x0a\x20\x20\x20\x20\x20\x20\x22desc\x22:\x20\x22\x22\x0a\x20\x20},\x0a\x20\x20\x22gql\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22query\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22list_func\x22:\x20\x22{{pluralCamelCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22find_one_func\x22:\x22{{camelCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22mutation\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22updateMultiple{{pascalCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22{{pascalCase\x20name}}Patch\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22delete\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22delete{{pluralPascalCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22button\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22export\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22add\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22delete\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22save\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20],\x0a\x20\x20\x22grid_column\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22string\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22header\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22hidden\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22editable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mandatory\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sortable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22align\x22:\x20\x22left\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22width\x22:\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22exportable\x22:\x20false\x0a\x20\x20\x20\x20\x20\x20},\x0a{{GridColumns}}\x0a\x20\x20],\x0a\x20\x20\x22grid\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22button\x22:[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{HistoryButton}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22option\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mobile_mode\x22:\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22desk_mode\x22:\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22use_row_checker\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22pages\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2020,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20100,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20300\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22view_mode\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22CARD\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sorters\x22:\x20[\x0a{{SortColumns}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20]\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22row\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple_select\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22click\x22:\x20\x22select-row-toggle\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22search\x22:\x20[\x0a{{SearchColumns}}\x0a\x20\x20]\x0a}\x0a','defineProperty','293961nXrEFi','hex','split','Menu','template','{\x22name\x22:\x20\x22','Resolver','sortRank','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','aes-256-cfb8','__esModule','refName','aes-256-ofb','gridRank','Entity','__importDefault','__metadata','creator_id','default','aes-256-cfb','tslib','scenario','\x20,\x22exportable\x22:\x20true','Arg','updatedAt','createMenuData','11622828UsKCqB','design:returntype','getRepository','replace','updated_at','aes-256-cbc','JSON','state','sort','8867898eFDdQs','checkStudioTemplateIsOverLimit','updater','save','551551DRFJJY','__param','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','189030sfCAFx','pluralize','enc','\x20,\x22editable\x22:\x20','routing'];a0_0x1ef0=function(){return _0x934921;};return a0_0x1ef0();}const modelTemplate=a0_0x1f6c0a(0x19b);
@@ -1 +1 @@
1
- 'use strict';function a0_0x224c(_0x8c6a47,_0x7750bb){const _0x1079c4=a0_0x1079();return a0_0x224c=function(_0x224cd6,_0x5d1617){_0x224cd6=_0x224cd6-0xb3;let _0x45a9c5=_0x1079c4[_0x224cd6];return _0x45a9c5;},a0_0x224c(_0x8c6a47,_0x7750bb);}const a0_0x36a4a4=a0_0x224c;(function(_0x3b98a4,_0x139fa9){const _0x4b1e9c=a0_0x224c,_0x1825a1=_0x3b98a4();while(!![]){try{const _0x14edcf=-parseInt(_0x4b1e9c(0xd4))/0x1+parseInt(_0x4b1e9c(0xe6))/0x2+-parseInt(_0x4b1e9c(0xe7))/0x3+-parseInt(_0x4b1e9c(0xe5))/0x4+-parseInt(_0x4b1e9c(0xf4))/0x5*(parseInt(_0x4b1e9c(0xf3))/0x6)+-parseInt(_0x4b1e9c(0x13d))/0x7+parseInt(_0x4b1e9c(0xf6))/0x8;if(_0x14edcf===_0x139fa9)break;else _0x1825a1['push'](_0x1825a1['shift']());}catch(_0x44c91b){_0x1825a1['push'](_0x1825a1['shift']());}}}(a0_0x1079,0xe3994));function a0_0x1079(){const _0x4aa13b=['colType','/server','design:returntype','\x0aimport\x20{\x20EventSubscriber\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20HistoryEntitySubscriber\x20}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@EventSubscriber()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20extends\x20HistoryEntitySubscriber<{{pascalCase\x20name}},{{pascalCase\x20name}}History>\x20{\x0a\x20\x20public\x20get\x20entity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}\x0a\x20\x20}\x0a\x0a\x20\x20public\x20get\x20historyEntity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}History\x0a\x20\x20}\x0a\x0a\x20\x20{{entityToJson}}\x0a\x0a\x20\x20async\x20beforeRemoveHistory(history:{{pascalCase\x20name}}History,entity:{{pascalCase\x20name}}){\x0a\x20\x20\x20\x20let\x20repo\x20=\x20getRepository({{pascalCase\x20name}}History);\x0a\x20\x20\x20\x20const\x20revNo\x20=\x20await\x20repo.createQueryBuilder()\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.select(\x27max(data_revision_no)\x27,\x20\x27rev_no\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.where(\x27domain_id\x20=\x20:domainId\x27,\x20{\x20domainId:\x20entity.domain.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.andWhere(\x27original_id\x20=\x20:originalId\x27,\x20{\x20originalId:\x20entity.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.getRawOne()\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20history.dataRevisionNo\x20=\x20revNo\x20?\x20revNo.rev_no\x20+\x201\x20:\x201;\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a}\x0a','18XiGZSa','541690etmGPJ','__decorate','23336120Dkhzzk','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryList\x20}\x20from\x20\x27./{{name}}-history-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}}History)\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryQuery\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}History,\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}History(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}History>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}History).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}HistoryList,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}Histories(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}HistoryList>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}}History)\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}History.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.creatorId})\x0a\x20\x20}\x0a}\x0a','.ts','lodash','\x20})','utf8','/*\x20ENTITIES\x20*/\x0a\x09...','\x0a/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0a\x0a/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0a\x0aexport\x20const\x20entities\x20=\x20[\x20\x20\x0a\x20\x20/*\x20ENTITIES\x20*/\x0a]\x20\x0a\x0a\x0aexport\x20const\x20schema\x20=\x20{\x0a\x20\x20resolverClasses:\x20[\x0a\x20\x20\x20\x20/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x20\x20]\x20\x0a}\x0a\x0aexport\x20const\x20subscribers\x20=\x20[\x0a\x20\x20/*\x20SUBSCRIBERS\x20*/\x0a]\x0a','Resolvers,\x20subscribers\x20as\x20','double','Entity','bigint','Entities,','replace','double\x20precision','\x0a\x20\x20','getRepository','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a\x20\x20@Column(\x27simple-json\x27,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20@Field(type\x20=>\x20ScalarObject,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20historyJson?:\x20any\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','string','createHistoryServiceFiles','/server/service/','Operato\x20Tool\x20Create\x20Service','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','...','updater','toolCreateService','__metadata','find','pluralCamelCaseName','snakeCaseName','writeFileSync','float','readFileSync','join','Resolvers,','EntitySubscribers,','packages','createServicePath','existsPath','OperatoToolCreateService','creator_id','updated_at','-query.ts','sort','timestamp\x20without\x20time\x20zone','camelCaseName','prototype','Ctx','getProjectRootPath','\x27,\x20type:\x20\x27','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}List\x20}\x20from\x20\x27./{{name}}-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Query\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}List,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{pluralCamelCase\x20name}}(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}List>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20convertedParams\x20=\x20convertListParams(params,\x20domain.id)\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.creatorId})\x0a\x20\x20}\x0a}\x0a','type\x20=>','push','import\x20{\x20entities\x20as\x20','length','pascalCaseName','createEntityText','writeFile','updater_id','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','createDir','createServiceFiles','\x0aimport\x20{\x20Resolver,\x20Mutation,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20In\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20New{{pascalCase\x20name}},\x20{{pascalCase\x20name}}Patch\x20}\x20from\x20\x27./{{name}}-type\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Mutation\x20{\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20create\x20new\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20create{{pascalCase\x20name}}(@Arg(\x27{{camelCase\x20name}}\x27)\x20{{camelCase\x20name}}:\x20New{{pascalCase\x20name}},\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20return\x20await\x20tx.getRepository({{pascalCase\x20name}}).save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20modify\x20{{pascalCase\x20name}}\x20information\x27\x20})\x0a\x20\x20async\x20update{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27id\x27)\x20id:\x20string,\x0a\x20\x20\x20\x20@Arg(\x27patch\x27)\x20patch:\x20{{pascalCase\x20name}}Patch,\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20repository\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20repository.findOne(\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20)\x0a\x0a\x20\x20\x20\x20return\x20await\x20repository.save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20...patch,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20[{{pascalCase\x20name}}],\x20{\x20description:\x20\x22To\x20modify\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20information\x22\x20})\x0a\x20\x20async\x20updateMultiple{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27patches\x27,\x20type\x20=>\x20[{{pascalCase\x20name}}Patch])\x20patches:\x20{{pascalCase\x20name}}Patch[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}[]>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20results\x20=\x20[]\x0a\x20\x20\x20\x20const\x20_createRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27+\x27)\x0a\x20\x20\x20\x20const\x20_updateRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27M\x27)\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}Repo\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x0a\x20\x20\x20\x20if\x20(_createRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_createRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20newRecord\x20=\x20_createRecords[i]\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...newRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27+\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20if\x20(_updateRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_updateRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20updRecord\x20=\x20_updateRecords[i]\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20{{camelCase\x20name}}Repo.findOne({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id:updRecord.id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...updRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27M\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20results\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20delete{{pascalCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove({\x20domain,\x20id,\x20updater:user\x20})\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20multiple\x20{{camelCase\x20name}}s\x27\x20})\x0a\x20\x20async\x20delete{{pluralPascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27ids\x27,\x20type\x20=>\x20[String])\x20ids:\x20string[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20delEntitis\x20=\x20ids.map(id=>{\x0a\x20\x20\x20\x20\x20\x20return\x20{domain,id,updater:user}\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove(delEntitis)\x0a\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a}\x0a','\x20{\x20nullable:\x20','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','@Column({name:\x27','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','env','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}}]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}Mutation]\x0a','replaceNamesMap','8779085EYZmiK','rank','pluralPascalCaseName','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','/packages','-type.ts','existsSync','__esModule','text','Date','indexOf','findOne','/packages/','Entities,\x20resolvers\x20as\x20','getColTxtType','getFieldType','/index.ts','-mutation.ts','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryQuery\x20}\x20from\x20\x27./{{name}}-history-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20}\x20from\x20\x27./event-subscriber\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}},\x20{{pascalCase\x20name}}History]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}HistoryQuery,\x20{{pascalCase\x20name}}Mutation]\x0aexport\x20const\x20subscribers\x20=\x20[{{pascalCase\x20name}}HistoryEntitySubscriber]\x0a\x0a','EntitySubscribers\x20}\x20from\x20\x27./','export\x20*\x20from\x20\x27./','datetime','JSON','map','columnToEntityColumn','pluralize','/service','__param','uniqRank','design:type','created_at','tableName','dataProp','@things-factory/resource-base','\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@InputType()\x0aexport\x20class\x20New{{pascalCase\x20name}}\x20{\x0a{{newTypeColumns}}\x0a}\x0a\x0a@InputType()\x0aexport\x20class\x20{{pascalCase\x20name}}Patch\x20{\x0a\x20\x20@Field(type\x20=>\x20ID,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20id?:\x20string\x0a\x0a{{patchTypeColumns}}\x0a\x0a\x20\x20@Field()\x0a\x20\x20cuFlag:\x20string\x0a}\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}List\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}])\x0a\x20\x20items:\x20{{pascalCase\x20name}}[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a','long','domain_id','91765rsNSTd','defineProperty','mkdirSync','COPY','number','createTypeText','Float','PWD','index.ts','name','Arg','-history\x27','state','\x27,\x20nullable:\x20','decimal','tslib','-history.ts','5876128KLiGbV','2806854Ypiebj','744696nDxFNI','Int','createNoHistoryServiceFiels','@Field(','nullable','character\x20varying','/event-subscriber.ts','Resolvers\x20}\x20from\x20\x27./'];a0_0x1079=function(){return _0x4aa13b;};return a0_0x1079();}Object[a0_0x36a4a4(0xd5)](exports,a0_0x36a4a4(0xb6),{'value':!0x0}),exports[a0_0x36a4a4(0x11e)]=void 0x0;const tslib_1=require(a0_0x36a4a4(0xe3)),type_graphql_1=require('type-graphql'),shell_1=require('@things-factory/shell'),resource_base_1=require(a0_0x36a4a4(0xd0)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x36a4a4(0xfa)),{plural:plural}=require(a0_0x36a4a4(0xc8)),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x36a4a4(0x110)](_0x593076,_0x2f0e12){const _0x239cd1=a0_0x36a4a4,{domain:_0x20357c}=_0x2f0e12[_0x239cd1(0xe0)],_0x38f01c=await(0x0,shell_1[_0x239cd1(0x107)])(resource_base_1[_0x239cd1(0x101)])[_0x239cd1(0xba)]({'where':{'id':_0x593076}}),_0xb0f946=await(0x0,shell_1[_0x239cd1(0x107)])(resource_base_1['EntityColumn'])[_0x239cd1(0x112)]({'where':{'domain':{'id':_0x20357c['id']},'entity':{'id':_0x38f01c['id']}}});let {name:_0x4a2bfd='',bundle:_0x175bb0=''}=_0x38f01c||{},_0x36942b=this[_0x239cd1(0x127)](),_0x5b7261=kebabCase(_0x4a2bfd);return await this[_0x239cd1(0x11c)](_0x36942b,_0x175bb0,_0x5b7261),await this[_0x239cd1(0x134)](_0x36942b,_0x175bb0,_0x4a2bfd,_0x5b7261,_0x38f01c,_0xb0f946),!0x0;}async['createServiceFiles'](_0x179873,_0x3cd5b4,_0x291427,_0xe4c820,_0x4ed6d1,_0x4e344c){const _0xe7eb74=a0_0x36a4a4;let _0x4f6272={'name':_0xe4c820,'tableName':_0x4ed6d1['tableName'],'pascalCaseName':startCase(camelCase(_0x291427))[_0xe7eb74(0x104)](/ /g,''),'camelCaseName':camelCase(_0x291427),'snakeCaseName':snakeCase(_0x291427),'pluralPascalCaseName':startCase(camelCase(plural(_0x291427)))['replace'](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x291427))},_0x2bbb7f=_0x179873+_0xe7eb74(0xbb)+_0x3cd5b4+_0xe7eb74(0x10b);['JSON',_0xe7eb74(0xd7)]['includes'](_0x4ed6d1[_0xe7eb74(0xcf)])?await this[_0xe7eb74(0x10a)](_0x2bbb7f,_0xe4c820,_0x4ed6d1,_0x4e344c,_0x4f6272):await this[_0xe7eb74(0xe9)](_0x2bbb7f,_0xe4c820,_0x4ed6d1,_0x4e344c,_0x4f6272);}async['createHistoryServiceFiles'](_0x29a357,_0x1ea5d4,_0x6d7899,_0x8651bb,_0x400d55){const _0x222bb9=a0_0x36a4a4;await this[_0x222bb9(0x130)](_0x29a357+(_0x1ea5d4+_0x222bb9(0xbf)),serviceHistoryIndex,_0x400d55);let _0x23938c=this['createEntityText'](_0x6d7899,_0x8651bb);await this['writeFile'](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+_0x222bb9(0xf9)),_0x23938c,_0x400d55),await this[_0x222bb9(0x130)](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+_0x222bb9(0x121)),serviceQuery,_0x400d55),await this[_0x222bb9(0x130)](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+_0x222bb9(0xc0)),serviceMutation,_0x400d55);let _0xf9be5f=this['createTypeText'](_0x8651bb);await this[_0x222bb9(0x130)](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+_0x222bb9(0xb4)),_0xf9be5f,_0x400d55);let _0x587772=this['createHistoryEntityText'](_0x6d7899,_0x8651bb);await this[_0x222bb9(0x130)](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+_0x222bb9(0xe4)),_0x587772,_0x400d55);let _0x274950='';_0x222bb9(0xc5)==_0x6d7899[_0x222bb9(0xcf)]?(_0x274950='\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20',await this['writeFile'](_0x29a357+(_0x1ea5d4+'/event-subscriber.ts'),serviceEntitySubscriber,_0x400d55)):_0x274950='';let _0x11e2a7=serviceEntitySubscriber[_0x222bb9(0x104)](/{{entityToJson}}/g,_0x274950);await this['writeFile'](_0x29a357+(_0x1ea5d4+_0x222bb9(0xed)),_0x11e2a7,_0x400d55),await this['writeFile'](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+'-history-query.ts'),serviceHistoryQuery,_0x400d55),await this['writeFile'](_0x29a357+(_0x1ea5d4+'/'+_0x1ea5d4+'-history-type.ts'),sereviceHistoryType,_0x400d55);let _0x4d9456=_0x29a357+'index.ts';0x0==await this[_0x222bb9(0x11d)](_0x4d9456)&&await this['writeFile'](_0x4d9456,allIndex,_0x400d55);let _0x437250=await fs[_0x222bb9(0x117)](_0x4d9456,_0x222bb9(0xfc));_0x437250[_0x222bb9(0xb9)](_0x222bb9(0xc3)+_0x400d55[_0x222bb9(0xdd)]+'/'+_0x400d55[_0x222bb9(0xdd)]+_0x222bb9(0xdf))<0x0&&(_0x437250=_0x437250[_0x222bb9(0x104)](/\/\* EXPORT ENTITY TYPES \*\//,_0x222bb9(0x10d)+_0x400d55[_0x222bb9(0xdd)]+'/'+_0x400d55[_0x222bb9(0xdd)]+'-history\x27')),_0x437250[_0x222bb9(0xb9)](_0x222bb9(0xc3)+_0x400d55[_0x222bb9(0xdd)]+'/'+_0x400d55['name']+'\x27')<0x0&&(_0x437250=_0x437250[_0x222bb9(0x104)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x400d55[_0x222bb9(0xdd)]+'/'+_0x400d55[_0x222bb9(0xdd)]+'\x27')),_0x437250['indexOf'](_0x222bb9(0x12c)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0xbc)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0xff)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0xc2)+_0x400d55[_0x222bb9(0xdd)]+'\x27')<0x0&&(_0x437250=_0x437250[_0x222bb9(0x104)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x222bb9(0x139)+_0x400d55['pascalCaseName']+_0x222bb9(0xbc)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0xff)+_0x400d55['pascalCaseName']+_0x222bb9(0xc2)+_0x400d55['name']+'\x27')),_0x437250[_0x222bb9(0xb9)](_0x222bb9(0x10e)+_0x400d55['pascalCaseName']+'Entities,')<0x0&&(_0x437250=_0x437250['replace'](/\/\* ENTITIES \*\//,_0x222bb9(0xfd)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0x103))),_0x437250['indexOf'](_0x222bb9(0x10e)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0x119))<0x0&&(_0x437250=_0x437250[_0x222bb9(0x104)](/\/\* RESOLVER CLASSES \*\//,_0x222bb9(0xf7)+_0x400d55['pascalCaseName']+'Resolvers,')),_0x437250['indexOf'](_0x222bb9(0x10e)+_0x400d55[_0x222bb9(0x12e)]+'EntitySubscribers,')<0x0&&(_0x437250=_0x437250[_0x222bb9(0x104)](/\/\* SUBSCRIBERS \*\//,_0x222bb9(0x137)+_0x400d55[_0x222bb9(0x12e)]+_0x222bb9(0x11a))),await this[_0x222bb9(0x130)](_0x4d9456,_0x437250,_0x400d55);}async['createNoHistoryServiceFiels'](_0x3ecba4,_0x34bf65,_0x1fe16d,_0x663650,_0x1dcec8){const _0x2d540f=a0_0x36a4a4;await this[_0x2d540f(0x130)](_0x3ecba4+(_0x34bf65+'/index.ts'),serviceIndex,_0x1dcec8),await this[_0x2d540f(0x130)](_0x3ecba4+(_0x34bf65+'/'+_0x34bf65+_0x2d540f(0x121)),serviceQuery,_0x1dcec8),await this['writeFile'](_0x3ecba4+(_0x34bf65+'/'+_0x34bf65+_0x2d540f(0xc0)),serviceMutation,_0x1dcec8);let _0x4b4139=this['createEntityText'](_0x1fe16d,_0x663650);await this[_0x2d540f(0x130)](_0x3ecba4+(_0x34bf65+'/'+_0x34bf65+_0x2d540f(0xf9)),_0x4b4139,_0x1dcec8);let _0x2cb7bc=this[_0x2d540f(0xd9)](_0x663650);await this[_0x2d540f(0x130)](_0x3ecba4+(_0x34bf65+'/'+_0x34bf65+_0x2d540f(0xb4)),_0x2cb7bc,_0x1dcec8);let _0x232908=_0x3ecba4+_0x2d540f(0xdc);0x0==await this[_0x2d540f(0x11d)](_0x232908)&&await this[_0x2d540f(0x130)](_0x232908,allIndex,_0x1dcec8);let _0x2a2c53=await fs[_0x2d540f(0x117)](_0x232908,_0x2d540f(0xfc));_0x2a2c53[_0x2d540f(0xb9)]('export\x20*\x20from\x20\x27./'+_0x1dcec8[_0x2d540f(0xdd)]+'/'+_0x1dcec8['name']+'\x27')<0x0&&(_0x2a2c53=_0x2a2c53[_0x2d540f(0x104)](/\/\* EXPORT ENTITY TYPES \*\//,_0x2d540f(0x10d)+_0x1dcec8[_0x2d540f(0xdd)]+'/'+_0x1dcec8[_0x2d540f(0xdd)]+'\x27')),_0x2a2c53[_0x2d540f(0xb9)](_0x2d540f(0x12c)+_0x1dcec8[_0x2d540f(0x12e)]+_0x2d540f(0xbc)+_0x1dcec8[_0x2d540f(0x12e)]+'Resolvers\x20}\x20from\x20\x27./'+_0x1dcec8['name']+'\x27')<0x0&&(_0x2a2c53=_0x2a2c53[_0x2d540f(0x104)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x2d540f(0x139)+_0x1dcec8['pascalCaseName']+_0x2d540f(0xbc)+_0x1dcec8[_0x2d540f(0x12e)]+_0x2d540f(0xee)+_0x1dcec8[_0x2d540f(0xdd)]+'\x27')),_0x2a2c53[_0x2d540f(0xb9)](_0x2d540f(0x10e)+_0x1dcec8['pascalCaseName']+'Entities,')<0x0&&(_0x2a2c53=_0x2a2c53['replace'](/\/\* ENTITIES \*\//,_0x2d540f(0xfd)+_0x1dcec8[_0x2d540f(0x12e)]+_0x2d540f(0x103))),_0x2a2c53[_0x2d540f(0xb9)]('...'+_0x1dcec8['pascalCaseName']+_0x2d540f(0x119))<0x0&&(_0x2a2c53=_0x2a2c53[_0x2d540f(0x104)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x1dcec8[_0x2d540f(0x12e)]+_0x2d540f(0x119))),await this[_0x2d540f(0x130)](_0x232908,_0x2a2c53,_0x1dcec8);}[a0_0x36a4a4(0xd9)](_0x1dd8a1){const _0x4bded3=a0_0x36a4a4;let _0x6b3f65=sereviceType,_0x40798b=_0x1dd8a1[_0x4bded3(0xc6)](_0x5b5b93=>{const _0x1643dc=_0x4bded3;if('id'==_0x5b5b93[_0x1643dc(0xdd)])return'';if(_0x1643dc(0xd3)==_0x5b5b93[_0x1643dc(0xdd)])return'';if(_0x1643dc(0xcd)==_0x5b5b93[_0x1643dc(0xdd)])return'';if('updated_at'==_0x5b5b93[_0x1643dc(0xdd)])return'';if('creator_id'==_0x5b5b93[_0x1643dc(0xdd)])return'';if('updater_id'==_0x5b5b93[_0x1643dc(0xdd)])return'';let _0x199798=this[_0x1643dc(0xbe)](_0x5b5b93),_0x79b9ce=this[_0x1643dc(0xbd)](_0x5b5b93),_0xee086d=camelCase(_0x5b5b93[_0x1643dc(0xdd)]);return'\x20\x20'+(_0x1643dc(0xea)+(0x0==_0x199798[_0x1643dc(0x12d)]?'':_0x1643dc(0x12a)+_0x199798+',')+_0x1643dc(0x136)+_0x5b5b93[_0x1643dc(0xeb)]+'\x20})')+_0x1643dc(0x106)+(''+_0xee086d+(_0x5b5b93['nullable']?'?':'')+':\x20'+_0x79b9ce)+'\x0a';});_0x6b3f65=_0x6b3f65[_0x4bded3(0x104)](/{{newTypeColumns}}/g,_0x40798b['join']('\x0a'));let _0x293e36=_0x1dd8a1['map'](_0x369228=>{const _0x48560f=_0x4bded3;if('id'==_0x369228['name'])return'';if(_0x48560f(0xd3)==_0x369228[_0x48560f(0xdd)])return'';if(_0x48560f(0xcd)==_0x369228[_0x48560f(0xdd)])return'';if(_0x48560f(0x120)==_0x369228[_0x48560f(0xdd)])return'';if(_0x48560f(0x11f)==_0x369228[_0x48560f(0xdd)])return'';if('updater_id'==_0x369228[_0x48560f(0xdd)])return'';let _0x35028d=this['getFieldType'](_0x369228),_0x20e690=this[_0x48560f(0xbd)](_0x369228);_0x369228[_0x48560f(0xeb)]=!0x0;let _0x520476=camelCase(_0x369228[_0x48560f(0xdd)]);return'\x20\x20'+(_0x48560f(0xea)+(0x0==_0x35028d[_0x48560f(0x12d)]?'':_0x48560f(0x12a)+_0x35028d+',')+'\x20{\x20nullable:\x20'+_0x369228[_0x48560f(0xeb)]+_0x48560f(0xfb))+'\x0a\x20\x20'+(''+_0x520476+(_0x369228['nullable']?'?':'')+':\x20'+_0x20e690)+'\x0a';});return _0x6b3f65=_0x6b3f65['replace'](/{{patchTypeColumns}}/g,_0x293e36[_0x4bded3(0x118)]('\x0a')),_0x6b3f65;}[a0_0x36a4a4(0x12f)](_0x4e9041,_0xad0226){const _0x829182=a0_0x36a4a4;let _0x4e622e=serviceEntity,_0x4dd029=_0xad0226[_0x829182(0x122)](function(_0x4f13a8,_0x198840){const _0x301085=_0x829182;return _0x4f13a8[_0x301085(0x13e)]-_0x198840['rank'];})[_0x829182(0xc6)](_0x2e9479=>this['columnToEntityColumn'](_0x2e9479));[_0x829182(0xd7),_0x829182(0xc5)]['includes'](_0x4e9041['dataProp'])&&_0x4dd029[_0x829182(0x12b)](_0x829182(0x132)),_0x4e622e=_0x4e622e[_0x829182(0x104)](/{{entityColumns}}/g,_0x4dd029[_0x829182(0x118)]('\x0a'));let _0x4b418d='',_0x1c7d37=_0xad0226['filter'](_0x561668=>_0x561668[_0x829182(0xcb)]&&_0x561668[_0x829182(0xcb)]>0x0)[_0x829182(0x122)](function(_0x5522f9,_0x352063){const _0x34f650=_0x829182;return _0x5522f9[_0x34f650(0xcb)]-_0x352063[_0x34f650(0xcb)];});if(_0x1c7d37[_0x829182(0x12d)]>0x0){_0x4b418d=_0x829182(0x141);let _0x2d62b5=_0x1c7d37[_0x829182(0xc6)](_0x3454e3=>{const _0x4701dc=_0x829182;let _0x5dd992=_0x3454e3[_0x4701dc(0xdd)];return _0x4701dc(0xd3)==_0x3454e3['name']&&(_0x5dd992='domain'),_0x4701dc(0x11f)==_0x3454e3['name']&&(_0x5dd992='creator'),_0x4701dc(0x131)==_0x3454e3['name']&&(_0x5dd992=_0x4701dc(0x10f)),'{{camelCase\x20name}}.'+camelCase(_0x5dd992);});_0x4b418d=_0x4b418d[_0x829182(0x104)](/{{indexColumns}}/g,_0x2d62b5[_0x829182(0x118)](','));}return _0x4e622e=_0x4e622e[_0x829182(0x104)](/{{indexAnn}}/g,_0x4b418d),_0x4e622e;}['createHistoryEntityText'](_0x42c489,_0x5466aa){const _0xfa48a4=a0_0x36a4a4;let _0x45b2a8=_0xfa48a4(0xc5)==_0x42c489[_0xfa48a4(0xcf)]?serviceEntityHistJson:serviceEntityHistCopy,_0x1161c4=_0x5466aa[_0xfa48a4(0x122)](function(_0x4ecf36,_0x47a29b){return _0x4ecf36['rank']-_0x47a29b['rank'];})[_0xfa48a4(0xc6)](_0x54b6c4=>this[_0xfa48a4(0xc7)](_0x54b6c4));return _0x45b2a8=_0x45b2a8[_0xfa48a4(0x104)](/{{entityColumns}}/g,_0x1161c4[_0xfa48a4(0x118)]('\x0a')),_0x45b2a8;}['columnToEntityColumn'](_0x5b41f3){const _0x5eb5b1=a0_0x36a4a4;if('id'==_0x5b41f3[_0x5eb5b1(0xdd)])return'';if(_0x5eb5b1(0xd3)==_0x5b41f3[_0x5eb5b1(0xdd)])return'';if(_0x5eb5b1(0xcd)==_0x5b41f3['name'])return'';if(_0x5eb5b1(0x120)==_0x5b41f3[_0x5eb5b1(0xdd)])return'';if('creator_id'==_0x5b41f3[_0x5eb5b1(0xdd)])return'';if('updater_id'==_0x5b41f3[_0x5eb5b1(0xdd)])return'';let _0x414e27=_0x5b41f3[_0x5eb5b1(0xef)];_0x5eb5b1(0x100)==_0x5b41f3[_0x5eb5b1(0xef)]&&(_0x414e27=_0x5eb5b1(0x105)),_0x5eb5b1(0xd2)==_0x5b41f3[_0x5eb5b1(0xef)]&&(_0x414e27=_0x5eb5b1(0x102)),'string'==_0x5b41f3[_0x5eb5b1(0xef)]&&(_0x414e27=_0x5eb5b1(0xec)),_0x5eb5b1(0xc4)==_0x5b41f3['colType']&&(_0x414e27=_0x5eb5b1(0x123));let _0x5f25ca='';_0x5eb5b1(0x109)==_0x5b41f3['colType']&&(_0x5f25ca=_0x5b41f3['colSize']);let _0x329293=this[_0x5eb5b1(0xbe)](_0x5b41f3),_0x4f16e6=this[_0x5eb5b1(0xbd)](_0x5b41f3),_0x40e1d0=camelCase(_0x5b41f3[_0x5eb5b1(0xdd)]);return'\x20\x20'+(_0x5eb5b1(0x138)+_0x5b41f3[_0x5eb5b1(0xdd)]+_0x5eb5b1(0x128)+_0x414e27+_0x5eb5b1(0xe1)+_0x5b41f3[_0x5eb5b1(0xeb)]+'\x20'+(0x0==_0x5f25ca[_0x5eb5b1(0x12d)]?'':',length:'+_0x5f25ca)+_0x5eb5b1(0xfb))+'\x0a\x20\x20'+(_0x5eb5b1(0xea)+(0x0==_0x329293[_0x5eb5b1(0x12d)]?'':_0x5eb5b1(0x12a)+_0x329293+',')+_0x5eb5b1(0x136)+_0x5b41f3[_0x5eb5b1(0xeb)]+_0x5eb5b1(0xfb))+_0x5eb5b1(0x106)+(''+_0x40e1d0+(_0x5b41f3[_0x5eb5b1(0xeb)]?'?':'')+':\x20'+_0x4f16e6)+'\x0a';}[a0_0x36a4a4(0xbe)](_0x403fb2){const _0x3bb7e5=a0_0x36a4a4;let _0x5e0052='';return'double'==_0x403fb2['colType']&&(_0x5e0052='Float'),_0x3bb7e5(0x116)==_0x403fb2[_0x3bb7e5(0xef)]&&(_0x5e0052=_0x3bb7e5(0xda)),_0x3bb7e5(0xd2)==_0x403fb2['colType']&&(_0x5e0052=_0x3bb7e5(0xe8)),'integer'==_0x403fb2[_0x3bb7e5(0xef)]&&(_0x5e0052=_0x3bb7e5(0xe8)),_0x5e0052;}[a0_0x36a4a4(0xbd)](_0x2144a5){const _0x5817bf=a0_0x36a4a4;let _0x302a2e=_0x2144a5[_0x5817bf(0xef)];return _0x5817bf(0xe2)==_0x2144a5[_0x5817bf(0xef)]&&(_0x302a2e=_0x5817bf(0xd8)),_0x5817bf(0x100)==_0x2144a5[_0x5817bf(0xef)]&&(_0x302a2e='number'),_0x5817bf(0x116)==_0x2144a5[_0x5817bf(0xef)]&&(_0x302a2e='number'),'integer'==_0x2144a5['colType']&&(_0x302a2e=_0x5817bf(0xd8)),_0x5817bf(0xd2)==_0x2144a5[_0x5817bf(0xef)]&&(_0x302a2e=_0x5817bf(0xd8)),_0x5817bf(0xc4)==_0x2144a5[_0x5817bf(0xef)]&&(_0x302a2e=_0x5817bf(0xb8)),'date'==_0x2144a5[_0x5817bf(0xef)]&&(_0x302a2e=_0x5817bf(0xb8)),_0x5817bf(0xb7)==_0x2144a5['colType']&&(_0x302a2e=_0x5817bf(0x109)),_0x302a2e;}async['writeFile'](_0x5758dd,_0x5397ec,_0x52fbaa){const _0x194c81=a0_0x36a4a4;await fs[_0x194c81(0x115)](_0x5758dd,this[_0x194c81(0x13c)](_0x5397ec,_0x52fbaa),'utf8');}['replaceNamesMap'](_0xef7cbd,_0x518630){const _0x5cf156=a0_0x36a4a4;return _0xef7cbd[_0x5cf156(0x104)](/{{pascalCase name}}/g,_0x518630[_0x5cf156(0x12e)])[_0x5cf156(0x104)](/{{camelCase name}}/g,_0x518630[_0x5cf156(0x124)])[_0x5cf156(0x104)](/{{snakeCase name}}/g,_0x518630[_0x5cf156(0x114)])['replace'](/{{pluralPascalCase name}}/g,_0x518630[_0x5cf156(0x13f)])[_0x5cf156(0x104)](/{{pluralCamelCase name}}/g,_0x518630[_0x5cf156(0x113)])[_0x5cf156(0x104)](/{{tableName}}/g,_0x518630[_0x5cf156(0xce)])[_0x5cf156(0x104)](/{{name}}/g,_0x518630[_0x5cf156(0xdd)]);}async[a0_0x36a4a4(0x11c)](_0x412036,_0x1b6074,_0xd1687d){const _0x193517=a0_0x36a4a4;let _0x17fae1=_0x412036+_0x193517(0xb3);await this[_0x193517(0x133)](_0x17fae1),_0x17fae1=_0x17fae1+'/'+_0x1b6074,await this[_0x193517(0x133)](_0x17fae1),_0x17fae1+=_0x193517(0xf0),await this[_0x193517(0x133)](_0x17fae1),_0x17fae1+=_0x193517(0xc9),await this[_0x193517(0x133)](_0x17fae1),_0x17fae1=_0x17fae1+'/'+_0xd1687d,await this['createDir'](_0x17fae1);}[a0_0x36a4a4(0x127)](){const _0xc887f0=a0_0x36a4a4;let _0xba381f=process[_0xc887f0(0x13a)][_0xc887f0(0xdb)]['split']('/'),_0x1318c9=[];for(let _0x275e43=0x0;_0x275e43<_0xba381f[_0xc887f0(0x12d)]&&_0xc887f0(0x11b)!=_0xba381f[_0x275e43];_0x275e43++)_0x1318c9['push'](_0xba381f[_0x275e43]);return _0x1318c9[_0xc887f0(0x118)]('/');}async[a0_0x36a4a4(0x133)](_0x2a829b){const _0x2e8574=a0_0x36a4a4;0x0==await this[_0x2e8574(0x11d)](_0x2a829b)&&fs[_0x2e8574(0xd6)](_0x2a829b);}async[a0_0x36a4a4(0x11d)](_0x9c5ed4){const _0xf3e361=a0_0x36a4a4;return await fs[_0xf3e361(0xb5)](_0x9c5ed4);}};tslib_1[a0_0x36a4a4(0xf5)]([(0x0,type_graphql_1['Query'])(_0x40a933=>Boolean,{'description':a0_0x36a4a4(0x10c)}),tslib_1[a0_0x36a4a4(0xca)](0x0,(0x0,type_graphql_1[a0_0x36a4a4(0xde)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x36a4a4(0x126)])()),tslib_1[a0_0x36a4a4(0x111)](a0_0x36a4a4(0xcc),Function),tslib_1[a0_0x36a4a4(0x111)]('design:paramtypes',[String,Object]),tslib_1[a0_0x36a4a4(0x111)](a0_0x36a4a4(0xf1),Promise)],OperatoToolCreateService[a0_0x36a4a4(0x125)],a0_0x36a4a4(0x110),null),OperatoToolCreateService=tslib_1['__decorate']([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports[a0_0x36a4a4(0x11e)]=OperatoToolCreateService;const allIndex=a0_0x36a4a4(0xfe),serviceIndex=a0_0x36a4a4(0x13b),serviceHistoryIndex=a0_0x36a4a4(0xc1),serviceQuery=a0_0x36a4a4(0x129),serviceHistoryQuery=a0_0x36a4a4(0xf8),serviceMutation=a0_0x36a4a4(0x135),sereviceType=a0_0x36a4a4(0xd1),sereviceHistoryType='\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a',serviceEntity='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20Domain\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0a@Entity(\x27{{tableName}}\x27)\x0a{{indexAnn}}\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}\x20{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntityHistCopy=a0_0x36a4a4(0x140),serviceEntityHistJson=a0_0x36a4a4(0x108),serviceEntitySubscriber=a0_0x36a4a4(0xf2);
1
+ 'use strict';function a0_0x53ca(_0x219512,_0x517e80){const _0x1b582b=a0_0x1b58();return a0_0x53ca=function(_0x53caf8,_0x4dbd50){_0x53caf8=_0x53caf8-0x16f;let _0xb53ca3=_0x1b582b[_0x53caf8];return _0xb53ca3;},a0_0x53ca(_0x219512,_0x517e80);}function a0_0x1b58(){const _0x5a18f3=['updater_id','createServiceFiles','Entity','rank','updated_at','pluralize','utf8','import\x20{\x20entities\x20as\x20','__param','createTypeText','2761850iSngap','tslib','/server','string','-history.ts','5115228leMvwq','nullable','export\x20*\x20from\x20\x27./','Resolvers,','getFieldType','EntitySubscribers\x20}\x20from\x20\x27./','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a\x20\x20@Column(\x27simple-json\x27,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20@Field(type\x20=>\x20ScalarObject,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20historyJson?:\x20any\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','character\x20varying','5kediRq','datetime','writeFile','462292uWGlDQ','decimal','-history-query.ts','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}}]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}Mutation]\x0a','toolCreateService','design:returntype','domain','\x0aimport\x20{\x20EventSubscriber\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20HistoryEntitySubscriber\x20}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@EventSubscriber()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20extends\x20HistoryEntitySubscriber<{{pascalCase\x20name}},{{pascalCase\x20name}}History>\x20{\x0a\x20\x20public\x20get\x20entity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}\x0a\x20\x20}\x0a\x0a\x20\x20public\x20get\x20historyEntity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}History\x0a\x20\x20}\x0a\x0a\x20\x20{{entityToJson}}\x0a\x0a\x20\x20async\x20beforeRemoveHistory(history:{{pascalCase\x20name}}History,entity:{{pascalCase\x20name}}){\x0a\x20\x20\x20\x20let\x20repo\x20=\x20getRepository({{pascalCase\x20name}}History);\x0a\x20\x20\x20\x20const\x20revNo\x20=\x20await\x20repo.createQueryBuilder()\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.select(\x27max(data_revision_no)\x27,\x20\x27rev_no\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.where(\x27domain_id\x20=\x20:domainId\x27,\x20{\x20domainId:\x20entity.domain.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.andWhere(\x27original_id\x20=\x20:originalId\x27,\x20{\x20originalId:\x20entity.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.getRawOne()\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20history.dataRevisionNo\x20=\x20revNo\x20?\x20revNo.rev_no\x20+\x201\x20:\x201;\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a}\x0a','/*\x20ENTITIES\x20*/\x0a\x09...','split','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryList\x20}\x20from\x20\x27./{{name}}-history-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}}History)\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryQuery\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}History,\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}History(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}History>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}History).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}HistoryList,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}Histories(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}HistoryList>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}}History)\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}History.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.creatorId})\x0a\x20\x20}\x0a}\x0a','packages','Arg','filter','\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20','integer','...',',length:','OperatoToolCreateService','6kGaZfY','map','snakeCaseName','includes','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','/index.ts','bigint','__metadata','env','Date','pluralCamelCaseName','-type.ts','creator_id','replace','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20Domain\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0a@Entity(\x27{{tableName}}\x27)\x0a{{indexAnn}}\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}\x20{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','Entities,','Operato\x20Tool\x20Create\x20Service','tableName','\x0a\x20\x20','uniqRank','type\x20=>','@things-factory/shell','2668768dgJZAk','design:paramtypes','long','.ts','number','indexOf','\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@InputType()\x0aexport\x20class\x20New{{pascalCase\x20name}}\x20{\x0a{{newTypeColumns}}\x0a}\x0a\x0a@InputType()\x0aexport\x20class\x20{{pascalCase\x20name}}Patch\x20{\x0a\x20\x20@Field(type\x20=>\x20ID,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20id?:\x20string\x0a\x0a{{patchTypeColumns}}\x0a\x0a\x20\x20@Field()\x0a\x20\x20cuFlag:\x20string\x0a}\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}List\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}])\x0a\x20\x20items:\x20{{pascalCase\x20name}}[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a','text','__decorate','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}List\x20}\x20from\x20\x27./{{name}}-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Query\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}List,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{pluralCamelCase\x20name}}(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}List>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20convertedParams\x20=\x20convertListParams(params,\x20domain.id)\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.creatorId})\x0a\x20\x20}\x0a}\x0a','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','Resolvers,\x20subscribers\x20as\x20','@things-factory/resource-base','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','Entities,\x20resolvers\x20as\x20','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryQuery\x20}\x20from\x20\x27./{{name}}-history-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20}\x20from\x20\x27./event-subscriber\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}},\x20{{pascalCase\x20name}}History]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}HistoryQuery,\x20{{pascalCase\x20name}}Mutation]\x0aexport\x20const\x20subscribers\x20=\x20[{{pascalCase\x20name}}HistoryEntitySubscriber]\x0a\x0a','existsPath','createHistoryEntityText','__esModule','Float','-query.ts','join','EntitySubscribers,','pascalCaseName','19060SOvauO','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','lodash','existsSync','\x0aimport\x20{\x20Resolver,\x20Mutation,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20In\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20New{{pascalCase\x20name}},\x20{{pascalCase\x20name}}Patch\x20}\x20from\x20\x27./{{name}}-type\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Mutation\x20{\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20create\x20new\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20create{{pascalCase\x20name}}(@Arg(\x27{{camelCase\x20name}}\x27)\x20{{camelCase\x20name}}:\x20New{{pascalCase\x20name}},\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20return\x20await\x20tx.getRepository({{pascalCase\x20name}}).save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20modify\x20{{pascalCase\x20name}}\x20information\x27\x20})\x0a\x20\x20async\x20update{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27id\x27)\x20id:\x20string,\x0a\x20\x20\x20\x20@Arg(\x27patch\x27)\x20patch:\x20{{pascalCase\x20name}}Patch,\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20repository\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20repository.findOne(\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20)\x0a\x0a\x20\x20\x20\x20return\x20await\x20repository.save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20...patch,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20[{{pascalCase\x20name}}],\x20{\x20description:\x20\x22To\x20modify\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20information\x22\x20})\x0a\x20\x20async\x20updateMultiple{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27patches\x27,\x20type\x20=>\x20[{{pascalCase\x20name}}Patch])\x20patches:\x20{{pascalCase\x20name}}Patch[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}[]>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20results\x20=\x20[]\x0a\x20\x20\x20\x20const\x20_createRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27+\x27)\x0a\x20\x20\x20\x20const\x20_updateRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27M\x27)\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}Repo\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x0a\x20\x20\x20\x20if\x20(_createRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_createRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20newRecord\x20=\x20_createRecords[i]\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...newRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27+\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20if\x20(_updateRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_updateRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20updRecord\x20=\x20_updateRecords[i]\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20{{camelCase\x20name}}Repo.findOne({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id:updRecord.id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...updRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27M\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20results\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20delete{{pascalCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove({\x20domain,\x20id,\x20updater:user\x20})\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20multiple\x20{{camelCase\x20name}}s\x27\x20})\x0a\x20\x20async\x20delete{{pluralPascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27ids\x27,\x20type\x20=>\x20[String])\x20ids:\x20string[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20delEntitis\x20=\x20ids.map(id=>{\x0a\x20\x20\x20\x20\x20\x20return\x20{domain,id,updater:user}\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove(delEntitis)\x0a\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a}\x0a','design:type','find','index.ts','344832xfMIML','2061hqMZib','type-graphql','/server/service/','/event-subscriber.ts','readFileSync','length','JSON','\x27,\x20nullable:\x20','prototype','writeFileSync','name','createEntityText','\x20{\x20nullable:\x20','\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a','creator','/packages','double','createDir','createServicePath','getColTxtType','\x20})','{{camelCase\x20name}}.','@Field(','colType','mkdirSync','getRepository','sort','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','221642WmTiaA','state','domain_id','/service','dataProp','Int','date','createNoHistoryServiceFiels','COPY','created_at','getProjectRootPath','Resolvers\x20}\x20from\x20\x27./','camelCaseName'];a0_0x1b58=function(){return _0x5a18f3;};return a0_0x1b58();}const a0_0x2ec24c=a0_0x53ca;(function(_0x1d6f2d,_0xc256a4){const _0x39f5e1=a0_0x53ca,_0x55b189=_0x1d6f2d();while(!![]){try{const _0x17a175=-parseInt(_0x39f5e1(0x1df))/0x1+parseInt(_0x39f5e1(0x18c))/0x2*(parseInt(_0x39f5e1(0x1c2))/0x3)+parseInt(_0x39f5e1(0x179))/0x4*(parseInt(_0x39f5e1(0x176))/0x5)+parseInt(_0x39f5e1(0x1fb))/0x6+parseInt(_0x39f5e1(0x1f6))/0x7+-parseInt(_0x39f5e1(0x1a2))/0x8+parseInt(_0x39f5e1(0x1c3))/0x9*(-parseInt(_0x39f5e1(0x1ba))/0xa);if(_0x17a175===_0xc256a4)break;else _0x55b189['push'](_0x55b189['shift']());}catch(_0x3002cb){_0x55b189['push'](_0x55b189['shift']());}}}(a0_0x1b58,0xaec05));Object['defineProperty'](exports,a0_0x2ec24c(0x1b4),{'value':!0x0}),exports['OperatoToolCreateService']=void 0x0;const tslib_1=require(a0_0x2ec24c(0x1f7)),type_graphql_1=require(a0_0x2ec24c(0x1c4)),shell_1=require(a0_0x2ec24c(0x1a1)),resource_base_1=require(a0_0x2ec24c(0x1ae)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x2ec24c(0x1bc)),{plural:plural}=require(a0_0x2ec24c(0x1f1)),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x2ec24c(0x17d)](_0x5949d7,_0x68ce45){const _0x3dcc1c=a0_0x2ec24c,{domain:_0x45e93c}=_0x68ce45[_0x3dcc1c(0x1e0)],_0x67b4a8=await(0x0,shell_1[_0x3dcc1c(0x1dc)])(resource_base_1[_0x3dcc1c(0x1ee)])['findOne']({'where':{'id':_0x5949d7}}),_0x1d15a0=await(0x0,shell_1[_0x3dcc1c(0x1dc)])(resource_base_1['EntityColumn'])[_0x3dcc1c(0x1c0)]({'where':{'domain':{'id':_0x45e93c['id']},'entity':{'id':_0x67b4a8['id']}}});let {name:_0x5e3011='',bundle:_0x3fd5a9=''}=_0x67b4a8||{},_0xbfcab8=this[_0x3dcc1c(0x1e9)](),_0xd44db8=kebabCase(_0x5e3011);return await this[_0x3dcc1c(0x1d5)](_0xbfcab8,_0x3fd5a9,_0xd44db8),await this[_0x3dcc1c(0x1ed)](_0xbfcab8,_0x3fd5a9,_0x5e3011,_0xd44db8,_0x67b4a8,_0x1d15a0),!0x0;}async[a0_0x2ec24c(0x1ed)](_0x3aab44,_0x57d0fe,_0x47cbbf,_0x5722d8,_0x542229,_0x475d1b){const _0x49778a=a0_0x2ec24c;let _0x1b10e1={'name':_0x5722d8,'tableName':_0x542229['tableName'],'pascalCaseName':startCase(camelCase(_0x47cbbf))[_0x49778a(0x199)](/ /g,''),'camelCaseName':camelCase(_0x47cbbf),'snakeCaseName':snakeCase(_0x47cbbf),'pluralPascalCaseName':startCase(camelCase(plural(_0x47cbbf)))[_0x49778a(0x199)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x47cbbf))},_0x1e39c0=_0x3aab44+'/packages/'+_0x57d0fe+_0x49778a(0x1c5);[_0x49778a(0x1c9),_0x49778a(0x1e7)]['includes'](_0x542229[_0x49778a(0x1e3)])?await this['createHistoryServiceFiles'](_0x1e39c0,_0x5722d8,_0x542229,_0x475d1b,_0x1b10e1):await this[_0x49778a(0x1e6)](_0x1e39c0,_0x5722d8,_0x542229,_0x475d1b,_0x1b10e1);}async['createHistoryServiceFiles'](_0x2490c8,_0x2192e3,_0x236778,_0x52d63d,_0x343b97){const _0x35f86b=a0_0x2ec24c;await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+'/index.ts'),serviceHistoryIndex,_0x343b97);let _0x26c76e=this[_0x35f86b(0x1ce)](_0x236778,_0x52d63d);await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+_0x35f86b(0x1a5)),_0x26c76e,_0x343b97),await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+_0x35f86b(0x1b6)),serviceQuery,_0x343b97),await this['writeFile'](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+'-mutation.ts'),serviceMutation,_0x343b97);let _0x3f32e0=this['createTypeText'](_0x52d63d);await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+_0x35f86b(0x197)),_0x3f32e0,_0x343b97);let _0x4181d7=this[_0x35f86b(0x1b3)](_0x236778,_0x52d63d);await this['writeFile'](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+_0x35f86b(0x1fa)),_0x4181d7,_0x343b97);let _0x5dc674='';_0x35f86b(0x1c9)==_0x236778[_0x35f86b(0x1e3)]?(_0x5dc674=_0x35f86b(0x187),await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+_0x35f86b(0x1c6)),serviceEntitySubscriber,_0x343b97)):_0x5dc674='';let _0x3023be=serviceEntitySubscriber[_0x35f86b(0x199)](/{{entityToJson}}/g,_0x5dc674);await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+_0x35f86b(0x1c6)),_0x3023be,_0x343b97),await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+_0x35f86b(0x17b)),serviceHistoryQuery,_0x343b97),await this[_0x35f86b(0x178)](_0x2490c8+(_0x2192e3+'/'+_0x2192e3+'-history-type.ts'),sereviceHistoryType,_0x343b97);let _0x269719=_0x2490c8+_0x35f86b(0x1c1);0x0==await this[_0x35f86b(0x1b2)](_0x269719)&&await this[_0x35f86b(0x178)](_0x269719,allIndex,_0x343b97);let _0x19fa3c=await fs[_0x35f86b(0x1c7)](_0x269719,'utf8');_0x19fa3c[_0x35f86b(0x1a7)]('export\x20*\x20from\x20\x27./'+_0x343b97[_0x35f86b(0x1cd)]+'/'+_0x343b97[_0x35f86b(0x1cd)]+'-history\x27')<0x0&&(_0x19fa3c=_0x19fa3c[_0x35f86b(0x199)](/\/\* EXPORT ENTITY TYPES \*\//,_0x35f86b(0x1ac)+_0x343b97[_0x35f86b(0x1cd)]+'/'+_0x343b97['name']+'-history\x27')),_0x19fa3c[_0x35f86b(0x1a7)](_0x35f86b(0x170)+_0x343b97['name']+'/'+_0x343b97[_0x35f86b(0x1cd)]+'\x27')<0x0&&(_0x19fa3c=_0x19fa3c[_0x35f86b(0x199)](/\/\* EXPORT ENTITY TYPES \*\//,_0x35f86b(0x1ac)+_0x343b97[_0x35f86b(0x1cd)]+'/'+_0x343b97[_0x35f86b(0x1cd)]+'\x27')),_0x19fa3c[_0x35f86b(0x1a7)](_0x35f86b(0x1f3)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x1b0)+_0x343b97[_0x35f86b(0x1b9)]+'Resolvers,\x20subscribers\x20as\x20'+_0x343b97['pascalCaseName']+'EntitySubscribers\x20}\x20from\x20\x27./'+_0x343b97[_0x35f86b(0x1cd)]+'\x27')<0x0&&(_0x19fa3c=_0x19fa3c[_0x35f86b(0x199)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x35f86b(0x190)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x1b0)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x1ad)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x173)+_0x343b97[_0x35f86b(0x1cd)]+'\x27')),_0x19fa3c[_0x35f86b(0x1a7)](_0x35f86b(0x189)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x19b))<0x0&&(_0x19fa3c=_0x19fa3c[_0x35f86b(0x199)](/\/\* ENTITIES \*\//,_0x35f86b(0x181)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x19b))),_0x19fa3c[_0x35f86b(0x1a7)]('...'+_0x343b97[_0x35f86b(0x1b9)]+'Resolvers,')<0x0&&(_0x19fa3c=_0x19fa3c[_0x35f86b(0x199)](/\/\* RESOLVER CLASSES \*\//,_0x35f86b(0x1af)+_0x343b97['pascalCaseName']+_0x35f86b(0x171))),_0x19fa3c[_0x35f86b(0x1a7)]('...'+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x1b8))<0x0&&(_0x19fa3c=_0x19fa3c['replace'](/\/\* SUBSCRIBERS \*\//,_0x35f86b(0x1de)+_0x343b97[_0x35f86b(0x1b9)]+_0x35f86b(0x1b8))),await this[_0x35f86b(0x178)](_0x269719,_0x19fa3c,_0x343b97);}async[a0_0x2ec24c(0x1e6)](_0x167b6d,_0x4c8eb1,_0xf81aab,_0x39ebf1,_0x3eca49){const _0x24a429=a0_0x2ec24c;await this[_0x24a429(0x178)](_0x167b6d+(_0x4c8eb1+_0x24a429(0x191)),serviceIndex,_0x3eca49),await this[_0x24a429(0x178)](_0x167b6d+(_0x4c8eb1+'/'+_0x4c8eb1+_0x24a429(0x1b6)),serviceQuery,_0x3eca49),await this[_0x24a429(0x178)](_0x167b6d+(_0x4c8eb1+'/'+_0x4c8eb1+'-mutation.ts'),serviceMutation,_0x3eca49);let _0x22a354=this[_0x24a429(0x1ce)](_0xf81aab,_0x39ebf1);await this[_0x24a429(0x178)](_0x167b6d+(_0x4c8eb1+'/'+_0x4c8eb1+_0x24a429(0x1a5)),_0x22a354,_0x3eca49);let _0x2f9f29=this[_0x24a429(0x1f5)](_0x39ebf1);await this[_0x24a429(0x178)](_0x167b6d+(_0x4c8eb1+'/'+_0x4c8eb1+'-type.ts'),_0x2f9f29,_0x3eca49);let _0x2fba37=_0x167b6d+'index.ts';0x0==await this[_0x24a429(0x1b2)](_0x2fba37)&&await this[_0x24a429(0x178)](_0x2fba37,allIndex,_0x3eca49);let _0x5c89a2=await fs[_0x24a429(0x1c7)](_0x2fba37,'utf8');_0x5c89a2[_0x24a429(0x1a7)](_0x24a429(0x170)+_0x3eca49[_0x24a429(0x1cd)]+'/'+_0x3eca49[_0x24a429(0x1cd)]+'\x27')<0x0&&(_0x5c89a2=_0x5c89a2[_0x24a429(0x199)](/\/\* EXPORT ENTITY TYPES \*\//,_0x24a429(0x1ac)+_0x3eca49[_0x24a429(0x1cd)]+'/'+_0x3eca49[_0x24a429(0x1cd)]+'\x27')),_0x5c89a2[_0x24a429(0x1a7)]('import\x20{\x20entities\x20as\x20'+_0x3eca49[_0x24a429(0x1b9)]+'Entities,\x20resolvers\x20as\x20'+_0x3eca49[_0x24a429(0x1b9)]+_0x24a429(0x1ea)+_0x3eca49[_0x24a429(0x1cd)]+'\x27')<0x0&&(_0x5c89a2=_0x5c89a2[_0x24a429(0x199)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x24a429(0x190)+_0x3eca49[_0x24a429(0x1b9)]+_0x24a429(0x1b0)+_0x3eca49[_0x24a429(0x1b9)]+_0x24a429(0x1ea)+_0x3eca49[_0x24a429(0x1cd)]+'\x27')),_0x5c89a2['indexOf'](_0x24a429(0x189)+_0x3eca49[_0x24a429(0x1b9)]+_0x24a429(0x19b))<0x0&&(_0x5c89a2=_0x5c89a2[_0x24a429(0x199)](/\/\* ENTITIES \*\//,_0x24a429(0x181)+_0x3eca49[_0x24a429(0x1b9)]+_0x24a429(0x19b))),_0x5c89a2[_0x24a429(0x1a7)](_0x24a429(0x189)+_0x3eca49[_0x24a429(0x1b9)]+'Resolvers,')<0x0&&(_0x5c89a2=_0x5c89a2[_0x24a429(0x199)](/\/\* RESOLVER CLASSES \*\//,_0x24a429(0x1af)+_0x3eca49[_0x24a429(0x1b9)]+'Resolvers,')),await this[_0x24a429(0x178)](_0x2fba37,_0x5c89a2,_0x3eca49);}['createTypeText'](_0x29bf20){const _0x191383=a0_0x2ec24c;let _0x34e559=sereviceType,_0x286697=_0x29bf20[_0x191383(0x18d)](_0x19209c=>{const _0x131b99=_0x191383;if('id'==_0x19209c[_0x131b99(0x1cd)])return'';if('domain_id'==_0x19209c[_0x131b99(0x1cd)])return'';if('created_at'==_0x19209c[_0x131b99(0x1cd)])return'';if(_0x131b99(0x1f0)==_0x19209c[_0x131b99(0x1cd)])return'';if(_0x131b99(0x198)==_0x19209c[_0x131b99(0x1cd)])return'';if('updater_id'==_0x19209c['name'])return'';let _0x49b81f=this[_0x131b99(0x172)](_0x19209c),_0xca58f0=this[_0x131b99(0x1d6)](_0x19209c),_0x4bda90=camelCase(_0x19209c['name']);return'\x20\x20'+(_0x131b99(0x1d9)+(0x0==_0x49b81f[_0x131b99(0x1c8)]?'':_0x131b99(0x1a0)+_0x49b81f+',')+'\x20{\x20nullable:\x20'+_0x19209c[_0x131b99(0x16f)]+_0x131b99(0x1d7))+'\x0a\x20\x20'+(''+_0x4bda90+(_0x19209c[_0x131b99(0x16f)]?'?':'')+':\x20'+_0xca58f0)+'\x0a';});_0x34e559=_0x34e559[_0x191383(0x199)](/{{newTypeColumns}}/g,_0x286697[_0x191383(0x1b7)]('\x0a'));let _0x8ce371=_0x29bf20[_0x191383(0x18d)](_0x573f77=>{const _0x2c8309=_0x191383;if('id'==_0x573f77[_0x2c8309(0x1cd)])return'';if(_0x2c8309(0x1e1)==_0x573f77[_0x2c8309(0x1cd)])return'';if('created_at'==_0x573f77[_0x2c8309(0x1cd)])return'';if('updated_at'==_0x573f77[_0x2c8309(0x1cd)])return'';if(_0x2c8309(0x198)==_0x573f77['name'])return'';if(_0x2c8309(0x1ec)==_0x573f77['name'])return'';let _0x462ea8=this[_0x2c8309(0x172)](_0x573f77),_0x158244=this[_0x2c8309(0x1d6)](_0x573f77);_0x573f77[_0x2c8309(0x16f)]=!0x0;let _0x3d0c24=camelCase(_0x573f77[_0x2c8309(0x1cd)]);return'\x20\x20'+('@Field('+(0x0==_0x462ea8[_0x2c8309(0x1c8)]?'':_0x2c8309(0x1a0)+_0x462ea8+',')+_0x2c8309(0x1cf)+_0x573f77['nullable']+_0x2c8309(0x1d7))+_0x2c8309(0x19e)+(''+_0x3d0c24+(_0x573f77[_0x2c8309(0x16f)]?'?':'')+':\x20'+_0x158244)+'\x0a';});return _0x34e559=_0x34e559[_0x191383(0x199)](/{{patchTypeColumns}}/g,_0x8ce371['join']('\x0a')),_0x34e559;}[a0_0x2ec24c(0x1ce)](_0x330263,_0xdee791){const _0x48937d=a0_0x2ec24c;let _0x39f923=serviceEntity,_0x46a8f4=_0xdee791[_0x48937d(0x1dd)](function(_0x281ede,_0x49ae6e){const _0x1d0626=_0x48937d;return _0x281ede['rank']-_0x49ae6e[_0x1d0626(0x1ef)];})[_0x48937d(0x18d)](_0x348f=>this['columnToEntityColumn'](_0x348f));[_0x48937d(0x1e7),_0x48937d(0x1c9)][_0x48937d(0x18f)](_0x330263[_0x48937d(0x1e3)])&&_0x46a8f4['push'](_0x48937d(0x1bb)),_0x39f923=_0x39f923[_0x48937d(0x199)](/{{entityColumns}}/g,_0x46a8f4[_0x48937d(0x1b7)]('\x0a'));let _0x353ca3='',_0xc00b5c=_0xdee791[_0x48937d(0x186)](_0x12cc7f=>_0x12cc7f['uniqRank']&&_0x12cc7f[_0x48937d(0x19f)]>0x0)[_0x48937d(0x1dd)](function(_0x4c2a91,_0x31d421){const _0x21c93c=_0x48937d;return _0x4c2a91[_0x21c93c(0x19f)]-_0x31d421[_0x21c93c(0x19f)];});if(_0xc00b5c[_0x48937d(0x1c8)]>0x0){_0x353ca3='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0x366b66=_0xc00b5c['map'](_0x3c0185=>{const _0x228078=_0x48937d;let _0x455b40=_0x3c0185['name'];return _0x228078(0x1e1)==_0x3c0185[_0x228078(0x1cd)]&&(_0x455b40=_0x228078(0x17f)),_0x228078(0x198)==_0x3c0185[_0x228078(0x1cd)]&&(_0x455b40=_0x228078(0x1d1)),_0x228078(0x1ec)==_0x3c0185[_0x228078(0x1cd)]&&(_0x455b40='updater'),_0x228078(0x1d8)+camelCase(_0x455b40);});_0x353ca3=_0x353ca3[_0x48937d(0x199)](/{{indexColumns}}/g,_0x366b66[_0x48937d(0x1b7)](','));}return _0x39f923=_0x39f923['replace'](/{{indexAnn}}/g,_0x353ca3),_0x39f923;}[a0_0x2ec24c(0x1b3)](_0x4a248a,_0x49ab1a){const _0x544914=a0_0x2ec24c;let _0x26ce8f=_0x544914(0x1c9)==_0x4a248a[_0x544914(0x1e3)]?serviceEntityHistJson:serviceEntityHistCopy,_0x12abe2=_0x49ab1a[_0x544914(0x1dd)](function(_0x183366,_0x17a877){const _0x4a805d=_0x544914;return _0x183366[_0x4a805d(0x1ef)]-_0x17a877[_0x4a805d(0x1ef)];})[_0x544914(0x18d)](_0x1f342a=>this['columnToEntityColumn'](_0x1f342a));return _0x26ce8f=_0x26ce8f[_0x544914(0x199)](/{{entityColumns}}/g,_0x12abe2[_0x544914(0x1b7)]('\x0a')),_0x26ce8f;}['columnToEntityColumn'](_0x2c6dfd){const _0x4505c8=a0_0x2ec24c;if('id'==_0x2c6dfd[_0x4505c8(0x1cd)])return'';if(_0x4505c8(0x1e1)==_0x2c6dfd['name'])return'';if(_0x4505c8(0x1e8)==_0x2c6dfd[_0x4505c8(0x1cd)])return'';if(_0x4505c8(0x1f0)==_0x2c6dfd[_0x4505c8(0x1cd)])return'';if('creator_id'==_0x2c6dfd[_0x4505c8(0x1cd)])return'';if('updater_id'==_0x2c6dfd[_0x4505c8(0x1cd)])return'';let _0x3f5392=_0x2c6dfd[_0x4505c8(0x1da)];'double'==_0x2c6dfd['colType']&&(_0x3f5392='double\x20precision'),_0x4505c8(0x1a4)==_0x2c6dfd['colType']&&(_0x3f5392=_0x4505c8(0x192)),_0x4505c8(0x1f9)==_0x2c6dfd[_0x4505c8(0x1da)]&&(_0x3f5392=_0x4505c8(0x175)),_0x4505c8(0x177)==_0x2c6dfd['colType']&&(_0x3f5392='timestamp\x20without\x20time\x20zone');let _0x564a0b='';_0x4505c8(0x1f9)==_0x2c6dfd[_0x4505c8(0x1da)]&&(_0x564a0b=_0x2c6dfd['colSize']);let _0x5ac10e=this[_0x4505c8(0x172)](_0x2c6dfd),_0x127253=this[_0x4505c8(0x1d6)](_0x2c6dfd),_0x167269=camelCase(_0x2c6dfd[_0x4505c8(0x1cd)]);return'\x20\x20'+('@Column({name:\x27'+_0x2c6dfd['name']+'\x27,\x20type:\x20\x27'+_0x3f5392+_0x4505c8(0x1ca)+_0x2c6dfd[_0x4505c8(0x16f)]+'\x20'+(0x0==_0x564a0b[_0x4505c8(0x1c8)]?'':_0x4505c8(0x18a)+_0x564a0b)+'\x20})')+'\x0a\x20\x20'+(_0x4505c8(0x1d9)+(0x0==_0x5ac10e[_0x4505c8(0x1c8)]?'':_0x4505c8(0x1a0)+_0x5ac10e+',')+_0x4505c8(0x1cf)+_0x2c6dfd['nullable']+_0x4505c8(0x1d7))+_0x4505c8(0x19e)+(''+_0x167269+(_0x2c6dfd[_0x4505c8(0x16f)]?'?':'')+':\x20'+_0x127253)+'\x0a';}[a0_0x2ec24c(0x172)](_0x13aed4){const _0x4a4f0f=a0_0x2ec24c;let _0x42709a='';return _0x4a4f0f(0x1d3)==_0x13aed4[_0x4a4f0f(0x1da)]&&(_0x42709a=_0x4a4f0f(0x1b5)),'float'==_0x13aed4[_0x4a4f0f(0x1da)]&&(_0x42709a='Float'),_0x4a4f0f(0x1a4)==_0x13aed4[_0x4a4f0f(0x1da)]&&(_0x42709a=_0x4a4f0f(0x1e4)),_0x4a4f0f(0x188)==_0x13aed4['colType']&&(_0x42709a=_0x4a4f0f(0x1e4)),_0x42709a;}[a0_0x2ec24c(0x1d6)](_0x28a489){const _0x506516=a0_0x2ec24c;let _0x3c3364=_0x28a489['colType'];return _0x506516(0x17a)==_0x28a489['colType']&&(_0x3c3364=_0x506516(0x1a6)),_0x506516(0x1d3)==_0x28a489['colType']&&(_0x3c3364=_0x506516(0x1a6)),'float'==_0x28a489[_0x506516(0x1da)]&&(_0x3c3364=_0x506516(0x1a6)),_0x506516(0x188)==_0x28a489['colType']&&(_0x3c3364='number'),_0x506516(0x1a4)==_0x28a489[_0x506516(0x1da)]&&(_0x3c3364='number'),_0x506516(0x177)==_0x28a489['colType']&&(_0x3c3364=_0x506516(0x195)),_0x506516(0x1e5)==_0x28a489[_0x506516(0x1da)]&&(_0x3c3364='Date'),_0x506516(0x1a9)==_0x28a489['colType']&&(_0x3c3364=_0x506516(0x1f9)),_0x3c3364;}async[a0_0x2ec24c(0x178)](_0x361ef0,_0x1126be,_0xd90656){const _0x46fa70=a0_0x2ec24c;await fs[_0x46fa70(0x1cc)](_0x361ef0,this['replaceNamesMap'](_0x1126be,_0xd90656),_0x46fa70(0x1f2));}['replaceNamesMap'](_0x529ad0,_0x433921){const _0x1250f2=a0_0x2ec24c;return _0x529ad0['replace'](/{{pascalCase name}}/g,_0x433921[_0x1250f2(0x1b9)])[_0x1250f2(0x199)](/{{camelCase name}}/g,_0x433921[_0x1250f2(0x1eb)])[_0x1250f2(0x199)](/{{snakeCase name}}/g,_0x433921[_0x1250f2(0x18e)])[_0x1250f2(0x199)](/{{pluralPascalCase name}}/g,_0x433921['pluralPascalCaseName'])[_0x1250f2(0x199)](/{{pluralCamelCase name}}/g,_0x433921[_0x1250f2(0x196)])[_0x1250f2(0x199)](/{{tableName}}/g,_0x433921[_0x1250f2(0x19d)])[_0x1250f2(0x199)](/{{name}}/g,_0x433921[_0x1250f2(0x1cd)]);}async[a0_0x2ec24c(0x1d5)](_0x20fe6e,_0x336015,_0x5a49eb){const _0x4b9189=a0_0x2ec24c;let _0xd8269d=_0x20fe6e+_0x4b9189(0x1d2);await this[_0x4b9189(0x1d4)](_0xd8269d),_0xd8269d=_0xd8269d+'/'+_0x336015,await this[_0x4b9189(0x1d4)](_0xd8269d),_0xd8269d+=_0x4b9189(0x1f8),await this['createDir'](_0xd8269d),_0xd8269d+=_0x4b9189(0x1e2),await this[_0x4b9189(0x1d4)](_0xd8269d),_0xd8269d=_0xd8269d+'/'+_0x5a49eb,await this[_0x4b9189(0x1d4)](_0xd8269d);}[a0_0x2ec24c(0x1e9)](){const _0x2cd805=a0_0x2ec24c;let _0x3be103=process[_0x2cd805(0x194)]['PWD'][_0x2cd805(0x182)]('/'),_0x1966e5=[];for(let _0x3ca131=0x0;_0x3ca131<_0x3be103[_0x2cd805(0x1c8)]&&_0x2cd805(0x184)!=_0x3be103[_0x3ca131];_0x3ca131++)_0x1966e5['push'](_0x3be103[_0x3ca131]);return _0x1966e5[_0x2cd805(0x1b7)]('/');}async['createDir'](_0x327663){const _0xc715b6=a0_0x2ec24c;0x0==await this[_0xc715b6(0x1b2)](_0x327663)&&fs[_0xc715b6(0x1db)](_0x327663);}async[a0_0x2ec24c(0x1b2)](_0x1dc481){const _0xd85276=a0_0x2ec24c;return await fs[_0xd85276(0x1bd)](_0x1dc481);}};tslib_1[a0_0x2ec24c(0x1aa)]([(0x0,type_graphql_1['Query'])(_0x49e44c=>Boolean,{'description':a0_0x2ec24c(0x19c)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x2ec24c(0x185)])('id')),tslib_1[a0_0x2ec24c(0x1f4)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x2ec24c(0x193)](a0_0x2ec24c(0x1bf),Function),tslib_1['__metadata'](a0_0x2ec24c(0x1a3),[String,Object]),tslib_1['__metadata'](a0_0x2ec24c(0x17e),Promise)],OperatoToolCreateService[a0_0x2ec24c(0x1cb)],a0_0x2ec24c(0x17d),null),OperatoToolCreateService=tslib_1[a0_0x2ec24c(0x1aa)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports[a0_0x2ec24c(0x18b)]=OperatoToolCreateService;const allIndex='\x0a/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0a\x0a/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0a\x0aexport\x20const\x20entities\x20=\x20[\x20\x20\x0a\x20\x20/*\x20ENTITIES\x20*/\x0a]\x20\x0a\x0a\x0aexport\x20const\x20schema\x20=\x20{\x0a\x20\x20resolverClasses:\x20[\x0a\x20\x20\x20\x20/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x20\x20]\x20\x0a}\x0a\x0aexport\x20const\x20subscribers\x20=\x20[\x0a\x20\x20/*\x20SUBSCRIBERS\x20*/\x0a]\x0a',serviceIndex=a0_0x2ec24c(0x17c),serviceHistoryIndex=a0_0x2ec24c(0x1b1),serviceQuery=a0_0x2ec24c(0x1ab),serviceHistoryQuery=a0_0x2ec24c(0x183),serviceMutation=a0_0x2ec24c(0x1be),sereviceType=a0_0x2ec24c(0x1a8),sereviceHistoryType=a0_0x2ec24c(0x1d0),serviceEntity=a0_0x2ec24c(0x19a),serviceEntityHistCopy='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntityHistJson=a0_0x2ec24c(0x174),serviceEntitySubscriber=a0_0x2ec24c(0x180);
@@ -1 +1 @@
1
- 'use strict';const a0_0xea7a12=a0_0x39f0;(function(_0x52e67a,_0x5b45ce){const _0x2e6201=a0_0x39f0,_0x5724af=_0x52e67a();while(!![]){try{const _0xa26ae1=-parseInt(_0x2e6201(0xd3))/0x1+-parseInt(_0x2e6201(0xcc))/0x2*(-parseInt(_0x2e6201(0xc0))/0x3)+-parseInt(_0x2e6201(0xc5))/0x4*(parseInt(_0x2e6201(0xd4))/0x5)+parseInt(_0x2e6201(0xe3))/0x6*(parseInt(_0x2e6201(0xd1))/0x7)+parseInt(_0x2e6201(0xc7))/0x8*(-parseInt(_0x2e6201(0xc6))/0x9)+-parseInt(_0x2e6201(0xe1))/0xa+-parseInt(_0x2e6201(0xbf))/0xb*(-parseInt(_0x2e6201(0xca))/0xc);if(_0xa26ae1===_0x5b45ce)break;else _0x5724af['push'](_0x5724af['shift']());}catch(_0x264c1e){_0x5724af['push'](_0x5724af['shift']());}}}(a0_0x469a,0xef3d1));function a0_0x39f0(_0x3caa1c,_0x261b54){const _0x469ae3=a0_0x469a();return a0_0x39f0=function(_0x39f01e,_0x276230){_0x39f01e=_0x39f01e-0xbe;let _0x33ee48=_0x469ae3[_0x39f01e];return _0x33ee48;},a0_0x39f0(_0x3caa1c,_0x261b54);}Object[a0_0xea7a12(0xd9)](exports,a0_0xea7a12(0xd5),{'value':!0x0}),exports['checkStudioTemplateIsOverLimit']=exports[a0_0xea7a12(0xde)]=void 0x0;const operato_license_checker_1=require('@things-factory/operato-license-checker'),shell_1=require(a0_0xea7a12(0xc1)),menu_base_1=require(a0_0xea7a12(0xe4)),license_error_1=require('../../errors/license-error');async function checkStudioPermission(){const _0x48cccf=a0_0xea7a12;let _0x4f97d9=((0x0,operato_license_checker_1['getPermission'])(_0x48cccf(0xe5))||',')[_0x48cccf(0xd8)](',')[_0x48cccf(0xcf)](_0x1252a3=>_0x1252a3[_0x48cccf(0xdd)]()),_0x3ddd6c=!0x1;return _0x4f97d9[_0x48cccf(0xc8)](_0x3464c9=>{const _0x324c14=_0x48cccf;_0x3464c9[_0x324c14(0xbe)](_0x324c14(0xce))&&(_0x3ddd6c=!0x0);}),_0x3ddd6c;}function a0_0x469a(){const _0x51b71a=['@things-factory/menu-base','Permissions\x20For\x20Tailor\x20Tool','INVALID_LICENSE','includes','31267841DZUaAb','890811gjbLEG','@things-factory/shell','getRepository','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','Menu','550404uFTmlX','9XfjcBa','5012920Qqytfs','forEach','manager','12kOCjMl','from','2aDmgYN','getCount','Studio','map','select','7ROwnjz','ERROR_CODES','1736818PZsCiv','55udvoSL','__esModule','where','LicenseError','split','defineProperty','checkStudioTemplateIsOverLimit','id\x20!=\x20:id','createQueryBuilder','trim','checkStudioPermission','menu','andWhere','2365240yZpWVr','OVER_LIMIT','11724126BjSbaV'];a0_0x469a=function(){return _0x51b71a;};return a0_0x469a();}async function checkStudioTemplateIsOverLimit(_0x453cb6,_0x434819){const _0x53e683=a0_0xea7a12;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x53e683(0xd7))]({'errorCode':_0x434819['t'](license_error_1[_0x53e683(0xd7)][_0x53e683(0xd2)][_0x53e683(0xe6)])});var _0x2603b7=0x0;if(_0x2603b7=_0x453cb6&&''!=_0x453cb6?await(0x0,shell_1['getRepository'])(menu_base_1[_0x53e683(0xc4)])[_0x53e683(0xc9)][_0x53e683(0xdc)]()[_0x53e683(0xd0)](_0x53e683(0xdf))['from'](menu_base_1['Menu'],'menu')[_0x53e683(0xd6)](_0x53e683(0xdb),{'id':_0x453cb6})[_0x53e683(0xe0)]('(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)')[_0x53e683(0xcd)]()+0x1:await(0x0,shell_1[_0x53e683(0xc2)])(menu_base_1[_0x53e683(0xc4)])[_0x53e683(0xc9)][_0x53e683(0xdc)]()[_0x53e683(0xd0)](_0x53e683(0xdf))[_0x53e683(0xcb)](menu_base_1[_0x53e683(0xc4)],_0x53e683(0xdf))['where'](_0x53e683(0xc3))[_0x53e683(0xcd)]()+0x1,!(0x0,operato_license_checker_1['checkTarget'])(_0x2603b7))throw new license_error_1['LicenseError']({'errorCode':_0x434819['t'](license_error_1[_0x53e683(0xd7)][_0x53e683(0xd2)][_0x53e683(0xe2)])});return!0x0;}exports[a0_0xea7a12(0xde)]=checkStudioPermission,exports[a0_0xea7a12(0xda)]=checkStudioTemplateIsOverLimit;
1
+ 'use strict';const a0_0x15fcf0=a0_0x1f96;(function(_0xdf85e2,_0x2f7770){const _0xb16a9e=a0_0x1f96,_0xd554b5=_0xdf85e2();while(!![]){try{const _0x75ffbf=-parseInt(_0xb16a9e(0x1b8))/0x1*(-parseInt(_0xb16a9e(0x19c))/0x2)+parseInt(_0xb16a9e(0x1b4))/0x3*(-parseInt(_0xb16a9e(0x1a7))/0x4)+parseInt(_0xb16a9e(0x1a6))/0x5+parseInt(_0xb16a9e(0x1b5))/0x6+-parseInt(_0xb16a9e(0x1a3))/0x7+parseInt(_0xb16a9e(0x19b))/0x8+parseInt(_0xb16a9e(0x1be))/0x9*(-parseInt(_0xb16a9e(0x1af))/0xa);if(_0x75ffbf===_0x2f7770)break;else _0xd554b5['push'](_0xd554b5['shift']());}catch(_0x2225ee){_0xd554b5['push'](_0xd554b5['shift']());}}}(a0_0x8a95,0x966b3));function a0_0x8a95(){const _0x3c0382=['2884635cUAbKH','501292nSbjWd','defineProperty','Studio','createQueryBuilder','menu','from','ERROR_CODES','id\x20!=\x20:id','64490LtCQYk','checkTarget','INVALID_LICENSE','select','getPermission','9WRTEDb','4149456rWpeUr','getRepository','manager','1ESiijJ','checkStudioTemplateIsOverLimit','Menu','forEach','LicenseError','trim','45NQPmYe','../../errors/license-error','where','3811136ZKkYmM','783164egAatO','@things-factory/operato-license-checker','map','getCount','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','checkStudioPermission','andWhere','7785036yjVrSs','split','@things-factory/menu-base'];a0_0x8a95=function(){return _0x3c0382;};return a0_0x8a95();}Object[a0_0x15fcf0(0x1a8)](exports,'__esModule',{'value':!0x0}),exports[a0_0x15fcf0(0x1b9)]=exports[a0_0x15fcf0(0x1a1)]=void 0x0;const operato_license_checker_1=require(a0_0x15fcf0(0x19d)),shell_1=require('@things-factory/shell'),menu_base_1=require(a0_0x15fcf0(0x1a5)),license_error_1=require(a0_0x15fcf0(0x199));function a0_0x1f96(_0x45234c,_0x556d6f){const _0x8a952f=a0_0x8a95();return a0_0x1f96=function(_0x1f9690,_0x5ceaba){_0x1f9690=_0x1f9690-0x199;let _0x3bc174=_0x8a952f[_0x1f9690];return _0x3bc174;},a0_0x1f96(_0x45234c,_0x556d6f);}async function checkStudioPermission(){const _0x1eee66=a0_0x15fcf0;let _0x1091ea=((0x0,operato_license_checker_1[_0x1eee66(0x1b3)])('Permissions\x20For\x20Tailor\x20Tool')||',')[_0x1eee66(0x1a4)](',')[_0x1eee66(0x19e)](_0x3612fa=>_0x3612fa[_0x1eee66(0x1bd)]()),_0x23476b=!0x1;return _0x1091ea[_0x1eee66(0x1bb)](_0x4850f7=>{const _0x37e62f=_0x1eee66;_0x4850f7['includes'](_0x37e62f(0x1a9))&&(_0x23476b=!0x0);}),_0x23476b;}async function checkStudioTemplateIsOverLimit(_0x2a19e1,_0x526875){const _0x21c463=a0_0x15fcf0;if(0x0==await checkStudioPermission())throw new license_error_1['LicenseError']({'errorCode':_0x526875['t'](license_error_1['LicenseError'][_0x21c463(0x1ad)][_0x21c463(0x1b1)])});var _0x1fd03d=0x0;if(_0x1fd03d=_0x2a19e1&&''!=_0x2a19e1?await(0x0,shell_1[_0x21c463(0x1b6)])(menu_base_1[_0x21c463(0x1ba)])[_0x21c463(0x1b7)][_0x21c463(0x1aa)]()[_0x21c463(0x1b2)](_0x21c463(0x1ab))[_0x21c463(0x1ac)](menu_base_1[_0x21c463(0x1ba)],_0x21c463(0x1ab))[_0x21c463(0x19a)](_0x21c463(0x1ae),{'id':_0x2a19e1})[_0x21c463(0x1a2)](_0x21c463(0x1a0))[_0x21c463(0x19f)]()+0x1:await(0x0,shell_1['getRepository'])(menu_base_1['Menu'])['manager'][_0x21c463(0x1aa)]()[_0x21c463(0x1b2)](_0x21c463(0x1ab))[_0x21c463(0x1ac)](menu_base_1['Menu'],_0x21c463(0x1ab))[_0x21c463(0x19a)](_0x21c463(0x1a0))[_0x21c463(0x19f)]()+0x1,!(0x0,operato_license_checker_1[_0x21c463(0x1b0)])(_0x1fd03d))throw new license_error_1[(_0x21c463(0x1bc))]({'errorCode':_0x526875['t'](license_error_1[_0x21c463(0x1bc)]['ERROR_CODES']['OVER_LIMIT'])});return!0x0;}exports[a0_0x15fcf0(0x1a1)]=checkStudioPermission,exports[a0_0x15fcf0(0x1b9)]=checkStudioTemplateIsOverLimit;
@@ -1 +1 @@
1
- 'use strict';function a0_0x4e9c(){const _0xc77048=['3934630EbiBsl','__param','Query','checkStudioTemplateIsOverLimit','Ctx','35PUCHYq','1525638zCYbxt','design:paramtypes','748010FHaLIB','prototype','OperatoToolResolver','design:returntype','Operato\x20Tool\x20Studio\x20Usage\x20Permissions','type-graphql','616665cLifVs','defineProperty','tslib','design:type','./tool-permission','698484jUncDv','3Zsnkzp','__metadata','Arg','4911592SUBgot','436542dgOral','studioTemplateIsOverLimit','__decorate','18wTSaZH'];a0_0x4e9c=function(){return _0xc77048;};return a0_0x4e9c();}const a0_0x3d156d=a0_0x522a;(function(_0x5a2e5a,_0x4ab99d){const _0xe7d2b0=a0_0x522a,_0x6ed395=_0x5a2e5a();while(!![]){try{const _0x13416f=parseInt(_0xe7d2b0(0x11a))/0x1+parseInt(_0xe7d2b0(0x12e))/0x2*(-parseInt(_0xe7d2b0(0x120))/0x3)+-parseInt(_0xe7d2b0(0x11f))/0x4+parseInt(_0xe7d2b0(0x12d))/0x5*(parseInt(_0xe7d2b0(0x124))/0x6)+-parseInt(_0xe7d2b0(0x128))/0x7+parseInt(_0xe7d2b0(0x123))/0x8+-parseInt(_0xe7d2b0(0x127))/0x9*(-parseInt(_0xe7d2b0(0x130))/0xa);if(_0x13416f===_0x4ab99d)break;else _0x6ed395['push'](_0x6ed395['shift']());}catch(_0x22dd96){_0x6ed395['push'](_0x6ed395['shift']());}}}(a0_0x4e9c,0x5f361));Object[a0_0x3d156d(0x11b)](exports,'__esModule',{'value':!0x0}),exports[a0_0x3d156d(0x132)]=void 0x0;const tslib_1=require(a0_0x3d156d(0x11c)),type_graphql_1=require(a0_0x3d156d(0x119)),tool_permission_1=require(a0_0x3d156d(0x11e));let OperatoToolResolver=class{async['studioPermission'](_0x2e3bb6){return(0x0,tool_permission_1['checkStudioPermission'])();}async[a0_0x3d156d(0x125)](_0x140d64,_0x32defe){const _0x3fa1c3=a0_0x3d156d;return(0x0,tool_permission_1[_0x3fa1c3(0x12b)])(_0x140d64,_0x32defe);}};function a0_0x522a(_0x46b25f,_0x1a6686){const _0x4e9c61=a0_0x4e9c();return a0_0x522a=function(_0x522aad,_0x2feac8){_0x522aad=_0x522aad-0x119;let _0x1bb9df=_0x4e9c61[_0x522aad];return _0x1bb9df;},a0_0x522a(_0x46b25f,_0x1a6686);}tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x3d156d(0x12a)])(_0x7b63a0=>Boolean,{'description':a0_0x3d156d(0x134)}),tslib_1[a0_0x3d156d(0x129)](0x0,(0x0,type_graphql_1[a0_0x3d156d(0x12c)])()),tslib_1['__metadata'](a0_0x3d156d(0x11d),Function),tslib_1['__metadata'](a0_0x3d156d(0x12f),[Object]),tslib_1['__metadata']('design:returntype',Promise)],OperatoToolResolver[a0_0x3d156d(0x131)],'studioPermission',null),tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x3d156d(0x12a)])(_0x479a55=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Limit\x20check'}),tslib_1[a0_0x3d156d(0x129)](0x0,(0x0,type_graphql_1[a0_0x3d156d(0x122)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x3d156d(0x12c)])()),tslib_1[a0_0x3d156d(0x121)]('design:type',Function),tslib_1[a0_0x3d156d(0x121)](a0_0x3d156d(0x12f),[String,Object]),tslib_1['__metadata'](a0_0x3d156d(0x133),Promise)],OperatoToolResolver['prototype'],'studioTemplateIsOverLimit',null),OperatoToolResolver=tslib_1[a0_0x3d156d(0x126)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolResolver),exports[a0_0x3d156d(0x132)]=OperatoToolResolver;
1
+ 'use strict';const a0_0x439120=a0_0x24d2;(function(_0x5e0f62,_0x56efeb){const _0x4ba5ae=a0_0x24d2,_0x51c8bc=_0x5e0f62();while(!![]){try{const _0x475bae=-parseInt(_0x4ba5ae(0x179))/0x1*(-parseInt(_0x4ba5ae(0x178))/0x2)+-parseInt(_0x4ba5ae(0x15c))/0x3*(-parseInt(_0x4ba5ae(0x177))/0x4)+parseInt(_0x4ba5ae(0x15e))/0x5+-parseInt(_0x4ba5ae(0x172))/0x6+-parseInt(_0x4ba5ae(0x163))/0x7*(-parseInt(_0x4ba5ae(0x167))/0x8)+-parseInt(_0x4ba5ae(0x15a))/0x9*(parseInt(_0x4ba5ae(0x161))/0xa)+-parseInt(_0x4ba5ae(0x166))/0xb;if(_0x475bae===_0x56efeb)break;else _0x51c8bc['push'](_0x51c8bc['shift']());}catch(_0x1fce19){_0x51c8bc['push'](_0x51c8bc['shift']());}}}(a0_0xa775,0xa9b06));Object[a0_0x439120(0x16d)](exports,a0_0x439120(0x16e),{'value':!0x0}),exports['OperatoToolResolver']=void 0x0;function a0_0xa775(){const _0x1c8e8c=['182134bXWPAK','36jGWrAW','Query','153744NPHcmZ','Operato\x20Tool\x20Studio\x20Limit\x20check','271575ssUKUc','checkStudioTemplateIsOverLimit','Operato\x20Tool\x20Studio\x20Usage\x20Permissions','503820JZSLZu','__metadata','1070517oLUdfo','Arg','design:type','12129139hJHzhP','32CfnLdu','Ctx','studioPermission','studioTemplateIsOverLimit','__param','OperatoToolResolver','defineProperty','__esModule','type-graphql','design:returntype','design:paramtypes','1599408KhAEmB','Resolver','__decorate','prototype','./tool-permission','68ZDzFhk','8zOHfSM'];a0_0xa775=function(){return _0x1c8e8c;};return a0_0xa775();}const tslib_1=require('tslib'),type_graphql_1=require(a0_0x439120(0x16f)),tool_permission_1=require(a0_0x439120(0x176));function a0_0x24d2(_0x3ecbda,_0x59e1bb){const _0xa775e8=a0_0xa775();return a0_0x24d2=function(_0x24d288,_0x47cd2d){_0x24d288=_0x24d288-0x15a;let _0x54a72d=_0xa775e8[_0x24d288];return _0x54a72d;},a0_0x24d2(_0x3ecbda,_0x59e1bb);}let OperatoToolResolver=class{async[a0_0x439120(0x169)](_0x17646c){return(0x0,tool_permission_1['checkStudioPermission'])();}async[a0_0x439120(0x16a)](_0x257dd8,_0x4cc87){const _0x4bb31d=a0_0x439120;return(0x0,tool_permission_1[_0x4bb31d(0x15f)])(_0x257dd8,_0x4cc87);}};tslib_1[a0_0x439120(0x174)]([(0x0,type_graphql_1['Query'])(_0x546d8d=>Boolean,{'description':a0_0x439120(0x160)}),tslib_1[a0_0x439120(0x16b)](0x0,(0x0,type_graphql_1[a0_0x439120(0x168)])()),tslib_1['__metadata']('design:type',Function),tslib_1['__metadata'](a0_0x439120(0x171),[Object]),tslib_1[a0_0x439120(0x162)]('design:returntype',Promise)],OperatoToolResolver[a0_0x439120(0x175)],a0_0x439120(0x169),null),tslib_1[a0_0x439120(0x174)]([(0x0,type_graphql_1[a0_0x439120(0x15b)])(_0x1656ff=>Boolean,{'description':a0_0x439120(0x15d)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x439120(0x164)])('id')),tslib_1[a0_0x439120(0x16b)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x439120(0x162)](a0_0x439120(0x165),Function),tslib_1['__metadata'](a0_0x439120(0x171),[String,Object]),tslib_1[a0_0x439120(0x162)](a0_0x439120(0x170),Promise)],OperatoToolResolver[a0_0x439120(0x175)],'studioTemplateIsOverLimit',null),OperatoToolResolver=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x439120(0x173)])()],OperatoToolResolver),exports[a0_0x439120(0x16c)]=OperatoToolResolver;