zod-openapi 5.0.0-beta.8 → 5.0.0
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/README.md +185 -47
- package/dist/api.d.mts +2 -11
- package/dist/api.d.ts +2 -11
- package/dist/api.js +2 -4
- package/dist/api.mjs +2 -3
- package/dist/components-BRLB21IO.js +958 -0
- package/dist/components-DuIz-WUQ.mjs +900 -0
- package/dist/{components-BBthgA_z.d.ts → components-Dus8apcN.d.mts} +177 -90
- package/dist/{components-DzDcF4aG.d.mts → components-T2U31sZh.d.ts} +177 -90
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +7 -8
- package/dist/components-BaA49bb2.js +0 -776
- package/dist/components-DMRr6ft0.mjs +0 -741
- package/dist/create/componentsSideEffects.d.mts +0 -6
- package/dist/create/componentsSideEffects.d.ts +0 -6
- package/dist/create/componentsSideEffects.js +0 -48
- package/dist/create/componentsSideEffects.mjs +0 -48
- package/dist/zod-BvA30wad.mjs +0 -5
- package/dist/zod-i2t01GF0.js +0 -40
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentRegistry, ZodOpenApiComponentsObject } from "../components-DzDcF4aG.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/create/componentsSideEffects.d.ts
|
|
4
|
-
declare const registerSchemas: (schemas: ZodOpenApiComponentsObject["schemas"], registry: ComponentRegistry) => void;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { registerSchemas };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentRegistry, ZodOpenApiComponentsObject } from "../components-BBthgA_z.js";
|
|
2
|
-
|
|
3
|
-
//#region src/create/componentsSideEffects.d.ts
|
|
4
|
-
declare const registerSchemas: (schemas: ZodOpenApiComponentsObject["schemas"], registry: ComponentRegistry) => void;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { registerSchemas };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const require_zod = require('../zod-i2t01GF0.js');
|
|
2
|
-
const zod_v4 = require_zod.__toESM(require("zod/v4"));
|
|
3
|
-
|
|
4
|
-
//#region src/create/componentsSideEffects.ts
|
|
5
|
-
const registerSchemas = (schemas, registry) => {
|
|
6
|
-
if (!schemas) return;
|
|
7
|
-
for (const [key, schema] of Object.entries(schemas)) {
|
|
8
|
-
if (registry.schemas.ids.has(key)) throw new Error(`Schema "${key}" is already registered`);
|
|
9
|
-
if (require_zod.isAnyZodType(schema)) {
|
|
10
|
-
const inputSchemaObject = {};
|
|
11
|
-
const outputSchemaObject = {};
|
|
12
|
-
const identifier = `components > schemas > ${key}`;
|
|
13
|
-
registry.schemas.input.set(identifier, {
|
|
14
|
-
zodType: schema,
|
|
15
|
-
schemaObject: inputSchemaObject
|
|
16
|
-
});
|
|
17
|
-
registry.schemas.output.set(identifier, {
|
|
18
|
-
zodType: schema,
|
|
19
|
-
schemaObject: outputSchemaObject
|
|
20
|
-
});
|
|
21
|
-
registry.schemas.manual.set(key, {
|
|
22
|
-
identifier,
|
|
23
|
-
io: {
|
|
24
|
-
input: {
|
|
25
|
-
schemaObject: inputSchemaObject,
|
|
26
|
-
used: 0
|
|
27
|
-
},
|
|
28
|
-
output: {
|
|
29
|
-
schemaObject: outputSchemaObject,
|
|
30
|
-
used: 0
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
zodType: schema
|
|
34
|
-
});
|
|
35
|
-
const meta = zod_v4.globalRegistry.get(schema);
|
|
36
|
-
if (meta?.id) continue;
|
|
37
|
-
zod_v4.globalRegistry.add(schema, {
|
|
38
|
-
...meta,
|
|
39
|
-
id: key
|
|
40
|
-
});
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
registry.schemas.ids.set(key, schema);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
exports.registerSchemas = registerSchemas;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { isAnyZodType } from "../zod-BvA30wad.mjs";
|
|
2
|
-
import { globalRegistry } from "zod/v4";
|
|
3
|
-
|
|
4
|
-
//#region src/create/componentsSideEffects.ts
|
|
5
|
-
const registerSchemas = (schemas, registry) => {
|
|
6
|
-
if (!schemas) return;
|
|
7
|
-
for (const [key, schema] of Object.entries(schemas)) {
|
|
8
|
-
if (registry.schemas.ids.has(key)) throw new Error(`Schema "${key}" is already registered`);
|
|
9
|
-
if (isAnyZodType(schema)) {
|
|
10
|
-
const inputSchemaObject = {};
|
|
11
|
-
const outputSchemaObject = {};
|
|
12
|
-
const identifier = `components > schemas > ${key}`;
|
|
13
|
-
registry.schemas.input.set(identifier, {
|
|
14
|
-
zodType: schema,
|
|
15
|
-
schemaObject: inputSchemaObject
|
|
16
|
-
});
|
|
17
|
-
registry.schemas.output.set(identifier, {
|
|
18
|
-
zodType: schema,
|
|
19
|
-
schemaObject: outputSchemaObject
|
|
20
|
-
});
|
|
21
|
-
registry.schemas.manual.set(key, {
|
|
22
|
-
identifier,
|
|
23
|
-
io: {
|
|
24
|
-
input: {
|
|
25
|
-
schemaObject: inputSchemaObject,
|
|
26
|
-
used: 0
|
|
27
|
-
},
|
|
28
|
-
output: {
|
|
29
|
-
schemaObject: outputSchemaObject,
|
|
30
|
-
used: 0
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
zodType: schema
|
|
34
|
-
});
|
|
35
|
-
const meta = globalRegistry.get(schema);
|
|
36
|
-
if (meta?.id) continue;
|
|
37
|
-
globalRegistry.add(schema, {
|
|
38
|
-
...meta,
|
|
39
|
-
id: key
|
|
40
|
-
});
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
registry.schemas.ids.set(key, schema);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { registerSchemas };
|
package/dist/zod-BvA30wad.mjs
DELETED
package/dist/zod-i2t01GF0.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
|
|
25
|
-
//#region src/zod.ts
|
|
26
|
-
const isAnyZodType = (schema) => typeof schema === "object" && schema !== null && "_zod" in schema;
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
Object.defineProperty(exports, '__toESM', {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () {
|
|
32
|
-
return __toESM;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, 'isAnyZodType', {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () {
|
|
38
|
-
return isAnyZodType;
|
|
39
|
-
}
|
|
40
|
-
});
|