zod-openapi 5.0.0-beta.4 → 5.0.0-beta.5

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.
Files changed (51) hide show
  1. package/README.md +208 -71
  2. package/api/index.d.ts +1 -0
  3. package/api/package.json +5 -0
  4. package/dist/api.cjs +8 -0
  5. package/dist/api.d.mts +3 -22
  6. package/dist/api.d.ts +3 -22
  7. package/dist/api.mjs +8 -4
  8. package/dist/components.chunk.cjs +2463 -0
  9. package/dist/components.chunk.mjs +2464 -0
  10. package/dist/create/components.d.ts +125 -0
  11. package/dist/create/content.d.ts +8 -0
  12. package/dist/create/document.d.ts +91 -0
  13. package/dist/create/parameters.d.ts +9 -0
  14. package/dist/create/schema/single.d.ts +33 -0
  15. package/dist/extend.cjs +4 -0
  16. package/dist/extend.d.mts +1 -0
  17. package/dist/extend.d.ts +1 -0
  18. package/dist/extend.mjs +3 -0
  19. package/dist/extendZod.chunk.cjs +95 -0
  20. package/dist/extendZod.chunk.mjs +96 -0
  21. package/dist/extendZod.d.ts +6 -0
  22. package/dist/extendZodSymbols.chunk.cjs +5 -0
  23. package/dist/extendZodSymbols.chunk.mjs +6 -0
  24. package/dist/extendZodSymbols.d.ts +4 -0
  25. package/dist/extendZodTypes.d.ts +91 -0
  26. package/dist/index.cjs +60 -0
  27. package/dist/index.d.mts +7 -23
  28. package/dist/index.d.ts +7 -23
  29. package/dist/index.mjs +59 -18
  30. package/dist/openapi.d.ts +5 -0
  31. package/dist/openapi3-ts/dist/model/oas-common.d.ts +16 -0
  32. package/dist/openapi3-ts/dist/model/openapi30.d.ts +291 -0
  33. package/dist/openapi3-ts/dist/model/openapi31.d.ts +298 -0
  34. package/dist/openapi3-ts/dist/model/specification-extension.d.ts +7 -0
  35. package/dist/openapi3-ts/dist/oas30.d.ts +3 -0
  36. package/dist/openapi3-ts/dist/oas31.d.ts +3 -0
  37. package/extend/index.d.ts +1 -0
  38. package/extend/package.json +5 -0
  39. package/package.json +30 -13
  40. package/dist/api.js +0 -8
  41. package/dist/components-5_CJdR73.d.ts +0 -543
  42. package/dist/components-CXjVnBr-.js +0 -782
  43. package/dist/components-CvutxtFV.mjs +0 -741
  44. package/dist/components-DAYTA1Um.d.mts +0 -543
  45. package/dist/create/componentsSideEffects.d.mts +0 -6
  46. package/dist/create/componentsSideEffects.d.ts +0 -6
  47. package/dist/create/componentsSideEffects.js +0 -48
  48. package/dist/create/componentsSideEffects.mjs +0 -48
  49. package/dist/index.js +0 -20
  50. package/dist/zod-BvA30wad.mjs +0 -5
  51. package/dist/zod-i2t01GF0.js +0 -40
