@things-factory/operato-tools 6.1.12 → 6.1.14

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_0x14133c=a0_0x449b;(function(_0x37e88a,_0x377240){const _0x1d04b8=a0_0x449b,_0x487231=_0x37e88a();while(!![]){try{const _0x8f71f2=-parseInt(_0x1d04b8(0x140))/0x1+-parseInt(_0x1d04b8(0x148))/0x2*(parseInt(_0x1d04b8(0x13c))/0x3)+-parseInt(_0x1d04b8(0x146))/0x4+-parseInt(_0x1d04b8(0x145))/0x5*(-parseInt(_0x1d04b8(0x13e))/0x6)+-parseInt(_0x1d04b8(0x143))/0x7+parseInt(_0x1d04b8(0x13b))/0x8+-parseInt(_0x1d04b8(0x144))/0x9*(-parseInt(_0x1d04b8(0x13a))/0xa);if(_0x8f71f2===_0x377240)break;else _0x487231['push'](_0x487231['shift']());}catch(_0x9ab35b){_0x487231['push'](_0x487231['shift']());}}}(a0_0x5c9c,0xa0461));Object[a0_0x14133c(0x13f)](exports,a0_0x14133c(0x141),{'value':!0x0}),exports[a0_0x14133c(0x147)]=void 0x0;function a0_0x5c9c(){const _0x3bacd8=['4760462kxFXqt','9RVgNdY','55RFYqQJ','3677196DTtABu','LicenseError','2JQKJPL','assign','../constants/error-code','21227190yVrhDQ','9197088zTDdxT','3283755GbcLwa','ERROR_CODES','572034ceiHpa','defineProperty','970653mtZnTN','__esModule','errorCode'];a0_0x5c9c=function(){return _0x3bacd8;};return a0_0x5c9c();}const tslib_1=require('tslib'),ERROR_CODES=tslib_1['__importStar'](require(a0_0x14133c(0x139)));function a0_0x449b(_0x2c51a7,_0x548ab7){const _0x5c9cd5=a0_0x5c9c();return a0_0x449b=function(_0x449bbe,_0x439ac0){_0x449bbe=_0x449bbe-0x138;let _0x4b80d1=_0x5c9cd5[_0x449bbe];return _0x4b80d1;},a0_0x449b(_0x2c51a7,_0x548ab7);}class LicenseError extends Error{static get[a0_0x14133c(0x13d)](){const _0x55a1b7=a0_0x14133c;return Object[_0x55a1b7(0x138)]({},ERROR_CODES);}constructor({errorCode:_0x4600cd,detail:_0x399d34}){const _0x45a0d5=a0_0x14133c;super(_0x4600cd),this['name']='license-error',this[_0x45a0d5(0x142)]=_0x4600cd,this['detail']=_0x399d34;}}exports[a0_0x14133c(0x147)]=LicenseError;
1
+ 'use strict';const a0_0x519e0b=a0_0x4685;(function(_0x2071b4,_0xa38e90){const _0x3d24ad=a0_0x4685,_0x219418=_0x2071b4();while(!![]){try{const _0x5e84a9=parseInt(_0x3d24ad(0xfb))/0x1+parseInt(_0x3d24ad(0x101))/0x2+-parseInt(_0x3d24ad(0x102))/0x3+parseInt(_0x3d24ad(0x10f))/0x4*(parseInt(_0x3d24ad(0x10a))/0x5)+-parseInt(_0x3d24ad(0x107))/0x6*(parseInt(_0x3d24ad(0x103))/0x7)+parseInt(_0x3d24ad(0x106))/0x8*(parseInt(_0x3d24ad(0x105))/0x9)+-parseInt(_0x3d24ad(0x10d))/0xa;if(_0x5e84a9===_0xa38e90)break;else _0x219418['push'](_0x219418['shift']());}catch(_0x4dd68c){_0x219418['push'](_0x219418['shift']());}}}(a0_0x1210,0xadc58));function a0_0x1210(){const _0x2b3214=['name','432620LmKQNp','744763sZXLmZ','../constants/error-code','defineProperty','errorCode','__importStar','tslib','2316576eQhiaE','3339936RmiCAF','34727NmLfJR','LicenseError','9FyAmuT','2487208CYnBqd','36khAjAY','assign','__esModule','60cetWNp','detail','license-error','16569660cTtwNI'];a0_0x1210=function(){return _0x2b3214;};return a0_0x1210();}function a0_0x4685(_0xe537fe,_0xd8d635){const _0x1210d4=a0_0x1210();return a0_0x4685=function(_0x4685c2,_0x33823a){_0x4685c2=_0x4685c2-0xfb;let _0x5b6207=_0x1210d4[_0x4685c2];return _0x5b6207;},a0_0x4685(_0xe537fe,_0xd8d635);}Object[a0_0x519e0b(0xfd)](exports,a0_0x519e0b(0x109),{'value':!0x0}),exports[a0_0x519e0b(0x104)]=void 0x0;const tslib_1=require(a0_0x519e0b(0x100)),ERROR_CODES=tslib_1[a0_0x519e0b(0xff)](require(a0_0x519e0b(0xfc)));class LicenseError extends Error{static get['ERROR_CODES'](){const _0x5210ae=a0_0x519e0b;return Object[_0x5210ae(0x108)]({},ERROR_CODES);}constructor({errorCode:_0x50cf9b,detail:_0x4571dd}){const _0x4b1ba8=a0_0x519e0b;super(_0x50cf9b),this[_0x4b1ba8(0x10e)]=_0x4b1ba8(0x10c),this[_0x4b1ba8(0xfe)]=_0x50cf9b,this[_0x4b1ba8(0x10b)]=_0x4571dd;}}exports[a0_0x519e0b(0x104)]=LicenseError;
package/server/routes.js CHANGED
@@ -1 +1 @@
1
- const a0_0xdb081c=a0_0x2d4e;function a0_0x5867(){const _0x27f87a=['14402792SdnsXX','1158768ooJFfU','265915ZsuopI','things-factory:operato-tools:routes','24jkkjar','3811689nigbgG','debug','81402gHItkz','bootstrap-module-domain-public-route','250311HyQMLk','6277740QgbZXe','108OpeaHv','bootstrap-module-global-private-route'];a0_0x5867=function(){return _0x27f87a;};return a0_0x5867();}function a0_0x2d4e(_0x484e75,_0x2e6b27){const _0x58672a=a0_0x5867();return a0_0x2d4e=function(_0x2d4ed3,_0x5edaba){_0x2d4ed3=_0x2d4ed3-0x173;let _0x40a2f3=_0x58672a[_0x2d4ed3];return _0x40a2f3;},a0_0x2d4e(_0x484e75,_0x2e6b27);}(function(_0x7eb7b4,_0x39e470){const _0x121dee=a0_0x2d4e,_0x44ee05=_0x7eb7b4();while(!![]){try{const _0xdb5e72=parseInt(_0x121dee(0x178))/0x1+-parseInt(_0x121dee(0x176))/0x2*(parseInt(_0x121dee(0x173))/0x3)+-parseInt(_0x121dee(0x17d))/0x4+parseInt(_0x121dee(0x17e))/0x5*(-parseInt(_0x121dee(0x17a))/0x6)+parseInt(_0x121dee(0x179))/0x7+parseInt(_0x121dee(0x17c))/0x8+-parseInt(_0x121dee(0x174))/0x9;if(_0xdb5e72===_0x39e470)break;else _0x44ee05['push'](_0x44ee05['shift']());}catch(_0x5b98c6){_0x44ee05['push'](_0x44ee05['shift']());}}}(a0_0x5867,0xe8445));const debug=require(a0_0xdb081c(0x175))(a0_0xdb081c(0x17f));process['on']('bootstrap-module-global-public-route',(_0x5c12bb,_0xec40da)=>{}),process['on'](a0_0xdb081c(0x17b),(_0x2ca62e,_0x1eebc5)=>{}),process['on'](a0_0xdb081c(0x177),(_0x44427e,_0x5b7e4d)=>{}),process['on']('bootstrap-module-domain-private-route',(_0x54f824,_0x31937d)=>{});
1
+ const a0_0x591813=a0_0x5b46;function a0_0x4f79(){const _0x35ad35=['242MvJjrx','bootstrap-module-domain-private-route','909820ddBHxU','1146271BBaSeI','5kJXKPA','287526NkyOTE','bootstrap-module-global-private-route','9ofNWIN','debug','281864VPDlmn','11CsSnRY','447MtYYTB','425400NPEwhf','bootstrap-module-domain-public-route','877692bMzjJI'];a0_0x4f79=function(){return _0x35ad35;};return a0_0x4f79();}(function(_0x36aaad,_0xb61c9){const _0x26d694=a0_0x5b46,_0x323f47=_0x36aaad();while(!![]){try{const _0x3f91ba=-parseInt(_0x26d694(0x164))/0x1*(parseInt(_0x26d694(0x168))/0x2)+parseInt(_0x26d694(0x165))/0x3+-parseInt(_0x26d694(0x167))/0x4+-parseInt(_0x26d694(0x16c))/0x5*(-parseInt(_0x26d694(0x16d))/0x6)+parseInt(_0x26d694(0x16b))/0x7+-parseInt(_0x26d694(0x162))/0x8*(parseInt(_0x26d694(0x16f))/0x9)+-parseInt(_0x26d694(0x16a))/0xa*(-parseInt(_0x26d694(0x163))/0xb);if(_0x3f91ba===_0xb61c9)break;else _0x323f47['push'](_0x323f47['shift']());}catch(_0x49b9c9){_0x323f47['push'](_0x323f47['shift']());}}}(a0_0x4f79,0x21221));function a0_0x5b46(_0xee6e04,_0x51cea7){const _0x4f79f9=a0_0x4f79();return a0_0x5b46=function(_0x5b4630,_0x2e87f0){_0x5b4630=_0x5b4630-0x161;let _0x2e0a77=_0x4f79f9[_0x5b4630];return _0x2e0a77;},a0_0x5b46(_0xee6e04,_0x51cea7);}const debug=require(a0_0x591813(0x161))('things-factory:operato-tools:routes');process['on']('bootstrap-module-global-public-route',(_0x39ce52,_0x1f62cb)=>{}),process['on'](a0_0x591813(0x16e),(_0x2217a5,_0x12fee0)=>{}),process['on'](a0_0x591813(0x166),(_0x5088de,_0x538ba5)=>{}),process['on'](a0_0x591813(0x169),(_0x1c6c2a,_0x585d98)=>{});
@@ -1 +1 @@
1
- 'use strict';function a0_0x2df7(_0x13c688,_0x2043b1){const _0x333690=a0_0x3336();return a0_0x2df7=function(_0x2df7aa,_0x6ddbf0){_0x2df7aa=_0x2df7aa-0x17f;let _0x471842=_0x333690[_0x2df7aa];return _0x471842;},a0_0x2df7(_0x13c688,_0x2043b1);}const a0_0x2f94fb=a0_0x2df7;(function(_0x285059,_0x1f0a7f){const _0x41712a=a0_0x2df7,_0x211a74=_0x285059();while(!![]){try{const _0x1da6e7=-parseInt(_0x41712a(0x180))/0x1+parseInt(_0x41712a(0x1f2))/0x2+-parseInt(_0x41712a(0x1a9))/0x3+parseInt(_0x41712a(0x19b))/0x4*(parseInt(_0x41712a(0x1be))/0x5)+parseInt(_0x41712a(0x190))/0x6+-parseInt(_0x41712a(0x1c4))/0x7+parseInt(_0x41712a(0x1ef))/0x8;if(_0x1da6e7===_0x1f0a7f)break;else _0x211a74['push'](_0x211a74['shift']());}catch(_0x3a9bc8){_0x211a74['push'](_0x211a74['shift']());}}}(a0_0x3336,0x8a324));Object[a0_0x2f94fb(0x1bf)](exports,a0_0x2f94fb(0x1a1),{'value':!0x0}),exports[a0_0x2f94fb(0x1a7)]=void 0x0;const tslib_1=require(a0_0x2f94fb(0x1b0)),type_graphql_1=require('type-graphql'),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require('@things-factory/menu-base'),tool_permission_1=require(a0_0x2f94fb(0x1e1)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x2f94fb(0x185)),{plural:plural}=require(a0_0x2f94fb(0x1e6)),crypto_1=tslib_1[a0_0x2f94fb(0x1b6)](require(a0_0x2f94fb(0x1a3)));let OperatoToolCreateMenu=class{async[a0_0x2f94fb(0x1c2)](_0x3e3f96,_0x12323b,_0x58abb8){const _0x1f87af=a0_0x2f94fb,{domain:_0x1cc3d3,user:_0x3eec83,tx:_0x319792}=_0x58abb8[_0x1f87af(0x1a4)];await(0x0,tool_permission_1[_0x1f87af(0x1b9)])('',_0x58abb8);const _0x5cc3fa=await _0x319792['getRepository'](resource_base_1[_0x1f87af(0x1ea)])['findOne']({'where':{'domain':{'id':_0x1cc3d3['id']},'id':_0x3e3f96}}),_0x305406=await _0x319792[_0x1f87af(0x1b7)](resource_base_1[_0x1f87af(0x1e5)])['find']({'where':{'domain':{'id':_0x1cc3d3['id']},'entity':{'id':_0x5cc3fa['id']}}});let {name:_0x5c497c=''}=_0x5cc3fa||{},_0x1ec618=kebabCase(_0x5c497c),_0x123aea=modelTemplate['replace'](/{{pascalCase name}}/g,startCase(camelCase(_0x5c497c))[_0x1f87af(0x1bb)](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x5c497c))[_0x1f87af(0x1bb)](/{{snakeCase name}}/g,snakeCase(_0x5c497c))[_0x1f87af(0x1bb)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x5c497c)))['replace'](/ /g,''))[_0x1f87af(0x1bb)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x5c497c)))[_0x1f87af(0x1bb)](/{{name}}/g,_0x5c497c),_0x149ea0='';_0x1f87af(0x1bd)==_0x5cc3fa['dataProp']?_0x149ea0='\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20':_0x1f87af(0x1a0)==_0x5cc3fa[_0x1f87af(0x1cf)]&&(_0x149ea0=_0x1f87af(0x194)),_0x123aea=_0x123aea['replace'](/{{HistoryButton}}/g,_0x149ea0);let _0x314146=this[_0x1f87af(0x1d7)](_0x305406);_0x123aea=_0x123aea[_0x1f87af(0x1bb)](/{{SortColumns}}/g,_0x314146[_0x1f87af(0x18e)](','));let _0x2f9355=this[_0x1f87af(0x1b4)](_0x305406);_0x123aea=_0x123aea['replace'](/{{SearchColumns}}/g,_0x2f9355[_0x1f87af(0x18e)](','));let _0x5a3e74=this[_0x1f87af(0x1c0)](_0x305406);return _0x123aea=_0x123aea[_0x1f87af(0x1bb)](/{{GridColumns}}/g,_0x5a3e74[_0x1f87af(0x18e)](',')),_0x123aea=this['enc'](_0x123aea),await this['createMenuData'](_0x319792,_0x1cc3d3,_0x3eec83,_0x12323b,_0x1ec618,_0x123aea),!0x0;}[a0_0x2f94fb(0x1c0)](_0x4cdee5){const _0x43c5c1=a0_0x2f94fb;return _0x4cdee5['filter'](_0x3220cc=>'id'!=_0x3220cc[_0x43c5c1(0x1ce)]&&_0x3220cc[_0x43c5c1(0x1ee)]>0x0)[_0x43c5c1(0x1a8)](function(_0x325ba7,_0x37b55d){const _0x1edc9e=_0x43c5c1;return _0x325ba7['gridRank']-_0x37b55d[_0x1edc9e(0x1ee)];})['map'](_0x2b78e9=>{const _0x5376c0=_0x43c5c1;let {gridEditor:_0x1ee7f0=_0x5376c0(0x1ac),name:_0x159810,term:_0x2d3437,gridWidth:_0x5b6b1d=0x0,gridAlign:_0x561e4d=_0x5376c0(0x1c1),nullable:_0x230880=!0x1}=_0x2b78e9;if(null==_0x1ee7f0&&(_0x1ee7f0=_0x5376c0(0x1ac)),null==_0x561e4d&&(_0x561e4d=_0x5376c0(0x1c1)),'updater_id'==_0x159810||'creator_id'==_0x159810)return _0x159810='updater_id'==_0x159810?'updater':_0x5376c0(0x19f),_0x5376c0(0x18c)+_0x159810+'\x22,\x22header\x22:\x20\x22'+_0x159810+_0x5376c0(0x195);if(_0x5376c0(0x181)==_0x159810||_0x5376c0(0x188)==_0x159810)return _0x5376c0(0x1df)+(_0x5376c0(0x181)==_0x159810?_0x5376c0(0x1af):_0x5376c0(0x1ec))+'\x22,\x22header\x22:\x20\x22'+_0x159810+'\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}';let _0x2fb581=_0x5376c0(0x191)!=_0x1ee7f0&&_0x5376c0(0x1d0)!=_0x1ee7f0,_0xf9bd30=_0x5376c0(0x1d0)==_0x1ee7f0;0x1!=_0xf9bd30&&0x0!=_0x2fb581||(_0x1ee7f0=_0x5376c0(0x1ac));let _0x2f138e=_0x5376c0(0x18b)+_0x1ee7f0+'\x22,\x22name\x22:\x20\x22'+camelCase(_0x159810)+'\x22,\x22header\x22:\x20\x22'+_0x2d3437+_0x5376c0(0x1e0)+_0xf9bd30+_0x5376c0(0x19a)+_0x2fb581+_0x5376c0(0x1d2)+!_0x230880+_0x5376c0(0x1de)+_0x561e4d+_0x5376c0(0x1e4)+_0x5b6b1d+_0x5376c0(0x1ed);return _0x5376c0(0x19d)==_0x2b78e9[_0x5376c0(0x1b2)]&&(_0x2f138e+=_0x5376c0(0x1e7)+_0x2b78e9[_0x5376c0(0x1d8)]+'\x22}'),_0x5376c0(0x199)==_0x2b78e9[_0x5376c0(0x1b2)]&&(_0x2f138e+=',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22'+_0x2b78e9[_0x5376c0(0x1d8)]+'\x22}'),'entity'==_0x2b78e9[_0x5376c0(0x1b2)]&&(_0x2f138e+=',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22'+camelCase(plural(_0x2b78e9[_0x5376c0(0x1d8)]))+_0x5376c0(0x1b8)),_0x2f138e+='}',_0x2f138e;});}[a0_0x2f94fb(0x1b4)](_0x15c872){const _0x5b3876=a0_0x2f94fb;return _0x15c872['filter'](_0x2a97e2=>_0x2a97e2['searchRank']>0x0)[_0x5b3876(0x1a8)](function(_0x42ebb4,_0x19159c){const _0x279f21=_0x5b3876;return _0x42ebb4[_0x279f21(0x18a)]-_0x19159c[_0x279f21(0x18a)];})['map'](_0x496362=>{const _0x4c4814=_0x5b3876;let _0x56347b=_0x496362[_0x4c4814(0x1c7)];return'filter'==_0x56347b?'\x22'+camelCase(_0x496362[_0x4c4814(0x1ce)])+'\x22':(_0x56347b||(_0x56347b='eq'),_0x4c4814(0x1dc)+camelCase(_0x496362[_0x4c4814(0x1ce)])+_0x4c4814(0x1eb)+_0x56347b+'\x22}');});}[a0_0x2f94fb(0x1d7)](_0x48de48){const _0x13fdee=a0_0x2f94fb;return _0x48de48['filter'](_0x5acad2=>_0x5acad2[_0x13fdee(0x1f0)]>0x0)[_0x13fdee(0x1a8)](function(_0x57bb90,_0x17d5db){const _0x533e97=_0x13fdee;return _0x57bb90[_0x533e97(0x1f0)]-_0x17d5db[_0x533e97(0x1f0)];})[_0x13fdee(0x1ab)](_0x244f39=>'{\x22name\x22:\x22'+camelCase(_0x244f39[_0x13fdee(0x1ce)])+_0x13fdee(0x1d3)+_0x244f39[_0x13fdee(0x1c5)]+'}');}async['createMenuData'](_0x26ede1,_0x337463,_0x387cd5,_0x228320,_0x2f9f98,_0x36258d){const _0x27fc4b=a0_0x2f94fb;let _0x1acc5a=await _0x26ede1[_0x27fc4b(0x1b7)](menu_base_1[_0x27fc4b(0x182)])[_0x27fc4b(0x1a6)]({'where':{'domain':{'id':_0x337463['id']},'id':_0x228320}}),_0x3d7f49=(await _0x26ede1[_0x27fc4b(0x1b7)](menu_base_1[_0x27fc4b(0x182)])['query'](_0x27fc4b(0x1b1)+_0x228320+_0x27fc4b(0x197)+_0x228320+'\x27'))[0x0][_0x27fc4b(0x187)]+0xa,_0x2a03f0=new menu_base_1['Menu']();_0x2a03f0[_0x27fc4b(0x1ce)]=_0x2f9f98,_0x2a03f0[_0x27fc4b(0x189)]=_0x27fc4b(0x1ba),_0x2a03f0[_0x27fc4b(0x1e3)]=_0x27fc4b(0x1a2),_0x2a03f0[_0x27fc4b(0x187)]=_0x3d7f49,_0x2a03f0['hiddenFlag']=!0x1,_0x2a03f0[_0x27fc4b(0x196)]=_0x2f9f98,_0x2a03f0[_0x27fc4b(0x1d6)]=_0x36258d,_0x2a03f0['resourceUrl']=_0x27fc4b(0x1e9),_0x2a03f0[_0x27fc4b(0x1e8)]=_0x1acc5a,await _0x26ede1[_0x27fc4b(0x1b7)](menu_base_1['Menu'])['save'](Object[_0x27fc4b(0x1f4)](Object[_0x27fc4b(0x1f4)]({},_0x2a03f0),{'domain':_0x337463,'creator':_0x387cd5,'updater':_0x387cd5}));}[a0_0x2f94fb(0x1da)](_0x13dbd3){const _0x41ff8e=a0_0x2f94fb;let _0x146861=JSON[_0x41ff8e(0x1c3)](_0x13dbd3)['split'](/(.{100})/)['filter'](_0x537e12=>_0x537e12),_0x1b1d14=[_0x41ff8e(0x1cd),_0x41ff8e(0x19c),_0x41ff8e(0x18f),_0x41ff8e(0x1f1),_0x41ff8e(0x1c6),_0x41ff8e(0x18d),_0x41ff8e(0x1cb),_0x41ff8e(0x1d9)],_0x3d433c=crypto_1[_0x41ff8e(0x1c9)]['randomBytes'](0x20)[_0x41ff8e(0x1f3)](_0x41ff8e(0x184)),_0x502c35=Buffer[_0x41ff8e(0x19e)](_0x3d433c,_0x41ff8e(0x184)),_0xa0a9a1=_0x3d433c[_0x41ff8e(0x1cc)](0x0,0x10),_0x1c14ae=['',_0xa0a9a1,_0xa0a9a1,_0xa0a9a1,_0xa0a9a1,_0xa0a9a1,_0xa0a9a1,_0xa0a9a1],_0x11b048=0x0,_0x5d6c45=[];_0x5d6c45[_0x41ff8e(0x1b5)](_0x3d433c);for(var _0x2528ec=0x0;_0x2528ec<_0x146861[_0x41ff8e(0x1d4)];_0x2528ec++,_0x11b048++){_0x11b048==_0x1b1d14[_0x41ff8e(0x1d4)]&&(_0x11b048=0x0);let _0x24d0b0=crypto_1['default'][_0x41ff8e(0x1d1)](_0x1b1d14[_0x11b048],_0x502c35,_0x1c14ae[_0x11b048]),_0x48c604=_0x24d0b0[_0x41ff8e(0x1dd)](_0x146861[_0x2528ec],_0x41ff8e(0x186),_0x41ff8e(0x184));_0x48c604+=_0x24d0b0[_0x41ff8e(0x1e2)](_0x41ff8e(0x184)),_0x5d6c45['push'](_0x48c604);}return _0x5d6c45[_0x41ff8e(0x18e)](_0x41ff8e(0x1c8));}};function a0_0x3336(){const _0x3eee4b=['utf8','rank','created_at','menuType','searchRank','{\x22type\x22:\x20\x22','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','aes-256-ofb','join','aes-256-cfb','3866094oHhkjp','readonly','Mutation','__param','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','routing','\x27\x20or\x20id\x20=\x20\x27','Operato\x20Tool\x20Create\x20Menu','scenario','\x20,\x22editable\x22:\x20','20516zKmhxD','aes-256-cbc','code','from','creator','COPY','__esModule','meta-grist-page','crypto','state','__decorate','findOne','OperatoToolCreateMenu','sort','2224191FINcpu','\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','map','string','design:type','parent_menu_id','updatedAt','tslib','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','refType','Directive','createSearchCols','push','__importDefault','getRepository','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','checkStudioTemplateIsOverLimit','SCREEN','replace','Arg','JSON','45wogXjK','defineProperty','createGridColumns','left','toolCreateMenu','stringify','3350480CSCgei','reverseSort','aes-256-cfb1','searchOper','h1z0q9i9x7q6','default','design:paramtypes','aes-256-ctr','substring','aes-256-ecb','name','dataProp','hidden','createCipheriv',',\x22mandatory\x22:\x20','\x22,\x22desc\x22:','length','design:returntype','template','createSortCols','refName','aes256','enc','@transaction','{\x22name\x22:\x20\x22','update',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','\x22,\x22hidden\x22:','./../tool-secret/tool-permission','final','category','\x22,\x22width\x22:','EntityColumn','pluralize',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','parent','@things-factory/meta-ui/client/pages/meta-grist-page','Entity','\x22,\x22operator\x22:\x20\x22','createdAt','\x20,\x22exportable\x22:\x20true','gridRank','11384000SZTZEJ','sortRank','aes-256-cfb8','103582wiytGD','toString','assign','prototype','379212QoNkdl','updated_at','Menu','__metadata','hex','lodash'];a0_0x3336=function(){return _0x3eee4b;};return a0_0x3336();}tslib_1[a0_0x2f94fb(0x1a5)]([(0x0,type_graphql_1[a0_0x2f94fb(0x1b3)])(a0_0x2f94fb(0x1db)),(0x0,type_graphql_1[a0_0x2f94fb(0x192)])(_0x1ad6c9=>Boolean,{'description':a0_0x2f94fb(0x198)}),tslib_1[a0_0x2f94fb(0x193)](0x0,(0x0,type_graphql_1[a0_0x2f94fb(0x1bc)])('id')),tslib_1[a0_0x2f94fb(0x193)](0x1,(0x0,type_graphql_1['Arg'])(a0_0x2f94fb(0x1ae))),tslib_1[a0_0x2f94fb(0x193)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x2f94fb(0x183)](a0_0x2f94fb(0x1ad),Function),tslib_1['__metadata'](a0_0x2f94fb(0x1ca),[String,String,Object]),tslib_1[a0_0x2f94fb(0x183)](a0_0x2f94fb(0x1d5),Promise)],OperatoToolCreateMenu[a0_0x2f94fb(0x17f)],'toolCreateMenu',null),OperatoToolCreateMenu=tslib_1[a0_0x2f94fb(0x1a5)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateMenu),exports[a0_0x2f94fb(0x1a7)]=OperatoToolCreateMenu;const modelTemplate=a0_0x2f94fb(0x1aa);
1
+ 'use strict';const a0_0x545eda=a0_0x7d25;(function(_0x49ce67,_0x4cdf98){const _0x11773b=a0_0x7d25,_0x425097=_0x49ce67();while(!![]){try{const _0x4293bb=parseInt(_0x11773b(0x108))/0x1*(parseInt(_0x11773b(0x15c))/0x2)+parseInt(_0x11773b(0x179))/0x3+parseInt(_0x11773b(0x169))/0x4*(-parseInt(_0x11773b(0x165))/0x5)+parseInt(_0x11773b(0x153))/0x6*(parseInt(_0x11773b(0x17e))/0x7)+parseInt(_0x11773b(0x154))/0x8*(-parseInt(_0x11773b(0x13d))/0x9)+-parseInt(_0x11773b(0x129))/0xa*(parseInt(_0x11773b(0x170))/0xb)+-parseInt(_0x11773b(0x114))/0xc*(-parseInt(_0x11773b(0x180))/0xd);if(_0x4293bb===_0x4cdf98)break;else _0x425097['push'](_0x425097['shift']());}catch(_0x26b7fc){_0x425097['push'](_0x425097['shift']());}}}(a0_0x33e6,0xcf37e));Object[a0_0x545eda(0x11c)](exports,'__esModule',{'value':!0x0}),exports[a0_0x545eda(0x141)]=void 0x0;const tslib_1=require(a0_0x545eda(0x121)),type_graphql_1=require(a0_0x545eda(0x15e)),resource_base_1=require(a0_0x545eda(0x135)),menu_base_1=require(a0_0x545eda(0x13f)),tool_permission_1=require(a0_0x545eda(0x12e)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x545eda(0x13a)),{plural:plural}=require(a0_0x545eda(0x11b)),crypto_1=tslib_1['__importDefault'](require('crypto'));let OperatoToolCreateMenu=class{async[a0_0x545eda(0x155)](_0x4fb21e,_0x111090,_0xcedfc7){const _0x786f48=a0_0x545eda,{domain:_0x450e8b,user:_0x5cd67e,tx:_0x5495b2}=_0xcedfc7[_0x786f48(0x167)];await(0x0,tool_permission_1[_0x786f48(0x173)])('',_0xcedfc7);const _0x5d5b0b=await _0x5495b2[_0x786f48(0x13c)](resource_base_1[_0x786f48(0x12b)])[_0x786f48(0x13b)]({'where':{'domain':{'id':_0x450e8b['id']},'id':_0x4fb21e}}),_0x103f44=await _0x5495b2[_0x786f48(0x13c)](resource_base_1[_0x786f48(0x116)])[_0x786f48(0x12c)]({'where':{'domain':{'id':_0x450e8b['id']},'entity':{'id':_0x5d5b0b['id']}}});let {name:_0xb51a23=''}=_0x5d5b0b||{},_0x2033e8=kebabCase(_0xb51a23),_0x1b6cbb=modelTemplate['replace'](/{{pascalCase name}}/g,startCase(camelCase(_0xb51a23))[_0x786f48(0x164)](/ /g,''))[_0x786f48(0x164)](/{{camelCase name}}/g,camelCase(_0xb51a23))[_0x786f48(0x164)](/{{snakeCase name}}/g,snakeCase(_0xb51a23))['replace'](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0xb51a23)))[_0x786f48(0x164)](/ /g,''))[_0x786f48(0x164)](/{{pluralCamelCase name}}/g,camelCase(plural(_0xb51a23)))['replace'](/{{name}}/g,_0xb51a23),_0x43e8d1='';_0x786f48(0x163)==_0x5d5b0b[_0x786f48(0x123)]?_0x43e8d1=_0x786f48(0x119):'COPY'==_0x5d5b0b[_0x786f48(0x123)]&&(_0x43e8d1=_0x786f48(0x161)),_0x1b6cbb=_0x1b6cbb[_0x786f48(0x164)](/{{HistoryButton}}/g,_0x43e8d1);let _0x5ce0e4=this[_0x786f48(0x177)](_0x103f44);_0x1b6cbb=_0x1b6cbb[_0x786f48(0x164)](/{{SortColumns}}/g,_0x5ce0e4[_0x786f48(0x103)](','));let _0x2ec14d=this[_0x786f48(0x17f)](_0x103f44);_0x1b6cbb=_0x1b6cbb['replace'](/{{SearchColumns}}/g,_0x2ec14d['join'](','));let _0x20bb4b=this[_0x786f48(0x120)](_0x103f44);return _0x1b6cbb=_0x1b6cbb['replace'](/{{GridColumns}}/g,_0x20bb4b[_0x786f48(0x103)](',')),_0x1b6cbb=this[_0x786f48(0x175)](_0x1b6cbb),await this['createMenuData'](_0x5495b2,_0x450e8b,_0x5cd67e,_0x111090,_0x2033e8,_0x1b6cbb),!0x0;}[a0_0x545eda(0x120)](_0x485e30){const _0x48db71=a0_0x545eda;return _0x485e30['filter'](_0x1bd321=>'id'!=_0x1bd321['name']&&_0x1bd321[_0x48db71(0x118)]>0x0)[_0x48db71(0x160)](function(_0x461434,_0x4a30d2){const _0x4a8d88=_0x48db71;return _0x461434[_0x4a8d88(0x118)]-_0x4a30d2[_0x4a8d88(0x118)];})[_0x48db71(0x112)](_0xd3e5ce=>{const _0x238c8b=_0x48db71;let {gridEditor:_0x3272a2=_0x238c8b(0x15a),name:_0x47e883,term:_0x3c5f82,gridWidth:_0x7004ef=0x0,gridAlign:_0x471dfa=_0x238c8b(0x16e),nullable:_0x2fc274=!0x1}=_0xd3e5ce;if(null==_0x3272a2&&(_0x3272a2='string'),null==_0x471dfa&&(_0x471dfa='left'),_0x238c8b(0x10d)==_0x47e883||_0x238c8b(0x140)==_0x47e883)return _0x47e883=_0x238c8b(0x10d)==_0x47e883?_0x238c8b(0x178):_0x238c8b(0x15b),'{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22'+_0x47e883+_0x238c8b(0x168)+_0x47e883+_0x238c8b(0x138);if(_0x238c8b(0x107)==_0x47e883||_0x238c8b(0x176)==_0x47e883)return'{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22'+(_0x238c8b(0x107)==_0x47e883?_0x238c8b(0x17b):_0x238c8b(0x128))+_0x238c8b(0x168)+_0x47e883+'\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}';let _0x41264e=_0x238c8b(0x183)!=_0x3272a2&&_0x238c8b(0x132)!=_0x3272a2,_0x3e93f6=_0x238c8b(0x132)==_0x3272a2;0x1!=_0x3e93f6&&0x0!=_0x41264e||(_0x3272a2='string');let _0x2dda3a=_0x238c8b(0x10e)+_0x3272a2+_0x238c8b(0x11d)+camelCase(_0x47e883)+_0x238c8b(0x168)+_0x3c5f82+'\x22,\x22hidden\x22:'+_0x3e93f6+_0x238c8b(0x158)+_0x41264e+_0x238c8b(0x171)+!_0x2fc274+_0x238c8b(0x144)+_0x471dfa+_0x238c8b(0x150)+_0x7004ef+_0x238c8b(0x12f);return _0x238c8b(0x126)==_0xd3e5ce[_0x238c8b(0x16f)]&&(_0x2dda3a+=_0x238c8b(0x133)+_0xd3e5ce[_0x238c8b(0x162)]+'\x22}'),'scenario'==_0xd3e5ce[_0x238c8b(0x16f)]&&(_0x2dda3a+=_0x238c8b(0x125)+_0xd3e5ce[_0x238c8b(0x162)]+'\x22}'),_0x238c8b(0x151)==_0xd3e5ce[_0x238c8b(0x16f)]&&(_0x2dda3a+=',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22'+camelCase(plural(_0xd3e5ce['refName']))+'\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}'),_0x2dda3a+='}',_0x2dda3a;});}['createSearchCols'](_0x48f08c){const _0x43c4b6=a0_0x545eda;return _0x48f08c['filter'](_0x1c4d77=>_0x1c4d77[_0x43c4b6(0x145)]>0x0)['sort'](function(_0x351c56,_0x4f89bf){const _0xb889d4=_0x43c4b6;return _0x351c56[_0xb889d4(0x145)]-_0x4f89bf['searchRank'];})[_0x43c4b6(0x112)](_0x50299c=>{const _0x3d5b21=_0x43c4b6;let _0x1d7f97=_0x50299c[_0x3d5b21(0x157)];return _0x3d5b21(0x152)==_0x1d7f97?'\x22'+camelCase(_0x50299c[_0x3d5b21(0x166)])+'\x22':(_0x1d7f97||(_0x1d7f97='eq'),_0x3d5b21(0x10f)+camelCase(_0x50299c[_0x3d5b21(0x166)])+_0x3d5b21(0x17a)+_0x1d7f97+'\x22}');});}['createSortCols'](_0x3b7c1b){const _0x143a44=a0_0x545eda;return _0x3b7c1b[_0x143a44(0x152)](_0x197977=>_0x197977['sortRank']>0x0)[_0x143a44(0x160)](function(_0x45a8f6,_0x4f66ed){const _0x6660d1=_0x143a44;return _0x45a8f6[_0x6660d1(0x134)]-_0x4f66ed[_0x6660d1(0x134)];})['map'](_0x4ec6fa=>_0x143a44(0x111)+camelCase(_0x4ec6fa['name'])+_0x143a44(0x146)+_0x4ec6fa[_0x143a44(0x147)]+'}');}async[a0_0x545eda(0x17d)](_0x392573,_0x914f00,_0x57a583,_0x25bf39,_0x793cbc,_0x51b69b){const _0x19dcfe=a0_0x545eda;let _0xe63832=await _0x392573['getRepository'](menu_base_1[_0x19dcfe(0x17c)])[_0x19dcfe(0x13b)]({'where':{'domain':{'id':_0x914f00['id']},'id':_0x25bf39}}),_0x2ebed7=(await _0x392573['getRepository'](menu_base_1[_0x19dcfe(0x17c)])[_0x19dcfe(0x113)](_0x19dcfe(0x16d)+_0x25bf39+_0x19dcfe(0x12d)+_0x25bf39+'\x27'))[0x0][_0x19dcfe(0x124)]+0xa,_0x45b17d=new menu_base_1[(_0x19dcfe(0x17c))]();_0x45b17d['name']=_0x793cbc,_0x45b17d['menuType']='SCREEN',_0x45b17d[_0x19dcfe(0x174)]=_0x19dcfe(0x11f),_0x45b17d[_0x19dcfe(0x124)]=_0x2ebed7,_0x45b17d['hiddenFlag']=!0x1,_0x45b17d[_0x19dcfe(0x14e)]=_0x793cbc,_0x45b17d[_0x19dcfe(0x149)]=_0x51b69b,_0x45b17d[_0x19dcfe(0x16c)]=_0x19dcfe(0x131),_0x45b17d[_0x19dcfe(0x139)]=_0xe63832,await _0x392573[_0x19dcfe(0x13c)](menu_base_1[_0x19dcfe(0x17c)])[_0x19dcfe(0x13e)](Object['assign'](Object[_0x19dcfe(0x143)]({},_0x45b17d),{'domain':_0x914f00,'creator':_0x57a583,'updater':_0x57a583}));}[a0_0x545eda(0x175)](_0x4a7e6b){const _0x39e04a=a0_0x545eda;let _0x5a4df0=JSON[_0x39e04a(0x117)](_0x4a7e6b)[_0x39e04a(0x185)](/(.{100})/)[_0x39e04a(0x152)](_0x1dd3f6=>_0x1dd3f6),_0x3de9a2=[_0x39e04a(0x122),'aes-256-cbc',_0x39e04a(0x130),_0x39e04a(0x182),_0x39e04a(0x14d),_0x39e04a(0x172),_0x39e04a(0x11a),'aes256'],_0x2964d2=crypto_1['default'][_0x39e04a(0x16a)](0x20)[_0x39e04a(0x127)]('hex'),_0x22e722=Buffer[_0x39e04a(0x104)](_0x2964d2,_0x39e04a(0x15d)),_0x4d79c7=_0x2964d2['substring'](0x0,0x10),_0x1fc169=['',_0x4d79c7,_0x4d79c7,_0x4d79c7,_0x4d79c7,_0x4d79c7,_0x4d79c7,_0x4d79c7],_0x142f61=0x0,_0x3e061a=[];_0x3e061a[_0x39e04a(0x142)](_0x2964d2);for(var _0x3282a1=0x0;_0x3282a1<_0x5a4df0[_0x39e04a(0x10c)];_0x3282a1++,_0x142f61++){_0x142f61==_0x3de9a2[_0x39e04a(0x10c)]&&(_0x142f61=0x0);let _0x383029=crypto_1[_0x39e04a(0x136)][_0x39e04a(0x115)](_0x3de9a2[_0x142f61],_0x22e722,_0x1fc169[_0x142f61]),_0x52772a=_0x383029[_0x39e04a(0x12a)](_0x5a4df0[_0x3282a1],_0x39e04a(0x14c),_0x39e04a(0x15d));_0x52772a+=_0x383029[_0x39e04a(0x15f)](_0x39e04a(0x15d)),_0x3e061a[_0x39e04a(0x142)](_0x52772a);}return _0x3e061a[_0x39e04a(0x103)](_0x39e04a(0x105));}};function a0_0x33e6(){const _0x28bd9a=['state','\x22,\x22header\x22:\x20\x22','3368ypiQaU','randomBytes','__decorate','resourceUrl','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','left','refType','335995VswiSC',',\x22mandatory\x22:\x20','aes-256-ofb','checkStudioTemplateIsOverLimit','category','enc','created_at','createSortCols','updater','669675WlPzAZ','\x22,\x22operator\x22:\x20\x22','updatedAt','Menu','createMenuData','21MyfPPw','createSearchCols','1317758SBqqlk','@transaction','aes-256-cfb8','readonly','parent_menu_id','split','join','from','h1z0q9i9x7q6','design:paramtypes','updated_at','828903rACmaY','Resolver','__param','design:type','length','updater_id','{\x22type\x22:\x20\x22','{\x22name\x22:\x20\x22','Ctx','{\x22name\x22:\x22','map','query','84kgtJQM','createCipheriv','EntityColumn','stringify','gridRank','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','aes-256-ctr','pluralize','defineProperty','\x22,\x22name\x22:\x20\x22','Arg','meta-grist-page','createGridColumns','tslib','aes-256-ecb','dataProp','rank',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','code','toString','createdAt','60YncCNH','update','Entity','find','\x27\x20or\x20id\x20=\x20\x27','./../tool-secret/tool-permission','\x20,\x22exportable\x22:\x20true','aes-256-cfb','@things-factory/meta-ui/client/pages/meta-grist-page','hidden',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','sortRank','@things-factory/resource-base','default','__metadata','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','parent','lodash','findOne','getRepository','9ICAbXk','save','@things-factory/menu-base','creator_id','OperatoToolCreateMenu','push','assign',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','searchRank','\x22,\x22desc\x22:','reverseSort','\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','template','prototype','Directive','utf8','aes-256-cfb1','routing','Operato\x20Tool\x20Create\x20Menu','\x22,\x22width\x22:','entity','filter','780906EnQcMW','5003088QdsBYC','toolCreateMenu','Mutation','searchOper','\x20,\x22editable\x22:\x20','design:returntype','string','creator','4fDOHwW','hex','type-graphql','final','sort','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','refName','JSON','replace','7860bBqqpq','name'];a0_0x33e6=function(){return _0x28bd9a;};return a0_0x33e6();}tslib_1[a0_0x545eda(0x16b)]([(0x0,type_graphql_1[a0_0x545eda(0x14b)])(a0_0x545eda(0x181)),(0x0,type_graphql_1[a0_0x545eda(0x156)])(_0x144c97=>Boolean,{'description':a0_0x545eda(0x14f)}),tslib_1[a0_0x545eda(0x10a)](0x0,(0x0,type_graphql_1[a0_0x545eda(0x11e)])('id')),tslib_1[a0_0x545eda(0x10a)](0x1,(0x0,type_graphql_1['Arg'])(a0_0x545eda(0x184))),tslib_1['__param'](0x2,(0x0,type_graphql_1[a0_0x545eda(0x110)])()),tslib_1[a0_0x545eda(0x137)](a0_0x545eda(0x10b),Function),tslib_1[a0_0x545eda(0x137)](a0_0x545eda(0x106),[String,String,Object]),tslib_1['__metadata'](a0_0x545eda(0x159),Promise)],OperatoToolCreateMenu[a0_0x545eda(0x14a)],a0_0x545eda(0x155),null),OperatoToolCreateMenu=tslib_1[a0_0x545eda(0x16b)]([(0x0,type_graphql_1[a0_0x545eda(0x109)])()],OperatoToolCreateMenu),exports[a0_0x545eda(0x141)]=OperatoToolCreateMenu;function a0_0x7d25(_0x1df4d1,_0xc664f1){const _0x33e61c=a0_0x33e6();return a0_0x7d25=function(_0x7d250,_0x53d322){_0x7d250=_0x7d250-0x103;let _0x184006=_0x33e61c[_0x7d250];return _0x184006;},a0_0x7d25(_0x1df4d1,_0xc664f1);}const modelTemplate=a0_0x545eda(0x148);
@@ -1 +1 @@
1
- 'use strict';function a0_0x2c08(){const _0x4bb68e=['Query','long','map','EntitySubscribers\x20}\x20from\x20\x27./','@things-factory/shell','design:returntype','rank','float','-history-query.ts','Resolvers,\x20subscribers\x20as\x20','timestamp\x20without\x20time\x20zone','__param','\x20})','Entity','mkdirSync','getProjectRootPath','26760QjqQXp','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','createHistoryServiceFiles','tableName','createTypeText','camelCaseName','find','JSON','type\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(\x27{{tableName}}\x27)\x0a{{indexAnn}}\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}\x20{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','168cYxGLM','updated_at','\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','date','{{camelCase\x20name}}.','\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','\x0a\x20\x20','.ts','character\x20varying','Entities,\x20resolvers\x20as\x20','columnToEntityColumn','-mutation.ts','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','-type.ts','/*\x20ENTITIES\x20*/\x0a\x09...','colSize','OperatoToolCreateService','packages','replace','updater_id','createServicePath','sort','/packages/','/event-subscriber.ts','500270BPYRNI','58295JsNPBX','split','env','Entities,','createDir','/server/service/','pascalCaseName','@things-factory/resource-base','-history-type.ts','double','export\x20*\x20from\x20\x27./','Resolvers,','Float','includes','...','name','createEntityText','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','Arg',',length:','createServiceFiles','datetime','/server','Ctx','nullable','length','710666cBGVXB','integer','4294197kBYMPS','-query.ts','writeFile','snakeCaseName','getFieldType','push','double\x20precision','state','/packages','@Field(','design:type','existsSync','design:paramtypes','getColTxtType','\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','replaceNamesMap','34685mxLyKa','prototype','readFileSync','tslib','join','getRepository','number','132JkYVRk','__esModule','dataProp','\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','1936cwaoww','creator','indexOf','__metadata','\x27,\x20nullable:\x20','pluralCamelCaseName','index.ts','pluralize','COPY','150321sMRGxF','createHistoryEntityText','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','Date','EntitySubscribers,','16llCUxD','\x20{\x20nullable:\x20','utf8','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a\x20\x20@Column(\x27simple-json\x27,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20@Field(type\x20=>\x20ScalarObject,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20historyJson?:\x20any\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','Int','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','domain_id','existsPath','writeFileSync','created_at','__decorate','import\x20{\x20entities\x20as\x20','Resolvers\x20}\x20from\x20\x27./','createNoHistoryServiceFiels','uniqRank','creator_id','-history\x27','Operato\x20Tool\x20Create\x20Service','colType'];a0_0x2c08=function(){return _0x4bb68e;};return a0_0x2c08();}const a0_0x28ceca=a0_0x2557;(function(_0x52ad00,_0x4980e2){const _0x209cef=a0_0x2557,_0x353d2a=_0x52ad00();while(!![]){try{const _0xa731a6=-parseInt(_0x209cef(0x10f))/0x1+-parseInt(_0x209cef(0x9e))/0x2+parseInt(_0x209cef(0xc4))/0x3*(-parseInt(_0x209cef(0xca))/0x4)+-parseInt(_0x209cef(0x110))/0x5*(-parseInt(_0x209cef(0xb7))/0x6)+parseInt(_0x209cef(0xb0))/0x7*(parseInt(_0x209cef(0xf7))/0x8)+parseInt(_0x209cef(0xa0))/0x9+-parseInt(_0x209cef(0xed))/0xa*(-parseInt(_0x209cef(0xbb))/0xb);if(_0xa731a6===_0x4980e2)break;else _0x353d2a['push'](_0x353d2a['shift']());}catch(_0x288f48){_0x353d2a['push'](_0x353d2a['shift']());}}}(a0_0x2c08,0x3dad7));Object['defineProperty'](exports,a0_0x28ceca(0xb8),{'value':!0x0}),exports[a0_0x28ceca(0x107)]=void 0x0;const tslib_1=require(a0_0x28ceca(0xb3)),type_graphql_1=require('type-graphql'),shell_1=require(a0_0x28ceca(0xe1)),resource_base_1=require(a0_0x28ceca(0x117)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require(a0_0x28ceca(0xc2)),fs=require('fs');let OperatoToolCreateService=class{async['toolCreateService'](_0x1d88b0,_0x2861bc){const _0x867d1=a0_0x28ceca,{domain:_0x21939f}=_0x2861bc[_0x867d1(0xa7)],_0x384dc6=await(0x0,shell_1['getRepository'])(resource_base_1[_0x867d1(0xea)])['findOne']({'where':{'id':_0x1d88b0}}),_0x5ec88c=await(0x0,shell_1[_0x867d1(0xb5)])(resource_base_1['EntityColumn'])[_0x867d1(0xf3)]({'where':{'domain':{'id':_0x21939f['id']},'entity':{'id':_0x384dc6['id']}}});let {name:_0x33f2fb='',bundle:_0x384613=''}=_0x384dc6||{},_0x140d34=this[_0x867d1(0xec)](),_0x3b9175=kebabCase(_0x33f2fb);return await this[_0x867d1(0x10b)](_0x140d34,_0x384613,_0x3b9175),await this['createServiceFiles'](_0x140d34,_0x384613,_0x33f2fb,_0x3b9175,_0x384dc6,_0x5ec88c),!0x0;}async[a0_0x28ceca(0x98)](_0x1260fa,_0x8d229c,_0x8e3183,_0x5e44fb,_0x16f7a0,_0x5673b1){const _0x556733=a0_0x28ceca;let _0x8cd66e={'name':_0x5e44fb,'tableName':_0x16f7a0['tableName'],'pascalCaseName':startCase(camelCase(_0x8e3183))[_0x556733(0x109)](/ /g,''),'camelCaseName':camelCase(_0x8e3183),'snakeCaseName':snakeCase(_0x8e3183),'pluralPascalCaseName':startCase(camelCase(plural(_0x8e3183)))[_0x556733(0x109)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x8e3183))},_0xf59748=_0x1260fa+_0x556733(0x10d)+_0x8d229c+_0x556733(0x115);[_0x556733(0xf4),_0x556733(0xc3)][_0x556733(0x11d)](_0x16f7a0['dataProp'])?await this['createHistoryServiceFiles'](_0xf59748,_0x5e44fb,_0x16f7a0,_0x5673b1,_0x8cd66e):await this[_0x556733(0xd7)](_0xf59748,_0x5e44fb,_0x16f7a0,_0x5673b1,_0x8cd66e);}async[a0_0x28ceca(0xef)](_0x206d53,_0x214363,_0x599e51,_0x58d751,_0x2987b8){const _0x61d842=a0_0x28ceca;await this[_0x61d842(0xa2)](_0x206d53+(_0x214363+'/index.ts'),serviceHistoryIndex,_0x2987b8);let _0x3a2dea=this[_0x61d842(0x120)](_0x599e51,_0x58d751);await this[_0x61d842(0xa2)](_0x206d53+(_0x214363+'/'+_0x214363+_0x61d842(0xfe)),_0x3a2dea,_0x2987b8),await this['writeFile'](_0x206d53+(_0x214363+'/'+_0x214363+_0x61d842(0xa1)),serviceQuery,_0x2987b8),await this['writeFile'](_0x206d53+(_0x214363+'/'+_0x214363+'-mutation.ts'),serviceMutation,_0x2987b8);let _0x5c3408=this[_0x61d842(0xf1)](_0x58d751);await this['writeFile'](_0x206d53+(_0x214363+'/'+_0x214363+_0x61d842(0x104)),_0x5c3408,_0x2987b8);let _0x28e393=this['createHistoryEntityText'](_0x599e51,_0x58d751);await this[_0x61d842(0xa2)](_0x206d53+(_0x214363+'/'+_0x214363+'-history.ts'),_0x28e393,_0x2987b8);let _0x1daff3='';_0x61d842(0xf4)==_0x599e51[_0x61d842(0xb9)]?(_0x1daff3=_0x61d842(0xae),await this[_0x61d842(0xa2)](_0x206d53+(_0x214363+'/event-subscriber.ts'),serviceEntitySubscriber,_0x2987b8)):_0x1daff3='';let _0x2311a5=serviceEntitySubscriber[_0x61d842(0x109)](/{{entityToJson}}/g,_0x1daff3);await this[_0x61d842(0xa2)](_0x206d53+(_0x214363+_0x61d842(0x10e)),_0x2311a5,_0x2987b8),await this[_0x61d842(0xa2)](_0x206d53+(_0x214363+'/'+_0x214363+_0x61d842(0xe5)),serviceHistoryQuery,_0x2987b8),await this['writeFile'](_0x206d53+(_0x214363+'/'+_0x214363+_0x61d842(0x118)),sereviceHistoryType,_0x2987b8);let _0x4b1ef0=_0x206d53+_0x61d842(0xc1);0x0==await this[_0x61d842(0xd1)](_0x4b1ef0)&&await this[_0x61d842(0xa2)](_0x4b1ef0,allIndex,_0x2987b8);let _0x22d43d=await fs[_0x61d842(0xb2)](_0x4b1ef0,'utf8');_0x22d43d[_0x61d842(0xbd)]('export\x20*\x20from\x20\x27./'+_0x2987b8['name']+'/'+_0x2987b8['name']+_0x61d842(0xda))<0x0&&(_0x22d43d=_0x22d43d[_0x61d842(0x109)](/\/\* EXPORT ENTITY TYPES \*\//,_0x61d842(0x121)+_0x2987b8[_0x61d842(0x11f)]+'/'+_0x2987b8[_0x61d842(0x11f)]+'-history\x27')),_0x22d43d['indexOf'](_0x61d842(0x11a)+_0x2987b8[_0x61d842(0x11f)]+'/'+_0x2987b8[_0x61d842(0x11f)]+'\x27')<0x0&&(_0x22d43d=_0x22d43d['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x61d842(0x121)+_0x2987b8[_0x61d842(0x11f)]+'/'+_0x2987b8[_0x61d842(0x11f)]+'\x27')),_0x22d43d[_0x61d842(0xbd)]('import\x20{\x20entities\x20as\x20'+_0x2987b8['pascalCaseName']+_0x61d842(0x100)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0xe6)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0xe0)+_0x2987b8[_0x61d842(0x11f)]+'\x27')<0x0&&(_0x22d43d=_0x22d43d[_0x61d842(0x109)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0x100)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0xe6)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0xe0)+_0x2987b8['name']+'\x27')),_0x22d43d['indexOf'](_0x61d842(0x11e)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0x113))<0x0&&(_0x22d43d=_0x22d43d[_0x61d842(0x109)](/\/\* ENTITIES \*\//,_0x61d842(0x105)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0x113))),_0x22d43d[_0x61d842(0xbd)](_0x61d842(0x11e)+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0x11b))<0x0&&(_0x22d43d=_0x22d43d[_0x61d842(0x109)](/\/\* RESOLVER CLASSES \*\//,_0x61d842(0xc7)+_0x2987b8['pascalCaseName']+_0x61d842(0x11b))),_0x22d43d[_0x61d842(0xbd)]('...'+_0x2987b8['pascalCaseName']+_0x61d842(0xc9))<0x0&&(_0x22d43d=_0x22d43d[_0x61d842(0x109)](/\/\* SUBSCRIBERS \*\//,'/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...'+_0x2987b8[_0x61d842(0x116)]+_0x61d842(0xc9))),await this[_0x61d842(0xa2)](_0x4b1ef0,_0x22d43d,_0x2987b8);}async[a0_0x28ceca(0xd7)](_0x368469,_0x2c4c4e,_0x8d9d78,_0x564cd1,_0x1c7330){const _0x4f79c7=a0_0x28ceca;await this[_0x4f79c7(0xa2)](_0x368469+(_0x2c4c4e+'/index.ts'),serviceIndex,_0x1c7330),await this[_0x4f79c7(0xa2)](_0x368469+(_0x2c4c4e+'/'+_0x2c4c4e+_0x4f79c7(0xa1)),serviceQuery,_0x1c7330),await this['writeFile'](_0x368469+(_0x2c4c4e+'/'+_0x2c4c4e+_0x4f79c7(0x102)),serviceMutation,_0x1c7330);let _0x1cb98b=this[_0x4f79c7(0x120)](_0x8d9d78,_0x564cd1);await this[_0x4f79c7(0xa2)](_0x368469+(_0x2c4c4e+'/'+_0x2c4c4e+_0x4f79c7(0xfe)),_0x1cb98b,_0x1c7330);let _0x533cc1=this[_0x4f79c7(0xf1)](_0x564cd1);await this[_0x4f79c7(0xa2)](_0x368469+(_0x2c4c4e+'/'+_0x2c4c4e+'-type.ts'),_0x533cc1,_0x1c7330);let _0x454a4f=_0x368469+_0x4f79c7(0xc1);0x0==await this['existsPath'](_0x454a4f)&&await this['writeFile'](_0x454a4f,allIndex,_0x1c7330);let _0x3ac2a1=await fs[_0x4f79c7(0xb2)](_0x454a4f,_0x4f79c7(0xcc));_0x3ac2a1[_0x4f79c7(0xbd)](_0x4f79c7(0x11a)+_0x1c7330[_0x4f79c7(0x11f)]+'/'+_0x1c7330[_0x4f79c7(0x11f)]+'\x27')<0x0&&(_0x3ac2a1=_0x3ac2a1[_0x4f79c7(0x109)](/\/\* EXPORT ENTITY TYPES \*\//,_0x4f79c7(0x121)+_0x1c7330[_0x4f79c7(0x11f)]+'/'+_0x1c7330[_0x4f79c7(0x11f)]+'\x27')),_0x3ac2a1[_0x4f79c7(0xbd)](_0x4f79c7(0xd5)+_0x1c7330[_0x4f79c7(0x116)]+_0x4f79c7(0x100)+_0x1c7330[_0x4f79c7(0x116)]+_0x4f79c7(0xd6)+_0x1c7330[_0x4f79c7(0x11f)]+'\x27')<0x0&&(_0x3ac2a1=_0x3ac2a1[_0x4f79c7(0x109)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x4f79c7(0xc6)+_0x1c7330[_0x4f79c7(0x116)]+_0x4f79c7(0x100)+_0x1c7330[_0x4f79c7(0x116)]+_0x4f79c7(0xd6)+_0x1c7330['name']+'\x27')),_0x3ac2a1[_0x4f79c7(0xbd)](_0x4f79c7(0x11e)+_0x1c7330[_0x4f79c7(0x116)]+_0x4f79c7(0x113))<0x0&&(_0x3ac2a1=_0x3ac2a1[_0x4f79c7(0x109)](/\/\* ENTITIES \*\//,_0x4f79c7(0x105)+_0x1c7330[_0x4f79c7(0x116)]+_0x4f79c7(0x113))),_0x3ac2a1[_0x4f79c7(0xbd)](_0x4f79c7(0x11e)+_0x1c7330['pascalCaseName']+_0x4f79c7(0x11b))<0x0&&(_0x3ac2a1=_0x3ac2a1['replace'](/\/\* RESOLVER CLASSES \*\//,_0x4f79c7(0xc7)+_0x1c7330['pascalCaseName']+_0x4f79c7(0x11b))),await this[_0x4f79c7(0xa2)](_0x454a4f,_0x3ac2a1,_0x1c7330);}['createTypeText'](_0x472c28){const _0x2f0bb7=a0_0x28ceca;let _0x280978=sereviceType,_0x4b63cb=_0x472c28[_0x2f0bb7(0xdf)](_0x3e8736=>{const _0x13e3c2=_0x2f0bb7;if('id'==_0x3e8736['name'])return'';if(_0x13e3c2(0xd0)==_0x3e8736[_0x13e3c2(0x11f)])return'';if(_0x13e3c2(0xd3)==_0x3e8736[_0x13e3c2(0x11f)])return'';if(_0x13e3c2(0xf8)==_0x3e8736[_0x13e3c2(0x11f)])return'';if('creator_id'==_0x3e8736['name'])return'';if(_0x13e3c2(0x10a)==_0x3e8736['name'])return'';let _0x3ee742=this[_0x13e3c2(0xa4)](_0x3e8736),_0x49f4f6=this[_0x13e3c2(0xad)](_0x3e8736),_0x4c13e5=camelCase(_0x3e8736[_0x13e3c2(0x11f)]);return'\x20\x20'+(_0x13e3c2(0xa9)+(0x0==_0x3ee742['length']?'':_0x13e3c2(0xf5)+_0x3ee742+',')+_0x13e3c2(0xcb)+_0x3e8736[_0x13e3c2(0x9c)]+_0x13e3c2(0xe9))+'\x0a\x20\x20'+(''+_0x4c13e5+(_0x3e8736[_0x13e3c2(0x9c)]?'?':'')+':\x20'+_0x49f4f6)+'\x0a';});_0x280978=_0x280978[_0x2f0bb7(0x109)](/{{newTypeColumns}}/g,_0x4b63cb[_0x2f0bb7(0xb4)]('\x0a'));let _0x381fc8=_0x472c28[_0x2f0bb7(0xdf)](_0x5a8bb3=>{const _0x228762=_0x2f0bb7;if('id'==_0x5a8bb3[_0x228762(0x11f)])return'';if(_0x228762(0xd0)==_0x5a8bb3[_0x228762(0x11f)])return'';if(_0x228762(0xd3)==_0x5a8bb3[_0x228762(0x11f)])return'';if(_0x228762(0xf8)==_0x5a8bb3[_0x228762(0x11f)])return'';if(_0x228762(0xd9)==_0x5a8bb3[_0x228762(0x11f)])return'';if(_0x228762(0x10a)==_0x5a8bb3[_0x228762(0x11f)])return'';let _0xe6be69=this[_0x228762(0xa4)](_0x5a8bb3),_0x127cc3=this['getColTxtType'](_0x5a8bb3);_0x5a8bb3[_0x228762(0x9c)]=!0x0;let _0x417368=camelCase(_0x5a8bb3[_0x228762(0x11f)]);return'\x20\x20'+(_0x228762(0xa9)+(0x0==_0xe6be69[_0x228762(0x9d)]?'':_0x228762(0xf5)+_0xe6be69+',')+'\x20{\x20nullable:\x20'+_0x5a8bb3['nullable']+_0x228762(0xe9))+_0x228762(0xfd)+(''+_0x417368+(_0x5a8bb3['nullable']?'?':'')+':\x20'+_0x127cc3)+'\x0a';});return _0x280978=_0x280978['replace'](/{{patchTypeColumns}}/g,_0x381fc8[_0x2f0bb7(0xb4)]('\x0a')),_0x280978;}[a0_0x28ceca(0x120)](_0x4630f5,_0x35c2f9){const _0x5f3606=a0_0x28ceca;let _0x3f368f=serviceEntity,_0x59e9f3=_0x35c2f9[_0x5f3606(0x10c)](function(_0x20f3d2,_0x2249ea){const _0x4d9287=_0x5f3606;return _0x20f3d2[_0x4d9287(0xe3)]-_0x2249ea['rank'];})[_0x5f3606(0xdf)](_0x5070d3=>this['columnToEntityColumn'](_0x5070d3));[_0x5f3606(0xc3),_0x5f3606(0xf4)][_0x5f3606(0x11d)](_0x4630f5[_0x5f3606(0xb9)])&&_0x59e9f3[_0x5f3606(0xa5)](_0x5f3606(0xee)),_0x3f368f=_0x3f368f[_0x5f3606(0x109)](/{{entityColumns}}/g,_0x59e9f3[_0x5f3606(0xb4)]('\x0a'));let _0x721d3d='',_0x52694a=_0x35c2f9['filter'](_0x1f27aa=>_0x1f27aa['uniqRank']&&_0x1f27aa[_0x5f3606(0xd8)]>0x0)[_0x5f3606(0x10c)](function(_0x3d5c84,_0x35d0e8){const _0x430128=_0x5f3606;return _0x3d5c84[_0x430128(0xd8)]-_0x35d0e8['uniqRank'];});if(_0x52694a['length']>0x0){_0x721d3d=_0x5f3606(0xcf);let _0x9cb733=_0x52694a[_0x5f3606(0xdf)](_0x206f6c=>{const _0xf2f87b=_0x5f3606;let _0x569732=_0x206f6c[_0xf2f87b(0x11f)];return _0xf2f87b(0xd0)==_0x206f6c[_0xf2f87b(0x11f)]&&(_0x569732='domain'),'creator_id'==_0x206f6c[_0xf2f87b(0x11f)]&&(_0x569732=_0xf2f87b(0xbc)),_0xf2f87b(0x10a)==_0x206f6c[_0xf2f87b(0x11f)]&&(_0x569732='updater'),_0xf2f87b(0xfb)+camelCase(_0x569732);});_0x721d3d=_0x721d3d['replace'](/{{indexColumns}}/g,_0x9cb733[_0x5f3606(0xb4)](','));}return _0x3f368f=_0x3f368f[_0x5f3606(0x109)](/{{indexAnn}}/g,_0x721d3d),_0x3f368f;}[a0_0x28ceca(0xc5)](_0x2995fc,_0xcd6b53){const _0x530922=a0_0x28ceca;let _0x288dc6=_0x530922(0xf4)==_0x2995fc['dataProp']?serviceEntityHistJson:serviceEntityHistCopy,_0x45a500=_0xcd6b53[_0x530922(0x10c)](function(_0x5ba0cf,_0x5220a6){const _0x3d5e31=_0x530922;return _0x5ba0cf[_0x3d5e31(0xe3)]-_0x5220a6[_0x3d5e31(0xe3)];})[_0x530922(0xdf)](_0x54a605=>this[_0x530922(0x101)](_0x54a605));return _0x288dc6=_0x288dc6[_0x530922(0x109)](/{{entityColumns}}/g,_0x45a500[_0x530922(0xb4)]('\x0a')),_0x288dc6;}[a0_0x28ceca(0x101)](_0x3b75b5){const _0x173be9=a0_0x28ceca;if('id'==_0x3b75b5['name'])return'';if(_0x173be9(0xd0)==_0x3b75b5[_0x173be9(0x11f)])return'';if(_0x173be9(0xd3)==_0x3b75b5[_0x173be9(0x11f)])return'';if(_0x173be9(0xf8)==_0x3b75b5['name'])return'';if('creator_id'==_0x3b75b5['name'])return'';if(_0x173be9(0x10a)==_0x3b75b5[_0x173be9(0x11f)])return'';let _0x57876c=_0x3b75b5[_0x173be9(0xdc)];_0x173be9(0x119)==_0x3b75b5[_0x173be9(0xdc)]&&(_0x57876c=_0x173be9(0xa6)),_0x173be9(0xde)==_0x3b75b5[_0x173be9(0xdc)]&&(_0x57876c='bigint'),'string'==_0x3b75b5[_0x173be9(0xdc)]&&(_0x57876c=_0x173be9(0xff)),'datetime'==_0x3b75b5[_0x173be9(0xdc)]&&(_0x57876c=_0x173be9(0xe7));let _0x18d260='';'string'==_0x3b75b5['colType']&&(_0x18d260=_0x3b75b5[_0x173be9(0x106)]);let _0x5796f2=this[_0x173be9(0xa4)](_0x3b75b5),_0x45d31a=this[_0x173be9(0xad)](_0x3b75b5),_0x31e701=camelCase(_0x3b75b5[_0x173be9(0x11f)]);return'\x20\x20'+('@Column({name:\x27'+_0x3b75b5[_0x173be9(0x11f)]+'\x27,\x20type:\x20\x27'+_0x57876c+_0x173be9(0xbf)+_0x3b75b5['nullable']+'\x20'+(0x0==_0x18d260[_0x173be9(0x9d)]?'':_0x173be9(0x123)+_0x18d260)+_0x173be9(0xe9))+'\x0a\x20\x20'+(_0x173be9(0xa9)+(0x0==_0x5796f2[_0x173be9(0x9d)]?'':_0x173be9(0xf5)+_0x5796f2+',')+'\x20{\x20nullable:\x20'+_0x3b75b5['nullable']+'\x20})')+_0x173be9(0xfd)+(''+_0x31e701+(_0x3b75b5[_0x173be9(0x9c)]?'?':'')+':\x20'+_0x45d31a)+'\x0a';}['getFieldType'](_0x4478bf){const _0xffc530=a0_0x28ceca;let _0x413b43='';return _0xffc530(0x119)==_0x4478bf[_0xffc530(0xdc)]&&(_0x413b43='Float'),_0xffc530(0xe4)==_0x4478bf[_0xffc530(0xdc)]&&(_0x413b43=_0xffc530(0x11c)),_0xffc530(0xde)==_0x4478bf[_0xffc530(0xdc)]&&(_0x413b43=_0xffc530(0xce)),_0xffc530(0x9f)==_0x4478bf['colType']&&(_0x413b43=_0xffc530(0xce)),_0x413b43;}[a0_0x28ceca(0xad)](_0x7c1adb){const _0x594b27=a0_0x28ceca;let _0x4f5d71=_0x7c1adb['colType'];return'decimal'==_0x7c1adb[_0x594b27(0xdc)]&&(_0x4f5d71=_0x594b27(0xb6)),_0x594b27(0x119)==_0x7c1adb['colType']&&(_0x4f5d71=_0x594b27(0xb6)),_0x594b27(0xe4)==_0x7c1adb[_0x594b27(0xdc)]&&(_0x4f5d71=_0x594b27(0xb6)),_0x594b27(0x9f)==_0x7c1adb[_0x594b27(0xdc)]&&(_0x4f5d71=_0x594b27(0xb6)),_0x594b27(0xde)==_0x7c1adb['colType']&&(_0x4f5d71=_0x594b27(0xb6)),_0x594b27(0x99)==_0x7c1adb['colType']&&(_0x4f5d71=_0x594b27(0xc8)),_0x594b27(0xfa)==_0x7c1adb[_0x594b27(0xdc)]&&(_0x4f5d71=_0x594b27(0xc8)),'text'==_0x7c1adb[_0x594b27(0xdc)]&&(_0x4f5d71='string'),_0x4f5d71;}async[a0_0x28ceca(0xa2)](_0xa77e58,_0x2bc946,_0x2c0b9d){const _0xb92d0d=a0_0x28ceca;await fs[_0xb92d0d(0xd2)](_0xa77e58,this[_0xb92d0d(0xaf)](_0x2bc946,_0x2c0b9d),_0xb92d0d(0xcc));}['replaceNamesMap'](_0x4be579,_0x16c323){const _0x157c4a=a0_0x28ceca;return _0x4be579[_0x157c4a(0x109)](/{{pascalCase name}}/g,_0x16c323[_0x157c4a(0x116)])[_0x157c4a(0x109)](/{{camelCase name}}/g,_0x16c323[_0x157c4a(0xf2)])[_0x157c4a(0x109)](/{{snakeCase name}}/g,_0x16c323[_0x157c4a(0xa3)])[_0x157c4a(0x109)](/{{pluralPascalCase name}}/g,_0x16c323['pluralPascalCaseName'])[_0x157c4a(0x109)](/{{pluralCamelCase name}}/g,_0x16c323[_0x157c4a(0xc0)])['replace'](/{{tableName}}/g,_0x16c323[_0x157c4a(0xf0)])[_0x157c4a(0x109)](/{{name}}/g,_0x16c323[_0x157c4a(0x11f)]);}async['createServicePath'](_0x104f32,_0x10c3f9,_0x59fd32){const _0x25a993=a0_0x28ceca;let _0x147140=_0x104f32+_0x25a993(0xa8);await this['createDir'](_0x147140),_0x147140=_0x147140+'/'+_0x10c3f9,await this['createDir'](_0x147140),_0x147140+=_0x25a993(0x9a),await this[_0x25a993(0x114)](_0x147140),_0x147140+='/service',await this[_0x25a993(0x114)](_0x147140),_0x147140=_0x147140+'/'+_0x59fd32,await this[_0x25a993(0x114)](_0x147140);}[a0_0x28ceca(0xec)](){const _0xbceea1=a0_0x28ceca;let _0x42b0a3=process[_0xbceea1(0x112)]['PWD'][_0xbceea1(0x111)]('/'),_0x5c5add=[];for(let _0x34caa8=0x0;_0x34caa8<_0x42b0a3[_0xbceea1(0x9d)]&&_0xbceea1(0x108)!=_0x42b0a3[_0x34caa8];_0x34caa8++)_0x5c5add['push'](_0x42b0a3[_0x34caa8]);return _0x5c5add[_0xbceea1(0xb4)]('/');}async['createDir'](_0x21ecf0){const _0x136ce0=a0_0x28ceca;0x0==await this[_0x136ce0(0xd1)](_0x21ecf0)&&fs[_0x136ce0(0xeb)](_0x21ecf0);}async[a0_0x28ceca(0xd1)](_0x1dc9e2){const _0x3028c4=a0_0x28ceca;return await fs[_0x3028c4(0xab)](_0x1dc9e2);}};tslib_1[a0_0x28ceca(0xd4)]([(0x0,type_graphql_1[a0_0x28ceca(0xdd)])(_0x162e2f=>Boolean,{'description':a0_0x28ceca(0xdb)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x28ceca(0x122)])('id')),tslib_1[a0_0x28ceca(0xe8)](0x1,(0x0,type_graphql_1[a0_0x28ceca(0x9b)])()),tslib_1['__metadata'](a0_0x28ceca(0xaa),Function),tslib_1[a0_0x28ceca(0xbe)](a0_0x28ceca(0xac),[String,Object]),tslib_1['__metadata'](a0_0x28ceca(0xe2),Promise)],OperatoToolCreateService[a0_0x28ceca(0xb1)],'toolCreateService',null),OperatoToolCreateService=tslib_1[a0_0x28ceca(0xd4)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports[a0_0x28ceca(0x107)]=OperatoToolCreateService;function a0_0x2557(_0x2907be,_0x377f10){const _0x2c0889=a0_0x2c08();return a0_0x2557=function(_0x255788,_0x50618f){_0x255788=_0x255788-0x98;let _0x197db4=_0x2c0889[_0x255788];return _0x197db4;},a0_0x2557(_0x2907be,_0x377f10);}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='\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',serviceQuery=a0_0x28ceca(0xba),serviceHistoryQuery=a0_0x28ceca(0xf9),serviceMutation=a0_0x28ceca(0xfc),sereviceType='\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',sereviceHistoryType='\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a',serviceEntity=a0_0x28ceca(0xf6),serviceEntityHistCopy=a0_0x28ceca(0x103),serviceEntityHistJson=a0_0x28ceca(0xcd),serviceEntitySubscriber='\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';
1
+ 'use strict';function a0_0x10b8(){const _0x10280d=['793202ageGpx','__decorate','-history-type.ts','...','replace','split','JSON','Float','OperatoToolCreateService','string','Int','existsPath','createDir','date','\x27,\x20type:\x20\x27','length','\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','/packages','Resolvers\x20}\x20from\x20\x27./','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','long','createServicePath','domain','camelCaseName','env','9567BcariO','@things-factory/shell','@Column({name:\x27','\x20{\x20nullable:\x20','dataProp','mkdirSync','-history-query.ts','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a\x20\x20@Column(\x27simple-json\x27,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20@Field(type\x20=>\x20ScalarObject,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20historyJson?:\x20any\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','name','3633UYoPWX','join','replaceNamesMap','createHistoryServiceFiles','\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',',length:','creator_id','-history.ts','COPY','2804412BCtVYF','prototype','1496qTgrbu','includes','toolCreateService','colType','float','text','Entity','getProjectRootPath','push','-query.ts','updater_id','\x27,\x20nullable:\x20','77MhcuMK','find','decimal','pascalCaseName','readFileSync','character\x20varying','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','/packages/','.ts','\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','design:returntype','nullable','timestamp\x20without\x20time\x20zone','double','\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','getColTxtType','1660UKCJLn','indexOf','\x0a\x20\x20','getFieldType','\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','pluralCamelCaseName','{{camelCase\x20name}}.','bigint','getRepository','utf8','domain_id','snakeCaseName','Resolvers,','Entities,\x20resolvers\x20as\x20','sort','\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','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','__esModule','\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','columnToEntityColumn','__metadata','Operato\x20Tool\x20Create\x20Service','/service','514392iXOWkP','/server','/index.ts','created_at','-history\x27','updated_at','Ctx','packages','createServiceFiles','findOne','6188MGByIP','tableName','EntityColumn','pluralPascalCaseName','Date','integer','import\x20{\x20entities\x20as\x20','state','/event-subscriber.ts','rank','370EPSLka','createTypeText','writeFile','/*\x20ENTITIES\x20*/\x0a\x09...','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','@Field(','filter','\x20})','1NswKAd','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20Domain\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0a@Entity(\x27{{tableName}}\x27)\x0a{{indexAnn}}\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}\x20{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','1561839mqePKH','uniqRank','updater','Arg','design:paramtypes','datetime','type\x20=>','creator','colSize','Resolver','Resolvers,\x20subscribers\x20as\x20','-mutation.ts','tslib','type-graphql','index.ts','map','createEntityText','EntitySubscribers\x20}\x20from\x20\x27./','createHistoryEntityText','number','Query','Entities,','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'];a0_0x10b8=function(){return _0x10280d;};return a0_0x10b8();}const a0_0x204474=a0_0x2cfd;(function(_0x1398ef,_0x1f5bc8){const _0xb030e4=a0_0x2cfd,_0x369b93=_0x1398ef();while(!![]){try{const _0x38747d=parseInt(_0xb030e4(0x94))/0x1*(parseInt(_0xb030e4(0xad))/0x2)+parseInt(_0xb030e4(0x96))/0x3+-parseInt(_0xb030e4(0x117))/0x4*(parseInt(_0xb030e4(0xf6))/0x5)+-parseInt(_0xb030e4(0xd8))/0x6+-parseInt(_0xb030e4(0xcf))/0x7*(-parseInt(_0xb030e4(0xda))/0x8)+parseInt(_0xb030e4(0xc6))/0x9*(parseInt(_0xb030e4(0x121))/0xa)+-parseInt(_0xb030e4(0xe6))/0xb*(-parseInt(_0xb030e4(0x10d))/0xc);if(_0x38747d===_0x1f5bc8)break;else _0x369b93['push'](_0x369b93['shift']());}catch(_0x48592c){_0x369b93['push'](_0x369b93['shift']());}}}(a0_0x10b8,0x5afae));Object['defineProperty'](exports,a0_0x204474(0x107),{'value':!0x0}),exports[a0_0x204474(0xb5)]=void 0x0;function a0_0x2cfd(_0x4a9597,_0x345f90){const _0x10b823=a0_0x10b8();return a0_0x2cfd=function(_0x2cfdfc,_0x55edd2){_0x2cfdfc=_0x2cfdfc-0x94;let _0x399d06=_0x10b823[_0x2cfdfc];return _0x399d06;},a0_0x2cfd(_0x4a9597,_0x345f90);}const tslib_1=require(a0_0x204474(0xa2)),type_graphql_1=require(a0_0x204474(0xa3)),shell_1=require(a0_0x204474(0xc7)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require('pluralize'),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x204474(0xdc)](_0x1f3144,_0x59bcf8){const _0x2fd802=a0_0x204474,{domain:_0x366003}=_0x59bcf8[_0x2fd802(0x11e)],_0x26261c=await(0x0,shell_1[_0x2fd802(0xfe)])(resource_base_1[_0x2fd802(0xe0)])[_0x2fd802(0x116)]({'where':{'id':_0x1f3144}}),_0x4d0bc2=await(0x0,shell_1[_0x2fd802(0xfe)])(resource_base_1[_0x2fd802(0x119)])[_0x2fd802(0xe7)]({'where':{'domain':{'id':_0x366003['id']},'entity':{'id':_0x26261c['id']}}});let {name:_0x391ab6='',bundle:_0x300bd8=''}=_0x26261c||{},_0x1bd9be=this[_0x2fd802(0xe1)](),_0x76c30e=kebabCase(_0x391ab6);return await this['createServicePath'](_0x1bd9be,_0x300bd8,_0x76c30e),await this[_0x2fd802(0x115)](_0x1bd9be,_0x300bd8,_0x391ab6,_0x76c30e,_0x26261c,_0x4d0bc2),!0x0;}async[a0_0x204474(0x115)](_0x378275,_0x664753,_0x185d41,_0x2d4f30,_0xc777be,_0x477264){const _0x1387a9=a0_0x204474;let _0x2394b3={'name':_0x2d4f30,'tableName':_0xc777be[_0x1387a9(0x118)],'pascalCaseName':startCase(camelCase(_0x185d41))['replace'](/ /g,''),'camelCaseName':camelCase(_0x185d41),'snakeCaseName':snakeCase(_0x185d41),'pluralPascalCaseName':startCase(camelCase(plural(_0x185d41)))[_0x1387a9(0xb1)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x185d41))},_0x1edff2=_0x378275+_0x1387a9(0xed)+_0x664753+'/server/service/';['JSON','COPY']['includes'](_0xc777be[_0x1387a9(0xca)])?await this['createHistoryServiceFiles'](_0x1edff2,_0x2d4f30,_0xc777be,_0x477264,_0x2394b3):await this['createNoHistoryServiceFiels'](_0x1edff2,_0x2d4f30,_0xc777be,_0x477264,_0x2394b3);}async[a0_0x204474(0xd2)](_0xdfff7a,_0xf246fd,_0x31853f,_0x160023,_0x3086d8){const _0x169252=a0_0x204474;await this['writeFile'](_0xdfff7a+(_0xf246fd+_0x169252(0x10f)),serviceHistoryIndex,_0x3086d8);let _0x259834=this[_0x169252(0xa6)](_0x31853f,_0x160023);await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+'.ts'),_0x259834,_0x3086d8),await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+_0x169252(0xe3)),serviceQuery,_0x3086d8),await this['writeFile'](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+_0x169252(0xa1)),serviceMutation,_0x3086d8);let _0x252a80=this[_0x169252(0x122)](_0x160023);await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+'-type.ts'),_0x252a80,_0x3086d8);let _0x2dbb6b=this[_0x169252(0xa8)](_0x31853f,_0x160023);await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+_0x169252(0xd6)),_0x2dbb6b,_0x3086d8);let _0x128eaf='';_0x169252(0xb3)==_0x31853f[_0x169252(0xca)]?(_0x128eaf=_0x169252(0xbd),await this['writeFile'](_0xdfff7a+(_0xf246fd+_0x169252(0x11f)),serviceEntitySubscriber,_0x3086d8)):_0x128eaf='';let _0x1276dc=serviceEntitySubscriber[_0x169252(0xb1)](/{{entityToJson}}/g,_0x128eaf);await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+_0x169252(0x11f)),_0x1276dc,_0x3086d8),await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+_0x169252(0xcc)),serviceHistoryQuery,_0x3086d8),await this[_0x169252(0x123)](_0xdfff7a+(_0xf246fd+'/'+_0xf246fd+_0x169252(0xaf)),sereviceHistoryType,_0x3086d8);let _0x5e4d1d=_0xdfff7a+_0x169252(0xa4);0x0==await this[_0x169252(0xb8)](_0x5e4d1d)&&await this[_0x169252(0x123)](_0x5e4d1d,allIndex,_0x3086d8);let _0x374773=await fs[_0x169252(0xea)](_0x5e4d1d,_0x169252(0xff));_0x374773[_0x169252(0xf7)]('export\x20*\x20from\x20\x27./'+_0x3086d8[_0x169252(0xce)]+'/'+_0x3086d8[_0x169252(0xce)]+_0x169252(0x111))<0x0&&(_0x374773=_0x374773[_0x169252(0xb1)](/\/\* EXPORT ENTITY TYPES \*\//,_0x169252(0xac)+_0x3086d8[_0x169252(0xce)]+'/'+_0x3086d8[_0x169252(0xce)]+_0x169252(0x111))),_0x374773[_0x169252(0xf7)]('export\x20*\x20from\x20\x27./'+_0x3086d8[_0x169252(0xce)]+'/'+_0x3086d8[_0x169252(0xce)]+'\x27')<0x0&&(_0x374773=_0x374773[_0x169252(0xb1)](/\/\* EXPORT ENTITY TYPES \*\//,_0x169252(0xac)+_0x3086d8[_0x169252(0xce)]+'/'+_0x3086d8[_0x169252(0xce)]+'\x27')),_0x374773[_0x169252(0xf7)](_0x169252(0x11d)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0x103)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0xa0)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0xa7)+_0x3086d8[_0x169252(0xce)]+'\x27')<0x0&&(_0x374773=_0x374773['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x169252(0xc0)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0x103)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0xa0)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0xa7)+_0x3086d8[_0x169252(0xce)]+'\x27')),_0x374773[_0x169252(0xf7)]('...'+_0x3086d8[_0x169252(0xe9)]+'Entities,')<0x0&&(_0x374773=_0x374773[_0x169252(0xb1)](/\/\* ENTITIES \*\//,_0x169252(0x124)+_0x3086d8[_0x169252(0xe9)]+'Entities,')),_0x374773[_0x169252(0xf7)](_0x169252(0xb0)+_0x3086d8[_0x169252(0xe9)]+_0x169252(0x102))<0x0&&(_0x374773=_0x374773[_0x169252(0xb1)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x3086d8[_0x169252(0xe9)]+_0x169252(0x102))),_0x374773[_0x169252(0xf7)](_0x169252(0xb0)+_0x3086d8[_0x169252(0xe9)]+'EntitySubscribers,')<0x0&&(_0x374773=_0x374773[_0x169252(0xb1)](/\/\* SUBSCRIBERS \*\//,_0x169252(0x106)+_0x3086d8[_0x169252(0xe9)]+'EntitySubscribers,')),await this[_0x169252(0x123)](_0x5e4d1d,_0x374773,_0x3086d8);}async['createNoHistoryServiceFiels'](_0x1bea5c,_0x3b32e3,_0x18eb31,_0x1a3e88,_0x436806){const _0x549cb1=a0_0x204474;await this[_0x549cb1(0x123)](_0x1bea5c+(_0x3b32e3+_0x549cb1(0x10f)),serviceIndex,_0x436806),await this['writeFile'](_0x1bea5c+(_0x3b32e3+'/'+_0x3b32e3+_0x549cb1(0xe3)),serviceQuery,_0x436806),await this[_0x549cb1(0x123)](_0x1bea5c+(_0x3b32e3+'/'+_0x3b32e3+_0x549cb1(0xa1)),serviceMutation,_0x436806);let _0x49ea26=this[_0x549cb1(0xa6)](_0x18eb31,_0x1a3e88);await this['writeFile'](_0x1bea5c+(_0x3b32e3+'/'+_0x3b32e3+_0x549cb1(0xee)),_0x49ea26,_0x436806);let _0x1d38d8=this[_0x549cb1(0x122)](_0x1a3e88);await this['writeFile'](_0x1bea5c+(_0x3b32e3+'/'+_0x3b32e3+'-type.ts'),_0x1d38d8,_0x436806);let _0x170b62=_0x1bea5c+_0x549cb1(0xa4);0x0==await this[_0x549cb1(0xb8)](_0x170b62)&&await this['writeFile'](_0x170b62,allIndex,_0x436806);let _0x15b418=await fs[_0x549cb1(0xea)](_0x170b62,_0x549cb1(0xff));_0x15b418['indexOf']('export\x20*\x20from\x20\x27./'+_0x436806[_0x549cb1(0xce)]+'/'+_0x436806[_0x549cb1(0xce)]+'\x27')<0x0&&(_0x15b418=_0x15b418['replace'](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x436806[_0x549cb1(0xce)]+'/'+_0x436806['name']+'\x27')),_0x15b418[_0x549cb1(0xf7)]('import\x20{\x20entities\x20as\x20'+_0x436806[_0x549cb1(0xe9)]+'Entities,\x20resolvers\x20as\x20'+_0x436806['pascalCaseName']+_0x549cb1(0xbf)+_0x436806['name']+'\x27')<0x0&&(_0x15b418=_0x15b418[_0x549cb1(0xb1)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x549cb1(0xc0)+_0x436806['pascalCaseName']+'Entities,\x20resolvers\x20as\x20'+_0x436806[_0x549cb1(0xe9)]+_0x549cb1(0xbf)+_0x436806[_0x549cb1(0xce)]+'\x27')),_0x15b418['indexOf'](_0x549cb1(0xb0)+_0x436806[_0x549cb1(0xe9)]+_0x549cb1(0xab))<0x0&&(_0x15b418=_0x15b418[_0x549cb1(0xb1)](/\/\* ENTITIES \*\//,_0x549cb1(0x124)+_0x436806[_0x549cb1(0xe9)]+_0x549cb1(0xab))),_0x15b418[_0x549cb1(0xf7)](_0x549cb1(0xb0)+_0x436806['pascalCaseName']+'Resolvers,')<0x0&&(_0x15b418=_0x15b418[_0x549cb1(0xb1)](/\/\* RESOLVER CLASSES \*\//,_0x549cb1(0x125)+_0x436806[_0x549cb1(0xe9)]+_0x549cb1(0x102))),await this['writeFile'](_0x170b62,_0x15b418,_0x436806);}[a0_0x204474(0x122)](_0x344c30){const _0x38adf2=a0_0x204474;let _0x11168f=sereviceType,_0x440153=_0x344c30[_0x38adf2(0xa5)](_0x20e67a=>{const _0x4d4cb9=_0x38adf2;if('id'==_0x20e67a[_0x4d4cb9(0xce)])return'';if(_0x4d4cb9(0x100)==_0x20e67a[_0x4d4cb9(0xce)])return'';if(_0x4d4cb9(0x110)==_0x20e67a[_0x4d4cb9(0xce)])return'';if(_0x4d4cb9(0x112)==_0x20e67a['name'])return'';if(_0x4d4cb9(0xd5)==_0x20e67a[_0x4d4cb9(0xce)])return'';if('updater_id'==_0x20e67a[_0x4d4cb9(0xce)])return'';let _0x4eda20=this[_0x4d4cb9(0xf9)](_0x20e67a),_0x5ce2b8=this[_0x4d4cb9(0xf5)](_0x20e67a),_0x487c2d=camelCase(_0x20e67a[_0x4d4cb9(0xce)]);return'\x20\x20'+(_0x4d4cb9(0x127)+(0x0==_0x4eda20[_0x4d4cb9(0xbc)]?'':_0x4d4cb9(0x9c)+_0x4eda20+',')+_0x4d4cb9(0xc9)+_0x20e67a[_0x4d4cb9(0xf1)]+'\x20})')+_0x4d4cb9(0xf8)+(''+_0x487c2d+(_0x20e67a[_0x4d4cb9(0xf1)]?'?':'')+':\x20'+_0x5ce2b8)+'\x0a';});_0x11168f=_0x11168f[_0x38adf2(0xb1)](/{{newTypeColumns}}/g,_0x440153['join']('\x0a'));let _0x49fb5a=_0x344c30[_0x38adf2(0xa5)](_0x7d9c2d=>{const _0x2a33bd=_0x38adf2;if('id'==_0x7d9c2d[_0x2a33bd(0xce)])return'';if(_0x2a33bd(0x100)==_0x7d9c2d['name'])return'';if(_0x2a33bd(0x110)==_0x7d9c2d['name'])return'';if(_0x2a33bd(0x112)==_0x7d9c2d[_0x2a33bd(0xce)])return'';if(_0x2a33bd(0xd5)==_0x7d9c2d[_0x2a33bd(0xce)])return'';if(_0x2a33bd(0xe4)==_0x7d9c2d['name'])return'';let _0x27bd2e=this['getFieldType'](_0x7d9c2d),_0x333dcd=this['getColTxtType'](_0x7d9c2d);_0x7d9c2d[_0x2a33bd(0xf1)]=!0x0;let _0x57f54=camelCase(_0x7d9c2d[_0x2a33bd(0xce)]);return'\x20\x20'+(_0x2a33bd(0x127)+(0x0==_0x27bd2e[_0x2a33bd(0xbc)]?'':_0x2a33bd(0x9c)+_0x27bd2e+',')+_0x2a33bd(0xc9)+_0x7d9c2d[_0x2a33bd(0xf1)]+_0x2a33bd(0x129))+_0x2a33bd(0xf8)+(''+_0x57f54+(_0x7d9c2d[_0x2a33bd(0xf1)]?'?':'')+':\x20'+_0x333dcd)+'\x0a';});return _0x11168f=_0x11168f['replace'](/{{patchTypeColumns}}/g,_0x49fb5a['join']('\x0a')),_0x11168f;}[a0_0x204474(0xa6)](_0x73f027,_0x326dee){const _0x3a4a08=a0_0x204474;let _0x438376=serviceEntity,_0x36f5e4=_0x326dee['sort'](function(_0x4ec2b8,_0x1b6a47){const _0x127eb3=a0_0x2cfd;return _0x4ec2b8[_0x127eb3(0x120)]-_0x1b6a47[_0x127eb3(0x120)];})[_0x3a4a08(0xa5)](_0x46342a=>this[_0x3a4a08(0x109)](_0x46342a));[_0x3a4a08(0xd7),'JSON'][_0x3a4a08(0xdb)](_0x73f027[_0x3a4a08(0xca)])&&_0x36f5e4[_0x3a4a08(0xe2)](_0x3a4a08(0xec)),_0x438376=_0x438376[_0x3a4a08(0xb1)](/{{entityColumns}}/g,_0x36f5e4['join']('\x0a'));let _0x11f1de='',_0x5ab92f=_0x326dee[_0x3a4a08(0x128)](_0xfecf04=>_0xfecf04['uniqRank']&&_0xfecf04[_0x3a4a08(0x97)]>0x0)[_0x3a4a08(0x104)](function(_0x2ddee9,_0x2601a4){const _0x581440=_0x3a4a08;return _0x2ddee9[_0x581440(0x97)]-_0x2601a4[_0x581440(0x97)];});if(_0x5ab92f['length']>0x0){_0x11f1de=_0x3a4a08(0x126);let _0x197524=_0x5ab92f['map'](_0x26e6d5=>{const _0x47d58f=_0x3a4a08;let _0x46d5db=_0x26e6d5['name'];return _0x47d58f(0x100)==_0x26e6d5[_0x47d58f(0xce)]&&(_0x46d5db=_0x47d58f(0xc3)),_0x47d58f(0xd5)==_0x26e6d5['name']&&(_0x46d5db=_0x47d58f(0x9d)),_0x47d58f(0xe4)==_0x26e6d5['name']&&(_0x46d5db=_0x47d58f(0x98)),_0x47d58f(0xfc)+camelCase(_0x46d5db);});_0x11f1de=_0x11f1de['replace'](/{{indexColumns}}/g,_0x197524[_0x3a4a08(0xd0)](','));}return _0x438376=_0x438376[_0x3a4a08(0xb1)](/{{indexAnn}}/g,_0x11f1de),_0x438376;}[a0_0x204474(0xa8)](_0x21edab,_0x40610){const _0x3343bb=a0_0x204474;let _0x48365d=_0x3343bb(0xb3)==_0x21edab[_0x3343bb(0xca)]?serviceEntityHistJson:serviceEntityHistCopy,_0x228097=_0x40610[_0x3343bb(0x104)](function(_0x105c23,_0x2e45fb){const _0x2b27d3=_0x3343bb;return _0x105c23[_0x2b27d3(0x120)]-_0x2e45fb['rank'];})[_0x3343bb(0xa5)](_0x523f59=>this[_0x3343bb(0x109)](_0x523f59));return _0x48365d=_0x48365d['replace'](/{{entityColumns}}/g,_0x228097[_0x3343bb(0xd0)]('\x0a')),_0x48365d;}['columnToEntityColumn'](_0x10d1be){const _0x447ce5=a0_0x204474;if('id'==_0x10d1be[_0x447ce5(0xce)])return'';if(_0x447ce5(0x100)==_0x10d1be[_0x447ce5(0xce)])return'';if('created_at'==_0x10d1be[_0x447ce5(0xce)])return'';if(_0x447ce5(0x112)==_0x10d1be['name'])return'';if(_0x447ce5(0xd5)==_0x10d1be[_0x447ce5(0xce)])return'';if('updater_id'==_0x10d1be['name'])return'';let _0x1b4991=_0x10d1be['colType'];_0x447ce5(0xf3)==_0x10d1be[_0x447ce5(0xdd)]&&(_0x1b4991='double\x20precision'),_0x447ce5(0xc1)==_0x10d1be[_0x447ce5(0xdd)]&&(_0x1b4991=_0x447ce5(0xfd)),_0x447ce5(0xb6)==_0x10d1be['colType']&&(_0x1b4991=_0x447ce5(0xeb)),_0x447ce5(0x9b)==_0x10d1be[_0x447ce5(0xdd)]&&(_0x1b4991=_0x447ce5(0xf2));let _0x550828='';_0x447ce5(0xb6)==_0x10d1be[_0x447ce5(0xdd)]&&(_0x550828=_0x10d1be[_0x447ce5(0x9e)]);let _0xebe8a9=this[_0x447ce5(0xf9)](_0x10d1be),_0x5855b5=this[_0x447ce5(0xf5)](_0x10d1be),_0x1195d7=camelCase(_0x10d1be[_0x447ce5(0xce)]);return'\x20\x20'+(_0x447ce5(0xc8)+_0x10d1be[_0x447ce5(0xce)]+_0x447ce5(0xbb)+_0x1b4991+_0x447ce5(0xe5)+_0x10d1be[_0x447ce5(0xf1)]+'\x20'+(0x0==_0x550828[_0x447ce5(0xbc)]?'':_0x447ce5(0xd4)+_0x550828)+'\x20})')+_0x447ce5(0xf8)+(_0x447ce5(0x127)+(0x0==_0xebe8a9['length']?'':_0x447ce5(0x9c)+_0xebe8a9+',')+_0x447ce5(0xc9)+_0x10d1be[_0x447ce5(0xf1)]+'\x20})')+_0x447ce5(0xf8)+(''+_0x1195d7+(_0x10d1be[_0x447ce5(0xf1)]?'?':'')+':\x20'+_0x5855b5)+'\x0a';}['getFieldType'](_0x286b9e){const _0x3326e2=a0_0x204474;let _0x593f18='';return _0x3326e2(0xf3)==_0x286b9e[_0x3326e2(0xdd)]&&(_0x593f18=_0x3326e2(0xb4)),'float'==_0x286b9e['colType']&&(_0x593f18=_0x3326e2(0xb4)),_0x3326e2(0xc1)==_0x286b9e[_0x3326e2(0xdd)]&&(_0x593f18=_0x3326e2(0xb7)),_0x3326e2(0x11c)==_0x286b9e['colType']&&(_0x593f18=_0x3326e2(0xb7)),_0x593f18;}[a0_0x204474(0xf5)](_0x41f01f){const _0x100255=a0_0x204474;let _0xb2d1c6=_0x41f01f[_0x100255(0xdd)];return _0x100255(0xe8)==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6=_0x100255(0xa9)),_0x100255(0xf3)==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6=_0x100255(0xa9)),_0x100255(0xde)==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6=_0x100255(0xa9)),'integer'==_0x41f01f['colType']&&(_0xb2d1c6=_0x100255(0xa9)),_0x100255(0xc1)==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6=_0x100255(0xa9)),'datetime'==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6='Date'),_0x100255(0xba)==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6=_0x100255(0x11b)),_0x100255(0xdf)==_0x41f01f[_0x100255(0xdd)]&&(_0xb2d1c6=_0x100255(0xb6)),_0xb2d1c6;}async[a0_0x204474(0x123)](_0x2b0375,_0x117ad5,_0x4883e7){const _0x7d0923=a0_0x204474;await fs['writeFileSync'](_0x2b0375,this['replaceNamesMap'](_0x117ad5,_0x4883e7),_0x7d0923(0xff));}[a0_0x204474(0xd1)](_0x5bd082,_0x576ccb){const _0x3f069b=a0_0x204474;return _0x5bd082[_0x3f069b(0xb1)](/{{pascalCase name}}/g,_0x576ccb[_0x3f069b(0xe9)])[_0x3f069b(0xb1)](/{{camelCase name}}/g,_0x576ccb[_0x3f069b(0xc4)])[_0x3f069b(0xb1)](/{{snakeCase name}}/g,_0x576ccb[_0x3f069b(0x101)])[_0x3f069b(0xb1)](/{{pluralPascalCase name}}/g,_0x576ccb[_0x3f069b(0x11a)])[_0x3f069b(0xb1)](/{{pluralCamelCase name}}/g,_0x576ccb[_0x3f069b(0xfb)])[_0x3f069b(0xb1)](/{{tableName}}/g,_0x576ccb['tableName'])[_0x3f069b(0xb1)](/{{name}}/g,_0x576ccb['name']);}async[a0_0x204474(0xc2)](_0x239359,_0x2dbb89,_0x222f2f){const _0x5f079b=a0_0x204474;let _0x1e8e24=_0x239359+_0x5f079b(0xbe);await this[_0x5f079b(0xb9)](_0x1e8e24),_0x1e8e24=_0x1e8e24+'/'+_0x2dbb89,await this[_0x5f079b(0xb9)](_0x1e8e24),_0x1e8e24+=_0x5f079b(0x10e),await this[_0x5f079b(0xb9)](_0x1e8e24),_0x1e8e24+=_0x5f079b(0x10c),await this[_0x5f079b(0xb9)](_0x1e8e24),_0x1e8e24=_0x1e8e24+'/'+_0x222f2f,await this[_0x5f079b(0xb9)](_0x1e8e24);}['getProjectRootPath'](){const _0x4b5f33=a0_0x204474;let _0x4aa8cb=process[_0x4b5f33(0xc5)]['PWD'][_0x4b5f33(0xb2)]('/'),_0x5b97d5=[];for(let _0x368f99=0x0;_0x368f99<_0x4aa8cb[_0x4b5f33(0xbc)]&&_0x4b5f33(0x114)!=_0x4aa8cb[_0x368f99];_0x368f99++)_0x5b97d5[_0x4b5f33(0xe2)](_0x4aa8cb[_0x368f99]);return _0x5b97d5[_0x4b5f33(0xd0)]('/');}async['createDir'](_0x29a110){const _0x1236e8=a0_0x204474;0x0==await this['existsPath'](_0x29a110)&&fs[_0x1236e8(0xcb)](_0x29a110);}async[a0_0x204474(0xb8)](_0x232805){return await fs['existsSync'](_0x232805);}};tslib_1[a0_0x204474(0xae)]([(0x0,type_graphql_1[a0_0x204474(0xaa)])(_0x13266e=>Boolean,{'description':a0_0x204474(0x10b)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x204474(0x99)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x204474(0x113)])()),tslib_1[a0_0x204474(0x10a)]('design:type',Function),tslib_1['__metadata'](a0_0x204474(0x9a),[String,Object]),tslib_1[a0_0x204474(0x10a)](a0_0x204474(0xf0),Promise)],OperatoToolCreateService[a0_0x204474(0xd9)],a0_0x204474(0xdc),null),OperatoToolCreateService=tslib_1[a0_0x204474(0xae)]([(0x0,type_graphql_1[a0_0x204474(0x9f)])()],OperatoToolCreateService),exports[a0_0x204474(0xb5)]=OperatoToolCreateService;const allIndex=a0_0x204474(0xd3),serviceIndex=a0_0x204474(0x105),serviceHistoryIndex=a0_0x204474(0xfa),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_0x204474(0xef),serviceMutation='\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',sereviceType=a0_0x204474(0xf4),sereviceHistoryType=a0_0x204474(0x108),serviceEntity=a0_0x204474(0x95),serviceEntityHistCopy='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntityHistJson=a0_0x204474(0xcd),serviceEntitySubscriber='\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';
@@ -1 +1 @@
1
- 'use strict';const a0_0x8ca0d8=a0_0x2975;(function(_0x501325,_0x16a589){const _0x345718=a0_0x2975,_0x2ce7cc=_0x501325();while(!![]){try{const _0x10be66=parseInt(_0x345718(0x8e))/0x1+parseInt(_0x345718(0x84))/0x2+parseInt(_0x345718(0x70))/0x3+parseInt(_0x345718(0x72))/0x4*(-parseInt(_0x345718(0x6e))/0x5)+parseInt(_0x345718(0x71))/0x6*(-parseInt(_0x345718(0x6c))/0x7)+parseInt(_0x345718(0x75))/0x8*(parseInt(_0x345718(0x7a))/0x9)+-parseInt(_0x345718(0x74))/0xa*(parseInt(_0x345718(0x79))/0xb);if(_0x10be66===_0x16a589)break;else _0x2ce7cc['push'](_0x2ce7cc['shift']());}catch(_0x4dec46){_0x2ce7cc['push'](_0x2ce7cc['shift']());}}}(a0_0x21de,0x99c5b));function a0_0x2975(_0xf6fd85,_0x4e4bfb){const _0x21deec=a0_0x21de();return a0_0x2975=function(_0x297581,_0x311a38){_0x297581=_0x297581-0x6a;let _0x4127c=_0x21deec[_0x297581];return _0x4127c;},a0_0x2975(_0xf6fd85,_0x4e4bfb);}function a0_0x21de(){const _0x48c6b5=['LicenseError','INVALID_LICENSE','id\x20!=\x20:id','@things-factory/shell','manager','getRepository','includes','getPermission','checkStudioTemplateIsOverLimit','1066768FVYqUA','where','trim','getCount','@things-factory/menu-base','Studio','@things-factory/operato-license-checker','map','split','from','394703xfjOeC','defineProperty','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','32193GidoGE','checkStudioPermission','55HwQfXW','ERROR_CODES','1769181XXNJpv','426NmmxHy','379516hPkLyT','menu','730GBVBYo','2712KgShYS','Menu','checkTarget','select','78078FowQAi','26559JpFEwm'];a0_0x21de=function(){return _0x48c6b5;};return a0_0x21de();}Object[a0_0x8ca0d8(0x6a)](exports,'__esModule',{'value':!0x0}),exports[a0_0x8ca0d8(0x83)]=exports[a0_0x8ca0d8(0x6d)]=void 0x0;const operato_license_checker_1=require(a0_0x8ca0d8(0x8a)),shell_1=require(a0_0x8ca0d8(0x7e)),menu_base_1=require(a0_0x8ca0d8(0x88)),license_error_1=require('../../errors/license-error');async function checkStudioPermission(){const _0xf0e3f7=a0_0x8ca0d8;let _0x308242=((0x0,operato_license_checker_1[_0xf0e3f7(0x82)])('Permissions\x20For\x20Tailor\x20Tool')||',')[_0xf0e3f7(0x8c)](',')[_0xf0e3f7(0x8b)](_0x35096b=>_0x35096b[_0xf0e3f7(0x86)]()),_0x4e8ddb=!0x1;return _0x308242['forEach'](_0x42b46a=>{const _0x3af492=_0xf0e3f7;_0x42b46a[_0x3af492(0x81)](_0x3af492(0x89))&&(_0x4e8ddb=!0x0);}),_0x4e8ddb;}async function checkStudioTemplateIsOverLimit(_0x2ac6f9,_0x4e2e91){const _0x42a0ea=a0_0x8ca0d8;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x42a0ea(0x7b))]({'errorCode':_0x4e2e91['t'](license_error_1[_0x42a0ea(0x7b)][_0x42a0ea(0x6f)][_0x42a0ea(0x7c)])});var _0x59bd2a=0x0;if(_0x59bd2a=_0x2ac6f9&&''!=_0x2ac6f9?await(0x0,shell_1[_0x42a0ea(0x80)])(menu_base_1['Menu'])['manager']['createQueryBuilder']()[_0x42a0ea(0x78)](_0x42a0ea(0x73))['from'](menu_base_1[_0x42a0ea(0x76)],_0x42a0ea(0x73))[_0x42a0ea(0x85)](_0x42a0ea(0x7d),{'id':_0x2ac6f9})['andWhere'](_0x42a0ea(0x6b))[_0x42a0ea(0x87)]()+0x1:await(0x0,shell_1[_0x42a0ea(0x80)])(menu_base_1[_0x42a0ea(0x76)])[_0x42a0ea(0x7f)]['createQueryBuilder']()[_0x42a0ea(0x78)](_0x42a0ea(0x73))[_0x42a0ea(0x8d)](menu_base_1[_0x42a0ea(0x76)],_0x42a0ea(0x73))[_0x42a0ea(0x85)](_0x42a0ea(0x6b))[_0x42a0ea(0x87)]()+0x1,!(0x0,operato_license_checker_1[_0x42a0ea(0x77)])(_0x59bd2a))throw new license_error_1[(_0x42a0ea(0x7b))]({'errorCode':_0x4e2e91['t'](license_error_1['LicenseError'][_0x42a0ea(0x6f)]['OVER_LIMIT'])});return!0x0;}exports['checkStudioPermission']=checkStudioPermission,exports[a0_0x8ca0d8(0x83)]=checkStudioTemplateIsOverLimit;
1
+ 'use strict';const a0_0x6c5ea7=a0_0x5307;function a0_0x5307(_0x1cc6ab,_0x671e83){const _0x3acbf0=a0_0x3acb();return a0_0x5307=function(_0x5307c7,_0x3e7982){_0x5307c7=_0x5307c7-0x125;let _0x1836c9=_0x3acbf0[_0x5307c7];return _0x1836c9;},a0_0x5307(_0x1cc6ab,_0x671e83);}(function(_0x305bbd,_0x23f79f){const _0x13bc9a=a0_0x5307,_0x2e83aa=_0x305bbd();while(!![]){try{const _0x1f3e10=parseInt(_0x13bc9a(0x135))/0x1*(-parseInt(_0x13bc9a(0x140))/0x2)+-parseInt(_0x13bc9a(0x14d))/0x3*(-parseInt(_0x13bc9a(0x133))/0x4)+parseInt(_0x13bc9a(0x126))/0x5*(parseInt(_0x13bc9a(0x12f))/0x6)+parseInt(_0x13bc9a(0x14c))/0x7+-parseInt(_0x13bc9a(0x137))/0x8+parseInt(_0x13bc9a(0x134))/0x9*(parseInt(_0x13bc9a(0x144))/0xa)+parseInt(_0x13bc9a(0x131))/0xb*(-parseInt(_0x13bc9a(0x13a))/0xc);if(_0x1f3e10===_0x23f79f)break;else _0x2e83aa['push'](_0x2e83aa['shift']());}catch(_0x21c5f3){_0x2e83aa['push'](_0x2e83aa['shift']());}}}(a0_0x3acb,0xe7531));function a0_0x3acb(){const _0x544261=['../../errors/license-error','Studio','@things-factory/menu-base','30180FDQYGh','map','forEach','select','checkTarget','from','menu','Permissions\x20For\x20Tailor\x20Tool','11148676mlPLGb','9MQIagj','getPermission','5IEFiHu','where','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','OVER_LIMIT','getCount','@things-factory/shell','createQueryBuilder','id\x20!=\x20:id','@things-factory/operato-license-checker','920454eEFvay','split','39919stbkix','Menu','1657828TbhDFv','4374FxuYed','1NaXCOm','getRepository','11406368OBDzkn','LicenseError','INVALID_LICENSE','1836oFFgrJ','checkStudioPermission','andWhere','checkStudioTemplateIsOverLimit','manager','defineProperty','3055316WmriXS'];a0_0x3acb=function(){return _0x544261;};return a0_0x3acb();}Object[a0_0x6c5ea7(0x13f)](exports,'__esModule',{'value':!0x0}),exports['checkStudioTemplateIsOverLimit']=exports[a0_0x6c5ea7(0x13b)]=void 0x0;const operato_license_checker_1=require(a0_0x6c5ea7(0x12e)),shell_1=require(a0_0x6c5ea7(0x12b)),menu_base_1=require(a0_0x6c5ea7(0x143)),license_error_1=require(a0_0x6c5ea7(0x141));async function checkStudioPermission(){const _0x4bb6f5=a0_0x6c5ea7;let _0x1274be=((0x0,operato_license_checker_1[_0x4bb6f5(0x125)])(_0x4bb6f5(0x14b))||',')[_0x4bb6f5(0x130)](',')[_0x4bb6f5(0x145)](_0x82ff24=>_0x82ff24['trim']()),_0x391c3a=!0x1;return _0x1274be[_0x4bb6f5(0x146)](_0x584948=>{const _0x16fd9b=_0x4bb6f5;_0x584948['includes'](_0x16fd9b(0x142))&&(_0x391c3a=!0x0);}),_0x391c3a;}async function checkStudioTemplateIsOverLimit(_0x358645,_0x377dbb){const _0x392962=a0_0x6c5ea7;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x392962(0x138))]({'errorCode':_0x377dbb['t'](license_error_1[_0x392962(0x138)]['ERROR_CODES'][_0x392962(0x139)])});var _0x1876dc=0x0;if(_0x1876dc=_0x358645&&''!=_0x358645?await(0x0,shell_1['getRepository'])(menu_base_1['Menu'])[_0x392962(0x13e)]['createQueryBuilder']()[_0x392962(0x147)](_0x392962(0x14a))['from'](menu_base_1[_0x392962(0x132)],_0x392962(0x14a))[_0x392962(0x127)](_0x392962(0x12d),{'id':_0x358645})[_0x392962(0x13c)](_0x392962(0x128))[_0x392962(0x12a)]()+0x1:await(0x0,shell_1[_0x392962(0x136)])(menu_base_1[_0x392962(0x132)])[_0x392962(0x13e)][_0x392962(0x12c)]()[_0x392962(0x147)](_0x392962(0x14a))[_0x392962(0x149)](menu_base_1[_0x392962(0x132)],_0x392962(0x14a))[_0x392962(0x127)](_0x392962(0x128))[_0x392962(0x12a)]()+0x1,!(0x0,operato_license_checker_1[_0x392962(0x148)])(_0x1876dc))throw new license_error_1[(_0x392962(0x138))]({'errorCode':_0x377dbb['t'](license_error_1[_0x392962(0x138)]['ERROR_CODES'][_0x392962(0x129)])});return!0x0;}exports[a0_0x6c5ea7(0x13b)]=checkStudioPermission,exports[a0_0x6c5ea7(0x13d)]=checkStudioTemplateIsOverLimit;
@@ -1 +1 @@
1
- 'use strict';const a0_0xd41327=a0_0x2188;(function(_0x1b5700,_0x57c33b){const _0x353804=a0_0x2188,_0x4cc2a8=_0x1b5700();while(!![]){try{const _0x3c1d06=-parseInt(_0x353804(0x122))/0x1+parseInt(_0x353804(0x135))/0x2+parseInt(_0x353804(0x130))/0x3*(parseInt(_0x353804(0x126))/0x4)+parseInt(_0x353804(0x138))/0x5+parseInt(_0x353804(0x134))/0x6*(parseInt(_0x353804(0x137))/0x7)+parseInt(_0x353804(0x139))/0x8+-parseInt(_0x353804(0x12f))/0x9;if(_0x3c1d06===_0x57c33b)break;else _0x4cc2a8['push'](_0x4cc2a8['shift']());}catch(_0x76931e){_0x4cc2a8['push'](_0x4cc2a8['shift']());}}}(a0_0x20ee,0x5e858));Object[a0_0xd41327(0x125)](exports,a0_0xd41327(0x12c),{'value':!0x0}),exports[a0_0xd41327(0x128)]=void 0x0;function a0_0x20ee(){const _0x20d87b=['7zDAvcG','3399280lzZvDG','6031864lxQFGs','__param','prototype','./tool-permission','design:returntype','studioTemplateIsOverLimit','766834LspQZs','checkStudioTemplateIsOverLimit','tslib','defineProperty','82564ttsqCE','__metadata','OperatoToolResolver','Ctx','Resolver','Arg','__esModule','design:paramtypes','__decorate','15763959IrvUIA','27XmlkKD','checkStudioPermission','Query','design:type','3296160UOmSUY','1473154aHcyNt','studioPermission'];a0_0x20ee=function(){return _0x20d87b;};return a0_0x20ee();}function a0_0x2188(_0x174c64,_0x42f86b){const _0x20ee82=a0_0x20ee();return a0_0x2188=function(_0x2188b8,_0x5dd03e){_0x2188b8=_0x2188b8-0x121;let _0x284b2f=_0x20ee82[_0x2188b8];return _0x284b2f;},a0_0x2188(_0x174c64,_0x42f86b);}const tslib_1=require(a0_0xd41327(0x124)),type_graphql_1=require('type-graphql'),tool_permission_1=require(a0_0xd41327(0x13c));let OperatoToolResolver=class{async[a0_0xd41327(0x136)](_0x4c9a8c){const _0x1ac5ce=a0_0xd41327;return(0x0,tool_permission_1[_0x1ac5ce(0x131)])();}async['studioTemplateIsOverLimit'](_0xb690e3,_0x128ecc){const _0x3b603d=a0_0xd41327;return(0x0,tool_permission_1[_0x3b603d(0x123)])(_0xb690e3,_0x128ecc);}};tslib_1[a0_0xd41327(0x12e)]([(0x0,type_graphql_1['Query'])(_0x46e17=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Usage\x20Permissions'}),tslib_1[a0_0xd41327(0x13a)](0x0,(0x0,type_graphql_1[a0_0xd41327(0x129)])()),tslib_1[a0_0xd41327(0x127)](a0_0xd41327(0x133),Function),tslib_1[a0_0xd41327(0x127)](a0_0xd41327(0x12d),[Object]),tslib_1[a0_0xd41327(0x127)]('design:returntype',Promise)],OperatoToolResolver['prototype'],a0_0xd41327(0x136),null),tslib_1[a0_0xd41327(0x12e)]([(0x0,type_graphql_1[a0_0xd41327(0x132)])(_0x4cd3d6=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Limit\x20check'}),tslib_1[a0_0xd41327(0x13a)](0x0,(0x0,type_graphql_1[a0_0xd41327(0x12b)])('id')),tslib_1[a0_0xd41327(0x13a)](0x1,(0x0,type_graphql_1[a0_0xd41327(0x129)])()),tslib_1['__metadata']('design:type',Function),tslib_1[a0_0xd41327(0x127)](a0_0xd41327(0x12d),[String,Object]),tslib_1[a0_0xd41327(0x127)](a0_0xd41327(0x13d),Promise)],OperatoToolResolver[a0_0xd41327(0x13b)],a0_0xd41327(0x121),null),OperatoToolResolver=tslib_1[a0_0xd41327(0x12e)]([(0x0,type_graphql_1[a0_0xd41327(0x12a)])()],OperatoToolResolver),exports[a0_0xd41327(0x128)]=OperatoToolResolver;
1
+ 'use strict';const a0_0x3210a6=a0_0xa9c4;(function(_0x433184,_0x366ad4){const _0x3c9da8=a0_0xa9c4,_0x5a50f3=_0x433184();while(!![]){try{const _0xf98c10=-parseInt(_0x3c9da8(0x19e))/0x1+-parseInt(_0x3c9da8(0x1a4))/0x2*(-parseInt(_0x3c9da8(0x1ad))/0x3)+-parseInt(_0x3c9da8(0x1a0))/0x4+-parseInt(_0x3c9da8(0x19f))/0x5+parseInt(_0x3c9da8(0x19c))/0x6+-parseInt(_0x3c9da8(0x1a1))/0x7*(-parseInt(_0x3c9da8(0x1a6))/0x8)+parseInt(_0x3c9da8(0x19d))/0x9*(parseInt(_0x3c9da8(0x1ae))/0xa);if(_0xf98c10===_0x366ad4)break;else _0x5a50f3['push'](_0x5a50f3['shift']());}catch(_0x4dc36c){_0x5a50f3['push'](_0x5a50f3['shift']());}}}(a0_0x3c09,0x4562d));Object[a0_0x3210a6(0x1b0)](exports,a0_0x3210a6(0x1a5),{'value':!0x0}),exports[a0_0x3210a6(0x1aa)]=void 0x0;const tslib_1=require('tslib'),type_graphql_1=require(a0_0x3210a6(0x1ac)),tool_permission_1=require(a0_0x3210a6(0x1b2));function a0_0xa9c4(_0x24c463,_0x4c7f09){const _0x3c0997=a0_0x3c09();return a0_0xa9c4=function(_0xa9c4dd,_0xfcde02){_0xa9c4dd=_0xa9c4dd-0x19b;let _0x12c83e=_0x3c0997[_0xa9c4dd];return _0x12c83e;},a0_0xa9c4(_0x24c463,_0x4c7f09);}function a0_0x3c09(){const _0x656274=['19352OqEmts','Resolver','studioTemplateIsOverLimit','design:paramtypes','OperatoToolResolver','Ctx','type-graphql','3357WpcRPf','40xEMAuk','Arg','defineProperty','__metadata','./tool-permission','__decorate','design:type','__param','prototype','Query','1889430kUgeOq','1490517HCOHTu','144942UhBKXP','2684955vjBxva','840748ArXkuZ','35NwAKyV','studioPermission','Operato\x20Tool\x20Studio\x20Limit\x20check','334lcgPtK','__esModule'];a0_0x3c09=function(){return _0x656274;};return a0_0x3c09();}let OperatoToolResolver=class{async[a0_0x3210a6(0x1a2)](_0xca0d67){return(0x0,tool_permission_1['checkStudioPermission'])();}async['studioTemplateIsOverLimit'](_0x3f6366,_0x1bb1e6){return(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])(_0x3f6366,_0x1bb1e6);}};tslib_1[a0_0x3210a6(0x1b3)]([(0x0,type_graphql_1[a0_0x3210a6(0x19b)])(_0xe5cf26=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Usage\x20Permissions'}),tslib_1[a0_0x3210a6(0x1b5)](0x0,(0x0,type_graphql_1[a0_0x3210a6(0x1ab)])()),tslib_1['__metadata'](a0_0x3210a6(0x1b4),Function),tslib_1[a0_0x3210a6(0x1b1)](a0_0x3210a6(0x1a9),[Object]),tslib_1['__metadata']('design:returntype',Promise)],OperatoToolResolver[a0_0x3210a6(0x1b6)],a0_0x3210a6(0x1a2),null),tslib_1[a0_0x3210a6(0x1b3)]([(0x0,type_graphql_1[a0_0x3210a6(0x19b)])(_0x38d486=>Boolean,{'description':a0_0x3210a6(0x1a3)}),tslib_1[a0_0x3210a6(0x1b5)](0x0,(0x0,type_graphql_1[a0_0x3210a6(0x1af)])('id')),tslib_1[a0_0x3210a6(0x1b5)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1['__metadata']('design:type',Function),tslib_1['__metadata']('design:paramtypes',[String,Object]),tslib_1['__metadata']('design:returntype',Promise)],OperatoToolResolver[a0_0x3210a6(0x1b6)],a0_0x3210a6(0x1a8),null),OperatoToolResolver=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x3210a6(0x1a7)])()],OperatoToolResolver),exports[a0_0x3210a6(0x1aa)]=OperatoToolResolver;