@anncic-api/typeorm 1.0.28 → 1.1.2
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/dist/configuration.js +1 -1
- package/dist/decorator/InjectEntity.js +1 -1
- package/dist/decorator/InjectRepository.js +1 -1
- package/dist/decorator/ProvideEntity.js +1 -1
- package/dist/decorator/ProvideRepository.js +1 -1
- package/dist/decorator/ProvideSearch.js +1 -1
- package/dist/decorator/VirtualColumn.js +1 -1
- package/dist/definition/Repository.d.ts +4 -4
- package/dist/definition/Repository.js +1 -1
- package/dist/helper/getDataSourceEntity.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interface.d.ts +7 -3
- package/dist/interface.js +1 -1
- package/package.json +3 -3
package/dist/configuration.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a0_0x1843(){const _0x54037e=['__decorate','object','CustomConfiguration','defineProperty','getClassMetadata','Inject','112TOuwpf','find','@midwayjs/decorator','TypeORMDataSourceManager','2164832zIVTkm','__metadata','@midwayjs/core','3805089OFdtAo','1468695ccqIxP','design:type','6373660ZMIXKk','name','REPOSITORY_KEY','251hYbLjV','Configuration','Repository','MidwayDecoratorService','metadata','MidwayConfigService','body','length','getDataSourceNameByModel','handlercache','6663382JiWRiB','数据不存在','TypeORMError','push','config','typeorm','function','anncic-api:typeorm','7504xsjsCH','6GxbTQg','9sIIVzj','registerPropertyHandler','__esModule','warn','getDataSource','middlewareError','getEnv','decorator','production','prototype','288432jvlLPU','useMiddleware','target','\x20is\x20not\x20ProvideRepository\x20Entify'];a0_0x1843=function(){return _0x54037e;};return a0_0x1843();}const a0_0x4b5bc0=a0_0x20ed;(function(_0x50bea4,_0x294073){const _0x4e69b9=a0_0x20ed,_0x58b4b4=_0x50bea4();while(!![]){try{const _0xc77652=-parseInt(_0x4e69b9(0x21a))/0x1*(-parseInt(_0x4e69b9(0x1f7))/0x2)+-parseInt(_0x4e69b9(0x214))/0x3+-parseInt(_0x4e69b9(0x211))/0x4+parseInt(_0x4e69b9(0x215))/0x5*(-parseInt(_0x4e69b9(0x1f8))/0x6)+parseInt(_0x4e69b9(0x20d))/0x7*(parseInt(_0x4e69b9(0x203))/0x8)+-parseInt(_0x4e69b9(0x1f9))/0x9*(-parseInt(_0x4e69b9(0x217))/0xa)+parseInt(_0x4e69b9(0x1ef))/0xb;if(_0xc77652===_0x294073)break;else _0x58b4b4['push'](_0x58b4b4['shift']());}catch(_0x5552cd){_0x58b4b4['push'](_0x58b4b4['shift']());}}}(a0_0x1843,0xa0c02));var __decorate=this&&this[a0_0x4b5bc0(0x207)]||function(_0x188d20,_0x2966bf,_0x56e174,_0x1bc6b6){const _0x18055a=a0_0x4b5bc0;var _0x16fb5f=arguments['length'],_0x357f84=_0x16fb5f<0x3?_0x2966bf:_0x1bc6b6===null?_0x1bc6b6=Object['getOwnPropertyDescriptor'](_0x2966bf,_0x56e174):_0x1bc6b6,_0x2a9f84;if(typeof Reflect===_0x18055a(0x208)&&typeof Reflect['decorate']===_0x18055a(0x1f5))_0x357f84=Reflect['decorate'](_0x188d20,_0x2966bf,_0x56e174,_0x1bc6b6);else{for(var _0x55ece3=_0x188d20[_0x18055a(0x1ec)]-0x1;_0x55ece3>=0x0;_0x55ece3--)if(_0x2a9f84=_0x188d20[_0x55ece3])_0x357f84=(_0x16fb5f<0x3?_0x2a9f84(_0x357f84):_0x16fb5f>0x3?_0x2a9f84(_0x2966bf,_0x56e174,_0x357f84):_0x2a9f84(_0x2966bf,_0x56e174))||_0x357f84;}return _0x16fb5f>0x3&&_0x357f84&&Object[_0x18055a(0x20a)](_0x2966bf,_0x56e174,_0x357f84),_0x357f84;},__metadata=this&&this[a0_0x4b5bc0(0x212)]||function(_0x4ff3d8,_0xc7334f){const _0x3e0027=a0_0x4b5bc0;if(typeof Reflect===_0x3e0027(0x208)&&typeof Reflect[_0x3e0027(0x1e9)]==='function')return Reflect[_0x3e0027(0x1e9)](_0x4ff3d8,_0xc7334f);};Object[a0_0x4b5bc0(0x20a)](exports,a0_0x4b5bc0(0x1fb),{'value':!![]}),exports[a0_0x4b5bc0(0x209)]=void 0x0;const typeorm_1=require('@midwayjs/typeorm'),decorator_1=require(a0_0x4b5bc0(0x20f)),core_1=require(a0_0x4b5bc0(0x213)),typeorm_2=require(a0_0x4b5bc0(0x1f4)),Repository_1=require('./definition/Repository'),interface_1=require('./interface'),typeorm=require('@midwayjs/typeorm');let CustomConfiguration=class CustomConfiguration{constructor(){const _0x522de6=a0_0x4b5bc0;this[_0x522de6(0x1ee)]=[];}async['onReady'](_0x2ef944,_0x5529f4){const _0xe4ebd1=a0_0x4b5bc0,_0x2fa045=await _0x2ef944['getAsync'](typeorm_1[_0xe4ebd1(0x210)]);this[_0xe4ebd1(0x200)][_0xe4ebd1(0x1fa)](interface_1['ENTIFY_KEY'],(_0x42ed5e,{entity:_0x4cd604,connection:_0x5bcf2c})=>{const _0x3767f6=_0xe4ebd1;let _0x5dcd69=this[_0x3767f6(0x1ee)][_0x3767f6(0x20e)](_0x5420eb=>_0x5420eb[_0x3767f6(0x205)]==_0x4cd604);return!_0x5dcd69&&(_0x5dcd69=new Repository_1['Repository'](_0x5529f4,_0x2fa045[_0x3767f6(0x1fd)](_0x5bcf2c||_0x2fa045[_0x3767f6(0x1ed)](_0x4cd604))['getRepository'](_0x4cd604)),this[_0x3767f6(0x1ee)][_0x3767f6(0x1f2)](_0x5dcd69)),_0x5dcd69;}),this['decorator']['registerPropertyHandler'](interface_1[_0xe4ebd1(0x219)],(_0x2160b3,{repository:_0x69e92c,connection:_0x562675})=>{const _0x689a79=_0xe4ebd1,{entity:_0x58676f}=(0x0,decorator_1[_0x689a79(0x20b)])(interface_1[_0x689a79(0x219)],_0x69e92c)||{};if(!_0x58676f)throw new Error('anncic-api-typeorm\x20Error\x20'+((_0x69e92c===null||_0x69e92c===void 0x0?void 0x0:_0x69e92c[_0x689a79(0x218)])||_0x69e92c)+_0x689a79(0x206));let _0x59f6c4=this[_0x689a79(0x1ee)][_0x689a79(0x20e)](_0x8fe6c4=>_0x8fe6c4[_0x689a79(0x205)]==_0x58676f);return!_0x59f6c4&&(_0x59f6c4=new Repository_1[(_0x689a79(0x1e7))](_0x5529f4,_0x2fa045['getDataSource'](_0x562675||_0x2fa045[_0x689a79(0x1ed)](_0x58676f))['getRepository'](_0x58676f)),this[_0x689a79(0x1ee)]['push'](_0x59f6c4)),_0x59f6c4;}),_0x5529f4[_0xe4ebd1(0x204)](this['middlewareError'](_0x5529f4));}[a0_0x4b5bc0(0x1fe)](_0x523ca8){return async(_0x57da51,_0x431ca0)=>{const _0x5ab47a=a0_0x20ed;try{await _0x431ca0();}catch(_0x40c61d){if(_0x40c61d instanceof typeorm_2[_0x5ab47a(0x1f1)])_0x40c61d instanceof typeorm_2['EntityNotFoundError']?_0x57da51[_0x5ab47a(0x1eb)]={'code':0x194,'msg':_0x5ab47a(0x1f0)}:(_0x57da51[_0x5ab47a(0x1eb)]={'code':0x1f4,'msg':_0x40c61d['message']},_0x523ca8[_0x5ab47a(0x1ff)]()!=_0x5ab47a(0x201)&&console[_0x5ab47a(0x1fc)](_0x40c61d));else throw _0x40c61d;}};}};function a0_0x20ed(_0x4bf09d,_0x4287bf){const _0x184326=a0_0x1843();return a0_0x20ed=function(_0x20edd8,_0x24ccb3){_0x20edd8=_0x20edd8-0x1e7;let _0x33f8b3=_0x184326[_0x20edd8];return _0x33f8b3;},a0_0x20ed(_0x4bf09d,_0x4287bf);}__decorate([(0x0,decorator_1['Inject'])(),__metadata(a0_0x4b5bc0(0x216),core_1[a0_0x4b5bc0(0x1ea)])],CustomConfiguration[a0_0x4b5bc0(0x202)],a0_0x4b5bc0(0x1f3),void 0x0),__decorate([(0x0,decorator_1[a0_0x4b5bc0(0x20c)])(),__metadata('design:type',core_1[a0_0x4b5bc0(0x1e8)])],CustomConfiguration['prototype'],'decorator',void 0x0),CustomConfiguration=__decorate([(0x0,decorator_1[a0_0x4b5bc0(0x21b)])({'imports':[typeorm],'conflictCheck':![],'namespace':a0_0x4b5bc0(0x1f6)})],CustomConfiguration),exports[a0_0x4b5bc0(0x209)]=CustomConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a1_0x57ec(_0x169b69,_0x1ca504){const _0x3bc355=a1_0x3bc3();return a1_0x57ec=function(_0x57ec4d,_0x426713){_0x57ec4d=_0x57ec4d-0x1a1;let _0x2829d1=_0x3bc355[_0x57ec4d];return _0x2829d1;},a1_0x57ec(_0x169b69,_0x1ca504);}const a1_0x3de94c=a1_0x57ec;(function(_0xca140b,_0x1d75d8){const _0x33f715=a1_0x57ec,_0x41f11d=_0xca140b();while(!![]){try{const _0x261185=-parseInt(_0x33f715(0x1a2))/0x1+parseInt(_0x33f715(0x1a7))/0x2+-parseInt(_0x33f715(0x1a1))/0x3+-parseInt(_0x33f715(0x1ae))/0x4+parseInt(_0x33f715(0x1a9))/0x5*(parseInt(_0x33f715(0x1aa))/0x6)+-parseInt(_0x33f715(0x1a8))/0x7*(parseInt(_0x33f715(0x1a3))/0x8)+parseInt(_0x33f715(0x1af))/0x9*(parseInt(_0x33f715(0x1ac))/0xa);if(_0x261185===_0x1d75d8)break;else _0x41f11d['push'](_0x41f11d['shift']());}catch(_0x3bd896){_0x41f11d['push'](_0x41f11d['shift']());}}}(a1_0x3bc3,0x2cd10));Object[a1_0x3de94c(0x1ab)](exports,'__esModule',{'value':!![]}),exports[a1_0x3de94c(0x1a6)]=void 0x0;const decorator_1=require('@midwayjs/decorator'),interface_1=require('../interface');function InjectEntity(_0x5dab73,_0x3df28a=a1_0x3de94c(0x1a4)){const _0x14388d=a1_0x3de94c;return(0x0,decorator_1[_0x14388d(0x1a5)])(interface_1[_0x14388d(0x1ad)],{'entity':_0x5dab73,'connection':_0x3df28a});}function a1_0x3bc3(){const _0x368442=['36804iKRazw','45UuUEkS','706341ETsvrK','264438BYCXYs','8QovwEK','default','createCustomPropertyDecorator','InjectEntity','640594WxxcLt','1396129QsGLfV','30NwcwnZ','172974iWLuVk','defineProperty','797660ZIjBzz','ENTIFY_KEY'];a1_0x3bc3=function(){return _0x368442;};return a1_0x3bc3();}exports[a1_0x3de94c(0x1a6)]=InjectEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a2_0x15c219=a2_0x3103;(function(_0x4ee5a6,_0x440f3a){const _0x2d9215=a2_0x3103,_0x36e06b=_0x4ee5a6();while(!![]){try{const _0x132ad7=parseInt(_0x2d9215(0x1aa))/0x1*(parseInt(_0x2d9215(0x1a1))/0x2)+parseInt(_0x2d9215(0x1b1))/0x3*(parseInt(_0x2d9215(0x1a5))/0x4)+parseInt(_0x2d9215(0x1a3))/0x5+-parseInt(_0x2d9215(0x1a6))/0x6*(parseInt(_0x2d9215(0x1ae))/0x7)+parseInt(_0x2d9215(0x1ab))/0x8*(parseInt(_0x2d9215(0x1af))/0x9)+parseInt(_0x2d9215(0x1ac))/0xa+-parseInt(_0x2d9215(0x1ad))/0xb*(parseInt(_0x2d9215(0x1a4))/0xc);if(_0x132ad7===_0x440f3a)break;else _0x36e06b['push'](_0x36e06b['shift']());}catch(_0x29ca3a){_0x36e06b['push'](_0x36e06b['shift']());}}}(a2_0x3291,0xc09b1));function a2_0x3291(){const _0x2d5815=['default','../interface','@midwayjs/decorator','2283YEODIc','350728oVSOAD','15054080fHdteL','1795178QhQGma','2156105kvVmoy','9FTouUE','createCustomPropertyDecorator','1808529duxKMO','172ixBaIy','InjectRepository','1086400bCEihN','108xjbFHU','4uDwMUe','6uzFuOB'];a2_0x3291=function(){return _0x2d5815;};return a2_0x3291();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['InjectRepository']=void 0x0;const decorator_1=require(a2_0x15c219(0x1a9)),interface_1=require(a2_0x15c219(0x1a8));function a2_0x3103(_0x1983f0,_0xc251aa){const _0x329106=a2_0x3291();return a2_0x3103=function(_0x310387,_0x40abff){_0x310387=_0x310387-0x1a1;let _0x382896=_0x329106[_0x310387];return _0x382896;},a2_0x3103(_0x1983f0,_0xc251aa);}function InjectRepository(_0x2cb3b9,_0x1893a1=a2_0x15c219(0x1a7)){const _0x144ef4=a2_0x15c219;return(0x0,decorator_1[_0x144ef4(0x1b0)])(interface_1['REPOSITORY_KEY'],{'repository':_0x2cb3b9,'connection':_0x1893a1});}exports[a2_0x15c219(0x1a2)]=InjectRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a3_0x22e0(_0x438a2e,_0x82cb8d){const _0x236b94=a3_0x236b();return a3_0x22e0=function(_0x22e0c5,_0x2fe529){_0x22e0c5=_0x22e0c5-0x189;let _0x5aef5d=_0x236b94[_0x22e0c5];return _0x5aef5d;},a3_0x22e0(_0x438a2e,_0x82cb8d);}const a3_0x897a2d=a3_0x22e0;(function(_0xe0e400,_0x369762){const _0x4c78d6=a3_0x22e0,_0x50890f=_0xe0e400();while(!![]){try{const _0x2b6231=parseInt(_0x4c78d6(0x18e))/0x1+parseInt(_0x4c78d6(0x18a))/0x2*(parseInt(_0x4c78d6(0x18d))/0x3)+-parseInt(_0x4c78d6(0x198))/0x4*(parseInt(_0x4c78d6(0x18b))/0x5)+parseInt(_0x4c78d6(0x18f))/0x6*(parseInt(_0x4c78d6(0x18c))/0x7)+parseInt(_0x4c78d6(0x191))/0x8*(parseInt(_0x4c78d6(0x19e))/0x9)+-parseInt(_0x4c78d6(0x19f))/0xa+parseInt(_0x4c78d6(0x19a))/0xb;if(_0x2b6231===_0x369762)break;else _0x50890f['push'](_0x50890f['shift']());}catch(_0x25b4e9){_0x50890f['push'](_0x50890f['shift']());}}}(a3_0x236b,0xd0a9c));Object[a3_0x897a2d(0x19c)](exports,a3_0x897a2d(0x199),{'value':!![]}),exports['ProvideEntity']=void 0x0;const typeorm_1=require(a3_0x897a2d(0x194)),decorator_1=require(a3_0x897a2d(0x196)),interface_1=require(a3_0x897a2d(0x190));function ProvideEntity(_0x449080,_0xcb3497={}){return _0x252e82=>{const _0x39a53e=a3_0x22e0;_0xcb3497[_0x39a53e(0x1a0)]=_0x449080['tableName'];const _0xc64430=[];if(!(_0x449080===null||_0x449080===void 0x0?void 0x0:_0x449080[_0x39a53e(0x19b)]))_0xc64430[_0x39a53e(0x197)](_0x39a53e(0x19d));else{if(typeof(_0x449080===null||_0x449080===void 0x0?void 0x0:_0x449080[_0x39a53e(0x19b)])==_0x39a53e(0x189))_0xc64430[_0x39a53e(0x197)](_0x449080===null||_0x449080===void 0x0?void 0x0:_0x449080[_0x39a53e(0x19b)]);else{if(Array[_0x39a53e(0x192)](_0x449080===null||_0x449080===void 0x0?void 0x0:_0x449080[_0x39a53e(0x19b)]))for(let _0x549897 of _0x449080[_0x39a53e(0x19b)]||[_0x39a53e(0x19d)]){_0xc64430[_0x39a53e(0x197)](_0x549897);}}}(0x0,decorator_1['saveModule'])(interface_1['ENTIFY_MODULE'],_0x252e82),(0x0,decorator_1[_0x39a53e(0x195)])(interface_1['ENTIFY_MODULE_SOURCE'],{'tableName':_0x449080[_0x39a53e(0x193)],'dataSource':_0xc64430},_0x252e82),(0x0,typeorm_1['Entity'])(_0x449080['tableName'],_0xcb3497)(_0x252e82);};}function a3_0x236b(){const _0x34128e=['typeorm','saveClassMetadata','@midwayjs/decorator','push','28KlVeXY','__esModule','4129906yvXhZl','dataSource','defineProperty','default','45yVXJIv','7647200BhMuzQ','name','string','1064510Rxfvay','253070hYcgWQ','119VRwVJf','3ZTHyxO','131335ryFigs','110418hmmjoG','../interface','994904FPEgsk','isArray','tableName'];a3_0x236b=function(){return _0x34128e;};return a3_0x236b();}exports['ProvideEntity']=ProvideEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a4_0x420027=a4_0x3e1a;(function(_0x221e7e,_0x2dbcf8){const _0x286a88=a4_0x3e1a,_0x4289a4=_0x221e7e();while(!![]){try{const _0x42bbdb=-parseInt(_0x286a88(0xb5))/0x1*(-parseInt(_0x286a88(0xc1))/0x2)+parseInt(_0x286a88(0xc2))/0x3+-parseInt(_0x286a88(0xc0))/0x4*(-parseInt(_0x286a88(0xb4))/0x5)+-parseInt(_0x286a88(0xb3))/0x6*(-parseInt(_0x286a88(0xb1))/0x7)+parseInt(_0x286a88(0xba))/0x8*(-parseInt(_0x286a88(0xb7))/0x9)+parseInt(_0x286a88(0xb8))/0xa+-parseInt(_0x286a88(0xb2))/0xb;if(_0x42bbdb===_0x2dbcf8)break;else _0x4289a4['push'](_0x4289a4['shift']());}catch(_0xa6bc08){_0x4289a4['push'](_0x4289a4['shift']());}}}(a4_0x4c7b,0xcbaa7));function a4_0x3e1a(_0x41933d,_0x409408){const _0x4c7b90=a4_0x4c7b();return a4_0x3e1a=function(_0x3e1ac1,_0x18228e){_0x3e1ac1=_0x3e1ac1-0xb1;let _0x431d97=_0x4c7b90[_0x3e1ac1];return _0x431d97;},a4_0x3e1a(_0x41933d,_0x409408);}Object[a4_0x420027(0xbe)](exports,a4_0x420027(0xbc),{'value':!![]}),exports['ProvideRepository']=void 0x0;const decorator_1=require('@midwayjs/decorator'),interface_1=require(a4_0x420027(0xbf));function ProvideRepository(_0x431fcf){return _0x4f7eb9=>{const _0x2516e1=a4_0x3e1a;(0x0,decorator_1[_0x2516e1(0xbd)])(decorator_1['ScopeEnum']['Request'],{'allowDowngrade':!![]})(_0x4f7eb9),((0x0,decorator_1[_0x2516e1(0xbb)])()(_0x4f7eb9),(0x0,decorator_1[_0x2516e1(0xb6)])(interface_1['REPOSITORY_KEY'],{'entity':_0x431fcf},_0x4f7eb9));};}function a4_0x4c7b(){const _0x103eae=['defineProperty','../interface','40172IJmJBb','36oDlaNh','1825683uobGjp','2467843womhce','24965435wrLsTt','12pTCQSa','380LrIobG','34251IBaotZ','saveClassMetadata','7258257TvzagM','12168280HnRBVL','ProvideRepository','8ZzukNv','Provide','__esModule','Scope'];a4_0x4c7b=function(){return _0x103eae;};return a4_0x4c7b();}exports[a4_0x420027(0xb9)]=ProvideRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a5_0x161074=a5_0x4aaa;(function(_0x11ff9e,_0x100e96){const _0x58e45d=a5_0x4aaa,_0x1e5bbb=_0x11ff9e();while(!![]){try{const _0xe2615c=-parseInt(_0x58e45d(0x1c6))/0x1*(-parseInt(_0x58e45d(0x1c3))/0x2)+parseInt(_0x58e45d(0x1c7))/0x3*(parseInt(_0x58e45d(0x1bc))/0x4)+-parseInt(_0x58e45d(0x1ca))/0x5*(-parseInt(_0x58e45d(0x1b9))/0x6)+parseInt(_0x58e45d(0x1b5))/0x7+-parseInt(_0x58e45d(0x1bf))/0x8*(parseInt(_0x58e45d(0x1bb))/0x9)+parseInt(_0x58e45d(0x1b6))/0xa+-parseInt(_0x58e45d(0x1c0))/0xb;if(_0xe2615c===_0x100e96)break;else _0x1e5bbb['push'](_0x1e5bbb['shift']());}catch(_0x3162aa){_0x1e5bbb['push'](_0x1e5bbb['shift']());}}}(a5_0x256b,0xaf85d));function a5_0x4aaa(_0x55c534,_0x5858a1){const _0x256b5c=a5_0x256b();return a5_0x4aaa=function(_0x4aaa74,_0x156e9c){_0x4aaa74=_0x4aaa74-0x1b5;let _0x1448b4=_0x256b5c[_0x4aaa74];return _0x1448b4;},a5_0x4aaa(_0x55c534,_0x5858a1);}Object[a5_0x161074(0x1bd)](exports,a5_0x161074(0x1c1),{'value':!![]}),exports[a5_0x161074(0x1c9)]=exports['ProvideSearch']=void 0x0;const decorator_1=require(a5_0x161074(0x1ba)),interface_1=require(a5_0x161074(0x1c4));function ProvideSearch(_0x1b87e1){return _0x125dd5=>{const _0x5bc58c=a5_0x4aaa;(0x0,decorator_1['saveModule'])(interface_1[_0x5bc58c(0x1c5)],_0x125dd5),(0x0,decorator_1[_0x5bc58c(0x1c2)])(decorator_1[_0x5bc58c(0x1c8)][_0x5bc58c(0x1be)])(_0x125dd5),(0x0,decorator_1[_0x5bc58c(0x1b7)])(interface_1[_0x5bc58c(0x1c5)],_0x1b87e1,_0x125dd5);};}exports[a5_0x161074(0x1cb)]=ProvideSearch;function Search(_0x348cd9,_0x2a7413){return(_0x89e2a0,_0x6035bc,_0x3419a2)=>{const _0x3817dc=a5_0x4aaa;(0x0,decorator_1[_0x3817dc(0x1b7)])(interface_1[_0x3817dc(0x1b8)],{'field':_0x348cd9,'comment':_0x2a7413,'target':_0x89e2a0,'methodName':_0x6035bc,'descriptor':_0x3419a2},_0x89e2a0);};}exports[a5_0x161074(0x1c9)]=Search;function a5_0x256b(){const _0x574fed=['2123245ttoAdf','ProvideSearch','10060904XWyqZE','4054960mbIDkx','attachClassMetadata','MODEL_SEARCH_KEY','18WkLYWe','@midwayjs/decorator','177426wlfeBV','222128dhwuqe','defineProperty','Singleton','536UGhviW','13310935WBmOtE','__esModule','Scope','44170nlGZAO','../interface','MODEL_KEY','1bQwFgP','6RjyPKL','ScopeEnum','Search'];a5_0x256b=function(){return _0x574fed;};return a5_0x256b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6_0xd18dfb=a6_0x3d03;(function(_0x3a62ba,_0x2bce72){const _0x4335f4=a6_0x3d03,_0x3139fe=_0x3a62ba();while(!![]){try{const _0x3da0b7=-parseInt(_0x4335f4(0x85))/0x1*(-parseInt(_0x4335f4(0x8a))/0x2)+-parseInt(_0x4335f4(0x82))/0x3*(-parseInt(_0x4335f4(0x96))/0x4)+parseInt(_0x4335f4(0x92))/0x5+-parseInt(_0x4335f4(0x8f))/0x6+-parseInt(_0x4335f4(0x7f))/0x7+parseInt(_0x4335f4(0x90))/0x8+-parseInt(_0x4335f4(0x91))/0x9;if(_0x3da0b7===_0x2bce72)break;else _0x3139fe['push'](_0x3139fe['shift']());}catch(_0x19cdab){_0x3139fe['push'](_0x3139fe['shift']());}}}(a6_0x2a41,0xd34c1));function a6_0x3d03(_0x1a739d,_0x268032){const _0x2a41a3=a6_0x2a41();return a6_0x3d03=function(_0x3d0353,_0x426354){_0x3d0353=_0x3d0353-0x7d;let _0x4aab09=_0x2a41a3[_0x3d0353];return _0x4aab09;},a6_0x3d03(_0x1a739d,_0x268032);}Object['defineProperty'](exports,a6_0xd18dfb(0x80),{'value':!![]}),exports['VirtualColumn']=void 0x0;const typeorm_1=require('typeorm'),decorator_1=require('@midwayjs/decorator'),interface_1=require(a6_0xd18dfb(0x8b));function a6_0x2a41(){const _0x2c2e2e=['13244600kWNmQx','3354192LPAwJJ','537170TJrlPF','prototype','getMany','lockVersion','1356xutATF','getRawAndEntities','SelectQueryBuilder','getClassMetadata','getEntityValue','optimistic','lockMode','expressionMap','ENTITY_VIRTUAL_COLUMN_KEY','11947796bCmHOg','__esModule','hasOwnProperty','9939iMmfHn','metadata','OptimisticLockVersionMismatchError','13TYhNwh','OptimisticLockCanNotBeUsedError','getCount','default','getOne','137030DQIHPy','../interface','getManyAndCount','getTime','updateDateColumn','4990932hSeMko'];a6_0x2a41=function(){return _0x2c2e2e;};return a6_0x2a41();}function VirtualColumn(_0x315a1b,_0x1c0410){return(_0x1c765f,_0x549170)=>{const _0x2e3adc=a6_0x3d03,_0xca584f=(0x0,decorator_1[_0x2e3adc(0x99)])(interface_1[_0x2e3adc(0x7e)],_0x1c765f)||{};_0xca584f[_0x549170]={'comment':_0x315a1b,..._0x1c0410},(0x0,decorator_1['saveClassMetadata'])(interface_1[_0x2e3adc(0x7e)],_0xca584f,_0x1c765f);};}exports['VirtualColumn']=VirtualColumn,typeorm_1[a6_0xd18dfb(0x98)][a6_0xd18dfb(0x93)][a6_0xd18dfb(0x94)]=async function(){const _0x4a9010=a6_0xd18dfb;if(this[_0x4a9010(0x7d)]['lockMode']===_0x4a9010(0x9b))throw new typeorm_1[(_0x4a9010(0x86))]();const {entities:_0x315fee,raw:_0x3b6731}=await this[_0x4a9010(0x97)]();return _0x315fee['map']((_0x58fb6b,_0x51e900)=>{const _0x359791=_0x4a9010;var _0x5740ad;const _0x4caad1=(0x0,decorator_1[_0x359791(0x99)])(interface_1[_0x359791(0x7e)],_0x58fb6b)||{};for(const _0x141f1e in _0x4caad1){_0x3b6731[_0x51e900]&&_0x3b6731[_0x51e900][_0x359791(0x81)](_0x141f1e)&&(_0x58fb6b[_0x141f1e]=_0x3b6731[_0x51e900][_0x141f1e]||((_0x5740ad=_0x4caad1[_0x141f1e])===null||_0x5740ad===void 0x0?void 0x0:_0x5740ad[_0x359791(0x88)])||'');}return _0x58fb6b;});},typeorm_1[a6_0xd18dfb(0x98)]['prototype'][a6_0xd18dfb(0x8c)]=async function(){const _0x50db49=a6_0xd18dfb;return[await this['getMany'](),await this[_0x50db49(0x87)]()];},typeorm_1[a6_0xd18dfb(0x98)]['prototype'][a6_0xd18dfb(0x89)]=async function(){const _0x4ef3fe=a6_0xd18dfb;var _0x1c30b5;const {entities:_0x3c589b,raw:_0x24afd3}=await this[_0x4ef3fe(0x97)]();if(_0x3c589b[0x0]&&this[_0x4ef3fe(0x7d)][_0x4ef3fe(0x9c)]===_0x4ef3fe(0x9b)&&this[_0x4ef3fe(0x7d)][_0x4ef3fe(0x95)]){const _0x51174a=this[_0x4ef3fe(0x7d)]['mainAlias'][_0x4ef3fe(0x83)];if(this[_0x4ef3fe(0x7d)][_0x4ef3fe(0x95)]instanceof Date){const _0x19aa24=_0x51174a[_0x4ef3fe(0x8e)][_0x4ef3fe(0x9a)](_0x3c589b[0x0]);if(_0x19aa24[_0x4ef3fe(0x8d)]()!==this[_0x4ef3fe(0x7d)][_0x4ef3fe(0x95)][_0x4ef3fe(0x8d)]())throw new typeorm_1[(_0x4ef3fe(0x84))](_0x51174a['name'],this[_0x4ef3fe(0x7d)]['lockVersion'],_0x19aa24);}else{const _0x15d38d=_0x51174a['versionColumn']['getEntityValue'](_0x3c589b[0x0]);if(_0x15d38d!==this[_0x4ef3fe(0x7d)][_0x4ef3fe(0x95)])throw new typeorm_1[(_0x4ef3fe(0x84))](_0x51174a['name'],this[_0x4ef3fe(0x7d)][_0x4ef3fe(0x95)],_0x15d38d);}}if(_0x3c589b[0x0]&&_0x24afd3[0x0]){const _0x4c34ce=(0x0,decorator_1['getClassMetadata'])(interface_1[_0x4ef3fe(0x7e)],_0x3c589b[0x0]);for(const _0x251821 in _0x4c34ce){_0x24afd3[0x0]['hasOwnProperty'](_0x251821)&&(_0x3c589b[0x0][_0x251821]=_0x24afd3[0x0][_0x251821]||((_0x1c30b5=_0x4c34ce[_0x251821])===null||_0x1c30b5===void 0x0?void 0x0:_0x1c30b5[_0x4ef3fe(0x88)])||'');}}return _0x3c589b[0x0]||null;};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMidwayApplication } from '@midwayjs/core';
|
|
2
|
-
import { Repository as BaseRepository, EntityManager, ObjectLiteral, DeepPartial
|
|
3
|
-
import {
|
|
2
|
+
import { Repository as BaseRepository, EntityManager, ObjectLiteral, DeepPartial } from "typeorm";
|
|
3
|
+
import { SearchParams, SearchPaginate, SearchOptions } from "../interface";
|
|
4
4
|
interface modelSearch {
|
|
5
5
|
model: any;
|
|
6
6
|
searchs: any[];
|
|
@@ -9,11 +9,11 @@ declare type IsolationLevel = "READ UNCOMMITTED" | "READ COMMITTED" | "REPEATABL
|
|
|
9
9
|
export declare class Repository<Entity extends ObjectLiteral> extends BaseRepository<Entity> {
|
|
10
10
|
readonly app: IMidwayApplication;
|
|
11
11
|
readonly modelSearchs: modelSearch[];
|
|
12
|
-
|
|
13
|
-
search(params?: SearchOption<Entity>, paginate?: SearchPaginateOption, queryRunner?: QueryRunner): Promise<import("typeorm").SelectQueryBuilder<Entity>>;
|
|
12
|
+
search(params?: SearchParams<Entity>, paginate?: SearchPaginate, options?: SearchOptions): Promise<import("typeorm").SelectQueryBuilder<Entity>>;
|
|
14
13
|
mergeSave(mergeIntoEntity: Entity, ...entityLikes: DeepPartial<Entity>[]): Promise<Entity>;
|
|
15
14
|
createSave(mergeIntoEntity: DeepPartial<Entity>, ...entityLikes: DeepPartial<Entity>[]): Promise<Entity>;
|
|
16
15
|
transaction<T>(runInTransaction: (manager: EntityManager) => Promise<T>): Promise<T>;
|
|
17
16
|
transaction<T>(isolationLevel: IsolationLevel, runInTransaction: (manager: EntityManager) => Promise<T>): Promise<T>;
|
|
17
|
+
constructor(app: IMidwayApplication, repository: BaseRepository<Entity>);
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a7_0x4c08ca=a7_0x1d53;(function(_0x4bc0c5,_0x49f3ef){const _0x4865b6=a7_0x1d53,_0x3cc782=_0x4bc0c5();while(!![]){try{const _0x1117f4=-parseInt(_0x4865b6(0xd8))/0x1+parseInt(_0x4865b6(0xfc))/0x2+parseInt(_0x4865b6(0xf3))/0x3*(parseInt(_0x4865b6(0xf4))/0x4)+-parseInt(_0x4865b6(0x121))/0x5+parseInt(_0x4865b6(0x105))/0x6*(parseInt(_0x4865b6(0xe7))/0x7)+parseInt(_0x4865b6(0xe9))/0x8*(parseInt(_0x4865b6(0xfd))/0x9)+-parseInt(_0x4865b6(0xfb))/0xa*(-parseInt(_0x4865b6(0x115))/0xb);if(_0x1117f4===_0x49f3ef)break;else _0x3cc782['push'](_0x3cc782['shift']());}catch(_0x383e79){_0x3cc782['push'](_0x3cc782['shift']());}}}(a7_0xb97c,0x52863));Object[a7_0x4c08ca(0x107)](exports,a7_0x4c08ca(0x111),{'value':!![]}),exports[a7_0x4c08ca(0x11a)]=void 0x0;function a7_0x1d53(_0x3f0847,_0x195f91){const _0xb97c2c=a7_0xb97c();return a7_0x1d53=function(_0x1d5355,_0x493173){_0x1d5355=_0x1d5355-0xd8;let _0x5acb11=_0xb97c2c[_0x1d5355];return _0x5acb11;},a7_0x1d53(_0x3f0847,_0x195f91);}const decorator_1=require('@midwayjs/decorator'),typeorm_1=require('typeorm'),interface_1=require(a7_0x4c08ca(0x110));class Repository extends typeorm_1[a7_0x4c08ca(0x11a)]{constructor(_0x4ef14e,_0x164acc){const _0x29de02=a7_0x4c08ca;super(_0x164acc['target'],_0x164acc[_0x29de02(0xdd)],_0x164acc[_0x29de02(0xe5)]),this[_0x29de02(0x10a)]=[];for(const _0x4fd3b6 of(0x0,decorator_1[_0x29de02(0x10c)])(interface_1[_0x29de02(0x113)],this[_0x29de02(0xf1)])||[]){const _0x4f1f4a={'model':_0x4fd3b6,'searchs':[]};for(const _0x499530 of(0x0,decorator_1['getClassMetadata'])(interface_1[_0x29de02(0x119)],_0x4fd3b6)||[]){_0x4f1f4a['searchs'][_0x29de02(0xe0)](_0x499530);}this['modelSearchs'][_0x29de02(0xe0)](_0x4f1f4a);}this[_0x29de02(0xf5)]=_0x4ef14e;}async[a7_0x4c08ca(0x10e)](_0xeb1f6f,_0x32d9a0,_0x2da7a5={}){const _0x2ad285=a7_0x4c08ca;var _0x57dc80,_0x438b96,_0x29c46a,_0x79d8bb,_0x34cae8,_0x1c3a00;const _0x82a2c3=this[_0x2ad285(0x117)](undefined,_0x2da7a5===null||_0x2da7a5===void 0x0?void 0x0:_0x2da7a5[_0x2ad285(0xe5)]),_0x1638ae=[];for(const _0x41da67 of this['modelSearchs']){if((_0x41da67===null||_0x41da67===void 0x0?void 0x0:_0x41da67[_0x2ad285(0xe1)])&&((_0x57dc80=_0x41da67===null||_0x41da67===void 0x0?void 0x0:_0x41da67[_0x2ad285(0x114)])===null||_0x57dc80===void 0x0?void 0x0:_0x57dc80[_0x2ad285(0xe8)])>0x0){const _0x3c7e40=await this[_0x2ad285(0xf5)][_0x2ad285(0x118)]()[_0x2ad285(0x112)](_0x41da67[_0x2ad285(0xe1)]);for(const _0x4db249 of _0x41da67[_0x2ad285(0x114)]){(_0x4db249===null||_0x4db249===void 0x0?void 0x0:_0x4db249[_0x2ad285(0x125)])&&(_0x4db249===null||_0x4db249===void 0x0?void 0x0:_0x4db249[_0x2ad285(0x101)])&&typeof _0x3c7e40[_0x4db249['methodName']]==_0x2ad285(0x104)&&(typeof(_0xeb1f6f===null||_0xeb1f6f===void 0x0?void 0x0:_0xeb1f6f[_0x4db249[_0x2ad285(0x125)]])!=_0x2ad285(0xe4)&&!((_0x438b96=_0xeb1f6f===null||_0xeb1f6f===void 0x0?void 0x0:_0xeb1f6f[_0x4db249['field']])===null||_0x438b96===void 0x0?void 0x0:_0x438b96[_0x2ad285(0xfe)](_0x2ad285(0x106)))&&(_0x1638ae[_0x2ad285(0x124)](_0x4db249[_0x2ad285(0x125)])==-0x1&&_0x1638ae[_0x2ad285(0xe0)](_0x4db249[_0x2ad285(0x125)]),await _0x3c7e40[_0x4db249[_0x2ad285(0x101)]][_0x2ad285(0xeb)](_0x3c7e40)(_0x82a2c3,_0xeb1f6f[_0x4db249[_0x2ad285(0x125)]],_0xeb1f6f,_0x32d9a0,_0x2da7a5===null||_0x2da7a5===void 0x0?void 0x0:_0x2da7a5[_0x2ad285(0xe5)])));}}}for(const _0x54da04 in _0xeb1f6f){if(typeof _0xeb1f6f[_0x54da04]!='undefined'&&_0x1638ae[_0x2ad285(0x124)](_0x54da04)==-0x1){const _0x32799c=this[_0x2ad285(0x127)][_0x2ad285(0x102)](_0x54da04);if(_0x32799c){if((_0x29c46a=_0xeb1f6f===null||_0xeb1f6f===void 0x0?void 0x0:_0xeb1f6f[_0x54da04])===null||_0x29c46a===void 0x0?void 0x0:_0x29c46a[_0x2ad285(0xfe)](_0x2ad285(0x106))){const _0x551962=(_0x79d8bb=_0xeb1f6f[_0x54da04])===null||_0x79d8bb===void 0x0?void 0x0:_0x79d8bb[_0x2ad285(0x10f)],_0x3413bd=(_0x34cae8=_0xeb1f6f[_0x54da04])===null||_0x34cae8===void 0x0?void 0x0:_0x34cae8['operator']['trim']()['toUpperCase'](),_0x315843=_0x2ad285(0xd9)+_0x54da04+'_'+Math[_0x2ad285(0xdf)](Math[_0x2ad285(0xdb)]()*0xa)+Math['ceil'](Math['random']()*0xa)+Math['ceil'](Math[_0x2ad285(0xdb)]()*0xa)+Math[_0x2ad285(0xdf)](Math[_0x2ad285(0xdb)]()*0xa);if(['=','!=','<>','>','>=','<','<=','LIKE',_0x2ad285(0xe3)][_0x2ad285(0x124)](_0x3413bd)!=-0x1)typeof _0x551962!=_0x2ad285(0xe4)&&_0x82a2c3['andWhere'](_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x54da04+'\x20'+_0x3413bd+'\x20:'+_0x315843,{[_0x315843]:_0x551962});else{if(['IN',_0x2ad285(0xf6)]['indexOf'](_0x3413bd)!=-0x1){if(typeof _0x551962!='undefined'){const _0x2348fa=Array[_0x2ad285(0xfa)](_0x551962)?_0x551962:typeof _0x551962==_0x2ad285(0x100)?_0x551962[_0x2ad285(0x108)](','):[_0x551962];_0x82a2c3[_0x2ad285(0xf7)](_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x54da04+'\x20'+_0x3413bd+'(:'+_0x315843+')',{[_0x315843]:_0x2348fa});}}else{if([_0x2ad285(0x11f),_0x2ad285(0xf8)][_0x2ad285(0x124)](_0x3413bd)!=-0x1)typeof _0x551962!=_0x2ad285(0xe4)&&_0x82a2c3[_0x2ad285(0xf7)](_0x3413bd+'(:'+_0x315843+','+_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x54da04+')',{[_0x315843]:_0x551962});else{if([_0x2ad285(0xe6),'NOT\x20BETWEEN'][_0x2ad285(0x124)](_0x3413bd)!=-0x1){if(typeof _0x551962!=_0x2ad285(0xe4)){const _0x252565=Array[_0x2ad285(0xfa)](_0x551962)?_0x551962:typeof _0x551962==_0x2ad285(0x100)?_0x551962[_0x2ad285(0x108)](','):[_0x551962];_0x252565[_0x2ad285(0xe8)]>0x1&&_0x82a2c3[_0x2ad285(0xf7)](_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x54da04+'\x20'+_0x3413bd+'\x20:'+_0x315843+_0x2ad285(0xda)+_0x315843+'_2',{[''+_0x315843]:_0x252565[0x0],[_0x315843+'_2']:_0x252565[0x1]});}}else[_0x2ad285(0xff),_0x2ad285(0x10d)][_0x2ad285(0x124)](_0x3413bd)!=-0x1&&_0x82a2c3[_0x2ad285(0xf7)](_0x3413bd+'('+_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x54da04+')');}}}}else{if(_0x1638ae[_0x2ad285(0x124)](_0x54da04)==-0x1){const _0x4b7ffe=typeof _0x32799c['type']==_0x2ad285(0x104)?(_0x1c3a00=_0x32799c===null||_0x32799c===void 0x0?void 0x0:_0x32799c[_0x2ad285(0xf9)])===null||_0x1c3a00===void 0x0?void 0x0:_0x1c3a00[_0x2ad285(0x103)]:_0x32799c[_0x2ad285(0xf9)][_0x2ad285(0xf0)]();_0x4b7ffe==_0x2ad285(0x109)?_0x82a2c3['andWhere'](_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x54da04+_0x2ad285(0x123)+_0x54da04,{['_auto_'+_0x54da04]:'%'+_0xeb1f6f[_0x54da04]+'%'}):_0x82a2c3['andWhere'](_0x82a2c3['alias']+'.'+_0x54da04+_0x2ad285(0x11d)+_0x54da04,{[_0x2ad285(0xd9)+_0x54da04]:_0xeb1f6f[_0x54da04]});}}}}}(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0xde)])&&_0x82a2c3[_0x2ad285(0xe2)](Math['abs'](_0x32d9a0[_0x2ad285(0xde)]));(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0x120)])&&(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0xde)])&&_0x82a2c3[_0x2ad285(0xf2)]((Math[_0x2ad285(0xef)](_0x32d9a0[_0x2ad285(0x120)])-0x1)*Math['abs'](_0x32d9a0[_0x2ad285(0xde)]));if(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0x116)]){if(_0x32d9a0['_order']['indexOf']('.')!==-0x1)_0x82a2c3[_0x2ad285(0xdc)](''+_0x32d9a0[_0x2ad285(0x116)],(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0x11c)])?_0x2ad285(0xee):_0x2ad285(0x11e));else _0x1638ae[_0x2ad285(0x124)](_0x32d9a0[_0x2ad285(0x116)])==-0x1&&(this['metadata']['findColumnWithPropertyName'](_0x32d9a0['_order'])?_0x82a2c3['orderBy'](_0x82a2c3[_0x2ad285(0x128)]+'.'+_0x32d9a0['_order'],(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0x11c)])?_0x2ad285(0xee):'DESC'):_0x82a2c3[_0x2ad285(0xdc)](''+_0x32d9a0[_0x2ad285(0x116)],(_0x32d9a0===null||_0x32d9a0===void 0x0?void 0x0:_0x32d9a0[_0x2ad285(0x11c)])?_0x2ad285(0xee):_0x2ad285(0x11e)));}return typeof(_0x2da7a5===null||_0x2da7a5===void 0x0?void 0x0:_0x2da7a5['excess'])=='function'&&await(_0x2da7a5===null||_0x2da7a5===void 0x0?void 0x0:_0x2da7a5[_0x2ad285(0x11b)](_0x82a2c3)),_0x82a2c3;}async[a7_0x4c08ca(0xec)](_0x32dbdb,..._0x3ed391){const _0xdc58bb=a7_0x4c08ca,_0x3c2659=this[_0xdc58bb(0xea)](_0x32dbdb,..._0x3ed391);return await this['save'](_0x3c2659);}async[a7_0x4c08ca(0xed)](_0xb85ef2,..._0xdd6572){const _0x197231=a7_0x4c08ca,_0x52153d=this[_0x197231(0xea)](this[_0x197231(0x122)](_0xb85ef2),..._0xdd6572);return await this[_0x197231(0x10b)](_0x52153d);}async[a7_0x4c08ca(0x126)](_0x57a87c,_0x4630fa){const _0x203b14=a7_0x4c08ca;return this[_0x203b14(0xdd)][_0x203b14(0x126)](_0x57a87c,_0x4630fa);}}exports[a7_0x4c08ca(0x11a)]=Repository;function a7_0xb97c(){const _0x49e0a7=['methodName','findColumnWithPropertyName','name','function','78ZeuNBX','operator','defineProperty','split','String','modelSearchs','save','getClassMetadata','NOT\x20ISNULL','search','condition','../interface','__esModule','getAsync','MODEL_KEY','searchs','9940051lybuGC','_order','createQueryBuilder','getApplicationContext','MODEL_SEARCH_KEY','Repository','excess','_isreverse','\x20=\x20:_auto_','DESC','FIND\x20IN\x20SET','_page','1861510wOPNXv','create','\x20like\x20:_auto_','indexOf','field','transaction','metadata','alias','653909fLzsRn','_auto_','\x20AND\x20:','random','orderBy','manager','_size','ceil','push','model','take','NOT\x20LIKE','undefined','queryRunner','BETWEEN','48874CdlWNR','length','80536HkyXvZ','merge','bind','mergeSave','createSave','ASC','abs','toString','target','skip','6444byQMnE','112ifFDgt','app','NOT\x20IN','andWhere','NOT\x20FIND\x20IN\x20SET','type','isArray','10XqRWui','95874SvFWyF','234RBShza','hasOwnProperty','ISNULL','string'];a7_0xb97c=function(){return _0x49e0a7;};return a7_0xb97c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a8_0x434d77=a8_0x4c5a;function a8_0x4c5a(_0xc5be74,_0x2f6ce5){const _0x48f142=a8_0x48f1();return a8_0x4c5a=function(_0x4c5aaf,_0x1a3f9d){_0x4c5aaf=_0x4c5aaf-0x1f3;let _0x214204=_0x48f142[_0x4c5aaf];return _0x214204;},a8_0x4c5a(_0xc5be74,_0x2f6ce5);}(function(_0xe51c0e,_0x3de3bd){const _0x17a2f9=a8_0x4c5a,_0x1ec5de=_0xe51c0e();while(!![]){try{const _0x32d6ed=parseInt(_0x17a2f9(0x1ff))/0x1+-parseInt(_0x17a2f9(0x206))/0x2+parseInt(_0x17a2f9(0x1fb))/0x3*(parseInt(_0x17a2f9(0x1fa))/0x4)+parseInt(_0x17a2f9(0x200))/0x5*(parseInt(_0x17a2f9(0x204))/0x6)+-parseInt(_0x17a2f9(0x1f6))/0x7*(parseInt(_0x17a2f9(0x1f8))/0x8)+parseInt(_0x17a2f9(0x1fe))/0x9*(parseInt(_0x17a2f9(0x203))/0xa)+-parseInt(_0x17a2f9(0x201))/0xb*(parseInt(_0x17a2f9(0x1f4))/0xc);if(_0x32d6ed===_0x3de3bd)break;else _0x1ec5de['push'](_0x1ec5de['shift']());}catch(_0x58d3ba){_0x1ec5de['push'](_0x1ec5de['shift']());}}}(a8_0x48f1,0xb1f37));function a8_0x48f1(){const _0x159f82=['../interface','501840sSKweK','push','36IFrbqR','getDataSourceEntity','1817473xUeJje','dataSource','32yHybXu','default','2687104gytTsJ','6sSyMWX','listModule','ENTIFY_MODULE','1240641uBqPoA','181330bSnhSK','307535gdxSYt','1511114QRqnNx','@midwayjs/decorator','30szvSWs','48ZcxDWK'];a8_0x48f1=function(){return _0x159f82;};return a8_0x48f1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a8_0x434d77(0x1f5)]=void 0x0;const decorator_1=require(a8_0x434d77(0x202)),interface_1=require(a8_0x434d77(0x205));function getDataSourceEntity(_0x59d4f4=a8_0x434d77(0x1f9)){const _0x2b117a=a8_0x434d77;var _0x3e3e6d;const _0x123d66=[];for(const _0xb11803 of(0x0,decorator_1[_0x2b117a(0x1fc)])(interface_1[_0x2b117a(0x1fd)])){const _0x40d3e6=(0x0,decorator_1['getClassMetadata'])(interface_1['ENTIFY_MODULE_SOURCE'],_0xb11803);((_0x3e3e6d=_0x40d3e6===null||_0x40d3e6===void 0x0?void 0x0:_0x40d3e6[_0x2b117a(0x1f7)])===null||_0x3e3e6d===void 0x0?void 0x0:_0x3e3e6d['find'](_0x2c7af6=>_0x2c7af6==_0x59d4f4))&&_0x123d66[_0x2b117a(0x1f3)](_0xb11803);}return _0x123d66;}exports[a8_0x434d77(0x1f5)]=getDataSourceEntity;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "typeorm";
|
|
2
|
-
export
|
|
2
|
+
export * from './interface';
|
|
3
3
|
export { Repository } from './definition/Repository';
|
|
4
4
|
export { VirtualColumn } from "./decorator/VirtualColumn";
|
|
5
5
|
export { InjectEntity } from './decorator/InjectEntity';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a9_0xdbc3(){var _0x43d72d=['writable','./decorator/InjectRepository','937630lRoSDC','Scope','CustomConfiguration','./decorator/ProvideEntity','ProvideRepository','default','14305fYfRNq','InjectEntity','Inject','73620ewJnux','InjectRepository','defineProperty','typeorm','./decorator/ProvideRepository','Configuration','./interface','300YfcrEv','1716304XUpKno','Search','VirtualColumn','__exportStar','configurable','3775618GhqTNy','Provide','create','./decorator/VirtualColumn','get','7668odcwxt','__esModule','prototype','__createBinding','ProvideSearch','3647IuddeM','54RrBPUR','ScopeEnum','Repository','./helper/getDataSourceEntity','ProvideEntity','getDataSourceEntity','36RaOfcz','142aCYdiR','./decorator/ProvideSearch'];a9_0xdbc3=function(){return _0x43d72d;};return a9_0xdbc3();}var a9_0x180df8=a9_0x31dc;(function(_0x16b5bb,_0x5b9b65){var _0x3b5508=a9_0x31dc,_0x3c456c=_0x16b5bb();while(!![]){try{var _0x1967d6=parseInt(_0x3b5508(0x18a))/0x1+-parseInt(_0x3b5508(0x1a9))/0x2*(-parseInt(_0x3b5508(0x19c))/0x3)+-parseInt(_0x3b5508(0x191))/0x4*(parseInt(_0x3b5508(0x187))/0x5)+parseInt(_0x3b5508(0x1a2))/0x6*(-parseInt(_0x3b5508(0x1a1))/0x7)+parseInt(_0x3b5508(0x192))/0x8+parseInt(_0x3b5508(0x1a8))/0x9*(-parseInt(_0x3b5508(0x1ad))/0xa)+parseInt(_0x3b5508(0x197))/0xb;if(_0x1967d6===_0x5b9b65)break;else _0x3c456c['push'](_0x3c456c['shift']());}catch(_0x2599db){_0x3c456c['push'](_0x3c456c['shift']());}}}(a9_0xdbc3,0x355bc));var __createBinding=this&&this[a9_0x180df8(0x19f)]||(Object[a9_0x180df8(0x199)]?function(_0x43ffb9,_0x5c6d3e,_0x56ab47,_0x26288e){var _0x32697e=a9_0x180df8;if(_0x26288e===undefined)_0x26288e=_0x56ab47;var _0x151e0a=Object['getOwnPropertyDescriptor'](_0x5c6d3e,_0x56ab47);(!_0x151e0a||(_0x32697e(0x19b)in _0x151e0a?!_0x5c6d3e[_0x32697e(0x19d)]:_0x151e0a[_0x32697e(0x1ab)]||_0x151e0a[_0x32697e(0x196)]))&&(_0x151e0a={'enumerable':!![],'get':function(){return _0x5c6d3e[_0x56ab47];}}),Object[_0x32697e(0x18c)](_0x43ffb9,_0x26288e,_0x151e0a);}:function(_0x299f21,_0x12c7b1,_0x21c67c,_0x409f51){if(_0x409f51===undefined)_0x409f51=_0x21c67c;_0x299f21[_0x409f51]=_0x12c7b1[_0x21c67c];}),__exportStar=this&&this[a9_0x180df8(0x195)]||function(_0x4fd13c,_0x5e0b7f){var _0x75a1dd=a9_0x180df8;for(var _0x4a6d6c in _0x4fd13c)if(_0x4a6d6c!==_0x75a1dd(0x186)&&!Object[_0x75a1dd(0x19e)]['hasOwnProperty']['call'](_0x5e0b7f,_0x4a6d6c))__createBinding(_0x5e0b7f,_0x4fd13c,_0x4a6d6c);};Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x19d),{'value':!![]}),exports[a9_0x180df8(0x1a3)]=exports[a9_0x180df8(0x1ae)]=exports['Inject']=exports['Provide']=exports[a9_0x180df8(0x18f)]=exports[a9_0x180df8(0x1a7)]=exports[a9_0x180df8(0x193)]=exports['ProvideSearch']=exports[a9_0x180df8(0x185)]=exports[a9_0x180df8(0x1a6)]=exports['InjectRepository']=exports[a9_0x180df8(0x188)]=exports['VirtualColumn']=exports['Repository']=void 0x0,__exportStar(require(a9_0x180df8(0x18d)),exports),__exportStar(require(a9_0x180df8(0x190)),exports);var Repository_1=require('./definition/Repository');Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x1a4),{'enumerable':!![],'get':function(){return Repository_1['Repository'];}});var VirtualColumn_1=require(a9_0x180df8(0x19a));Object['defineProperty'](exports,'VirtualColumn',{'enumerable':!![],'get':function(){var _0x2649db=a9_0x180df8;return VirtualColumn_1[_0x2649db(0x194)];}});function a9_0x31dc(_0x4e8fe7,_0x574bc9){var _0xdbc39d=a9_0xdbc3();return a9_0x31dc=function(_0x31dc47,_0x3af9f4){_0x31dc47=_0x31dc47-0x185;var _0x5aef22=_0xdbc39d[_0x31dc47];return _0x5aef22;},a9_0x31dc(_0x4e8fe7,_0x574bc9);}var InjectEntity_1=require('./decorator/InjectEntity');Object[a9_0x180df8(0x18c)](exports,'InjectEntity',{'enumerable':!![],'get':function(){var _0x5b126c=a9_0x180df8;return InjectEntity_1[_0x5b126c(0x188)];}});var InjectRepository_1=require(a9_0x180df8(0x1ac));Object[a9_0x180df8(0x18c)](exports,'InjectRepository',{'enumerable':!![],'get':function(){var _0x309fa9=a9_0x180df8;return InjectRepository_1[_0x309fa9(0x18b)];}});var ProvideEntity_1=require(a9_0x180df8(0x1b0));Object[a9_0x180df8(0x18c)](exports,'ProvideEntity',{'enumerable':!![],'get':function(){var _0x17a314=a9_0x180df8;return ProvideEntity_1[_0x17a314(0x1a6)];}});var ProvideRepository_1=require(a9_0x180df8(0x18e));Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x185),{'enumerable':!![],'get':function(){return ProvideRepository_1['ProvideRepository'];}});var ProvideSearch_1=require(a9_0x180df8(0x1aa));Object[a9_0x180df8(0x18c)](exports,'ProvideSearch',{'enumerable':!![],'get':function(){var _0x3e3548=a9_0x180df8;return ProvideSearch_1[_0x3e3548(0x1a0)];}}),Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x193),{'enumerable':!![],'get':function(){return ProvideSearch_1['Search'];}});var getDataSourceEntity_1=require(a9_0x180df8(0x1a5));Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x1a7),{'enumerable':!![],'get':function(){var _0x53b11d=a9_0x180df8;return getDataSourceEntity_1[_0x53b11d(0x1a7)];}});var configuration_1=require('./configuration');Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x18f),{'enumerable':!![],'get':function(){var _0x24c426=a9_0x180df8;return configuration_1[_0x24c426(0x1af)];}});var decorator_1=require('@midwayjs/decorator');Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x198),{'enumerable':!![],'get':function(){var _0x5e36ab=a9_0x180df8;return decorator_1[_0x5e36ab(0x198)];}}),Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x189),{'enumerable':!![],'get':function(){var _0x1fadce=a9_0x180df8;return decorator_1[_0x1fadce(0x189)];}}),Object['defineProperty'](exports,a9_0x180df8(0x1ae),{'enumerable':!![],'get':function(){var _0xf515f9=a9_0x180df8;return decorator_1[_0xf515f9(0x1ae)];}}),Object[a9_0x180df8(0x18c)](exports,a9_0x180df8(0x1a3),{'enumerable':!![],'get':function(){var _0x3a7bb8=a9_0x180df8;return decorator_1[_0x3a7bb8(0x1a3)];}});
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindOptionsWhereProperty, DeepPartial } from 'typeorm';
|
|
1
|
+
import { FindOptionsWhereProperty, DeepPartial, ObjectLiteral, QueryRunner, SelectQueryBuilder } from 'typeorm';
|
|
2
2
|
export declare const ENTIFY_KEY = "decorator:anncic-api:typeorm:entify";
|
|
3
3
|
export declare const ENTIFY_MODULE = "decorator:anncic-api:typeorm:entify:module";
|
|
4
4
|
export declare const ENTIFY_MODULE_SOURCE = "decorator:anncic-api:typeorm:entify:module:source";
|
|
@@ -6,7 +6,7 @@ export declare const REPOSITORY_KEY = "decorator:anncic-api:typeorm:repository";
|
|
|
6
6
|
export declare const MODEL_KEY = "decorator:anncic-api:typeorm:model";
|
|
7
7
|
export declare const MODEL_SEARCH_KEY = "decorator:anncic-api:typeorm:model:search";
|
|
8
8
|
export declare const ENTITY_VIRTUAL_COLUMN_KEY = "decorator:anncic-api:typeorm:entity:virtual:column";
|
|
9
|
-
export declare type
|
|
9
|
+
export declare type SearchParams<Entity> = {
|
|
10
10
|
[P in keyof Entity]?: {
|
|
11
11
|
operator: '=' | '!=' | '<>' | '>' | '>=' | '<' | '<=' | 'LIKE' | 'NOT LIKE';
|
|
12
12
|
condition: FindOptionsWhereProperty<NonNullable<Entity[P]>>;
|
|
@@ -25,9 +25,13 @@ export declare type SearchOption<Entity> = {
|
|
|
25
25
|
} | DeepPartial<Entity> | {
|
|
26
26
|
[key: string]: any;
|
|
27
27
|
};
|
|
28
|
-
export declare class
|
|
28
|
+
export declare class SearchPaginate {
|
|
29
29
|
_page?: number;
|
|
30
30
|
_size?: number;
|
|
31
31
|
_order?: string;
|
|
32
32
|
_isreverse?: number;
|
|
33
33
|
}
|
|
34
|
+
export interface SearchOptions {
|
|
35
|
+
queryRunner?: QueryRunner;
|
|
36
|
+
excess?: <Entity extends ObjectLiteral>(search: SelectQueryBuilder<Entity>) => void;
|
|
37
|
+
}
|
package/dist/interface.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a10_0x12351d=a10_0x1d22;function a10_0x1d22(_0xdd4478,_0x19aedc){const _0x4cb4f0=a10_0x4cb4();return a10_0x1d22=function(_0x1d223f,_0x4734b9){_0x1d223f=_0x1d223f-0x163;let _0x37e582=_0x4cb4f0[_0x1d223f];return _0x37e582;},a10_0x1d22(_0xdd4478,_0x19aedc);}(function(_0x17a725,_0x13258a){const _0x1bd856=a10_0x1d22,_0x2abeef=_0x17a725();while(!![]){try{const _0x1fb7ec=parseInt(_0x1bd856(0x182))/0x1*(parseInt(_0x1bd856(0x175))/0x2)+parseInt(_0x1bd856(0x172))/0x3*(-parseInt(_0x1bd856(0x16a))/0x4)+parseInt(_0x1bd856(0x183))/0x5*(parseInt(_0x1bd856(0x171))/0x6)+parseInt(_0x1bd856(0x179))/0x7+parseInt(_0x1bd856(0x177))/0x8*(-parseInt(_0x1bd856(0x181))/0x9)+-parseInt(_0x1bd856(0x17a))/0xa*(parseInt(_0x1bd856(0x17d))/0xb)+parseInt(_0x1bd856(0x17e))/0xc;if(_0x1fb7ec===_0x13258a)break;else _0x2abeef['push'](_0x2abeef['shift']());}catch(_0x1e191d){_0x2abeef['push'](_0x2abeef['shift']());}}}(a10_0x4cb4,0xee9cc));Object[a10_0x12351d(0x165)](exports,a10_0x12351d(0x180),{'value':!![]}),exports[a10_0x12351d(0x168)]=exports['ENTITY_VIRTUAL_COLUMN_KEY']=exports['MODEL_SEARCH_KEY']=exports[a10_0x12351d(0x16c)]=exports[a10_0x12351d(0x174)]=exports[a10_0x12351d(0x17c)]=exports[a10_0x12351d(0x170)]=exports[a10_0x12351d(0x167)]=void 0x0;const typeorm_1=require('typeorm');exports[a10_0x12351d(0x167)]=a10_0x12351d(0x186),exports[a10_0x12351d(0x170)]=a10_0x12351d(0x16e),exports[a10_0x12351d(0x17c)]='decorator:anncic-api:typeorm:entify:module:source',exports[a10_0x12351d(0x174)]=a10_0x12351d(0x176),exports[a10_0x12351d(0x16c)]=a10_0x12351d(0x164),exports[a10_0x12351d(0x16f)]=a10_0x12351d(0x16d),exports[a10_0x12351d(0x163)]=a10_0x12351d(0x17b);function a10_0x4cb4(){const _0x1b9b0a=['13332893wAnPMo','10HcQqHL','decorator:anncic-api:typeorm:entity:virtual:column','ENTIFY_MODULE_SOURCE','9593155MsJHHl','4889568UQHrXl','reject','__esModule','5378733IlcksJ','1VELmfH','5gPmKXI','findOneOrFail','findOneBy','decorator:anncic-api:typeorm:entify','ENTITY_VIRTUAL_COLUMN_KEY','decorator:anncic-api:typeorm:model','defineProperty','findOneByOrFail','ENTIFY_KEY','SearchPaginate','EntityManager','6765380SeitMC','resolve','MODEL_KEY','decorator:anncic-api:typeorm:model:search','decorator:anncic-api:typeorm:entify:module','MODEL_SEARCH_KEY','ENTIFY_MODULE','9641802OepeRR','3yHjHGl','prototype','REPOSITORY_KEY','438626XybuMe','decorator:anncic-api:typeorm:repository','8WsMITJ','EntityNotFoundError'];a10_0x4cb4=function(){return _0x1b9b0a;};return a10_0x4cb4();}class SearchPaginate{}exports[a10_0x12351d(0x168)]=SearchPaginate,typeorm_1['EntityManager']['prototype'][a10_0x12351d(0x184)]=async function(_0x4e713c,_0x5bc424){return this['findOne'](_0x4e713c,_0x5bc424)['then'](_0xe87ad9=>{const _0x40821a=a10_0x1d22;if(_0xe87ad9===null||_0xe87ad9===undefined)return Promise['reject'](new typeorm_1['EntityNotFoundError'](_0x4e713c,_0x5bc424));return Promise[_0x40821a(0x16b)](_0xe87ad9);});},typeorm_1[a10_0x12351d(0x169)][a10_0x12351d(0x173)][a10_0x12351d(0x166)]=async function(_0x18d388,_0x138489){const _0x579f9c=a10_0x12351d;return this[_0x579f9c(0x185)](_0x18d388,_0x138489)['then'](_0x19590b=>{const _0xc8b9cc=_0x579f9c;if(_0x19590b===null||_0x19590b===undefined)return Promise[_0xc8b9cc(0x17f)](new typeorm_1[(_0xc8b9cc(0x178))](_0x18d388,_0x138489));return Promise[_0xc8b9cc(0x16b)](_0x19590b);});};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anncic-api/typeorm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"build": "tsc && javascript-obfuscator ./dist --output ./dist --config obfuscator.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@midwayjs/typeorm": "^3.
|
|
17
|
+
"@midwayjs/typeorm": "^3.5.0",
|
|
18
18
|
"typeorm": "^0.3.7"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"javascript-obfuscator": "2.19.0",
|
|
23
23
|
"typescript": "^4.7.4"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "e7efdf15bb83435be251d3e1492f9e5cf65ca81d"
|
|
26
26
|
}
|