@@ -0,0 +1,298 @@
1
+ import { ServerObject } from './oas-common.js';
2
+ export { ServerVariableObject } from './oas-common.js';
3
+ import { ISpecificationExtension } from './specification-extension.js';
4
+
5
+ interface OpenAPIObject extends ISpecificationExtension {
6
+ openapi: string;
7
+ info: InfoObject;
8
+ servers?: ServerObject[];
9
+ paths?: PathsObject;
10
+ components?: ComponentsObject;
11
+ security?: SecurityRequirementObject[];
12
+ tags?: TagObject[];
13
+ externalDocs?: ExternalDocumentationObject;
14
+ webhooks?: PathsObject;
15
+ }
16
+ interface InfoObject extends ISpecificationExtension {
17
+ title: string;
18
+ description?: string;
19
+ termsOfService?: string;
20
+ contact?: ContactObject;
21
+ license?: LicenseObject;
22
+ version: string;
23
+ }
24
+ interface ContactObject extends ISpecificationExtension {
25
+ name?: string;
26
+ url?: string;
27
+ email?: string;
28
+ }
29
+ interface LicenseObject extends ISpecificationExtension {
30
+ name: string;
31
+ identifier?: string;
32
+ url?: string;
33
+ }
34
+ interface ComponentsObject extends ISpecificationExtension {
35
+ schemas?: {
36
+ [schema: string]: SchemaObject | ReferenceObject;
37
+ };
38
+ responses?: {
39
+ [response: string]: ResponseObject | ReferenceObject;
40
+ };
41
+ parameters?: {
42
+ [parameter: string]: ParameterObject | ReferenceObject;
43
+ };
44
+ examples?: {
45
+ [example: string]: ExampleObject | ReferenceObject;
46
+ };
47
+ requestBodies?: {
48
+ [request: string]: RequestBodyObject | ReferenceObject;
49
+ };
50
+ headers?: {
51
+ [header: string]: HeaderObject | ReferenceObject;
52
+ };
53
+ securitySchemes?: {
54
+ [securityScheme: string]: SecuritySchemeObject | ReferenceObject;
55
+ };
56
+ links?: {
57
+ [link: string]: LinkObject | ReferenceObject;
58
+ };
59
+ callbacks?: {
60
+ [callback: string]: CallbackObject | ReferenceObject;
61
+ };
62
+ }
63
+ interface PathsObject extends ISpecificationExtension {
64
+ [path: string]: PathItemObject;
65
+ }
66
+ type PathObject = PathsObject;
67
+ interface PathItemObject extends ISpecificationExtension {
68
+ $ref?: string;
69
+ summary?: string;
70
+ description?: string;
71
+ get?: OperationObject;
72
+ put?: OperationObject;
73
+ post?: OperationObject;
74
+ delete?: OperationObject;
75
+ options?: OperationObject;
76
+ head?: OperationObject;
77
+ patch?: OperationObject;
78
+ trace?: OperationObject;
79
+ servers?: ServerObject[];
80
+ parameters?: (ParameterObject | ReferenceObject)[];
81
+ }
82
+ interface OperationObject extends ISpecificationExtension {
83
+ tags?: string[];
84
+ summary?: string;
85
+ description?: string;
86
+ externalDocs?: ExternalDocumentationObject;
87
+ operationId?: string;
88
+ parameters?: (ParameterObject | ReferenceObject)[];
89
+ requestBody?: RequestBodyObject | ReferenceObject;
90
+ responses?: ResponsesObject;
91
+ callbacks?: CallbacksObject;
92
+ deprecated?: boolean;
93
+ security?: SecurityRequirementObject[];
94
+ servers?: ServerObject[];
95
+ }
96
+ interface ExternalDocumentationObject extends ISpecificationExtension {
97
+ description?: string;
98
+ url: string;
99
+ }
100
+ type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
101
+ type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
102
+ interface BaseParameterObject extends ISpecificationExtension {
103
+ description?: string;
104
+ required?: boolean;
105
+ deprecated?: boolean;
106
+ allowEmptyValue?: boolean;
107
+ style?: ParameterStyle;
108
+ explode?: boolean;
109
+ allowReserved?: boolean;
110
+ schema?: SchemaObject | ReferenceObject;
111
+ examples?: {
112
+ [param: string]: ExampleObject | ReferenceObject;
113
+ };
114
+ example?: any;
115
+ content?: ContentObject;
116
+ }
117
+ interface ParameterObject extends BaseParameterObject {
118
+ name: string;
119
+ in: ParameterLocation;
120
+ }
121
+ interface RequestBodyObject extends ISpecificationExtension {
122
+ description?: string;
123
+ content: ContentObject;
124
+ required?: boolean;
125
+ }
126
+ interface ContentObject {
127
+ [mediatype: string]: MediaTypeObject;
128
+ }
129
+ interface MediaTypeObject extends ISpecificationExtension {
130
+ schema?: SchemaObject | ReferenceObject;
131
+ examples?: ExamplesObject;
132
+ example?: any;
133
+ encoding?: EncodingObject;
134
+ }
135
+ interface EncodingObject extends ISpecificationExtension {
136
+ [property: string]: EncodingPropertyObject | any;
137
+ }
138
+ interface EncodingPropertyObject {
139
+ contentType?: string;
140
+ headers?: {
141
+ [key: string]: HeaderObject | ReferenceObject;
142
+ };
143
+ style?: string;
144
+ explode?: boolean;
145
+ allowReserved?: boolean;
146
+ [key: string]: any;
147
+ }
148
+ interface ResponsesObject extends ISpecificationExtension {
149
+ default?: ResponseObject | ReferenceObject;
150
+ [statuscode: string]: ResponseObject | ReferenceObject | any;
151
+ }
152
+ interface ResponseObject extends ISpecificationExtension {
153
+ description: string;
154
+ headers?: HeadersObject;
155
+ content?: ContentObject;
156
+ links?: LinksObject;
157
+ }
158
+ interface CallbacksObject extends ISpecificationExtension {
159
+ [name: string]: CallbackObject | ReferenceObject | any;
160
+ }
161
+ interface CallbackObject extends ISpecificationExtension {
162
+ [name: string]: PathItemObject | any;
163
+ }
164
+ interface HeadersObject {
165
+ [name: string]: HeaderObject | ReferenceObject;
166
+ }
167
+ interface ExampleObject {
168
+ summary?: string;
169
+ description?: string;
170
+ value?: any;
171
+ externalValue?: string;
172
+ [property: string]: any;
173
+ }
174
+ interface LinksObject {
175
+ [name: string]: LinkObject | ReferenceObject;
176
+ }
177
+ interface LinkObject extends ISpecificationExtension {
178
+ operationRef?: string;
179
+ operationId?: string;
180
+ parameters?: LinkParametersObject;
181
+ requestBody?: any | string;
182
+ description?: string;
183
+ server?: ServerObject;
184
+ [property: string]: any;
185
+ }
186
+ interface LinkParametersObject {
187
+ [name: string]: any | string;
188
+ }
189
+ interface HeaderObject extends BaseParameterObject {
190
+ $ref?: string;
191
+ }
192
+ interface TagObject extends ISpecificationExtension {
193
+ name: string;
194
+ description?: string;
195
+ externalDocs?: ExternalDocumentationObject;
196
+ [extension: string]: any;
197
+ }
198
+ interface ExamplesObject {
199
+ [name: string]: ExampleObject | ReferenceObject;
200
+ }
201
+ interface ReferenceObject {
202
+ $ref: string;
203
+ summary?: string;
204
+ description?: string;
205
+ }
206
+ type SchemaObjectType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
207
+ interface SchemaObject extends ISpecificationExtension {
208
+ discriminator?: DiscriminatorObject;
209
+ readOnly?: boolean;
210
+ writeOnly?: boolean;
211
+ xml?: XmlObject;
212
+ externalDocs?: ExternalDocumentationObject;
213
+ example?: any;
214
+ examples?: any[];
215
+ deprecated?: boolean;
216
+ type?: SchemaObjectType | SchemaObjectType[];
217
+ format?: 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password' | string;
218
+ allOf?: (SchemaObject | ReferenceObject)[];
219
+ oneOf?: (SchemaObject | ReferenceObject)[];
220
+ anyOf?: (SchemaObject | ReferenceObject)[];
221
+ not?: SchemaObject | ReferenceObject;
222
+ items?: SchemaObject | ReferenceObject;
223
+ properties?: {
224
+ [propertyName: string]: SchemaObject | ReferenceObject;
225
+ };
226
+ additionalProperties?: SchemaObject | ReferenceObject | boolean;
227
+ propertyNames?: SchemaObject | ReferenceObject;
228
+ description?: string;
229
+ default?: any;
230
+ title?: string;
231
+ multipleOf?: number;
232
+ maximum?: number;
233
+ const?: any;
234
+ exclusiveMaximum?: number;
235
+ minimum?: number;
236
+ exclusiveMinimum?: number;
237
+ maxLength?: number;
238
+ minLength?: number;
239
+ pattern?: string;
240
+ maxItems?: number;
241
+ minItems?: number;
242
+ uniqueItems?: boolean;
243
+ maxProperties?: number;
244
+ minProperties?: number;
245
+ required?: string[];
246
+ enum?: any[];
247
+ prefixItems?: (SchemaObject | ReferenceObject)[];
248
+ contentMediaType?: string;
249
+ contentEncoding?: string;
250
+ }
251
+ interface SchemasObject {
252
+ [schema: string]: SchemaObject;
253
+ }
254
+ interface DiscriminatorObject {
255
+ propertyName: string;
256
+ mapping?: {
257
+ [key: string]: string;
258
+ };
259
+ }
260
+ interface XmlObject extends ISpecificationExtension {
261
+ name?: string;
262
+ namespace?: string;
263
+ prefix?: string;
264
+ attribute?: boolean;
265
+ wrapped?: boolean;
266
+ }
267
+ type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
268
+ interface SecuritySchemeObject extends ISpecificationExtension {
269
+ type: SecuritySchemeType;
270
+ description?: string;
271
+ name?: string;
272
+ in?: string;
273
+ scheme?: string;
274
+ bearerFormat?: string;
275
+ flows?: OAuthFlowsObject;
276
+ openIdConnectUrl?: string;
277
+ }
278
+ interface OAuthFlowsObject extends ISpecificationExtension {
279
+ implicit?: OAuthFlowObject;
280
+ password?: OAuthFlowObject;
281
+ clientCredentials?: OAuthFlowObject;
282
+ authorizationCode?: OAuthFlowObject;
283
+ }
284
+ interface OAuthFlowObject extends ISpecificationExtension {
285
+ authorizationUrl?: string;
286
+ tokenUrl?: string;
287
+ refreshUrl?: string;
288
+ scopes: ScopesObject;
289
+ }
290
+ interface ScopesObject extends ISpecificationExtension {
291
+ [scope: string]: any;
292
+ }
293
+ interface SecurityRequirementObject {
294
+ [name: string]: string[];
295
+ }
296
+
297
+ export { ISpecificationExtension, ServerObject };
298
+ export type { BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, 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, TagObject, XmlObject };
@@ -0,0 +1,7 @@
1
+ type IExtensionName = `x-${string}`;
2
+ type IExtensionType = any;
3
+ type ISpecificationExtension = {
4
+ [extensionName: IExtensionName]: IExtensionType;
5
+ };
6
+
7
+ export type { IExtensionName, IExtensionType, ISpecificationExtension };
@@ -0,0 +1,3 @@
1
+ export { BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, PathItemObject, PathObject, PathsObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemaObjectFormat, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, TagObject, XmlObject } from './model/openapi30.js';
2
+ export { IExtensionName, IExtensionType, ISpecificationExtension } from './model/specification-extension.js';
3
+ export { ServerObject, ServerVariableObject } from './model/oas-common.js';
@@ -0,0 +1,3 @@
1
+ export { BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, HeaderObject, HeadersObject, 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, TagObject, XmlObject } from './model/openapi31.js';
2
+ export { IExtensionName, IExtensionType, ISpecificationExtension } from './model/specification-extension.js';
3
+ export { ServerObject, ServerVariableObject } from './model/oas-common.js';
@@ -0,0 +1 @@
1
+ export * from "../dist/extend";
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/extend.cjs",
3
+ "module": "../dist/extend.mjs",
4
+ "types": "./index.d.ts"
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod-openapi",
3
- "version": "5.0.0-beta.4",
3
+ "version": "5.0.0-beta.5",
4
4
  "description": "Convert Zod Schemas to OpenAPI v3.x documentation",
