@anncic-api/validator 3.3.3 → 3.3.5
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/config/config.default.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/decorator/Rule.js +1 -1
- package/dist/decorator/Validator.js +1 -1
- package/dist/exception/ValidatorError.js +1 -1
- package/dist/helper/dtoHelper.d.ts +3 -3
- package/dist/helper/dtoHelper.js +1 -1
- package/dist/helper/getSchema.d.ts +2 -0
- package/dist/helper/getSchema.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/interface.js +1 -1
- package/dist/service/ValidatorService.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a0_0x2263(_0x44d3c3,_0x57ff30){const _0xb03897=a0_0x2e75();return a0_0x2263=function(_0x43be54,_0x5aa3a0){_0x43be54=_0x43be54-0x147;let _0x2e75f5=_0xb03897[_0x43be54];return _0x2e75f5;},a0_0x2263(_0x44d3c3,_0x57ff30);}const a0_0x1a52ba=a0_0x2263;(function(_0x4055a3,_0x3e1f8a){const _0x2ae023=a0_0x2263,_0x46e3f8=_0x4055a3();while(!![]){try{const _0x457f6e=-parseInt(_0x2ae023(0x15a))/0x1*(-parseInt(_0x2ae023(0x151))/0x2)+-parseInt(_0x2ae023(0x14f))/0x3*(parseInt(_0x2ae023(0x153))/0x4)+-parseInt(_0x2ae023(0x14b))/0x5+-parseInt(_0x2ae023(0x14c))/0x6*(parseInt(_0x2ae023(0x155))/0x7)+parseInt(_0x2ae023(0x149))/0x8+parseInt(_0x2ae023(0x157))/0x9*(-parseInt(_0x2ae023(0x154))/0xa)+parseInt(_0x2ae023(0x156))/0xb*(parseInt(_0x2ae023(0x150))/0xc);if(_0x457f6e===_0x3e1f8a)break;else _0x46e3f8['push'](_0x46e3f8['shift']());}catch(_0x13751a){_0x46e3f8['push'](_0x46e3f8['shift']());}}}(a0_0x2e75,0x9d516));const a0_0x5aa3a0=(function(){let _0x45636d=!![];return function(_0x24e4bf,_0x403f1e){const _0x3b4607=_0x45636d?function(){const _0x2106e2=a0_0x2263;if(_0x403f1e){const _0x341d90=_0x403f1e[_0x2106e2(0x159)](_0x24e4bf,arguments);return _0x403f1e=null,_0x341d90;}}:function(){};return _0x45636d=![],_0x3b4607;};}()),a0_0x43be54=a0_0x5aa3a0(this,function(){const _0x3cf11d=a0_0x2263;return a0_0x43be54[_0x3cf11d(0x14e)]()[_0x3cf11d(0x15b)]('(((.+)+)+)+$')[_0x3cf11d(0x14e)]()[_0x3cf11d(0x148)](a0_0x43be54)[_0x3cf11d(0x15b)](_0x3cf11d(0x15c));});function a0_0x2e75(){const _0xde758=['497464AtOIli','ValidatorError','9772rLOJXQ','401290TehFHH','1771QfdyXH','8096RLaEig','279WniMvm','../../locales/zh_CN.json','apply','2DfrCtR','search','(((.+)+)+)+$','default','constructor','4144720PPkXGA','../../locales/en_US.json','4775005BWuGtP','12486kUQiZp','defineProperty','toString','1167WyOgqC','53880dOcltQ'];a0_0x2e75=function(){return _0xde758;};return a0_0x2e75();}a0_0x43be54();'use strict';Object[a0_0x1a52ba(0x14d)](exports,'__esModule',{'value':!![]});const ValidatorError_1=require('../exception/ValidatorError');exports[a0_0x1a52ba(0x147)]={'validator':{'errorStatus':ValidatorError_1[a0_0x1a52ba(0x152)]['PARAMS'],'validationOptions':{'allowUnknown':!![],'stripUnknown':!![],'dateFormat':'string'}},'i18n':{'localeTable':{'en_US':{'validator':require(a0_0x1a52ba(0x14a))},'zh_CN':{'validator':require(a0_0x1a52ba(0x158))}}}};
|
package/dist/configuration.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a1_0x89ab91=a1_0x49de;(function(_0x95bd66,_0x1b0363){const _0x449018=a1_0x49de,_0x3e37c3=_0x95bd66();while(!![]){try{const _0x542037=parseInt(_0x449018(0x19c))/0x1*(parseInt(_0x449018(0x19d))/0x2)+-parseInt(_0x449018(0x194))/0x3*(parseInt(_0x449018(0x17b))/0x4)+-parseInt(_0x449018(0x17a))/0x5+-parseInt(_0x449018(0x16e))/0x6+parseInt(_0x449018(0x171))/0x7*(-parseInt(_0x449018(0x173))/0x8)+-parseInt(_0x449018(0x192))/0x9*(parseInt(_0x449018(0x188))/0xa)+parseInt(_0x449018(0x189))/0xb;if(_0x542037===_0x1b0363)break;else _0x3e37c3['push'](_0x3e37c3['shift']());}catch(_0x2f075c){_0x3e37c3['push'](_0x3e37c3['shift']());}}}(a1_0x332a,0xa50c8));const a1_0x566649=(function(){let _0x44dea0=!![];return function(_0x356f36,_0xa40d21){const _0x11a6b0=_0x44dea0?function(){if(_0xa40d21){const _0x552762=_0xa40d21['apply'](_0x356f36,arguments);return _0xa40d21=null,_0x552762;}}:function(){};return _0x44dea0=![],_0x11a6b0;};}()),a1_0x563a34=a1_0x566649(this,function(){const _0x439069=a1_0x49de;return a1_0x563a34[_0x439069(0x18d)]()[_0x439069(0x177)](_0x439069(0x195))[_0x439069(0x18d)]()['constructor'](a1_0x563a34)[_0x439069(0x177)]('(((.+)+)+)+$');});a1_0x563a34();'use strict';var __decorate=this&&this[a1_0x89ab91(0x16a)]||function(_0x297041,_0xf37a45,_0x32dd5a,_0x276ca3){const _0x4efb91=a1_0x89ab91;var _0x18d315=arguments[_0x4efb91(0x176)],_0x343052=_0x18d315<0x3?_0xf37a45:_0x276ca3===null?_0x276ca3=Object['getOwnPropertyDescriptor'](_0xf37a45,_0x32dd5a):_0x276ca3,_0x13cf50;if(typeof Reflect===_0x4efb91(0x18a)&&typeof Reflect[_0x4efb91(0x167)]==='function')_0x343052=Reflect[_0x4efb91(0x167)](_0x297041,_0xf37a45,_0x32dd5a,_0x276ca3);else{for(var _0xd794bb=_0x297041[_0x4efb91(0x176)]-0x1;_0xd794bb>=0x0;_0xd794bb--)if(_0x13cf50=_0x297041[_0xd794bb])_0x343052=(_0x18d315<0x3?_0x13cf50(_0x343052):_0x18d315>0x3?_0x13cf50(_0xf37a45,_0x32dd5a,_0x343052):_0x13cf50(_0xf37a45,_0x32dd5a))||_0x343052;}return _0x18d315>0x3&&_0x343052&&Object[_0x4efb91(0x199)](_0xf37a45,_0x32dd5a,_0x343052),_0x343052;},__metadata=this&&this[a1_0x89ab91(0x18f)]||function(_0x16570c,_0x5ccb11){const _0x16df87=a1_0x89ab91;if(typeof Reflect===_0x16df87(0x18a)&&typeof Reflect['metadata']==='function')return Reflect[_0x16df87(0x172)](_0x16570c,_0x5ccb11);};function a1_0x49de(_0x938622,_0x3dcba8){const _0x3702fb=a1_0x332a();return a1_0x49de=function(_0x563a34,_0x566649){_0x563a34=_0x563a34-0x164;let _0x332ab4=_0x3702fb[_0x563a34];return _0x332ab4;},a1_0x49de(_0x938622,_0x3dcba8);}function a1_0x332a(){const _0x33fccd=['16919WSborZ','metadata','696WENzCJ','params','CustomConfiguration','length','search','methodArgs','body','6534315VPDujL','72ngwgBD','./interface','propertyName','ValidatorService','design:type','undefined','splice','req','Configuration','getAttr','bound\x20dispatch','locale','Inject','30VflKdx','20843163yZlCNF','object','assign','./service/ValidatorService','toString','methodName','__metadata','@anncic-api/core','getClassMetadata','266886BjcxRt','param','25167hTZlLN','(((.+)+)+)+$','@midwayjs/i18n','find','decorator','defineProperty','res','onReady','98519vxHUbG','22IqPnkK','prototype','target','./config/config.default','anncic-api:validator','validator','decorate','getSchema','registerMethodHandler','__decorate','I18N_ATTR_KEY','function','VALIDATOR_KEY','3272376uaFPGx','request','args'];a1_0x332a=function(){return _0x33fccd;};return a1_0x332a();}Object[a1_0x89ab91(0x199)](exports,'__esModule',{'value':!![]}),exports[a1_0x89ab91(0x175)]=void 0x0;const i18n_1=require(a1_0x89ab91(0x196)),core_1=require('@midwayjs/core'),core_2=require('@midwayjs/core'),interface_1=require(a1_0x89ab91(0x17c)),ValidatorService_1=require(a1_0x89ab91(0x18c)),i18n=require('@midwayjs/i18n'),anncic=require(a1_0x89ab91(0x190)),ConfigDefault=require(a1_0x89ab91(0x164));let CustomConfiguration=exports['CustomConfiguration']=class CustomConfiguration{async[a1_0x89ab91(0x19b)](){const _0x157ddc=a1_0x89ab91;this['decorator'][_0x157ddc(0x169)](interface_1[_0x157ddc(0x16d)],_0x5eb915=>{const _0x181542=_0x157ddc,_0x1eecc1=_0x5eb915['metadata'],_0x528e55=(0x0,core_2['getMethodParamTypes'])(_0x5eb915[_0x181542(0x19f)],_0x5eb915[_0x181542(0x17d)]);return{'before':_0x3eac54=>{const _0x1eb7d0=_0x181542;var _0x537993,_0x2c8a09,_0x36502f,_0x3fc4a0,_0x5580e3,_0x2f39c7,_0x44679f,_0x4f9b40,_0x5c37d3,_0x4a1e2d,_0x452783,_0x257ab3,_0x2112f7;const _0x19bf70=_0x3eac54[_0x1eb7d0(0x19f)][core_1['REQUEST_OBJ_CTX_KEY']],_0x5600cb=Object[_0x1eb7d0(0x18b)]({},((_0x537993=_0x19bf70===null||_0x19bf70===void 0x0?void 0x0:_0x19bf70['request'])===null||_0x537993===void 0x0?void 0x0:_0x537993['query'])||{},((_0x2c8a09=_0x19bf70===null||_0x19bf70===void 0x0?void 0x0:_0x19bf70['request'])===null||_0x2c8a09===void 0x0?void 0x0:_0x2c8a09[_0x1eb7d0(0x179)])||{}),_0x47f1bb=((0x0,core_2[_0x1eb7d0(0x191)])(interface_1[_0x1eb7d0(0x16d)],_0x3eac54['target'])||[])[_0x1eb7d0(0x197)](_0x9c3611=>_0x9c3611['method']==_0x3eac54[_0x1eb7d0(0x18e)]);!(_0x1eecc1===null||_0x1eecc1===void 0x0?void 0x0:_0x1eecc1[_0x1eb7d0(0x186)])&&_0x19bf70&&_0x19bf70[_0x1eb7d0(0x184)]&&(_0x1eecc1[_0x1eb7d0(0x186)]=_0x19bf70['getAttr'](i18n_1[_0x1eb7d0(0x16b)]));for(let _0x461fa4=0x0;_0x461fa4<_0x528e55[_0x1eb7d0(0x176)];_0x461fa4++){const _0x4c6384=_0x528e55[_0x461fa4],_0xc3231a=this[_0x1eb7d0(0x17e)][_0x1eb7d0(0x168)](_0x4c6384);if(_0xc3231a){if(typeof _0x3eac54[_0x1eb7d0(0x170)][_0x461fa4]==_0x1eb7d0(0x180)||((_0x36502f=_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4])===null||_0x36502f===void 0x0?void 0x0:_0x36502f[_0x1eb7d0(0x16f)])&&((_0x3fc4a0=_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4])===null||_0x3fc4a0===void 0x0?void 0x0:_0x3fc4a0[_0x1eb7d0(0x19a)])&&((_0x5580e3=_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4])===null||_0x5580e3===void 0x0?void 0x0:_0x5580e3[_0x1eb7d0(0x182)]))_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4]=_0x5600cb;else((_0x2f39c7=_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4])===null||_0x2f39c7===void 0x0?void 0x0:_0x2f39c7['name'])==_0x1eb7d0(0x185)&&_0x3eac54[_0x1eb7d0(0x170)][_0x1eb7d0(0x181)](_0x461fa4,0x0,_0x5600cb);const _0x42f13e=this[_0x1eb7d0(0x17e)][_0x1eb7d0(0x166)](_0xc3231a,_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4],_0x1eecc1);_0x42f13e&&(_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4]=_0x42f13e);}else{if((_0x47f1bb===null||_0x47f1bb===void 0x0?void 0x0:_0x47f1bb['methodArgs'][_0x461fa4])&&((_0x44679f=_0x3eac54['args'][_0x461fa4])===null||_0x44679f===void 0x0?void 0x0:_0x44679f['params'])&&typeof _0x3eac54[_0x1eb7d0(0x170)][_0x461fa4][_0x1eb7d0(0x193)]==_0x1eb7d0(0x16c)&&((_0x4f9b40=_0x19bf70===null||_0x19bf70===void 0x0?void 0x0:_0x19bf70[_0x1eb7d0(0x174)])===null||_0x4f9b40===void 0x0?void 0x0:_0x4f9b40[_0x47f1bb[_0x1eb7d0(0x178)][_0x461fa4]]))_0x3eac54['args'][_0x461fa4]=_0x4c6384((_0x5c37d3=_0x19bf70===null||_0x19bf70===void 0x0?void 0x0:_0x19bf70[_0x1eb7d0(0x174)])===null||_0x5c37d3===void 0x0?void 0x0:_0x5c37d3[_0x47f1bb[_0x1eb7d0(0x178)][_0x461fa4]]);else(_0x47f1bb===null||_0x47f1bb===void 0x0?void 0x0:_0x47f1bb[_0x1eb7d0(0x178)][_0x461fa4])&&((_0x452783=(_0x4a1e2d=_0x3eac54['args'][_0x461fa4])===null||_0x4a1e2d===void 0x0?void 0x0:_0x4a1e2d[_0x1eb7d0(0x174)])===null||_0x452783===void 0x0?void 0x0:_0x452783[_0x47f1bb[_0x1eb7d0(0x178)][_0x461fa4]])&&(_0x3eac54['args'][_0x461fa4]=(_0x2112f7=(_0x257ab3=_0x3eac54[_0x1eb7d0(0x170)][_0x461fa4])===null||_0x257ab3===void 0x0?void 0x0:_0x257ab3[_0x1eb7d0(0x174)])===null||_0x2112f7===void 0x0?void 0x0:_0x2112f7[_0x47f1bb[_0x1eb7d0(0x178)][_0x461fa4]]);}}},'afterThrow':(_0x3dbd78,_0x37f94c)=>{throw _0x37f94c;}};});}};__decorate([(0x0,core_2['Inject'])(),__metadata(a1_0x89ab91(0x17f),core_1['MidwayDecoratorService'])],CustomConfiguration['prototype'],a1_0x89ab91(0x198),void 0x0),__decorate([(0x0,core_2[a1_0x89ab91(0x187)])(),__metadata('design:type',ValidatorService_1['ValidatorService'])],CustomConfiguration[a1_0x89ab91(0x19e)],a1_0x89ab91(0x17e),void 0x0),exports[a1_0x89ab91(0x175)]=CustomConfiguration=__decorate([(0x0,core_2[a1_0x89ab91(0x183)])({'conflictCheck':![],'imports':[i18n,anncic],'namespace':a1_0x89ab91(0x165),'importConfigs':[{'default':ConfigDefault}]})],CustomConfiguration);
|
package/dist/decorator/Rule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a2_0x207b16=a2_0x4e25;(function(_0x1e4709,_0x406c3e){const _0x1c5e69=a2_0x4e25,_0x4164f2=_0x1e4709();while(!![]){try{const _0x488c4a=-parseInt(_0x1c5e69(0x1c5))/0x1*(parseInt(_0x1c5e69(0x1b7))/0x2)+-parseInt(_0x1c5e69(0x1bc))/0x3*(-parseInt(_0x1c5e69(0x1c2))/0x4)+parseInt(_0x1c5e69(0x1b4))/0x5*(-parseInt(_0x1c5e69(0x1b8))/0x6)+parseInt(_0x1c5e69(0x1cf))/0x7*(parseInt(_0x1c5e69(0x1c7))/0x8)+parseInt(_0x1c5e69(0x1bd))/0x9+parseInt(_0x1c5e69(0x1b3))/0xa+parseInt(_0x1c5e69(0x1ca))/0xb*(-parseInt(_0x1c5e69(0x1ce))/0xc);if(_0x488c4a===_0x406c3e)break;else _0x4164f2['push'](_0x4164f2['shift']());}catch(_0x4eaeba){_0x4164f2['push'](_0x4164f2['shift']());}}}(a2_0x4f73,0x9aabc));const a2_0x4661d3=(function(){let _0x24505d=!![];return function(_0x40c23d,_0x2aa5c7){const _0x6f0c0b=_0x24505d?function(){const _0x2b9d3b=a2_0x4e25;if(_0x2aa5c7){const _0x323e46=_0x2aa5c7[_0x2b9d3b(0x1c6)](_0x40c23d,arguments);return _0x2aa5c7=null,_0x323e46;}}:function(){};return _0x24505d=![],_0x6f0c0b;};}()),a2_0x14f32c=a2_0x4661d3(this,function(){const _0xf98a2e=a2_0x4e25;return a2_0x14f32c['toString']()[_0xf98a2e(0x1b9)](_0xf98a2e(0x1ae))[_0xf98a2e(0x1c9)]()[_0xf98a2e(0x1c8)](a2_0x14f32c)['search'](_0xf98a2e(0x1ae));});a2_0x14f32c();'use strict';Object[a2_0x207b16(0x1b1)](exports,a2_0x207b16(0x1b2),{'value':!![]}),exports['Rule']=exports[a2_0x207b16(0x1c3)]=void 0x0;const joi=require(a2_0x207b16(0x1c1)),date_1=require(a2_0x207b16(0x1c0)),core_1=require(a2_0x207b16(0x1b5)),interface_1=require(a2_0x207b16(0x1af));exports['RuleType']=joi[a2_0x207b16(0x1bb)](date_1[a2_0x207b16(0x1ba)]);function Rule(_0x513245,_0x45843e,_0x32db10=''){return(_0x47fbb5,_0x51350b)=>{const _0x2c2f0e=a2_0x4e25;var _0x1785af;if(_0x51350b)!joi['isSchema'](_0x45843e)&&(_0x45843e===null||_0x45843e===void 0x0?void 0x0:_0x45843e[_0x2c2f0e(0x1be)])&&(_0x45843e=joi[_0x2c2f0e(0x1ad)]((0x0,core_1[_0x2c2f0e(0x1b6)])(interface_1['RULES_KEY'],_0x45843e))['meta']({'id':_0x45843e[_0x2c2f0e(0x1be)]}),(0x0,core_1['getPropertyType'])(_0x47fbb5,_0x51350b)[_0x2c2f0e(0x1be)]==='Array'&&(_0x45843e=joi['array']()[_0x2c2f0e(0x1c4)](_0x45843e))),joi['isSchema'](_0x45843e)&&(_0x513245&&typeof(_0x45843e===null||_0x45843e===void 0x0?void 0x0:_0x45843e['label'])==_0x2c2f0e(0x1cb)&&(_0x45843e=_0x45843e['label'](_0x513245)),_0x32db10&&typeof(_0x45843e===null||_0x45843e===void 0x0?void 0x0:_0x45843e[_0x2c2f0e(0x1cd)])=='function'&&(_0x45843e=_0x45843e['description'](_0x32db10)),(0x0,core_1['attachClassMetadata'])(interface_1['RULES_KEY'],_0x45843e,_0x47fbb5,_0x51350b));else{const _0x481ff1=(0x0,core_1['getClassMetadata'])(interface_1[_0x2c2f0e(0x1cc)],_0x45843e);if(_0x481ff1){let _0x4ac747=(_0x1785af=(0x0,core_1[_0x2c2f0e(0x1b6)])(interface_1[_0x2c2f0e(0x1cc)],_0x47fbb5))!==null&&_0x1785af!==void 0x0?_0x1785af:{};Object[_0x2c2f0e(0x1bf)](_0x481ff1)['map'](_0x2bf37b=>{!_0x4ac747[_0x2bf37b]&&(_0x4ac747[_0x2bf37b]=_0x481ff1[_0x2bf37b]);}),(0x0,core_1['saveClassMetadata'])(interface_1[_0x2c2f0e(0x1cc)],_0x4ac747,_0x47fbb5);}}};}function a2_0x4e25(_0x1b104d,_0x12e544){const _0x5d191b=a2_0x4f73();return a2_0x4e25=function(_0x14f32c,_0x4661d3){_0x14f32c=_0x14f32c-0x1ad;let _0x4f733d=_0x5d191b[_0x14f32c];return _0x4f733d;},a2_0x4e25(_0x1b104d,_0x12e544);}exports[a2_0x207b16(0x1b0)]=Rule;function a2_0x4f73(){const _0x29f92b=['2547kMTdjm','5625621BjcEyY','name','keys','@joi/date','joi','492sttWMS','RuleType','items','1xIrOBQ','apply','24iPtwRp','constructor','toString','12529bZuybq','function','RULES_KEY','description','10212WxETls','2641772TtBsct','object','(((.+)+)+)+$','../interface','Rule','defineProperty','__esModule','6904160wTAEzi','800wdPzPT','@midwayjs/core','getClassMetadata','1571518BQJBXN','6132GClOqJ','search','default','extend'];a2_0x4f73=function(){return _0x29f92b;};return a2_0x4f73();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x1fad47=a3_0x2a50;function a3_0x2a50(_0x483e96,_0x7c417d){const _0x221be3=a3_0x4bdd();return a3_0x2a50=function(_0x2717ad,_0x568d4f){_0x2717ad=_0x2717ad-0x193;let _0x4bdda0=_0x221be3[_0x2717ad];return _0x4bdda0;},a3_0x2a50(_0x483e96,_0x7c417d);}(function(_0x7c19af,_0x281b47){const _0x75f65=a3_0x2a50,_0x30793f=_0x7c19af();while(!![]){try{const _0x3c9d81=-parseInt(_0x75f65(0x1a6))/0x1*(-parseInt(_0x75f65(0x1a5))/0x2)+parseInt(_0x75f65(0x195))/0x3*(parseInt(_0x75f65(0x19d))/0x4)+parseInt(_0x75f65(0x19c))/0x5*(-parseInt(_0x75f65(0x19b))/0x6)+-parseInt(_0x75f65(0x1a3))/0x7*(-parseInt(_0x75f65(0x19e))/0x8)+-parseInt(_0x75f65(0x194))/0x9*(parseInt(_0x75f65(0x1a4))/0xa)+parseInt(_0x75f65(0x1a2))/0xb+-parseInt(_0x75f65(0x1a8))/0xc;if(_0x3c9d81===_0x281b47)break;else _0x30793f['push'](_0x30793f['shift']());}catch(_0x5929d0){_0x30793f['push'](_0x30793f['shift']());}}}(a3_0x4bdd,0xa6c7c));const a3_0x568d4f=(function(){let _0x29e144=!![];return function(_0x2bd134,_0x478bd8){const _0x2468d7=_0x29e144?function(){if(_0x478bd8){const _0x1bbea6=_0x478bd8['apply'](_0x2bd134,arguments);return _0x478bd8=null,_0x1bbea6;}}:function(){};return _0x29e144=![],_0x2468d7;};}()),a3_0x2717ad=a3_0x568d4f(this,function(){const _0x2be49f=a3_0x2a50;return a3_0x2717ad['toString']()[_0x2be49f(0x1ac)](_0x2be49f(0x1a7))[_0x2be49f(0x197)]()['constructor'](a3_0x2717ad)[_0x2be49f(0x1ac)](_0x2be49f(0x1a7));});function a3_0x4bdd(){const _0x6ee81e=['30KvNNEi','5956LFwLjg','366PxQrPZ','(((.+)+)+)+$','11912988lkeBTn','indexOf','__esModule','VALIDATOR_KEY','search','prototype','1836963rgPzzR','1635HaYquG','../interface','toString','defineProperty','function','slice','1494hFZIjC','14410icVSMw','5120CQLhZU','3541544Plfrzx','getFuncArgs','replace','constructor','3661746iPwZKw','14YxmOQz'];a3_0x4bdd=function(){return _0x6ee81e;};return a3_0x4bdd();}a3_0x2717ad();'use strict';Object[a3_0x1fad47(0x198)](exports,a3_0x1fad47(0x1aa),{'value':!![]}),exports[a3_0x1fad47(0x19f)]=exports['Validator']=void 0x0;const core_1=require('@midwayjs/core'),interface_1=require(a3_0x1fad47(0x196));function Validator(_0x1376ee={}){return(_0xcb5aee,_0x316427,_0x509e08)=>{const _0x1b7e6b=a3_0x2a50,_0x5db032=getFuncArgs(_0xcb5aee[_0x316427]);(0x0,core_1['attachClassMetadata'])(interface_1[_0x1b7e6b(0x1ab)],{'method':_0x316427,'methodArgs':_0x5db032},_0xcb5aee),(0x0,core_1['createCustomMethodDecorator'])(interface_1[_0x1b7e6b(0x1ab)],_0x1376ee)(_0xcb5aee,_0x316427,_0x509e08);};}exports['Validator']=Validator;function getFuncArgs(_0x2c30b5){const _0x27cfa7=a3_0x1fad47;if(typeof _0x2c30b5==_0x27cfa7(0x199)){const _0x329f8f=/=>.*$/mg,_0x35fed7=/=[^,)]+/mg,_0x2b9dc2=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,_0x414a82=(_0x2c30b5[_0x27cfa7(0x193)]?_0x2c30b5[_0x27cfa7(0x193)][_0x27cfa7(0x1a1)][_0x27cfa7(0x197)]():_0x2c30b5[_0x27cfa7(0x197)]())[_0x27cfa7(0x1a0)](_0x2b9dc2,'')['replace'](_0x329f8f,'')['replace'](_0x35fed7,''),_0x277922=_0x414a82[_0x27cfa7(0x19a)](_0x414a82['indexOf']('(')+0x1,_0x414a82[_0x27cfa7(0x1a9)](')'))['match'](/([^\s,]+)/g)||[];return _0x277922;}}exports['getFuncArgs']=getFuncArgs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a4_0x2a097c=a4_0xf884;(function(_0x44092e,_0x337614){var _0xae259e=a4_0xf884,_0x504ada=_0x44092e();while(!![]){try{var _0x2ec96d=parseInt(_0xae259e(0x135))/0x1+-parseInt(_0xae259e(0x148))/0x2*(parseInt(_0xae259e(0x141))/0x3)+parseInt(_0xae259e(0x143))/0x4+parseInt(_0xae259e(0x133))/0x5*(parseInt(_0xae259e(0x145))/0x6)+parseInt(_0xae259e(0x13e))/0x7+-parseInt(_0xae259e(0x13a))/0x8*(-parseInt(_0xae259e(0x147))/0x9)+-parseInt(_0xae259e(0x146))/0xa;if(_0x2ec96d===_0x337614)break;else _0x504ada['push'](_0x504ada['shift']());}catch(_0x192681){_0x504ada['push'](_0x504ada['shift']());}}}(a4_0x2f2b,0xa30d6));function a4_0x2f2b(){var _0x52d1b5=['NOFIND_SCHEMA','5dGXQho','design:type','984813BZzCyb','ValidatorError','getOwnPropertyDescriptor','AnnErrorMsg','toString','8321816qqBByS','defineProperty','constructor','@anncic-api/core','3509940RSxkLC','__decorate','__metadata','408zcEyzH','PARAMS','4715244csQirf','decorate','6796848GXStWv','30830330RtajKp','9VobYvL','15988IbZEwh','参数验证失败','search','(((.+)+)+)+$','function','object','length','metadata'];a4_0x2f2b=function(){return _0x52d1b5;};return a4_0x2f2b();}var a4_0xc1c204=(function(){var _0x425c26=!![];return function(_0x4ac8b6,_0x89697d){var _0x34b57f=_0x425c26?function(){if(_0x89697d){var _0x116d10=_0x89697d['apply'](_0x4ac8b6,arguments);return _0x89697d=null,_0x116d10;}}:function(){};return _0x425c26=![],_0x34b57f;};}()),a4_0x498c04=a4_0xc1c204(this,function(){var _0x1a8f1f=a4_0xf884;return a4_0x498c04[_0x1a8f1f(0x139)]()[_0x1a8f1f(0x14a)](_0x1a8f1f(0x14b))[_0x1a8f1f(0x139)]()[_0x1a8f1f(0x13c)](a4_0x498c04)['search'](_0x1a8f1f(0x14b));});a4_0x498c04();'use strict';function a4_0xf884(_0x21d7bc,_0x6a50cf){var _0xe5a405=a4_0x2f2b();return a4_0xf884=function(_0x498c04,_0xc1c204){_0x498c04=_0x498c04-0x12e;var _0x2f2bbe=_0xe5a405[_0x498c04];return _0x2f2bbe;},a4_0xf884(_0x21d7bc,_0x6a50cf);}var __decorate=this&&this[a4_0x2a097c(0x13f)]||function(_0x32ab92,_0x53a723,_0x13f3be,_0xae852c){var _0x277387=a4_0x2a097c,_0x19640a=arguments[_0x277387(0x130)],_0x366b8a=_0x19640a<0x3?_0x53a723:_0xae852c===null?_0xae852c=Object[_0x277387(0x137)](_0x53a723,_0x13f3be):_0xae852c,_0x13ab33;if(typeof Reflect==='object'&&typeof Reflect[_0x277387(0x144)]===_0x277387(0x12e))_0x366b8a=Reflect['decorate'](_0x32ab92,_0x53a723,_0x13f3be,_0xae852c);else{for(var _0x2f6844=_0x32ab92['length']-0x1;_0x2f6844>=0x0;_0x2f6844--)if(_0x13ab33=_0x32ab92[_0x2f6844])_0x366b8a=(_0x19640a<0x3?_0x13ab33(_0x366b8a):_0x19640a>0x3?_0x13ab33(_0x53a723,_0x13f3be,_0x366b8a):_0x13ab33(_0x53a723,_0x13f3be))||_0x366b8a;}return _0x19640a>0x3&&_0x366b8a&&Object['defineProperty'](_0x53a723,_0x13f3be,_0x366b8a),_0x366b8a;},__metadata=this&&this[a4_0x2a097c(0x140)]||function(_0x4d0b22,_0x4540fe){var _0x13340a=a4_0x2a097c;if(typeof Reflect===_0x13340a(0x12f)&&typeof Reflect[_0x13340a(0x131)]===_0x13340a(0x12e))return Reflect[_0x13340a(0x131)](_0x4d0b22,_0x4540fe);};Object[a4_0x2a097c(0x13b)](exports,'__esModule',{'value':!![]}),exports[a4_0x2a097c(0x136)]=void 0x0;const core_1=require(a4_0x2a097c(0x13d));class ValidatorError extends AnnError{}exports[a4_0x2a097c(0x136)]=ValidatorError,ValidatorError['PARAMS']=0x18c1e,ValidatorError['NOFIND_SCHEMA']=0x18c1c,__decorate([(0x0,core_1[a4_0x2a097c(0x138)])('参数验证失败'),__metadata(a4_0x2a097c(0x134),Object)],ValidatorError,a4_0x2a097c(0x142),void 0x0),__decorate([(0x0,core_1[a4_0x2a097c(0x138)])(a4_0x2a097c(0x149)),__metadata('design:type',Object)],ValidatorError,a4_0x2a097c(0x132),void 0x0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface Dto<T>
|
|
1
|
+
export interface Dto<T> {
|
|
2
2
|
new (): T;
|
|
3
3
|
}
|
|
4
|
-
export declare function PickDto<T, K extends keyof T>(dto: Dto<T>, keys: K[]): Dto<Pick<T, typeof keys[number]>>;
|
|
5
|
-
export declare function OmitDto<T, K extends keyof T>(dto: Dto<T>, keys: K[]): Dto<Omit<T, typeof keys[number]>>;
|
|
4
|
+
export declare function PickDto<T, K extends keyof T>(dto: Dto<T>, keys: K[]): Dto<Pick<T, (typeof keys)[number]>>;
|
|
5
|
+
export declare function OmitDto<T, K extends keyof T>(dto: Dto<T>, keys: K[]): Dto<Omit<T, (typeof keys)[number]>>;
|
package/dist/helper/dtoHelper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a5_0x2569(){const _0x2bffc2=['assign','5lErTOs','6408060HlZFkY','getClassExtendedMetadata','5122360aYxafs','constructor','3262398eUoExG','(((.+)+)+)+$','OmitDto','@midwayjs/core','__esModule','45GFcyis','prototype','1305315XBLVrl','PickDto','saveClassMetadata','1527206yrSjJq','toString','226093aXJrRP','../interface','RULES_KEY','1566078GcBZDy','128NuqQHI','search'];a5_0x2569=function(){return _0x2bffc2;};return a5_0x2569();}const a5_0x196a2b=a5_0x3e98;(function(_0x5b0317,_0x105410){const _0x14dbda=a5_0x3e98,_0x28c76a=_0x5b0317();while(!![]){try{const _0xd35ad0=parseInt(_0x14dbda(0x175))/0x1+parseInt(_0x14dbda(0x17a))/0x2+parseInt(_0x14dbda(0x18a))/0x3+parseInt(_0x14dbda(0x181))/0x4+-parseInt(_0x14dbda(0x17e))/0x5*(parseInt(_0x14dbda(0x183))/0x6)+parseInt(_0x14dbda(0x177))/0x7*(parseInt(_0x14dbda(0x17b))/0x8)+-parseInt(_0x14dbda(0x188))/0x9*(parseInt(_0x14dbda(0x17f))/0xa);if(_0xd35ad0===_0x105410)break;else _0x28c76a['push'](_0x28c76a['shift']());}catch(_0x1948c5){_0x28c76a['push'](_0x28c76a['shift']());}}}(a5_0x2569,0xc2151));const a5_0x38b103=(function(){let _0x4a7008=!![];return function(_0x4c5367,_0x45c7be){const _0x502143=_0x4a7008?function(){if(_0x45c7be){const _0x4a8e62=_0x45c7be['apply'](_0x4c5367,arguments);return _0x45c7be=null,_0x4a8e62;}}:function(){};return _0x4a7008=![],_0x502143;};}()),a5_0x28e785=a5_0x38b103(this,function(){const _0x1c2622=a5_0x3e98;return a5_0x28e785[_0x1c2622(0x176)]()[_0x1c2622(0x17c)](_0x1c2622(0x184))['toString']()[_0x1c2622(0x182)](a5_0x28e785)[_0x1c2622(0x17c)](_0x1c2622(0x184));});a5_0x28e785();'use strict';Object['defineProperty'](exports,a5_0x196a2b(0x187),{'value':!![]}),exports[a5_0x196a2b(0x185)]=exports[a5_0x196a2b(0x18b)]=void 0x0;const core_1=require(a5_0x196a2b(0x186)),interface_1=require(a5_0x196a2b(0x178));function PickDto(_0x1de263,_0x1cb29a){const _0x5896e7=a5_0x196a2b,_0x58e9c7=function(){};_0x58e9c7[_0x5896e7(0x189)]=_0x1de263[_0x5896e7(0x189)];const _0x3dc330=(0x0,core_1[_0x5896e7(0x180)])(interface_1[_0x5896e7(0x179)],_0x1de263),_0x5e4d7a={};for(const _0x4871fe of _0x1cb29a){_0x3dc330[_0x4871fe]&&(_0x5e4d7a[_0x4871fe]=_0x3dc330[_0x4871fe]);}return(0x0,core_1['saveClassMetadata'])(interface_1[_0x5896e7(0x179)],_0x5e4d7a,_0x58e9c7),_0x58e9c7;}function a5_0x3e98(_0x3be40d,_0x546a2e){const _0x114650=a5_0x2569();return a5_0x3e98=function(_0x28e785,_0x38b103){_0x28e785=_0x28e785-0x175;let _0x256960=_0x114650[_0x28e785];return _0x256960;},a5_0x3e98(_0x3be40d,_0x546a2e);}exports[a5_0x196a2b(0x18b)]=PickDto;function OmitDto(_0x7ea915,_0x33b4b2){const _0xa6aa8b=a5_0x196a2b,_0x4af67f=function(){};_0x4af67f[_0xa6aa8b(0x189)]=_0x7ea915[_0xa6aa8b(0x189)];const _0x40f823=(0x0,core_1[_0xa6aa8b(0x180)])(interface_1['RULES_KEY'],_0x7ea915),_0x349597=Object[_0xa6aa8b(0x17d)]({},_0x40f823);for(const _0x59aece of _0x33b4b2){delete _0x349597[_0x59aece];}return(0x0,core_1[_0xa6aa8b(0x18c)])(interface_1[_0xa6aa8b(0x179)],_0x349597,_0x4af67f),_0x4af67f;}exports['OmitDto']=OmitDto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a6_0x1c8a(_0x15138e,_0x3f14cb){const _0x492ae4=a6_0x33be();return a6_0x1c8a=function(_0x3db41f,_0x672167){_0x3db41f=_0x3db41f-0xbb;let _0x33be3b=_0x492ae4[_0x3db41f];return _0x33be3b;},a6_0x1c8a(_0x15138e,_0x3f14cb);}const a6_0x55369e=a6_0x1c8a;(function(_0x41ed1e,_0x5a9d97){const _0x592d62=a6_0x1c8a,_0x19c0f5=_0x41ed1e();while(!![]){try{const _0x59eb29=-parseInt(_0x592d62(0xbe))/0x1+parseInt(_0x592d62(0xc7))/0x2+-parseInt(_0x592d62(0xce))/0x3*(parseInt(_0x592d62(0xbd))/0x4)+parseInt(_0x592d62(0xc2))/0x5+-parseInt(_0x592d62(0xc1))/0x6*(parseInt(_0x592d62(0xc5))/0x7)+parseInt(_0x592d62(0xcd))/0x8*(-parseInt(_0x592d62(0xbb))/0x9)+-parseInt(_0x592d62(0xca))/0xa*(-parseInt(_0x592d62(0xbc))/0xb);if(_0x59eb29===_0x5a9d97)break;else _0x19c0f5['push'](_0x19c0f5['shift']());}catch(_0x2f4dff){_0x19c0f5['push'](_0x19c0f5['shift']());}}}(a6_0x33be,0xf2de0));function a6_0x33be(){const _0x5a2a8b=['constructor','13210WeujtV','getSchema','(((.+)+)+)+$','8AJKOXw','487821ihrynT','object','11196882cLkQNm','10835LvvsKg','28qOZuKe','219588LHptXH','defineProperty','apply','7020BcnkyB','8661355ZAhmrP','getClassExtendedMetadata','RULES_KEY','7385XHoicY','toString','3595226bIgorC','__esModule'];a6_0x33be=function(){return _0x5a2a8b;};return a6_0x33be();}const a6_0x672167=(function(){let _0x16a202=!![];return function(_0x1c712b,_0x49b9f0){const _0x27c0ce=_0x16a202?function(){const _0x1311ea=a6_0x1c8a;if(_0x49b9f0){const _0x42a825=_0x49b9f0[_0x1311ea(0xc0)](_0x1c712b,arguments);return _0x49b9f0=null,_0x42a825;}}:function(){};return _0x16a202=![],_0x27c0ce;};}()),a6_0x3db41f=a6_0x672167(this,function(){const _0x1ac6f0=a6_0x1c8a;return a6_0x3db41f[_0x1ac6f0(0xc6)]()['search'](_0x1ac6f0(0xcc))[_0x1ac6f0(0xc6)]()[_0x1ac6f0(0xc9)](a6_0x3db41f)['search'](_0x1ac6f0(0xcc));});a6_0x3db41f();'use strict';Object[a6_0x55369e(0xbf)](exports,a6_0x55369e(0xc8),{'value':!![]}),exports['getSchema']=void 0x0;const Joi=require('joi'),core_1=require('@midwayjs/core'),interface_1=require('../interface');function getSchema(_0x55523c){const _0x3b0da4=a6_0x55369e,_0x1d67ec=(0x0,core_1[_0x3b0da4(0xc3)])(interface_1[_0x3b0da4(0xc4)],_0x55523c);if(_0x1d67ec)return Joi[_0x3b0da4(0xcf)](_0x1d67ec);}exports[a6_0x55369e(0xcb)]=getSchema;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./interface";
|
|
2
2
|
export * from './helper/dtoHelper';
|
|
3
|
+
export * from './helper/getSchema';
|
|
3
4
|
export { Validator } from "./decorator/Validator";
|
|
4
5
|
export { Rule, RuleType } from "./decorator/Rule";
|
|
5
6
|
export { ValidatorError } from './exception/ValidatorError';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a7_0x456873=a7_0x1c92;(function(_0x5a5b31,_0x438b65){var _0x46da41=a7_0x1c92,_0x31820e=_0x5a5b31();while(!![]){try{var _0x5e1af0=-parseInt(_0x46da41(0x1f5))/0x1+parseInt(_0x46da41(0x1e6))/0x2*(parseInt(_0x46da41(0x1e4))/0x3)+parseInt(_0x46da41(0x1ed))/0x4+-parseInt(_0x46da41(0x1e9))/0x5*(parseInt(_0x46da41(0x1ea))/0x6)+parseInt(_0x46da41(0x1e5))/0x7+-parseInt(_0x46da41(0x1e0))/0x8*(-parseInt(_0x46da41(0x1f8))/0x9)+-parseInt(_0x46da41(0x1de))/0xa;if(_0x5e1af0===_0x438b65)break;else _0x31820e['push'](_0x31820e['shift']());}catch(_0x1ef9a1){_0x31820e['push'](_0x31820e['shift']());}}}(a7_0x24b9,0xb14bb));var a7_0x3db47c=(function(){var _0x1820f9=!![];return function(_0x4f8fbc,_0x5590a1){var _0x143517=_0x1820f9?function(){if(_0x5590a1){var _0x2e0309=_0x5590a1['apply'](_0x4f8fbc,arguments);return _0x5590a1=null,_0x2e0309;}}:function(){};return _0x1820f9=![],_0x143517;};}()),a7_0x455e52=a7_0x3db47c(this,function(){var _0x6fa1a5=a7_0x1c92;return a7_0x455e52[_0x6fa1a5(0x1eb)]()[_0x6fa1a5(0x1fa)](_0x6fa1a5(0x1ee))['toString']()[_0x6fa1a5(0x1e7)](a7_0x455e52)[_0x6fa1a5(0x1fa)](_0x6fa1a5(0x1ee));});a7_0x455e52();'use strict';var __createBinding=this&&this[a7_0x456873(0x1dc)]||(Object[a7_0x456873(0x1e2)]?function(_0x340212,_0x3fe50c,_0x309d05,_0x18133a){var _0x637d49=a7_0x456873;if(_0x18133a===undefined)_0x18133a=_0x309d05;var _0x3cf28f=Object['getOwnPropertyDescriptor'](_0x3fe50c,_0x309d05);(!_0x3cf28f||(_0x637d49(0x1e8)in _0x3cf28f?!_0x3fe50c[_0x637d49(0x1fd)]:_0x3cf28f['writable']||_0x3cf28f['configurable']))&&(_0x3cf28f={'enumerable':!![],'get':function(){return _0x3fe50c[_0x309d05];}}),Object['defineProperty'](_0x340212,_0x18133a,_0x3cf28f);}:function(_0xd59be1,_0x295e45,_0x200d84,_0x2c51b2){if(_0x2c51b2===undefined)_0x2c51b2=_0x200d84;_0xd59be1[_0x2c51b2]=_0x295e45[_0x200d84];}),__exportStar=this&&this[a7_0x456873(0x1f3)]||function(_0x1f7da9,_0x4a86b2){var _0x4eded8=a7_0x456873;for(var _0x51a73d in _0x1f7da9)if(_0x51a73d!=='default'&&!Object[_0x4eded8(0x1f9)]['hasOwnProperty'][_0x4eded8(0x1db)](_0x4a86b2,_0x51a73d))__createBinding(_0x4a86b2,_0x1f7da9,_0x51a73d);};Object['defineProperty'](exports,a7_0x456873(0x1fd),{'value':!![]}),exports['Configuration']=exports[a7_0x456873(0x1fb)]=exports['ValidatorError']=exports['RuleType']=exports['Rule']=exports['Validator']=void 0x0,__exportStar(require(a7_0x456873(0x1dd)),exports),__exportStar(require('./helper/dtoHelper'),exports),__exportStar(require(a7_0x456873(0x1e3)),exports);var Validator_1=require('./decorator/Validator');Object[a7_0x456873(0x1f1)](exports,a7_0x456873(0x1f0),{'enumerable':!![],'get':function(){var _0x26dcf3=a7_0x456873;return Validator_1[_0x26dcf3(0x1f0)];}});function a7_0x24b9(){var _0x4cdd85=['Configuration','Validator','defineProperty','./configuration','__exportStar','ValidatorError','348393QGehZq','./exception/ValidatorError','./decorator/Rule','9Srlwyc','prototype','search','ValidatorService','RuleType','__esModule','call','__createBinding','./interface','2671080FreZkd','Rule','2031088uGPfyc','CustomConfiguration','create','./helper/getSchema','3OpAncD','950698RLFiGx','1915882GedOfD','constructor','get','741485fjonOH','42fQxRLA','toString','./service/ValidatorService','4128568xdSXGB','(((.+)+)+)+$'];a7_0x24b9=function(){return _0x4cdd85;};return a7_0x24b9();}var Rule_1=require(a7_0x456873(0x1f7));Object[a7_0x456873(0x1f1)](exports,a7_0x456873(0x1df),{'enumerable':!![],'get':function(){return Rule_1['Rule'];}}),Object[a7_0x456873(0x1f1)](exports,'RuleType',{'enumerable':!![],'get':function(){var _0x3633bd=a7_0x456873;return Rule_1[_0x3633bd(0x1fc)];}});var ValidatorError_1=require(a7_0x456873(0x1f6));Object['defineProperty'](exports,a7_0x456873(0x1f4),{'enumerable':!![],'get':function(){var _0x5e043a=a7_0x456873;return ValidatorError_1[_0x5e043a(0x1f4)];}});var ValidatorService_1=require(a7_0x456873(0x1ec));Object[a7_0x456873(0x1f1)](exports,'ValidatorService',{'enumerable':!![],'get':function(){var _0x5e0fc2=a7_0x456873;return ValidatorService_1[_0x5e0fc2(0x1fb)];}});function a7_0x1c92(_0x51ec6c,_0x944162){var _0x4096e9=a7_0x24b9();return a7_0x1c92=function(_0x455e52,_0x3db47c){_0x455e52=_0x455e52-0x1db;var _0x24b993=_0x4096e9[_0x455e52];return _0x24b993;},a7_0x1c92(_0x51ec6c,_0x944162);}var configuration_1=require(a7_0x456873(0x1f2));Object[a7_0x456873(0x1f1)](exports,a7_0x456873(0x1ef),{'enumerable':!![],'get':function(){var _0x37821e=a7_0x456873;return configuration_1[_0x37821e(0x1e1)];}});
|
package/dist/interface.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a8_0x1a5d(_0x5ff14d,_0x261c9e){var _0x15c150=a8_0x5415();return a8_0x1a5d=function(_0x10caa9,_0x4e0c29){_0x10caa9=_0x10caa9-0x128;var _0x541580=_0x15c150[_0x10caa9];return _0x541580;},a8_0x1a5d(_0x5ff14d,_0x261c9e);}var a8_0x2b9bae=a8_0x1a5d;(function(_0x360400,_0xad1b8b){var _0x515b46=a8_0x1a5d,_0x23cebb=_0x360400();while(!![]){try{var _0x57921a=parseInt(_0x515b46(0x128))/0x1+parseInt(_0x515b46(0x12a))/0x2+-parseInt(_0x515b46(0x131))/0x3+-parseInt(_0x515b46(0x133))/0x4+parseInt(_0x515b46(0x12f))/0x5+parseInt(_0x515b46(0x12e))/0x6*(parseInt(_0x515b46(0x136))/0x7)+-parseInt(_0x515b46(0x12d))/0x8*(parseInt(_0x515b46(0x12b))/0x9);if(_0x57921a===_0xad1b8b)break;else _0x23cebb['push'](_0x23cebb['shift']());}catch(_0x43a074){_0x23cebb['push'](_0x23cebb['shift']());}}}(a8_0x5415,0x5599f));var a8_0x4e0c29=(function(){var _0xca50ce=!![];return function(_0x496a27,_0x3dfe3f){var _0x32be7a=_0xca50ce?function(){var _0x318cd5=a8_0x1a5d;if(_0x3dfe3f){var _0xd04a53=_0x3dfe3f[_0x318cd5(0x134)](_0x496a27,arguments);return _0x3dfe3f=null,_0xd04a53;}}:function(){};return _0xca50ce=![],_0x32be7a;};}()),a8_0x10caa9=a8_0x4e0c29(this,function(){var _0x3c56ed=a8_0x1a5d;return a8_0x10caa9[_0x3c56ed(0x137)]()[_0x3c56ed(0x138)](_0x3c56ed(0x130))[_0x3c56ed(0x137)]()[_0x3c56ed(0x129)](a8_0x10caa9)[_0x3c56ed(0x138)](_0x3c56ed(0x130));});function a8_0x5415(){var _0x1d1cb5=['RULES_KEY','7wHPHJx','toString','search','VALIDATOR_KEY','defineProperty','644739cohvJh','constructor','404630LLSwsF','9GxVkIF','anncic-api:validator:rules','962648uJwGZk','1819770clkhOG','1581065WFHmVf','(((.+)+)+)+$','1055586EqFnHI','__esModule','2574984UJaaPC','apply'];a8_0x5415=function(){return _0x1d1cb5;};return a8_0x5415();}a8_0x10caa9();'use strict';Object[a8_0x2b9bae(0x13a)](exports,a8_0x2b9bae(0x132),{'value':!![]}),exports[a8_0x2b9bae(0x139)]=exports[a8_0x2b9bae(0x135)]=void 0x0,exports[a8_0x2b9bae(0x135)]=a8_0x2b9bae(0x12c),exports[a8_0x2b9bae(0x139)]='anncic-api:validator:validator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a9_0x2a0cf=a9_0xd5e1;function a9_0x22de(){const _0x3df485=['i18nConfig','__metadata','Provide','ScopeEnum','message','Singleton','参数验证失败','schema','formatLocale','1724756oAEqrs','prototype','22023gyDhiD','Inject','forEach','_flags','validationOptions','error','errors','messages','type','validator','4358238zDoqEs','i18nService','i18n','MidwayI18nServiceSingleton','NOFIND_SCHEMA','object','keys','decorate','ValidatorService','search','24bnlQsd','getLocaleMapping','RULES_KEY','344YPntvI','isSchema','format','design:paramtypes','4080180gMiLYx','toString','105420IlFdEB','function','value','__decorate','joi','length','PARAMS','Config','$_terms','design:returntype','design:type','ValidatorError','getOwnPropertyDescriptor','localeTable','apply','metadata','language','key','310956cQBlqf','@midwayjs/core','date','init','fromEntries','YYYY-MM-DD\x20HH:mm:ss','defineProperty','validatorConfig','../interface','getSchema','__esModule','(((.+)+)+)+$','360411gnIkTS'];a9_0x22de=function(){return _0x3df485;};return a9_0x22de();}function a9_0xd5e1(_0x12a493,_0xdb4284){const _0x24cdc0=a9_0x22de();return a9_0xd5e1=function(_0xf4a931,_0x840d36){_0xf4a931=_0xf4a931-0x126;let _0x22de7d=_0x24cdc0[_0xf4a931];return _0x22de7d;},a9_0xd5e1(_0x12a493,_0xdb4284);}(function(_0x4b4af,_0x38b344){const _0x16ee8e=a9_0xd5e1,_0x428ea5=_0x4b4af();while(!![]){try{const _0x573484=parseInt(_0x16ee8e(0x13b))/0x1+parseInt(_0x16ee8e(0x151))/0x2+-parseInt(_0x16ee8e(0x147))/0x3*(parseInt(_0x16ee8e(0x167))/0x4)+-parseInt(_0x16ee8e(0x127))/0x5+parseInt(_0x16ee8e(0x15d))/0x6+-parseInt(_0x16ee8e(0x129))/0x7+-parseInt(_0x16ee8e(0x16a))/0x8*(-parseInt(_0x16ee8e(0x153))/0x9);if(_0x573484===_0x38b344)break;else _0x428ea5['push'](_0x428ea5['shift']());}catch(_0x43a95a){_0x428ea5['push'](_0x428ea5['shift']());}}}(a9_0x22de,0x6e992));const a9_0x840d36=(function(){let _0x257887=!![];return function(_0x37574a,_0x4ba320){const _0x504095=_0x257887?function(){const _0x3955d4=a9_0xd5e1;if(_0x4ba320){const _0x4b3820=_0x4ba320[_0x3955d4(0x137)](_0x37574a,arguments);return _0x4ba320=null,_0x4b3820;}}:function(){};return _0x257887=![],_0x504095;};}()),a9_0xf4a931=a9_0x840d36(this,function(){const _0x1e3c9b=a9_0xd5e1;return a9_0xf4a931[_0x1e3c9b(0x128)]()[_0x1e3c9b(0x166)](_0x1e3c9b(0x146))[_0x1e3c9b(0x128)]()['constructor'](a9_0xf4a931)[_0x1e3c9b(0x166)](_0x1e3c9b(0x146));});a9_0xf4a931();'use strict';var __decorate=this&&this[a9_0x2a0cf(0x12c)]||function(_0x528253,_0x1d5b7c,_0x3bcece,_0x8f6234){const _0x87877e=a9_0x2a0cf;var _0x2f4284=arguments[_0x87877e(0x12e)],_0x1a8070=_0x2f4284<0x3?_0x1d5b7c:_0x8f6234===null?_0x8f6234=Object[_0x87877e(0x135)](_0x1d5b7c,_0x3bcece):_0x8f6234,_0x1763c6;if(typeof Reflect===_0x87877e(0x162)&&typeof Reflect[_0x87877e(0x164)]===_0x87877e(0x12a))_0x1a8070=Reflect[_0x87877e(0x164)](_0x528253,_0x1d5b7c,_0x3bcece,_0x8f6234);else{for(var _0x56da23=_0x528253['length']-0x1;_0x56da23>=0x0;_0x56da23--)if(_0x1763c6=_0x528253[_0x56da23])_0x1a8070=(_0x2f4284<0x3?_0x1763c6(_0x1a8070):_0x2f4284>0x3?_0x1763c6(_0x1d5b7c,_0x3bcece,_0x1a8070):_0x1763c6(_0x1d5b7c,_0x3bcece))||_0x1a8070;}return _0x2f4284>0x3&&_0x1a8070&&Object[_0x87877e(0x141)](_0x1d5b7c,_0x3bcece,_0x1a8070),_0x1a8070;},__metadata=this&&this[a9_0x2a0cf(0x149)]||function(_0x41f12c,_0x2dbc1b){const _0x51898f=a9_0x2a0cf;if(typeof Reflect===_0x51898f(0x162)&&typeof Reflect[_0x51898f(0x138)]==='function')return Reflect[_0x51898f(0x138)](_0x41f12c,_0x2dbc1b);};Object['defineProperty'](exports,a9_0x2a0cf(0x145),{'value':!![]}),exports[a9_0x2a0cf(0x165)]=void 0x0;const Joi=require(a9_0x2a0cf(0x12d)),i18n_1=require('@midwayjs/i18n'),core_1=require(a9_0x2a0cf(0x13c)),interface_1=require(a9_0x2a0cf(0x143)),ValidatorError_1=require('../exception/ValidatorError');let ValidatorService=exports['ValidatorService']=class ValidatorService{constructor(){const _0xc193d2=a9_0x2a0cf;this[_0xc193d2(0x15a)]={};}async[a9_0x2a0cf(0x13e)](){const _0x41175f=a9_0x2a0cf,_0xb01d20=Object[_0x41175f(0x163)](this[_0x41175f(0x148)][_0x41175f(0x136)]);_0xb01d20[_0x41175f(0x155)](_0x5520d3=>{const _0x38c6e4=_0x41175f;this['messages'][(0x0,i18n_1['formatLocale'])(_0x5520d3)]=Object[_0x38c6e4(0x13f)](this[_0x38c6e4(0x15e)][_0x38c6e4(0x168)](_0x5520d3,_0x38c6e4(0x15c)));});}[a9_0x2a0cf(0x144)](_0x12be56){const _0x144fa7=a9_0x2a0cf,_0x332846=(0x0,core_1['getClassExtendedMetadata'])(interface_1[_0x144fa7(0x169)],_0x12be56);return _0x332846?Joi[_0x144fa7(0x162)](_0x332846):undefined;}['validator'](_0x10e2e3,_0x1506ad,_0x397d21={}){const _0x4ae109=a9_0x2a0cf;var _0x5d0a27,_0x18544e,_0x2011f7,_0x3ea26a,_0x33b118,_0x41b356;const _0xf71a71=Joi[_0x4ae109(0x16b)](_0x10e2e3)?_0x10e2e3:this[_0x4ae109(0x144)](_0x10e2e3);if(!_0xf71a71)throw new AnnError(ValidatorError_1[_0x4ae109(0x134)][_0x4ae109(0x161)]);_0x397d21[_0x4ae109(0x157)]=Object['assign']((_0x5d0a27=this[_0x4ae109(0x142)]['validationOptions'])!==null&&_0x5d0a27!==void 0x0?_0x5d0a27:{},{'messages':this[_0x4ae109(0x15a)]},_0x397d21[_0x4ae109(0x157)]||{}),_0x397d21[_0x4ae109(0x157)][_0x4ae109(0x159)]=_0x397d21[_0x4ae109(0x157)][_0x4ae109(0x159)]||{},_0x397d21[_0x4ae109(0x157)][_0x4ae109(0x159)][_0x4ae109(0x139)]=(0x0,i18n_1[_0x4ae109(0x150)])(this[_0x4ae109(0x15e)]['getAvailableLocale'](_0x397d21['validationOptions'][_0x4ae109(0x159)][_0x4ae109(0x139)]||_0x397d21['locale']||this[_0x4ae109(0x148)]['defaultLocale'],_0x4ae109(0x15c)));const _0x31c00c=_0xf71a71['validate'](_0x1506ad,_0x397d21[_0x4ae109(0x157)]);if(_0x31c00c===null||_0x31c00c===void 0x0?void 0x0:_0x31c00c[_0x4ae109(0x158)]){if(_0x31c00c[_0x4ae109(0x158)]instanceof AnnError)throw _0x31c00c[_0x4ae109(0x158)];else{if(_0x31c00c[_0x4ae109(0x158)]instanceof Error)throw new AnnError(ValidatorError_1['ValidatorError'][_0x4ae109(0x12f)],{'message':((_0x18544e=_0x31c00c[_0x4ae109(0x158)])===null||_0x18544e===void 0x0?void 0x0:_0x18544e['message'])||_0x4ae109(0x14e)});else throw new AnnError(ValidatorError_1['ValidatorError'][_0x4ae109(0x12f)],{'message':((_0x33b118=(_0x3ea26a=(_0x2011f7=_0x31c00c[_0x4ae109(0x158)])===null||_0x2011f7===void 0x0?void 0x0:_0x2011f7['details'])===null||_0x3ea26a===void 0x0?void 0x0:_0x3ea26a[0x0])===null||_0x33b118===void 0x0?void 0x0:_0x33b118[_0x4ae109(0x14c)])||_0x4ae109(0x14e)});}}if(_0x31c00c===null||_0x31c00c===void 0x0?void 0x0:_0x31c00c[_0x4ae109(0x12b)]){const _0x31d2c7=(_0x41b356=_0xf71a71===null||_0xf71a71===void 0x0?void 0x0:_0xf71a71[_0x4ae109(0x131)])===null||_0x41b356===void 0x0?void 0x0:_0x41b356[_0x4ae109(0x163)],_0x387c8e=function(_0x559835,_0x20f81f){const _0x3af293=_0x4ae109;var _0x1b2f86,_0x2135d2,_0x35ae8b,_0x706f29,_0x2865ec,_0x2e84c3,_0x2498cb,_0x553947,_0x478c11,_0x4f54b2,_0x248997;for(let _0xbf61be in _0x559835){if(_0x20f81f[(_0x1b2f86=_0x559835[_0xbf61be])===null||_0x1b2f86===void 0x0?void 0x0:_0x1b2f86[_0x3af293(0x13a)]]&&((_0x35ae8b=(_0x2135d2=_0x559835[_0xbf61be])===null||_0x2135d2===void 0x0?void 0x0:_0x2135d2[_0x3af293(0x14f)])===null||_0x35ae8b===void 0x0?void 0x0:_0x35ae8b[_0x3af293(0x15b)])){if(((_0x2865ec=(_0x706f29=_0x559835[_0xbf61be])===null||_0x706f29===void 0x0?void 0x0:_0x706f29[_0x3af293(0x14f)])===null||_0x2865ec===void 0x0?void 0x0:_0x2865ec[_0x3af293(0x15b)])==_0x3af293(0x162))_0x20f81f[_0x559835[_0xbf61be][_0x3af293(0x13a)]]=_0x387c8e((_0x2498cb=(_0x2e84c3=_0x559835[_0xbf61be])===null||_0x2e84c3===void 0x0?void 0x0:_0x2e84c3[_0x3af293(0x14f)][_0x3af293(0x131)])===null||_0x2498cb===void 0x0?void 0x0:_0x2498cb[_0x3af293(0x163)],_0x20f81f[_0x559835[_0xbf61be][_0x3af293(0x13a)]]);else{if(_0x559835[_0xbf61be][_0x3af293(0x14f)][_0x3af293(0x15b)]==_0x3af293(0x13d)&&_0x31c00c[_0x3af293(0x12b)][(_0x553947=_0x559835[_0xbf61be])===null||_0x553947===void 0x0?void 0x0:_0x553947[_0x3af293(0x13a)]]){const _0x4578ca=((_0x248997=(_0x4f54b2=(_0x478c11=_0x559835[_0xbf61be])===null||_0x478c11===void 0x0?void 0x0:_0x478c11[_0x3af293(0x14f)])===null||_0x4f54b2===void 0x0?void 0x0:_0x4f54b2[_0x3af293(0x156)])===null||_0x248997===void 0x0?void 0x0:_0x248997[_0x3af293(0x16c)])||_0x3af293(0x140);_0x20f81f[_0x559835[_0xbf61be][_0x3af293(0x13a)]]=dayjs(_0x31c00c['value'][_0x559835[_0xbf61be][_0x3af293(0x13a)]])['format'](_0x4578ca);}}}}return _0x20f81f;};return _0x387c8e(_0x31d2c7,_0x31c00c['value']);}throw new AnnError(ValidatorError_1[_0x4ae109(0x134)][_0x4ae109(0x12f)]);}};__decorate([(0x0,core_1[a9_0x2a0cf(0x130)])(a9_0x2a0cf(0x15f)),__metadata(a9_0x2a0cf(0x133),Object)],ValidatorService[a9_0x2a0cf(0x152)],'i18nConfig',void 0x0),__decorate([(0x0,core_1[a9_0x2a0cf(0x130)])('validator'),__metadata(a9_0x2a0cf(0x133),Object)],ValidatorService[a9_0x2a0cf(0x152)],a9_0x2a0cf(0x142),void 0x0),__decorate([(0x0,core_1[a9_0x2a0cf(0x154)])(),__metadata(a9_0x2a0cf(0x133),i18n_1[a9_0x2a0cf(0x160)])],ValidatorService[a9_0x2a0cf(0x152)],a9_0x2a0cf(0x15e),void 0x0),__decorate([(0x0,core_1['Init'])(),__metadata(a9_0x2a0cf(0x133),Function),__metadata(a9_0x2a0cf(0x126),[]),__metadata(a9_0x2a0cf(0x132),Promise)],ValidatorService[a9_0x2a0cf(0x152)],a9_0x2a0cf(0x13e),null),exports[a9_0x2a0cf(0x165)]=ValidatorService=__decorate([(0x0,core_1[a9_0x2a0cf(0x14a)])('validator'),(0x0,core_1['Scope'])(core_1[a9_0x2a0cf(0x14b)][a9_0x2a0cf(0x14d)])],ValidatorService);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anncic-api/validator",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.5",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build": "tsc && javascript-obfuscator ./dist --output ./dist --config obfuscator.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@anncic-api/core": "^3.3.
|
|
20
|
+
"@anncic-api/core": "^3.3.5",
|
|
21
21
|
"@joi/date": "^2.1.0",
|
|
22
22
|
"joi": "^17.9.2"
|
|
23
23
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"javascript-obfuscator": "^4.0.2",
|
|
27
27
|
"typescript": "^5.1.3"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1f539fbcbb6f1388687d111e2b01285669481111"
|
|
30
30
|
}
|