zod-openapi 5.0.0-beta.8 → 5.0.0-beta.9
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 +2 -2
- package/dist/api.d.mts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +2 -3
- package/dist/api.mjs +1 -2
- package/dist/{components-DMRr6ft0.mjs → components-0QHfGwg0.mjs} +157 -107
- package/dist/{components-BBthgA_z.d.ts → components-26wns3Hd.d.mts} +8 -13
- package/dist/{components-BaA49bb2.js → components-CB3cj8u3.js} +192 -113
- package/dist/{components-DzDcF4aG.d.mts → components-CokUEQbL.d.ts} +8 -13
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +2 -5
- 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
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiMediaTypeObject, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBody, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiVersion, createDocument } from "./components-CokUEQbL.js";
|
|
2
2
|
import { core } from "zod/v4";
|
|
3
3
|
|
|
4
4
|
//#region rolldown:runtime
|
|
@@ -13,11 +13,11 @@ declare const createSchema: (schema: core.$ZodType, ctx?: {
|
|
|
13
13
|
io?: "input" | "output";
|
|
14
14
|
opts?: CreateDocumentOptions;
|
|
15
15
|
}) => {
|
|
16
|
-
schema:
|
|
16
|
+
schema: ReferenceObject | SchemaObject;
|
|
17
17
|
components: Record<string, SchemaObject>;
|
|
18
18
|
};
|
|
19
19
|
declare namespace oas31_d_exports {
|
|
20
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
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
export { CreateDocumentOptions, Override, SchemaResult, ZodObjectInput,
|
|
23
|
+
export { CreateDocumentOptions, Override, SchemaResult, ZodObjectInput, ZodOpenApiCallbackObject, ZodOpenApiCallbacksObject, ZodOpenApiComponentsObject, ZodOpenApiContentObject, ZodOpenApiHeaderObject, ZodOpenApiHeadersObject, ZodOpenApiMediaTypeObject, ZodOpenApiObject, ZodOpenApiOperationObject, ZodOpenApiParameterObject, ZodOpenApiParameters, ZodOpenApiPathItemObject, ZodOpenApiPathsObject, ZodOpenApiRequestBody, ZodOpenApiRequestBodyObject, ZodOpenApiResponseObject, ZodOpenApiResponsesObject, ZodOpenApiSchemaObject, ZodOpenApiVersion, createDocument, createSchema, oas31_d_exports as oas31 };
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { createComponents, createPaths, createRegistry, createSchema } from "./components-DMRr6ft0.mjs";
|
|
1
|
+
import { createComponents, createPaths, createRegistry, createSchema } from "./components-0QHfGwg0.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/create/document.ts
|
|
5
4
|
const createDocument = (zodOpenApiObject, opts = {}) => {
|
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.9",
|
|
4
4
|
"description": "Convert Zod Schemas to OpenAPI v3.x documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -20,10 +20,7 @@
|
|
|
20
20
|
"url": "git+ssh://git@github.com/samchungy/zod-openapi.git"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
|
-
"sideEffects":
|
|
24
|
-
"dist/create/componentsSideEffects.mjs",
|
|
25
|
-
"dist/create/componentsSideEffects.js"
|
|
26
|
-
],
|
|
23
|
+
"sideEffects": false,
|
|
27
24
|
"exports": {
|
|
28
25
|
".": {
|
|
29
26
|
"import": "./dist/index.mjs",
|
|
@@ -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
|
-
});
|