@things-factory/operato-tools 6.1.74 → 6.1.75
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.
- package/client/actions/main.js +1 -1
- package/client/pages/generator/button-config-tab-mixin.js +4 -4
- package/client/pages/generator/column-config-tab-mixin.js +4 -4
- package/client/pages/generator/etc-config-tab-mixin.js +4 -4
- package/client/pages/generator/form-config-tab-mixin.js +4 -4
- package/client/pages/generator/graphql-config-tab-mixin.js +24 -24
- package/client/pages/generator/grid-config-tab-mixin.js +23 -23
- package/client/pages/generator/grid-emphasized-config-tab-mixin.js +8 -8
- package/client/pages/generator/menu-config-tab-mixin.js +11 -11
- package/client/pages/generator/meta-generator-page.js +11 -11
- package/client/pages/generator/search-config-tab-mixin.js +4 -4
- package/client/pages/generator/tab-config-tab-mixin.js +4 -4
- package/client/pages/main.js +4 -4
- package/client/reducers/main.js +1 -1
- package/package.json +3 -3
- package/server/constants/error-code.js +1 -1
- package/server/errors/license-error.js +1 -1
- package/server/routes.js +1 -1
- package/server/service/tool-entity/create-menu.js +1 -1
- package/server/service/tool-entity/create-service.js +1 -1
- package/server/service/tool-secret/tool-permission.js +1 -1
- package/server/service/tool-secret/tool-resolver.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<ox-grist auto-fetch id="tab-tab-grid" .config=${this[
|
|
3
|
-
.fetchHandler=${this[
|
|
4
|
-
</ox-grist>`;}get[
|
|
1
|
+
const a0_0x4d2eea=a0_0x5d50;(function(_0x5c55ce,_0x4af57e){const _0x295e13=a0_0x5d50,_0x2848c6=_0x5c55ce();while(!![]){try{const _0x4041d6=parseInt(_0x295e13(0x19b))/0x1+parseInt(_0x295e13(0x1b8))/0x2+parseInt(_0x295e13(0x1b5))/0x3+parseInt(_0x295e13(0x19f))/0x4*(-parseInt(_0x295e13(0x1b3))/0x5)+parseInt(_0x295e13(0x1a4))/0x6+parseInt(_0x295e13(0x198))/0x7+parseInt(_0x295e13(0x1aa))/0x8*(-parseInt(_0x295e13(0x19e))/0x9);if(_0x4041d6===_0x4af57e)break;else _0x2848c6['push'](_0x2848c6['shift']());}catch(_0x5bfb18){_0x2848c6['push'](_0x2848c6['shift']());}}}(a0_0x36b7,0x39b92));import{html}from'lit-element';function a0_0x5d50(_0x1c20e2,_0x278a8c){const _0x36b725=a0_0x36b7();return a0_0x5d50=function(_0x5d5010,_0x136171){_0x5d5010=_0x5d5010-0x194;let _0x329b38=_0x36b725[_0x5d5010];return _0x329b38;},a0_0x5d50(_0x1c20e2,_0x278a8c);}import{MetaApi}from'@things-factory/meta-ui/client/utils/meta-api';import{TermsUtil}from'@things-factory/meta-ui/client/utils/terms-util';function a0_0x36b7(){const _0x408e58=['location','renderTabConfigTab','map','shadowRoot','button','parent_id','bind','icon','tab-tab-grid','setTabConfigTabValues','#tab-tab-grid','setTabConfigTabConfig','viewTabData','tagname','1212904vOjBIt','display','tLabel','157674KtAhcY','getGristGuttersConfig','tab','256869SsjWlW','86708doChvM','getGristSelectableConfig','params','param_field','string','147672UcXWmQ','page_location','tag','integer','getTabConfigTabValues','tabTabGrist','88dmNjdv','delete','name','sortRecordByRank','left','parent_field','rank','fetchTabTabHandler','routing','25LXgFjb','menu','861930oDfhwc','forEach','deleteRow','31804pssSCH','tabTabGridConfig'];a0_0x36b7=function(){return _0x408e58;};return a0_0x36b7();}export const TabConfigTabMixin=_0x4d6715=>class extends _0x4d6715{[a0_0x4d2eea(0x1c3)](_0x8b3415){const _0x3438ff=a0_0x4d2eea;let _0x157687=_0x8b3415?.[_0x3438ff(0x1bc)]((_0xd13406,_0x19a02d)=>{const _0x26401d=_0x3438ff;let _0x5eb22f=_0x19a02d+0x1,_0x3f1518={};return _0x3f1518['rank']=0xa*_0x5eb22f,_0x3f1518['id']=_0x5eb22f,_0x3f1518[_0x26401d(0x1ac)]=_0xd13406[_0x26401d(0x1ac)],_0x3f1518[_0x26401d(0x199)]=_0xd13406[_0x26401d(0x199)],_0x3f1518[_0x26401d(0x197)]=_0xd13406['tagname'],_0x3f1518[_0x26401d(0x1c1)]=_0xd13406[_0x26401d(0x1c1)],_0x3f1518[_0x26401d(0x1ba)]=_0xd13406[_0x26401d(0x1ba)],_0x3f1518['parent_field']=_0xd13406['parent_field'],_0x3f1518['param_field']=_0xd13406[_0x26401d(0x1a2)],_0x3f1518['menu']=_0xd13406[_0x26401d(0x1b4)],_0x3f1518;});this[_0x3438ff(0x196)]=_0x157687||[],this['tabTabGrist']?.['fetch']();}[a0_0x4d2eea(0x1a8)](){const _0x51a230=a0_0x4d2eea;let _0x2bd064={'tab':[]},_0x3eaa80=this['getElementValueById'](_0x51a230(0x1c2));return this[_0x51a230(0x1ad)](_0x3eaa80)?.[_0x51a230(0x1b6)](_0x2b7990=>{const _0x1b550a=_0x51a230;var {name:_0x5ee99e,display:_0x3e2faa,tagname:_0x210c58,location:_0x414d60,parent_field:_0x587281,param_field:_0x4e8231,menu:_0x27265e,icon:_0x15af13}=_0x2b7990;_0x5ee99e&&_0x210c58&&_0x414d60&&_0x27265e&&(_0x3e2faa||(_0x3e2faa=_0x5ee99e),_0x587281||(_0x587281='id'),_0x4e8231||(_0x4e8231='param_field'),_0x2bd064[_0x1b550a(0x19d)]['push']({'name':_0x5ee99e,'display':_0x3e2faa,'tagname':_0x210c58,'location':_0x414d60,'parent_field':_0x587281,'param_field':_0x4e8231,'menu':_0x27265e,'icon':_0x15af13}));}),_0x2bd064;}[a0_0x4d2eea(0x1bb)](){const _0x504678=a0_0x4d2eea;return html`
|
|
2
|
+
<ox-grist auto-fetch id="tab-tab-grid" .config=${this[_0x504678(0x1b9)]} .mode='GRID'
|
|
3
|
+
.fetchHandler=${this[_0x504678(0x1b1)][_0x504678(0x1c0)](this)}>
|
|
4
|
+
</ox-grist>`;}get[a0_0x4d2eea(0x1a9)](){const _0x14404c=a0_0x4d2eea;return this[_0x14404c(0x1bd)]['querySelector'](_0x14404c(0x194));}async[a0_0x4d2eea(0x1b1)](){const _0x479cc7=a0_0x4d2eea;return{'total':0x0,'records':this[_0x479cc7(0x196)]||[]};}async[a0_0x4d2eea(0x195)](){const _0x4a610b=a0_0x4d2eea;this[_0x4a610b(0x1b9)]={'rows':MetaApi[_0x4a610b(0x1a0)](!0x0),'pagination':{'infinite':!0x0},'sorters':[{'name':'rank','desc':!0x1}],'appendable':!0x0,'columns':[...MetaApi[_0x4a610b(0x19c)](!0x1,!0x1),{'type':'gutter','gutterName':_0x4a610b(0x1be),'icon':_0x4a610b(0x1ab),'handlers':{'click':(_0x5aa0f6,_0x492072,_0x120ba9,_0x53a3e4,_0xaee36a)=>{const _0x336bd=_0x4a610b;_0x53a3e4['id']&&this[_0x336bd(0x1b7)](this['tabTabGrist'],_0x53a3e4);}}},{'type':_0x4a610b(0x1a3),'name':'id','hidden':!0x0},{'type':_0x4a610b(0x1a7),'name':_0x4a610b(0x1b0),'header':TermsUtil[_0x4a610b(0x19a)](_0x4a610b(0x1b0)),'sortable':!0x1,'width':0x32,'record':{'align':'right','editable':!0x0,'mandatory':!0x0}},{'type':'string','name':'name','header':TermsUtil[_0x4a610b(0x19a)](_0x4a610b(0x1ac)),'sortable':!0x1,'width':0x6e,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':_0x4a610b(0x1a3),'name':_0x4a610b(0x199),'header':TermsUtil[_0x4a610b(0x19a)]('display'),'sortable':!0x1,'width':0x6e,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':'string','name':_0x4a610b(0x1c1),'header':TermsUtil[_0x4a610b(0x19a)]('icon'),'sortable':!0x0,'width':0x55,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':_0x4a610b(0x1a3),'name':_0x4a610b(0x1b4),'header':TermsUtil['tLabel'](_0x4a610b(0x1b2)),'sortable':!0x1,'width':0x96,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':_0x4a610b(0x1a3),'name':_0x4a610b(0x197),'header':TermsUtil[_0x4a610b(0x19a)](_0x4a610b(0x1a6)),'sortable':!0x1,'width':0x96,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':_0x4a610b(0x1a3),'name':'location','header':TermsUtil[_0x4a610b(0x19a)](_0x4a610b(0x1a5)),'sortable':!0x1,'width':0x145,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':'string','name':_0x4a610b(0x1af),'header':TermsUtil[_0x4a610b(0x19a)](_0x4a610b(0x1bf)),'sortable':!0x1,'width':0x64,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}},{'type':_0x4a610b(0x1a3),'name':_0x4a610b(0x1a2),'header':TermsUtil['tLabel'](_0x4a610b(0x1a1)),'sortable':!0x1,'width':0x5a,'record':{'align':_0x4a610b(0x1ae),'editable':!0x0,'mandatory':!0x0}}]};}};
|
package/client/pages/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a0_0xbea314=a0_0x2baf;function a0_0x2baf(_0x4076b4,_0x42db31){var _0xd595d5=a0_0xd595();return a0_0x2baf=function(_0x2bafe5,_0x1d5a10){_0x2bafe5=_0x2bafe5-0x1d6;var _0x301f10=_0xd595d5[_0x2bafe5];return _0x301f10;},a0_0x2baf(_0x4076b4,_0x42db31);}(function(_0x254ef7,_0x3d7532){var _0x55d176=a0_0x2baf,_0x3c7f37=_0x254ef7();while(!![]){try{var _0x27dc9d=parseInt(_0x55d176(0x1d9))/0x1+-parseInt(_0x55d176(0x1e3))/0x2*(parseInt(_0x55d176(0x1dc))/0x3)+parseInt(_0x55d176(0x1d7))/0x4*(-parseInt(_0x55d176(0x1d8))/0x5)+-parseInt(_0x55d176(0x1e1))/0x6*(parseInt(_0x55d176(0x1d6))/0x7)+parseInt(_0x55d176(0x1db))/0x8+-parseInt(_0x55d176(0x1e4))/0x9+-parseInt(_0x55d176(0x1e0))/0xa;if(_0x27dc9d===_0x3d7532)break;else _0x3c7f37['push'](_0x3c7f37['shift']());}catch(_0x385fd0){_0x3c7f37['push'](_0x3c7f37['shift']());}}}(a0_0xd595,0x27714));import{html,css}from'lit-element';import{connect}from'pwa-helpers/connect-mixin.js';import{store,PageView}from'@things-factory/shell';import{TermsUtil}from'@things-factory/meta-ui';class OperatoToolsMain extends connect(store)(PageView){static get[a0_0xbea314(0x1e5)](){return[css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
background-color: var(--main-section-background-color);
|
|
@@ -41,11 +41,11 @@ var a0_0x7be37d=a0_0x3fa9;(function(_0xd24b27,_0x58a0fa){var _0x8b5d96=a0_0x3fa9
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`];}get[
|
|
44
|
+
`];}get[a0_0xbea314(0x1df)](){return{'title':'Operato\x20Tools','actions':[]};}[a0_0xbea314(0x1e2)](){var _0x53caf3=a0_0xbea314;return html`
|
|
45
45
|
<h2>Operato Tools</h2>
|
|
46
46
|
<p page-description>
|
|
47
|
-
${TermsUtil[
|
|
47
|
+
${TermsUtil['tText'](_0x53caf3(0x1dd))}
|
|
48
48
|
</p>
|
|
49
49
|
|
|
50
50
|
<img src="/assets/images/operato-tools.png" />
|
|
51
|
-
`;}}window['customElements'][
|
|
51
|
+
`;}}window['customElements'][a0_0xbea314(0x1de)](a0_0xbea314(0x1da),OperatoToolsMain);function a0_0xd595(){var _0x572c63=['1178672IzkPOB','81afimdn','tool\x20start\x20msg','define','context','1659030WbrRwk','44916hoTHor','render','1370gNlpku','144261izvgFn','styles','77oflrfa','864BuNbCv','585JARGwK','322267ysZJNV','operato-tools-main'];a0_0xd595=function(){return _0x572c63;};return a0_0xd595();}
|
package/client/reducers/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x20c1db=a0_0x3280;(function(_0x3b6107,_0x5a258e){const _0x47934a=a0_0x3280,_0x36f9cb=_0x3b6107();while(!![]){try{const _0x195cd6=-parseInt(_0x47934a(0x1e3))/0x1+-parseInt(_0x47934a(0x1e0))/0x2+-parseInt(_0x47934a(0x1df))/0x3+parseInt(_0x47934a(0x1de))/0x4+-parseInt(_0x47934a(0x1d9))/0x5+-parseInt(_0x47934a(0x1da))/0x6*(parseInt(_0x47934a(0x1dd))/0x7)+parseInt(_0x47934a(0x1e1))/0x8;if(_0x195cd6===_0x5a258e)break;else _0x36f9cb['push'](_0x36f9cb['shift']());}catch(_0x5cc1cd){_0x36f9cb['push'](_0x36f9cb['shift']());}}}(a0_0x32f0,0x1ae9b));function a0_0x32f0(){const _0x221016=['351300mWvfbo','5166368JOrnLn','dispatch','98933lrwMaL','errors','ABC','studioPermission','131475vAMwyi','1211316gyRMCm','UPDATE_OPERATO_TOOLS_PERMISSION','type','7rtGDne','622512rELhFP','565275NYnKGx'];a0_0x32f0=function(){return _0x221016;};return a0_0x32f0();}import a0_0x46e97f from'graphql-tag';import{i18next}from'@operato/i18n';import{store}from'@operato/shell';import{client,gqlContext}from'@operato/graphql';function a0_0x3280(_0x4d8bc4,_0x19f8ca){const _0x32f089=a0_0x32f0();return a0_0x3280=function(_0x3280a8,_0x5ed6c8){_0x3280a8=_0x3280a8-0x1d9;let _0x238129=_0x32f089[_0x3280a8];return _0x238129;},a0_0x3280(_0x4d8bc4,_0x19f8ca);}import{UPDATE_OPERATO_TOOLS}from'../actions/main';const INITIAL_STATE={'operatoTools':a0_0x20c1db(0x1e5),'studioPermission':!0x1};export const UPDATE_OPERATO_TOOLS_PERMISSION=a0_0x20c1db(0x1db);((async()=>{const _0x1ac5f9=a0_0x20c1db;var _0x277895=await client['query']({'query':a0_0x46e97f`{studioPermission}`});let _0x4f3741=!0x1;_0x277895[_0x1ac5f9(0x1e4)]||(_0x4f3741=_0x277895['data'][_0x1ac5f9(0x1e6)]),store[_0x1ac5f9(0x1e2)]({'type':UPDATE_OPERATO_TOOLS_PERMISSION,'state':{'studioPermission':_0x4f3741}});})());const operatoTools=(_0x4a38fe=INITIAL_STATE,_0x1cb859)=>{const _0x5a6e2d=a0_0x20c1db;switch(_0x1cb859[_0x5a6e2d(0x1dc)]){case UPDATE_OPERATO_TOOLS:return{..._0x4a38fe};case UPDATE_OPERATO_TOOLS_PERMISSION:return{...INITIAL_STATE,..._0x1cb859['state']};default:return _0x4a38fe;}};export default operatoTools;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-tools",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.75",
|
|
4
4
|
"main": "server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"docker:run": "docker run -it -p 4000:3000 hatiolab/operato-tools:latest"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@things-factory/meta-ui": "^6.1.
|
|
32
|
+
"@things-factory/meta-ui": "^6.1.75",
|
|
33
33
|
"@things-factory/operato-license-checker": "^3.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@things-factory/builder": "^6.1.66",
|
|
37
37
|
"@things-factory/meta-ui": "^6.0.0-alpha.6"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "ee13b641139de96d05449ad33fe577124adfd9c7"
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';var a0_0x3995c5=a0_0x5a4f;(function(_0xdda8ec,_0x135011){var _0x109031=a0_0x5a4f,_0x2b2504=_0xdda8ec();while(!![]){try{var _0x4fe2ec=-parseInt(_0x109031(0xa5))/0x1+-parseInt(_0x109031(0xb1))/0x2+parseInt(_0x109031(0xa3))/0x3*(-parseInt(_0x109031(0xa7))/0x4)+parseInt(_0x109031(0xae))/0x5+parseInt(_0x109031(0xad))/0x6+-parseInt(_0x109031(0xa8))/0x7*(-parseInt(_0x109031(0xac))/0x8)+parseInt(_0x109031(0xb0))/0x9*(parseInt(_0x109031(0xaa))/0xa);if(_0x4fe2ec===_0x135011)break;else _0x2b2504['push'](_0x2b2504['shift']());}catch(_0x5711e7){_0x2b2504['push'](_0x2b2504['shift']());}}}(a0_0x3478,0xca38b));function a0_0x5a4f(_0x3adad4,_0x46cdb0){var _0x3478e0=a0_0x3478();return a0_0x5a4f=function(_0x5a4f05,_0xe7b060){_0x5a4f05=_0x5a4f05-0xa3;var _0x5c8c45=_0x3478e0[_0x5a4f05];return _0x5c8c45;},a0_0x5a4f(_0x3adad4,_0x46cdb0);}function a0_0x3478(){var _0x38601c=['1569318aeDLEo','__esModule','1272820JaAujV','544355IjpxbS','error.invalid\x20license\x20key','622840FdVXbc','INVALID_LICENSE','56GWVmQg','5038650cjHzCp','4687420vuumbr','OVER_LIMIT','351SaKtOt','2796916LzWQJv','9jJtvNe','error.page\x20count\x20over\x20license\x20limit'];a0_0x3478=function(){return _0x38601c;};return a0_0x3478();}Object['defineProperty'](exports,a0_0x3995c5(0xa6),{'value':!0x0}),exports[a0_0x3995c5(0xaf)]=exports[a0_0x3995c5(0xab)]=void 0x0,exports[a0_0x3995c5(0xab)]=a0_0x3995c5(0xa9),exports[a0_0x3995c5(0xaf)]=a0_0x3995c5(0xa4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x5dcd79=a0_0x3a95;function a0_0x2e84(){const _0x1c56f0=['ERROR_CODES','10KpjvOE','LicenseError','1256272WCJOfI','321vqPqPa','defineProperty','1GyGWeK','295956gQYJuJ','49548vOkKHZ','12108vNjPLS','__importStar','tslib','../constants/error-code','619768tYOuWY','567826PtlYAc','__esModule','errorCode','assign','3014MEsCva','6gONKVj','352185znPyNt'];a0_0x2e84=function(){return _0x1c56f0;};return a0_0x2e84();}(function(_0x163ffa,_0x437d97){const _0x215652=a0_0x3a95,_0x55d8ed=_0x163ffa();while(!![]){try{const _0x2e076f=-parseInt(_0x215652(0x137))/0x1*(parseInt(_0x215652(0x13e))/0x2)+parseInt(_0x215652(0x135))/0x3*(-parseInt(_0x215652(0x13a))/0x4)+-parseInt(_0x215652(0x130))/0x5+parseInt(_0x215652(0x12f))/0x6*(parseInt(_0x215652(0x13f))/0x7)+-parseInt(_0x215652(0x134))/0x8+parseInt(_0x215652(0x138))/0x9*(-parseInt(_0x215652(0x132))/0xa)+parseInt(_0x215652(0x12e))/0xb*(parseInt(_0x215652(0x139))/0xc);if(_0x2e076f===_0x437d97)break;else _0x55d8ed['push'](_0x55d8ed['shift']());}catch(_0x3bb14b){_0x55d8ed['push'](_0x55d8ed['shift']());}}}(a0_0x2e84,0x4db80));Object[a0_0x5dcd79(0x136)](exports,a0_0x5dcd79(0x140),{'value':!0x0}),exports[a0_0x5dcd79(0x133)]=void 0x0;const tslib_1=require(a0_0x5dcd79(0x13c)),ERROR_CODES=tslib_1[a0_0x5dcd79(0x13b)](require(a0_0x5dcd79(0x13d)));class LicenseError extends Error{static get[a0_0x5dcd79(0x131)](){const _0x68ba38=a0_0x5dcd79;return Object[_0x68ba38(0x12d)]({},ERROR_CODES);}constructor({errorCode:_0x4191a8,detail:_0x203dd0}){const _0x558dbe=a0_0x5dcd79;super(_0x4191a8),this['name']='license-error',this[_0x558dbe(0x12c)]=_0x4191a8,this['detail']=_0x203dd0;}}function a0_0x3a95(_0x3c2701,_0x4a43a6){const _0x2e8406=a0_0x2e84();return a0_0x3a95=function(_0x3a95a1,_0x3c6eb2){_0x3a95a1=_0x3a95a1-0x12c;let _0x3f27bb=_0x2e8406[_0x3a95a1];return _0x3f27bb;},a0_0x3a95(_0x3c2701,_0x4a43a6);}exports[a0_0x5dcd79(0x133)]=LicenseError;
|
package/server/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a0_0x2367(_0x25b421,_0x10f3d0){const _0x1035d9=a0_0x1035();return a0_0x2367=function(_0x236721,_0x4ad62f){_0x236721=_0x236721-0x109;let _0x2d72d3=_0x1035d9[_0x236721];return _0x2d72d3;},a0_0x2367(_0x25b421,_0x10f3d0);}function a0_0x1035(){const _0x25a287=['1624quUKba','1957383ZquCMw','bootstrap-module-global-public-route','12MNKsEl','48328iGXVQB','27AFMIUL','8dfYKAI','58933809nFhONK','5IoUvrN','4306578lWbmHl','debug','175418oJPvcr','4821404BsHtsR','bootstrap-module-domain-public-route','5068270VSIQrT','bootstrap-module-global-private-route','things-factory:operato-tools:routes'];a0_0x1035=function(){return _0x25a287;};return a0_0x1035();}const a0_0x43dbe3=a0_0x2367;(function(_0x3214e3,_0x1fdc53){const _0x35cb64=a0_0x2367,_0x2cb99e=_0x3214e3();while(!![]){try{const _0x1daaf2=parseInt(_0x35cb64(0x10f))/0x1*(parseInt(_0x35cb64(0x114))/0x2)+parseInt(_0x35cb64(0x10a))/0x3+parseInt(_0x35cb64(0x115))/0x4+parseInt(_0x35cb64(0x111))/0x5*(parseInt(_0x35cb64(0x112))/0x6)+parseInt(_0x35cb64(0x109))/0x7*(parseInt(_0x35cb64(0x10d))/0x8)+parseInt(_0x35cb64(0x10e))/0x9*(parseInt(_0x35cb64(0x117))/0xa)+parseInt(_0x35cb64(0x110))/0xb*(-parseInt(_0x35cb64(0x10c))/0xc);if(_0x1daaf2===_0x1fdc53)break;else _0x2cb99e['push'](_0x2cb99e['shift']());}catch(_0x55fcee){_0x2cb99e['push'](_0x2cb99e['shift']());}}}(a0_0x1035,0xcd795));const debug=require(a0_0x43dbe3(0x113))(a0_0x43dbe3(0x119));process['on'](a0_0x43dbe3(0x10b),(_0x3898b4,_0x21df1c)=>{}),process['on'](a0_0x43dbe3(0x118),(_0x5722e9,_0x26328f)=>{}),process['on'](a0_0x43dbe3(0x116),(_0x3e0626,_0x5d08f6)=>{}),process['on']('bootstrap-module-domain-private-route',(_0x24ddbe,_0x52ee21)=>{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x5b28(){const _0x6e2cc3=['\x22,\x22width\x22:',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','hex','push','rank','SCREEN','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','aes-256-ctr','query','meta-grist-page','dataProp','filter','__esModule','getRepository','./../tool-secret/tool-permission',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\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_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','from','\x22,\x22header\x22:\x20\x22','32989cNGAPr','createMenuData','template','OperatoToolCreateMenu','JSON','147151nBKyaT','updater_id','\x22,\x22desc\x22:','refType','2968iZycnF','\x22,\x22name\x22:\x20\x22','3227QdNiiO','{\x22name\x22:\x20\x22','940MRJuwc',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','string','routing','join','Entity','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','@transaction','hiddenFlag','1640844vpaITJ','Mutation','sortRank','resourceUrl','@things-factory/menu-base','save','\x22,\x22operator\x22:\x20\x22','scenario','findOne','2snubCL','25659RcQuyR','created_at','updater','stringify','createGridColumns','\x22,\x22hidden\x22:',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','createSearchCols','aes-256-cfb1','aes-256-cfb8','updated_at','state','checkStudioTemplateIsOverLimit','5bBhtXj','code','updatedAt','final','replace','17970oMjoZW','Operato\x20Tool\x20Create\x20Menu','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','refName','createSortCols','Directive','__metadata','menuType','{\x22name\x22:\x22','design:returntype','creator','type-graphql','sort','searchOper','parent_menu_id','Resolver','182rwAZzn','map','hidden','aes256','assign','Menu','length','reverseSort','@things-factory/meta-ui/client/pages/meta-grist-page','Arg','parent','1046172IOiWUT','createCipheriv','find','__param','update','563109PVwzKs','name','__decorate','substring','aes-256-cbc','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','h1z0q9i9x7q6','left','prototype','design:paramtypes','\x20,\x22editable\x22:\x20','gridRank','default','toolCreateMenu','toString'];a0_0x5b28=function(){return _0x6e2cc3;};return a0_0x5b28();}const a0_0x153a40=a0_0x498f;(function(_0x960b2a,_0x22b530){const _0x56f89d=a0_0x498f,_0x15b34e=_0x960b2a();while(!![]){try{const _0x5e86af=-parseInt(_0x56f89d(0x103))/0x1*(parseInt(_0x56f89d(0x11d))/0x2)+-parseInt(_0x56f89d(0xdc))/0x3+parseInt(_0x56f89d(0x14b))/0x4*(-parseInt(_0x56f89d(0x12b))/0x5)+parseInt(_0x56f89d(0x130))/0x6*(-parseInt(_0x56f89d(0x109))/0x7)+-parseInt(_0x56f89d(0x107))/0x8*(-parseInt(_0x56f89d(0x11e))/0x9)+parseInt(_0x56f89d(0x10b))/0xa*(-parseInt(_0x56f89d(0xfe))/0xb)+parseInt(_0x56f89d(0x114))/0xc*(parseInt(_0x56f89d(0x140))/0xd);if(_0x5e86af===_0x22b530)break;else _0x15b34e['push'](_0x15b34e['shift']());}catch(_0x5d5733){_0x15b34e['push'](_0x15b34e['shift']());}}}(a0_0x5b28,0xae151));Object['defineProperty'](exports,a0_0x153a40(0xf7),{'value':!0x0}),exports['OperatoToolCreateMenu']=void 0x0;const tslib_1=require('tslib'),type_graphql_1=require(a0_0x153a40(0x13b)),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require(a0_0x153a40(0x118)),tool_permission_1=require(a0_0x153a40(0xf9)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require('pluralize'),crypto_1=tslib_1['__importDefault'](require('crypto'));let OperatoToolCreateMenu=class{async[a0_0x153a40(0xe9)](_0x248c8c,_0x46a9b6,_0x32e447){const _0x226eff=a0_0x153a40,{domain:_0x256bde,user:_0x5b0dc6,tx:_0x1f493b}=_0x32e447[_0x226eff(0x129)];await(0x0,tool_permission_1[_0x226eff(0x12a)])('',_0x32e447);const _0x41f4d3=await _0x1f493b[_0x226eff(0xf8)](resource_base_1[_0x226eff(0x110)])['findOne']({'where':{'domain':{'id':_0x256bde['id']},'id':_0x248c8c}}),_0x398697=await _0x1f493b[_0x226eff(0xf8)](resource_base_1['EntityColumn'])[_0x226eff(0x14d)]({'where':{'domain':{'id':_0x256bde['id']},'entity':{'id':_0x41f4d3['id']}}});let {name:_0x2fea65=''}=_0x41f4d3||{},_0x4cfd13=kebabCase(_0x2fea65),_0x2a3962=modelTemplate['replace'](/{{pascalCase name}}/g,startCase(camelCase(_0x2fea65))['replace'](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x2fea65))['replace'](/{{snakeCase name}}/g,snakeCase(_0x2fea65))[_0x226eff(0x12f)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x2fea65)))[_0x226eff(0x12f)](/ /g,''))[_0x226eff(0x12f)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x2fea65)))[_0x226eff(0x12f)](/{{name}}/g,_0x2fea65),_0x2088f2='';_0x226eff(0x102)==_0x41f4d3[_0x226eff(0xf5)]?_0x2088f2=_0x226eff(0xfb):'COPY'==_0x41f4d3[_0x226eff(0xf5)]&&(_0x2088f2='\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'),_0x2a3962=_0x2a3962[_0x226eff(0x12f)](/{{HistoryButton}}/g,_0x2088f2);let _0x1ac53c=this['createSortCols'](_0x398697);_0x2a3962=_0x2a3962[_0x226eff(0x12f)](/{{SortColumns}}/g,_0x1ac53c['join'](','));let _0x16c2aa=this['createSearchCols'](_0x398697);_0x2a3962=_0x2a3962[_0x226eff(0x12f)](/{{SearchColumns}}/g,_0x16c2aa[_0x226eff(0x10f)](','));let _0x1a0442=this[_0x226eff(0x122)](_0x398697);return _0x2a3962=_0x2a3962[_0x226eff(0x12f)](/{{GridColumns}}/g,_0x1a0442[_0x226eff(0x10f)](',')),_0x2a3962=this['enc'](_0x2a3962),await this[_0x226eff(0xff)](_0x1f493b,_0x256bde,_0x5b0dc6,_0x46a9b6,_0x4cfd13,_0x2a3962),!0x0;}[a0_0x153a40(0x122)](_0x1647f2){const _0x2824a1=a0_0x153a40;return _0x1647f2[_0x2824a1(0xf6)](_0x25c319=>'id'!=_0x25c319['name']&&_0x25c319[_0x2824a1(0xe7)]>0x0)[_0x2824a1(0x13c)](function(_0x24e723,_0x412483){const _0xfe7614=_0x2824a1;return _0x24e723[_0xfe7614(0xe7)]-_0x412483[_0xfe7614(0xe7)];})[_0x2824a1(0x141)](_0x2a26ca=>{const _0x269d74=_0x2824a1;let {gridEditor:_0x5fe7e8=_0x269d74(0x10d),name:_0xfe3850,term:_0x41e9cf,gridWidth:_0x31ea39=0x0,gridAlign:_0x3a2f8d=_0x269d74(0xe3),nullable:_0x4c5b07=!0x1}=_0x2a26ca;if(null==_0x5fe7e8&&(_0x5fe7e8=_0x269d74(0x10d)),null==_0x3a2f8d&&(_0x3a2f8d=_0x269d74(0xe3)),_0x269d74(0x104)==_0xfe3850||'creator_id'==_0xfe3850)return _0xfe3850=_0x269d74(0x104)==_0xfe3850?_0x269d74(0x120):_0x269d74(0x13a),_0x269d74(0x132)+_0xfe3850+_0x269d74(0xfd)+_0xfe3850+_0x269d74(0xf1);if(_0x269d74(0x128)==_0xfe3850||_0x269d74(0x11f)==_0xfe3850)return _0x269d74(0xe1)+('updated_at'==_0xfe3850?_0x269d74(0x12d):'createdAt')+_0x269d74(0xfd)+_0xfe3850+'\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}';let _0x1a2f4e='readonly'!=_0x5fe7e8&&_0x269d74(0x142)!=_0x5fe7e8,_0x215a90=_0x269d74(0x142)==_0x5fe7e8;0x1!=_0x215a90&&0x0!=_0x1a2f4e||(_0x5fe7e8=_0x269d74(0x10d));let _0x268846='{\x22type\x22:\x20\x22'+_0x5fe7e8+_0x269d74(0x108)+camelCase(_0xfe3850)+'\x22,\x22header\x22:\x20\x22'+_0x41e9cf+_0x269d74(0x123)+_0x215a90+_0x269d74(0xe6)+_0x1a2f4e+',\x22mandatory\x22:\x20'+!_0x4c5b07+_0x269d74(0x10c)+_0x3a2f8d+_0x269d74(0xeb)+_0x31ea39+'\x20,\x22exportable\x22:\x20true';return _0x269d74(0x12c)==_0x2a26ca[_0x269d74(0x106)]&&(_0x268846+=_0x269d74(0xec)+_0x2a26ca[_0x269d74(0x133)]+'\x22}'),_0x269d74(0x11b)==_0x2a26ca[_0x269d74(0x106)]&&(_0x268846+=_0x269d74(0xfa)+_0x2a26ca['refName']+'\x22}'),'entity'==_0x2a26ca['refType']&&(_0x268846+=_0x269d74(0x124)+camelCase(plural(_0x2a26ca[_0x269d74(0x133)]))+_0x269d74(0x111)),_0x268846+='}',_0x268846;});}[a0_0x153a40(0x125)](_0x512acb){const _0x2e5a33=a0_0x153a40;return _0x512acb[_0x2e5a33(0xf6)](_0x2c76c5=>_0x2c76c5['searchRank']>0x0)['sort'](function(_0x236f1c,_0x4f4104){return _0x236f1c['searchRank']-_0x4f4104['searchRank'];})[_0x2e5a33(0x141)](_0x108216=>{const _0x56d418=_0x2e5a33;let _0x20dcdd=_0x108216[_0x56d418(0x13d)];return _0x56d418(0xf6)==_0x20dcdd?'\x22'+camelCase(_0x108216[_0x56d418(0xdd)])+'\x22':(_0x20dcdd||(_0x20dcdd='eq'),_0x56d418(0x10a)+camelCase(_0x108216[_0x56d418(0xdd)])+_0x56d418(0x11a)+_0x20dcdd+'\x22}');});}[a0_0x153a40(0x134)](_0x2f90e4){const _0x550e99=a0_0x153a40;return _0x2f90e4[_0x550e99(0xf6)](_0x2cc5e7=>_0x2cc5e7[_0x550e99(0x116)]>0x0)[_0x550e99(0x13c)](function(_0x2fc07c,_0x2d2b61){const _0x58cf5f=_0x550e99;return _0x2fc07c[_0x58cf5f(0x116)]-_0x2d2b61[_0x58cf5f(0x116)];})['map'](_0x689bf0=>_0x550e99(0x138)+camelCase(_0x689bf0['name'])+_0x550e99(0x105)+_0x689bf0[_0x550e99(0x147)]+'}');}async[a0_0x153a40(0xff)](_0x30aa74,_0x20fbc2,_0xdb6cc4,_0x3de47f,_0x4ea513,_0x24c859){const _0x2348e7=a0_0x153a40;let _0x59a85e=await _0x30aa74[_0x2348e7(0xf8)](menu_base_1[_0x2348e7(0x145)])[_0x2348e7(0x11c)]({'where':{'domain':{'id':_0x20fbc2['id']},'id':_0x3de47f}}),_0x593185=(await _0x30aa74[_0x2348e7(0xf8)](menu_base_1[_0x2348e7(0x145)])[_0x2348e7(0xf3)]('select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27'+_0x3de47f+'\x27\x20or\x20id\x20=\x20\x27'+_0x3de47f+'\x27'))[0x0][_0x2348e7(0xef)]+0xa,_0x236dcb=new menu_base_1[(_0x2348e7(0x145))]();_0x236dcb[_0x2348e7(0xdd)]=_0x4ea513,_0x236dcb[_0x2348e7(0x137)]=_0x2348e7(0xf0),_0x236dcb['category']=_0x2348e7(0xf4),_0x236dcb[_0x2348e7(0xef)]=_0x593185,_0x236dcb[_0x2348e7(0x113)]=!0x1,_0x236dcb[_0x2348e7(0x10e)]=_0x4ea513,_0x236dcb[_0x2348e7(0x100)]=_0x24c859,_0x236dcb[_0x2348e7(0x117)]=_0x2348e7(0x148),_0x236dcb[_0x2348e7(0x14a)]=_0x59a85e,await _0x30aa74['getRepository'](menu_base_1['Menu'])[_0x2348e7(0x119)](Object[_0x2348e7(0x144)](Object[_0x2348e7(0x144)]({},_0x236dcb),{'domain':_0x20fbc2,'creator':_0xdb6cc4,'updater':_0xdb6cc4}));}['enc'](_0x4db029){const _0x587366=a0_0x153a40;let _0x30434b=JSON[_0x587366(0x121)](_0x4db029)['split'](/(.{100})/)[_0x587366(0xf6)](_0x412763=>_0x412763),_0x510711=['aes-256-ecb',_0x587366(0xe0),'aes-256-cfb',_0x587366(0x127),_0x587366(0x126),'aes-256-ofb',_0x587366(0xf2),_0x587366(0x143)],_0x369ecf=crypto_1[_0x587366(0xe8)]['randomBytes'](0x20)[_0x587366(0xea)](_0x587366(0xed)),_0x26de54=Buffer[_0x587366(0xfc)](_0x369ecf,_0x587366(0xed)),_0x13bf8c=_0x369ecf[_0x587366(0xdf)](0x0,0x10),_0x1b78fa=['',_0x13bf8c,_0x13bf8c,_0x13bf8c,_0x13bf8c,_0x13bf8c,_0x13bf8c,_0x13bf8c],_0x5bc777=0x0,_0xbb3556=[];_0xbb3556[_0x587366(0xee)](_0x369ecf);for(var _0x4a7c71=0x0;_0x4a7c71<_0x30434b[_0x587366(0x146)];_0x4a7c71++,_0x5bc777++){_0x5bc777==_0x510711[_0x587366(0x146)]&&(_0x5bc777=0x0);let _0x32d055=crypto_1[_0x587366(0xe8)][_0x587366(0x14c)](_0x510711[_0x5bc777],_0x26de54,_0x1b78fa[_0x5bc777]),_0x5d6f9b=_0x32d055[_0x587366(0xdb)](_0x30434b[_0x4a7c71],'utf8','hex');_0x5d6f9b+=_0x32d055[_0x587366(0x12e)](_0x587366(0xed)),_0xbb3556['push'](_0x5d6f9b);}return _0xbb3556[_0x587366(0x10f)](_0x587366(0xe2));}};function a0_0x498f(_0x224af0,_0x325a8c){const _0x5b2861=a0_0x5b28();return a0_0x498f=function(_0x498fa0,_0x28ec0b){_0x498fa0=_0x498fa0-0xdb;let _0x5be6aa=_0x5b2861[_0x498fa0];return _0x5be6aa;},a0_0x498f(_0x224af0,_0x325a8c);}tslib_1[a0_0x153a40(0xde)]([(0x0,type_graphql_1[a0_0x153a40(0x135)])(a0_0x153a40(0x112)),(0x0,type_graphql_1[a0_0x153a40(0x115)])(_0x2380c2=>Boolean,{'description':a0_0x153a40(0x131)}),tslib_1[a0_0x153a40(0x14e)](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1[a0_0x153a40(0x14e)](0x1,(0x0,type_graphql_1[a0_0x153a40(0x149)])(a0_0x153a40(0x13e))),tslib_1[a0_0x153a40(0x14e)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x153a40(0x136)]('design:type',Function),tslib_1[a0_0x153a40(0x136)](a0_0x153a40(0xe5),[String,String,Object]),tslib_1[a0_0x153a40(0x136)](a0_0x153a40(0x139),Promise)],OperatoToolCreateMenu[a0_0x153a40(0xe4)],a0_0x153a40(0xe9),null),OperatoToolCreateMenu=tslib_1[a0_0x153a40(0xde)]([(0x0,type_graphql_1[a0_0x153a40(0x13f)])()],OperatoToolCreateMenu),exports[a0_0x153a40(0x101)]=OperatoToolCreateMenu;const modelTemplate='\x0a{\x0a\x20\x20\x22menu\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22title\x22:\x20\x22{{name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22\x22,\x0a\x20\x20\x20\x20\x20\x20\x22desc\x22:\x20\x22\x22\x0a\x20\x20},\x0a\x20\x20\x22gql\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22query\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22list_func\x22:\x20\x22{{pluralCamelCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22find_one_func\x22:\x22{{camelCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22mutation\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22updateMultiple{{pascalCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22{{pascalCase\x20name}}Patch\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22delete\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22delete{{pluralPascalCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22button\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22export\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22add\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22delete\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22save\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20],\x0a\x20\x20\x22grid_column\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22string\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22header\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22hidden\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22editable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mandatory\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sortable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22align\x22:\x20\x22left\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22width\x22:\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22exportable\x22:\x20false\x0a\x20\x20\x20\x20\x20\x20},\x0a{{GridColumns}}\x0a\x20\x20],\x0a\x20\x20\x22grid\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22button\x22:[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{HistoryButton}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22option\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mobile_mode\x22:\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22desk_mode\x22:\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22use_row_checker\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22pages\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2020,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20100,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20300\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22view_mode\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22CARD\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sorters\x22:\x20[\x0a{{SortColumns}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20]\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22row\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple_select\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22click\x22:\x20\x22select-row-toggle\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22search\x22:\x20[\x0a{{SearchColumns}}\x0a\x20\x20]\x0a}\x0a';
|
|
1
|
+
'use strict';const a0_0x1dbb48=a0_0x1043;(function(_0x256082,_0x17b7fd){const _0xcbca45=a0_0x1043,_0x26f780=_0x256082();while(!![]){try{const _0x57725e=parseInt(_0xcbca45(0x10a))/0x1+-parseInt(_0xcbca45(0x116))/0x2*(parseInt(_0xcbca45(0xf8))/0x3)+-parseInt(_0xcbca45(0x126))/0x4+-parseInt(_0xcbca45(0xe8))/0x5*(parseInt(_0xcbca45(0x143))/0x6)+-parseInt(_0xcbca45(0xf2))/0x7*(-parseInt(_0xcbca45(0xd2))/0x8)+-parseInt(_0xcbca45(0xfe))/0x9+parseInt(_0xcbca45(0x10b))/0xa;if(_0x57725e===_0x17b7fd)break;else _0x26f780['push'](_0x26f780['shift']());}catch(_0x567a0e){_0x26f780['push'](_0x26f780['shift']());}}}(a0_0x39a5,0xafee0));Object[a0_0x1dbb48(0xf6)](exports,a0_0x1dbb48(0x125),{'value':!0x0}),exports['OperatoToolCreateMenu']=void 0x0;const tslib_1=require(a0_0x1dbb48(0x133)),type_graphql_1=require(a0_0x1dbb48(0xe3)),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require(a0_0x1dbb48(0x120)),tool_permission_1=require(a0_0x1dbb48(0x101)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x1dbb48(0xec)),{plural:plural}=require(a0_0x1dbb48(0x13d)),crypto_1=tslib_1[a0_0x1dbb48(0x128)](require(a0_0x1dbb48(0xde)));let OperatoToolCreateMenu=class{async['toolCreateMenu'](_0x299420,_0x37fd09,_0x57eb4d){const _0x1cbe74=a0_0x1dbb48,{domain:_0xc86561,user:_0x4096f8,tx:_0x5a3315}=_0x57eb4d[_0x1cbe74(0x104)];await(0x0,tool_permission_1[_0x1cbe74(0xf3)])('',_0x57eb4d);const _0x33eefe=await _0x5a3315[_0x1cbe74(0x108)](resource_base_1[_0x1cbe74(0xeb)])[_0x1cbe74(0xe4)]({'where':{'domain':{'id':_0xc86561['id']},'id':_0x299420}}),_0x195610=await _0x5a3315['getRepository'](resource_base_1[_0x1cbe74(0xd9)])['find']({'where':{'domain':{'id':_0xc86561['id']},'entity':{'id':_0x33eefe['id']}}});let {name:_0x36fc3c=''}=_0x33eefe||{},_0x5b5eaa=kebabCase(_0x36fc3c),_0x4c4617=modelTemplate[_0x1cbe74(0x112)](/{{pascalCase name}}/g,startCase(camelCase(_0x36fc3c))[_0x1cbe74(0x112)](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x36fc3c))[_0x1cbe74(0x112)](/{{snakeCase name}}/g,snakeCase(_0x36fc3c))['replace'](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x36fc3c)))[_0x1cbe74(0x112)](/ /g,''))[_0x1cbe74(0x112)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x36fc3c)))[_0x1cbe74(0x112)](/{{name}}/g,_0x36fc3c),_0x6d193d='';_0x1cbe74(0x114)==_0x33eefe[_0x1cbe74(0xe0)]?_0x6d193d='\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20':'COPY'==_0x33eefe['dataProp']&&(_0x6d193d=_0x1cbe74(0x13b)),_0x4c4617=_0x4c4617[_0x1cbe74(0x112)](/{{HistoryButton}}/g,_0x6d193d);let _0x36123d=this['createSortCols'](_0x195610);_0x4c4617=_0x4c4617['replace'](/{{SortColumns}}/g,_0x36123d[_0x1cbe74(0x105)](','));let _0x37cf4d=this[_0x1cbe74(0x12a)](_0x195610);_0x4c4617=_0x4c4617[_0x1cbe74(0x112)](/{{SearchColumns}}/g,_0x37cf4d['join'](','));let _0x327ed5=this[_0x1cbe74(0x117)](_0x195610);return _0x4c4617=_0x4c4617[_0x1cbe74(0x112)](/{{GridColumns}}/g,_0x327ed5[_0x1cbe74(0x105)](',')),_0x4c4617=this[_0x1cbe74(0x107)](_0x4c4617),await this['createMenuData'](_0x5a3315,_0xc86561,_0x4096f8,_0x37fd09,_0x5b5eaa,_0x4c4617),!0x0;}['createGridColumns'](_0x4e9767){const _0x5e9a69=a0_0x1dbb48;return _0x4e9767['filter'](_0x1c917d=>'id'!=_0x1c917d[_0x5e9a69(0x11c)]&&_0x1c917d[_0x5e9a69(0x10f)]>0x0)[_0x5e9a69(0x129)](function(_0x2f0676,_0x5049d5){const _0x3744b1=_0x5e9a69;return _0x2f0676[_0x3744b1(0x10f)]-_0x5049d5[_0x3744b1(0x10f)];})[_0x5e9a69(0xe9)](_0x43f7c9=>{const _0x445d5f=_0x5e9a69;let {gridEditor:_0x5f5255=_0x445d5f(0x12d),name:_0x2fde02,term:_0x128722,gridWidth:_0x17839b=0x0,gridAlign:_0x39f975='left',nullable:_0x1cd392=!0x1}=_0x43f7c9;if(null==_0x5f5255&&(_0x5f5255=_0x445d5f(0x12d)),null==_0x39f975&&(_0x39f975=_0x445d5f(0xdb)),_0x445d5f(0x102)==_0x2fde02||_0x445d5f(0xfc)==_0x2fde02)return _0x2fde02=_0x445d5f(0x102)==_0x2fde02?_0x445d5f(0xfb):_0x445d5f(0x113),_0x445d5f(0x115)+_0x2fde02+_0x445d5f(0x12c)+_0x2fde02+_0x445d5f(0x109);if(_0x445d5f(0x11d)==_0x2fde02||_0x445d5f(0x138)==_0x2fde02)return _0x445d5f(0x141)+(_0x445d5f(0x11d)==_0x2fde02?_0x445d5f(0xf0):_0x445d5f(0x11b))+'\x22,\x22header\x22:\x20\x22'+_0x2fde02+_0x445d5f(0x131);let _0x44f0b7='readonly'!=_0x5f5255&&_0x445d5f(0x137)!=_0x5f5255,_0x1eaeaa=_0x445d5f(0x137)==_0x5f5255;0x1!=_0x1eaeaa&&0x0!=_0x44f0b7||(_0x5f5255=_0x445d5f(0x12d));let _0x4b64ae=_0x445d5f(0x12e)+_0x5f5255+_0x445d5f(0x119)+camelCase(_0x2fde02)+_0x445d5f(0x12c)+_0x128722+_0x445d5f(0xe7)+_0x1eaeaa+_0x445d5f(0xf7)+_0x44f0b7+_0x445d5f(0x136)+!_0x1cd392+_0x445d5f(0x11a)+_0x39f975+_0x445d5f(0xd3)+_0x17839b+_0x445d5f(0xdd);return _0x445d5f(0x124)==_0x43f7c9[_0x445d5f(0xf1)]&&(_0x4b64ae+=_0x445d5f(0x10e)+_0x43f7c9['refName']+'\x22}'),_0x445d5f(0xff)==_0x43f7c9[_0x445d5f(0xf1)]&&(_0x4b64ae+=',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22'+_0x43f7c9[_0x445d5f(0xd0)]+'\x22}'),'entity'==_0x43f7c9['refType']&&(_0x4b64ae+=_0x445d5f(0xd7)+camelCase(plural(_0x43f7c9['refName']))+_0x445d5f(0x122)),_0x4b64ae+='}',_0x4b64ae;});}[a0_0x1dbb48(0x12a)](_0x5a6565){const _0x5a606b=a0_0x1dbb48;return _0x5a6565['filter'](_0x4e83a1=>_0x4e83a1[_0x5a606b(0xd4)]>0x0)[_0x5a606b(0x129)](function(_0x1240aa,_0xa45a32){const _0x31613c=_0x5a606b;return _0x1240aa[_0x31613c(0xd4)]-_0xa45a32[_0x31613c(0xd4)];})[_0x5a606b(0xe9)](_0x52128e=>{const _0x4cde9e=_0x5a606b;let _0x1ae35f=_0x52128e['searchOper'];return'filter'==_0x1ae35f?'\x22'+camelCase(_0x52128e['name'])+'\x22':(_0x1ae35f||(_0x1ae35f='eq'),_0x4cde9e(0xd6)+camelCase(_0x52128e[_0x4cde9e(0x11c)])+_0x4cde9e(0xee)+_0x1ae35f+'\x22}');});}[a0_0x1dbb48(0x11f)](_0x1fe364){const _0x5a7b06=a0_0x1dbb48;return _0x1fe364[_0x5a7b06(0x144)](_0x323a9b=>_0x323a9b[_0x5a7b06(0x12b)]>0x0)[_0x5a7b06(0x129)](function(_0x39f051,_0x2998a1){const _0x25a290=_0x5a7b06;return _0x39f051[_0x25a290(0x12b)]-_0x2998a1[_0x25a290(0x12b)];})[_0x5a7b06(0xe9)](_0x23808c=>_0x5a7b06(0xf9)+camelCase(_0x23808c[_0x5a7b06(0x11c)])+_0x5a7b06(0xf4)+_0x23808c[_0x5a7b06(0x13f)]+'}');}async[a0_0x1dbb48(0x127)](_0xa35df8,_0xd74b80,_0x2d08a4,_0x485422,_0x2d8b9f,_0x5134eb){const _0x3c2ed2=a0_0x1dbb48;let _0x3b41fb=await _0xa35df8[_0x3c2ed2(0x108)](menu_base_1[_0x3c2ed2(0xfd)])[_0x3c2ed2(0xe4)]({'where':{'domain':{'id':_0xd74b80['id']},'id':_0x485422}}),_0x31441e=(await _0xa35df8[_0x3c2ed2(0x108)](menu_base_1[_0x3c2ed2(0xfd)])[_0x3c2ed2(0xda)]('select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27'+_0x485422+_0x3c2ed2(0x121)+_0x485422+'\x27'))[0x0][_0x3c2ed2(0x142)]+0xa,_0x3dac65=new menu_base_1[(_0x3c2ed2(0xfd))]();_0x3dac65[_0x3c2ed2(0x11c)]=_0x2d8b9f,_0x3dac65[_0x3c2ed2(0x130)]=_0x3c2ed2(0x140),_0x3dac65['category']=_0x3c2ed2(0x134),_0x3dac65[_0x3c2ed2(0x142)]=_0x31441e,_0x3dac65[_0x3c2ed2(0xdf)]=!0x1,_0x3dac65[_0x3c2ed2(0x100)]=_0x2d8b9f,_0x3dac65['template']=_0x5134eb,_0x3dac65[_0x3c2ed2(0xe1)]='@things-factory/meta-ui/client/pages/meta-grist-page',_0x3dac65['parent']=_0x3b41fb,await _0xa35df8[_0x3c2ed2(0x108)](menu_base_1[_0x3c2ed2(0xfd)])['save'](Object['assign'](Object[_0x3c2ed2(0x103)]({},_0x3dac65),{'domain':_0xd74b80,'creator':_0x2d08a4,'updater':_0x2d08a4}));}['enc'](_0x1950a9){const _0x1e899f=a0_0x1dbb48;let _0x21bc06=JSON[_0x1e899f(0x118)](_0x1950a9)[_0x1e899f(0xfa)](/(.{100})/)[_0x1e899f(0x144)](_0x39e7b1=>_0x39e7b1),_0x20967b=[_0x1e899f(0xe6),_0x1e899f(0xf5),_0x1e899f(0x10c),_0x1e899f(0x13c),'aes-256-cfb1','aes-256-ofb','aes-256-ctr','aes256'],_0x2f8064=crypto_1['default'][_0x1e899f(0x132)](0x20)[_0x1e899f(0x135)](_0x1e899f(0xd5)),_0x58abff=Buffer[_0x1e899f(0xcf)](_0x2f8064,_0x1e899f(0xd5)),_0x238949=_0x2f8064['substring'](0x0,0x10),_0x5030dd=['',_0x238949,_0x238949,_0x238949,_0x238949,_0x238949,_0x238949,_0x238949],_0x4828b1=0x0,_0x129d86=[];_0x129d86['push'](_0x2f8064);for(var _0x2932ba=0x0;_0x2932ba<_0x21bc06[_0x1e899f(0x12f)];_0x2932ba++,_0x4828b1++){_0x4828b1==_0x20967b['length']&&(_0x4828b1=0x0);let _0x3043a5=crypto_1['default'][_0x1e899f(0x13e)](_0x20967b[_0x4828b1],_0x58abff,_0x5030dd[_0x4828b1]),_0x166362=_0x3043a5[_0x1e899f(0xea)](_0x21bc06[_0x2932ba],_0x1e899f(0xed),_0x1e899f(0xd5));_0x166362+=_0x3043a5['final']('hex'),_0x129d86[_0x1e899f(0x10d)](_0x166362);}return _0x129d86[_0x1e899f(0x105)]('h1z0q9i9x7q6');}};tslib_1[a0_0x1dbb48(0x13a)]([(0x0,type_graphql_1['Directive'])(a0_0x1dbb48(0x111)),(0x0,type_graphql_1[a0_0x1dbb48(0x139)])(_0xba3fa=>Boolean,{'description':a0_0x1dbb48(0x110)}),tslib_1['__param'](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1[a0_0x1dbb48(0xef)](0x1,(0x0,type_graphql_1[a0_0x1dbb48(0xd1)])(a0_0x1dbb48(0x123))),tslib_1[a0_0x1dbb48(0xef)](0x2,(0x0,type_graphql_1[a0_0x1dbb48(0x11e)])()),tslib_1[a0_0x1dbb48(0xe5)]('design:type',Function),tslib_1[a0_0x1dbb48(0xe5)]('design:paramtypes',[String,String,Object]),tslib_1['__metadata']('design:returntype',Promise)],OperatoToolCreateMenu[a0_0x1dbb48(0x106)],'toolCreateMenu',null),OperatoToolCreateMenu=tslib_1[a0_0x1dbb48(0x13a)]([(0x0,type_graphql_1[a0_0x1dbb48(0xd8)])()],OperatoToolCreateMenu),exports[a0_0x1dbb48(0xe2)]=OperatoToolCreateMenu;function a0_0x39a5(){const _0x5a4f11=['@things-factory/menu-base','\x27\x20or\x20id\x20=\x20\x27','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','parent_menu_id','code','__esModule','413480CUPWxn','createMenuData','__importDefault','sort','createSearchCols','sortRank','\x22,\x22header\x22:\x20\x22','string','{\x22type\x22:\x20\x22','length','menuType','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','randomBytes','tslib','meta-grist-page','toString',',\x22mandatory\x22:\x20','hidden','created_at','Mutation','__decorate','\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','aes-256-cfb8','pluralize','createCipheriv','reverseSort','SCREEN','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','rank','452238bzXgPV','filter','from','refName','Arg','6561112CikmDF','\x22,\x22width\x22:','searchRank','hex','{\x22name\x22:\x20\x22',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','Resolver','EntityColumn','query','left','\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','\x20,\x22exportable\x22:\x20true','crypto','hiddenFlag','dataProp','resourceUrl','OperatoToolCreateMenu','type-graphql','findOne','__metadata','aes-256-ecb','\x22,\x22hidden\x22:','5vRPMOI','map','update','Entity','lodash','utf8','\x22,\x22operator\x22:\x20\x22','__param','updatedAt','refType','7fnmMpo','checkStudioTemplateIsOverLimit','\x22,\x22desc\x22:','aes-256-cbc','defineProperty','\x20,\x22editable\x22:\x20','372SSWHIh','{\x22name\x22:\x22','split','updater','creator_id','Menu','4758741qtsygU','scenario','routing','./../tool-secret/tool-permission','updater_id','assign','state','join','prototype','enc','getRepository','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','96509OYGMuj','6347080fGmItA','aes-256-cfb','push',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','gridRank','Operato\x20Tool\x20Create\x20Menu','@transaction','replace','creator','JSON','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','1988EaGhPG','createGridColumns','stringify','\x22,\x22name\x22:\x20\x22',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','createdAt','name','updated_at','Ctx','createSortCols'];a0_0x39a5=function(){return _0x5a4f11;};return a0_0x39a5();}function a0_0x1043(_0x2b1803,_0x344574){const _0x39a5e9=a0_0x39a5();return a0_0x1043=function(_0x10438b,_0x5d0f90){_0x10438b=_0x10438b-0xcf;let _0x5a3f89=_0x39a5e9[_0x10438b];return _0x5a3f89;},a0_0x1043(_0x2b1803,_0x344574);}const modelTemplate=a0_0x1dbb48(0xdc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x2554(_0x2c2390,_0x31c8f7){const _0x47141e=a0_0x4714();return a0_0x2554=function(_0x2554bb,_0x4d9973){_0x2554bb=_0x2554bb-0x108;let _0x5ca99d=_0x47141e[_0x2554bb];return _0x5ca99d;},a0_0x2554(_0x2c2390,_0x31c8f7);}const a0_0x48affc=a0_0x2554;(function(_0x49685e,_0x6e8784){const _0x46b505=a0_0x2554,_0x5a37af=_0x49685e();while(!![]){try{const _0x1e90d4=-parseInt(_0x46b505(0x181))/0x1+parseInt(_0x46b505(0x114))/0x2*(-parseInt(_0x46b505(0x18b))/0x3)+-parseInt(_0x46b505(0x123))/0x4*(-parseInt(_0x46b505(0x112))/0x5)+-parseInt(_0x46b505(0x17b))/0x6*(parseInt(_0x46b505(0x127))/0x7)+parseInt(_0x46b505(0x173))/0x8*(parseInt(_0x46b505(0x13b))/0x9)+-parseInt(_0x46b505(0x12b))/0xa+parseInt(_0x46b505(0x110))/0xb;if(_0x1e90d4===_0x6e8784)break;else _0x5a37af['push'](_0x5a37af['shift']());}catch(_0x1b43d0){_0x5a37af['push'](_0x5a37af['shift']());}}}(a0_0x4714,0xbe913));function a0_0x4714(){const _0xa0cd39=['createTypeText','9525901jZVUew','dataProp','EntityColumn','Operato\x20Tool\x20Create\x20Service','3546120uBKgnV','rank','@things-factory/shell','mkdirSync','\x20{\x20nullable:\x20','float','design:returntype','Entities,','.ts','design:type','getProjectRootPath','-mutation.ts','-history-type.ts','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','double','colSize','1449sHupgx','...','string','\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','join','getColTxtType','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','decimal','__metadata','EntitySubscribers\x20}\x20from\x20\x27./','PWD','\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','timestamp\x20without\x20time\x20zone','\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','sort','camelCaseName','/server/service/','__param','replaceNamesMap','/*\x20ENTITIES\x20*/\x0a\x09...','__decorate','\x27,\x20nullable:\x20','tableName','Float','text','Resolvers\x20}\x20from\x20\x27./','indexOf','replace','creator_id','export\x20*\x20from\x20\x27./','double\x20precision','pluralPascalCaseName','-query.ts','datetime','readFileSync','@Field(','includes','Ctx','uniqRank','__esModule','EntitySubscribers,','createHistoryServiceFiles','-history-query.ts','-history.ts','\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','map','utf8','number','createServiceFiles','\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','Resolvers,','character\x20varying','prototype','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','\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','Int','3016bfOwPE','updater','creator','-type.ts','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}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','@things-factory/resource-base','nullable','bigint','6kvgzwv','updater_id','type\x20=>','-history\x27','createHistoryEntityText','\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','996965LwMigW','\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','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','import\x20{\x20entities\x20as\x20','\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','/index.ts','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryList\x20}\x20from\x20\x27./{{name}}-history-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}}History)\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryQuery\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}History,\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}History(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}History>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}History).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}HistoryList,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}Histories(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}HistoryList>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}}History)\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}History.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.creatorId})\x0a\x20\x20}\x0a}\x0a','\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','getFieldType','type-graphql','2063742RMudGW','find','index.ts','{{camelCase\x20name}}.','getRepository','colType','/service','\x0a\x20\x20','env','toolCreateService','createDir','/event-subscriber.ts','columnToEntityColumn','findOne','name','pascalCaseName','domain','JSON','existsPath','long','pluralCamelCaseName','domain_id','45213025UiMGDe','OperatoToolCreateService','3489195IwZPZM','COPY','4qsyHTe','writeFile','@Column({name:\x27','updated_at','Entities,\x20resolvers\x20as\x20','\x20})','createEntityText','split','integer','lodash','push','Date','snakeCaseName','packages','created_at','4HEWdLY','length','design:paramtypes'];a0_0x4714=function(){return _0xa0cd39;};return a0_0x4714();}Object['defineProperty'](exports,a0_0x48affc(0x162),{'value':!0x0}),exports[a0_0x48affc(0x111)]=void 0x0;const tslib_1=require('tslib'),type_graphql_1=require(a0_0x48affc(0x18a)),shell_1=require(a0_0x48affc(0x12d)),resource_base_1=require(a0_0x48affc(0x178)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x48affc(0x11d)),{plural:plural}=require('pluralize'),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x48affc(0x194)](_0x5260d3,_0x435dc3){const _0x57978e=a0_0x48affc,{domain:_0x48ed8d}=_0x435dc3['state'],_0x3931f6=await(0x0,shell_1['getRepository'])(resource_base_1['Entity'])[_0x57978e(0x198)]({'where':{'id':_0x5260d3}}),_0x27078c=await(0x0,shell_1[_0x57978e(0x18f)])(resource_base_1[_0x57978e(0x129)])[_0x57978e(0x18c)]({'where':{'domain':{'id':_0x48ed8d['id']},'entity':{'id':_0x3931f6['id']}}});let {name:_0x3004d2='',bundle:_0x18ebf1=''}=_0x3931f6||{},_0x481af0=this[_0x57978e(0x135)](),_0x2e39be=kebabCase(_0x3004d2);return await this['createServicePath'](_0x481af0,_0x18ebf1,_0x2e39be),await this[_0x57978e(0x16b)](_0x481af0,_0x18ebf1,_0x3004d2,_0x2e39be,_0x3931f6,_0x27078c),!0x0;}async[a0_0x48affc(0x16b)](_0x27310f,_0x4a15e0,_0x255952,_0x42bfe5,_0x16c2f7,_0x16ec96){const _0x597e9b=a0_0x48affc;let _0x21482d={'name':_0x42bfe5,'tableName':_0x16c2f7['tableName'],'pascalCaseName':startCase(camelCase(_0x255952))['replace'](/ /g,''),'camelCaseName':camelCase(_0x255952),'snakeCaseName':snakeCase(_0x255952),'pluralPascalCaseName':startCase(camelCase(plural(_0x255952)))[_0x597e9b(0x156)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x255952))},_0x44755d=_0x27310f+'/packages/'+_0x4a15e0+_0x597e9b(0x14b);[_0x597e9b(0x10b),'COPY'][_0x597e9b(0x15f)](_0x16c2f7[_0x597e9b(0x128)])?await this['createHistoryServiceFiles'](_0x44755d,_0x42bfe5,_0x16c2f7,_0x16ec96,_0x21482d):await this['createNoHistoryServiceFiels'](_0x44755d,_0x42bfe5,_0x16c2f7,_0x16ec96,_0x21482d);}async[a0_0x48affc(0x164)](_0xb4fcf,_0x4cb08c,_0x15b1e9,_0x4580bd,_0x33bad9){const _0x325555=a0_0x48affc;await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+_0x325555(0x186)),serviceHistoryIndex,_0x33bad9);let _0x5ec979=this[_0x325555(0x11a)](_0x15b1e9,_0x4580bd);await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+'.ts'),_0x5ec979,_0x33bad9),await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+_0x325555(0x15b)),serviceQuery,_0x33bad9),await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+_0x325555(0x136)),serviceMutation,_0x33bad9);let _0x5499a7=this[_0x325555(0x126)](_0x4580bd);await this['writeFile'](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+_0x325555(0x176)),_0x5499a7,_0x33bad9);let _0x3c4dbe=this[_0x325555(0x17f)](_0x15b1e9,_0x4580bd);await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+_0x325555(0x166)),_0x3c4dbe,_0x33bad9);let _0x408f8c='';_0x325555(0x10b)==_0x15b1e9[_0x325555(0x128)]?(_0x408f8c='\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20',await this['writeFile'](_0xb4fcf+(_0x4cb08c+_0x325555(0x196)),serviceEntitySubscriber,_0x33bad9)):_0x408f8c='';let _0x35bac0=serviceEntitySubscriber[_0x325555(0x156)](/{{entityToJson}}/g,_0x408f8c);await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+'/event-subscriber.ts'),_0x35bac0,_0x33bad9),await this[_0x325555(0x115)](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+_0x325555(0x165)),serviceHistoryQuery,_0x33bad9),await this['writeFile'](_0xb4fcf+(_0x4cb08c+'/'+_0x4cb08c+_0x325555(0x137)),sereviceHistoryType,_0x33bad9);let _0x190aab=_0xb4fcf+'index.ts';0x0==await this[_0x325555(0x10c)](_0x190aab)&&await this[_0x325555(0x115)](_0x190aab,allIndex,_0x33bad9);let _0x15d2f0=await fs[_0x325555(0x15d)](_0x190aab,_0x325555(0x169));_0x15d2f0[_0x325555(0x155)]('export\x20*\x20from\x20\x27./'+_0x33bad9[_0x325555(0x108)]+'/'+_0x33bad9['name']+_0x325555(0x17e))<0x0&&(_0x15d2f0=_0x15d2f0[_0x325555(0x156)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x33bad9[_0x325555(0x108)]+'/'+_0x33bad9[_0x325555(0x108)]+'-history\x27')),_0x15d2f0['indexOf'](_0x325555(0x158)+_0x33bad9[_0x325555(0x108)]+'/'+_0x33bad9['name']+'\x27')<0x0&&(_0x15d2f0=_0x15d2f0[_0x325555(0x156)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x33bad9[_0x325555(0x108)]+'/'+_0x33bad9[_0x325555(0x108)]+'\x27')),_0x15d2f0[_0x325555(0x155)](_0x325555(0x184)+_0x33bad9[_0x325555(0x109)]+'Entities,\x20resolvers\x20as\x20'+_0x33bad9[_0x325555(0x109)]+'Resolvers,\x20subscribers\x20as\x20'+_0x33bad9[_0x325555(0x109)]+_0x325555(0x144)+_0x33bad9[_0x325555(0x108)]+'\x27')<0x0&&(_0x15d2f0=_0x15d2f0[_0x325555(0x156)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x33bad9[_0x325555(0x109)]+_0x325555(0x118)+_0x33bad9[_0x325555(0x109)]+'Resolvers,\x20subscribers\x20as\x20'+_0x33bad9['pascalCaseName']+'EntitySubscribers\x20}\x20from\x20\x27./'+_0x33bad9[_0x325555(0x108)]+'\x27')),_0x15d2f0['indexOf'](_0x325555(0x13c)+_0x33bad9['pascalCaseName']+_0x325555(0x132))<0x0&&(_0x15d2f0=_0x15d2f0[_0x325555(0x156)](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x33bad9[_0x325555(0x109)]+'Entities,')),_0x15d2f0[_0x325555(0x155)]('...'+_0x33bad9[_0x325555(0x109)]+_0x325555(0x16d))<0x0&&(_0x15d2f0=_0x15d2f0[_0x325555(0x156)](/\/\* RESOLVER CLASSES \*\//,_0x325555(0x138)+_0x33bad9['pascalCaseName']+_0x325555(0x16d))),_0x15d2f0['indexOf'](_0x325555(0x13c)+_0x33bad9[_0x325555(0x109)]+_0x325555(0x163))<0x0&&(_0x15d2f0=_0x15d2f0[_0x325555(0x156)](/\/\* SUBSCRIBERS \*\//,_0x325555(0x170)+_0x33bad9[_0x325555(0x109)]+_0x325555(0x163))),await this[_0x325555(0x115)](_0x190aab,_0x15d2f0,_0x33bad9);}async['createNoHistoryServiceFiels'](_0x3f9b33,_0x3bb128,_0x37b2a6,_0x3c6058,_0x3e85ff){const _0x3c8328=a0_0x48affc;await this[_0x3c8328(0x115)](_0x3f9b33+(_0x3bb128+'/index.ts'),serviceIndex,_0x3e85ff),await this[_0x3c8328(0x115)](_0x3f9b33+(_0x3bb128+'/'+_0x3bb128+_0x3c8328(0x15b)),serviceQuery,_0x3e85ff),await this[_0x3c8328(0x115)](_0x3f9b33+(_0x3bb128+'/'+_0x3bb128+_0x3c8328(0x136)),serviceMutation,_0x3e85ff);let _0x3838db=this[_0x3c8328(0x11a)](_0x37b2a6,_0x3c6058);await this[_0x3c8328(0x115)](_0x3f9b33+(_0x3bb128+'/'+_0x3bb128+_0x3c8328(0x133)),_0x3838db,_0x3e85ff);let _0x2ebb47=this[_0x3c8328(0x126)](_0x3c6058);await this[_0x3c8328(0x115)](_0x3f9b33+(_0x3bb128+'/'+_0x3bb128+_0x3c8328(0x176)),_0x2ebb47,_0x3e85ff);let _0x20f9b3=_0x3f9b33+_0x3c8328(0x18d);0x0==await this['existsPath'](_0x20f9b3)&&await this[_0x3c8328(0x115)](_0x20f9b3,allIndex,_0x3e85ff);let _0x290587=await fs[_0x3c8328(0x15d)](_0x20f9b3,_0x3c8328(0x169));_0x290587[_0x3c8328(0x155)](_0x3c8328(0x158)+_0x3e85ff[_0x3c8328(0x108)]+'/'+_0x3e85ff[_0x3c8328(0x108)]+'\x27')<0x0&&(_0x290587=_0x290587[_0x3c8328(0x156)](/\/\* EXPORT ENTITY TYPES \*\//,_0x3c8328(0x141)+_0x3e85ff[_0x3c8328(0x108)]+'/'+_0x3e85ff['name']+'\x27')),_0x290587[_0x3c8328(0x155)](_0x3c8328(0x184)+_0x3e85ff[_0x3c8328(0x109)]+'Entities,\x20resolvers\x20as\x20'+_0x3e85ff[_0x3c8328(0x109)]+_0x3c8328(0x154)+_0x3e85ff[_0x3c8328(0x108)]+'\x27')<0x0&&(_0x290587=_0x290587['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x3e85ff[_0x3c8328(0x109)]+_0x3c8328(0x118)+_0x3e85ff['pascalCaseName']+'Resolvers\x20}\x20from\x20\x27./'+_0x3e85ff['name']+'\x27')),_0x290587[_0x3c8328(0x155)]('...'+_0x3e85ff[_0x3c8328(0x109)]+_0x3c8328(0x132))<0x0&&(_0x290587=_0x290587[_0x3c8328(0x156)](/\/\* ENTITIES \*\//,_0x3c8328(0x14e)+_0x3e85ff[_0x3c8328(0x109)]+_0x3c8328(0x132))),_0x290587[_0x3c8328(0x155)](_0x3c8328(0x13c)+_0x3e85ff[_0x3c8328(0x109)]+_0x3c8328(0x16d))<0x0&&(_0x290587=_0x290587[_0x3c8328(0x156)](/\/\* RESOLVER CLASSES \*\//,_0x3c8328(0x138)+_0x3e85ff[_0x3c8328(0x109)]+'Resolvers,')),await this[_0x3c8328(0x115)](_0x20f9b3,_0x290587,_0x3e85ff);}['createTypeText'](_0x41dc0f){const _0x3f5619=a0_0x48affc;let _0x1bbcbd=sereviceType,_0x72a088=_0x41dc0f[_0x3f5619(0x168)](_0x3b831b=>{const _0xdd58e6=_0x3f5619;if('id'==_0x3b831b[_0xdd58e6(0x108)])return'';if('domain_id'==_0x3b831b['name'])return'';if(_0xdd58e6(0x122)==_0x3b831b[_0xdd58e6(0x108)])return'';if(_0xdd58e6(0x117)==_0x3b831b['name'])return'';if(_0xdd58e6(0x157)==_0x3b831b[_0xdd58e6(0x108)])return'';if('updater_id'==_0x3b831b[_0xdd58e6(0x108)])return'';let _0x253313=this[_0xdd58e6(0x189)](_0x3b831b),_0x571c61=this[_0xdd58e6(0x140)](_0x3b831b),_0x249636=camelCase(_0x3b831b[_0xdd58e6(0x108)]);return'\x20\x20'+(_0xdd58e6(0x15e)+(0x0==_0x253313['length']?'':_0xdd58e6(0x17d)+_0x253313+',')+_0xdd58e6(0x12f)+_0x3b831b[_0xdd58e6(0x179)]+_0xdd58e6(0x119))+_0xdd58e6(0x192)+(''+_0x249636+(_0x3b831b['nullable']?'?':'')+':\x20'+_0x571c61)+'\x0a';});_0x1bbcbd=_0x1bbcbd['replace'](/{{newTypeColumns}}/g,_0x72a088[_0x3f5619(0x13f)]('\x0a'));let _0x11116c=_0x41dc0f[_0x3f5619(0x168)](_0x3d8920=>{const _0x49baef=_0x3f5619;if('id'==_0x3d8920['name'])return'';if(_0x49baef(0x10f)==_0x3d8920[_0x49baef(0x108)])return'';if(_0x49baef(0x122)==_0x3d8920[_0x49baef(0x108)])return'';if(_0x49baef(0x117)==_0x3d8920[_0x49baef(0x108)])return'';if('creator_id'==_0x3d8920['name'])return'';if(_0x49baef(0x17c)==_0x3d8920[_0x49baef(0x108)])return'';let _0x1d290c=this['getFieldType'](_0x3d8920),_0x529ecb=this[_0x49baef(0x140)](_0x3d8920);_0x3d8920[_0x49baef(0x179)]=!0x0;let _0x46f592=camelCase(_0x3d8920[_0x49baef(0x108)]);return'\x20\x20'+(_0x49baef(0x15e)+(0x0==_0x1d290c[_0x49baef(0x124)]?'':'type\x20=>'+_0x1d290c+',')+_0x49baef(0x12f)+_0x3d8920[_0x49baef(0x179)]+_0x49baef(0x119))+_0x49baef(0x192)+(''+_0x46f592+(_0x3d8920[_0x49baef(0x179)]?'?':'')+':\x20'+_0x529ecb)+'\x0a';});return _0x1bbcbd=_0x1bbcbd[_0x3f5619(0x156)](/{{patchTypeColumns}}/g,_0x11116c[_0x3f5619(0x13f)]('\x0a')),_0x1bbcbd;}[a0_0x48affc(0x11a)](_0x2d6ac4,_0x259e19){const _0x36e615=a0_0x48affc;let _0x461160=serviceEntity,_0x57103c=_0x259e19['sort'](function(_0x4dbe38,_0x23eeeb){const _0x31ff93=a0_0x2554;return _0x4dbe38[_0x31ff93(0x12c)]-_0x23eeeb['rank'];})['map'](_0x554a33=>this[_0x36e615(0x197)](_0x554a33));[_0x36e615(0x113),_0x36e615(0x10b)][_0x36e615(0x15f)](_0x2d6ac4[_0x36e615(0x128)])&&_0x57103c['push'](_0x36e615(0x183)),_0x461160=_0x461160[_0x36e615(0x156)](/{{entityColumns}}/g,_0x57103c[_0x36e615(0x13f)]('\x0a'));let _0x1f0908='',_0x3ea5a0=_0x259e19['filter'](_0x56d1ef=>_0x56d1ef[_0x36e615(0x161)]&&_0x56d1ef['uniqRank']>0x0)['sort'](function(_0x21b12e,_0x3a240c){const _0x1c26df=_0x36e615;return _0x21b12e[_0x1c26df(0x161)]-_0x3a240c[_0x1c26df(0x161)];});if(_0x3ea5a0[_0x36e615(0x124)]>0x0){_0x1f0908='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0x2bad98=_0x3ea5a0[_0x36e615(0x168)](_0x3d4625=>{const _0x21ca67=_0x36e615;let _0x244d7d=_0x3d4625[_0x21ca67(0x108)];return _0x21ca67(0x10f)==_0x3d4625[_0x21ca67(0x108)]&&(_0x244d7d=_0x21ca67(0x10a)),_0x21ca67(0x157)==_0x3d4625[_0x21ca67(0x108)]&&(_0x244d7d=_0x21ca67(0x175)),_0x21ca67(0x17c)==_0x3d4625[_0x21ca67(0x108)]&&(_0x244d7d=_0x21ca67(0x174)),_0x21ca67(0x18e)+camelCase(_0x244d7d);});_0x1f0908=_0x1f0908[_0x36e615(0x156)](/{{indexColumns}}/g,_0x2bad98['join'](','));}return _0x461160=_0x461160[_0x36e615(0x156)](/{{indexAnn}}/g,_0x1f0908),_0x461160;}[a0_0x48affc(0x17f)](_0xa7a011,_0x202656){const _0x51a005=a0_0x48affc;let _0x175eba=_0x51a005(0x10b)==_0xa7a011[_0x51a005(0x128)]?serviceEntityHistJson:serviceEntityHistCopy,_0x54900a=_0x202656[_0x51a005(0x149)](function(_0x153194,_0x5b0e8f){const _0x553fb0=_0x51a005;return _0x153194[_0x553fb0(0x12c)]-_0x5b0e8f[_0x553fb0(0x12c)];})[_0x51a005(0x168)](_0x49e752=>this[_0x51a005(0x197)](_0x49e752));return _0x175eba=_0x175eba[_0x51a005(0x156)](/{{entityColumns}}/g,_0x54900a['join']('\x0a')),_0x175eba;}[a0_0x48affc(0x197)](_0x2fb6a1){const _0x5ba53a=a0_0x48affc;if('id'==_0x2fb6a1[_0x5ba53a(0x108)])return'';if('domain_id'==_0x2fb6a1[_0x5ba53a(0x108)])return'';if(_0x5ba53a(0x122)==_0x2fb6a1[_0x5ba53a(0x108)])return'';if('updated_at'==_0x2fb6a1['name'])return'';if(_0x5ba53a(0x157)==_0x2fb6a1['name'])return'';if('updater_id'==_0x2fb6a1['name'])return'';let _0x371745=_0x2fb6a1[_0x5ba53a(0x190)];_0x5ba53a(0x139)==_0x2fb6a1[_0x5ba53a(0x190)]&&(_0x371745=_0x5ba53a(0x159)),_0x5ba53a(0x10d)==_0x2fb6a1[_0x5ba53a(0x190)]&&(_0x371745=_0x5ba53a(0x17a)),_0x5ba53a(0x13d)==_0x2fb6a1['colType']&&(_0x371745=_0x5ba53a(0x16e)),_0x5ba53a(0x15c)==_0x2fb6a1[_0x5ba53a(0x190)]&&(_0x371745=_0x5ba53a(0x147));let _0x39298d='';_0x5ba53a(0x13d)==_0x2fb6a1[_0x5ba53a(0x190)]&&(_0x39298d=_0x2fb6a1[_0x5ba53a(0x13a)]);let _0x1b3d23=this[_0x5ba53a(0x189)](_0x2fb6a1),_0x57f88e=this[_0x5ba53a(0x140)](_0x2fb6a1),_0x3e5aa2=camelCase(_0x2fb6a1['name']);return'\x20\x20'+(_0x5ba53a(0x116)+_0x2fb6a1[_0x5ba53a(0x108)]+'\x27,\x20type:\x20\x27'+_0x371745+_0x5ba53a(0x150)+_0x2fb6a1[_0x5ba53a(0x179)]+'\x20'+(0x0==_0x39298d[_0x5ba53a(0x124)]?'':',length:'+_0x39298d)+_0x5ba53a(0x119))+_0x5ba53a(0x192)+(_0x5ba53a(0x15e)+(0x0==_0x1b3d23['length']?'':_0x5ba53a(0x17d)+_0x1b3d23+',')+'\x20{\x20nullable:\x20'+_0x2fb6a1[_0x5ba53a(0x179)]+'\x20})')+_0x5ba53a(0x192)+(''+_0x3e5aa2+(_0x2fb6a1[_0x5ba53a(0x179)]?'?':'')+':\x20'+_0x57f88e)+'\x0a';}['getFieldType'](_0x300a22){const _0x25db05=a0_0x48affc;let _0x4fa04b='';return _0x25db05(0x139)==_0x300a22[_0x25db05(0x190)]&&(_0x4fa04b=_0x25db05(0x152)),_0x25db05(0x130)==_0x300a22[_0x25db05(0x190)]&&(_0x4fa04b=_0x25db05(0x152)),_0x25db05(0x10d)==_0x300a22[_0x25db05(0x190)]&&(_0x4fa04b=_0x25db05(0x172)),_0x25db05(0x11c)==_0x300a22['colType']&&(_0x4fa04b=_0x25db05(0x172)),_0x4fa04b;}[a0_0x48affc(0x140)](_0x1b7079){const _0x19f35d=a0_0x48affc;let _0x163fa9=_0x1b7079[_0x19f35d(0x190)];return _0x19f35d(0x142)==_0x1b7079['colType']&&(_0x163fa9=_0x19f35d(0x16a)),'double'==_0x1b7079['colType']&&(_0x163fa9=_0x19f35d(0x16a)),_0x19f35d(0x130)==_0x1b7079[_0x19f35d(0x190)]&&(_0x163fa9='number'),'integer'==_0x1b7079[_0x19f35d(0x190)]&&(_0x163fa9=_0x19f35d(0x16a)),_0x19f35d(0x10d)==_0x1b7079[_0x19f35d(0x190)]&&(_0x163fa9=_0x19f35d(0x16a)),_0x19f35d(0x15c)==_0x1b7079[_0x19f35d(0x190)]&&(_0x163fa9=_0x19f35d(0x11f)),'date'==_0x1b7079[_0x19f35d(0x190)]&&(_0x163fa9=_0x19f35d(0x11f)),_0x19f35d(0x153)==_0x1b7079[_0x19f35d(0x190)]&&(_0x163fa9='string'),_0x163fa9;}async['writeFile'](_0x1a0e13,_0x1dbe87,_0x3e3916){await fs['writeFileSync'](_0x1a0e13,this['replaceNamesMap'](_0x1dbe87,_0x3e3916),'utf8');}[a0_0x48affc(0x14d)](_0x367f10,_0x2fd390){const _0x1a8e5e=a0_0x48affc;return _0x367f10['replace'](/{{pascalCase name}}/g,_0x2fd390['pascalCaseName'])[_0x1a8e5e(0x156)](/{{camelCase name}}/g,_0x2fd390[_0x1a8e5e(0x14a)])[_0x1a8e5e(0x156)](/{{snakeCase name}}/g,_0x2fd390[_0x1a8e5e(0x120)])['replace'](/{{pluralPascalCase name}}/g,_0x2fd390[_0x1a8e5e(0x15a)])['replace'](/{{pluralCamelCase name}}/g,_0x2fd390[_0x1a8e5e(0x10e)])[_0x1a8e5e(0x156)](/{{tableName}}/g,_0x2fd390[_0x1a8e5e(0x151)])[_0x1a8e5e(0x156)](/{{name}}/g,_0x2fd390[_0x1a8e5e(0x108)]);}async['createServicePath'](_0x41ccd0,_0x14b277,_0x2a88e6){const _0x13ab00=a0_0x48affc;let _0x3c5660=_0x41ccd0+'/packages';await this['createDir'](_0x3c5660),_0x3c5660=_0x3c5660+'/'+_0x14b277,await this[_0x13ab00(0x195)](_0x3c5660),_0x3c5660+='/server',await this['createDir'](_0x3c5660),_0x3c5660+=_0x13ab00(0x191),await this['createDir'](_0x3c5660),_0x3c5660=_0x3c5660+'/'+_0x2a88e6,await this[_0x13ab00(0x195)](_0x3c5660);}[a0_0x48affc(0x135)](){const _0xf7758=a0_0x48affc;let _0x45cb8e=process[_0xf7758(0x193)][_0xf7758(0x145)][_0xf7758(0x11b)]('/'),_0x5bba9c=[];for(let _0x4e60fd=0x0;_0x4e60fd<_0x45cb8e['length']&&_0xf7758(0x121)!=_0x45cb8e[_0x4e60fd];_0x4e60fd++)_0x5bba9c[_0xf7758(0x11e)](_0x45cb8e[_0x4e60fd]);return _0x5bba9c['join']('/');}async[a0_0x48affc(0x195)](_0x4d1992){const _0x4a118d=a0_0x48affc;0x0==await this[_0x4a118d(0x10c)](_0x4d1992)&&fs[_0x4a118d(0x12e)](_0x4d1992);}async[a0_0x48affc(0x10c)](_0x5f159e){return await fs['existsSync'](_0x5f159e);}};tslib_1[a0_0x48affc(0x14f)]([(0x0,type_graphql_1['Query'])(_0x2667de=>Boolean,{'description':a0_0x48affc(0x12a)}),tslib_1[a0_0x48affc(0x14c)](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1[a0_0x48affc(0x14c)](0x1,(0x0,type_graphql_1[a0_0x48affc(0x160)])()),tslib_1[a0_0x48affc(0x143)](a0_0x48affc(0x134),Function),tslib_1[a0_0x48affc(0x143)](a0_0x48affc(0x125),[String,Object]),tslib_1[a0_0x48affc(0x143)](a0_0x48affc(0x131),Promise)],OperatoToolCreateService[a0_0x48affc(0x16f)],a0_0x48affc(0x194),null),OperatoToolCreateService=tslib_1[a0_0x48affc(0x14f)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports[a0_0x48affc(0x111)]=OperatoToolCreateService;const allIndex=a0_0x48affc(0x188),serviceIndex=a0_0x48affc(0x177),serviceHistoryIndex=a0_0x48affc(0x13e),serviceQuery=a0_0x48affc(0x16c),serviceHistoryQuery=a0_0x48affc(0x187),serviceMutation=a0_0x48affc(0x167),sereviceType=a0_0x48affc(0x182),sereviceHistoryType=a0_0x48affc(0x148),serviceEntity=a0_0x48affc(0x171),serviceEntityHistCopy=a0_0x48affc(0x146),serviceEntityHistJson=a0_0x48affc(0x180),serviceEntitySubscriber=a0_0x48affc(0x185);
|
|
1
|
+
'use strict';const a0_0x42ad40=a0_0xbfd3;function a0_0xbfd3(_0x30d2b5,_0x16548e){const _0x5f23e6=a0_0x5f23();return a0_0xbfd3=function(_0xbfd3f6,_0x25987a){_0xbfd3f6=_0xbfd3f6-0x154;let _0x338942=_0x5f23e6[_0xbfd3f6];return _0x338942;},a0_0xbfd3(_0x30d2b5,_0x16548e);}(function(_0x15e045,_0x2951b5){const _0x27a366=a0_0xbfd3,_0xd53777=_0x15e045();while(!![]){try{const _0x5d3581=-parseInt(_0x27a366(0x1ad))/0x1+-parseInt(_0x27a366(0x1c3))/0x2*(parseInt(_0x27a366(0x19a))/0x3)+parseInt(_0x27a366(0x1df))/0x4+-parseInt(_0x27a366(0x172))/0x5+-parseInt(_0x27a366(0x186))/0x6*(-parseInt(_0x27a366(0x19b))/0x7)+-parseInt(_0x27a366(0x1c9))/0x8*(-parseInt(_0x27a366(0x192))/0x9)+parseInt(_0x27a366(0x17b))/0xa;if(_0x5d3581===_0x2951b5)break;else _0xd53777['push'](_0xd53777['shift']());}catch(_0x2fba7d){_0xd53777['push'](_0xd53777['shift']());}}}(a0_0x5f23,0x48b96));Object[a0_0x42ad40(0x1d0)](exports,a0_0x42ad40(0x18c),{'value':!0x0}),exports['OperatoToolCreateService']=void 0x0;const tslib_1=require(a0_0x42ad40(0x1d4)),type_graphql_1=require(a0_0x42ad40(0x1e4)),shell_1=require(a0_0x42ad40(0x18d)),resource_base_1=require(a0_0x42ad40(0x185)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x42ad40(0x184)),{plural:plural}=require(a0_0x42ad40(0x1d3)),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x42ad40(0x183)](_0x15fa18,_0x36554f){const _0x65064b=a0_0x42ad40,{domain:_0xb6655b}=_0x36554f[_0x65064b(0x169)],_0x41ece3=await(0x0,shell_1['getRepository'])(resource_base_1[_0x65064b(0x163)])[_0x65064b(0x161)]({'where':{'id':_0x15fa18}}),_0x204313=await(0x0,shell_1[_0x65064b(0x1a7)])(resource_base_1[_0x65064b(0x198)])['find']({'where':{'domain':{'id':_0xb6655b['id']},'entity':{'id':_0x41ece3['id']}}});let {name:_0x11e7a3='',bundle:_0x3438f1=''}=_0x41ece3||{},_0x1a6ccf=this[_0x65064b(0x16a)](),_0x4011af=kebabCase(_0x11e7a3);return await this[_0x65064b(0x193)](_0x1a6ccf,_0x3438f1,_0x4011af),await this[_0x65064b(0x190)](_0x1a6ccf,_0x3438f1,_0x11e7a3,_0x4011af,_0x41ece3,_0x204313),!0x0;}async[a0_0x42ad40(0x190)](_0x530630,_0x2ea571,_0x1160d1,_0x2a594a,_0x2e494d,_0x438583){const _0x2c70ba=a0_0x42ad40;let _0x3530b8={'name':_0x2a594a,'tableName':_0x2e494d[_0x2c70ba(0x15f)],'pascalCaseName':startCase(camelCase(_0x1160d1))[_0x2c70ba(0x191)](/ /g,''),'camelCaseName':camelCase(_0x1160d1),'snakeCaseName':snakeCase(_0x1160d1),'pluralPascalCaseName':startCase(camelCase(plural(_0x1160d1)))[_0x2c70ba(0x191)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x1160d1))},_0x5f35a0=_0x530630+_0x2c70ba(0x1b9)+_0x2ea571+_0x2c70ba(0x1b4);[_0x2c70ba(0x1b1),_0x2c70ba(0x179)][_0x2c70ba(0x19f)](_0x2e494d['dataProp'])?await this['createHistoryServiceFiles'](_0x5f35a0,_0x2a594a,_0x2e494d,_0x438583,_0x3530b8):await this[_0x2c70ba(0x1dd)](_0x5f35a0,_0x2a594a,_0x2e494d,_0x438583,_0x3530b8);}async[a0_0x42ad40(0x166)](_0x1636b6,_0x1bc5f1,_0x9774a2,_0x5d667e,_0x34e6e6){const _0x36c6cc=a0_0x42ad40;await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+_0x36c6cc(0x17a)),serviceHistoryIndex,_0x34e6e6);let _0x518012=this[_0x36c6cc(0x1da)](_0x9774a2,_0x5d667e);await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+_0x36c6cc(0x18f)),_0x518012,_0x34e6e6),await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+_0x36c6cc(0x1a4)),serviceQuery,_0x34e6e6),await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+_0x36c6cc(0x1ab)),serviceMutation,_0x34e6e6);let _0x5bfd7e=this[_0x36c6cc(0x1b0)](_0x5d667e);await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+_0x36c6cc(0x1d5)),_0x5bfd7e,_0x34e6e6);let _0x3aaef2=this[_0x36c6cc(0x1bc)](_0x9774a2,_0x5d667e);await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+_0x36c6cc(0x19e)),_0x3aaef2,_0x34e6e6);let _0x16e5c0='';_0x36c6cc(0x1b1)==_0x9774a2[_0x36c6cc(0x1bd)]?(_0x16e5c0='\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[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+_0x36c6cc(0x1c2)),serviceEntitySubscriber,_0x34e6e6)):_0x16e5c0='';let _0x4e8696=serviceEntitySubscriber['replace'](/{{entityToJson}}/g,_0x16e5c0);await this['writeFile'](_0x1636b6+(_0x1bc5f1+_0x36c6cc(0x1c2)),_0x4e8696,_0x34e6e6),await this['writeFile'](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+'-history-query.ts'),serviceHistoryQuery,_0x34e6e6),await this[_0x36c6cc(0x197)](_0x1636b6+(_0x1bc5f1+'/'+_0x1bc5f1+_0x36c6cc(0x1dc)),sereviceHistoryType,_0x34e6e6);let _0x52966c=_0x1636b6+_0x36c6cc(0x1aa);0x0==await this['existsPath'](_0x52966c)&&await this[_0x36c6cc(0x197)](_0x52966c,allIndex,_0x34e6e6);let _0xca1b9b=await fs[_0x36c6cc(0x15d)](_0x52966c,'utf8');_0xca1b9b[_0x36c6cc(0x1b5)](_0x36c6cc(0x199)+_0x34e6e6[_0x36c6cc(0x180)]+'/'+_0x34e6e6[_0x36c6cc(0x180)]+_0x36c6cc(0x17f))<0x0&&(_0xca1b9b=_0xca1b9b['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x36c6cc(0x1b6)+_0x34e6e6['name']+'/'+_0x34e6e6[_0x36c6cc(0x180)]+_0x36c6cc(0x17f))),_0xca1b9b[_0x36c6cc(0x1b5)](_0x36c6cc(0x199)+_0x34e6e6[_0x36c6cc(0x180)]+'/'+_0x34e6e6[_0x36c6cc(0x180)]+'\x27')<0x0&&(_0xca1b9b=_0xca1b9b[_0x36c6cc(0x191)](/\/\* EXPORT ENTITY TYPES \*\//,_0x36c6cc(0x1b6)+_0x34e6e6['name']+'/'+_0x34e6e6['name']+'\x27')),_0xca1b9b[_0x36c6cc(0x1b5)]('import\x20{\x20entities\x20as\x20'+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x1d9)+_0x34e6e6[_0x36c6cc(0x171)]+'Resolvers,\x20subscribers\x20as\x20'+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x176)+_0x34e6e6[_0x36c6cc(0x180)]+'\x27')<0x0&&(_0xca1b9b=_0xca1b9b[_0x36c6cc(0x191)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x1d9)+_0x34e6e6[_0x36c6cc(0x171)]+'Resolvers,\x20subscribers\x20as\x20'+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x176)+_0x34e6e6[_0x36c6cc(0x180)]+'\x27')),_0xca1b9b[_0x36c6cc(0x1b5)](_0x36c6cc(0x178)+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x154))<0x0&&(_0xca1b9b=_0xca1b9b['replace'](/\/\* ENTITIES \*\//,_0x36c6cc(0x16c)+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x154))),_0xca1b9b[_0x36c6cc(0x1b5)](_0x36c6cc(0x178)+_0x34e6e6['pascalCaseName']+_0x36c6cc(0x1af))<0x0&&(_0xca1b9b=_0xca1b9b[_0x36c6cc(0x191)](/\/\* RESOLVER CLASSES \*\//,_0x36c6cc(0x170)+_0x34e6e6[_0x36c6cc(0x171)]+_0x36c6cc(0x1af))),_0xca1b9b[_0x36c6cc(0x1b5)]('...'+_0x34e6e6['pascalCaseName']+'EntitySubscribers,')<0x0&&(_0xca1b9b=_0xca1b9b[_0x36c6cc(0x191)](/\/\* SUBSCRIBERS \*\//,_0x36c6cc(0x16f)+_0x34e6e6[_0x36c6cc(0x171)]+'EntitySubscribers,')),await this[_0x36c6cc(0x197)](_0x52966c,_0xca1b9b,_0x34e6e6);}async[a0_0x42ad40(0x1dd)](_0x4e2eda,_0x1741fc,_0xb961ac,_0x8cbeab,_0x2c8e44){const _0x1d7331=a0_0x42ad40;await this[_0x1d7331(0x197)](_0x4e2eda+(_0x1741fc+_0x1d7331(0x17a)),serviceIndex,_0x2c8e44),await this[_0x1d7331(0x197)](_0x4e2eda+(_0x1741fc+'/'+_0x1741fc+'-query.ts'),serviceQuery,_0x2c8e44),await this[_0x1d7331(0x197)](_0x4e2eda+(_0x1741fc+'/'+_0x1741fc+_0x1d7331(0x1ab)),serviceMutation,_0x2c8e44);let _0x2ccd56=this[_0x1d7331(0x1da)](_0xb961ac,_0x8cbeab);await this[_0x1d7331(0x197)](_0x4e2eda+(_0x1741fc+'/'+_0x1741fc+'.ts'),_0x2ccd56,_0x2c8e44);let _0x9a82a4=this['createTypeText'](_0x8cbeab);await this[_0x1d7331(0x197)](_0x4e2eda+(_0x1741fc+'/'+_0x1741fc+'-type.ts'),_0x9a82a4,_0x2c8e44);let _0x5997fa=_0x4e2eda+_0x1d7331(0x1aa);0x0==await this['existsPath'](_0x5997fa)&&await this[_0x1d7331(0x197)](_0x5997fa,allIndex,_0x2c8e44);let _0x34fc9a=await fs['readFileSync'](_0x5997fa,_0x1d7331(0x159));_0x34fc9a[_0x1d7331(0x1b5)](_0x1d7331(0x199)+_0x2c8e44[_0x1d7331(0x180)]+'/'+_0x2c8e44[_0x1d7331(0x180)]+'\x27')<0x0&&(_0x34fc9a=_0x34fc9a[_0x1d7331(0x191)](/\/\* EXPORT ENTITY TYPES \*\//,_0x1d7331(0x1b6)+_0x2c8e44[_0x1d7331(0x180)]+'/'+_0x2c8e44[_0x1d7331(0x180)]+'\x27')),_0x34fc9a[_0x1d7331(0x1b5)](_0x1d7331(0x1a5)+_0x2c8e44['pascalCaseName']+_0x1d7331(0x1d9)+_0x2c8e44[_0x1d7331(0x171)]+_0x1d7331(0x1c6)+_0x2c8e44[_0x1d7331(0x180)]+'\x27')<0x0&&(_0x34fc9a=_0x34fc9a[_0x1d7331(0x191)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1d7331(0x1cf)+_0x2c8e44[_0x1d7331(0x171)]+_0x1d7331(0x1d9)+_0x2c8e44[_0x1d7331(0x171)]+_0x1d7331(0x1c6)+_0x2c8e44[_0x1d7331(0x180)]+'\x27')),_0x34fc9a[_0x1d7331(0x1b5)](_0x1d7331(0x178)+_0x2c8e44[_0x1d7331(0x171)]+_0x1d7331(0x154))<0x0&&(_0x34fc9a=_0x34fc9a[_0x1d7331(0x191)](/\/\* ENTITIES \*\//,_0x1d7331(0x16c)+_0x2c8e44['pascalCaseName']+'Entities,')),_0x34fc9a[_0x1d7331(0x1b5)]('...'+_0x2c8e44['pascalCaseName']+_0x1d7331(0x1af))<0x0&&(_0x34fc9a=_0x34fc9a[_0x1d7331(0x191)](/\/\* RESOLVER CLASSES \*\//,_0x1d7331(0x170)+_0x2c8e44['pascalCaseName']+_0x1d7331(0x1af))),await this[_0x1d7331(0x197)](_0x5997fa,_0x34fc9a,_0x2c8e44);}[a0_0x42ad40(0x1b0)](_0xc41e9f){const _0x20348e=a0_0x42ad40;let _0x3d824c=sereviceType,_0x3b6ae6=_0xc41e9f['map'](_0x2f3dba=>{const _0x1add9d=a0_0xbfd3;if('id'==_0x2f3dba['name'])return'';if(_0x1add9d(0x1c4)==_0x2f3dba[_0x1add9d(0x180)])return'';if(_0x1add9d(0x165)==_0x2f3dba[_0x1add9d(0x180)])return'';if('updated_at'==_0x2f3dba['name'])return'';if(_0x1add9d(0x1de)==_0x2f3dba[_0x1add9d(0x180)])return'';if(_0x1add9d(0x19d)==_0x2f3dba[_0x1add9d(0x180)])return'';let _0x5a37a2=this[_0x1add9d(0x1cb)](_0x2f3dba),_0x215dc7=this[_0x1add9d(0x1c7)](_0x2f3dba),_0x440e05=camelCase(_0x2f3dba[_0x1add9d(0x180)]);return'\x20\x20'+('@Field('+(0x0==_0x5a37a2[_0x1add9d(0x1b2)]?'':_0x1add9d(0x196)+_0x5a37a2+',')+_0x1add9d(0x1a8)+_0x2f3dba[_0x1add9d(0x1d1)]+_0x1add9d(0x173))+_0x1add9d(0x1ca)+(''+_0x440e05+(_0x2f3dba[_0x1add9d(0x1d1)]?'?':'')+':\x20'+_0x215dc7)+'\x0a';});_0x3d824c=_0x3d824c[_0x20348e(0x191)](/{{newTypeColumns}}/g,_0x3b6ae6[_0x20348e(0x1bb)]('\x0a'));let _0x314025=_0xc41e9f['map'](_0x8ffc69=>{const _0xd77cfc=_0x20348e;if('id'==_0x8ffc69[_0xd77cfc(0x180)])return'';if(_0xd77cfc(0x1c4)==_0x8ffc69['name'])return'';if(_0xd77cfc(0x165)==_0x8ffc69[_0xd77cfc(0x180)])return'';if(_0xd77cfc(0x1d2)==_0x8ffc69[_0xd77cfc(0x180)])return'';if(_0xd77cfc(0x1de)==_0x8ffc69[_0xd77cfc(0x180)])return'';if('updater_id'==_0x8ffc69[_0xd77cfc(0x180)])return'';let _0x38eda5=this['getFieldType'](_0x8ffc69),_0x469c4a=this[_0xd77cfc(0x1c7)](_0x8ffc69);_0x8ffc69[_0xd77cfc(0x1d1)]=!0x0;let _0x2a91d1=camelCase(_0x8ffc69[_0xd77cfc(0x180)]);return'\x20\x20'+(_0xd77cfc(0x195)+(0x0==_0x38eda5['length']?'':_0xd77cfc(0x196)+_0x38eda5+',')+_0xd77cfc(0x1a8)+_0x8ffc69[_0xd77cfc(0x1d1)]+_0xd77cfc(0x173))+_0xd77cfc(0x1ca)+(''+_0x2a91d1+(_0x8ffc69[_0xd77cfc(0x1d1)]?'?':'')+':\x20'+_0x469c4a)+'\x0a';});return _0x3d824c=_0x3d824c[_0x20348e(0x191)](/{{patchTypeColumns}}/g,_0x314025[_0x20348e(0x1bb)]('\x0a')),_0x3d824c;}[a0_0x42ad40(0x1da)](_0x576da,_0x47b82e){const _0x246189=a0_0x42ad40;let _0x2c81c5=serviceEntity,_0x44c29f=_0x47b82e[_0x246189(0x15b)](function(_0x52c502,_0x48419c){const _0x17f1f8=_0x246189;return _0x52c502['rank']-_0x48419c[_0x17f1f8(0x1b3)];})['map'](_0x758ca1=>this[_0x246189(0x1cc)](_0x758ca1));[_0x246189(0x179),_0x246189(0x1b1)]['includes'](_0x576da[_0x246189(0x1bd)])&&_0x44c29f[_0x246189(0x1e1)]('\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201'),_0x2c81c5=_0x2c81c5[_0x246189(0x191)](/{{entityColumns}}/g,_0x44c29f[_0x246189(0x1bb)]('\x0a'));let _0x2973a2='',_0x286d08=_0x47b82e[_0x246189(0x1a1)](_0x20c0ac=>_0x20c0ac[_0x246189(0x158)]&&_0x20c0ac[_0x246189(0x158)]>0x0)[_0x246189(0x15b)](function(_0x43ff0c,_0x377a49){const _0x284e75=_0x246189;return _0x43ff0c[_0x284e75(0x158)]-_0x377a49[_0x284e75(0x158)];});if(_0x286d08[_0x246189(0x1b2)]>0x0){_0x2973a2=_0x246189(0x1ce);let _0x4e174a=_0x286d08[_0x246189(0x181)](_0x37b496=>{const _0x30b2b7=_0x246189;let _0x3cfd7f=_0x37b496[_0x30b2b7(0x180)];return _0x30b2b7(0x1c4)==_0x37b496[_0x30b2b7(0x180)]&&(_0x3cfd7f='domain'),_0x30b2b7(0x1de)==_0x37b496['name']&&(_0x3cfd7f=_0x30b2b7(0x1a3)),'updater_id'==_0x37b496[_0x30b2b7(0x180)]&&(_0x3cfd7f=_0x30b2b7(0x1e3)),'{{camelCase\x20name}}.'+camelCase(_0x3cfd7f);});_0x2973a2=_0x2973a2[_0x246189(0x191)](/{{indexColumns}}/g,_0x4e174a[_0x246189(0x1bb)](','));}return _0x2c81c5=_0x2c81c5[_0x246189(0x191)](/{{indexAnn}}/g,_0x2973a2),_0x2c81c5;}[a0_0x42ad40(0x1bc)](_0x376f55,_0x5e126d){const _0x2fe8c5=a0_0x42ad40;let _0x1b3779=_0x2fe8c5(0x1b1)==_0x376f55[_0x2fe8c5(0x1bd)]?serviceEntityHistJson:serviceEntityHistCopy,_0x5e89d2=_0x5e126d['sort'](function(_0x1cbca9,_0x5b5c6c){const _0x9f99d5=_0x2fe8c5;return _0x1cbca9[_0x9f99d5(0x1b3)]-_0x5b5c6c[_0x9f99d5(0x1b3)];})[_0x2fe8c5(0x181)](_0x2f79a7=>this[_0x2fe8c5(0x1cc)](_0x2f79a7));return _0x1b3779=_0x1b3779['replace'](/{{entityColumns}}/g,_0x5e89d2[_0x2fe8c5(0x1bb)]('\x0a')),_0x1b3779;}[a0_0x42ad40(0x1cc)](_0x43f2b1){const _0x3fee4b=a0_0x42ad40;if('id'==_0x43f2b1['name'])return'';if(_0x3fee4b(0x1c4)==_0x43f2b1[_0x3fee4b(0x180)])return'';if(_0x3fee4b(0x165)==_0x43f2b1[_0x3fee4b(0x180)])return'';if(_0x3fee4b(0x1d2)==_0x43f2b1[_0x3fee4b(0x180)])return'';if(_0x3fee4b(0x1de)==_0x43f2b1['name'])return'';if(_0x3fee4b(0x19d)==_0x43f2b1[_0x3fee4b(0x180)])return'';let _0x4cae1c=_0x43f2b1[_0x3fee4b(0x1d7)];_0x3fee4b(0x182)==_0x43f2b1[_0x3fee4b(0x1d7)]&&(_0x4cae1c=_0x3fee4b(0x1a0)),_0x3fee4b(0x15e)==_0x43f2b1[_0x3fee4b(0x1d7)]&&(_0x4cae1c=_0x3fee4b(0x189)),_0x3fee4b(0x16e)==_0x43f2b1['colType']&&(_0x4cae1c=_0x3fee4b(0x18e)),'datetime'==_0x43f2b1[_0x3fee4b(0x1d7)]&&(_0x4cae1c=_0x3fee4b(0x1ac));let _0x4234d9='';_0x3fee4b(0x16e)==_0x43f2b1[_0x3fee4b(0x1d7)]&&(_0x4234d9=_0x43f2b1[_0x3fee4b(0x1ba)]);let _0x4dba9d=this[_0x3fee4b(0x1cb)](_0x43f2b1),_0x5bba60=this[_0x3fee4b(0x1c7)](_0x43f2b1),_0x2334a1=camelCase(_0x43f2b1[_0x3fee4b(0x180)]);return'\x20\x20'+(_0x3fee4b(0x1a6)+_0x43f2b1['name']+_0x3fee4b(0x1a2)+_0x4cae1c+_0x3fee4b(0x16b)+_0x43f2b1[_0x3fee4b(0x1d1)]+'\x20'+(0x0==_0x4234d9[_0x3fee4b(0x1b2)]?'':_0x3fee4b(0x18b)+_0x4234d9)+_0x3fee4b(0x173))+_0x3fee4b(0x1ca)+(_0x3fee4b(0x195)+(0x0==_0x4dba9d[_0x3fee4b(0x1b2)]?'':_0x3fee4b(0x196)+_0x4dba9d+',')+'\x20{\x20nullable:\x20'+_0x43f2b1[_0x3fee4b(0x1d1)]+_0x3fee4b(0x173))+_0x3fee4b(0x1ca)+(''+_0x2334a1+(_0x43f2b1['nullable']?'?':'')+':\x20'+_0x5bba60)+'\x0a';}[a0_0x42ad40(0x1cb)](_0x4bdb7b){const _0x4c7e5d=a0_0x42ad40;let _0x39c3a4='';return'double'==_0x4bdb7b['colType']&&(_0x39c3a4=_0x4c7e5d(0x155)),_0x4c7e5d(0x19c)==_0x4bdb7b[_0x4c7e5d(0x1d7)]&&(_0x39c3a4=_0x4c7e5d(0x155)),_0x4c7e5d(0x15e)==_0x4bdb7b[_0x4c7e5d(0x1d7)]&&(_0x39c3a4=_0x4c7e5d(0x164)),'integer'==_0x4bdb7b[_0x4c7e5d(0x1d7)]&&(_0x39c3a4=_0x4c7e5d(0x164)),_0x39c3a4;}[a0_0x42ad40(0x1c7)](_0x48ab6f){const _0x16a7dd=a0_0x42ad40;let _0x478a1f=_0x48ab6f['colType'];return _0x16a7dd(0x1ae)==_0x48ab6f['colType']&&(_0x478a1f=_0x16a7dd(0x1c1)),_0x16a7dd(0x182)==_0x48ab6f[_0x16a7dd(0x1d7)]&&(_0x478a1f=_0x16a7dd(0x1c1)),_0x16a7dd(0x19c)==_0x48ab6f['colType']&&(_0x478a1f=_0x16a7dd(0x1c1)),_0x16a7dd(0x168)==_0x48ab6f['colType']&&(_0x478a1f=_0x16a7dd(0x1c1)),'long'==_0x48ab6f[_0x16a7dd(0x1d7)]&&(_0x478a1f=_0x16a7dd(0x1c1)),_0x16a7dd(0x17e)==_0x48ab6f['colType']&&(_0x478a1f=_0x16a7dd(0x1be)),_0x16a7dd(0x160)==_0x48ab6f['colType']&&(_0x478a1f=_0x16a7dd(0x1be)),'text'==_0x48ab6f[_0x16a7dd(0x1d7)]&&(_0x478a1f='string'),_0x478a1f;}async['writeFile'](_0x5460f7,_0x7b7e96,_0x235f49){const _0x5a757a=a0_0x42ad40;await fs['writeFileSync'](_0x5460f7,this[_0x5a757a(0x174)](_0x7b7e96,_0x235f49),_0x5a757a(0x159));}[a0_0x42ad40(0x174)](_0x5d9a50,_0x1bf40f){const _0x304bf2=a0_0x42ad40;return _0x5d9a50[_0x304bf2(0x191)](/{{pascalCase name}}/g,_0x1bf40f['pascalCaseName'])[_0x304bf2(0x191)](/{{camelCase name}}/g,_0x1bf40f['camelCaseName'])[_0x304bf2(0x191)](/{{snakeCase name}}/g,_0x1bf40f[_0x304bf2(0x1cd)])['replace'](/{{pluralPascalCase name}}/g,_0x1bf40f['pluralPascalCaseName'])[_0x304bf2(0x191)](/{{pluralCamelCase name}}/g,_0x1bf40f[_0x304bf2(0x1c8)])[_0x304bf2(0x191)](/{{tableName}}/g,_0x1bf40f[_0x304bf2(0x15f)])['replace'](/{{name}}/g,_0x1bf40f['name']);}async[a0_0x42ad40(0x193)](_0x4a47ce,_0x36566c,_0x436c67){const _0x123bb6=a0_0x42ad40;let _0x316b80=_0x4a47ce+_0x123bb6(0x167);await this[_0x123bb6(0x188)](_0x316b80),_0x316b80=_0x316b80+'/'+_0x36566c,await this[_0x123bb6(0x188)](_0x316b80),_0x316b80+=_0x123bb6(0x156),await this[_0x123bb6(0x188)](_0x316b80),_0x316b80+='/service',await this['createDir'](_0x316b80),_0x316b80=_0x316b80+'/'+_0x436c67,await this[_0x123bb6(0x188)](_0x316b80);}[a0_0x42ad40(0x16a)](){const _0x228429=a0_0x42ad40;let _0xe00aac=process[_0x228429(0x1b8)]['PWD'][_0x228429(0x162)]('/'),_0x4b6d04=[];for(let _0x19db27=0x0;_0x19db27<_0xe00aac['length']&&_0x228429(0x1d6)!=_0xe00aac[_0x19db27];_0x19db27++)_0x4b6d04['push'](_0xe00aac[_0x19db27]);return _0x4b6d04[_0x228429(0x1bb)]('/');}async[a0_0x42ad40(0x188)](_0x3c6f5b){const _0x5b84d1=a0_0x42ad40;0x0==await this[_0x5b84d1(0x1e2)](_0x3c6f5b)&&fs[_0x5b84d1(0x17d)](_0x3c6f5b);}async[a0_0x42ad40(0x1e2)](_0x470bcf){const _0x5c2d6c=a0_0x42ad40;return await fs[_0x5c2d6c(0x1e0)](_0x470bcf);}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x42ad40(0x18a)])(_0x3a8d02=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Service'}),tslib_1[a0_0x42ad40(0x1db)](0x0,(0x0,type_graphql_1[a0_0x42ad40(0x187)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x42ad40(0x16d)])()),tslib_1[a0_0x42ad40(0x17c)](a0_0x42ad40(0x1a9),Function),tslib_1[a0_0x42ad40(0x17c)]('design:paramtypes',[String,Object]),tslib_1['__metadata'](a0_0x42ad40(0x1bf),Promise)],OperatoToolCreateService[a0_0x42ad40(0x175)],a0_0x42ad40(0x183),null),OperatoToolCreateService=tslib_1[a0_0x42ad40(0x177)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports[a0_0x42ad40(0x194)]=OperatoToolCreateService;const allIndex=a0_0x42ad40(0x1c5),serviceIndex='\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}}]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}Mutation]\x0a',serviceHistoryIndex=a0_0x42ad40(0x1c0),serviceQuery='\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}List\x20}\x20from\x20\x27./{{name}}-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Query\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}List,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{pluralCamelCase\x20name}}(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}List>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20convertedParams\x20=\x20convertListParams(params,\x20domain.id)\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.creatorId})\x0a\x20\x20}\x0a}\x0a',serviceHistoryQuery='\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',serviceMutation=a0_0x42ad40(0x157),sereviceType=a0_0x42ad40(0x1b7),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_0x42ad40(0x1d8),serviceEntityHistJson=a0_0x42ad40(0x15c),serviceEntitySubscriber=a0_0x42ad40(0x15a);function a0_0x5f23(){const _0x2f00d9=['long','tableName','date','findOne','split','Entity','Int','created_at','createHistoryServiceFiles','/packages','integer','state','getProjectRootPath','\x27,\x20nullable:\x20','/*\x20ENTITIES\x20*/\x0a\x09...','Ctx','string','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','pascalCaseName','2956845KDZyKl','\x20})','replaceNamesMap','prototype','EntitySubscribers\x20}\x20from\x20\x27./','__decorate','...','COPY','/index.ts','9260620NETmWl','__metadata','mkdirSync','datetime','-history\x27','name','map','double','toolCreateService','lodash','@things-factory/resource-base','6JXAAYu','Arg','createDir','bigint','Query',',length:','__esModule','@things-factory/shell','character\x20varying','.ts','createServiceFiles','replace','24651NscMMH','createServicePath','OperatoToolCreateService','@Field(','type\x20=>','writeFile','EntityColumn','export\x20*\x20from\x20\x27./','3mTWVEy','525539dGiOVe','float','updater_id','-history.ts','includes','double\x20precision','filter','\x27,\x20type:\x20\x27','creator','-query.ts','import\x20{\x20entities\x20as\x20','@Column({name:\x27','getRepository','\x20{\x20nullable:\x20','design:type','index.ts','-mutation.ts','timestamp\x20without\x20time\x20zone','10261bJPgRQ','decimal','Resolvers,','createTypeText','JSON','length','rank','/server/service/','indexOf','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','\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','env','/packages/','colSize','join','createHistoryEntityText','dataProp','Date','design:returntype','\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','number','/event-subscriber.ts','567882IUUhea','domain_id','\x0a/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0a\x0a/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0a\x0aexport\x20const\x20entities\x20=\x20[\x20\x20\x0a\x20\x20/*\x20ENTITIES\x20*/\x0a]\x20\x0a\x0a\x0aexport\x20const\x20schema\x20=\x20{\x0a\x20\x20resolverClasses:\x20[\x0a\x20\x20\x20\x20/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x20\x20]\x20\x0a}\x0a\x0aexport\x20const\x20subscribers\x20=\x20[\x0a\x20\x20/*\x20SUBSCRIBERS\x20*/\x0a]\x0a','Resolvers\x20}\x20from\x20\x27./','getColTxtType','pluralCamelCaseName','272yjcgGi','\x0a\x20\x20','getFieldType','columnToEntityColumn','snakeCaseName','@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','defineProperty','nullable','updated_at','pluralize','tslib','-type.ts','packages','colType','\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','Entities,\x20resolvers\x20as\x20','createEntityText','__param','-history-type.ts','createNoHistoryServiceFiels','creator_id','356736CTvXZQ','existsSync','push','existsPath','updater','type-graphql','Entities,','Float','/server','\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','uniqRank','utf8','\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','sort','\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','readFileSync'];a0_0x5f23=function(){return _0x2f00d9;};return a0_0x5f23();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x25dca1=a0_0x208c;(function(_0x41164f,_0x22b0b1){const _0x2b1ce5=a0_0x208c,_0x549e56=_0x41164f();while(!![]){try{const _0xf4da39=-parseInt(_0x2b1ce5(0x16c))/0x1*(-parseInt(_0x2b1ce5(0x171))/0x2)+-parseInt(_0x2b1ce5(0x166))/0x3+-parseInt(_0x2b1ce5(0x182))/0x4*(-parseInt(_0x2b1ce5(0x17b))/0x5)+-parseInt(_0x2b1ce5(0x181))/0x6*(-parseInt(_0x2b1ce5(0x185))/0x7)+-parseInt(_0x2b1ce5(0x17a))/0x8*(-parseInt(_0x2b1ce5(0x183))/0x9)+parseInt(_0x2b1ce5(0x16d))/0xa+parseInt(_0x2b1ce5(0x167))/0xb*(-parseInt(_0x2b1ce5(0x16e))/0xc);if(_0xf4da39===_0x22b0b1)break;else _0x549e56['push'](_0x549e56['shift']());}catch(_0x1d75ea){_0x549e56['push'](_0x549e56['shift']());}}}(a0_0x3b26,0x3bb55));function a0_0x208c(_0x4f9bae,_0x525ecc){const _0x3b2679=a0_0x3b26();return a0_0x208c=function(_0x208c48,_0x30be61){_0x208c48=_0x208c48-0x165;let _0x59eb6b=_0x3b2679[_0x208c48];return _0x59eb6b;},a0_0x208c(_0x4f9bae,_0x525ecc);}Object['defineProperty'](exports,a0_0x25dca1(0x180),{'value':!0x0}),exports[a0_0x25dca1(0x17e)]=exports['checkStudioPermission']=void 0x0;const operato_license_checker_1=require('@things-factory/operato-license-checker'),shell_1=require(a0_0x25dca1(0x16a)),menu_base_1=require('@things-factory/menu-base'),license_error_1=require(a0_0x25dca1(0x173));async function checkStudioPermission(){const _0x39650e=a0_0x25dca1;let _0x5d7f11=((0x0,operato_license_checker_1[_0x39650e(0x16b)])(_0x39650e(0x178))||',')['split'](',')[_0x39650e(0x17c)](_0x425309=>_0x425309['trim']()),_0x595a0a=!0x1;return _0x5d7f11[_0x39650e(0x165)](_0x205b7c=>{const _0xed74b5=_0x39650e;_0x205b7c['includes'](_0xed74b5(0x168))&&(_0x595a0a=!0x0);}),_0x595a0a;}async function checkStudioTemplateIsOverLimit(_0x54c861,_0x44c054){const _0x11cd92=a0_0x25dca1;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x11cd92(0x174))]({'errorCode':_0x44c054['t'](license_error_1[_0x11cd92(0x174)][_0x11cd92(0x169)]['INVALID_LICENSE'])});var _0x2472f2=0x0;if(_0x2472f2=_0x54c861&&''!=_0x54c861?await(0x0,shell_1['getRepository'])(menu_base_1[_0x11cd92(0x17d)])[_0x11cd92(0x186)][_0x11cd92(0x170)]()['select'](_0x11cd92(0x17f))[_0x11cd92(0x179)](menu_base_1[_0x11cd92(0x17d)],_0x11cd92(0x17f))[_0x11cd92(0x184)]('id\x20!=\x20:id',{'id':_0x54c861})['andWhere'](_0x11cd92(0x172))[_0x11cd92(0x187)]()+0x1:await(0x0,shell_1['getRepository'])(menu_base_1['Menu'])[_0x11cd92(0x186)]['createQueryBuilder']()[_0x11cd92(0x177)](_0x11cd92(0x17f))['from'](menu_base_1[_0x11cd92(0x17d)],'menu')[_0x11cd92(0x184)](_0x11cd92(0x172))[_0x11cd92(0x187)]()+0x1,!(0x0,operato_license_checker_1[_0x11cd92(0x176)])(_0x2472f2))throw new license_error_1[(_0x11cd92(0x174))]({'errorCode':_0x44c054['t'](license_error_1[_0x11cd92(0x174)][_0x11cd92(0x169)][_0x11cd92(0x16f)])});return!0x0;}function a0_0x3b26(){const _0xb87874=['1464870dxlVSk','168KLOhXW','OVER_LIMIT','createQueryBuilder','308090ThMVkU','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','../../errors/license-error','LicenseError','checkStudioPermission','checkTarget','select','Permissions\x20For\x20Tailor\x20Tool','from','55112oJZgMT','1115xLYAjX','map','Menu','checkStudioTemplateIsOverLimit','menu','__esModule','12RjWItg','912pmCyCD','594qoXQKq','where','353171EUhzcZ','manager','getCount','forEach','188439VQYBSR','471097zPFfFa','Studio','ERROR_CODES','@things-factory/shell','getPermission','1fpxLee'];a0_0x3b26=function(){return _0xb87874;};return a0_0x3b26();}exports[a0_0x25dca1(0x175)]=checkStudioPermission,exports['checkStudioTemplateIsOverLimit']=checkStudioTemplateIsOverLimit;
|