@things-factory/operato-tools 6.0.32 → 6.0.36

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_0x581ab8=a0_0x4e96;(function(_0x1c00a6,_0x353252){const _0x406ea6=a0_0x4e96,_0x564db5=_0x1c00a6();while(!![]){try{const _0x608d98=-parseInt(_0x406ea6(0x143))/0x1*(parseInt(_0x406ea6(0x14f))/0x2)+parseInt(_0x406ea6(0x150))/0x3*(parseInt(_0x406ea6(0x14c))/0x4)+-parseInt(_0x406ea6(0x14a))/0x5+-parseInt(_0x406ea6(0x14e))/0x6*(parseInt(_0x406ea6(0x14b))/0x7)+-parseInt(_0x406ea6(0x146))/0x8+-parseInt(_0x406ea6(0x13e))/0x9*(parseInt(_0x406ea6(0x147))/0xa)+parseInt(_0x406ea6(0x145))/0xb;if(_0x608d98===_0x353252)break;else _0x564db5['push'](_0x564db5['shift']());}catch(_0x5c41cd){_0x564db5['push'](_0x564db5['shift']());}}}(a0_0x1d3b,0x2f131));function a0_0x1d3b(){const _0x127fb9=['name','6CKjXHI','8194JmZLmB','37569urySNp','detail','__importStar','__esModule','765BjhYJk','ERROR_CODES','tslib','defineProperty','license-error','7yjYglL','LicenseError','8445536fNunvj','3030952aAxXzR','39830aXnoRD','../constants/error-code','errorCode','105300DOUNHx','1196741EbSiPw','116TLGHDN'];a0_0x1d3b=function(){return _0x127fb9;};return a0_0x1d3b();}Object[a0_0x581ab8(0x141)](exports,a0_0x581ab8(0x13d),{'value':!0x0}),exports[a0_0x581ab8(0x144)]=void 0x0;const tslib_1=require(a0_0x581ab8(0x140)),ERROR_CODES=tslib_1[a0_0x581ab8(0x13c)](require(a0_0x581ab8(0x148)));class LicenseError extends Error{static get[a0_0x581ab8(0x13f)](){return Object['assign']({},ERROR_CODES);}constructor({errorCode:_0x11d216,detail:_0x3950ed}){const _0x59e1fe=a0_0x581ab8;super(_0x11d216),this[_0x59e1fe(0x14d)]=_0x59e1fe(0x142),this[_0x59e1fe(0x149)]=_0x11d216,this[_0x59e1fe(0x13b)]=_0x3950ed;}}function a0_0x4e96(_0x4c038b,_0x122758){const _0x1d3b4d=a0_0x1d3b();return a0_0x4e96=function(_0x4e9688,_0x5b0cd8){_0x4e9688=_0x4e9688-0x13b;let _0x16f811=_0x1d3b4d[_0x4e9688];return _0x16f811;},a0_0x4e96(_0x4c038b,_0x122758);}exports[a0_0x581ab8(0x144)]=LicenseError;
1
+ 'use strict';const a0_0x55c220=a0_0x4418;(function(_0x160e34,_0x1f6a8c){const _0x329a6c=a0_0x4418,_0x59acdc=_0x160e34();while(!![]){try{const _0x24794d=-parseInt(_0x329a6c(0x1bf))/0x1+parseInt(_0x329a6c(0x1bc))/0x2+-parseInt(_0x329a6c(0x1ad))/0x3*(-parseInt(_0x329a6c(0x1af))/0x4)+-parseInt(_0x329a6c(0x1bd))/0x5*(parseInt(_0x329a6c(0x1b8))/0x6)+-parseInt(_0x329a6c(0x1ac))/0x7*(parseInt(_0x329a6c(0x1ba))/0x8)+-parseInt(_0x329a6c(0x1b2))/0x9+-parseInt(_0x329a6c(0x1b5))/0xa*(-parseInt(_0x329a6c(0x1b1))/0xb);if(_0x24794d===_0x1f6a8c)break;else _0x59acdc['push'](_0x59acdc['shift']());}catch(_0x2f93d0){_0x59acdc['push'](_0x59acdc['shift']());}}}(a0_0x4e64,0xbe5bf));function a0_0x4418(_0x2b27ec,_0x37c438){const _0x4e64cd=a0_0x4e64();return a0_0x4418=function(_0x4418b2,_0x50409f){_0x4418b2=_0x4418b2-0x1ab;let _0x49b8b9=_0x4e64cd[_0x4418b2];return _0x49b8b9;},a0_0x4418(_0x2b27ec,_0x37c438);}Object[a0_0x55c220(0x1b6)](exports,a0_0x55c220(0x1be),{'value':!0x0}),exports[a0_0x55c220(0x1b3)]=void 0x0;const tslib_1=require(a0_0x55c220(0x1b7)),ERROR_CODES=tslib_1['__importStar'](require(a0_0x55c220(0x1ab)));class LicenseError extends Error{static get[a0_0x55c220(0x1ae)](){return Object['assign']({},ERROR_CODES);}constructor({errorCode:_0x5e768d,detail:_0x4334aa}){const _0x5419d6=a0_0x55c220;super(_0x5e768d),this[_0x5419d6(0x1b4)]=_0x5419d6(0x1b0),this[_0x5419d6(0x1b9)]=_0x5e768d,this[_0x5419d6(0x1bb)]=_0x4334aa;}}function a0_0x4e64(){const _0x1c896f=['name','6680OTIemH','defineProperty','tslib','3715566OYpKeA','errorCode','20816omYQRM','detail','190610nZDDxl','10xbBQmx','__esModule','508519atzUYP','../constants/error-code','2807uCKbZr','994062ObSANS','ERROR_CODES','4EoctYC','license-error','56254UGkTbo','2453913kwzMdY','LicenseError'];a0_0x4e64=function(){return _0x1c896f;};return a0_0x4e64();}exports[a0_0x55c220(0x1b3)]=LicenseError;
package/server/routes.js CHANGED
@@ -1 +1 @@
1
- function a0_0xaa90(){const _0x206c17=['8273460aSpAQF','1921682RlKmja','25136eJODvJ','660gBgEJC','debug','21863676CECpSJ','bootstrap-module-global-private-route','things-factory:operato-tools:routes','541689FUyWyU','11PBTVrA','27978mWkVqV','4vsTjgu','bootstrap-module-domain-private-route','270040ZytkeJ','6BlWaJk','1899EofSGD','bootstrap-module-domain-public-route'];a0_0xaa90=function(){return _0x206c17;};return a0_0xaa90();}function a0_0x4d89(_0x15dc7d,_0x41fe13){const _0xaa90e4=a0_0xaa90();return a0_0x4d89=function(_0x4d89f5,_0xfd3298){_0x4d89f5=_0x4d89f5-0x6d;let _0x10cc08=_0xaa90e4[_0x4d89f5];return _0x10cc08;},a0_0x4d89(_0x15dc7d,_0x41fe13);}const a0_0x41c9ec=a0_0x4d89;(function(_0x5a5823,_0x114026){const _0x868604=a0_0x4d89,_0x215caf=_0x5a5823();while(!![]){try{const _0x3e795a=-parseInt(_0x868604(0x6e))/0x1*(-parseInt(_0x868604(0x6f))/0x2)+parseInt(_0x868604(0x7a))/0x3*(parseInt(_0x868604(0x7d))/0x4)+parseInt(_0x868604(0x75))/0x5*(-parseInt(_0x868604(0x7c))/0x6)+-parseInt(_0x868604(0x73))/0x7+parseInt(_0x868604(0x74))/0x8*(-parseInt(_0x868604(0x70))/0x9)+-parseInt(_0x868604(0x72))/0xa+parseInt(_0x868604(0x7b))/0xb*(parseInt(_0x868604(0x77))/0xc);if(_0x3e795a===_0x114026)break;else _0x215caf['push'](_0x215caf['shift']());}catch(_0x4dd107){_0x215caf['push'](_0x215caf['shift']());}}}(a0_0xaa90,0x698b2));const debug=require(a0_0x41c9ec(0x76))(a0_0x41c9ec(0x79));process['on']('bootstrap-module-global-public-route',(_0x1412ca,_0x14bba7)=>{}),process['on'](a0_0x41c9ec(0x78),(_0x10bd1b,_0x5dee7d)=>{}),process['on'](a0_0x41c9ec(0x71),(_0x220458,_0x274925)=>{}),process['on'](a0_0x41c9ec(0x6d),(_0x5e97f6,_0x56f65b)=>{});
1
+ function a0_0x1d55(_0x6482e9,_0x585ab2){const _0x1db911=a0_0x1db9();return a0_0x1d55=function(_0x1d55fd,_0xb35888){_0x1d55fd=_0x1d55fd-0x14d;let _0x46845b=_0x1db911[_0x1d55fd];return _0x46845b;},a0_0x1d55(_0x6482e9,_0x585ab2);}const a0_0x5717ae=a0_0x1d55;function a0_0x1db9(){const _0x4cb6fc=['16020HSIjjv','bootstrap-module-global-private-route','3820873mrCFCu','bootstrap-module-global-public-route','4529352oRIQqw','715941MZFgFb','73XiWpaa','bootstrap-module-domain-public-route','5UHpfRx','10mPvBlS','bootstrap-module-domain-private-route','4539rKKYCl','1947UGZrit','1850QmSrEY','things-factory:operato-tools:routes','3236244gnRPMF','60oOVacd'];a0_0x1db9=function(){return _0x4cb6fc;};return a0_0x1db9();}(function(_0x25fb1e,_0x510b5c){const _0x53d4a8=a0_0x1d55,_0x481769=_0x25fb1e();while(!![]){try{const _0x332e00=parseInt(_0x53d4a8(0x15d))/0x1*(-parseInt(_0x53d4a8(0x153))/0x2)+-parseInt(_0x53d4a8(0x151))/0x3*(parseInt(_0x53d4a8(0x156))/0x4)+-parseInt(_0x53d4a8(0x14e))/0x5*(-parseInt(_0x53d4a8(0x155))/0x6)+-parseInt(_0x53d4a8(0x159))/0x7+parseInt(_0x53d4a8(0x15b))/0x8+parseInt(_0x53d4a8(0x15c))/0x9*(parseInt(_0x53d4a8(0x14f))/0xa)+parseInt(_0x53d4a8(0x152))/0xb*(-parseInt(_0x53d4a8(0x157))/0xc);if(_0x332e00===_0x510b5c)break;else _0x481769['push'](_0x481769['shift']());}catch(_0x2941e2){_0x481769['push'](_0x481769['shift']());}}}(a0_0x1db9,0x4c5a2));const debug=require('debug')(a0_0x5717ae(0x154));process['on'](a0_0x5717ae(0x15a),(_0x1857db,_0x22b1fa)=>{}),process['on'](a0_0x5717ae(0x158),(_0x51ee22,_0x5e1325)=>{}),process['on'](a0_0x5717ae(0x14d),(_0x48d538,_0x3d3f01)=>{}),process['on'](a0_0x5717ae(0x150),(_0x3e0dfa,_0x3c20b9)=>{});
@@ -1 +1 @@
1
- 'use strict';function a0_0xfcb8(){const _0x5b1611=['hiddenFlag',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','createSortCols','toString','\x22,\x22desc\x22:','Mutation','4340448PeUJdV','menuType','pluralize','createCipheriv','searchOper','tslib','aes-256-ecb','__esModule','substring','final','Ctx','__param','design:type','\x20,\x22exportable\x22:\x20true','__importDefault','aes-256-ofb','aes256','query','{\x22name\x22:\x20\x22','654601Xhksss','updater_id','h1z0q9i9x7q6','__metadata','state','15280920RJWxlt','createGridColumns','Arg','rank','{\x22type\x22:\x20\x22','updater','Menu','default','__decorate','creator_id','parent','replace','\x22,\x22width\x22:\x2080,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','map','filter','aes-256-cfb1','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','aes-256-cbc','dataProp','./../tool-secret/tool-permission','utf8','from','SCREEN','design:returntype','gridRank','code','Directive','813hnCbJP',',\x22object_opt\x22:{\x22queryName\x22:\x22','3083804YNMesf','stringify','routing','415970mZpLRB','\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','sort','searchRank','getRepository','length','hex','entity','defineProperty','\x22,\x22operator\x22:\x20\x22','creator','@things-factory/menu-base','\x27\x20or\x20id\x20=\x20\x27','design:paramtypes','join','find','636PGoZbU','\x22,\x22header\x22:\x20\x22','toolCreateMenu','aes-256-cfb8','refName',',\x22mandatory\x22:\x20','parent_menu_id','@things-factory/resource-base','prototype','crypto','@transaction','aes-256-ctr',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','1351cDPEBT','hidden','assign','refType','\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\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','findOne','left','createMenuData','scenario','push','1704ZmzFQz','OperatoToolCreateMenu','name','EntityColumn','JSON','Operato\x20Tool\x20Create\x20Menu','\x22,\x22width\x22:','sortRank','enc','randomBytes','string','checkStudioTemplateIsOverLimit','createSearchCols'];a0_0xfcb8=function(){return _0x5b1611;};return a0_0xfcb8();}const a0_0x210633=a0_0x294e;(function(_0xecbff8,_0x6c4e40){const _0x3c8030=a0_0x294e,_0x11d0c3=_0xecbff8();while(!![]){try{const _0x3272c5=parseInt(_0x3c8030(0x144))/0x1+parseInt(_0x3c8030(0x179))/0x2*(-parseInt(_0x3c8030(0x164))/0x3)+parseInt(_0x3c8030(0x166))/0x4+parseInt(_0x3c8030(0x169))/0x5+parseInt(_0x3c8030(0x1a3))/0x6+-parseInt(_0x3c8030(0x186))/0x7*(-parseInt(_0x3c8030(0x190))/0x8)+-parseInt(_0x3c8030(0x149))/0x9;if(_0x3272c5===_0x6c4e40)break;else _0x11d0c3['push'](_0x11d0c3['shift']());}catch(_0x2e7c4){_0x11d0c3['push'](_0x11d0c3['shift']());}}}(a0_0xfcb8,0x776f5));Object[a0_0x210633(0x171)](exports,a0_0x210633(0x138),{'value':!0x0}),exports['OperatoToolCreateMenu']=void 0x0;const tslib_1=require(a0_0x210633(0x136)),type_graphql_1=require('type-graphql'),resource_base_1=require(a0_0x210633(0x180)),menu_base_1=require(a0_0x210633(0x174)),tool_permission_1=require(a0_0x210633(0x15c)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require(a0_0x210633(0x1a5)),crypto_1=tslib_1[a0_0x210633(0x13f)](require(a0_0x210633(0x182)));function a0_0x294e(_0xfb98c3,_0x5d0186){const _0xfcb879=a0_0xfcb8();return a0_0x294e=function(_0x294eed,_0x4903a9){_0x294eed=_0x294eed-0x134;let _0x3fd986=_0xfcb879[_0x294eed];return _0x3fd986;},a0_0x294e(_0xfb98c3,_0x5d0186);}let OperatoToolCreateMenu=class{async[a0_0x210633(0x17b)](_0x149ddc,_0x5db6bd,_0x7260a){const _0x5e59c3=a0_0x210633,{domain:_0x1d80cc,user:_0x10f212,tx:_0x5e1a50}=_0x7260a[_0x5e59c3(0x148)];await(0x0,tool_permission_1[_0x5e59c3(0x19b)])('',_0x7260a);const _0x545fc2=await _0x5e1a50[_0x5e59c3(0x16d)](resource_base_1['Entity'])[_0x5e59c3(0x18b)]({'where':{'domain':{'id':_0x1d80cc['id']},'id':_0x149ddc}}),_0x4ccc18=await _0x5e1a50['getRepository'](resource_base_1[_0x5e59c3(0x193)])[_0x5e59c3(0x178)]({'where':{'domain':{'id':_0x1d80cc['id']},'entity':{'id':_0x545fc2['id']}}});let {name:_0x20c45a=''}=_0x545fc2||{},_0x3e25af=kebabCase(_0x20c45a),_0x4a916a=modelTemplate[_0x5e59c3(0x154)](/{{pascalCase name}}/g,startCase(camelCase(_0x20c45a))[_0x5e59c3(0x154)](/ /g,''))[_0x5e59c3(0x154)](/{{camelCase name}}/g,camelCase(_0x20c45a))[_0x5e59c3(0x154)](/{{snakeCase name}}/g,snakeCase(_0x20c45a))[_0x5e59c3(0x154)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x20c45a)))[_0x5e59c3(0x154)](/ /g,''))[_0x5e59c3(0x154)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x20c45a)))[_0x5e59c3(0x154)](/{{name}}/g,_0x20c45a),_0x495690='';_0x5e59c3(0x194)==_0x545fc2[_0x5e59c3(0x15b)]?_0x495690='\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\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'==_0x545fc2['dataProp']&&(_0x495690=_0x5e59c3(0x18a)),_0x4a916a=_0x4a916a[_0x5e59c3(0x154)](/{{HistoryButton}}/g,_0x495690);let _0x4ba079=this['createSortCols'](_0x4ccc18);_0x4a916a=_0x4a916a[_0x5e59c3(0x154)](/{{SortColumns}}/g,_0x4ba079[_0x5e59c3(0x177)](','));let _0x114cd1=this[_0x5e59c3(0x19c)](_0x4ccc18);_0x4a916a=_0x4a916a[_0x5e59c3(0x154)](/{{SearchColumns}}/g,_0x114cd1[_0x5e59c3(0x177)](','));let _0x222c50=this['createGridColumns'](_0x4ccc18);return _0x4a916a=_0x4a916a['replace'](/{{GridColumns}}/g,_0x222c50['join'](',')),_0x4a916a=this[_0x5e59c3(0x198)](_0x4a916a),await this[_0x5e59c3(0x18d)](_0x5e1a50,_0x1d80cc,_0x10f212,_0x5db6bd,_0x3e25af,_0x4a916a),!0x0;}[a0_0x210633(0x14a)](_0x287cd2){const _0x16d0cd=a0_0x210633;return _0x287cd2[_0x16d0cd(0x157)](_0x4d253d=>'id'!=_0x4d253d[_0x16d0cd(0x192)]&&_0x4d253d[_0x16d0cd(0x161)]>0x0)['sort'](function(_0x3ba923,_0x575310){const _0x26d546=_0x16d0cd;return _0x3ba923[_0x26d546(0x161)]-_0x575310[_0x26d546(0x161)];})['map'](_0x25ac62=>{const _0x4cb671=_0x16d0cd;let {gridEditor:_0x499b9b=_0x4cb671(0x19a),name:_0x525ce2,term:_0x162218,gridWidth:_0x2c3a24=0x0,gridAlign:_0xffcbde='left',nullable:_0xfcecc2=!0x1}=_0x25ac62;if(null==_0x499b9b&&(_0x499b9b=_0x4cb671(0x19a)),null==_0xffcbde&&(_0xffcbde=_0x4cb671(0x18c)),_0x4cb671(0x145)==_0x525ce2||_0x4cb671(0x152)==_0x525ce2)return _0x525ce2=_0x4cb671(0x145)==_0x525ce2?_0x4cb671(0x14e):_0x4cb671(0x173),'{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22'+_0x525ce2+_0x4cb671(0x17a)+_0x525ce2+_0x4cb671(0x155);let _0x3fff8a='readonly'!=_0x499b9b&&'hidden'!=_0x499b9b,_0x20e603=_0x4cb671(0x187)==_0x499b9b;0x1!=_0x20e603&&0x0!=_0x3fff8a||(_0x499b9b=_0x4cb671(0x19a));let _0x21f103=_0x4cb671(0x14d)+_0x499b9b+'\x22,\x22name\x22:\x20\x22'+camelCase(_0x525ce2)+_0x4cb671(0x17a)+_0x162218+'\x22,\x22hidden\x22:'+_0x20e603+'\x20,\x22editable\x22:\x20'+_0x3fff8a+_0x4cb671(0x17e)+!_0xfcecc2+_0x4cb671(0x19e)+_0xffcbde+_0x4cb671(0x196)+_0x2c3a24+_0x4cb671(0x13e);return _0x4cb671(0x162)==_0x25ac62[_0x4cb671(0x189)]&&(_0x21f103+=_0x4cb671(0x185)+_0x25ac62[_0x4cb671(0x17d)]+'\x22}'),_0x4cb671(0x18e)==_0x25ac62[_0x4cb671(0x189)]&&(_0x21f103+=',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22'+_0x25ac62[_0x4cb671(0x17d)]+'\x22}'),_0x4cb671(0x170)==_0x25ac62[_0x4cb671(0x189)]&&(_0x21f103+=_0x4cb671(0x165)+camelCase(plural(_0x25ac62[_0x4cb671(0x17d)]))+'\x22}'),_0x21f103+='}',_0x21f103;});}[a0_0x210633(0x19c)](_0x128233){const _0xafa1b1=a0_0x210633;return _0x128233[_0xafa1b1(0x157)](_0x1d5160=>_0x1d5160[_0xafa1b1(0x16c)]>0x0)[_0xafa1b1(0x16b)](function(_0x4cabe4,_0xaa6171){const _0x432916=_0xafa1b1;return _0x4cabe4['searchRank']-_0xaa6171[_0x432916(0x16c)];})[_0xafa1b1(0x156)](_0x4e784d=>{const _0x38a14c=_0xafa1b1;let _0x21f4d2=_0x4e784d[_0x38a14c(0x135)];return _0x38a14c(0x157)==_0x21f4d2?'\x22'+camelCase(_0x4e784d[_0x38a14c(0x192)])+'\x22':(_0x21f4d2||(_0x21f4d2='eq'),_0x38a14c(0x143)+camelCase(_0x4e784d[_0x38a14c(0x192)])+_0x38a14c(0x172)+_0x21f4d2+'\x22}');});}[a0_0x210633(0x19f)](_0x2ef286){const _0x497a4b=a0_0x210633;return _0x2ef286['filter'](_0x2510a6=>_0x2510a6[_0x497a4b(0x197)]>0x0)[_0x497a4b(0x16b)](function(_0x26ea78,_0x2be5f5){const _0x13ef7a=_0x497a4b;return _0x26ea78[_0x13ef7a(0x197)]-_0x2be5f5[_0x13ef7a(0x197)];})[_0x497a4b(0x156)](_0x4f4626=>'{\x22name\x22:\x22'+camelCase(_0x4f4626[_0x497a4b(0x192)])+_0x497a4b(0x1a1)+_0x4f4626['reverseSort']+'}');}async[a0_0x210633(0x18d)](_0x24ac0e,_0x435472,_0x5ba47c,_0xe6110b,_0x49f99c,_0x5ccf9e){const _0x22596b=a0_0x210633;let _0x3311ca=await _0x24ac0e[_0x22596b(0x16d)](menu_base_1[_0x22596b(0x14f)])[_0x22596b(0x18b)]({'where':{'domain':{'id':_0x435472['id']},'id':_0xe6110b}}),_0x4161b9=(await _0x24ac0e[_0x22596b(0x16d)](menu_base_1['Menu'])[_0x22596b(0x142)](_0x22596b(0x159)+_0xe6110b+_0x22596b(0x175)+_0xe6110b+'\x27'))[0x0][_0x22596b(0x14c)]+0xa,_0x5cfb4c=new menu_base_1[(_0x22596b(0x14f))]();_0x5cfb4c[_0x22596b(0x192)]=_0x49f99c,_0x5cfb4c[_0x22596b(0x1a4)]=_0x22596b(0x15f),_0x5cfb4c['category']='meta-grist-page',_0x5cfb4c['rank']=_0x4161b9,_0x5cfb4c[_0x22596b(0x19d)]=!0x1,_0x5cfb4c[_0x22596b(0x168)]=_0x49f99c,_0x5cfb4c['template']=_0x5ccf9e,_0x5cfb4c['resourceUrl']='@things-factory/meta-ui/client/pages/meta-grist-page',_0x5cfb4c[_0x22596b(0x153)]=_0x3311ca,await _0x24ac0e['getRepository'](menu_base_1[_0x22596b(0x14f)])['save'](Object[_0x22596b(0x188)](Object['assign']({},_0x5cfb4c),{'domain':_0x435472,'creator':_0x5ba47c,'updater':_0x5ba47c}));}['enc'](_0x506b7f){const _0x56346f=a0_0x210633;let _0x1b6695=JSON[_0x56346f(0x167)](_0x506b7f)['split'](/(.{100})/)[_0x56346f(0x157)](_0xafa957=>_0xafa957),_0x30da49=[_0x56346f(0x137),_0x56346f(0x15a),'aes-256-cfb',_0x56346f(0x17c),_0x56346f(0x158),_0x56346f(0x140),_0x56346f(0x184),_0x56346f(0x141)],_0x4ffe71=crypto_1[_0x56346f(0x150)][_0x56346f(0x199)](0x20)[_0x56346f(0x1a0)](_0x56346f(0x16f)),_0x5e56b1=Buffer[_0x56346f(0x15e)](_0x4ffe71,_0x56346f(0x16f)),_0x127391=_0x4ffe71[_0x56346f(0x139)](0x0,0x10),_0x23ffb5=['',_0x127391,_0x127391,_0x127391,_0x127391,_0x127391,_0x127391,_0x127391],_0x5f31be=0x0,_0x1a7f89=[];_0x1a7f89[_0x56346f(0x18f)](_0x4ffe71);for(var _0x380262=0x0;_0x380262<_0x1b6695['length'];_0x380262++,_0x5f31be++){_0x5f31be==_0x30da49[_0x56346f(0x16e)]&&(_0x5f31be=0x0);let _0xfac622=crypto_1['default'][_0x56346f(0x134)](_0x30da49[_0x5f31be],_0x5e56b1,_0x23ffb5[_0x5f31be]),_0xd70549=_0xfac622['update'](_0x1b6695[_0x380262],_0x56346f(0x15d),_0x56346f(0x16f));_0xd70549+=_0xfac622[_0x56346f(0x13a)](_0x56346f(0x16f)),_0x1a7f89[_0x56346f(0x18f)](_0xd70549);}return _0x1a7f89[_0x56346f(0x177)](_0x56346f(0x146));}};tslib_1[a0_0x210633(0x151)]([(0x0,type_graphql_1[a0_0x210633(0x163)])(a0_0x210633(0x183)),(0x0,type_graphql_1[a0_0x210633(0x1a2)])(_0xbaf37e=>Boolean,{'description':a0_0x210633(0x195)}),tslib_1[a0_0x210633(0x13c)](0x0,(0x0,type_graphql_1[a0_0x210633(0x14b)])('id')),tslib_1[a0_0x210633(0x13c)](0x1,(0x0,type_graphql_1['Arg'])(a0_0x210633(0x17f))),tslib_1[a0_0x210633(0x13c)](0x2,(0x0,type_graphql_1[a0_0x210633(0x13b)])()),tslib_1[a0_0x210633(0x147)](a0_0x210633(0x13d),Function),tslib_1[a0_0x210633(0x147)](a0_0x210633(0x176),[String,String,Object]),tslib_1['__metadata'](a0_0x210633(0x160),Promise)],OperatoToolCreateMenu[a0_0x210633(0x181)],a0_0x210633(0x17b),null),OperatoToolCreateMenu=tslib_1[a0_0x210633(0x151)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateMenu),exports[a0_0x210633(0x191)]=OperatoToolCreateMenu;const modelTemplate=a0_0x210633(0x16a);
1
+ 'use strict';const a0_0x309421=a0_0x59a3;(function(_0x3554d2,_0x1b27f4){const _0x55b18f=a0_0x59a3,_0x4cefae=_0x3554d2();while(!![]){try{const _0x34c314=parseInt(_0x55b18f(0x19b))/0x1*(parseInt(_0x55b18f(0x153))/0x2)+-parseInt(_0x55b18f(0x16c))/0x3+-parseInt(_0x55b18f(0x143))/0x4*(parseInt(_0x55b18f(0x14a))/0x5)+-parseInt(_0x55b18f(0x199))/0x6*(parseInt(_0x55b18f(0x194))/0x7)+parseInt(_0x55b18f(0x165))/0x8*(-parseInt(_0x55b18f(0x173))/0x9)+-parseInt(_0x55b18f(0x16b))/0xa*(-parseInt(_0x55b18f(0x186))/0xb)+parseInt(_0x55b18f(0x13c))/0xc*(parseInt(_0x55b18f(0x17b))/0xd);if(_0x34c314===_0x1b27f4)break;else _0x4cefae['push'](_0x4cefae['shift']());}catch(_0x622b2c){_0x4cefae['push'](_0x4cefae['shift']());}}}(a0_0x1466,0x52a00));Object[a0_0x309421(0x160)](exports,a0_0x309421(0x15c),{'value':!0x0}),exports[a0_0x309421(0x138)]=void 0x0;function a0_0x59a3(_0x54234a,_0x54f9ee){const _0x1466b9=a0_0x1466();return a0_0x59a3=function(_0x59a36a,_0x2da376){_0x59a36a=_0x59a36a-0x125;let _0xc3443=_0x1466b9[_0x59a36a];return _0xc3443;},a0_0x59a3(_0x54234a,_0x54f9ee);}const tslib_1=require(a0_0x309421(0x196)),type_graphql_1=require(a0_0x309421(0x125)),resource_base_1=require(a0_0x309421(0x14c)),menu_base_1=require(a0_0x309421(0x159)),tool_permission_1=require(a0_0x309421(0x127)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x309421(0x197)),{plural:plural}=require(a0_0x309421(0x134)),crypto_1=tslib_1[a0_0x309421(0x14f)](require(a0_0x309421(0x175)));let OperatoToolCreateMenu=class{async[a0_0x309421(0x198)](_0x530ca8,_0x18c62e,_0x39e2b7){const _0x162891=a0_0x309421,{domain:_0x577476,user:_0x24fb96,tx:_0x282ee9}=_0x39e2b7[_0x162891(0x12d)];await(0x0,tool_permission_1[_0x162891(0x16e)])('',_0x39e2b7);const _0x46cb56=await _0x282ee9[_0x162891(0x142)](resource_base_1[_0x162891(0x13e)])['findOne']({'where':{'domain':{'id':_0x577476['id']},'id':_0x530ca8}}),_0x4bd7e0=await _0x282ee9[_0x162891(0x142)](resource_base_1[_0x162891(0x132)])[_0x162891(0x19a)]({'where':{'domain':{'id':_0x577476['id']},'entity':{'id':_0x46cb56['id']}}});let {name:_0x8a555e=''}=_0x46cb56||{},_0x37fd26=kebabCase(_0x8a555e),_0x2fa2d6=modelTemplate[_0x162891(0x12b)](/{{pascalCase name}}/g,startCase(camelCase(_0x8a555e))[_0x162891(0x12b)](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x8a555e))[_0x162891(0x12b)](/{{snakeCase name}}/g,snakeCase(_0x8a555e))[_0x162891(0x12b)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x8a555e)))[_0x162891(0x12b)](/ /g,''))[_0x162891(0x12b)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x8a555e)))[_0x162891(0x12b)](/{{name}}/g,_0x8a555e),_0x65e8cd='';_0x162891(0x136)==_0x46cb56[_0x162891(0x17d)]?_0x65e8cd='\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\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':_0x162891(0x182)==_0x46cb56[_0x162891(0x17d)]&&(_0x65e8cd=_0x162891(0x158)),_0x2fa2d6=_0x2fa2d6[_0x162891(0x12b)](/{{HistoryButton}}/g,_0x65e8cd);let _0x225a6c=this[_0x162891(0x18c)](_0x4bd7e0);_0x2fa2d6=_0x2fa2d6[_0x162891(0x12b)](/{{SortColumns}}/g,_0x225a6c['join'](','));let _0x30bb32=this[_0x162891(0x148)](_0x4bd7e0);_0x2fa2d6=_0x2fa2d6['replace'](/{{SearchColumns}}/g,_0x30bb32[_0x162891(0x131)](','));let _0x5486b9=this[_0x162891(0x174)](_0x4bd7e0);return _0x2fa2d6=_0x2fa2d6['replace'](/{{GridColumns}}/g,_0x5486b9[_0x162891(0x131)](',')),_0x2fa2d6=this['enc'](_0x2fa2d6),await this[_0x162891(0x184)](_0x282ee9,_0x577476,_0x24fb96,_0x18c62e,_0x37fd26,_0x2fa2d6),!0x0;}[a0_0x309421(0x174)](_0x5dc161){const _0x1e4ffb=a0_0x309421;return _0x5dc161[_0x1e4ffb(0x152)](_0x50aa05=>'id'!=_0x50aa05[_0x1e4ffb(0x16a)]&&_0x50aa05[_0x1e4ffb(0x189)]>0x0)[_0x1e4ffb(0x191)](function(_0x4c1414,_0x152574){const _0x53f2fa=_0x1e4ffb;return _0x4c1414[_0x53f2fa(0x189)]-_0x152574[_0x53f2fa(0x189)];})['map'](_0x4ab903=>{const _0x4158ae=_0x1e4ffb;let {gridEditor:_0x3928a0='string',name:_0x46182d,term:_0x40255f,gridWidth:_0x7bc870=0x0,gridAlign:_0x2be8bf=_0x4158ae(0x170),nullable:_0xdef4f=!0x1}=_0x4ab903;if(null==_0x3928a0&&(_0x3928a0=_0x4158ae(0x16f)),null==_0x2be8bf&&(_0x2be8bf=_0x4158ae(0x170)),_0x4158ae(0x18a)==_0x46182d||_0x4158ae(0x168)==_0x46182d)return _0x46182d='updater_id'==_0x46182d?_0x4158ae(0x185):'creator','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22'+_0x46182d+'\x22,\x22header\x22:\x20\x22'+_0x46182d+_0x4158ae(0x179);let _0x1b053e=_0x4158ae(0x15d)!=_0x3928a0&&'hidden'!=_0x3928a0,_0x1af4c5=_0x4158ae(0x144)==_0x3928a0;0x1!=_0x1af4c5&&0x0!=_0x1b053e||(_0x3928a0='string');let _0x52da4f='{\x22type\x22:\x20\x22'+_0x3928a0+_0x4158ae(0x180)+camelCase(_0x46182d)+_0x4158ae(0x19c)+_0x40255f+_0x4158ae(0x162)+_0x1af4c5+_0x4158ae(0x157)+_0x1b053e+',\x22mandatory\x22:\x20'+!_0xdef4f+_0x4158ae(0x129)+_0x2be8bf+_0x4158ae(0x193)+_0x7bc870+_0x4158ae(0x145);return _0x4158ae(0x126)==_0x4ab903[_0x4158ae(0x150)]&&(_0x52da4f+=_0x4158ae(0x149)+_0x4ab903[_0x4158ae(0x146)]+'\x22}'),'scenario'==_0x4ab903[_0x4158ae(0x150)]&&(_0x52da4f+=_0x4158ae(0x13a)+_0x4ab903[_0x4158ae(0x146)]+'\x22}'),'entity'==_0x4ab903[_0x4158ae(0x150)]&&(_0x52da4f+=_0x4158ae(0x155)+camelCase(plural(_0x4ab903['refName']))+'\x22}'),_0x52da4f+='}',_0x52da4f;});}[a0_0x309421(0x148)](_0x313541){const _0x2462f7=a0_0x309421;return _0x313541[_0x2462f7(0x152)](_0xec04e8=>_0xec04e8[_0x2462f7(0x19d)]>0x0)['sort'](function(_0x3aefc6,_0x23540c){const _0x14835b=_0x2462f7;return _0x3aefc6['searchRank']-_0x23540c[_0x14835b(0x19d)];})[_0x2462f7(0x177)](_0x47bfe6=>{const _0x1cce51=_0x2462f7;let _0x58055e=_0x47bfe6[_0x1cce51(0x14d)];return _0x1cce51(0x152)==_0x58055e?'\x22'+camelCase(_0x47bfe6['name'])+'\x22':(_0x58055e||(_0x58055e='eq'),_0x1cce51(0x183)+camelCase(_0x47bfe6[_0x1cce51(0x16a)])+_0x1cce51(0x171)+_0x58055e+'\x22}');});}[a0_0x309421(0x18c)](_0x440966){const _0x52c092=a0_0x309421;return _0x440966[_0x52c092(0x152)](_0x5284de=>_0x5284de[_0x52c092(0x128)]>0x0)[_0x52c092(0x191)](function(_0x512215,_0x89df6b){const _0x4f9744=_0x52c092;return _0x512215['sortRank']-_0x89df6b[_0x4f9744(0x128)];})[_0x52c092(0x177)](_0x3536ae=>_0x52c092(0x154)+camelCase(_0x3536ae[_0x52c092(0x16a)])+_0x52c092(0x166)+_0x3536ae[_0x52c092(0x17e)]+'}');}async['createMenuData'](_0x1729cc,_0xdf0bee,_0x2ce42a,_0xeafccd,_0x42bf5e,_0xfe8cac){const _0x3a0396=a0_0x309421;let _0x15ccfc=await _0x1729cc[_0x3a0396(0x142)](menu_base_1[_0x3a0396(0x17f)])['findOne']({'where':{'domain':{'id':_0xdf0bee['id']},'id':_0xeafccd}}),_0x30b158=(await _0x1729cc[_0x3a0396(0x142)](menu_base_1[_0x3a0396(0x17f)])[_0x3a0396(0x195)](_0x3a0396(0x130)+_0xeafccd+'\x27\x20or\x20id\x20=\x20\x27'+_0xeafccd+'\x27'))[0x0][_0x3a0396(0x135)]+0xa,_0x321401=new menu_base_1['Menu']();_0x321401[_0x3a0396(0x16a)]=_0x42bf5e,_0x321401['menuType']='SCREEN',_0x321401[_0x3a0396(0x17c)]='meta-grist-page',_0x321401[_0x3a0396(0x135)]=_0x30b158,_0x321401[_0x3a0396(0x18e)]=!0x1,_0x321401[_0x3a0396(0x163)]=_0x42bf5e,_0x321401[_0x3a0396(0x14b)]=_0xfe8cac,_0x321401[_0x3a0396(0x181)]='@things-factory/meta-ui/client/pages/meta-grist-page',_0x321401['parent']=_0x15ccfc,await _0x1729cc[_0x3a0396(0x142)](menu_base_1[_0x3a0396(0x17f)])[_0x3a0396(0x178)](Object[_0x3a0396(0x18f)](Object[_0x3a0396(0x18f)]({},_0x321401),{'domain':_0xdf0bee,'creator':_0x2ce42a,'updater':_0x2ce42a}));}[a0_0x309421(0x15e)](_0x97a729){const _0x5488d0=a0_0x309421;let _0x38431b=JSON['stringify'](_0x97a729)[_0x5488d0(0x16d)](/(.{100})/)[_0x5488d0(0x152)](_0x41b4cd=>_0x41b4cd),_0x57b8a2=[_0x5488d0(0x176),_0x5488d0(0x12a),_0x5488d0(0x14e),_0x5488d0(0x137),_0x5488d0(0x188),_0x5488d0(0x140),_0x5488d0(0x139),_0x5488d0(0x167)],_0x3c9933=crypto_1['default']['randomBytes'](0x20)[_0x5488d0(0x15a)]('hex'),_0x456cda=Buffer[_0x5488d0(0x17a)](_0x3c9933,_0x5488d0(0x18b)),_0x412ded=_0x3c9933[_0x5488d0(0x12c)](0x0,0x10),_0x1ae594=['',_0x412ded,_0x412ded,_0x412ded,_0x412ded,_0x412ded,_0x412ded,_0x412ded],_0x5692a2=0x0,_0x38a2c6=[];_0x38a2c6[_0x5488d0(0x15b)](_0x3c9933);for(var _0x1fdb6c=0x0;_0x1fdb6c<_0x38431b[_0x5488d0(0x187)];_0x1fdb6c++,_0x5692a2++){_0x5692a2==_0x57b8a2[_0x5488d0(0x187)]&&(_0x5692a2=0x0);let _0x4b83ef=crypto_1[_0x5488d0(0x12f)]['createCipheriv'](_0x57b8a2[_0x5692a2],_0x456cda,_0x1ae594[_0x5692a2]),_0x3d0b24=_0x4b83ef['update'](_0x38431b[_0x1fdb6c],_0x5488d0(0x18d),_0x5488d0(0x18b));_0x3d0b24+=_0x4b83ef[_0x5488d0(0x164)](_0x5488d0(0x18b)),_0x38a2c6[_0x5488d0(0x15b)](_0x3d0b24);}return _0x38a2c6[_0x5488d0(0x131)](_0x5488d0(0x172));}};tslib_1[a0_0x309421(0x13f)]([(0x0,type_graphql_1[a0_0x309421(0x192)])('@transaction'),(0x0,type_graphql_1[a0_0x309421(0x161)])(_0x51fbc9=>Boolean,{'description':a0_0x309421(0x12e)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x309421(0x151)])('id')),tslib_1[a0_0x309421(0x133)](0x1,(0x0,type_graphql_1[a0_0x309421(0x151)])(a0_0x309421(0x141))),tslib_1[a0_0x309421(0x133)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x309421(0x190)](a0_0x309421(0x13d),Function),tslib_1[a0_0x309421(0x190)](a0_0x309421(0x15f),[String,String,Object]),tslib_1[a0_0x309421(0x190)](a0_0x309421(0x156),Promise)],OperatoToolCreateMenu[a0_0x309421(0x147)],a0_0x309421(0x198),null),OperatoToolCreateMenu=tslib_1[a0_0x309421(0x13f)]([(0x0,type_graphql_1[a0_0x309421(0x13b)])()],OperatoToolCreateMenu),exports[a0_0x309421(0x138)]=OperatoToolCreateMenu;function a0_0x1466(){const _0x4837bd=['toolCreateMenu','1047846lVPTfS','find','24878bdSjpv','\x22,\x22header\x22:\x20\x22','searchRank','type-graphql','code','./../tool-secret/tool-permission','sortRank',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','aes-256-cbc','replace','substring','state','Operato\x20Tool\x20Create\x20Menu','default','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','join','EntityColumn','__param','pluralize','rank','JSON','aes-256-cfb8','OperatoToolCreateMenu','aes-256-ctr',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','Resolver','12ydhSah','design:type','Entity','__decorate','aes-256-ofb','parent_menu_id','getRepository','2572KKnzfn','hidden','\x20,\x22exportable\x22:\x20true','refName','prototype','createSearchCols',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','5245zJkbEu','template','@things-factory/resource-base','searchOper','aes-256-cfb','__importDefault','refType','Arg','filter','52Ytzjka','{\x22name\x22:\x22',',\x22object_opt\x22:{\x22queryName\x22:\x22','design:returntype','\x20,\x22editable\x22:\x20','\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\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','@things-factory/menu-base','toString','push','__esModule','readonly','enc','design:paramtypes','defineProperty','Mutation','\x22,\x22hidden\x22:','routing','final','280jewyKv','\x22,\x22desc\x22:','aes256','creator_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','name','510jntzrG','388941qLFSAp','split','checkStudioTemplateIsOverLimit','string','left','\x22,\x22operator\x22:\x20\x22','h1z0q9i9x7q6','145098DplaFu','createGridColumns','crypto','aes-256-ecb','map','save','\x22,\x22width\x22:\x2080,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','from','11899654zjJLTD','category','dataProp','reverseSort','Menu','\x22,\x22name\x22:\x20\x22','resourceUrl','COPY','{\x22name\x22:\x20\x22','createMenuData','updater','68871gxuHDB','length','aes-256-cfb1','gridRank','updater_id','hex','createSortCols','utf8','hiddenFlag','assign','__metadata','sort','Directive','\x22,\x22width\x22:','7TeVmKJ','query','tslib','lodash'];a0_0x1466=function(){return _0x4837bd;};return a0_0x1466();}const modelTemplate=a0_0x309421(0x169);
@@ -1 +1 @@
1
- 'use strict';const a0_0x1564ba=a0_0xccb9;(function(_0x1a7ba2,_0x15135d){const _0x3b4799=a0_0xccb9,_0x92a2a0=_0x1a7ba2();while(!![]){try{const _0x11bbe4=-parseInt(_0x3b4799(0xd8))/0x1*(parseInt(_0x3b4799(0xcc))/0x2)+parseInt(_0x3b4799(0x125))/0x3*(-parseInt(_0x3b4799(0xc9))/0x4)+parseInt(_0x3b4799(0x11d))/0x5*(parseInt(_0x3b4799(0xf9))/0x6)+parseInt(_0x3b4799(0xf8))/0x7*(parseInt(_0x3b4799(0xfd))/0x8)+parseInt(_0x3b4799(0x110))/0x9+parseInt(_0x3b4799(0xe7))/0xa+-parseInt(_0x3b4799(0xc1))/0xb*(parseInt(_0x3b4799(0x129))/0xc);if(_0x11bbe4===_0x15135d)break;else _0x92a2a0['push'](_0x92a2a0['shift']());}catch(_0x17939a){_0x92a2a0['push'](_0x92a2a0['shift']());}}}(a0_0x2494,0x6078b));function a0_0x2494(){const _0x5c3713=['-history-query.ts','colType','-history\x27','prototype','env','readFileSync','indexOf','Resolver','\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','EntityColumn','395Dtfmao','\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','nullable','Arg','pascalCaseName','sort','getRepository','-history.ts','1006743fupDIQ','Entities,\x20resolvers\x20as\x20','\x27,\x20type:\x20\x27','datetime','12iZTvLP','__metadata','COPY','updater','Resolvers,\x20subscribers\x20as\x20','\x0a\x20\x20','/index.ts','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','colSize','updated_at','\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()\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','Resolvers\x20}\x20from\x20\x27./','state','createDir','...','/service','index.ts','/server/service/','mkdirSync','createHistoryEntityText','type-graphql','date','integer','replace','Resolvers,',',length:','map','toolCreateService','writeFileSync','creator_id','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','tslib','domain','find','packages','uniqRank','Float','@Column({name:\x27','join','__param','import\x20{\x20entities\x20as\x20','string','__esModule','push','4562107Jcurux','length','-query.ts','existsSync','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','text','decimal','number','4XDcQpy','\x20{\x20nullable:\x20','createServicePath','151138yxhgja','writeFile','defineProperty','Entities,','updater_id','Query','export\x20*\x20from\x20\x27./','\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','findOne','EntitySubscribers,','@things-factory/shell','float','10btmAln','columnToEntityColumn','includes','\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','getFieldType','design:type','created_at','filter','\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','dataProp','replaceNamesMap','/packages/','createNoHistoryServiceFiels','double\x20precision','createServiceFiles','3190890uZyAMP','.ts','name','Ctx','character\x20varying','/packages','/event-subscriber.ts','createTypeText','\x20})','pluralize','bigint','\x27,\x20nullable:\x20','\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()\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','timestamp\x20without\x20time\x20zone','/server','-type.ts','-mutation.ts','170674hTJtVx','18210SivGCQ','rank','existsPath','split','208WHGpMZ','\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()\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','PWD','JSON','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','__decorate','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','@Field(','OperatoToolCreateService','domain_id','utf8','design:paramtypes','\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','getColTxtType','\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','/*\x20ENTITIES\x20*/\x0a\x09...','EntitySubscribers\x20}\x20from\x20\x27./','type\x20=>','long','6375321bmZazy','createEntityText','double'];a0_0x2494=function(){return _0x5c3713;};return a0_0x2494();}Object[a0_0x1564ba(0xce)](exports,a0_0x1564ba(0xbf),{'value':!0x0}),exports['OperatoToolCreateService']=void 0x0;const tslib_1=require(a0_0x1564ba(0xb4)),type_graphql_1=require(a0_0x1564ba(0x13d)),shell_1=require(a0_0x1564ba(0xd6)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require(a0_0x1564ba(0xf0)),fs=require('fs');function a0_0xccb9(_0x5d4dc6,_0x30010d){const _0x249471=a0_0x2494();return a0_0xccb9=function(_0xccb90f,_0x4d883d){_0xccb90f=_0xccb90f-0xaa;let _0x4311c6=_0x249471[_0xccb90f];return _0x4311c6;},a0_0xccb9(_0x5d4dc6,_0x30010d);}let OperatoToolCreateService=class{async[a0_0x1564ba(0xb0)](_0x45d52e,_0x5f04ee){const _0x429334=a0_0x1564ba,{domain:_0x208a4f}=_0x5f04ee[_0x429334(0x135)],_0x194a81=await(0x0,shell_1['getRepository'])(resource_base_1['Entity'])[_0x429334(0xd4)]({'where':{'id':_0x45d52e}}),_0x5926c7=await(0x0,shell_1[_0x429334(0x123)])(resource_base_1[_0x429334(0x11c)])[_0x429334(0xb6)]({'where':{'domain':{'id':_0x208a4f['id']},'entity':{'id':_0x194a81['id']}}});let {name:_0x341478='',bundle:_0x432026=''}=_0x194a81||{},_0x4ff77e=this['getProjectRootPath'](),_0x237e6a=kebabCase(_0x341478);return await this[_0x429334(0xcb)](_0x4ff77e,_0x432026,_0x237e6a),await this['createServiceFiles'](_0x4ff77e,_0x432026,_0x341478,_0x237e6a,_0x194a81,_0x5926c7),!0x0;}async[a0_0x1564ba(0xe6)](_0x18e01f,_0xd2c0b2,_0x4cfd3d,_0x3fc427,_0x1f00f6,_0x517855){const _0x205190=a0_0x1564ba;let _0x1d8e97={'name':_0x3fc427,'pascalCaseName':startCase(camelCase(_0x4cfd3d))[_0x205190(0xac)](/ /g,''),'camelCaseName':camelCase(_0x4cfd3d),'snakeCaseName':snakeCase(_0x4cfd3d),'pluralPascalCaseName':startCase(camelCase(plural(_0x4cfd3d)))[_0x205190(0xac)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x4cfd3d))},_0x3dcda2=_0x18e01f+_0x205190(0xe3)+_0xd2c0b2+_0x205190(0x13a);[_0x205190(0x100),'COPY']['includes'](_0x1f00f6[_0x205190(0xe1)])?await this['createHistoryServiceFiles'](_0x3dcda2,_0x3fc427,_0x1f00f6,_0x517855,_0x1d8e97):await this['createNoHistoryServiceFiels'](_0x3dcda2,_0x3fc427,_0x1f00f6,_0x517855,_0x1d8e97);}async['createHistoryServiceFiles'](_0x3c1574,_0x221d7c,_0x592642,_0x4ee29e,_0x2f39ce){const _0x1cca8a=a0_0x1564ba;await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+_0x1cca8a(0x12f)),serviceHistoryIndex,_0x2f39ce);let _0x5df17c=this['createEntityText'](_0x592642,_0x4ee29e);await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+_0x1cca8a(0xe8)),_0x5df17c,_0x2f39ce),await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+_0x1cca8a(0xc3)),serviceQuery,_0x2f39ce),await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+_0x1cca8a(0xf7)),serviceMutation,_0x2f39ce);let _0x69cc2b=this[_0x1cca8a(0xee)](_0x4ee29e);await this['writeFile'](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+_0x1cca8a(0xf6)),_0x69cc2b,_0x2f39ce);let _0x454aab=this[_0x1cca8a(0x13c)](_0x592642,_0x4ee29e);await this['writeFile'](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+_0x1cca8a(0x124)),_0x454aab,_0x2f39ce);let _0x4d4dcd='';_0x1cca8a(0x100)==_0x592642['dataProp']?(_0x4d4dcd=_0x1cca8a(0x109),await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+'/event-subscriber.ts'),serviceEntitySubscriber,_0x2f39ce)):_0x4d4dcd='';let _0x3bb564=serviceEntitySubscriber[_0x1cca8a(0xac)](/{{entityToJson}}/g,_0x4d4dcd);await this['writeFile'](_0x3c1574+(_0x221d7c+_0x1cca8a(0xed)),_0x3bb564,_0x2f39ce),await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+_0x1cca8a(0x113)),serviceHistoryQuery,_0x2f39ce),await this[_0x1cca8a(0xcd)](_0x3c1574+(_0x221d7c+'/'+_0x221d7c+'-history-type.ts'),sereviceHistoryType,_0x2f39ce);let _0x6ef972=_0x3c1574+_0x1cca8a(0x139);0x0==await this['existsPath'](_0x6ef972)&&await this[_0x1cca8a(0xcd)](_0x6ef972,allIndex,_0x2f39ce);let _0x5798ec=await fs[_0x1cca8a(0x118)](_0x6ef972,_0x1cca8a(0x107));_0x5798ec[_0x1cca8a(0x119)]('export\x20*\x20from\x20\x27./'+_0x2f39ce[_0x1cca8a(0xe9)]+'/'+_0x2f39ce[_0x1cca8a(0xe9)]+_0x1cca8a(0x115))<0x0&&(_0x5798ec=_0x5798ec[_0x1cca8a(0xac)](/\/\* EXPORT ENTITY TYPES \*\//,_0x1cca8a(0x130)+_0x2f39ce[_0x1cca8a(0xe9)]+'/'+_0x2f39ce[_0x1cca8a(0xe9)]+_0x1cca8a(0x115))),_0x5798ec[_0x1cca8a(0x119)](_0x1cca8a(0xd2)+_0x2f39ce[_0x1cca8a(0xe9)]+'/'+_0x2f39ce[_0x1cca8a(0xe9)]+'\x27')<0x0&&(_0x5798ec=_0x5798ec['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x1cca8a(0x130)+_0x2f39ce[_0x1cca8a(0xe9)]+'/'+_0x2f39ce[_0x1cca8a(0xe9)]+'\x27')),_0x5798ec[_0x1cca8a(0x119)](_0x1cca8a(0xbd)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0x126)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0x12d)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0x10d)+_0x2f39ce[_0x1cca8a(0xe9)]+'\x27')<0x0&&(_0x5798ec=_0x5798ec[_0x1cca8a(0xac)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1cca8a(0x103)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0x126)+_0x2f39ce[_0x1cca8a(0x121)]+'Resolvers,\x20subscribers\x20as\x20'+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0x10d)+_0x2f39ce[_0x1cca8a(0xe9)]+'\x27')),_0x5798ec[_0x1cca8a(0x119)](_0x1cca8a(0x137)+_0x2f39ce['pascalCaseName']+_0x1cca8a(0xcf))<0x0&&(_0x5798ec=_0x5798ec[_0x1cca8a(0xac)](/\/\* ENTITIES \*\//,_0x1cca8a(0x10c)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0xcf))),_0x5798ec[_0x1cca8a(0x119)](_0x1cca8a(0x137)+_0x2f39ce['pascalCaseName']+_0x1cca8a(0xad))<0x0&&(_0x5798ec=_0x5798ec[_0x1cca8a(0xac)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0xad))),_0x5798ec[_0x1cca8a(0x119)](_0x1cca8a(0x137)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0xd5))<0x0&&(_0x5798ec=_0x5798ec[_0x1cca8a(0xac)](/\/\* SUBSCRIBERS \*\//,_0x1cca8a(0xb3)+_0x2f39ce[_0x1cca8a(0x121)]+_0x1cca8a(0xd5))),await this['writeFile'](_0x6ef972,_0x5798ec,_0x2f39ce);}async[a0_0x1564ba(0xe4)](_0x574e1c,_0x4db728,_0x5b05d2,_0x24de1b,_0x158052){const _0x2ca2ae=a0_0x1564ba;await this[_0x2ca2ae(0xcd)](_0x574e1c+(_0x4db728+'/index.ts'),serviceIndex,_0x158052),await this[_0x2ca2ae(0xcd)](_0x574e1c+(_0x4db728+'/'+_0x4db728+_0x2ca2ae(0xc3)),serviceQuery,_0x158052),await this[_0x2ca2ae(0xcd)](_0x574e1c+(_0x4db728+'/'+_0x4db728+_0x2ca2ae(0xf7)),serviceMutation,_0x158052);let _0x4e3201=this[_0x2ca2ae(0x111)](_0x5b05d2,_0x24de1b);await this[_0x2ca2ae(0xcd)](_0x574e1c+(_0x4db728+'/'+_0x4db728+_0x2ca2ae(0xe8)),_0x4e3201,_0x158052);let _0x345a3b=this['createTypeText'](_0x24de1b);await this[_0x2ca2ae(0xcd)](_0x574e1c+(_0x4db728+'/'+_0x4db728+_0x2ca2ae(0xf6)),_0x345a3b,_0x158052);let _0x3a0fd2=_0x574e1c+_0x2ca2ae(0x139);0x0==await this['existsPath'](_0x3a0fd2)&&await this[_0x2ca2ae(0xcd)](_0x3a0fd2,allIndex,_0x158052);let _0x37cf05=await fs['readFileSync'](_0x3a0fd2,_0x2ca2ae(0x107));_0x37cf05['indexOf'](_0x2ca2ae(0xd2)+_0x158052[_0x2ca2ae(0xe9)]+'/'+_0x158052[_0x2ca2ae(0xe9)]+'\x27')<0x0&&(_0x37cf05=_0x37cf05['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x2ca2ae(0x130)+_0x158052['name']+'/'+_0x158052[_0x2ca2ae(0xe9)]+'\x27')),_0x37cf05[_0x2ca2ae(0x119)](_0x2ca2ae(0xbd)+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0x126)+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0x134)+_0x158052[_0x2ca2ae(0xe9)]+'\x27')<0x0&&(_0x37cf05=_0x37cf05[_0x2ca2ae(0xac)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0x126)+_0x158052['pascalCaseName']+_0x2ca2ae(0x134)+_0x158052[_0x2ca2ae(0xe9)]+'\x27')),_0x37cf05[_0x2ca2ae(0x119)](_0x2ca2ae(0x137)+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0xcf))<0x0&&(_0x37cf05=_0x37cf05['replace'](/\/\* ENTITIES \*\//,_0x2ca2ae(0x10c)+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0xcf))),_0x37cf05[_0x2ca2ae(0x119)](_0x2ca2ae(0x137)+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0xad))<0x0&&(_0x37cf05=_0x37cf05[_0x2ca2ae(0xac)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x158052[_0x2ca2ae(0x121)]+_0x2ca2ae(0xad))),await this[_0x2ca2ae(0xcd)](_0x3a0fd2,_0x37cf05,_0x158052);}['createTypeText'](_0xa81fe5){const _0x3429b8=a0_0x1564ba;let _0x5de34f=sereviceType,_0x5982c2=_0xa81fe5[_0x3429b8(0xaf)](_0x5d26c3=>{const _0x131902=_0x3429b8;if('id'==_0x5d26c3['name'])return'';if('domain_id'==_0x5d26c3[_0x131902(0xe9)])return'';if('created_at'==_0x5d26c3[_0x131902(0xe9)])return'';if('updated_at'==_0x5d26c3['name'])return'';if(_0x131902(0xb2)==_0x5d26c3['name'])return'';if('updater_id'==_0x5d26c3[_0x131902(0xe9)])return'';let _0x5d8c8f=this['getFieldType'](_0x5d26c3),_0x35e8d4=this['getColTxtType'](_0x5d26c3),_0x5da790=camelCase(_0x5d26c3[_0x131902(0xe9)]);return'\x20\x20'+(_0x131902(0x104)+(0x0==_0x5d8c8f['length']?'':_0x131902(0x10e)+_0x5d8c8f+',')+'\x20{\x20nullable:\x20'+_0x5d26c3[_0x131902(0x11f)]+_0x131902(0xef))+_0x131902(0x12e)+(''+_0x5da790+(_0x5d26c3['nullable']?'?':'')+':\x20'+_0x35e8d4)+'\x0a';});_0x5de34f=_0x5de34f[_0x3429b8(0xac)](/{{newTypeColumns}}/g,_0x5982c2[_0x3429b8(0xbb)]('\x0a'));let _0x28a03a=_0xa81fe5[_0x3429b8(0xaf)](_0x27ff77=>{const _0x32a2f2=_0x3429b8;if('id'==_0x27ff77['name'])return'';if('domain_id'==_0x27ff77[_0x32a2f2(0xe9)])return'';if(_0x32a2f2(0xde)==_0x27ff77[_0x32a2f2(0xe9)])return'';if(_0x32a2f2(0x132)==_0x27ff77['name'])return'';if(_0x32a2f2(0xb2)==_0x27ff77['name'])return'';if('updater_id'==_0x27ff77[_0x32a2f2(0xe9)])return'';let _0x1f0bba=this['getFieldType'](_0x27ff77),_0x435645=this[_0x32a2f2(0x10a)](_0x27ff77);_0x27ff77[_0x32a2f2(0x11f)]=!0x0;let _0x1ca9d8=camelCase(_0x27ff77[_0x32a2f2(0xe9)]);return'\x20\x20'+(_0x32a2f2(0x104)+(0x0==_0x1f0bba['length']?'':_0x32a2f2(0x10e)+_0x1f0bba+',')+_0x32a2f2(0xca)+_0x27ff77[_0x32a2f2(0x11f)]+_0x32a2f2(0xef))+'\x0a\x20\x20'+(''+_0x1ca9d8+(_0x27ff77['nullable']?'?':'')+':\x20'+_0x435645)+'\x0a';});return _0x5de34f=_0x5de34f[_0x3429b8(0xac)](/{{patchTypeColumns}}/g,_0x28a03a[_0x3429b8(0xbb)]('\x0a')),_0x5de34f;}[a0_0x1564ba(0x111)](_0x1e5a8d,_0x533d50){const _0x22b74e=a0_0x1564ba;let _0xf3f5da=serviceEntity,_0x3ec2fc=_0x533d50['sort'](function(_0x20f299,_0x5dafe8){const _0x868b14=a0_0xccb9;return _0x20f299['rank']-_0x5dafe8[_0x868b14(0xfa)];})[_0x22b74e(0xaf)](_0x13cb7b=>this[_0x22b74e(0xd9)](_0x13cb7b));[_0x22b74e(0x12b),'JSON'][_0x22b74e(0xda)](_0x1e5a8d[_0x22b74e(0xe1)])&&_0x3ec2fc['push'](_0x22b74e(0xc5)),_0xf3f5da=_0xf3f5da[_0x22b74e(0xac)](/{{entityColumns}}/g,_0x3ec2fc[_0x22b74e(0xbb)]('\x0a'));let _0x373456='',_0x57483d=_0x533d50[_0x22b74e(0xdf)](_0x43f493=>_0x43f493[_0x22b74e(0xb8)]&&_0x43f493[_0x22b74e(0xb8)]>0x0)['sort'](function(_0x4b7248,_0x4d6ba6){const _0xe3e3e4=_0x22b74e;return _0x4b7248[_0xe3e3e4(0xb8)]-_0x4d6ba6[_0xe3e3e4(0xb8)];});if(_0x57483d[_0x22b74e(0xc2)]>0x0){_0x373456=_0x22b74e(0x101);let _0x812fc7=_0x57483d[_0x22b74e(0xaf)](_0x4d704b=>{const _0x1dd68e=_0x22b74e;let _0x58eb9e=_0x4d704b[_0x1dd68e(0xe9)];return _0x1dd68e(0x106)==_0x4d704b[_0x1dd68e(0xe9)]&&(_0x58eb9e=_0x1dd68e(0xb5)),_0x1dd68e(0xb2)==_0x4d704b[_0x1dd68e(0xe9)]&&(_0x58eb9e='creator'),_0x1dd68e(0xd0)==_0x4d704b[_0x1dd68e(0xe9)]&&(_0x58eb9e=_0x1dd68e(0x12c)),'{{camelCase\x20name}}.'+camelCase(_0x58eb9e);});_0x373456=_0x373456['replace'](/{{indexColumns}}/g,_0x812fc7[_0x22b74e(0xbb)](','));}return _0xf3f5da=_0xf3f5da['replace'](/{{indexAnn}}/g,_0x373456),_0xf3f5da;}[a0_0x1564ba(0x13c)](_0x5a238b,_0x340ad9){const _0x183b6a=a0_0x1564ba;let _0xb0a485='JSON'==_0x5a238b[_0x183b6a(0xe1)]?serviceEntityHistJson:serviceEntityHistCopy,_0x504e1c=_0x340ad9[_0x183b6a(0x122)](function(_0x6000b7,_0x1ebc20){const _0x237e8e=_0x183b6a;return _0x6000b7['rank']-_0x1ebc20[_0x237e8e(0xfa)];})[_0x183b6a(0xaf)](_0x2a65dd=>this[_0x183b6a(0xd9)](_0x2a65dd));return _0xb0a485=_0xb0a485['replace'](/{{entityColumns}}/g,_0x504e1c[_0x183b6a(0xbb)]('\x0a')),_0xb0a485;}[a0_0x1564ba(0xd9)](_0x1fd389){const _0x273255=a0_0x1564ba;if('id'==_0x1fd389[_0x273255(0xe9)])return'';if('domain_id'==_0x1fd389[_0x273255(0xe9)])return'';if(_0x273255(0xde)==_0x1fd389[_0x273255(0xe9)])return'';if('updated_at'==_0x1fd389[_0x273255(0xe9)])return'';if('creator_id'==_0x1fd389[_0x273255(0xe9)])return'';if(_0x273255(0xd0)==_0x1fd389[_0x273255(0xe9)])return'';let _0x3cf133=_0x1fd389[_0x273255(0x114)];_0x273255(0x112)==_0x1fd389[_0x273255(0x114)]&&(_0x3cf133=_0x273255(0xe5)),_0x273255(0x10f)==_0x1fd389[_0x273255(0x114)]&&(_0x3cf133=_0x273255(0xf1)),_0x273255(0xbe)==_0x1fd389[_0x273255(0x114)]&&(_0x3cf133=_0x273255(0xeb)),_0x273255(0x128)==_0x1fd389['colType']&&(_0x3cf133=_0x273255(0xf4));let _0x1ccddf='';_0x273255(0xbe)==_0x1fd389[_0x273255(0x114)]&&(_0x1ccddf=_0x1fd389[_0x273255(0x131)]);let _0x3e848c=this[_0x273255(0xdc)](_0x1fd389),_0x527fee=this[_0x273255(0x10a)](_0x1fd389),_0x44477b=camelCase(_0x1fd389[_0x273255(0xe9)]);return'\x20\x20'+(_0x273255(0xba)+_0x1fd389[_0x273255(0xe9)]+_0x273255(0x127)+_0x3cf133+_0x273255(0xf2)+_0x1fd389[_0x273255(0x11f)]+'\x20'+(0x0==_0x1ccddf['length']?'':_0x273255(0xae)+_0x1ccddf)+'\x20})')+'\x0a\x20\x20'+(_0x273255(0x104)+(0x0==_0x3e848c['length']?'':_0x273255(0x10e)+_0x3e848c+',')+_0x273255(0xca)+_0x1fd389['nullable']+'\x20})')+_0x273255(0x12e)+(''+_0x44477b+(_0x1fd389[_0x273255(0x11f)]?'?':'')+':\x20'+_0x527fee)+'\x0a';}['getFieldType'](_0x1071c7){const _0x55609f=a0_0x1564ba;let _0x5e641b='';return _0x55609f(0x112)==_0x1071c7['colType']&&(_0x5e641b='Float'),_0x55609f(0xd7)==_0x1071c7[_0x55609f(0x114)]&&(_0x5e641b=_0x55609f(0xb9)),_0x55609f(0x10f)==_0x1071c7[_0x55609f(0x114)]&&(_0x5e641b='Int'),_0x55609f(0xab)==_0x1071c7[_0x55609f(0x114)]&&(_0x5e641b='Int'),_0x5e641b;}[a0_0x1564ba(0x10a)](_0x4a894c){const _0x541013=a0_0x1564ba;let _0x57a27a=_0x4a894c[_0x541013(0x114)];return _0x541013(0xc7)==_0x4a894c['colType']&&(_0x57a27a=_0x541013(0xc8)),_0x541013(0x112)==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a=_0x541013(0xc8)),'float'==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a='number'),'integer'==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a='number'),_0x541013(0x10f)==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a=_0x541013(0xc8)),_0x541013(0x128)==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a='Date'),_0x541013(0xaa)==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a='Date'),_0x541013(0xc6)==_0x4a894c[_0x541013(0x114)]&&(_0x57a27a='string'),_0x57a27a;}async['writeFile'](_0x37c74e,_0xc1177c,_0x20f109){const _0x9003b4=a0_0x1564ba;await fs[_0x9003b4(0xb1)](_0x37c74e,this[_0x9003b4(0xe2)](_0xc1177c,_0x20f109),_0x9003b4(0x107));}[a0_0x1564ba(0xe2)](_0x535821,_0x2f9b43){const _0x130641=a0_0x1564ba;return _0x535821[_0x130641(0xac)](/{{pascalCase name}}/g,_0x2f9b43[_0x130641(0x121)])['replace'](/{{camelCase name}}/g,_0x2f9b43['camelCaseName'])[_0x130641(0xac)](/{{snakeCase name}}/g,_0x2f9b43['snakeCaseName'])['replace'](/{{pluralPascalCase name}}/g,_0x2f9b43['pluralPascalCaseName'])[_0x130641(0xac)](/{{pluralCamelCase name}}/g,_0x2f9b43['pluralCamelCaseName'])['replace'](/{{name}}/g,_0x2f9b43['name']);}async[a0_0x1564ba(0xcb)](_0x235ddb,_0x50bceb,_0x6ff677){const _0x377cdf=a0_0x1564ba;let _0xb6fb6e=_0x235ddb+_0x377cdf(0xec);await this[_0x377cdf(0x136)](_0xb6fb6e),_0xb6fb6e=_0xb6fb6e+'/'+_0x50bceb,await this['createDir'](_0xb6fb6e),_0xb6fb6e+=_0x377cdf(0xf5),await this[_0x377cdf(0x136)](_0xb6fb6e),_0xb6fb6e+=_0x377cdf(0x138),await this['createDir'](_0xb6fb6e),_0xb6fb6e=_0xb6fb6e+'/'+_0x6ff677,await this[_0x377cdf(0x136)](_0xb6fb6e);}['getProjectRootPath'](){const _0x4e0674=a0_0x1564ba;let _0x4119d8=process[_0x4e0674(0x117)][_0x4e0674(0xff)][_0x4e0674(0xfc)]('/'),_0x2519b8=[];for(let _0x853ef2=0x0;_0x853ef2<_0x4119d8['length']&&_0x4e0674(0xb7)!=_0x4119d8[_0x853ef2];_0x853ef2++)_0x2519b8[_0x4e0674(0xc0)](_0x4119d8[_0x853ef2]);return _0x2519b8[_0x4e0674(0xbb)]('/');}async['createDir'](_0x5534c9){const _0x3e7fcf=a0_0x1564ba;0x0==await this['existsPath'](_0x5534c9)&&fs[_0x3e7fcf(0x13b)](_0x5534c9);}async[a0_0x1564ba(0xfb)](_0x171caa){const _0x568805=a0_0x1564ba;return await fs[_0x568805(0xc4)](_0x171caa);}};tslib_1[a0_0x1564ba(0x102)]([(0x0,type_graphql_1[a0_0x1564ba(0xd1)])(_0x3aa5cd=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Service'}),tslib_1[a0_0x1564ba(0xbc)](0x0,(0x0,type_graphql_1[a0_0x1564ba(0x120)])('id')),tslib_1[a0_0x1564ba(0xbc)](0x1,(0x0,type_graphql_1[a0_0x1564ba(0xea)])()),tslib_1[a0_0x1564ba(0x12a)](a0_0x1564ba(0xdd),Function),tslib_1[a0_0x1564ba(0x12a)](a0_0x1564ba(0x108),[String,Object]),tslib_1[a0_0x1564ba(0x12a)]('design:returntype',Promise)],OperatoToolCreateService[a0_0x1564ba(0x116)],a0_0x1564ba(0xb0),null),OperatoToolCreateService=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x1564ba(0x11a)])()],OperatoToolCreateService),exports[a0_0x1564ba(0x105)]=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='\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',serviceHistoryIndex=a0_0x1564ba(0xdb),serviceQuery='\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',serviceHistoryQuery=a0_0x1564ba(0x11e),serviceMutation=a0_0x1564ba(0xd3),sereviceType=a0_0x1564ba(0x10b),sereviceHistoryType=a0_0x1564ba(0xe0),serviceEntity=a0_0x1564ba(0xf3),serviceEntityHistCopy=a0_0x1564ba(0xfe),serviceEntityHistJson=a0_0x1564ba(0x133),serviceEntitySubscriber=a0_0x1564ba(0x11b);
1
+ 'use strict';function a0_0x1c2b(_0x1c88cc,_0x5b8e28){const _0x3ec256=a0_0x3ec2();return a0_0x1c2b=function(_0x1c2b9e,_0x1e9512){_0x1c2b9e=_0x1c2b9e-0x13e;let _0x44ca5b=_0x3ec256[_0x1c2b9e];return _0x44ca5b;},a0_0x1c2b(_0x1c88cc,_0x5b8e28);}const a0_0x128975=a0_0x1c2b;(function(_0xf2f656,_0x336676){const _0x58b9e8=a0_0x1c2b,_0x50a0b1=_0xf2f656();while(!![]){try{const _0x120a85=-parseInt(_0x58b9e8(0x1bc))/0x1+-parseInt(_0x58b9e8(0x188))/0x2+-parseInt(_0x58b9e8(0x1c9))/0x3+parseInt(_0x58b9e8(0x159))/0x4*(parseInt(_0x58b9e8(0x157))/0x5)+parseInt(_0x58b9e8(0x1ad))/0x6+-parseInt(_0x58b9e8(0x17e))/0x7*(-parseInt(_0x58b9e8(0x158))/0x8)+parseInt(_0x58b9e8(0x1a1))/0x9*(parseInt(_0x58b9e8(0x174))/0xa);if(_0x120a85===_0x336676)break;else _0x50a0b1['push'](_0x50a0b1['shift']());}catch(_0x5729d1){_0x50a0b1['push'](_0x50a0b1['shift']());}}}(a0_0x3ec2,0x7cde4));function a0_0x3ec2(){const _0x3eb4be=['8CKKSJc','1176VoeVCp','type-graphql','nullable','created_at','sort','pluralPascalCaseName','toolCreateService','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','env','creator','integer','design:paramtypes','replace','double','mkdirSync','import\x20{\x20entities\x20as\x20','/server','COPY','@Field(','datetime','__decorate','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','existsPath','/packages','createHistoryServiceFiles','find','\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','1273710KtZdbc','float','updater','getColTxtType','Entities,','index.ts','PWD','getFieldType','@things-factory/resource-base','string','1672230MxqqWy','EntitySubscribers,','\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','createTypeText','push','-history.ts','Entities,\x20resolvers\x20as\x20','Resolvers,\x20subscribers\x20as\x20','Resolvers\x20}\x20from\x20\x27./','getRepository','1060724hJsLLF','number','Resolvers,','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','includes','\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()\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','\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()\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','\x0a\x20\x20','timestamp\x20without\x20time\x20zone','EntitySubscribers\x20}\x20from\x20\x27./','/event-subscriber.ts','.ts','pascalCaseName','domain','-type.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','domain_id','\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}}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','getProjectRootPath','...','-mutation.ts','state','@things-factory/shell','99vjxCLW','dataProp','tslib','colType','uniqRank','-history-type.ts','{{camelCase\x20name}}.','split','/server/service/','export\x20*\x20from\x20\x27./','replaceNamesMap','/*\x20ENTITIES\x20*/\x0a\x09...','3893820eHblSP','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','filter','createDir','design:type','__param','prototype','long','map','join','Arg','Query','creator_id','-history-query.ts','double\x20precision','724390JqKbaT','bigint','readFileSync','length','findOne','\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','OperatoToolCreateService','\x27,\x20nullable:\x20','createServicePath','text','updated_at','writeFileSync','Date','2461653MtFpmf','type\x20=>','rank','\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','camelCaseName','indexOf','createHistoryEntityText','name','createEntityText','JSON','Float','packages','Entity','-query.ts','updater_id','columnToEntityColumn','/packages/','date','Int','/index.ts','\x20})','createNoHistoryServiceFiels','\x20{\x20nullable:\x20','writeFile','pluralCamelCaseName','character\x20varying','utf8','5065UkBEFb'];a0_0x3ec2=function(){return _0x3eb4be;};return a0_0x3ec2();}Object['defineProperty'](exports,'__esModule',{'value':!0x0}),exports[a0_0x128975(0x1c2)]=void 0x0;const tslib_1=require(a0_0x128975(0x1a3)),type_graphql_1=require(a0_0x128975(0x15a)),shell_1=require(a0_0x128975(0x1a0)),resource_base_1=require(a0_0x128975(0x17c)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require('pluralize'),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x128975(0x15f)](_0x57586a,_0x4c1f26){const _0x5c699f=a0_0x128975,{domain:_0x19801d}=_0x4c1f26[_0x5c699f(0x19f)],_0x17de8c=await(0x0,shell_1[_0x5c699f(0x187)])(resource_base_1[_0x5c699f(0x148)])[_0x5c699f(0x1c0)]({'where':{'id':_0x57586a}}),_0x125c6e=await(0x0,shell_1[_0x5c699f(0x187)])(resource_base_1['EntityColumn'])[_0x5c699f(0x172)]({'where':{'domain':{'id':_0x19801d['id']},'entity':{'id':_0x17de8c['id']}}});let {name:_0xa673f7='',bundle:_0x5f3166=''}=_0x17de8c||{},_0x569293=this['getProjectRootPath'](),_0x1c0c12=kebabCase(_0xa673f7);return await this[_0x5c699f(0x1c4)](_0x569293,_0x5f3166,_0x1c0c12),await this[_0x5c699f(0x18b)](_0x569293,_0x5f3166,_0xa673f7,_0x1c0c12,_0x17de8c,_0x125c6e),!0x0;}async['createServiceFiles'](_0xdcd764,_0x4958a8,_0x33474b,_0x512116,_0x3ddc20,_0x26f336){const _0x3d9ca4=a0_0x128975;let _0x35318b={'name':_0x512116,'pascalCaseName':startCase(camelCase(_0x33474b))[_0x3d9ca4(0x165)](/ /g,''),'camelCaseName':camelCase(_0x33474b),'snakeCaseName':snakeCase(_0x33474b),'pluralPascalCaseName':startCase(camelCase(plural(_0x33474b)))['replace'](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x33474b))},_0x4750cc=_0xdcd764+_0x3d9ca4(0x14c)+_0x4958a8+_0x3d9ca4(0x1a9);[_0x3d9ca4(0x145),_0x3d9ca4(0x16a)][_0x3d9ca4(0x18d)](_0x3ddc20[_0x3d9ca4(0x1a2)])?await this[_0x3d9ca4(0x171)](_0x4750cc,_0x512116,_0x3ddc20,_0x26f336,_0x35318b):await this[_0x3d9ca4(0x151)](_0x4750cc,_0x512116,_0x3ddc20,_0x26f336,_0x35318b);}async['createHistoryServiceFiles'](_0x41bff6,_0x18849d,_0x3e6330,_0x30f724,_0x495e3a){const _0x517344=a0_0x128975;await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+_0x517344(0x14f)),serviceHistoryIndex,_0x495e3a);let _0x1097ac=this['createEntityText'](_0x3e6330,_0x30f724);await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+'/'+_0x18849d+'.ts'),_0x1097ac,_0x495e3a),await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+'/'+_0x18849d+_0x517344(0x149)),serviceQuery,_0x495e3a),await this['writeFile'](_0x41bff6+(_0x18849d+'/'+_0x18849d+_0x517344(0x19e)),serviceMutation,_0x495e3a);let _0x273336=this[_0x517344(0x181)](_0x30f724);await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+'/'+_0x18849d+_0x517344(0x197)),_0x273336,_0x495e3a);let _0xffa896=this['createHistoryEntityText'](_0x3e6330,_0x30f724);await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+'/'+_0x18849d+_0x517344(0x183)),_0xffa896,_0x495e3a);let _0x2d270c='';_0x517344(0x145)==_0x3e6330[_0x517344(0x1a2)]?(_0x2d270c='\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[_0x517344(0x153)](_0x41bff6+(_0x18849d+_0x517344(0x193)),serviceEntitySubscriber,_0x495e3a)):_0x2d270c='';let _0x30b480=serviceEntitySubscriber[_0x517344(0x165)](/{{entityToJson}}/g,_0x2d270c);await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+_0x517344(0x193)),_0x30b480,_0x495e3a),await this['writeFile'](_0x41bff6+(_0x18849d+'/'+_0x18849d+_0x517344(0x1ba)),serviceHistoryQuery,_0x495e3a),await this[_0x517344(0x153)](_0x41bff6+(_0x18849d+'/'+_0x18849d+_0x517344(0x1a6)),sereviceHistoryType,_0x495e3a);let _0x3247cd=_0x41bff6+_0x517344(0x179);0x0==await this[_0x517344(0x16f)](_0x3247cd)&&await this[_0x517344(0x153)](_0x3247cd,allIndex,_0x495e3a);let _0x22b08f=await fs[_0x517344(0x1be)](_0x3247cd,_0x517344(0x156));_0x22b08f[_0x517344(0x141)](_0x517344(0x1aa)+_0x495e3a['name']+'/'+_0x495e3a[_0x517344(0x143)]+'-history\x27')<0x0&&(_0x22b08f=_0x22b08f[_0x517344(0x165)](/\/\* EXPORT ENTITY TYPES \*\//,_0x517344(0x160)+_0x495e3a[_0x517344(0x143)]+'/'+_0x495e3a['name']+'-history\x27')),_0x22b08f[_0x517344(0x141)](_0x517344(0x1aa)+_0x495e3a[_0x517344(0x143)]+'/'+_0x495e3a['name']+'\x27')<0x0&&(_0x22b08f=_0x22b08f[_0x517344(0x165)](/\/\* EXPORT ENTITY TYPES \*\//,_0x517344(0x160)+_0x495e3a[_0x517344(0x143)]+'/'+_0x495e3a[_0x517344(0x143)]+'\x27')),_0x22b08f[_0x517344(0x141)]('import\x20{\x20entities\x20as\x20'+_0x495e3a[_0x517344(0x195)]+_0x517344(0x184)+_0x495e3a[_0x517344(0x195)]+_0x517344(0x185)+_0x495e3a['pascalCaseName']+_0x517344(0x192)+_0x495e3a['name']+'\x27')<0x0&&(_0x22b08f=_0x22b08f[_0x517344(0x165)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x517344(0x16e)+_0x495e3a[_0x517344(0x195)]+_0x517344(0x184)+_0x495e3a[_0x517344(0x195)]+'Resolvers,\x20subscribers\x20as\x20'+_0x495e3a[_0x517344(0x195)]+_0x517344(0x192)+_0x495e3a['name']+'\x27')),_0x22b08f[_0x517344(0x141)](_0x517344(0x19d)+_0x495e3a[_0x517344(0x195)]+_0x517344(0x178))<0x0&&(_0x22b08f=_0x22b08f[_0x517344(0x165)](/\/\* ENTITIES \*\//,_0x517344(0x1ac)+_0x495e3a[_0x517344(0x195)]+_0x517344(0x178))),_0x22b08f[_0x517344(0x141)](_0x517344(0x19d)+_0x495e3a[_0x517344(0x195)]+'Resolvers,')<0x0&&(_0x22b08f=_0x22b08f[_0x517344(0x165)](/\/\* RESOLVER CLASSES \*\//,_0x517344(0x1ae)+_0x495e3a[_0x517344(0x195)]+_0x517344(0x18a))),_0x22b08f[_0x517344(0x141)](_0x517344(0x19d)+_0x495e3a[_0x517344(0x195)]+_0x517344(0x17f))<0x0&&(_0x22b08f=_0x22b08f[_0x517344(0x165)](/\/\* SUBSCRIBERS \*\//,'/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...'+_0x495e3a[_0x517344(0x195)]+'EntitySubscribers,')),await this[_0x517344(0x153)](_0x3247cd,_0x22b08f,_0x495e3a);}async[a0_0x128975(0x151)](_0x5bb55c,_0xbc6640,_0x58d4e8,_0x18fc18,_0x15bbe7){const _0x3f1f4d=a0_0x128975;await this['writeFile'](_0x5bb55c+(_0xbc6640+_0x3f1f4d(0x14f)),serviceIndex,_0x15bbe7),await this['writeFile'](_0x5bb55c+(_0xbc6640+'/'+_0xbc6640+_0x3f1f4d(0x149)),serviceQuery,_0x15bbe7),await this[_0x3f1f4d(0x153)](_0x5bb55c+(_0xbc6640+'/'+_0xbc6640+'-mutation.ts'),serviceMutation,_0x15bbe7);let _0x407439=this[_0x3f1f4d(0x144)](_0x58d4e8,_0x18fc18);await this[_0x3f1f4d(0x153)](_0x5bb55c+(_0xbc6640+'/'+_0xbc6640+_0x3f1f4d(0x194)),_0x407439,_0x15bbe7);let _0xcf635a=this[_0x3f1f4d(0x181)](_0x18fc18);await this['writeFile'](_0x5bb55c+(_0xbc6640+'/'+_0xbc6640+_0x3f1f4d(0x197)),_0xcf635a,_0x15bbe7);let _0x593546=_0x5bb55c+_0x3f1f4d(0x179);0x0==await this[_0x3f1f4d(0x16f)](_0x593546)&&await this[_0x3f1f4d(0x153)](_0x593546,allIndex,_0x15bbe7);let _0x27a1ec=await fs[_0x3f1f4d(0x1be)](_0x593546,'utf8');_0x27a1ec[_0x3f1f4d(0x141)]('export\x20*\x20from\x20\x27./'+_0x15bbe7['name']+'/'+_0x15bbe7[_0x3f1f4d(0x143)]+'\x27')<0x0&&(_0x27a1ec=_0x27a1ec['replace'](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x15bbe7[_0x3f1f4d(0x143)]+'/'+_0x15bbe7[_0x3f1f4d(0x143)]+'\x27')),_0x27a1ec[_0x3f1f4d(0x141)](_0x3f1f4d(0x168)+_0x15bbe7[_0x3f1f4d(0x195)]+_0x3f1f4d(0x184)+_0x15bbe7['pascalCaseName']+_0x3f1f4d(0x186)+_0x15bbe7[_0x3f1f4d(0x143)]+'\x27')<0x0&&(_0x27a1ec=_0x27a1ec['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x3f1f4d(0x16e)+_0x15bbe7['pascalCaseName']+_0x3f1f4d(0x184)+_0x15bbe7[_0x3f1f4d(0x195)]+_0x3f1f4d(0x186)+_0x15bbe7['name']+'\x27')),_0x27a1ec[_0x3f1f4d(0x141)](_0x3f1f4d(0x19d)+_0x15bbe7['pascalCaseName']+_0x3f1f4d(0x178))<0x0&&(_0x27a1ec=_0x27a1ec[_0x3f1f4d(0x165)](/\/\* ENTITIES \*\//,_0x3f1f4d(0x1ac)+_0x15bbe7[_0x3f1f4d(0x195)]+'Entities,')),_0x27a1ec[_0x3f1f4d(0x141)](_0x3f1f4d(0x19d)+_0x15bbe7['pascalCaseName']+_0x3f1f4d(0x18a))<0x0&&(_0x27a1ec=_0x27a1ec[_0x3f1f4d(0x165)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x15bbe7[_0x3f1f4d(0x195)]+_0x3f1f4d(0x18a))),await this['writeFile'](_0x593546,_0x27a1ec,_0x15bbe7);}[a0_0x128975(0x181)](_0x1c4945){const _0x53401c=a0_0x128975;let _0x1ce33c=sereviceType,_0x443ece=_0x1c4945[_0x53401c(0x1b5)](_0x3dfe52=>{const _0x4af2e1=_0x53401c;if('id'==_0x3dfe52[_0x4af2e1(0x143)])return'';if(_0x4af2e1(0x199)==_0x3dfe52[_0x4af2e1(0x143)])return'';if('created_at'==_0x3dfe52['name'])return'';if(_0x4af2e1(0x1c6)==_0x3dfe52[_0x4af2e1(0x143)])return'';if(_0x4af2e1(0x1b9)==_0x3dfe52[_0x4af2e1(0x143)])return'';if(_0x4af2e1(0x14a)==_0x3dfe52[_0x4af2e1(0x143)])return'';let _0x1e2d7a=this['getFieldType'](_0x3dfe52),_0x4ae11a=this[_0x4af2e1(0x177)](_0x3dfe52),_0x5cb2bd=camelCase(_0x3dfe52[_0x4af2e1(0x143)]);return'\x20\x20'+(_0x4af2e1(0x16b)+(0x0==_0x1e2d7a[_0x4af2e1(0x1bf)]?'':_0x4af2e1(0x1ca)+_0x1e2d7a+',')+_0x4af2e1(0x152)+_0x3dfe52[_0x4af2e1(0x15b)]+_0x4af2e1(0x150))+_0x4af2e1(0x190)+(''+_0x5cb2bd+(_0x3dfe52[_0x4af2e1(0x15b)]?'?':'')+':\x20'+_0x4ae11a)+'\x0a';});_0x1ce33c=_0x1ce33c[_0x53401c(0x165)](/{{newTypeColumns}}/g,_0x443ece[_0x53401c(0x1b6)]('\x0a'));let _0x370f91=_0x1c4945[_0x53401c(0x1b5)](_0x87a6b4=>{const _0x221df1=_0x53401c;if('id'==_0x87a6b4[_0x221df1(0x143)])return'';if(_0x221df1(0x199)==_0x87a6b4['name'])return'';if(_0x221df1(0x15c)==_0x87a6b4[_0x221df1(0x143)])return'';if(_0x221df1(0x1c6)==_0x87a6b4[_0x221df1(0x143)])return'';if('creator_id'==_0x87a6b4['name'])return'';if(_0x221df1(0x14a)==_0x87a6b4['name'])return'';let _0x27c205=this[_0x221df1(0x17b)](_0x87a6b4),_0x217867=this[_0x221df1(0x177)](_0x87a6b4);_0x87a6b4['nullable']=!0x0;let _0x523408=camelCase(_0x87a6b4[_0x221df1(0x143)]);return'\x20\x20'+(_0x221df1(0x16b)+(0x0==_0x27c205['length']?'':_0x221df1(0x1ca)+_0x27c205+',')+_0x221df1(0x152)+_0x87a6b4['nullable']+_0x221df1(0x150))+_0x221df1(0x190)+(''+_0x523408+(_0x87a6b4['nullable']?'?':'')+':\x20'+_0x217867)+'\x0a';});return _0x1ce33c=_0x1ce33c[_0x53401c(0x165)](/{{patchTypeColumns}}/g,_0x370f91[_0x53401c(0x1b6)]('\x0a')),_0x1ce33c;}['createEntityText'](_0x4d7248,_0x31ae99){const _0x41fc76=a0_0x128975;let _0x4d68af=serviceEntity,_0x271c7c=_0x31ae99['sort'](function(_0x5e04e9,_0x2d0285){const _0x2eeb21=a0_0x1c2b;return _0x5e04e9[_0x2eeb21(0x13e)]-_0x2d0285[_0x2eeb21(0x13e)];})['map'](_0xadb0ed=>this[_0x41fc76(0x14b)](_0xadb0ed));['COPY',_0x41fc76(0x145)][_0x41fc76(0x18d)](_0x4d7248[_0x41fc76(0x1a2)])&&_0x271c7c[_0x41fc76(0x182)]('\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201'),_0x4d68af=_0x4d68af['replace'](/{{entityColumns}}/g,_0x271c7c['join']('\x0a'));let _0x2881b0='',_0xf0438a=_0x31ae99[_0x41fc76(0x1af)](_0x1a27a2=>_0x1a27a2[_0x41fc76(0x1a5)]&&_0x1a27a2[_0x41fc76(0x1a5)]>0x0)['sort'](function(_0x2d6846,_0x92dd3c){const _0x4e126d=_0x41fc76;return _0x2d6846['uniqRank']-_0x92dd3c[_0x4e126d(0x1a5)];});if(_0xf0438a['length']>0x0){_0x2881b0='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0x133aa2=_0xf0438a[_0x41fc76(0x1b5)](_0x34f7c7=>{const _0x39faad=_0x41fc76;let _0x9a10=_0x34f7c7[_0x39faad(0x143)];return _0x39faad(0x199)==_0x34f7c7['name']&&(_0x9a10=_0x39faad(0x196)),_0x39faad(0x1b9)==_0x34f7c7[_0x39faad(0x143)]&&(_0x9a10=_0x39faad(0x162)),'updater_id'==_0x34f7c7[_0x39faad(0x143)]&&(_0x9a10=_0x39faad(0x176)),_0x39faad(0x1a7)+camelCase(_0x9a10);});_0x2881b0=_0x2881b0[_0x41fc76(0x165)](/{{indexColumns}}/g,_0x133aa2['join'](','));}return _0x4d68af=_0x4d68af[_0x41fc76(0x165)](/{{indexAnn}}/g,_0x2881b0),_0x4d68af;}[a0_0x128975(0x142)](_0x396d81,_0x15196c){const _0x3c9241=a0_0x128975;let _0x92a1dd='JSON'==_0x396d81[_0x3c9241(0x1a2)]?serviceEntityHistJson:serviceEntityHistCopy,_0x3b39ab=_0x15196c[_0x3c9241(0x15d)](function(_0xcf2806,_0x2dbe7d){const _0x5534ed=_0x3c9241;return _0xcf2806[_0x5534ed(0x13e)]-_0x2dbe7d[_0x5534ed(0x13e)];})[_0x3c9241(0x1b5)](_0x3d9ef6=>this[_0x3c9241(0x14b)](_0x3d9ef6));return _0x92a1dd=_0x92a1dd['replace'](/{{entityColumns}}/g,_0x3b39ab[_0x3c9241(0x1b6)]('\x0a')),_0x92a1dd;}[a0_0x128975(0x14b)](_0x48822a){const _0x1aa7cc=a0_0x128975;if('id'==_0x48822a['name'])return'';if(_0x1aa7cc(0x199)==_0x48822a[_0x1aa7cc(0x143)])return'';if(_0x1aa7cc(0x15c)==_0x48822a['name'])return'';if(_0x1aa7cc(0x1c6)==_0x48822a[_0x1aa7cc(0x143)])return'';if(_0x1aa7cc(0x1b9)==_0x48822a[_0x1aa7cc(0x143)])return'';if(_0x1aa7cc(0x14a)==_0x48822a[_0x1aa7cc(0x143)])return'';let _0x5343ad=_0x48822a[_0x1aa7cc(0x1a4)];'double'==_0x48822a[_0x1aa7cc(0x1a4)]&&(_0x5343ad=_0x1aa7cc(0x1bb)),_0x1aa7cc(0x1b4)==_0x48822a['colType']&&(_0x5343ad=_0x1aa7cc(0x1bd)),_0x1aa7cc(0x17d)==_0x48822a['colType']&&(_0x5343ad=_0x1aa7cc(0x155)),_0x1aa7cc(0x16c)==_0x48822a[_0x1aa7cc(0x1a4)]&&(_0x5343ad=_0x1aa7cc(0x191));let _0x2a2746='';'string'==_0x48822a[_0x1aa7cc(0x1a4)]&&(_0x2a2746=_0x48822a['colSize']);let _0x139518=this['getFieldType'](_0x48822a),_0x467278=this[_0x1aa7cc(0x177)](_0x48822a),_0x77dc8b=camelCase(_0x48822a[_0x1aa7cc(0x143)]);return'\x20\x20'+('@Column({name:\x27'+_0x48822a[_0x1aa7cc(0x143)]+_0x1aa7cc(0x19a)+_0x5343ad+_0x1aa7cc(0x1c3)+_0x48822a['nullable']+'\x20'+(0x0==_0x2a2746['length']?'':',length:'+_0x2a2746)+_0x1aa7cc(0x150))+'\x0a\x20\x20'+(_0x1aa7cc(0x16b)+(0x0==_0x139518[_0x1aa7cc(0x1bf)]?'':_0x1aa7cc(0x1ca)+_0x139518+',')+_0x1aa7cc(0x152)+_0x48822a['nullable']+_0x1aa7cc(0x150))+'\x0a\x20\x20'+(''+_0x77dc8b+(_0x48822a[_0x1aa7cc(0x15b)]?'?':'')+':\x20'+_0x467278)+'\x0a';}[a0_0x128975(0x17b)](_0x1b55a3){const _0x24dd60=a0_0x128975;let _0x413fdc='';return _0x24dd60(0x166)==_0x1b55a3[_0x24dd60(0x1a4)]&&(_0x413fdc=_0x24dd60(0x146)),'float'==_0x1b55a3[_0x24dd60(0x1a4)]&&(_0x413fdc=_0x24dd60(0x146)),_0x24dd60(0x1b4)==_0x1b55a3[_0x24dd60(0x1a4)]&&(_0x413fdc=_0x24dd60(0x14e)),_0x24dd60(0x163)==_0x1b55a3[_0x24dd60(0x1a4)]&&(_0x413fdc=_0x24dd60(0x14e)),_0x413fdc;}[a0_0x128975(0x177)](_0x21713a){const _0x3e3caa=a0_0x128975;let _0x1be24f=_0x21713a[_0x3e3caa(0x1a4)];return'decimal'==_0x21713a[_0x3e3caa(0x1a4)]&&(_0x1be24f=_0x3e3caa(0x189)),'double'==_0x21713a[_0x3e3caa(0x1a4)]&&(_0x1be24f=_0x3e3caa(0x189)),_0x3e3caa(0x175)==_0x21713a[_0x3e3caa(0x1a4)]&&(_0x1be24f=_0x3e3caa(0x189)),'integer'==_0x21713a['colType']&&(_0x1be24f=_0x3e3caa(0x189)),'long'==_0x21713a[_0x3e3caa(0x1a4)]&&(_0x1be24f=_0x3e3caa(0x189)),'datetime'==_0x21713a[_0x3e3caa(0x1a4)]&&(_0x1be24f=_0x3e3caa(0x1c8)),_0x3e3caa(0x14d)==_0x21713a[_0x3e3caa(0x1a4)]&&(_0x1be24f=_0x3e3caa(0x1c8)),_0x3e3caa(0x1c5)==_0x21713a['colType']&&(_0x1be24f=_0x3e3caa(0x17d)),_0x1be24f;}async[a0_0x128975(0x153)](_0x115a35,_0x329a96,_0x5a88fb){const _0x4c1a5f=a0_0x128975;await fs[_0x4c1a5f(0x1c7)](_0x115a35,this[_0x4c1a5f(0x1ab)](_0x329a96,_0x5a88fb),'utf8');}[a0_0x128975(0x1ab)](_0x5668b6,_0x387422){const _0x824d75=a0_0x128975;return _0x5668b6[_0x824d75(0x165)](/{{pascalCase name}}/g,_0x387422[_0x824d75(0x195)])['replace'](/{{camelCase name}}/g,_0x387422[_0x824d75(0x140)])['replace'](/{{snakeCase name}}/g,_0x387422['snakeCaseName'])[_0x824d75(0x165)](/{{pluralPascalCase name}}/g,_0x387422[_0x824d75(0x15e)])[_0x824d75(0x165)](/{{pluralCamelCase name}}/g,_0x387422[_0x824d75(0x154)])['replace'](/{{name}}/g,_0x387422[_0x824d75(0x143)]);}async[a0_0x128975(0x1c4)](_0x2a4e0b,_0x35f214,_0x1a883f){const _0x510569=a0_0x128975;let _0x509005=_0x2a4e0b+_0x510569(0x170);await this[_0x510569(0x1b0)](_0x509005),_0x509005=_0x509005+'/'+_0x35f214,await this['createDir'](_0x509005),_0x509005+=_0x510569(0x169),await this[_0x510569(0x1b0)](_0x509005),_0x509005+='/service',await this[_0x510569(0x1b0)](_0x509005),_0x509005=_0x509005+'/'+_0x1a883f,await this[_0x510569(0x1b0)](_0x509005);}[a0_0x128975(0x19c)](){const _0x269c5a=a0_0x128975;let _0x17af68=process[_0x269c5a(0x161)][_0x269c5a(0x17a)][_0x269c5a(0x1a8)]('/'),_0x17c2ec=[];for(let _0x4b1c57=0x0;_0x4b1c57<_0x17af68[_0x269c5a(0x1bf)]&&_0x269c5a(0x147)!=_0x17af68[_0x4b1c57];_0x4b1c57++)_0x17c2ec['push'](_0x17af68[_0x4b1c57]);return _0x17c2ec[_0x269c5a(0x1b6)]('/');}async[a0_0x128975(0x1b0)](_0x59b8fd){const _0x5cb9dd=a0_0x128975;0x0==await this[_0x5cb9dd(0x16f)](_0x59b8fd)&&fs[_0x5cb9dd(0x167)](_0x59b8fd);}async['existsPath'](_0x3bae6e){return await fs['existsSync'](_0x3bae6e);}};tslib_1[a0_0x128975(0x16d)]([(0x0,type_graphql_1[a0_0x128975(0x1b8)])(_0x473747=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Service'}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x128975(0x1b7)])('id')),tslib_1[a0_0x128975(0x1b2)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1['__metadata'](a0_0x128975(0x1b1),Function),tslib_1['__metadata'](a0_0x128975(0x164),[String,Object]),tslib_1['__metadata']('design:returntype',Promise)],OperatoToolCreateService[a0_0x128975(0x1b3)],a0_0x128975(0x15f),null),OperatoToolCreateService=tslib_1[a0_0x128975(0x16d)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports['OperatoToolCreateService']=OperatoToolCreateService;const allIndex=a0_0x128975(0x173),serviceIndex='\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',serviceHistoryIndex=a0_0x128975(0x198),serviceQuery='\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',serviceHistoryQuery=a0_0x128975(0x19b),serviceMutation=a0_0x128975(0x18c),sereviceType=a0_0x128975(0x13f),sereviceHistoryType=a0_0x128975(0x180),serviceEntity=a0_0x128975(0x18e),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()\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_0x128975(0x18f),serviceEntitySubscriber=a0_0x128975(0x1c1);
@@ -1 +1 @@
1
- 'use strict';const a0_0x54cdd0=a0_0x57c6;(function(_0x42de36,_0x5e7994){const _0x5335fa=a0_0x57c6,_0x123f07=_0x42de36();while(!![]){try{const _0x461a1a=parseInt(_0x5335fa(0x1f6))/0x1+parseInt(_0x5335fa(0x210))/0x2*(parseInt(_0x5335fa(0x1fc))/0x3)+-parseInt(_0x5335fa(0x200))/0x4+-parseInt(_0x5335fa(0x207))/0x5+parseInt(_0x5335fa(0x217))/0x6+-parseInt(_0x5335fa(0x214))/0x7*(-parseInt(_0x5335fa(0x208))/0x8)+parseInt(_0x5335fa(0x202))/0x9*(-parseInt(_0x5335fa(0x206))/0xa);if(_0x461a1a===_0x5e7994)break;else _0x123f07['push'](_0x123f07['shift']());}catch(_0x581e37){_0x123f07['push'](_0x123f07['shift']());}}}(a0_0x544f,0x4bd25));function a0_0x57c6(_0x4257e2,_0xbb4624){const _0x544f6c=a0_0x544f();return a0_0x57c6=function(_0x57c645,_0x3053d4){_0x57c645=_0x57c645-0x1f3;let _0x4e4b04=_0x544f6c[_0x57c645];return _0x4e4b04;},a0_0x57c6(_0x4257e2,_0xbb4624);}Object['defineProperty'](exports,a0_0x54cdd0(0x1f7),{'value':!0x0}),exports['checkStudioTemplateIsOverLimit']=exports[a0_0x54cdd0(0x213)]=void 0x0;const operato_license_checker_1=require(a0_0x54cdd0(0x205)),shell_1=require(a0_0x54cdd0(0x215)),menu_base_1=require(a0_0x54cdd0(0x201)),license_error_1=require(a0_0x54cdd0(0x212));async function checkStudioPermission(){const _0x26f916=a0_0x54cdd0;let _0x450068=((0x0,operato_license_checker_1[_0x26f916(0x209)])(_0x26f916(0x216))||',')['split'](',')[_0x26f916(0x211)](_0x38723d=>_0x38723d['trim']()),_0xb8b295=!0x1;return _0x450068[_0x26f916(0x20c)](_0x40cae6=>{const _0x48386e=_0x26f916;_0x40cae6[_0x48386e(0x1f8)](_0x48386e(0x203))&&(_0xb8b295=!0x0);}),_0xb8b295;}async function checkStudioTemplateIsOverLimit(_0x41d3bf,_0x38f09e){const _0x2f7ca2=a0_0x54cdd0;if(0x0==await checkStudioPermission())throw new license_error_1['LicenseError']({'errorCode':_0x38f09e['t'](license_error_1['LicenseError'][_0x2f7ca2(0x1f4)]['INVALID_LICENSE'])});var _0x2c3002=0x0;if(_0x2c3002=_0x41d3bf&&''!=_0x41d3bf?await(0x0,shell_1[_0x2f7ca2(0x1fd)])(menu_base_1[_0x2f7ca2(0x20b)])[_0x2f7ca2(0x20a)][_0x2f7ca2(0x1fb)]()[_0x2f7ca2(0x20d)]('menu')[_0x2f7ca2(0x1f9)](menu_base_1['Menu'],_0x2f7ca2(0x1ff))['where'](_0x2f7ca2(0x20e),{'id':_0x41d3bf})['andWhere'](_0x2f7ca2(0x1fa))[_0x2f7ca2(0x20f)]()+0x1:await(0x0,shell_1[_0x2f7ca2(0x1fd)])(menu_base_1[_0x2f7ca2(0x20b)])['manager']['createQueryBuilder']()['select']('menu')[_0x2f7ca2(0x1f9)](menu_base_1[_0x2f7ca2(0x20b)],_0x2f7ca2(0x1ff))[_0x2f7ca2(0x1f5)](_0x2f7ca2(0x1fa))['getCount']()+0x1,!(0x0,operato_license_checker_1[_0x2f7ca2(0x1f3)])(_0x2c3002))throw new license_error_1[(_0x2f7ca2(0x1fe))]({'errorCode':_0x38f09e['t'](license_error_1[_0x2f7ca2(0x1fe)][_0x2f7ca2(0x1f4)][_0x2f7ca2(0x204)])});return!0x0;}exports['checkStudioPermission']=checkStudioPermission,exports['checkStudioTemplateIsOverLimit']=checkStudioTemplateIsOverLimit;function a0_0x544f(){const _0x23c3e8=['id\x20!=\x20:id','getCount','636WIjKjv','map','../../errors/license-error','checkStudioPermission','63uFARhn','@things-factory/shell','Permissions\x20For\x20Tailor\x20Tool','593628AoCuHb','checkTarget','ERROR_CODES','where','333673BWemsi','__esModule','includes','from','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','createQueryBuilder','4689VFaLCl','getRepository','LicenseError','menu','1928348VmvfmI','@things-factory/menu-base','12519uNZIuy','Studio','OVER_LIMIT','@things-factory/operato-license-checker','470FSLPVQ','2284665rFoYQV','342504wttmNY','getPermission','manager','Menu','forEach','select'];a0_0x544f=function(){return _0x23c3e8;};return a0_0x544f();}
1
+ 'use strict';function a0_0x1d58(){const _0x3b7632=['trim','split','../../errors/license-error','366804jguOOr','2028DdBOQa','@things-factory/shell','select','id\x20!=\x20:id','@things-factory/menu-base','OVER_LIMIT','forEach','761622nWrWkZ','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','Studio','Menu','map','2388717zXZUcg','6rYdMZv','1060724MWPSRc','getCount','LicenseError','Permissions\x20For\x20Tailor\x20Tool','__esModule','manager','INVALID_LICENSE','createQueryBuilder','466764oTQLYi','@things-factory/operato-license-checker','checkTarget','1455zwOvSG','checkStudioTemplateIsOverLimit','includes','368960uziYPG','defineProperty','getRepository','where','from','menu'];a0_0x1d58=function(){return _0x3b7632;};return a0_0x1d58();}const a0_0x35f145=a0_0x5cad;(function(_0x566f4f,_0x3599ba){const _0x1b7d7d=a0_0x5cad,_0x914b9b=_0x566f4f();while(!![]){try{const _0x33fefc=parseInt(_0x1b7d7d(0xdd))/0x1+-parseInt(_0x1b7d7d(0xf4))/0x2+-parseInt(_0x1b7d7d(0xe5))/0x3+parseInt(_0x1b7d7d(0xde))/0x4*(-parseInt(_0x1b7d7d(0xf7))/0x5)+-parseInt(_0x1b7d7d(0xeb))/0x6*(-parseInt(_0x1b7d7d(0xec))/0x7)+parseInt(_0x1b7d7d(0xfa))/0x8+parseInt(_0x1b7d7d(0xea))/0x9;if(_0x33fefc===_0x3599ba)break;else _0x914b9b['push'](_0x914b9b['shift']());}catch(_0x294148){_0x914b9b['push'](_0x914b9b['shift']());}}}(a0_0x1d58,0x2fa04));Object[a0_0x35f145(0xfb)](exports,a0_0x35f145(0xf0),{'value':!0x0}),exports[a0_0x35f145(0xf8)]=exports['checkStudioPermission']=void 0x0;const operato_license_checker_1=require(a0_0x35f145(0xf5)),shell_1=require(a0_0x35f145(0xdf)),menu_base_1=require(a0_0x35f145(0xe2)),license_error_1=require(a0_0x35f145(0xdc));async function checkStudioPermission(){const _0x2a8798=a0_0x35f145;let _0x534759=((0x0,operato_license_checker_1['getPermission'])(_0x2a8798(0xef))||',')[_0x2a8798(0x101)](',')[_0x2a8798(0xe9)](_0x2f267b=>_0x2f267b[_0x2a8798(0x100)]()),_0xa00d2b=!0x1;return _0x534759[_0x2a8798(0xe4)](_0x23babc=>{const _0x22d8d3=_0x2a8798;_0x23babc[_0x22d8d3(0xf9)](_0x22d8d3(0xe7))&&(_0xa00d2b=!0x0);}),_0xa00d2b;}function a0_0x5cad(_0x59c5bd,_0x46de68){const _0x1d58b7=a0_0x1d58();return a0_0x5cad=function(_0x5cad2a,_0x4dd6d4){_0x5cad2a=_0x5cad2a-0xdc;let _0xa8450f=_0x1d58b7[_0x5cad2a];return _0xa8450f;},a0_0x5cad(_0x59c5bd,_0x46de68);}async function checkStudioTemplateIsOverLimit(_0x9c8fa8,_0x1260cd){const _0x5175a6=a0_0x35f145;if(0x0==await checkStudioPermission())throw new license_error_1['LicenseError']({'errorCode':_0x1260cd['t'](license_error_1[_0x5175a6(0xee)]['ERROR_CODES'][_0x5175a6(0xf2)])});var _0x13e585=0x0;if(_0x13e585=_0x9c8fa8&&''!=_0x9c8fa8?await(0x0,shell_1[_0x5175a6(0xfc)])(menu_base_1['Menu'])[_0x5175a6(0xf1)]['createQueryBuilder']()[_0x5175a6(0xe0)](_0x5175a6(0xff))[_0x5175a6(0xfe)](menu_base_1['Menu'],_0x5175a6(0xff))[_0x5175a6(0xfd)](_0x5175a6(0xe1),{'id':_0x9c8fa8})['andWhere']('(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)')[_0x5175a6(0xed)]()+0x1:await(0x0,shell_1[_0x5175a6(0xfc)])(menu_base_1[_0x5175a6(0xe8)])['manager'][_0x5175a6(0xf3)]()[_0x5175a6(0xe0)](_0x5175a6(0xff))[_0x5175a6(0xfe)](menu_base_1[_0x5175a6(0xe8)],'menu')[_0x5175a6(0xfd)](_0x5175a6(0xe6))[_0x5175a6(0xed)]()+0x1,!(0x0,operato_license_checker_1[_0x5175a6(0xf6)])(_0x13e585))throw new license_error_1['LicenseError']({'errorCode':_0x1260cd['t'](license_error_1[_0x5175a6(0xee)]['ERROR_CODES'][_0x5175a6(0xe3)])});return!0x0;}exports['checkStudioPermission']=checkStudioPermission,exports[a0_0x35f145(0xf8)]=checkStudioTemplateIsOverLimit;
@@ -1 +1 @@
1
- 'use strict';const a0_0x2b02e7=a0_0x286c;function a0_0x2ea4(){const _0x4f6a6c=['Operato\x20Tool\x20Studio\x20Usage\x20Permissions','2100Xaosso','Resolver','__esModule','224530NhGGDj','checkStudioTemplateIsOverLimit','checkStudioPermission','__param','8NPTKmN','2014586nSpvBg','tslib','Query','prototype','__metadata','OperatoToolResolver','./tool-permission','defineProperty','Ctx','__decorate','Operato\x20Tool\x20Studio\x20Limit\x20check','2436344TuXdQJ','Arg','studioPermission','3063276oNZKtk','studioTemplateIsOverLimit','7430nRUggw','1365564SsoCyn','design:type','design:returntype','281533bdkLCX','design:paramtypes'];a0_0x2ea4=function(){return _0x4f6a6c;};return a0_0x2ea4();}(function(_0x1b3ade,_0x3b4b7e){const _0x5c37e7=a0_0x286c,_0x5136a5=_0x1b3ade();while(!![]){try{const _0x452284=parseInt(_0x5c37e7(0x115))/0x1+parseInt(_0x5c37e7(0x11b))/0x2+parseInt(_0x5c37e7(0x112))/0x3+parseInt(_0x5c37e7(0x10c))/0x4+parseInt(_0x5c37e7(0x111))/0x5*(-parseInt(_0x5c37e7(0x118))/0x6)+parseInt(_0x5c37e7(0x120))/0x7*(-parseInt(_0x5c37e7(0x11f))/0x8)+-parseInt(_0x5c37e7(0x10f))/0x9;if(_0x452284===_0x3b4b7e)break;else _0x5136a5['push'](_0x5136a5['shift']());}catch(_0x1d68b2){_0x5136a5['push'](_0x5136a5['shift']());}}}(a0_0x2ea4,0x4ba32));function a0_0x286c(_0x5be245,_0x33fb0b){const _0x2ea496=a0_0x2ea4();return a0_0x286c=function(_0x286c32,_0x3b1000){_0x286c32=_0x286c32-0x10b;let _0x4741fe=_0x2ea496[_0x286c32];return _0x4741fe;},a0_0x286c(_0x5be245,_0x33fb0b);}Object[a0_0x2b02e7(0x127)](exports,a0_0x2b02e7(0x11a),{'value':!0x0}),exports['OperatoToolResolver']=void 0x0;const tslib_1=require(a0_0x2b02e7(0x121)),type_graphql_1=require('type-graphql'),tool_permission_1=require(a0_0x2b02e7(0x126));let OperatoToolResolver=class{async['studioPermission'](_0x19a638){const _0x5966d6=a0_0x2b02e7;return(0x0,tool_permission_1[_0x5966d6(0x11d)])();}async[a0_0x2b02e7(0x110)](_0x3ed486,_0x3d2708){const _0x167f9b=a0_0x2b02e7;return(0x0,tool_permission_1[_0x167f9b(0x11c)])(_0x3ed486,_0x3d2708);}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x2b02e7(0x122)])(_0x27f899=>Boolean,{'description':a0_0x2b02e7(0x117)}),tslib_1[a0_0x2b02e7(0x11e)](0x0,(0x0,type_graphql_1[a0_0x2b02e7(0x128)])()),tslib_1[a0_0x2b02e7(0x124)]('design:type',Function),tslib_1[a0_0x2b02e7(0x124)]('design:paramtypes',[Object]),tslib_1['__metadata'](a0_0x2b02e7(0x114),Promise)],OperatoToolResolver['prototype'],a0_0x2b02e7(0x10e),null),tslib_1['__decorate']([(0x0,type_graphql_1['Query'])(_0x4a1fe9=>Boolean,{'description':a0_0x2b02e7(0x10b)}),tslib_1[a0_0x2b02e7(0x11e)](0x0,(0x0,type_graphql_1[a0_0x2b02e7(0x10d)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x2b02e7(0x128)])()),tslib_1['__metadata'](a0_0x2b02e7(0x113),Function),tslib_1[a0_0x2b02e7(0x124)](a0_0x2b02e7(0x116),[String,Object]),tslib_1[a0_0x2b02e7(0x124)](a0_0x2b02e7(0x114),Promise)],OperatoToolResolver[a0_0x2b02e7(0x123)],a0_0x2b02e7(0x110),null),OperatoToolResolver=tslib_1[a0_0x2b02e7(0x129)]([(0x0,type_graphql_1[a0_0x2b02e7(0x119)])()],OperatoToolResolver),exports[a0_0x2b02e7(0x125)]=OperatoToolResolver;
1
+ 'use strict';const a0_0x200d29=a0_0x140c;(function(_0x5de3db,_0x4d4a3b){const _0x34e4d3=a0_0x140c,_0x4c01de=_0x5de3db();while(!![]){try{const _0x46653f=-parseInt(_0x34e4d3(0x7c))/0x1*(-parseInt(_0x34e4d3(0x83))/0x2)+-parseInt(_0x34e4d3(0x82))/0x3+parseInt(_0x34e4d3(0x7e))/0x4+parseInt(_0x34e4d3(0x73))/0x5+-parseInt(_0x34e4d3(0x7d))/0x6*(-parseInt(_0x34e4d3(0x71))/0x7)+parseInt(_0x34e4d3(0x80))/0x8+-parseInt(_0x34e4d3(0x78))/0x9;if(_0x46653f===_0x4d4a3b)break;else _0x4c01de['push'](_0x4c01de['shift']());}catch(_0x4c4925){_0x4c01de['push'](_0x4c01de['shift']());}}}(a0_0x5ea2,0xe5ebf));function a0_0x140c(_0x38f230,_0x3f7cc7){const _0x5ea26a=a0_0x5ea2();return a0_0x140c=function(_0x140ccc,_0xa674c9){_0x140ccc=_0x140ccc-0x70;let _0x20192e=_0x5ea26a[_0x140ccc];return _0x20192e;},a0_0x140c(_0x38f230,_0x3f7cc7);}function a0_0x5ea2(){const _0x5515e8=['1758324MYoeJt','studioTemplateIsOverLimit','11948616dDFvGY','__decorate','5445198SJetdK','12142puPlFk','Operato\x20Tool\x20Studio\x20Limit\x20check','tslib','__param','Arg','424529altFTh','__metadata','1680705uILIci','Query','Ctx','design:type','defineProperty','10416033mzgniP','prototype','design:returntype','OperatoToolResolver','211XwvBXa','36wYUkGQ'];a0_0x5ea2=function(){return _0x5515e8;};return a0_0x5ea2();}Object[a0_0x200d29(0x77)](exports,'__esModule',{'value':!0x0}),exports[a0_0x200d29(0x7b)]=void 0x0;const tslib_1=require(a0_0x200d29(0x85)),type_graphql_1=require('type-graphql'),tool_permission_1=require('./tool-permission');let OperatoToolResolver=class{async['studioPermission'](_0x1a876d){return(0x0,tool_permission_1['checkStudioPermission'])();}async[a0_0x200d29(0x7f)](_0x4540cb,_0x57722b){return(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])(_0x4540cb,_0x57722b);}};tslib_1[a0_0x200d29(0x81)]([(0x0,type_graphql_1['Query'])(_0x143933=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Usage\x20Permissions'}),tslib_1['__param'](0x0,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x200d29(0x72)]('design:type',Function),tslib_1[a0_0x200d29(0x72)]('design:paramtypes',[Object]),tslib_1[a0_0x200d29(0x72)](a0_0x200d29(0x7a),Promise)],OperatoToolResolver[a0_0x200d29(0x79)],'studioPermission',null),tslib_1[a0_0x200d29(0x81)]([(0x0,type_graphql_1[a0_0x200d29(0x74)])(_0x41cfec=>Boolean,{'description':a0_0x200d29(0x84)}),tslib_1[a0_0x200d29(0x86)](0x0,(0x0,type_graphql_1[a0_0x200d29(0x70)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x200d29(0x75)])()),tslib_1['__metadata'](a0_0x200d29(0x76),Function),tslib_1[a0_0x200d29(0x72)]('design:paramtypes',[String,Object]),tslib_1[a0_0x200d29(0x72)]('design:returntype',Promise)],OperatoToolResolver[a0_0x200d29(0x79)],'studioTemplateIsOverLimit',null),OperatoToolResolver=tslib_1[a0_0x200d29(0x81)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolResolver),exports[a0_0x200d29(0x7b)]=OperatoToolResolver;