@things-factory/operato-tools 6.1.28 → 6.1.30
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 +21 -21
- 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 +10 -10
- package/client/pages/generator/search-config-tab-mixin.js +4 -4
- package/client/pages/generator/tab-config-tab-mixin.js +4 -4
- package/client/pages/main.js +4 -4
- package/client/reducers/main.js +1 -1
- package/package.json +3 -3
- package/server/constants/error-code.js +1 -1
- package/server/errors/license-error.js +1 -1
- package/server/routes.js +1 -1
- package/server/service/tool-entity/create-menu.js +1 -1
- package/server/service/tool-entity/create-service.js +1 -1
- package/server/service/tool-secret/tool-permission.js +1 -1
- package/server/service/tool-secret/tool-resolver.js +1 -1
package/client/pages/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var a0_0xbf498=a0_0x25fc;(function(_0x42b4b4,_0x2d78d3){var _0x575def=a0_0x25fc,_0xb0bf61=_0x42b4b4();while(!![]){try{var _0x310f66=-parseInt(_0x575def(0xb4))/0x1+parseInt(_0x575def(0xbb))/0x2*(-parseInt(_0x575def(0xb7))/0x3)+parseInt(_0x575def(0xb5))/0x4*(-parseInt(_0x575def(0xb8))/0x5)+-parseInt(_0x575def(0xb3))/0x6+-parseInt(_0x575def(0xaf))/0x7*(parseInt(_0x575def(0xbe))/0x8)+-parseInt(_0x575def(0xb1))/0x9+parseInt(_0x575def(0xb6))/0xa;if(_0x310f66===_0x2d78d3)break;else _0xb0bf61['push'](_0xb0bf61['shift']());}catch(_0x56f5af){_0xb0bf61['push'](_0xb0bf61['shift']());}}}(a0_0xffba,0xbb8e6));import{html,css}from'lit-element';function a0_0xffba(){var _0x39b83a=['4341834ECYMEG','1267040fDUtbZ','1000XWieie','63440640dKovvU','33hREArM','24845CeeqmC','render','styles','236546uDsRCz','customElements','tool\x20start\x20msg','8275832NbIudO','7IeFwUs','context','66807ksxWkX','operato-tools-main'];a0_0xffba=function(){return _0x39b83a;};return a0_0xffba();}import{connect}from'pwa-helpers/connect-mixin.js';function a0_0x25fc(_0x2c3e7b,_0x2e52e0){var _0xffba12=a0_0xffba();return a0_0x25fc=function(_0x25fc7f,_0x2236a9){_0x25fc7f=_0x25fc7f-0xaf;var _0x1e27df=_0xffba12[_0x25fc7f];return _0x1e27df;},a0_0x25fc(_0x2c3e7b,_0x2e52e0);}import{store,PageView}from'@things-factory/shell';import{TermsUtil}from'@things-factory/meta-ui';class OperatoToolsMain extends connect(store)(PageView){static get[a0_0xbf498(0xba)](){return[css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
background-color: var(--main-section-background-color);
|
|
@@ -41,11 +41,11 @@ function a0_0x520c(_0x7c8969,_0x3c7d22){var _0x2e7bf1=a0_0x2e7b();return a0_0x52
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`];}get[
|
|
44
|
+
`];}get[a0_0xbf498(0xb0)](){return{'title':'Operato\x20Tools','actions':[]};}[a0_0xbf498(0xb9)](){var _0xc59c75=a0_0xbf498;return html`
|
|
45
45
|
<h2>Operato Tools</h2>
|
|
46
46
|
<p page-description>
|
|
47
|
-
${TermsUtil[
|
|
47
|
+
${TermsUtil['tText'](_0xc59c75(0xbd))}
|
|
48
48
|
</p>
|
|
49
49
|
|
|
50
50
|
<img src="/assets/images/operato-tools.png" />
|
|
51
|
-
`;}}window[
|
|
51
|
+
`;}}window[a0_0xbf498(0xbc)]['define'](a0_0xbf498(0xb2),OperatoToolsMain);
|
package/client/reducers/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x2aab86=a0_0x1dc8;function a0_0x3541(){const _0x308e40=['171mmLLTi','1350186eowXFx','944468FbIVTv','6rqvYlt','state','query','8EslSpL','studioPermission','28830nYiqYs','12030QiAfWf','9709UFIiLA','256728ChMILG','dispatch','ABC','567890eMJfeU'];a0_0x3541=function(){return _0x308e40;};return a0_0x3541();}function a0_0x1dc8(_0x52c56d,_0x5bff6f){const _0x3541fb=a0_0x3541();return a0_0x1dc8=function(_0x1dc86d,_0x31f2fd){_0x1dc86d=_0x1dc86d-0x197;let _0x383d50=_0x3541fb[_0x1dc86d];return _0x383d50;},a0_0x1dc8(_0x52c56d,_0x5bff6f);}(function(_0xd9e0a7,_0x32184b){const _0x551a99=a0_0x1dc8,_0x2bb11c=_0xd9e0a7();while(!![]){try{const _0x3c514a=parseInt(_0x551a99(0x199))/0x1+parseInt(_0x551a99(0x198))/0x2*(parseInt(_0x551a99(0x1a1))/0x3)+-parseInt(_0x551a99(0x1a4))/0x4*(-parseInt(_0x551a99(0x19d))/0x5)+-parseInt(_0x551a99(0x19f))/0x6+parseInt(_0x551a99(0x1a0))/0x7+parseInt(_0x551a99(0x19a))/0x8+parseInt(_0x551a99(0x19e))/0x9*(-parseInt(_0x551a99(0x197))/0xa);if(_0x3c514a===_0x32184b)break;else _0x2bb11c['push'](_0x2bb11c['shift']());}catch(_0x59ec1c){_0x2bb11c['push'](_0x2bb11c['shift']());}}}(a0_0x3541,0x213a6));import a0_0x211a64 from'graphql-tag';import{i18next}from'@operato/i18n';import{store}from'@operato/shell';import{client,gqlContext}from'@operato/graphql';import{UPDATE_OPERATO_TOOLS}from'../actions/main';const INITIAL_STATE={'operatoTools':a0_0x2aab86(0x19c),'studioPermission':!0x1};export const UPDATE_OPERATO_TOOLS_PERMISSION='UPDATE_OPERATO_TOOLS_PERMISSION';((async()=>{const _0x12f531=a0_0x2aab86;var _0x37dadd=await client[_0x12f531(0x1a3)]({'query':a0_0x211a64`{studioPermission}`});let _0x40b885=!0x1;_0x37dadd['errors']||(_0x40b885=_0x37dadd['data'][_0x12f531(0x1a5)]),store[_0x12f531(0x19b)]({'type':UPDATE_OPERATO_TOOLS_PERMISSION,'state':{'studioPermission':_0x40b885}});})());const operatoTools=(_0x4a4c0e=INITIAL_STATE,_0x1e468f)=>{const _0x1da610=a0_0x2aab86;switch(_0x1e468f['type']){case UPDATE_OPERATO_TOOLS:return{..._0x4a4c0e};case UPDATE_OPERATO_TOOLS_PERMISSION:return{...INITIAL_STATE,..._0x1e468f[_0x1da610(0x1a2)]};default:return _0x4a4c0e;}};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.30",
|
|
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.30",
|
|
33
33
|
"@things-factory/operato-license-checker": "^3.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@things-factory/builder": "^6.1.28",
|
|
37
37
|
"@things-factory/meta-ui": "^6.0.0-alpha.6"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "d9bab65da9dc680c206f57affb068c84a2d8d570"
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0xdb1974=a0_0x589b;(function(_0x22382a,_0x191838){var _0x247ab3=a0_0x589b,_0x916f28=_0x22382a();while(!![]){try{var _0x179f06=parseInt(_0x247ab3(0x19e))/0x1*(parseInt(_0x247ab3(0x19b))/0x2)+parseInt(_0x247ab3(0x198))/0x3+parseInt(_0x247ab3(0x1a1))/0x4*(parseInt(_0x247ab3(0x19d))/0x5)+-parseInt(_0x247ab3(0x196))/0x6+parseInt(_0x247ab3(0x1a5))/0x7*(parseInt(_0x247ab3(0x19f))/0x8)+parseInt(_0x247ab3(0x1a2))/0x9+parseInt(_0x247ab3(0x19c))/0xa*(-parseInt(_0x247ab3(0x19a))/0xb);if(_0x179f06===_0x191838)break;else _0x916f28['push'](_0x916f28['shift']());}catch(_0x36bdcc){_0x916f28['push'](_0x916f28['shift']());}}}(a0_0x290b,0x35798));function a0_0x589b(_0x2aaa2f,_0x346ad8){var _0x290be0=a0_0x290b();return a0_0x589b=function(_0x589b79,_0x31f1bc){_0x589b79=_0x589b79-0x196;var _0x57d901=_0x290be0[_0x589b79];return _0x57d901;},a0_0x589b(_0x2aaa2f,_0x346ad8);}Object[a0_0xdb1974(0x1a0)](exports,'__esModule',{'value':!0x0}),exports[a0_0xdb1974(0x1a4)]=exports[a0_0xdb1974(0x199)]=void 0x0,exports[a0_0xdb1974(0x199)]=a0_0xdb1974(0x197),exports['OVER_LIMIT']=a0_0xdb1974(0x1a3);function a0_0x290b(){var _0x292207=['error.page\x20count\x20over\x20license\x20limit','OVER_LIMIT','5222uCUpan','2505954KLsQRr','error.invalid\x20license\x20key','295473OTXfkO','INVALID_LICENSE','1474gRmPdg','6562KhLVcm','37860vfHFjW','64235KDXkfx','123gjytHS','2016KcpjBh','defineProperty','124YnwwUo','501408aCLhbv'];a0_0x290b=function(){return _0x292207;};return a0_0x290b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x36c0cd=a0_0xda48;(function(_0x28d31e,_0x186666){const _0x557df1=a0_0xda48,_0x1f1a68=_0x28d31e();while(!![]){try{const _0x34d2ca=parseInt(_0x557df1(0x1c4))/0x1+-parseInt(_0x557df1(0x1bf))/0x2*(-parseInt(_0x557df1(0x1c8))/0x3)+parseInt(_0x557df1(0x1c9))/0x4*(-parseInt(_0x557df1(0x1c0))/0x5)+parseInt(_0x557df1(0x1be))/0x6*(parseInt(_0x557df1(0x1c7))/0x7)+parseInt(_0x557df1(0x1c1))/0x8*(parseInt(_0x557df1(0x1c5))/0x9)+parseInt(_0x557df1(0x1ca))/0xa+-parseInt(_0x557df1(0x1bc))/0xb;if(_0x34d2ca===_0x186666)break;else _0x1f1a68['push'](_0x1f1a68['shift']());}catch(_0x526a7c){_0x1f1a68['push'](_0x1f1a68['shift']());}}}(a0_0x16c0,0x33c23));Object[a0_0x36c0cd(0x1c3)](exports,'__esModule',{'value':!0x0}),exports[a0_0x36c0cd(0x1bd)]=void 0x0;const tslib_1=require(a0_0x36c0cd(0x1c6)),ERROR_CODES=tslib_1[a0_0x36c0cd(0x1cb)](require('../constants/error-code'));function a0_0xda48(_0x584a22,_0x2e1ef1){const _0x16c0f9=a0_0x16c0();return a0_0xda48=function(_0xda4838,_0x534300){_0xda4838=_0xda4838-0x1b8;let _0x291e9d=_0x16c0f9[_0xda4838];return _0x291e9d;},a0_0xda48(_0x584a22,_0x2e1ef1);}class LicenseError extends Error{static get['ERROR_CODES'](){const _0x59c415=a0_0x36c0cd;return Object[_0x59c415(0x1b8)]({},ERROR_CODES);}constructor({errorCode:_0x2c7d65,detail:_0x8ae7cb}){const _0x540228=a0_0x36c0cd;super(_0x2c7d65),this[_0x540228(0x1c2)]=_0x540228(0x1b9),this[_0x540228(0x1ba)]=_0x2c7d65,this[_0x540228(0x1bb)]=_0x8ae7cb;}}exports[a0_0x36c0cd(0x1bd)]=LicenseError;function a0_0x16c0(){const _0x53277e=['78hHlpUR','8ljWsUx','1438590uHHenj','__importStar','assign','license-error','errorCode','detail','3795231LRzkgN','LicenseError','894XOgnAs','1340UzWbLW','316055bcWZGN','8NBaMgV','name','defineProperty','150457ZHzXAJ','2649411kwagMk','tslib','3633TGPKXc'];a0_0x16c0=function(){return _0x53277e;};return a0_0x16c0();}
|
package/server/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0xe8713=a0_0x24e7;(function(_0xc8b0eb,_0xf06674){const _0x1368bc=a0_0x24e7,_0xbf8fd2=_0xc8b0eb();while(!![]){try{const _0x54a18c=-parseInt(_0x1368bc(0x132))/0x1*(-parseInt(_0x1368bc(0x12d))/0x2)+parseInt(_0x1368bc(0x128))/0x3*(-parseInt(_0x1368bc(0x12a))/0x4)+-parseInt(_0x1368bc(0x12b))/0x5+parseInt(_0x1368bc(0x126))/0x6+-parseInt(_0x1368bc(0x135))/0x7+-parseInt(_0x1368bc(0x130))/0x8*(parseInt(_0x1368bc(0x134))/0x9)+parseInt(_0x1368bc(0x133))/0xa*(parseInt(_0x1368bc(0x12f))/0xb);if(_0x54a18c===_0xf06674)break;else _0xbf8fd2['push'](_0xbf8fd2['shift']());}catch(_0x915f8d){_0xbf8fd2['push'](_0xbf8fd2['shift']());}}}(a0_0xfc6a,0x752fb));function a0_0xfc6a(){const _0x53f160=['70800pZrHSM','things-factory:operato-tools:routes','1ySwRIG','1940NZcCUu','657lgXdDt','6398924KbHXCH','bootstrap-module-domain-private-route','285480phvobc','bootstrap-module-domain-public-route','666sJdyAE','bootstrap-module-global-private-route','9508LgzMTD','728490AdcDuQ','debug','1126834bypbEa','bootstrap-module-global-public-route','119218kKUjoI'];a0_0xfc6a=function(){return _0x53f160;};return a0_0xfc6a();}const debug=require(a0_0xe8713(0x12c))(a0_0xe8713(0x131));function a0_0x24e7(_0x97d8be,_0x48b5e6){const _0xfc6a78=a0_0xfc6a();return a0_0x24e7=function(_0x24e76e,_0x4d4ce6){_0x24e76e=_0x24e76e-0x126;let _0x1eb37d=_0xfc6a78[_0x24e76e];return _0x1eb37d;},a0_0x24e7(_0x97d8be,_0x48b5e6);}process['on'](a0_0xe8713(0x12e),(_0x49c8c7,_0x5c73d1)=>{}),process['on'](a0_0xe8713(0x129),(_0x4701b7,_0x5a6ffd)=>{}),process['on'](a0_0xe8713(0x127),(_0x461608,_0x49355f)=>{}),process['on'](a0_0xe8713(0x136),(_0x42e80a,_0x71fa7b)=>{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x1d1781=a0_0xf3cc;(function(_0xbe495d,_0x213e8c){const _0x2f0996=a0_0xf3cc,_0x36e16e=_0xbe495d();while(!![]){try{const _0x1d93d5=parseInt(_0x2f0996(0x81))/0x1+parseInt(_0x2f0996(0xd7))/0x2+parseInt(_0x2f0996(0x76))/0x3+parseInt(_0x2f0996(0x82))/0x4+-parseInt(_0x2f0996(0xa2))/0x5+parseInt(_0x2f0996(0x87))/0x6+-parseInt(_0x2f0996(0x94))/0x7;if(_0x1d93d5===_0x213e8c)break;else _0x36e16e['push'](_0x36e16e['shift']());}catch(_0xaad77){_0x36e16e['push'](_0x36e16e['shift']());}}}(a0_0x57b9,0x453bd));Object[a0_0x1d1781(0x72)](exports,a0_0x1d1781(0x89),{'value':!0x0}),exports['OperatoToolCreateMenu']=void 0x0;function a0_0x57b9(){const _0x53336b=['sortRank',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','JSON','meta-grist-page','OperatoToolCreateMenu','defineProperty','tslib','refName','\x22,\x22header\x22:\x20\x22','111321CpyTDy','getRepository','refType','\x22,\x22name\x22:\x20\x22','split','\x22,\x22width\x22:','design:type','Arg','h1z0q9i9x7q6','hidden','category','550183YkTGEz','1624304VASBaJ','hiddenFlag','__decorate','push','findOne','3052590ENMgax','updatedAt','__esModule','enc','readonly','rank','creator_id','toolCreateMenu','sort','parent','searchRank','resourceUrl','Mutation','6123614OWImyj','createSortCols','parent_menu_id','default','\x22,\x22hidden\x22:','./../tool-secret/tool-permission',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','searchOper','SCREEN','save','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','substring','createGridColumns','2319955bRWurK','type-graphql','updated_at','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','Operato\x20Tool\x20Create\x20Menu','code','final','\x22,\x22operator\x22:\x20\x22','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','assign','design:paramtypes','aes-256-cfb8','Ctx','aes-256-ofb','@things-factory/menu-base','updater_id','created_at','createSearchCols','aes256','aes-256-cfb','EntityColumn','design:returntype','name','\x20,\x22exportable\x22:\x20true','pluralize','left','creator','\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','COPY','string','aes-256-ctr','replace','map','\x27\x20or\x20id\x20=\x20\x27','aes-256-cfb1','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','__metadata','filter','__param','join','Menu','length','stringify','\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','createdAt','checkStudioTemplateIsOverLimit','Entity',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','@things-factory/meta-ui/client/pages/meta-grist-page','\x20,\x22editable\x22:\x20','state','240486ZIUdvK','hex','find','{\x22name\x22:\x22','query','gridRank'];a0_0x57b9=function(){return _0x53336b;};return a0_0x57b9();}const tslib_1=require(a0_0x1d1781(0x73)),type_graphql_1=require(a0_0x1d1781(0xa3)),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require(a0_0x1d1781(0xb1)),tool_permission_1=require(a0_0x1d1781(0x99)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require('lodash'),{plural:plural}=require(a0_0x1d1781(0xbb)),crypto_1=tslib_1['__importDefault'](require('crypto'));let OperatoToolCreateMenu=class{async[a0_0x1d1781(0x8e)](_0x1b1b19,_0x429ce0,_0x5c6bcc){const _0x5eae37=a0_0x1d1781,{domain:_0xd67e52,user:_0x19843a,tx:_0x283c9f}=_0x5c6bcc[_0x5eae37(0xd6)];await(0x0,tool_permission_1[_0x5eae37(0xd1)])('',_0x5c6bcc);const _0x5af024=await _0x283c9f['getRepository'](resource_base_1[_0x5eae37(0xd2)])['findOne']({'where':{'domain':{'id':_0xd67e52['id']},'id':_0x1b1b19}}),_0x36e522=await _0x283c9f[_0x5eae37(0x77)](resource_base_1[_0x5eae37(0xb7)])[_0x5eae37(0xd9)]({'where':{'domain':{'id':_0xd67e52['id']},'entity':{'id':_0x5af024['id']}}});let {name:_0x2cc764=''}=_0x5af024||{},_0x479a08=kebabCase(_0x2cc764),_0x53faab=modelTemplate[_0x5eae37(0xc2)](/{{pascalCase name}}/g,startCase(camelCase(_0x2cc764))['replace'](/ /g,''))[_0x5eae37(0xc2)](/{{camelCase name}}/g,camelCase(_0x2cc764))['replace'](/{{snakeCase name}}/g,snakeCase(_0x2cc764))['replace'](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x2cc764)))[_0x5eae37(0xc2)](/ /g,''))[_0x5eae37(0xc2)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x2cc764)))[_0x5eae37(0xc2)](/{{name}}/g,_0x2cc764),_0x1e7b90='';_0x5eae37(0x6f)==_0x5af024['dataProp']?_0x1e7b90=_0x5eae37(0xcf):_0x5eae37(0xbf)==_0x5af024['dataProp']&&(_0x1e7b90=_0x5eae37(0xc6)),_0x53faab=_0x53faab[_0x5eae37(0xc2)](/{{HistoryButton}}/g,_0x1e7b90);let _0x45c653=this[_0x5eae37(0x95)](_0x36e522);_0x53faab=_0x53faab[_0x5eae37(0xc2)](/{{SortColumns}}/g,_0x45c653[_0x5eae37(0xcb)](','));let _0x131bf7=this[_0x5eae37(0xb4)](_0x36e522);_0x53faab=_0x53faab[_0x5eae37(0xc2)](/{{SearchColumns}}/g,_0x131bf7[_0x5eae37(0xcb)](','));let _0x1085c1=this[_0x5eae37(0xa1)](_0x36e522);return _0x53faab=_0x53faab['replace'](/{{GridColumns}}/g,_0x1085c1['join'](',')),_0x53faab=this[_0x5eae37(0x8a)](_0x53faab),await this['createMenuData'](_0x283c9f,_0xd67e52,_0x19843a,_0x429ce0,_0x479a08,_0x53faab),!0x0;}[a0_0x1d1781(0xa1)](_0xf38ad8){const _0x11ec3b=a0_0x1d1781;return _0xf38ad8['filter'](_0x1c4a3d=>'id'!=_0x1c4a3d[_0x11ec3b(0xb9)]&&_0x1c4a3d[_0x11ec3b(0xdc)]>0x0)[_0x11ec3b(0x8f)](function(_0x570b0f,_0x1b87e8){const _0x53f568=_0x11ec3b;return _0x570b0f[_0x53f568(0xdc)]-_0x1b87e8['gridRank'];})['map'](_0x4cf1e4=>{const _0x46199e=_0x11ec3b;let {gridEditor:_0x43adb7=_0x46199e(0xc0),name:_0x461f2c,term:_0x32852a,gridWidth:_0x4d9a6f=0x0,gridAlign:_0x5b3893='left',nullable:_0x20799d=!0x1}=_0x4cf1e4;if(null==_0x43adb7&&(_0x43adb7='string'),null==_0x5b3893&&(_0x5b3893=_0x46199e(0xbc)),'updater_id'==_0x461f2c||_0x46199e(0x8d)==_0x461f2c)return _0x461f2c=_0x46199e(0xb2)==_0x461f2c?'updater':_0x46199e(0xbd),_0x46199e(0x9f)+_0x461f2c+_0x46199e(0x75)+_0x461f2c+_0x46199e(0xc7);if(_0x46199e(0xa4)==_0x461f2c||_0x46199e(0xb3)==_0x461f2c)return _0x46199e(0xaa)+(_0x46199e(0xa4)==_0x461f2c?_0x46199e(0x88):_0x46199e(0xd0))+_0x46199e(0x75)+_0x461f2c+_0x46199e(0x9b);let _0x1b38c0=_0x46199e(0x8b)!=_0x43adb7&&_0x46199e(0x7f)!=_0x43adb7,_0x439b75=_0x46199e(0x7f)==_0x43adb7;0x1!=_0x439b75&&0x0!=_0x1b38c0||(_0x43adb7=_0x46199e(0xc0));let _0xa14125='{\x22type\x22:\x20\x22'+_0x43adb7+_0x46199e(0x79)+camelCase(_0x461f2c)+_0x46199e(0x75)+_0x32852a+_0x46199e(0x98)+_0x439b75+_0x46199e(0xd5)+_0x1b38c0+',\x22mandatory\x22:\x20'+!_0x20799d+_0x46199e(0xab)+_0x5b3893+_0x46199e(0x7b)+_0x4d9a6f+_0x46199e(0xba);return _0x46199e(0xa7)==_0x4cf1e4[_0x46199e(0x78)]&&(_0xa14125+=_0x46199e(0x6e)+_0x4cf1e4[_0x46199e(0x74)]+'\x22}'),'scenario'==_0x4cf1e4[_0x46199e(0x78)]&&(_0xa14125+=_0x46199e(0xd3)+_0x4cf1e4[_0x46199e(0x74)]+'\x22}'),'entity'==_0x4cf1e4[_0x46199e(0x78)]&&(_0xa14125+=_0x46199e(0x9a)+camelCase(plural(_0x4cf1e4[_0x46199e(0x74)]))+_0x46199e(0xa5)),_0xa14125+='}',_0xa14125;});}[a0_0x1d1781(0xb4)](_0x56b833){const _0x59bb67=a0_0x1d1781;return _0x56b833[_0x59bb67(0xc9)](_0x4aefac=>_0x4aefac['searchRank']>0x0)[_0x59bb67(0x8f)](function(_0x30636c,_0x6d3778){const _0x521a9e=_0x59bb67;return _0x30636c[_0x521a9e(0x91)]-_0x6d3778[_0x521a9e(0x91)];})[_0x59bb67(0xc3)](_0x5420f7=>{const _0x38b1b7=_0x59bb67;let _0x1fbfa4=_0x5420f7[_0x38b1b7(0x9c)];return _0x38b1b7(0xc9)==_0x1fbfa4?'\x22'+camelCase(_0x5420f7['name'])+'\x22':(_0x1fbfa4||(_0x1fbfa4='eq'),'{\x22name\x22:\x20\x22'+camelCase(_0x5420f7['name'])+_0x38b1b7(0xa9)+_0x1fbfa4+'\x22}');});}[a0_0x1d1781(0x95)](_0x1fa1d8){const _0x10965b=a0_0x1d1781;return _0x1fa1d8[_0x10965b(0xc9)](_0x517492=>_0x517492['sortRank']>0x0)[_0x10965b(0x8f)](function(_0x550285,_0x204f03){const _0x2324c3=_0x10965b;return _0x550285[_0x2324c3(0xdd)]-_0x204f03[_0x2324c3(0xdd)];})[_0x10965b(0xc3)](_0x354cfb=>_0x10965b(0xda)+camelCase(_0x354cfb['name'])+'\x22,\x22desc\x22:'+_0x354cfb['reverseSort']+'}');}async['createMenuData'](_0x400094,_0xebe963,_0x551605,_0x440605,_0x56aba4,_0x135f17){const _0x252464=a0_0x1d1781;let _0x355105=await _0x400094['getRepository'](menu_base_1[_0x252464(0xcc)])[_0x252464(0x86)]({'where':{'domain':{'id':_0xebe963['id']},'id':_0x440605}}),_0x36097d=(await _0x400094[_0x252464(0x77)](menu_base_1[_0x252464(0xcc)])[_0x252464(0xdb)]('select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27'+_0x440605+_0x252464(0xc4)+_0x440605+'\x27'))[0x0]['rank']+0xa,_0x4f9521=new menu_base_1['Menu']();_0x4f9521['name']=_0x56aba4,_0x4f9521['menuType']=_0x252464(0x9d),_0x4f9521[_0x252464(0x80)]=_0x252464(0x70),_0x4f9521[_0x252464(0x8c)]=_0x36097d,_0x4f9521[_0x252464(0x83)]=!0x1,_0x4f9521['routing']=_0x56aba4,_0x4f9521['template']=_0x135f17,_0x4f9521[_0x252464(0x92)]=_0x252464(0xd4),_0x4f9521[_0x252464(0x90)]=_0x355105,await _0x400094[_0x252464(0x77)](menu_base_1[_0x252464(0xcc)])[_0x252464(0x9e)](Object[_0x252464(0xac)](Object[_0x252464(0xac)]({},_0x4f9521),{'domain':_0xebe963,'creator':_0x551605,'updater':_0x551605}));}[a0_0x1d1781(0x8a)](_0x1647bb){const _0x1e51f9=a0_0x1d1781;let _0x566d00=JSON[_0x1e51f9(0xce)](_0x1647bb)[_0x1e51f9(0x7a)](/(.{100})/)[_0x1e51f9(0xc9)](_0x560eba=>_0x560eba),_0x522a7b=['aes-256-ecb','aes-256-cbc',_0x1e51f9(0xb6),_0x1e51f9(0xae),_0x1e51f9(0xc5),_0x1e51f9(0xb0),_0x1e51f9(0xc1),_0x1e51f9(0xb5)],_0x3d2fe4=crypto_1[_0x1e51f9(0x97)]['randomBytes'](0x20)['toString'](_0x1e51f9(0xd8)),_0x105aaa=Buffer['from'](_0x3d2fe4,_0x1e51f9(0xd8)),_0x2e7ef4=_0x3d2fe4[_0x1e51f9(0xa0)](0x0,0x10),_0xac8846=['',_0x2e7ef4,_0x2e7ef4,_0x2e7ef4,_0x2e7ef4,_0x2e7ef4,_0x2e7ef4,_0x2e7ef4],_0x28d22f=0x0,_0x4f7eee=[];_0x4f7eee[_0x1e51f9(0x85)](_0x3d2fe4);for(var _0x4761a8=0x0;_0x4761a8<_0x566d00[_0x1e51f9(0xcd)];_0x4761a8++,_0x28d22f++){_0x28d22f==_0x522a7b['length']&&(_0x28d22f=0x0);let _0x160ba9=crypto_1[_0x1e51f9(0x97)]['createCipheriv'](_0x522a7b[_0x28d22f],_0x105aaa,_0xac8846[_0x28d22f]),_0x3ae911=_0x160ba9['update'](_0x566d00[_0x4761a8],'utf8',_0x1e51f9(0xd8));_0x3ae911+=_0x160ba9[_0x1e51f9(0xa8)](_0x1e51f9(0xd8)),_0x4f7eee[_0x1e51f9(0x85)](_0x3ae911);}return _0x4f7eee['join'](_0x1e51f9(0x7e));}};tslib_1[a0_0x1d1781(0x84)]([(0x0,type_graphql_1['Directive'])('@transaction'),(0x0,type_graphql_1[a0_0x1d1781(0x93)])(_0x2dae6e=>Boolean,{'description':a0_0x1d1781(0xa6)}),tslib_1[a0_0x1d1781(0xca)](0x0,(0x0,type_graphql_1[a0_0x1d1781(0x7d)])('id')),tslib_1[a0_0x1d1781(0xca)](0x1,(0x0,type_graphql_1[a0_0x1d1781(0x7d)])(a0_0x1d1781(0x96))),tslib_1[a0_0x1d1781(0xca)](0x2,(0x0,type_graphql_1[a0_0x1d1781(0xaf)])()),tslib_1[a0_0x1d1781(0xc8)](a0_0x1d1781(0x7c),Function),tslib_1[a0_0x1d1781(0xc8)](a0_0x1d1781(0xad),[String,String,Object]),tslib_1['__metadata'](a0_0x1d1781(0xb8),Promise)],OperatoToolCreateMenu['prototype'],a0_0x1d1781(0x8e),null),OperatoToolCreateMenu=tslib_1[a0_0x1d1781(0x84)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateMenu),exports[a0_0x1d1781(0x71)]=OperatoToolCreateMenu;function a0_0xf3cc(_0x5e0eab,_0x3363b3){const _0x57b90e=a0_0x57b9();return a0_0xf3cc=function(_0xf3ccc2,_0x3cebf9){_0xf3ccc2=_0xf3ccc2-0x6e;let _0x56afaf=_0x57b90e[_0xf3ccc2];return _0x56afaf;},a0_0xf3cc(_0x5e0eab,_0x3363b3);}const modelTemplate=a0_0x1d1781(0xbe);
|
|
1
|
+
'use strict';function a0_0x2fcd(){const _0x4f15a6=['split','Entity','readonly','gridRank','join','1308YXNbhR','refName','code','defineProperty','\x27\x20or\x20id\x20=\x20\x27','refType','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','aes-256-cfb1','1573160ytcQyR','replace','\x20,\x22exportable\x22:\x20true','searchOper','sortRank',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','creator','__decorate','updater_id','aes-256-cfb','dataProp','tslib','Menu','aes-256-cbc','substring','2603ddqprR','aes-256-ctr','\x22,\x22width\x22:','scenario','stringify','__param','aes-256-ecb','COPY','template','assign',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','menuType',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','enc','left','string','filter','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','resourceUrl','map','createSearchCols','\x22,\x22name\x22:\x20\x22','aes-256-cfb8','75204fSZxaj','toolCreateMenu','find','592990RvnUCW','@things-factory/meta-ui/client/pages/meta-grist-page','parent_menu_id','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','utf8','push','OperatoToolCreateMenu','274kwtsZH','updater','name','sort','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','\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',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','Resolver','category','SCREEN','searchRank','\x20,\x22editable\x22:\x20','entity','design:type','\x22,\x22header\x22:\x20\x22','@transaction','__metadata','Mutation','update','getRepository','prototype','48MRIUAk','createGridColumns','length','6mwKskb','aes256','JSON','creator_id','lodash','createCipheriv','checkStudioTemplateIsOverLimit','createMenuData','type-graphql','\x22,\x22hidden\x22:','704FokYQo','design:returntype','default','meta-grist-page','./../tool-secret/tool-permission','{\x22name\x22:\x22','h1z0q9i9x7q6','updatedAt','aes-256-ofb','final','2448754ACTnKP','__importDefault','\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','parent','EntityColumn','hidden','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','69aJSDBG','Directive','from','Operato\x20Tool\x20Create\x20Menu','222741hVlANp','findOne','routing','Arg','hex','createSortCols','created_at','randomBytes','updated_at'];a0_0x2fcd=function(){return _0x4f15a6;};return a0_0x2fcd();}const a0_0x4da135=a0_0x2642;(function(_0x497764,_0x110428){const _0x56d28a=a0_0x2642,_0xfb20fc=_0x497764();while(!![]){try{const _0x4ad182=-parseInt(_0x56d28a(0xa5))/0x1*(parseInt(_0x56d28a(0xc6))/0x2)+parseInt(_0x56d28a(0x7c))/0x3*(-parseInt(_0x56d28a(0x8e))/0x4)+parseInt(_0x56d28a(0xbf))/0x5+parseInt(_0x56d28a(0xde))/0x6*(parseInt(_0x56d28a(0xf2))/0x7)+-parseInt(_0x56d28a(0xdb))/0x8*(parseInt(_0x56d28a(0x80))/0x9)+-parseInt(_0x56d28a(0x96))/0xa+-parseInt(_0x56d28a(0xe8))/0xb*(-parseInt(_0x56d28a(0xbc))/0xc);if(_0x4ad182===_0x110428)break;else _0xfb20fc['push'](_0xfb20fc['shift']());}catch(_0x240ba9){_0xfb20fc['push'](_0xfb20fc['shift']());}}}(a0_0x2fcd,0x30b8e));Object[a0_0x4da135(0x91)](exports,'__esModule',{'value':!0x0}),exports[a0_0x4da135(0xc5)]=void 0x0;function a0_0x2642(_0x117baf,_0x478329){const _0x2fcd2d=a0_0x2fcd();return a0_0x2642=function(_0x264233,_0x363f26){_0x264233=_0x264233-0x78;let _0x276190=_0x2fcd2d[_0x264233];return _0x276190;},a0_0x2642(_0x117baf,_0x478329);}const tslib_1=require(a0_0x4da135(0xa1)),type_graphql_1=require(a0_0x4da135(0xe6)),resource_base_1=require('@things-factory/resource-base'),menu_base_1=require('@things-factory/menu-base'),tool_permission_1=require(a0_0x4da135(0xec)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x4da135(0xe2)),{plural:plural}=require('pluralize'),crypto_1=tslib_1[a0_0x4da135(0xf3)](require('crypto'));let OperatoToolCreateMenu=class{async[a0_0x4da135(0xbd)](_0x5505d7,_0x319a3c,_0x1c99cf){const _0x28eeac=a0_0x4da135,{domain:_0x2ccd29,user:_0x59b41d,tx:_0x276144}=_0x1c99cf['state'];await(0x0,tool_permission_1[_0x28eeac(0xe4)])('',_0x1c99cf);const _0x45cccb=await _0x276144[_0x28eeac(0xd9)](resource_base_1[_0x28eeac(0x8a)])[_0x28eeac(0x81)]({'where':{'domain':{'id':_0x2ccd29['id']},'id':_0x5505d7}}),_0x252306=await _0x276144['getRepository'](resource_base_1[_0x28eeac(0x79)])[_0x28eeac(0xbe)]({'where':{'domain':{'id':_0x2ccd29['id']},'entity':{'id':_0x45cccb['id']}}});let {name:_0x2c8055=''}=_0x45cccb||{},_0x565cdb=kebabCase(_0x2c8055),_0xdd93f=modelTemplate[_0x28eeac(0x97)](/{{pascalCase name}}/g,startCase(camelCase(_0x2c8055))[_0x28eeac(0x97)](/ /g,''))[_0x28eeac(0x97)](/{{camelCase name}}/g,camelCase(_0x2c8055))[_0x28eeac(0x97)](/{{snakeCase name}}/g,snakeCase(_0x2c8055))[_0x28eeac(0x97)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x2c8055)))[_0x28eeac(0x97)](/ /g,''))['replace'](/{{pluralCamelCase name}}/g,camelCase(plural(_0x2c8055)))[_0x28eeac(0x97)](/{{name}}/g,_0x2c8055),_0x3a0dc2='';_0x28eeac(0xe0)==_0x45cccb[_0x28eeac(0xa0)]?_0x3a0dc2=_0x28eeac(0xf4):_0x28eeac(0xac)==_0x45cccb[_0x28eeac(0xa0)]&&(_0x3a0dc2=_0x28eeac(0xcb)),_0xdd93f=_0xdd93f[_0x28eeac(0x97)](/{{HistoryButton}}/g,_0x3a0dc2);let _0x5f4a54=this[_0x28eeac(0x85)](_0x252306);_0xdd93f=_0xdd93f[_0x28eeac(0x97)](/{{SortColumns}}/g,_0x5f4a54[_0x28eeac(0x8d)](','));let _0x56d188=this[_0x28eeac(0xb9)](_0x252306);_0xdd93f=_0xdd93f[_0x28eeac(0x97)](/{{SearchColumns}}/g,_0x56d188['join'](','));let _0x2dd7ec=this[_0x28eeac(0xdc)](_0x252306);return _0xdd93f=_0xdd93f[_0x28eeac(0x97)](/{{GridColumns}}/g,_0x2dd7ec[_0x28eeac(0x8d)](',')),_0xdd93f=this[_0x28eeac(0xb2)](_0xdd93f),await this[_0x28eeac(0xe5)](_0x276144,_0x2ccd29,_0x59b41d,_0x319a3c,_0x565cdb,_0xdd93f),!0x0;}[a0_0x4da135(0xdc)](_0x5ee0d6){const _0x3f4461=a0_0x4da135;return _0x5ee0d6[_0x3f4461(0xb5)](_0xf1a6f8=>'id'!=_0xf1a6f8[_0x3f4461(0xc8)]&&_0xf1a6f8[_0x3f4461(0x8c)]>0x0)[_0x3f4461(0xc9)](function(_0x4f21ff,_0x5e434f){const _0x508a5b=_0x3f4461;return _0x4f21ff[_0x508a5b(0x8c)]-_0x5e434f[_0x508a5b(0x8c)];})[_0x3f4461(0xb8)](_0x388ac3=>{const _0x50847f=_0x3f4461;let {gridEditor:_0x3bdbee=_0x50847f(0xb4),name:_0x3a1299,term:_0x411c66,gridWidth:_0x13a787=0x0,gridAlign:_0x500bde='left',nullable:_0x51b239=!0x1}=_0x388ac3;if(null==_0x3bdbee&&(_0x3bdbee=_0x50847f(0xb4)),null==_0x500bde&&(_0x500bde=_0x50847f(0xb3)),_0x50847f(0x9e)==_0x3a1299||_0x50847f(0xe1)==_0x3a1299)return _0x3a1299=_0x50847f(0x9e)==_0x3a1299?_0x50847f(0xc7):_0x50847f(0x9c),'{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22'+_0x3a1299+'\x22,\x22header\x22:\x20\x22'+_0x3a1299+_0x50847f(0x94);if(_0x50847f(0x88)==_0x3a1299||_0x50847f(0x86)==_0x3a1299)return _0x50847f(0xb6)+(_0x50847f(0x88)==_0x3a1299?_0x50847f(0xef):'createdAt')+_0x50847f(0xd4)+_0x3a1299+_0x50847f(0xc2);let _0x40cd13=_0x50847f(0x8b)!=_0x3bdbee&&_0x50847f(0x7a)!=_0x3bdbee,_0x193612=_0x50847f(0x7a)==_0x3bdbee;0x1!=_0x193612&&0x0!=_0x40cd13||(_0x3bdbee=_0x50847f(0xb4));let _0x241d53='{\x22type\x22:\x20\x22'+_0x3bdbee+_0x50847f(0xba)+camelCase(_0x3a1299)+_0x50847f(0xd4)+_0x411c66+_0x50847f(0xe7)+_0x193612+_0x50847f(0xd1)+_0x40cd13+',\x22mandatory\x22:\x20'+!_0x51b239+_0x50847f(0xb1)+_0x500bde+_0x50847f(0xa7)+_0x13a787+_0x50847f(0x98);return _0x50847f(0x90)==_0x388ac3[_0x50847f(0x93)]&&(_0x241d53+=_0x50847f(0x9b)+_0x388ac3[_0x50847f(0x8f)]+'\x22}'),_0x50847f(0xa8)==_0x388ac3[_0x50847f(0x93)]&&(_0x241d53+=_0x50847f(0xaf)+_0x388ac3[_0x50847f(0x8f)]+'\x22}'),_0x50847f(0xd2)==_0x388ac3['refType']&&(_0x241d53+=_0x50847f(0xcc)+camelCase(plural(_0x388ac3[_0x50847f(0x8f)]))+_0x50847f(0x7b)),_0x241d53+='}',_0x241d53;});}[a0_0x4da135(0xb9)](_0x215411){const _0x1e919e=a0_0x4da135;return _0x215411[_0x1e919e(0xb5)](_0x42c5e7=>_0x42c5e7[_0x1e919e(0xd0)]>0x0)[_0x1e919e(0xc9)](function(_0x5081d7,_0x58d454){return _0x5081d7['searchRank']-_0x58d454['searchRank'];})[_0x1e919e(0xb8)](_0x5deed1=>{const _0x3ae54d=_0x1e919e;let _0x5dfe27=_0x5deed1[_0x3ae54d(0x99)];return _0x3ae54d(0xb5)==_0x5dfe27?'\x22'+camelCase(_0x5deed1[_0x3ae54d(0xc8)])+'\x22':(_0x5dfe27||(_0x5dfe27='eq'),'{\x22name\x22:\x20\x22'+camelCase(_0x5deed1['name'])+'\x22,\x22operator\x22:\x20\x22'+_0x5dfe27+'\x22}');});}[a0_0x4da135(0x85)](_0x41b92c){const _0x59c8ac=a0_0x4da135;return _0x41b92c['filter'](_0x4a2cd6=>_0x4a2cd6['sortRank']>0x0)[_0x59c8ac(0xc9)](function(_0x522144,_0x734fa4){const _0x4e2059=_0x59c8ac;return _0x522144[_0x4e2059(0x9a)]-_0x734fa4[_0x4e2059(0x9a)];})[_0x59c8ac(0xb8)](_0x1cb671=>_0x59c8ac(0xed)+camelCase(_0x1cb671[_0x59c8ac(0xc8)])+'\x22,\x22desc\x22:'+_0x1cb671['reverseSort']+'}');}async[a0_0x4da135(0xe5)](_0x2f706e,_0x22983c,_0x181fcd,_0x273f3c,_0x59031a,_0x5ae49e){const _0x469a11=a0_0x4da135;let _0x50c349=await _0x2f706e[_0x469a11(0xd9)](menu_base_1[_0x469a11(0xa2)])['findOne']({'where':{'domain':{'id':_0x22983c['id']},'id':_0x273f3c}}),_0x2654dd=(await _0x2f706e[_0x469a11(0xd9)](menu_base_1[_0x469a11(0xa2)])['query'](_0x469a11(0xca)+_0x273f3c+_0x469a11(0x92)+_0x273f3c+'\x27'))[0x0]['rank']+0xa,_0x2adc64=new menu_base_1[(_0x469a11(0xa2))]();_0x2adc64[_0x469a11(0xc8)]=_0x59031a,_0x2adc64[_0x469a11(0xb0)]=_0x469a11(0xcf),_0x2adc64[_0x469a11(0xce)]=_0x469a11(0xeb),_0x2adc64['rank']=_0x2654dd,_0x2adc64['hiddenFlag']=!0x1,_0x2adc64[_0x469a11(0x82)]=_0x59031a,_0x2adc64[_0x469a11(0xad)]=_0x5ae49e,_0x2adc64[_0x469a11(0xb7)]=_0x469a11(0xc0),_0x2adc64[_0x469a11(0x78)]=_0x50c349,await _0x2f706e[_0x469a11(0xd9)](menu_base_1['Menu'])['save'](Object['assign'](Object[_0x469a11(0xae)]({},_0x2adc64),{'domain':_0x22983c,'creator':_0x181fcd,'updater':_0x181fcd}));}[a0_0x4da135(0xb2)](_0x42f3c8){const _0xa690ab=a0_0x4da135;let _0x4b05bc=JSON[_0xa690ab(0xa9)](_0x42f3c8)[_0xa690ab(0x89)](/(.{100})/)[_0xa690ab(0xb5)](_0x3d46a7=>_0x3d46a7),_0x165b30=[_0xa690ab(0xab),_0xa690ab(0xa3),_0xa690ab(0x9f),_0xa690ab(0xbb),_0xa690ab(0x95),_0xa690ab(0xf0),_0xa690ab(0xa6),_0xa690ab(0xdf)],_0x2b3f60=crypto_1[_0xa690ab(0xea)][_0xa690ab(0x87)](0x20)['toString']('hex'),_0x3b4096=Buffer[_0xa690ab(0x7e)](_0x2b3f60,_0xa690ab(0x84)),_0xe142ee=_0x2b3f60[_0xa690ab(0xa4)](0x0,0x10),_0x3e3fbe=['',_0xe142ee,_0xe142ee,_0xe142ee,_0xe142ee,_0xe142ee,_0xe142ee,_0xe142ee],_0x2e65db=0x0,_0x1c1f94=[];_0x1c1f94[_0xa690ab(0xc4)](_0x2b3f60);for(var _0x588e91=0x0;_0x588e91<_0x4b05bc['length'];_0x588e91++,_0x2e65db++){_0x2e65db==_0x165b30[_0xa690ab(0xdd)]&&(_0x2e65db=0x0);let _0x28e704=crypto_1['default'][_0xa690ab(0xe3)](_0x165b30[_0x2e65db],_0x3b4096,_0x3e3fbe[_0x2e65db]),_0x5593f3=_0x28e704[_0xa690ab(0xd8)](_0x4b05bc[_0x588e91],_0xa690ab(0xc3),_0xa690ab(0x84));_0x5593f3+=_0x28e704[_0xa690ab(0xf1)](_0xa690ab(0x84)),_0x1c1f94['push'](_0x5593f3);}return _0x1c1f94['join'](_0xa690ab(0xee));}};tslib_1[a0_0x4da135(0x9d)]([(0x0,type_graphql_1[a0_0x4da135(0x7d)])(a0_0x4da135(0xd5)),(0x0,type_graphql_1[a0_0x4da135(0xd7)])(_0x3db1a5=>Boolean,{'description':a0_0x4da135(0x7f)}),tslib_1[a0_0x4da135(0xaa)](0x0,(0x0,type_graphql_1[a0_0x4da135(0x83)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1['Arg'])(a0_0x4da135(0xc1))),tslib_1[a0_0x4da135(0xaa)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x4da135(0xd6)](a0_0x4da135(0xd3),Function),tslib_1[a0_0x4da135(0xd6)]('design:paramtypes',[String,String,Object]),tslib_1['__metadata'](a0_0x4da135(0xe9),Promise)],OperatoToolCreateMenu[a0_0x4da135(0xda)],a0_0x4da135(0xbd),null),OperatoToolCreateMenu=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x4da135(0xcd)])()],OperatoToolCreateMenu),exports['OperatoToolCreateMenu']=OperatoToolCreateMenu;const modelTemplate='\x0a{\x0a\x20\x20\x22menu\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22title\x22:\x20\x22{{name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22\x22,\x0a\x20\x20\x20\x20\x20\x20\x22desc\x22:\x20\x22\x22\x0a\x20\x20},\x0a\x20\x20\x22gql\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22query\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22list_func\x22:\x20\x22{{pluralCamelCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22find_one_func\x22:\x22{{camelCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22mutation\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22updateMultiple{{pascalCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22{{pascalCase\x20name}}Patch\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22delete\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22delete{{pluralPascalCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22button\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22export\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22add\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22delete\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22save\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20],\x0a\x20\x20\x22grid_column\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22string\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22header\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22hidden\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22editable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mandatory\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sortable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22align\x22:\x20\x22left\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22width\x22:\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22exportable\x22:\x20false\x0a\x20\x20\x20\x20\x20\x20},\x0a{{GridColumns}}\x0a\x20\x20],\x0a\x20\x20\x22grid\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22button\x22:[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{HistoryButton}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22option\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mobile_mode\x22:\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22desk_mode\x22:\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22use_row_checker\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22pages\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2020,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20100,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20300\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22view_mode\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22CARD\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sorters\x22:\x20[\x0a{{SortColumns}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20]\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22row\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple_select\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22click\x22:\x20\x22select-row-toggle\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22search\x22:\x20[\x0a{{SearchColumns}}\x0a\x20\x20]\x0a}\x0a';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x573f8b=a0_0x1d93;(function(_0x1cccc5,_0x526b18){const _0x2ed907=a0_0x1d93,_0x285b83=_0x1cccc5();while(!![]){try{const _0x9036fc=parseInt(_0x2ed907(0x1c3))/0x1+-parseInt(_0x2ed907(0x1ee))/0x2+parseInt(_0x2ed907(0x1a8))/0x3*(-parseInt(_0x2ed907(0x163))/0x4)+-parseInt(_0x2ed907(0x17a))/0x5*(parseInt(_0x2ed907(0x1bf))/0x6)+parseInt(_0x2ed907(0x1b2))/0x7+parseInt(_0x2ed907(0x193))/0x8+parseInt(_0x2ed907(0x1d9))/0x9;if(_0x9036fc===_0x526b18)break;else _0x285b83['push'](_0x285b83['shift']());}catch(_0x3563f1){_0x285b83['push'](_0x285b83['shift']());}}}(a0_0x12ad,0x78bbc));function a0_0x1d93(_0x3de4a8,_0x59f0f0){const _0x12ad15=a0_0x12ad();return a0_0x1d93=function(_0x1d930c,_0x33574c){_0x1d930c=_0x1d930c-0x15f;let _0x535809=_0x12ad15[_0x1d930c];return _0x535809;},a0_0x1d93(_0x3de4a8,_0x59f0f0);}Object[a0_0x573f8b(0x1d4)](exports,'__esModule',{'value':!0x0}),exports[a0_0x573f8b(0x17f)]=void 0x0;function a0_0x12ad(){const _0x8b07ca=['\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','__param','\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','split','Resolver','Operato\x20Tool\x20Create\x20Service','map','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','/packages','Resolvers,','text','\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','createNoHistoryServiceFiels','/service','utf8','\x20{\x20nullable:\x20','\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','/packages/','1308104WEQppu',',length:','camelCaseName','type\x20=>','nullable','float','236OTiVud','\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','/index.ts','Float','-query.ts','-mutation.ts','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a','.ts','created_at','getFieldType','character\x20varying','...','lodash','pluralCamelCaseName','replace','/server','sort','uniqRank','existsPath','design:returntype','Int','replaceNamesMap','state','165ZxpoiY','__decorate','\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','Arg','index.ts','OperatoToolCreateService','-type.ts','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','creator_id','timestamp\x20without\x20time\x20zone','long','createHistoryEntityText','double','number','updater_id','toolCreateService','domain_id','domain','import\x20{\x20entities\x20as\x20','\x20})','pascalCaseName','Date','date','-history-type.ts','@things-factory/resource-base','3509048utPHdA','snakeCaseName','tslib','string','type-graphql','decimal','-history\x27','filter','includes','push','columnToEntityColumn','createDir','@Column({name:\x27','\x27,\x20nullable:\x20','createServicePath','Query','tableName','Resolvers\x20}\x20from\x20\x27./','\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','datetime','writeFile','13461eBuZdS','EntityColumn','creator','createEntityText','mkdirSync','writeFileSync','export\x20*\x20from\x20\x27./','EntitySubscribers\x20}\x20from\x20\x27./','findOne','colType','6731410mkTrOE','\x27,\x20type:\x20\x27','Resolvers,\x20subscribers\x20as\x20','design:paramtypes','Entity','JSON','env','Entities,','__metadata','find','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','createTypeText','indexOf','150882iggDnw','getRepository','updated_at','length','208584VKFKyE','@Field(','/server/service/','dataProp','packages','existsSync','EntitySubscribers,','prototype','pluralize','join','createHistoryServiceFiles','\x0a\x20\x20','integer','\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','Entities,\x20resolvers\x20as\x20','rank','{{camelCase\x20name}}.','defineProperty','COPY','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','PWD','getColTxtType','5708835rGdcnb','colSize','name'];a0_0x12ad=function(){return _0x8b07ca;};return a0_0x12ad();}const tslib_1=require(a0_0x573f8b(0x195)),type_graphql_1=require(a0_0x573f8b(0x197)),shell_1=require('@things-factory/shell'),resource_base_1=require(a0_0x573f8b(0x192)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x573f8b(0x16f)),{plural:plural}=require(a0_0x573f8b(0x1cb)),fs=require('fs');let OperatoToolCreateService=class{async['toolCreateService'](_0xc0692c,_0x5bf932){const _0x13dc5=a0_0x573f8b,{domain:_0x3b3383}=_0x5bf932[_0x13dc5(0x179)],_0x5ceaec=await(0x0,shell_1[_0x13dc5(0x1c0)])(resource_base_1[_0x13dc5(0x1b6)])[_0x13dc5(0x1b0)]({'where':{'id':_0xc0692c}}),_0x305baf=await(0x0,shell_1[_0x13dc5(0x1c0)])(resource_base_1[_0x13dc5(0x1a9)])[_0x13dc5(0x1bb)]({'where':{'domain':{'id':_0x3b3383['id']},'entity':{'id':_0x5ceaec['id']}}});let {name:_0x1f5bd1='',bundle:_0x4e854a=''}=_0x5ceaec||{},_0x498e35=this['getProjectRootPath'](),_0x4cc719=kebabCase(_0x1f5bd1);return await this['createServicePath'](_0x498e35,_0x4e854a,_0x4cc719),await this['createServiceFiles'](_0x498e35,_0x4e854a,_0x1f5bd1,_0x4cc719,_0x5ceaec,_0x305baf),!0x0;}async['createServiceFiles'](_0x284993,_0x3e58ef,_0x12b607,_0x4fb467,_0x4c2e57,_0x2d9bfc){const _0x10d0ae=a0_0x573f8b;let _0x579962={'name':_0x4fb467,'tableName':_0x4c2e57[_0x10d0ae(0x1a3)],'pascalCaseName':startCase(camelCase(_0x12b607))['replace'](/ /g,''),'camelCaseName':camelCase(_0x12b607),'snakeCaseName':snakeCase(_0x12b607),'pluralPascalCaseName':startCase(camelCase(plural(_0x12b607)))[_0x10d0ae(0x171)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x12b607))},_0x351e11=_0x284993+_0x10d0ae(0x1ed)+_0x3e58ef+_0x10d0ae(0x1c5);[_0x10d0ae(0x1b7),_0x10d0ae(0x1d5)][_0x10d0ae(0x19b)](_0x4c2e57[_0x10d0ae(0x1c6)])?await this[_0x10d0ae(0x1cd)](_0x351e11,_0x4fb467,_0x4c2e57,_0x2d9bfc,_0x579962):await this[_0x10d0ae(0x1e8)](_0x351e11,_0x4fb467,_0x4c2e57,_0x2d9bfc,_0x579962);}async[a0_0x573f8b(0x1cd)](_0x1b4248,_0x1ef9f4,_0x4f2174,_0x49db0b,_0x424084){const _0x5d1678=a0_0x573f8b;await this['writeFile'](_0x1b4248+(_0x1ef9f4+'/index.ts'),serviceHistoryIndex,_0x424084);let _0x421080=this[_0x5d1678(0x1ab)](_0x4f2174,_0x49db0b);await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+_0x5d1678(0x16a)),_0x421080,_0x424084),await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+_0x5d1678(0x167)),serviceQuery,_0x424084),await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+_0x5d1678(0x168)),serviceMutation,_0x424084);let _0x1918ab=this['createTypeText'](_0x49db0b);await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+_0x5d1678(0x180)),_0x1918ab,_0x424084);let _0x23a994=this[_0x5d1678(0x185)](_0x4f2174,_0x49db0b);await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+'-history.ts'),_0x23a994,_0x424084);let _0x106990='';'JSON'==_0x4f2174[_0x5d1678(0x1c6)]?(_0x106990='\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20',await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/event-subscriber.ts'),serviceEntitySubscriber,_0x424084)):_0x106990='';let _0x25da3b=serviceEntitySubscriber['replace'](/{{entityToJson}}/g,_0x106990);await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/event-subscriber.ts'),_0x25da3b,_0x424084),await this['writeFile'](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+'-history-query.ts'),serviceHistoryQuery,_0x424084),await this[_0x5d1678(0x1a7)](_0x1b4248+(_0x1ef9f4+'/'+_0x1ef9f4+_0x5d1678(0x191)),sereviceHistoryType,_0x424084);let _0x31220d=_0x1b4248+_0x5d1678(0x17e);0x0==await this[_0x5d1678(0x175)](_0x31220d)&&await this[_0x5d1678(0x1a7)](_0x31220d,allIndex,_0x424084);let _0x4f9e02=await fs['readFileSync'](_0x31220d,'utf8');_0x4f9e02[_0x5d1678(0x1be)](_0x5d1678(0x1ae)+_0x424084[_0x5d1678(0x1db)]+'/'+_0x424084[_0x5d1678(0x1db)]+'-history\x27')<0x0&&(_0x4f9e02=_0x4f9e02[_0x5d1678(0x171)](/\/\* EXPORT ENTITY TYPES \*\//,_0x5d1678(0x1e3)+_0x424084[_0x5d1678(0x1db)]+'/'+_0x424084['name']+_0x5d1678(0x199))),_0x4f9e02[_0x5d1678(0x1be)](_0x5d1678(0x1ae)+_0x424084[_0x5d1678(0x1db)]+'/'+_0x424084[_0x5d1678(0x1db)]+'\x27')<0x0&&(_0x4f9e02=_0x4f9e02[_0x5d1678(0x171)](/\/\* EXPORT ENTITY TYPES \*\//,_0x5d1678(0x1e3)+_0x424084[_0x5d1678(0x1db)]+'/'+_0x424084[_0x5d1678(0x1db)]+'\x27')),_0x4f9e02['indexOf'](_0x5d1678(0x18c)+_0x424084[_0x5d1678(0x18e)]+'Entities,\x20resolvers\x20as\x20'+_0x424084[_0x5d1678(0x18e)]+'Resolvers,\x20subscribers\x20as\x20'+_0x424084[_0x5d1678(0x18e)]+'EntitySubscribers\x20}\x20from\x20\x27./'+_0x424084['name']+'\x27')<0x0&&(_0x4f9e02=_0x4f9e02['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x5d1678(0x1bc)+_0x424084[_0x5d1678(0x18e)]+_0x5d1678(0x1d1)+_0x424084[_0x5d1678(0x18e)]+_0x5d1678(0x1b4)+_0x424084[_0x5d1678(0x18e)]+_0x5d1678(0x1af)+_0x424084[_0x5d1678(0x1db)]+'\x27')),_0x4f9e02[_0x5d1678(0x1be)]('...'+_0x424084[_0x5d1678(0x18e)]+'Entities,')<0x0&&(_0x4f9e02=_0x4f9e02['replace'](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x424084[_0x5d1678(0x18e)]+'Entities,')),_0x4f9e02[_0x5d1678(0x1be)](_0x5d1678(0x16e)+_0x424084[_0x5d1678(0x18e)]+_0x5d1678(0x1e5))<0x0&&(_0x4f9e02=_0x4f9e02[_0x5d1678(0x171)](/\/\* RESOLVER CLASSES \*\//,_0x5d1678(0x181)+_0x424084[_0x5d1678(0x18e)]+'Resolvers,')),_0x4f9e02[_0x5d1678(0x1be)](_0x5d1678(0x16e)+_0x424084['pascalCaseName']+_0x5d1678(0x1c9))<0x0&&(_0x4f9e02=_0x4f9e02[_0x5d1678(0x171)](/\/\* SUBSCRIBERS \*\//,'/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...'+_0x424084[_0x5d1678(0x18e)]+_0x5d1678(0x1c9))),await this['writeFile'](_0x31220d,_0x4f9e02,_0x424084);}async[a0_0x573f8b(0x1e8)](_0x582d6c,_0x5c4323,_0x4b3230,_0x8ee814,_0x5cf4f2){const _0x389322=a0_0x573f8b;await this[_0x389322(0x1a7)](_0x582d6c+(_0x5c4323+_0x389322(0x165)),serviceIndex,_0x5cf4f2),await this[_0x389322(0x1a7)](_0x582d6c+(_0x5c4323+'/'+_0x5c4323+'-query.ts'),serviceQuery,_0x5cf4f2),await this[_0x389322(0x1a7)](_0x582d6c+(_0x5c4323+'/'+_0x5c4323+_0x389322(0x168)),serviceMutation,_0x5cf4f2);let _0x54b419=this[_0x389322(0x1ab)](_0x4b3230,_0x8ee814);await this[_0x389322(0x1a7)](_0x582d6c+(_0x5c4323+'/'+_0x5c4323+_0x389322(0x16a)),_0x54b419,_0x5cf4f2);let _0x52a62c=this[_0x389322(0x1bd)](_0x8ee814);await this[_0x389322(0x1a7)](_0x582d6c+(_0x5c4323+'/'+_0x5c4323+_0x389322(0x180)),_0x52a62c,_0x5cf4f2);let _0x1b9107=_0x582d6c+_0x389322(0x17e);0x0==await this['existsPath'](_0x1b9107)&&await this[_0x389322(0x1a7)](_0x1b9107,allIndex,_0x5cf4f2);let _0x2c37b0=await fs['readFileSync'](_0x1b9107,_0x389322(0x1ea));_0x2c37b0[_0x389322(0x1be)]('export\x20*\x20from\x20\x27./'+_0x5cf4f2[_0x389322(0x1db)]+'/'+_0x5cf4f2['name']+'\x27')<0x0&&(_0x2c37b0=_0x2c37b0['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x389322(0x1e3)+_0x5cf4f2['name']+'/'+_0x5cf4f2[_0x389322(0x1db)]+'\x27')),_0x2c37b0[_0x389322(0x1be)]('import\x20{\x20entities\x20as\x20'+_0x5cf4f2[_0x389322(0x18e)]+_0x389322(0x1d1)+_0x5cf4f2[_0x389322(0x18e)]+_0x389322(0x1a4)+_0x5cf4f2[_0x389322(0x1db)]+'\x27')<0x0&&(_0x2c37b0=_0x2c37b0['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x5cf4f2[_0x389322(0x18e)]+_0x389322(0x1d1)+_0x5cf4f2[_0x389322(0x18e)]+'Resolvers\x20}\x20from\x20\x27./'+_0x5cf4f2[_0x389322(0x1db)]+'\x27')),_0x2c37b0[_0x389322(0x1be)]('...'+_0x5cf4f2['pascalCaseName']+_0x389322(0x1b9))<0x0&&(_0x2c37b0=_0x2c37b0[_0x389322(0x171)](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x5cf4f2[_0x389322(0x18e)]+_0x389322(0x1b9))),_0x2c37b0[_0x389322(0x1be)](_0x389322(0x16e)+_0x5cf4f2[_0x389322(0x18e)]+'Resolvers,')<0x0&&(_0x2c37b0=_0x2c37b0['replace'](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x5cf4f2['pascalCaseName']+'Resolvers,')),await this['writeFile'](_0x1b9107,_0x2c37b0,_0x5cf4f2);}[a0_0x573f8b(0x1bd)](_0x4548d8){const _0x4c5301=a0_0x573f8b;let _0x28810a=sereviceType,_0x17b17c=_0x4548d8['map'](_0x2bc70c=>{const _0x145096=a0_0x1d93;if('id'==_0x2bc70c[_0x145096(0x1db)])return'';if(_0x145096(0x18a)==_0x2bc70c[_0x145096(0x1db)])return'';if(_0x145096(0x16b)==_0x2bc70c[_0x145096(0x1db)])return'';if(_0x145096(0x1c1)==_0x2bc70c[_0x145096(0x1db)])return'';if(_0x145096(0x182)==_0x2bc70c['name'])return'';if(_0x145096(0x188)==_0x2bc70c[_0x145096(0x1db)])return'';let _0x41ed63=this['getFieldType'](_0x2bc70c),_0x5d3f9c=this['getColTxtType'](_0x2bc70c),_0x54627a=camelCase(_0x2bc70c['name']);return'\x20\x20'+('@Field('+(0x0==_0x41ed63[_0x145096(0x1c2)]?'':_0x145096(0x160)+_0x41ed63+',')+_0x145096(0x1eb)+_0x2bc70c['nullable']+_0x145096(0x18d))+_0x145096(0x1ce)+(''+_0x54627a+(_0x2bc70c[_0x145096(0x161)]?'?':'')+':\x20'+_0x5d3f9c)+'\x0a';});_0x28810a=_0x28810a['replace'](/{{newTypeColumns}}/g,_0x17b17c[_0x4c5301(0x1cc)]('\x0a'));let _0xb0efd8=_0x4548d8[_0x4c5301(0x1e2)](_0x3774e2=>{const _0x58d5c0=_0x4c5301;if('id'==_0x3774e2[_0x58d5c0(0x1db)])return'';if(_0x58d5c0(0x18a)==_0x3774e2[_0x58d5c0(0x1db)])return'';if('created_at'==_0x3774e2[_0x58d5c0(0x1db)])return'';if(_0x58d5c0(0x1c1)==_0x3774e2[_0x58d5c0(0x1db)])return'';if(_0x58d5c0(0x182)==_0x3774e2['name'])return'';if(_0x58d5c0(0x188)==_0x3774e2[_0x58d5c0(0x1db)])return'';let _0x411119=this[_0x58d5c0(0x16c)](_0x3774e2),_0x4e444b=this[_0x58d5c0(0x1d8)](_0x3774e2);_0x3774e2[_0x58d5c0(0x161)]=!0x0;let _0x1005b0=camelCase(_0x3774e2['name']);return'\x20\x20'+(_0x58d5c0(0x1c4)+(0x0==_0x411119[_0x58d5c0(0x1c2)]?'':'type\x20=>'+_0x411119+',')+_0x58d5c0(0x1eb)+_0x3774e2['nullable']+_0x58d5c0(0x18d))+_0x58d5c0(0x1ce)+(''+_0x1005b0+(_0x3774e2[_0x58d5c0(0x161)]?'?':'')+':\x20'+_0x4e444b)+'\x0a';});return _0x28810a=_0x28810a[_0x4c5301(0x171)](/{{patchTypeColumns}}/g,_0xb0efd8[_0x4c5301(0x1cc)]('\x0a')),_0x28810a;}[a0_0x573f8b(0x1ab)](_0x228cc0,_0x3a1f1d){const _0x101910=a0_0x573f8b;let _0x983302=serviceEntity,_0x2f7b2c=_0x3a1f1d[_0x101910(0x173)](function(_0x1c9017,_0x4431b2){const _0x53abd0=_0x101910;return _0x1c9017[_0x53abd0(0x1d2)]-_0x4431b2['rank'];})[_0x101910(0x1e2)](_0x474800=>this['columnToEntityColumn'](_0x474800));[_0x101910(0x1d5),_0x101910(0x1b7)][_0x101910(0x19b)](_0x228cc0['dataProp'])&&_0x2f7b2c[_0x101910(0x19c)](_0x101910(0x1d6)),_0x983302=_0x983302[_0x101910(0x171)](/{{entityColumns}}/g,_0x2f7b2c[_0x101910(0x1cc)]('\x0a'));let _0x258896='',_0x3fc81e=_0x3a1f1d[_0x101910(0x19a)](_0x2b7301=>_0x2b7301[_0x101910(0x174)]&&_0x2b7301[_0x101910(0x174)]>0x0)[_0x101910(0x173)](function(_0x5ec5c5,_0x43f98f){const _0x845f1f=_0x101910;return _0x5ec5c5[_0x845f1f(0x174)]-_0x43f98f['uniqRank'];});if(_0x3fc81e['length']>0x0){_0x258896='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0x42128f=_0x3fc81e[_0x101910(0x1e2)](_0x22d2ea=>{const _0x378a1d=_0x101910;let _0x5e7565=_0x22d2ea[_0x378a1d(0x1db)];return _0x378a1d(0x18a)==_0x22d2ea[_0x378a1d(0x1db)]&&(_0x5e7565=_0x378a1d(0x18b)),_0x378a1d(0x182)==_0x22d2ea[_0x378a1d(0x1db)]&&(_0x5e7565=_0x378a1d(0x1aa)),'updater_id'==_0x22d2ea['name']&&(_0x5e7565='updater'),_0x378a1d(0x1d3)+camelCase(_0x5e7565);});_0x258896=_0x258896[_0x101910(0x171)](/{{indexColumns}}/g,_0x42128f[_0x101910(0x1cc)](','));}return _0x983302=_0x983302[_0x101910(0x171)](/{{indexAnn}}/g,_0x258896),_0x983302;}[a0_0x573f8b(0x185)](_0x4db105,_0x5d7747){const _0x3ae569=a0_0x573f8b;let _0x177364=_0x3ae569(0x1b7)==_0x4db105['dataProp']?serviceEntityHistJson:serviceEntityHistCopy,_0x70edfe=_0x5d7747[_0x3ae569(0x173)](function(_0x2961e1,_0x43ddae){const _0x241ff7=_0x3ae569;return _0x2961e1[_0x241ff7(0x1d2)]-_0x43ddae['rank'];})[_0x3ae569(0x1e2)](_0x447ae2=>this[_0x3ae569(0x19d)](_0x447ae2));return _0x177364=_0x177364[_0x3ae569(0x171)](/{{entityColumns}}/g,_0x70edfe[_0x3ae569(0x1cc)]('\x0a')),_0x177364;}['columnToEntityColumn'](_0x5a67d5){const _0x3f60fb=a0_0x573f8b;if('id'==_0x5a67d5['name'])return'';if('domain_id'==_0x5a67d5['name'])return'';if(_0x3f60fb(0x16b)==_0x5a67d5[_0x3f60fb(0x1db)])return'';if(_0x3f60fb(0x1c1)==_0x5a67d5[_0x3f60fb(0x1db)])return'';if(_0x3f60fb(0x182)==_0x5a67d5['name'])return'';if('updater_id'==_0x5a67d5['name'])return'';let _0x210565=_0x5a67d5[_0x3f60fb(0x1b1)];_0x3f60fb(0x186)==_0x5a67d5[_0x3f60fb(0x1b1)]&&(_0x210565='double\x20precision'),_0x3f60fb(0x184)==_0x5a67d5[_0x3f60fb(0x1b1)]&&(_0x210565='bigint'),_0x3f60fb(0x196)==_0x5a67d5[_0x3f60fb(0x1b1)]&&(_0x210565=_0x3f60fb(0x16d)),'datetime'==_0x5a67d5[_0x3f60fb(0x1b1)]&&(_0x210565=_0x3f60fb(0x183));let _0x511ce5='';_0x3f60fb(0x196)==_0x5a67d5[_0x3f60fb(0x1b1)]&&(_0x511ce5=_0x5a67d5[_0x3f60fb(0x1da)]);let _0x2a6c8e=this['getFieldType'](_0x5a67d5),_0x47f5fe=this['getColTxtType'](_0x5a67d5),_0x6a63ca=camelCase(_0x5a67d5[_0x3f60fb(0x1db)]);return'\x20\x20'+(_0x3f60fb(0x19f)+_0x5a67d5[_0x3f60fb(0x1db)]+_0x3f60fb(0x1b3)+_0x210565+_0x3f60fb(0x1a0)+_0x5a67d5['nullable']+'\x20'+(0x0==_0x511ce5[_0x3f60fb(0x1c2)]?'':_0x3f60fb(0x1ef)+_0x511ce5)+_0x3f60fb(0x18d))+_0x3f60fb(0x1ce)+(_0x3f60fb(0x1c4)+(0x0==_0x2a6c8e['length']?'':'type\x20=>'+_0x2a6c8e+',')+_0x3f60fb(0x1eb)+_0x5a67d5[_0x3f60fb(0x161)]+_0x3f60fb(0x18d))+_0x3f60fb(0x1ce)+(''+_0x6a63ca+(_0x5a67d5[_0x3f60fb(0x161)]?'?':'')+':\x20'+_0x47f5fe)+'\x0a';}[a0_0x573f8b(0x16c)](_0x136163){const _0x1a6d59=a0_0x573f8b;let _0x5eccfa='';return _0x1a6d59(0x186)==_0x136163[_0x1a6d59(0x1b1)]&&(_0x5eccfa='Float'),_0x1a6d59(0x162)==_0x136163[_0x1a6d59(0x1b1)]&&(_0x5eccfa=_0x1a6d59(0x166)),'long'==_0x136163[_0x1a6d59(0x1b1)]&&(_0x5eccfa='Int'),_0x1a6d59(0x1cf)==_0x136163[_0x1a6d59(0x1b1)]&&(_0x5eccfa=_0x1a6d59(0x177)),_0x5eccfa;}[a0_0x573f8b(0x1d8)](_0x389a89){const _0x4950f5=a0_0x573f8b;let _0x49f6db=_0x389a89['colType'];return _0x4950f5(0x198)==_0x389a89[_0x4950f5(0x1b1)]&&(_0x49f6db=_0x4950f5(0x187)),_0x4950f5(0x186)==_0x389a89[_0x4950f5(0x1b1)]&&(_0x49f6db='number'),_0x4950f5(0x162)==_0x389a89['colType']&&(_0x49f6db=_0x4950f5(0x187)),_0x4950f5(0x1cf)==_0x389a89[_0x4950f5(0x1b1)]&&(_0x49f6db=_0x4950f5(0x187)),_0x4950f5(0x184)==_0x389a89[_0x4950f5(0x1b1)]&&(_0x49f6db=_0x4950f5(0x187)),_0x4950f5(0x1a6)==_0x389a89['colType']&&(_0x49f6db=_0x4950f5(0x18f)),_0x4950f5(0x190)==_0x389a89['colType']&&(_0x49f6db=_0x4950f5(0x18f)),_0x4950f5(0x1e6)==_0x389a89[_0x4950f5(0x1b1)]&&(_0x49f6db='string'),_0x49f6db;}async['writeFile'](_0xbbad47,_0x47540c,_0x4545ed){const _0xdea269=a0_0x573f8b;await fs[_0xdea269(0x1ad)](_0xbbad47,this[_0xdea269(0x178)](_0x47540c,_0x4545ed),_0xdea269(0x1ea));}[a0_0x573f8b(0x178)](_0x2c2518,_0x3bf07b){const _0x1092b3=a0_0x573f8b;return _0x2c2518[_0x1092b3(0x171)](/{{pascalCase name}}/g,_0x3bf07b['pascalCaseName'])['replace'](/{{camelCase name}}/g,_0x3bf07b[_0x1092b3(0x15f)])[_0x1092b3(0x171)](/{{snakeCase name}}/g,_0x3bf07b[_0x1092b3(0x194)])[_0x1092b3(0x171)](/{{pluralPascalCase name}}/g,_0x3bf07b['pluralPascalCaseName'])[_0x1092b3(0x171)](/{{pluralCamelCase name}}/g,_0x3bf07b[_0x1092b3(0x170)])[_0x1092b3(0x171)](/{{tableName}}/g,_0x3bf07b[_0x1092b3(0x1a3)])[_0x1092b3(0x171)](/{{name}}/g,_0x3bf07b[_0x1092b3(0x1db)]);}async[a0_0x573f8b(0x1a1)](_0x591e6a,_0x1d569b,_0x32dd8e){const _0xe4a17e=a0_0x573f8b;let _0x45aca9=_0x591e6a+_0xe4a17e(0x1e4);await this[_0xe4a17e(0x19e)](_0x45aca9),_0x45aca9=_0x45aca9+'/'+_0x1d569b,await this[_0xe4a17e(0x19e)](_0x45aca9),_0x45aca9+=_0xe4a17e(0x172),await this['createDir'](_0x45aca9),_0x45aca9+=_0xe4a17e(0x1e9),await this[_0xe4a17e(0x19e)](_0x45aca9),_0x45aca9=_0x45aca9+'/'+_0x32dd8e,await this[_0xe4a17e(0x19e)](_0x45aca9);}['getProjectRootPath'](){const _0x2c8da8=a0_0x573f8b;let _0x3d3094=process[_0x2c8da8(0x1b8)][_0x2c8da8(0x1d7)][_0x2c8da8(0x1df)]('/'),_0x32808b=[];for(let _0x468e23=0x0;_0x468e23<_0x3d3094[_0x2c8da8(0x1c2)]&&_0x2c8da8(0x1c7)!=_0x3d3094[_0x468e23];_0x468e23++)_0x32808b[_0x2c8da8(0x19c)](_0x3d3094[_0x468e23]);return _0x32808b[_0x2c8da8(0x1cc)]('/');}async[a0_0x573f8b(0x19e)](_0x48bc13){const _0x5dc2ea=a0_0x573f8b;0x0==await this['existsPath'](_0x48bc13)&&fs[_0x5dc2ea(0x1ac)](_0x48bc13);}async[a0_0x573f8b(0x175)](_0x18daef){const _0x2b7a5f=a0_0x573f8b;return await fs[_0x2b7a5f(0x1c8)](_0x18daef);}};tslib_1[a0_0x573f8b(0x17b)]([(0x0,type_graphql_1[a0_0x573f8b(0x1a2)])(_0x4ebc8b=>Boolean,{'description':a0_0x573f8b(0x1e1)}),tslib_1[a0_0x573f8b(0x1dd)](0x0,(0x0,type_graphql_1[a0_0x573f8b(0x17d)])('id')),tslib_1[a0_0x573f8b(0x1dd)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x573f8b(0x1ba)]('design:type',Function),tslib_1[a0_0x573f8b(0x1ba)](a0_0x573f8b(0x1b5),[String,Object]),tslib_1[a0_0x573f8b(0x1ba)](a0_0x573f8b(0x176),Promise)],OperatoToolCreateService[a0_0x573f8b(0x1ca)],a0_0x573f8b(0x189),null),OperatoToolCreateService=tslib_1[a0_0x573f8b(0x17b)]([(0x0,type_graphql_1[a0_0x573f8b(0x1e0)])()],OperatoToolCreateService),exports['OperatoToolCreateService']=OperatoToolCreateService;const allIndex=a0_0x573f8b(0x17c),serviceIndex='\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}}]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}Mutation]\x0a',serviceHistoryIndex='\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryQuery\x20}\x20from\x20\x27./{{name}}-history-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20}\x20from\x20\x27./event-subscriber\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}},\x20{{pascalCase\x20name}}History]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}HistoryQuery,\x20{{pascalCase\x20name}}Mutation]\x0aexport\x20const\x20subscribers\x20=\x20[{{pascalCase\x20name}}HistoryEntitySubscriber]\x0a\x0a',serviceQuery=a0_0x573f8b(0x1ec),serviceHistoryQuery=a0_0x573f8b(0x1d0),serviceMutation=a0_0x573f8b(0x164),sereviceType=a0_0x573f8b(0x1dc),sereviceHistoryType=a0_0x573f8b(0x1de),serviceEntity=a0_0x573f8b(0x1e7),serviceEntityHistCopy=a0_0x573f8b(0x169),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_0x573f8b(0x1a5);
|
|
1
|
+
'use strict';const a0_0x4e8664=a0_0x92d1;(function(_0x53f03f,_0x4a26d6){const _0x4d8541=a0_0x92d1,_0x12d29c=_0x53f03f();while(!![]){try{const _0x508caf=parseInt(_0x4d8541(0x1a9))/0x1*(parseInt(_0x4d8541(0x18d))/0x2)+parseInt(_0x4d8541(0x16e))/0x3*(-parseInt(_0x4d8541(0x161))/0x4)+parseInt(_0x4d8541(0x16c))/0x5+parseInt(_0x4d8541(0x1bb))/0x6+-parseInt(_0x4d8541(0x14d))/0x7+-parseInt(_0x4d8541(0x1b8))/0x8*(-parseInt(_0x4d8541(0x14b))/0x9)+-parseInt(_0x4d8541(0x191))/0xa;if(_0x508caf===_0x4a26d6)break;else _0x12d29c['push'](_0x12d29c['shift']());}catch(_0x3e2456){_0x12d29c['push'](_0x12d29c['shift']());}}}(a0_0x3f2e,0x2ad8c));Object[a0_0x4e8664(0x15c)](exports,'__esModule',{'value':!0x0}),exports[a0_0x4e8664(0x18f)]=void 0x0;function a0_0x3f2e(){const _0x4484ff=['createDir','2859530wwwHKX','createTypeText','createHistoryServiceFiles','PWD','pluralize','Entities,\x20resolvers\x20as\x20','{{camelCase\x20name}}.','double','pluralCamelCaseName','-type.ts','@things-factory/shell','__metadata','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','getProjectRootPath','uniqRank','Int','-query.ts','/service','EntitySubscribers,','number','colType','-history-query.ts','lodash','createHistoryEntityText','323096yGeMmS','-history\x27','creator','toolCreateService','-mutation.ts','float','design:returntype','__param','JSON','writeFile','indexOf','/event-subscriber.ts','updater_id','sort','colSize','472952zmAHYy','\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','\x20})','197454WMPjJT','.ts','design:type','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','date','\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','pluralPascalCaseName','bigint','Date','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','createEntityText','created_at','Resolvers,\x20subscribers\x20as\x20','split','Ctx','name','createServiceFiles','long','existsPath','state','/*\x20ENTITIES\x20*/\x0a\x09...','dataProp','Entities,','map','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryList\x20}\x20from\x20\x27./{{name}}-history-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}}History)\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryQuery\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}History,\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}History(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}History>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}History).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}HistoryList,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}Histories(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}HistoryList>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}}History)\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}History.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.creatorId})\x0a\x20\x20}\x0a}\x0a','nullable','Query','getFieldType','index.ts','18EJplSi','integer','1452808mEufdC','Float','string','filter','updated_at','export\x20*\x20from\x20\x27./','/server/service/','decimal','...','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','packages','COPY','-history.ts','__decorate','columnToEntityColumn','defineProperty','Resolvers,','getRepository','-history-type.ts','type\x20=>','16624oEGWqj','Arg','Operato\x20Tool\x20Create\x20Service','\x20{\x20nullable:\x20','\x27,\x20nullable:\x20','design:paramtypes','replace','utf8','@Field(','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','datetime','1638730YvoLTw','pascalCaseName','96RWngOh','import\x20{\x20entities\x20as\x20','domain','\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','snakeCaseName','tableName','\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','\x27,\x20type:\x20\x27','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','getColTxtType','findOne','length','camelCaseName','\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','\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','/index.ts','character\x20varying','/packages/','Resolvers\x20}\x20from\x20\x27./','find','includes','readFileSync','creator_id','join','Entity','\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','\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','\x0a\x20\x20','EntitySubscribers\x20}\x20from\x20\x27./','createServicePath','rank','2wwpAyi','domain_id','OperatoToolCreateService'];a0_0x3f2e=function(){return _0x4484ff;};return a0_0x3f2e();}const tslib_1=require('tslib'),type_graphql_1=require('type-graphql'),shell_1=require(a0_0x4e8664(0x19b)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x4e8664(0x1a7)),{plural:plural}=require(a0_0x4e8664(0x195)),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x4e8664(0x1ac)](_0x70bca7,_0x67e00b){const _0x3235da=a0_0x4e8664,{domain:_0x2f5420}=_0x67e00b[_0x3235da(0x141)],_0x1f164d=await(0x0,shell_1['getRepository'])(resource_base_1[_0x3235da(0x186)])[_0x3235da(0x178)]({'where':{'id':_0x70bca7}}),_0x12e3a5=await(0x0,shell_1[_0x3235da(0x15e)])(resource_base_1['EntityColumn'])[_0x3235da(0x181)]({'where':{'domain':{'id':_0x2f5420['id']},'entity':{'id':_0x1f164d['id']}}});let {name:_0x5c7821='',bundle:_0x1e87d1=''}=_0x1f164d||{},_0x582a48=this['getProjectRootPath'](),_0x53fc00=kebabCase(_0x5c7821);return await this[_0x3235da(0x18b)](_0x582a48,_0x1e87d1,_0x53fc00),await this[_0x3235da(0x13e)](_0x582a48,_0x1e87d1,_0x5c7821,_0x53fc00,_0x1f164d,_0x12e3a5),!0x0;}async[a0_0x4e8664(0x13e)](_0x82c1db,_0x5174df,_0x390eab,_0x5938f9,_0x4d07d1,_0x577b79){const _0xd6bfb0=a0_0x4e8664;let _0x305abd={'name':_0x5938f9,'tableName':_0x4d07d1[_0xd6bfb0(0x173)],'pascalCaseName':startCase(camelCase(_0x390eab))['replace'](/ /g,''),'camelCaseName':camelCase(_0x390eab),'snakeCaseName':snakeCase(_0x390eab),'pluralPascalCaseName':startCase(camelCase(plural(_0x390eab)))[_0xd6bfb0(0x167)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x390eab))},_0xe68ff9=_0x82c1db+_0xd6bfb0(0x17f)+_0x5174df+_0xd6bfb0(0x153);[_0xd6bfb0(0x1b1),_0xd6bfb0(0x158)][_0xd6bfb0(0x182)](_0x4d07d1[_0xd6bfb0(0x143)])?await this[_0xd6bfb0(0x193)](_0xe68ff9,_0x5938f9,_0x4d07d1,_0x577b79,_0x305abd):await this['createNoHistoryServiceFiels'](_0xe68ff9,_0x5938f9,_0x4d07d1,_0x577b79,_0x305abd);}async[a0_0x4e8664(0x193)](_0x1ee64b,_0x260a5b,_0x7d9f4c,_0x421ec3,_0x336855){const _0x1fafc5=a0_0x4e8664;await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+_0x1fafc5(0x17d)),serviceHistoryIndex,_0x336855);let _0x539107=this[_0x1fafc5(0x138)](_0x7d9f4c,_0x421ec3);await this['writeFile'](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+'.ts'),_0x539107,_0x336855),await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+_0x1fafc5(0x1a1)),serviceQuery,_0x336855),await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+_0x1fafc5(0x1ad)),serviceMutation,_0x336855);let _0x27441b=this['createTypeText'](_0x421ec3);await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+_0x1fafc5(0x19a)),_0x27441b,_0x336855);let _0x39c958=this[_0x1fafc5(0x1a8)](_0x7d9f4c,_0x421ec3);await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+_0x1fafc5(0x159)),_0x39c958,_0x336855);let _0x1b9a30='';_0x1fafc5(0x1b1)==_0x7d9f4c[_0x1fafc5(0x143)]?(_0x1b9a30=_0x1fafc5(0x188),await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+_0x1fafc5(0x1b4)),serviceEntitySubscriber,_0x336855)):_0x1b9a30='';let _0x292ccd=serviceEntitySubscriber[_0x1fafc5(0x167)](/{{entityToJson}}/g,_0x1b9a30);await this['writeFile'](_0x1ee64b+(_0x260a5b+_0x1fafc5(0x1b4)),_0x292ccd,_0x336855),await this[_0x1fafc5(0x1b2)](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+_0x1fafc5(0x1a6)),serviceHistoryQuery,_0x336855),await this['writeFile'](_0x1ee64b+(_0x260a5b+'/'+_0x260a5b+_0x1fafc5(0x15f)),sereviceHistoryType,_0x336855);let _0x3d631e=_0x1ee64b+_0x1fafc5(0x14a);0x0==await this['existsPath'](_0x3d631e)&&await this[_0x1fafc5(0x1b2)](_0x3d631e,allIndex,_0x336855);let _0x2ad311=await fs[_0x1fafc5(0x183)](_0x3d631e,_0x1fafc5(0x168));_0x2ad311['indexOf'](_0x1fafc5(0x152)+_0x336855[_0x1fafc5(0x13d)]+'/'+_0x336855[_0x1fafc5(0x13d)]+_0x1fafc5(0x1aa))<0x0&&(_0x2ad311=_0x2ad311[_0x1fafc5(0x167)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x336855[_0x1fafc5(0x13d)]+'/'+_0x336855[_0x1fafc5(0x13d)]+'-history\x27')),_0x2ad311[_0x1fafc5(0x1b3)](_0x1fafc5(0x152)+_0x336855[_0x1fafc5(0x13d)]+'/'+_0x336855[_0x1fafc5(0x13d)]+'\x27')<0x0&&(_0x2ad311=_0x2ad311[_0x1fafc5(0x167)](/\/\* EXPORT ENTITY TYPES \*\//,_0x1fafc5(0x16a)+_0x336855['name']+'/'+_0x336855['name']+'\x27')),_0x2ad311[_0x1fafc5(0x1b3)]('import\x20{\x20entities\x20as\x20'+_0x336855[_0x1fafc5(0x16d)]+'Entities,\x20resolvers\x20as\x20'+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x13a)+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x18a)+_0x336855[_0x1fafc5(0x13d)]+'\x27')<0x0&&(_0x2ad311=_0x2ad311['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1fafc5(0x156)+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x196)+_0x336855['pascalCaseName']+'Resolvers,\x20subscribers\x20as\x20'+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x18a)+_0x336855[_0x1fafc5(0x13d)]+'\x27')),_0x2ad311['indexOf']('...'+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x144))<0x0&&(_0x2ad311=_0x2ad311[_0x1fafc5(0x167)](/\/\* ENTITIES \*\//,_0x1fafc5(0x142)+_0x336855['pascalCaseName']+_0x1fafc5(0x144))),_0x2ad311[_0x1fafc5(0x1b3)](_0x1fafc5(0x155)+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x15d))<0x0&&(_0x2ad311=_0x2ad311[_0x1fafc5(0x167)](/\/\* RESOLVER CLASSES \*\//,_0x1fafc5(0x137)+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x15d))),_0x2ad311['indexOf'](_0x1fafc5(0x155)+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x1a3))<0x0&&(_0x2ad311=_0x2ad311[_0x1fafc5(0x167)](/\/\* SUBSCRIBERS \*\//,_0x1fafc5(0x19d)+_0x336855[_0x1fafc5(0x16d)]+_0x1fafc5(0x1a3))),await this[_0x1fafc5(0x1b2)](_0x3d631e,_0x2ad311,_0x336855);}async['createNoHistoryServiceFiels'](_0x1f67fc,_0x21b491,_0x14113b,_0x1efe0a,_0x12e406){const _0x56eff3=a0_0x4e8664;await this['writeFile'](_0x1f67fc+(_0x21b491+'/index.ts'),serviceIndex,_0x12e406),await this[_0x56eff3(0x1b2)](_0x1f67fc+(_0x21b491+'/'+_0x21b491+_0x56eff3(0x1a1)),serviceQuery,_0x12e406),await this['writeFile'](_0x1f67fc+(_0x21b491+'/'+_0x21b491+_0x56eff3(0x1ad)),serviceMutation,_0x12e406);let _0x7e5605=this['createEntityText'](_0x14113b,_0x1efe0a);await this[_0x56eff3(0x1b2)](_0x1f67fc+(_0x21b491+'/'+_0x21b491+_0x56eff3(0x1bc)),_0x7e5605,_0x12e406);let _0x3718c6=this[_0x56eff3(0x192)](_0x1efe0a);await this['writeFile'](_0x1f67fc+(_0x21b491+'/'+_0x21b491+_0x56eff3(0x19a)),_0x3718c6,_0x12e406);let _0x4f1583=_0x1f67fc+_0x56eff3(0x14a);0x0==await this[_0x56eff3(0x140)](_0x4f1583)&&await this[_0x56eff3(0x1b2)](_0x4f1583,allIndex,_0x12e406);let _0x2f0290=await fs[_0x56eff3(0x183)](_0x4f1583,_0x56eff3(0x168));_0x2f0290[_0x56eff3(0x1b3)](_0x56eff3(0x152)+_0x12e406[_0x56eff3(0x13d)]+'/'+_0x12e406[_0x56eff3(0x13d)]+'\x27')<0x0&&(_0x2f0290=_0x2f0290[_0x56eff3(0x167)](/\/\* EXPORT ENTITY TYPES \*\//,_0x56eff3(0x16a)+_0x12e406[_0x56eff3(0x13d)]+'/'+_0x12e406[_0x56eff3(0x13d)]+'\x27')),_0x2f0290[_0x56eff3(0x1b3)](_0x56eff3(0x16f)+_0x12e406[_0x56eff3(0x16d)]+_0x56eff3(0x196)+_0x12e406['pascalCaseName']+_0x56eff3(0x180)+_0x12e406['name']+'\x27')<0x0&&(_0x2f0290=_0x2f0290[_0x56eff3(0x167)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x56eff3(0x156)+_0x12e406[_0x56eff3(0x16d)]+'Entities,\x20resolvers\x20as\x20'+_0x12e406['pascalCaseName']+_0x56eff3(0x180)+_0x12e406[_0x56eff3(0x13d)]+'\x27')),_0x2f0290[_0x56eff3(0x1b3)](_0x56eff3(0x155)+_0x12e406[_0x56eff3(0x16d)]+_0x56eff3(0x144))<0x0&&(_0x2f0290=_0x2f0290[_0x56eff3(0x167)](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x12e406[_0x56eff3(0x16d)]+_0x56eff3(0x144))),_0x2f0290[_0x56eff3(0x1b3)](_0x56eff3(0x155)+_0x12e406[_0x56eff3(0x16d)]+_0x56eff3(0x15d))<0x0&&(_0x2f0290=_0x2f0290['replace'](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x12e406[_0x56eff3(0x16d)]+'Resolvers,')),await this[_0x56eff3(0x1b2)](_0x4f1583,_0x2f0290,_0x12e406);}[a0_0x4e8664(0x192)](_0x369286){const _0x4eb829=a0_0x4e8664;let _0x194b25=sereviceType,_0x23c326=_0x369286[_0x4eb829(0x145)](_0x1142a9=>{const _0xe3167=_0x4eb829;if('id'==_0x1142a9[_0xe3167(0x13d)])return'';if(_0xe3167(0x18e)==_0x1142a9[_0xe3167(0x13d)])return'';if(_0xe3167(0x139)==_0x1142a9[_0xe3167(0x13d)])return'';if(_0xe3167(0x151)==_0x1142a9['name'])return'';if(_0xe3167(0x184)==_0x1142a9[_0xe3167(0x13d)])return'';if(_0xe3167(0x1b5)==_0x1142a9[_0xe3167(0x13d)])return'';let _0x13967c=this[_0xe3167(0x149)](_0x1142a9),_0x5d6448=this[_0xe3167(0x177)](_0x1142a9),_0x393ad1=camelCase(_0x1142a9[_0xe3167(0x13d)]);return'\x20\x20'+('@Field('+(0x0==_0x13967c['length']?'':_0xe3167(0x160)+_0x13967c+',')+_0xe3167(0x164)+_0x1142a9['nullable']+_0xe3167(0x1ba))+_0xe3167(0x189)+(''+_0x393ad1+(_0x1142a9[_0xe3167(0x147)]?'?':'')+':\x20'+_0x5d6448)+'\x0a';});_0x194b25=_0x194b25[_0x4eb829(0x167)](/{{newTypeColumns}}/g,_0x23c326['join']('\x0a'));let _0x15adf6=_0x369286[_0x4eb829(0x145)](_0x57cad0=>{const _0x38327b=_0x4eb829;if('id'==_0x57cad0[_0x38327b(0x13d)])return'';if(_0x38327b(0x18e)==_0x57cad0[_0x38327b(0x13d)])return'';if(_0x38327b(0x139)==_0x57cad0['name'])return'';if(_0x38327b(0x151)==_0x57cad0[_0x38327b(0x13d)])return'';if(_0x38327b(0x184)==_0x57cad0[_0x38327b(0x13d)])return'';if(_0x38327b(0x1b5)==_0x57cad0[_0x38327b(0x13d)])return'';let _0x5f2a34=this[_0x38327b(0x149)](_0x57cad0),_0x46277c=this[_0x38327b(0x177)](_0x57cad0);_0x57cad0[_0x38327b(0x147)]=!0x0;let _0x3c9638=camelCase(_0x57cad0['name']);return'\x20\x20'+(_0x38327b(0x169)+(0x0==_0x5f2a34['length']?'':_0x38327b(0x160)+_0x5f2a34+',')+_0x38327b(0x164)+_0x57cad0[_0x38327b(0x147)]+_0x38327b(0x1ba))+_0x38327b(0x189)+(''+_0x3c9638+(_0x57cad0[_0x38327b(0x147)]?'?':'')+':\x20'+_0x46277c)+'\x0a';});return _0x194b25=_0x194b25[_0x4eb829(0x167)](/{{patchTypeColumns}}/g,_0x15adf6[_0x4eb829(0x185)]('\x0a')),_0x194b25;}[a0_0x4e8664(0x138)](_0x42b857,_0x18e9a8){const _0x54af62=a0_0x4e8664;let _0x2eaad8=serviceEntity,_0x4d1e3a=_0x18e9a8['sort'](function(_0x554984,_0x5ba556){const _0x317b57=a0_0x92d1;return _0x554984['rank']-_0x5ba556[_0x317b57(0x18c)];})[_0x54af62(0x145)](_0x493596=>this['columnToEntityColumn'](_0x493596));[_0x54af62(0x158),_0x54af62(0x1b1)][_0x54af62(0x182)](_0x42b857['dataProp'])&&_0x4d1e3a['push'](_0x54af62(0x1be)),_0x2eaad8=_0x2eaad8['replace'](/{{entityColumns}}/g,_0x4d1e3a[_0x54af62(0x185)]('\x0a'));let _0x392bdd='',_0x14f0c3=_0x18e9a8[_0x54af62(0x150)](_0x2fb279=>_0x2fb279['uniqRank']&&_0x2fb279[_0x54af62(0x19f)]>0x0)[_0x54af62(0x1b6)](function(_0x108a62,_0x3a6c1b){const _0x3e9217=_0x54af62;return _0x108a62[_0x3e9217(0x19f)]-_0x3a6c1b[_0x3e9217(0x19f)];});if(_0x14f0c3['length']>0x0){_0x392bdd=_0x54af62(0x176);let _0x288bfa=_0x14f0c3['map'](_0x2fce99=>{const _0x38207f=_0x54af62;let _0x481a84=_0x2fce99[_0x38207f(0x13d)];return _0x38207f(0x18e)==_0x2fce99[_0x38207f(0x13d)]&&(_0x481a84=_0x38207f(0x170)),_0x38207f(0x184)==_0x2fce99['name']&&(_0x481a84=_0x38207f(0x1ab)),_0x38207f(0x1b5)==_0x2fce99[_0x38207f(0x13d)]&&(_0x481a84='updater'),_0x38207f(0x197)+camelCase(_0x481a84);});_0x392bdd=_0x392bdd[_0x54af62(0x167)](/{{indexColumns}}/g,_0x288bfa['join'](','));}return _0x2eaad8=_0x2eaad8[_0x54af62(0x167)](/{{indexAnn}}/g,_0x392bdd),_0x2eaad8;}[a0_0x4e8664(0x1a8)](_0x28d371,_0x14c704){const _0x1c1af2=a0_0x4e8664;let _0x4c5087='JSON'==_0x28d371[_0x1c1af2(0x143)]?serviceEntityHistJson:serviceEntityHistCopy,_0x4e2559=_0x14c704[_0x1c1af2(0x1b6)](function(_0x8bfe6b,_0x39ff21){const _0x1062e0=_0x1c1af2;return _0x8bfe6b[_0x1062e0(0x18c)]-_0x39ff21[_0x1062e0(0x18c)];})[_0x1c1af2(0x145)](_0x3d395b=>this['columnToEntityColumn'](_0x3d395b));return _0x4c5087=_0x4c5087[_0x1c1af2(0x167)](/{{entityColumns}}/g,_0x4e2559['join']('\x0a')),_0x4c5087;}[a0_0x4e8664(0x15b)](_0x2f4909){const _0x499c68=a0_0x4e8664;if('id'==_0x2f4909[_0x499c68(0x13d)])return'';if('domain_id'==_0x2f4909['name'])return'';if(_0x499c68(0x139)==_0x2f4909['name'])return'';if(_0x499c68(0x151)==_0x2f4909[_0x499c68(0x13d)])return'';if(_0x499c68(0x184)==_0x2f4909[_0x499c68(0x13d)])return'';if('updater_id'==_0x2f4909[_0x499c68(0x13d)])return'';let _0x1e42fd=_0x2f4909[_0x499c68(0x1a5)];_0x499c68(0x198)==_0x2f4909[_0x499c68(0x1a5)]&&(_0x1e42fd='double\x20precision'),_0x499c68(0x13f)==_0x2f4909['colType']&&(_0x1e42fd=_0x499c68(0x135)),'string'==_0x2f4909['colType']&&(_0x1e42fd=_0x499c68(0x17e)),_0x499c68(0x16b)==_0x2f4909[_0x499c68(0x1a5)]&&(_0x1e42fd='timestamp\x20without\x20time\x20zone');let _0x3caae0='';_0x499c68(0x14f)==_0x2f4909[_0x499c68(0x1a5)]&&(_0x3caae0=_0x2f4909[_0x499c68(0x1b7)]);let _0x2f87a0=this[_0x499c68(0x149)](_0x2f4909),_0xd05e93=this[_0x499c68(0x177)](_0x2f4909),_0x40054b=camelCase(_0x2f4909['name']);return'\x20\x20'+('@Column({name:\x27'+_0x2f4909['name']+_0x499c68(0x175)+_0x1e42fd+_0x499c68(0x165)+_0x2f4909[_0x499c68(0x147)]+'\x20'+(0x0==_0x3caae0[_0x499c68(0x179)]?'':',length:'+_0x3caae0)+_0x499c68(0x1ba))+_0x499c68(0x189)+(_0x499c68(0x169)+(0x0==_0x2f87a0['length']?'':'type\x20=>'+_0x2f87a0+',')+_0x499c68(0x164)+_0x2f4909['nullable']+'\x20})')+_0x499c68(0x189)+(''+_0x40054b+(_0x2f4909[_0x499c68(0x147)]?'?':'')+':\x20'+_0xd05e93)+'\x0a';}[a0_0x4e8664(0x149)](_0xdb51c2){const _0x2b18a8=a0_0x4e8664;let _0x46a6f3='';return'double'==_0xdb51c2[_0x2b18a8(0x1a5)]&&(_0x46a6f3=_0x2b18a8(0x14e)),_0x2b18a8(0x1ae)==_0xdb51c2['colType']&&(_0x46a6f3=_0x2b18a8(0x14e)),_0x2b18a8(0x13f)==_0xdb51c2[_0x2b18a8(0x1a5)]&&(_0x46a6f3=_0x2b18a8(0x1a0)),_0x2b18a8(0x14c)==_0xdb51c2['colType']&&(_0x46a6f3=_0x2b18a8(0x1a0)),_0x46a6f3;}['getColTxtType'](_0xe3f4c2){const _0x87ea0d=a0_0x4e8664;let _0x52986f=_0xe3f4c2[_0x87ea0d(0x1a5)];return _0x87ea0d(0x154)==_0xe3f4c2[_0x87ea0d(0x1a5)]&&(_0x52986f=_0x87ea0d(0x1a4)),_0x87ea0d(0x198)==_0xe3f4c2[_0x87ea0d(0x1a5)]&&(_0x52986f='number'),'float'==_0xe3f4c2[_0x87ea0d(0x1a5)]&&(_0x52986f='number'),_0x87ea0d(0x14c)==_0xe3f4c2['colType']&&(_0x52986f='number'),'long'==_0xe3f4c2['colType']&&(_0x52986f=_0x87ea0d(0x1a4)),_0x87ea0d(0x16b)==_0xe3f4c2[_0x87ea0d(0x1a5)]&&(_0x52986f=_0x87ea0d(0x136)),_0x87ea0d(0x1bf)==_0xe3f4c2[_0x87ea0d(0x1a5)]&&(_0x52986f='Date'),'text'==_0xe3f4c2['colType']&&(_0x52986f='string'),_0x52986f;}async['writeFile'](_0x9d4611,_0x332a5e,_0x377b50){await fs['writeFileSync'](_0x9d4611,this['replaceNamesMap'](_0x332a5e,_0x377b50),'utf8');}['replaceNamesMap'](_0x14cf69,_0x1d1a35){const _0x4f5622=a0_0x4e8664;return _0x14cf69['replace'](/{{pascalCase name}}/g,_0x1d1a35[_0x4f5622(0x16d)])[_0x4f5622(0x167)](/{{camelCase name}}/g,_0x1d1a35[_0x4f5622(0x17a)])[_0x4f5622(0x167)](/{{snakeCase name}}/g,_0x1d1a35[_0x4f5622(0x172)])['replace'](/{{pluralPascalCase name}}/g,_0x1d1a35[_0x4f5622(0x134)])[_0x4f5622(0x167)](/{{pluralCamelCase name}}/g,_0x1d1a35[_0x4f5622(0x199)])[_0x4f5622(0x167)](/{{tableName}}/g,_0x1d1a35[_0x4f5622(0x173)])[_0x4f5622(0x167)](/{{name}}/g,_0x1d1a35[_0x4f5622(0x13d)]);}async['createServicePath'](_0xf11f12,_0x5423b2,_0xd74dad){const _0x400111=a0_0x4e8664;let _0x10d31d=_0xf11f12+'/packages';await this['createDir'](_0x10d31d),_0x10d31d=_0x10d31d+'/'+_0x5423b2,await this['createDir'](_0x10d31d),_0x10d31d+='/server',await this[_0x400111(0x190)](_0x10d31d),_0x10d31d+=_0x400111(0x1a2),await this[_0x400111(0x190)](_0x10d31d),_0x10d31d=_0x10d31d+'/'+_0xd74dad,await this[_0x400111(0x190)](_0x10d31d);}[a0_0x4e8664(0x19e)](){const _0xc829b2=a0_0x4e8664;let _0xcf4cb3=process['env'][_0xc829b2(0x194)][_0xc829b2(0x13b)]('/'),_0xce931=[];for(let _0x29211b=0x0;_0x29211b<_0xcf4cb3['length']&&_0xc829b2(0x157)!=_0xcf4cb3[_0x29211b];_0x29211b++)_0xce931['push'](_0xcf4cb3[_0x29211b]);return _0xce931[_0xc829b2(0x185)]('/');}async[a0_0x4e8664(0x190)](_0xc9447a){0x0==await this['existsPath'](_0xc9447a)&&fs['mkdirSync'](_0xc9447a);}async[a0_0x4e8664(0x140)](_0x4dc66c){return await fs['existsSync'](_0x4dc66c);}};function a0_0x92d1(_0x39906e,_0x4e3d0e){const _0x3f2e90=a0_0x3f2e();return a0_0x92d1=function(_0x92d1a,_0x3f33ce){_0x92d1a=_0x92d1a-0x133;let _0x10a6b0=_0x3f2e90[_0x92d1a];return _0x10a6b0;},a0_0x92d1(_0x39906e,_0x4e3d0e);}tslib_1[a0_0x4e8664(0x15a)]([(0x0,type_graphql_1[a0_0x4e8664(0x148)])(_0x5808a9=>Boolean,{'description':a0_0x4e8664(0x163)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x4e8664(0x162)])('id')),tslib_1[a0_0x4e8664(0x1b0)](0x1,(0x0,type_graphql_1[a0_0x4e8664(0x13c)])()),tslib_1[a0_0x4e8664(0x19c)](a0_0x4e8664(0x1bd),Function),tslib_1['__metadata'](a0_0x4e8664(0x166),[String,Object]),tslib_1['__metadata'](a0_0x4e8664(0x1af),Promise)],OperatoToolCreateService['prototype'],'toolCreateService',null),OperatoToolCreateService=tslib_1[a0_0x4e8664(0x15a)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateService),exports['OperatoToolCreateService']=OperatoToolCreateService;const allIndex=a0_0x4e8664(0x174),serviceIndex=a0_0x4e8664(0x1b9),serviceHistoryIndex=a0_0x4e8664(0x187),serviceQuery='\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}List\x20}\x20from\x20\x27./{{name}}-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Query\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}List,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{pluralCamelCase\x20name}}(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}List>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20convertedParams\x20=\x20convertListParams(params,\x20domain.id)\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.creatorId})\x0a\x20\x20}\x0a}\x0a',serviceHistoryQuery=a0_0x4e8664(0x146),serviceMutation='\x0aimport\x20{\x20Resolver,\x20Mutation,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20In\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20New{{pascalCase\x20name}},\x20{{pascalCase\x20name}}Patch\x20}\x20from\x20\x27./{{name}}-type\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Mutation\x20{\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20create\x20new\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20create{{pascalCase\x20name}}(@Arg(\x27{{camelCase\x20name}}\x27)\x20{{camelCase\x20name}}:\x20New{{pascalCase\x20name}},\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20return\x20await\x20tx.getRepository({{pascalCase\x20name}}).save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20modify\x20{{pascalCase\x20name}}\x20information\x27\x20})\x0a\x20\x20async\x20update{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27id\x27)\x20id:\x20string,\x0a\x20\x20\x20\x20@Arg(\x27patch\x27)\x20patch:\x20{{pascalCase\x20name}}Patch,\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20repository\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20repository.findOne(\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20)\x0a\x0a\x20\x20\x20\x20return\x20await\x20repository.save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20...patch,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20[{{pascalCase\x20name}}],\x20{\x20description:\x20\x22To\x20modify\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20information\x22\x20})\x0a\x20\x20async\x20updateMultiple{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27patches\x27,\x20type\x20=>\x20[{{pascalCase\x20name}}Patch])\x20patches:\x20{{pascalCase\x20name}}Patch[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}[]>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20results\x20=\x20[]\x0a\x20\x20\x20\x20const\x20_createRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27+\x27)\x0a\x20\x20\x20\x20const\x20_updateRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27M\x27)\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}Repo\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x0a\x20\x20\x20\x20if\x20(_createRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_createRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20newRecord\x20=\x20_createRecords[i]\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...newRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27+\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20if\x20(_updateRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_updateRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20updRecord\x20=\x20_updateRecords[i]\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20{{camelCase\x20name}}Repo.findOne({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id:updRecord.id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...updRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27M\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20results\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20delete{{pascalCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove({\x20domain,\x20id,\x20updater:user\x20})\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20multiple\x20{{camelCase\x20name}}s\x27\x20})\x0a\x20\x20async\x20delete{{pluralPascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27ids\x27,\x20type\x20=>\x20[String])\x20ids:\x20string[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20delEntitis\x20=\x20ids.map(id=>{\x0a\x20\x20\x20\x20\x20\x20return\x20{domain,id,updater:user}\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove(delEntitis)\x0a\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a}\x0a',sereviceType='\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@InputType()\x0aexport\x20class\x20New{{pascalCase\x20name}}\x20{\x0a{{newTypeColumns}}\x0a}\x0a\x0a@InputType()\x0aexport\x20class\x20{{pascalCase\x20name}}Patch\x20{\x0a\x20\x20@Field(type\x20=>\x20ID,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20id?:\x20string\x0a\x0a{{patchTypeColumns}}\x0a\x0a\x20\x20@Field()\x0a\x20\x20cuFlag:\x20string\x0a}\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}List\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}])\x0a\x20\x20items:\x20{{pascalCase\x20name}}[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a',sereviceHistoryType=a0_0x4e8664(0x17c),serviceEntity=a0_0x4e8664(0x17b),serviceEntityHistCopy='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\x0a\x20\x20@HistoryActionColumn({\x0a\x20\x20\x20\x20nullable:\x20false,\x0a\x20\x20\x20\x20type:\x0a\x20\x20\x20\x20\x20\x20DATABASE_TYPE\x20==\x20\x27postgres\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mysql\x27\x20||\x20DATABASE_TYPE\x20==\x20\x27mariadb\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27enum\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20DATABASE_TYPE\x20==\x20\x27oracle\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20?\x20\x27varchar2\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20:\x20\x27smallint\x27,\x0a\x20\x20\x20\x20enum:\x20HistoryActionType\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20dataRevisionAction!:\x20HistoryActionType\x0a\x0a\x20\x20@Column({\x20default:\x201,\x20nullable:\x20false\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntityHistJson=a0_0x4e8664(0x133),serviceEntitySubscriber=a0_0x4e8664(0x171);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x2af3(_0x205d23,_0x1ef767){const _0xad95d=a0_0xad95();return a0_0x2af3=function(_0x2af30c,_0x3b247e){_0x2af30c=_0x2af30c-0xad;let _0x468d7c=_0xad95d[_0x2af30c];return _0x468d7c;},a0_0x2af3(_0x205d23,_0x1ef767);}const a0_0x31ec31=a0_0x2af3;(function(_0x19c080,_0x3e005f){const _0x38a2b5=a0_0x2af3,_0xb68ae4=_0x19c080();while(!![]){try{const _0x410e9e=parseInt(_0x38a2b5(0xb1))/0x1*(parseInt(_0x38a2b5(0xc8))/0x2)+parseInt(_0x38a2b5(0xcb))/0x3+-parseInt(_0x38a2b5(0xb3))/0x4+-parseInt(_0x38a2b5(0xca))/0x5+-parseInt(_0x38a2b5(0xb0))/0x6+parseInt(_0x38a2b5(0xce))/0x7+-parseInt(_0x38a2b5(0xbf))/0x8;if(_0x410e9e===_0x3e005f)break;else _0xb68ae4['push'](_0xb68ae4['shift']());}catch(_0x5522b2){_0xb68ae4['push'](_0xb68ae4['shift']());}}}(a0_0xad95,0x6b66b));function a0_0xad95(){const _0x1525d5=['from','Permissions\x20For\x20Tailor\x20Tool','trim','OVER_LIMIT','andWhere','ERROR_CODES','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','698mfyhIY','checkTarget','261210lJGaFm','683181VelwLC','id\x20!=\x20:id','LicenseError','5826338vnExdC','map','createQueryBuilder','manager','1535994xiKPvX','1948DGFQcA','where','2590516rqAcup','checkStudioPermission','getRepository','menu','Studio','__esModule','@things-factory/menu-base','checkStudioTemplateIsOverLimit','@things-factory/operato-license-checker','select','Menu','getCount','2753024ywuiBc','getPermission'];a0_0xad95=function(){return _0x1525d5;};return a0_0xad95();}Object['defineProperty'](exports,a0_0x31ec31(0xb8),{'value':!0x0}),exports[a0_0x31ec31(0xba)]=exports[a0_0x31ec31(0xb4)]=void 0x0;const operato_license_checker_1=require(a0_0x31ec31(0xbb)),shell_1=require('@things-factory/shell'),menu_base_1=require(a0_0x31ec31(0xb9)),license_error_1=require('../../errors/license-error');async function checkStudioPermission(){const _0x2873d1=a0_0x31ec31;let _0x1a2165=((0x0,operato_license_checker_1[_0x2873d1(0xc0)])(_0x2873d1(0xc2))||',')['split'](',')[_0x2873d1(0xad)](_0x43c527=>_0x43c527[_0x2873d1(0xc3)]()),_0x18743d=!0x1;return _0x1a2165['forEach'](_0x11a219=>{const _0x4fc7d8=_0x2873d1;_0x11a219['includes'](_0x4fc7d8(0xb7))&&(_0x18743d=!0x0);}),_0x18743d;}async function checkStudioTemplateIsOverLimit(_0x488b82,_0x161f71){const _0xb6f41c=a0_0x31ec31;if(0x0==await checkStudioPermission())throw new license_error_1['LicenseError']({'errorCode':_0x161f71['t'](license_error_1['LicenseError'][_0xb6f41c(0xc6)]['INVALID_LICENSE'])});var _0xca3941=0x0;if(_0xca3941=_0x488b82&&''!=_0x488b82?await(0x0,shell_1['getRepository'])(menu_base_1[_0xb6f41c(0xbd)])[_0xb6f41c(0xaf)][_0xb6f41c(0xae)]()[_0xb6f41c(0xbc)](_0xb6f41c(0xb6))[_0xb6f41c(0xc1)](menu_base_1['Menu'],_0xb6f41c(0xb6))[_0xb6f41c(0xb2)](_0xb6f41c(0xcc),{'id':_0x488b82})[_0xb6f41c(0xc5)](_0xb6f41c(0xc7))[_0xb6f41c(0xbe)]()+0x1:await(0x0,shell_1[_0xb6f41c(0xb5)])(menu_base_1['Menu'])['manager'][_0xb6f41c(0xae)]()[_0xb6f41c(0xbc)](_0xb6f41c(0xb6))[_0xb6f41c(0xc1)](menu_base_1[_0xb6f41c(0xbd)],_0xb6f41c(0xb6))[_0xb6f41c(0xb2)]('(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)')[_0xb6f41c(0xbe)]()+0x1,!(0x0,operato_license_checker_1[_0xb6f41c(0xc9)])(_0xca3941))throw new license_error_1['LicenseError']({'errorCode':_0x161f71['t'](license_error_1[_0xb6f41c(0xcd)][_0xb6f41c(0xc6)][_0xb6f41c(0xc4)])});return!0x0;}exports[a0_0x31ec31(0xb4)]=checkStudioPermission,exports[a0_0x31ec31(0xba)]=checkStudioTemplateIsOverLimit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x5947(){const _0x32273e=['16CTOYpn','design:paramtypes','4133987NCkMOY','__param','design:returntype','1145LnYlEw','3riQRAj','1028043WTXVXx','tslib','774nQvOzp','__decorate','Operato\x20Tool\x20Studio\x20Limit\x20check','__esModule','studioTemplateIsOverLimit','studioPermission','182161ZRajbY','OperatoToolResolver','191940vsJrsd','./tool-permission','prototype','__metadata','314766mFCqtz','Ctx','type-graphql','design:type','Resolver','3IFPMMN','2840380oExipS','Arg','Operato\x20Tool\x20Studio\x20Usage\x20Permissions','Query'];a0_0x5947=function(){return _0x32273e;};return a0_0x5947();}const a0_0x53df17=a0_0x48a9;(function(_0x42726d,_0x25e77d){const _0x17a030=a0_0x48a9,_0x130716=_0x42726d();while(!![]){try{const _0xb6759c=parseInt(_0x17a030(0x11b))/0x1*(-parseInt(_0x17a030(0x10b))/0x2)+parseInt(_0x17a030(0x110))/0x3*(-parseInt(_0x17a030(0x107))/0x4)+-parseInt(_0x17a030(0x11a))/0x5*(-parseInt(_0x17a030(0x11e))/0x6)+parseInt(_0x17a030(0x105))/0x7+parseInt(_0x17a030(0x115))/0x8*(parseInt(_0x17a030(0x11c))/0x9)+parseInt(_0x17a030(0x111))/0xa+parseInt(_0x17a030(0x117))/0xb;if(_0xb6759c===_0x25e77d)break;else _0x130716['push'](_0x130716['shift']());}catch(_0x2760fb){_0x130716['push'](_0x130716['shift']());}}}(a0_0x5947,0x6773b));Object['defineProperty'](exports,a0_0x53df17(0x121),{'value':!0x0}),exports[a0_0x53df17(0x106)]=void 0x0;const tslib_1=require(a0_0x53df17(0x11d)),type_graphql_1=require(a0_0x53df17(0x10d)),tool_permission_1=require(a0_0x53df17(0x108));function a0_0x48a9(_0x1f6dad,_0x9c2f83){const _0x594774=a0_0x5947();return a0_0x48a9=function(_0x48a9d7,_0x40c9b2){_0x48a9d7=_0x48a9d7-0x105;let _0x48d0f2=_0x594774[_0x48a9d7];return _0x48d0f2;},a0_0x48a9(_0x1f6dad,_0x9c2f83);}let OperatoToolResolver=class{async[a0_0x53df17(0x123)](_0x4d234e){return(0x0,tool_permission_1['checkStudioPermission'])();}async[a0_0x53df17(0x122)](_0x1469c6,_0x44450f){return(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])(_0x1469c6,_0x44450f);}};tslib_1[a0_0x53df17(0x11f)]([(0x0,type_graphql_1[a0_0x53df17(0x114)])(_0x261717=>Boolean,{'description':a0_0x53df17(0x113)}),tslib_1[a0_0x53df17(0x118)](0x0,(0x0,type_graphql_1[a0_0x53df17(0x10c)])()),tslib_1[a0_0x53df17(0x10a)](a0_0x53df17(0x10e),Function),tslib_1[a0_0x53df17(0x10a)](a0_0x53df17(0x116),[Object]),tslib_1['__metadata'](a0_0x53df17(0x119),Promise)],OperatoToolResolver[a0_0x53df17(0x109)],a0_0x53df17(0x123),null),tslib_1[a0_0x53df17(0x11f)]([(0x0,type_graphql_1[a0_0x53df17(0x114)])(_0x4c1b26=>Boolean,{'description':a0_0x53df17(0x120)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x53df17(0x112)])('id')),tslib_1[a0_0x53df17(0x118)](0x1,(0x0,type_graphql_1[a0_0x53df17(0x10c)])()),tslib_1['__metadata']('design:type',Function),tslib_1[a0_0x53df17(0x10a)]('design:paramtypes',[String,Object]),tslib_1['__metadata'](a0_0x53df17(0x119),Promise)],OperatoToolResolver[a0_0x53df17(0x109)],'studioTemplateIsOverLimit',null),OperatoToolResolver=tslib_1[a0_0x53df17(0x11f)]([(0x0,type_graphql_1[a0_0x53df17(0x10f)])()],OperatoToolResolver),exports[a0_0x53df17(0x106)]=OperatoToolResolver;
|