@things-factory/operato-tools 6.0.134 → 6.0.140

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_0x33d99e=a0_0x56f5;(function(_0x42360d,_0x3096b1){const _0x570a97=a0_0x56f5,_0x257cef=_0x42360d();while(!![]){try{const _0x41a5d5=-parseInt(_0x570a97(0x1aa))/0x1+parseInt(_0x570a97(0x1b4))/0x2+-parseInt(_0x570a97(0x1ac))/0x3*(-parseInt(_0x570a97(0x1b1))/0x4)+-parseInt(_0x570a97(0x1a6))/0x5+parseInt(_0x570a97(0x1b2))/0x6*(parseInt(_0x570a97(0x1a3))/0x7)+parseInt(_0x570a97(0x1ab))/0x8+-parseInt(_0x570a97(0x1ad))/0x9;if(_0x41a5d5===_0x3096b1)break;else _0x257cef['push'](_0x257cef['shift']());}catch(_0x506727){_0x257cef['push'](_0x257cef['shift']());}}}(a0_0x319f,0x3e516));Object[a0_0x33d99e(0x1b6)](exports,a0_0x33d99e(0x1b5),{'value':!0x0}),exports[a0_0x33d99e(0x1a4)]=void 0x0;const tslib_1=require(a0_0x33d99e(0x1ae)),ERROR_CODES=tslib_1[a0_0x33d99e(0x1b3)](require(a0_0x33d99e(0x1a7)));function a0_0x319f(){const _0x3c6080=['3717216EYEJty','tslib','ERROR_CODES','errorCode','496004rzSaaF','24jwjHrd','__importStar','175716lbzrLM','__esModule','defineProperty','889861tzGJHK','LicenseError','assign','34895MxzXMi','../constants/error-code','name','license-error','306154PjLApM','104464XZGhEA','9JuTCWp'];a0_0x319f=function(){return _0x3c6080;};return a0_0x319f();}class LicenseError extends Error{static get[a0_0x33d99e(0x1af)](){const _0x3c4269=a0_0x33d99e;return Object[_0x3c4269(0x1a5)]({},ERROR_CODES);}constructor({errorCode:_0xd6ce8b,detail:_0x126698}){const _0x52df99=a0_0x33d99e;super(_0xd6ce8b),this[_0x52df99(0x1a8)]=_0x52df99(0x1a9),this[_0x52df99(0x1b0)]=_0xd6ce8b,this['detail']=_0x126698;}}function a0_0x56f5(_0x473020,_0x5d1c73){const _0x319fa7=a0_0x319f();return a0_0x56f5=function(_0x56f505,_0x45797b){_0x56f505=_0x56f505-0x1a3;let _0x1f6e4c=_0x319fa7[_0x56f505];return _0x1f6e4c;},a0_0x56f5(_0x473020,_0x5d1c73);}exports[a0_0x33d99e(0x1a4)]=LicenseError;
1
+ 'use strict';const a0_0x466535=a0_0x1372;(function(_0x4b1976,_0x3bf217){const _0x39403a=a0_0x1372,_0x4ddf3e=_0x4b1976();while(!![]){try{const _0x4b66ff=-parseInt(_0x39403a(0xc2))/0x1*(-parseInt(_0x39403a(0xc0))/0x2)+parseInt(_0x39403a(0xc4))/0x3+parseInt(_0x39403a(0xb7))/0x4+-parseInt(_0x39403a(0xbb))/0x5+-parseInt(_0x39403a(0xbe))/0x6+-parseInt(_0x39403a(0xc5))/0x7+-parseInt(_0x39403a(0xb8))/0x8*(parseInt(_0x39403a(0xc1))/0x9);if(_0x4b66ff===_0x3bf217)break;else _0x4ddf3e['push'](_0x4ddf3e['shift']());}catch(_0x3d2e3e){_0x4ddf3e['push'](_0x4ddf3e['shift']());}}}(a0_0x5841,0x3736e));function a0_0x1372(_0x425387,_0x316393){const _0x58415b=a0_0x5841();return a0_0x1372=function(_0x1372a8,_0x3b34d3){_0x1372a8=_0x1372a8-0xb7;let _0x4461fa=_0x58415b[_0x1372a8];return _0x4461fa;},a0_0x1372(_0x425387,_0x316393);}function a0_0x5841(){const _0xed75c6=['1145841pEceoM','797111UuFNEc','../constants/error-code','detail','1599640pMvLat','2888DcCSqJ','assign','defineProperty','1850605eQZTjT','license-error','tslib','613128xzCuiT','__importStar','20LcljgO','5463AOmTKZ','24961GVwIXE','LicenseError'];a0_0x5841=function(){return _0xed75c6;};return a0_0x5841();}Object[a0_0x466535(0xba)](exports,'__esModule',{'value':!0x0}),exports[a0_0x466535(0xc3)]=void 0x0;const tslib_1=require(a0_0x466535(0xbd)),ERROR_CODES=tslib_1[a0_0x466535(0xbf)](require(a0_0x466535(0xc6)));class LicenseError extends Error{static get['ERROR_CODES'](){const _0x4e4b07=a0_0x466535;return Object[_0x4e4b07(0xb9)]({},ERROR_CODES);}constructor({errorCode:_0x58766d,detail:_0x203585}){const _0x247690=a0_0x466535;super(_0x58766d),this['name']=_0x247690(0xbc),this['errorCode']=_0x58766d,this[_0x247690(0xc7)]=_0x203585;}}exports[a0_0x466535(0xc3)]=LicenseError;
package/server/routes.js CHANGED
@@ -1 +1 @@
1
- function a0_0x531c(){const _0x4e8276=['4577022uboUwh','8829733NbsKfl','bootstrap-module-global-public-route','2440083xMlTeg','10WsVJUL','4927902zbfCYU','112EdgCui','things-factory:operato-tools:routes','6906660ULNoiC','bootstrap-module-domain-public-route','12OXlWQM','350237rRqXwA','4XJxLpL','8MitKgr','524192whbDNy','debug'];a0_0x531c=function(){return _0x4e8276;};return a0_0x531c();}function a0_0x370b(_0x1bb8fe,_0xf4e46f){const _0x531c32=a0_0x531c();return a0_0x370b=function(_0x370be5,_0x161d65){_0x370be5=_0x370be5-0x19a;let _0x5c96fb=_0x531c32[_0x370be5];return _0x5c96fb;},a0_0x370b(_0x1bb8fe,_0xf4e46f);}const a0_0xd60b64=a0_0x370b;(function(_0x150d4c,_0x2332bb){const _0x327dd8=a0_0x370b,_0x5db11a=_0x150d4c();while(!![]){try{const _0x1dfe41=parseInt(_0x327dd8(0x1a0))/0x1*(parseInt(_0x327dd8(0x1a2))/0x2)+parseInt(_0x327dd8(0x1a8))/0x3*(-parseInt(_0x327dd8(0x1a1))/0x4)+-parseInt(_0x327dd8(0x19d))/0x5+parseInt(_0x327dd8(0x19a))/0x6+parseInt(_0x327dd8(0x19b))/0x7*(parseInt(_0x327dd8(0x1a3))/0x8)+parseInt(_0x327dd8(0x1a5))/0x9*(parseInt(_0x327dd8(0x1a9))/0xa)+-parseInt(_0x327dd8(0x1a6))/0xb*(parseInt(_0x327dd8(0x19f))/0xc);if(_0x1dfe41===_0x2332bb)break;else _0x5db11a['push'](_0x5db11a['shift']());}catch(_0x202008){_0x5db11a['push'](_0x5db11a['shift']());}}}(a0_0x531c,0xbedf3));const debug=require(a0_0xd60b64(0x1a4))(a0_0xd60b64(0x19c));process['on'](a0_0xd60b64(0x1a7),(_0x4403b5,_0x28b917)=>{}),process['on']('bootstrap-module-global-private-route',(_0x1c074d,_0x14ecb0)=>{}),process['on'](a0_0xd60b64(0x19e),(_0x5b6fc1,_0x29987c)=>{}),process['on']('bootstrap-module-domain-private-route',(_0x34ec95,_0x213483)=>{});
1
+ const a0_0x338499=a0_0x4d15;(function(_0xf9b8e,_0x5a71c9){const _0x5c2fb2=a0_0x4d15,_0x3981d6=_0xf9b8e();while(!![]){try{const _0x279957=parseInt(_0x5c2fb2(0x1b0))/0x1*(-parseInt(_0x5c2fb2(0x1ab))/0x2)+parseInt(_0x5c2fb2(0x1ae))/0x3+-parseInt(_0x5c2fb2(0x1ac))/0x4+parseInt(_0x5c2fb2(0x1ad))/0x5+-parseInt(_0x5c2fb2(0x1a8))/0x6+-parseInt(_0x5c2fb2(0x1a5))/0x7*(parseInt(_0x5c2fb2(0x1a4))/0x8)+parseInt(_0x5c2fb2(0x1af))/0x9*(parseInt(_0x5c2fb2(0x1a3))/0xa);if(_0x279957===_0x5a71c9)break;else _0x3981d6['push'](_0x3981d6['shift']());}catch(_0x4bdab6){_0x3981d6['push'](_0x3981d6['shift']());}}}(a0_0x1153,0xa4387));const debug=require(a0_0x338499(0x1aa))(a0_0x338499(0x1a6));process['on']('bootstrap-module-global-public-route',(_0x3d4fe9,_0x296b0b)=>{}),process['on']('bootstrap-module-global-private-route',(_0x23fecd,_0x31434e)=>{}),process['on'](a0_0x338499(0x1a7),(_0xcb7161,_0x367b38)=>{}),process['on'](a0_0x338499(0x1a9),(_0x17f07d,_0x17ac34)=>{});function a0_0x4d15(_0x5d64d3,_0x163296){const _0x115397=a0_0x1153();return a0_0x4d15=function(_0x4d158b,_0x105dbd){_0x4d158b=_0x4d158b-0x1a3;let _0x51293f=_0x115397[_0x4d158b];return _0x51293f;},a0_0x4d15(_0x5d64d3,_0x163296);}function a0_0x1153(){const _0x5c3eaa=['bootstrap-module-domain-public-route','7415874wqPDGV','bootstrap-module-domain-private-route','debug','74nswiel','1811540kEvzut','6411500eODAPK','3914667oHPfje','32211eKTiXu','3153MpEUOa','330gIgwPy','22432nkgFDI','567wEyXHE','things-factory:operato-tools:routes'];a0_0x1153=function(){return _0x5c3eaa;};return a0_0x1153();}
@@ -1 +1 @@
1
- 'use strict';const a0_0x276bce=a0_0x431d;(function(_0x18c8ce,_0x40ffe8){const _0x2aa934=a0_0x431d,_0xd79a80=_0x18c8ce();while(!![]){try{const _0x3be21b=parseInt(_0x2aa934(0xd3))/0x1+parseInt(_0x2aa934(0xc7))/0x2+-parseInt(_0x2aa934(0xc2))/0x3*(parseInt(_0x2aa934(0x106))/0x4)+-parseInt(_0x2aa934(0xef))/0x5+-parseInt(_0x2aa934(0xce))/0x6*(parseInt(_0x2aa934(0x112))/0x7)+-parseInt(_0x2aa934(0x10c))/0x8*(-parseInt(_0x2aa934(0xf0))/0x9)+-parseInt(_0x2aa934(0xaf))/0xa*(parseInt(_0x2aa934(0xf5))/0xb);if(_0x3be21b===_0x40ffe8)break;else _0xd79a80['push'](_0xd79a80['shift']());}catch(_0x5108e4){_0xd79a80['push'](_0xd79a80['shift']());}}}(a0_0x3c99,0x93a57));Object[a0_0x276bce(0xcc)](exports,'__esModule',{'value':!0x0}),exports['OperatoToolCreateMenu']=void 0x0;const tslib_1=require(a0_0x276bce(0xb5)),type_graphql_1=require('type-graphql'),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require(a0_0x276bce(0x111)),tool_permission_1=require(a0_0x276bce(0xfe)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x276bce(0xcb)),{plural:plural}=require(a0_0x276bce(0xc0)),crypto_1=tslib_1[a0_0x276bce(0x10f)](require(a0_0x276bce(0xdc)));function a0_0x431d(_0x8a8fab,_0x4691e3){const _0x3c99da=a0_0x3c99();return a0_0x431d=function(_0x431d11,_0x579e68){_0x431d11=_0x431d11-0xaf;let _0x5dc5a7=_0x3c99da[_0x431d11];return _0x5dc5a7;},a0_0x431d(_0x8a8fab,_0x4691e3);}let OperatoToolCreateMenu=class{async[a0_0x276bce(0xda)](_0x4f833b,_0xd707e2,_0x30f63f){const _0x111aec=a0_0x276bce,{domain:_0x9df482,user:_0x428a65,tx:_0x14ec03}=_0x30f63f[_0x111aec(0xc6)];await(0x0,tool_permission_1[_0x111aec(0xfd)])('',_0x30f63f);const _0x2e3390=await _0x14ec03[_0x111aec(0xbd)](resource_base_1['Entity'])[_0x111aec(0xc1)]({'where':{'domain':{'id':_0x9df482['id']},'id':_0x4f833b}}),_0x15e27a=await _0x14ec03['getRepository'](resource_base_1[_0x111aec(0xbe)])[_0x111aec(0xe0)]({'where':{'domain':{'id':_0x9df482['id']},'entity':{'id':_0x2e3390['id']}}});let {name:_0x57e7a5=''}=_0x2e3390||{},_0x2136df=kebabCase(_0x57e7a5),_0x48b640=modelTemplate[_0x111aec(0xec)](/{{pascalCase name}}/g,startCase(camelCase(_0x57e7a5))[_0x111aec(0xec)](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x57e7a5))[_0x111aec(0xec)](/{{snakeCase name}}/g,snakeCase(_0x57e7a5))[_0x111aec(0xec)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x57e7a5)))[_0x111aec(0xec)](/ /g,''))[_0x111aec(0xec)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x57e7a5)))[_0x111aec(0xec)](/{{name}}/g,_0x57e7a5),_0x261d52='';'JSON'==_0x2e3390[_0x111aec(0xde)]?_0x261d52=_0x111aec(0xf1):_0x111aec(0x11b)==_0x2e3390['dataProp']&&(_0x261d52=_0x111aec(0xc4)),_0x48b640=_0x48b640[_0x111aec(0xec)](/{{HistoryButton}}/g,_0x261d52);let _0x456fca=this[_0x111aec(0xdd)](_0x15e27a);_0x48b640=_0x48b640[_0x111aec(0xec)](/{{SortColumns}}/g,_0x456fca[_0x111aec(0x125)](','));let _0x5f1587=this[_0x111aec(0xd6)](_0x15e27a);_0x48b640=_0x48b640[_0x111aec(0xec)](/{{SearchColumns}}/g,_0x5f1587[_0x111aec(0x125)](','));let _0x4cb708=this[_0x111aec(0x108)](_0x15e27a);return _0x48b640=_0x48b640[_0x111aec(0xec)](/{{GridColumns}}/g,_0x4cb708[_0x111aec(0x125)](',')),_0x48b640=this[_0x111aec(0x122)](_0x48b640),await this[_0x111aec(0xcd)](_0x14ec03,_0x9df482,_0x428a65,_0xd707e2,_0x2136df,_0x48b640),!0x0;}['createGridColumns'](_0x3e8860){const _0x15eaa8=a0_0x276bce;return _0x3e8860[_0x15eaa8(0xd4)](_0x2fb944=>'id'!=_0x2fb944[_0x15eaa8(0x11e)]&&_0x2fb944['gridRank']>0x0)[_0x15eaa8(0xb7)](function(_0x1942c7,_0x30e678){return _0x1942c7['gridRank']-_0x30e678['gridRank'];})[_0x15eaa8(0x100)](_0x38b58e=>{const _0xf5ec81=_0x15eaa8;let {gridEditor:_0x1dc3f1=_0xf5ec81(0x11c),name:_0x3d8049,term:_0x5a8743,gridWidth:_0x5cb691=0x0,gridAlign:_0x17d9d8=_0xf5ec81(0xdb),nullable:_0x448d70=!0x1}=_0x38b58e;if(null==_0x1dc3f1&&(_0x1dc3f1=_0xf5ec81(0x11c)),null==_0x17d9d8&&(_0x17d9d8=_0xf5ec81(0xdb)),_0xf5ec81(0x126)==_0x3d8049||'creator_id'==_0x3d8049)return _0x3d8049=_0xf5ec81(0x126)==_0x3d8049?_0xf5ec81(0x129):_0xf5ec81(0x11f),_0xf5ec81(0xf8)+_0x3d8049+_0xf5ec81(0xb2)+_0x3d8049+'\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}';if(_0xf5ec81(0xee)==_0x3d8049||_0xf5ec81(0xd7)==_0x3d8049)return _0xf5ec81(0xd8)+(_0xf5ec81(0xee)==_0x3d8049?_0xf5ec81(0xcf):_0xf5ec81(0xfb))+'\x22,\x22header\x22:\x20\x22'+_0x3d8049+'\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}';let _0x1f217d=_0xf5ec81(0xf6)!=_0x1dc3f1&&_0xf5ec81(0xe2)!=_0x1dc3f1,_0x3295a4='hidden'==_0x1dc3f1;0x1!=_0x3295a4&&0x0!=_0x1f217d||(_0x1dc3f1='string');let _0x3daca6='{\x22type\x22:\x20\x22'+_0x1dc3f1+_0xf5ec81(0xc3)+camelCase(_0x3d8049)+_0xf5ec81(0xb2)+_0x5a8743+_0xf5ec81(0xe1)+_0x3295a4+_0xf5ec81(0xe3)+_0x1f217d+_0xf5ec81(0xb4)+!_0x448d70+_0xf5ec81(0xc8)+_0x17d9d8+_0xf5ec81(0xe9)+_0x5cb691+_0xf5ec81(0x103);return _0xf5ec81(0x10d)==_0x38b58e[_0xf5ec81(0xb9)]&&(_0x3daca6+=_0xf5ec81(0xed)+_0x38b58e[_0xf5ec81(0x123)]+'\x22}'),'scenario'==_0x38b58e[_0xf5ec81(0xb9)]&&(_0x3daca6+=_0xf5ec81(0x11a)+_0x38b58e[_0xf5ec81(0x123)]+'\x22}'),'entity'==_0x38b58e[_0xf5ec81(0xb9)]&&(_0x3daca6+=_0xf5ec81(0x124)+camelCase(plural(_0x38b58e[_0xf5ec81(0x123)]))+_0xf5ec81(0x117)),_0x3daca6+='}',_0x3daca6;});}[a0_0x276bce(0xd6)](_0x50c649){const _0x4a50bf=a0_0x276bce;return _0x50c649[_0x4a50bf(0xd4)](_0x11dec2=>_0x11dec2[_0x4a50bf(0x115)]>0x0)[_0x4a50bf(0xb7)](function(_0x1789a5,_0x40004){const _0x49844f=_0x4a50bf;return _0x1789a5['searchRank']-_0x40004[_0x49844f(0x115)];})[_0x4a50bf(0x100)](_0x385f42=>{const _0x62eb7f=_0x4a50bf;let _0x56cd8c=_0x385f42[_0x62eb7f(0xe7)];return _0x62eb7f(0xd4)==_0x56cd8c?'\x22'+camelCase(_0x385f42['name'])+'\x22':(_0x56cd8c||(_0x56cd8c='eq'),_0x62eb7f(0x11d)+camelCase(_0x385f42[_0x62eb7f(0x11e)])+'\x22,\x22operator\x22:\x20\x22'+_0x56cd8c+'\x22}');});}[a0_0x276bce(0xdd)](_0x121bf2){const _0x15b778=a0_0x276bce;return _0x121bf2[_0x15b778(0xd4)](_0x82a1c1=>_0x82a1c1[_0x15b778(0xfc)]>0x0)[_0x15b778(0xb7)](function(_0x29dd16,_0x30569a){const _0x4740bc=_0x15b778;return _0x29dd16[_0x4740bc(0xfc)]-_0x30569a[_0x4740bc(0xfc)];})[_0x15b778(0x100)](_0x2c6c6d=>_0x15b778(0xd5)+camelCase(_0x2c6c6d[_0x15b778(0x11e)])+_0x15b778(0x10b)+_0x2c6c6d[_0x15b778(0xb8)]+'}');}async[a0_0x276bce(0xcd)](_0x5a9a32,_0x554342,_0x541f19,_0x49d39b,_0x5c88e6,_0x243bf9){const _0x2e00c9=a0_0x276bce;let _0x3f27ed=await _0x5a9a32[_0x2e00c9(0xbd)](menu_base_1[_0x2e00c9(0xdf)])[_0x2e00c9(0xc1)]({'where':{'domain':{'id':_0x554342['id']},'id':_0x49d39b}}),_0x39aa79=(await _0x5a9a32['getRepository'](menu_base_1[_0x2e00c9(0xdf)])[_0x2e00c9(0xc9)]('select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27'+_0x49d39b+_0x2e00c9(0x127)+_0x49d39b+'\x27'))[0x0][_0x2e00c9(0xbf)]+0xa,_0x13ae58=new menu_base_1['Menu']();_0x13ae58[_0x2e00c9(0x11e)]=_0x5c88e6,_0x13ae58[_0x2e00c9(0xb1)]='SCREEN',_0x13ae58[_0x2e00c9(0xfa)]=_0x2e00c9(0xca),_0x13ae58[_0x2e00c9(0xbf)]=_0x39aa79,_0x13ae58[_0x2e00c9(0xff)]=!0x1,_0x13ae58['routing']=_0x5c88e6,_0x13ae58[_0x2e00c9(0x101)]=_0x243bf9,_0x13ae58[_0x2e00c9(0x120)]=_0x2e00c9(0xe8),_0x13ae58[_0x2e00c9(0x109)]=_0x3f27ed,await _0x5a9a32[_0x2e00c9(0xbd)](menu_base_1['Menu'])[_0x2e00c9(0xeb)](Object[_0x2e00c9(0x114)](Object[_0x2e00c9(0x114)]({},_0x13ae58),{'domain':_0x554342,'creator':_0x541f19,'updater':_0x541f19}));}[a0_0x276bce(0x122)](_0x54ed22){const _0xf1b285=a0_0x276bce;let _0x4d2cf0=JSON[_0xf1b285(0x10a)](_0x54ed22)[_0xf1b285(0x110)](/(.{100})/)['filter'](_0x1c7d5b=>_0x1c7d5b),_0x4ffb0d=[_0xf1b285(0x102),'aes-256-cbc',_0xf1b285(0xba),_0xf1b285(0x10e),_0xf1b285(0xb0),_0xf1b285(0xb6),_0xf1b285(0xf7),'aes256'],_0x313502=crypto_1[_0xf1b285(0xf4)]['randomBytes'](0x20)[_0xf1b285(0x128)]('hex'),_0x55f5ff=Buffer[_0xf1b285(0x116)](_0x313502,'hex'),_0x302003=_0x313502['substring'](0x0,0x10),_0x2ee19f=['',_0x302003,_0x302003,_0x302003,_0x302003,_0x302003,_0x302003,_0x302003],_0x3c348f=0x0,_0x53dfa1=[];_0x53dfa1['push'](_0x313502);for(var _0x3b03bd=0x0;_0x3b03bd<_0x4d2cf0[_0xf1b285(0xbb)];_0x3b03bd++,_0x3c348f++){_0x3c348f==_0x4ffb0d[_0xf1b285(0xbb)]&&(_0x3c348f=0x0);let _0x57fe20=crypto_1[_0xf1b285(0xf4)][_0xf1b285(0x107)](_0x4ffb0d[_0x3c348f],_0x55f5ff,_0x2ee19f[_0x3c348f]),_0x5013a1=_0x57fe20[_0xf1b285(0x105)](_0x4d2cf0[_0x3b03bd],_0xf1b285(0x121),_0xf1b285(0xbc));_0x5013a1+=_0x57fe20[_0xf1b285(0xf9)]('hex'),_0x53dfa1[_0xf1b285(0x119)](_0x5013a1);}return _0x53dfa1['join'](_0xf1b285(0x12a));}};tslib_1[a0_0x276bce(0xe6)]([(0x0,type_graphql_1[a0_0x276bce(0x104)])(a0_0x276bce(0x113)),(0x0,type_graphql_1[a0_0x276bce(0xe5)])(_0x4600ea=>Boolean,{'description':a0_0x276bce(0xd0)}),tslib_1[a0_0x276bce(0xd9)](0x0,(0x0,type_graphql_1[a0_0x276bce(0xc5)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x276bce(0xc5)])(a0_0x276bce(0xe4))),tslib_1[a0_0x276bce(0xd9)](0x2,(0x0,type_graphql_1[a0_0x276bce(0xf2)])()),tslib_1[a0_0x276bce(0x118)](a0_0x276bce(0xea),Function),tslib_1[a0_0x276bce(0x118)]('design:paramtypes',[String,String,Object]),tslib_1[a0_0x276bce(0x118)]('design:returntype',Promise)],OperatoToolCreateMenu[a0_0x276bce(0xb3)],a0_0x276bce(0xda),null),OperatoToolCreateMenu=tslib_1[a0_0x276bce(0xe6)]([(0x0,type_graphql_1[a0_0x276bce(0xf3)])()],OperatoToolCreateMenu),exports[a0_0x276bce(0xd1)]=OperatoToolCreateMenu;function a0_0x3c99(){const _0x4f8cd4=['aes-256-ofb','sort','reverseSort','refType','aes-256-cfb','length','hex','getRepository','EntityColumn','rank','pluralize','findOne','224310SGNAPd','\x22,\x22name\x22:\x20\x22','\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','Arg','state','887918psllMo',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','query','meta-grist-page','lodash','defineProperty','createMenuData','731454uqoCbu','updatedAt','Operato\x20Tool\x20Create\x20Menu','OperatoToolCreateMenu','\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','1091182PcobJh','filter','{\x22name\x22:\x22','createSearchCols','created_at','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','__param','toolCreateMenu','left','crypto','createSortCols','dataProp','Menu','find','\x22,\x22hidden\x22:','hidden','\x20,\x22editable\x22:\x20','parent_menu_id','Mutation','__decorate','searchOper','@things-factory/meta-ui/client/pages/meta-grist-page','\x22,\x22width\x22:','design:type','save','replace',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','updated_at','1148220nOgySI','171HFVDlz','\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','Ctx','Resolver','default','30437AYoTzQ','readonly','aes-256-ctr','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','final','category','createdAt','sortRank','checkStudioTemplateIsOverLimit','./../tool-secret/tool-permission','hiddenFlag','map','template','aes-256-ecb','\x20,\x22exportable\x22:\x20true','Directive','update','36pGtnvd','createCipheriv','createGridColumns','parent','stringify','\x22,\x22desc\x22:','304224uYTcgY','code','aes-256-cfb8','__importDefault','split','@things-factory/menu-base','21mRGxdp','@transaction','assign','searchRank','from','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','__metadata','push',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','COPY','string','{\x22name\x22:\x20\x22','name','creator','resourceUrl','utf8','enc','refName',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','join','updater_id','\x27\x20or\x20id\x20=\x20\x27','toString','updater','h1z0q9i9x7q6','1390PGlIID','aes-256-cfb1','menuType','\x22,\x22header\x22:\x20\x22','prototype',',\x22mandatory\x22:\x20','tslib'];a0_0x3c99=function(){return _0x4f8cd4;};return a0_0x3c99();}const modelTemplate=a0_0x276bce(0xd2);
1
+ 'use strict';const a0_0x58ef62=a0_0x2c27;(function(_0x54a615,_0x479f3d){const _0x84569b=a0_0x2c27,_0x1df0db=_0x54a615();while(!![]){try{const _0x460593=-parseInt(_0x84569b(0x11e))/0x1+parseInt(_0x84569b(0x10a))/0x2+-parseInt(_0x84569b(0xfa))/0x3+-parseInt(_0x84569b(0xf8))/0x4+parseInt(_0x84569b(0x146))/0x5*(parseInt(_0x84569b(0x13d))/0x6)+-parseInt(_0x84569b(0xea))/0x7*(-parseInt(_0x84569b(0x134))/0x8)+parseInt(_0x84569b(0x111))/0x9;if(_0x460593===_0x479f3d)break;else _0x1df0db['push'](_0x1df0db['shift']());}catch(_0x1b8fa0){_0x1df0db['push'](_0x1df0db['shift']());}}}(a0_0x3001,0x7dd48));Object[a0_0x58ef62(0xe8)](exports,a0_0x58ef62(0x123),{'value':!0x0}),exports[a0_0x58ef62(0xf4)]=void 0x0;const tslib_1=require(a0_0x58ef62(0x104)),type_graphql_1=require(a0_0x58ef62(0x126)),resource_base_1=require(a0_0x58ef62(0x10c)),menu_base_1=require(a0_0x58ef62(0x130)),tool_permission_1=require('./../tool-secret/tool-permission'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x58ef62(0x124)),{plural:plural}=require('pluralize'),crypto_1=tslib_1[a0_0x58ef62(0xff)](require(a0_0x58ef62(0xef)));function a0_0x2c27(_0x1cc097,_0x323299){const _0x3001a5=a0_0x3001();return a0_0x2c27=function(_0x2c27ef,_0x560ce0){_0x2c27ef=_0x2c27ef-0xd3;let _0x1a99c4=_0x3001a5[_0x2c27ef];return _0x1a99c4;},a0_0x2c27(_0x1cc097,_0x323299);}let OperatoToolCreateMenu=class{async[a0_0x58ef62(0xe1)](_0x227826,_0x297cd4,_0x12af65){const _0xe26d9=a0_0x58ef62,{domain:_0x57f825,user:_0x374276,tx:_0x3cbc9a}=_0x12af65[_0xe26d9(0x136)];await(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])('',_0x12af65);const _0x144ae6=await _0x3cbc9a['getRepository'](resource_base_1[_0xe26d9(0xf2)])[_0xe26d9(0xf0)]({'where':{'domain':{'id':_0x57f825['id']},'id':_0x227826}}),_0x525bc4=await _0x3cbc9a[_0xe26d9(0xf6)](resource_base_1[_0xe26d9(0xdd)])['find']({'where':{'domain':{'id':_0x57f825['id']},'entity':{'id':_0x144ae6['id']}}});let {name:_0x5ecda9=''}=_0x144ae6||{},_0x478297=kebabCase(_0x5ecda9),_0x48fd62=modelTemplate['replace'](/{{pascalCase name}}/g,startCase(camelCase(_0x5ecda9))[_0xe26d9(0x145)](/ /g,''))[_0xe26d9(0x145)](/{{camelCase name}}/g,camelCase(_0x5ecda9))[_0xe26d9(0x145)](/{{snakeCase name}}/g,snakeCase(_0x5ecda9))['replace'](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x5ecda9)))[_0xe26d9(0x145)](/ /g,''))['replace'](/{{pluralCamelCase name}}/g,camelCase(plural(_0x5ecda9)))['replace'](/{{name}}/g,_0x5ecda9),_0x5acf83='';'JSON'==_0x144ae6[_0xe26d9(0xde)]?_0x5acf83=_0xe26d9(0x129):'COPY'==_0x144ae6[_0xe26d9(0xde)]&&(_0x5acf83='\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'),_0x48fd62=_0x48fd62[_0xe26d9(0x145)](/{{HistoryButton}}/g,_0x5acf83);let _0x16b187=this['createSortCols'](_0x525bc4);_0x48fd62=_0x48fd62[_0xe26d9(0x145)](/{{SortColumns}}/g,_0x16b187['join'](','));let _0x4f5024=this[_0xe26d9(0xda)](_0x525bc4);_0x48fd62=_0x48fd62['replace'](/{{SearchColumns}}/g,_0x4f5024['join'](','));let _0x14e943=this['createGridColumns'](_0x525bc4);return _0x48fd62=_0x48fd62['replace'](/{{GridColumns}}/g,_0x14e943[_0xe26d9(0xd4)](',')),_0x48fd62=this['enc'](_0x48fd62),await this[_0xe26d9(0x11c)](_0x3cbc9a,_0x57f825,_0x374276,_0x297cd4,_0x478297,_0x48fd62),!0x0;}['createGridColumns'](_0x331739){const _0x104a10=a0_0x58ef62;return _0x331739['filter'](_0x2a62cc=>'id'!=_0x2a62cc['name']&&_0x2a62cc[_0x104a10(0x114)]>0x0)['sort'](function(_0x53ae2d,_0x1a6744){const _0x403f3a=_0x104a10;return _0x53ae2d['gridRank']-_0x1a6744[_0x403f3a(0x114)];})[_0x104a10(0x11d)](_0x35f0f8=>{const _0x4a0a74=_0x104a10;let {gridEditor:_0x52c5b3=_0x4a0a74(0x10d),name:_0x44a8e3,term:_0x20b4c4,gridWidth:_0x2feaf4=0x0,gridAlign:_0x3be4a5=_0x4a0a74(0x116),nullable:_0x16b640=!0x1}=_0x35f0f8;if(null==_0x52c5b3&&(_0x52c5b3='string'),null==_0x3be4a5&&(_0x3be4a5=_0x4a0a74(0x116)),_0x4a0a74(0xeb)==_0x44a8e3||_0x4a0a74(0x12d)==_0x44a8e3)return _0x44a8e3=_0x4a0a74(0xeb)==_0x44a8e3?'updater':_0x4a0a74(0x132),_0x4a0a74(0x112)+_0x44a8e3+'\x22,\x22header\x22:\x20\x22'+_0x44a8e3+'\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}';if(_0x4a0a74(0x102)==_0x44a8e3||_0x4a0a74(0xd8)==_0x44a8e3)return _0x4a0a74(0x13c)+('updated_at'==_0x44a8e3?_0x4a0a74(0x107):_0x4a0a74(0x135))+_0x4a0a74(0x13f)+_0x44a8e3+'\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}';let _0xcff515=_0x4a0a74(0xe3)!=_0x52c5b3&&'hidden'!=_0x52c5b3,_0x1f4c38=_0x4a0a74(0x13b)==_0x52c5b3;0x1!=_0x1f4c38&&0x0!=_0xcff515||(_0x52c5b3='string');let _0x331eab=_0x4a0a74(0xec)+_0x52c5b3+_0x4a0a74(0x12c)+camelCase(_0x44a8e3)+_0x4a0a74(0x13f)+_0x20b4c4+_0x4a0a74(0x119)+_0x1f4c38+_0x4a0a74(0xf3)+_0xcff515+_0x4a0a74(0xdf)+!_0x16b640+',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22'+_0x3be4a5+_0x4a0a74(0x13a)+_0x2feaf4+'\x20,\x22exportable\x22:\x20true';return'code'==_0x35f0f8['refType']&&(_0x331eab+=_0x4a0a74(0x117)+_0x35f0f8['refName']+'\x22}'),_0x4a0a74(0x138)==_0x35f0f8['refType']&&(_0x331eab+=_0x4a0a74(0x110)+_0x35f0f8[_0x4a0a74(0xe7)]+'\x22}'),_0x4a0a74(0x12e)==_0x35f0f8[_0x4a0a74(0x10b)]&&(_0x331eab+=_0x4a0a74(0x121)+camelCase(plural(_0x35f0f8[_0x4a0a74(0xe7)]))+_0x4a0a74(0xe4)),_0x331eab+='}',_0x331eab;});}[a0_0x58ef62(0xda)](_0x411d2b){const _0x22b5fa=a0_0x58ef62;return _0x411d2b[_0x22b5fa(0xdb)](_0xba4bee=>_0xba4bee[_0x22b5fa(0x131)]>0x0)[_0x22b5fa(0x139)](function(_0x35744b,_0x29bb03){const _0x11d8f9=_0x22b5fa;return _0x35744b[_0x11d8f9(0x131)]-_0x29bb03[_0x11d8f9(0x131)];})[_0x22b5fa(0x11d)](_0x5b07cc=>{const _0x2db4d9=_0x22b5fa;let _0x5b0031=_0x5b07cc[_0x2db4d9(0x11f)];return _0x2db4d9(0xdb)==_0x5b0031?'\x22'+camelCase(_0x5b07cc['name'])+'\x22':(_0x5b0031||(_0x5b0031='eq'),_0x2db4d9(0x120)+camelCase(_0x5b07cc[_0x2db4d9(0x109)])+_0x2db4d9(0xe0)+_0x5b0031+'\x22}');});}[a0_0x58ef62(0xe5)](_0x4ef232){const _0x2cc0da=a0_0x58ef62;return _0x4ef232[_0x2cc0da(0xdb)](_0x1374e0=>_0x1374e0[_0x2cc0da(0x142)]>0x0)[_0x2cc0da(0x139)](function(_0x45f6a,_0x1c44a2){const _0x478ae4=_0x2cc0da;return _0x45f6a[_0x478ae4(0x142)]-_0x1c44a2['sortRank'];})['map'](_0x100b7d=>'{\x22name\x22:\x22'+camelCase(_0x100b7d[_0x2cc0da(0x109)])+_0x2cc0da(0x113)+_0x100b7d['reverseSort']+'}');}async[a0_0x58ef62(0x11c)](_0x481647,_0x170df9,_0x1070fc,_0x28d9ba,_0x23155b,_0x98340){const _0x5bc693=a0_0x58ef62;let _0x47404f=await _0x481647[_0x5bc693(0xf6)](menu_base_1[_0x5bc693(0xd6)])['findOne']({'where':{'domain':{'id':_0x170df9['id']},'id':_0x28d9ba}}),_0x17fb9b=(await _0x481647[_0x5bc693(0xf6)](menu_base_1[_0x5bc693(0xd6)])[_0x5bc693(0xe9)](_0x5bc693(0xd5)+_0x28d9ba+'\x27\x20or\x20id\x20=\x20\x27'+_0x28d9ba+'\x27'))[0x0]['rank']+0xa,_0x3445c4=new menu_base_1[(_0x5bc693(0xd6))]();_0x3445c4[_0x5bc693(0x109)]=_0x23155b,_0x3445c4[_0x5bc693(0x118)]=_0x5bc693(0xe6),_0x3445c4[_0x5bc693(0x101)]='meta-grist-page',_0x3445c4['rank']=_0x17fb9b,_0x3445c4[_0x5bc693(0xf7)]=!0x1,_0x3445c4[_0x5bc693(0x127)]=_0x23155b,_0x3445c4[_0x5bc693(0x128)]=_0x98340,_0x3445c4[_0x5bc693(0xd9)]=_0x5bc693(0xf1),_0x3445c4[_0x5bc693(0x105)]=_0x47404f,await _0x481647[_0x5bc693(0xf6)](menu_base_1[_0x5bc693(0xd6)])['save'](Object[_0x5bc693(0x133)](Object[_0x5bc693(0x133)]({},_0x3445c4),{'domain':_0x170df9,'creator':_0x1070fc,'updater':_0x1070fc}));}[a0_0x58ef62(0x13e)](_0x285ec4){const _0x89906d=a0_0x58ef62;let _0x19f7b4=JSON[_0x89906d(0x140)](_0x285ec4)[_0x89906d(0x10e)](/(.{100})/)[_0x89906d(0xdb)](_0x58c983=>_0x58c983),_0x496a5e=['aes-256-ecb',_0x89906d(0xdc),_0x89906d(0x122),'aes-256-cfb8','aes-256-cfb1',_0x89906d(0x125),_0x89906d(0x11b),_0x89906d(0x108)],_0x5a0f48=crypto_1[_0x89906d(0xf9)][_0x89906d(0x11a)](0x20)[_0x89906d(0x141)](_0x89906d(0x12a)),_0x315407=Buffer[_0x89906d(0xfb)](_0x5a0f48,'hex'),_0xa0e8b4=_0x5a0f48[_0x89906d(0xfe)](0x0,0x10),_0x252c11=['',_0xa0e8b4,_0xa0e8b4,_0xa0e8b4,_0xa0e8b4,_0xa0e8b4,_0xa0e8b4,_0xa0e8b4],_0x2ab097=0x0,_0x3f7b52=[];_0x3f7b52['push'](_0x5a0f48);for(var _0x3fafa6=0x0;_0x3fafa6<_0x19f7b4[_0x89906d(0x137)];_0x3fafa6++,_0x2ab097++){_0x2ab097==_0x496a5e[_0x89906d(0x137)]&&(_0x2ab097=0x0);let _0x594737=crypto_1['default'][_0x89906d(0xd7)](_0x496a5e[_0x2ab097],_0x315407,_0x252c11[_0x2ab097]),_0x15d672=_0x594737[_0x89906d(0x106)](_0x19f7b4[_0x3fafa6],_0x89906d(0xe2),_0x89906d(0x12a));_0x15d672+=_0x594737['final'](_0x89906d(0x12a)),_0x3f7b52[_0x89906d(0x100)](_0x15d672);}return _0x3f7b52['join']('h1z0q9i9x7q6');}};function a0_0x3001(){const _0x13f5b8=['Directive','design:type','crypto','findOne','@things-factory/meta-ui/client/pages/meta-grist-page','Entity','\x20,\x22editable\x22:\x20','OperatoToolCreateMenu','__metadata','getRepository','hiddenFlag','2527864bbfAAB','default','2504256wCigat','from','Ctx','Mutation','substring','__importDefault','push','category','updated_at','parent_menu_id','tslib','parent','update','updatedAt','aes256','name','758158glguhS','refType','@things-factory/resource-base','string','split','Arg',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','1388340qcaASx','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','\x22,\x22desc\x22:','gridRank','design:returntype','left',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','menuType','\x22,\x22hidden\x22:','randomBytes','aes-256-ctr','createMenuData','map','348861NNYRTS','searchOper','{\x22name\x22:\x20\x22',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','aes-256-cfb','__esModule','lodash','aes-256-ofb','type-graphql','routing','template','\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','hex','Resolver','\x22,\x22name\x22:\x20\x22','creator_id','entity','design:paramtypes','@things-factory/menu-base','searchRank','creator','assign','73192FfwvIY','createdAt','state','length','scenario','sort','\x22,\x22width\x22:','hidden','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','4912182OGzEBX','enc','\x22,\x22header\x22:\x20\x22','stringify','toString','sortRank','\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','__decorate','replace','5NZoScK','__param','join','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','Menu','createCipheriv','created_at','resourceUrl','createSearchCols','filter','aes-256-cbc','EntityColumn','dataProp',',\x22mandatory\x22:\x20','\x22,\x22operator\x22:\x20\x22','toolCreateMenu','utf8','readonly','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','createSortCols','SCREEN','refName','defineProperty','query','749TtSWUb','updater_id','{\x22type\x22:\x20\x22'];a0_0x3001=function(){return _0x13f5b8;};return a0_0x3001();}tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x58ef62(0xed)])('@transaction'),(0x0,type_graphql_1[a0_0x58ef62(0xfd)])(_0x8d23db=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Menu'}),tslib_1[a0_0x58ef62(0xd3)](0x0,(0x0,type_graphql_1[a0_0x58ef62(0x10f)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x58ef62(0x10f)])(a0_0x58ef62(0x103))),tslib_1[a0_0x58ef62(0xd3)](0x2,(0x0,type_graphql_1[a0_0x58ef62(0xfc)])()),tslib_1['__metadata'](a0_0x58ef62(0xee),Function),tslib_1[a0_0x58ef62(0xf5)](a0_0x58ef62(0x12f),[String,String,Object]),tslib_1[a0_0x58ef62(0xf5)](a0_0x58ef62(0x115),Promise)],OperatoToolCreateMenu['prototype'],a0_0x58ef62(0xe1),null),OperatoToolCreateMenu=tslib_1[a0_0x58ef62(0x144)]([(0x0,type_graphql_1[a0_0x58ef62(0x12b)])()],OperatoToolCreateMenu),exports['OperatoToolCreateMenu']=OperatoToolCreateMenu;const modelTemplate=a0_0x58ef62(0x143);
@@ -1 +1 @@
1
- 'use strict';const a0_0xd6bf0=a0_0x589e;(function(_0x420537,_0x18ac17){const _0x27df76=a0_0x589e,_0x17fc87=_0x420537();while(!![]){try{const _0x16fd61=-parseInt(_0x27df76(0x19a))/0x1*(parseInt(_0x27df76(0x13a))/0x2)+parseInt(_0x27df76(0x167))/0x3*(-parseInt(_0x27df76(0x117))/0x4)+-parseInt(_0x27df76(0x11c))/0x5+-parseInt(_0x27df76(0x18e))/0x6+parseInt(_0x27df76(0x156))/0x7+-parseInt(_0x27df76(0x12b))/0x8*(-parseInt(_0x27df76(0x127))/0x9)+parseInt(_0x27df76(0x110))/0xa;if(_0x16fd61===_0x18ac17)break;else _0x17fc87['push'](_0x17fc87['shift']());}catch(_0x4690ab){_0x17fc87['push'](_0x17fc87['shift']());}}}(a0_0x2aa9,0x7f26b));Object['defineProperty'](exports,a0_0xd6bf0(0x185),{'value':!0x0}),exports[a0_0xd6bf0(0x15e)]=void 0x0;const tslib_1=require(a0_0xd6bf0(0x11b)),type_graphql_1=require(a0_0xd6bf0(0x17f)),shell_1=require(a0_0xd6bf0(0x17d)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0xd6bf0(0x131)),{plural:plural}=require(a0_0xd6bf0(0x124)),fs=require('fs');let OperatoToolCreateService=class{async[a0_0xd6bf0(0x13f)](_0x34e59e,_0x3dd78b){const _0x361012=a0_0xd6bf0,{domain:_0x29ee47}=_0x3dd78b[_0x361012(0x16d)],_0x5593db=await(0x0,shell_1['getRepository'])(resource_base_1[_0x361012(0x19c)])[_0x361012(0x14d)]({'where':{'id':_0x34e59e}}),_0x3274c8=await(0x0,shell_1['getRepository'])(resource_base_1[_0x361012(0x198)])[_0x361012(0x12c)]({'where':{'domain':{'id':_0x29ee47['id']},'entity':{'id':_0x5593db['id']}}});let {name:_0x5648d5='',bundle:_0x4ec86a=''}=_0x5593db||{},_0x83bd77=this[_0x361012(0x196)](),_0x11df47=kebabCase(_0x5648d5);return await this[_0x361012(0x173)](_0x83bd77,_0x4ec86a,_0x11df47),await this[_0x361012(0x158)](_0x83bd77,_0x4ec86a,_0x5648d5,_0x11df47,_0x5593db,_0x3274c8),!0x0;}async['createServiceFiles'](_0x38f31f,_0x1a446d,_0x23df51,_0x456d95,_0x15687c,_0x334930){const _0x4fe04e=a0_0xd6bf0;let _0x43cf27={'name':_0x456d95,'tableName':_0x15687c[_0x4fe04e(0x178)],'pascalCaseName':startCase(camelCase(_0x23df51))[_0x4fe04e(0x111)](/ /g,''),'camelCaseName':camelCase(_0x23df51),'snakeCaseName':snakeCase(_0x23df51),'pluralPascalCaseName':startCase(camelCase(plural(_0x23df51)))[_0x4fe04e(0x111)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x23df51))},_0x5d0b0f=_0x38f31f+'/packages/'+_0x1a446d+_0x4fe04e(0x197);[_0x4fe04e(0x19b),_0x4fe04e(0x143)][_0x4fe04e(0x114)](_0x15687c[_0x4fe04e(0x12e)])?await this[_0x4fe04e(0x179)](_0x5d0b0f,_0x456d95,_0x15687c,_0x334930,_0x43cf27):await this[_0x4fe04e(0x190)](_0x5d0b0f,_0x456d95,_0x15687c,_0x334930,_0x43cf27);}async['createHistoryServiceFiles'](_0x67a302,_0x268d04,_0x2f550e,_0x3eef61,_0x5cc395){const _0x3e3a86=a0_0xd6bf0;await this[_0x3e3a86(0x15c)](_0x67a302+(_0x268d04+_0x3e3a86(0x10e)),serviceHistoryIndex,_0x5cc395);let _0x734a93=this[_0x3e3a86(0x140)](_0x2f550e,_0x3eef61);await this['writeFile'](_0x67a302+(_0x268d04+'/'+_0x268d04+_0x3e3a86(0x10d)),_0x734a93,_0x5cc395),await this['writeFile'](_0x67a302+(_0x268d04+'/'+_0x268d04+_0x3e3a86(0x175)),serviceQuery,_0x5cc395),await this[_0x3e3a86(0x15c)](_0x67a302+(_0x268d04+'/'+_0x268d04+_0x3e3a86(0x13e)),serviceMutation,_0x5cc395);let _0x436d4c=this[_0x3e3a86(0x18b)](_0x3eef61);await this[_0x3e3a86(0x15c)](_0x67a302+(_0x268d04+'/'+_0x268d04+_0x3e3a86(0x11d)),_0x436d4c,_0x5cc395);let _0x3efadd=this[_0x3e3a86(0x128)](_0x2f550e,_0x3eef61);await this['writeFile'](_0x67a302+(_0x268d04+'/'+_0x268d04+'-history.ts'),_0x3efadd,_0x5cc395);let _0x2ab4f5='';'JSON'==_0x2f550e[_0x3e3a86(0x12e)]?(_0x2ab4f5='\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20',await this[_0x3e3a86(0x15c)](_0x67a302+(_0x268d04+'/event-subscriber.ts'),serviceEntitySubscriber,_0x5cc395)):_0x2ab4f5='';let _0x19eca1=serviceEntitySubscriber['replace'](/{{entityToJson}}/g,_0x2ab4f5);await this[_0x3e3a86(0x15c)](_0x67a302+(_0x268d04+_0x3e3a86(0x135)),_0x19eca1,_0x5cc395),await this[_0x3e3a86(0x15c)](_0x67a302+(_0x268d04+'/'+_0x268d04+_0x3e3a86(0x120)),serviceHistoryQuery,_0x5cc395),await this['writeFile'](_0x67a302+(_0x268d04+'/'+_0x268d04+_0x3e3a86(0x15d)),sereviceHistoryType,_0x5cc395);let _0x219287=_0x67a302+'index.ts';0x0==await this[_0x3e3a86(0x191)](_0x219287)&&await this[_0x3e3a86(0x15c)](_0x219287,allIndex,_0x5cc395);let _0x8dbe63=await fs[_0x3e3a86(0x172)](_0x219287,_0x3e3a86(0x15b));_0x8dbe63[_0x3e3a86(0x134)](_0x3e3a86(0x155)+_0x5cc395['name']+'/'+_0x5cc395[_0x3e3a86(0x133)]+_0x3e3a86(0x16e))<0x0&&(_0x8dbe63=_0x8dbe63[_0x3e3a86(0x111)](/\/\* EXPORT ENTITY TYPES \*\//,_0x3e3a86(0x18f)+_0x5cc395['name']+'/'+_0x5cc395['name']+_0x3e3a86(0x16e))),_0x8dbe63[_0x3e3a86(0x134)](_0x3e3a86(0x155)+_0x5cc395[_0x3e3a86(0x133)]+'/'+_0x5cc395['name']+'\x27')<0x0&&(_0x8dbe63=_0x8dbe63[_0x3e3a86(0x111)](/\/\* EXPORT ENTITY TYPES \*\//,_0x3e3a86(0x18f)+_0x5cc395[_0x3e3a86(0x133)]+'/'+_0x5cc395[_0x3e3a86(0x133)]+'\x27')),_0x8dbe63['indexOf']('import\x20{\x20entities\x20as\x20'+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x14c)+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x182)+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x154)+_0x5cc395[_0x3e3a86(0x133)]+'\x27')<0x0&&(_0x8dbe63=_0x8dbe63[_0x3e3a86(0x111)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x3e3a86(0x147)+_0x5cc395['pascalCaseName']+_0x3e3a86(0x14c)+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x182)+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x154)+_0x5cc395[_0x3e3a86(0x133)]+'\x27')),_0x8dbe63[_0x3e3a86(0x134)]('...'+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x115))<0x0&&(_0x8dbe63=_0x8dbe63[_0x3e3a86(0x111)](/\/\* ENTITIES \*\//,_0x3e3a86(0x186)+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x115))),_0x8dbe63[_0x3e3a86(0x134)](_0x3e3a86(0x168)+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x119))<0x0&&(_0x8dbe63=_0x8dbe63[_0x3e3a86(0x111)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x5cc395['pascalCaseName']+_0x3e3a86(0x119))),_0x8dbe63[_0x3e3a86(0x134)]('...'+_0x5cc395[_0x3e3a86(0x163)]+_0x3e3a86(0x137))<0x0&&(_0x8dbe63=_0x8dbe63['replace'](/\/\* SUBSCRIBERS \*\//,_0x3e3a86(0x113)+_0x5cc395['pascalCaseName']+_0x3e3a86(0x137))),await this[_0x3e3a86(0x15c)](_0x219287,_0x8dbe63,_0x5cc395);}async[a0_0xd6bf0(0x190)](_0x52a2bb,_0x4c3e26,_0x33569e,_0x23b004,_0x4a0716){const _0x355a25=a0_0xd6bf0;await this[_0x355a25(0x15c)](_0x52a2bb+(_0x4c3e26+_0x355a25(0x10e)),serviceIndex,_0x4a0716),await this[_0x355a25(0x15c)](_0x52a2bb+(_0x4c3e26+'/'+_0x4c3e26+_0x355a25(0x175)),serviceQuery,_0x4a0716),await this[_0x355a25(0x15c)](_0x52a2bb+(_0x4c3e26+'/'+_0x4c3e26+'-mutation.ts'),serviceMutation,_0x4a0716);let _0x5b1556=this['createEntityText'](_0x33569e,_0x23b004);await this[_0x355a25(0x15c)](_0x52a2bb+(_0x4c3e26+'/'+_0x4c3e26+_0x355a25(0x10d)),_0x5b1556,_0x4a0716);let _0x2b7323=this['createTypeText'](_0x23b004);await this['writeFile'](_0x52a2bb+(_0x4c3e26+'/'+_0x4c3e26+_0x355a25(0x11d)),_0x2b7323,_0x4a0716);let _0x118d59=_0x52a2bb+_0x355a25(0x187);0x0==await this[_0x355a25(0x191)](_0x118d59)&&await this[_0x355a25(0x15c)](_0x118d59,allIndex,_0x4a0716);let _0x571184=await fs[_0x355a25(0x172)](_0x118d59,_0x355a25(0x15b));_0x571184[_0x355a25(0x134)](_0x355a25(0x155)+_0x4a0716[_0x355a25(0x133)]+'/'+_0x4a0716[_0x355a25(0x133)]+'\x27')<0x0&&(_0x571184=_0x571184[_0x355a25(0x111)](/\/\* EXPORT ENTITY TYPES \*\//,_0x355a25(0x18f)+_0x4a0716[_0x355a25(0x133)]+'/'+_0x4a0716['name']+'\x27')),_0x571184[_0x355a25(0x134)](_0x355a25(0x10a)+_0x4a0716[_0x355a25(0x163)]+'Entities,\x20resolvers\x20as\x20'+_0x4a0716['pascalCaseName']+_0x355a25(0x11a)+_0x4a0716[_0x355a25(0x133)]+'\x27')<0x0&&(_0x571184=_0x571184[_0x355a25(0x111)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x4a0716['pascalCaseName']+'Entities,\x20resolvers\x20as\x20'+_0x4a0716[_0x355a25(0x163)]+_0x355a25(0x11a)+_0x4a0716[_0x355a25(0x133)]+'\x27')),_0x571184[_0x355a25(0x134)]('...'+_0x4a0716['pascalCaseName']+'Entities,')<0x0&&(_0x571184=_0x571184[_0x355a25(0x111)](/\/\* ENTITIES \*\//,_0x355a25(0x186)+_0x4a0716['pascalCaseName']+_0x355a25(0x115))),_0x571184['indexOf'](_0x355a25(0x168)+_0x4a0716[_0x355a25(0x163)]+'Resolvers,')<0x0&&(_0x571184=_0x571184[_0x355a25(0x111)](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x4a0716[_0x355a25(0x163)]+_0x355a25(0x119))),await this['writeFile'](_0x118d59,_0x571184,_0x4a0716);}[a0_0xd6bf0(0x18b)](_0x118555){const _0x572199=a0_0xd6bf0;let _0x35ad80=sereviceType,_0x4021f5=_0x118555['map'](_0x993995=>{const _0x1b1541=a0_0x589e;if('id'==_0x993995[_0x1b1541(0x133)])return'';if(_0x1b1541(0x121)==_0x993995['name'])return'';if(_0x1b1541(0x19e)==_0x993995[_0x1b1541(0x133)])return'';if(_0x1b1541(0x15f)==_0x993995[_0x1b1541(0x133)])return'';if('creator_id'==_0x993995[_0x1b1541(0x133)])return'';if('updater_id'==_0x993995[_0x1b1541(0x133)])return'';let _0x100896=this[_0x1b1541(0x11e)](_0x993995),_0x3aabda=this['getColTxtType'](_0x993995),_0x19a6d6=camelCase(_0x993995[_0x1b1541(0x133)]);return'\x20\x20'+(_0x1b1541(0x118)+(0x0==_0x100896[_0x1b1541(0x18d)]?'':_0x1b1541(0x148)+_0x100896+',')+_0x1b1541(0x130)+_0x993995[_0x1b1541(0x153)]+_0x1b1541(0x11f))+_0x1b1541(0x139)+(''+_0x19a6d6+(_0x993995[_0x1b1541(0x153)]?'?':'')+':\x20'+_0x3aabda)+'\x0a';});_0x35ad80=_0x35ad80[_0x572199(0x111)](/{{newTypeColumns}}/g,_0x4021f5[_0x572199(0x10b)]('\x0a'));let _0x188bdc=_0x118555[_0x572199(0x129)](_0x34df09=>{const _0x3a1859=_0x572199;if('id'==_0x34df09['name'])return'';if(_0x3a1859(0x121)==_0x34df09[_0x3a1859(0x133)])return'';if('created_at'==_0x34df09['name'])return'';if(_0x3a1859(0x15f)==_0x34df09[_0x3a1859(0x133)])return'';if(_0x3a1859(0x16c)==_0x34df09['name'])return'';if('updater_id'==_0x34df09[_0x3a1859(0x133)])return'';let _0x13620e=this[_0x3a1859(0x11e)](_0x34df09),_0x3ae1a7=this['getColTxtType'](_0x34df09);_0x34df09['nullable']=!0x0;let _0x4dff2d=camelCase(_0x34df09['name']);return'\x20\x20'+(_0x3a1859(0x118)+(0x0==_0x13620e[_0x3a1859(0x18d)]?'':_0x3a1859(0x148)+_0x13620e+',')+_0x3a1859(0x130)+_0x34df09[_0x3a1859(0x153)]+_0x3a1859(0x11f))+_0x3a1859(0x139)+(''+_0x4dff2d+(_0x34df09[_0x3a1859(0x153)]?'?':'')+':\x20'+_0x3ae1a7)+'\x0a';});return _0x35ad80=_0x35ad80[_0x572199(0x111)](/{{patchTypeColumns}}/g,_0x188bdc[_0x572199(0x10b)]('\x0a')),_0x35ad80;}[a0_0xd6bf0(0x140)](_0x3676f8,_0x4aa852){const _0x3db2b4=a0_0xd6bf0;let _0x4eee8b=serviceEntity,_0xecc2c3=_0x4aa852[_0x3db2b4(0x194)](function(_0x2e21dd,_0x1f77cf){const _0x45ad66=_0x3db2b4;return _0x2e21dd[_0x45ad66(0x160)]-_0x1f77cf[_0x45ad66(0x160)];})['map'](_0xab6de5=>this[_0x3db2b4(0x166)](_0xab6de5));[_0x3db2b4(0x143),_0x3db2b4(0x19b)]['includes'](_0x3676f8['dataProp'])&&_0xecc2c3[_0x3db2b4(0x16b)]('\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201'),_0x4eee8b=_0x4eee8b[_0x3db2b4(0x111)](/{{entityColumns}}/g,_0xecc2c3[_0x3db2b4(0x10b)]('\x0a'));let _0x122d49='',_0x4b1e8e=_0x4aa852[_0x3db2b4(0x176)](_0xf099e3=>_0xf099e3[_0x3db2b4(0x136)]&&_0xf099e3['uniqRank']>0x0)[_0x3db2b4(0x194)](function(_0x23362a,_0xe3409d){const _0x119a01=_0x3db2b4;return _0x23362a[_0x119a01(0x136)]-_0xe3409d['uniqRank'];});if(_0x4b1e8e[_0x3db2b4(0x18d)]>0x0){_0x122d49=_0x3db2b4(0x146);let _0x5accf0=_0x4b1e8e['map'](_0x478ce2=>{const _0x1d2206=_0x3db2b4;let _0x46e52f=_0x478ce2[_0x1d2206(0x133)];return _0x1d2206(0x121)==_0x478ce2['name']&&(_0x46e52f=_0x1d2206(0x161)),_0x1d2206(0x16c)==_0x478ce2[_0x1d2206(0x133)]&&(_0x46e52f=_0x1d2206(0x19f)),_0x1d2206(0x189)==_0x478ce2[_0x1d2206(0x133)]&&(_0x46e52f=_0x1d2206(0x13b)),_0x1d2206(0x19d)+camelCase(_0x46e52f);});_0x122d49=_0x122d49[_0x3db2b4(0x111)](/{{indexColumns}}/g,_0x5accf0['join'](','));}return _0x4eee8b=_0x4eee8b[_0x3db2b4(0x111)](/{{indexAnn}}/g,_0x122d49),_0x4eee8b;}[a0_0xd6bf0(0x128)](_0x2efebd,_0x1c17e7){const _0x5d81bf=a0_0xd6bf0;let _0x41ab5c=_0x5d81bf(0x19b)==_0x2efebd['dataProp']?serviceEntityHistJson:serviceEntityHistCopy,_0x655c20=_0x1c17e7['sort'](function(_0x9ff658,_0x5aedd2){const _0xaaa3f7=_0x5d81bf;return _0x9ff658['rank']-_0x5aedd2[_0xaaa3f7(0x160)];})[_0x5d81bf(0x129)](_0x2e9ec3=>this['columnToEntityColumn'](_0x2e9ec3));return _0x41ab5c=_0x41ab5c['replace'](/{{entityColumns}}/g,_0x655c20[_0x5d81bf(0x10b)]('\x0a')),_0x41ab5c;}[a0_0xd6bf0(0x166)](_0x584304){const _0x58e55a=a0_0xd6bf0;if('id'==_0x584304['name'])return'';if('domain_id'==_0x584304[_0x58e55a(0x133)])return'';if('created_at'==_0x584304[_0x58e55a(0x133)])return'';if(_0x58e55a(0x15f)==_0x584304['name'])return'';if(_0x58e55a(0x16c)==_0x584304[_0x58e55a(0x133)])return'';if('updater_id'==_0x584304['name'])return'';let _0x5c6011=_0x584304[_0x58e55a(0x17b)];'double'==_0x584304[_0x58e55a(0x17b)]&&(_0x5c6011=_0x58e55a(0x12d)),_0x58e55a(0x132)==_0x584304[_0x58e55a(0x17b)]&&(_0x5c6011=_0x58e55a(0x159)),_0x58e55a(0x18c)==_0x584304['colType']&&(_0x5c6011='character\x20varying'),_0x58e55a(0x18a)==_0x584304[_0x58e55a(0x17b)]&&(_0x5c6011=_0x58e55a(0x125));let _0x1dd776='';'string'==_0x584304['colType']&&(_0x1dd776=_0x584304['colSize']);let _0x5a12e3=this[_0x58e55a(0x11e)](_0x584304),_0x38a468=this[_0x58e55a(0x171)](_0x584304),_0x2e277a=camelCase(_0x584304[_0x58e55a(0x133)]);return'\x20\x20'+(_0x58e55a(0x14b)+_0x584304[_0x58e55a(0x133)]+_0x58e55a(0x157)+_0x5c6011+_0x58e55a(0x123)+_0x584304[_0x58e55a(0x153)]+'\x20'+(0x0==_0x1dd776[_0x58e55a(0x18d)]?'':_0x58e55a(0x145)+_0x1dd776)+_0x58e55a(0x11f))+'\x0a\x20\x20'+(_0x58e55a(0x118)+(0x0==_0x5a12e3[_0x58e55a(0x18d)]?'':_0x58e55a(0x148)+_0x5a12e3+',')+_0x58e55a(0x130)+_0x584304[_0x58e55a(0x153)]+_0x58e55a(0x11f))+_0x58e55a(0x139)+(''+_0x2e277a+(_0x584304[_0x58e55a(0x153)]?'?':'')+':\x20'+_0x38a468)+'\x0a';}['getFieldType'](_0x1e3ad3){const _0x41bb80=a0_0xd6bf0;let _0xd7e38b='';return _0x41bb80(0x165)==_0x1e3ad3['colType']&&(_0xd7e38b=_0x41bb80(0x195)),_0x41bb80(0x142)==_0x1e3ad3['colType']&&(_0xd7e38b='Float'),'long'==_0x1e3ad3[_0x41bb80(0x17b)]&&(_0xd7e38b='Int'),'integer'==_0x1e3ad3[_0x41bb80(0x17b)]&&(_0xd7e38b=_0x41bb80(0x17c)),_0xd7e38b;}['getColTxtType'](_0x8655b7){const _0x65f9c0=a0_0xd6bf0;let _0x381bd5=_0x8655b7[_0x65f9c0(0x17b)];return _0x65f9c0(0x112)==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5='number'),_0x65f9c0(0x165)==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5=_0x65f9c0(0x141)),'float'==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5=_0x65f9c0(0x141)),_0x65f9c0(0x12a)==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5=_0x65f9c0(0x141)),'long'==_0x8655b7['colType']&&(_0x381bd5='number'),_0x65f9c0(0x18a)==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5='Date'),_0x65f9c0(0x149)==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5=_0x65f9c0(0x180)),'text'==_0x8655b7[_0x65f9c0(0x17b)]&&(_0x381bd5='string'),_0x381bd5;}async['writeFile'](_0x16a5b2,_0x3d0690,_0x1b75fd){const _0x307850=a0_0xd6bf0;await fs['writeFileSync'](_0x16a5b2,this[_0x307850(0x151)](_0x3d0690,_0x1b75fd),'utf8');}[a0_0xd6bf0(0x151)](_0x74c8b4,_0x501b7f){const _0x34426d=a0_0xd6bf0;return _0x74c8b4[_0x34426d(0x111)](/{{pascalCase name}}/g,_0x501b7f['pascalCaseName'])['replace'](/{{camelCase name}}/g,_0x501b7f[_0x34426d(0x162)])[_0x34426d(0x111)](/{{snakeCase name}}/g,_0x501b7f[_0x34426d(0x181)])[_0x34426d(0x111)](/{{pluralPascalCase name}}/g,_0x501b7f[_0x34426d(0x150)])['replace'](/{{pluralCamelCase name}}/g,_0x501b7f['pluralCamelCaseName'])[_0x34426d(0x111)](/{{tableName}}/g,_0x501b7f[_0x34426d(0x178)])[_0x34426d(0x111)](/{{name}}/g,_0x501b7f['name']);}async[a0_0xd6bf0(0x173)](_0x157c00,_0x14ee31,_0x206db9){const _0x193c77=a0_0xd6bf0;let _0x544eb0=_0x157c00+_0x193c77(0x184);await this[_0x193c77(0x14a)](_0x544eb0),_0x544eb0=_0x544eb0+'/'+_0x14ee31,await this[_0x193c77(0x14a)](_0x544eb0),_0x544eb0+=_0x193c77(0x17e),await this[_0x193c77(0x14a)](_0x544eb0),_0x544eb0+=_0x193c77(0x193),await this['createDir'](_0x544eb0),_0x544eb0=_0x544eb0+'/'+_0x206db9,await this[_0x193c77(0x14a)](_0x544eb0);}[a0_0xd6bf0(0x196)](){const _0x51cfc0=a0_0xd6bf0;let _0x42c78e=process[_0x51cfc0(0x188)]['PWD'][_0x51cfc0(0x16a)]('/'),_0x4c818b=[];for(let _0x496ddb=0x0;_0x496ddb<_0x42c78e[_0x51cfc0(0x18d)]&&'packages'!=_0x42c78e[_0x496ddb];_0x496ddb++)_0x4c818b[_0x51cfc0(0x16b)](_0x42c78e[_0x496ddb]);return _0x4c818b[_0x51cfc0(0x10b)]('/');}async['createDir'](_0x574e1d){const _0xc130a4=a0_0xd6bf0;0x0==await this['existsPath'](_0x574e1d)&&fs[_0xc130a4(0x12f)](_0x574e1d);}async[a0_0xd6bf0(0x191)](_0x170172){const _0x5809d0=a0_0xd6bf0;return await fs[_0x5809d0(0x126)](_0x170172);}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0xd6bf0(0x116)])(_0x1d5536=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Service'}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0xd6bf0(0x152)])('id')),tslib_1[a0_0xd6bf0(0x14f)](0x1,(0x0,type_graphql_1[a0_0xd6bf0(0x174)])()),tslib_1[a0_0xd6bf0(0x13c)](a0_0xd6bf0(0x15a),Function),tslib_1[a0_0xd6bf0(0x13c)](a0_0xd6bf0(0x144),[String,Object]),tslib_1[a0_0xd6bf0(0x13c)](a0_0xd6bf0(0x164),Promise)],OperatoToolCreateService[a0_0xd6bf0(0x17a)],'toolCreateService',null),OperatoToolCreateService=tslib_1[a0_0xd6bf0(0x199)]([(0x0,type_graphql_1[a0_0xd6bf0(0x169)])()],OperatoToolCreateService),exports['OperatoToolCreateService']=OperatoToolCreateService;function a0_0x589e(_0x275bd1,_0x2ac681){const _0x2aa942=a0_0x2aa9();return a0_0x589e=function(_0x589e8b,_0x101ff9){_0x589e8b=_0x589e8b-0x10a;let _0x46cebb=_0x2aa942[_0x589e8b];return _0x46cebb;},a0_0x589e(_0x275bd1,_0x2ac681);}function a0_0x2aa9(){const _0x4115bf=['__esModule','/*\x20ENTITIES\x20*/\x0a\x09...','index.ts','env','updater_id','datetime','createTypeText','string','length','4612044iBWUak','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','createNoHistoryServiceFiels','existsPath','\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','/service','sort','Float','getProjectRootPath','/server/service/','EntityColumn','__decorate','469035DGDNvV','JSON','Entity','{{camelCase\x20name}}.','created_at','creator','import\x20{\x20entities\x20as\x20','join','\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','.ts','/index.ts','\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','4707660HBCzUr','replace','decimal','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','includes','Entities,','Query','323452UjUNrA','@Field(','Resolvers,','Resolvers\x20}\x20from\x20\x27./','tslib','318465sukcnt','-type.ts','getFieldType','\x20})','-history-query.ts','domain_id','\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','\x27,\x20nullable:\x20','pluralize','timestamp\x20without\x20time\x20zone','existsSync','44442Ecuzgw','createHistoryEntityText','map','integer','880ZiBITm','find','double\x20precision','dataProp','mkdirSync','\x20{\x20nullable:\x20','lodash','long','name','indexOf','/event-subscriber.ts','uniqRank','EntitySubscribers,','\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','\x0a\x20\x20','2ZgLmvR','updater','__metadata','\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','-mutation.ts','toolCreateService','createEntityText','number','float','COPY','design:paramtypes',',length:','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','type\x20=>','date','createDir','@Column({name:\x27','Entities,\x20resolvers\x20as\x20','findOne','\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','__param','pluralPascalCaseName','replaceNamesMap','Arg','nullable','EntitySubscribers\x20}\x20from\x20\x27./','export\x20*\x20from\x20\x27./','6223910GOikns','\x27,\x20type:\x20\x27','createServiceFiles','bigint','design:type','utf8','writeFile','-history-type.ts','OperatoToolCreateService','updated_at','rank','domain','camelCaseName','pascalCaseName','design:returntype','double','columnToEntityColumn','3ApokdK','...','Resolver','split','push','creator_id','state','-history\x27','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryList\x20}\x20from\x20\x27./{{name}}-history-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}}History)\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryQuery\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}History,\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}History(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}History>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}History).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}HistoryList,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}Histories(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}HistoryList>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}}History)\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}History.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.creatorId})\x0a\x20\x20}\x0a}\x0a','\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','getColTxtType','readFileSync','createServicePath','Ctx','-query.ts','filter','\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a','tableName','createHistoryServiceFiles','prototype','colType','Int','@things-factory/shell','/server','type-graphql','Date','snakeCaseName','Resolvers,\x20subscribers\x20as\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\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','/packages'];a0_0x2aa9=function(){return _0x4115bf;};return a0_0x2aa9();}const allIndex=a0_0xd6bf0(0x13d),serviceIndex=a0_0xd6bf0(0x138),serviceHistoryIndex=a0_0xd6bf0(0x170),serviceQuery=a0_0xd6bf0(0x192),serviceHistoryQuery=a0_0xd6bf0(0x16f),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_0xd6bf0(0x10f),sereviceHistoryType=a0_0xd6bf0(0x177),serviceEntity=a0_0xd6bf0(0x10c),serviceEntityHistCopy=a0_0xd6bf0(0x14e),serviceEntityHistJson=a0_0xd6bf0(0x183),serviceEntitySubscriber=a0_0xd6bf0(0x122);
1
+ 'use strict';const a0_0x418395=a0_0x48a2;(function(_0x119722,_0x138656){const _0x3d7907=a0_0x48a2,_0x225d8c=_0x119722();while(!![]){try{const _0x32ef95=parseInt(_0x3d7907(0x113))/0x1*(-parseInt(_0x3d7907(0x17c))/0x2)+parseInt(_0x3d7907(0x19c))/0x3*(parseInt(_0x3d7907(0x185))/0x4)+-parseInt(_0x3d7907(0x132))/0x5+-parseInt(_0x3d7907(0x198))/0x6+parseInt(_0x3d7907(0x13b))/0x7+-parseInt(_0x3d7907(0x178))/0x8+parseInt(_0x3d7907(0x11e))/0x9;if(_0x32ef95===_0x138656)break;else _0x225d8c['push'](_0x225d8c['shift']());}catch(_0x1dbd93){_0x225d8c['push'](_0x225d8c['shift']());}}}(a0_0x4670,0xca9b9));Object[a0_0x418395(0x14d)](exports,a0_0x418395(0x15e),{'value':!0x0}),exports[a0_0x418395(0x196)]=void 0x0;const tslib_1=require(a0_0x418395(0x15f)),type_graphql_1=require('type-graphql'),shell_1=require(a0_0x418395(0x164)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x418395(0x123)),{plural:plural}=require(a0_0x418395(0x162)),fs=require('fs');function a0_0x4670(){const _0x593b25=['decimal','createServicePath','Entity','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','existsPath','-history-type.ts','existsSync','createHistoryEntityText','/server','number','EntitySubscribers,','import\x20{\x20entities\x20as\x20','12310928INkRrS','join','\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','\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','2GKxCMn','createTypeText','Date','string','writeFileSync','push','writeFile','pascalCaseName','columnToEntityColumn','972ywYXHk','-history\x27','\x0a\x20\x20','PWD','Operato\x20Tool\x20Create\x20Service','-type.ts','nullable','design:paramtypes','Int','split','\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','date','replace','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','colType','/event-subscriber.ts','colSize','OperatoToolCreateService','Ctx','6208422iOEDQT','name','length','getFieldType','2808lQZGZH','\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','__decorate','indexOf','-history-query.ts','findOne','\x20{\x20nullable:\x20','EntitySubscribers\x20}\x20from\x20\x27./','\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','createHistoryServiceFiles','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','591970gYWMsX','/packages','/index.ts','includes','JSON','...','EntityColumn','character\x20varying','updater_id','createEntityText','getRepository','24345396yJrNrU','COPY','\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','state','__metadata','lodash','rank','__param','Resolvers\x20}\x20from\x20\x27./','index.ts','\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','double','export\x20*\x20from\x20\x27./','getProjectRootPath','creator_id','bigint','.ts','replaceNamesMap','createDir','\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','879770lArnhk','/*\x20ENTITIES\x20*/\x0a\x09...','Arg','long','\x27,\x20type:\x20\x27','-query.ts','Entities,\x20resolvers\x20as\x20','Resolvers,\x20subscribers\x20as\x20','design:returntype','8672412wFKFXJ','getColTxtType','updater','integer','readFileSync','Entities,','@Column({name:\x27','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','dataProp','createNoHistoryServiceFiels','@Field(','Resolvers,','map','sort','utf8','Resolver','Float','tableName','defineProperty','float','design:type','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','env','\x27,\x20nullable:\x20','find',',length:','uniqRank','\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','\x20})','createServiceFiles','\x0aimport\x20{\x20Resolver,\x20Mutation,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20In\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20New{{pascalCase\x20name}},\x20{{pascalCase\x20name}}Patch\x20}\x20from\x20\x27./{{name}}-type\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Mutation\x20{\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20create\x20new\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20create{{pascalCase\x20name}}(@Arg(\x27{{camelCase\x20name}}\x27)\x20{{camelCase\x20name}}:\x20New{{pascalCase\x20name}},\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20return\x20await\x20tx.getRepository({{pascalCase\x20name}}).save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20modify\x20{{pascalCase\x20name}}\x20information\x27\x20})\x0a\x20\x20async\x20update{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27id\x27)\x20id:\x20string,\x0a\x20\x20\x20\x20@Arg(\x27patch\x27)\x20patch:\x20{{pascalCase\x20name}}Patch,\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20repository\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20repository.findOne(\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20)\x0a\x0a\x20\x20\x20\x20return\x20await\x20repository.save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20...patch,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20[{{pascalCase\x20name}}],\x20{\x20description:\x20\x22To\x20modify\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20information\x22\x20})\x0a\x20\x20async\x20updateMultiple{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27patches\x27,\x20type\x20=>\x20[{{pascalCase\x20name}}Patch])\x20patches:\x20{{pascalCase\x20name}}Patch[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}[]>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20results\x20=\x20[]\x0a\x20\x20\x20\x20const\x20_createRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27+\x27)\x0a\x20\x20\x20\x20const\x20_updateRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27M\x27)\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}Repo\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x0a\x20\x20\x20\x20if\x20(_createRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_createRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20newRecord\x20=\x20_createRecords[i]\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...newRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27+\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20if\x20(_updateRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_updateRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20updRecord\x20=\x20_updateRecords[i]\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20{{camelCase\x20name}}Repo.findOne({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id:updRecord.id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...updRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27M\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20results\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20delete{{pascalCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove({\x20domain,\x20id,\x20updater:user\x20})\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20multiple\x20{{camelCase\x20name}}s\x27\x20})\x0a\x20\x20async\x20delete{{pluralPascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27ids\x27,\x20type\x20=>\x20[String])\x20ids:\x20string[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20delEntitis\x20=\x20ids.map(id=>{\x0a\x20\x20\x20\x20\x20\x20return\x20{domain,id,updater:user}\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove(delEntitis)\x0a\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a}\x0a','mkdirSync','domain_id','domain','-history.ts','__esModule','tslib','-mutation.ts','pluralCamelCaseName','pluralize','{{camelCase\x20name}}.','@things-factory/shell','type\x20=>','prototype','created_at','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','toolCreateService','updated_at','double\x20precision'];a0_0x4670=function(){return _0x593b25;};return a0_0x4670();}let OperatoToolCreateService=class{async[a0_0x418395(0x169)](_0x116a29,_0x1f6db7){const _0x5526af=a0_0x418395,{domain:_0x452720}=_0x1f6db7[_0x5526af(0x121)],_0x4b8855=await(0x0,shell_1['getRepository'])(resource_base_1[_0x5526af(0x16e)])[_0x5526af(0x1a1)]({'where':{'id':_0x116a29}}),_0x4bd451=await(0x0,shell_1[_0x5526af(0x11d)])(resource_base_1[_0x5526af(0x119)])[_0x5526af(0x153)]({'where':{'domain':{'id':_0x452720['id']},'entity':{'id':_0x4b8855['id']}}});let {name:_0x3ed538='',bundle:_0x4e4489=''}=_0x4b8855||{},_0xc2a8e=this[_0x5526af(0x12b)](),_0xa4565d=kebabCase(_0x3ed538);return await this[_0x5526af(0x16d)](_0xc2a8e,_0x4e4489,_0xa4565d),await this[_0x5526af(0x158)](_0xc2a8e,_0x4e4489,_0x3ed538,_0xa4565d,_0x4b8855,_0x4bd451),!0x0;}async['createServiceFiles'](_0x55325b,_0x13ab8b,_0x7fc910,_0x3d0d3e,_0xeae847,_0x5550ba){const _0x39b4d0=a0_0x418395;let _0x3d49b3={'name':_0x3d0d3e,'tableName':_0xeae847[_0x39b4d0(0x14c)],'pascalCaseName':startCase(camelCase(_0x7fc910))[_0x39b4d0(0x191)](/ /g,''),'camelCaseName':camelCase(_0x7fc910),'snakeCaseName':snakeCase(_0x7fc910),'pluralPascalCaseName':startCase(camelCase(plural(_0x7fc910)))[_0x39b4d0(0x191)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x7fc910))},_0x42b088=_0x55325b+'/packages/'+_0x13ab8b+'/server/service/';['JSON',_0x39b4d0(0x11f)][_0x39b4d0(0x116)](_0xeae847['dataProp'])?await this[_0x39b4d0(0x111)](_0x42b088,_0x3d0d3e,_0xeae847,_0x5550ba,_0x3d49b3):await this[_0x39b4d0(0x144)](_0x42b088,_0x3d0d3e,_0xeae847,_0x5550ba,_0x3d49b3);}async['createHistoryServiceFiles'](_0x15a4b3,_0x5a2df5,_0x30a985,_0x49b5af,_0x3b0e54){const _0x3c8c36=a0_0x418395;await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+_0x3c8c36(0x115)),serviceHistoryIndex,_0x3b0e54);let _0x2d286e=this[_0x3c8c36(0x11c)](_0x30a985,_0x49b5af);await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x12e)),_0x2d286e,_0x3b0e54),await this['writeFile'](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x137)),serviceQuery,_0x3b0e54),await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x160)),serviceMutation,_0x3b0e54);let _0x450498=this[_0x3c8c36(0x17d)](_0x49b5af);await this['writeFile'](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x18a)),_0x450498,_0x3b0e54);let _0x343f49=this[_0x3c8c36(0x173)](_0x30a985,_0x49b5af);await this['writeFile'](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x15d)),_0x343f49,_0x3b0e54);let _0x36f923='';_0x3c8c36(0x117)==_0x30a985[_0x3c8c36(0x143)]?(_0x36f923=_0x3c8c36(0x131),await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+_0x3c8c36(0x194)),serviceEntitySubscriber,_0x3b0e54)):_0x36f923='';let _0x26a364=serviceEntitySubscriber[_0x3c8c36(0x191)](/{{entityToJson}}/g,_0x36f923);await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+_0x3c8c36(0x194)),_0x26a364,_0x3b0e54),await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x1a0)),serviceHistoryQuery,_0x3b0e54),await this[_0x3c8c36(0x182)](_0x15a4b3+(_0x5a2df5+'/'+_0x5a2df5+_0x3c8c36(0x171)),sereviceHistoryType,_0x3b0e54);let _0x8a4bff=_0x15a4b3+_0x3c8c36(0x127);0x0==await this[_0x3c8c36(0x170)](_0x8a4bff)&&await this[_0x3c8c36(0x182)](_0x8a4bff,allIndex,_0x3b0e54);let _0x47803e=await fs['readFileSync'](_0x8a4bff,'utf8');_0x47803e[_0x3c8c36(0x19f)](_0x3c8c36(0x12a)+_0x3b0e54[_0x3c8c36(0x199)]+'/'+_0x3b0e54[_0x3c8c36(0x199)]+_0x3c8c36(0x186))<0x0&&(_0x47803e=_0x47803e['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x3c8c36(0x168)+_0x3b0e54[_0x3c8c36(0x199)]+'/'+_0x3b0e54['name']+_0x3c8c36(0x186))),_0x47803e['indexOf'](_0x3c8c36(0x12a)+_0x3b0e54[_0x3c8c36(0x199)]+'/'+_0x3b0e54[_0x3c8c36(0x199)]+'\x27')<0x0&&(_0x47803e=_0x47803e[_0x3c8c36(0x191)](/\/\* EXPORT ENTITY TYPES \*\//,_0x3c8c36(0x168)+_0x3b0e54[_0x3c8c36(0x199)]+'/'+_0x3b0e54[_0x3c8c36(0x199)]+'\x27')),_0x47803e[_0x3c8c36(0x19f)]('import\x20{\x20entities\x20as\x20'+_0x3b0e54[_0x3c8c36(0x183)]+'Entities,\x20resolvers\x20as\x20'+_0x3b0e54['pascalCaseName']+'Resolvers,\x20subscribers\x20as\x20'+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x1a3)+_0x3b0e54[_0x3c8c36(0x199)]+'\x27')<0x0&&(_0x47803e=_0x47803e[_0x3c8c36(0x191)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x3c8c36(0x112)+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x138)+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x139)+_0x3b0e54['pascalCaseName']+_0x3c8c36(0x1a3)+_0x3b0e54[_0x3c8c36(0x199)]+'\x27')),_0x47803e['indexOf'](_0x3c8c36(0x118)+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x140))<0x0&&(_0x47803e=_0x47803e[_0x3c8c36(0x191)](/\/\* ENTITIES \*\//,_0x3c8c36(0x133)+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x140))),_0x47803e[_0x3c8c36(0x19f)]('...'+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x146))<0x0&&(_0x47803e=_0x47803e['replace'](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x146))),_0x47803e['indexOf'](_0x3c8c36(0x118)+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x176))<0x0&&(_0x47803e=_0x47803e['replace'](/\/\* SUBSCRIBERS \*\//,_0x3c8c36(0x142)+_0x3b0e54[_0x3c8c36(0x183)]+_0x3c8c36(0x176))),await this[_0x3c8c36(0x182)](_0x8a4bff,_0x47803e,_0x3b0e54);}async[a0_0x418395(0x144)](_0x3c50b6,_0x5a2f0a,_0x59c35e,_0xcd4e81,_0x100424){const _0x2bd584=a0_0x418395;await this[_0x2bd584(0x182)](_0x3c50b6+(_0x5a2f0a+_0x2bd584(0x115)),serviceIndex,_0x100424),await this[_0x2bd584(0x182)](_0x3c50b6+(_0x5a2f0a+'/'+_0x5a2f0a+_0x2bd584(0x137)),serviceQuery,_0x100424),await this[_0x2bd584(0x182)](_0x3c50b6+(_0x5a2f0a+'/'+_0x5a2f0a+_0x2bd584(0x160)),serviceMutation,_0x100424);let _0xa34ec=this[_0x2bd584(0x11c)](_0x59c35e,_0xcd4e81);await this[_0x2bd584(0x182)](_0x3c50b6+(_0x5a2f0a+'/'+_0x5a2f0a+'.ts'),_0xa34ec,_0x100424);let _0x22ba59=this['createTypeText'](_0xcd4e81);await this[_0x2bd584(0x182)](_0x3c50b6+(_0x5a2f0a+'/'+_0x5a2f0a+_0x2bd584(0x18a)),_0x22ba59,_0x100424);let _0x5d67d1=_0x3c50b6+_0x2bd584(0x127);0x0==await this[_0x2bd584(0x170)](_0x5d67d1)&&await this['writeFile'](_0x5d67d1,allIndex,_0x100424);let _0x98f13b=await fs[_0x2bd584(0x13f)](_0x5d67d1,_0x2bd584(0x149));_0x98f13b[_0x2bd584(0x19f)](_0x2bd584(0x12a)+_0x100424[_0x2bd584(0x199)]+'/'+_0x100424[_0x2bd584(0x199)]+'\x27')<0x0&&(_0x98f13b=_0x98f13b[_0x2bd584(0x191)](/\/\* EXPORT ENTITY TYPES \*\//,_0x2bd584(0x168)+_0x100424['name']+'/'+_0x100424['name']+'\x27')),_0x98f13b[_0x2bd584(0x19f)](_0x2bd584(0x177)+_0x100424[_0x2bd584(0x183)]+_0x2bd584(0x138)+_0x100424[_0x2bd584(0x183)]+_0x2bd584(0x126)+_0x100424[_0x2bd584(0x199)]+'\x27')<0x0&&(_0x98f13b=_0x98f13b[_0x2bd584(0x191)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x2bd584(0x112)+_0x100424['pascalCaseName']+_0x2bd584(0x138)+_0x100424[_0x2bd584(0x183)]+_0x2bd584(0x126)+_0x100424['name']+'\x27')),_0x98f13b['indexOf'](_0x2bd584(0x118)+_0x100424[_0x2bd584(0x183)]+_0x2bd584(0x140))<0x0&&(_0x98f13b=_0x98f13b['replace'](/\/\* ENTITIES \*\//,_0x2bd584(0x133)+_0x100424[_0x2bd584(0x183)]+'Entities,')),_0x98f13b['indexOf'](_0x2bd584(0x118)+_0x100424['pascalCaseName']+_0x2bd584(0x146))<0x0&&(_0x98f13b=_0x98f13b[_0x2bd584(0x191)](/\/\* RESOLVER CLASSES \*\//,_0x2bd584(0x192)+_0x100424[_0x2bd584(0x183)]+_0x2bd584(0x146))),await this[_0x2bd584(0x182)](_0x5d67d1,_0x98f13b,_0x100424);}[a0_0x418395(0x17d)](_0x3f8a14){const _0x421a1f=a0_0x418395;let _0x39f56d=sereviceType,_0x2152de=_0x3f8a14[_0x421a1f(0x147)](_0x5bcbd2=>{const _0x41bcb9=_0x421a1f;if('id'==_0x5bcbd2['name'])return'';if(_0x41bcb9(0x15b)==_0x5bcbd2['name'])return'';if(_0x41bcb9(0x167)==_0x5bcbd2['name'])return'';if(_0x41bcb9(0x16a)==_0x5bcbd2[_0x41bcb9(0x199)])return'';if(_0x41bcb9(0x12c)==_0x5bcbd2['name'])return'';if(_0x41bcb9(0x11b)==_0x5bcbd2[_0x41bcb9(0x199)])return'';let _0x3bb98b=this['getFieldType'](_0x5bcbd2),_0x5da619=this[_0x41bcb9(0x13c)](_0x5bcbd2),_0x305873=camelCase(_0x5bcbd2[_0x41bcb9(0x199)]);return'\x20\x20'+(_0x41bcb9(0x145)+(0x0==_0x3bb98b['length']?'':_0x41bcb9(0x165)+_0x3bb98b+',')+'\x20{\x20nullable:\x20'+_0x5bcbd2[_0x41bcb9(0x18b)]+_0x41bcb9(0x157))+_0x41bcb9(0x187)+(''+_0x305873+(_0x5bcbd2[_0x41bcb9(0x18b)]?'?':'')+':\x20'+_0x5da619)+'\x0a';});_0x39f56d=_0x39f56d[_0x421a1f(0x191)](/{{newTypeColumns}}/g,_0x2152de[_0x421a1f(0x179)]('\x0a'));let _0x4c4f02=_0x3f8a14[_0x421a1f(0x147)](_0x368d60=>{const _0xbebc20=_0x421a1f;if('id'==_0x368d60[_0xbebc20(0x199)])return'';if('domain_id'==_0x368d60['name'])return'';if('created_at'==_0x368d60[_0xbebc20(0x199)])return'';if(_0xbebc20(0x16a)==_0x368d60[_0xbebc20(0x199)])return'';if('creator_id'==_0x368d60[_0xbebc20(0x199)])return'';if(_0xbebc20(0x11b)==_0x368d60[_0xbebc20(0x199)])return'';let _0xe8a90f=this[_0xbebc20(0x19b)](_0x368d60),_0x21d352=this[_0xbebc20(0x13c)](_0x368d60);_0x368d60[_0xbebc20(0x18b)]=!0x0;let _0x3a1788=camelCase(_0x368d60['name']);return'\x20\x20'+(_0xbebc20(0x145)+(0x0==_0xe8a90f[_0xbebc20(0x19a)]?'':_0xbebc20(0x165)+_0xe8a90f+',')+_0xbebc20(0x1a2)+_0x368d60[_0xbebc20(0x18b)]+_0xbebc20(0x157))+'\x0a\x20\x20'+(''+_0x3a1788+(_0x368d60[_0xbebc20(0x18b)]?'?':'')+':\x20'+_0x21d352)+'\x0a';});return _0x39f56d=_0x39f56d[_0x421a1f(0x191)](/{{patchTypeColumns}}/g,_0x4c4f02[_0x421a1f(0x179)]('\x0a')),_0x39f56d;}[a0_0x418395(0x11c)](_0x3a40f5,_0x37555f){const _0x4e94ad=a0_0x418395;let _0x4c6dc2=serviceEntity,_0x14827f=_0x37555f[_0x4e94ad(0x148)](function(_0x166e25,_0x70567c){const _0x4b80e5=_0x4e94ad;return _0x166e25[_0x4b80e5(0x124)]-_0x70567c[_0x4b80e5(0x124)];})['map'](_0x58d5e1=>this[_0x4e94ad(0x184)](_0x58d5e1));['COPY',_0x4e94ad(0x117)]['includes'](_0x3a40f5[_0x4e94ad(0x143)])&&_0x14827f['push'](_0x4e94ad(0x16f)),_0x4c6dc2=_0x4c6dc2[_0x4e94ad(0x191)](/{{entityColumns}}/g,_0x14827f['join']('\x0a'));let _0x31ebab='',_0x154e21=_0x37555f['filter'](_0x7e9bc8=>_0x7e9bc8[_0x4e94ad(0x155)]&&_0x7e9bc8[_0x4e94ad(0x155)]>0x0)[_0x4e94ad(0x148)](function(_0x17d163,_0x142aae){const _0x14bccc=_0x4e94ad;return _0x17d163['uniqRank']-_0x142aae[_0x14bccc(0x155)];});if(_0x154e21[_0x4e94ad(0x19a)]>0x0){_0x31ebab=_0x4e94ad(0x150);let _0x2dde38=_0x154e21[_0x4e94ad(0x147)](_0x55439c=>{const _0x3f7176=_0x4e94ad;let _0x10a8cc=_0x55439c[_0x3f7176(0x199)];return _0x3f7176(0x15b)==_0x55439c[_0x3f7176(0x199)]&&(_0x10a8cc=_0x3f7176(0x15c)),_0x3f7176(0x12c)==_0x55439c[_0x3f7176(0x199)]&&(_0x10a8cc='creator'),_0x3f7176(0x11b)==_0x55439c['name']&&(_0x10a8cc=_0x3f7176(0x13d)),_0x3f7176(0x163)+camelCase(_0x10a8cc);});_0x31ebab=_0x31ebab[_0x4e94ad(0x191)](/{{indexColumns}}/g,_0x2dde38[_0x4e94ad(0x179)](','));}return _0x4c6dc2=_0x4c6dc2['replace'](/{{indexAnn}}/g,_0x31ebab),_0x4c6dc2;}[a0_0x418395(0x173)](_0x23fd0d,_0x274712){const _0x21e654=a0_0x418395;let _0x5b9715='JSON'==_0x23fd0d[_0x21e654(0x143)]?serviceEntityHistJson:serviceEntityHistCopy,_0x3c4555=_0x274712[_0x21e654(0x148)](function(_0x10a356,_0x4dbd19){return _0x10a356['rank']-_0x4dbd19['rank'];})[_0x21e654(0x147)](_0x8a4b52=>this[_0x21e654(0x184)](_0x8a4b52));return _0x5b9715=_0x5b9715[_0x21e654(0x191)](/{{entityColumns}}/g,_0x3c4555[_0x21e654(0x179)]('\x0a')),_0x5b9715;}[a0_0x418395(0x184)](_0x56f9a3){const _0x3d695a=a0_0x418395;if('id'==_0x56f9a3[_0x3d695a(0x199)])return'';if(_0x3d695a(0x15b)==_0x56f9a3[_0x3d695a(0x199)])return'';if(_0x3d695a(0x167)==_0x56f9a3[_0x3d695a(0x199)])return'';if('updated_at'==_0x56f9a3[_0x3d695a(0x199)])return'';if(_0x3d695a(0x12c)==_0x56f9a3[_0x3d695a(0x199)])return'';if(_0x3d695a(0x11b)==_0x56f9a3[_0x3d695a(0x199)])return'';let _0x517a55=_0x56f9a3[_0x3d695a(0x193)];_0x3d695a(0x129)==_0x56f9a3[_0x3d695a(0x193)]&&(_0x517a55=_0x3d695a(0x16b)),_0x3d695a(0x135)==_0x56f9a3[_0x3d695a(0x193)]&&(_0x517a55=_0x3d695a(0x12d)),'string'==_0x56f9a3[_0x3d695a(0x193)]&&(_0x517a55=_0x3d695a(0x11a)),'datetime'==_0x56f9a3[_0x3d695a(0x193)]&&(_0x517a55='timestamp\x20without\x20time\x20zone');let _0x208a78='';'string'==_0x56f9a3[_0x3d695a(0x193)]&&(_0x208a78=_0x56f9a3[_0x3d695a(0x195)]);let _0x427d84=this[_0x3d695a(0x19b)](_0x56f9a3),_0x25490f=this[_0x3d695a(0x13c)](_0x56f9a3),_0x3a6a8a=camelCase(_0x56f9a3['name']);return'\x20\x20'+(_0x3d695a(0x141)+_0x56f9a3[_0x3d695a(0x199)]+_0x3d695a(0x136)+_0x517a55+_0x3d695a(0x152)+_0x56f9a3['nullable']+'\x20'+(0x0==_0x208a78[_0x3d695a(0x19a)]?'':_0x3d695a(0x154)+_0x208a78)+_0x3d695a(0x157))+_0x3d695a(0x187)+(_0x3d695a(0x145)+(0x0==_0x427d84['length']?'':_0x3d695a(0x165)+_0x427d84+',')+_0x3d695a(0x1a2)+_0x56f9a3[_0x3d695a(0x18b)]+_0x3d695a(0x157))+_0x3d695a(0x187)+(''+_0x3a6a8a+(_0x56f9a3[_0x3d695a(0x18b)]?'?':'')+':\x20'+_0x25490f)+'\x0a';}['getFieldType'](_0x3dc617){const _0x46e2ad=a0_0x418395;let _0x4640c3='';return _0x46e2ad(0x129)==_0x3dc617[_0x46e2ad(0x193)]&&(_0x4640c3=_0x46e2ad(0x14b)),_0x46e2ad(0x14e)==_0x3dc617[_0x46e2ad(0x193)]&&(_0x4640c3=_0x46e2ad(0x14b)),_0x46e2ad(0x135)==_0x3dc617[_0x46e2ad(0x193)]&&(_0x4640c3=_0x46e2ad(0x18d)),_0x46e2ad(0x13e)==_0x3dc617['colType']&&(_0x4640c3='Int'),_0x4640c3;}[a0_0x418395(0x13c)](_0xba50ca){const _0x267b77=a0_0x418395;let _0x46f046=_0xba50ca[_0x267b77(0x193)];return _0x267b77(0x16c)==_0xba50ca['colType']&&(_0x46f046=_0x267b77(0x175)),_0x267b77(0x129)==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046='number'),_0x267b77(0x14e)==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046=_0x267b77(0x175)),'integer'==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046=_0x267b77(0x175)),_0x267b77(0x135)==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046=_0x267b77(0x175)),'datetime'==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046=_0x267b77(0x17e)),_0x267b77(0x190)==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046=_0x267b77(0x17e)),'text'==_0xba50ca[_0x267b77(0x193)]&&(_0x46f046=_0x267b77(0x17f)),_0x46f046;}async[a0_0x418395(0x182)](_0x5b92d0,_0x27b747,_0x27492a){const _0x191f12=a0_0x418395;await fs[_0x191f12(0x180)](_0x5b92d0,this[_0x191f12(0x12f)](_0x27b747,_0x27492a),'utf8');}[a0_0x418395(0x12f)](_0x2fcdf5,_0x5487ff){const _0x471e08=a0_0x418395;return _0x2fcdf5[_0x471e08(0x191)](/{{pascalCase name}}/g,_0x5487ff[_0x471e08(0x183)])['replace'](/{{camelCase name}}/g,_0x5487ff['camelCaseName'])[_0x471e08(0x191)](/{{snakeCase name}}/g,_0x5487ff['snakeCaseName'])['replace'](/{{pluralPascalCase name}}/g,_0x5487ff['pluralPascalCaseName'])[_0x471e08(0x191)](/{{pluralCamelCase name}}/g,_0x5487ff[_0x471e08(0x161)])[_0x471e08(0x191)](/{{tableName}}/g,_0x5487ff[_0x471e08(0x14c)])[_0x471e08(0x191)](/{{name}}/g,_0x5487ff[_0x471e08(0x199)]);}async[a0_0x418395(0x16d)](_0x4d6efb,_0xd6c87e,_0x3d05d0){const _0x585deb=a0_0x418395;let _0x3f4217=_0x4d6efb+_0x585deb(0x114);await this[_0x585deb(0x130)](_0x3f4217),_0x3f4217=_0x3f4217+'/'+_0xd6c87e,await this[_0x585deb(0x130)](_0x3f4217),_0x3f4217+=_0x585deb(0x174),await this[_0x585deb(0x130)](_0x3f4217),_0x3f4217+='/service',await this[_0x585deb(0x130)](_0x3f4217),_0x3f4217=_0x3f4217+'/'+_0x3d05d0,await this[_0x585deb(0x130)](_0x3f4217);}[a0_0x418395(0x12b)](){const _0x5cf53c=a0_0x418395;let _0x5f10ae=process[_0x5cf53c(0x151)][_0x5cf53c(0x188)][_0x5cf53c(0x18e)]('/'),_0x81c993=[];for(let _0x37f7f5=0x0;_0x37f7f5<_0x5f10ae['length']&&'packages'!=_0x5f10ae[_0x37f7f5];_0x37f7f5++)_0x81c993[_0x5cf53c(0x181)](_0x5f10ae[_0x37f7f5]);return _0x81c993['join']('/');}async['createDir'](_0xb983fe){const _0x202813=a0_0x418395;0x0==await this[_0x202813(0x170)](_0xb983fe)&&fs[_0x202813(0x15a)](_0xb983fe);}async[a0_0x418395(0x170)](_0x742ea0){const _0x5355d4=a0_0x418395;return await fs[_0x5355d4(0x172)](_0x742ea0);}};function a0_0x48a2(_0x34aec2,_0xc9adda){const _0x46704f=a0_0x4670();return a0_0x48a2=function(_0x48a2c0,_0x58ce25){_0x48a2c0=_0x48a2c0-0x111;let _0x1494ac=_0x46704f[_0x48a2c0];return _0x1494ac;},a0_0x48a2(_0x34aec2,_0xc9adda);}tslib_1[a0_0x418395(0x19e)]([(0x0,type_graphql_1['Query'])(_0x604900=>Boolean,{'description':a0_0x418395(0x189)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x418395(0x134)])('id')),tslib_1[a0_0x418395(0x125)](0x1,(0x0,type_graphql_1[a0_0x418395(0x197)])()),tslib_1['__metadata'](a0_0x418395(0x14f),Function),tslib_1[a0_0x418395(0x122)](a0_0x418395(0x18c),[String,Object]),tslib_1['__metadata'](a0_0x418395(0x13a),Promise)],OperatoToolCreateService[a0_0x418395(0x166)],a0_0x418395(0x169),null),OperatoToolCreateService=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x418395(0x14a)])()],OperatoToolCreateService),exports[a0_0x418395(0x196)]=OperatoToolCreateService;const allIndex=a0_0x418395(0x18f),serviceIndex=a0_0x418395(0x1a4),serviceHistoryIndex=a0_0x418395(0x19d),serviceQuery=a0_0x418395(0x156),serviceHistoryQuery=a0_0x418395(0x17a),serviceMutation=a0_0x418395(0x159),sereviceType=a0_0x418395(0x17b),sereviceHistoryType='\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a',serviceEntity='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20Domain\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0a@Entity(\x27{{tableName}}\x27)\x0a{{indexAnn}}\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}\x20{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntityHistCopy=a0_0x418395(0x120),serviceEntityHistJson='\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',serviceEntitySubscriber=a0_0x418395(0x128);
@@ -1 +1 @@
1
- 'use strict';const a0_0x138282=a0_0x5e5b;function a0_0x5e5b(_0x54b9f5,_0x45d234){const _0x84ab8c=a0_0x84ab();return a0_0x5e5b=function(_0x5e5b6a,_0x3f7891){_0x5e5b6a=_0x5e5b6a-0x11c;let _0x546a10=_0x84ab8c[_0x5e5b6a];return _0x546a10;},a0_0x5e5b(_0x54b9f5,_0x45d234);}(function(_0x5f5170,_0x2a085d){const _0x3f7fbd=a0_0x5e5b,_0x56d921=_0x5f5170();while(!![]){try{const _0x4d767f=parseInt(_0x3f7fbd(0x121))/0x1*(parseInt(_0x3f7fbd(0x125))/0x2)+parseInt(_0x3f7fbd(0x131))/0x3+parseInt(_0x3f7fbd(0x13e))/0x4*(parseInt(_0x3f7fbd(0x134))/0x5)+-parseInt(_0x3f7fbd(0x122))/0x6+parseInt(_0x3f7fbd(0x133))/0x7+-parseInt(_0x3f7fbd(0x12f))/0x8*(parseInt(_0x3f7fbd(0x129))/0x9)+parseInt(_0x3f7fbd(0x130))/0xa*(parseInt(_0x3f7fbd(0x13b))/0xb);if(_0x4d767f===_0x2a085d)break;else _0x56d921['push'](_0x56d921['shift']());}catch(_0x13f49d){_0x56d921['push'](_0x56d921['shift']());}}}(a0_0x84ab,0x845a0));function a0_0x84ab(){const _0xb0f85d=['LicenseError','@things-factory/menu-base','map','manager','Permissions\x20For\x20Tailor\x20Tool','where','1353TtfleY','ERROR_CODES','select','32ZEikWf','getPermission','INVALID_LICENSE','defineProperty','trim','checkStudioPermission','getRepository','forEach','id\x20!=\x20:id','includes','8blWZUD','2067744SsNoOQ','Menu','OVER_LIMIT','54560rRCgGE','Studio','split','createQueryBuilder','45891DKfVnz','__esModule','menu','checkStudioTemplateIsOverLimit','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','getCount','536JhAxIz','6000OjvnTm','893880WsHxhH','andWhere','3065671nSeHod','125260PvTIPM'];a0_0x84ab=function(){return _0xb0f85d;};return a0_0x84ab();}Object[a0_0x138282(0x141)](exports,a0_0x138282(0x12a),{'value':!0x0}),exports[a0_0x138282(0x12c)]=exports[a0_0x138282(0x11c)]=void 0x0;const operato_license_checker_1=require('@things-factory/operato-license-checker'),shell_1=require('@things-factory/shell'),menu_base_1=require(a0_0x138282(0x136)),license_error_1=require('../../errors/license-error');async function checkStudioPermission(){const _0x3bef5b=a0_0x138282;let _0x4ecda4=((0x0,operato_license_checker_1[_0x3bef5b(0x13f)])(_0x3bef5b(0x139))||',')[_0x3bef5b(0x127)](',')[_0x3bef5b(0x137)](_0xbdcc01=>_0xbdcc01[_0x3bef5b(0x142)]()),_0x190c93=!0x1;return _0x4ecda4[_0x3bef5b(0x11e)](_0x5ed998=>{const _0x2ceef8=_0x3bef5b;_0x5ed998[_0x2ceef8(0x120)](_0x2ceef8(0x126))&&(_0x190c93=!0x0);}),_0x190c93;}async function checkStudioTemplateIsOverLimit(_0x460afb,_0x4a9854){const _0x3f13b0=a0_0x138282;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x3f13b0(0x135))]({'errorCode':_0x4a9854['t'](license_error_1[_0x3f13b0(0x135)][_0x3f13b0(0x13c)][_0x3f13b0(0x140)])});var _0x57f3a1=0x0;if(_0x57f3a1=_0x460afb&&''!=_0x460afb?await(0x0,shell_1[_0x3f13b0(0x11d)])(menu_base_1[_0x3f13b0(0x123)])[_0x3f13b0(0x138)][_0x3f13b0(0x128)]()[_0x3f13b0(0x13d)](_0x3f13b0(0x12b))['from'](menu_base_1[_0x3f13b0(0x123)],_0x3f13b0(0x12b))[_0x3f13b0(0x13a)](_0x3f13b0(0x11f),{'id':_0x460afb})[_0x3f13b0(0x132)](_0x3f13b0(0x12d))['getCount']()+0x1:await(0x0,shell_1[_0x3f13b0(0x11d)])(menu_base_1[_0x3f13b0(0x123)])['manager'][_0x3f13b0(0x128)]()[_0x3f13b0(0x13d)](_0x3f13b0(0x12b))['from'](menu_base_1[_0x3f13b0(0x123)],_0x3f13b0(0x12b))[_0x3f13b0(0x13a)](_0x3f13b0(0x12d))[_0x3f13b0(0x12e)]()+0x1,!(0x0,operato_license_checker_1['checkTarget'])(_0x57f3a1))throw new license_error_1[(_0x3f13b0(0x135))]({'errorCode':_0x4a9854['t'](license_error_1['LicenseError'][_0x3f13b0(0x13c)][_0x3f13b0(0x124)])});return!0x0;}exports[a0_0x138282(0x11c)]=checkStudioPermission,exports[a0_0x138282(0x12c)]=checkStudioTemplateIsOverLimit;
1
+ 'use strict';const a0_0x277ba7=a0_0x35f4;(function(_0xff84b3,_0x254b81){const _0xfa00=a0_0x35f4,_0x5117f1=_0xff84b3();while(!![]){try{const _0x4fd870=-parseInt(_0xfa00(0x190))/0x1*(-parseInt(_0xfa00(0x19c))/0x2)+parseInt(_0xfa00(0x1a7))/0x3*(-parseInt(_0xfa00(0x1b1))/0x4)+-parseInt(_0xfa00(0x18d))/0x5+-parseInt(_0xfa00(0x1a4))/0x6+-parseInt(_0xfa00(0x194))/0x7*(-parseInt(_0xfa00(0x1a3))/0x8)+-parseInt(_0xfa00(0x19d))/0x9*(parseInt(_0xfa00(0x18a))/0xa)+-parseInt(_0xfa00(0x195))/0xb*(-parseInt(_0xfa00(0x1ad))/0xc);if(_0x4fd870===_0x254b81)break;else _0x5117f1['push'](_0x5117f1['shift']());}catch(_0x1517d2){_0x5117f1['push'](_0x5117f1['shift']());}}}(a0_0x55fa,0x6d775));Object[a0_0x277ba7(0x1ab)](exports,'__esModule',{'value':!0x0}),exports[a0_0x277ba7(0x1b0)]=exports[a0_0x277ba7(0x1a9)]=void 0x0;const operato_license_checker_1=require('@things-factory/operato-license-checker'),shell_1=require(a0_0x277ba7(0x18b)),menu_base_1=require(a0_0x277ba7(0x1a0)),license_error_1=require(a0_0x277ba7(0x192));async function checkStudioPermission(){const _0x50c054=a0_0x277ba7;let _0xc2d202=((0x0,operato_license_checker_1[_0x50c054(0x18e)])(_0x50c054(0x199))||',')[_0x50c054(0x193)](',')[_0x50c054(0x1a8)](_0x520649=>_0x520649[_0x50c054(0x1aa)]()),_0x4b5691=!0x1;return _0xc2d202['forEach'](_0xeff7b3=>{const _0x5d940d=_0x50c054;_0xeff7b3[_0x5d940d(0x19f)](_0x5d940d(0x1a6))&&(_0x4b5691=!0x0);}),_0x4b5691;}function a0_0x35f4(_0x5c3c5c,_0x247d21){const _0x55fa46=a0_0x55fa();return a0_0x35f4=function(_0x35f458,_0x1dcea0){_0x35f458=_0x35f458-0x189;let _0x1f6e6b=_0x55fa46[_0x35f458];return _0x1f6e6b;},a0_0x35f4(_0x5c3c5c,_0x247d21);}async function checkStudioTemplateIsOverLimit(_0x25c50d,_0x2232e9){const _0x5a159a=a0_0x277ba7;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x5a159a(0x19b))]({'errorCode':_0x2232e9['t'](license_error_1['LicenseError'][_0x5a159a(0x1ac)][_0x5a159a(0x1a1)])});var _0x5e1301=0x0;if(_0x5e1301=_0x25c50d&&''!=_0x25c50d?await(0x0,shell_1['getRepository'])(menu_base_1['Menu'])['manager']['createQueryBuilder']()[_0x5a159a(0x19a)](_0x5a159a(0x191))['from'](menu_base_1[_0x5a159a(0x18c)],_0x5a159a(0x191))[_0x5a159a(0x197)]('id\x20!=\x20:id',{'id':_0x25c50d})[_0x5a159a(0x189)](_0x5a159a(0x1ae))[_0x5a159a(0x1a5)]()+0x1:await(0x0,shell_1[_0x5a159a(0x1a2)])(menu_base_1['Menu'])[_0x5a159a(0x18f)][_0x5a159a(0x196)]()[_0x5a159a(0x19a)](_0x5a159a(0x191))[_0x5a159a(0x198)](menu_base_1[_0x5a159a(0x18c)],_0x5a159a(0x191))[_0x5a159a(0x197)](_0x5a159a(0x1ae))[_0x5a159a(0x1a5)]()+0x1,!(0x0,operato_license_checker_1[_0x5a159a(0x19e)])(_0x5e1301))throw new license_error_1[(_0x5a159a(0x19b))]({'errorCode':_0x2232e9['t'](license_error_1[_0x5a159a(0x19b)][_0x5a159a(0x1ac)][_0x5a159a(0x1af)])});return!0x0;}function a0_0x55fa(){const _0x4d4065=['Studio','3ESQoMq','map','checkStudioPermission','trim','defineProperty','ERROR_CODES','12VYIMec','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','OVER_LIMIT','checkStudioTemplateIsOverLimit','2371060NDLhqF','andWhere','80rDWoHM','@things-factory/shell','Menu','1538190OqzKHT','getPermission','manager','2439IkRefE','menu','../../errors/license-error','split','7wfVDyY','19144532hNoEAw','createQueryBuilder','where','from','Permissions\x20For\x20Tailor\x20Tool','select','LicenseError','40WaNCha','844407YkWdDF','checkTarget','includes','@things-factory/menu-base','INVALID_LICENSE','getRepository','4433512LKjIXt','1464126GOZMfC','getCount'];a0_0x55fa=function(){return _0x4d4065;};return a0_0x55fa();}exports['checkStudioPermission']=checkStudioPermission,exports[a0_0x277ba7(0x1b0)]=checkStudioTemplateIsOverLimit;
@@ -1 +1 @@
1
- 'use strict';const a0_0x5ec864=a0_0x47a6;(function(_0x5553ae,_0x6deb3b){const _0xaeede1=a0_0x47a6,_0x6fa44a=_0x5553ae();while(!![]){try{const _0x33f76f=parseInt(_0xaeede1(0xcf))/0x1+-parseInt(_0xaeede1(0xc2))/0x2+-parseInt(_0xaeede1(0xcd))/0x3*(-parseInt(_0xaeede1(0xc8))/0x4)+parseInt(_0xaeede1(0xbc))/0x5+-parseInt(_0xaeede1(0xbe))/0x6+parseInt(_0xaeede1(0xba))/0x7+-parseInt(_0xaeede1(0xc3))/0x8;if(_0x33f76f===_0x6deb3b)break;else _0x6fa44a['push'](_0x6fa44a['shift']());}catch(_0x3c6a42){_0x6fa44a['push'](_0x6fa44a['shift']());}}}(a0_0x3749,0x1fc24));function a0_0x47a6(_0x574d7e,_0x477717){const _0x374985=a0_0x3749();return a0_0x47a6=function(_0x47a6b5,_0x47f593){_0x47a6b5=_0x47a6b5-0xb7;let _0x4c347a=_0x374985[_0x47a6b5];return _0x4c347a;},a0_0x47a6(_0x574d7e,_0x477717);}Object[a0_0x5ec864(0xb7)](exports,a0_0x5ec864(0xca),{'value':!0x0}),exports[a0_0x5ec864(0xcc)]=void 0x0;function a0_0x3749(){const _0x525d14=['__esModule','prototype','OperatoToolResolver','36cXvqnF','studioTemplateIsOverLimit','79504DLoSsi','Resolver','Query','./tool-permission','defineProperty','Operato\x20Tool\x20Studio\x20Usage\x20Permissions','checkStudioTemplateIsOverLimit','1447292SeBZUN','__metadata','782055ojwkAt','design:returntype','135144KIgWSX','__decorate','design:type','Arg','189066sRxQgz','3042448ZdHZyz','Ctx','tslib','studioPermission','design:paramtypes','61592cxqwrB','__param'];a0_0x3749=function(){return _0x525d14;};return a0_0x3749();}const tslib_1=require(a0_0x5ec864(0xc5)),type_graphql_1=require('type-graphql'),tool_permission_1=require(a0_0x5ec864(0xd2));let OperatoToolResolver=class{async['studioPermission'](_0x1f998b){return(0x0,tool_permission_1['checkStudioPermission'])();}async[a0_0x5ec864(0xce)](_0x64a100,_0x310ae2){const _0x43f31a=a0_0x5ec864;return(0x0,tool_permission_1[_0x43f31a(0xb9)])(_0x64a100,_0x310ae2);}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x5ec864(0xd1)])(_0x212767=>Boolean,{'description':a0_0x5ec864(0xb8)}),tslib_1[a0_0x5ec864(0xc9)](0x0,(0x0,type_graphql_1[a0_0x5ec864(0xc4)])()),tslib_1['__metadata']('design:type',Function),tslib_1['__metadata'](a0_0x5ec864(0xc7),[Object]),tslib_1['__metadata'](a0_0x5ec864(0xbd),Promise)],OperatoToolResolver['prototype'],a0_0x5ec864(0xc6),null),tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x5ec864(0xd1)])(_0x2aa1e1=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Limit\x20check'}),tslib_1[a0_0x5ec864(0xc9)](0x0,(0x0,type_graphql_1[a0_0x5ec864(0xc1)])('id')),tslib_1[a0_0x5ec864(0xc9)](0x1,(0x0,type_graphql_1[a0_0x5ec864(0xc4)])()),tslib_1[a0_0x5ec864(0xbb)](a0_0x5ec864(0xc0),Function),tslib_1[a0_0x5ec864(0xbb)](a0_0x5ec864(0xc7),[String,Object]),tslib_1[a0_0x5ec864(0xbb)](a0_0x5ec864(0xbd),Promise)],OperatoToolResolver[a0_0x5ec864(0xcb)],a0_0x5ec864(0xce),null),OperatoToolResolver=tslib_1[a0_0x5ec864(0xbf)]([(0x0,type_graphql_1[a0_0x5ec864(0xd0)])()],OperatoToolResolver),exports[a0_0x5ec864(0xcc)]=OperatoToolResolver;
1
+ 'use strict';const a0_0x25d2ec=a0_0x16c2;function a0_0x16c2(_0x25d2c2,_0x1db8b1){const _0x3c8706=a0_0x3c87();return a0_0x16c2=function(_0x16c20d,_0x563ec2){_0x16c20d=_0x16c20d-0x10a;let _0x50d844=_0x3c8706[_0x16c20d];return _0x50d844;},a0_0x16c2(_0x25d2c2,_0x1db8b1);}(function(_0xccc349,_0x1523e3){const _0x4ebde5=a0_0x16c2,_0x7d8b07=_0xccc349();while(!![]){try{const _0xeb3f26=parseInt(_0x4ebde5(0x11e))/0x1+parseInt(_0x4ebde5(0x126))/0x2+parseInt(_0x4ebde5(0x10e))/0x3+parseInt(_0x4ebde5(0x112))/0x4*(parseInt(_0x4ebde5(0x115))/0x5)+-parseInt(_0x4ebde5(0x120))/0x6+-parseInt(_0x4ebde5(0x124))/0x7*(parseInt(_0x4ebde5(0x11f))/0x8)+parseInt(_0x4ebde5(0x11b))/0x9*(-parseInt(_0x4ebde5(0x121))/0xa);if(_0xeb3f26===_0x1523e3)break;else _0x7d8b07['push'](_0x7d8b07['shift']());}catch(_0x164fd2){_0x7d8b07['push'](_0x7d8b07['shift']());}}}(a0_0x3c87,0xa1484));function a0_0x3c87(){const _0x222e33=['482980DYAkae','8Fqrsdv','706380EqzPEB','190nmyNCz','__decorate','design:paramtypes','2779553kchEcs','prototype','1118402NtqibU','Arg','Ctx','tslib','__param','1787145dplhyM','Operato\x20Tool\x20Studio\x20Limit\x20check','design:returntype','studioPermission','556044ZeCpxs','checkStudioPermission','OperatoToolResolver','30VlLTYu','__metadata','Query','checkStudioTemplateIsOverLimit','Operato\x20Tool\x20Studio\x20Usage\x20Permissions','studioTemplateIsOverLimit','614151jVaXVm','Resolver','defineProperty'];a0_0x3c87=function(){return _0x222e33;};return a0_0x3c87();}Object[a0_0x25d2ec(0x11d)](exports,'__esModule',{'value':!0x0}),exports[a0_0x25d2ec(0x114)]=void 0x0;const tslib_1=require(a0_0x25d2ec(0x10c)),type_graphql_1=require('type-graphql'),tool_permission_1=require('./tool-permission');let OperatoToolResolver=class{async['studioPermission'](_0x251c93){const _0xf275f1=a0_0x25d2ec;return(0x0,tool_permission_1[_0xf275f1(0x113)])();}async[a0_0x25d2ec(0x11a)](_0x905dc2,_0x3a86a7){const _0x1fa1cc=a0_0x25d2ec;return(0x0,tool_permission_1[_0x1fa1cc(0x118)])(_0x905dc2,_0x3a86a7);}};tslib_1[a0_0x25d2ec(0x122)]([(0x0,type_graphql_1[a0_0x25d2ec(0x117)])(_0x3ce982=>Boolean,{'description':a0_0x25d2ec(0x119)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x25d2ec(0x10b)])()),tslib_1['__metadata']('design:type',Function),tslib_1[a0_0x25d2ec(0x116)]('design:paramtypes',[Object]),tslib_1[a0_0x25d2ec(0x116)](a0_0x25d2ec(0x110),Promise)],OperatoToolResolver[a0_0x25d2ec(0x125)],a0_0x25d2ec(0x111),null),tslib_1[a0_0x25d2ec(0x122)]([(0x0,type_graphql_1[a0_0x25d2ec(0x117)])(_0x51d90d=>Boolean,{'description':a0_0x25d2ec(0x10f)}),tslib_1[a0_0x25d2ec(0x10d)](0x0,(0x0,type_graphql_1[a0_0x25d2ec(0x10a)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x25d2ec(0x10b)])()),tslib_1[a0_0x25d2ec(0x116)]('design:type',Function),tslib_1['__metadata'](a0_0x25d2ec(0x123),[String,Object]),tslib_1[a0_0x25d2ec(0x116)](a0_0x25d2ec(0x110),Promise)],OperatoToolResolver[a0_0x25d2ec(0x125)],a0_0x25d2ec(0x11a),null),OperatoToolResolver=tslib_1[a0_0x25d2ec(0x122)]([(0x0,type_graphql_1[a0_0x25d2ec(0x11c)])()],OperatoToolResolver),exports[a0_0x25d2ec(0x114)]=OperatoToolResolver;