zod-openapi 5.0.0-beta.5 → 5.0.0-beta.7
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 +71 -208
- package/api/index.d.ts +1 -1
- package/dist/api.d.mts +16 -3
- package/dist/api.d.ts +16 -3
- package/dist/api.js +8 -0
- package/dist/api.mjs +4 -8
- package/dist/components-5_CJdR73.d.ts +543 -0
- package/dist/components-BaA49bb2.js +776 -0
- package/dist/components-DAYTA1Um.d.mts +543 -0
- package/dist/components-DMRr6ft0.mjs +741 -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 -7
- package/dist/index.d.ts +23 -7
- package/dist/index.js +20 -0
- package/dist/index.mjs +18 -59
- package/dist/zod-BvA30wad.mjs +5 -0
- package/dist/zod-i2t01GF0.js +40 -0
- package/package.json +14 -32
- package/dist/api.cjs +0 -8
- package/dist/components.chunk.cjs +0 -2463
- package/dist/components.chunk.mjs +0 -2464
- package/dist/create/components.d.ts +0 -125
- package/dist/create/content.d.ts +0 -8
- package/dist/create/document.d.ts +0 -91
- package/dist/create/parameters.d.ts +0 -9
- package/dist/create/schema/single.d.ts +0 -33
- package/dist/extend.cjs +0 -4
- package/dist/extend.d.mts +0 -1
- package/dist/extend.d.ts +0 -1
- package/dist/extend.mjs +0 -3
- package/dist/extendZod.chunk.cjs +0 -95
- package/dist/extendZod.chunk.mjs +0 -96
- package/dist/extendZod.d.ts +0 -6
- package/dist/extendZodSymbols.chunk.cjs +0 -5
- package/dist/extendZodSymbols.chunk.mjs +0 -6
- package/dist/extendZodSymbols.d.ts +0 -4
- package/dist/extendZodTypes.d.ts +0 -91
- package/dist/index.cjs +0 -60
- 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/openapi30.d.ts +0 -291
- package/dist/openapi3-ts/dist/model/openapi31.d.ts +0 -298
- package/dist/openapi3-ts/dist/model/specification-extension.d.ts +0 -7
- package/dist/openapi3-ts/dist/oas30.d.ts +0 -3
- package/dist/openapi3-ts/dist/oas31.d.ts +0 -3
- package/extend/index.d.ts +0 -1
- package/extend/package.json +0 -5
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentRegistry, ZodOpenApiComponentsObject } from "../components-DAYTA1Um.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/create/componentsSideEffects.d.ts
|
|
4
|
+
declare const registerSchemas: (schemas: ZodOpenApiComponentsObject["schemas"], registry: ComponentRegistry) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { registerSchemas };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentRegistry, ZodOpenApiComponentsObject } from "../components-5_CJdR73.js";
|
|
2
|
+
|
|
3
|
+
//#region src/create/componentsSideEffects.d.ts
|
|
4
|
+
declare const registerSchemas: (schemas: ZodOpenApiComponentsObject["schemas"], registry: ComponentRegistry) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { registerSchemas };
|
|
@@ -0,0 +1,48 @@
|
|
|
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;
|
|
@@ -0,0 +1,48 @@
|
|
|
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/index.d.mts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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-DAYTA1Um.mjs";
|
|
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.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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-BaA49bb2.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,60 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
components,
|
|
17
|
-
defaultComponents,
|
|
18
|
-
documentOptions
|
|
19
|
-
);
|
|
20
|
-
return {
|
|
21
|
-
...rest,
|
|
22
|
-
...createdPaths && { paths: createdPaths },
|
|
23
|
-
...createdWebhooks && { webhooks: createdWebhooks },
|
|
24
|
-
...createdComponents && { components: createdComponents }
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
const createSchema = (zodType, opts) => {
|
|
28
|
-
const components = getDefaultComponents(
|
|
29
|
-
{
|
|
30
|
-
schemas: opts == null ? void 0 : opts.components
|
|
31
|
-
},
|
|
32
|
-
opts == null ? void 0 : opts.openapi
|
|
33
|
-
);
|
|
34
|
-
const state = {
|
|
35
|
-
components,
|
|
36
|
-
type: (opts == null ? void 0 : opts.schemaType) ?? "output",
|
|
37
|
-
path: [],
|
|
38
|
-
visited: /* @__PURE__ */ new Set(),
|
|
39
|
-
documentOptions: opts
|
|
40
|
-
};
|
|
41
|
-
const schema = createSchema$1(zodType, state, ["createSchema"]);
|
|
42
|
-
const schemaComponents = createSchemaComponents({}, components);
|
|
43
|
-
return {
|
|
44
|
-
schema,
|
|
45
|
-
components: schemaComponents
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const oas30 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
49
|
-
__proto__: null
|
|
50
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
51
|
-
const oas31 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
52
|
-
__proto__: null
|
|
53
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
54
|
-
export {
|
|
55
|
-
createDocument,
|
|
56
|
-
createSchema,
|
|
57
|
-
extendZodWithOpenApi,
|
|
58
|
-
oas30,
|
|
59
|
-
oas31
|
|
1
|
+
import "./zod-BvA30wad.mjs";
|
|
2
|
+
import { createComponents, createPaths, createRegistry, createSchema } from "./components-DMRr6ft0.mjs";
|
|
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 = 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;
|
|
60
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.7",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -21,47 +21,29 @@
|
|
|
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": [
|
|
59
|
-
"api",
|
|
60
42
|
"dist",
|
|
61
|
-
"
|
|
43
|
+
"api"
|
|
62
44
|
],
|
|
63
45
|
"scripts": {
|
|
64
|
-
"build": "pnpm copy:types &&
|
|
46
|
+
"build": "pnpm copy:types && tsdown",
|
|
65
47
|
"copy:types": "skuba node scripts/copyTypes.ts",
|
|
66
48
|
"create:docs": " skuba node examples/simple/createSchema.ts && redocly build-docs examples/simple/openapi.yml --output=examples/simple/redoc-static.html",
|
|
67
49
|
"format": "skuba format",
|
|
@@ -73,21 +55,21 @@
|
|
|
73
55
|
},
|
|
74
56
|
"devDependencies": {
|
|
75
57
|
"@arethetypeswrong/cli": "0.18.1",
|
|
76
|
-
"@crackle/cli": "0.16.0",
|
|
77
58
|
"@redocly/cli": "1.34.3",
|
|
78
59
|
"@types/node": "22.15.21",
|
|
79
60
|
"eslint-plugin-zod-openapi": "1.0.0",
|
|
80
|
-
"openapi3-ts": "4.
|
|
81
|
-
"skuba": "11.0.1
|
|
61
|
+
"openapi3-ts": "4.5.0",
|
|
62
|
+
"skuba": "11.0.1",
|
|
63
|
+
"tsdown": "0.12.9",
|
|
82
64
|
"yaml": "2.8.0",
|
|
83
|
-
"zod": "3.25.
|
|
65
|
+
"zod": "3.25.67"
|
|
84
66
|
},
|
|
85
67
|
"peerDependencies": {
|
|
86
|
-
"zod": "^3.
|
|
68
|
+
"zod": "^3.25.67"
|
|
87
69
|
},
|
|
88
70
|
"packageManager": "pnpm@10.11.0",
|
|
89
71
|
"engines": {
|
|
90
|
-
"node": ">=
|
|
72
|
+
"node": ">=20"
|
|
91
73
|
},
|
|
92
74
|
"publishConfig": {
|
|
93
75
|
"provenance": true,
|
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.createMediaTypeSchema = components.createMediaTypeSchema;
|
|
6
|
-
exports.createParamOrRef = components.createParamOrRef;
|
|
7
|
-
exports.getDefaultComponents = components.getDefaultComponents;
|
|
8
|
-
exports.getZodObject = components.getZodObject;
|