@anncic-api/typeorm 1.0.25 → 1.1.0
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 +2 -2
package/dist/configuration.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x589b25=a0_0x2482;(function(_0x1b696f,_0x394286){const _0xd2a0f5=a0_0x2482,_0x5e10bd=_0x1b696f();while(!![]){try{const _0x482835=parseInt(_0xd2a0f5(0x98))/0x1*(parseInt(_0xd2a0f5(0xb8))/0x2)+-parseInt(_0xd2a0f5(0x99))/0x3*(-parseInt(_0xd2a0f5(0x96))/0x4)+parseInt(_0xd2a0f5(0xac))/0x5+parseInt(_0xd2a0f5(0x90))/0x6+-parseInt(_0xd2a0f5(0x8f))/0x7+parseInt(_0xd2a0f5(0xba))/0x8+-parseInt(_0xd2a0f5(0xa5))/0x9;if(_0x482835===_0x394286)break;else _0x5e10bd['push'](_0x5e10bd['shift']());}catch(_0x330b23){_0x5e10bd['push'](_0x5e10bd['shift']());}}}(a0_0x86b3,0x86562));var __decorate=this&&this['__decorate']||function(_0x44a59a,_0x448f70,_0x2c8661,_0x161d09){const _0x22a918=a0_0x2482;var _0x712b84=arguments[_0x22a918(0x92)],_0x1bfb28=_0x712b84<0x3?_0x448f70:_0x161d09===null?_0x161d09=Object['getOwnPropertyDescriptor'](_0x448f70,_0x2c8661):_0x161d09,_0x5bd25e;if(typeof Reflect===_0x22a918(0xbc)&&typeof Reflect[_0x22a918(0xa1)]===_0x22a918(0xad))_0x1bfb28=Reflect[_0x22a918(0xa1)](_0x44a59a,_0x448f70,_0x2c8661,_0x161d09);else{for(var _0x137280=_0x44a59a[_0x22a918(0x92)]-0x1;_0x137280>=0x0;_0x137280--)if(_0x5bd25e=_0x44a59a[_0x137280])_0x1bfb28=(_0x712b84<0x3?_0x5bd25e(_0x1bfb28):_0x712b84>0x3?_0x5bd25e(_0x448f70,_0x2c8661,_0x1bfb28):_0x5bd25e(_0x448f70,_0x2c8661))||_0x1bfb28;}return _0x712b84>0x3&&_0x1bfb28&&Object[_0x22a918(0xbf)](_0x448f70,_0x2c8661,_0x1bfb28),_0x1bfb28;},__metadata=this&&this[a0_0x589b25(0xbe)]||function(_0x31e5ef,_0x4eb900){const _0x2818a2=a0_0x589b25;if(typeof Reflect===_0x2818a2(0xbc)&&typeof Reflect[_0x2818a2(0xbd)]===_0x2818a2(0xad))return Reflect['metadata'](_0x31e5ef,_0x4eb900);};Object[a0_0x589b25(0xbf)](exports,a0_0x589b25(0x9a),{'value':!![]}),exports[a0_0x589b25(0xc1)]=void 0x0;function a0_0x86b3(){const _0x1370b4=['数据不存在','\x20is\x20not\x20ProvideRepository\x20Entify','handlercache','decorator','body','TypeORMError','message','getDataSourceNameByModel','target','anncic-api:typeorm','1960702rfccWn','design:type','4188120qpGmKW','getClassMetadata','object','metadata','__metadata','defineProperty','TypeORMDataSourceManager','CustomConfiguration','push','production','getRepository','3136707ItUZCk','4879434JErpWL','registerPropertyHandler','length','Inject','typeorm','MidwayConfigService','365444EAcOne','getDataSource','1sHlEHD','15IGKrQG','__esModule','config','@midwayjs/decorator','anncic-api-typeorm\x20Error\x20','getEnv','./definition/Repository','REPOSITORY_KEY','decorate','Repository','EntityNotFoundError','prototype','24613812nyXQFE','MidwayDecoratorService','useMiddleware','name','onReady','ENTIFY_KEY','find','4796505pfRCni','function'];a0_0x86b3=function(){return _0x1370b4;};return a0_0x86b3();}const typeorm_1=require('@midwayjs/typeorm'),decorator_1=require(a0_0x589b25(0x9c)),core_1=require('@midwayjs/core'),typeorm_2=require(a0_0x589b25(0x94)),Repository_1=require(a0_0x589b25(0x9f)),interface_1=require('./interface'),typeorm=require('@midwayjs/typeorm');function a0_0x2482(_0x1cbd43,_0x577f38){const _0x86b3b7=a0_0x86b3();return a0_0x2482=function(_0x248292,_0x99cdcb){_0x248292=_0x248292-0x8d;let _0x236f77=_0x86b3b7[_0x248292];return _0x236f77;},a0_0x2482(_0x1cbd43,_0x577f38);}let CustomConfiguration=class CustomConfiguration{constructor(){const _0x3a63d4=a0_0x589b25;this[_0x3a63d4(0xb0)]=[];}async[a0_0x589b25(0xa9)](_0x46cebf,_0x441f60){const _0x7f3580=a0_0x589b25,_0x62e98b=await _0x46cebf['getAsync'](typeorm_1[_0x7f3580(0xc0)]);this[_0x7f3580(0xb1)][_0x7f3580(0x91)](interface_1[_0x7f3580(0xaa)],(_0x3a821c,{entity:_0x2870a8,connection:_0x5677cb})=>{const _0x49b0b8=_0x7f3580;let _0x4368ff=this['handlercache'][_0x49b0b8(0xab)](_0x62ed1e=>_0x62ed1e['target']==_0x2870a8);return!_0x4368ff&&(_0x4368ff=new Repository_1['Repository'](_0x441f60,_0x62e98b['getDataSource'](_0x5677cb||_0x62e98b[_0x49b0b8(0xb5)](_0x2870a8))[_0x49b0b8(0x8e)](_0x2870a8)),this[_0x49b0b8(0xb0)][_0x49b0b8(0xc2)](_0x4368ff)),_0x4368ff;}),this['decorator']['registerPropertyHandler'](interface_1[_0x7f3580(0xa0)],(_0x389931,{repository:_0x41d839,connection:_0x646082})=>{const _0x320437=_0x7f3580,{entity:_0x1a68a8}=(0x0,decorator_1[_0x320437(0xbb)])(interface_1['REPOSITORY_KEY'],_0x41d839)||{};if(!_0x1a68a8)throw new Error(_0x320437(0x9d)+((_0x41d839===null||_0x41d839===void 0x0?void 0x0:_0x41d839[_0x320437(0xa8)])||_0x41d839)+_0x320437(0xaf));let _0x58c471=this['handlercache']['find'](_0x9ee335=>_0x9ee335[_0x320437(0xb6)]==_0x1a68a8);return!_0x58c471&&(_0x58c471=new Repository_1[(_0x320437(0xa2))](_0x441f60,_0x62e98b[_0x320437(0x97)](_0x646082||_0x62e98b[_0x320437(0xb5)](_0x1a68a8))[_0x320437(0x8e)](_0x1a68a8)),this[_0x320437(0xb0)][_0x320437(0xc2)](_0x58c471)),_0x58c471;}),_0x441f60[_0x7f3580(0xa7)](this['middlewareError'](_0x441f60));}['middlewareError'](_0x374c0a){return async(_0x23181e,_0x2c1fc7)=>{const _0x14c5a9=a0_0x2482;try{await _0x2c1fc7();}catch(_0x479c1b){if(_0x479c1b instanceof typeorm_2[_0x14c5a9(0xb3)])_0x479c1b instanceof typeorm_2[_0x14c5a9(0xa3)]?_0x23181e[_0x14c5a9(0xb2)]={'code':0x194,'msg':_0x14c5a9(0xae)}:(_0x23181e[_0x14c5a9(0xb2)]={'code':0x1f4,'msg':_0x479c1b[_0x14c5a9(0xb4)]},_0x374c0a[_0x14c5a9(0x9e)]()!=_0x14c5a9(0x8d)&&console['warn'](_0x479c1b));else throw _0x479c1b;}};}};__decorate([(0x0,decorator_1[a0_0x589b25(0x93)])(),__metadata(a0_0x589b25(0xb9),core_1[a0_0x589b25(0x95)])],CustomConfiguration[a0_0x589b25(0xa4)],a0_0x589b25(0x9b),void 0x0),__decorate([(0x0,decorator_1[a0_0x589b25(0x93)])(),__metadata(a0_0x589b25(0xb9),core_1[a0_0x589b25(0xa6)])],CustomConfiguration['prototype'],a0_0x589b25(0xb1),void 0x0),CustomConfiguration=__decorate([(0x0,decorator_1['Configuration'])({'imports':[typeorm],'conflictCheck':![],'namespace':a0_0x589b25(0xb7)})],CustomConfiguration),exports[a0_0x589b25(0xc1)]=CustomConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a1_0x4680c0=a1_0x2620;(function(_0x3fe208,_0x5578ec){const _0x4acaea=a1_0x2620,_0x47c76c=_0x3fe208();while(!![]){try{const _0x36f54c=parseInt(_0x4acaea(0x115))/0x1*(-parseInt(_0x4acaea(0x10d))/0x2)+parseInt(_0x4acaea(0x114))/0x3*(-parseInt(_0x4acaea(0x11d))/0x4)+parseInt(_0x4acaea(0x116))/0x5*(-parseInt(_0x4acaea(0x118))/0x6)+parseInt(_0x4acaea(0x11e))/0x7*(-parseInt(_0x4acaea(0x111))/0x8)+-parseInt(_0x4acaea(0x120))/0x9*(parseInt(_0x4acaea(0x112))/0xa)+-parseInt(_0x4acaea(0x11c))/0xb+parseInt(_0x4acaea(0x11b))/0xc*(parseInt(_0x4acaea(0x11a))/0xd);if(_0x36f54c===_0x5578ec)break;else _0x47c76c['push'](_0x47c76c['shift']());}catch(_0x4ed25e){_0x47c76c['push'](_0x47c76c['shift']());}}}(a1_0x5b21,0xec96f));function a1_0x2620(_0x106999,_0x3cba23){const _0x5b2189=a1_0x5b21();return a1_0x2620=function(_0x2620b0,_0x2d6df3){_0x2620b0=_0x2620b0-0x10c;let _0x42cc67=_0x5b2189[_0x2620b0];return _0x42cc67;},a1_0x2620(_0x106999,_0x3cba23);}Object[a1_0x4680c0(0x110)](exports,a1_0x4680c0(0x113),{'value':!![]}),exports[a1_0x4680c0(0x10c)]=void 0x0;const decorator_1=require(a1_0x4680c0(0x11f)),interface_1=require(a1_0x4680c0(0x10e));function a1_0x5b21(){const _0x382fc6=['@midwayjs/decorator','45IffzQG','InjectEntity','14422gMctom','../interface','ENTIFY_KEY','defineProperty','8yZBPQv','2944160OlpzIt','__esModule','14433uNZVPa','124uqhiFv','7165Ghnddg','default','1938MYsajZ','createCustomPropertyDecorator','1862406FTYKzN','540hHQPHh','1384438CrGMHY','628JzvLlp','12372017xQoSzF'];a1_0x5b21=function(){return _0x382fc6;};return a1_0x5b21();}function InjectEntity(_0xe6ce5f,_0x583869=a1_0x4680c0(0x117)){const _0x1db282=a1_0x4680c0;return(0x0,decorator_1[_0x1db282(0x119)])(interface_1[_0x1db282(0x10f)],{'entity':_0xe6ce5f,'connection':_0x583869});}exports[a1_0x4680c0(0x10c)]=InjectEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a2_0x42faf3=a2_0x560f;(function(_0x36e3d8,_0x866259){const _0x56dc83=a2_0x560f,_0x4c5940=_0x36e3d8();while(!![]){try{const _0x3cdcd6=parseInt(_0x56dc83(0x1a6))/0x1+parseInt(_0x56dc83(0x1a9))/0x2+-parseInt(_0x56dc83(0x1a7))/0x3+parseInt(_0x56dc83(0x1ad))/0x4*(-parseInt(_0x56dc83(0x1a4))/0x5)+-parseInt(_0x56dc83(0x1ac))/0x6+-parseInt(_0x56dc83(0x1a8))/0x7+-parseInt(_0x56dc83(0x1b0))/0x8;if(_0x3cdcd6===_0x866259)break;else _0x4c5940['push'](_0x4c5940['shift']());}catch(_0x9b8812){_0x4c5940['push'](_0x4c5940['shift']());}}}(a2_0x5c04,0x5639d));Object[a2_0x42faf3(0x1a5)](exports,a2_0x42faf3(0x1ab),{'value':!![]}),exports[a2_0x42faf3(0x1b1)]=void 0x0;const decorator_1=require(a2_0x42faf3(0x1af)),interface_1=require(a2_0x42faf3(0x1b2));function InjectRepository(_0x401870,_0x23a976='default'){const _0x48d87f=a2_0x42faf3;return(0x0,decorator_1[_0x48d87f(0x1aa)])(interface_1[_0x48d87f(0x1ae)],{'repository':_0x401870,'connection':_0x23a976});}function a2_0x5c04(){const _0x121864=['3238515zgUuYS','1353128FxIdAS','createCustomPropertyDecorator','__esModule','808728vzNxyW','871220KESnxz','REPOSITORY_KEY','@midwayjs/decorator','1175808RTWGrA','InjectRepository','../interface','5eHLjzl','defineProperty','695392FewYdm','169683qAcZDC'];a2_0x5c04=function(){return _0x121864;};return a2_0x5c04();}function a2_0x560f(_0x629f23,_0x2ca45b){const _0x5c043b=a2_0x5c04();return a2_0x560f=function(_0x560f95,_0x22b98d){_0x560f95=_0x560f95-0x1a4;let _0x299312=_0x5c043b[_0x560f95];return _0x299312;},a2_0x560f(_0x629f23,_0x2ca45b);}exports[a2_0x42faf3(0x1b1)]=InjectRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a3_0xe96f3f=a3_0x3b16;(function(_0x55c8be,_0x3f7857){const _0x285c55=a3_0x3b16,_0x2dfcdf=_0x55c8be();while(!![]){try{const _0x51158f=parseInt(_0x285c55(0xe4))/0x1+-parseInt(_0x285c55(0xe2))/0x2+-parseInt(_0x285c55(0xd9))/0x3*(parseInt(_0x285c55(0xd7))/0x4)+parseInt(_0x285c55(0xe3))/0x5+parseInt(_0x285c55(0xdb))/0x6+-parseInt(_0x285c55(0xdc))/0x7+parseInt(_0x285c55(0xd6))/0x8;if(_0x51158f===_0x3f7857)break;else _0x2dfcdf['push'](_0x2dfcdf['shift']());}catch(_0x2c3200){_0x2dfcdf['push'](_0x2dfcdf['shift']());}}}(a3_0xd220,0xe75bb));Object[a3_0xe96f3f(0xd2)](exports,a3_0xe96f3f(0xcf),{'value':!![]}),exports[a3_0xe96f3f(0xd4)]=void 0x0;const typeorm_1=require(a3_0xe96f3f(0xd0)),decorator_1=require(a3_0xe96f3f(0xd1)),interface_1=require('../interface');function a3_0x3b16(_0x2b27bb,_0x1957d6){const _0xd22078=a3_0xd220();return a3_0x3b16=function(_0x3b167b,_0x427fe6){_0x3b167b=_0x3b167b-0xcd;let _0x9ec9a5=_0xd22078[_0x3b167b];return _0x9ec9a5;},a3_0x3b16(_0x2b27bb,_0x1957d6);}function ProvideEntity(_0x48bdc7,_0x134d1e={}){return _0x472f29=>{const _0x48859a=a3_0x3b16;_0x134d1e[_0x48859a(0xde)]=_0x48bdc7[_0x48859a(0xdd)];const _0x5c0b61=[];if(!(_0x48bdc7===null||_0x48bdc7===void 0x0?void 0x0:_0x48bdc7[_0x48859a(0xdf)]))_0x5c0b61[_0x48859a(0xce)](_0x48859a(0xe0));else{if(typeof(_0x48bdc7===null||_0x48bdc7===void 0x0?void 0x0:_0x48bdc7[_0x48859a(0xdf)])==_0x48859a(0xd8))_0x5c0b61[_0x48859a(0xce)](_0x48bdc7===null||_0x48bdc7===void 0x0?void 0x0:_0x48bdc7['dataSource']);else{if(Array[_0x48859a(0xd5)](_0x48bdc7===null||_0x48bdc7===void 0x0?void 0x0:_0x48bdc7[_0x48859a(0xdf)]))for(let _0x4633c9 of _0x48bdc7[_0x48859a(0xdf)]||[_0x48859a(0xe0)]){_0x5c0b61[_0x48859a(0xce)](_0x4633c9);}}}(0x0,decorator_1[_0x48859a(0xe1)])(interface_1[_0x48859a(0xd3)],_0x472f29),(0x0,decorator_1[_0x48859a(0xcd)])(interface_1[_0x48859a(0xe5)],{'tableName':_0x48bdc7[_0x48859a(0xdd)],'dataSource':_0x5c0b61},_0x472f29),(0x0,typeorm_1[_0x48859a(0xda)])(_0x48bdc7[_0x48859a(0xdd)],_0x134d1e)(_0x472f29);};}function a3_0xd220(){const _0x47adb1=['isArray','741616Uoyamd','2571620UQmJch','string','6RsgYEp','Entity','410376APEvzl','5319111QTJgsn','tableName','name','dataSource','default','saveModule','268362yIbzea','6263805TZAnxd','1713648ICLlwD','ENTIFY_MODULE_SOURCE','saveClassMetadata','push','__esModule','typeorm','@midwayjs/decorator','defineProperty','ENTIFY_MODULE','ProvideEntity'];a3_0xd220=function(){return _0x47adb1;};return a3_0xd220();}exports[a3_0xe96f3f(0xd4)]=ProvideEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a4_0x21f198=a4_0x49d8;function a4_0x22cb(){const _0x501ae2=['1MeMAoL','Request','ScopeEnum','4sEAywZ','268390WpCvVK','1067kBIekR','__esModule','REPOSITORY_KEY','2548126RtXWVb','639312ameuBJ','ProvideRepository','defineProperty','3188289uynlAI','24unrkmn','3872736bRrNjU','2360945OtTYAb','@midwayjs/decorator','Scope','saveClassMetadata','1959340jELNeG'];a4_0x22cb=function(){return _0x501ae2;};return a4_0x22cb();}function a4_0x49d8(_0x41a67f,_0x254729){const _0x22cb5f=a4_0x22cb();return a4_0x49d8=function(_0x49d83f,_0x5d1ce5){_0x49d83f=_0x49d83f-0x7e;let _0x3c2ea4=_0x22cb5f[_0x49d83f];return _0x3c2ea4;},a4_0x49d8(_0x41a67f,_0x254729);}(function(_0x2b7106,_0x37a9fe){const _0x17dad9=a4_0x49d8,_0x22edd9=_0x2b7106();while(!![]){try{const _0x236a5c=-parseInt(_0x17dad9(0x84))/0x1*(-parseInt(_0x17dad9(0x83))/0x2)+parseInt(_0x17dad9(0x90))/0x3+parseInt(_0x17dad9(0x87))/0x4*(-parseInt(_0x17dad9(0x7f))/0x5)+parseInt(_0x17dad9(0x8d))/0x6+parseInt(_0x17dad9(0x8c))/0x7*(parseInt(_0x17dad9(0x91))/0x8)+parseInt(_0x17dad9(0x7e))/0x9+-parseInt(_0x17dad9(0x88))/0xa*(parseInt(_0x17dad9(0x89))/0xb);if(_0x236a5c===_0x37a9fe)break;else _0x22edd9['push'](_0x22edd9['shift']());}catch(_0x4f78fd){_0x22edd9['push'](_0x22edd9['shift']());}}}(a4_0x22cb,0x9173b));Object[a4_0x21f198(0x8f)](exports,a4_0x21f198(0x8a),{'value':!![]}),exports['ProvideRepository']=void 0x0;const decorator_1=require(a4_0x21f198(0x80)),interface_1=require('../interface');function ProvideRepository(_0x5d0a66){return _0x8b8876=>{const _0x50bf27=a4_0x49d8;(0x0,decorator_1[_0x50bf27(0x81)])(decorator_1[_0x50bf27(0x86)][_0x50bf27(0x85)],{'allowDowngrade':!![]})(_0x8b8876),((0x0,decorator_1['Provide'])()(_0x8b8876),(0x0,decorator_1[_0x50bf27(0x82)])(interface_1[_0x50bf27(0x8b)],{'entity':_0x5d0a66},_0x8b8876));};}exports[a4_0x21f198(0x8e)]=ProvideRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a5_0x483d(){const _0x3a1dad=['622194pHhGcM','175147LMEnsF','Singleton','MODEL_SEARCH_KEY','555501DVqJTJ','10KHnbNb','@midwayjs/decorator','72pHNtjx','Search','Scope','112LjhCWX','719559BLQZBu','89810TcjVaK','ProvideSearch','11700324fxcmfP','saveModule','defineProperty','MODEL_KEY','3238050JMbTMr','../interface'];a5_0x483d=function(){return _0x3a1dad;};return a5_0x483d();}const a5_0x25141e=a5_0x2cc5;(function(_0x3d1636,_0x44309c){const _0x46b296=a5_0x2cc5,_0x58aa2c=_0x3d1636();while(!![]){try{const _0x1f6220=-parseInt(_0x46b296(0x166))/0x1+-parseInt(_0x46b296(0x162))/0x2+parseInt(_0x46b296(0x16d))/0x3+parseInt(_0x46b296(0x16c))/0x4*(parseInt(_0x46b296(0x16e))/0x5)+-parseInt(_0x46b296(0x174))/0x6+parseInt(_0x46b296(0x163))/0x7*(-parseInt(_0x46b296(0x169))/0x8)+parseInt(_0x46b296(0x170))/0x9*(parseInt(_0x46b296(0x167))/0xa);if(_0x1f6220===_0x44309c)break;else _0x58aa2c['push'](_0x58aa2c['shift']());}catch(_0x851573){_0x58aa2c['push'](_0x58aa2c['shift']());}}}(a5_0x483d,0x646e3));Object[a5_0x25141e(0x172)](exports,'__esModule',{'value':!![]}),exports[a5_0x25141e(0x16a)]=exports[a5_0x25141e(0x16f)]=void 0x0;const decorator_1=require(a5_0x25141e(0x168)),interface_1=require(a5_0x25141e(0x175));function ProvideSearch(_0x5c010d){return _0x5d26bd=>{const _0x51a9d6=a5_0x2cc5;(0x0,decorator_1[_0x51a9d6(0x171)])(interface_1['MODEL_KEY'],_0x5d26bd),(0x0,decorator_1[_0x51a9d6(0x16b)])(decorator_1['ScopeEnum'][_0x51a9d6(0x164)])(_0x5d26bd),(0x0,decorator_1['attachClassMetadata'])(interface_1[_0x51a9d6(0x173)],_0x5c010d,_0x5d26bd);};}function a5_0x2cc5(_0x4f79c2,_0x421129){const _0x483d49=a5_0x483d();return a5_0x2cc5=function(_0x2cc577,_0x5565e9){_0x2cc577=_0x2cc577-0x162;let _0x574b92=_0x483d49[_0x2cc577];return _0x574b92;},a5_0x2cc5(_0x4f79c2,_0x421129);}exports[a5_0x25141e(0x16f)]=ProvideSearch;function Search(_0xb16543,_0x202498){return(_0x2c5618,_0xb7e71c,_0x4f01ec)=>{const _0x1aad31=a5_0x2cc5;(0x0,decorator_1['attachClassMetadata'])(interface_1[_0x1aad31(0x165)],{'field':_0xb16543,'comment':_0x202498,'target':_0x2c5618,'methodName':_0xb7e71c,'descriptor':_0x4f01ec},_0x2c5618);};}exports[a5_0x25141e(0x16a)]=Search;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6_0x4393fe=a6_0x5907;(function(_0x2363ef,_0x417b11){const _0x504660=a6_0x5907,_0x3b458e=_0x2363ef();while(!![]){try{const _0x438e95=parseInt(_0x504660(0x16f))/0x1*(-parseInt(_0x504660(0x168))/0x2)+-parseInt(_0x504660(0x16d))/0x3+parseInt(_0x504660(0x178))/0x4+parseInt(_0x504660(0x17e))/0x5+parseInt(_0x504660(0x164))/0x6*(-parseInt(_0x504660(0x166))/0x7)+-parseInt(_0x504660(0x16b))/0x8*(parseInt(_0x504660(0x167))/0x9)+parseInt(_0x504660(0x17d))/0xa;if(_0x438e95===_0x417b11)break;else _0x3b458e['push'](_0x3b458e['shift']());}catch(_0x518312){_0x3b458e['push'](_0x3b458e['shift']());}}}(a6_0x1441,0x2a06e));function a6_0x5907(_0x47b6e5,_0x162ff0){const _0x1441ed=a6_0x1441();return a6_0x5907=function(_0x59071d,_0x59228e){_0x59071d=_0x59071d-0x15d;let _0x34908e=_0x1441ed[_0x59071d];return _0x34908e;},a6_0x5907(_0x47b6e5,_0x162ff0);}Object['defineProperty'](exports,a6_0x4393fe(0x17c),{'value':!![]}),exports[a6_0x4393fe(0x177)]=void 0x0;const typeorm_1=require(a6_0x4393fe(0x17a)),decorator_1=require(a6_0x4393fe(0x161)),interface_1=require(a6_0x4393fe(0x169));function VirtualColumn(_0x5ed1f9,_0x4c82e9){return(_0x2d10fc,_0x9543fb)=>{const _0x422cda=a6_0x5907,_0xa8831=(0x0,decorator_1[_0x422cda(0x165)])(interface_1['ENTITY_VIRTUAL_COLUMN_KEY'],_0x2d10fc)||{};_0xa8831[_0x9543fb]={'comment':_0x5ed1f9,..._0x4c82e9},(0x0,decorator_1[_0x422cda(0x17b)])(interface_1[_0x422cda(0x163)],_0xa8831,_0x2d10fc);};}function a6_0x1441(){const _0x49cece=['getTime','hasOwnProperty','getRawAndEntities','metadata','@midwayjs/decorator','expressionMap','ENTITY_VIRTUAL_COLUMN_KEY','379866ygEbnL','getClassMetadata','35YPWnWG','968580yqQIMJ','2FUsbQu','../interface','lockMode','24FqRXTS','mainAlias','567294abwTCH','optimistic','37218vuhwIn','SelectQueryBuilder','name','default','getCount','getEntityValue','getManyAndCount','prototype','VirtualColumn','809956lUmPtR','map','typeorm','saveClassMetadata','__esModule','6214960pcuaug','1069440fvWyXr','lockVersion','versionColumn','getMany'];a6_0x1441=function(){return _0x49cece;};return a6_0x1441();}exports[a6_0x4393fe(0x177)]=VirtualColumn,typeorm_1[a6_0x4393fe(0x170)][a6_0x4393fe(0x176)][a6_0x4393fe(0x181)]=async function(){const _0x1e3602=a6_0x4393fe;if(this[_0x1e3602(0x162)][_0x1e3602(0x16a)]===_0x1e3602(0x16e))throw new typeorm_1['OptimisticLockCanNotBeUsedError']();const {entities:_0x11855f,raw:_0x34fa04}=await this[_0x1e3602(0x15f)]();return _0x11855f[_0x1e3602(0x179)]((_0x196523,_0x35c676)=>{const _0x5229ea=_0x1e3602;var _0x5864ba;const _0x19f5c6=(0x0,decorator_1['getClassMetadata'])(interface_1[_0x5229ea(0x163)],_0x196523)||{};for(const _0x18dcd6 in _0x19f5c6){_0x34fa04[_0x35c676]&&_0x34fa04[_0x35c676][_0x5229ea(0x15e)](_0x18dcd6)&&(_0x196523[_0x18dcd6]=_0x34fa04[_0x35c676][_0x18dcd6]||((_0x5864ba=_0x19f5c6[_0x18dcd6])===null||_0x5864ba===void 0x0?void 0x0:_0x5864ba['default'])||'');}return _0x196523;});},typeorm_1[a6_0x4393fe(0x170)][a6_0x4393fe(0x176)][a6_0x4393fe(0x175)]=async function(){const _0x4ac894=a6_0x4393fe;return[await this['getMany'](),await this[_0x4ac894(0x173)]()];},typeorm_1[a6_0x4393fe(0x170)][a6_0x4393fe(0x176)]['getOne']=async function(){const _0x10e350=a6_0x4393fe;var _0x48fef5;const {entities:_0x3c938d,raw:_0xfc7ab7}=await this[_0x10e350(0x15f)]();if(_0x3c938d[0x0]&&this[_0x10e350(0x162)][_0x10e350(0x16a)]==='optimistic'&&this[_0x10e350(0x162)]['lockVersion']){const _0x19c0db=this[_0x10e350(0x162)][_0x10e350(0x16c)][_0x10e350(0x160)];if(this[_0x10e350(0x162)][_0x10e350(0x17f)]instanceof Date){const _0x1217f0=_0x19c0db['updateDateColumn'][_0x10e350(0x174)](_0x3c938d[0x0]);if(_0x1217f0[_0x10e350(0x15d)]()!==this[_0x10e350(0x162)]['lockVersion'][_0x10e350(0x15d)]())throw new typeorm_1['OptimisticLockVersionMismatchError'](_0x19c0db[_0x10e350(0x171)],this[_0x10e350(0x162)][_0x10e350(0x17f)],_0x1217f0);}else{const _0x479055=_0x19c0db[_0x10e350(0x180)][_0x10e350(0x174)](_0x3c938d[0x0]);if(_0x479055!==this[_0x10e350(0x162)][_0x10e350(0x17f)])throw new typeorm_1['OptimisticLockVersionMismatchError'](_0x19c0db['name'],this['expressionMap']['lockVersion'],_0x479055);}}if(_0x3c938d[0x0]&&_0xfc7ab7[0x0]){const _0x288345=(0x0,decorator_1[_0x10e350(0x165)])(interface_1['ENTITY_VIRTUAL_COLUMN_KEY'],_0x3c938d[0x0]);for(const _0x116778 in _0x288345){_0xfc7ab7[0x0][_0x10e350(0x15e)](_0x116778)&&(_0x3c938d[0x0][_0x116778]=_0xfc7ab7[0x0][_0x116778]||((_0x48fef5=_0x288345[_0x116778])===null||_0x48fef5===void 0x0?void 0x0:_0x48fef5[_0x10e350(0x172)])||'');}}return _0x3c938d[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_0x489417=a7_0x3d7f;(function(_0x4e0b92,_0x176840){const _0x335af3=a7_0x3d7f,_0x5a6aa8=_0x4e0b92();while(!![]){try{const _0x7a9d77=parseInt(_0x335af3(0x114))/0x1*(-parseInt(_0x335af3(0x113))/0x2)+-parseInt(_0x335af3(0x125))/0x3*(parseInt(_0x335af3(0x133))/0x4)+-parseInt(_0x335af3(0x134))/0x5+parseInt(_0x335af3(0x13c))/0x6+parseInt(_0x335af3(0x14a))/0x7+parseInt(_0x335af3(0x140))/0x8*(parseInt(_0x335af3(0x136))/0x9)+-parseInt(_0x335af3(0x135))/0xa*(parseInt(_0x335af3(0x12e))/0xb);if(_0x7a9d77===_0x176840)break;else _0x5a6aa8['push'](_0x5a6aa8['shift']());}catch(_0x31d248){_0x5a6aa8['push'](_0x5a6aa8['shift']());}}}(a7_0x4595,0xb73e5));function a7_0x3d7f(_0x292f52,_0x2a4abb){const _0x459502=a7_0x4595();return a7_0x3d7f=function(_0x3d7f7f,_0x331bc2){_0x3d7f7f=_0x3d7f7f-0x101;let _0x1e6efc=_0x459502[_0x3d7f7f];return _0x1e6efc;},a7_0x3d7f(_0x292f52,_0x2a4abb);}function a7_0x4595(){const _0x1472a9=['NOT\x20ISNULL','type','__esModule','NOT\x20BETWEEN','orderBy','excess','15518lLHAFy','149DmHXRC','NOT\x20FIND\x20IN\x20SET','random','_page','manager','ceil','toString','merge','NOT\x20LIKE','andWhere','model','_isreverse','FIND\x20IN\x20SET','@midwayjs/decorator','skip','findColumnWithPropertyName','BETWEEN','9XqbTTN','string','push','function','ISNULL','save','app','indexOf','mergeSave','242gZGXox','getAsync','\x20AND\x20:','field','alias','404988XaWNVN','7157005xDqzWG','260330JXiRZZ','1089uNcolA','ASC','modelSearchs','bind','hasOwnProperty','undefined','8930064tiUXos','searchs','MODEL_KEY','length','92264xZUlUJ','../interface','toUpperCase','MODEL_SEARCH_KEY','operator','transaction','_order','isArray','metadata','condition','9314809OZwVxl','DESC','_size','abs','Repository','methodName','take','split','_auto_','\x20=\x20:_auto_','name','target','queryRunner','getClassMetadata'];a7_0x4595=function(){return _0x1472a9;};return a7_0x4595();}Object['defineProperty'](exports,a7_0x489417(0x10f),{'value':!![]}),exports[a7_0x489417(0x103)]=void 0x0;const decorator_1=require(a7_0x489417(0x121)),typeorm_1=require('typeorm'),interface_1=require(a7_0x489417(0x141));class Repository extends typeorm_1[a7_0x489417(0x103)]{constructor(_0x1eb89a,_0x36ac10){const _0x139128=a7_0x489417;super(_0x36ac10[_0x139128(0x10a)],_0x36ac10[_0x139128(0x118)],_0x36ac10[_0x139128(0x10b)]),this['modelSearchs']=[];for(const _0x4e6a16 of(0x0,decorator_1['getClassMetadata'])(interface_1[_0x139128(0x13e)],this[_0x139128(0x10a)])||[]){const _0xecef7f={'model':_0x4e6a16,'searchs':[]};for(const _0x5d482e of(0x0,decorator_1[_0x139128(0x10c)])(interface_1[_0x139128(0x143)],_0x4e6a16)||[]){_0xecef7f['searchs'][_0x139128(0x127)](_0x5d482e);}this[_0x139128(0x138)][_0x139128(0x127)](_0xecef7f);}this[_0x139128(0x12b)]=_0x1eb89a;}async['search'](_0x3bfba0,_0x1ca21a,_0xec8120={}){const _0x2ba3f3=a7_0x489417;var _0x770c7f,_0x33dd17,_0x1cdfb7,_0x3700b1,_0x41019a,_0x371f8e;const _0x2c752b=this['createQueryBuilder'](undefined,_0xec8120===null||_0xec8120===void 0x0?void 0x0:_0xec8120['queryRunner']),_0x1d0c5c=[];for(const _0x3c770c of this[_0x2ba3f3(0x138)]){if((_0x3c770c===null||_0x3c770c===void 0x0?void 0x0:_0x3c770c[_0x2ba3f3(0x11e)])&&((_0x770c7f=_0x3c770c===null||_0x3c770c===void 0x0?void 0x0:_0x3c770c[_0x2ba3f3(0x13d)])===null||_0x770c7f===void 0x0?void 0x0:_0x770c7f[_0x2ba3f3(0x13f)])>0x0){const _0x2a76b2=await this['app']['getApplicationContext']()[_0x2ba3f3(0x12f)](_0x3c770c[_0x2ba3f3(0x11e)]);for(const _0x556022 of _0x3c770c[_0x2ba3f3(0x13d)]){(_0x556022===null||_0x556022===void 0x0?void 0x0:_0x556022[_0x2ba3f3(0x131)])&&(_0x556022===null||_0x556022===void 0x0?void 0x0:_0x556022[_0x2ba3f3(0x104)])&&typeof _0x2a76b2[_0x556022[_0x2ba3f3(0x104)]]==_0x2ba3f3(0x128)&&(typeof(_0x3bfba0===null||_0x3bfba0===void 0x0?void 0x0:_0x3bfba0[_0x556022[_0x2ba3f3(0x131)]])!=_0x2ba3f3(0x13b)&&!((_0x33dd17=_0x3bfba0===null||_0x3bfba0===void 0x0?void 0x0:_0x3bfba0[_0x556022[_0x2ba3f3(0x131)]])===null||_0x33dd17===void 0x0?void 0x0:_0x33dd17[_0x2ba3f3(0x13a)](_0x2ba3f3(0x144)))&&(_0x1d0c5c[_0x2ba3f3(0x12c)](_0x556022[_0x2ba3f3(0x131)])==-0x1&&_0x1d0c5c[_0x2ba3f3(0x127)](_0x556022[_0x2ba3f3(0x131)]),await _0x2a76b2[_0x556022[_0x2ba3f3(0x104)]][_0x2ba3f3(0x139)](_0x2a76b2)(_0x2c752b,_0x3bfba0[_0x556022[_0x2ba3f3(0x131)]],_0x3bfba0,_0x1ca21a,_0xec8120===null||_0xec8120===void 0x0?void 0x0:_0xec8120[_0x2ba3f3(0x10b)])));}}}for(const _0x2d739d in _0x3bfba0){if(typeof _0x3bfba0[_0x2d739d]!=_0x2ba3f3(0x13b)&&_0x1d0c5c['indexOf'](_0x2d739d)==-0x1){const _0x3fb604=this[_0x2ba3f3(0x148)][_0x2ba3f3(0x123)](_0x2d739d);if(_0x3fb604){if((_0x1cdfb7=_0x3bfba0===null||_0x3bfba0===void 0x0?void 0x0:_0x3bfba0[_0x2d739d])===null||_0x1cdfb7===void 0x0?void 0x0:_0x1cdfb7[_0x2ba3f3(0x13a)]('operator')){const _0x3afa6c=(_0x3700b1=_0x3bfba0[_0x2d739d])===null||_0x3700b1===void 0x0?void 0x0:_0x3700b1[_0x2ba3f3(0x149)],_0x324d87=(_0x41019a=_0x3bfba0[_0x2d739d])===null||_0x41019a===void 0x0?void 0x0:_0x41019a[_0x2ba3f3(0x144)]['trim']()[_0x2ba3f3(0x142)](),_0x9bb587='_auto_'+_0x2d739d+'_'+Math['ceil'](Math[_0x2ba3f3(0x116)]()*0xa)+Math[_0x2ba3f3(0x119)](Math[_0x2ba3f3(0x116)]()*0xa)+Math[_0x2ba3f3(0x119)](Math[_0x2ba3f3(0x116)]()*0xa)+Math[_0x2ba3f3(0x119)](Math[_0x2ba3f3(0x116)]()*0xa);if(['=','!=','<>','>','>=','<','<=','LIKE',_0x2ba3f3(0x11c)]['indexOf'](_0x324d87)!=-0x1)typeof _0x3afa6c!=_0x2ba3f3(0x13b)&&_0x2c752b[_0x2ba3f3(0x11d)](_0x2c752b[_0x2ba3f3(0x132)]+'.'+_0x2d739d+'\x20'+_0x324d87+'\x20:'+_0x9bb587,{[_0x9bb587]:_0x3afa6c});else{if(['IN','NOT\x20IN'][_0x2ba3f3(0x12c)](_0x324d87)!=-0x1){if(typeof _0x3afa6c!=_0x2ba3f3(0x13b)){const _0x4350aa=Array[_0x2ba3f3(0x147)](_0x3afa6c)?_0x3afa6c:typeof _0x3afa6c==_0x2ba3f3(0x126)?_0x3afa6c['split'](','):[_0x3afa6c];_0x2c752b[_0x2ba3f3(0x11d)](_0x2c752b['alias']+'.'+_0x2d739d+'\x20'+_0x324d87+'(:'+_0x9bb587+')',{[_0x9bb587]:_0x4350aa});}}else{if([_0x2ba3f3(0x120),_0x2ba3f3(0x115)][_0x2ba3f3(0x12c)](_0x324d87)!=-0x1)typeof _0x3afa6c!=_0x2ba3f3(0x13b)&&_0x2c752b['andWhere'](_0x324d87+'(:'+_0x9bb587+','+_0x2c752b['alias']+'.'+_0x2d739d+')',{[_0x9bb587]:_0x3afa6c});else{if([_0x2ba3f3(0x124),_0x2ba3f3(0x110)][_0x2ba3f3(0x12c)](_0x324d87)!=-0x1){if(typeof _0x3afa6c!='undefined'){const _0x5d0723=Array[_0x2ba3f3(0x147)](_0x3afa6c)?_0x3afa6c:typeof _0x3afa6c==_0x2ba3f3(0x126)?_0x3afa6c[_0x2ba3f3(0x106)](','):[_0x3afa6c];_0x5d0723[_0x2ba3f3(0x13f)]>0x1&&_0x2c752b[_0x2ba3f3(0x11d)](_0x2c752b[_0x2ba3f3(0x132)]+'.'+_0x2d739d+'\x20'+_0x324d87+'\x20:'+_0x9bb587+_0x2ba3f3(0x130)+_0x9bb587+'_2',{[''+_0x9bb587]:_0x5d0723[0x0],[_0x9bb587+'_2']:_0x5d0723[0x1]});}}else[_0x2ba3f3(0x129),_0x2ba3f3(0x10d)][_0x2ba3f3(0x12c)](_0x324d87)!=-0x1&&_0x2c752b[_0x2ba3f3(0x11d)](_0x324d87+'('+_0x2c752b[_0x2ba3f3(0x132)]+'.'+_0x2d739d+')');}}}}else{if(_0x1d0c5c['indexOf'](_0x2d739d)==-0x1){const _0x104111=typeof _0x3fb604['type']==_0x2ba3f3(0x128)?(_0x371f8e=_0x3fb604===null||_0x3fb604===void 0x0?void 0x0:_0x3fb604[_0x2ba3f3(0x10e)])===null||_0x371f8e===void 0x0?void 0x0:_0x371f8e[_0x2ba3f3(0x109)]:_0x3fb604['type'][_0x2ba3f3(0x11a)]();_0x104111=='String'?_0x2c752b[_0x2ba3f3(0x11d)](_0x2c752b['alias']+'.'+_0x2d739d+'\x20like\x20:_auto_'+_0x2d739d,{[_0x2ba3f3(0x107)+_0x2d739d]:'%'+_0x3bfba0[_0x2d739d]+'%'}):_0x2c752b[_0x2ba3f3(0x11d)](_0x2c752b[_0x2ba3f3(0x132)]+'.'+_0x2d739d+_0x2ba3f3(0x108)+_0x2d739d,{['_auto_'+_0x2d739d]:_0x3bfba0[_0x2d739d]});}}}}}(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a[_0x2ba3f3(0x101)])&&_0x2c752b[_0x2ba3f3(0x105)](Math[_0x2ba3f3(0x102)](_0x1ca21a[_0x2ba3f3(0x101)]));(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a[_0x2ba3f3(0x117)])&&(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a['_size'])&&_0x2c752b[_0x2ba3f3(0x122)]((Math['abs'](_0x1ca21a[_0x2ba3f3(0x117)])-0x1)*Math['abs'](_0x1ca21a[_0x2ba3f3(0x101)]));if(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a[_0x2ba3f3(0x146)]){if(_0x1ca21a[_0x2ba3f3(0x146)]['indexOf']('.')!==-0x1)_0x2c752b[_0x2ba3f3(0x111)](''+_0x1ca21a['_order'],(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a[_0x2ba3f3(0x11f)])?_0x2ba3f3(0x137):_0x2ba3f3(0x14b));else _0x1d0c5c[_0x2ba3f3(0x12c)](_0x1ca21a[_0x2ba3f3(0x146)])==-0x1&&(this[_0x2ba3f3(0x148)][_0x2ba3f3(0x123)](_0x1ca21a[_0x2ba3f3(0x146)])?_0x2c752b['orderBy'](_0x2c752b[_0x2ba3f3(0x132)]+'.'+_0x1ca21a[_0x2ba3f3(0x146)],(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a[_0x2ba3f3(0x11f)])?_0x2ba3f3(0x137):_0x2ba3f3(0x14b)):_0x2c752b[_0x2ba3f3(0x111)](''+_0x1ca21a[_0x2ba3f3(0x146)],(_0x1ca21a===null||_0x1ca21a===void 0x0?void 0x0:_0x1ca21a[_0x2ba3f3(0x11f)])?'ASC':'DESC'));}return typeof(_0xec8120===null||_0xec8120===void 0x0?void 0x0:_0xec8120[_0x2ba3f3(0x112)])==_0x2ba3f3(0x128)&&await(_0xec8120===null||_0xec8120===void 0x0?void 0x0:_0xec8120['excess'](_0x2c752b)),_0x2c752b;}async[a7_0x489417(0x12d)](_0xf179d3,..._0x2510ae){const _0x5d2cc2=a7_0x489417,_0x54cc49=this[_0x5d2cc2(0x11b)](_0xf179d3,..._0x2510ae);return await this[_0x5d2cc2(0x12a)](_0x54cc49);}async['createSave'](_0x536e9f,..._0x4ee30f){const _0x2cc8cd=a7_0x489417,_0x340a29=this[_0x2cc8cd(0x11b)](this['create'](_0x536e9f),..._0x4ee30f);return await this[_0x2cc8cd(0x12a)](_0x340a29);}async[a7_0x489417(0x145)](_0x1f3347,_0x775800){const _0x386f1f=a7_0x489417;return this[_0x386f1f(0x118)]['transaction'](_0x1f3347,_0x775800);}}exports['Repository']=Repository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a8_0x3d066e=a8_0x1da9;(function(_0x5d386b,_0x3493b0){const _0x355e1a=a8_0x1da9,_0x5e7d6f=_0x5d386b();while(!![]){try{const _0x34c0ab=-parseInt(_0x355e1a(0x165))/0x1*(parseInt(_0x355e1a(0x172))/0x2)+-parseInt(_0x355e1a(0x176))/0x3+parseInt(_0x355e1a(0x163))/0x4+-parseInt(_0x355e1a(0x174))/0x5+-parseInt(_0x355e1a(0x173))/0x6+-parseInt(_0x355e1a(0x162))/0x7*(parseInt(_0x355e1a(0x16f))/0x8)+-parseInt(_0x355e1a(0x171))/0x9*(-parseInt(_0x355e1a(0x177))/0xa);if(_0x34c0ab===_0x3493b0)break;else _0x5e7d6f['push'](_0x5e7d6f['shift']());}catch(_0x5a14f2){_0x5e7d6f['push'](_0x5e7d6f['shift']());}}}(a8_0x5665,0x187b0));Object[a8_0x3d066e(0x16d)](exports,a8_0x3d066e(0x170),{'value':!![]}),exports[a8_0x3d066e(0x164)]=void 0x0;function a8_0x1da9(_0x1eae9e,_0x1e44e2){const _0x5665b8=a8_0x5665();return a8_0x1da9=function(_0x1da9aa,_0x188630){_0x1da9aa=_0x1da9aa-0x162;let _0x31ffea=_0x5665b8[_0x1da9aa];return _0x31ffea;},a8_0x1da9(_0x1eae9e,_0x1e44e2);}const decorator_1=require(a8_0x3d066e(0x16b)),interface_1=require(a8_0x3d066e(0x16a));function getDataSourceEntity(_0x2a6b53=a8_0x3d066e(0x16e)){const _0x38050c=a8_0x3d066e;var _0x33ffbb;const _0x3e7231=[];for(const _0x170c53 of(0x0,decorator_1[_0x38050c(0x167)])(interface_1[_0x38050c(0x168)])){const _0xf8ea09=(0x0,decorator_1[_0x38050c(0x169)])(interface_1[_0x38050c(0x175)],_0x170c53);((_0x33ffbb=_0xf8ea09===null||_0xf8ea09===void 0x0?void 0x0:_0xf8ea09[_0x38050c(0x166)])===null||_0x33ffbb===void 0x0?void 0x0:_0x33ffbb[_0x38050c(0x16c)](_0x50d9ac=>_0x50d9ac==_0x2a6b53))&&_0x3e7231['push'](_0x170c53);}return _0x3e7231;}function a8_0x5665(){const _0x23c001=['442722hHIMir','6257810nrGoPY','217357tAHPhS','159044PFrhTM','getDataSourceEntity','61eQkkrA','dataSource','listModule','ENTIFY_MODULE','getClassMetadata','../interface','@midwayjs/decorator','find','defineProperty','default','24MmIfCs','__esModule','9ereiZM','5342DqjUug','32376UYcXhU','781080hXdxJE','ENTIFY_MODULE_SOURCE'];a8_0x5665=function(){return _0x23c001;};return a8_0x5665();}exports[a8_0x3d066e(0x164)]=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';var
|
|
1
|
+
'use strict';var a9_0x17b4c8=a9_0xeec9;function a9_0x2cde(){var _0x578715=['./decorator/ProvideRepository','./interface','./decorator/ProvideSearch','1304xSTPMF','VirtualColumn','595AkGtrw','getOwnPropertyDescriptor','Search','__esModule','31722nfpDRw','ProvideEntity','139064yTdXCS','3379019Sgfxth','Inject','defineProperty','getDataSourceEntity','ProvideSearch','./decorator/InjectRepository','./decorator/VirtualColumn','4533SsMOMS','Repository','1515974VGkqAK','./definition/Repository','InjectEntity','CustomConfiguration','InjectRepository','423WAulNb','call','prototype','8460265nNQNdj','ProvideRepository','1IYNJfk','default','get','@midwayjs/decorator','7957540MbuWot','./decorator/InjectEntity','typeorm','Provide','Configuration','ScopeEnum'];a9_0x2cde=function(){return _0x578715;};return a9_0x2cde();}(function(_0x24cc4a,_0x37d1d9){var _0x25262c=a9_0xeec9,_0x2302f8=_0x24cc4a();while(!![]){try{var _0xdec37e=parseInt(_0x25262c(0x1ed))/0x1*(-parseInt(_0x25262c(0x1e3))/0x2)+parseInt(_0x25262c(0x1e1))/0x3*(parseInt(_0x25262c(0x1d1))/0x4)+-parseInt(_0x25262c(0x1d3))/0x5*(-parseInt(_0x25262c(0x1d7))/0x6)+-parseInt(_0x25262c(0x1da))/0x7+-parseInt(_0x25262c(0x1d9))/0x8*(-parseInt(_0x25262c(0x1e8))/0x9)+parseInt(_0x25262c(0x1f1))/0xa+-parseInt(_0x25262c(0x1eb))/0xb;if(_0xdec37e===_0x37d1d9)break;else _0x2302f8['push'](_0x2302f8['shift']());}catch(_0x4e646f){_0x2302f8['push'](_0x2302f8['shift']());}}}(a9_0x2cde,0xb0ec3));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x115145,_0x12c0fd,_0x4d93b,_0x1261a7){var _0x40dbd1=a9_0xeec9;if(_0x1261a7===undefined)_0x1261a7=_0x4d93b;var _0x5b97ca=Object[_0x40dbd1(0x1d4)](_0x12c0fd,_0x4d93b);(!_0x5b97ca||(_0x40dbd1(0x1ef)in _0x5b97ca?!_0x12c0fd[_0x40dbd1(0x1d6)]:_0x5b97ca['writable']||_0x5b97ca['configurable']))&&(_0x5b97ca={'enumerable':!![],'get':function(){return _0x12c0fd[_0x4d93b];}}),Object[_0x40dbd1(0x1dc)](_0x115145,_0x1261a7,_0x5b97ca);}:function(_0x2d0373,_0x38b862,_0x42c9da,_0x285a97){if(_0x285a97===undefined)_0x285a97=_0x42c9da;_0x2d0373[_0x285a97]=_0x38b862[_0x42c9da];}),__exportStar=this&&this['__exportStar']||function(_0x1764b8,_0x56b7b1){var _0xfc9e7b=a9_0xeec9;for(var _0x12021d in _0x1764b8)if(_0x12021d!==_0xfc9e7b(0x1ee)&&!Object[_0xfc9e7b(0x1ea)]['hasOwnProperty'][_0xfc9e7b(0x1e9)](_0x56b7b1,_0x12021d))__createBinding(_0x56b7b1,_0x1764b8,_0x12021d);};Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1d6),{'value':!![]}),exports[a9_0x17b4c8(0x1cd)]=exports['Scope']=exports[a9_0x17b4c8(0x1db)]=exports['Provide']=exports[a9_0x17b4c8(0x1cc)]=exports['getDataSourceEntity']=exports[a9_0x17b4c8(0x1d5)]=exports[a9_0x17b4c8(0x1de)]=exports[a9_0x17b4c8(0x1ec)]=exports[a9_0x17b4c8(0x1d8)]=exports['InjectRepository']=exports[a9_0x17b4c8(0x1e5)]=exports[a9_0x17b4c8(0x1d2)]=exports['Repository']=void 0x0,__exportStar(require(a9_0x17b4c8(0x1ca)),exports),__exportStar(require(a9_0x17b4c8(0x1cf)),exports);var Repository_1=require(a9_0x17b4c8(0x1e4));Object['defineProperty'](exports,a9_0x17b4c8(0x1e2),{'enumerable':!![],'get':function(){var _0xe5d8cd=a9_0x17b4c8;return Repository_1[_0xe5d8cd(0x1e2)];}});var VirtualColumn_1=require(a9_0x17b4c8(0x1e0));Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1d2),{'enumerable':!![],'get':function(){var _0x242bdf=a9_0x17b4c8;return VirtualColumn_1[_0x242bdf(0x1d2)];}});var InjectEntity_1=require(a9_0x17b4c8(0x1f2));function a9_0xeec9(_0x4bc91e,_0x34e0cd){var _0x2cde24=a9_0x2cde();return a9_0xeec9=function(_0xeec9fb,_0x4207c0){_0xeec9fb=_0xeec9fb-0x1ca;var _0x4713a6=_0x2cde24[_0xeec9fb];return _0x4713a6;},a9_0xeec9(_0x4bc91e,_0x34e0cd);}Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1e5),{'enumerable':!![],'get':function(){var _0x2ad129=a9_0x17b4c8;return InjectEntity_1[_0x2ad129(0x1e5)];}});var InjectRepository_1=require(a9_0x17b4c8(0x1df));Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1e7),{'enumerable':!![],'get':function(){var _0x529ac0=a9_0x17b4c8;return InjectRepository_1[_0x529ac0(0x1e7)];}});var ProvideEntity_1=require('./decorator/ProvideEntity');Object['defineProperty'](exports,a9_0x17b4c8(0x1d8),{'enumerable':!![],'get':function(){var _0x4053ff=a9_0x17b4c8;return ProvideEntity_1[_0x4053ff(0x1d8)];}});var ProvideRepository_1=require(a9_0x17b4c8(0x1ce));Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1ec),{'enumerable':!![],'get':function(){var _0xd5df04=a9_0x17b4c8;return ProvideRepository_1[_0xd5df04(0x1ec)];}});var ProvideSearch_1=require(a9_0x17b4c8(0x1d0));Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1de),{'enumerable':!![],'get':function(){var _0x2db6ac=a9_0x17b4c8;return ProvideSearch_1[_0x2db6ac(0x1de)];}}),Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1d5),{'enumerable':!![],'get':function(){return ProvideSearch_1['Search'];}});var getDataSourceEntity_1=require('./helper/getDataSourceEntity');Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1dd),{'enumerable':!![],'get':function(){var _0x3dc466=a9_0x17b4c8;return getDataSourceEntity_1[_0x3dc466(0x1dd)];}});var configuration_1=require('./configuration');Object[a9_0x17b4c8(0x1dc)](exports,'Configuration',{'enumerable':!![],'get':function(){var _0xe0a5fd=a9_0x17b4c8;return configuration_1[_0xe0a5fd(0x1e6)];}});var decorator_1=require(a9_0x17b4c8(0x1f0));Object['defineProperty'](exports,a9_0x17b4c8(0x1cb),{'enumerable':!![],'get':function(){var _0x3c9762=a9_0x17b4c8;return decorator_1[_0x3c9762(0x1cb)];}}),Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1db),{'enumerable':!![],'get':function(){var _0xc78b60=a9_0x17b4c8;return decorator_1[_0xc78b60(0x1db)];}}),Object['defineProperty'](exports,'Scope',{'enumerable':!![],'get':function(){return decorator_1['Scope'];}}),Object[a9_0x17b4c8(0x1dc)](exports,a9_0x17b4c8(0x1cd),{'enumerable':!![],'get':function(){return decorator_1['ScopeEnum'];}});
|
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';const
|
|
1
|
+
'use strict';const a10_0x2efb3c=a10_0xd62e;(function(_0x28a345,_0x3c6546){const _0xc02549=a10_0xd62e,_0x5eaa49=_0x28a345();while(!![]){try{const _0x19a659=-parseInt(_0xc02549(0x1f8))/0x1*(parseInt(_0xc02549(0x1ef))/0x2)+parseInt(_0xc02549(0x1ec))/0x3*(-parseInt(_0xc02549(0x201))/0x4)+parseInt(_0xc02549(0x1f5))/0x5+-parseInt(_0xc02549(0x1f4))/0x6+parseInt(_0xc02549(0x204))/0x7*(parseInt(_0xc02549(0x203))/0x8)+parseInt(_0xc02549(0x1fc))/0x9+parseInt(_0xc02549(0x1f7))/0xa;if(_0x19a659===_0x3c6546)break;else _0x5eaa49['push'](_0x5eaa49['shift']());}catch(_0x583b92){_0x5eaa49['push'](_0x5eaa49['shift']());}}}(a10_0x5047,0x4cf43));Object[a10_0x2efb3c(0x205)](exports,'__esModule',{'value':!![]}),exports[a10_0x2efb3c(0x1fb)]=exports[a10_0x2efb3c(0x1fa)]=exports[a10_0x2efb3c(0x1f3)]=exports[a10_0x2efb3c(0x1f0)]=exports[a10_0x2efb3c(0x207)]=exports[a10_0x2efb3c(0x1f6)]=exports['ENTIFY_MODULE']=exports[a10_0x2efb3c(0x202)]=void 0x0;function a10_0xd62e(_0x30a75a,_0x2a9009){const _0x504784=a10_0x5047();return a10_0xd62e=function(_0xd62e2b,_0x294feb){_0xd62e2b=_0xd62e2b-0x1eb;let _0x49c265=_0x504784[_0xd62e2b];return _0x49c265;},a10_0xd62e(_0x30a75a,_0x2a9009);}const typeorm_1=require('typeorm');exports[a10_0x2efb3c(0x202)]=a10_0x2efb3c(0x208),exports[a10_0x2efb3c(0x200)]=a10_0x2efb3c(0x1f2),exports[a10_0x2efb3c(0x1f6)]=a10_0x2efb3c(0x1eb),exports[a10_0x2efb3c(0x207)]=a10_0x2efb3c(0x1ff),exports['MODEL_KEY']='decorator:anncic-api:typeorm:model',exports[a10_0x2efb3c(0x1f3)]='decorator:anncic-api:typeorm:model:search',exports[a10_0x2efb3c(0x1fa)]=a10_0x2efb3c(0x1f9);class SearchPaginate{}exports['SearchPaginate']=SearchPaginate,typeorm_1[a10_0x2efb3c(0x1ee)]['prototype']['findOneOrFail']=async function(_0x426e72,_0x1a60f0){const _0x1d8117=a10_0x2efb3c;return this[_0x1d8117(0x1ed)](_0x426e72,_0x1a60f0)[_0x1d8117(0x1fd)](_0x2c1d43=>{const _0x823f93=_0x1d8117;if(_0x2c1d43===null||_0x2c1d43===undefined)return Promise[_0x823f93(0x1f1)](new typeorm_1['EntityNotFoundError'](_0x426e72,_0x1a60f0));return Promise[_0x823f93(0x1fe)](_0x2c1d43);});},typeorm_1[a10_0x2efb3c(0x1ee)]['prototype'][a10_0x2efb3c(0x209)]=async function(_0x129610,_0x119e0f){const _0x2e8dd0=a10_0x2efb3c;return this[_0x2e8dd0(0x206)](_0x129610,_0x119e0f)['then'](_0x5f4574=>{const _0x3e38fa=_0x2e8dd0;if(_0x5f4574===null||_0x5f4574===undefined)return Promise[_0x3e38fa(0x1f1)](new typeorm_1['EntityNotFoundError'](_0x129610,_0x119e0f));return Promise[_0x3e38fa(0x1fe)](_0x5f4574);});};function a10_0x5047(){const _0x2c8016=['566968QpOEAJ','ENTIFY_KEY','1016hfEjkx','33362PBTWvE','defineProperty','findOneBy','REPOSITORY_KEY','decorator:anncic-api:typeorm:entify','findOneByOrFail','decorator:anncic-api:typeorm:entify:module:source','3hWettM','findOne','EntityManager','23846voCdzG','MODEL_KEY','reject','decorator:anncic-api:typeorm:entify:module','MODEL_SEARCH_KEY','3092172LIIQtc','1193235IQDAzV','ENTIFY_MODULE_SOURCE','1647240xjPbNM','25Mjdlja','decorator:anncic-api:typeorm:entity:virtual:column','ENTITY_VIRTUAL_COLUMN_KEY','SearchPaginate','2355561RbjJHp','then','resolve','decorator:anncic-api:typeorm:repository','ENTIFY_MODULE'];a10_0x5047=function(){return _0x2c8016;};return a10_0x5047();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anncic-api/typeorm",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"javascript-obfuscator": "2.19.0",
|
|
23
23
|
"typescript": "^4.7.4"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "1ff379ce4e785376983b20bd452defb97c4a3fa9"
|
|
26
26
|
}
|