5
5
  "keywords": [
6
6
  "typescript",
@@ -21,21 +21,38 @@
21
21
  },
22
22
  "license": "MIT",
23
23
  "sideEffects": [
24
- "dist/create/componentsSideEffects.mjs",
25
- "dist/create/componentsSideEffects.js"
24
+ "dist/extend.*",
25
+ "dist/side-effects/**",
26
+ "src/entries/extend.ts"
26
27
  ],
27
28
  "exports": {
28
29
  ".": {
30
+ "types": {
31
+ "import": "./dist/index.d.mts",
32
+ "require": "./dist/index.d.ts"
33
+ },
29
34
  "import": "./dist/index.mjs",
30
- "require": "./dist/index.js"
35
+ "require": "./dist/index.cjs"
31
36
  },
32
37
  "./api": {
38
+ "types": {
39
+ "import": "./dist/api.d.mts",
40
+ "require": "./dist/api.d.ts"
41
+ },
33
42
  "import": "./dist/api.mjs",
34
- "require": "./dist/api.js"
43
+ "require": "./dist/api.cjs"
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"
35
52
  },
36
53
  "./package.json": "./package.json"
37
54
  },
38
- "main": "./dist/index.js",
55
+ "main": "./dist/index.cjs",
39
56
  "module": "./dist/index.mjs",
