zod-openapi 5.0.0-beta.3 → 5.0.0-beta.4
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 +1 -1
- package/dist/api.d.mts +22 -5
- package/dist/api.d.ts +22 -5
- package/dist/api.js +8 -0
- package/dist/api.mjs +4 -8
- package/dist/components-5_CJdR73.d.ts +543 -0
- package/dist/components-CXjVnBr-.js +782 -0
- package/dist/components-CvutxtFV.mjs +741 -0
- package/dist/components-DAYTA1Um.d.mts +543 -0
- package/dist/create/componentsSideEffects.d.mts +6 -0
- package/dist/create/componentsSideEffects.d.ts +6 -0
- package/dist/create/componentsSideEffects.js +48 -0
- package/dist/create/componentsSideEffects.mjs +48 -0
- package/dist/index.d.mts +23 -5
- package/dist/index.d.ts +23 -5
- package/dist/index.js +20 -0
- package/dist/index.mjs +17 -22
- package/dist/zod-BvA30wad.mjs +5 -0
- package/dist/zod-i2t01GF0.js +40 -0
- package/package.json +9 -26
- package/api/index.d.ts +0 -1
- package/api/package.json +0 -5
- package/dist/api.cjs +0 -8
- package/dist/components.chunk.cjs +0 -1023
- package/dist/components.chunk.mjs +0 -1024
- package/dist/create/components.d.ts +0 -65
- package/dist/create/content.d.ts +0 -10
- package/dist/create/document.d.ts +0 -97
- package/dist/create/object.d.ts +0 -5
- package/dist/create/parameters.d.ts +0 -14
- package/dist/create/schema/schema.d.ts +0 -21
- package/dist/index.cjs +0 -23
- package/dist/openapi.d.ts +0 -5
- package/dist/openapi3-ts/dist/model/oas-common.d.ts +0 -16
- package/dist/openapi3-ts/dist/model/openapi31.d.ts +0 -302
- package/dist/openapi3-ts/dist/model/specification-extension.d.ts +0 -7
- package/dist/openapi3-ts/oas31.d.ts +0 -3
- package/dist/zod.d.ts +0 -49
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BaseParameterObject, CallbackObject, CallbacksObject, ComponentRegistry, ComponentsObject, ContactObject, ContentObject, CreateDocumentOptions, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, IExtensionName, IExtensionType, ISpecificationExtension, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, Override, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, TagObject, XmlObject, ZodObjectInput, ZodObjectInputType, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiMediaTypeObject, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBody, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiVersion, createDocument, isAnyZodType } from "./components-5_CJdR73.js";
|
|
2
|
+
import { core } from "zod/v4";
|
|
3
|
+
|
|
4
|
+
//#region rolldown:runtime
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/create/schema/schema.d.ts
|
|
7
|
+
interface SchemaResult {
|
|
8
|
+
schema: SchemaObject | ReferenceObject;
|
|
9
|
+
components: Record<string, SchemaObject>;
|
|
10
|
+
}
|
|
11
|
+
declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
12
|
+
registry?: ComponentRegistry;
|
|
13
|
+
io?: "input" | "output";
|
|
14
|
+
opts?: CreateDocumentOptions;
|
|
15
|
+
}) => {
|
|
16
|
+
schema: SchemaObject | ReferenceObject;
|
|
17
|
+
components: Record<string, SchemaObject>;
|
|
18
|
+
};
|
|
19
|
+
declare namespace oas31_d_exports {
|
|
20
|
+
export { BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, IExtensionName, IExtensionType, ISpecificationExtension, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, TagObject, XmlObject };
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { CreateDocumentOptions, Override, SchemaResult, ZodObjectInput, ZodObjectInputType, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiMediaTypeObject, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBody, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiVersion, createDocument, createSchema, isAnyZodType, oas31_d_exports as oas31 };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require('./zod-i2t01GF0.js');
|
|
2
|
+
const require_components = require('./components-CXjVnBr-.js');
|
|
3
|
+
|
|
4
|
+
//#region src/create/document.ts
|
|
5
|
+
const createDocument = (zodOpenApiObject, opts = {}) => {
|
|
6
|
+
const { paths, webhooks, components,...rest } = zodOpenApiObject;
|
|
7
|
+
const document = rest;
|
|
8
|
+
const registry = require_components.createRegistry(components);
|
|
9
|
+
const createdPaths = require_components.createPaths(paths, registry, ["paths"]);
|
|
10
|
+
if (createdPaths) document.paths = createdPaths;
|
|
11
|
+
const createdWebhooks = require_components.createPaths(webhooks, registry, ["webhooks"]);
|
|
12
|
+
if (createdWebhooks) document.webhooks = createdWebhooks;
|
|
13
|
+
const createdComponents = require_components.createComponents(registry, opts);
|
|
14
|
+
if (Object.keys(createdComponents).length > 0) document.components = createdComponents;
|
|
15
|
+
return document;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.createDocument = createDocument;
|
|
20
|
+
exports.createSchema = require_components.createSchema;
|
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createSchema } from "./components.
|
|
1
|
+
import "./zod-BvA30wad.mjs";
|
|
2
|
+
import { createComponents, createPaths, createRegistry, createSchema } from "./components-CvutxtFV.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/create/document.ts
|
|
3
5
|
const createDocument = (zodOpenApiObject, opts = {}) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const createdComponents = createComponents(registry, opts);
|
|
16
|
-
if (Object.keys(createdComponents).length > 0) {
|
|
17
|
-
document.components = createdComponents;
|
|
18
|
-
}
|
|
19
|
-
return document;
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
createDocument,
|
|
23
|
-
createSchema
|
|
6
|
+
const { paths, webhooks, components,...rest } = zodOpenApiObject;
|
|
7
|
+
const document = rest;
|
|
8
|
+
const registry = createRegistry(components);
|
|
9
|
+
const createdPaths = createPaths(paths, registry, ["paths"]);
|
|
10
|
+
if (createdPaths) document.paths = createdPaths;
|
|
11
|
+
const createdWebhooks = createPaths(webhooks, registry, ["webhooks"]);
|
|
12
|
+
if (createdWebhooks) document.webhooks = createdWebhooks;
|
|
13
|
+
const createdComponents = createComponents(registry, opts);
|
|
14
|
+
if (Object.keys(createdComponents).length > 0) document.components = createdComponents;
|
|
15
|
+
return document;
|
|
24
16
|
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { createDocument, createSchema };
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod-openapi",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.4",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -21,38 +21,21 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"sideEffects": [
|
|
24
|
-
"dist/
|
|
25
|
-
"dist/
|
|
26
|
-
"src/entries/extend.ts"
|
|
24
|
+
"dist/create/componentsSideEffects.mjs",
|
|
25
|
+
"dist/create/componentsSideEffects.js"
|
|
27
26
|
],
|
|
28
27
|
"exports": {
|
|
29
28
|
".": {
|
|
30
|
-
"types": {
|
|
31
|
-
"import": "./dist/index.d.mts",
|
|
32
|
-
"require": "./dist/index.d.ts"
|
|
33
|
-
},
|
|
34
29
|
"import": "./dist/index.mjs",
|
|
35
|
-
"require": "./dist/index.
|
|
30
|
+
"require": "./dist/index.js"
|
|
36
31
|
},
|
|
37
32
|
"./api": {
|
|
38
|
-
"types": {
|
|
39
|
-
"import": "./dist/api.d.mts",
|
|
40
|
-
"require": "./dist/api.d.ts"
|
|
41
|
-
},
|
|
42
33
|
"import": "./dist/api.mjs",
|
|
43
|
-
"require": "./dist/api.
|
|
44
|
-
},
|
|
45
|
-
"./extend": {
|
|
46
|
-
"types": {
|
|
47
|
-
"import": "./dist/extend.d.mts",
|
|
48
|
-
"require": "./dist/extend.d.ts"
|
|
49
|
-
},
|
|
50
|
-
"import": "./dist/extend.mjs",
|
|
51
|
-
"require": "./dist/extend.cjs"
|
|
34
|
+
"require": "./dist/api.js"
|
|
52
35
|
},
|
|
53
36
|
"./package.json": "./package.json"
|
|
54
37
|
},
|
|
55
|
-
"main": "./dist/index.
|
|
38
|
+
"main": "./dist/index.js",
|
|
56
39
|
"module": "./dist/index.mjs",
|
|
57
40
|
"types": "./dist/index.d.ts",
|
|
58
41
|
"files": [
|
|
@@ -61,7 +44,7 @@
|
|
|
61
44
|
"extend"
|
|
62
45
|
],
|
|
63
46
|
"scripts": {
|
|
64
|
-
"build": "pnpm copy:types &&
|
|
47
|
+
"build": "pnpm copy:types && tsdown",
|
|
65
48
|
"copy:types": "skuba node scripts/copyTypes.ts",
|
|
66
49
|
"create:docs": " skuba node examples/simple/createSchema.ts && redocly build-docs examples/simple/openapi.yml --output=examples/simple/redoc-static.html",
|
|
67
50
|
"format": "skuba format",
|
|
@@ -73,12 +56,12 @@
|
|
|
73
56
|
},
|
|
74
57
|
"devDependencies": {
|
|
75
58
|
"@arethetypeswrong/cli": "0.18.1",
|
|
76
|
-
"@crackle/cli": "0.16.0",
|
|
77
59
|
"@redocly/cli": "1.34.3",
|
|
78
60
|
"@types/node": "22.15.21",
|
|
79
61
|
"eslint-plugin-zod-openapi": "1.0.0",
|
|
80
62
|
"openapi3-ts": "4.5.0",
|
|
81
63
|
"skuba": "11.0.1",
|
|
64
|
+
"tsdown": "0.12.9",
|
|
82
65
|
"yaml": "2.8.0",
|
|
83
66
|
"zod": "3.25.67"
|
|
84
67
|
},
|
|
@@ -87,7 +70,7 @@
|
|
|
87
70
|
},
|
|
88
71
|
"packageManager": "pnpm@10.11.0",
|
|
89
72
|
"engines": {
|
|
90
|
-
"node": ">=
|
|
73
|
+
"node": ">=20.9.0"
|
|
91
74
|
},
|
|
92
75
|
"publishConfig": {
|
|
93
76
|
"provenance": true,
|
package/api/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../dist/api";
|
package/api/package.json
DELETED
package/dist/api.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const components = require("./components.chunk.cjs");
|
|
4
|
-
exports.createComponents = components.createComponents;
|
|
5
|
-
exports.createMediaTypeObject = components.createMediaTypeObject;
|
|
6
|
-
exports.createParameter = components.createParameter;
|
|
7
|
-
exports.createRegistry = components.createRegistry;
|
|
8
|
-
exports.unwrapZodObject = components.unwrapZodObject;
|