@vercube/schema 0.0.19 → 0.0.20
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/index.d.mts +8 -2
- package/dist/index.mjs +17 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z, z as z$1 } from "zod";
|
|
2
2
|
import { RouteConfig } from "@asteasolutions/zod-to-openapi";
|
|
3
3
|
import { App, BasePlugin } from "@vercube/core";
|
|
4
4
|
|
|
@@ -54,4 +54,10 @@ declare class SchemaPlugin<T = unknown> extends BasePlugin<T> {
|
|
|
54
54
|
use(app: App, options: T): void | Promise<void>;
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
-
|
|
57
|
+
//#region src/Schemas/BaseHttpErrorSchema.d.ts
|
|
58
|
+
declare const BaseHttpErrorSchema: z$1.ZodType;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/Schemas/ValidationErrorSchema.d.ts
|
|
61
|
+
declare const ValidationErrorSchema: z$1.ZodType;
|
|
62
|
+
//#endregion
|
|
63
|
+
export { BaseHttpErrorSchema, Schema, SchemaPlugin, ValidationErrorSchema, z };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { z } from "zod";
|
|
2
|
+
import { z, z as z$1 } from "zod";
|
|
3
3
|
import { OpenAPIRegistry, OpenApiGeneratorV3, extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
|
|
4
4
|
import { BaseDecorator, Inject, createDecorator } from "@vercube/di";
|
|
5
5
|
import defu from "defu";
|
|
@@ -211,9 +211,24 @@ var SchemaPlugin = class extends BasePlugin {
|
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/Schemas/BaseHttpErrorSchema.ts
|
|
216
|
+
const BaseHttpErrorSchema = z$1.object({
|
|
217
|
+
status: z$1.number().openapi({ description: "The HTTP status code of the error" }),
|
|
218
|
+
name: z$1.string().optional().openapi({ description: "The name of the error" }),
|
|
219
|
+
message: z$1.string().openapi({ description: "The message of the error" })
|
|
220
|
+
}).openapi("HttpError");
|
|
221
|
+
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/Schemas/ValidationErrorSchema.ts
|
|
224
|
+
const ValidationErrorSchema = z$1.object({
|
|
225
|
+
...BaseHttpErrorSchema,
|
|
226
|
+
errors: z$1.array(z$1.any()).optional().openapi({ description: "The errors of the validation" })
|
|
227
|
+
}).openapi("ValidationError");
|
|
228
|
+
|
|
214
229
|
//#endregion
|
|
215
230
|
//#region src/index.ts
|
|
216
231
|
extendZodWithOpenApi(z);
|
|
217
232
|
|
|
218
233
|
//#endregion
|
|
219
|
-
export { Schema, SchemaPlugin, z };
|
|
234
|
+
export { BaseHttpErrorSchema, Schema, SchemaPlugin, ValidationErrorSchema, z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "Schema (swagger) module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@standard-schema/spec": "1.0.0",
|
|
32
32
|
"defu": "6.1.4",
|
|
33
33
|
"zod": "4.0.10",
|
|
34
|
-
"@vercube/core": "0.0.
|
|
35
|
-
"@vercube/di": "0.0.
|
|
34
|
+
"@vercube/core": "0.0.20",
|
|
35
|
+
"@vercube/di": "0.0.20"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|