@things-factory/operato-tools 6.1.41 → 6.1.42
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 +22 -22
- package/client/pages/generator/grid-config-tab-mixin.js +22 -22
- package/client/pages/generator/grid-emphasized-config-tab-mixin.js +8 -8
- package/client/pages/generator/menu-config-tab-mixin.js +12 -12
- package/client/pages/generator/meta-generator-page.js +11 -11
- package/client/pages/generator/search-config-tab-mixin.js +4 -4
- package/client/pages/generator/tab-config-tab-mixin.js +4 -4
- package/client/pages/main.js +4 -4
- package/client/reducers/main.js +1 -1
- package/package.json +3 -3
- package/server/constants/error-code.js +1 -1
- package/server/errors/license-error.js +1 -1
- package/server/routes.js +1 -1
- package/server/service/tool-entity/create-menu.js +1 -1
- package/server/service/tool-entity/create-service.js +1 -1
- package/server/service/tool-secret/tool-permission.js +1 -1
- package/server/service/tool-secret/tool-resolver.js +1 -1
package/client/pages/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a0_0x4c4046=a0_0x1f83;(function(_0x5cb833,_0x4d80d9){var _0xc70087=a0_0x1f83,_0x59f475=_0x5cb833();while(!![]){try{var _0x43a0ad=-parseInt(_0xc70087(0x76))/0x1*(-parseInt(_0xc70087(0x81))/0x2)+parseInt(_0xc70087(0x7c))/0x3+parseInt(_0xc70087(0x82))/0x4+-parseInt(_0xc70087(0x77))/0x5*(-parseInt(_0xc70087(0x7e))/0x6)+-parseInt(_0xc70087(0x84))/0x7+parseInt(_0xc70087(0x79))/0x8*(-parseInt(_0xc70087(0x7d))/0x9)+-parseInt(_0xc70087(0x78))/0xa;if(_0x43a0ad===_0x4d80d9)break;else _0x59f475['push'](_0x59f475['shift']());}catch(_0x472d18){_0x59f475['push'](_0x59f475['shift']());}}}(a0_0x3190,0x52a84));import{html,css}from'lit-element';import{connect}from'pwa-helpers/connect-mixin.js';function a0_0x1f83(_0x3fe70a,_0x5e7a06){var _0x319035=a0_0x3190();return a0_0x1f83=function(_0x1f8383,_0xd3fd80){_0x1f8383=_0x1f8383-0x76;var _0x7df22b=_0x319035[_0x1f8383];return _0x7df22b;},a0_0x1f83(_0x3fe70a,_0x5e7a06);}import{store,PageView}from'@things-factory/shell';import{TermsUtil}from'@things-factory/meta-ui';class OperatoToolsMain extends connect(store)(PageView){static get[a0_0x4c4046(0x83)](){return[css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
background-color: var(--main-section-background-color);
|
|
@@ -41,11 +41,11 @@ var a0_0x640029=a0_0x15f2;(function(_0x31d39a,_0x1ff870){var _0x546476=a0_0x15f2
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`];}get[
|
|
44
|
+
`];}get[a0_0x4c4046(0x7a)](){return{'title':'Operato\x20Tools','actions':[]};}[a0_0x4c4046(0x7b)](){var _0x1c160d=a0_0x4c4046;return html`
|
|
45
45
|
<h2>Operato Tools</h2>
|
|
46
46
|
<p page-description>
|
|
47
|
-
${TermsUtil[
|
|
47
|
+
${TermsUtil[_0x1c160d(0x86)](_0x1c160d(0x80))}
|
|
48
48
|
</p>
|
|
49
49
|
|
|
50
50
|
<img src="/assets/images/operato-tools.png" />
|
|
51
|
-
`;}}
|
|
51
|
+
`;}}function a0_0x3190(){var _0x59ed82=['tool\x20start\x20msg','2618olLAIO','1773096HfYfsl','styles','3319624itAlbt','define','tText','358MbbfCx','5EKcJBY','8379930hjvruW','31256pUyThG','context','render','1096137lswiCk','639dneUPT','3905466BjgrbN','customElements'];a0_0x3190=function(){return _0x59ed82;};return a0_0x3190();}window[a0_0x4c4046(0x7f)][a0_0x4c4046(0x85)]('operato-tools-main',OperatoToolsMain);
|
package/client/reducers/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x29c1b1=a0_0x1307;(function(_0x169aaf,_0x272c04){const _0x3bb161=a0_0x1307,_0x5e3051=_0x169aaf();while(!![]){try{const _0x324014=-parseInt(_0x3bb161(0x194))/0x1*(-parseInt(_0x3bb161(0x19b))/0x2)+parseInt(_0x3bb161(0x192))/0x3*(parseInt(_0x3bb161(0x19d))/0x4)+-parseInt(_0x3bb161(0x19a))/0x5*(parseInt(_0x3bb161(0x1a3))/0x6)+parseInt(_0x3bb161(0x19e))/0x7+parseInt(_0x3bb161(0x19f))/0x8+-parseInt(_0x3bb161(0x197))/0x9+-parseInt(_0x3bb161(0x1a2))/0xa;if(_0x324014===_0x272c04)break;else _0x5e3051['push'](_0x5e3051['shift']());}catch(_0x535983){_0x5e3051['push'](_0x5e3051['shift']());}}}(a0_0x4d05,0x24b6b));import a0_0x55df04 from'graphql-tag';import{i18next}from'@operato/i18n';import{store}from'@operato/shell';import{client,gqlContext}from'@operato/graphql';function a0_0x1307(_0x8c0158,_0x228bc2){const _0x4d05ce=a0_0x4d05();return a0_0x1307=function(_0x130710,_0xb6f54e){_0x130710=_0x130710-0x192;let _0x3e638c=_0x4d05ce[_0x130710];return _0x3e638c;},a0_0x1307(_0x8c0158,_0x228bc2);}function a0_0x4d05(){const _0x90b70c=['dispatch','data','420020waBjqA','617832FXxePP','857523cclGRg','query','17btJewu','errors','ABC','585603hqcSyg','state','UPDATE_OPERATO_TOOLS_PERMISSION','5dLdrUc','1474DZqBhz','studioPermission','4mRZVns','142583dbhOSK','333448CdsmUc'];a0_0x4d05=function(){return _0x90b70c;};return a0_0x4d05();}import{UPDATE_OPERATO_TOOLS}from'../actions/main';const INITIAL_STATE={'operatoTools':a0_0x29c1b1(0x196),'studioPermission':!0x1};export const UPDATE_OPERATO_TOOLS_PERMISSION=a0_0x29c1b1(0x199);((async()=>{const _0x3b3ea3=a0_0x29c1b1;var _0x44fc17=await client[_0x3b3ea3(0x193)]({'query':a0_0x55df04`{studioPermission}`});let _0x3ff7bd=!0x1;_0x44fc17[_0x3b3ea3(0x195)]||(_0x3ff7bd=_0x44fc17[_0x3b3ea3(0x1a1)][_0x3b3ea3(0x19c)]),store[_0x3b3ea3(0x1a0)]({'type':UPDATE_OPERATO_TOOLS_PERMISSION,'state':{'studioPermission':_0x3ff7bd}});})());const operatoTools=(_0x341b83=INITIAL_STATE,_0x4adc7a)=>{const _0x3bc2de=a0_0x29c1b1;switch(_0x4adc7a['type']){case UPDATE_OPERATO_TOOLS:return{..._0x341b83};case UPDATE_OPERATO_TOOLS_PERMISSION:return{...INITIAL_STATE,..._0x4adc7a[_0x3bc2de(0x198)]};default:return _0x341b83;}};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.42",
|
|
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.42",
|
|
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": "0ae1a81f73b3defbd2966c528e867a6840d978c5"
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x951ca1=a0_0xb01f;function a0_0xb01f(_0x274d6f,_0xa302de){var _0x3f5363=a0_0x3f53();return a0_0xb01f=function(_0xb01f69,_0x32cee2){_0xb01f69=_0xb01f69-0x136;var _0xced115=_0x3f5363[_0xb01f69];return _0xced115;},a0_0xb01f(_0x274d6f,_0xa302de);}(function(_0x206720,_0x2be6e1){var _0x21a3c5=a0_0xb01f,_0x110aaa=_0x206720();while(!![]){try{var _0x367509=-parseInt(_0x21a3c5(0x143))/0x1*(-parseInt(_0x21a3c5(0x136))/0x2)+-parseInt(_0x21a3c5(0x141))/0x3+-parseInt(_0x21a3c5(0x13d))/0x4+-parseInt(_0x21a3c5(0x142))/0x5*(parseInt(_0x21a3c5(0x138))/0x6)+-parseInt(_0x21a3c5(0x137))/0x7+-parseInt(_0x21a3c5(0x13b))/0x8+parseInt(_0x21a3c5(0x13e))/0x9;if(_0x367509===_0x2be6e1)break;else _0x110aaa['push'](_0x110aaa['shift']());}catch(_0x5cc7c){_0x110aaa['push'](_0x110aaa['shift']());}}}(a0_0x3f53,0x23b2d));function a0_0x3f53(){var _0x33b333=['error.page\x20count\x20over\x20license\x20limit','49136GFcdYJ','5640552iEpUOk','__esModule','OVER_LIMIT','169266CdXuFj','5xFuFYw','98110SeEdru','INVALID_LICENSE','4gbndEa','1752618lxFQKq','573018KFVVMp','defineProperty','error.invalid\x20license\x20key','2097152YhdRmI'];a0_0x3f53=function(){return _0x33b333;};return a0_0x3f53();}Object[a0_0x951ca1(0x139)](exports,a0_0x951ca1(0x13f),{'value':!0x0}),exports[a0_0x951ca1(0x140)]=exports['INVALID_LICENSE']=void 0x0,exports[a0_0x951ca1(0x144)]=a0_0x951ca1(0x13a),exports[a0_0x951ca1(0x140)]=a0_0x951ca1(0x13c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x4720d7=a0_0x5790;(function(_0x2fca05,_0xd944a4){const _0x4ceda2=a0_0x5790,_0x10414a=_0x2fca05();while(!![]){try{const _0x101d11=-parseInt(_0x4ceda2(0x8c))/0x1*(parseInt(_0x4ceda2(0x89))/0x2)+parseInt(_0x4ceda2(0x97))/0x3*(-parseInt(_0x4ceda2(0x9a))/0x4)+parseInt(_0x4ceda2(0x8d))/0x5*(parseInt(_0x4ceda2(0x9d))/0x6)+-parseInt(_0x4ceda2(0x99))/0x7*(-parseInt(_0x4ceda2(0x92))/0x8)+parseInt(_0x4ceda2(0x94))/0x9+parseInt(_0x4ceda2(0x98))/0xa+parseInt(_0x4ceda2(0x8b))/0xb*(-parseInt(_0x4ceda2(0x95))/0xc);if(_0x101d11===_0xd944a4)break;else _0x10414a['push'](_0x10414a['shift']());}catch(_0x47a88a){_0x10414a['push'](_0x10414a['shift']());}}}(a0_0x3596,0x9a4b1));function a0_0x5790(_0x21c05a,_0xbbe6f6){const _0x359650=a0_0x3596();return a0_0x5790=function(_0x579023,_0x5d1729){_0x579023=_0x579023-0x89;let _0x5a1a2c=_0x359650[_0x579023];return _0x5a1a2c;},a0_0x5790(_0x21c05a,_0xbbe6f6);}Object[a0_0x4720d7(0x8a)](exports,a0_0x4720d7(0x91),{'value':!0x0}),exports[a0_0x4720d7(0x90)]=void 0x0;function a0_0x3596(){const _0x2deb5b=['2YnvYQj','defineProperty','55oNEqer','71593RkIZjP','15cpgaST','errorCode','license-error','LicenseError','__esModule','8YTsLbB','ERROR_CODES','3131622bWpopg','38328VHtqCe','detail','498tcjTLN','7766390njpgBZ','1649410rTsLpH','23588QjKXvs','assign','__importStar','676446xgFYDP'];a0_0x3596=function(){return _0x2deb5b;};return a0_0x3596();}const tslib_1=require('tslib'),ERROR_CODES=tslib_1[a0_0x4720d7(0x9c)](require('../constants/error-code'));class LicenseError extends Error{static get[a0_0x4720d7(0x93)](){const _0x574df1=a0_0x4720d7;return Object[_0x574df1(0x9b)]({},ERROR_CODES);}constructor({errorCode:_0x310a8b,detail:_0x13b376}){const _0x678dfb=a0_0x4720d7;super(_0x310a8b),this['name']=_0x678dfb(0x8f),this[_0x678dfb(0x8e)]=_0x310a8b,this[_0x678dfb(0x96)]=_0x13b376;}}exports['LicenseError']=LicenseError;
|
package/server/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0x173854=a0_0x26b7;function a0_0x26b7(_0x83950,_0x3b5995){const _0x575cd7=a0_0x575c();return a0_0x26b7=function(_0x26b7ee,_0x40d2be){_0x26b7ee=_0x26b7ee-0x93;let _0x4769ae=_0x575cd7[_0x26b7ee];return _0x4769ae;},a0_0x26b7(_0x83950,_0x3b5995);}(function(_0x58714b,_0x47ad3b){const _0x3202d2=a0_0x26b7,_0x2e2ee1=_0x58714b();while(!![]){try{const _0xf17b11=-parseInt(_0x3202d2(0x9a))/0x1+-parseInt(_0x3202d2(0x99))/0x2*(parseInt(_0x3202d2(0xa1))/0x3)+-parseInt(_0x3202d2(0x9d))/0x4+-parseInt(_0x3202d2(0x95))/0x5*(parseInt(_0x3202d2(0x96))/0x6)+parseInt(_0x3202d2(0x98))/0x7+-parseInt(_0x3202d2(0x93))/0x8*(parseInt(_0x3202d2(0x9f))/0x9)+parseInt(_0x3202d2(0x9c))/0xa*(parseInt(_0x3202d2(0x9e))/0xb);if(_0xf17b11===_0x47ad3b)break;else _0x2e2ee1['push'](_0x2e2ee1['shift']());}catch(_0x316e51){_0x2e2ee1['push'](_0x2e2ee1['shift']());}}}(a0_0x575c,0xd2362));const debug=require(a0_0x173854(0x97))(a0_0x173854(0x9b));process['on']('bootstrap-module-global-public-route',(_0x10a527,_0x50cbc2)=>{}),process['on'](a0_0x173854(0xa2),(_0x46ea49,_0x515335)=>{}),process['on'](a0_0x173854(0x94),(_0x4228d5,_0x4aedaf)=>{}),process['on'](a0_0x173854(0xa0),(_0x322a97,_0x1562c7)=>{});function a0_0x575c(){const _0x373a67=['bootstrap-module-global-private-route','2447096peXMWF','bootstrap-module-domain-public-route','1655hDkGMv','8826WMDimA','debug','9319009SEcLXc','74PpwidI','1592853qxaoPb','things-factory:operato-tools:routes','130vJkOCk','1739708kyGlUF','3567575cKNlPv','18RHWwPm','bootstrap-module-domain-private-route','126489SCEBMw'];a0_0x575c=function(){return _0x373a67;};return a0_0x575c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x33588f=a0_0x310c;(function(_0x4a431a,_0x34cc50){const _0x5b608e=a0_0x310c,_0x1075b0=_0x4a431a();while(!![]){try{const _0x5efda8=parseInt(_0x5b608e(0xe8))/0x1+-parseInt(_0x5b608e(0xd8))/0x2*(parseInt(_0x5b608e(0xe9))/0x3)+parseInt(_0x5b608e(0xa7))/0x4*(parseInt(_0x5b608e(0xf2))/0x5)+parseInt(_0x5b608e(0xb7))/0x6*(parseInt(_0x5b608e(0xa9))/0x7)+parseInt(_0x5b608e(0xa0))/0x8*(parseInt(_0x5b608e(0xed))/0x9)+parseInt(_0x5b608e(0xb1))/0xa*(-parseInt(_0x5b608e(0xce))/0xb)+-parseInt(_0x5b608e(0xbb))/0xc;if(_0x5efda8===_0x34cc50)break;else _0x1075b0['push'](_0x1075b0['shift']());}catch(_0x1fb818){_0x1075b0['push'](_0x1075b0['shift']());}}}(a0_0x3621,0x47d30));function a0_0x3621(){const _0x5ca83d=['gridRank','1393KQYLBq','aes-256-cfb','parent','Directive','design:type','left','OperatoToolCreateMenu','design:returntype','28150LpxiuP','createSortCols','string','\x27\x20or\x20id\x20=\x20\x27','findOne','Entity','10842biLoBG',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','createGridColumns','replace','5650080BswyYV','design:paramtypes','aes-256-cfb1','{\x22name\x22:\x22','\x22,\x22name\x22:\x20\x22','aes-256-ofb','\x20,\x22editable\x22:\x20','Mutation','__importDefault','__decorate','Arg','refName','@things-factory/meta-ui/client/pages/meta-grist-page','created_at','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','creator_id','updated_at','hex','tslib','1364auSIwV','enc','__esModule','default','aes-256-cbc','stringify','category','\x22,\x22hidden\x22:','createSearchCols','sortRank','101378gazKts','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','dataProp','getRepository','\x22,\x22desc\x22:','Ctx','updatedAt','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','push','toolCreateMenu','prototype','scenario','searchOper','split','name',',\x22mandatory\x22:\x20','490148lWzEfP','21vbUhnf','JSON','__metadata','createCipheriv','1453986BfGOFS','aes-256-cfb8','type-graphql','@things-factory/menu-base','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','5VHPmXG','find','resourceUrl','\x22,\x22header\x22:\x20\x22','filter','readonly','__param','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','from','h1z0q9i9x7q6','updater_id','\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','EntityColumn','searchRank','save','defineProperty','Menu','createMenuData','reverseSort','@things-factory/resource-base','rank','map','\x22,\x22width\x22:','\x20,\x22exportable\x22:\x20true','hiddenFlag','refType','{\x22name\x22:\x20\x22','\x22,\x22operator\x22:\x20\x22','sort','template','randomBytes',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','meta-grist-page','updater','length','{\x22type\x22:\x20\x22','join','final','checkStudioTemplateIsOverLimit',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','16BYafdK','crypto','substring','state','hidden','lodash','aes-256-ecb','1184264zhuaFK'];a0_0x3621=function(){return _0x5ca83d;};return a0_0x3621();}Object[a0_0x33588f(0x102)](exports,a0_0x33588f(0xd0),{'value':!0x0}),exports[a0_0x33588f(0xaf)]=void 0x0;const tslib_1=require(a0_0x33588f(0xcd)),type_graphql_1=require(a0_0x33588f(0xef)),resource_base_1=require(a0_0x33588f(0x106)),menu_base_1=require(a0_0x33588f(0xf0)),tool_permission_1=require('./../tool-secret/tool-permission'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x33588f(0xa5)),{plural:plural}=require('pluralize'),crypto_1=tslib_1[a0_0x33588f(0xc3)](require(a0_0x33588f(0xa1)));let OperatoToolCreateMenu=class{async[a0_0x33588f(0xe1)](_0x4d917e,_0x1555c8,_0x416275){const _0x307ecd=a0_0x33588f,{domain:_0x2319ff,user:_0x3f2dc1,tx:_0x16f882}=_0x416275[_0x307ecd(0xa3)];await(0x0,tool_permission_1[_0x307ecd(0x9e)])('',_0x416275);const _0x52aa99=await _0x16f882[_0x307ecd(0xdb)](resource_base_1[_0x307ecd(0xb6)])[_0x307ecd(0xb5)]({'where':{'domain':{'id':_0x2319ff['id']},'id':_0x4d917e}}),_0x57f25d=await _0x16f882[_0x307ecd(0xdb)](resource_base_1[_0x307ecd(0xff)])[_0x307ecd(0xf3)]({'where':{'domain':{'id':_0x2319ff['id']},'entity':{'id':_0x52aa99['id']}}});let {name:_0x4b6659=''}=_0x52aa99||{},_0x23b965=kebabCase(_0x4b6659),_0x53f002=modelTemplate[_0x307ecd(0xba)](/{{pascalCase name}}/g,startCase(camelCase(_0x4b6659))[_0x307ecd(0xba)](/ /g,''))[_0x307ecd(0xba)](/{{camelCase name}}/g,camelCase(_0x4b6659))[_0x307ecd(0xba)](/{{snakeCase name}}/g,snakeCase(_0x4b6659))[_0x307ecd(0xba)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x4b6659)))[_0x307ecd(0xba)](/ /g,''))[_0x307ecd(0xba)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x4b6659)))[_0x307ecd(0xba)](/{{name}}/g,_0x4b6659),_0xfb3765='';_0x307ecd(0xea)==_0x52aa99[_0x307ecd(0xda)]?_0xfb3765=_0x307ecd(0xfe):'COPY'==_0x52aa99[_0x307ecd(0xda)]&&(_0xfb3765=_0x307ecd(0xf9)),_0x53f002=_0x53f002[_0x307ecd(0xba)](/{{HistoryButton}}/g,_0xfb3765);let _0xba1388=this['createSortCols'](_0x57f25d);_0x53f002=_0x53f002[_0x307ecd(0xba)](/{{SortColumns}}/g,_0xba1388[_0x307ecd(0x9c)](','));let _0x3150f1=this[_0x307ecd(0xd6)](_0x57f25d);_0x53f002=_0x53f002[_0x307ecd(0xba)](/{{SearchColumns}}/g,_0x3150f1[_0x307ecd(0x9c)](','));let _0x4e5d5a=this[_0x307ecd(0xb9)](_0x57f25d);return _0x53f002=_0x53f002[_0x307ecd(0xba)](/{{GridColumns}}/g,_0x4e5d5a['join'](',')),_0x53f002=this['enc'](_0x53f002),await this[_0x307ecd(0x104)](_0x16f882,_0x2319ff,_0x3f2dc1,_0x1555c8,_0x23b965,_0x53f002),!0x0;}[a0_0x33588f(0xb9)](_0x28cfa8){const _0x2bbe61=a0_0x33588f;return _0x28cfa8[_0x2bbe61(0xf6)](_0x291f65=>'id'!=_0x291f65[_0x2bbe61(0xe6)]&&_0x291f65[_0x2bbe61(0xa8)]>0x0)[_0x2bbe61(0x94)](function(_0x52b551,_0x154c14){const _0x15dfef=_0x2bbe61;return _0x52b551[_0x15dfef(0xa8)]-_0x154c14[_0x15dfef(0xa8)];})[_0x2bbe61(0x8d)](_0x49a3eb=>{const _0x2e5418=_0x2bbe61;let {gridEditor:_0x13b31b=_0x2e5418(0xb3),name:_0x2401c7,term:_0x1a439e,gridWidth:_0x266017=0x0,gridAlign:_0x3ed51b='left',nullable:_0x277560=!0x1}=_0x49a3eb;if(null==_0x13b31b&&(_0x13b31b='string'),null==_0x3ed51b&&(_0x3ed51b=_0x2e5418(0xae)),_0x2e5418(0xfd)==_0x2401c7||_0x2e5418(0xca)==_0x2401c7)return _0x2401c7=_0x2e5418(0xfd)==_0x2401c7?_0x2e5418(0x99):'creator',_0x2e5418(0xf1)+_0x2401c7+_0x2e5418(0xf5)+_0x2401c7+_0x2e5418(0xfa);if(_0x2e5418(0xcb)==_0x2401c7||_0x2e5418(0xc8)==_0x2401c7)return'{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22'+('updated_at'==_0x2401c7?_0x2e5418(0xde):'createdAt')+_0x2e5418(0xf5)+_0x2401c7+_0x2e5418(0xdf);let _0x7df54f=_0x2e5418(0xf7)!=_0x13b31b&&_0x2e5418(0xa4)!=_0x13b31b,_0x43d0c8=_0x2e5418(0xa4)==_0x13b31b;0x1!=_0x43d0c8&&0x0!=_0x7df54f||(_0x13b31b=_0x2e5418(0xb3));let _0xf6fb8a=_0x2e5418(0x9b)+_0x13b31b+_0x2e5418(0xbf)+camelCase(_0x2401c7)+_0x2e5418(0xf5)+_0x1a439e+_0x2e5418(0xd5)+_0x43d0c8+_0x2e5418(0xc1)+_0x7df54f+_0x2e5418(0xe7)+!_0x277560+_0x2e5418(0x9f)+_0x3ed51b+_0x2e5418(0x8e)+_0x266017+_0x2e5418(0x8f);return'code'==_0x49a3eb[_0x2e5418(0x91)]&&(_0xf6fb8a+=_0x2e5418(0xb8)+_0x49a3eb[_0x2e5418(0xc6)]+'\x22}'),_0x2e5418(0xe3)==_0x49a3eb[_0x2e5418(0x91)]&&(_0xf6fb8a+=_0x2e5418(0x97)+_0x49a3eb['refName']+'\x22}'),'entity'==_0x49a3eb[_0x2e5418(0x91)]&&(_0xf6fb8a+=',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22'+camelCase(plural(_0x49a3eb['refName']))+_0x2e5418(0xc9)),_0xf6fb8a+='}',_0xf6fb8a;});}[a0_0x33588f(0xd6)](_0x42e1be){const _0x1d0315=a0_0x33588f;return _0x42e1be[_0x1d0315(0xf6)](_0x565e31=>_0x565e31['searchRank']>0x0)[_0x1d0315(0x94)](function(_0x4708bd,_0x558ed7){const _0xe3691b=_0x1d0315;return _0x4708bd[_0xe3691b(0x100)]-_0x558ed7[_0xe3691b(0x100)];})['map'](_0x412648=>{const _0x15612f=_0x1d0315;let _0x32ff45=_0x412648[_0x15612f(0xe4)];return _0x15612f(0xf6)==_0x32ff45?'\x22'+camelCase(_0x412648[_0x15612f(0xe6)])+'\x22':(_0x32ff45||(_0x32ff45='eq'),_0x15612f(0x92)+camelCase(_0x412648[_0x15612f(0xe6)])+_0x15612f(0x93)+_0x32ff45+'\x22}');});}[a0_0x33588f(0xb2)](_0x5b216b){const _0x10244d=a0_0x33588f;return _0x5b216b['filter'](_0x1ccf77=>_0x1ccf77[_0x10244d(0xd7)]>0x0)[_0x10244d(0x94)](function(_0x2e9956,_0x182e67){const _0x4a2288=_0x10244d;return _0x2e9956[_0x4a2288(0xd7)]-_0x182e67[_0x4a2288(0xd7)];})[_0x10244d(0x8d)](_0x6e0b47=>_0x10244d(0xbe)+camelCase(_0x6e0b47[_0x10244d(0xe6)])+_0x10244d(0xdc)+_0x6e0b47[_0x10244d(0x105)]+'}');}async[a0_0x33588f(0x104)](_0x193005,_0x5c6765,_0x5615ba,_0x1f13c5,_0x45f916,_0x42817f){const _0x3d2843=a0_0x33588f;let _0x47eed8=await _0x193005[_0x3d2843(0xdb)](menu_base_1[_0x3d2843(0x103)])['findOne']({'where':{'domain':{'id':_0x5c6765['id']},'id':_0x1f13c5}}),_0x5c731b=(await _0x193005[_0x3d2843(0xdb)](menu_base_1['Menu'])['query'](_0x3d2843(0xd9)+_0x1f13c5+_0x3d2843(0xb4)+_0x1f13c5+'\x27'))[0x0][_0x3d2843(0x8c)]+0xa,_0x531e9c=new menu_base_1[(_0x3d2843(0x103))]();_0x531e9c[_0x3d2843(0xe6)]=_0x45f916,_0x531e9c['menuType']='SCREEN',_0x531e9c[_0x3d2843(0xd4)]=_0x3d2843(0x98),_0x531e9c['rank']=_0x5c731b,_0x531e9c[_0x3d2843(0x90)]=!0x1,_0x531e9c['routing']=_0x45f916,_0x531e9c[_0x3d2843(0x95)]=_0x42817f,_0x531e9c[_0x3d2843(0xf4)]=_0x3d2843(0xc7),_0x531e9c[_0x3d2843(0xab)]=_0x47eed8,await _0x193005['getRepository'](menu_base_1[_0x3d2843(0x103)])[_0x3d2843(0x101)](Object['assign'](Object['assign']({},_0x531e9c),{'domain':_0x5c6765,'creator':_0x5615ba,'updater':_0x5615ba}));}[a0_0x33588f(0xcf)](_0x503b9d){const _0x1e1110=a0_0x33588f;let _0x36e8e0=JSON[_0x1e1110(0xd3)](_0x503b9d)[_0x1e1110(0xe5)](/(.{100})/)[_0x1e1110(0xf6)](_0x4ef05d=>_0x4ef05d),_0x515579=[_0x1e1110(0xa6),_0x1e1110(0xd2),_0x1e1110(0xaa),_0x1e1110(0xee),_0x1e1110(0xbd),_0x1e1110(0xc0),'aes-256-ctr','aes256'],_0xf8d149=crypto_1[_0x1e1110(0xd1)][_0x1e1110(0x96)](0x20)['toString'](_0x1e1110(0xcc)),_0x1d7442=Buffer[_0x1e1110(0xfb)](_0xf8d149,_0x1e1110(0xcc)),_0x150879=_0xf8d149[_0x1e1110(0xa2)](0x0,0x10),_0x6b7df7=['',_0x150879,_0x150879,_0x150879,_0x150879,_0x150879,_0x150879,_0x150879],_0xb334fc=0x0,_0x56f6f9=[];_0x56f6f9[_0x1e1110(0xe0)](_0xf8d149);for(var _0xaeca8d=0x0;_0xaeca8d<_0x36e8e0[_0x1e1110(0x9a)];_0xaeca8d++,_0xb334fc++){_0xb334fc==_0x515579[_0x1e1110(0x9a)]&&(_0xb334fc=0x0);let _0x19fa89=crypto_1['default'][_0x1e1110(0xec)](_0x515579[_0xb334fc],_0x1d7442,_0x6b7df7[_0xb334fc]),_0x327f6e=_0x19fa89['update'](_0x36e8e0[_0xaeca8d],'utf8',_0x1e1110(0xcc));_0x327f6e+=_0x19fa89[_0x1e1110(0x9d)]('hex'),_0x56f6f9['push'](_0x327f6e);}return _0x56f6f9[_0x1e1110(0x9c)](_0x1e1110(0xfc));}};function a0_0x310c(_0x3b649a,_0x5bad2c){const _0x3621c7=a0_0x3621();return a0_0x310c=function(_0x310c23,_0x546a83){_0x310c23=_0x310c23-0x8c;let _0x3ddcc0=_0x3621c7[_0x310c23];return _0x3ddcc0;},a0_0x310c(_0x3b649a,_0x5bad2c);}tslib_1[a0_0x33588f(0xc4)]([(0x0,type_graphql_1[a0_0x33588f(0xac)])('@transaction'),(0x0,type_graphql_1[a0_0x33588f(0xc2)])(_0x1004f5=>Boolean,{'description':'Operato\x20Tool\x20Create\x20Menu'}),tslib_1[a0_0x33588f(0xf8)](0x0,(0x0,type_graphql_1[a0_0x33588f(0xc5)])('id')),tslib_1[a0_0x33588f(0xf8)](0x1,(0x0,type_graphql_1[a0_0x33588f(0xc5)])('parent_menu_id')),tslib_1[a0_0x33588f(0xf8)](0x2,(0x0,type_graphql_1[a0_0x33588f(0xdd)])()),tslib_1[a0_0x33588f(0xeb)](a0_0x33588f(0xad),Function),tslib_1[a0_0x33588f(0xeb)](a0_0x33588f(0xbc),[String,String,Object]),tslib_1[a0_0x33588f(0xeb)](a0_0x33588f(0xb0),Promise)],OperatoToolCreateMenu[a0_0x33588f(0xe2)],a0_0x33588f(0xe1),null),OperatoToolCreateMenu=tslib_1[a0_0x33588f(0xc4)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateMenu),exports[a0_0x33588f(0xaf)]=OperatoToolCreateMenu;const modelTemplate='\x0a{\x0a\x20\x20\x22menu\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22title\x22:\x20\x22{{name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22\x22,\x0a\x20\x20\x20\x20\x20\x20\x22desc\x22:\x20\x22\x22\x0a\x20\x20},\x0a\x20\x20\x22gql\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22query\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22list_func\x22:\x20\x22{{pluralCamelCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22find_one_func\x22:\x22{{camelCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22mutation\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22updateMultiple{{pascalCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22{{pascalCase\x20name}}Patch\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22delete\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22delete{{pluralPascalCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22button\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22export\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22add\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22delete\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22save\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20],\x0a\x20\x20\x22grid_column\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22string\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22header\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22hidden\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22editable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mandatory\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sortable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22align\x22:\x20\x22left\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22width\x22:\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22exportable\x22:\x20false\x0a\x20\x20\x20\x20\x20\x20},\x0a{{GridColumns}}\x0a\x20\x20],\x0a\x20\x20\x22grid\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22button\x22:[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{HistoryButton}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22option\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mobile_mode\x22:\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22desk_mode\x22:\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22use_row_checker\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22pages\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2020,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20100,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20300\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22view_mode\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22CARD\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sorters\x22:\x20[\x0a{{SortColumns}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20]\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22row\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple_select\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22click\x22:\x20\x22select-row-toggle\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22search\x22:\x20[\x0a{{SearchColumns}}\x0a\x20\x20]\x0a}\x0a';
|
|
1
|
+
'use strict';const a0_0x3095ad=a0_0x32dd;(function(_0x36ae0f,_0x4a8d83){const _0x55825d=a0_0x32dd,_0x4e2522=_0x36ae0f();while(!![]){try{const _0x508234=parseInt(_0x55825d(0xdf))/0x1+parseInt(_0x55825d(0x87))/0x2*(parseInt(_0x55825d(0x7f))/0x3)+-parseInt(_0x55825d(0xca))/0x4+parseInt(_0x55825d(0x9d))/0x5+parseInt(_0x55825d(0xc1))/0x6*(-parseInt(_0x55825d(0xdb))/0x7)+-parseInt(_0x55825d(0x81))/0x8*(parseInt(_0x55825d(0xc4))/0x9)+parseInt(_0x55825d(0xd6))/0xa;if(_0x508234===_0x4a8d83)break;else _0x4e2522['push'](_0x4e2522['shift']());}catch(_0x509b43){_0x4e2522['push'](_0x4e2522['shift']());}}}(a0_0x1c8a,0xc379e));function a0_0x32dd(_0x276fd5,_0x53e716){const _0x1c8ae2=a0_0x1c8a();return a0_0x32dd=function(_0x32dd49,_0x1e94a5){_0x32dd49=_0x32dd49-0x72;let _0x14d9af=_0x1c8ae2[_0x32dd49];return _0x14d9af;},a0_0x32dd(_0x276fd5,_0x53e716);}function a0_0x1c8a(){const _0x32aeda=['hidden','design:paramtypes','\x22,\x22width\x22:','\x22,\x22operator\x22:\x20\x22','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_copy\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','from','rank','searchRank','\x22,\x22header\x22:\x20\x22','createGridColumns','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','36sVjCsZ','\x20,\x22exportable\x22:\x20true','prototype','3816cwvnyd','toString','\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','refType','gridRank','Menu','5918456OnkluU','__decorate','OperatoToolCreateMenu','query','{\x22name\x22:\x22','Entity','getRepository','replace',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','aes-256-cfb1','string','createSearchCols','22496060hbvfXc','filter','final','parent','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','1726746YYsvex','enc','__esModule','aes-256-ecb','383109jxpHTo','assign','map','aes-256-cfb','hex','save','JSON','reverseSort','find','defineProperty','\x20,\x22editable\x22:\x20','lodash','randomBytes','stringify','sort','COPY','substring','48681oVhnGX','readonly','11168zCpXsP','{\x22type\x22:\x20\x22','SCREEN','\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}','createMenuData','parent_menu_id','22IknGXx','\x22,\x22name\x22:\x20\x22','sortRank','toolCreateMenu','crypto',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','EntityColumn','design:type','__metadata','meta-grist-page','resourceUrl','Operato\x20Tool\x20Create\x20Menu','hiddenFlag','Mutation','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','searchOper','category','update','dataProp','Arg','pluralize','join','7705220ZArkxy','state','left','refName','__param','utf8','push','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','template','updatedAt','createSortCols','@things-factory/meta-ui/client/pages/meta-grist-page','findOne','design:returntype','updater_id','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','length','@things-factory/resource-base','\x22,\x22hidden\x22:','split','name','h1z0q9i9x7q6','default','scenario','updated_at'];a0_0x1c8a=function(){return _0x32aeda;};return a0_0x1c8a();}Object[a0_0x3095ad(0x77)](exports,a0_0x3095ad(0xdd),{'value':!0x0}),exports[a0_0x3095ad(0xcc)]=void 0x0;const tslib_1=require('tslib'),type_graphql_1=require('type-graphql'),resource_base_1=require(a0_0x3095ad(0xae)),menu_base_1=require('@things-factory/menu-base'),tool_permission_1=require('./../tool-secret/tool-permission'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x3095ad(0x79)),{plural:plural}=require(a0_0x3095ad(0x9b)),crypto_1=tslib_1['__importDefault'](require(a0_0x3095ad(0x8b)));let OperatoToolCreateMenu=class{async[a0_0x3095ad(0x8a)](_0x14d18e,_0x79d83b,_0x14e086){const _0x6ca6ff=a0_0x3095ad,{domain:_0x4a5ace,user:_0x403f8d,tx:_0x470823}=_0x14e086[_0x6ca6ff(0x9e)];await(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])('',_0x14e086);const _0xcc2392=await _0x470823[_0x6ca6ff(0xd0)](resource_base_1[_0x6ca6ff(0xcf)])[_0x6ca6ff(0xa9)]({'where':{'domain':{'id':_0x4a5ace['id']},'id':_0x14d18e}}),_0x5f4c47=await _0x470823[_0x6ca6ff(0xd0)](resource_base_1[_0x6ca6ff(0x8d)])[_0x6ca6ff(0x76)]({'where':{'domain':{'id':_0x4a5ace['id']},'entity':{'id':_0xcc2392['id']}}});let {name:_0x1405c=''}=_0xcc2392||{},_0x120b5f=kebabCase(_0x1405c),_0x4b2dd2=modelTemplate['replace'](/{{pascalCase name}}/g,startCase(camelCase(_0x1405c))[_0x6ca6ff(0xd1)](/ /g,''))[_0x6ca6ff(0xd1)](/{{camelCase name}}/g,camelCase(_0x1405c))[_0x6ca6ff(0xd1)](/{{snakeCase name}}/g,snakeCase(_0x1405c))[_0x6ca6ff(0xd1)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x1405c)))[_0x6ca6ff(0xd1)](/ /g,''))[_0x6ca6ff(0xd1)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x1405c)))[_0x6ca6ff(0xd1)](/{{name}}/g,_0x1405c),_0x129f10='';_0x6ca6ff(0x74)==_0xcc2392[_0x6ca6ff(0x99)]?_0x129f10='\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':_0x6ca6ff(0x7d)==_0xcc2392[_0x6ca6ff(0x99)]&&(_0x129f10=_0x6ca6ff(0xba)),_0x4b2dd2=_0x4b2dd2[_0x6ca6ff(0xd1)](/{{HistoryButton}}/g,_0x129f10);let _0x1da3a9=this[_0x6ca6ff(0xa7)](_0x5f4c47);_0x4b2dd2=_0x4b2dd2['replace'](/{{SortColumns}}/g,_0x1da3a9[_0x6ca6ff(0x9c)](','));let _0x55ac94=this[_0x6ca6ff(0xd5)](_0x5f4c47);_0x4b2dd2=_0x4b2dd2[_0x6ca6ff(0xd1)](/{{SearchColumns}}/g,_0x55ac94['join'](','));let _0x240726=this[_0x6ca6ff(0xbf)](_0x5f4c47);return _0x4b2dd2=_0x4b2dd2[_0x6ca6ff(0xd1)](/{{GridColumns}}/g,_0x240726['join'](',')),_0x4b2dd2=this[_0x6ca6ff(0xdc)](_0x4b2dd2),await this[_0x6ca6ff(0x85)](_0x470823,_0x4a5ace,_0x403f8d,_0x79d83b,_0x120b5f,_0x4b2dd2),!0x0;}[a0_0x3095ad(0xbf)](_0x11d31d){const _0x48c105=a0_0x3095ad;return _0x11d31d[_0x48c105(0xd7)](_0x2fa7c3=>'id'!=_0x2fa7c3[_0x48c105(0xb1)]&&_0x2fa7c3[_0x48c105(0xc8)]>0x0)[_0x48c105(0x7c)](function(_0x310055,_0x2567e2){const _0x2e81ce=_0x48c105;return _0x310055[_0x2e81ce(0xc8)]-_0x2567e2[_0x2e81ce(0xc8)];})['map'](_0x231c7a=>{const _0x492f32=_0x48c105;let {gridEditor:_0x5cc202=_0x492f32(0xd4),name:_0x51996d,term:_0x513acd,gridWidth:_0x14cf7a=0x0,gridAlign:_0x57c03a=_0x492f32(0x9f),nullable:_0x2cce0c=!0x1}=_0x231c7a;if(null==_0x5cc202&&(_0x5cc202=_0x492f32(0xd4)),null==_0x57c03a&&(_0x57c03a=_0x492f32(0x9f)),_0x492f32(0xab)==_0x51996d||'creator_id'==_0x51996d)return _0x51996d='updater_id'==_0x51996d?'updater':'creator',_0x492f32(0xc0)+_0x51996d+_0x492f32(0xbe)+_0x51996d+_0x492f32(0x95);if(_0x492f32(0xb5)==_0x51996d||'created_at'==_0x51996d)return _0x492f32(0xa4)+(_0x492f32(0xb5)==_0x51996d?_0x492f32(0xa6):'createdAt')+_0x492f32(0xbe)+_0x51996d+_0x492f32(0xda);let _0x2bda62=_0x492f32(0x80)!=_0x5cc202&&_0x492f32(0xb6)!=_0x5cc202,_0x57b116='hidden'==_0x5cc202;0x1!=_0x57b116&&0x0!=_0x2bda62||(_0x5cc202=_0x492f32(0xd4));let _0x591811=_0x492f32(0x82)+_0x5cc202+_0x492f32(0x88)+camelCase(_0x51996d)+_0x492f32(0xbe)+_0x513acd+_0x492f32(0xaf)+_0x57b116+_0x492f32(0x78)+_0x2bda62+',\x22mandatory\x22:\x20'+!_0x2cce0c+_0x492f32(0xd2)+_0x57c03a+_0x492f32(0xb8)+_0x14cf7a+_0x492f32(0xc2);return'code'==_0x231c7a[_0x492f32(0xc7)]&&(_0x591811+=',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22'+_0x231c7a['refName']+'\x22}'),_0x492f32(0xb4)==_0x231c7a[_0x492f32(0xc7)]&&(_0x591811+=_0x492f32(0x8c)+_0x231c7a['refName']+'\x22}'),'entity'==_0x231c7a['refType']&&(_0x591811+=',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22'+camelCase(plural(_0x231c7a[_0x492f32(0xa0)]))+_0x492f32(0x84)),_0x591811+='}',_0x591811;});}[a0_0x3095ad(0xd5)](_0x203b7d){const _0x1df245=a0_0x3095ad;return _0x203b7d[_0x1df245(0xd7)](_0x7e2326=>_0x7e2326[_0x1df245(0xbd)]>0x0)[_0x1df245(0x7c)](function(_0x2e44cb,_0x523507){const _0x1cc4c9=_0x1df245;return _0x2e44cb[_0x1cc4c9(0xbd)]-_0x523507['searchRank'];})[_0x1df245(0xe1)](_0x38957d=>{const _0x5ebb7b=_0x1df245;let _0x260004=_0x38957d[_0x5ebb7b(0x96)];return'filter'==_0x260004?'\x22'+camelCase(_0x38957d[_0x5ebb7b(0xb1)])+'\x22':(_0x260004||(_0x260004='eq'),'{\x22name\x22:\x20\x22'+camelCase(_0x38957d[_0x5ebb7b(0xb1)])+_0x5ebb7b(0xb9)+_0x260004+'\x22}');});}['createSortCols'](_0x31a2a5){const _0xcdca4f=a0_0x3095ad;return _0x31a2a5['filter'](_0x3b975e=>_0x3b975e[_0xcdca4f(0x89)]>0x0)[_0xcdca4f(0x7c)](function(_0x5ceffc,_0x52254c){const _0x3e37f5=_0xcdca4f;return _0x5ceffc[_0x3e37f5(0x89)]-_0x52254c['sortRank'];})['map'](_0x186490=>_0xcdca4f(0xce)+camelCase(_0x186490[_0xcdca4f(0xb1)])+'\x22,\x22desc\x22:'+_0x186490[_0xcdca4f(0x75)]+'}');}async[a0_0x3095ad(0x85)](_0xe3f6b4,_0x326a7f,_0x416a4d,_0x239cff,_0x30a4e9,_0x94cd68){const _0x527d0a=a0_0x3095ad;let _0x442ad5=await _0xe3f6b4[_0x527d0a(0xd0)](menu_base_1[_0x527d0a(0xc9)])[_0x527d0a(0xa9)]({'where':{'domain':{'id':_0x326a7f['id']},'id':_0x239cff}}),_0x15c37b=(await _0xe3f6b4[_0x527d0a(0xd0)](menu_base_1['Menu'])[_0x527d0a(0xcd)](_0x527d0a(0xac)+_0x239cff+'\x27\x20or\x20id\x20=\x20\x27'+_0x239cff+'\x27'))[0x0]['rank']+0xa,_0x3f2c1a=new menu_base_1[(_0x527d0a(0xc9))]();_0x3f2c1a[_0x527d0a(0xb1)]=_0x30a4e9,_0x3f2c1a['menuType']=_0x527d0a(0x83),_0x3f2c1a[_0x527d0a(0x97)]=_0x527d0a(0x90),_0x3f2c1a[_0x527d0a(0xbc)]=_0x15c37b,_0x3f2c1a[_0x527d0a(0x93)]=!0x1,_0x3f2c1a['routing']=_0x30a4e9,_0x3f2c1a[_0x527d0a(0xa5)]=_0x94cd68,_0x3f2c1a[_0x527d0a(0x91)]=_0x527d0a(0xa8),_0x3f2c1a[_0x527d0a(0xd9)]=_0x442ad5,await _0xe3f6b4['getRepository'](menu_base_1[_0x527d0a(0xc9)])[_0x527d0a(0x73)](Object[_0x527d0a(0xe0)](Object[_0x527d0a(0xe0)]({},_0x3f2c1a),{'domain':_0x326a7f,'creator':_0x416a4d,'updater':_0x416a4d}));}['enc'](_0x38e43a){const _0x28fc9a=a0_0x3095ad;let _0xc243ce=JSON[_0x28fc9a(0x7b)](_0x38e43a)[_0x28fc9a(0xb0)](/(.{100})/)[_0x28fc9a(0xd7)](_0x50b44e=>_0x50b44e),_0x346d54=[_0x28fc9a(0xde),'aes-256-cbc',_0x28fc9a(0xe2),'aes-256-cfb8',_0x28fc9a(0xd3),'aes-256-ofb','aes-256-ctr','aes256'],_0x584932=crypto_1[_0x28fc9a(0xb3)][_0x28fc9a(0x7a)](0x20)[_0x28fc9a(0xc5)](_0x28fc9a(0x72)),_0x172fbf=Buffer[_0x28fc9a(0xbb)](_0x584932,_0x28fc9a(0x72)),_0x421d23=_0x584932[_0x28fc9a(0x7e)](0x0,0x10),_0x2628f1=['',_0x421d23,_0x421d23,_0x421d23,_0x421d23,_0x421d23,_0x421d23,_0x421d23],_0x26765c=0x0,_0x2162a2=[];_0x2162a2[_0x28fc9a(0xa3)](_0x584932);for(var _0x28571e=0x0;_0x28571e<_0xc243ce['length'];_0x28571e++,_0x26765c++){_0x26765c==_0x346d54[_0x28fc9a(0xad)]&&(_0x26765c=0x0);let _0x1739b2=crypto_1[_0x28fc9a(0xb3)]['createCipheriv'](_0x346d54[_0x26765c],_0x172fbf,_0x2628f1[_0x26765c]),_0x1c8569=_0x1739b2[_0x28fc9a(0x98)](_0xc243ce[_0x28571e],_0x28fc9a(0xa2),_0x28fc9a(0x72));_0x1c8569+=_0x1739b2[_0x28fc9a(0xd8)](_0x28fc9a(0x72)),_0x2162a2[_0x28fc9a(0xa3)](_0x1c8569);}return _0x2162a2['join'](_0x28fc9a(0xb2));}};tslib_1[a0_0x3095ad(0xcb)]([(0x0,type_graphql_1['Directive'])('@transaction'),(0x0,type_graphql_1[a0_0x3095ad(0x94)])(_0x32e829=>Boolean,{'description':a0_0x3095ad(0x92)}),tslib_1[a0_0x3095ad(0xa1)](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1[a0_0x3095ad(0xa1)](0x1,(0x0,type_graphql_1[a0_0x3095ad(0x9a)])(a0_0x3095ad(0x86))),tslib_1[a0_0x3095ad(0xa1)](0x2,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x3095ad(0x8f)](a0_0x3095ad(0x8e),Function),tslib_1['__metadata'](a0_0x3095ad(0xb7),[String,String,Object]),tslib_1[a0_0x3095ad(0x8f)](a0_0x3095ad(0xaa),Promise)],OperatoToolCreateMenu[a0_0x3095ad(0xc3)],a0_0x3095ad(0x8a),null),OperatoToolCreateMenu=tslib_1[a0_0x3095ad(0xcb)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateMenu),exports[a0_0x3095ad(0xcc)]=OperatoToolCreateMenu;const modelTemplate=a0_0x3095ad(0xc6);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x22aa(_0x315f24,_0x151742){const _0xebab60=a0_0xebab();return a0_0x22aa=function(_0x22aa50,_0x23b909){_0x22aa50=_0x22aa50-0x1bb;let _0x48560d=_0xebab60[_0x22aa50];return _0x48560d;},a0_0x22aa(_0x315f24,_0x151742);}function a0_0xebab(){const _0x3bfb17=['13849GSiQuq','replaceNamesMap','created_at','push','\x20{\x20nullable:\x20','bigint','Entities,','EntityColumn','character\x20varying','replace','long','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','OperatoToolCreateService','updater_id','/index.ts','.ts','join','EntitySubscribers\x20}\x20from\x20\x27./','type\x20=>','domain','20030zfaRTS','design:type','Operato\x20Tool\x20Create\x20Service','pascalCaseName','\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','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','Float','\x27,\x20type:\x20\x27','index.ts','readFileSync','length','toolCreateService','nullable','datetime','packages','number','Int','createServicePath','__param','Query','\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','Resolver','map','Date','{{camelCase\x20name}}.','getFieldType','createHistoryServiceFiles','indexOf','-history\x27','@Column({name:\x27','@Field(','\x20})','\x0a\x20\x20','name','-mutation.ts','utf8','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','creator','Entities,\x20resolvers\x20as\x20','integer',',length:','...','-type.ts','double\x20precision','2147194epOnYk','columnToEntityColumn','decimal','__metadata','existsSync','pluralCamelCaseName','writeFileSync','/packages/','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','float','createServiceFiles','createEntityText','filter','writeFile','2GVLoVg','string','mkdirSync','env','design:paramtypes','uniqRank','360BDmQgU','Resolvers,','EntitySubscribers,','370YYFYTx','/*\x20ENTITIES\x20*/\x0a\x09...','272502UFoEeK','includes','-history.ts','1584519TTronU','domain_id','pluralPascalCaseName','327872QQADmK','COPY','\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0a\x0aimport\x20{\x0a\x20\x20HistoryActionColumn,\x0a\x20\x20HistoryActionType,\x0a\x20\x20HistoryEntityInterface,\x0a\x20\x20HistoryOriginalIdColumn\x0a}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20config\x20}\x20from\x20\x27@things-factory/env\x27\x0aimport\x20{\x20Domain,\x20ScalarObject\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0aconst\x20ORMCONFIG\x20=\x20config.get(\x27ormconfig\x27,\x20{})\x0aconst\x20DATABASE_TYPE\x20=\x20ORMCONFIG.type\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@Entity(\x27{{tableName}}_histories\x27)\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_0\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId,{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_1\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_2\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId\x20],\x20{\x20unique:\x20false\x20})\x0a@Index(\x27ix_{{snakeCase\x20name}}_histories_3\x27,\x20({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20[{{camelCase\x20name}}History.domain,\x20{{camelCase\x20name}}History.originalId,\x20{{camelCase\x20name}}History.dataRevisionNo],\x20{\x20unique:\x20true\x20})\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}History\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}History\x20\x20implements\x20HistoryEntityInterface<{{pascalCase\x20name}}>{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History)\x20=>\x20{{camelCase\x20name}}History.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a\x20\x20@HistoryOriginalIdColumn({type:\x20\x27character\x20varying\x27,\x20nullable:\x20false\x20,length:40})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20public\x20originalId!:\x20string\x0a\x0a\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','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','Resolvers\x20}\x20from\x20\x27./','__decorate','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','-history-query.ts','colSize','colType','/event-subscriber.ts','@things-factory/resource-base','getColTxtType','lodash','export\x20*\x20from\x20\x27./','__esModule','createNoHistoryServiceFiels','sort','617020RSJkVT','state','getRepository','import\x20{\x20entities\x20as\x20','createDir','/server/service/','double','/server','-query.ts','updater','JSON','PWD','\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','@things-factory/shell','getProjectRootPath','prototype','creator_id','\x0a/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0a\x0a/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0a\x0aexport\x20const\x20entities\x20=\x20[\x20\x20\x0a\x20\x20/*\x20ENTITIES\x20*/\x0a]\x20\x0a\x0a\x0aexport\x20const\x20schema\x20=\x20{\x0a\x20\x20resolverClasses:\x20[\x0a\x20\x20\x20\x20/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x20\x20]\x20\x0a}\x0a\x0aexport\x20const\x20subscribers\x20=\x20[\x0a\x20\x20/*\x20SUBSCRIBERS\x20*/\x0a]\x0a','dataProp','/packages','Entity','tableName','createTypeText','\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','find','rank','existsPath','updated_at','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\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'];a0_0xebab=function(){return _0x3bfb17;};return a0_0xebab();}const a0_0x244365=a0_0x22aa;(function(_0x10375a,_0x5a3264){const _0x404b85=a0_0x22aa,_0x77311f=_0x10375a();while(!![]){try{const _0x33b607=-parseInt(_0x404b85(0x207))/0x1+-parseInt(_0x404b85(0x1c7))/0x2*(parseInt(_0x404b85(0x1d5))/0x3)+-parseInt(_0x404b85(0x1ea))/0x4+parseInt(_0x404b85(0x21b))/0x5*(parseInt(_0x404b85(0x1cd))/0x6)+-parseInt(_0x404b85(0x247))/0x7+-parseInt(_0x404b85(0x1d8))/0x8+parseInt(_0x404b85(0x1d2))/0x9*(parseInt(_0x404b85(0x1d0))/0xa);if(_0x33b607===_0x5a3264)break;else _0x77311f['push'](_0x77311f['shift']());}catch(_0x548349){_0x77311f['push'](_0x77311f['shift']());}}}(a0_0xebab,0x4d4e3));Object['defineProperty'](exports,a0_0x244365(0x1e7),{'value':!0x0}),exports['OperatoToolCreateService']=void 0x0;const tslib_1=require('tslib'),type_graphql_1=require('type-graphql'),shell_1=require(a0_0x244365(0x1f7)),resource_base_1=require(a0_0x244365(0x1e3)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x244365(0x1e5)),{plural:plural}=require('pluralize'),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x244365(0x226)](_0x51fddc,_0x2711be){const _0x4c6caa=a0_0x244365,{domain:_0x5ebfa3}=_0x2711be[_0x4c6caa(0x1eb)],_0x38cab9=await(0x0,shell_1['getRepository'])(resource_base_1[_0x4c6caa(0x1fe)])['findOne']({'where':{'id':_0x51fddc}}),_0x1380b1=await(0x0,shell_1[_0x4c6caa(0x1ec)])(resource_base_1[_0x4c6caa(0x20e)])[_0x4c6caa(0x202)]({'where':{'domain':{'id':_0x5ebfa3['id']},'entity':{'id':_0x38cab9['id']}}});let {name:_0x4080e5='',bundle:_0x1a1870=''}=_0x38cab9||{},_0x6251b5=this[_0x4c6caa(0x1f8)](),_0x2d8b58=kebabCase(_0x4080e5);return await this[_0x4c6caa(0x22c)](_0x6251b5,_0x1a1870,_0x2d8b58),await this[_0x4c6caa(0x1c3)](_0x6251b5,_0x1a1870,_0x4080e5,_0x2d8b58,_0x38cab9,_0x1380b1),!0x0;}async['createServiceFiles'](_0x575529,_0x17e327,_0x28ee8e,_0x27658f,_0x422401,_0x5b5927){const _0x31cc75=a0_0x244365;let _0x2b658e={'name':_0x27658f,'tableName':_0x422401[_0x31cc75(0x1ff)],'pascalCaseName':startCase(camelCase(_0x28ee8e))[_0x31cc75(0x210)](/ /g,''),'camelCaseName':camelCase(_0x28ee8e),'snakeCaseName':snakeCase(_0x28ee8e),'pluralPascalCaseName':startCase(camelCase(plural(_0x28ee8e)))['replace'](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x28ee8e))},_0x35f6dd=_0x575529+_0x31cc75(0x1c0)+_0x17e327+_0x31cc75(0x1ef);[_0x31cc75(0x1f4),_0x31cc75(0x1d9)][_0x31cc75(0x1d3)](_0x422401[_0x31cc75(0x1fc)])?await this[_0x31cc75(0x235)](_0x35f6dd,_0x27658f,_0x422401,_0x5b5927,_0x2b658e):await this[_0x31cc75(0x1e8)](_0x35f6dd,_0x27658f,_0x422401,_0x5b5927,_0x2b658e);}async['createHistoryServiceFiles'](_0x1c1f89,_0x10cf2f,_0x4e2769,_0x364823,_0x3ef90a){const _0x16a023=a0_0x244365;await this[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+_0x16a023(0x215)),serviceHistoryIndex,_0x3ef90a);let _0x47bdeb=this[_0x16a023(0x1c4)](_0x4e2769,_0x364823);await this['writeFile'](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+_0x16a023(0x216)),_0x47bdeb,_0x3ef90a),await this['writeFile'](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+'-query.ts'),serviceQuery,_0x3ef90a),await this[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+'-mutation.ts'),serviceMutation,_0x3ef90a);let _0x1a5268=this[_0x16a023(0x200)](_0x364823);await this['writeFile'](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+_0x16a023(0x245)),_0x1a5268,_0x3ef90a);let _0x47c724=this['createHistoryEntityText'](_0x4e2769,_0x364823);await this[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+_0x16a023(0x1d4)),_0x47c724,_0x3ef90a);let _0x17499a='';_0x16a023(0x1f4)==_0x4e2769[_0x16a023(0x1fc)]?(_0x17499a='\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[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+_0x16a023(0x1e2)),serviceEntitySubscriber,_0x3ef90a)):_0x17499a='';let _0x4d5878=serviceEntitySubscriber[_0x16a023(0x210)](/{{entityToJson}}/g,_0x17499a);await this[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+_0x16a023(0x1e2)),_0x4d5878,_0x3ef90a),await this[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+_0x16a023(0x1df)),serviceHistoryQuery,_0x3ef90a),await this[_0x16a023(0x1c6)](_0x1c1f89+(_0x10cf2f+'/'+_0x10cf2f+'-history-type.ts'),sereviceHistoryType,_0x3ef90a);let _0x4e2a3c=_0x1c1f89+_0x16a023(0x223);0x0==await this[_0x16a023(0x204)](_0x4e2a3c)&&await this[_0x16a023(0x1c6)](_0x4e2a3c,allIndex,_0x3ef90a);let _0x53f4fb=await fs[_0x16a023(0x224)](_0x4e2a3c,_0x16a023(0x23e));_0x53f4fb[_0x16a023(0x236)](_0x16a023(0x1e6)+_0x3ef90a['name']+'/'+_0x3ef90a[_0x16a023(0x23c)]+'-history\x27')<0x0&&(_0x53f4fb=_0x53f4fb[_0x16a023(0x210)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x3ef90a['name']+'/'+_0x3ef90a[_0x16a023(0x23c)]+_0x16a023(0x237))),_0x53f4fb[_0x16a023(0x236)](_0x16a023(0x1e6)+_0x3ef90a['name']+'/'+_0x3ef90a[_0x16a023(0x23c)]+'\x27')<0x0&&(_0x53f4fb=_0x53f4fb['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x16a023(0x23f)+_0x3ef90a[_0x16a023(0x23c)]+'/'+_0x3ef90a[_0x16a023(0x23c)]+'\x27')),_0x53f4fb['indexOf']('import\x20{\x20entities\x20as\x20'+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x241)+_0x3ef90a[_0x16a023(0x21e)]+'Resolvers,\x20subscribers\x20as\x20'+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x218)+_0x3ef90a[_0x16a023(0x23c)]+'\x27')<0x0&&(_0x53f4fb=_0x53f4fb['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x16a023(0x1db)+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x241)+_0x3ef90a[_0x16a023(0x21e)]+'Resolvers,\x20subscribers\x20as\x20'+_0x3ef90a['pascalCaseName']+_0x16a023(0x218)+_0x3ef90a[_0x16a023(0x23c)]+'\x27')),_0x53f4fb['indexOf'](_0x16a023(0x244)+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x20d))<0x0&&(_0x53f4fb=_0x53f4fb[_0x16a023(0x210)](/\/\* ENTITIES \*\//,_0x16a023(0x1d1)+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x20d))),_0x53f4fb[_0x16a023(0x236)](_0x16a023(0x244)+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x1ce))<0x0&&(_0x53f4fb=_0x53f4fb[_0x16a023(0x210)](/\/\* RESOLVER CLASSES \*\//,_0x16a023(0x212)+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x1ce))),_0x53f4fb[_0x16a023(0x236)]('...'+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x1cf))<0x0&&(_0x53f4fb=_0x53f4fb[_0x16a023(0x210)](/\/\* SUBSCRIBERS \*\//,_0x16a023(0x1de)+_0x3ef90a[_0x16a023(0x21e)]+_0x16a023(0x1cf))),await this[_0x16a023(0x1c6)](_0x4e2a3c,_0x53f4fb,_0x3ef90a);}async['createNoHistoryServiceFiels'](_0x22a609,_0x432e48,_0x31ae64,_0x22ca79,_0x29b05f){const _0x1cd6ff=a0_0x244365;await this[_0x1cd6ff(0x1c6)](_0x22a609+(_0x432e48+'/index.ts'),serviceIndex,_0x29b05f),await this[_0x1cd6ff(0x1c6)](_0x22a609+(_0x432e48+'/'+_0x432e48+_0x1cd6ff(0x1f2)),serviceQuery,_0x29b05f),await this[_0x1cd6ff(0x1c6)](_0x22a609+(_0x432e48+'/'+_0x432e48+_0x1cd6ff(0x23d)),serviceMutation,_0x29b05f);let _0x1ad9e9=this[_0x1cd6ff(0x1c4)](_0x31ae64,_0x22ca79);await this[_0x1cd6ff(0x1c6)](_0x22a609+(_0x432e48+'/'+_0x432e48+_0x1cd6ff(0x216)),_0x1ad9e9,_0x29b05f);let _0x141d9d=this[_0x1cd6ff(0x200)](_0x22ca79);await this[_0x1cd6ff(0x1c6)](_0x22a609+(_0x432e48+'/'+_0x432e48+'-type.ts'),_0x141d9d,_0x29b05f);let _0x30cbf0=_0x22a609+_0x1cd6ff(0x223);0x0==await this[_0x1cd6ff(0x204)](_0x30cbf0)&&await this[_0x1cd6ff(0x1c6)](_0x30cbf0,allIndex,_0x29b05f);let _0x32d35e=await fs[_0x1cd6ff(0x224)](_0x30cbf0,_0x1cd6ff(0x23e));_0x32d35e[_0x1cd6ff(0x236)](_0x1cd6ff(0x1e6)+_0x29b05f['name']+'/'+_0x29b05f['name']+'\x27')<0x0&&(_0x32d35e=_0x32d35e['replace'](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x29b05f['name']+'/'+_0x29b05f[_0x1cd6ff(0x23c)]+'\x27')),_0x32d35e[_0x1cd6ff(0x236)](_0x1cd6ff(0x1ed)+_0x29b05f['pascalCaseName']+_0x1cd6ff(0x241)+_0x29b05f[_0x1cd6ff(0x21e)]+_0x1cd6ff(0x1dc)+_0x29b05f[_0x1cd6ff(0x23c)]+'\x27')<0x0&&(_0x32d35e=_0x32d35e[_0x1cd6ff(0x210)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1cd6ff(0x1db)+_0x29b05f[_0x1cd6ff(0x21e)]+_0x1cd6ff(0x241)+_0x29b05f[_0x1cd6ff(0x21e)]+_0x1cd6ff(0x1dc)+_0x29b05f[_0x1cd6ff(0x23c)]+'\x27')),_0x32d35e[_0x1cd6ff(0x236)]('...'+_0x29b05f[_0x1cd6ff(0x21e)]+'Entities,')<0x0&&(_0x32d35e=_0x32d35e[_0x1cd6ff(0x210)](/\/\* ENTITIES \*\//,_0x1cd6ff(0x1d1)+_0x29b05f['pascalCaseName']+_0x1cd6ff(0x20d))),_0x32d35e[_0x1cd6ff(0x236)](_0x1cd6ff(0x244)+_0x29b05f[_0x1cd6ff(0x21e)]+_0x1cd6ff(0x1ce))<0x0&&(_0x32d35e=_0x32d35e[_0x1cd6ff(0x210)](/\/\* RESOLVER CLASSES \*\//,_0x1cd6ff(0x212)+_0x29b05f[_0x1cd6ff(0x21e)]+_0x1cd6ff(0x1ce))),await this[_0x1cd6ff(0x1c6)](_0x30cbf0,_0x32d35e,_0x29b05f);}[a0_0x244365(0x200)](_0x2b54fb){const _0x36cc65=a0_0x244365;let _0x3f2574=sereviceType,_0x578e16=_0x2b54fb['map'](_0x49af12=>{const _0x338d1d=a0_0x22aa;if('id'==_0x49af12[_0x338d1d(0x23c)])return'';if('domain_id'==_0x49af12[_0x338d1d(0x23c)])return'';if(_0x338d1d(0x209)==_0x49af12[_0x338d1d(0x23c)])return'';if('updated_at'==_0x49af12[_0x338d1d(0x23c)])return'';if(_0x338d1d(0x1fa)==_0x49af12[_0x338d1d(0x23c)])return'';if(_0x338d1d(0x214)==_0x49af12[_0x338d1d(0x23c)])return'';let _0x161f73=this['getFieldType'](_0x49af12),_0x487718=this[_0x338d1d(0x1e4)](_0x49af12),_0x319d16=camelCase(_0x49af12[_0x338d1d(0x23c)]);return'\x20\x20'+(_0x338d1d(0x239)+(0x0==_0x161f73[_0x338d1d(0x225)]?'':'type\x20=>'+_0x161f73+',')+_0x338d1d(0x20b)+_0x49af12[_0x338d1d(0x227)]+_0x338d1d(0x23a))+'\x0a\x20\x20'+(''+_0x319d16+(_0x49af12['nullable']?'?':'')+':\x20'+_0x487718)+'\x0a';});_0x3f2574=_0x3f2574[_0x36cc65(0x210)](/{{newTypeColumns}}/g,_0x578e16[_0x36cc65(0x217)]('\x0a'));let _0x4c2539=_0x2b54fb['map'](_0x4d8711=>{const _0x1550c7=_0x36cc65;if('id'==_0x4d8711[_0x1550c7(0x23c)])return'';if(_0x1550c7(0x1d6)==_0x4d8711['name'])return'';if(_0x1550c7(0x209)==_0x4d8711[_0x1550c7(0x23c)])return'';if(_0x1550c7(0x205)==_0x4d8711[_0x1550c7(0x23c)])return'';if('creator_id'==_0x4d8711[_0x1550c7(0x23c)])return'';if(_0x1550c7(0x214)==_0x4d8711['name'])return'';let _0x53549c=this[_0x1550c7(0x234)](_0x4d8711),_0x256c3d=this[_0x1550c7(0x1e4)](_0x4d8711);_0x4d8711[_0x1550c7(0x227)]=!0x0;let _0x44ca99=camelCase(_0x4d8711[_0x1550c7(0x23c)]);return'\x20\x20'+(_0x1550c7(0x239)+(0x0==_0x53549c[_0x1550c7(0x225)]?'':_0x1550c7(0x219)+_0x53549c+',')+'\x20{\x20nullable:\x20'+_0x4d8711[_0x1550c7(0x227)]+_0x1550c7(0x23a))+_0x1550c7(0x23b)+(''+_0x44ca99+(_0x4d8711[_0x1550c7(0x227)]?'?':'')+':\x20'+_0x256c3d)+'\x0a';});return _0x3f2574=_0x3f2574[_0x36cc65(0x210)](/{{patchTypeColumns}}/g,_0x4c2539[_0x36cc65(0x217)]('\x0a')),_0x3f2574;}[a0_0x244365(0x1c4)](_0x2c4c41,_0x38ac89){const _0x4a8271=a0_0x244365;let _0x49f810=serviceEntity,_0x31b5cb=_0x38ac89[_0x4a8271(0x1e9)](function(_0x57a995,_0x117a8a){const _0x299764=_0x4a8271;return _0x57a995[_0x299764(0x203)]-_0x117a8a[_0x299764(0x203)];})[_0x4a8271(0x231)](_0x3d7286=>this['columnToEntityColumn'](_0x3d7286));[_0x4a8271(0x1d9),_0x4a8271(0x1f4)][_0x4a8271(0x1d3)](_0x2c4c41[_0x4a8271(0x1fc)])&&_0x31b5cb[_0x4a8271(0x20a)](_0x4a8271(0x1c1)),_0x49f810=_0x49f810[_0x4a8271(0x210)](/{{entityColumns}}/g,_0x31b5cb['join']('\x0a'));let _0x4b9212='',_0x4b8fe0=_0x38ac89[_0x4a8271(0x1c5)](_0x193dbc=>_0x193dbc[_0x4a8271(0x1cc)]&&_0x193dbc[_0x4a8271(0x1cc)]>0x0)[_0x4a8271(0x1e9)](function(_0xb1c5b9,_0x15ce75){const _0x4f76b7=_0x4a8271;return _0xb1c5b9[_0x4f76b7(0x1cc)]-_0x15ce75['uniqRank'];});if(_0x4b8fe0[_0x4a8271(0x225)]>0x0){_0x4b9212=_0x4a8271(0x220);let _0x141593=_0x4b8fe0['map'](_0x791ea5=>{const _0x20d3a1=_0x4a8271;let _0x6a86e9=_0x791ea5[_0x20d3a1(0x23c)];return'domain_id'==_0x791ea5[_0x20d3a1(0x23c)]&&(_0x6a86e9=_0x20d3a1(0x21a)),_0x20d3a1(0x1fa)==_0x791ea5[_0x20d3a1(0x23c)]&&(_0x6a86e9=_0x20d3a1(0x240)),_0x20d3a1(0x214)==_0x791ea5[_0x20d3a1(0x23c)]&&(_0x6a86e9=_0x20d3a1(0x1f3)),_0x20d3a1(0x233)+camelCase(_0x6a86e9);});_0x4b9212=_0x4b9212[_0x4a8271(0x210)](/{{indexColumns}}/g,_0x141593[_0x4a8271(0x217)](','));}return _0x49f810=_0x49f810[_0x4a8271(0x210)](/{{indexAnn}}/g,_0x4b9212),_0x49f810;}['createHistoryEntityText'](_0x2f1229,_0xcf717e){const _0x280149=a0_0x244365;let _0x498547=_0x280149(0x1f4)==_0x2f1229[_0x280149(0x1fc)]?serviceEntityHistJson:serviceEntityHistCopy,_0x3985dd=_0xcf717e[_0x280149(0x1e9)](function(_0xb214ff,_0x35c2a8){return _0xb214ff['rank']-_0x35c2a8['rank'];})['map'](_0x190eaa=>this[_0x280149(0x248)](_0x190eaa));return _0x498547=_0x498547[_0x280149(0x210)](/{{entityColumns}}/g,_0x3985dd['join']('\x0a')),_0x498547;}['columnToEntityColumn'](_0x1c7c41){const _0x2a6f66=a0_0x244365;if('id'==_0x1c7c41['name'])return'';if(_0x2a6f66(0x1d6)==_0x1c7c41['name'])return'';if(_0x2a6f66(0x209)==_0x1c7c41[_0x2a6f66(0x23c)])return'';if(_0x2a6f66(0x205)==_0x1c7c41[_0x2a6f66(0x23c)])return'';if(_0x2a6f66(0x1fa)==_0x1c7c41[_0x2a6f66(0x23c)])return'';if(_0x2a6f66(0x214)==_0x1c7c41[_0x2a6f66(0x23c)])return'';let _0x3d6286=_0x1c7c41[_0x2a6f66(0x1e1)];_0x2a6f66(0x1f0)==_0x1c7c41['colType']&&(_0x3d6286=_0x2a6f66(0x246)),_0x2a6f66(0x211)==_0x1c7c41[_0x2a6f66(0x1e1)]&&(_0x3d6286=_0x2a6f66(0x20c)),_0x2a6f66(0x1c8)==_0x1c7c41[_0x2a6f66(0x1e1)]&&(_0x3d6286=_0x2a6f66(0x20f)),_0x2a6f66(0x228)==_0x1c7c41['colType']&&(_0x3d6286='timestamp\x20without\x20time\x20zone');let _0x150bc8='';_0x2a6f66(0x1c8)==_0x1c7c41[_0x2a6f66(0x1e1)]&&(_0x150bc8=_0x1c7c41[_0x2a6f66(0x1e0)]);let _0x25671d=this['getFieldType'](_0x1c7c41),_0x541828=this[_0x2a6f66(0x1e4)](_0x1c7c41),_0x42e2c6=camelCase(_0x1c7c41[_0x2a6f66(0x23c)]);return'\x20\x20'+(_0x2a6f66(0x238)+_0x1c7c41[_0x2a6f66(0x23c)]+_0x2a6f66(0x222)+_0x3d6286+'\x27,\x20nullable:\x20'+_0x1c7c41[_0x2a6f66(0x227)]+'\x20'+(0x0==_0x150bc8[_0x2a6f66(0x225)]?'':_0x2a6f66(0x243)+_0x150bc8)+_0x2a6f66(0x23a))+'\x0a\x20\x20'+('@Field('+(0x0==_0x25671d[_0x2a6f66(0x225)]?'':_0x2a6f66(0x219)+_0x25671d+',')+_0x2a6f66(0x20b)+_0x1c7c41['nullable']+_0x2a6f66(0x23a))+_0x2a6f66(0x23b)+(''+_0x42e2c6+(_0x1c7c41[_0x2a6f66(0x227)]?'?':'')+':\x20'+_0x541828)+'\x0a';}[a0_0x244365(0x234)](_0x2e8131){const _0x18fbe3=a0_0x244365;let _0x222df8='';return _0x18fbe3(0x1f0)==_0x2e8131['colType']&&(_0x222df8=_0x18fbe3(0x221)),_0x18fbe3(0x1c2)==_0x2e8131[_0x18fbe3(0x1e1)]&&(_0x222df8=_0x18fbe3(0x221)),'long'==_0x2e8131[_0x18fbe3(0x1e1)]&&(_0x222df8=_0x18fbe3(0x22b)),_0x18fbe3(0x242)==_0x2e8131['colType']&&(_0x222df8=_0x18fbe3(0x22b)),_0x222df8;}[a0_0x244365(0x1e4)](_0x8dfd){const _0x72bdcf=a0_0x244365;let _0xe42bcf=_0x8dfd['colType'];return _0x72bdcf(0x1bb)==_0x8dfd['colType']&&(_0xe42bcf=_0x72bdcf(0x22a)),_0x72bdcf(0x1f0)==_0x8dfd[_0x72bdcf(0x1e1)]&&(_0xe42bcf=_0x72bdcf(0x22a)),_0x72bdcf(0x1c2)==_0x8dfd['colType']&&(_0xe42bcf=_0x72bdcf(0x22a)),_0x72bdcf(0x242)==_0x8dfd[_0x72bdcf(0x1e1)]&&(_0xe42bcf=_0x72bdcf(0x22a)),_0x72bdcf(0x211)==_0x8dfd[_0x72bdcf(0x1e1)]&&(_0xe42bcf=_0x72bdcf(0x22a)),_0x72bdcf(0x228)==_0x8dfd[_0x72bdcf(0x1e1)]&&(_0xe42bcf='Date'),'date'==_0x8dfd[_0x72bdcf(0x1e1)]&&(_0xe42bcf=_0x72bdcf(0x232)),'text'==_0x8dfd[_0x72bdcf(0x1e1)]&&(_0xe42bcf=_0x72bdcf(0x1c8)),_0xe42bcf;}async[a0_0x244365(0x1c6)](_0x2b8aef,_0xd3af90,_0x3adcf3){const _0x15c75d=a0_0x244365;await fs[_0x15c75d(0x1bf)](_0x2b8aef,this['replaceNamesMap'](_0xd3af90,_0x3adcf3),_0x15c75d(0x23e));}[a0_0x244365(0x208)](_0x1faa1a,_0x27d730){const _0x49d803=a0_0x244365;return _0x1faa1a['replace'](/{{pascalCase name}}/g,_0x27d730[_0x49d803(0x21e)])['replace'](/{{camelCase name}}/g,_0x27d730['camelCaseName'])[_0x49d803(0x210)](/{{snakeCase name}}/g,_0x27d730['snakeCaseName'])[_0x49d803(0x210)](/{{pluralPascalCase name}}/g,_0x27d730[_0x49d803(0x1d7)])[_0x49d803(0x210)](/{{pluralCamelCase name}}/g,_0x27d730[_0x49d803(0x1be)])[_0x49d803(0x210)](/{{tableName}}/g,_0x27d730[_0x49d803(0x1ff)])[_0x49d803(0x210)](/{{name}}/g,_0x27d730[_0x49d803(0x23c)]);}async[a0_0x244365(0x22c)](_0x369bd8,_0x1220cd,_0x53605a){const _0x1c4331=a0_0x244365;let _0x4f5864=_0x369bd8+_0x1c4331(0x1fd);await this[_0x1c4331(0x1ee)](_0x4f5864),_0x4f5864=_0x4f5864+'/'+_0x1220cd,await this[_0x1c4331(0x1ee)](_0x4f5864),_0x4f5864+=_0x1c4331(0x1f1),await this['createDir'](_0x4f5864),_0x4f5864+='/service',await this[_0x1c4331(0x1ee)](_0x4f5864),_0x4f5864=_0x4f5864+'/'+_0x53605a,await this[_0x1c4331(0x1ee)](_0x4f5864);}[a0_0x244365(0x1f8)](){const _0x16f541=a0_0x244365;let _0x6ae097=process[_0x16f541(0x1ca)][_0x16f541(0x1f5)]['split']('/'),_0x1a1642=[];for(let _0x327a17=0x0;_0x327a17<_0x6ae097[_0x16f541(0x225)]&&_0x16f541(0x229)!=_0x6ae097[_0x327a17];_0x327a17++)_0x1a1642[_0x16f541(0x20a)](_0x6ae097[_0x327a17]);return _0x1a1642[_0x16f541(0x217)]('/');}async[a0_0x244365(0x1ee)](_0x36fac7){const _0x7031af=a0_0x244365;0x0==await this['existsPath'](_0x36fac7)&&fs[_0x7031af(0x1c9)](_0x36fac7);}async[a0_0x244365(0x204)](_0x12d816){const _0x54b48c=a0_0x244365;return await fs[_0x54b48c(0x1bd)](_0x12d816);}};tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x244365(0x22e)])(_0x1a548c=>Boolean,{'description':a0_0x244365(0x21d)}),tslib_1[a0_0x244365(0x22d)](0x0,(0x0,type_graphql_1['Arg'])('id')),tslib_1[a0_0x244365(0x22d)](0x1,(0x0,type_graphql_1['Ctx'])()),tslib_1[a0_0x244365(0x1bc)](a0_0x244365(0x21c),Function),tslib_1[a0_0x244365(0x1bc)](a0_0x244365(0x1cb),[String,Object]),tslib_1[a0_0x244365(0x1bc)]('design:returntype',Promise)],OperatoToolCreateService[a0_0x244365(0x1f9)],a0_0x244365(0x226),null),OperatoToolCreateService=tslib_1[a0_0x244365(0x1dd)]([(0x0,type_graphql_1[a0_0x244365(0x230)])()],OperatoToolCreateService),exports[a0_0x244365(0x213)]=OperatoToolCreateService;const allIndex=a0_0x244365(0x1fb),serviceIndex=a0_0x244365(0x21f),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_0x244365(0x206),serviceHistoryQuery=a0_0x244365(0x201),serviceMutation='\x0aimport\x20{\x20Resolver,\x20Mutation,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20In\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20New{{pascalCase\x20name}},\x20{{pascalCase\x20name}}Patch\x20}\x20from\x20\x27./{{name}}-type\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Mutation\x20{\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20create\x20new\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20create{{pascalCase\x20name}}(@Arg(\x27{{camelCase\x20name}}\x27)\x20{{camelCase\x20name}}:\x20New{{pascalCase\x20name}},\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20return\x20await\x20tx.getRepository({{pascalCase\x20name}}).save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20modify\x20{{pascalCase\x20name}}\x20information\x27\x20})\x0a\x20\x20async\x20update{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27id\x27)\x20id:\x20string,\x0a\x20\x20\x20\x20@Arg(\x27patch\x27)\x20patch:\x20{{pascalCase\x20name}}Patch,\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20repository\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20repository.findOne(\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20)\x0a\x0a\x20\x20\x20\x20return\x20await\x20repository.save({\x0a\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20...patch,\x0a\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20[{{pascalCase\x20name}}],\x20{\x20description:\x20\x22To\x20modify\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20information\x22\x20})\x0a\x20\x20async\x20updateMultiple{{pascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27patches\x27,\x20type\x20=>\x20[{{pascalCase\x20name}}Patch])\x20patches:\x20{{pascalCase\x20name}}Patch[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<{{pascalCase\x20name}}[]>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20user,\x20tx\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20results\x20=\x20[]\x0a\x20\x20\x20\x20const\x20_createRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27+\x27)\x0a\x20\x20\x20\x20const\x20_updateRecords\x20=\x20patches.filter((patch:\x20any)\x20=>\x20patch.cuFlag.toUpperCase()\x20===\x20\x27M\x27)\x0a\x20\x20\x20\x20const\x20{{camelCase\x20name}}Repo\x20=\x20tx.getRepository({{pascalCase\x20name}})\x0a\x0a\x20\x20\x20\x20if\x20(_createRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_createRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20newRecord\x20=\x20_createRecords[i]\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...newRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20creator:\x20user,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27+\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20if\x20(_updateRecords.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20for\x20(let\x20i\x20=\x200;\x20i\x20<\x20_updateRecords.length;\x20i++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20updRecord\x20=\x20_updateRecords[i]\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20{{camelCase\x20name}}\x20=\x20await\x20{{camelCase\x20name}}Repo.findOne({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id:updRecord.id\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20relations:\x20[\x27domain\x27,\x20\x27updater\x27,\x20\x27creator\x27]\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20result\x20=\x20await\x20{{camelCase\x20name}}Repo.save({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...{{camelCase\x20name}},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...updRecord,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updater:\x20user\x0a\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20results.push({\x20...result,\x20cuFlag:\x20\x27M\x27\x20})\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20results\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20delete{{pascalCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove({\x20domain,\x20id,\x20updater:user\x20})\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a\x0a\x20\x20@Directive(\x27@transaction\x27)\x0a\x20\x20@Mutation(returns\x20=>\x20Boolean,\x20{\x20description:\x20\x27To\x20delete\x20multiple\x20{{camelCase\x20name}}s\x27\x20})\x0a\x20\x20async\x20delete{{pluralPascalCase\x20name}}(\x0a\x20\x20\x20\x20@Arg(\x27ids\x27,\x20type\x20=>\x20[String])\x20ids:\x20string[],\x0a\x20\x20\x20\x20@Ctx()\x20context:\x20any\x0a\x20\x20):\x20Promise<boolean>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain,\x20tx,\x20user\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20let\x20delEntitis\x20=\x20ids.map(id=>{\x0a\x20\x20\x20\x20\x20\x20return\x20{domain,id,updater:user}\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20await\x20tx.getRepository({{pascalCase\x20name}}).remove(delEntitis)\x0a\x0a\x20\x20\x20\x20return\x20true\x0a\x20\x20}\x0a}\x0a',sereviceType=a0_0x244365(0x1f6),sereviceHistoryType='\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a',serviceEntity='\x0aimport\x20{\x0a\x20\x20CreateDateColumn,\x0a\x20\x20UpdateDateColumn,\x0a\x20\x20Entity,\x0a\x20\x20Index,\x0a\x20\x20Column,\x0a\x20\x20RelationId,\x0a\x20\x20ManyToOne,\x0a\x20\x20PrimaryGeneratedColumn,\x0a\x20\x20VersionColumn\x0a}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20ObjectType,\x20Field,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20Domain\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0a\x0a@Entity(\x27{{tableName}}\x27)\x0a{{indexAnn}}\x0a@ObjectType({\x20description:\x20\x27Entity\x20for\x20{{pascalCase\x20name}}\x27\x20})\x0aexport\x20class\x20{{pascalCase\x20name}}\x20{\x0a\x20\x20@PrimaryGeneratedColumn(\x27uuid\x27)\x0a\x20\x20@Field(type\x20=>\x20ID)\x0a\x20\x20readonly\x20id:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20Domain,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20false\x20})\x0a\x20\x20domain:\x20Domain\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.domain)\x0a\x20\x20domainId:\x20string\x0a\x0a{{entityColumns}}\x0a\x0a\x20\x20@CreateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20createdAt?:\x20Date\x0a\x0a\x20\x20@UpdateDateColumn()\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updatedAt?:\x20Date\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20creator?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.creator)\x0a\x20\x20creatorId?:\x20string\x0a\x0a\x20\x20@ManyToOne(type\x20=>\x20User,\x20{\x0a\x20\x20\x20\x20createForeignKeyConstraints:\x20false,\x0a\x20\x20\x20\x20nullable:\x20true\x0a\x20\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20updater?:\x20User\x0a\x0a\x20\x20@RelationId(({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20{{camelCase\x20name}}.updater)\x0a\x20\x20updaterId?:\x20string\x0a}\x0a',serviceEntityHistCopy='\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_0x244365(0x1da),serviceEntitySubscriber=a0_0x244365(0x22f);
|
|
1
|
+
'use strict';const a0_0x8dae72=a0_0x882d;(function(_0x1946b0,_0x583f39){const _0x4f0ed8=a0_0x882d,_0x34f5dd=_0x1946b0();while(!![]){try{const _0x3bb181=parseInt(_0x4f0ed8(0x205))/0x1+-parseInt(_0x4f0ed8(0x216))/0x2+-parseInt(_0x4f0ed8(0x1fe))/0x3+-parseInt(_0x4f0ed8(0x244))/0x4+parseInt(_0x4f0ed8(0x227))/0x5*(-parseInt(_0x4f0ed8(0x237))/0x6)+-parseInt(_0x4f0ed8(0x1f7))/0x7*(parseInt(_0x4f0ed8(0x277))/0x8)+parseInt(_0x4f0ed8(0x20b))/0x9;if(_0x3bb181===_0x583f39)break;else _0x34f5dd['push'](_0x34f5dd['shift']());}catch(_0x3f043d){_0x34f5dd['push'](_0x34f5dd['shift']());}}}(a0_0x3a4d,0x1eb2f));function a0_0x882d(_0x2a3221,_0x4d2fc5){const _0x3a4d48=a0_0x3a4d();return a0_0x882d=function(_0x882d04,_0x1072f2){_0x882d04=_0x882d04-0x1f4;let _0x1fc587=_0x3a4d48[_0x882d04];return _0x1fc587;},a0_0x882d(_0x2a3221,_0x4d2fc5);}Object[a0_0x8dae72(0x24c)](exports,a0_0x8dae72(0x21c),{'value':!0x0}),exports[a0_0x8dae72(0x21f)]=void 0x0;const tslib_1=require(a0_0x8dae72(0x27f)),type_graphql_1=require(a0_0x8dae72(0x209)),shell_1=require(a0_0x8dae72(0x240)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x8dae72(0x22f)),{plural:plural}=require(a0_0x8dae72(0x215)),fs=require('fs');function a0_0x3a4d(){const _0x887c64=['tslib','\x20{\x20nullable:\x20','JSON','getFieldType','Arg','length','existsPath','text','createHistoryEntityText','...','createHistoryServiceFiles','220577yOamlk','creator','getRepository','double\x20precision','__decorate','EntityColumn','Int','549813VsPIih','-history-type.ts','created_at','design:returntype','number','/event-subscriber.ts','toolCreateService','61497tsdkAl','env','createServiceFiles','-history-query.ts','type-graphql','Entities,','8857854oEBJjG','long','updater_id','-query.ts','push','tableName','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','createDir','rank','includes','pluralize','255638LHmjNa','date','COPY','replaceNamesMap','findOne','design:type','__esModule','/*\x20ENTITIES\x20*/\x0a\x09...','domain','OperatoToolCreateService',',length:','\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','\x20})','bigint','\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','Entity','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','380870CKWeHs','join','export\x20*\x20from\x20\x27./','index.ts','updated_at','utf8','prototype','/packages/','lodash','\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','packages','\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','readFileSync','Operato\x20Tool\x20Create\x20Service','\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','EntitySubscribers,','12ksLVFS','getColTxtType','camelCaseName','name','\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','\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','datetime','-type.ts','Resolver','@things-factory/shell','\x27,\x20type:\x20\x27','@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})','Date','943780mNFqCU','columnToEntityColumn','Ctx','createEntityText','createTypeText','type\x20=>','filter','getProjectRootPath','defineProperty','float','character\x20varying','__metadata','map','uniqRank','creator_id','dataProp','\x0a\x20\x20','find','\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','{{camelCase\x20name}}.','decimal','pascalCaseName','domain_id','writeFile','indexOf','createNoHistoryServiceFiels','Query','split','/packages','Resolvers\x20}\x20from\x20\x27./','updater','writeFileSync','__param','\x27,\x20nullable:\x20','.ts','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','replace','@Field(','colType','nullable','Resolvers,','string','integer','EntitySubscribers\x20}\x20from\x20\x27./','timestamp\x20without\x20time\x20zone','-history\x27','state','snakeCaseName','createServicePath','sort','Float','56uiqBny','existsSync','import\x20{\x20entities\x20as\x20','mkdirSync','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}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','@Column({name:\x27','/index.ts','-mutation.ts'];a0_0x3a4d=function(){return _0x887c64;};return a0_0x3a4d();}let OperatoToolCreateService=class{async[a0_0x8dae72(0x204)](_0x3b92e1,_0x499a00){const _0x311771=a0_0x8dae72,{domain:_0x1b9c7e}=_0x499a00[_0x311771(0x272)],_0x592847=await(0x0,shell_1[_0x311771(0x1f9)])(resource_base_1[_0x311771(0x225)])[_0x311771(0x21a)]({'where':{'id':_0x3b92e1}}),_0x29a621=await(0x0,shell_1[_0x311771(0x1f9)])(resource_base_1[_0x311771(0x1fc)])[_0x311771(0x255)]({'where':{'domain':{'id':_0x1b9c7e['id']},'entity':{'id':_0x592847['id']}}});let {name:_0x4d3bde='',bundle:_0x1b2fd5=''}=_0x592847||{},_0x5058f0=this[_0x311771(0x24b)](),_0x4a1cb9=kebabCase(_0x4d3bde);return await this[_0x311771(0x274)](_0x5058f0,_0x1b2fd5,_0x4a1cb9),await this['createServiceFiles'](_0x5058f0,_0x1b2fd5,_0x4d3bde,_0x4a1cb9,_0x592847,_0x29a621),!0x0;}async[a0_0x8dae72(0x207)](_0x20ee4a,_0x41077d,_0x16f6db,_0x4ec2ea,_0x2d023a,_0x5e3dca){const _0xc430e5=a0_0x8dae72;let _0x39833e={'name':_0x4ec2ea,'tableName':_0x2d023a[_0xc430e5(0x210)],'pascalCaseName':startCase(camelCase(_0x16f6db))['replace'](/ /g,''),'camelCaseName':camelCase(_0x16f6db),'snakeCaseName':snakeCase(_0x16f6db),'pluralPascalCaseName':startCase(camelCase(plural(_0x16f6db)))[_0xc430e5(0x268)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x16f6db))},_0x2f802e=_0x20ee4a+_0xc430e5(0x22e)+_0x41077d+'/server/service/';['JSON',_0xc430e5(0x218)][_0xc430e5(0x214)](_0x2d023a['dataProp'])?await this[_0xc430e5(0x1f6)](_0x2f802e,_0x4ec2ea,_0x2d023a,_0x5e3dca,_0x39833e):await this[_0xc430e5(0x25d)](_0x2f802e,_0x4ec2ea,_0x2d023a,_0x5e3dca,_0x39833e);}async[a0_0x8dae72(0x1f6)](_0x2474ba,_0x5c1b1a,_0x570a98,_0x351d8d,_0x32999c){const _0x5eb60e=a0_0x8dae72;await this[_0x5eb60e(0x25b)](_0x2474ba+(_0x5c1b1a+_0x5eb60e(0x27d)),serviceHistoryIndex,_0x32999c);let _0x15a197=this[_0x5eb60e(0x247)](_0x570a98,_0x351d8d);await this[_0x5eb60e(0x25b)](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+_0x5eb60e(0x266)),_0x15a197,_0x32999c),await this['writeFile'](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+_0x5eb60e(0x20e)),serviceQuery,_0x32999c),await this['writeFile'](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+'-mutation.ts'),serviceMutation,_0x32999c);let _0x1ec6ba=this[_0x5eb60e(0x248)](_0x351d8d);await this[_0x5eb60e(0x25b)](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+'-type.ts'),_0x1ec6ba,_0x32999c);let _0x34ba0b=this[_0x5eb60e(0x1f4)](_0x570a98,_0x351d8d);await this[_0x5eb60e(0x25b)](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+'-history.ts'),_0x34ba0b,_0x32999c);let _0x3d3a09='';_0x5eb60e(0x281)==_0x570a98['dataProp']?(_0x3d3a09='\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20',await this['writeFile'](_0x2474ba+(_0x5c1b1a+'/event-subscriber.ts'),serviceEntitySubscriber,_0x32999c)):_0x3d3a09='';let _0x47d649=serviceEntitySubscriber[_0x5eb60e(0x268)](/{{entityToJson}}/g,_0x3d3a09);await this[_0x5eb60e(0x25b)](_0x2474ba+(_0x5c1b1a+_0x5eb60e(0x203)),_0x47d649,_0x32999c),await this['writeFile'](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+_0x5eb60e(0x208)),serviceHistoryQuery,_0x32999c),await this[_0x5eb60e(0x25b)](_0x2474ba+(_0x5c1b1a+'/'+_0x5c1b1a+_0x5eb60e(0x1ff)),sereviceHistoryType,_0x32999c);let _0x5ed14d=_0x2474ba+'index.ts';0x0==await this[_0x5eb60e(0x285)](_0x5ed14d)&&await this[_0x5eb60e(0x25b)](_0x5ed14d,allIndex,_0x32999c);let _0x9122ac=await fs[_0x5eb60e(0x233)](_0x5ed14d,_0x5eb60e(0x22c));_0x9122ac[_0x5eb60e(0x25c)]('export\x20*\x20from\x20\x27./'+_0x32999c[_0x5eb60e(0x23a)]+'/'+_0x32999c[_0x5eb60e(0x23a)]+'-history\x27')<0x0&&(_0x9122ac=_0x9122ac[_0x5eb60e(0x268)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x32999c[_0x5eb60e(0x23a)]+'/'+_0x32999c[_0x5eb60e(0x23a)]+_0x5eb60e(0x271))),_0x9122ac[_0x5eb60e(0x25c)](_0x5eb60e(0x229)+_0x32999c[_0x5eb60e(0x23a)]+'/'+_0x32999c[_0x5eb60e(0x23a)]+'\x27')<0x0&&(_0x9122ac=_0x9122ac['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x5eb60e(0x267)+_0x32999c[_0x5eb60e(0x23a)]+'/'+_0x32999c['name']+'\x27')),_0x9122ac[_0x5eb60e(0x25c)]('import\x20{\x20entities\x20as\x20'+_0x32999c[_0x5eb60e(0x259)]+'Entities,\x20resolvers\x20as\x20'+_0x32999c[_0x5eb60e(0x259)]+'Resolvers,\x20subscribers\x20as\x20'+_0x32999c['pascalCaseName']+_0x5eb60e(0x26f)+_0x32999c['name']+'\x27')<0x0&&(_0x9122ac=_0x9122ac['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x32999c[_0x5eb60e(0x259)]+'Entities,\x20resolvers\x20as\x20'+_0x32999c[_0x5eb60e(0x259)]+'Resolvers,\x20subscribers\x20as\x20'+_0x32999c[_0x5eb60e(0x259)]+'EntitySubscribers\x20}\x20from\x20\x27./'+_0x32999c[_0x5eb60e(0x23a)]+'\x27')),_0x9122ac['indexOf'](_0x5eb60e(0x1f5)+_0x32999c[_0x5eb60e(0x259)]+_0x5eb60e(0x20a))<0x0&&(_0x9122ac=_0x9122ac[_0x5eb60e(0x268)](/\/\* ENTITIES \*\//,_0x5eb60e(0x21d)+_0x32999c['pascalCaseName']+_0x5eb60e(0x20a))),_0x9122ac['indexOf'](_0x5eb60e(0x1f5)+_0x32999c['pascalCaseName']+_0x5eb60e(0x26c))<0x0&&(_0x9122ac=_0x9122ac['replace'](/\/\* RESOLVER CLASSES \*\//,_0x5eb60e(0x226)+_0x32999c[_0x5eb60e(0x259)]+_0x5eb60e(0x26c))),_0x9122ac[_0x5eb60e(0x25c)](_0x5eb60e(0x1f5)+_0x32999c[_0x5eb60e(0x259)]+_0x5eb60e(0x236))<0x0&&(_0x9122ac=_0x9122ac[_0x5eb60e(0x268)](/\/\* SUBSCRIBERS \*\//,'/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...'+_0x32999c[_0x5eb60e(0x259)]+_0x5eb60e(0x236))),await this['writeFile'](_0x5ed14d,_0x9122ac,_0x32999c);}async[a0_0x8dae72(0x25d)](_0x57e8a0,_0x10fbd0,_0x24ee0f,_0x1a3ff7,_0x46a077){const _0x1fd558=a0_0x8dae72;await this['writeFile'](_0x57e8a0+(_0x10fbd0+_0x1fd558(0x27d)),serviceIndex,_0x46a077),await this['writeFile'](_0x57e8a0+(_0x10fbd0+'/'+_0x10fbd0+_0x1fd558(0x20e)),serviceQuery,_0x46a077),await this[_0x1fd558(0x25b)](_0x57e8a0+(_0x10fbd0+'/'+_0x10fbd0+_0x1fd558(0x27e)),serviceMutation,_0x46a077);let _0x4589c0=this[_0x1fd558(0x247)](_0x24ee0f,_0x1a3ff7);await this['writeFile'](_0x57e8a0+(_0x10fbd0+'/'+_0x10fbd0+_0x1fd558(0x266)),_0x4589c0,_0x46a077);let _0x4f872d=this[_0x1fd558(0x248)](_0x1a3ff7);await this[_0x1fd558(0x25b)](_0x57e8a0+(_0x10fbd0+'/'+_0x10fbd0+_0x1fd558(0x23e)),_0x4f872d,_0x46a077);let _0x4d99c3=_0x57e8a0+_0x1fd558(0x22a);0x0==await this[_0x1fd558(0x285)](_0x4d99c3)&&await this[_0x1fd558(0x25b)](_0x4d99c3,allIndex,_0x46a077);let _0xc205e=await fs['readFileSync'](_0x4d99c3,'utf8');_0xc205e[_0x1fd558(0x25c)]('export\x20*\x20from\x20\x27./'+_0x46a077[_0x1fd558(0x23a)]+'/'+_0x46a077[_0x1fd558(0x23a)]+'\x27')<0x0&&(_0xc205e=_0xc205e['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x1fd558(0x267)+_0x46a077[_0x1fd558(0x23a)]+'/'+_0x46a077['name']+'\x27')),_0xc205e[_0x1fd558(0x25c)](_0x1fd558(0x279)+_0x46a077[_0x1fd558(0x259)]+'Entities,\x20resolvers\x20as\x20'+_0x46a077[_0x1fd558(0x259)]+'Resolvers\x20}\x20from\x20\x27./'+_0x46a077[_0x1fd558(0x23a)]+'\x27')<0x0&&(_0xc205e=_0xc205e[_0x1fd558(0x268)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x1fd558(0x211)+_0x46a077[_0x1fd558(0x259)]+'Entities,\x20resolvers\x20as\x20'+_0x46a077[_0x1fd558(0x259)]+_0x1fd558(0x261)+_0x46a077[_0x1fd558(0x23a)]+'\x27')),_0xc205e[_0x1fd558(0x25c)](_0x1fd558(0x1f5)+_0x46a077['pascalCaseName']+_0x1fd558(0x20a))<0x0&&(_0xc205e=_0xc205e[_0x1fd558(0x268)](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x46a077[_0x1fd558(0x259)]+_0x1fd558(0x20a))),_0xc205e[_0x1fd558(0x25c)](_0x1fd558(0x1f5)+_0x46a077[_0x1fd558(0x259)]+_0x1fd558(0x26c))<0x0&&(_0xc205e=_0xc205e['replace'](/\/\* RESOLVER CLASSES \*\//,'/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...'+_0x46a077[_0x1fd558(0x259)]+_0x1fd558(0x26c))),await this[_0x1fd558(0x25b)](_0x4d99c3,_0xc205e,_0x46a077);}[a0_0x8dae72(0x248)](_0x4c4bb6){const _0xaddf06=a0_0x8dae72;let _0x299967=sereviceType,_0x2f5609=_0x4c4bb6[_0xaddf06(0x250)](_0x27662a=>{const _0x2ca57c=_0xaddf06;if('id'==_0x27662a[_0x2ca57c(0x23a)])return'';if(_0x2ca57c(0x25a)==_0x27662a[_0x2ca57c(0x23a)])return'';if('created_at'==_0x27662a['name'])return'';if('updated_at'==_0x27662a['name'])return'';if(_0x2ca57c(0x252)==_0x27662a[_0x2ca57c(0x23a)])return'';if(_0x2ca57c(0x20d)==_0x27662a[_0x2ca57c(0x23a)])return'';let _0x23effc=this[_0x2ca57c(0x282)](_0x27662a),_0x4c88c2=this[_0x2ca57c(0x238)](_0x27662a),_0x8ce92f=camelCase(_0x27662a[_0x2ca57c(0x23a)]);return'\x20\x20'+(_0x2ca57c(0x269)+(0x0==_0x23effc[_0x2ca57c(0x284)]?'':_0x2ca57c(0x249)+_0x23effc+',')+_0x2ca57c(0x280)+_0x27662a[_0x2ca57c(0x26b)]+_0x2ca57c(0x222))+_0x2ca57c(0x254)+(''+_0x8ce92f+(_0x27662a['nullable']?'?':'')+':\x20'+_0x4c88c2)+'\x0a';});_0x299967=_0x299967['replace'](/{{newTypeColumns}}/g,_0x2f5609[_0xaddf06(0x228)]('\x0a'));let _0x1f2f75=_0x4c4bb6[_0xaddf06(0x250)](_0x341cea=>{const _0x4558b5=_0xaddf06;if('id'==_0x341cea[_0x4558b5(0x23a)])return'';if(_0x4558b5(0x25a)==_0x341cea[_0x4558b5(0x23a)])return'';if('created_at'==_0x341cea[_0x4558b5(0x23a)])return'';if('updated_at'==_0x341cea[_0x4558b5(0x23a)])return'';if('creator_id'==_0x341cea[_0x4558b5(0x23a)])return'';if(_0x4558b5(0x20d)==_0x341cea[_0x4558b5(0x23a)])return'';let _0x45b14a=this['getFieldType'](_0x341cea),_0x4e1167=this[_0x4558b5(0x238)](_0x341cea);_0x341cea['nullable']=!0x0;let _0x27e8d3=camelCase(_0x341cea[_0x4558b5(0x23a)]);return'\x20\x20'+(_0x4558b5(0x269)+(0x0==_0x45b14a[_0x4558b5(0x284)]?'':_0x4558b5(0x249)+_0x45b14a+',')+_0x4558b5(0x280)+_0x341cea['nullable']+_0x4558b5(0x222))+_0x4558b5(0x254)+(''+_0x27e8d3+(_0x341cea[_0x4558b5(0x26b)]?'?':'')+':\x20'+_0x4e1167)+'\x0a';});return _0x299967=_0x299967[_0xaddf06(0x268)](/{{patchTypeColumns}}/g,_0x1f2f75[_0xaddf06(0x228)]('\x0a')),_0x299967;}['createEntityText'](_0x5047d1,_0x83682f){const _0x2a9732=a0_0x8dae72;let _0x93ebc5=serviceEntity,_0x5436c2=_0x83682f[_0x2a9732(0x275)](function(_0x4d911b,_0x5cbbcc){const _0xe967d0=_0x2a9732;return _0x4d911b[_0xe967d0(0x213)]-_0x5cbbcc[_0xe967d0(0x213)];})[_0x2a9732(0x250)](_0x389c26=>this[_0x2a9732(0x245)](_0x389c26));[_0x2a9732(0x218),_0x2a9732(0x281)][_0x2a9732(0x214)](_0x5047d1[_0x2a9732(0x253)])&&_0x5436c2[_0x2a9732(0x20f)]('\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201'),_0x93ebc5=_0x93ebc5[_0x2a9732(0x268)](/{{entityColumns}}/g,_0x5436c2[_0x2a9732(0x228)]('\x0a'));let _0x3f6a4f='',_0x1acaab=_0x83682f[_0x2a9732(0x24a)](_0x55ec88=>_0x55ec88[_0x2a9732(0x251)]&&_0x55ec88['uniqRank']>0x0)[_0x2a9732(0x275)](function(_0x293f85,_0x3102cc){const _0x5674a8=_0x2a9732;return _0x293f85['uniqRank']-_0x3102cc[_0x5674a8(0x251)];});if(_0x1acaab['length']>0x0){_0x3f6a4f=_0x2a9732(0x242);let _0x5c1fb4=_0x1acaab[_0x2a9732(0x250)](_0x102a4e=>{const _0x4683eb=_0x2a9732;let _0x21bbd4=_0x102a4e[_0x4683eb(0x23a)];return _0x4683eb(0x25a)==_0x102a4e['name']&&(_0x21bbd4=_0x4683eb(0x21e)),_0x4683eb(0x252)==_0x102a4e[_0x4683eb(0x23a)]&&(_0x21bbd4=_0x4683eb(0x1f8)),_0x4683eb(0x20d)==_0x102a4e[_0x4683eb(0x23a)]&&(_0x21bbd4=_0x4683eb(0x262)),_0x4683eb(0x257)+camelCase(_0x21bbd4);});_0x3f6a4f=_0x3f6a4f[_0x2a9732(0x268)](/{{indexColumns}}/g,_0x5c1fb4[_0x2a9732(0x228)](','));}return _0x93ebc5=_0x93ebc5[_0x2a9732(0x268)](/{{indexAnn}}/g,_0x3f6a4f),_0x93ebc5;}[a0_0x8dae72(0x1f4)](_0x4371a0,_0x4b60be){const _0x4612fe=a0_0x8dae72;let _0x32079e=_0x4612fe(0x281)==_0x4371a0['dataProp']?serviceEntityHistJson:serviceEntityHistCopy,_0x531607=_0x4b60be[_0x4612fe(0x275)](function(_0x4f2d9e,_0x1ad19f){const _0x2d965f=_0x4612fe;return _0x4f2d9e[_0x2d965f(0x213)]-_0x1ad19f['rank'];})['map'](_0x510aff=>this[_0x4612fe(0x245)](_0x510aff));return _0x32079e=_0x32079e['replace'](/{{entityColumns}}/g,_0x531607[_0x4612fe(0x228)]('\x0a')),_0x32079e;}['columnToEntityColumn'](_0x47af91){const _0x26e256=a0_0x8dae72;if('id'==_0x47af91[_0x26e256(0x23a)])return'';if(_0x26e256(0x25a)==_0x47af91['name'])return'';if(_0x26e256(0x200)==_0x47af91['name'])return'';if(_0x26e256(0x22b)==_0x47af91[_0x26e256(0x23a)])return'';if(_0x26e256(0x252)==_0x47af91['name'])return'';if(_0x26e256(0x20d)==_0x47af91[_0x26e256(0x23a)])return'';let _0x54fe54=_0x47af91['colType'];'double'==_0x47af91[_0x26e256(0x26a)]&&(_0x54fe54=_0x26e256(0x1fa)),'long'==_0x47af91[_0x26e256(0x26a)]&&(_0x54fe54=_0x26e256(0x223)),_0x26e256(0x26d)==_0x47af91[_0x26e256(0x26a)]&&(_0x54fe54=_0x26e256(0x24e)),'datetime'==_0x47af91['colType']&&(_0x54fe54=_0x26e256(0x270));let _0x3f2791='';_0x26e256(0x26d)==_0x47af91[_0x26e256(0x26a)]&&(_0x3f2791=_0x47af91['colSize']);let _0x408626=this[_0x26e256(0x282)](_0x47af91),_0xe680e9=this[_0x26e256(0x238)](_0x47af91),_0x4ce479=camelCase(_0x47af91[_0x26e256(0x23a)]);return'\x20\x20'+(_0x26e256(0x27c)+_0x47af91['name']+_0x26e256(0x241)+_0x54fe54+_0x26e256(0x265)+_0x47af91[_0x26e256(0x26b)]+'\x20'+(0x0==_0x3f2791[_0x26e256(0x284)]?'':_0x26e256(0x220)+_0x3f2791)+'\x20})')+'\x0a\x20\x20'+('@Field('+(0x0==_0x408626[_0x26e256(0x284)]?'':_0x26e256(0x249)+_0x408626+',')+_0x26e256(0x280)+_0x47af91[_0x26e256(0x26b)]+_0x26e256(0x222))+'\x0a\x20\x20'+(''+_0x4ce479+(_0x47af91[_0x26e256(0x26b)]?'?':'')+':\x20'+_0xe680e9)+'\x0a';}[a0_0x8dae72(0x282)](_0x19c0f3){const _0x4e1f23=a0_0x8dae72;let _0x553ec6='';return'double'==_0x19c0f3[_0x4e1f23(0x26a)]&&(_0x553ec6=_0x4e1f23(0x276)),_0x4e1f23(0x24d)==_0x19c0f3[_0x4e1f23(0x26a)]&&(_0x553ec6='Float'),_0x4e1f23(0x20c)==_0x19c0f3['colType']&&(_0x553ec6='Int'),_0x4e1f23(0x26e)==_0x19c0f3['colType']&&(_0x553ec6=_0x4e1f23(0x1fd)),_0x553ec6;}[a0_0x8dae72(0x238)](_0x3143c3){const _0xda5b5f=a0_0x8dae72;let _0x3fdd9=_0x3143c3[_0xda5b5f(0x26a)];return _0xda5b5f(0x258)==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9='number'),'double'==_0x3143c3['colType']&&(_0x3fdd9=_0xda5b5f(0x202)),_0xda5b5f(0x24d)==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9=_0xda5b5f(0x202)),'integer'==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9=_0xda5b5f(0x202)),'long'==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9=_0xda5b5f(0x202)),_0xda5b5f(0x23d)==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9=_0xda5b5f(0x243)),_0xda5b5f(0x217)==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9=_0xda5b5f(0x243)),_0xda5b5f(0x286)==_0x3143c3[_0xda5b5f(0x26a)]&&(_0x3fdd9='string'),_0x3fdd9;}async['writeFile'](_0xc91069,_0x77b62d,_0x392762){const _0xb0f1d2=a0_0x8dae72;await fs[_0xb0f1d2(0x263)](_0xc91069,this[_0xb0f1d2(0x219)](_0x77b62d,_0x392762),_0xb0f1d2(0x22c));}[a0_0x8dae72(0x219)](_0x11bc20,_0x1f178){const _0x25e50c=a0_0x8dae72;return _0x11bc20[_0x25e50c(0x268)](/{{pascalCase name}}/g,_0x1f178[_0x25e50c(0x259)])[_0x25e50c(0x268)](/{{camelCase name}}/g,_0x1f178[_0x25e50c(0x239)])[_0x25e50c(0x268)](/{{snakeCase name}}/g,_0x1f178[_0x25e50c(0x273)])[_0x25e50c(0x268)](/{{pluralPascalCase name}}/g,_0x1f178['pluralPascalCaseName'])[_0x25e50c(0x268)](/{{pluralCamelCase name}}/g,_0x1f178['pluralCamelCaseName'])[_0x25e50c(0x268)](/{{tableName}}/g,_0x1f178[_0x25e50c(0x210)])['replace'](/{{name}}/g,_0x1f178[_0x25e50c(0x23a)]);}async[a0_0x8dae72(0x274)](_0x24ab70,_0x2e141f,_0x473184){const _0x423b32=a0_0x8dae72;let _0x4b9cb7=_0x24ab70+_0x423b32(0x260);await this[_0x423b32(0x212)](_0x4b9cb7),_0x4b9cb7=_0x4b9cb7+'/'+_0x2e141f,await this[_0x423b32(0x212)](_0x4b9cb7),_0x4b9cb7+='/server',await this[_0x423b32(0x212)](_0x4b9cb7),_0x4b9cb7+='/service',await this[_0x423b32(0x212)](_0x4b9cb7),_0x4b9cb7=_0x4b9cb7+'/'+_0x473184,await this[_0x423b32(0x212)](_0x4b9cb7);}[a0_0x8dae72(0x24b)](){const _0x58cd4f=a0_0x8dae72;let _0x2394f6=process[_0x58cd4f(0x206)]['PWD'][_0x58cd4f(0x25f)]('/'),_0x3c60fb=[];for(let _0x4880be=0x0;_0x4880be<_0x2394f6['length']&&_0x58cd4f(0x231)!=_0x2394f6[_0x4880be];_0x4880be++)_0x3c60fb[_0x58cd4f(0x20f)](_0x2394f6[_0x4880be]);return _0x3c60fb[_0x58cd4f(0x228)]('/');}async[a0_0x8dae72(0x212)](_0x438d1a){const _0x53a0f0=a0_0x8dae72;0x0==await this['existsPath'](_0x438d1a)&&fs[_0x53a0f0(0x27a)](_0x438d1a);}async['existsPath'](_0x2c192a){const _0x35a281=a0_0x8dae72;return await fs[_0x35a281(0x278)](_0x2c192a);}};tslib_1[a0_0x8dae72(0x1fb)]([(0x0,type_graphql_1[a0_0x8dae72(0x25e)])(_0x3301c1=>Boolean,{'description':a0_0x8dae72(0x234)}),tslib_1[a0_0x8dae72(0x264)](0x0,(0x0,type_graphql_1[a0_0x8dae72(0x283)])('id')),tslib_1[a0_0x8dae72(0x264)](0x1,(0x0,type_graphql_1[a0_0x8dae72(0x246)])()),tslib_1[a0_0x8dae72(0x24f)](a0_0x8dae72(0x21b),Function),tslib_1[a0_0x8dae72(0x24f)]('design:paramtypes',[String,Object]),tslib_1[a0_0x8dae72(0x24f)](a0_0x8dae72(0x201),Promise)],OperatoToolCreateService[a0_0x8dae72(0x22d)],a0_0x8dae72(0x204),null),OperatoToolCreateService=tslib_1[a0_0x8dae72(0x1fb)]([(0x0,type_graphql_1[a0_0x8dae72(0x23f)])()],OperatoToolCreateService),exports['OperatoToolCreateService']=OperatoToolCreateService;const allIndex=a0_0x8dae72(0x221),serviceIndex=a0_0x8dae72(0x224),serviceHistoryIndex=a0_0x8dae72(0x27b),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_0x8dae72(0x232),serviceMutation=a0_0x8dae72(0x235),sereviceType=a0_0x8dae72(0x256),sereviceHistoryType='\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryList\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}History])\x0a\x20\x20items:\x20{{pascalCase\x20name}}History[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a',serviceEntity=a0_0x8dae72(0x230),serviceEntityHistCopy=a0_0x8dae72(0x23c),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_0x8dae72(0x23b);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x23524d=a0_0x2be7;(function(_0x2e9c59,_0xfac4f3){const _0x2e6a17=a0_0x2be7,_0x468560=_0x2e9c59();while(!![]){try{const _0x513ed2=parseInt(_0x2e6a17(0xe6))/0x1*(parseInt(_0x2e6a17(0xe9))/0x2)+parseInt(_0x2e6a17(0xf3))/0x3*(-parseInt(_0x2e6a17(0xe8))/0x4)+parseInt(_0x2e6a17(0xf5))/0x5+-parseInt(_0x2e6a17(0xf8))/0x6+-parseInt(_0x2e6a17(0xe0))/0x7*(parseInt(_0x2e6a17(0xf6))/0x8)+-parseInt(_0x2e6a17(0xdc))/0x9+parseInt(_0x2e6a17(0xe3))/0xa;if(_0x513ed2===_0xfac4f3)break;else _0x468560['push'](_0x468560['shift']());}catch(_0x2b2079){_0x468560['push'](_0x468560['shift']());}}}(a0_0x89c4,0xbf687));Object['defineProperty'](exports,'__esModule',{'value':!0x0}),exports[a0_0x23524d(0xf1)]=exports['checkStudioPermission']=void 0x0;const operato_license_checker_1=require('@things-factory/operato-license-checker'),shell_1=require(a0_0x23524d(0xe5)),menu_base_1=require(a0_0x23524d(0xea)),license_error_1=require(a0_0x23524d(0xf0));async function checkStudioPermission(){const _0x21b056=a0_0x23524d;let _0x235aa2=((0x0,operato_license_checker_1['getPermission'])('Permissions\x20For\x20Tailor\x20Tool')||',')[_0x21b056(0xf2)](',')[_0x21b056(0xf7)](_0x55735e=>_0x55735e[_0x21b056(0xec)]()),_0x30740d=!0x1;return _0x235aa2['forEach'](_0x5760fd=>{_0x5760fd['includes']('Studio')&&(_0x30740d=!0x0);}),_0x30740d;}async function checkStudioTemplateIsOverLimit(_0x6972dc,_0x46a44b){const _0x393ce5=a0_0x23524d;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x393ce5(0xfb))]({'errorCode':_0x46a44b['t'](license_error_1['LicenseError']['ERROR_CODES']['INVALID_LICENSE'])});var _0x402a2b=0x0;if(_0x402a2b=_0x6972dc&&''!=_0x6972dc?await(0x0,shell_1[_0x393ce5(0xee)])(menu_base_1[_0x393ce5(0xeb)])[_0x393ce5(0xdf)][_0x393ce5(0xdb)]()[_0x393ce5(0xed)](_0x393ce5(0xf4))['from'](menu_base_1[_0x393ce5(0xeb)],_0x393ce5(0xf4))[_0x393ce5(0xe1)](_0x393ce5(0xe4),{'id':_0x6972dc})[_0x393ce5(0xde)](_0x393ce5(0xfa))[_0x393ce5(0xdd)]()+0x1:await(0x0,shell_1[_0x393ce5(0xee)])(menu_base_1[_0x393ce5(0xeb)])[_0x393ce5(0xdf)][_0x393ce5(0xdb)]()[_0x393ce5(0xed)](_0x393ce5(0xf4))[_0x393ce5(0xe7)](menu_base_1[_0x393ce5(0xeb)],_0x393ce5(0xf4))[_0x393ce5(0xe1)](_0x393ce5(0xfa))[_0x393ce5(0xdd)]()+0x1,!(0x0,operato_license_checker_1[_0x393ce5(0xef)])(_0x402a2b))throw new license_error_1[(_0x393ce5(0xfb))]({'errorCode':_0x46a44b['t'](license_error_1['LicenseError']['ERROR_CODES'][_0x393ce5(0xf9)])});return!0x0;}function a0_0x2be7(_0x2b7202,_0x5aae81){const _0x89c404=a0_0x89c4();return a0_0x2be7=function(_0x2be779,_0x10fe44){_0x2be779=_0x2be779-0xdb;let _0x5167e7=_0x89c404[_0x2be779];return _0x5167e7;},a0_0x2be7(_0x2b7202,_0x5aae81);}function a0_0x89c4(){const _0x32877a=['16YLEwUc','map','1538208xkwIlo','OVER_LIMIT','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','LicenseError','createQueryBuilder','10105479puVWfs','getCount','andWhere','manager','2102898TAjJZx','where','checkStudioPermission','34327430lOGdmK','id\x20!=\x20:id','@things-factory/shell','3422mTNBDi','from','1044932dpTGHY','8McgCkO','@things-factory/menu-base','Menu','trim','select','getRepository','checkTarget','../../errors/license-error','checkStudioTemplateIsOverLimit','split','15SdJwjm','menu','3118840nnyQAn'];a0_0x89c4=function(){return _0x32877a;};return a0_0x89c4();}exports[a0_0x23524d(0xe2)]=checkStudioPermission,exports[a0_0x23524d(0xf1)]=checkStudioTemplateIsOverLimit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x5223(_0x389cb7,_0x545c7b){const _0x222634=a0_0x2226();return a0_0x5223=function(_0x522318,_0x33fb64){_0x522318=_0x522318-0x1a2;let _0x37c291=_0x222634[_0x522318];return _0x37c291;},a0_0x5223(_0x389cb7,_0x545c7b);}const a0_0xe4cc82=a0_0x5223;(function(_0x12f720,_0x1b1e39){const _0x4509c3=a0_0x5223,_0x1ca448=_0x12f720();while(!![]){try{const _0x59b171=parseInt(_0x4509c3(0x1bf))/0x1+parseInt(_0x4509c3(0x1a9))/0x2+parseInt(_0x4509c3(0x1b4))/0x3*(-parseInt(_0x4509c3(0x1b2))/0x4)+-parseInt(_0x4509c3(0x1a5))/0x5*(-parseInt(_0x4509c3(0x1be))/0x6)+-parseInt(_0x4509c3(0x1ba))/0x7*(parseInt(_0x4509c3(0x1c1))/0x8)+-parseInt(_0x4509c3(0x1aa))/0x9*(parseInt(_0x4509c3(0x1b3))/0xa)+-parseInt(_0x4509c3(0x1b1))/0xb*(parseInt(_0x4509c3(0x1ac))/0xc);if(_0x59b171===_0x1b1e39)break;else _0x1ca448['push'](_0x1ca448['shift']());}catch(_0x18c5a0){_0x1ca448['push'](_0x1ca448['shift']());}}}(a0_0x2226,0xc915b));Object[a0_0xe4cc82(0x1b7)](exports,a0_0xe4cc82(0x1a7),{'value':!0x0}),exports[a0_0xe4cc82(0x1ad)]=void 0x0;const tslib_1=require(a0_0xe4cc82(0x1a6)),type_graphql_1=require(a0_0xe4cc82(0x1a2)),tool_permission_1=require(a0_0xe4cc82(0x1bd));let OperatoToolResolver=class{async[a0_0xe4cc82(0x1b6)](_0xf9edb7){const _0x4614b9=a0_0xe4cc82;return(0x0,tool_permission_1[_0x4614b9(0x1af)])();}async[a0_0xe4cc82(0x1a4)](_0x46c53f,_0x4803ba){return(0x0,tool_permission_1['checkStudioTemplateIsOverLimit'])(_0x46c53f,_0x4803ba);}};tslib_1[a0_0xe4cc82(0x1c2)]([(0x0,type_graphql_1[a0_0xe4cc82(0x1b5)])(_0x54ecfc=>Boolean,{'description':a0_0xe4cc82(0x1c0)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0xe4cc82(0x1bc)])()),tslib_1[a0_0xe4cc82(0x1b0)](a0_0xe4cc82(0x1b9),Function),tslib_1['__metadata'](a0_0xe4cc82(0x1a3),[Object]),tslib_1[a0_0xe4cc82(0x1b0)](a0_0xe4cc82(0x1b8),Promise)],OperatoToolResolver[a0_0xe4cc82(0x1ae)],a0_0xe4cc82(0x1b6),null),tslib_1[a0_0xe4cc82(0x1c2)]([(0x0,type_graphql_1[a0_0xe4cc82(0x1b5)])(_0x4ddf94=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Limit\x20check'}),tslib_1[a0_0xe4cc82(0x1a8)](0x0,(0x0,type_graphql_1[a0_0xe4cc82(0x1bb)])('id')),tslib_1[a0_0xe4cc82(0x1a8)](0x1,(0x0,type_graphql_1[a0_0xe4cc82(0x1bc)])()),tslib_1['__metadata']('design:type',Function),tslib_1[a0_0xe4cc82(0x1b0)](a0_0xe4cc82(0x1a3),[String,Object]),tslib_1[a0_0xe4cc82(0x1b0)](a0_0xe4cc82(0x1b8),Promise)],OperatoToolResolver[a0_0xe4cc82(0x1ae)],a0_0xe4cc82(0x1a4),null),OperatoToolResolver=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0xe4cc82(0x1ab)])()],OperatoToolResolver),exports[a0_0xe4cc82(0x1ad)]=OperatoToolResolver;function a0_0x2226(){const _0x2f386b=['1105611UVSToT','Query','studioPermission','defineProperty','design:returntype','design:type','8519VwLXII','Arg','Ctx','./tool-permission','18TKSQjd','1603310UpVVjl','Operato\x20Tool\x20Studio\x20Usage\x20Permissions','184CvniPz','__decorate','type-graphql','design:paramtypes','studioTemplateIsOverLimit','1265800aTKvfG','tslib','__esModule','__param','1263160WMrMYd','434637zywStw','Resolver','3636nbChKo','OperatoToolResolver','prototype','checkStudioPermission','__metadata','45771NYEuTP','8GbEIJP','30GipeHg'];a0_0x2226=function(){return _0x2f386b;};return a0_0x2226();}
|