vovk 3.0.0-draft.54 → 3.0.0-draft.55
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/.turbo/turbo-build.log +1 -1
- package/dist/createVovkApp.js +3 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/getSchema.js +1 -1
- package/package.json +1 -1
- package/src/createVovkApp.ts +4 -1
- package/src/types.ts +2 -2
- package/src/utils/getSchema.ts +1 -4
package/.turbo/turbo-build.log
CHANGED
package/dist/createVovkApp.js
CHANGED
|
@@ -31,9 +31,11 @@ function createVovkApp() {
|
|
|
31
31
|
controller._handlers = {
|
|
32
32
|
...controller._handlers,
|
|
33
33
|
[propertyKey]: {
|
|
34
|
-
...(controller._handlers ?? {})[propertyKey],
|
|
35
34
|
path,
|
|
36
35
|
httpMethod,
|
|
36
|
+
validation: {},
|
|
37
|
+
custom: {},
|
|
38
|
+
...(controller._handlers ?? {})[propertyKey],
|
|
37
39
|
},
|
|
38
40
|
};
|
|
39
41
|
const originalMethod = controller[propertyKey];
|
package/dist/types.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export type StaticClass = Function;
|
|
|
6
6
|
export type VovkHandlerSchema = {
|
|
7
7
|
path: string;
|
|
8
8
|
httpMethod: HttpMethod;
|
|
9
|
-
validation
|
|
9
|
+
validation: {
|
|
10
10
|
query?: KnownAny;
|
|
11
11
|
body?: KnownAny;
|
|
12
12
|
};
|
|
13
|
-
custom
|
|
13
|
+
custom: Record<string, KnownAny>;
|
|
14
14
|
};
|
|
15
15
|
export type VovkControllerSchema = {
|
|
16
16
|
controllerName: string;
|
package/dist/utils/getSchema.js
CHANGED
package/package.json
CHANGED
package/src/createVovkApp.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
type DecoratorOptions,
|
|
8
8
|
type VovkRequest,
|
|
9
9
|
type StaticClass,
|
|
10
|
+
VovkHandlerSchema,
|
|
10
11
|
} from './types';
|
|
11
12
|
import getSchema from './utils/getSchema';
|
|
12
13
|
|
|
@@ -47,9 +48,11 @@ export function createVovkApp() {
|
|
|
47
48
|
controller._handlers = {
|
|
48
49
|
...controller._handlers,
|
|
49
50
|
[propertyKey]: {
|
|
50
|
-
...(controller._handlers ?? {})[propertyKey],
|
|
51
51
|
path,
|
|
52
52
|
httpMethod,
|
|
53
|
+
validation: {},
|
|
54
|
+
custom: {},
|
|
55
|
+
...((controller._handlers ?? {})[propertyKey] as Partial<VovkHandlerSchema>),
|
|
53
56
|
},
|
|
54
57
|
};
|
|
55
58
|
|
package/src/types.ts
CHANGED
|
@@ -9,8 +9,8 @@ export type StaticClass = Function; // eslint-disable-line @typescript-eslint/no
|
|
|
9
9
|
export type VovkHandlerSchema = {
|
|
10
10
|
path: string;
|
|
11
11
|
httpMethod: HttpMethod;
|
|
12
|
-
validation
|
|
13
|
-
custom
|
|
12
|
+
validation: { query?: KnownAny; body?: KnownAny };
|
|
13
|
+
custom: Record<string, KnownAny>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type VovkControllerSchema = {
|
package/src/utils/getSchema.ts
CHANGED
|
@@ -27,10 +27,7 @@ export default function getSchema(options: {
|
|
|
27
27
|
...(exposeValidation
|
|
28
28
|
? controller._handlers
|
|
29
29
|
: Object.fromEntries(
|
|
30
|
-
Object.entries(controller._handlers ?? {}).map(([key, value]) => [
|
|
31
|
-
key,
|
|
32
|
-
{ ...value, validation: undefined },
|
|
33
|
-
])
|
|
30
|
+
Object.entries(controller._handlers ?? {}).map(([key, value]) => [key, { ...value, validation: {} }])
|
|
34
31
|
)),
|
|
35
32
|
},
|
|
36
33
|
};
|