vovk 3.0.0-draft.90 → 3.0.0-draft.92
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/LICENSE +1 -1
- package/dist/client/createRPC.js +1 -1
- package/dist/client/types.d.ts +1 -1
- package/dist/types.d.ts +5 -3
- package/package.json +2 -2
package/LICENSE
CHANGED
package/dist/client/createRPC.js
CHANGED
|
@@ -42,7 +42,7 @@ const createRPC = (fullSchema, segmentName, controllerName, options) => {
|
|
|
42
42
|
if (typeof validateOnClient !== 'function') {
|
|
43
43
|
throw new Error('validateOnClient must be a function');
|
|
44
44
|
}
|
|
45
|
-
await validateOnClient({ body, query, params, endpoint }, validation ?? {});
|
|
45
|
+
await validateOnClient({ body, query, params, endpoint }, validation ?? {}, fullSchema);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
const internalOptions = {
|
package/dist/client/types.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export type VovkValidateOnClient = (input: {
|
|
|
95
95
|
query?: unknown;
|
|
96
96
|
params?: unknown;
|
|
97
97
|
endpoint: string;
|
|
98
|
-
}, validation: Exclude<VovkHandlerSchema['validation'], undefined
|
|
98
|
+
}, validation: Exclude<VovkHandlerSchema['validation'], undefined>, fullSchema: VovkFullSchema) => void | Promise<void>;
|
|
99
99
|
export type VovkClientOptions<OPTS extends Record<string, KnownAny> = Record<string, never>> = {
|
|
100
100
|
fetcher?: VovkClientFetcher<OPTS>;
|
|
101
101
|
validateOnClient?: VovkValidateOnClient;
|
package/dist/types.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ type GenerateFrom = (string | {
|
|
|
117
117
|
fullSchema?: string | boolean;
|
|
118
118
|
})[];
|
|
119
119
|
export type VovkConfig = {
|
|
120
|
-
emitConfig?: boolean |
|
|
120
|
+
emitConfig?: boolean | (keyof VovkStrictConfig)[];
|
|
121
121
|
clientOutDir?: string;
|
|
122
122
|
schemaOutDir?: string;
|
|
123
123
|
fetcherImport?: string | string[];
|
|
@@ -136,13 +136,15 @@ export type VovkConfig = {
|
|
|
136
136
|
controller?: string;
|
|
137
137
|
[key: string]: string | undefined;
|
|
138
138
|
};
|
|
139
|
+
custom?: Record<string, KnownAny>;
|
|
139
140
|
};
|
|
140
|
-
export type VovkStrictConfig = Required<Omit<VovkConfig, 'emitConfig' | 'validateOnClientImport' | 'fetcherImport' | 'createRPCImport' | 'generateFrom'>> & {
|
|
141
|
-
emitConfig:
|
|
141
|
+
export type VovkStrictConfig = Required<Omit<VovkConfig, 'emitConfig' | 'validateOnClientImport' | 'fetcherImport' | 'createRPCImport' | 'generateFrom' | 'custom'>> & {
|
|
142
|
+
emitConfig: (keyof VovkStrictConfig)[];
|
|
142
143
|
validateOnClientImport: string[] | null;
|
|
143
144
|
fetcherImport: string[];
|
|
144
145
|
createRPCImport: string[];
|
|
145
146
|
generateFrom: GenerateFrom;
|
|
147
|
+
custom: Record<string, KnownAny>;
|
|
146
148
|
};
|
|
147
149
|
export type VovkFullSchema = {
|
|
148
150
|
config: Partial<VovkStrictConfig>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vovk",
|
|
3
|
-
"version": "3.0.0-draft.
|
|
3
|
+
"version": "3.0.0-draft.92",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"description": "RESTful RPC for Next.js - Transforms Next.js into a powerful REST API platform with RPC capabilities.",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"nextjs",
|
|
21
21
|
"router"
|
|
22
22
|
],
|
|
23
|
-
"author": "
|
|
23
|
+
"author": "Andrey Gubanov",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/finom/vovk/issues"
|