@things-factory/operato-tools 6.1.46 → 6.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/actions/main.js +1 -1
- package/client/pages/generator/button-config-tab-mixin.js +4 -4
- package/client/pages/generator/column-config-tab-mixin.js +4 -4
- package/client/pages/generator/etc-config-tab-mixin.js +4 -4
- package/client/pages/generator/form-config-tab-mixin.js +4 -4
- package/client/pages/generator/graphql-config-tab-mixin.js +24 -24
- package/client/pages/generator/grid-config-tab-mixin.js +22 -22
- package/client/pages/generator/grid-emphasized-config-tab-mixin.js +8 -8
- package/client/pages/generator/menu-config-tab-mixin.js +11 -11
- package/client/pages/generator/meta-generator-page.js +11 -11
- package/client/pages/generator/search-config-tab-mixin.js +4 -4
- package/client/pages/generator/tab-config-tab-mixin.js +4 -4
- package/client/pages/main.js +4 -4
- package/client/reducers/main.js +1 -1
- package/package.json +3 -3
- package/server/constants/error-code.js +1 -1
- package/server/errors/license-error.js +1 -1
- package/server/routes.js +1 -1
- package/server/service/tool-entity/create-menu.js +1 -1
- package/server/service/tool-entity/create-service.js +1 -1
- package/server/service/tool-secret/tool-permission.js +1 -1
- package/server/service/tool-secret/tool-resolver.js +1 -1
package/client/pages/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var a0_0x4cdbdd=a0_0x1d60;(function(_0x1e01b3,_0x17c6f1){var _0x1b64fc=a0_0x1d60,_0x506e88=_0x1e01b3();while(!![]){try{var _0x1dc7c6=-parseInt(_0x1b64fc(0xb9))/0x1*(-parseInt(_0x1b64fc(0xb5))/0x2)+-parseInt(_0x1b64fc(0xb8))/0x3+-parseInt(_0x1b64fc(0xc6))/0x4*(-parseInt(_0x1b64fc(0xc2))/0x5)+parseInt(_0x1b64fc(0xc8))/0x6*(-parseInt(_0x1b64fc(0xbb))/0x7)+-parseInt(_0x1b64fc(0xc0))/0x8*(parseInt(_0x1b64fc(0xb7))/0x9)+-parseInt(_0x1b64fc(0xc7))/0xa+-parseInt(_0x1b64fc(0xbd))/0xb*(-parseInt(_0x1b64fc(0xbe))/0xc);if(_0x1dc7c6===_0x17c6f1)break;else _0x506e88['push'](_0x506e88['shift']());}catch(_0x188693){_0x506e88['push'](_0x506e88['shift']());}}}(a0_0x18b0,0x672bd));import{html,css}from'lit-element';import{connect}from'pwa-helpers/connect-mixin.js';import{store,PageView}from'@things-factory/shell';import{TermsUtil}from'@things-factory/meta-ui';function a0_0x1d60(_0x2a5d0c,_0x3bab61){var _0x18b039=a0_0x18b0();return a0_0x1d60=function(_0x1d6028,_0x37d4c1){_0x1d6028=_0x1d6028-0xb5;var _0xa0c8f5=_0x18b039[_0x1d6028];return _0xa0c8f5;},a0_0x1d60(_0x2a5d0c,_0x3bab61);}function a0_0x18b0(){var _0x489699=['1226406JafvBM','7SrWKar','context','3644844wkLrxo','operato-tools-main','10238426QHKKhi','12plrawj','tText','40yJWjNU','styles','45dowLPl','define','tool\x20start\x20msg','render','122548ehHpbm','864400laSsey','6ucWuKk','221894ItpTXb','customElements','980289jmlzGN'];a0_0x18b0=function(){return _0x489699;};return a0_0x18b0();}class OperatoToolsMain extends connect(store)(PageView){static get[a0_0x4cdbdd(0xc1)](){return[css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
background-color: var(--main-section-background-color);
|
|
@@ -41,11 +41,11 @@ function a0_0x2e89(){var _0x23933c=['tool\x20start\x20msg','4uRebUu','10896294my
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`];}get[
|
|
44
|
+
`];}get[a0_0x4cdbdd(0xba)](){return{'title':'Operato\x20Tools','actions':[]};}[a0_0x4cdbdd(0xc5)](){var _0x36f9c9=a0_0x4cdbdd;return html`
|
|
45
45
|
<h2>Operato Tools</h2>
|
|
46
46
|
<p page-description>
|
|
47
|
-
${TermsUtil[
|
|
47
|
+
${TermsUtil[_0x36f9c9(0xbf)](_0x36f9c9(0xc4))}
|
|
48
48
|
</p>
|
|
49
49
|
|
|
50
50
|
<img src="/assets/images/operato-tools.png" />
|
|
51
|
-
`;}}window[
|
|
51
|
+
`;}}window[a0_0x4cdbdd(0xb6)][a0_0x4cdbdd(0xc3)](a0_0x4cdbdd(0xbc),OperatoToolsMain);
|
package/client/reducers/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x416892=a0_0x5142;(function(_0x29f6e9,_0x443157){const _0x2370cb=a0_0x5142,_0x56eeb6=_0x29f6e9();while(!![]){try{const _0x4c7332=-parseInt(_0x2370cb(0x180))/0x1*(parseInt(_0x2370cb(0x179))/0x2)+-parseInt(_0x2370cb(0x17d))/0x3*(-parseInt(_0x2370cb(0x188))/0x4)+-parseInt(_0x2370cb(0x181))/0x5*(-parseInt(_0x2370cb(0x17b))/0x6)+-parseInt(_0x2370cb(0x186))/0x7*(-parseInt(_0x2370cb(0x17a))/0x8)+parseInt(_0x2370cb(0x17f))/0x9*(parseInt(_0x2370cb(0x18a))/0xa)+-parseInt(_0x2370cb(0x187))/0xb*(parseInt(_0x2370cb(0x183))/0xc)+-parseInt(_0x2370cb(0x17e))/0xd*(parseInt(_0x2370cb(0x178))/0xe);if(_0x4c7332===_0x443157)break;else _0x56eeb6['push'](_0x56eeb6['shift']());}catch(_0xee8ceb){_0x56eeb6['push'](_0x56eeb6['shift']());}}}(a0_0x11dc,0x49d73));import a0_0x577b87 from'graphql-tag';import{i18next}from'@operato/i18n';import{store}from'@operato/shell';import{client,gqlContext}from'@operato/graphql';import{UPDATE_OPERATO_TOOLS}from'../actions/main';const INITIAL_STATE={'operatoTools':a0_0x416892(0x189),'studioPermission':!0x1};function a0_0x5142(_0x1232df,_0x264ab4){const _0x11dcc=a0_0x11dc();return a0_0x5142=function(_0x514246,_0x2d9a0d){_0x514246=_0x514246-0x176;let _0x25f082=_0x11dcc[_0x514246];return _0x25f082;},a0_0x5142(_0x1232df,_0x264ab4);}function a0_0x11dc(){const _0x58b8dd=['type','state','1501514EvCCNP','55ryUWuo','1396qoPsDB','ABC','50UZRqYT','UPDATE_OPERATO_TOOLS_PERMISSION','dispatch','92288XzAvTJ','2WBnwHQ','16PrZgDd','80634azeMFH','errors','3921wCBPCL','832YObyAx','210555SsNldi','255469kbPyWI','95guUore','query','666372FzRURH'];a0_0x11dc=function(){return _0x58b8dd;};return a0_0x11dc();}export const UPDATE_OPERATO_TOOLS_PERMISSION=a0_0x416892(0x176);((async()=>{const _0x2234a2=a0_0x416892;var _0x1a3729=await client[_0x2234a2(0x182)]({'query':a0_0x577b87`{studioPermission}`});let _0x5673fc=!0x1;_0x1a3729[_0x2234a2(0x17c)]||(_0x5673fc=_0x1a3729['data']['studioPermission']),store[_0x2234a2(0x177)]({'type':UPDATE_OPERATO_TOOLS_PERMISSION,'state':{'studioPermission':_0x5673fc}});})());const operatoTools=(_0x30171f=INITIAL_STATE,_0x26a98d)=>{const _0xd95c13=a0_0x416892;switch(_0x26a98d[_0xd95c13(0x184)]){case UPDATE_OPERATO_TOOLS:return{..._0x30171f};case UPDATE_OPERATO_TOOLS_PERMISSION:return{...INITIAL_STATE,..._0x26a98d[_0xd95c13(0x185)]};default:return _0x30171f;}};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.47",
|
|
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.47",
|
|
33
33
|
"@things-factory/operato-license-checker": "^3.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@things-factory/builder": "^6.1.46",
|
|
37
37
|
"@things-factory/meta-ui": "^6.0.0-alpha.6"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "288c08459f4e3df5ae883497f23f63e85f75726f"
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x198c4f=a0_0x3189;(function(_0x244e37,_0x2c6249){var _0x2132a6=a0_0x3189,_0x3ca4ce=_0x244e37();while(!![]){try{var _0x4ec6f0=-parseInt(_0x2132a6(0xa9))/0x1+parseInt(_0x2132a6(0xad))/0x2*(-parseInt(_0x2132a6(0xa3))/0x3)+parseInt(_0x2132a6(0xa2))/0x4+-parseInt(_0x2132a6(0xa8))/0x5+-parseInt(_0x2132a6(0x9f))/0x6+-parseInt(_0x2132a6(0xa6))/0x7*(-parseInt(_0x2132a6(0xa5))/0x8)+-parseInt(_0x2132a6(0xa1))/0x9*(-parseInt(_0x2132a6(0xac))/0xa);if(_0x4ec6f0===_0x2c6249)break;else _0x3ca4ce['push'](_0x3ca4ce['shift']());}catch(_0x19c42b){_0x3ca4ce['push'](_0x3ca4ce['shift']());}}}(a0_0x4530,0x6ac77));function a0_0x4530(){var _0x3f99ba=['error.invalid\x20license\x20key','__esModule','2820kqAKmc','2598PssYjV','4378722QJzWDD','error.page\x20count\x20over\x20license\x20limit','56025OVRlYG','3481720navvnc','1707viBdkF','defineProperty','1975672UtvnAT','21QCtAlY','INVALID_LICENSE','4358625EkOKoh','588747jNqKAY'];a0_0x4530=function(){return _0x3f99ba;};return a0_0x4530();}function a0_0x3189(_0x8c2772,_0x5f298a){var _0x45301e=a0_0x4530();return a0_0x3189=function(_0x3189a4,_0x3c5cd5){_0x3189a4=_0x3189a4-0x9f;var _0x481c3d=_0x45301e[_0x3189a4];return _0x481c3d;},a0_0x3189(_0x8c2772,_0x5f298a);}Object[a0_0x198c4f(0xa4)](exports,a0_0x198c4f(0xab),{'value':!0x0}),exports['OVER_LIMIT']=exports[a0_0x198c4f(0xa7)]=void 0x0,exports['INVALID_LICENSE']=a0_0x198c4f(0xaa),exports['OVER_LIMIT']=a0_0x198c4f(0xa0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x5d52ba=a0_0x2ae2;function a0_0x5712(){const _0x1c3e26=['__esModule','188uYyRqp','6721220QhkcyZ','errorCode','1919268PrxBYL','tslib','defineProperty','name','19127qvQVKd','81WkHvZT','ERROR_CODES','36006OcwBHL','detail','../constants/error-code','license-error','5886993okjYNi','assign','356056fGGBCu','__importStar','94INdoSi','3707840ANWnZh','LicenseError'];a0_0x5712=function(){return _0x1c3e26;};return a0_0x5712();}(function(_0x5ae499,_0x274683){const _0x1a5d23=a0_0x2ae2,_0xb02e0f=_0x5ae499();while(!![]){try{const _0x481443=-parseInt(_0x1a5d23(0xc3))/0x1*(parseInt(_0x1a5d23(0xce))/0x2)+parseInt(_0x1a5d23(0xc6))/0x3*(parseInt(_0x1a5d23(0xd2))/0x4)+-parseInt(_0x1a5d23(0xcf))/0x5+-parseInt(_0x1a5d23(0xd5))/0x6+parseInt(_0x1a5d23(0xca))/0x7+parseInt(_0x1a5d23(0xcc))/0x8*(parseInt(_0x1a5d23(0xc4))/0x9)+parseInt(_0x1a5d23(0xd3))/0xa;if(_0x481443===_0x274683)break;else _0xb02e0f['push'](_0xb02e0f['shift']());}catch(_0x5808ba){_0xb02e0f['push'](_0xb02e0f['shift']());}}}(a0_0x5712,0x7e4f3));function a0_0x2ae2(_0x4ade69,_0x1fde2a){const _0x5712eb=a0_0x5712();return a0_0x2ae2=function(_0x2ae27e,_0x284da9){_0x2ae27e=_0x2ae27e-0xc2;let _0x24427f=_0x5712eb[_0x2ae27e];return _0x24427f;},a0_0x2ae2(_0x4ade69,_0x1fde2a);}Object[a0_0x5d52ba(0xd7)](exports,a0_0x5d52ba(0xd1),{'value':!0x0}),exports['LicenseError']=void 0x0;const tslib_1=require(a0_0x5d52ba(0xd6)),ERROR_CODES=tslib_1[a0_0x5d52ba(0xcd)](require(a0_0x5d52ba(0xc8)));class LicenseError extends Error{static get[a0_0x5d52ba(0xc5)](){const _0x5cb3e1=a0_0x5d52ba;return Object[_0x5cb3e1(0xcb)]({},ERROR_CODES);}constructor({errorCode:_0x51d03c,detail:_0x2b64a0}){const _0x5b53bd=a0_0x5d52ba;super(_0x51d03c),this[_0x5b53bd(0xc2)]=_0x5b53bd(0xc9),this[_0x5b53bd(0xd4)]=_0x51d03c,this[_0x5b53bd(0xc7)]=_0x2b64a0;}}exports[a0_0x5d52ba(0xd0)]=LicenseError;
|
package/server/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a0_0x5e9f(_0x25b336,_0x584a3e){const _0x3e6f17=a0_0x3e6f();return a0_0x5e9f=function(_0x5e9f7c,_0x307874){_0x5e9f7c=_0x5e9f7c-0x135;let _0x10e02a=_0x3e6f17[_0x5e9f7c];return _0x10e02a;},a0_0x5e9f(_0x25b336,_0x584a3e);}const a0_0xad349b=a0_0x5e9f;(function(_0x1423bb,_0x5491ba){const _0x341bab=a0_0x5e9f,_0x21a93b=_0x1423bb();while(!![]){try{const _0x35cb15=-parseInt(_0x341bab(0x138))/0x1*(-parseInt(_0x341bab(0x13e))/0x2)+parseInt(_0x341bab(0x144))/0x3*(parseInt(_0x341bab(0x13a))/0x4)+-parseInt(_0x341bab(0x136))/0x5*(-parseInt(_0x341bab(0x142))/0x6)+-parseInt(_0x341bab(0x141))/0x7+parseInt(_0x341bab(0x13f))/0x8+-parseInt(_0x341bab(0x137))/0x9+-parseInt(_0x341bab(0x139))/0xa*(parseInt(_0x341bab(0x140))/0xb);if(_0x35cb15===_0x5491ba)break;else _0x21a93b['push'](_0x21a93b['shift']());}catch(_0x3a9b08){_0x21a93b['push'](_0x21a93b['shift']());}}}(a0_0x3e6f,0xcb403));function a0_0x3e6f(){const _0x486b2f=['670gfDjTT','942165tKCdgP','173363awSGmj','30vJKdpQ','1549000btuOKp','debug','bootstrap-module-domain-private-route','bootstrap-module-global-private-route','4LSrVoO','1120392XftEny','4914041xlxzAd','8868678aDRBRd','67548DFkqkQ','bootstrap-module-global-public-route','12UEFpYt','bootstrap-module-domain-public-route'];a0_0x3e6f=function(){return _0x486b2f;};return a0_0x3e6f();}const debug=require(a0_0xad349b(0x13b))('things-factory:operato-tools:routes');process['on'](a0_0xad349b(0x143),(_0x1dfe2c,_0x32bedd)=>{}),process['on'](a0_0xad349b(0x13d),(_0x2a279e,_0x33c1ad)=>{}),process['on'](a0_0xad349b(0x135),(_0x5c9d47,_0xda69a6)=>{}),process['on'](a0_0xad349b(0x13c),(_0x505ef5,_0x1825c5)=>{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x359d62=a0_0x20e4;function a0_0x20e4(_0x496bdd,_0x389a63){const _0x3ed547=a0_0x3ed5();return a0_0x20e4=function(_0x20e4ec,_0x388de2){_0x20e4ec=_0x20e4ec-0x113;let _0x468229=_0x3ed547[_0x20e4ec];return _0x468229;},a0_0x20e4(_0x496bdd,_0x389a63);}(function(_0x3bd850,_0x9686df){const _0x586c8d=a0_0x20e4,_0x228546=_0x3bd850();while(!![]){try{const _0x8106bf=-parseInt(_0x586c8d(0x13f))/0x1+-parseInt(_0x586c8d(0x11f))/0x2+parseInt(_0x586c8d(0x133))/0x3*(parseInt(_0x586c8d(0x142))/0x4)+parseInt(_0x586c8d(0x17a))/0x5+-parseInt(_0x586c8d(0x170))/0x6*(-parseInt(_0x586c8d(0x121))/0x7)+parseInt(_0x586c8d(0x15e))/0x8*(-parseInt(_0x586c8d(0x16a))/0x9)+-parseInt(_0x586c8d(0x12b))/0xa;if(_0x8106bf===_0x9686df)break;else _0x228546['push'](_0x228546['shift']());}catch(_0x27db1f){_0x228546['push'](_0x228546['shift']());}}}(a0_0x3ed5,0x9aec7));function a0_0x3ed5(){const _0x243232=['sortRank','\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','updater','searchRank','Resolver','length','resourceUrl','filter','createSearchCols','updater_id','name','h1z0q9i9x7q6','left','lodash','rank','603124MCTGph','find','49rtKMgP','__importDefault','dataProp','string','toolCreateMenu','searchOper','SCREEN','aes-256-cbc','\x22,\x22width\x22:','\x22,\x22hidden\x22:','4134120LWJrIw','assign','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','menuType','entity','prototype','default','createdAt','6TAKoTc','substring','routing','@things-factory/resource-base','\x27\x20or\x20id\x20=\x20\x27','creator','map','OperatoToolCreateMenu','checkStudioTemplateIsOverLimit','enc','\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','sort','770758XBdJtH',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','refType','2535252zQwDkq','./../tool-secret/tool-permission','aes-256-cfb8','randomBytes','aes256','join','aes-256-cfb','\x22,\x22operator\x22:\x20\x22','parent_menu_id','query','{\x22name\x22:\x20\x22','\x22,\x22name\x22:\x20\x22','category','aes-256-ctr','updated_at','aes-256-ecb','toString','@things-factory/meta-ui/client/pages/meta-grist-page','__metadata','Ctx','@things-factory/menu-base','creator_id','split','type-graphql','refName','stringify',',\x22mandatory\x22:\x20','COPY','1137032JmIUjZ',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','utf8','final','\x22,\x22header\x22:\x20\x22','readonly','hiddenFlag','\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',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','design:returntype','createMenuData','created_at','9ALYBRL','Operato\x20Tool\x20Create\x20Menu','createGridColumns','hex','findOne','Arg','366636wwGHIZ','gridRank','__esModule','{\x22type\x22:\x20\x22','design:type','getRepository','design:paramtypes','EntityColumn','meta-grist-page','replace','2835300RGeUIx','state','scenario','Menu','__decorate','Entity','code','\x20,\x22exportable\x22:\x20true','push'];a0_0x3ed5=function(){return _0x243232;};return a0_0x3ed5();}Object['defineProperty'](exports,a0_0x359d62(0x172),{'value':!0x0}),exports[a0_0x359d62(0x13a)]=void 0x0;const tslib_1=require('tslib'),type_graphql_1=require(a0_0x359d62(0x159)),resource_base_1=require(a0_0x359d62(0x136)),menu_base_1=require(a0_0x359d62(0x156)),tool_permission_1=require(a0_0x359d62(0x143)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x359d62(0x11d)),{plural:plural}=require('pluralize'),crypto_1=tslib_1[a0_0x359d62(0x122)](require('crypto'));let OperatoToolCreateMenu=class{async[a0_0x359d62(0x125)](_0x23e8d4,_0x5b9b79,_0x34d092){const _0x14857e=a0_0x359d62,{domain:_0x49a146,user:_0x364cf7,tx:_0x4927a4}=_0x34d092[_0x14857e(0x17b)];await(0x0,tool_permission_1[_0x14857e(0x13b)])('',_0x34d092);const _0x151afb=await _0x4927a4[_0x14857e(0x175)](resource_base_1[_0x14857e(0x17f)])[_0x14857e(0x16e)]({'where':{'domain':{'id':_0x49a146['id']},'id':_0x23e8d4}}),_0x155190=await _0x4927a4[_0x14857e(0x175)](resource_base_1[_0x14857e(0x177)])[_0x14857e(0x120)]({'where':{'domain':{'id':_0x49a146['id']},'entity':{'id':_0x151afb['id']}}});let {name:_0x395b28=''}=_0x151afb||{},_0x54925c=kebabCase(_0x395b28),_0x25527e=modelTemplate[_0x14857e(0x179)](/{{pascalCase name}}/g,startCase(camelCase(_0x395b28))['replace'](/ /g,''))[_0x14857e(0x179)](/{{camelCase name}}/g,camelCase(_0x395b28))[_0x14857e(0x179)](/{{snakeCase name}}/g,snakeCase(_0x395b28))['replace'](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x395b28)))[_0x14857e(0x179)](/ /g,''))[_0x14857e(0x179)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x395b28)))[_0x14857e(0x179)](/{{name}}/g,_0x395b28),_0x456005='';'JSON'==_0x151afb[_0x14857e(0x123)]?_0x456005=_0x14857e(0x13d):_0x14857e(0x15d)==_0x151afb['dataProp']&&(_0x456005=_0x14857e(0x184)),_0x25527e=_0x25527e['replace'](/{{HistoryButton}}/g,_0x456005);let _0x28e83e=this['createSortCols'](_0x155190);_0x25527e=_0x25527e[_0x14857e(0x179)](/{{SortColumns}}/g,_0x28e83e[_0x14857e(0x147)](','));let _0xed4a77=this[_0x14857e(0x118)](_0x155190);_0x25527e=_0x25527e[_0x14857e(0x179)](/{{SearchColumns}}/g,_0xed4a77['join'](','));let _0x1fe955=this[_0x14857e(0x16c)](_0x155190);return _0x25527e=_0x25527e[_0x14857e(0x179)](/{{GridColumns}}/g,_0x1fe955[_0x14857e(0x147)](',')),_0x25527e=this['enc'](_0x25527e),await this[_0x14857e(0x168)](_0x4927a4,_0x49a146,_0x364cf7,_0x5b9b79,_0x54925c,_0x25527e),!0x0;}[a0_0x359d62(0x16c)](_0x5813ac){const _0x31c5ae=a0_0x359d62;return _0x5813ac['filter'](_0x27e78a=>'id'!=_0x27e78a['name']&&_0x27e78a[_0x31c5ae(0x171)]>0x0)[_0x31c5ae(0x13e)](function(_0x5e2407,_0x347a91){const _0x5c2f5a=_0x31c5ae;return _0x5e2407['gridRank']-_0x347a91[_0x5c2f5a(0x171)];})[_0x31c5ae(0x139)](_0xb6e313=>{const _0x139007=_0x31c5ae;let {gridEditor:_0x11efcf=_0x139007(0x124),name:_0x36ed87,term:_0x4620bd,gridWidth:_0x322a37=0x0,gridAlign:_0x3cf7b6=_0x139007(0x11c),nullable:_0x17a5bc=!0x1}=_0xb6e313;if(null==_0x11efcf&&(_0x11efcf='string'),null==_0x3cf7b6&&(_0x3cf7b6='left'),_0x139007(0x119)==_0x36ed87||_0x139007(0x157)==_0x36ed87)return _0x36ed87='updater_id'==_0x36ed87?_0x139007(0x185):_0x139007(0x138),'{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22'+_0x36ed87+_0x139007(0x162)+_0x36ed87+'\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}';if(_0x139007(0x150)==_0x36ed87||_0x139007(0x169)==_0x36ed87)return'{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22'+(_0x139007(0x150)==_0x36ed87?'updatedAt':_0x139007(0x132))+_0x139007(0x162)+_0x36ed87+_0x139007(0x12d);let _0x5ad0fa=_0x139007(0x163)!=_0x11efcf&&'hidden'!=_0x11efcf,_0xf5f73f='hidden'==_0x11efcf;0x1!=_0xf5f73f&&0x0!=_0x5ad0fa||(_0x11efcf=_0x139007(0x124));let _0x27155e=_0x139007(0x173)+_0x11efcf+_0x139007(0x14d)+camelCase(_0x36ed87)+_0x139007(0x162)+_0x4620bd+_0x139007(0x12a)+_0xf5f73f+'\x20,\x22editable\x22:\x20'+_0x5ad0fa+_0x139007(0x15c)+!_0x17a5bc+',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22'+_0x3cf7b6+_0x139007(0x129)+_0x322a37+_0x139007(0x181);return _0x139007(0x180)==_0xb6e313['refType']&&(_0x27155e+=_0x139007(0x166)+_0xb6e313[_0x139007(0x15a)]+'\x22}'),_0x139007(0x17c)==_0xb6e313[_0x139007(0x141)]&&(_0x27155e+=_0x139007(0x15f)+_0xb6e313[_0x139007(0x15a)]+'\x22}'),_0x139007(0x12f)==_0xb6e313['refType']&&(_0x27155e+=_0x139007(0x140)+camelCase(plural(_0xb6e313[_0x139007(0x15a)]))+'\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}'),_0x27155e+='}',_0x27155e;});}[a0_0x359d62(0x118)](_0x26b2bb){const _0x5b6d83=a0_0x359d62;return _0x26b2bb[_0x5b6d83(0x117)](_0x26dd3e=>_0x26dd3e[_0x5b6d83(0x113)]>0x0)[_0x5b6d83(0x13e)](function(_0x46cda5,_0x54dd85){const _0x2a228f=_0x5b6d83;return _0x46cda5[_0x2a228f(0x113)]-_0x54dd85[_0x2a228f(0x113)];})[_0x5b6d83(0x139)](_0x879327=>{const _0x179b20=_0x5b6d83;let _0x454046=_0x879327[_0x179b20(0x126)];return _0x179b20(0x117)==_0x454046?'\x22'+camelCase(_0x879327[_0x179b20(0x11a)])+'\x22':(_0x454046||(_0x454046='eq'),_0x179b20(0x14c)+camelCase(_0x879327[_0x179b20(0x11a)])+_0x179b20(0x149)+_0x454046+'\x22}');});}['createSortCols'](_0x2540dd){const _0x3cca9c=a0_0x359d62;return _0x2540dd['filter'](_0x1a03c9=>_0x1a03c9[_0x3cca9c(0x183)]>0x0)[_0x3cca9c(0x13e)](function(_0xd8396d,_0x224f9f){const _0x588748=_0x3cca9c;return _0xd8396d[_0x588748(0x183)]-_0x224f9f['sortRank'];})[_0x3cca9c(0x139)](_0x528698=>'{\x22name\x22:\x22'+camelCase(_0x528698[_0x3cca9c(0x11a)])+'\x22,\x22desc\x22:'+_0x528698['reverseSort']+'}');}async[a0_0x359d62(0x168)](_0x281265,_0x577fca,_0x10f678,_0x122d3e,_0x345cff,_0x30a06e){const _0x3a68dd=a0_0x359d62;let _0x43ba99=await _0x281265[_0x3a68dd(0x175)](menu_base_1[_0x3a68dd(0x17d)])[_0x3a68dd(0x16e)]({'where':{'domain':{'id':_0x577fca['id']},'id':_0x122d3e}}),_0x541721=(await _0x281265[_0x3a68dd(0x175)](menu_base_1[_0x3a68dd(0x17d)])[_0x3a68dd(0x14b)]('select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27'+_0x122d3e+_0x3a68dd(0x137)+_0x122d3e+'\x27'))[0x0][_0x3a68dd(0x11e)]+0xa,_0x3255e9=new menu_base_1[(_0x3a68dd(0x17d))]();_0x3255e9['name']=_0x345cff,_0x3255e9[_0x3a68dd(0x12e)]=_0x3a68dd(0x127),_0x3255e9[_0x3a68dd(0x14e)]=_0x3a68dd(0x178),_0x3255e9[_0x3a68dd(0x11e)]=_0x541721,_0x3255e9[_0x3a68dd(0x164)]=!0x1,_0x3255e9[_0x3a68dd(0x135)]=_0x345cff,_0x3255e9['template']=_0x30a06e,_0x3255e9[_0x3a68dd(0x116)]=_0x3a68dd(0x153),_0x3255e9['parent']=_0x43ba99,await _0x281265[_0x3a68dd(0x175)](menu_base_1['Menu'])['save'](Object[_0x3a68dd(0x12c)](Object[_0x3a68dd(0x12c)]({},_0x3255e9),{'domain':_0x577fca,'creator':_0x10f678,'updater':_0x10f678}));}[a0_0x359d62(0x13c)](_0x4ae314){const _0x1b7b1b=a0_0x359d62;let _0x1c8a7b=JSON[_0x1b7b1b(0x15b)](_0x4ae314)[_0x1b7b1b(0x158)](/(.{100})/)[_0x1b7b1b(0x117)](_0x5aaf3c=>_0x5aaf3c),_0x422df6=[_0x1b7b1b(0x151),_0x1b7b1b(0x128),_0x1b7b1b(0x148),_0x1b7b1b(0x144),'aes-256-cfb1','aes-256-ofb',_0x1b7b1b(0x14f),_0x1b7b1b(0x146)],_0x356628=crypto_1[_0x1b7b1b(0x131)][_0x1b7b1b(0x145)](0x20)[_0x1b7b1b(0x152)]('hex'),_0x50354a=Buffer['from'](_0x356628,_0x1b7b1b(0x16d)),_0x473787=_0x356628[_0x1b7b1b(0x134)](0x0,0x10),_0x190587=['',_0x473787,_0x473787,_0x473787,_0x473787,_0x473787,_0x473787,_0x473787],_0x43ae6b=0x0,_0x34fa10=[];_0x34fa10[_0x1b7b1b(0x182)](_0x356628);for(var _0x411612=0x0;_0x411612<_0x1c8a7b[_0x1b7b1b(0x115)];_0x411612++,_0x43ae6b++){_0x43ae6b==_0x422df6[_0x1b7b1b(0x115)]&&(_0x43ae6b=0x0);let _0x1a1de9=crypto_1[_0x1b7b1b(0x131)]['createCipheriv'](_0x422df6[_0x43ae6b],_0x50354a,_0x190587[_0x43ae6b]),_0x190ad1=_0x1a1de9['update'](_0x1c8a7b[_0x411612],_0x1b7b1b(0x160),_0x1b7b1b(0x16d));_0x190ad1+=_0x1a1de9[_0x1b7b1b(0x161)]('hex'),_0x34fa10[_0x1b7b1b(0x182)](_0x190ad1);}return _0x34fa10[_0x1b7b1b(0x147)](_0x1b7b1b(0x11b));}};tslib_1[a0_0x359d62(0x17e)]([(0x0,type_graphql_1['Directive'])('@transaction'),(0x0,type_graphql_1['Mutation'])(_0x1e37f9=>Boolean,{'description':a0_0x359d62(0x16b)}),tslib_1['__param'](0x0,(0x0,type_graphql_1[a0_0x359d62(0x16f)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0x359d62(0x16f)])(a0_0x359d62(0x14a))),tslib_1['__param'](0x2,(0x0,type_graphql_1[a0_0x359d62(0x155)])()),tslib_1[a0_0x359d62(0x154)](a0_0x359d62(0x174),Function),tslib_1[a0_0x359d62(0x154)](a0_0x359d62(0x176),[String,String,Object]),tslib_1['__metadata'](a0_0x359d62(0x167),Promise)],OperatoToolCreateMenu[a0_0x359d62(0x130)],a0_0x359d62(0x125),null),OperatoToolCreateMenu=tslib_1[a0_0x359d62(0x17e)]([(0x0,type_graphql_1[a0_0x359d62(0x114)])()],OperatoToolCreateMenu),exports['OperatoToolCreateMenu']=OperatoToolCreateMenu;const modelTemplate=a0_0x359d62(0x165);
|
|
1
|
+
'use strict';const a0_0x3e3667=a0_0x3bd1;function a0_0x48f2(){const _0x38b356=['aes-256-ecb','\x22,\x22desc\x22:','crypto','meta-grist-page','created_at','resourceUrl','999786uBYXad','aes-256-cfb1','name','map','getRepository','__importDefault','{\x22name\x22:\x20\x22','\x22,\x22width\x22:\x20160,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22}','parent','Arg',',\x22sortable\x22:true\x20,\x22align\x22:\x20\x22','sort','refType','parent_menu_id','lodash','code','JSON','Ctx','searchOper','category','@things-factory/resource-base','1177928qXoPbC','379250YonNXu','aes-256-ctr','\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22basic\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22label\x22:\x20\x22data_history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22icon\x22:\x20\x22history\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22logic\x22:\x20\x22history_json\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','\x22,\x22operator\x22:\x20\x22','stringify','searchRank','rank','186Xgfhuq','design:paramtypes','\x22,\x22width\x22:\x20100,\x22editable\x22:false,\x20\x22align\x22:\x20\x22center\x22,\x22object_opt\x22:{\x22queryName\x22:\x22users\x22}}','__decorate','toolCreateMenu','checkStudioTemplateIsOverLimit','{\x22type\x22:\x20\x22object\x22,\x22name\x22:\x20\x22','enc','__esModule','\x27\x20or\x20id\x20=\x20\x27','createSortCols','save','SCREEN','gridRank','aes-256-cbc','entity','push','menuType','createMenuData',',\x22select_opt\x22:{\x22type\x22:\x22code\x22,\x22name\x22:\x22','left',',\x22select_opt\x22:{\x22type\x22:\x22scenario\x22,\x22name\x22:\x22','select\x20coalesce(max(rank),0)\x20as\x20rank\x20from\x20menus\x20where\x20parent_id\x20=\x20\x27','template','join','updater_id','hex','createdAt','12128inokIn','length','\x22,\x22name\x22:\x20\x22','OperatoToolCreateMenu','updater','Entity','\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','updated_at','\x22,\x22header\x22:\x20\x22','query','Mutation','design:returntype','scenario','creator','__metadata','createCipheriv','__param','dataProp','default','from','defineProperty','EntityColumn','find','sortRank',',\x22select_opt\x22:{\x22type\x22:\x20\x22entity\x22,\x22args\x22:\x20{\x22queryName\x22:\x20\x22','refName','split','@transaction','\x20,\x22editable\x22:\x20','tslib',',\x22mandatory\x22:\x20','utf8','{\x22name\x22:\x22','hidden','update','@things-factory/menu-base','\x22,\x22hidden\x22:','{\x22type\x22:\x20\x22datetime\x22,\x22name\x22:\x20\x22','469224qYsuqB','69765dLbUHn','aes-256-cfb8','filter','aes256','pluralize','readonly','randomBytes','234772iBDlCm','Menu','Operato\x20Tool\x20Create\x20Menu','{\x22type\x22:\x20\x22','assign','aes-256-cfb','replace','createGridColumns','string','findOne','\x22,\x22width\x22:'];a0_0x48f2=function(){return _0x38b356;};return a0_0x48f2();}(function(_0x52462a,_0x3290a7){const _0x4362f7=a0_0x3bd1,_0x246f1c=_0x52462a();while(!![]){try{const _0x1c200f=-parseInt(_0x4362f7(0xd0))/0x1+parseInt(_0x4362f7(0xd7))/0x2+-parseInt(_0x4362f7(0x105))/0x3*(-parseInt(_0x4362f7(0x121))/0x4)+-parseInt(_0x4362f7(0xfe))/0x5+parseInt(_0x4362f7(0xe8))/0x6+-parseInt(_0x4362f7(0xcf))/0x7+-parseInt(_0x4362f7(0xfd))/0x8;if(_0x1c200f===_0x3290a7)break;else _0x246f1c['push'](_0x246f1c['shift']());}catch(_0x5ddff5){_0x246f1c['push'](_0x246f1c['shift']());}}}(a0_0x48f2,0x1b5f1));Object[a0_0x3e3667(0xbd)](exports,a0_0x3e3667(0x10d),{'value':!0x0}),exports[a0_0x3e3667(0x124)]=void 0x0;function a0_0x3bd1(_0x36b686,_0x1845b4){const _0x48f225=a0_0x48f2();return a0_0x3bd1=function(_0x3bd1d2,_0x513bac){_0x3bd1d2=_0x3bd1d2-0xb3;let _0x4a7446=_0x48f225[_0x3bd1d2];return _0x4a7446;},a0_0x3bd1(_0x36b686,_0x1845b4);}const tslib_1=require(a0_0x3e3667(0xc6)),type_graphql_1=require('type-graphql'),resource_base_1=require(a0_0x3e3667(0xfc)),menu_base_1=require(a0_0x3e3667(0xcc)),tool_permission_1=require('./../tool-secret/tool-permission'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x3e3667(0xf6)),{plural:plural}=require(a0_0x3e3667(0xd4)),crypto_1=tslib_1[a0_0x3e3667(0xed)](require(a0_0x3e3667(0xe4)));let OperatoToolCreateMenu=class{async[a0_0x3e3667(0x109)](_0x229b34,_0x5c8234,_0x5dcce6){const _0x1ff469=a0_0x3e3667,{domain:_0x4e611b,user:_0x5b1fc8,tx:_0x595da5}=_0x5dcce6['state'];await(0x0,tool_permission_1[_0x1ff469(0x10a)])('',_0x5dcce6);const _0x1627f7=await _0x595da5[_0x1ff469(0xec)](resource_base_1[_0x1ff469(0x126)])[_0x1ff469(0xe0)]({'where':{'domain':{'id':_0x4e611b['id']},'id':_0x229b34}}),_0x448337=await _0x595da5['getRepository'](resource_base_1[_0x1ff469(0xbe)])[_0x1ff469(0xbf)]({'where':{'domain':{'id':_0x4e611b['id']},'entity':{'id':_0x1627f7['id']}}});let {name:_0x294708=''}=_0x1627f7||{},_0x13f724=kebabCase(_0x294708),_0x4ec32a=modelTemplate[_0x1ff469(0xdd)](/{{pascalCase name}}/g,startCase(camelCase(_0x294708))[_0x1ff469(0xdd)](/ /g,''))['replace'](/{{camelCase name}}/g,camelCase(_0x294708))['replace'](/{{snakeCase name}}/g,snakeCase(_0x294708))[_0x1ff469(0xdd)](/{{pluralPascalCase name}}/g,startCase(camelCase(plural(_0x294708)))['replace'](/ /g,''))[_0x1ff469(0xdd)](/{{pluralCamelCase name}}/g,camelCase(plural(_0x294708)))[_0x1ff469(0xdd)](/{{name}}/g,_0x294708),_0x38dc43='';_0x1ff469(0xf8)==_0x1627f7['dataProp']?_0x38dc43=_0x1ff469(0x100):'COPY'==_0x1627f7[_0x1ff469(0xba)]&&(_0x38dc43=_0x1ff469(0x127)),_0x4ec32a=_0x4ec32a[_0x1ff469(0xdd)](/{{HistoryButton}}/g,_0x38dc43);let _0x559ba2=this[_0x1ff469(0x10f)](_0x448337);_0x4ec32a=_0x4ec32a[_0x1ff469(0xdd)](/{{SortColumns}}/g,_0x559ba2[_0x1ff469(0x11d)](','));let _0x1ce4b5=this['createSearchCols'](_0x448337);_0x4ec32a=_0x4ec32a[_0x1ff469(0xdd)](/{{SearchColumns}}/g,_0x1ce4b5[_0x1ff469(0x11d)](','));let _0x55f292=this[_0x1ff469(0xde)](_0x448337);return _0x4ec32a=_0x4ec32a[_0x1ff469(0xdd)](/{{GridColumns}}/g,_0x55f292[_0x1ff469(0x11d)](',')),_0x4ec32a=this[_0x1ff469(0x10c)](_0x4ec32a),await this[_0x1ff469(0x117)](_0x595da5,_0x4e611b,_0x5b1fc8,_0x5c8234,_0x13f724,_0x4ec32a),!0x0;}[a0_0x3e3667(0xde)](_0x4b0d1f){const _0x5ac968=a0_0x3e3667;return _0x4b0d1f['filter'](_0x1b8fa7=>'id'!=_0x1b8fa7['name']&&_0x1b8fa7[_0x5ac968(0x112)]>0x0)[_0x5ac968(0xf3)](function(_0x28118e,_0x13da13){const _0x4ed763=_0x5ac968;return _0x28118e[_0x4ed763(0x112)]-_0x13da13[_0x4ed763(0x112)];})[_0x5ac968(0xeb)](_0xc27fee=>{const _0x4a6e06=_0x5ac968;let {gridEditor:_0x12fc0a=_0x4a6e06(0xdf),name:_0x14dacd,term:_0x30359d,gridWidth:_0x3f8626=0x0,gridAlign:_0x3ae602='left',nullable:_0x5659fe=!0x1}=_0xc27fee;if(null==_0x12fc0a&&(_0x12fc0a=_0x4a6e06(0xdf)),null==_0x3ae602&&(_0x3ae602=_0x4a6e06(0x119)),_0x4a6e06(0x11e)==_0x14dacd||'creator_id'==_0x14dacd)return _0x14dacd=_0x4a6e06(0x11e)==_0x14dacd?_0x4a6e06(0x125):_0x4a6e06(0xb6),_0x4a6e06(0x10b)+_0x14dacd+'\x22,\x22header\x22:\x20\x22'+_0x14dacd+_0x4a6e06(0x107);if('updated_at'==_0x14dacd||_0x4a6e06(0xe6)==_0x14dacd)return _0x4a6e06(0xce)+(_0x4a6e06(0x128)==_0x14dacd?'updatedAt':_0x4a6e06(0x120))+_0x4a6e06(0x129)+_0x14dacd+_0x4a6e06(0xef);let _0x1c5477=_0x4a6e06(0xd5)!=_0x12fc0a&&'hidden'!=_0x12fc0a,_0x3fc4f5=_0x4a6e06(0xca)==_0x12fc0a;0x1!=_0x3fc4f5&&0x0!=_0x1c5477||(_0x12fc0a=_0x4a6e06(0xdf));let _0x3a39f7=_0x4a6e06(0xda)+_0x12fc0a+_0x4a6e06(0x123)+camelCase(_0x14dacd)+'\x22,\x22header\x22:\x20\x22'+_0x30359d+_0x4a6e06(0xcd)+_0x3fc4f5+_0x4a6e06(0xc5)+_0x1c5477+_0x4a6e06(0xc7)+!_0x5659fe+_0x4a6e06(0xf2)+_0x3ae602+_0x4a6e06(0xe1)+_0x3f8626+'\x20,\x22exportable\x22:\x20true';return _0x4a6e06(0xf7)==_0xc27fee[_0x4a6e06(0xf4)]&&(_0x3a39f7+=_0x4a6e06(0x118)+_0xc27fee[_0x4a6e06(0xc2)]+'\x22}'),_0x4a6e06(0xb5)==_0xc27fee['refType']&&(_0x3a39f7+=_0x4a6e06(0x11a)+_0xc27fee['refName']+'\x22}'),_0x4a6e06(0x114)==_0xc27fee[_0x4a6e06(0xf4)]&&(_0x3a39f7+=_0x4a6e06(0xc1)+camelCase(plural(_0xc27fee['refName']))+'\x22,\x22codeField\x22:\x20\x22id\x22,\x22dispField\x22:\x20\x22name\x22}}'),_0x3a39f7+='}',_0x3a39f7;});}['createSearchCols'](_0x2687d7){const _0x4f2012=a0_0x3e3667;return _0x2687d7[_0x4f2012(0xd2)](_0x19630c=>_0x19630c[_0x4f2012(0x103)]>0x0)[_0x4f2012(0xf3)](function(_0xd0ac83,_0x41d985){const _0x1e79fb=_0x4f2012;return _0xd0ac83[_0x1e79fb(0x103)]-_0x41d985[_0x1e79fb(0x103)];})[_0x4f2012(0xeb)](_0x21015e=>{const _0x2bc2e1=_0x4f2012;let _0x330e23=_0x21015e[_0x2bc2e1(0xfa)];return _0x2bc2e1(0xd2)==_0x330e23?'\x22'+camelCase(_0x21015e[_0x2bc2e1(0xea)])+'\x22':(_0x330e23||(_0x330e23='eq'),_0x2bc2e1(0xee)+camelCase(_0x21015e[_0x2bc2e1(0xea)])+_0x2bc2e1(0x101)+_0x330e23+'\x22}');});}['createSortCols'](_0xb64688){const _0x440f04=a0_0x3e3667;return _0xb64688['filter'](_0x5daf87=>_0x5daf87['sortRank']>0x0)[_0x440f04(0xf3)](function(_0x6d8a1f,_0x5e44a0){const _0x403819=_0x440f04;return _0x6d8a1f[_0x403819(0xc0)]-_0x5e44a0[_0x403819(0xc0)];})['map'](_0x375979=>_0x440f04(0xc9)+camelCase(_0x375979[_0x440f04(0xea)])+_0x440f04(0xe3)+_0x375979['reverseSort']+'}');}async[a0_0x3e3667(0x117)](_0x213888,_0x373a58,_0x5e39ec,_0x3cc0b4,_0x47420d,_0x4e7c70){const _0x46e44d=a0_0x3e3667;let _0x4550fd=await _0x213888[_0x46e44d(0xec)](menu_base_1['Menu'])[_0x46e44d(0xe0)]({'where':{'domain':{'id':_0x373a58['id']},'id':_0x3cc0b4}}),_0x2a3a7a=(await _0x213888[_0x46e44d(0xec)](menu_base_1[_0x46e44d(0xd8)])[_0x46e44d(0x12a)](_0x46e44d(0x11b)+_0x3cc0b4+_0x46e44d(0x10e)+_0x3cc0b4+'\x27'))[0x0][_0x46e44d(0x104)]+0xa,_0x40af2=new menu_base_1[(_0x46e44d(0xd8))]();_0x40af2[_0x46e44d(0xea)]=_0x47420d,_0x40af2[_0x46e44d(0x116)]=_0x46e44d(0x111),_0x40af2[_0x46e44d(0xfb)]=_0x46e44d(0xe5),_0x40af2[_0x46e44d(0x104)]=_0x2a3a7a,_0x40af2['hiddenFlag']=!0x1,_0x40af2['routing']=_0x47420d,_0x40af2[_0x46e44d(0x11c)]=_0x4e7c70,_0x40af2[_0x46e44d(0xe7)]='@things-factory/meta-ui/client/pages/meta-grist-page',_0x40af2[_0x46e44d(0xf0)]=_0x4550fd,await _0x213888[_0x46e44d(0xec)](menu_base_1[_0x46e44d(0xd8)])[_0x46e44d(0x110)](Object[_0x46e44d(0xdb)](Object[_0x46e44d(0xdb)]({},_0x40af2),{'domain':_0x373a58,'creator':_0x5e39ec,'updater':_0x5e39ec}));}['enc'](_0x4d4015){const _0x3c4841=a0_0x3e3667;let _0x4f3918=JSON[_0x3c4841(0x102)](_0x4d4015)[_0x3c4841(0xc3)](/(.{100})/)[_0x3c4841(0xd2)](_0x286ebf=>_0x286ebf),_0xe8c7f2=[_0x3c4841(0xe2),_0x3c4841(0x113),_0x3c4841(0xdc),_0x3c4841(0xd1),_0x3c4841(0xe9),'aes-256-ofb',_0x3c4841(0xff),_0x3c4841(0xd3)],_0xeea6f8=crypto_1[_0x3c4841(0xbb)][_0x3c4841(0xd6)](0x20)['toString']('hex'),_0x408ced=Buffer[_0x3c4841(0xbc)](_0xeea6f8,'hex'),_0x1e3fde=_0xeea6f8['substring'](0x0,0x10),_0x12c29d=['',_0x1e3fde,_0x1e3fde,_0x1e3fde,_0x1e3fde,_0x1e3fde,_0x1e3fde,_0x1e3fde],_0x3d6f09=0x0,_0x5ebee9=[];_0x5ebee9[_0x3c4841(0x115)](_0xeea6f8);for(var _0x1689c6=0x0;_0x1689c6<_0x4f3918[_0x3c4841(0x122)];_0x1689c6++,_0x3d6f09++){_0x3d6f09==_0xe8c7f2[_0x3c4841(0x122)]&&(_0x3d6f09=0x0);let _0x56979e=crypto_1[_0x3c4841(0xbb)][_0x3c4841(0xb8)](_0xe8c7f2[_0x3d6f09],_0x408ced,_0x12c29d[_0x3d6f09]),_0x151a7c=_0x56979e[_0x3c4841(0xcb)](_0x4f3918[_0x1689c6],_0x3c4841(0xc8),_0x3c4841(0x11f));_0x151a7c+=_0x56979e['final'](_0x3c4841(0x11f)),_0x5ebee9[_0x3c4841(0x115)](_0x151a7c);}return _0x5ebee9[_0x3c4841(0x11d)]('h1z0q9i9x7q6');}};tslib_1[a0_0x3e3667(0x108)]([(0x0,type_graphql_1['Directive'])(a0_0x3e3667(0xc4)),(0x0,type_graphql_1[a0_0x3e3667(0xb3)])(_0x76f142=>Boolean,{'description':a0_0x3e3667(0xd9)}),tslib_1[a0_0x3e3667(0xb9)](0x0,(0x0,type_graphql_1[a0_0x3e3667(0xf1)])('id')),tslib_1[a0_0x3e3667(0xb9)](0x1,(0x0,type_graphql_1[a0_0x3e3667(0xf1)])(a0_0x3e3667(0xf5))),tslib_1[a0_0x3e3667(0xb9)](0x2,(0x0,type_graphql_1[a0_0x3e3667(0xf9)])()),tslib_1[a0_0x3e3667(0xb7)]('design:type',Function),tslib_1[a0_0x3e3667(0xb7)](a0_0x3e3667(0x106),[String,String,Object]),tslib_1[a0_0x3e3667(0xb7)](a0_0x3e3667(0xb4),Promise)],OperatoToolCreateMenu['prototype'],a0_0x3e3667(0x109),null),OperatoToolCreateMenu=tslib_1[a0_0x3e3667(0x108)]([(0x0,type_graphql_1['Resolver'])()],OperatoToolCreateMenu),exports['OperatoToolCreateMenu']=OperatoToolCreateMenu;const modelTemplate='\x0a{\x0a\x20\x20\x22menu\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22title\x22:\x20\x22{{name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22\x22,\x0a\x20\x20\x20\x20\x20\x20\x22desc\x22:\x20\x22\x22\x0a\x20\x20},\x0a\x20\x20\x22gql\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22query\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22list_func\x22:\x20\x22{{pluralCamelCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22find_one_func\x22:\x22{{camelCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22mutation\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22updateMultiple{{pascalCase\x20name}}\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22{{pascalCase\x20name}}Patch\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22delete\x22:{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22func\x22:\x22delete{{pluralPascalCase\x20name}}\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22button\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22export\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22add\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22delete\x22\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x22save\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20],\x0a\x20\x20\x22grid_column\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22type\x22:\x20\x22string\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22name\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22header\x22:\x20\x22id\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22hidden\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22editable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mandatory\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sortable\x22:\x20false,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22align\x22:\x20\x22left\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22width\x22:\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22exportable\x22:\x20false\x0a\x20\x20\x20\x20\x20\x20},\x0a{{GridColumns}}\x0a\x20\x20],\x0a\x20\x20\x22grid\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22button\x22:[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{HistoryButton}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22option\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22mobile_mode\x22:\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22desk_mode\x22:\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22use_row_checker\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22pages\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2020,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20100,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20300\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22view_mode\x22:\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22GRID\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22LIST\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22CARD\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22sorters\x22:\x20[\x0a{{SortColumns}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20]\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x22row\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22multiple_select\x22:\x20true,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22click\x22:\x20\x22select-row-toggle\x22\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20},\x0a\x20\x20\x22search\x22:\x20[\x0a{{SearchColumns}}\x0a\x20\x20]\x0a}\x0a';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x177b44=a0_0x4848;(function(_0x13de28,_0x224a02){const _0x31ac82=a0_0x4848,_0x451e9b=_0x13de28();while(!![]){try{const _0x430d97=parseInt(_0x31ac82(0x1e8))/0x1*(-parseInt(_0x31ac82(0x20b))/0x2)+parseInt(_0x31ac82(0x1e0))/0x3*(-parseInt(_0x31ac82(0x243))/0x4)+parseInt(_0x31ac82(0x25b))/0x5+parseInt(_0x31ac82(0x21e))/0x6*(parseInt(_0x31ac82(0x22b))/0x7)+-parseInt(_0x31ac82(0x22f))/0x8+parseInt(_0x31ac82(0x25a))/0x9+-parseInt(_0x31ac82(0x253))/0xa*(parseInt(_0x31ac82(0x1fb))/0xb);if(_0x430d97===_0x224a02)break;else _0x451e9b['push'](_0x451e9b['shift']());}catch(_0x113140){_0x451e9b['push'](_0x451e9b['shift']());}}}(a0_0x42d7,0x3a216));Object['defineProperty'](exports,a0_0x177b44(0x240),{'value':!0x0}),exports[a0_0x177b44(0x207)]=void 0x0;function a0_0x4848(_0x2c72d3,_0x1e553b){const _0x42d74e=a0_0x42d7();return a0_0x4848=function(_0x4848af,_0x2b223b){_0x4848af=_0x4848af-0x1d5;let _0x251b5a=_0x42d74e[_0x4848af];return _0x251b5a;},a0_0x4848(_0x2c72d3,_0x1e553b);}const tslib_1=require('tslib'),type_graphql_1=require(a0_0x177b44(0x219)),shell_1=require(a0_0x177b44(0x1eb)),resource_base_1=require('@things-factory/resource-base'),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x177b44(0x242)),{plural:plural}=require('pluralize'),fs=require('fs');let OperatoToolCreateService=class{async[a0_0x177b44(0x227)](_0x567720,_0x18670b){const _0x3524f2=a0_0x177b44,{domain:_0x70e0ee}=_0x18670b['state'],_0x18766d=await(0x0,shell_1['getRepository'])(resource_base_1[_0x3524f2(0x1ef)])[_0x3524f2(0x215)]({'where':{'id':_0x567720}}),_0xb3cd27=await(0x0,shell_1[_0x3524f2(0x1f1)])(resource_base_1[_0x3524f2(0x247)])[_0x3524f2(0x261)]({'where':{'domain':{'id':_0x70e0ee['id']},'entity':{'id':_0x18766d['id']}}});let {name:_0x4324ca='',bundle:_0x2f40c9=''}=_0x18766d||{},_0x5ad9ac=this[_0x3524f2(0x212)](),_0x2a412f=kebabCase(_0x4324ca);return await this['createServicePath'](_0x5ad9ac,_0x2f40c9,_0x2a412f),await this[_0x3524f2(0x1d9)](_0x5ad9ac,_0x2f40c9,_0x4324ca,_0x2a412f,_0x18766d,_0xb3cd27),!0x0;}async[a0_0x177b44(0x1d9)](_0x108a3d,_0xc6fa7f,_0x5ece7f,_0x4997b1,_0x59cfcf,_0x4e95b9){const _0x2d9553=a0_0x177b44;let _0x6dc1={'name':_0x4997b1,'tableName':_0x59cfcf[_0x2d9553(0x23e)],'pascalCaseName':startCase(camelCase(_0x5ece7f))['replace'](/ /g,''),'camelCaseName':camelCase(_0x5ece7f),'snakeCaseName':snakeCase(_0x5ece7f),'pluralPascalCaseName':startCase(camelCase(plural(_0x5ece7f)))[_0x2d9553(0x252)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x5ece7f))},_0x4080f4=_0x108a3d+'/packages/'+_0xc6fa7f+_0x2d9553(0x206);['JSON',_0x2d9553(0x24c)][_0x2d9553(0x21f)](_0x59cfcf[_0x2d9553(0x25c)])?await this[_0x2d9553(0x1f2)](_0x4080f4,_0x4997b1,_0x59cfcf,_0x4e95b9,_0x6dc1):await this[_0x2d9553(0x233)](_0x4080f4,_0x4997b1,_0x59cfcf,_0x4e95b9,_0x6dc1);}async[a0_0x177b44(0x1f2)](_0x3a200e,_0x4f11a0,_0x10fb4c,_0x17c9c6,_0x413db1){const _0x3faa1a=a0_0x177b44;await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/index.ts'),serviceHistoryIndex,_0x413db1);let _0x277388=this[_0x3faa1a(0x24b)](_0x10fb4c,_0x17c9c6);await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+_0x3faa1a(0x25f)),_0x277388,_0x413db1),await this['writeFile'](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+_0x3faa1a(0x234)),serviceQuery,_0x413db1),await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+_0x3faa1a(0x255)),serviceMutation,_0x413db1);let _0x31de66=this['createTypeText'](_0x17c9c6);await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+_0x3faa1a(0x25d)),_0x31de66,_0x413db1);let _0x61babb=this[_0x3faa1a(0x229)](_0x10fb4c,_0x17c9c6);await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+'-history.ts'),_0x61babb,_0x413db1);let _0x5b4e97='';_0x3faa1a(0x230)==_0x10fb4c['dataProp']?(_0x5b4e97='\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'](_0x3a200e+(_0x4f11a0+_0x3faa1a(0x1f3)),serviceEntitySubscriber,_0x413db1)):_0x5b4e97='';let _0x4e38e3=serviceEntitySubscriber[_0x3faa1a(0x252)](/{{entityToJson}}/g,_0x5b4e97);await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+_0x3faa1a(0x1f3)),_0x4e38e3,_0x413db1),await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+'-history-query.ts'),serviceHistoryQuery,_0x413db1),await this[_0x3faa1a(0x1f9)](_0x3a200e+(_0x4f11a0+'/'+_0x4f11a0+_0x3faa1a(0x23f)),sereviceHistoryType,_0x413db1);let _0x5dfeda=_0x3a200e+'index.ts';0x0==await this['existsPath'](_0x5dfeda)&&await this[_0x3faa1a(0x1f9)](_0x5dfeda,allIndex,_0x413db1);let _0x41cd46=await fs['readFileSync'](_0x5dfeda,'utf8');_0x41cd46[_0x3faa1a(0x1fd)](_0x3faa1a(0x21a)+_0x413db1['name']+'/'+_0x413db1['name']+_0x3faa1a(0x24a))<0x0&&(_0x41cd46=_0x41cd46[_0x3faa1a(0x252)](/\/\* EXPORT ENTITY TYPES \*\//,_0x3faa1a(0x1ee)+_0x413db1[_0x3faa1a(0x1d6)]+'/'+_0x413db1[_0x3faa1a(0x1d6)]+'-history\x27')),_0x41cd46[_0x3faa1a(0x1fd)]('export\x20*\x20from\x20\x27./'+_0x413db1[_0x3faa1a(0x1d6)]+'/'+_0x413db1[_0x3faa1a(0x1d6)]+'\x27')<0x0&&(_0x41cd46=_0x41cd46[_0x3faa1a(0x252)](/\/\* EXPORT ENTITY TYPES \*\//,_0x3faa1a(0x1ee)+_0x413db1[_0x3faa1a(0x1d6)]+'/'+_0x413db1['name']+'\x27')),_0x41cd46['indexOf'](_0x3faa1a(0x249)+_0x413db1[_0x3faa1a(0x266)]+_0x3faa1a(0x24f)+_0x413db1[_0x3faa1a(0x266)]+_0x3faa1a(0x1db)+_0x413db1['pascalCaseName']+_0x3faa1a(0x1e6)+_0x413db1[_0x3faa1a(0x1d6)]+'\x27')<0x0&&(_0x41cd46=_0x41cd46['replace'](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x3faa1a(0x23c)+_0x413db1['pascalCaseName']+_0x3faa1a(0x24f)+_0x413db1[_0x3faa1a(0x266)]+_0x3faa1a(0x1db)+_0x413db1['pascalCaseName']+_0x3faa1a(0x1e6)+_0x413db1['name']+'\x27')),_0x41cd46['indexOf'](_0x3faa1a(0x244)+_0x413db1[_0x3faa1a(0x266)]+_0x3faa1a(0x1ec))<0x0&&(_0x41cd46=_0x41cd46['replace'](/\/\* ENTITIES \*\//,_0x3faa1a(0x236)+_0x413db1['pascalCaseName']+_0x3faa1a(0x1ec))),_0x41cd46[_0x3faa1a(0x1fd)](_0x3faa1a(0x244)+_0x413db1[_0x3faa1a(0x266)]+'Resolvers,')<0x0&&(_0x41cd46=_0x41cd46['replace'](/\/\* RESOLVER CLASSES \*\//,_0x3faa1a(0x264)+_0x413db1[_0x3faa1a(0x266)]+_0x3faa1a(0x1d7))),_0x41cd46[_0x3faa1a(0x1fd)](_0x3faa1a(0x244)+_0x413db1['pascalCaseName']+_0x3faa1a(0x263))<0x0&&(_0x41cd46=_0x41cd46[_0x3faa1a(0x252)](/\/\* SUBSCRIBERS \*\//,_0x3faa1a(0x1d8)+_0x413db1['pascalCaseName']+_0x3faa1a(0x263))),await this[_0x3faa1a(0x1f9)](_0x5dfeda,_0x41cd46,_0x413db1);}async[a0_0x177b44(0x233)](_0x16520d,_0x30bdf6,_0x3e2dc6,_0x4d275d,_0x3033a2){const _0x57dfd8=a0_0x177b44;await this[_0x57dfd8(0x1f9)](_0x16520d+(_0x30bdf6+_0x57dfd8(0x213)),serviceIndex,_0x3033a2),await this[_0x57dfd8(0x1f9)](_0x16520d+(_0x30bdf6+'/'+_0x30bdf6+_0x57dfd8(0x234)),serviceQuery,_0x3033a2),await this['writeFile'](_0x16520d+(_0x30bdf6+'/'+_0x30bdf6+'-mutation.ts'),serviceMutation,_0x3033a2);let _0x4e65bc=this[_0x57dfd8(0x24b)](_0x3e2dc6,_0x4d275d);await this[_0x57dfd8(0x1f9)](_0x16520d+(_0x30bdf6+'/'+_0x30bdf6+_0x57dfd8(0x25f)),_0x4e65bc,_0x3033a2);let _0x17513f=this[_0x57dfd8(0x23b)](_0x4d275d);await this[_0x57dfd8(0x1f9)](_0x16520d+(_0x30bdf6+'/'+_0x30bdf6+_0x57dfd8(0x25d)),_0x17513f,_0x3033a2);let _0x54804f=_0x16520d+_0x57dfd8(0x210);0x0==await this['existsPath'](_0x54804f)&&await this[_0x57dfd8(0x1f9)](_0x54804f,allIndex,_0x3033a2);let _0xaf522=await fs[_0x57dfd8(0x218)](_0x54804f,_0x57dfd8(0x214));_0xaf522['indexOf'](_0x57dfd8(0x21a)+_0x3033a2[_0x57dfd8(0x1d6)]+'/'+_0x3033a2[_0x57dfd8(0x1d6)]+'\x27')<0x0&&(_0xaf522=_0xaf522['replace'](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x3033a2[_0x57dfd8(0x1d6)]+'/'+_0x3033a2[_0x57dfd8(0x1d6)]+'\x27')),_0xaf522[_0x57dfd8(0x1fd)](_0x57dfd8(0x249)+_0x3033a2[_0x57dfd8(0x266)]+'Entities,\x20resolvers\x20as\x20'+_0x3033a2[_0x57dfd8(0x266)]+_0x57dfd8(0x254)+_0x3033a2[_0x57dfd8(0x1d6)]+'\x27')<0x0&&(_0xaf522=_0xaf522[_0x57dfd8(0x252)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x57dfd8(0x23c)+_0x3033a2['pascalCaseName']+'Entities,\x20resolvers\x20as\x20'+_0x3033a2[_0x57dfd8(0x266)]+'Resolvers\x20}\x20from\x20\x27./'+_0x3033a2[_0x57dfd8(0x1d6)]+'\x27')),_0xaf522[_0x57dfd8(0x1fd)]('...'+_0x3033a2[_0x57dfd8(0x266)]+_0x57dfd8(0x1ec))<0x0&&(_0xaf522=_0xaf522['replace'](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x3033a2[_0x57dfd8(0x266)]+'Entities,')),_0xaf522['indexOf'](_0x57dfd8(0x244)+_0x3033a2[_0x57dfd8(0x266)]+_0x57dfd8(0x1d7))<0x0&&(_0xaf522=_0xaf522[_0x57dfd8(0x252)](/\/\* RESOLVER CLASSES \*\//,_0x57dfd8(0x264)+_0x3033a2[_0x57dfd8(0x266)]+_0x57dfd8(0x1d7))),await this[_0x57dfd8(0x1f9)](_0x54804f,_0xaf522,_0x3033a2);}[a0_0x177b44(0x23b)](_0x5b8b81){const _0x3f2642=a0_0x177b44;let _0x1e9a3d=sereviceType,_0x504fcb=_0x5b8b81[_0x3f2642(0x224)](_0x8de9e9=>{const _0x1c73c9=_0x3f2642;if('id'==_0x8de9e9['name'])return'';if('domain_id'==_0x8de9e9[_0x1c73c9(0x1d6)])return'';if(_0x1c73c9(0x23d)==_0x8de9e9[_0x1c73c9(0x1d6)])return'';if(_0x1c73c9(0x211)==_0x8de9e9[_0x1c73c9(0x1d6)])return'';if('creator_id'==_0x8de9e9[_0x1c73c9(0x1d6)])return'';if('updater_id'==_0x8de9e9[_0x1c73c9(0x1d6)])return'';let _0x529300=this['getFieldType'](_0x8de9e9),_0x2ee7a7=this['getColTxtType'](_0x8de9e9),_0x484908=camelCase(_0x8de9e9['name']);return'\x20\x20'+(_0x1c73c9(0x220)+(0x0==_0x529300['length']?'':_0x1c73c9(0x239)+_0x529300+',')+_0x1c73c9(0x223)+_0x8de9e9['nullable']+_0x1c73c9(0x246))+_0x1c73c9(0x22d)+(''+_0x484908+(_0x8de9e9[_0x1c73c9(0x1ea)]?'?':'')+':\x20'+_0x2ee7a7)+'\x0a';});_0x1e9a3d=_0x1e9a3d[_0x3f2642(0x252)](/{{newTypeColumns}}/g,_0x504fcb[_0x3f2642(0x201)]('\x0a'));let _0x529aac=_0x5b8b81['map'](_0x156946=>{const _0x3eb8c7=_0x3f2642;if('id'==_0x156946[_0x3eb8c7(0x1d6)])return'';if(_0x3eb8c7(0x203)==_0x156946[_0x3eb8c7(0x1d6)])return'';if(_0x3eb8c7(0x23d)==_0x156946[_0x3eb8c7(0x1d6)])return'';if('updated_at'==_0x156946[_0x3eb8c7(0x1d6)])return'';if(_0x3eb8c7(0x267)==_0x156946[_0x3eb8c7(0x1d6)])return'';if(_0x3eb8c7(0x245)==_0x156946['name'])return'';let _0x14cd9c=this[_0x3eb8c7(0x1df)](_0x156946),_0x342d38=this['getColTxtType'](_0x156946);_0x156946[_0x3eb8c7(0x1ea)]=!0x0;let _0x1326a8=camelCase(_0x156946['name']);return'\x20\x20'+(_0x3eb8c7(0x220)+(0x0==_0x14cd9c['length']?'':'type\x20=>'+_0x14cd9c+',')+_0x3eb8c7(0x223)+_0x156946[_0x3eb8c7(0x1ea)]+'\x20})')+_0x3eb8c7(0x22d)+(''+_0x1326a8+(_0x156946['nullable']?'?':'')+':\x20'+_0x342d38)+'\x0a';});return _0x1e9a3d=_0x1e9a3d[_0x3f2642(0x252)](/{{patchTypeColumns}}/g,_0x529aac[_0x3f2642(0x201)]('\x0a')),_0x1e9a3d;}[a0_0x177b44(0x24b)](_0x2ded79,_0x161e35){const _0x3f073a=a0_0x177b44;let _0x40c15d=serviceEntity,_0x54c5ee=_0x161e35['sort'](function(_0x3f5cb5,_0x2e3d0d){const _0x34e324=a0_0x4848;return _0x3f5cb5[_0x34e324(0x231)]-_0x2e3d0d[_0x34e324(0x231)];})[_0x3f073a(0x224)](_0x372215=>this[_0x3f073a(0x1e1)](_0x372215));[_0x3f073a(0x24c),_0x3f073a(0x230)][_0x3f073a(0x21f)](_0x2ded79[_0x3f073a(0x25c)])&&_0x54c5ee[_0x3f073a(0x208)](_0x3f073a(0x258)),_0x40c15d=_0x40c15d[_0x3f073a(0x252)](/{{entityColumns}}/g,_0x54c5ee[_0x3f073a(0x201)]('\x0a'));let _0x1127df='',_0x5b3856=_0x161e35[_0x3f073a(0x221)](_0x21771c=>_0x21771c[_0x3f073a(0x222)]&&_0x21771c['uniqRank']>0x0)['sort'](function(_0x24c6ff,_0x243c47){const _0x288aa9=_0x3f073a;return _0x24c6ff['uniqRank']-_0x243c47[_0x288aa9(0x222)];});if(_0x5b3856['length']>0x0){_0x1127df='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0x1226d4=_0x5b3856[_0x3f073a(0x224)](_0x136784=>{const _0x4eb2a8=_0x3f073a;let _0x35cc5b=_0x136784[_0x4eb2a8(0x1d6)];return _0x4eb2a8(0x203)==_0x136784[_0x4eb2a8(0x1d6)]&&(_0x35cc5b=_0x4eb2a8(0x257)),_0x4eb2a8(0x267)==_0x136784[_0x4eb2a8(0x1d6)]&&(_0x35cc5b='creator'),_0x4eb2a8(0x245)==_0x136784[_0x4eb2a8(0x1d6)]&&(_0x35cc5b='updater'),'{{camelCase\x20name}}.'+camelCase(_0x35cc5b);});_0x1127df=_0x1127df['replace'](/{{indexColumns}}/g,_0x1226d4[_0x3f073a(0x201)](','));}return _0x40c15d=_0x40c15d[_0x3f073a(0x252)](/{{indexAnn}}/g,_0x1127df),_0x40c15d;}['createHistoryEntityText'](_0x46331a,_0x652cf5){const _0xec21ac=a0_0x177b44;let _0x11ed9c=_0xec21ac(0x230)==_0x46331a[_0xec21ac(0x25c)]?serviceEntityHistJson:serviceEntityHistCopy,_0x1b2694=_0x652cf5[_0xec21ac(0x256)](function(_0x3b3065,_0x29bc83){const _0x5c33ae=_0xec21ac;return _0x3b3065[_0x5c33ae(0x231)]-_0x29bc83['rank'];})['map'](_0x224cea=>this[_0xec21ac(0x1e1)](_0x224cea));return _0x11ed9c=_0x11ed9c['replace'](/{{entityColumns}}/g,_0x1b2694[_0xec21ac(0x201)]('\x0a')),_0x11ed9c;}[a0_0x177b44(0x1e1)](_0x267682){const _0x3dab62=a0_0x177b44;if('id'==_0x267682[_0x3dab62(0x1d6)])return'';if(_0x3dab62(0x203)==_0x267682['name'])return'';if('created_at'==_0x267682['name'])return'';if(_0x3dab62(0x211)==_0x267682[_0x3dab62(0x1d6)])return'';if('creator_id'==_0x267682[_0x3dab62(0x1d6)])return'';if(_0x3dab62(0x245)==_0x267682[_0x3dab62(0x1d6)])return'';let _0x49233f=_0x267682['colType'];_0x3dab62(0x228)==_0x267682['colType']&&(_0x49233f=_0x3dab62(0x1f7)),_0x3dab62(0x1dd)==_0x267682[_0x3dab62(0x1f4)]&&(_0x49233f=_0x3dab62(0x20c)),_0x3dab62(0x21c)==_0x267682[_0x3dab62(0x1f4)]&&(_0x49233f=_0x3dab62(0x265)),_0x3dab62(0x205)==_0x267682[_0x3dab62(0x1f4)]&&(_0x49233f=_0x3dab62(0x250));let _0x57ddda='';_0x3dab62(0x21c)==_0x267682['colType']&&(_0x57ddda=_0x267682['colSize']);let _0x5b2c71=this[_0x3dab62(0x1df)](_0x267682),_0x1d8be7=this[_0x3dab62(0x1e7)](_0x267682),_0x41ccf=camelCase(_0x267682['name']);return'\x20\x20'+(_0x3dab62(0x1ed)+_0x267682[_0x3dab62(0x1d6)]+_0x3dab62(0x25e)+_0x49233f+_0x3dab62(0x1fa)+_0x267682[_0x3dab62(0x1ea)]+'\x20'+(0x0==_0x57ddda['length']?'':_0x3dab62(0x1f6)+_0x57ddda)+_0x3dab62(0x246))+_0x3dab62(0x22d)+(_0x3dab62(0x220)+(0x0==_0x5b2c71[_0x3dab62(0x1fc)]?'':_0x3dab62(0x239)+_0x5b2c71+',')+_0x3dab62(0x223)+_0x267682[_0x3dab62(0x1ea)]+_0x3dab62(0x246))+'\x0a\x20\x20'+(''+_0x41ccf+(_0x267682[_0x3dab62(0x1ea)]?'?':'')+':\x20'+_0x1d8be7)+'\x0a';}[a0_0x177b44(0x1df)](_0x1ff2c2){const _0x3ecdcc=a0_0x177b44;let _0x5f6999='';return'double'==_0x1ff2c2[_0x3ecdcc(0x1f4)]&&(_0x5f6999=_0x3ecdcc(0x22a)),'float'==_0x1ff2c2[_0x3ecdcc(0x1f4)]&&(_0x5f6999=_0x3ecdcc(0x22a)),_0x3ecdcc(0x1dd)==_0x1ff2c2[_0x3ecdcc(0x1f4)]&&(_0x5f6999=_0x3ecdcc(0x1fe)),_0x3ecdcc(0x24d)==_0x1ff2c2[_0x3ecdcc(0x1f4)]&&(_0x5f6999=_0x3ecdcc(0x1fe)),_0x5f6999;}[a0_0x177b44(0x1e7)](_0x202121){const _0x555648=a0_0x177b44;let _0xf9b513=_0x202121[_0x555648(0x1f4)];return _0x555648(0x1da)==_0x202121['colType']&&(_0xf9b513='number'),_0x555648(0x228)==_0x202121[_0x555648(0x1f4)]&&(_0xf9b513='number'),_0x555648(0x20e)==_0x202121[_0x555648(0x1f4)]&&(_0xf9b513='number'),_0x555648(0x24d)==_0x202121['colType']&&(_0xf9b513=_0x555648(0x1f8)),_0x555648(0x1dd)==_0x202121['colType']&&(_0xf9b513=_0x555648(0x1f8)),_0x555648(0x205)==_0x202121[_0x555648(0x1f4)]&&(_0xf9b513=_0x555648(0x248)),_0x555648(0x200)==_0x202121[_0x555648(0x1f4)]&&(_0xf9b513=_0x555648(0x248)),_0x555648(0x251)==_0x202121[_0x555648(0x1f4)]&&(_0xf9b513=_0x555648(0x21c)),_0xf9b513;}async['writeFile'](_0x965423,_0xa8770,_0x183843){const _0x1e79d9=a0_0x177b44;await fs[_0x1e79d9(0x260)](_0x965423,this[_0x1e79d9(0x216)](_0xa8770,_0x183843),_0x1e79d9(0x214));}[a0_0x177b44(0x216)](_0x2ee6e0,_0x45229a){const _0xb744eb=a0_0x177b44;return _0x2ee6e0['replace'](/{{pascalCase name}}/g,_0x45229a[_0xb744eb(0x266)])[_0xb744eb(0x252)](/{{camelCase name}}/g,_0x45229a[_0xb744eb(0x20a)])[_0xb744eb(0x252)](/{{snakeCase name}}/g,_0x45229a[_0xb744eb(0x232)])['replace'](/{{pluralPascalCase name}}/g,_0x45229a['pluralPascalCaseName'])[_0xb744eb(0x252)](/{{pluralCamelCase name}}/g,_0x45229a['pluralCamelCaseName'])['replace'](/{{tableName}}/g,_0x45229a[_0xb744eb(0x23e)])[_0xb744eb(0x252)](/{{name}}/g,_0x45229a['name']);}async[a0_0x177b44(0x1f0)](_0x495aae,_0x33c5cb,_0x42125f){const _0x58eeb3=a0_0x177b44;let _0x2ba56e=_0x495aae+_0x58eeb3(0x20f);await this[_0x58eeb3(0x1e3)](_0x2ba56e),_0x2ba56e=_0x2ba56e+'/'+_0x33c5cb,await this[_0x58eeb3(0x1e3)](_0x2ba56e),_0x2ba56e+='/server',await this['createDir'](_0x2ba56e),_0x2ba56e+=_0x58eeb3(0x1e4),await this[_0x58eeb3(0x1e3)](_0x2ba56e),_0x2ba56e=_0x2ba56e+'/'+_0x42125f,await this[_0x58eeb3(0x1e3)](_0x2ba56e);}['getProjectRootPath'](){const _0x1829d8=a0_0x177b44;let _0x3fc731=process[_0x1829d8(0x1f5)]['PWD'][_0x1829d8(0x1d5)]('/'),_0x29fdd6=[];for(let _0x167b7a=0x0;_0x167b7a<_0x3fc731[_0x1829d8(0x1fc)]&&_0x1829d8(0x24e)!=_0x3fc731[_0x167b7a];_0x167b7a++)_0x29fdd6[_0x1829d8(0x208)](_0x3fc731[_0x167b7a]);return _0x29fdd6['join']('/');}async[a0_0x177b44(0x1e3)](_0x294551){const _0x389326=a0_0x177b44;0x0==await this[_0x389326(0x1de)](_0x294551)&&fs[_0x389326(0x202)](_0x294551);}async[a0_0x177b44(0x1de)](_0x560ab1){const _0x26ea15=a0_0x177b44;return await fs[_0x26ea15(0x238)](_0x560ab1);}};tslib_1[a0_0x177b44(0x259)]([(0x0,type_graphql_1[a0_0x177b44(0x22e)])(_0x1480b9=>Boolean,{'description':a0_0x177b44(0x262)}),tslib_1[a0_0x177b44(0x217)](0x0,(0x0,type_graphql_1[a0_0x177b44(0x21d)])('id')),tslib_1[a0_0x177b44(0x217)](0x1,(0x0,type_graphql_1[a0_0x177b44(0x235)])()),tslib_1['__metadata'](a0_0x177b44(0x225),Function),tslib_1['__metadata'](a0_0x177b44(0x237),[String,Object]),tslib_1[a0_0x177b44(0x226)](a0_0x177b44(0x1e2),Promise)],OperatoToolCreateService[a0_0x177b44(0x1e9)],a0_0x177b44(0x227),null),OperatoToolCreateService=tslib_1[a0_0x177b44(0x259)]([(0x0,type_graphql_1[a0_0x177b44(0x1dc)])()],OperatoToolCreateService),exports[a0_0x177b44(0x207)]=OperatoToolCreateService;function a0_0x42d7(){const _0x414513=['readFileSync','type-graphql','export\x20*\x20from\x20\x27./','\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','string','Arg','30iSStsQ','includes','@Field(','filter','uniqRank','\x20{\x20nullable:\x20','map','design:type','__metadata','toolCreateService','double','createHistoryEntityText','Float','590149zyuXKE','\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','\x0a\x20\x20','Query','1893992ZJCajf','JSON','rank','snakeCaseName','createNoHistoryServiceFiels','-query.ts','Ctx','/*\x20ENTITIES\x20*/\x0a\x09...','design:paramtypes','existsSync','type\x20=>','\x0aimport\x20{\x20EventSubscriber\x20}\x20from\x20\x27typeorm\x27\x0aimport\x20{\x20HistoryEntitySubscriber\x20}\x20from\x20\x27@operato/typeorm-history\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20getRepository\x20}\x20from\x20\x27@things-factory/shell\x27\x0a\x0a@EventSubscriber()\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryEntitySubscriber\x20extends\x20HistoryEntitySubscriber<{{pascalCase\x20name}},{{pascalCase\x20name}}History>\x20{\x0a\x20\x20public\x20get\x20entity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}\x0a\x20\x20}\x0a\x0a\x20\x20public\x20get\x20historyEntity()\x20{\x0a\x20\x20\x20\x20return\x20{{pascalCase\x20name}}History\x0a\x20\x20}\x0a\x0a\x20\x20{{entityToJson}}\x0a\x0a\x20\x20async\x20beforeRemoveHistory(history:{{pascalCase\x20name}}History,entity:{{pascalCase\x20name}}){\x0a\x20\x20\x20\x20let\x20repo\x20=\x20getRepository({{pascalCase\x20name}}History);\x0a\x20\x20\x20\x20const\x20revNo\x20=\x20await\x20repo.createQueryBuilder()\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.select(\x27max(data_revision_no)\x27,\x20\x27rev_no\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.where(\x27domain_id\x20=\x20:domainId\x27,\x20{\x20domainId:\x20entity.domain.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.andWhere(\x27original_id\x20=\x20:originalId\x27,\x20{\x20originalId:\x20entity.id\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.getRawOne()\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20history.dataRevisionNo\x20=\x20revNo\x20?\x20revNo.rev_no\x20+\x201\x20:\x201;\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a}\x0a','createTypeText','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','created_at','tableName','-history-type.ts','__esModule','\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','lodash','4JralYO','...','updater_id','\x20})','EntityColumn','Date','import\x20{\x20entities\x20as\x20','-history\x27','createEntityText','COPY','integer','packages','Entities,\x20resolvers\x20as\x20','timestamp\x20without\x20time\x20zone','text','replace','101320uqXvHD','Resolvers\x20}\x20from\x20\x27./','-mutation.ts','sort','domain','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','__decorate','3954429kMIiWf','1010420bnfKzi','dataProp','-type.ts','\x27,\x20type:\x20\x27','.ts','writeFileSync','find','Operato\x20Tool\x20Create\x20Service','EntitySubscribers,','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','character\x20varying','pascalCaseName','creator_id','split','name','Resolvers,','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','createServiceFiles','decimal','Resolvers,\x20subscribers\x20as\x20','Resolver','long','existsPath','getFieldType','250221lMPoLH','columnToEntityColumn','design:returntype','createDir','/service','\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','EntitySubscribers\x20}\x20from\x20\x27./','getColTxtType','2mXMYXR','prototype','nullable','@things-factory/shell','Entities,','@Column({name:\x27','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','Entity','createServicePath','getRepository','createHistoryServiceFiles','/event-subscriber.ts','colType','env',',length:','double\x20precision','number','writeFile','\x27,\x20nullable:\x20','495HQoIAZ','length','indexOf','Int','\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','date','join','mkdirSync','domain_id','\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','datetime','/server/service/','OperatoToolCreateService','push','\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','camelCaseName','48802OkgYce','bigint','\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','float','/packages','index.ts','updated_at','getProjectRootPath','/index.ts','utf8','findOne','replaceNamesMap','__param'];a0_0x42d7=function(){return _0x414513;};return a0_0x42d7();}const allIndex=a0_0x177b44(0x209),serviceIndex='\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}}]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}Mutation]\x0a',serviceHistoryIndex=a0_0x177b44(0x1ff),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_0x177b44(0x204),serviceMutation=a0_0x177b44(0x21b),sereviceType=a0_0x177b44(0x241),sereviceHistoryType=a0_0x177b44(0x1e5),serviceEntity=a0_0x177b44(0x22c),serviceEntityHistCopy=a0_0x177b44(0x20d),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_0x177b44(0x23a);
|
|
1
|
+
'use strict';const a0_0x4d2c7a=a0_0x4a0a;function a0_0x483f(){const _0x1ba862=['createTypeText','colSize','updated_at','rank','Date','getFieldType','\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','-history-type.ts','624197qDReGL','createNoHistoryServiceFiels','/packages/','\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','creator_id','index.ts','\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','double','character\x20varying','Entities,','columnToEntityColumn','writeFile','EntitySubscribers\x20}\x20from\x20\x27./','@Field(','__param','integer','__esModule','updater_id','Arg','createEntityText','/service','/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./','\x0a\x20\x20public\x20createHistoryEntity(manager,\x20entity)\x20{\x0a\x20\x20\x20\x20let\x20history\x20=\x20manager.create(this.historyEntity,\x20entity);\x0a\x20\x20\x20\x20history.historyJson\x20=\x20JSON.stringify(entity);\x0a\x20\x20\x20\x20return\x20history;\x0a\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20@VersionColumn({\x20default:\x201\x20})\x0a\x20\x20@Field({\x20nullable:\x20true\x20})\x0a\x20\x20dataRevisionNo?:\x20number\x20=\x201','date','-history.ts','COPY','createDir','6648ltMXMZ','float','uniqRank','\x27,\x20nullable:\x20','tableName','type\x20=>','@things-factory/shell','join','design:returntype','Ctx','sort','mkdirSync','\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Query\x20}\x20from\x20\x27./{{name}}-query\x27\x0aimport\x20{\x20{{pascalCase\x20name}}Mutation\x20}\x20from\x20\x27./{{name}}-mutation\x27\x0a\x0aexport\x20const\x20entities\x20=\x20[{{pascalCase\x20name}}]\x0aexport\x20const\x20resolvers\x20=\x20[{{pascalCase\x20name}}Query,\x20{{pascalCase\x20name}}Mutation]\x0a','696940fXLaOU','/packages','tslib','\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','Resolver','Resolvers,','-history\x27','/event-subscriber.ts','string','existsSync','JSON','creator','882501JPIpEC','includes','OperatoToolCreateService','findOne','5133095xrFFqh','__decorate','pascalCaseName','prototype','EntitySubscribers,','updater','\x20{\x20nullable:\x20','\x27,\x20type:\x20\x27','Query','27094671kXRknv','created_at','find','/*\x20SUBSCRIBERS\x20*/\x0a\x09\x09...','-query.ts','pluralCamelCaseName','bigint','domain','-mutation.ts','\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','replaceNamesMap','...','\x0a\x20\x20','utf8','@things-factory/resource-base','getColTxtType','snakeCaseName','Operato\x20Tool\x20Create\x20Service','existsPath','-type.ts','@Column({name:\x27','readFileSync','type-graphql','createServicePath','import\x20{\x20entities\x20as\x20','/*\x20RESOLVER\x20CLASSES\x20*/\x0a\x09\x09...','number','length','/index.ts','\x20})','PWD','packages','name','Entity','indexOf','state','1897OpFYBJ','12qpHwYp','5904102yHBbLJ','{{camelCase\x20name}}.','Resolvers,\x20subscribers\x20as\x20','\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0aimport\x20{\x20{{pascalCase\x20name}}List\x20}\x20from\x20\x27./{{name}}-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}})\x0aexport\x20class\x20{{pascalCase\x20name}}Query\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}},\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}List,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}\x27\x20})\x0a\x20\x20async\x20{{pluralCamelCase\x20name}}(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}List>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}})\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20convertedParams\x20=\x20convertListParams(params,\x20domain.id)\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}:\x20{{pascalCase\x20name}}):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}.creatorId})\x0a\x20\x20}\x0a}\x0a','writeFileSync','\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','createHistoryServiceFiles','split','createServiceFiles','defineProperty','camelCaseName','\x0aimport\x20{\x20ObjectType,\x20Field,\x20InputType,\x20Int,\x20ID,\x20Float,\x20registerEnumType\x20}\x20from\x20\x27type-graphql\x27\x0a\x0aimport\x20{\x20{{pascalCase\x20name}}\x20}\x20from\x20\x27./{{name}}\x27\x0a\x0a@InputType()\x0aexport\x20class\x20New{{pascalCase\x20name}}\x20{\x0a{{newTypeColumns}}\x0a}\x0a\x0a@InputType()\x0aexport\x20class\x20{{pascalCase\x20name}}Patch\x20{\x0a\x20\x20@Field(type\x20=>\x20ID,\x20{\x20nullable:\x20true\x20})\x0a\x20\x20id?:\x20string\x0a\x0a{{patchTypeColumns}}\x0a\x0a\x20\x20@Field()\x0a\x20\x20cuFlag:\x20string\x0a}\x0a\x0a@ObjectType()\x0aexport\x20class\x20{{pascalCase\x20name}}List\x20{\x0a\x20\x20@Field(type\x20=>\x20[{{pascalCase\x20name}}])\x0a\x20\x20items:\x20{{pascalCase\x20name}}[]\x0a\x0a\x20\x20@Field(type\x20=>\x20Int)\x0a\x20\x20total:\x20number\x0a}\x0a','__metadata','Entities,\x20resolvers\x20as\x20','replace','toolCreateService','colType','/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20','design:paramtypes',',length:','-history-query.ts','env','createHistoryEntityText','EntityColumn','getRepository','pluralize','push','map','\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','nullable','export\x20*\x20from\x20\x27./','pluralPascalCaseName','Int','lodash','text','long'];a0_0x483f=function(){return _0x1ba862;};return a0_0x483f();}(function(_0x4b3865,_0x53a8ac){const _0x2f8d5e=a0_0x4a0a,_0x5f4fde=_0x4b3865();while(!![]){try{const _0x34cfb0=parseInt(_0x2f8d5e(0x181))/0x1+parseInt(_0x2f8d5e(0x1ab))/0x2+-parseInt(_0x2f8d5e(0x1b7))/0x3*(-parseInt(_0x2f8d5e(0x1e9))/0x4)+parseInt(_0x2f8d5e(0x1bb))/0x5+parseInt(_0x2f8d5e(0x1ea))/0x6+-parseInt(_0x2f8d5e(0x1e8))/0x7*(parseInt(_0x2f8d5e(0x19e))/0x8)+-parseInt(_0x2f8d5e(0x1c4))/0x9;if(_0x34cfb0===_0x53a8ac)break;else _0x5f4fde['push'](_0x5f4fde['shift']());}catch(_0x4be5db){_0x5f4fde['push'](_0x5f4fde['shift']());}}}(a0_0x483f,0x99d44));Object[a0_0x4d2c7a(0x1f3)](exports,a0_0x4d2c7a(0x192),{'value':!0x0}),exports[a0_0x4d2c7a(0x1b9)]=void 0x0;const tslib_1=require(a0_0x4d2c7a(0x1ad)),type_graphql_1=require(a0_0x4d2c7a(0x1da)),shell_1=require(a0_0x4d2c7a(0x1a4)),resource_base_1=require(a0_0x4d2c7a(0x1d2)),{camelCase:camelCase,startCase:startCase,snakeCase:snakeCase,kebabCase:kebabCase}=require(a0_0x4d2c7a(0x176)),{plural:plural}=require(a0_0x4d2c7a(0x16e)),fs=require('fs');function a0_0x4a0a(_0x12b47a,_0x2c30b4){const _0x483f1e=a0_0x483f();return a0_0x4a0a=function(_0x4a0a65,_0x5bb452){_0x4a0a65=_0x4a0a65-0x16b;let _0x562b6b=_0x483f1e[_0x4a0a65];return _0x562b6b;},a0_0x4a0a(_0x12b47a,_0x2c30b4);}let OperatoToolCreateService=class{async[a0_0x4d2c7a(0x1f9)](_0x1a38df,_0x2da30e){const _0x30a2d7=a0_0x4d2c7a,{domain:_0x2310b2}=_0x2da30e[_0x30a2d7(0x1e7)],_0x428099=await(0x0,shell_1[_0x30a2d7(0x16d)])(resource_base_1[_0x30a2d7(0x1e5)])[_0x30a2d7(0x1ba)]({'where':{'id':_0x1a38df}}),_0x2970da=await(0x0,shell_1[_0x30a2d7(0x16d)])(resource_base_1[_0x30a2d7(0x16c)])[_0x30a2d7(0x1c6)]({'where':{'domain':{'id':_0x2310b2['id']},'entity':{'id':_0x428099['id']}}});let {name:_0x166b89='',bundle:_0x7edb00=''}=_0x428099||{},_0x570333=this['getProjectRootPath'](),_0x5cb958=kebabCase(_0x166b89);return await this[_0x30a2d7(0x1db)](_0x570333,_0x7edb00,_0x5cb958),await this[_0x30a2d7(0x1f2)](_0x570333,_0x7edb00,_0x166b89,_0x5cb958,_0x428099,_0x2970da),!0x0;}async[a0_0x4d2c7a(0x1f2)](_0x5e7578,_0x136fea,_0x1ff009,_0x1d71c2,_0x3ef214,_0x39860a){const _0x1a4d5e=a0_0x4d2c7a;let _0xcf25f0={'name':_0x1d71c2,'tableName':_0x3ef214[_0x1a4d5e(0x1a2)],'pascalCaseName':startCase(camelCase(_0x1ff009))[_0x1a4d5e(0x1f8)](/ /g,''),'camelCaseName':camelCase(_0x1ff009),'snakeCaseName':snakeCase(_0x1ff009),'pluralPascalCaseName':startCase(camelCase(plural(_0x1ff009)))[_0x1a4d5e(0x1f8)](/ /g,''),'pluralCamelCaseName':camelCase(plural(_0x1ff009))},_0x31d9a4=_0x5e7578+_0x1a4d5e(0x183)+_0x136fea+'/server/service/';[_0x1a4d5e(0x1b5),_0x1a4d5e(0x19c)][_0x1a4d5e(0x1b8)](_0x3ef214[_0x1a4d5e(0x188)])?await this[_0x1a4d5e(0x1f0)](_0x31d9a4,_0x1d71c2,_0x3ef214,_0x39860a,_0xcf25f0):await this['createNoHistoryServiceFiels'](_0x31d9a4,_0x1d71c2,_0x3ef214,_0x39860a,_0xcf25f0);}async[a0_0x4d2c7a(0x1f0)](_0x38090c,_0xe73923,_0x541bda,_0x3d813e,_0x4fa5f3){const _0x552298=a0_0x4d2c7a;await this['writeFile'](_0x38090c+(_0xe73923+_0x552298(0x1e0)),serviceHistoryIndex,_0x4fa5f3);let _0x20773e=this[_0x552298(0x195)](_0x541bda,_0x3d813e);await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+'/'+_0xe73923+'.ts'),_0x20773e,_0x4fa5f3),await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+'/'+_0xe73923+_0x552298(0x1c8)),serviceQuery,_0x4fa5f3),await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+'/'+_0xe73923+_0x552298(0x1cc)),serviceMutation,_0x4fa5f3);let _0x14a4c5=this[_0x552298(0x179)](_0x3d813e);await this['writeFile'](_0x38090c+(_0xe73923+'/'+_0xe73923+_0x552298(0x1d7)),_0x14a4c5,_0x4fa5f3);let _0x3fa32a=this[_0x552298(0x16b)](_0x541bda,_0x3d813e);await this['writeFile'](_0x38090c+(_0xe73923+'/'+_0xe73923+_0x552298(0x19b)),_0x3fa32a,_0x4fa5f3);let _0x3af1d1='';_0x552298(0x1b5)==_0x541bda[_0x552298(0x188)]?(_0x3af1d1=_0x552298(0x198),await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+_0x552298(0x1b2)),serviceEntitySubscriber,_0x4fa5f3)):_0x3af1d1='';let _0x44b6dd=serviceEntitySubscriber[_0x552298(0x1f8)](/{{entityToJson}}/g,_0x3af1d1);await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+_0x552298(0x1b2)),_0x44b6dd,_0x4fa5f3),await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+'/'+_0xe73923+_0x552298(0x1fe)),serviceHistoryQuery,_0x4fa5f3),await this[_0x552298(0x18d)](_0x38090c+(_0xe73923+'/'+_0xe73923+_0x552298(0x180)),sereviceHistoryType,_0x4fa5f3);let _0x492daf=_0x38090c+_0x552298(0x186);0x0==await this[_0x552298(0x1d6)](_0x492daf)&&await this[_0x552298(0x18d)](_0x492daf,allIndex,_0x4fa5f3);let _0x24e88e=await fs[_0x552298(0x1d9)](_0x492daf,_0x552298(0x1d1));_0x24e88e[_0x552298(0x1e6)](_0x552298(0x173)+_0x4fa5f3[_0x552298(0x1e4)]+'/'+_0x4fa5f3[_0x552298(0x1e4)]+_0x552298(0x1b1))<0x0&&(_0x24e88e=_0x24e88e['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x552298(0x197)+_0x4fa5f3[_0x552298(0x1e4)]+'/'+_0x4fa5f3['name']+'-history\x27')),_0x24e88e['indexOf'](_0x552298(0x173)+_0x4fa5f3[_0x552298(0x1e4)]+'/'+_0x4fa5f3[_0x552298(0x1e4)]+'\x27')<0x0&&(_0x24e88e=_0x24e88e['replace'](/\/\* EXPORT ENTITY TYPES \*\//,_0x552298(0x197)+_0x4fa5f3['name']+'/'+_0x4fa5f3[_0x552298(0x1e4)]+'\x27')),_0x24e88e[_0x552298(0x1e6)](_0x552298(0x1dc)+_0x4fa5f3[_0x552298(0x1bd)]+'Entities,\x20resolvers\x20as\x20'+_0x4fa5f3[_0x552298(0x1bd)]+'Resolvers,\x20subscribers\x20as\x20'+_0x4fa5f3[_0x552298(0x1bd)]+_0x552298(0x18e)+_0x4fa5f3[_0x552298(0x1e4)]+'\x27')<0x0&&(_0x24e88e=_0x24e88e[_0x552298(0x1f8)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,'/*\x20IMPORT\x20ENTITIES\x20AND\x20RESOLVERS\x20*/\x0aimport\x20{\x20entities\x20as\x20'+_0x4fa5f3['pascalCaseName']+_0x552298(0x1f7)+_0x4fa5f3[_0x552298(0x1bd)]+_0x552298(0x1ec)+_0x4fa5f3[_0x552298(0x1bd)]+'EntitySubscribers\x20}\x20from\x20\x27./'+_0x4fa5f3[_0x552298(0x1e4)]+'\x27')),_0x24e88e['indexOf'](_0x552298(0x1cf)+_0x4fa5f3[_0x552298(0x1bd)]+_0x552298(0x18b))<0x0&&(_0x24e88e=_0x24e88e[_0x552298(0x1f8)](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x4fa5f3[_0x552298(0x1bd)]+_0x552298(0x18b))),_0x24e88e[_0x552298(0x1e6)](_0x552298(0x1cf)+_0x4fa5f3[_0x552298(0x1bd)]+_0x552298(0x1b0))<0x0&&(_0x24e88e=_0x24e88e[_0x552298(0x1f8)](/\/\* RESOLVER CLASSES \*\//,_0x552298(0x1dd)+_0x4fa5f3[_0x552298(0x1bd)]+_0x552298(0x1b0))),_0x24e88e[_0x552298(0x1e6)](_0x552298(0x1cf)+_0x4fa5f3['pascalCaseName']+_0x552298(0x1bf))<0x0&&(_0x24e88e=_0x24e88e[_0x552298(0x1f8)](/\/\* SUBSCRIBERS \*\//,_0x552298(0x1c7)+_0x4fa5f3['pascalCaseName']+_0x552298(0x1bf))),await this[_0x552298(0x18d)](_0x492daf,_0x24e88e,_0x4fa5f3);}async[a0_0x4d2c7a(0x182)](_0xcde049,_0x411e67,_0x367c08,_0x36794e,_0x5b2e50){const _0x506b15=a0_0x4d2c7a;await this[_0x506b15(0x18d)](_0xcde049+(_0x411e67+'/index.ts'),serviceIndex,_0x5b2e50),await this['writeFile'](_0xcde049+(_0x411e67+'/'+_0x411e67+_0x506b15(0x1c8)),serviceQuery,_0x5b2e50),await this[_0x506b15(0x18d)](_0xcde049+(_0x411e67+'/'+_0x411e67+_0x506b15(0x1cc)),serviceMutation,_0x5b2e50);let _0x7b1df7=this[_0x506b15(0x195)](_0x367c08,_0x36794e);await this[_0x506b15(0x18d)](_0xcde049+(_0x411e67+'/'+_0x411e67+'.ts'),_0x7b1df7,_0x5b2e50);let _0x41e474=this[_0x506b15(0x179)](_0x36794e);await this[_0x506b15(0x18d)](_0xcde049+(_0x411e67+'/'+_0x411e67+_0x506b15(0x1d7)),_0x41e474,_0x5b2e50);let _0x172d71=_0xcde049+_0x506b15(0x186);0x0==await this[_0x506b15(0x1d6)](_0x172d71)&&await this[_0x506b15(0x18d)](_0x172d71,allIndex,_0x5b2e50);let _0x293138=await fs['readFileSync'](_0x172d71,_0x506b15(0x1d1));_0x293138[_0x506b15(0x1e6)](_0x506b15(0x173)+_0x5b2e50[_0x506b15(0x1e4)]+'/'+_0x5b2e50['name']+'\x27')<0x0&&(_0x293138=_0x293138[_0x506b15(0x1f8)](/\/\* EXPORT ENTITY TYPES \*\//,'/*\x20EXPORT\x20ENTITY\x20TYPES\x20*/\x0aexport\x20*\x20from\x20\x27./'+_0x5b2e50['name']+'/'+_0x5b2e50[_0x506b15(0x1e4)]+'\x27')),_0x293138[_0x506b15(0x1e6)](_0x506b15(0x1dc)+_0x5b2e50[_0x506b15(0x1bd)]+_0x506b15(0x1f7)+_0x5b2e50[_0x506b15(0x1bd)]+'Resolvers\x20}\x20from\x20\x27./'+_0x5b2e50[_0x506b15(0x1e4)]+'\x27')<0x0&&(_0x293138=_0x293138[_0x506b15(0x1f8)](/\/\* IMPORT ENTITIES AND RESOLVERS \*\//,_0x506b15(0x1fb)+_0x5b2e50['pascalCaseName']+_0x506b15(0x1f7)+_0x5b2e50[_0x506b15(0x1bd)]+'Resolvers\x20}\x20from\x20\x27./'+_0x5b2e50['name']+'\x27')),_0x293138[_0x506b15(0x1e6)](_0x506b15(0x1cf)+_0x5b2e50[_0x506b15(0x1bd)]+_0x506b15(0x18b))<0x0&&(_0x293138=_0x293138[_0x506b15(0x1f8)](/\/\* ENTITIES \*\//,'/*\x20ENTITIES\x20*/\x0a\x09...'+_0x5b2e50[_0x506b15(0x1bd)]+_0x506b15(0x18b))),_0x293138[_0x506b15(0x1e6)](_0x506b15(0x1cf)+_0x5b2e50[_0x506b15(0x1bd)]+_0x506b15(0x1b0))<0x0&&(_0x293138=_0x293138['replace'](/\/\* RESOLVER CLASSES \*\//,_0x506b15(0x1dd)+_0x5b2e50[_0x506b15(0x1bd)]+'Resolvers,')),await this[_0x506b15(0x18d)](_0x172d71,_0x293138,_0x5b2e50);}[a0_0x4d2c7a(0x179)](_0x27375d){const _0x180e46=a0_0x4d2c7a;let _0x2b9195=sereviceType,_0x528190=_0x27375d[_0x180e46(0x170)](_0x14027f=>{const _0xe4575e=_0x180e46;if('id'==_0x14027f[_0xe4575e(0x1e4)])return'';if('domain_id'==_0x14027f['name'])return'';if(_0xe4575e(0x1c5)==_0x14027f[_0xe4575e(0x1e4)])return'';if(_0xe4575e(0x17b)==_0x14027f['name'])return'';if(_0xe4575e(0x185)==_0x14027f[_0xe4575e(0x1e4)])return'';if(_0xe4575e(0x193)==_0x14027f[_0xe4575e(0x1e4)])return'';let _0x22008c=this[_0xe4575e(0x17e)](_0x14027f),_0x6a71ba=this[_0xe4575e(0x1d3)](_0x14027f),_0x597abe=camelCase(_0x14027f[_0xe4575e(0x1e4)]);return'\x20\x20'+('@Field('+(0x0==_0x22008c['length']?'':_0xe4575e(0x1a3)+_0x22008c+',')+'\x20{\x20nullable:\x20'+_0x14027f['nullable']+_0xe4575e(0x1e1))+_0xe4575e(0x1d0)+(''+_0x597abe+(_0x14027f[_0xe4575e(0x172)]?'?':'')+':\x20'+_0x6a71ba)+'\x0a';});_0x2b9195=_0x2b9195[_0x180e46(0x1f8)](/{{newTypeColumns}}/g,_0x528190['join']('\x0a'));let _0x2d6cdc=_0x27375d[_0x180e46(0x170)](_0xf3b39a=>{const _0x1e3dc6=_0x180e46;if('id'==_0xf3b39a[_0x1e3dc6(0x1e4)])return'';if('domain_id'==_0xf3b39a[_0x1e3dc6(0x1e4)])return'';if(_0x1e3dc6(0x1c5)==_0xf3b39a[_0x1e3dc6(0x1e4)])return'';if('updated_at'==_0xf3b39a[_0x1e3dc6(0x1e4)])return'';if(_0x1e3dc6(0x185)==_0xf3b39a[_0x1e3dc6(0x1e4)])return'';if(_0x1e3dc6(0x193)==_0xf3b39a['name'])return'';let _0x55a98a=this['getFieldType'](_0xf3b39a),_0x220c71=this[_0x1e3dc6(0x1d3)](_0xf3b39a);_0xf3b39a[_0x1e3dc6(0x172)]=!0x0;let _0x3a52af=camelCase(_0xf3b39a[_0x1e3dc6(0x1e4)]);return'\x20\x20'+(_0x1e3dc6(0x18f)+(0x0==_0x55a98a[_0x1e3dc6(0x1df)]?'':_0x1e3dc6(0x1a3)+_0x55a98a+',')+_0x1e3dc6(0x1c1)+_0xf3b39a[_0x1e3dc6(0x172)]+'\x20})')+_0x1e3dc6(0x1d0)+(''+_0x3a52af+(_0xf3b39a['nullable']?'?':'')+':\x20'+_0x220c71)+'\x0a';});return _0x2b9195=_0x2b9195[_0x180e46(0x1f8)](/{{patchTypeColumns}}/g,_0x2d6cdc[_0x180e46(0x1a5)]('\x0a')),_0x2b9195;}[a0_0x4d2c7a(0x195)](_0x2ca19a,_0x137a22){const _0x42454f=a0_0x4d2c7a;let _0x54bedc=serviceEntity,_0x1eedde=_0x137a22['sort'](function(_0x531e97,_0x5726ad){const _0x3901ce=a0_0x4a0a;return _0x531e97[_0x3901ce(0x17c)]-_0x5726ad[_0x3901ce(0x17c)];})[_0x42454f(0x170)](_0x5b3d3a=>this[_0x42454f(0x18c)](_0x5b3d3a));[_0x42454f(0x19c),'JSON'][_0x42454f(0x1b8)](_0x2ca19a[_0x42454f(0x188)])&&_0x1eedde[_0x42454f(0x16f)](_0x42454f(0x199)),_0x54bedc=_0x54bedc[_0x42454f(0x1f8)](/{{entityColumns}}/g,_0x1eedde[_0x42454f(0x1a5)]('\x0a'));let _0xffa0ad='',_0x2a3dca=_0x137a22['filter'](_0x5d4256=>_0x5d4256[_0x42454f(0x1a0)]&&_0x5d4256[_0x42454f(0x1a0)]>0x0)['sort'](function(_0x3fac9e,_0x29a472){const _0x2ac198=_0x42454f;return _0x3fac9e['uniqRank']-_0x29a472[_0x2ac198(0x1a0)];});if(_0x2a3dca[_0x42454f(0x1df)]>0x0){_0xffa0ad='@Index(\x27ix_{{snakeCase\x20name}}_0\x27,\x20({{camelCase\x20name}}:\x20{{pascalCase\x20name}})\x20=>\x20[{{indexColumns}}],\x20{\x20unique:\x20true\x20})';let _0xa54671=_0x2a3dca[_0x42454f(0x170)](_0x2342e9=>{const _0x50551e=_0x42454f;let _0x8c6ec6=_0x2342e9['name'];return'domain_id'==_0x2342e9[_0x50551e(0x1e4)]&&(_0x8c6ec6=_0x50551e(0x1cb)),_0x50551e(0x185)==_0x2342e9[_0x50551e(0x1e4)]&&(_0x8c6ec6=_0x50551e(0x1b6)),_0x50551e(0x193)==_0x2342e9['name']&&(_0x8c6ec6=_0x50551e(0x1c0)),_0x50551e(0x1eb)+camelCase(_0x8c6ec6);});_0xffa0ad=_0xffa0ad[_0x42454f(0x1f8)](/{{indexColumns}}/g,_0xa54671[_0x42454f(0x1a5)](','));}return _0x54bedc=_0x54bedc[_0x42454f(0x1f8)](/{{indexAnn}}/g,_0xffa0ad),_0x54bedc;}[a0_0x4d2c7a(0x16b)](_0x590fc7,_0x3d604b){const _0x25e566=a0_0x4d2c7a;let _0x276b59=_0x25e566(0x1b5)==_0x590fc7['dataProp']?serviceEntityHistJson:serviceEntityHistCopy,_0x5a72a5=_0x3d604b[_0x25e566(0x1a8)](function(_0x1dd1ad,_0x2b8274){const _0x4adc21=_0x25e566;return _0x1dd1ad['rank']-_0x2b8274[_0x4adc21(0x17c)];})[_0x25e566(0x170)](_0x5c49fc=>this[_0x25e566(0x18c)](_0x5c49fc));return _0x276b59=_0x276b59[_0x25e566(0x1f8)](/{{entityColumns}}/g,_0x5a72a5[_0x25e566(0x1a5)]('\x0a')),_0x276b59;}[a0_0x4d2c7a(0x18c)](_0x116a0c){const _0x38b738=a0_0x4d2c7a;if('id'==_0x116a0c[_0x38b738(0x1e4)])return'';if('domain_id'==_0x116a0c[_0x38b738(0x1e4)])return'';if(_0x38b738(0x1c5)==_0x116a0c[_0x38b738(0x1e4)])return'';if('updated_at'==_0x116a0c[_0x38b738(0x1e4)])return'';if(_0x38b738(0x185)==_0x116a0c[_0x38b738(0x1e4)])return'';if(_0x38b738(0x193)==_0x116a0c[_0x38b738(0x1e4)])return'';let _0x538532=_0x116a0c[_0x38b738(0x1fa)];_0x38b738(0x189)==_0x116a0c[_0x38b738(0x1fa)]&&(_0x538532='double\x20precision'),_0x38b738(0x178)==_0x116a0c[_0x38b738(0x1fa)]&&(_0x538532=_0x38b738(0x1ca)),'string'==_0x116a0c[_0x38b738(0x1fa)]&&(_0x538532=_0x38b738(0x18a)),'datetime'==_0x116a0c[_0x38b738(0x1fa)]&&(_0x538532='timestamp\x20without\x20time\x20zone');let _0x475ca1='';'string'==_0x116a0c['colType']&&(_0x475ca1=_0x116a0c[_0x38b738(0x17a)]);let _0x2b4cd5=this[_0x38b738(0x17e)](_0x116a0c),_0x2c2253=this['getColTxtType'](_0x116a0c),_0xc45297=camelCase(_0x116a0c[_0x38b738(0x1e4)]);return'\x20\x20'+(_0x38b738(0x1d8)+_0x116a0c[_0x38b738(0x1e4)]+_0x38b738(0x1c2)+_0x538532+_0x38b738(0x1a1)+_0x116a0c[_0x38b738(0x172)]+'\x20'+(0x0==_0x475ca1['length']?'':_0x38b738(0x1fd)+_0x475ca1)+_0x38b738(0x1e1))+_0x38b738(0x1d0)+(_0x38b738(0x18f)+(0x0==_0x2b4cd5[_0x38b738(0x1df)]?'':_0x38b738(0x1a3)+_0x2b4cd5+',')+_0x38b738(0x1c1)+_0x116a0c[_0x38b738(0x172)]+_0x38b738(0x1e1))+_0x38b738(0x1d0)+(''+_0xc45297+(_0x116a0c[_0x38b738(0x172)]?'?':'')+':\x20'+_0x2c2253)+'\x0a';}[a0_0x4d2c7a(0x17e)](_0x53bc5b){const _0x4a287f=a0_0x4d2c7a;let _0x4a2f67='';return _0x4a287f(0x189)==_0x53bc5b[_0x4a287f(0x1fa)]&&(_0x4a2f67='Float'),_0x4a287f(0x19f)==_0x53bc5b[_0x4a287f(0x1fa)]&&(_0x4a2f67='Float'),_0x4a287f(0x178)==_0x53bc5b[_0x4a287f(0x1fa)]&&(_0x4a2f67=_0x4a287f(0x175)),_0x4a287f(0x191)==_0x53bc5b[_0x4a287f(0x1fa)]&&(_0x4a2f67=_0x4a287f(0x175)),_0x4a2f67;}[a0_0x4d2c7a(0x1d3)](_0x34814f){const _0x36068f=a0_0x4d2c7a;let _0x6dd2d8=_0x34814f['colType'];return'decimal'==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8=_0x36068f(0x1de)),'double'==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8=_0x36068f(0x1de)),_0x36068f(0x19f)==_0x34814f['colType']&&(_0x6dd2d8=_0x36068f(0x1de)),_0x36068f(0x191)==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8=_0x36068f(0x1de)),_0x36068f(0x178)==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8='number'),'datetime'==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8=_0x36068f(0x17d)),_0x36068f(0x19a)==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8=_0x36068f(0x17d)),_0x36068f(0x177)==_0x34814f[_0x36068f(0x1fa)]&&(_0x6dd2d8=_0x36068f(0x1b3)),_0x6dd2d8;}async[a0_0x4d2c7a(0x18d)](_0x3ee2f7,_0x551920,_0x34998a){const _0x455c2d=a0_0x4d2c7a;await fs[_0x455c2d(0x1ee)](_0x3ee2f7,this[_0x455c2d(0x1ce)](_0x551920,_0x34998a),'utf8');}['replaceNamesMap'](_0x3303df,_0x277256){const _0x29a3d8=a0_0x4d2c7a;return _0x3303df[_0x29a3d8(0x1f8)](/{{pascalCase name}}/g,_0x277256[_0x29a3d8(0x1bd)])[_0x29a3d8(0x1f8)](/{{camelCase name}}/g,_0x277256[_0x29a3d8(0x1f4)])[_0x29a3d8(0x1f8)](/{{snakeCase name}}/g,_0x277256[_0x29a3d8(0x1d4)])['replace'](/{{pluralPascalCase name}}/g,_0x277256[_0x29a3d8(0x174)])['replace'](/{{pluralCamelCase name}}/g,_0x277256[_0x29a3d8(0x1c9)])['replace'](/{{tableName}}/g,_0x277256[_0x29a3d8(0x1a2)])[_0x29a3d8(0x1f8)](/{{name}}/g,_0x277256[_0x29a3d8(0x1e4)]);}async['createServicePath'](_0x4bb4bb,_0x218f66,_0x393781){const _0x1bfd85=a0_0x4d2c7a;let _0x3e957b=_0x4bb4bb+_0x1bfd85(0x1ac);await this['createDir'](_0x3e957b),_0x3e957b=_0x3e957b+'/'+_0x218f66,await this[_0x1bfd85(0x19d)](_0x3e957b),_0x3e957b+='/server',await this[_0x1bfd85(0x19d)](_0x3e957b),_0x3e957b+=_0x1bfd85(0x196),await this['createDir'](_0x3e957b),_0x3e957b=_0x3e957b+'/'+_0x393781,await this[_0x1bfd85(0x19d)](_0x3e957b);}['getProjectRootPath'](){const _0x35ebdd=a0_0x4d2c7a;let _0x25df74=process[_0x35ebdd(0x1ff)][_0x35ebdd(0x1e2)][_0x35ebdd(0x1f1)]('/'),_0x52e076=[];for(let _0x222d21=0x0;_0x222d21<_0x25df74[_0x35ebdd(0x1df)]&&_0x35ebdd(0x1e3)!=_0x25df74[_0x222d21];_0x222d21++)_0x52e076['push'](_0x25df74[_0x222d21]);return _0x52e076[_0x35ebdd(0x1a5)]('/');}async[a0_0x4d2c7a(0x19d)](_0x4a2efc){const _0x2fe7ee=a0_0x4d2c7a;0x0==await this[_0x2fe7ee(0x1d6)](_0x4a2efc)&&fs[_0x2fe7ee(0x1a9)](_0x4a2efc);}async[a0_0x4d2c7a(0x1d6)](_0xeb56a3){const _0x12fddc=a0_0x4d2c7a;return await fs[_0x12fddc(0x1b4)](_0xeb56a3);}};tslib_1[a0_0x4d2c7a(0x1bc)]([(0x0,type_graphql_1[a0_0x4d2c7a(0x1c3)])(_0x33bba7=>Boolean,{'description':a0_0x4d2c7a(0x1d5)}),tslib_1[a0_0x4d2c7a(0x190)](0x0,(0x0,type_graphql_1[a0_0x4d2c7a(0x194)])('id')),tslib_1[a0_0x4d2c7a(0x190)](0x1,(0x0,type_graphql_1[a0_0x4d2c7a(0x1a7)])()),tslib_1[a0_0x4d2c7a(0x1f6)]('design:type',Function),tslib_1['__metadata'](a0_0x4d2c7a(0x1fc),[String,Object]),tslib_1[a0_0x4d2c7a(0x1f6)](a0_0x4d2c7a(0x1a6),Promise)],OperatoToolCreateService[a0_0x4d2c7a(0x1be)],'toolCreateService',null),OperatoToolCreateService=tslib_1['__decorate']([(0x0,type_graphql_1[a0_0x4d2c7a(0x1af)])()],OperatoToolCreateService),exports[a0_0x4d2c7a(0x1b9)]=OperatoToolCreateService;const allIndex=a0_0x4d2c7a(0x187),serviceIndex=a0_0x4d2c7a(0x1aa),serviceHistoryIndex=a0_0x4d2c7a(0x1ef),serviceQuery=a0_0x4d2c7a(0x1ed),serviceHistoryQuery='\x0aimport\x20{\x20Resolver,\x20Query,\x20FieldResolver,\x20Root,\x20Args,\x20Arg,\x20Ctx,\x20Directive\x20}\x20from\x20\x27type-graphql\x27\x0aimport\x20{\x20Domain,\x20ListParam,\x20convertListParams,\x20getRepository,\x20getQueryBuilderFromListParams\x20}\x20from\x20\x27@things-factory/shell\x27\x0aimport\x20{\x20User\x20}\x20from\x20\x27@things-factory/auth-base\x27\x0aimport\x20{\x20{{pascalCase\x20name}}History\x20}\x20from\x20\x27./{{name}}-history\x27\x0aimport\x20{\x20{{pascalCase\x20name}}HistoryList\x20}\x20from\x20\x27./{{name}}-history-type\x27\x0a\x0a@Resolver({{pascalCase\x20name}}History)\x0aexport\x20class\x20{{pascalCase\x20name}}HistoryQuery\x20{\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}History,\x20{\x20description:\x20\x27To\x20fetch\x20a\x20{{pascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}History(@Arg(\x27id\x27)\x20id:\x20string,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}History>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x20\x20\x20\x20return\x20await\x20getRepository({{pascalCase\x20name}}History).findOne({\x0a\x20\x20\x20\x20\x20\x20where:\x20{\x20domain:\x20{\x20id:\x20domain.id\x20},\x20id\x20}\x0a\x20\x20\x20\x20})\x0a\x20\x20}\x0a\x0a\x20\x20@Query(returns\x20=>\x20{{pascalCase\x20name}}HistoryList,\x20{\x20description:\x20\x27To\x20fetch\x20multiple\x20{{pluralPascalCase\x20name}}History\x27\x20})\x0a\x20\x20async\x20{{camelCase\x20name}}Histories(@Args()\x20params:\x20ListParam,\x20@Ctx()\x20context:\x20any):\x20Promise<{{pascalCase\x20name}}HistoryList>\x20{\x0a\x20\x20\x20\x20const\x20{\x20domain\x20}\x20=\x20context.state\x0a\x0a\x20\x20\x20\x20const\x20queryBuilder\x20=\x20getQueryBuilderFromListParams({\x0a\x20\x20\x20\x20\x20\x20domain,\x0a\x20\x20\x20\x20\x20\x20params,\x0a\x20\x20\x20\x20\x20\x20repository:\x20await\x20getRepository({{pascalCase\x20name}}History)\x0a\x20\x20\x20\x20})\x0a\x0a\x20\x20\x20\x20const\x20[items,\x20total]\x20=\x20await\x20queryBuilder.getManyAndCount()\x0a\x0a\x20\x20\x20\x20return\x20{\x20items,\x20total\x20}\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20Domain)\x0a\x20\x20async\x20domain(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<Domain>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(Domain).findOneBy({id:{{camelCase\x20name}}History.domainId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20updater(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.updaterId})\x0a\x20\x20}\x0a\x0a\x20\x20@FieldResolver(type\x20=>\x20User)\x0a\x20\x20async\x20creator(@Root()\x20{{camelCase\x20name}}History:\x20{{pascalCase\x20name}}History):\x20Promise<User>\x20{\x0a\x20\x20\x20\x20return\x20await\x20getRepository(User).findOneBy({id:{{camelCase\x20name}}History.creatorId})\x0a\x20\x20}\x0a}\x0a',serviceMutation=a0_0x4d2c7a(0x17f),sereviceType=a0_0x4d2c7a(0x1f5),sereviceHistoryType=a0_0x4d2c7a(0x1cd),serviceEntity=a0_0x4d2c7a(0x184),serviceEntityHistCopy=a0_0x4d2c7a(0x1ae),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_0x4d2c7a(0x171);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a0_0x1c83(){const _0xf35774=['LicenseError','manager','Menu','1116808bkbywO','14132610IugFLK','647791cADObF','@things-factory/shell','id\x20!=\x20:id','getPermission','Permissions\x20For\x20Tailor\x20Tool','map','createQueryBuilder','30yolJmO','Studio','../../errors/license-error','menu','andWhere','(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)','2SGXrxs','INVALID_LICENSE','from','OVER_LIMIT','getRepository','checkStudioPermission','@things-factory/operato-license-checker','60819GnhwDV','4941508XtPhIJ','@things-factory/menu-base','split','forEach','checkTarget','select','4353368cgGGzX','ERROR_CODES','5688975YOkflv','trim','where','9Lwohfk','getCount','__esModule'];a0_0x1c83=function(){return _0xf35774;};return a0_0x1c83();}const a0_0x4b51be=a0_0x25f1;(function(_0x55624d,_0xc04926){const _0x338ff5=a0_0x25f1,_0x5c1773=_0x55624d();while(!![]){try{const _0x1208f1=-parseInt(_0x338ff5(0x1db))/0x1*(-parseInt(_0x338ff5(0x1c0))/0x2)+-parseInt(_0x338ff5(0x1c7))/0x3+parseInt(_0x338ff5(0x1c8))/0x4+-parseInt(_0x338ff5(0x1d0))/0x5+-parseInt(_0x338ff5(0x1ba))/0x6*(-parseInt(_0x338ff5(0x1d9))/0x7)+-parseInt(_0x338ff5(0x1ce))/0x8*(-parseInt(_0x338ff5(0x1d3))/0x9)+-parseInt(_0x338ff5(0x1da))/0xa;if(_0x1208f1===_0xc04926)break;else _0x5c1773['push'](_0x5c1773['shift']());}catch(_0x131860){_0x5c1773['push'](_0x5c1773['shift']());}}}(a0_0x1c83,0x9f9a2));Object['defineProperty'](exports,a0_0x4b51be(0x1d5),{'value':!0x0}),exports['checkStudioTemplateIsOverLimit']=exports[a0_0x4b51be(0x1c5)]=void 0x0;const operato_license_checker_1=require(a0_0x4b51be(0x1c6)),shell_1=require(a0_0x4b51be(0x1dc)),menu_base_1=require(a0_0x4b51be(0x1c9)),license_error_1=require(a0_0x4b51be(0x1bc));async function checkStudioPermission(){const _0x3b80e0=a0_0x4b51be;let _0x2bebbf=((0x0,operato_license_checker_1[_0x3b80e0(0x1b6)])(_0x3b80e0(0x1b7))||',')[_0x3b80e0(0x1ca)](',')[_0x3b80e0(0x1b8)](_0x3b410f=>_0x3b410f[_0x3b80e0(0x1d1)]()),_0x41a58b=!0x1;return _0x2bebbf[_0x3b80e0(0x1cb)](_0x1265d9=>{const _0x1db2c2=_0x3b80e0;_0x1265d9['includes'](_0x1db2c2(0x1bb))&&(_0x41a58b=!0x0);}),_0x41a58b;}async function checkStudioTemplateIsOverLimit(_0x11fec0,_0x5e8aa7){const _0x1ac536=a0_0x4b51be;if(0x0==await checkStudioPermission())throw new license_error_1[(_0x1ac536(0x1d6))]({'errorCode':_0x5e8aa7['t'](license_error_1[_0x1ac536(0x1d6)][_0x1ac536(0x1cf)][_0x1ac536(0x1c1)])});var _0x5b61af=0x0;if(_0x5b61af=_0x11fec0&&''!=_0x11fec0?await(0x0,shell_1[_0x1ac536(0x1c4)])(menu_base_1['Menu'])[_0x1ac536(0x1d7)][_0x1ac536(0x1b9)]()[_0x1ac536(0x1cd)](_0x1ac536(0x1bd))[_0x1ac536(0x1c2)](menu_base_1[_0x1ac536(0x1d8)],_0x1ac536(0x1bd))[_0x1ac536(0x1d2)](_0x1ac536(0x1b5),{'id':_0x11fec0})[_0x1ac536(0x1be)]('(template\x20is\x20not\x20null\x20and\x20template\x20!=\x20\x27\x27\x20)')[_0x1ac536(0x1d4)]()+0x1:await(0x0,shell_1['getRepository'])(menu_base_1['Menu'])[_0x1ac536(0x1d7)][_0x1ac536(0x1b9)]()[_0x1ac536(0x1cd)](_0x1ac536(0x1bd))[_0x1ac536(0x1c2)](menu_base_1[_0x1ac536(0x1d8)],_0x1ac536(0x1bd))['where'](_0x1ac536(0x1bf))[_0x1ac536(0x1d4)]()+0x1,!(0x0,operato_license_checker_1[_0x1ac536(0x1cc)])(_0x5b61af))throw new license_error_1[(_0x1ac536(0x1d6))]({'errorCode':_0x5e8aa7['t'](license_error_1[_0x1ac536(0x1d6)][_0x1ac536(0x1cf)][_0x1ac536(0x1c3)])});return!0x0;}function a0_0x25f1(_0x37a66c,_0x377b2d){const _0x1c8343=a0_0x1c83();return a0_0x25f1=function(_0x25f1ed,_0x1c09e2){_0x25f1ed=_0x25f1ed-0x1b5;let _0x5ebfc4=_0x1c8343[_0x25f1ed];return _0x5ebfc4;},a0_0x25f1(_0x37a66c,_0x377b2d);}exports['checkStudioPermission']=checkStudioPermission,exports['checkStudioTemplateIsOverLimit']=checkStudioTemplateIsOverLimit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0xcc63f0=a0_0x3245;function a0_0x3245(_0x250e05,_0x2e379a){const _0x597203=a0_0x5972();return a0_0x3245=function(_0x324518,_0x428dc9){_0x324518=_0x324518-0xf1;let _0x2c93a8=_0x597203[_0x324518];return _0x2c93a8;},a0_0x3245(_0x250e05,_0x2e379a);}(function(_0x17863c,_0x3c4683){const _0x580a1e=a0_0x3245,_0x34e4a6=_0x17863c();while(!![]){try{const _0x519976=parseInt(_0x580a1e(0x109))/0x1+-parseInt(_0x580a1e(0xf7))/0x2+-parseInt(_0x580a1e(0x102))/0x3*(parseInt(_0x580a1e(0xf1))/0x4)+-parseInt(_0x580a1e(0xf4))/0x5*(parseInt(_0x580a1e(0x108))/0x6)+-parseInt(_0x580a1e(0xfb))/0x7+-parseInt(_0x580a1e(0x106))/0x8+-parseInt(_0x580a1e(0xf8))/0x9*(-parseInt(_0x580a1e(0x10a))/0xa);if(_0x519976===_0x3c4683)break;else _0x34e4a6['push'](_0x34e4a6['shift']());}catch(_0x194ddc){_0x34e4a6['push'](_0x34e4a6['shift']());}}}(a0_0x5972,0x37274));Object[a0_0xcc63f0(0xfe)](exports,a0_0xcc63f0(0xf5),{'value':!0x0}),exports['OperatoToolResolver']=void 0x0;const tslib_1=require(a0_0xcc63f0(0x10e)),type_graphql_1=require(a0_0xcc63f0(0xff)),tool_permission_1=require('./tool-permission');let OperatoToolResolver=class{async[a0_0xcc63f0(0xfa)](_0x1ceada){return(0x0,tool_permission_1['checkStudioPermission'])();}async[a0_0xcc63f0(0xf2)](_0x4ad9f3,_0x5de797){const _0x185990=a0_0xcc63f0;return(0x0,tool_permission_1[_0x185990(0x103)])(_0x4ad9f3,_0x5de797);}};tslib_1[a0_0xcc63f0(0x101)]([(0x0,type_graphql_1[a0_0xcc63f0(0xf3)])(_0x24b7cc=>Boolean,{'description':'Operato\x20Tool\x20Studio\x20Usage\x20Permissions'}),tslib_1[a0_0xcc63f0(0xfd)](0x0,(0x0,type_graphql_1[a0_0xcc63f0(0xfc)])()),tslib_1[a0_0xcc63f0(0x105)](a0_0xcc63f0(0x104),Function),tslib_1['__metadata'](a0_0xcc63f0(0xf9),[Object]),tslib_1[a0_0xcc63f0(0x105)](a0_0xcc63f0(0x100),Promise)],OperatoToolResolver[a0_0xcc63f0(0x107)],a0_0xcc63f0(0xfa),null),tslib_1[a0_0xcc63f0(0x101)]([(0x0,type_graphql_1[a0_0xcc63f0(0xf3)])(_0x5529e6=>Boolean,{'description':a0_0xcc63f0(0x10c)}),tslib_1[a0_0xcc63f0(0xfd)](0x0,(0x0,type_graphql_1[a0_0xcc63f0(0x10b)])('id')),tslib_1['__param'](0x1,(0x0,type_graphql_1[a0_0xcc63f0(0xfc)])()),tslib_1[a0_0xcc63f0(0x105)](a0_0xcc63f0(0x104),Function),tslib_1['__metadata'](a0_0xcc63f0(0xf9),[String,Object]),tslib_1[a0_0xcc63f0(0x105)](a0_0xcc63f0(0x100),Promise)],OperatoToolResolver[a0_0xcc63f0(0x107)],a0_0xcc63f0(0xf2),null),OperatoToolResolver=tslib_1[a0_0xcc63f0(0x101)]([(0x0,type_graphql_1[a0_0xcc63f0(0xf6)])()],OperatoToolResolver),exports[a0_0xcc63f0(0x10d)]=OperatoToolResolver;function a0_0x5972(){const _0x373c5f=['__param','defineProperty','type-graphql','design:returntype','__decorate','1263MprRiV','checkStudioTemplateIsOverLimit','design:type','__metadata','211592nAYZJu','prototype','66lMFwEp','112057nOCwhF','14625140mknJfu','Arg','Operato\x20Tool\x20Studio\x20Limit\x20check','OperatoToolResolver','tslib','2932qkwrGU','studioTemplateIsOverLimit','Query','181765PCqMPb','__esModule','Resolver','352300aZMVtG','9ejjvYU','design:paramtypes','studioPermission','3063116mddKMC','Ctx'];a0_0x5972=function(){return _0x373c5f;};return a0_0x5972();}
|