@things-factory/operato-tools 6.1.22 → 6.1.24
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 +22 -22
- 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 +3 -3
- package/client/pages/generator/tab-config-tab-mixin.js +4 -4
- package/client/pages/main.js +3 -3
- package/client/reducers/main.js +1 -1
- package/package.json +4 -4
- 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
|
-
const
|
|
2
|
-
<ox-grist auto-fetch id="tab-tab-grid" .config=${this[
|
|
3
|
-
.fetchHandler=${this[
|
|
4
|
-
</ox-grist>`;}get[
|
|
1
|
+
const a0_0x3f6b90=a0_0x2f4b;(function(_0x1350b3,_0x1e5b5d){const _0x1106cb=a0_0x2f4b,_0x57a1be=_0x1350b3();while(!![]){try{const _0x1cc9af=parseInt(_0x1106cb(0xe5))/0x1+parseInt(_0x1106cb(0xec))/0x2*(-parseInt(_0x1106cb(0xea))/0x3)+-parseInt(_0x1106cb(0xe0))/0x4+parseInt(_0x1106cb(0xe7))/0x5+-parseInt(_0x1106cb(0xc5))/0x6+-parseInt(_0x1106cb(0xc2))/0x7+-parseInt(_0x1106cb(0xcd))/0x8*(-parseInt(_0x1106cb(0xee))/0x9);if(_0x1cc9af===_0x1e5b5d)break;else _0x57a1be['push'](_0x57a1be['shift']());}catch(_0x5dfd36){_0x57a1be['push'](_0x57a1be['shift']());}}}(a0_0x5d49,0x98d21));import{html}from'lit-element';import{MetaApi}from'@things-factory/meta-ui/client/utils/meta-api';function a0_0x2f4b(_0x68e193,_0x123b0e){const _0x5d496f=a0_0x5d49();return a0_0x2f4b=function(_0x2f4b15,_0x3ca14b){_0x2f4b15=_0x2f4b15-0xc2;let _0x173b6c=_0x5d496f[_0x2f4b15];return _0x173b6c;},a0_0x2f4b(_0x68e193,_0x123b0e);}import{TermsUtil}from'@things-factory/meta-ui/client/utils/terms-util';export const TabConfigTabMixin=_0x57d2b5=>class extends _0x57d2b5{[a0_0x3f6b90(0xe3)](_0x43487b){const _0x5118d7=a0_0x3f6b90;let _0x1d5414=_0x43487b?.['map']((_0x37efbb,_0x3c11c2)=>{const _0x21fb8f=a0_0x2f4b;let _0x55750a=_0x3c11c2+0x1,_0x2a2eb2={};return _0x2a2eb2[_0x21fb8f(0xdb)]=0xa*_0x55750a,_0x2a2eb2['id']=_0x55750a,_0x2a2eb2[_0x21fb8f(0xc3)]=_0x37efbb[_0x21fb8f(0xc3)],_0x2a2eb2[_0x21fb8f(0xd2)]=_0x37efbb[_0x21fb8f(0xd2)],_0x2a2eb2[_0x21fb8f(0xca)]=_0x37efbb['tagname'],_0x2a2eb2[_0x21fb8f(0xcb)]=_0x37efbb[_0x21fb8f(0xcb)],_0x2a2eb2[_0x21fb8f(0xc8)]=_0x37efbb[_0x21fb8f(0xc8)],_0x2a2eb2[_0x21fb8f(0xc6)]=_0x37efbb[_0x21fb8f(0xc6)],_0x2a2eb2[_0x21fb8f(0xd3)]=_0x37efbb[_0x21fb8f(0xd3)],_0x2a2eb2[_0x21fb8f(0xd1)]=_0x37efbb[_0x21fb8f(0xd1)],_0x2a2eb2;});this[_0x5118d7(0xe2)]=_0x1d5414||[],this[_0x5118d7(0xe6)]?.[_0x5118d7(0xef)]();}['getTabConfigTabValues'](){const _0x3eba66=a0_0x3f6b90;let _0x3ab33e={'tab':[]},_0x2a7c8c=this[_0x3eba66(0xcc)]('tab-tab-grid');return this[_0x3eba66(0xd5)](_0x2a7c8c)?.[_0x3eba66(0xc7)](_0x1fe103=>{const _0x2c16d6=_0x3eba66;var {name:_0x3a39d2,display:_0x234b1f,tagname:_0x4c1054,location:_0x21c139,parent_field:_0x1a4aa5,param_field:_0x54012c,menu:_0x3134b5,icon:_0x129406}=_0x1fe103;_0x3a39d2&&_0x4c1054&&_0x21c139&&_0x3134b5&&(_0x234b1f||(_0x234b1f=_0x3a39d2),_0x1a4aa5||(_0x1a4aa5='id'),_0x54012c||(_0x54012c=_0x2c16d6(0xd3)),_0x3ab33e[_0x2c16d6(0xda)][_0x2c16d6(0xdd)]({'name':_0x3a39d2,'display':_0x234b1f,'tagname':_0x4c1054,'location':_0x21c139,'parent_field':_0x1a4aa5,'param_field':_0x54012c,'menu':_0x3134b5,'icon':_0x129406}));}),_0x3ab33e;}[a0_0x3f6b90(0xeb)](){const _0x47dc16=a0_0x3f6b90;return html`
|
|
2
|
+
<ox-grist auto-fetch id="tab-tab-grid" .config=${this[_0x47dc16(0xd8)]} .mode='GRID'
|
|
3
|
+
.fetchHandler=${this[_0x47dc16(0xd9)][_0x47dc16(0xe1)](this)}>
|
|
4
|
+
</ox-grist>`;}get[a0_0x3f6b90(0xe6)](){const _0x53c07b=a0_0x3f6b90;return this[_0x53c07b(0xcf)][_0x53c07b(0xd7)](_0x53c07b(0xdc));}async[a0_0x3f6b90(0xd9)](){const _0x2a8a7d=a0_0x3f6b90;return{'total':0x0,'records':this[_0x2a8a7d(0xe2)]||[]};}async[a0_0x3f6b90(0xdf)](){const _0x30766a=a0_0x3f6b90;this[_0x30766a(0xd8)]={'rows':MetaApi[_0x30766a(0xce)](!0x0),'pagination':{'infinite':!0x0},'sorters':[{'name':_0x30766a(0xdb),'desc':!0x1}],'appendable':!0x0,'columns':[...MetaApi['getGristGuttersConfig'](!0x1,!0x1),{'type':'gutter','gutterName':_0x30766a(0xd0),'icon':_0x30766a(0xde),'handlers':{'click':(_0x53803b,_0xc86804,_0x345eb8,_0x288489,_0x426a26)=>{const _0x8c4a5=_0x30766a;_0x288489['id']&&this[_0x8c4a5(0xd4)](this[_0x8c4a5(0xe6)],_0x288489);}}},{'type':'string','name':'id','hidden':!0x0},{'type':'integer','name':_0x30766a(0xdb),'header':TermsUtil[_0x30766a(0xc4)](_0x30766a(0xdb)),'sortable':!0x0,'width':0x41,'record':{'align':_0x30766a(0xe9),'editable':!0x0,'mandatory':!0x0}},{'type':_0x30766a(0xd6),'name':_0x30766a(0xc3),'header':TermsUtil['tLabel'](_0x30766a(0xc3)),'sortable':!0x1,'width':0x64,'record':{'align':_0x30766a(0xe8),'editable':!0x0,'mandatory':!0x0}},{'type':_0x30766a(0xd6),'name':_0x30766a(0xd2),'header':TermsUtil['tLabel'](_0x30766a(0xd2)),'sortable':!0x1,'width':0x64,'record':{'align':_0x30766a(0xe8),'editable':!0x0,'mandatory':!0x0}},{'type':'string','name':_0x30766a(0xcb),'header':TermsUtil['tLabel'](_0x30766a(0xcb)),'sortable':!0x0,'width':0x41,'record':{'align':'center','editable':!0x0,'mandatory':!0x0}},{'type':_0x30766a(0xd6),'name':_0x30766a(0xd1),'header':TermsUtil['tLabel'](_0x30766a(0xe4)),'sortable':!0x1,'width':0x64,'record':{'align':_0x30766a(0xe8),'editable':!0x0,'mandatory':!0x0}},{'type':_0x30766a(0xd6),'name':_0x30766a(0xca),'header':TermsUtil[_0x30766a(0xc4)](_0x30766a(0xc9)),'sortable':!0x1,'width':0x96,'record':{'align':'left','editable':!0x0,'mandatory':!0x0}},{'type':_0x30766a(0xd6),'name':_0x30766a(0xc8),'header':TermsUtil['tLabel']('page_location'),'sortable':!0x1,'width':0x12c,'record':{'align':_0x30766a(0xe8),'editable':!0x0,'mandatory':!0x0}},{'type':'string','name':'parent_field','header':TermsUtil[_0x30766a(0xc4)]('parent_id'),'sortable':!0x1,'width':0x64,'record':{'align':'left','editable':!0x0,'mandatory':!0x0}},{'type':_0x30766a(0xd6),'name':_0x30766a(0xd3),'header':TermsUtil[_0x30766a(0xc4)](_0x30766a(0xed)),'sortable':!0x1,'width':0x64,'record':{'align':_0x30766a(0xe8),'editable':!0x0,'mandatory':!0x0}}]};}};function a0_0x5d49(){const _0xd64bc1=['string','querySelector','tabTabGridConfig','fetchTabTabHandler','tab','rank','#tab-tab-grid','push','delete','setTabConfigTabConfig','4377092ovdfxS','bind','viewTabData','setTabConfigTabValues','routing','9190MIerXT','tabTabGrist','5123870oOMalj','left','right','1887420xSFdPb','renderTabConfigTab','2RiqlZD','params','180OaiheO','fetch','4297237xTpbuM','name','tLabel','458202SxTGIb','parent_field','forEach','location','tag','tagname','icon','getElementValueById','802264bNlPlE','getGristSelectableConfig','shadowRoot','button','menu','display','param_field','deleteRow','sortRecordByRank'];a0_0x5d49=function(){return _0xd64bc1;};return a0_0x5d49();}
|
package/client/pages/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
var a0_0x4a260a=a0_0x411e;function a0_0x411e(_0x5d6ff1,_0x120b87){var _0x1a613e=a0_0x1a61();return a0_0x411e=function(_0x411e45,_0x3ea6e9){_0x411e45=_0x411e45-0x1c7;var _0x15a189=_0x1a613e[_0x411e45];return _0x15a189;},a0_0x411e(_0x5d6ff1,_0x120b87);}(function(_0x5dbf95,_0x502289){var _0x4c7322=a0_0x411e,_0x3106a1=_0x5dbf95();while(!![]){try{var _0x4d009c=-parseInt(_0x4c7322(0x1cc))/0x1*(parseInt(_0x4c7322(0x1cb))/0x2)+parseInt(_0x4c7322(0x1ca))/0x3+parseInt(_0x4c7322(0x1cd))/0x4*(parseInt(_0x4c7322(0x1d4))/0x5)+-parseInt(_0x4c7322(0x1d3))/0x6*(parseInt(_0x4c7322(0x1d1))/0x7)+-parseInt(_0x4c7322(0x1ce))/0x8+-parseInt(_0x4c7322(0x1d7))/0x9*(parseInt(_0x4c7322(0x1c9))/0xa)+-parseInt(_0x4c7322(0x1c7))/0xb*(-parseInt(_0x4c7322(0x1c8))/0xc);if(_0x4d009c===_0x502289)break;else _0x3106a1['push'](_0x3106a1['shift']());}catch(_0x684ce5){_0x3106a1['push'](_0x3106a1['shift']());}}}(a0_0x1a61,0xdcdd0));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';function a0_0x1a61(){var _0x28c5b4=['12AOXmbo','10QCRqUB','3609309pSPMFs','2sqlKSu','171016zZGHsE','1970908pjLYZR','6782448qansAj','render','define','1635298NLHzns','Operato\x20Tools','24xyLXZa','10OsdYXi','operato-tools-main','customElements','11919573Bihmdx','21931514glNCav'];a0_0x1a61=function(){return _0x28c5b4;};return a0_0x1a61();}class OperatoToolsMain extends connect(store)(PageView){static get['styles'](){return[css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
background-color: var(--main-section-background-color);
|
|
@@ -41,11 +41,11 @@ function a0_0x232a(){var _0x26b7a6=['8020FlQxJA','272692iiHYLF','styles','99146I
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`];}get[
|
|
44
|
+
`];}get['context'](){var _0x3cbb5e=a0_0x411e;return{'title':_0x3cbb5e(0x1d2),'actions':[]};}[a0_0x4a260a(0x1cf)](){return html`
|
|
45
45
|
<h2>Operato Tools</h2>
|
|
46
46
|
<p page-description>
|
|
47
47
|
${TermsUtil['tText']('tool\x20start\x20msg')}
|
|
48
48
|
</p>
|
|
49
49
|
|
|
50
50
|
<img src="/assets/images/operato-tools.png" />
|
|
51
|
-
`;}}window[
|
|
51
|
+
`;}}window[a0_0x4a260a(0x1d6)][a0_0x4a260a(0x1d0)](a0_0x4a260a(0x1d5),OperatoToolsMain);
|
package/client/reducers/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0x6e8b5e=a0_0x4f54;(function(_0x470cca,_0x558510){const _0x55e952=a0_0x4f54,_0x100e4c=_0x470cca();while(!![]){try{const _0x55f0cb=-parseInt(_0x55e952(0x16b))/0x1+parseInt(_0x55e952(0x173))/0x2+parseInt(_0x55e952(0x16c))/0x3+parseInt(_0x55e952(0x174))/0x4+parseInt(_0x55e952(0x164))/0x5*(parseInt(_0x55e952(0x166))/0x6)+parseInt(_0x55e952(0x165))/0x7*(parseInt(_0x55e952(0x16e))/0x8)+parseInt(_0x55e952(0x16a))/0x9*(-parseInt(_0x55e952(0x170))/0xa);if(_0x55f0cb===_0x558510)break;else _0x100e4c['push'](_0x100e4c['shift']());}catch(_0x9b1a9b){_0x100e4c['push'](_0x100e4c['shift']());}}}(a0_0x5883,0x85edf));import a0_0x80b11 from'graphql-tag';import{i18next}from'@operato/i18n';function a0_0x4f54(_0x512427,_0x4d59db){const _0x5883d0=a0_0x5883();return a0_0x4f54=function(_0x4f5426,_0x4232c1){_0x4f5426=_0x4f5426-0x164;let _0x449f5c=_0x5883d0[_0x4f5426];return _0x449f5c;},a0_0x4f54(_0x512427,_0x4d59db);}import{store}from'@operato/shell';import{client,gqlContext}from'@operato/graphql';import{UPDATE_OPERATO_TOOLS}from'../actions/main';const INITIAL_STATE={'operatoTools':a0_0x6e8b5e(0x171),'studioPermission':!0x1};export const UPDATE_OPERATO_TOOLS_PERMISSION=a0_0x6e8b5e(0x172);((async()=>{const _0x535be0=a0_0x6e8b5e;var _0x419d22=await client['query']({'query':a0_0x80b11`{studioPermission}`});let _0x209825=!0x1;_0x419d22[_0x535be0(0x169)]||(_0x209825=_0x419d22[_0x535be0(0x168)]['studioPermission']),store[_0x535be0(0x16f)]({'type':UPDATE_OPERATO_TOOLS_PERMISSION,'state':{'studioPermission':_0x209825}});})());function a0_0x5883(){const _0x3f44c3=['892193eLbzha','2321514ZpTEOi','type','8376MmveNb','dispatch','29980GuLtgm','ABC','UPDATE_OPERATO_TOOLS_PERMISSION','589826byoVdP','2961528ZGDyoV','130bUIMTY','777okrPFp','2328MuqvQB','state','data','errors','1485yuPaRy'];a0_0x5883=function(){return _0x3f44c3;};return a0_0x5883();}const operatoTools=(_0x5f325c=INITIAL_STATE,_0x20d0bd)=>{const _0x1929ea=a0_0x6e8b5e;switch(_0x20d0bd[_0x1929ea(0x16d)]){case UPDATE_OPERATO_TOOLS:return{..._0x5f325c};case UPDATE_OPERATO_TOOLS_PERMISSION:return{...INITIAL_STATE,..._0x20d0bd[_0x1929ea(0x167)]};default:return _0x5f325c;}};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.24",
|
|
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.24",
|
|
33
33
|
"@things-factory/operato-license-checker": "^3.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@things-factory/builder": "^6.1.
|
|
36
|
+
"@things-factory/builder": "^6.1.23",
|
|
37
37
|
"@things-factory/meta-ui": "^6.0.0-alpha.6"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "937547135c52acc7551933e86a589fa0a122b2a5"
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';function a0_0x8deb(_0x238ff5,_0x57fe1a){var _0x53e638=a0_0x53e6();return a0_0x8deb=function(_0x8deba7,_0x527066){_0x8deba7=_0x8deba7-0xbf;var _0x3cdfbd=_0x53e638[_0x8deba7];return _0x3cdfbd;},a0_0x8deb(_0x238ff5,_0x57fe1a);}var a0_0x7e582c=a0_0x8deb;function a0_0x53e6(){var _0x206b6f=['505348ohVJlF','4445360cHPvXx','__esModule','8554BtGONq','2098210nltBQD','1559976uahxrf','18IYxVsB','410HEbiZX','defineProperty','INVALID_LICENSE','OVER_LIMIT','error.page\x20count\x20over\x20license\x20limit','error.invalid\x20license\x20key','1MJJHfu','384246HOWipY','555249oigCXT'];a0_0x53e6=function(){return _0x206b6f;};return a0_0x53e6();}(function(_0x18d5be,_0x114c41){var _0xbcf5e0=a0_0x8deb,_0x533a79=_0x18d5be();while(!![]){try{var _0x301d2d=-parseInt(_0xbcf5e0(0xc0))/0x1*(-parseInt(_0xbcf5e0(0xc3))/0x2)+-parseInt(_0xbcf5e0(0xc2))/0x3+-parseInt(_0xbcf5e0(0xc8))/0x4+-parseInt(_0xbcf5e0(0xc7))/0x5*(parseInt(_0xbcf5e0(0xc9))/0x6)+parseInt(_0xbcf5e0(0xc6))/0x7+parseInt(_0xbcf5e0(0xc4))/0x8+-parseInt(_0xbcf5e0(0xc1))/0x9*(-parseInt(_0xbcf5e0(0xca))/0xa);if(_0x301d2d===_0x114c41)break;else _0x533a79['push'](_0x533a79['shift']());}catch(_0x4cd440){_0x533a79['push'](_0x533a79['shift']());}}}(a0_0x53e6,0xb1401));Object[a0_0x7e582c(0xcb)](exports,a0_0x7e582c(0xc5),{'value':!0x0}),exports['OVER_LIMIT']=exports[a0_0x7e582c(0xcc)]=void 0x0,exports[a0_0x7e582c(0xcc)]=a0_0x7e582c(0xbf),exports[a0_0x7e582c(0xcd)]=a0_0x7e582c(0xce);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x16a972=a0_0x254a;function a0_0x254a(_0xa119de,_0xfc2235){const _0x3b18a9=a0_0x3b18();return a0_0x254a=function(_0x254a7f,_0x3f6fe2){_0x254a7f=_0x254a7f-0x148;let _0x5c65fe=_0x3b18a9[_0x254a7f];return _0x5c65fe;},a0_0x254a(_0xa119de,_0xfc2235);}(function(_0x1969e5,_0x3d1378){const _0x46209d=a0_0x254a,_0x4b13cf=_0x1969e5();while(!![]){try{const _0x576f6f=parseInt(_0x46209d(0x15a))/0x1+parseInt(_0x46209d(0x153))/0x2*(-parseInt(_0x46209d(0x149))/0x3)+-parseInt(_0x46209d(0x156))/0x4*(-parseInt(_0x46209d(0x154))/0x5)+parseInt(_0x46209d(0x15b))/0x6*(parseInt(_0x46209d(0x14a))/0x7)+parseInt(_0x46209d(0x150))/0x8*(parseInt(_0x46209d(0x158))/0x9)+-parseInt(_0x46209d(0x14f))/0xa*(parseInt(_0x46209d(0x14b))/0xb)+-parseInt(_0x46209d(0x155))/0xc;if(_0x576f6f===_0x3d1378)break;else _0x4b13cf['push'](_0x4b13cf['shift']());}catch(_0x32fd87){_0x4b13cf['push'](_0x4b13cf['shift']());}}}(a0_0x3b18,0xd35d3));Object[a0_0x16a972(0x152)](exports,'__esModule',{'value':!0x0}),exports['LicenseError']=void 0x0;const tslib_1=require('tslib'),ERROR_CODES=tslib_1[a0_0x16a972(0x157)](require(a0_0x16a972(0x151)));class LicenseError extends Error{static get['ERROR_CODES'](){const _0x582f95=a0_0x16a972;return Object[_0x582f95(0x15c)]({},ERROR_CODES);}constructor({errorCode:_0x4d69a1,detail:_0x2cde0c}){const _0x45086d=a0_0x16a972;super(_0x4d69a1),this[_0x45086d(0x14d)]=_0x45086d(0x14e),this[_0x45086d(0x14c)]=_0x4d69a1,this[_0x45086d(0x148)]=_0x2cde0c;}}exports[a0_0x16a972(0x159)]=LicenseError;function a0_0x3b18(){const _0x32cdbd=['LicenseError','82346sBdkSc','12jHWDgm','assign','detail','9BrTbeP','5754581SpkOTr','44ECANWw','errorCode','name','license-error','3886910kLrEah','5271472NMOXzc','../constants/error-code','defineProperty','82408cXQCbV','196505VkkaUZ','13548876YiucwJ','64ZqgtMj','__importStar','18jhTLsJ'];a0_0x3b18=function(){return _0x32cdbd;};return a0_0x3b18();}
|
package/server/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x178bf4=a0_0xac8e;(function(_0x10d834,_0xcf48bb){const _0x472e5f=a0_0xac8e,_0x54e0ae=_0x10d834();while(!![]){try{const _0x324ec7=-parseInt(_0x472e5f(0x1f1))/0x1*(parseInt(_0x472e5f(0x1eb))/0x2)+-parseInt(_0x472e5f(0x1f6))/0x3+parseInt(_0x472e5f(0x1ed))/0x4+parseInt(_0x472e5f(0x1f3))/0x5+parseInt(_0x472e5f(0x1ec))/0x6+parseInt(_0x472e5f(0x1f7))/0x7*(-parseInt(_0x472e5f(0x1f5))/0x8)+parseInt(_0x472e5f(0x1f2))/0x9;if(_0x324ec7===_0xcf48bb)break;else _0x54e0ae['push'](_0x54e0ae['shift']());}catch(_0x151196){_0x54e0ae['push'](_0x54e0ae['shift']());}}}(a0_0x3812,0xb21ce));const debug=require(a0_0x178bf4(0x1f0))('things-factory:operato-tools:routes');function a0_0xac8e(_0x2a1e89,_0x3f2dd4){const _0x38122f=a0_0x3812();return a0_0xac8e=function(_0xac8e64,_0x4126d5){_0xac8e64=_0xac8e64-0x1eb;let _0x5c9a25=_0x38122f[_0xac8e64];return _0x5c9a25;},a0_0xac8e(_0x2a1e89,_0x3f2dd4);}function a0_0x3812(){const _0x19d7f0=['7777314lXsXls','2009950oahFOk','bootstrap-module-global-private-route','2408MjgHui','4021773queZWK','13818MtxPfI','2lskPfs','8105634xejOKz','1323624NsZwQm','bootstrap-module-domain-private-route','bootstrap-module-domain-public-route','debug','283666DwRkIU'];a0_0x3812=function(){return _0x19d7f0;};return a0_0x3812();}process['on']('bootstrap-module-global-public-route',(_0x23c6f5,_0x268683)=>{}),process['on'](a0_0x178bf4(0x1f4),(_0x2b58e7,_0x38bf3e)=>{}),process['on'](a0_0x178bf4(0x1ef),(_0x386d6a,_0x26751e)=>{}),process['on'](a0_0x178bf4(0x1ee),(_0x2dd337,_0x1aceb8)=>{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x1ca5c9=a0_0x1021;(function(_0x510dd4,_0x2d7289){const _0x4b22a3=a0_0x1021,_0x155653=_0x510dd4();while(!![]){try{const _0x3dd98a=parseInt(_0x4b22a3(0xd9))/0x1*(-parseInt(_0x4b22a3(0x13f))/0x2)+-parseInt(_0x4b22a3(0x107))/0x3*(-parseInt(_0x4b22a3(0xd0))/0x4)+-parseInt(_0x4b22a3(0xe1))/0x5*(parseInt(_0x4b22a3(0x119))/0x6)+parseInt(_0x4b22a3(0x11b))/0x7+-parseInt(_0x4b22a3(0x108))/0x8*(parseInt(_0x4b22a3(0x115))/0x9)+parseInt(_0x4b22a3(0xc7))/0xa+parseInt(_0x4b22a3(0x105))/0xb;if(_0x3dd98a===_0x2d7289)break;else _0x155653['push'](_0x155653['shift']());}catch(_0x19af32){_0x155653['push'](_0x155653['shift']());}}}(a0_0x22c1,0x2f0ba));Object[a0_0x1ca5c9(0xe4)](exports,a0_0x1ca5c9(0x10a),{'value':!0x0}),exports[a0_0x1ca5c9(0xfe)]=void 0x0;function a0_0x1021(_0x544c92,_0x21b9b0){const _0x22c1ff=a0_0x22c1();return a0_0x1021=function(_0x102175,_0x29f161){_0x102175=_0x102175-0xc7;let _0x8c11d5=_0x22c1ff[_0x102175];return _0x8c11d5;},a0_0x1021(_0x544c92,_0x21b9b0);}const tslib_1=require(a0_0x1ca5c9(0xd7)),type_graphql_1=require(a0_0x1ca5c9(0xd3)),resource_base_1=require(a0_0x1ca5c9(0x10b)),menu_base_1=require(a0_0x1ca5c9(0xd6)),tool_permission_1=require('./../tool-secret/tool-permission'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require('pluralize'),crypto_1=tslib_1[a0_0x1ca5c9(0xf7)](require(a0_0x1ca5c9(0xe5)));let OperatoToolCreateMenu=class{async[a0_0x1ca5c9(0xf4)](_0x249c4f,_0x11b3f2,_0x2651b4){const _0xaad95=a0_0x1ca5c9,{domain:_0x1d94c5,user:_0x2990c0,tx:_0xff5f09}=_0x2651b4[_0xaad95(0x132)];await(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])('',_0x2651b4);const _0x5e82fb=await _0xff5f09[_0xaad95(0xde)](resource_base_1[_0xaad95(0xf2)])[_0xaad95(0xe0)]({'where':{'domain':{'id':_0x1d94c5['id']},'id':_0x249c4f}}),_0x334509=await _0xff5f09[_0xaad95(0xde)](resource_base_1[_0xaad95(0x100)])[_0xaad95(0xc9)]({'where':{'domain':{'id':_0x1d94c5['id']},'entity':{'id':_0x5e82fb['id']}}});let {name:_0xe34dc5=''}=_0x5e82fb||{},_0x2ca8ad=kebabCase(_0xe34dc5),_0x4efb74=modelTemplate[_0xaad95(0xdd)](/{{pascalCase name}}/g,startCase(camelCase(_0xe34dc5))['replace'](/ /g,''))[_0xaad95(0xdd)](/{{camelCase name}}/g,camelCase(_0xe34dc5))[_0xaad95(0xdd)](/{{snakeCase name}}/g,snakeCase(_0xe34dc5))[_0xaad95(0xdd)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0xe34dc5)))['replace'](/ /g,''))[_0xaad95(0xdd)](/{{pluralCamelCase name}}/g,camelCase(plural(_0xe34dc5)))['replace'](/{{name}}/g,_0xe34dc5),_0x4363f6='';'JSON'==_0x5e82fb[_0xaad95(0x129)]?_0x4363f6=_0xaad95(0xe6):_0xaad95(0xda)==_0x5e82fb[_0xaad95(0x129)]&&(_0x4363f6='\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'),_0x4efb74=_0x4efb74[_0xaad95(0xdd)](/{{HistoryButton}}/g,_0x4363f6);let _0x7662a0=this[_0xaad95(0x121)](_0x334509);_0x4efb74=_0x4efb74['replace'](/{{SortColumns}}/g,_0x7662a0[_0xaad95(0x102)](','));let _0x2b40e9=this[_0xaad95(0x113)](_0x334509);_0x4efb74=_0x4efb74[_0xaad95(0xdd)](/{{SearchColumns}}/g,_0x2b40e9['join'](','));let _0x19a135=this[_0xaad95(0xf3)](_0x334509);return _0x4efb74=_0x4efb74[_0xaad95(0xdd)](/{{GridColumns}}/g,_0x19a135[_0xaad95(0x102)](',')),_0x4efb74=this[_0xaad95(0x104)](_0x4efb74),await this[_0xaad95(0x11f)](_0xff5f09,_0x1d94c5,_0x2990c0,_0x11b3f2,_0x2ca8ad,_0x4efb74),!0x0;}[a0_0x1ca5c9(0xf3)](_0x259f0a){const _0x538618=a0_0x1ca5c9;return _0x259f0a[_0x538618(0xc8)](_0x5e9a21=>'id'!=_0x5e9a21[_0x538618(0x13d)]&&_0x5e9a21[_0x538618(0x137)]>0x0)[_0x538618(0x139)](function(_0x3d78d5,_0x20ca91){return _0x3d78d5['gridRank']-_0x20ca91['gridRank'];})[_0x538618(0x117)](_0x5aa0e1=>{const _0x58c136=_0x538618;let {gridEditor:_0x447a1c=_0x58c136(0xef),name:_0x13ef8f,term:_0x19a51e,gridWidth:_0x592f43=0x0,gridAlign:_0x48cdad=_0x58c136(0x10d),nullable:_0x1638ac=!0x1}=_0x5aa0e1;if(null==_0x447a1c&&(_0x447a1c=_0x58c136(0xef)),null==_0x48cdad&&(_0x48cdad=_0x58c136(0x10d)),_0x58c136(0x127)==_0x13ef8f||_0x58c136(0xec)==_0x13ef8f)return _0x13ef8f=_0x58c136(0x127)==_0x13ef8f?_0x58c136(0x111):'creator',_0x58c136(0xcc)+_0x13ef8f+_0x58c136(0xd5)+_0x13ef8f+_0x58c136(0x124);if(_0x58c136(0xe2)==_0x13ef8f||_0x58c136(0x103)==_0x13ef8f)return'{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22'+(_0x58c136(0xe2)==_0x13ef8f?_0x58c136(0xdf):'createdAt')+_0x58c136(0xd5)+_0x13ef8f+_0x58c136(0x134);let _0x3d57b8=_0x58c136(0xd1)!=_0x447a1c&&_0x58c136(0x136)!=_0x447a1c,_0x40919e=_0x58c136(0x136)==_0x447a1c;0x1!=_0x40919e&&0x0!=_0x3d57b8||(_0x447a1c=_0x58c136(0xef));let _0xa09d2a=_0x58c136(0x10f)+_0x447a1c+_0x58c136(0x10c)+camelCase(_0x13ef8f)+_0x58c136(0xd5)+_0x19a51e+_0x58c136(0xf5)+_0x40919e+'\x20,\x22editable\x22:\x20'+_0x3d57b8+_0x58c136(0xd2)+!_0x1638ac+_0x58c136(0x135)+_0x48cdad+'\x22,\x22width\x22:'+_0x592f43+_0x58c136(0xf0);return'code'==_0x5aa0e1[_0x58c136(0x12c)]&&(_0xa09d2a+=_0x58c136(0x122)+_0x5aa0e1[_0x58c136(0xdc)]+'\x22}'),'scenario'==_0x5aa0e1[_0x58c136(0x12c)]&&(_0xa09d2a+=_0x58c136(0x11d)+_0x5aa0e1['refName']+'\x22}'),_0x58c136(0x12a)==_0x5aa0e1[_0x58c136(0x12c)]&&(_0xa09d2a+=_0x58c136(0xe3)+camelCase(plural(_0x5aa0e1['refName']))+_0x58c136(0xf6)),_0xa09d2a+='}',_0xa09d2a;});}[a0_0x1ca5c9(0x113)](_0x5cb3c3){const _0x11e4a4=a0_0x1ca5c9;return _0x5cb3c3[_0x11e4a4(0xc8)](_0x14bd99=>_0x14bd99[_0x11e4a4(0x12b)]>0x0)[_0x11e4a4(0x139)](function(_0xbde5cb,_0x305d7e){const _0x513b87=_0x11e4a4;return _0xbde5cb[_0x513b87(0x12b)]-_0x305d7e[_0x513b87(0x12b)];})['map'](_0x284ecd=>{const _0x30c359=_0x11e4a4;let _0x320848=_0x284ecd['searchOper'];return _0x30c359(0xc8)==_0x320848?'\x22'+camelCase(_0x284ecd[_0x30c359(0x13d)])+'\x22':(_0x320848||(_0x320848='eq'),_0x30c359(0x126)+camelCase(_0x284ecd[_0x30c359(0x13d)])+_0x30c359(0x114)+_0x320848+'\x22}');});}[a0_0x1ca5c9(0x121)](_0x31ccaf){const _0x288e19=a0_0x1ca5c9;return _0x31ccaf[_0x288e19(0xc8)](_0x57ec1e=>_0x57ec1e[_0x288e19(0xfb)]>0x0)[_0x288e19(0x139)](function(_0x581cfe,_0x15a615){const _0x204894=_0x288e19;return _0x581cfe[_0x204894(0xfb)]-_0x15a615[_0x204894(0xfb)];})[_0x288e19(0x117)](_0x442c3e=>_0x288e19(0xce)+camelCase(_0x442c3e[_0x288e19(0x13d)])+_0x288e19(0xfd)+_0x442c3e[_0x288e19(0x13e)]+'}');}async[a0_0x1ca5c9(0x11f)](_0x39c4f5,_0x42010c,_0x31bfed,_0x5ca2ff,_0x27324f,_0x26f03a){const _0x5e742b=a0_0x1ca5c9;let _0x43df4f=await _0x39c4f5[_0x5e742b(0xde)](menu_base_1['Menu'])[_0x5e742b(0xe0)]({'where':{'domain':{'id':_0x42010c['id']},'id':_0x5ca2ff}}),_0x8cb60=(await _0x39c4f5['getRepository'](menu_base_1['Menu'])[_0x5e742b(0x109)](_0x5e742b(0x11a)+_0x5ca2ff+_0x5e742b(0x123)+_0x5ca2ff+'\x27'))[0x0][_0x5e742b(0x118)]+0xa,_0x4f22b4=new menu_base_1[(_0x5e742b(0xff))]();_0x4f22b4[_0x5e742b(0x13d)]=_0x27324f,_0x4f22b4[_0x5e742b(0x12e)]=_0x5e742b(0xfc),_0x4f22b4['category']=_0x5e742b(0xee),_0x4f22b4[_0x5e742b(0x118)]=_0x8cb60,_0x4f22b4[_0x5e742b(0xd8)]=!0x1,_0x4f22b4[_0x5e742b(0x120)]=_0x27324f,_0x4f22b4[_0x5e742b(0x13c)]=_0x26f03a,_0x4f22b4['resourceUrl']=_0x5e742b(0xcb),_0x4f22b4['parent']=_0x43df4f,await _0x39c4f5[_0x5e742b(0xde)](menu_base_1[_0x5e742b(0xff)])[_0x5e742b(0xea)](Object[_0x5e742b(0xed)](Object[_0x5e742b(0xed)]({},_0x4f22b4),{'domain':_0x42010c,'creator':_0x31bfed,'updater':_0x31bfed}));}[a0_0x1ca5c9(0x104)](_0x47255e){const _0x31f43=a0_0x1ca5c9;let _0x11c203=JSON[_0x31f43(0x131)](_0x47255e)[_0x31f43(0x112)](/(.{100})/)[_0x31f43(0xc8)](_0x416ce8=>_0x416ce8),_0x8da6f6=[_0x31f43(0x13b),_0x31f43(0x12f),_0x31f43(0x133),_0x31f43(0xf1),_0x31f43(0x116),_0x31f43(0x106),_0x31f43(0x110),_0x31f43(0xe8)],_0xe20227=crypto_1[_0x31f43(0xeb)]['randomBytes'](0x20)[_0x31f43(0x128)](_0x31f43(0xfa)),_0x5aaece=Buffer[_0x31f43(0xe7)](_0xe20227,_0x31f43(0xfa)),_0x5d52d6=_0xe20227['substring'](0x0,0x10),_0x20d5eb=['',_0x5d52d6,_0x5d52d6,_0x5d52d6,_0x5d52d6,_0x5d52d6,_0x5d52d6,_0x5d52d6],_0x917e3c=0x0,_0x268dd4=[];_0x268dd4['push'](_0xe20227);for(var _0x4c5a9c=0x0;_0x4c5a9c<_0x11c203[_0x31f43(0x138)];_0x4c5a9c++,_0x917e3c++){_0x917e3c==_0x8da6f6['length']&&(_0x917e3c=0x0);let _0x434ead=crypto_1[_0x31f43(0xeb)]['createCipheriv'](_0x8da6f6[_0x917e3c],_0x5aaece,_0x20d5eb[_0x917e3c]),_0x3c21e3=_0x434ead[_0x31f43(0xf9)](_0x11c203[_0x4c5a9c],_0x31f43(0xdb),_0x31f43(0xfa));_0x3c21e3+=_0x434ead[_0x31f43(0x13a)]('hex'),_0x268dd4[_0x31f43(0xcf)](_0x3c21e3);}return _0x268dd4[_0x31f43(0x102)]('h1z0q9i9x7q6');}};tslib_1[a0_0x1ca5c9(0xe9)]([(0x0,type_graphql_1['Directive'])('@transaction'),(0x0,type_graphql_1[a0_0x1ca5c9(0x12d)])(_0x581985=>Boolean,{'description':a0_0x1ca5c9(0x101)}),tslib_1[a0_0x1ca5c9(0xca)](0x0,(0x0,type_graphql_1[a0_0x1ca5c9(0x130)])('id')),tslib_1[a0_0x1ca5c9(0xca)](0x1,(0x0,type_graphql_1[a0_0x1ca5c9(0x130)])(a0_0x1ca5c9(0x11c))),tslib_1[a0_0x1ca5c9(0xca)](0x2,(0x0,type_graphql_1[a0_0x1ca5c9(0xd4)])()),tslib_1['__metadata'](a0_0x1ca5c9(0xcd),Function),tslib_1[a0_0x1ca5c9(0xf8)](a0_0x1ca5c9(0x10e),[String,String,Object]),tslib_1['__metadata']('design:returntype',Promise)],OperatoToolCreateMenu[a0_0x1ca5c9(0x125)],a0_0x1ca5c9(0xf4),null),OperatoToolCreateMenu=tslib_1[a0_0x1ca5c9(0xe9)]([(0x0,type_graphql_1[a0_0x1ca5c9(0x11e)])()],OperatoToolCreateMenu),exports[a0_0x1ca5c9(0xfe)]=OperatoToolCreateMenu;function a0_0x22c1(){const _0x5b6f61=['aes-256-ofb','6tjdAwY','77384EybTHx','query','__esModule','@things-factory/resource-base','\x22,\x22name\x22:\x20\x22','left','design:paramtypes','{\x22type\x22:\x20\x22','aes-256-ctr','updater','split','createSearchCols','\x22,\x22operator\x22:\x20\x22','261ACmAJA','aes-256-cfb1','map','rank','17574FAuxaj','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','1884155eCJWjE','parent_menu_id',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','Resolver','createMenuData','routing','createSortCols',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','\x27\x20or\x20id\x20=\x20\x27','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','prototype','{\x22name\x22:\x20\x22','updater_id','toString','dataProp','entity','searchRank','refType','Mutation','menuType','aes-256-cbc','Arg','stringify','state','aes-256-cfb','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','hidden','gridRank','length','sort','final','aes-256-ecb','template','name','reverseSort','928cekNbT','2255340OhbEPV','filter','find','__param','@things-factory/meta-ui/client/pages/meta-grist-page','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','design:type','{\x22name\x22:\x22','push','184732EZFadf','readonly',',\x22mandatory\x22:\x20','type-graphql','Ctx','\x22,\x22header\x22:\x20\x22','@things-factory/menu-base','tslib','hiddenFlag','577AtYNki','COPY','utf8','refName','replace','getRepository','updatedAt','findOne','5abrJzF','updated_at',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','defineProperty','crypto','\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','aes256','__decorate','save','default','creator_id','assign','meta-grist-page','string','\x20,\x22exportable\x22:\x20true','aes-256-cfb8','Entity','createGridColumns','toolCreateMenu','\x22,\x22hidden\x22:','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','__importDefault','__metadata','update','hex','sortRank','SCREEN','\x22,\x22desc\x22:','OperatoToolCreateMenu','Menu','EntityColumn','Operato\x20Tool\x20Create\x20Menu','join','created_at','enc','1724877EMWIUQ'];a0_0x22c1=function(){return _0x5b6f61;};return a0_0x22c1();}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';function a0_0x383f(){const _0xa19063=['283789uHbsMl','aes-256-ecb','name','assign','category',',\x22mandatory\x22:\x20','createGridColumns','h1z0q9i9x7q6','refType','replace','default','final','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','Resolver','createMenuData','enc','dataProp','COPY','48kFwAiJ','\x22,\x22desc\x22:','reverseSort','762363mRGgNC','find','code','\x20,\x22editable\x22:\x20','\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','checkStudioTemplateIsOverLimit','hidden','JSON','\x20,\x22exportable\x22:\x20true','@things-factory/meta-ui/client/pages/meta-grist-page','length','sort','design:returntype','creator','\x22,\x22operator\x22:\x20\x22','gridRank','join','EntityColumn','resourceUrl','map','aes-256-ofb','4008918xPNOkL','3252XMqNti','findOne','19390ZPRTQY','routing','refName','{\x22name\x22:\x22',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','parent','Arg','utf8','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','885929fsziHe','2185050hkevdU','tslib','__importDefault','@transaction','Menu','Directive','stringify','rank','update','3645uDDMFK','pluralize','OperatoToolCreateMenu','creator_id','template','save','design:paramtypes','Mutation','aes256','\x22,\x22header\x22:\x20\x22','updatedAt','left','randomBytes','toolCreateMenu','substring','{\x22type\x22:\x20\x22','scenario','aes-256-cbc','createCipheriv','\x22,\x22name\x22:\x20\x22','push','aes-256-ctr','\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','split',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','aes-256-cfb8','./../tool-secret/tool-permission','createSortCols','__param','__decorate','prototype','14ghrTSU','getRepository','query','aes-256-cfb1','string','@things-factory/resource-base','sortRank','filter','meta-grist-page','updated_at','createSearchCols','toString','updater_id','state','__metadata','menuType','1930LyeZzC','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\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','hex','searchRank'];a0_0x383f=function(){return _0xa19063;};return a0_0x383f();}const a0_0x22a47a=a0_0x1687;(function(_0x54ae6f,_0x45ca43){const _0x23a385=a0_0x1687,_0x368676=_0x54ae6f();while(!![]){try{const _0xf30271=-parseInt(_0x23a385(0x13d))/0x1+parseInt(_0x23a385(0x132))/0x2+-parseInt(_0x23a385(0x1a5))/0x3+-parseInt(_0x23a385(0x130))/0x4*(parseInt(_0x23a385(0x147))/0x5)+-parseInt(_0x23a385(0x13e))/0x6*(parseInt(_0x23a385(0x166))/0x7)+parseInt(_0x23a385(0x18d))/0x8*(-parseInt(_0x23a385(0x190))/0x9)+parseInt(_0x23a385(0x176))/0xa*(parseInt(_0x23a385(0x17b))/0xb);if(_0xf30271===_0x45ca43)break;else _0x368676['push'](_0x368676['shift']());}catch(_0x2f18c3){_0x368676['push'](_0x368676['shift']());}}}(a0_0x383f,0xe4db6));Object['defineProperty'](exports,'__esModule',{'value':!0x0}),exports[a0_0x22a47a(0x149)]=void 0x0;const tslib_1=require(a0_0x22a47a(0x13f)),type_graphql_1=require('type-graphql'),resource_base_1=require(a0_0x22a47a(0x16b)),menu_base_1=require('@things-factory/menu-base'),tool_permission_1=require(a0_0x22a47a(0x161)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require(a0_0x22a47a(0x148)),crypto_1=tslib_1[a0_0x22a47a(0x140)](require('crypto'));let OperatoToolCreateMenu=class{async[a0_0x22a47a(0x154)](_0x3f25b9,_0x158b78,_0x5c1abe){const _0x299317=a0_0x22a47a,{domain:_0x2a970e,user:_0x423a5c,tx:_0x36da75}=_0x5c1abe[_0x299317(0x173)];await(0x0,tool_permission_1[_0x299317(0x195)])('',_0x5c1abe);const _0x402cd6=await _0x36da75[_0x299317(0x167)](resource_base_1['Entity'])[_0x299317(0x131)]({'where':{'domain':{'id':_0x2a970e['id']},'id':_0x3f25b9}}),_0x8cf53a=await _0x36da75[_0x299317(0x167)](resource_base_1[_0x299317(0x1a1)])[_0x299317(0x191)]({'where':{'domain':{'id':_0x2a970e['id']},'entity':{'id':_0x402cd6['id']}}});let {name:_0x195ad6=''}=_0x402cd6||{},_0x14cc68=kebabCase(_0x195ad6),_0x4792c9=modelTemplate[_0x299317(0x184)](/{{pascalCase name}}/g,startCase(camelCase(_0x195ad6))['replace'](/ /g,''))[_0x299317(0x184)](/{{camelCase name}}/g,camelCase(_0x195ad6))[_0x299317(0x184)](/{{snakeCase name}}/g,snakeCase(_0x195ad6))[_0x299317(0x184)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x195ad6)))['replace'](/ /g,''))[_0x299317(0x184)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x195ad6)))['replace'](/{{name}}/g,_0x195ad6),_0xb1f728='';_0x299317(0x197)==_0x402cd6[_0x299317(0x18b)]?_0xb1f728=_0x299317(0x178):_0x299317(0x18c)==_0x402cd6['dataProp']&&(_0xb1f728=_0x299317(0x15d)),_0x4792c9=_0x4792c9['replace'](/{{HistoryButton}}/g,_0xb1f728);let _0x7cad2c=this[_0x299317(0x162)](_0x8cf53a);_0x4792c9=_0x4792c9[_0x299317(0x184)](/{{SortColumns}}/g,_0x7cad2c['join'](','));let _0x23651d=this[_0x299317(0x170)](_0x8cf53a);_0x4792c9=_0x4792c9[_0x299317(0x184)](/{{SearchColumns}}/g,_0x23651d[_0x299317(0x1a0)](','));let _0x2e2eb8=this[_0x299317(0x181)](_0x8cf53a);return _0x4792c9=_0x4792c9[_0x299317(0x184)](/{{GridColumns}}/g,_0x2e2eb8[_0x299317(0x1a0)](',')),_0x4792c9=this['enc'](_0x4792c9),await this[_0x299317(0x189)](_0x36da75,_0x2a970e,_0x423a5c,_0x158b78,_0x14cc68,_0x4792c9),!0x0;}[a0_0x22a47a(0x181)](_0x2b7951){const _0x4cb31c=a0_0x22a47a;return _0x2b7951[_0x4cb31c(0x16d)](_0x522293=>'id'!=_0x522293[_0x4cb31c(0x17d)]&&_0x522293[_0x4cb31c(0x19f)]>0x0)['sort'](function(_0x307448,_0x32ffd8){return _0x307448['gridRank']-_0x32ffd8['gridRank'];})['map'](_0x169c9f=>{const _0x3d71fa=_0x4cb31c;let {gridEditor:_0x15783d=_0x3d71fa(0x16a),name:_0x19fa30,term:_0x39b4aa,gridWidth:_0x32e3e5=0x0,gridAlign:_0x11c96c=_0x3d71fa(0x152),nullable:_0x4f1ec3=!0x1}=_0x169c9f;if(null==_0x15783d&&(_0x15783d='string'),null==_0x11c96c&&(_0x11c96c='left'),_0x3d71fa(0x172)==_0x19fa30||_0x3d71fa(0x14a)==_0x19fa30)return _0x19fa30=_0x3d71fa(0x172)==_0x19fa30?'updater':_0x3d71fa(0x19d),_0x3d71fa(0x13c)+_0x19fa30+_0x3d71fa(0x150)+_0x19fa30+_0x3d71fa(0x13b);if(_0x3d71fa(0x16f)==_0x19fa30||'created_at'==_0x19fa30)return _0x3d71fa(0x187)+(_0x3d71fa(0x16f)==_0x19fa30?_0x3d71fa(0x151):'createdAt')+_0x3d71fa(0x150)+_0x19fa30+'\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}';let _0x4ecc84='readonly'!=_0x15783d&&_0x3d71fa(0x196)!=_0x15783d,_0x53352c=_0x3d71fa(0x196)==_0x15783d;0x1!=_0x53352c&&0x0!=_0x4ecc84||(_0x15783d='string');let _0x15322c=_0x3d71fa(0x156)+_0x15783d+_0x3d71fa(0x15a)+camelCase(_0x19fa30)+_0x3d71fa(0x150)+_0x39b4aa+'\x22,\x22hidden\x22:'+_0x53352c+_0x3d71fa(0x193)+_0x4ecc84+_0x3d71fa(0x180)+!_0x4f1ec3+',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22'+_0x11c96c+'\x22,\x22width\x22:'+_0x32e3e5+_0x3d71fa(0x198);return _0x3d71fa(0x192)==_0x169c9f[_0x3d71fa(0x183)]&&(_0x15322c+=_0x3d71fa(0x136)+_0x169c9f['refName']+'\x22}'),_0x3d71fa(0x157)==_0x169c9f[_0x3d71fa(0x183)]&&(_0x15322c+=',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22'+_0x169c9f[_0x3d71fa(0x134)]+'\x22}'),'entity'==_0x169c9f[_0x3d71fa(0x183)]&&(_0x15322c+=_0x3d71fa(0x15f)+camelCase(plural(_0x169c9f[_0x3d71fa(0x134)]))+_0x3d71fa(0x177)),_0x15322c+='}',_0x15322c;});}[a0_0x22a47a(0x170)](_0x3ccf8b){const _0x1f824f=a0_0x22a47a;return _0x3ccf8b['filter'](_0x492c59=>_0x492c59[_0x1f824f(0x17a)]>0x0)[_0x1f824f(0x19b)](function(_0x4346da,_0x39ad60){const _0x4015cd=_0x1f824f;return _0x4346da[_0x4015cd(0x17a)]-_0x39ad60[_0x4015cd(0x17a)];})[_0x1f824f(0x1a3)](_0x4d5111=>{const _0x386099=_0x1f824f;let _0x4e83c2=_0x4d5111['searchOper'];return _0x386099(0x16d)==_0x4e83c2?'\x22'+camelCase(_0x4d5111[_0x386099(0x17d)])+'\x22':(_0x4e83c2||(_0x4e83c2='eq'),'{\x22name\x22:\x20\x22'+camelCase(_0x4d5111[_0x386099(0x17d)])+_0x386099(0x19e)+_0x4e83c2+'\x22}');});}[a0_0x22a47a(0x162)](_0x315523){const _0x2b8597=a0_0x22a47a;return _0x315523[_0x2b8597(0x16d)](_0x4a5153=>_0x4a5153[_0x2b8597(0x16c)]>0x0)[_0x2b8597(0x19b)](function(_0x1704ec,_0x482571){const _0x1b5be6=_0x2b8597;return _0x1704ec['sortRank']-_0x482571[_0x1b5be6(0x16c)];})['map'](_0x46b834=>_0x2b8597(0x135)+camelCase(_0x46b834[_0x2b8597(0x17d)])+_0x2b8597(0x18e)+_0x46b834[_0x2b8597(0x18f)]+'}');}async[a0_0x22a47a(0x189)](_0x15c6c1,_0x97ac65,_0x20eaf0,_0x2827c6,_0x792746,_0x4dae45){const _0xdf2d4b=a0_0x22a47a;let _0x243995=await _0x15c6c1[_0xdf2d4b(0x167)](menu_base_1[_0xdf2d4b(0x142)])['findOne']({'where':{'domain':{'id':_0x97ac65['id']},'id':_0x2827c6}}),_0x52f9e3=(await _0x15c6c1[_0xdf2d4b(0x167)](menu_base_1[_0xdf2d4b(0x142)])[_0xdf2d4b(0x168)](_0xdf2d4b(0x137)+_0x2827c6+'\x27\x20or\x20id\x20=\x20\x27'+_0x2827c6+'\x27'))[0x0][_0xdf2d4b(0x145)]+0xa,_0x53e540=new menu_base_1[(_0xdf2d4b(0x142))]();_0x53e540[_0xdf2d4b(0x17d)]=_0x792746,_0x53e540[_0xdf2d4b(0x175)]='SCREEN',_0x53e540[_0xdf2d4b(0x17f)]=_0xdf2d4b(0x16e),_0x53e540[_0xdf2d4b(0x145)]=_0x52f9e3,_0x53e540['hiddenFlag']=!0x1,_0x53e540[_0xdf2d4b(0x133)]=_0x792746,_0x53e540[_0xdf2d4b(0x14b)]=_0x4dae45,_0x53e540[_0xdf2d4b(0x1a2)]=_0xdf2d4b(0x199),_0x53e540[_0xdf2d4b(0x138)]=_0x243995,await _0x15c6c1[_0xdf2d4b(0x167)](menu_base_1[_0xdf2d4b(0x142)])[_0xdf2d4b(0x14c)](Object[_0xdf2d4b(0x17e)](Object['assign']({},_0x53e540),{'domain':_0x97ac65,'creator':_0x20eaf0,'updater':_0x20eaf0}));}[a0_0x22a47a(0x18a)](_0x3de373){const _0x33f9aa=a0_0x22a47a;let _0x2e275b=JSON[_0x33f9aa(0x144)](_0x3de373)[_0x33f9aa(0x15e)](/(.{100})/)['filter'](_0x34e0f7=>_0x34e0f7),_0x2fe12b=[_0x33f9aa(0x17c),_0x33f9aa(0x158),'aes-256-cfb',_0x33f9aa(0x160),_0x33f9aa(0x169),_0x33f9aa(0x1a4),_0x33f9aa(0x15c),_0x33f9aa(0x14f)],_0x40c226=crypto_1[_0x33f9aa(0x185)][_0x33f9aa(0x153)](0x20)[_0x33f9aa(0x171)](_0x33f9aa(0x179)),_0x391a1d=Buffer['from'](_0x40c226,_0x33f9aa(0x179)),_0xc5cec6=_0x40c226[_0x33f9aa(0x155)](0x0,0x10),_0x3f1224=['',_0xc5cec6,_0xc5cec6,_0xc5cec6,_0xc5cec6,_0xc5cec6,_0xc5cec6,_0xc5cec6],_0x10224e=0x0,_0x470006=[];_0x470006[_0x33f9aa(0x15b)](_0x40c226);for(var _0x480ba8=0x0;_0x480ba8<_0x2e275b[_0x33f9aa(0x19a)];_0x480ba8++,_0x10224e++){_0x10224e==_0x2fe12b['length']&&(_0x10224e=0x0);let _0x4f7f35=crypto_1[_0x33f9aa(0x185)][_0x33f9aa(0x159)](_0x2fe12b[_0x10224e],_0x391a1d,_0x3f1224[_0x10224e]),_0x51cc15=_0x4f7f35[_0x33f9aa(0x146)](_0x2e275b[_0x480ba8],_0x33f9aa(0x13a),'hex');_0x51cc15+=_0x4f7f35[_0x33f9aa(0x186)](_0x33f9aa(0x179)),_0x470006['push'](_0x51cc15);}return _0x470006[_0x33f9aa(0x1a0)](_0x33f9aa(0x182));}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x22a47a(0x143)])(a0_0x22a47a(0x141)),(0x0,type_graphql_1[a0_0x22a47a(0x14e)])(_0x56fd88=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Menu'}),tslib_1[a0_0x22a47a(0x163)](0x0,(0x0,type_graphql_1[a0_0x22a47a(0x139)])('id')),tslib_1[a0_0x22a47a(0x163)](0x1,(0x0,type_graphql_1['Arg'])('parent_menu_id')),tslib_1[a0_0x22a47a(0x163)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x22a47a(0x174)]('design:type',Function),tslib_1[a0_0x22a47a(0x174)](a0_0x22a47a(0x14d),[String,String,Object]),tslib_1[a0_0x22a47a(0x174)](a0_0x22a47a(0x19c),Promise)],OperatoToolCreateMenu[a0_0x22a47a(0x165)],a0_0x22a47a(0x154),null),OperatoToolCreateMenu=tslib_1[a0_0x22a47a(0x164)]([(0x0,type_graphql_1[a0_0x22a47a(0x188)])()],OperatoToolCreateMenu),exports[a0_0x22a47a(0x149)]=OperatoToolCreateMenu;function a0_0x1687(_0x18557f,_0x3a4747){const _0x383f89=a0_0x383f();return a0_0x1687=function(_0x168732,_0xcc14e1){_0x168732=_0x168732-0x130;let _0x37458b=_0x383f89[_0x168732];return _0x37458b;},a0_0x1687(_0x18557f,_0x3a4747);}const modelTemplate=a0_0x22a47a(0x194);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0xc2c71f=a0_0x30e8;(function(_0x2a72ae,_0x3c41e2){const _0x6695d8=a0_0x30e8,_0x1b2aac=_0x2a72ae();while(!![]){try{const _0x5c4f75=-parseInt(_0x6695d8(0x150))/0x1*(-parseInt(_0x6695d8(0x13a))/0x2)+parseInt(_0x6695d8(0x108))/0x3*(-parseInt(_0x6695d8(0x106))/0x4)+parseInt(_0x6695d8(0x141))/0x5+-parseInt(_0x6695d8(0x135))/0x6*(parseInt(_0x6695d8(0x124))/0x7)+-parseInt(_0x6695d8(0x146))/0x8+parseInt(_0x6695d8(0x14e))/0x9*(-parseInt(_0x6695d8(0x121))/0xa)+-parseInt(_0x6695d8(0x127))/0xb*(-parseInt(_0x6695d8(0x12e))/0xc);if(_0x5c4f75===_0x3c41e2)break;else _0x1b2aac['push'](_0x1b2aac['shift']());}catch(_0x2b41d6){_0x1b2aac['push'](_0x1b2aac['shift']());}}}(a0_0x2f0a,0x7e63e));Object[a0_0xc2c71f(0x154)](exports,a0_0xc2c71f(0x148),{'value':!0x0}),exports[a0_0xc2c71f(0x149)]=void 0x0;function a0_0x30e8(_0x590728,_0x4e8c8d){const _0x2f0a05=a0_0x2f0a();return a0_0x30e8=function(_0x30e8a9,_0x57cc46){_0x30e8a9=_0x30e8a9-0xd2;let _0x5c2908=_0x2f0a05[_0x30e8a9];return _0x5c2908;},a0_0x30e8(_0x590728,_0x4e8c8d);}function a0_0x2f0a(){const _0x148b90=['__param','529725nOYFHU','length','rank','1518LbTVuG','@Column({name:\x27','{{camelCase\x20name}}.','design:type','-type.ts','\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','214152AHgVet','\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','filter','Resolvers\x20}\x20from\x20\x27./','find','dataProp','getColTxtType','78nIexFB','Operato\x20Tool\x20Create\x20Service','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','EntitySubscribers\x20}\x20from\x20\x27./','domain_id','38KlsyuY','design:paramtypes','-history\x27','pluralCamelCaseName','pascalCaseName','\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','join','961285HMxKYx','updated_at','camelCaseName','\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','existsPath','6992712DVneMH','\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','__esModule','OperatoToolCreateService','existsSync','-history.ts','toolCreateService','EntitySubscribers,','9DHccLo','timestamp\x20without\x20time\x20zone','22663GqDAKE','type-graphql','COPY','datetime','defineProperty','/*\x20ENTITIES\x20*/\x0a\x09...','__decorate','createNoHistoryServiceFiels','integer','nullable','writeFile','packages','export\x20*\x20from\x20\x27./','getFieldType','columnToEntityColumn','Ctx','/server','PWD','pluralize','tableName','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','\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','Entity','type\x20=>','\x20})','number','\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','createHistoryEntityText','uniqRank','\x0a\x20\x20','/event-subscriber.ts','lodash','createDir','string','creator','findOne','tslib','writeFileSync','readFileSync','includes','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\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','Resolvers,\x20subscribers\x20as\x20','indexOf','utf8','getRepository','Int','Entities,','double\x20precision',',length:','__metadata','Entities,\x20resolvers\x20as\x20','createServiceFiles','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','Float','-history-query.ts','creator_id','float','getProjectRootPath','\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','/server/service/','prototype','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}}\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','double','map','\x27,\x20nullable:\x20','-query.ts','bigint','colType','createServicePath','long','JSON','createHistoryServiceFiles','split','createTypeText','pluralPascalCaseName','replaceNamesMap','/index.ts','sort','\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','-mutation.ts','push','4YakINa','/packages','1302981mgpUCa','\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','decimal','env','Resolvers,','Query','Date','.ts','\x20{\x20nullable:\x20','name','@things-factory/shell','createEntityText','created_at','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','updater','\x27,\x20type:\x20\x27','-history-type.ts','updater_id','mkdirSync','\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','replace','Resolver','design:returntype','...','@Field(','2757170BBSlrS','@things-factory/resource-base'];a0_0x2f0a=function(){return _0x148b90;};return a0_0x2f0a();}const tslib_1=require(a0_0xc2c71f(0xd8)),type_graphql_1=require(a0_0xc2c71f(0x151)),shell_1=require(a0_0xc2c71f(0x112)),resource_base_1=require(a0_0xc2c71f(0x122)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0xc2c71f(0xd3)),{plural:plural}=require(a0_0xc2c71f(0x162)),fs=require('fs');let OperatoToolCreateService=class{async[a0_0xc2c71f(0x14c)](_0x2a5934,_0x1cddb5){const _0x752008=a0_0xc2c71f,{domain:_0x3d37ba}=_0x1cddb5['state'],_0x542756=await(0x0,shell_1['getRepository'])(resource_base_1[_0x752008(0x166)])[_0x752008(0xd7)]({'where':{'id':_0x2a5934}}),_0x150722=await(0x0,shell_1[_0x752008(0xe0)])(resource_base_1['EntityColumn'])[_0x752008(0x132)]({'where':{'domain':{'id':_0x3d37ba['id']},'entity':{'id':_0x542756['id']}}});let {name:_0x45f034='',bundle:_0x13fb69=''}=_0x542756||{},_0x3919df=this[_0x752008(0xed)](),_0x38d24f=kebabCase(_0x45f034);return await this['createServicePath'](_0x3919df,_0x13fb69,_0x38d24f),await this['createServiceFiles'](_0x3919df,_0x13fb69,_0x45f034,_0x38d24f,_0x542756,_0x150722),!0x0;}async[a0_0xc2c71f(0xe7)](_0x544d21,_0x10dcae,_0x2418e3,_0x5794cb,_0x154cd8,_0x27e62a){const _0x1f67cd=a0_0xc2c71f;let _0x528ab0={'name':_0x5794cb,'tableName':_0x154cd8['tableName'],'pascalCaseName':startCase(camelCase(_0x2418e3))[_0x1f67cd(0x11c)](/ /g,''),'camelCaseName':camelCase(_0x2418e3),'snakeCaseName':snakeCase(_0x2418e3),'pluralPascalCaseName':startCase(camelCase(plural(_0x2418e3)))['replace'](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x2418e3))},_0x3a9427=_0x544d21+'/packages/'+_0x10dcae+_0x1f67cd(0xef);['JSON',_0x1f67cd(0x152)][_0x1f67cd(0xdb)](_0x154cd8[_0x1f67cd(0x133)])?await this[_0x1f67cd(0xfc)](_0x3a9427,_0x5794cb,_0x154cd8,_0x27e62a,_0x528ab0):await this[_0x1f67cd(0x157)](_0x3a9427,_0x5794cb,_0x154cd8,_0x27e62a,_0x528ab0);}async[a0_0xc2c71f(0xfc)](_0xcd1687,_0x4102af,_0x2100b3,_0x10b714,_0x25d13a){const _0x1748f0=a0_0xc2c71f;await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+_0x1748f0(0x101)),serviceHistoryIndex,_0x25d13a);let _0x126c51=this[_0x1748f0(0x113)](_0x2100b3,_0x10b714);await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0x10f)),_0x126c51,_0x25d13a),await this['writeFile'](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0xf6)),serviceQuery,_0x25d13a),await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0x104)),serviceMutation,_0x25d13a);let _0x179967=this[_0x1748f0(0xfe)](_0x10b714);await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0x12b)),_0x179967,_0x25d13a);let _0x5553cb=this['createHistoryEntityText'](_0x2100b3,_0x10b714);await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0x14b)),_0x5553cb,_0x25d13a);let _0x5547e7='';_0x1748f0(0xfb)==_0x2100b3[_0x1748f0(0x133)]?(_0x5547e7=_0x1748f0(0x13f),await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+_0x1748f0(0xd2)),serviceEntitySubscriber,_0x25d13a)):_0x5547e7='';let _0x35ba7d=serviceEntitySubscriber[_0x1748f0(0x11c)](/{{entityToJson}}/g,_0x5547e7);await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/event-subscriber.ts'),_0x35ba7d,_0x25d13a),await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0xea)),serviceHistoryQuery,_0x25d13a),await this[_0x1748f0(0x15a)](_0xcd1687+(_0x4102af+'/'+_0x4102af+_0x1748f0(0x118)),sereviceHistoryType,_0x25d13a);let _0x3fa6f8=_0xcd1687+_0x1748f0(0xf1);0x0==await this[_0x1748f0(0x145)](_0x3fa6f8)&&await this[_0x1748f0(0x15a)](_0x3fa6f8,allIndex,_0x25d13a);let _0x3a3881=await fs['readFileSync'](_0x3fa6f8,_0x1748f0(0xdf));_0x3a3881['indexOf']('export\x20*\x20from\x20\x27./'+_0x25d13a[_0x1748f0(0x111)]+'/'+_0x25d13a[_0x1748f0(0x111)]+_0x1748f0(0x13c))<0x0&&(_0x3a3881=_0x3a3881[_0x1748f0(0x11c)](/\/\* EXPORT ENTITY TYPES \*\//,_0x1748f0(0xe8)+_0x25d13a[_0x1748f0(0x111)]+'/'+_0x25d13a[_0x1748f0(0x111)]+_0x1748f0(0x13c))),_0x3a3881[_0x1748f0(0xde)]('export\x20*\x20from\x20\x27./'+_0x25d13a[_0x1748f0(0x111)]+'/'+_0x25d13a[_0x1748f0(0x111)]+'\x27')<0x0&&(_0x3a3881=_0x3a3881[_0x1748f0(0x11c)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x25d13a['name']+'/'+_0x25d13a['name']+'\x27')),_0x3a3881[_0x1748f0(0xde)](_0x1748f0(0x12d)+_0x25d13a[_0x1748f0(0x13e)]+'Entities,\x20resolvers\x20as\x20'+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0xdd)+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0x138)+_0x25d13a[_0x1748f0(0x111)]+'\x27')<0x0&&(_0x3a3881=_0x3a3881['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1748f0(0x164)+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0xe6)+_0x25d13a['pascalCaseName']+_0x1748f0(0xdd)+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0x138)+_0x25d13a['name']+'\x27')),_0x3a3881[_0x1748f0(0xde)](_0x1748f0(0x11f)+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0xe2))<0x0&&(_0x3a3881=_0x3a3881['replace'](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x25d13a['pascalCaseName']+_0x1748f0(0xe2))),_0x3a3881['indexOf']('...'+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0x10c))<0x0&&(_0x3a3881=_0x3a3881[_0x1748f0(0x11c)](/\/\* RESOLVER CLASSES \*\//,_0x1748f0(0x115)+_0x25d13a['pascalCaseName']+_0x1748f0(0x10c))),_0x3a3881[_0x1748f0(0xde)](_0x1748f0(0x11f)+_0x25d13a['pascalCaseName']+_0x1748f0(0x14d))<0x0&&(_0x3a3881=_0x3a3881['replace'](/\/\* SUBSCRIBERS \*\//,_0x1748f0(0x137)+_0x25d13a[_0x1748f0(0x13e)]+_0x1748f0(0x14d))),await this[_0x1748f0(0x15a)](_0x3fa6f8,_0x3a3881,_0x25d13a);}async[a0_0xc2c71f(0x157)](_0x237420,_0xa09bdd,_0x25263d,_0x54e01e,_0xa2a128){const _0x1b85c6=a0_0xc2c71f;await this[_0x1b85c6(0x15a)](_0x237420+(_0xa09bdd+_0x1b85c6(0x101)),serviceIndex,_0xa2a128),await this[_0x1b85c6(0x15a)](_0x237420+(_0xa09bdd+'/'+_0xa09bdd+_0x1b85c6(0xf6)),serviceQuery,_0xa2a128),await this[_0x1b85c6(0x15a)](_0x237420+(_0xa09bdd+'/'+_0xa09bdd+_0x1b85c6(0x104)),serviceMutation,_0xa2a128);let _0x3f634e=this['createEntityText'](_0x25263d,_0x54e01e);await this[_0x1b85c6(0x15a)](_0x237420+(_0xa09bdd+'/'+_0xa09bdd+_0x1b85c6(0x10f)),_0x3f634e,_0xa2a128);let _0x3e2cc8=this[_0x1b85c6(0xfe)](_0x54e01e);await this['writeFile'](_0x237420+(_0xa09bdd+'/'+_0xa09bdd+_0x1b85c6(0x12b)),_0x3e2cc8,_0xa2a128);let _0x4dbf9c=_0x237420+_0x1b85c6(0xf1);0x0==await this[_0x1b85c6(0x145)](_0x4dbf9c)&&await this[_0x1b85c6(0x15a)](_0x4dbf9c,allIndex,_0xa2a128);let _0x35c230=await fs[_0x1b85c6(0xda)](_0x4dbf9c,_0x1b85c6(0xdf));_0x35c230[_0x1b85c6(0xde)](_0x1b85c6(0x15c)+_0xa2a128['name']+'/'+_0xa2a128['name']+'\x27')<0x0&&(_0x35c230=_0x35c230[_0x1b85c6(0x11c)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0xa2a128['name']+'/'+_0xa2a128[_0x1b85c6(0x111)]+'\x27')),_0x35c230[_0x1b85c6(0xde)](_0x1b85c6(0x12d)+_0xa2a128[_0x1b85c6(0x13e)]+_0x1b85c6(0xe6)+_0xa2a128[_0x1b85c6(0x13e)]+_0x1b85c6(0x131)+_0xa2a128[_0x1b85c6(0x111)]+'\x27')<0x0&&(_0x35c230=_0x35c230[_0x1b85c6(0x11c)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1b85c6(0x164)+_0xa2a128['pascalCaseName']+_0x1b85c6(0xe6)+_0xa2a128[_0x1b85c6(0x13e)]+'Resolvers\x20}\x20from\x20\x27./'+_0xa2a128[_0x1b85c6(0x111)]+'\x27')),_0x35c230[_0x1b85c6(0xde)](_0x1b85c6(0x11f)+_0xa2a128[_0x1b85c6(0x13e)]+_0x1b85c6(0xe2))<0x0&&(_0x35c230=_0x35c230[_0x1b85c6(0x11c)](/\/\* ENTITIES \*\//,_0x1b85c6(0x155)+_0xa2a128[_0x1b85c6(0x13e)]+_0x1b85c6(0xe2))),_0x35c230[_0x1b85c6(0xde)](_0x1b85c6(0x11f)+_0xa2a128[_0x1b85c6(0x13e)]+_0x1b85c6(0x10c))<0x0&&(_0x35c230=_0x35c230[_0x1b85c6(0x11c)](/\/\* RESOLVER CLASSES \*\//,_0x1b85c6(0x115)+_0xa2a128[_0x1b85c6(0x13e)]+_0x1b85c6(0x10c))),await this[_0x1b85c6(0x15a)](_0x4dbf9c,_0x35c230,_0xa2a128);}[a0_0xc2c71f(0xfe)](_0x4cdfcf){const _0x3e40f4=a0_0xc2c71f;let _0x2606dc=sereviceType,_0x51c68d=_0x4cdfcf['map'](_0x3bbf73=>{const _0x1a056e=a0_0x30e8;if('id'==_0x3bbf73[_0x1a056e(0x111)])return'';if(_0x1a056e(0x139)==_0x3bbf73[_0x1a056e(0x111)])return'';if('created_at'==_0x3bbf73[_0x1a056e(0x111)])return'';if('updated_at'==_0x3bbf73['name'])return'';if(_0x1a056e(0xeb)==_0x3bbf73['name'])return'';if(_0x1a056e(0x119)==_0x3bbf73[_0x1a056e(0x111)])return'';let _0x4d87c9=this['getFieldType'](_0x3bbf73),_0x1f5c51=this[_0x1a056e(0x134)](_0x3bbf73),_0xb348fb=camelCase(_0x3bbf73[_0x1a056e(0x111)]);return'\x20\x20'+(_0x1a056e(0x120)+(0x0==_0x4d87c9[_0x1a056e(0x125)]?'':_0x1a056e(0x167)+_0x4d87c9+',')+_0x1a056e(0x110)+_0x3bbf73[_0x1a056e(0x159)]+_0x1a056e(0x168))+_0x1a056e(0x16d)+(''+_0xb348fb+(_0x3bbf73['nullable']?'?':'')+':\x20'+_0x1f5c51)+'\x0a';});_0x2606dc=_0x2606dc[_0x3e40f4(0x11c)](/{{newTypeColumns}}/g,_0x51c68d[_0x3e40f4(0x140)]('\x0a'));let _0x12ccbe=_0x4cdfcf[_0x3e40f4(0xf4)](_0x3def76=>{const _0x7a51af=_0x3e40f4;if('id'==_0x3def76['name'])return'';if(_0x7a51af(0x139)==_0x3def76['name'])return'';if(_0x7a51af(0x114)==_0x3def76[_0x7a51af(0x111)])return'';if(_0x7a51af(0x142)==_0x3def76[_0x7a51af(0x111)])return'';if(_0x7a51af(0xeb)==_0x3def76[_0x7a51af(0x111)])return'';if(_0x7a51af(0x119)==_0x3def76['name'])return'';let _0x4d2ded=this[_0x7a51af(0x15d)](_0x3def76),_0x15cee7=this[_0x7a51af(0x134)](_0x3def76);_0x3def76[_0x7a51af(0x159)]=!0x0;let _0xf86191=camelCase(_0x3def76[_0x7a51af(0x111)]);return'\x20\x20'+(_0x7a51af(0x120)+(0x0==_0x4d2ded['length']?'':'type\x20=>'+_0x4d2ded+',')+_0x7a51af(0x110)+_0x3def76['nullable']+_0x7a51af(0x168))+_0x7a51af(0x16d)+(''+_0xf86191+(_0x3def76['nullable']?'?':'')+':\x20'+_0x15cee7)+'\x0a';});return _0x2606dc=_0x2606dc[_0x3e40f4(0x11c)](/{{patchTypeColumns}}/g,_0x12ccbe[_0x3e40f4(0x140)]('\x0a')),_0x2606dc;}[a0_0xc2c71f(0x113)](_0x4d3da8,_0x36bd87){const _0x408cf7=a0_0xc2c71f;let _0x27215a=serviceEntity,_0x494b15=_0x36bd87[_0x408cf7(0x102)](function(_0x4f88e4,_0x9084c4){const _0x372200=_0x408cf7;return _0x4f88e4[_0x372200(0x126)]-_0x9084c4['rank'];})[_0x408cf7(0xf4)](_0x48ba6f=>this[_0x408cf7(0x15e)](_0x48ba6f));['COPY','JSON'][_0x408cf7(0xdb)](_0x4d3da8['dataProp'])&&_0x494b15[_0x408cf7(0x105)](_0x408cf7(0x12c)),_0x27215a=_0x27215a[_0x408cf7(0x11c)](/{{entityColumns}}/g,_0x494b15[_0x408cf7(0x140)]('\x0a'));let _0x52e134='',_0x2f82f1=_0x36bd87[_0x408cf7(0x130)](_0x56e172=>_0x56e172[_0x408cf7(0x16c)]&&_0x56e172['uniqRank']>0x0)[_0x408cf7(0x102)](function(_0x2ee47f,_0xa3954d){const _0x5b130e=_0x408cf7;return _0x2ee47f[_0x5b130e(0x16c)]-_0xa3954d['uniqRank'];});if(_0x2f82f1['length']>0x0){_0x52e134='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0x3b3ae1=_0x2f82f1[_0x408cf7(0xf4)](_0x474381=>{const _0x30a858=_0x408cf7;let _0x21e53a=_0x474381['name'];return'domain_id'==_0x474381[_0x30a858(0x111)]&&(_0x21e53a='domain'),_0x30a858(0xeb)==_0x474381[_0x30a858(0x111)]&&(_0x21e53a=_0x30a858(0xd6)),_0x30a858(0x119)==_0x474381[_0x30a858(0x111)]&&(_0x21e53a=_0x30a858(0x116)),_0x30a858(0x129)+camelCase(_0x21e53a);});_0x52e134=_0x52e134[_0x408cf7(0x11c)](/{{indexColumns}}/g,_0x3b3ae1[_0x408cf7(0x140)](','));}return _0x27215a=_0x27215a['replace'](/{{indexAnn}}/g,_0x52e134),_0x27215a;}[a0_0xc2c71f(0x16b)](_0x417ab1,_0x494406){const _0xc36992=a0_0xc2c71f;let _0xd3cefc='JSON'==_0x417ab1[_0xc36992(0x133)]?serviceEntityHistJson:serviceEntityHistCopy,_0x4b29cc=_0x494406[_0xc36992(0x102)](function(_0x199c64,_0x3af660){const _0x1aef59=_0xc36992;return _0x199c64[_0x1aef59(0x126)]-_0x3af660[_0x1aef59(0x126)];})[_0xc36992(0xf4)](_0x561e64=>this['columnToEntityColumn'](_0x561e64));return _0xd3cefc=_0xd3cefc['replace'](/{{entityColumns}}/g,_0x4b29cc['join']('\x0a')),_0xd3cefc;}[a0_0xc2c71f(0x15e)](_0x3fbe5b){const _0x233967=a0_0xc2c71f;if('id'==_0x3fbe5b[_0x233967(0x111)])return'';if('domain_id'==_0x3fbe5b[_0x233967(0x111)])return'';if(_0x233967(0x114)==_0x3fbe5b['name'])return'';if(_0x233967(0x142)==_0x3fbe5b[_0x233967(0x111)])return'';if(_0x233967(0xeb)==_0x3fbe5b[_0x233967(0x111)])return'';if(_0x233967(0x119)==_0x3fbe5b[_0x233967(0x111)])return'';let _0xb8cb3=_0x3fbe5b[_0x233967(0xf8)];'double'==_0x3fbe5b[_0x233967(0xf8)]&&(_0xb8cb3=_0x233967(0xe3)),_0x233967(0xfa)==_0x3fbe5b['colType']&&(_0xb8cb3=_0x233967(0xf7)),_0x233967(0xd5)==_0x3fbe5b['colType']&&(_0xb8cb3='character\x20varying'),'datetime'==_0x3fbe5b[_0x233967(0xf8)]&&(_0xb8cb3=_0x233967(0x14f));let _0xb33638='';_0x233967(0xd5)==_0x3fbe5b[_0x233967(0xf8)]&&(_0xb33638=_0x3fbe5b['colSize']);let _0x4533b3=this['getFieldType'](_0x3fbe5b),_0x55ff34=this['getColTxtType'](_0x3fbe5b),_0x48f267=camelCase(_0x3fbe5b['name']);return'\x20\x20'+(_0x233967(0x128)+_0x3fbe5b[_0x233967(0x111)]+_0x233967(0x117)+_0xb8cb3+_0x233967(0xf5)+_0x3fbe5b['nullable']+'\x20'+(0x0==_0xb33638[_0x233967(0x125)]?'':_0x233967(0xe4)+_0xb33638)+'\x20})')+_0x233967(0x16d)+(_0x233967(0x120)+(0x0==_0x4533b3[_0x233967(0x125)]?'':_0x233967(0x167)+_0x4533b3+',')+_0x233967(0x110)+_0x3fbe5b[_0x233967(0x159)]+'\x20})')+_0x233967(0x16d)+(''+_0x48f267+(_0x3fbe5b[_0x233967(0x159)]?'?':'')+':\x20'+_0x55ff34)+'\x0a';}[a0_0xc2c71f(0x15d)](_0x3da5a8){const _0x489d98=a0_0xc2c71f;let _0x4d42f2='';return'double'==_0x3da5a8[_0x489d98(0xf8)]&&(_0x4d42f2=_0x489d98(0xe9)),'float'==_0x3da5a8['colType']&&(_0x4d42f2=_0x489d98(0xe9)),_0x489d98(0xfa)==_0x3da5a8[_0x489d98(0xf8)]&&(_0x4d42f2=_0x489d98(0xe1)),_0x489d98(0x158)==_0x3da5a8[_0x489d98(0xf8)]&&(_0x4d42f2=_0x489d98(0xe1)),_0x4d42f2;}[a0_0xc2c71f(0x134)](_0x109dea){const _0x103ee7=a0_0xc2c71f;let _0x2e0753=_0x109dea[_0x103ee7(0xf8)];return _0x103ee7(0x10a)==_0x109dea['colType']&&(_0x2e0753='number'),_0x103ee7(0xf3)==_0x109dea[_0x103ee7(0xf8)]&&(_0x2e0753=_0x103ee7(0x169)),_0x103ee7(0xec)==_0x109dea['colType']&&(_0x2e0753=_0x103ee7(0x169)),_0x103ee7(0x158)==_0x109dea[_0x103ee7(0xf8)]&&(_0x2e0753=_0x103ee7(0x169)),'long'==_0x109dea[_0x103ee7(0xf8)]&&(_0x2e0753=_0x103ee7(0x169)),_0x103ee7(0x153)==_0x109dea['colType']&&(_0x2e0753=_0x103ee7(0x10e)),'date'==_0x109dea[_0x103ee7(0xf8)]&&(_0x2e0753='Date'),'text'==_0x109dea[_0x103ee7(0xf8)]&&(_0x2e0753='string'),_0x2e0753;}async[a0_0xc2c71f(0x15a)](_0x2b3d3b,_0x3913e3,_0x4323bc){const _0x4e7f75=a0_0xc2c71f;await fs[_0x4e7f75(0xd9)](_0x2b3d3b,this[_0x4e7f75(0x100)](_0x3913e3,_0x4323bc),_0x4e7f75(0xdf));}['replaceNamesMap'](_0x5665b5,_0x28d20a){const _0x21beb3=a0_0xc2c71f;return _0x5665b5[_0x21beb3(0x11c)](/{{pascalCase name}}/g,_0x28d20a[_0x21beb3(0x13e)])[_0x21beb3(0x11c)](/{{camelCase name}}/g,_0x28d20a[_0x21beb3(0x143)])[_0x21beb3(0x11c)](/{{snakeCase name}}/g,_0x28d20a['snakeCaseName'])[_0x21beb3(0x11c)](/{{pluralPascalCase name}}/g,_0x28d20a[_0x21beb3(0xff)])[_0x21beb3(0x11c)](/{{pluralCamelCase name}}/g,_0x28d20a[_0x21beb3(0x13d)])[_0x21beb3(0x11c)](/{{tableName}}/g,_0x28d20a[_0x21beb3(0x163)])[_0x21beb3(0x11c)](/{{name}}/g,_0x28d20a[_0x21beb3(0x111)]);}async[a0_0xc2c71f(0xf9)](_0x2dcae0,_0x3c70c3,_0x4b5efb){const _0x3fcf0e=a0_0xc2c71f;let _0x2966e7=_0x2dcae0+_0x3fcf0e(0x107);await this['createDir'](_0x2966e7),_0x2966e7=_0x2966e7+'/'+_0x3c70c3,await this[_0x3fcf0e(0xd4)](_0x2966e7),_0x2966e7+=_0x3fcf0e(0x160),await this['createDir'](_0x2966e7),_0x2966e7+='/service',await this[_0x3fcf0e(0xd4)](_0x2966e7),_0x2966e7=_0x2966e7+'/'+_0x4b5efb,await this[_0x3fcf0e(0xd4)](_0x2966e7);}['getProjectRootPath'](){const _0x5b2bc0=a0_0xc2c71f;let _0x1e4ba4=process[_0x5b2bc0(0x10b)][_0x5b2bc0(0x161)][_0x5b2bc0(0xfd)]('/'),_0x1a51a0=[];for(let _0x5bd709=0x0;_0x5bd709<_0x1e4ba4[_0x5b2bc0(0x125)]&&_0x5b2bc0(0x15b)!=_0x1e4ba4[_0x5bd709];_0x5bd709++)_0x1a51a0['push'](_0x1e4ba4[_0x5bd709]);return _0x1a51a0['join']('/');}async[a0_0xc2c71f(0xd4)](_0x417b5d){const _0x429348=a0_0xc2c71f;0x0==await this[_0x429348(0x145)](_0x417b5d)&&fs[_0x429348(0x11a)](_0x417b5d);}async[a0_0xc2c71f(0x145)](_0x44512b){const _0x10ba7d=a0_0xc2c71f;return await fs[_0x10ba7d(0x14a)](_0x44512b);}};tslib_1[a0_0xc2c71f(0x156)]([(0x0,type_graphql_1[a0_0xc2c71f(0x10d)])(_0x17f9a2=>Boolean,{'description':a0_0xc2c71f(0x136)}),tslib_1[a0_0xc2c71f(0x123)](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0xc2c71f(0x15f)])()),tslib_1[a0_0xc2c71f(0xe5)](a0_0xc2c71f(0x12a),Function),tslib_1[a0_0xc2c71f(0xe5)](a0_0xc2c71f(0x13b),[String,Object]),tslib_1[a0_0xc2c71f(0xe5)](a0_0xc2c71f(0x11e),Promise)],OperatoToolCreateService[a0_0xc2c71f(0xf0)],a0_0xc2c71f(0x14c),null),OperatoToolCreateService=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0xc2c71f(0x11d)])()],OperatoToolCreateService),exports[a0_0xc2c71f(0x149)]=OperatoToolCreateService;const allIndex=a0_0xc2c71f(0x12f),serviceIndex=a0_0xc2c71f(0x11b),serviceHistoryIndex=a0_0xc2c71f(0x147),serviceQuery=a0_0xc2c71f(0xf2),serviceHistoryQuery=a0_0xc2c71f(0x16a),serviceMutation=a0_0xc2c71f(0x165),sereviceType=a0_0xc2c71f(0x144),sereviceHistoryType=a0_0xc2c71f(0x103),serviceEntity=a0_0xc2c71f(0x109),serviceEntityHistCopy=a0_0xc2c71f(0xdc),serviceEntityHistJson=a0_0xc2c71f(0xee),serviceEntitySubscriber='\x0aimport\x20{\x20EventSubscriber\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20HistoryEntitySubscriber\x20}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@EventSubscriber()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20extends\x20HistoryEntitySubscriber<{{pascalCase\x20name}},{{pascalCase\x20name}}History>\x20{\x0a\x20\x20public\x20get\x20entity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}\x0a\x20\x20}\x0a\x0a\x20\x20public\x20get\x20historyEntity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}History\x0a\x20\x20}\x0a\x0a\x20\x20{{entityToJson}}\x0a\x0a\x20\x20async\x20beforeRemoveHistory(history:{{pascalCase\x20name}}History,entity:{{pascalCase\x20name}}){\x0a\x20\x20\x20\x20let\x20repo\x20=\x20getRepository({{pascalCase\x20name}}History);\x0a\x20\x20\x20\x20const\x20revNo\x20=\x20await\x20repo.createQueryBuilder()\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.select(\x27max(data_revision_no)\x27,\x20\x27rev_no\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.where(\x27domain_id\x20=\x20:domainId\x27,\x20{\x20domainId:\x20entity.domain.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.andWhere(\x27original_id\x20=\x20:originalId\x27,\x20{\x20originalId:\x20entity.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.getRawOne()\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20history.dataRevisionNo\x20=\x20revNo\x20?\x20revNo.rev_no\x20+\x201\x20:\x201;\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a}\x0a';
|
|
1
|
+
'use strict';const a0_0x429f8b=a0_0x48ab;(function(_0xdcdc85,_0x2ea852){const _0x1902f1=a0_0x48ab,_0x4dc604=_0xdcdc85();while(!![]){try{const _0xc0ceab=parseInt(_0x1902f1(0xe2))/0x1*(parseInt(_0x1902f1(0x105))/0x2)+parseInt(_0x1902f1(0xf9))/0x3+parseInt(_0x1902f1(0xeb))/0x4+-parseInt(_0x1902f1(0xdb))/0x5*(-parseInt(_0x1902f1(0xa5))/0x6)+-parseInt(_0x1902f1(0xe8))/0x7*(-parseInt(_0x1902f1(0x111))/0x8)+parseInt(_0x1902f1(0xaa))/0x9*(parseInt(_0x1902f1(0xdf))/0xa)+-parseInt(_0x1902f1(0xfc))/0xb*(parseInt(_0x1902f1(0xba))/0xc);if(_0xc0ceab===_0x2ea852)break;else _0x4dc604['push'](_0x4dc604['shift']());}catch(_0x5e934c){_0x4dc604['push'](_0x4dc604['shift']());}}}(a0_0x1639,0x1a49c));Object['defineProperty'](exports,a0_0x429f8b(0x101),{'value':!0x0}),exports[a0_0x429f8b(0x10e)]=void 0x0;const tslib_1=require(a0_0x429f8b(0x129)),type_graphql_1=require(a0_0x429f8b(0xe1)),shell_1=require(a0_0x429f8b(0x110)),resource_base_1=require(a0_0x429f8b(0xee)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x429f8b(0xfd)),{plural:plural}=require(a0_0x429f8b(0xf3)),fs=require('fs');let OperatoToolCreateService=class{async['toolCreateService'](_0x2172a5,_0x5888b6){const _0x3963fb=a0_0x429f8b,{domain:_0x57a004}=_0x5888b6['state'],_0x459e1e=await(0x0,shell_1[_0x3963fb(0xd1)])(resource_base_1[_0x3963fb(0xdc)])[_0x3963fb(0xbc)]({'where':{'id':_0x2172a5}}),_0x42b457=await(0x0,shell_1[_0x3963fb(0xd1)])(resource_base_1[_0x3963fb(0xe3)])[_0x3963fb(0xa4)]({'where':{'domain':{'id':_0x57a004['id']},'entity':{'id':_0x459e1e['id']}}});let {name:_0x56d635='',bundle:_0x580bd8=''}=_0x459e1e||{},_0x3221c0=this[_0x3963fb(0xc3)](),_0x1a31ca=kebabCase(_0x56d635);return await this['createServicePath'](_0x3221c0,_0x580bd8,_0x1a31ca),await this['createServiceFiles'](_0x3221c0,_0x580bd8,_0x56d635,_0x1a31ca,_0x459e1e,_0x42b457),!0x0;}async[a0_0x429f8b(0x11d)](_0x3a6700,_0x4faebb,_0x817f2,_0x14a15d,_0x58c1df,_0x4f45e0){const _0x176041=a0_0x429f8b;let _0x3f7c21={'name':_0x14a15d,'tableName':_0x58c1df['tableName'],'pascalCaseName':startCase(camelCase(_0x817f2))['replace'](/ /g,''),'camelCaseName':camelCase(_0x817f2),'snakeCaseName':snakeCase(_0x817f2),'pluralPascalCaseName':startCase(camelCase(plural(_0x817f2)))['replace'](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x817f2))},_0x20b8ed=_0x3a6700+_0x176041(0xa1)+_0x4faebb+'/server/service/';[_0x176041(0x109),_0x176041(0x134)][_0x176041(0xc8)](_0x58c1df['dataProp'])?await this[_0x176041(0xfe)](_0x20b8ed,_0x14a15d,_0x58c1df,_0x4f45e0,_0x3f7c21):await this[_0x176041(0xd5)](_0x20b8ed,_0x14a15d,_0x58c1df,_0x4f45e0,_0x3f7c21);}async[a0_0x429f8b(0xfe)](_0x155a41,_0x2c4a08,_0x18bfb1,_0x23a7df,_0x11e703){const _0x2b21d9=a0_0x429f8b;await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+_0x2b21d9(0xbe)),serviceHistoryIndex,_0x11e703);let _0x1fbdb4=this[_0x2b21d9(0xb5)](_0x18bfb1,_0x23a7df);await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+'.ts'),_0x1fbdb4,_0x11e703),await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+_0x2b21d9(0xb7)),serviceQuery,_0x11e703),await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+'-mutation.ts'),serviceMutation,_0x11e703);let _0x2fc824=this[_0x2b21d9(0xb1)](_0x23a7df);await this['writeFile'](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+_0x2b21d9(0xfa)),_0x2fc824,_0x11e703);let _0x4871c7=this[_0x2b21d9(0xf7)](_0x18bfb1,_0x23a7df);await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+_0x2b21d9(0xf4)),_0x4871c7,_0x11e703);let _0x309d43='';_0x2b21d9(0x109)==_0x18bfb1[_0x2b21d9(0xe0)]?(_0x309d43=_0x2b21d9(0x10d),await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+_0x2b21d9(0xcb)),serviceEntitySubscriber,_0x11e703)):_0x309d43='';let _0x4ff688=serviceEntitySubscriber['replace'](/{{entityToJson}}/g,_0x309d43);await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+_0x2b21d9(0xcb)),_0x4ff688,_0x11e703),await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+_0x2b21d9(0x114)),serviceHistoryQuery,_0x11e703),await this[_0x2b21d9(0x10c)](_0x155a41+(_0x2c4a08+'/'+_0x2c4a08+_0x2b21d9(0xaf)),sereviceHistoryType,_0x11e703);let _0x4e4430=_0x155a41+'index.ts';0x0==await this[_0x2b21d9(0x11f)](_0x4e4430)&&await this[_0x2b21d9(0x10c)](_0x4e4430,allIndex,_0x11e703);let _0x5c1f89=await fs['readFileSync'](_0x4e4430,_0x2b21d9(0x11e));_0x5c1f89[_0x2b21d9(0x9f)](_0x2b21d9(0xf6)+_0x11e703[_0x2b21d9(0xcf)]+'/'+_0x11e703[_0x2b21d9(0xcf)]+_0x2b21d9(0x12b))<0x0&&(_0x5c1f89=_0x5c1f89[_0x2b21d9(0xc6)](/\/\* EXPORT ENTITY TYPES \*\//,_0x2b21d9(0xda)+_0x11e703['name']+'/'+_0x11e703[_0x2b21d9(0xcf)]+_0x2b21d9(0x12b))),_0x5c1f89[_0x2b21d9(0x9f)](_0x2b21d9(0xf6)+_0x11e703[_0x2b21d9(0xcf)]+'/'+_0x11e703[_0x2b21d9(0xcf)]+'\x27')<0x0&&(_0x5c1f89=_0x5c1f89['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x2b21d9(0xda)+_0x11e703['name']+'/'+_0x11e703[_0x2b21d9(0xcf)]+'\x27')),_0x5c1f89[_0x2b21d9(0x9f)](_0x2b21d9(0xf1)+_0x11e703[_0x2b21d9(0xb0)]+_0x2b21d9(0x112)+_0x11e703[_0x2b21d9(0xb0)]+'Resolvers,\x20subscribers\x20as\x20'+_0x11e703[_0x2b21d9(0xb0)]+'EntitySubscribers\x20}\x20from\x20\x27./'+_0x11e703['name']+'\x27')<0x0&&(_0x5c1f89=_0x5c1f89[_0x2b21d9(0xc6)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x2b21d9(0xf0)+_0x11e703[_0x2b21d9(0xb0)]+_0x2b21d9(0x112)+_0x11e703[_0x2b21d9(0xb0)]+'Resolvers,\x20subscribers\x20as\x20'+_0x11e703[_0x2b21d9(0xb0)]+_0x2b21d9(0xe4)+_0x11e703[_0x2b21d9(0xcf)]+'\x27')),_0x5c1f89[_0x2b21d9(0x9f)](_0x2b21d9(0x133)+_0x11e703[_0x2b21d9(0xb0)]+'Entities,')<0x0&&(_0x5c1f89=_0x5c1f89[_0x2b21d9(0xc6)](/\/\* ENTITIES \*\//,_0x2b21d9(0x122)+_0x11e703[_0x2b21d9(0xb0)]+'Entities,')),_0x5c1f89[_0x2b21d9(0x9f)](_0x2b21d9(0x133)+_0x11e703[_0x2b21d9(0xb0)]+_0x2b21d9(0x115))<0x0&&(_0x5c1f89=_0x5c1f89[_0x2b21d9(0xc6)](/\/\* RESOLVER CLASSES \*\//,_0x2b21d9(0x128)+_0x11e703[_0x2b21d9(0xb0)]+_0x2b21d9(0x115))),_0x5c1f89[_0x2b21d9(0x9f)]('...'+_0x11e703['pascalCaseName']+'EntitySubscribers,')<0x0&&(_0x5c1f89=_0x5c1f89[_0x2b21d9(0xc6)](/\/\* SUBSCRIBERS \*\//,_0x2b21d9(0x123)+_0x11e703[_0x2b21d9(0xb0)]+'EntitySubscribers,')),await this[_0x2b21d9(0x10c)](_0x4e4430,_0x5c1f89,_0x11e703);}async[a0_0x429f8b(0xd5)](_0x488ef6,_0x5d55fa,_0x11e38e,_0x2698a9,_0x28bda0){const _0x876875=a0_0x429f8b;await this['writeFile'](_0x488ef6+(_0x5d55fa+_0x876875(0xbe)),serviceIndex,_0x28bda0),await this['writeFile'](_0x488ef6+(_0x5d55fa+'/'+_0x5d55fa+'-query.ts'),serviceQuery,_0x28bda0),await this['writeFile'](_0x488ef6+(_0x5d55fa+'/'+_0x5d55fa+'-mutation.ts'),serviceMutation,_0x28bda0);let _0x24e50a=this['createEntityText'](_0x11e38e,_0x2698a9);await this[_0x876875(0x10c)](_0x488ef6+(_0x5d55fa+'/'+_0x5d55fa+_0x876875(0xa7)),_0x24e50a,_0x28bda0);let _0x1729da=this[_0x876875(0xb1)](_0x2698a9);await this[_0x876875(0x10c)](_0x488ef6+(_0x5d55fa+'/'+_0x5d55fa+'-type.ts'),_0x1729da,_0x28bda0);let _0x20d232=_0x488ef6+_0x876875(0x12f);0x0==await this[_0x876875(0x11f)](_0x20d232)&&await this[_0x876875(0x10c)](_0x20d232,allIndex,_0x28bda0);let _0x50fe7b=await fs[_0x876875(0x12c)](_0x20d232,_0x876875(0x11e));_0x50fe7b[_0x876875(0x9f)](_0x876875(0xf6)+_0x28bda0['name']+'/'+_0x28bda0[_0x876875(0xcf)]+'\x27')<0x0&&(_0x50fe7b=_0x50fe7b[_0x876875(0xc6)](/\/\* EXPORT ENTITY TYPES \*\//,_0x876875(0xda)+_0x28bda0[_0x876875(0xcf)]+'/'+_0x28bda0['name']+'\x27')),_0x50fe7b['indexOf']('import\x20{\x20entities\x20as\x20'+_0x28bda0['pascalCaseName']+_0x876875(0x112)+_0x28bda0[_0x876875(0xb0)]+_0x876875(0xd6)+_0x28bda0[_0x876875(0xcf)]+'\x27')<0x0&&(_0x50fe7b=_0x50fe7b[_0x876875(0xc6)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x876875(0xf0)+_0x28bda0[_0x876875(0xb0)]+_0x876875(0x112)+_0x28bda0['pascalCaseName']+_0x876875(0xd6)+_0x28bda0['name']+'\x27')),_0x50fe7b[_0x876875(0x9f)]('...'+_0x28bda0[_0x876875(0xb0)]+'Entities,')<0x0&&(_0x50fe7b=_0x50fe7b['replace'](/\/\* ENTITIES \*\//,_0x876875(0x122)+_0x28bda0[_0x876875(0xb0)]+_0x876875(0xd8))),_0x50fe7b[_0x876875(0x9f)](_0x876875(0x133)+_0x28bda0[_0x876875(0xb0)]+_0x876875(0x115))<0x0&&(_0x50fe7b=_0x50fe7b[_0x876875(0xc6)](/\/\* RESOLVER CLASSES \*\//,_0x876875(0x128)+_0x28bda0[_0x876875(0xb0)]+_0x876875(0x115))),await this[_0x876875(0x10c)](_0x20d232,_0x50fe7b,_0x28bda0);}[a0_0x429f8b(0xb1)](_0x4bc41b){const _0x2491a5=a0_0x429f8b;let _0x3a2d02=sereviceType,_0x303961=_0x4bc41b['map'](_0x578db1=>{const _0x5b9d76=a0_0x48ab;if('id'==_0x578db1[_0x5b9d76(0xcf)])return'';if(_0x5b9d76(0xe6)==_0x578db1[_0x5b9d76(0xcf)])return'';if(_0x5b9d76(0x12a)==_0x578db1['name'])return'';if(_0x5b9d76(0xc9)==_0x578db1[_0x5b9d76(0xcf)])return'';if('creator_id'==_0x578db1[_0x5b9d76(0xcf)])return'';if(_0x5b9d76(0xca)==_0x578db1['name'])return'';let _0x47225e=this[_0x5b9d76(0x117)](_0x578db1),_0x2f0221=this[_0x5b9d76(0xc2)](_0x578db1),_0x3be077=camelCase(_0x578db1[_0x5b9d76(0xcf)]);return'\x20\x20'+(_0x5b9d76(0xfb)+(0x0==_0x47225e[_0x5b9d76(0x11a)]?'':_0x5b9d76(0xd7)+_0x47225e+',')+_0x5b9d76(0xd0)+_0x578db1[_0x5b9d76(0x120)]+'\x20})')+_0x5b9d76(0xd2)+(''+_0x3be077+(_0x578db1[_0x5b9d76(0x120)]?'?':'')+':\x20'+_0x2f0221)+'\x0a';});_0x3a2d02=_0x3a2d02[_0x2491a5(0xc6)](/{{newTypeColumns}}/g,_0x303961['join']('\x0a'));let _0x42c6b0=_0x4bc41b[_0x2491a5(0x11c)](_0x34e21b=>{const _0xf58f=_0x2491a5;if('id'==_0x34e21b[_0xf58f(0xcf)])return'';if('domain_id'==_0x34e21b[_0xf58f(0xcf)])return'';if(_0xf58f(0x12a)==_0x34e21b[_0xf58f(0xcf)])return'';if(_0xf58f(0xc9)==_0x34e21b[_0xf58f(0xcf)])return'';if('creator_id'==_0x34e21b[_0xf58f(0xcf)])return'';if(_0xf58f(0xca)==_0x34e21b[_0xf58f(0xcf)])return'';let _0xd23d7b=this[_0xf58f(0x117)](_0x34e21b),_0x47beb7=this['getColTxtType'](_0x34e21b);_0x34e21b[_0xf58f(0x120)]=!0x0;let _0x2e85ce=camelCase(_0x34e21b['name']);return'\x20\x20'+('@Field('+(0x0==_0xd23d7b['length']?'':_0xf58f(0xd7)+_0xd23d7b+',')+_0xf58f(0xd0)+_0x34e21b[_0xf58f(0x120)]+'\x20})')+_0xf58f(0xd2)+(''+_0x2e85ce+(_0x34e21b[_0xf58f(0x120)]?'?':'')+':\x20'+_0x47beb7)+'\x0a';});return _0x3a2d02=_0x3a2d02['replace'](/{{patchTypeColumns}}/g,_0x42c6b0[_0x2491a5(0xb3)]('\x0a')),_0x3a2d02;}['createEntityText'](_0x40bd80,_0x3a5419){const _0x51d039=a0_0x429f8b;let _0x19f374=serviceEntity,_0x9d473a=_0x3a5419[_0x51d039(0xd4)](function(_0x1f96e7,_0x36b62e){const _0xff3a05=_0x51d039;return _0x1f96e7['rank']-_0x36b62e[_0xff3a05(0xad)];})['map'](_0x5d219a=>this[_0x51d039(0xd3)](_0x5d219a));[_0x51d039(0x134),'JSON'][_0x51d039(0xc8)](_0x40bd80[_0x51d039(0xe0)])&&_0x9d473a[_0x51d039(0xa3)](_0x51d039(0xa6)),_0x19f374=_0x19f374[_0x51d039(0xc6)](/{{entityColumns}}/g,_0x9d473a[_0x51d039(0xb3)]('\x0a'));let _0x161d9f='',_0x2bd568=_0x3a5419[_0x51d039(0xdd)](_0x33aa7e=>_0x33aa7e[_0x51d039(0xb4)]&&_0x33aa7e[_0x51d039(0xb4)]>0x0)[_0x51d039(0xd4)](function(_0x51eb28,_0x43e559){const _0x38ce90=_0x51d039;return _0x51eb28[_0x38ce90(0xb4)]-_0x43e559[_0x38ce90(0xb4)];});if(_0x2bd568[_0x51d039(0x11a)]>0x0){_0x161d9f=_0x51d039(0xce);let _0x174398=_0x2bd568[_0x51d039(0x11c)](_0x5457ef=>{const _0x50db50=_0x51d039;let _0x485d29=_0x5457ef[_0x50db50(0xcf)];return _0x50db50(0xe6)==_0x5457ef['name']&&(_0x485d29=_0x50db50(0xcc)),_0x50db50(0x126)==_0x5457ef[_0x50db50(0xcf)]&&(_0x485d29=_0x50db50(0x10a)),'updater_id'==_0x5457ef['name']&&(_0x485d29='updater'),_0x50db50(0xed)+camelCase(_0x485d29);});_0x161d9f=_0x161d9f['replace'](/{{indexColumns}}/g,_0x174398[_0x51d039(0xb3)](','));}return _0x19f374=_0x19f374[_0x51d039(0xc6)](/{{indexAnn}}/g,_0x161d9f),_0x19f374;}[a0_0x429f8b(0xf7)](_0x11a998,_0x52e752){const _0x447146=a0_0x429f8b;let _0x101f17=_0x447146(0x109)==_0x11a998['dataProp']?serviceEntityHistJson:serviceEntityHistCopy,_0x83d775=_0x52e752[_0x447146(0xd4)](function(_0x5d4533,_0x5af547){const _0x5cf9a4=_0x447146;return _0x5d4533['rank']-_0x5af547[_0x5cf9a4(0xad)];})[_0x447146(0x11c)](_0x473fd2=>this[_0x447146(0xd3)](_0x473fd2));return _0x101f17=_0x101f17[_0x447146(0xc6)](/{{entityColumns}}/g,_0x83d775['join']('\x0a')),_0x101f17;}[a0_0x429f8b(0xd3)](_0x122b64){const _0x251916=a0_0x429f8b;if('id'==_0x122b64[_0x251916(0xcf)])return'';if(_0x251916(0xe6)==_0x122b64[_0x251916(0xcf)])return'';if(_0x251916(0x12a)==_0x122b64[_0x251916(0xcf)])return'';if('updated_at'==_0x122b64[_0x251916(0xcf)])return'';if(_0x251916(0x126)==_0x122b64[_0x251916(0xcf)])return'';if(_0x251916(0xca)==_0x122b64[_0x251916(0xcf)])return'';let _0x1e5155=_0x122b64[_0x251916(0xac)];'double'==_0x122b64[_0x251916(0xac)]&&(_0x1e5155=_0x251916(0xbb)),'long'==_0x122b64['colType']&&(_0x1e5155=_0x251916(0xe7)),'string'==_0x122b64[_0x251916(0xac)]&&(_0x1e5155=_0x251916(0x119)),'datetime'==_0x122b64[_0x251916(0xac)]&&(_0x1e5155=_0x251916(0x12d));let _0xe52f02='';_0x251916(0xc5)==_0x122b64[_0x251916(0xac)]&&(_0xe52f02=_0x122b64[_0x251916(0xea)]);let _0x164236=this['getFieldType'](_0x122b64),_0x19fb22=this[_0x251916(0xc2)](_0x122b64),_0x3ea2c3=camelCase(_0x122b64[_0x251916(0xcf)]);return'\x20\x20'+(_0x251916(0xbd)+_0x122b64[_0x251916(0xcf)]+_0x251916(0x100)+_0x1e5155+_0x251916(0xae)+_0x122b64['nullable']+'\x20'+(0x0==_0xe52f02['length']?'':_0x251916(0xe5)+_0xe52f02)+_0x251916(0x103))+_0x251916(0xd2)+('@Field('+(0x0==_0x164236[_0x251916(0x11a)]?'':_0x251916(0xd7)+_0x164236+',')+_0x251916(0xd0)+_0x122b64[_0x251916(0x120)]+_0x251916(0x103))+'\x0a\x20\x20'+(''+_0x3ea2c3+(_0x122b64[_0x251916(0x120)]?'?':'')+':\x20'+_0x19fb22)+'\x0a';}[a0_0x429f8b(0x117)](_0x54a90f){const _0x30a77a=a0_0x429f8b;let _0x5e9ded='';return _0x30a77a(0xa2)==_0x54a90f[_0x30a77a(0xac)]&&(_0x5e9ded=_0x30a77a(0x106)),_0x30a77a(0xc0)==_0x54a90f[_0x30a77a(0xac)]&&(_0x5e9ded=_0x30a77a(0x106)),_0x30a77a(0xff)==_0x54a90f[_0x30a77a(0xac)]&&(_0x5e9ded='Int'),_0x30a77a(0xb8)==_0x54a90f['colType']&&(_0x5e9ded=_0x30a77a(0x9c)),_0x5e9ded;}['getColTxtType'](_0x4340da){const _0x55a66f=a0_0x429f8b;let _0x315899=_0x4340da[_0x55a66f(0xac)];return _0x55a66f(0x107)==_0x4340da['colType']&&(_0x315899=_0x55a66f(0xc7)),'double'==_0x4340da[_0x55a66f(0xac)]&&(_0x315899='number'),_0x55a66f(0xc0)==_0x4340da[_0x55a66f(0xac)]&&(_0x315899=_0x55a66f(0xc7)),_0x55a66f(0xb8)==_0x4340da[_0x55a66f(0xac)]&&(_0x315899=_0x55a66f(0xc7)),'long'==_0x4340da['colType']&&(_0x315899=_0x55a66f(0xc7)),_0x55a66f(0xc1)==_0x4340da[_0x55a66f(0xac)]&&(_0x315899=_0x55a66f(0xc4)),'date'==_0x4340da[_0x55a66f(0xac)]&&(_0x315899=_0x55a66f(0xc4)),_0x55a66f(0xf5)==_0x4340da['colType']&&(_0x315899='string'),_0x315899;}async['writeFile'](_0x26417b,_0x2c1942,_0xff8c57){const _0x2145f3=a0_0x429f8b;await fs[_0x2145f3(0x118)](_0x26417b,this[_0x2145f3(0x108)](_0x2c1942,_0xff8c57),_0x2145f3(0x11e));}[a0_0x429f8b(0x108)](_0x5de1a7,_0x17dd85){const _0x9121ec=a0_0x429f8b;return _0x5de1a7[_0x9121ec(0xc6)](/{{pascalCase name}}/g,_0x17dd85['pascalCaseName'])['replace'](/{{camelCase name}}/g,_0x17dd85['camelCaseName'])['replace'](/{{snakeCase name}}/g,_0x17dd85[_0x9121ec(0x12e)])[_0x9121ec(0xc6)](/{{pluralPascalCase name}}/g,_0x17dd85[_0x9121ec(0xcd)])[_0x9121ec(0xc6)](/{{pluralCamelCase name}}/g,_0x17dd85[_0x9121ec(0xf2)])['replace'](/{{tableName}}/g,_0x17dd85[_0x9121ec(0x116)])[_0x9121ec(0xc6)](/{{name}}/g,_0x17dd85[_0x9121ec(0xcf)]);}async[a0_0x429f8b(0x121)](_0x3931f9,_0x1c80c1,_0x9bf23d){const _0x1e28c2=a0_0x429f8b;let _0x3570d5=_0x3931f9+_0x1e28c2(0x125);await this['createDir'](_0x3570d5),_0x3570d5=_0x3570d5+'/'+_0x1c80c1,await this[_0x1e28c2(0x132)](_0x3570d5),_0x3570d5+=_0x1e28c2(0x10b),await this['createDir'](_0x3570d5),_0x3570d5+=_0x1e28c2(0xb2),await this['createDir'](_0x3570d5),_0x3570d5=_0x3570d5+'/'+_0x9bf23d,await this[_0x1e28c2(0x132)](_0x3570d5);}[a0_0x429f8b(0xc3)](){const _0x5ae8bc=a0_0x429f8b;let _0x4c5fa9=process[_0x5ae8bc(0xa9)][_0x5ae8bc(0xa8)][_0x5ae8bc(0x127)]('/'),_0x14a364=[];for(let _0x47c2a8=0x0;_0x47c2a8<_0x4c5fa9[_0x5ae8bc(0x11a)]&&'packages'!=_0x4c5fa9[_0x47c2a8];_0x47c2a8++)_0x14a364['push'](_0x4c5fa9[_0x47c2a8]);return _0x14a364[_0x5ae8bc(0xb3)]('/');}async[a0_0x429f8b(0x132)](_0x270ea8){const _0x193b28=a0_0x429f8b;0x0==await this['existsPath'](_0x270ea8)&&fs[_0x193b28(0xb9)](_0x270ea8);}async[a0_0x429f8b(0x11f)](_0x10de6f){return await fs['existsSync'](_0x10de6f);}};function a0_0x1639(){const _0x5790c0=['/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','import\x20{\x20entities\x20as\x20','pluralCamelCaseName','pluralize','-history.ts','text','export\x20*\x20from\x20\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\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','251421OrrlNz','-type.ts','@Field(','13673eHbMYV','lodash','createHistoryServiceFiles','long','\x27,\x20type:\x20\x27','__esModule','prototype','\x20})','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}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','11854bpMgvw','Float','decimal','replaceNamesMap','JSON','creator','/server','writeFile','\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','OperatoToolCreateService','\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','@things-factory/shell','38672mGxERw','Entities,\x20resolvers\x20as\x20','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\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','-history-query.ts','Resolvers,','tableName','getFieldType','writeFileSync','character\x20varying','length','\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','map','createServiceFiles','utf8','existsPath','nullable','createServicePath','/*\x20ENTITIES\x20*/\x0a\x09...','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','\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','/packages','creator_id','split','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','tslib','created_at','-history\x27','readFileSync','timestamp\x20without\x20time\x20zone','snakeCaseName','index.ts','toolCreateService','design:type','createDir','...','COPY','Int','design:paramtypes','__metadata','indexOf','\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','/packages/','double','push','find','258RmGCtC','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','.ts','PWD','env','9819MzcBJj','Resolver','colType','rank','\x27,\x20nullable:\x20','-history-type.ts','pascalCaseName','createTypeText','/service','join','uniqRank','createEntityText','Arg','-query.ts','integer','mkdirSync','3252tXWiVk','double\x20precision','findOne','@Column({name:\x27','/index.ts','__param','float','datetime','getColTxtType','getProjectRootPath','Date','string','replace','number','includes','updated_at','updater_id','/event-subscriber.ts','domain','pluralPascalCaseName','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','name','\x20{\x20nullable:\x20','getRepository','\x0a\x20\x20','columnToEntityColumn','sort','createNoHistoryServiceFiels','Resolvers\x20}\x20from\x20\x27./','type\x20=>','Entities,','\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','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','10565oIKUlY','Entity','filter','__decorate','70EAIxnC','dataProp','type-graphql','27fSljpN','EntityColumn','EntitySubscribers\x20}\x20from\x20\x27./',',length:','domain_id','bigint','7RhWLFd','Operato\x20Tool\x20Create\x20Service','colSize','389452FnNYwm','Query','{{camelCase\x20name}}.','@things-factory/resource-base','design:returntype'];a0_0x1639=function(){return _0x5790c0;};return a0_0x1639();}function a0_0x48ab(_0x3d1db8,_0x3c5d1a){const _0x1639ca=a0_0x1639();return a0_0x48ab=function(_0x48abc9,_0x5d4a83){_0x48abc9=_0x48abc9-0x9c;let _0x202b3b=_0x1639ca[_0x48abc9];return _0x202b3b;},a0_0x48ab(_0x3d1db8,_0x3c5d1a);}tslib_1[a0_0x429f8b(0xde)]([(0x0,type_graphql_1[a0_0x429f8b(0xec)])(_0x436b26=>Boolean,{'description':a0_0x429f8b(0xe9)}),tslib_1[a0_0x429f8b(0xbf)](0x0,(0x0,type_graphql_1[a0_0x429f8b(0xb6)])('id')),tslib_1[a0_0x429f8b(0xbf)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1['__metadata'](a0_0x429f8b(0x131),Function),tslib_1[a0_0x429f8b(0x9e)](a0_0x429f8b(0x9d),[String,Object]),tslib_1[a0_0x429f8b(0x9e)](a0_0x429f8b(0xef),Promise)],OperatoToolCreateService[a0_0x429f8b(0x102)],a0_0x429f8b(0x130),null),OperatoToolCreateService=tslib_1[a0_0x429f8b(0xde)]([(0x0,type_graphql_1[a0_0x429f8b(0xab)])()],OperatoToolCreateService),exports[a0_0x429f8b(0x10e)]=OperatoToolCreateService;const allIndex='\x0a/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0a\x0a/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0a\x0aexport\x20const\x20entities\x20=\x20[\x20\x20\x0a\x20\x20/*\x20ENTITIES\x20*/\x0a]\x20\x0a\x0a\x0aexport\x20const\x20schema\x20=\x20{\x0a\x20\x20resolverClasses:\x20[\x0a\x20\x20\x20\x20/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x20\x20]\x20\x0a}\x0a\x0aexport\x20const\x20subscribers\x20=\x20[\x0a\x20\x20/*\x20SUBSCRIBERS\x20*/\x0a]\x0a',serviceIndex=a0_0x429f8b(0x104),serviceHistoryIndex=a0_0x429f8b(0xd9),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_0x429f8b(0x124),sereviceType=a0_0x429f8b(0x11b),sereviceHistoryType=a0_0x429f8b(0xa0),serviceEntity=a0_0x429f8b(0xf8),serviceEntityHistCopy=a0_0x429f8b(0x113),serviceEntityHistJson='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a\x20\x20@Column(\x27simple-json\x27,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20@Field(type\x20=>\x20ScalarObject,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20historyJson?:\x20any\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntitySubscriber=a0_0x429f8b(0x10f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x144e6d=a0_0x23a7;(function(_0x432eb3,_0x387f6a){const _0x385478=a0_0x23a7,_0x13f636=_0x432eb3();while(!![]){try{const _0x4048b8=-parseInt(_0x385478(0xc0))/0x1+parseInt(_0x385478(0xcc))/0x2*(parseInt(_0x385478(0xd0))/0x3)+-parseInt(_0x385478(0xc5))/0x4+-parseInt(_0x385478(0xd2))/0x5+parseInt(_0x385478(0xb5))/0x6+parseInt(_0x385478(0xbc))/0x7*(parseInt(_0x385478(0xc8))/0x8)+parseInt(_0x385478(0xba))/0x9*(-parseInt(_0x385478(0xc7))/0xa);if(_0x4048b8===_0x387f6a)break;else _0x13f636['push'](_0x13f636['shift']());}catch(_0x4b69a8){_0x13f636['push'](_0x13f636['shift']());}}}(a0_0x4769,0x50b9e));Object['defineProperty'](exports,'__esModule',{'value':!0x0}),exports['checkStudioTemplateIsOverLimit']=exports[a0_0x144e6d(0xbb)]=void 0x0;function a0_0x23a7(_0x8b497d,_0x362b87){const _0x476953=a0_0x4769();return a0_0x23a7=function(_0x23a728,_0x3861a3){_0x23a728=_0x23a728-0xb0;let _0x4c0d9c=_0x476953[_0x23a728];return _0x4c0d9c;},a0_0x23a7(_0x8b497d,_0x362b87);}function a0_0x4769(){const _0x160625=['andWhere','includes','getRepository','from','328472vTmwoC','getCount','20eCkdHY','29560ZtvdhG','OVER_LIMIT','createQueryBuilder','getPermission','777658OeUepx','Menu','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','checkTarget','3kiXTcY','../../errors/license-error','775190wrrtCf','forEach','split','map','id\x20!=\x20:id','select','manager','2711316pjIqVW','ERROR_CODES','LicenseError','@things-factory/operato-license-checker','menu','1987065uDDsuF','checkStudioPermission','903RTDjYZ','trim','Studio','checkStudioTemplateIsOverLimit','307990CdjUXy'];a0_0x4769=function(){return _0x160625;};return a0_0x4769();}const operato_license_checker_1=require(a0_0x144e6d(0xb8)),shell_1=require('@things-factory/shell'),menu_base_1=require('@things-factory/menu-base'),license_error_1=require(a0_0x144e6d(0xd1));async function checkStudioPermission(){const _0x5b5d8e=a0_0x144e6d;let _0x2aa03e=((0x0,operato_license_checker_1[_0x5b5d8e(0xcb)])('Permissions\x20For\x20Tailor\x20Tool')||',')[_0x5b5d8e(0xb0)](',')[_0x5b5d8e(0xb1)](_0x552230=>_0x552230[_0x5b5d8e(0xbd)]()),_0x4c1cc5=!0x1;return _0x2aa03e[_0x5b5d8e(0xd3)](_0x57f76c=>{const _0xb68307=_0x5b5d8e;_0x57f76c[_0xb68307(0xc2)](_0xb68307(0xbe))&&(_0x4c1cc5=!0x0);}),_0x4c1cc5;}async function checkStudioTemplateIsOverLimit(_0x32a524,_0x4ef72d){const _0xcb4bd0=a0_0x144e6d;if(0x0==await checkStudioPermission())throw new license_error_1[(_0xcb4bd0(0xb7))]({'errorCode':_0x4ef72d['t'](license_error_1[_0xcb4bd0(0xb7)][_0xcb4bd0(0xb6)]['INVALID_LICENSE'])});var _0x301220=0x0;if(_0x301220=_0x32a524&&''!=_0x32a524?await(0x0,shell_1[_0xcb4bd0(0xc3)])(menu_base_1[_0xcb4bd0(0xcd)])[_0xcb4bd0(0xb4)]['createQueryBuilder']()[_0xcb4bd0(0xb3)](_0xcb4bd0(0xb9))['from'](menu_base_1[_0xcb4bd0(0xcd)],_0xcb4bd0(0xb9))['where'](_0xcb4bd0(0xb2),{'id':_0x32a524})[_0xcb4bd0(0xc1)](_0xcb4bd0(0xce))[_0xcb4bd0(0xc6)]()+0x1:await(0x0,shell_1[_0xcb4bd0(0xc3)])(menu_base_1[_0xcb4bd0(0xcd)])['manager'][_0xcb4bd0(0xca)]()['select'](_0xcb4bd0(0xb9))[_0xcb4bd0(0xc4)](menu_base_1['Menu'],_0xcb4bd0(0xb9))['where'](_0xcb4bd0(0xce))[_0xcb4bd0(0xc6)]()+0x1,!(0x0,operato_license_checker_1[_0xcb4bd0(0xcf)])(_0x301220))throw new license_error_1['LicenseError']({'errorCode':_0x4ef72d['t'](license_error_1[_0xcb4bd0(0xb7)]['ERROR_CODES'][_0xcb4bd0(0xc9)])});return!0x0;}exports[a0_0x144e6d(0xbb)]=checkStudioPermission,exports[a0_0x144e6d(0xbf)]=checkStudioTemplateIsOverLimit;
|