@vercube/schema 0.0.23 → 0.0.25
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.mjs +11 -43
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
import "node:module";
|
|
2
1
|
import { OpenAPIRegistry, OpenApiGeneratorV3, extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { BaseDecorator, Inject, createDecorator } from "@vercube/di";
|
|
5
4
|
import defu from "defu";
|
|
6
5
|
import { BasePlugin, Controller, Get } from "@vercube/core";
|
|
7
6
|
|
|
8
|
-
//#region rolldown:runtime
|
|
9
|
-
var __create = Object.create;
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
14
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
-
var __commonJS = (cb, mod) => function() {
|
|
16
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
-
key = keys[i];
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
-
get: ((k) => from[k]).bind(null, key),
|
|
23
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
-
value: mod,
|
|
30
|
-
enumerable: true
|
|
31
|
-
}) : target, mod));
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
7
|
//#region src/Resolvers/SchemaBodyResolver.ts
|
|
35
8
|
/**
|
|
36
9
|
* Resolves the body schema for a given method.
|
|
@@ -98,20 +71,16 @@ var SchemaRegistry = class {
|
|
|
98
71
|
};
|
|
99
72
|
|
|
100
73
|
//#endregion
|
|
101
|
-
//#region
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
module.exports = __decorate, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
110
|
-
}) });
|
|
74
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/decorate.js
|
|
75
|
+
function __decorate(decorators, target, key, desc) {
|
|
76
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
77
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
78
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
79
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
80
|
+
}
|
|
111
81
|
|
|
112
82
|
//#endregion
|
|
113
83
|
//#region src/Decorators/Schema.ts
|
|
114
|
-
var import_decorate$1 = /* @__PURE__ */ __toESM(require_decorate(), 1);
|
|
115
84
|
/**
|
|
116
85
|
* A decorator class for handling OpenAPI schema registration for routes.
|
|
117
86
|
*
|
|
@@ -136,7 +105,7 @@ var SchemaDecorator = class extends BaseDecorator {
|
|
|
136
105
|
this.gSchemaRegistry.register(_schema);
|
|
137
106
|
}
|
|
138
107
|
};
|
|
139
|
-
(
|
|
108
|
+
__decorate([Inject(SchemaRegistry)], SchemaDecorator.prototype, "gSchemaRegistry", void 0);
|
|
140
109
|
/**
|
|
141
110
|
* A decorator function for registering OpenAPI schema metadata for a route.
|
|
142
111
|
*
|
|
@@ -152,7 +121,6 @@ function Schema(params) {
|
|
|
152
121
|
|
|
153
122
|
//#endregion
|
|
154
123
|
//#region src/Controllers/SchameController.ts
|
|
155
|
-
var import_decorate = /* @__PURE__ */ __toESM(require_decorate(), 1);
|
|
156
124
|
let SchemaController = class SchemaController$1 {
|
|
157
125
|
gSchemaRegistry;
|
|
158
126
|
/**
|
|
@@ -164,9 +132,9 @@ let SchemaController = class SchemaController$1 {
|
|
|
164
132
|
return this.gSchemaRegistry.generateSchema();
|
|
165
133
|
}
|
|
166
134
|
};
|
|
167
|
-
(
|
|
168
|
-
(
|
|
169
|
-
SchemaController = (
|
|
135
|
+
__decorate([Inject(SchemaRegistry)], SchemaController.prototype, "gSchemaRegistry", void 0);
|
|
136
|
+
__decorate([Get("/")], SchemaController.prototype, "get", null);
|
|
137
|
+
SchemaController = __decorate([Controller("/_schema")], SchemaController);
|
|
170
138
|
|
|
171
139
|
//#endregion
|
|
172
140
|
//#region src/Plugins/SchemaPlugin.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Schema (swagger) module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
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.1.
|
|
34
|
-
"@vercube/core": "0.0.
|
|
35
|
-
"@vercube/di": "0.0.
|
|
33
|
+
"zod": "4.1.12",
|
|
34
|
+
"@vercube/core": "0.0.25",
|
|
35
|
+
"@vercube/di": "0.0.25"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|