40
57
  "types": "./dist/index.d.ts",
41
58
  "files": [
@@ -44,7 +61,7 @@
44
61
  "extend"
45
62
  ],
46
63
  "scripts": {
47
- "build": "pnpm copy:types && tsdown",
64
+ "build": "pnpm copy:types && crackle package",
48
65
  "copy:types": "skuba node scripts/copyTypes.ts",
49
66
  "create:docs": " skuba node examples/simple/createSchema.ts && redocly build-docs examples/simple/openapi.yml --output=examples/simple/redoc-static.html",
50
67
  "format": "skuba format",
@@ -56,21 +73,21 @@
56
73
  },
57
74
  "devDependencies": {
58
75
  "@arethetypeswrong/cli": "0.18.1",
76
+ "@crackle/cli": "0.16.0",
59
77
  "@redocly/cli": "1.34.3",
60
78
  "@types/node": "22.15.21",
61
79
  "eslint-plugin-zod-openapi": "1.0.0",
62
- "openapi3-ts": "4.5.0",
63
- "skuba": "11.0.1",
64
- "tsdown": "0.12.9",
80
+ "openapi3-ts": "4.4.0",
81
+ "skuba": "11.0.1-fix-node16-compatibility-20250523051131",
65
82
  "yaml": "2.8.0",
66
- "zod": "3.25.67"
83
+ "zod": "3.25.23"
67
84
  },
68
85
  "peerDependencies": {
69
- "zod": "^3.25.67"
86
+ "zod": "^3.21.4"
70
87
  },
71
88
  "packageManager": "pnpm@10.11.0",
72
89
  "engines": {
73
- "node": ">=20.9.0"
90
+ "node": ">=18"
74
91
  },
75
92
  "publishConfig": {
76
93
  "provenance": true,
package/dist/api.js DELETED
@@ -1,8 +0,0 @@
1
- require('./zod-i2t01GF0.js');
2
- const require_components = require('./components-CXjVnBr-.js');
3
-
4
- exports.createComponents = require_components.createComponents;
5
- exports.createMediaTypeObject = require_components.createMediaTypeObject;
6
- exports.createParameter = require_components.createParameter;
7
- exports.createRegistry = require_components.createRegistry;
8
- exports.unwrapZodObject = require_components.unwrapZodObject;