vovk 3.0.0-draft.257 → 3.0.0-draft.259

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.
@@ -71,11 +71,11 @@ export declare function withValidationLibrary<T extends VovkTypedMethod<(req: Kn
71
71
  }): RETURN_TYPE;
72
72
  };
73
73
  models: {
74
- body: BODY_MODEL | undefined;
75
- query: QUERY_MODEL | undefined;
76
- params: PARAMS_MODEL | undefined;
77
- output: OUTPUT_MODEL | undefined;
78
- iteration: ITERATION_MODEL | undefined;
74
+ body: typeof body;
75
+ query: typeof query;
76
+ params: typeof params;
77
+ output: typeof output;
78
+ iteration: typeof iteration;
79
79
  };
80
80
  };
81
81
  export {};
@@ -91,13 +91,17 @@ function withValidationLibrary({ isForm, disableServerSideValidation, skipSchema
91
91
  fakeReq.vovk.meta({ __disableClientValidation: input?.disableClientValidation, ...(input?.meta ?? {}) });
92
92
  return resultHandler(fakeReq, (input?.params ?? {}));
93
93
  }
94
- const models = {
95
- body,
96
- query,
97
- params,
98
- output,
99
- iteration,
100
- };
94
+ const models = {};
95
+ if (body !== undefined)
96
+ models.body = body;
97
+ if (query !== undefined)
98
+ models.query = query;
99
+ if (params !== undefined)
100
+ models.params = params;
101
+ if (output !== undefined)
102
+ models.output = output;
103
+ if (iteration !== undefined)
104
+ models.iteration = iteration;
101
105
  const resultHandlerEnhanced = Object.assign(resultHandler, { fn, models });
102
106
  if (toJSONSchema) {
103
107
  const getJsonSchema = (model, type) => Object.assign(toJSONSchema(model, { type }), type === 'body' && isForm ? { 'x-formData': isForm } : {});
@@ -71,11 +71,11 @@ export declare function withValidationLibrary<T extends VovkTypedMethod<(req: Kn
71
71
  }): RETURN_TYPE;
72
72
  };
73
73
  models: {
74
- body: BODY_MODEL | undefined;
75
- query: QUERY_MODEL | undefined;
76
- params: PARAMS_MODEL | undefined;
77
- output: OUTPUT_MODEL | undefined;
78
- iteration: ITERATION_MODEL | undefined;
74
+ body: typeof body;
75
+ query: typeof query;
76
+ params: typeof params;
77
+ output: typeof output;
78
+ iteration: typeof iteration;
79
79
  };
80
80
  };
81
81
  export {};
@@ -91,13 +91,17 @@ function withValidationLibrary({ isForm, disableServerSideValidation, skipSchema
91
91
  fakeReq.vovk.meta({ __disableClientValidation: input?.disableClientValidation, ...(input?.meta ?? {}) });
92
92
  return resultHandler(fakeReq, (input?.params ?? {}));
93
93
  }
94
- const models = {
95
- body,
96
- query,
97
- params,
98
- output,
99
- iteration,
100
- };
94
+ const models = {};
95
+ if (body !== undefined)
96
+ models.body = body;
97
+ if (query !== undefined)
98
+ models.query = query;
99
+ if (params !== undefined)
100
+ models.params = params;
101
+ if (output !== undefined)
102
+ models.output = output;
103
+ if (iteration !== undefined)
104
+ models.iteration = iteration;
101
105
  const resultHandlerEnhanced = Object.assign(resultHandler, { fn, models });
102
106
  if (toJSONSchema) {
103
107
  const getJsonSchema = (model, type) => Object.assign(toJSONSchema(model, { type }), type === 'body' && isForm ? { 'x-formData': isForm } : {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.257",
3
+ "version": "3.0.0-draft.259",
4
4
  "main": "./cjs/index.js",
5
5
  "module": "./mjs/index.js",
6
6
  "types": "./mjs/index.d.ts",