@vercube/schema 0.0.20 → 0.0.22
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 +2 -8
- package/dist/index.mjs +7 -22
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import { RouteConfig } from "@asteasolutions/zod-to-openapi";
|
|
3
3
|
import { App, BasePlugin } from "@vercube/core";
|
|
4
4
|
|
|
@@ -54,10 +54,4 @@ declare class SchemaPlugin<T = unknown> extends BasePlugin<T> {
|
|
|
54
54
|
use(app: App, options: T): void | Promise<void>;
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
-
|
|
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 };
|
|
57
|
+
export { Schema, SchemaPlugin, z };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { z
|
|
2
|
+
import { z } 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";
|
|
@@ -98,8 +98,8 @@ function SchemaQueryParamsResolver(metadata, schema) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.
|
|
102
|
-
var require_decorate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.
|
|
101
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js
|
|
102
|
+
var require_decorate = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js": ((exports, module) => {
|
|
103
103
|
function __decorate(decorators, target, key, desc) {
|
|
104
104
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
105
105
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -107,11 +107,11 @@ var require_decorate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runti
|
|
|
107
107
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
108
108
|
}
|
|
109
109
|
module.exports = __decorate, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
110
|
-
} });
|
|
110
|
+
}) });
|
|
111
111
|
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/Decorators/Schema.ts
|
|
114
|
-
var import_decorate$1 = __toESM(require_decorate());
|
|
114
|
+
var import_decorate$1 = /* @__PURE__ */ __toESM(require_decorate(), 1);
|
|
115
115
|
/**
|
|
116
116
|
* A decorator class for handling OpenAPI schema registration for routes.
|
|
117
117
|
*
|
|
@@ -152,7 +152,7 @@ function Schema(params) {
|
|
|
152
152
|
|
|
153
153
|
//#endregion
|
|
154
154
|
//#region src/Controllers/SchameController.ts
|
|
155
|
-
var import_decorate = __toESM(require_decorate(), 1);
|
|
155
|
+
var import_decorate = /* @__PURE__ */ __toESM(require_decorate(), 1);
|
|
156
156
|
let SchemaController = class SchemaController$1 {
|
|
157
157
|
gSchemaRegistry;
|
|
158
158
|
/**
|
|
@@ -211,24 +211,9 @@ 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
|
-
|
|
229
214
|
//#endregion
|
|
230
215
|
//#region src/index.ts
|
|
231
216
|
extendZodWithOpenApi(z);
|
|
232
217
|
|
|
233
218
|
//#endregion
|
|
234
|
-
export {
|
|
219
|
+
export { Schema, SchemaPlugin, z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Schema (swagger) module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"swagger"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@asteasolutions/zod-to-openapi": "8.
|
|
30
|
+
"@asteasolutions/zod-to-openapi": "8.1.0",
|
|
31
31
|
"@standard-schema/spec": "1.0.0",
|
|
32
32
|
"defu": "6.1.4",
|
|
33
|
-
"zod": "4.0.
|
|
34
|
-
"@vercube/core": "0.0.
|
|
35
|
-
"@vercube/di": "0.0.
|
|
33
|
+
"zod": "4.0.17",
|
|
34
|
+
"@vercube/core": "0.0.22",
|
|
35
|
+
"@vercube/di": "0.0.22"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|