@midwayjs/validate 3.0.0-beta.6 → 3.0.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/config/config.default.d.ts +13 -0
- package/dist/config/config.default.js +18 -0
- package/dist/configuration.d.ts +2 -10
- package/dist/configuration.js +16 -37
- package/dist/decorator/validate.d.ts +3 -0
- package/dist/error.d.ts +5 -0
- package/dist/error.js +16 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/service.d.ts +23 -0
- package/dist/service.js +97 -0
- package/index.d.ts +5 -3
- package/locales/en_US.json +116 -0
- package/locales/zh_CN.json +116 -0
- package/package.json +11 -7
- package/CHANGELOG.md +0 -500
- package/dist/config.default.d.ts +0 -5
- package/dist/config.default.js +0 -8
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidateOptions } from '../decorator/validate';
|
|
2
|
+
export declare const validate: ValidateOptions;
|
|
3
|
+
export declare const i18n: {
|
|
4
|
+
localeTable: {
|
|
5
|
+
en_US: {
|
|
6
|
+
validate: any;
|
|
7
|
+
};
|
|
8
|
+
zh_CN: {
|
|
9
|
+
validate: any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=config.default.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18n = exports.validate = void 0;
|
|
4
|
+
exports.validate = {
|
|
5
|
+
validationOptions: {},
|
|
6
|
+
errorStatus: 422,
|
|
7
|
+
};
|
|
8
|
+
exports.i18n = {
|
|
9
|
+
localeTable: {
|
|
10
|
+
en_US: {
|
|
11
|
+
validate: require('../../locales/en_US.json'),
|
|
12
|
+
},
|
|
13
|
+
zh_CN: {
|
|
14
|
+
validate: require('../../locales/zh_CN.json'),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=config.default.js.map
|
package/dist/configuration.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { MidwayDecoratorService } from '@midwayjs/core';
|
|
2
|
-
import
|
|
3
|
-
import * as DefaultConfig from './config.default';
|
|
4
|
-
export declare class ValidateService {
|
|
5
|
-
validateConfig: typeof DefaultConfig.validate;
|
|
6
|
-
validate(ClzType: new (...args: any[]) => any, value: any, options?: {
|
|
7
|
-
errorStatus?: number;
|
|
8
|
-
validateOptions?: Joi.ValidationOptions;
|
|
9
|
-
}): Joi.ValidationResult;
|
|
10
|
-
}
|
|
2
|
+
import { ValidateService } from './service';
|
|
11
3
|
export declare class ValidateConfiguration {
|
|
12
4
|
decoratorService: MidwayDecoratorService;
|
|
13
5
|
validateService: ValidateService;
|
|
14
|
-
|
|
6
|
+
onReady(): Promise<void>;
|
|
15
7
|
}
|
|
16
8
|
//# sourceMappingURL=configuration.d.ts.map
|
package/dist/configuration.js
CHANGED
|
@@ -9,51 +9,35 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ValidateConfiguration =
|
|
12
|
+
exports.ValidateConfiguration = void 0;
|
|
13
13
|
const decorator_1 = require("@midwayjs/decorator");
|
|
14
14
|
const core_1 = require("@midwayjs/core");
|
|
15
15
|
const constants_1 = require("./constants");
|
|
16
|
-
const Joi = require("joi");
|
|
17
16
|
const util = require("util");
|
|
18
|
-
const DefaultConfig = require("./config.default");
|
|
17
|
+
const DefaultConfig = require("./config/config.default");
|
|
18
|
+
const service_1 = require("./service");
|
|
19
|
+
const i18n = require("@midwayjs/i18n");
|
|
19
20
|
const debug = util.debuglog('midway:debug');
|
|
20
|
-
let ValidateService = class ValidateService {
|
|
21
|
-
validate(ClzType, value, options) {
|
|
22
|
-
var _a;
|
|
23
|
-
const rules = (0, decorator_1.getClassExtendedMetadata)(constants_1.RULES_KEY, ClzType);
|
|
24
|
-
if (rules) {
|
|
25
|
-
const schema = Joi.object(rules);
|
|
26
|
-
const result = schema.validate(value);
|
|
27
|
-
if (result.error) {
|
|
28
|
-
throw new core_1.MidwayValidationError(result.error.message, (_a = options === null || options === void 0 ? void 0 : options.errorStatus) !== null && _a !== void 0 ? _a : this.validateConfig.errorStatus, result.error);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, decorator_1.Config)('validate'),
|
|
38
|
-
__metadata("design:type", Object)
|
|
39
|
-
], ValidateService.prototype, "validateConfig", void 0);
|
|
40
|
-
ValidateService = __decorate([
|
|
41
|
-
(0, decorator_1.Provide)(),
|
|
42
|
-
(0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
|
|
43
|
-
], ValidateService);
|
|
44
|
-
exports.ValidateService = ValidateService;
|
|
45
21
|
let ValidateConfiguration = class ValidateConfiguration {
|
|
46
|
-
async
|
|
22
|
+
async onReady() {
|
|
47
23
|
debug(`[validate]: Register @validate "${constants_1.VALIDATE_KEY}" handler"`);
|
|
48
24
|
this.decoratorService.registerMethodHandler(constants_1.VALIDATE_KEY, options => {
|
|
25
|
+
var _a;
|
|
49
26
|
// get param types from method
|
|
50
27
|
const paramTypes = (0, decorator_1.getMethodParamTypes)(options.target, options.propertyName);
|
|
28
|
+
const validateOptions = (_a = options.metadata) === null || _a === void 0 ? void 0 : _a.options;
|
|
51
29
|
// add aspect method
|
|
52
30
|
return {
|
|
53
31
|
before: (joinPoint) => {
|
|
54
32
|
for (let i = 0; i < paramTypes.length; i++) {
|
|
33
|
+
if (!validateOptions.locale) {
|
|
34
|
+
const maybeCtx = joinPoint.target[core_1.REQUEST_OBJ_CTX_KEY];
|
|
35
|
+
if (maybeCtx && maybeCtx.getAttr) {
|
|
36
|
+
validateOptions.locale = maybeCtx.getAttr(i18n.I18N_ATTR_KEY);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
55
39
|
const item = paramTypes[i];
|
|
56
|
-
const result = this.validateService.validate(item, joinPoint.args[i],
|
|
40
|
+
const result = this.validateService.validate(item, joinPoint.args[i], validateOptions);
|
|
57
41
|
if (result && result.value) {
|
|
58
42
|
joinPoint.args[i] = result.value;
|
|
59
43
|
}
|
|
@@ -69,17 +53,12 @@ __decorate([
|
|
|
69
53
|
], ValidateConfiguration.prototype, "decoratorService", void 0);
|
|
70
54
|
__decorate([
|
|
71
55
|
(0, decorator_1.Inject)(),
|
|
72
|
-
__metadata("design:type", ValidateService)
|
|
56
|
+
__metadata("design:type", service_1.ValidateService)
|
|
73
57
|
], ValidateConfiguration.prototype, "validateService", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
(0, decorator_1.Init)(),
|
|
76
|
-
__metadata("design:type", Function),
|
|
77
|
-
__metadata("design:paramtypes", []),
|
|
78
|
-
__metadata("design:returntype", Promise)
|
|
79
|
-
], ValidateConfiguration.prototype, "init", null);
|
|
80
58
|
ValidateConfiguration = __decorate([
|
|
81
59
|
(0, decorator_1.Configuration)({
|
|
82
60
|
namespace: 'validate',
|
|
61
|
+
imports: [i18n],
|
|
83
62
|
importConfigs: [
|
|
84
63
|
{
|
|
85
64
|
default: DefaultConfig,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import * as Joi from 'joi';
|
|
1
2
|
export interface ValidateOptions {
|
|
2
3
|
errorStatus?: number;
|
|
4
|
+
locale?: string;
|
|
5
|
+
validationOptions?: Joi.ValidationOptions;
|
|
3
6
|
}
|
|
4
7
|
export declare function Validate(options?: ValidateOptions): MethodDecorator;
|
|
5
8
|
//# sourceMappingURL=validate.d.ts.map
|
package/dist/error.d.ts
ADDED
package/dist/error.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MidwayValidationError = void 0;
|
|
4
|
+
const core_1 = require("@midwayjs/core");
|
|
5
|
+
const ValidateErrorCode = (0, core_1.registerErrorCode)('validate', {
|
|
6
|
+
VALIDATE_FAIL: 10000,
|
|
7
|
+
});
|
|
8
|
+
class MidwayValidationError extends core_1.MidwayHttpError {
|
|
9
|
+
constructor(message, status, cause) {
|
|
10
|
+
super(message, status, ValidateErrorCode.VALIDATE_FAIL, {
|
|
11
|
+
cause,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.MidwayValidationError = MidwayValidationError;
|
|
16
|
+
//# sourceMappingURL=error.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { ValidateConfiguration as Configuration
|
|
1
|
+
export { ValidateConfiguration as Configuration } from './configuration';
|
|
2
2
|
export * from './decorator/rule';
|
|
3
3
|
export * from './decorator/validate';
|
|
4
4
|
export * from './dtoHelper';
|
|
5
|
+
export * from './service';
|
|
6
|
+
export * from './error';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -10,11 +10,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.Configuration = void 0;
|
|
14
14
|
var configuration_1 = require("./configuration");
|
|
15
15
|
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.ValidateConfiguration; } });
|
|
16
|
-
Object.defineProperty(exports, "ValidateService", { enumerable: true, get: function () { return configuration_1.ValidateService; } });
|
|
17
16
|
__exportStar(require("./decorator/rule"), exports);
|
|
18
17
|
__exportStar(require("./decorator/validate"), exports);
|
|
19
18
|
__exportStar(require("./dtoHelper"), exports);
|
|
19
|
+
__exportStar(require("./service"), exports);
|
|
20
|
+
__exportStar(require("./error"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as DefaultConfig from './config/config.default';
|
|
2
|
+
import * as Joi from 'joi';
|
|
3
|
+
import { MidwayI18nServiceSingleton } from '@midwayjs/i18n';
|
|
4
|
+
import { ObjectSchema } from 'joi';
|
|
5
|
+
export declare class ValidateService {
|
|
6
|
+
protected validateConfig: typeof DefaultConfig.validate;
|
|
7
|
+
protected i18nConfig: any;
|
|
8
|
+
protected i18nService: MidwayI18nServiceSingleton;
|
|
9
|
+
protected messages: {};
|
|
10
|
+
protected init(): Promise<void>;
|
|
11
|
+
validate<T extends new (...args: any[]) => any>(ClzType: T, value: any, options?: {
|
|
12
|
+
errorStatus?: number;
|
|
13
|
+
locale?: string;
|
|
14
|
+
validationOptions?: Joi.ValidationOptions;
|
|
15
|
+
}): Joi.ValidationResult<T>;
|
|
16
|
+
validateWithSchema<T>(schema: ObjectSchema<any>, value: any, options?: {
|
|
17
|
+
errorStatus?: number;
|
|
18
|
+
locale?: string;
|
|
19
|
+
validationOptions?: Joi.ValidationOptions;
|
|
20
|
+
}): Joi.ValidationResult<T>;
|
|
21
|
+
getSchema<T extends new (...args: any[]) => any>(ClzType: T): ObjectSchema<any>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ValidateService = void 0;
|
|
13
|
+
const decorator_1 = require("@midwayjs/decorator");
|
|
14
|
+
const DefaultConfig = require("./config/config.default");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const Joi = require("joi");
|
|
17
|
+
const i18n_1 = require("@midwayjs/i18n");
|
|
18
|
+
const error_1 = require("./error");
|
|
19
|
+
let ValidateService = class ValidateService {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.messages = {};
|
|
22
|
+
}
|
|
23
|
+
async init() {
|
|
24
|
+
const locales = Object.keys(DefaultConfig.i18n.localeTable);
|
|
25
|
+
locales.forEach(locale => {
|
|
26
|
+
this.messages[(0, i18n_1.formatLocale)(locale)] = Object.fromEntries(this.i18nService.getLocaleMapping(locale, 'validate'));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
validate(ClzType, value, options = {}) {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
options.validationOptions = options.validationOptions || {};
|
|
32
|
+
options.validationOptions.errors = options.validationOptions.errors || {};
|
|
33
|
+
options.validationOptions.errors.language = (0, i18n_1.formatLocale)(this.i18nService.getAvailableLocale(options.validationOptions.errors.language ||
|
|
34
|
+
options.locale ||
|
|
35
|
+
this.i18nConfig.defaultLocale, 'validate'));
|
|
36
|
+
const rules = (0, decorator_1.getClassExtendedMetadata)(constants_1.RULES_KEY, ClzType);
|
|
37
|
+
if (rules) {
|
|
38
|
+
const schema = Joi.object(rules);
|
|
39
|
+
const result = schema.validate(value, Object.assign((_a = this.validateConfig.validationOptions) !== null && _a !== void 0 ? _a : {}, {
|
|
40
|
+
messages: this.messages,
|
|
41
|
+
}, (_b = options.validationOptions) !== null && _b !== void 0 ? _b : {}));
|
|
42
|
+
if (result.error) {
|
|
43
|
+
throw new error_1.MidwayValidationError(result.error.message, (_c = options === null || options === void 0 ? void 0 : options.errorStatus) !== null && _c !== void 0 ? _c : this.validateConfig.errorStatus, result.error);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
validateWithSchema(schema, value, options = {}) {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
options.validationOptions = options.validationOptions || {};
|
|
53
|
+
options.validationOptions.errors = options.validationOptions.errors || {};
|
|
54
|
+
options.validationOptions.errors.language = (0, i18n_1.formatLocale)(this.i18nService.getAvailableLocale(options.validationOptions.errors.language ||
|
|
55
|
+
options.locale ||
|
|
56
|
+
this.i18nConfig.defaultLocale, 'validate'));
|
|
57
|
+
const result = schema.validate(value, Object.assign((_a = this.validateConfig.validationOptions) !== null && _a !== void 0 ? _a : {}, {
|
|
58
|
+
messages: this.messages,
|
|
59
|
+
}, (_b = options.validationOptions) !== null && _b !== void 0 ? _b : {}));
|
|
60
|
+
if (result.error) {
|
|
61
|
+
throw new error_1.MidwayValidationError(result.error.message, (_c = options === null || options === void 0 ? void 0 : options.errorStatus) !== null && _c !== void 0 ? _c : this.validateConfig.errorStatus, result.error);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
getSchema(ClzType) {
|
|
68
|
+
const rules = (0, decorator_1.getClassExtendedMetadata)(constants_1.RULES_KEY, ClzType);
|
|
69
|
+
if (rules) {
|
|
70
|
+
return Joi.object(rules);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, decorator_1.Config)('validate'),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], ValidateService.prototype, "validateConfig", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, decorator_1.Config)('i18n'),
|
|
80
|
+
__metadata("design:type", Object)
|
|
81
|
+
], ValidateService.prototype, "i18nConfig", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, decorator_1.Inject)(),
|
|
84
|
+
__metadata("design:type", i18n_1.MidwayI18nServiceSingleton)
|
|
85
|
+
], ValidateService.prototype, "i18nService", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, decorator_1.Init)(),
|
|
88
|
+
__metadata("design:type", Function),
|
|
89
|
+
__metadata("design:paramtypes", []),
|
|
90
|
+
__metadata("design:returntype", Promise)
|
|
91
|
+
], ValidateService.prototype, "init", null);
|
|
92
|
+
ValidateService = __decorate([
|
|
93
|
+
(0, decorator_1.Provide)(),
|
|
94
|
+
(0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
|
|
95
|
+
], ValidateService);
|
|
96
|
+
exports.ValidateService = ValidateService;
|
|
97
|
+
//# sourceMappingURL=service.js.map
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './dist/index';
|
|
2
|
-
|
|
3
|
-
import { validate } from './dist/config.default';
|
|
2
|
+
import * as Joi from 'joi';
|
|
4
3
|
|
|
5
4
|
declare module '@midwayjs/core/dist/interface' {
|
|
6
5
|
interface MidwayConfig {
|
|
7
|
-
validate?:
|
|
6
|
+
validate?: {
|
|
7
|
+
validationOptions?: Joi.ValidationOptions;
|
|
8
|
+
errorStatus?: number;
|
|
9
|
+
};
|
|
8
10
|
}
|
|
9
11
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"alternatives.all": "{{#label}} does not match all of the required types",
|
|
3
|
+
"alternatives.any": "{{#label}} does not match any of the allowed types",
|
|
4
|
+
"alternatives.match": "{{#label}} does not match any of the allowed types",
|
|
5
|
+
"alternatives.one": "{{#label}} matches more than one allowed type",
|
|
6
|
+
"alternatives.types": "{{#label}} must be one of {{#types}}",
|
|
7
|
+
"any.custom": "{{#label}} failed custom validation because {{#error.message}}",
|
|
8
|
+
"any.default": "{{#label}} threw an error when running default method",
|
|
9
|
+
"any.failover": "{{#label}} threw an error when running failover method",
|
|
10
|
+
"any.invalid": "{{#label}} contains an invalid value",
|
|
11
|
+
"any.only": "{{#label}} must be {if(#valids.length == 1, \"\", \"one of \")}{{#valids}}",
|
|
12
|
+
"any.ref": "{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}",
|
|
13
|
+
"any.required": "{{#label}} is required",
|
|
14
|
+
"any.unknown": "{{#label}} is not allowed",
|
|
15
|
+
"array.base": "{{#label}} must be an array",
|
|
16
|
+
"array.excludes": "{{#label}} contains an excluded value",
|
|
17
|
+
"array.hasKnown": "{{#label}} does not contain at least one required match for type {:#patternLabel}",
|
|
18
|
+
"array.hasUnknown": "{{#label}} does not contain at least one required match",
|
|
19
|
+
"array.includes": "{{#label}} does not match any of the allowed types",
|
|
20
|
+
"array.includesRequiredBoth": "{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)",
|
|
21
|
+
"array.includesRequiredKnowns": "{{#label}} does not contain {{#knownMisses}}",
|
|
22
|
+
"array.includesRequiredUnknowns": "{{#label}} does not contain {{#unknownMisses}} required value(s)",
|
|
23
|
+
"array.length": "{{#label}} must contain {{#limit}} items",
|
|
24
|
+
"array.max": "{{#label}} must contain less than or equal to {{#limit}} items",
|
|
25
|
+
"array.min": "{{#label}} must contain at least {{#limit}} items",
|
|
26
|
+
"array.orderedLength": "{{#label}} must contain at most {{#limit}} items",
|
|
27
|
+
"array.sort": "{{#label}} must be sorted in {#order} order by {{#by}}",
|
|
28
|
+
"array.sort.mismatching": "{{#label}} cannot be sorted due to mismatching types",
|
|
29
|
+
"array.sort.unsupported": "{{#label}} cannot be sorted due to unsupported type {#type}",
|
|
30
|
+
"array.sparse": "{{#label}} must not be a sparse array item",
|
|
31
|
+
"array.unique": "{{#label}} contains a duplicate value",
|
|
32
|
+
"binary.base": "{{#label}} must be a buffer or a string",
|
|
33
|
+
"binary.length": "{{#label}} must be {{#limit}} bytes",
|
|
34
|
+
"binary.max": "{{#label}} must be less than or equal to {{#limit}} bytes",
|
|
35
|
+
"binary.min": "{{#label}} must be at least {{#limit}} bytes",
|
|
36
|
+
"boolean.base": "{{#label}} must be a boolean",
|
|
37
|
+
"date.base": "{{#label}} must be a valid date",
|
|
38
|
+
"date.format": "{{#label}} must be in {msg(\"date.format.\" + #format) || #format} format",
|
|
39
|
+
"date.greater": "{{#label}} must be greater than {{:#limit}}",
|
|
40
|
+
"date.less": "{{#label}} must be less than {{:#limit}}",
|
|
41
|
+
"date.max": "{{#label}} must be less than or equal to {{:#limit}}",
|
|
42
|
+
"date.min": "{{#label}} must be greater than or equal to {{:#limit}}",
|
|
43
|
+
"date.format.iso": "ISO 8601 date",
|
|
44
|
+
"date.format.javascript": "timestamp or number of milliseconds",
|
|
45
|
+
"date.format.unix": "timestamp or number of seconds",
|
|
46
|
+
"function.arity": "{{#label}} must have an arity of {{#n}}",
|
|
47
|
+
"function.class": "{{#label}} must be a class",
|
|
48
|
+
"function.maxArity": "{{#label}} must have an arity lesser or equal to {{#n}}",
|
|
49
|
+
"function.minArity": "{{#label}} must have an arity greater or equal to {{#n}}",
|
|
50
|
+
"object.and": "{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}",
|
|
51
|
+
"object.assert": "{{#label}} is invalid because {if(#subject.key, `\"` + #subject.key + `\" failed to ` + (#message || \"pass the assertion test\"), #message || \"the assertion failed\")}",
|
|
52
|
+
"object.base": "{{#label}} must be of type {{#type}}",
|
|
53
|
+
"object.instance": "{{#label}} must be an instance of {{:#type}}",
|
|
54
|
+
"object.length": "{{#label}} must have {{#limit}} key{if(#limit == 1, \"\", \"s\")}",
|
|
55
|
+
"object.max": "{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, \"\", \"s\")}",
|
|
56
|
+
"object.min": "{{#label}} must have at least {{#limit}} key{if(#limit == 1, \"\", \"s\")}",
|
|
57
|
+
"object.missing": "{{#label}} must contain at least one of {{#peersWithLabels}}",
|
|
58
|
+
"object.nand": "{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}",
|
|
59
|
+
"object.oxor": "{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}",
|
|
60
|
+
"object.pattern.match": "{{#label}} keys failed to match pattern requirements",
|
|
61
|
+
"object.refType": "{{#label}} must be a Joi reference",
|
|
62
|
+
"object.regex": "{{#label}} must be a RegExp object",
|
|
63
|
+
"object.rename.multiple": "{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}",
|
|
64
|
+
"object.rename.override": "{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists",
|
|
65
|
+
"object.schema": "{{#label}} must be a Joi schema of {{#type}} type",
|
|
66
|
+
"object.unknown": "{{#label}} is not allowed",
|
|
67
|
+
"object.with": "{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}",
|
|
68
|
+
"object.without": "{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}",
|
|
69
|
+
"object.xor": "{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}",
|
|
70
|
+
"number.base": "{{#label}} must be a number",
|
|
71
|
+
"number.greater": "{{#label}} must be greater than {{#limit}}",
|
|
72
|
+
"number.infinity": "{{#label}} cannot be infinity",
|
|
73
|
+
"number.integer": "{{#label}} must be an integer",
|
|
74
|
+
"number.less": "{{#label}} must be less than {{#limit}}",
|
|
75
|
+
"number.max": "{{#label}} must be less than or equal to {{#limit}}",
|
|
76
|
+
"number.min": "{{#label}} must be greater than or equal to {{#limit}}",
|
|
77
|
+
"number.multiple": "{{#label}} must be a multiple of {{#multiple}}",
|
|
78
|
+
"number.negative": "{{#label}} must be a negative number",
|
|
79
|
+
"number.port": "{{#label}} must be a valid port",
|
|
80
|
+
"number.positive": "{{#label}} must be a positive number",
|
|
81
|
+
"number.precision": "{{#label}} must have no more than {{#limit}} decimal places",
|
|
82
|
+
"number.unsafe": "{{#label}} must be a safe number",
|
|
83
|
+
"string.alphanum": "{{#label}} must only contain alpha-numeric characters",
|
|
84
|
+
"string.base": "{{#label}} must be a string",
|
|
85
|
+
"string.base64": "{{#label}} must be a valid base64 string",
|
|
86
|
+
"string.creditCard": "{{#label}} must be a credit card",
|
|
87
|
+
"string.dataUri": "{{#label}} must be a valid dataUri string",
|
|
88
|
+
"string.domain": "{{#label}} must contain a valid domain name",
|
|
89
|
+
"string.email": "{{#label}} must be a valid email",
|
|
90
|
+
"string.empty": "{{#label}} is not allowed to be empty",
|
|
91
|
+
"string.guid": "{{#label}} must be a valid GUID",
|
|
92
|
+
"string.hex": "{{#label}} must only contain hexadecimal characters",
|
|
93
|
+
"string.hexAlign": "{{#label}} hex decoded representation must be byte aligned",
|
|
94
|
+
"string.hostname": "{{#label}} must be a valid hostname",
|
|
95
|
+
"string.ip": "{{#label}} must be a valid ip address with a {{#cidr}} CIDR",
|
|
96
|
+
"string.ipVersion": "{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR",
|
|
97
|
+
"string.isoDate": "{{#label}} must be in iso format",
|
|
98
|
+
"string.isoDuration": "{{#label}} must be a valid ISO 8601 duration",
|
|
99
|
+
"string.length": "{{#label}} length must be {{#limit}} characters long",
|
|
100
|
+
"string.lowercase": "{{#label}} must only contain lowercase characters",
|
|
101
|
+
"string.max": "{{#label}} length must be less than or equal to {{#limit}} characters long",
|
|
102
|
+
"string.min": "{{#label}} length must be at least {{#limit}} characters long",
|
|
103
|
+
"string.normalize": "{{#label}} must be unicode normalized in the {{#form}} form",
|
|
104
|
+
"string.token": "{{#label}} must only contain alpha-numeric and underscore characters",
|
|
105
|
+
"string.pattern.base": "{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}",
|
|
106
|
+
"string.pattern.name": "{{#label}} with value {:[.]} fails to match the {{#name}} pattern",
|
|
107
|
+
"string.pattern.invert.base": "{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}",
|
|
108
|
+
"string.pattern.invert.name": "{{#label}} with value {:[.]} matches the inverted {{#name}} pattern",
|
|
109
|
+
"string.trim": "{{#label}} must not have leading or trailing whitespace",
|
|
110
|
+
"string.uri": "{{#label}} must be a valid uri",
|
|
111
|
+
"string.uriCustomScheme": "{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern",
|
|
112
|
+
"string.uriRelativeOnly": "{{#label}} must be a valid relative uri",
|
|
113
|
+
"string.uppercase": "{{#label}} must only contain uppercase characters",
|
|
114
|
+
"symbol.base": "{{#label}} must be a symbol",
|
|
115
|
+
"symbol.map": "{{#label}} must be one of {{#map}}"
|
|
116
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"alternatives.all": "{{#label}} 不能匹配上所以可选项",
|
|
3
|
+
"alternatives.any": "{{#label}} 不能匹配上任何可选项",
|
|
4
|
+
"alternatives.match": "{{#label}} 不能匹配上任何可选项",
|
|
5
|
+
"alternatives.one": "{{#label}} 匹配超过一个可选项",
|
|
6
|
+
"alternatives.types": "{{#label}} 必须是 {{#types}}",
|
|
7
|
+
"any.custom": "{{#label}} 自定义校验失败,原因为 {{#error.message}}",
|
|
8
|
+
"any.default": "{{#label}} 运行默认函数时出错",
|
|
9
|
+
"any.failover": "{{#label}} 运行 failover 函数时出错",
|
|
10
|
+
"any.invalid": "{{#label}} 不是可选值",
|
|
11
|
+
"any.only": "{{#label}} 必须是 {if(#valids.length == 1, \"\", \"one of \")}{{#valids}}",
|
|
12
|
+
"any.ref": "{{#label}} {{#arg}} 引用 {{:#ref}} 其中 {{#reason}}",
|
|
13
|
+
"any.required": "{{#label}} 是必须的",
|
|
14
|
+
"any.unknown": "{{#label}} 不被允许",
|
|
15
|
+
"array.base": "{{#label}} 必须是数组",
|
|
16
|
+
"array.excludes": "{{#label}} 包含排除的值",
|
|
17
|
+
"array.hasKnown": "{{#label}} 不包含至少一个类型为 {:#patternLabel} 的必选项",
|
|
18
|
+
"array.hasUnknown": "{{#label}} 不包含至少一个必选项",
|
|
19
|
+
"array.includes": "{{#label}} 不能匹配上任何可选项",
|
|
20
|
+
"array.includesRequiredBoth": "{{#label}} 不包含 {{#knownMisses}} 及 {{#unknownMisses}} 个必选项",
|
|
21
|
+
"array.includesRequiredKnowns": "{{#label}} 不包含 {{#knownMisses}} 等必选项",
|
|
22
|
+
"array.includesRequiredUnknowns": "{{#label}} 不包含 {{#unknownMisses}} 个必选项",
|
|
23
|
+
"array.length": "{{#label}} 必须正好包含 {{#limit}} 个成员",
|
|
24
|
+
"array.max": "{{#label}} 必须最多包含 {{#limit}} 个成员",
|
|
25
|
+
"array.min": "{{#label}} 必须至少包含 {{#limit}} 个成员",
|
|
26
|
+
"array.orderedLength": "{{#label}} 必须至少包含 {{#limit}} 个成员",
|
|
27
|
+
"array.sort": "{{#label}} 必须按 {#order} 顺序按 {{#by}} 排序",
|
|
28
|
+
"array.sort.mismatching": "{{#label}} 由于类型不匹配而无法排序",
|
|
29
|
+
"array.sort.unsupported": "{{#label}} 类型 {#type} 不支持排序",
|
|
30
|
+
"array.sparse": "{{#label}} 不能包含未定义成员",
|
|
31
|
+
"array.unique": "{{#label}} 是重复的成员",
|
|
32
|
+
"binary.base": "{{#label}} 必须是一段内容",
|
|
33
|
+
"binary.length": "{{#label}} 必须至少包含 {{#limit}} 个字节",
|
|
34
|
+
"binary.max": "{{#label}} 必须最多包含 {{#limit}} 个字节",
|
|
35
|
+
"binary.min": "{{#label}} 必须至少包含 {{#limit}} 个字节",
|
|
36
|
+
"boolean.base": "{{#label}} 必须是 bool 值",
|
|
37
|
+
"date.base": "{{#label}} 必须是毫秒数或者有效的时间字符串",
|
|
38
|
+
"date.format": "{{#label}} 必须是以下格式的字符串 {msg(\"date.format.\" + #format) || #format}",
|
|
39
|
+
"date.greater": "{{#label}} 必须晚于 {{:#limit}}",
|
|
40
|
+
"date.less": "{{#label}} 必须早于 {{:#limit}}",
|
|
41
|
+
"date.max": "{{#label}} 必须早于 {{:#limit}}",
|
|
42
|
+
"date.min": "{{#label}} 必须晚于 {{:#limit}}",
|
|
43
|
+
"date.format.iso": "必须是有效的\"ISO 8601\"格式的时间",
|
|
44
|
+
"date.format.javascript": "必须是有效的时间戳或者毫秒数",
|
|
45
|
+
"date.format.unix": "必须是有效的时间戳或者秒数",
|
|
46
|
+
"function.arity": "{{#label}} 必须正好拥有 {{#n}} 个参数",
|
|
47
|
+
"function.class": "{{#label}} 必须是对象类",
|
|
48
|
+
"function.maxArity": "{{#label}} 必须最多拥有 {{#n}} 个参数",
|
|
49
|
+
"function.minArity": "{{#label}} 必须至少拥有 {{#n}} 个参数",
|
|
50
|
+
"object.and": "{{#label}} 当前 {{#presentWithLabels}} 需要有对应的 {{#missingWithLabels}}",
|
|
51
|
+
"object.assert": "{{#label}} 无效,原因为 {if(#subject.key, `\"` + #subject.key + `\" failed to ` + (#message || \"pass the assertion test\"), #message || \"the assertion failed\")}",
|
|
52
|
+
"object.base": "{{#label}} 必须是一个对象 {{#type}}",
|
|
53
|
+
"object.instance": "{{#label}} 必须是一个 {{:#type}} 的实例",
|
|
54
|
+
"object.length": "{{#label}} 必须正好包含 {{#limit}} 个子对象",
|
|
55
|
+
"object.max": "{{#label}} 必须最多包含 {{#limit}} 个子对象",
|
|
56
|
+
"object.min": "{{#label}} 必须至少包含 {{#limit}} 个子对象",
|
|
57
|
+
"object.missing": "{{#label}} 没有对应的 {{#peersWithLabels}}",
|
|
58
|
+
"object.nand": "{{:#mainWithLabel}} 不得与 {{#peersWithLabels}} 同时存在",
|
|
59
|
+
"object.oxor": "{{#label}} 和 {{#peerWithLabels}} 有冲突",
|
|
60
|
+
"object.pattern.match": "{{#label}} 键匹配失败",
|
|
61
|
+
"object.refType": "{{#label}} 必须是 Joi 引用",
|
|
62
|
+
"object.regex": "{{#label}} 必须是正则对象",
|
|
63
|
+
"object.rename.multiple": "{{#label}} 无法重命名 {{:#from}} 因为多次重命名被禁用并且另一个键已经重命名为 {{:#to}}",
|
|
64
|
+
"object.rename.override": "{{#label}} 无法重命名 {{:#from}} 因为覆盖被禁用并且目标 {{:#to}} 存在",
|
|
65
|
+
"object.schema": "{{#label}} 必须是 {{#type}} 类型的 Joi Schema",
|
|
66
|
+
"object.unknown": "{{#label}} 不被允许",
|
|
67
|
+
"object.with": "{{:#mainWithLabel}} 缺少必需的对等方 {{:#peerWithLabel}}",
|
|
68
|
+
"object.without": "{{:#mainWithLabel}} 与禁止的节点冲突 {{:#peerWithLabel}}",
|
|
69
|
+
"object.xor": "{{#label}} 包含独占对等体之间的冲突 {{#peersWithLabels}}",
|
|
70
|
+
"number.base": "{{#label}} 必须是数值",
|
|
71
|
+
"number.greater": "{{#label}} 必须大于 {{#limit}}",
|
|
72
|
+
"number.infinity": "{{#label}} 不能是无穷大",
|
|
73
|
+
"number.integer": "{{#label}} 必须是整数",
|
|
74
|
+
"number.less": "{{#label}} 必须小于 {{#limit}}",
|
|
75
|
+
"number.max": "{{#label}} 必须小于或等于 {{#limit}}",
|
|
76
|
+
"number.min": "{{#label}} 必须大于或等于 {{#limit}}",
|
|
77
|
+
"number.multiple": "{{#label}} 必须是 {{#multiple}} 的倍数",
|
|
78
|
+
"number.negative": "{{#label}} 必须是负数",
|
|
79
|
+
"number.port": "{{#label}} 必须是有效的端口号",
|
|
80
|
+
"number.positive": "{{#label}} 必须是正数",
|
|
81
|
+
"number.precision": "{{#label}} 必须有 {{#limit}} 位小数",
|
|
82
|
+
"number.unsafe": "{{#label}} 必须是安全号码",
|
|
83
|
+
"string.alphanum": "{{#label}} must only contain alpha-numeric characters",
|
|
84
|
+
"string.base": "{{#label}} 必须是字符串",
|
|
85
|
+
"string.base64": "{{#label}} 必须是有效的 base64 字符串",
|
|
86
|
+
"string.creditCard": "{{#label}} 必须是有效的信用卡号",
|
|
87
|
+
"string.dataUri": "{{#label}} 必须是有效的 dataUri 字符串",
|
|
88
|
+
"string.domain": "{{#label}} 必须包含有效的域名",
|
|
89
|
+
"string.email": "{{#label}} 必须是有效的电子邮件",
|
|
90
|
+
"string.empty": "{{#label}} 不允许为空",
|
|
91
|
+
"string.guid": "{{#label}} 必须是有效的 GUID",
|
|
92
|
+
"string.hex": "{{#label}} 只能包含十六进制字符",
|
|
93
|
+
"string.hexAlign": "{{#label}} 十六进制解码表示必须字节对齐",
|
|
94
|
+
"string.hostname": "{{#label}} 必须是有效的主机名",
|
|
95
|
+
"string.ip": "{{#label}} 必须是具有 {{#cidr}} CIDR 的有效 IP 地址",
|
|
96
|
+
"string.ipVersion": "{{#label}} 必须是以下版本之一的有效 IP 地址 {{#version}} 和 {{#cidr}} CIDR",
|
|
97
|
+
"string.isoDate": "{{#label}} 必须是 iso 格式",
|
|
98
|
+
"string.isoDuration": "{{#label}} 必须是有效的 ISO 8601 持续时间",
|
|
99
|
+
"string.length": "{{#label}} 长度必须为 {{#limit}} 个字符长",
|
|
100
|
+
"string.lowercase": "{{#label}} 只能包含小写字符",
|
|
101
|
+
"string.max": "{{#label}} 长度必须小于或等于 {{#limit}} 个字符长",
|
|
102
|
+
"string.min": "{{#label}} 长度必须至少为 {{#limit}} 个字符长",
|
|
103
|
+
"string.normalize": "{{#label}} 必须以 {{#form}} 形式进行 unicode 规范化",
|
|
104
|
+
"string.token": "{{#label}} 只能包含字母数字和下划线字符",
|
|
105
|
+
"string.pattern.base": "{{#label}} 的值为 {:[.]} 未能匹配所需的模式:{{#regex}}",
|
|
106
|
+
"string.pattern.name": "{{#label}} 值为 {:[.]} 未能匹配 {{#name}} 模式",
|
|
107
|
+
"string.pattern.invert.base": "{{#label}} 与值 {:[.]} 匹配反转模式:{{#regex}}",
|
|
108
|
+
"string.pattern.invert.name": "{{#label}} 与值 {:[.]} 匹配倒置的 {{#name}} 模式",
|
|
109
|
+
"string.trim": "{{#label}} 不得前后空格",
|
|
110
|
+
"string.uri": "{{#label}} 必须是有效的 uri",
|
|
111
|
+
"string.uriCustomScheme": "{{#label}} 必须是有效的 uri,其方案与 {{#scheme}} 模式匹配",
|
|
112
|
+
"string.uriRelativeOnly": "{{#label}} 必须是有效的相对 uri",
|
|
113
|
+
"string.uppercase": "{{#label}} 只能包含大写字符",
|
|
114
|
+
"symbol.base": "{{#label}} 必须是符号",
|
|
115
|
+
"symbol.map": "{{#label}} 必须是 {{#map}} 之一"
|
|
116
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/validate",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Midway Component for mongoose",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"test": "node --require=ts-node/register ../../node_modules/.bin/jest",
|
|
10
|
-
"cov": "node --require=ts-node/register ../../node_modules/.bin/jest --coverage --forceExit",
|
|
9
|
+
"test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
|
|
10
|
+
"cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit",
|
|
11
11
|
"ci": "npm run test"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [],
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist/**/*.js",
|
|
17
17
|
"dist/**/*.d.ts",
|
|
18
|
+
"locales",
|
|
18
19
|
"index.d.ts"
|
|
19
20
|
],
|
|
20
21
|
"engines": {
|
|
@@ -22,12 +23,15 @@
|
|
|
22
23
|
},
|
|
23
24
|
"license": "MIT",
|
|
24
25
|
"dependencies": {
|
|
26
|
+
"@midwayjs/i18n": "^3.0.0",
|
|
25
27
|
"joi": "^17.2.1"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
|
-
"@midwayjs/core": "^3.0.0
|
|
29
|
-
"@midwayjs/decorator": "^3.0.0
|
|
30
|
-
"@midwayjs/
|
|
30
|
+
"@midwayjs/core": "^3.0.0",
|
|
31
|
+
"@midwayjs/decorator": "^3.0.0",
|
|
32
|
+
"@midwayjs/express": "^3.0.0",
|
|
33
|
+
"@midwayjs/koa": "^3.0.0",
|
|
34
|
+
"@midwayjs/mock": "^3.0.0"
|
|
31
35
|
},
|
|
32
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "55c26029bccf7bbb739fa1597e8f418dafa2caa0"
|
|
33
37
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,500 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* class transformer method missing ([#1387](https://github.com/midwayjs/midway/issues/1387)) ([074e839](https://github.com/midwayjs/midway/commit/074e8393598dc95e2742f735df75a2191c5fe25d))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
|
|
18
|
-
|
|
19
|
-
**Note:** Version bump only for package @midwayjs/validate
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Features
|
|
29
|
-
|
|
30
|
-
* add i18n ([#1375](https://github.com/midwayjs/midway/issues/1375)) ([bffefe0](https://github.com/midwayjs/midway/commit/bffefe07afe45777d49b5a76b9ab17fc2b9d9a55))
|
|
31
|
-
* auto transform args to type ([#1372](https://github.com/midwayjs/midway/issues/1372)) ([bb3f7d2](https://github.com/midwayjs/midway/commit/bb3f7d2028a034e1926d9df554849332354c3762))
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Features
|
|
41
|
-
|
|
42
|
-
* add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
# [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
|
|
49
|
-
|
|
50
|
-
**Note:** Version bump only for package @midwayjs/validate
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
|
|
57
|
-
|
|
58
|
-
**Note:** Version bump only for package @midwayjs/validate
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## [2.13.3](https://github.com/midwayjs/midway/compare/v2.13.2...v2.13.3) (2021-09-28)
|
|
65
|
-
|
|
66
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## [2.13.2](https://github.com/midwayjs/midway/compare/v2.13.1...v2.13.2) (2021-09-09)
|
|
73
|
-
|
|
74
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## [2.13.1](https://github.com/midwayjs/midway/compare/v2.13.0...v2.13.1) (2021-09-08)
|
|
81
|
-
|
|
82
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
# [2.13.0](https://github.com/midwayjs/midway/compare/v2.12.9...v2.13.0) (2021-09-07)
|
|
89
|
-
|
|
90
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## [2.12.9](https://github.com/midwayjs/midway/compare/v2.12.8...v2.12.9) (2021-09-01)
|
|
97
|
-
|
|
98
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
## [2.12.7](https://github.com/midwayjs/midway/compare/v2.12.6...v2.12.7) (2021-08-22)
|
|
105
|
-
|
|
106
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## [2.12.5](https://github.com/midwayjs/midway/compare/v2.12.4...v2.12.5) (2021-08-18)
|
|
113
|
-
|
|
114
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
## [2.12.3](https://github.com/midwayjs/midway/compare/v2.12.2...v2.12.3) (2021-08-09)
|
|
121
|
-
|
|
122
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
## [2.12.1](https://github.com/midwayjs/midway/compare/v2.12.0...v2.12.1) (2021-08-01)
|
|
129
|
-
|
|
130
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
# [2.12.0](https://github.com/midwayjs/midway/compare/v2.11.7...v2.12.0) (2021-07-30)
|
|
137
|
-
|
|
138
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
## [2.11.6](https://github.com/midwayjs/midway/compare/v2.11.5...v2.11.6) (2021-07-16)
|
|
145
|
-
|
|
146
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
## [2.11.5](https://github.com/midwayjs/midway/compare/v2.11.4...v2.11.5) (2021-07-15)
|
|
153
|
-
|
|
154
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
## [2.11.4](https://github.com/midwayjs/midway/compare/v2.11.3...v2.11.4) (2021-07-06)
|
|
161
|
-
|
|
162
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
## [2.11.3](https://github.com/midwayjs/midway/compare/v2.11.2...v2.11.3) (2021-07-02)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
### Bug Fixes
|
|
172
|
-
|
|
173
|
-
* hide real error when user code throw error ([#1128](https://github.com/midwayjs/midway/issues/1128)) ([e728b0b](https://github.com/midwayjs/midway/commit/e728b0b80956c09cfb856ffe082f44fa29cfeb82))
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
## [2.11.2](https://github.com/midwayjs/midway/compare/v2.11.1...v2.11.2) (2021-06-28)
|
|
180
|
-
|
|
181
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
## [2.11.1](https://github.com/midwayjs/midway/compare/v2.11.0...v2.11.1) (2021-06-19)
|
|
188
|
-
|
|
189
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
# [2.11.0](https://github.com/midwayjs/midway/compare/v2.10.19...v2.11.0) (2021-06-10)
|
|
196
|
-
|
|
197
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
## [2.10.18](https://github.com/midwayjs/midway/compare/v2.10.17...v2.10.18) (2021-05-26)
|
|
204
|
-
|
|
205
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
## [2.10.14](https://github.com/midwayjs/midway/compare/v2.10.13...v2.10.14) (2021-05-11)
|
|
212
|
-
|
|
213
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
## [2.10.13](https://github.com/midwayjs/midway/compare/v2.10.12...v2.10.13) (2021-05-08)
|
|
220
|
-
|
|
221
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
## [2.10.12](https://github.com/midwayjs/midway/compare/v2.10.11...v2.10.12) (2021-05-07)
|
|
228
|
-
|
|
229
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
## [2.10.11](https://github.com/midwayjs/midway/compare/v2.10.10...v2.10.11) (2021-04-29)
|
|
236
|
-
|
|
237
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
## [2.10.10](https://github.com/midwayjs/midway/compare/v2.10.9...v2.10.10) (2021-04-24)
|
|
244
|
-
|
|
245
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
## [2.10.9](https://github.com/midwayjs/midway/compare/v2.10.8...v2.10.9) (2021-04-21)
|
|
252
|
-
|
|
253
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
## [2.10.8](https://github.com/midwayjs/midway/compare/v2.10.7...v2.10.8) (2021-04-21)
|
|
260
|
-
|
|
261
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
## [2.10.7](https://github.com/midwayjs/midway/compare/v2.10.6...v2.10.7) (2021-04-17)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
### Bug Fixes
|
|
271
|
-
|
|
272
|
-
* add event name args ([#986](https://github.com/midwayjs/midway/issues/986)) ([bfd8232](https://github.com/midwayjs/midway/commit/bfd82320aee8600d8fa30bd2821a0e68c80fd755))
|
|
273
|
-
* format ([#997](https://github.com/midwayjs/midway/issues/997)) ([456cc14](https://github.com/midwayjs/midway/commit/456cc14513bdb000d1aa3130e9719caf7a8a803f))
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
### Features
|
|
277
|
-
|
|
278
|
-
* add midway task component ([#995](https://github.com/midwayjs/midway/issues/995)) ([befb81d](https://github.com/midwayjs/midway/commit/befb81dee90f01a20bba2c1835e8685cf85a76e7))
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
## [2.10.6](https://github.com/midwayjs/midway/compare/v2.10.5...v2.10.6) (2021-04-14)
|
|
285
|
-
|
|
286
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
## [2.10.5](https://github.com/midwayjs/midway/compare/v2.10.4...v2.10.5) (2021-04-13)
|
|
293
|
-
|
|
294
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
## [2.10.4](https://github.com/midwayjs/midway/compare/v2.10.3...v2.10.4) (2021-04-10)
|
|
301
|
-
|
|
302
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
## [2.10.3](https://github.com/midwayjs/midway/compare/v2.10.2...v2.10.3) (2021-04-07)
|
|
309
|
-
|
|
310
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
## [2.10.2](https://github.com/midwayjs/midway/compare/v2.10.1...v2.10.2) (2021-04-05)
|
|
317
|
-
|
|
318
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
# [2.10.0](https://github.com/midwayjs/midway/compare/v2.9.3...v2.10.0) (2021-04-02)
|
|
325
|
-
|
|
326
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
## [2.9.3](https://github.com/midwayjs/midway/compare/v2.9.2...v2.9.3) (2021-03-30)
|
|
333
|
-
|
|
334
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
## [2.9.2](https://github.com/midwayjs/midway/compare/v2.9.1...v2.9.2) (2021-03-27)
|
|
341
|
-
|
|
342
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
## [2.9.1](https://github.com/midwayjs/midway/compare/v2.9.0...v2.9.1) (2021-03-24)
|
|
349
|
-
|
|
350
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
# [2.9.0](https://github.com/midwayjs/midway/compare/v2.8.13...v2.9.0) (2021-03-22)
|
|
357
|
-
|
|
358
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
## [2.8.13](https://github.com/midwayjs/midway/compare/v2.8.12...v2.8.13) (2021-03-17)
|
|
365
|
-
|
|
366
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
## [2.8.11](https://github.com/midwayjs/midway/compare/v2.8.10...v2.8.11) (2021-03-12)
|
|
373
|
-
|
|
374
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
## [2.8.9](https://github.com/midwayjs/midway/compare/v2.8.8...v2.8.9) (2021-03-08)
|
|
381
|
-
|
|
382
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
## [2.8.8](https://github.com/midwayjs/midway/compare/v2.8.7...v2.8.8) (2021-03-06)
|
|
389
|
-
|
|
390
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
## [2.8.7](https://github.com/midwayjs/midway/compare/v2.8.6...v2.8.7) (2021-03-04)
|
|
397
|
-
|
|
398
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
## [2.8.6](https://github.com/midwayjs/midway/compare/v2.8.5...v2.8.6) (2021-03-03)
|
|
405
|
-
|
|
406
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
## [2.8.5](https://github.com/midwayjs/midway/compare/v2.8.4...v2.8.5) (2021-03-03)
|
|
413
|
-
|
|
414
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
## [2.8.4](https://github.com/midwayjs/midway/compare/v2.8.3...v2.8.4) (2021-03-03)
|
|
421
|
-
|
|
422
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
## [2.8.3](https://github.com/midwayjs/midway/compare/v2.8.2...v2.8.3) (2021-03-01)
|
|
429
|
-
|
|
430
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
## [2.8.2](https://github.com/midwayjs/midway/compare/v2.8.0...v2.8.2) (2021-02-27)
|
|
437
|
-
|
|
438
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
# [2.8.0](https://github.com/midwayjs/midway/compare/v2.7.7...v2.8.0) (2021-02-24)
|
|
445
|
-
|
|
446
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
## [2.7.7](https://github.com/midwayjs/midway/compare/v2.7.6...v2.7.7) (2021-02-20)
|
|
453
|
-
|
|
454
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
## [2.7.5](https://github.com/midwayjs/midway/compare/v2.7.4...v2.7.5) (2021-02-08)
|
|
461
|
-
|
|
462
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
## [2.7.3](https://github.com/midwayjs/midway/compare/v2.7.2...v2.7.3) (2021-02-02)
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
### Bug Fixes
|
|
472
|
-
|
|
473
|
-
* egg socket io missing session middleware ([#835](https://github.com/midwayjs/midway/issues/835)) ([6e605a1](https://github.com/midwayjs/midway/commit/6e605a15b64bf51182b393b68d66d0867c571b94))
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
## [2.7.2](https://github.com/midwayjs/midway/compare/v2.7.1...v2.7.2) (2021-01-28)
|
|
480
|
-
|
|
481
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
## [2.7.1](https://github.com/midwayjs/midway/compare/v2.7.0...v2.7.1) (2021-01-28)
|
|
488
|
-
|
|
489
|
-
**Note:** Version bump only for package @midwayjs/typegoose
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
# [2.7.0](https://github.com/midwayjs/midway/compare/v2.6.13...v2.7.0) (2021-01-27)
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
### Features
|
|
499
|
-
|
|
500
|
-
* support entry file in bootstrap ([#819](https://github.com/midwayjs/midway/issues/819)) ([49a5ff6](https://github.com/midwayjs/midway/commit/49a5ff662134bdd42dc3a80738b44a05138f8f7c))
|
package/dist/config.default.d.ts
DELETED