@scalar/openapi-types 0.2.1 → 0.2.3

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 (250) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.js +2 -1
  3. package/dist/index.js.map +7 -0
  4. package/dist/openapi-types.js +28 -33
  5. package/dist/openapi-types.js.map +7 -0
  6. package/dist/openapi-types.test-d.js +52 -0
  7. package/dist/openapi-types.test-d.js.map +7 -0
  8. package/dist/schemas/3.1/compliance/callback-object.test.js +97 -0
  9. package/dist/schemas/3.1/compliance/callback-object.test.js.map +7 -0
  10. package/dist/schemas/3.1/compliance/contact-object.test.js +19 -0
  11. package/dist/schemas/3.1/compliance/contact-object.test.js.map +7 -0
  12. package/dist/schemas/3.1/compliance/example-object.test.js +91 -0
  13. package/dist/schemas/3.1/compliance/example-object.test.js.map +7 -0
  14. package/dist/schemas/3.1/compliance/external-documentation-object.test.js +17 -0
  15. package/dist/schemas/3.1/compliance/external-documentation-object.test.js.map +7 -0
  16. package/dist/schemas/3.1/compliance/header-object.test.js +47 -0
  17. package/dist/schemas/3.1/compliance/header-object.test.js.map +7 -0
  18. package/dist/schemas/3.1/compliance/info-object.test.js +41 -0
  19. package/dist/schemas/3.1/compliance/info-object.test.js.map +7 -0
  20. package/dist/schemas/3.1/compliance/license-object.test.js +17 -0
  21. package/dist/schemas/3.1/compliance/license-object.test.js.map +7 -0
  22. package/dist/schemas/3.1/compliance/media-type-object.test.js +69 -0
  23. package/dist/schemas/3.1/compliance/media-type-object.test.js.map +7 -0
  24. package/dist/schemas/3.1/compliance/openapi-object.test.js +381 -0
  25. package/dist/schemas/3.1/compliance/openapi-object.test.js.map +7 -0
  26. package/dist/schemas/3.1/compliance/operation-object.test.js +467 -0
  27. package/dist/schemas/3.1/compliance/operation-object.test.js.map +7 -0
  28. package/dist/schemas/3.1/compliance/parameter-object.test.js +155 -0
  29. package/dist/schemas/3.1/compliance/parameter-object.test.js.map +7 -0
  30. package/dist/schemas/3.1/compliance/path-item-object.test.js +103 -0
  31. package/dist/schemas/3.1/compliance/path-item-object.test.js.map +7 -0
  32. package/dist/schemas/3.1/compliance/reference-object.test.js +282 -0
  33. package/dist/schemas/3.1/compliance/reference-object.test.js.map +7 -0
  34. package/dist/schemas/3.1/compliance/request-body-object.test.js +97 -0
  35. package/dist/schemas/3.1/compliance/request-body-object.test.js.map +7 -0
  36. package/dist/schemas/3.1/compliance/response-object.test.js +131 -0
  37. package/dist/schemas/3.1/compliance/response-object.test.js.map +7 -0
  38. package/dist/schemas/3.1/compliance/responses-object.test.js +53 -0
  39. package/dist/schemas/3.1/compliance/responses-object.test.js.map +7 -0
  40. package/dist/schemas/3.1/compliance/runtime-expression.test.js +165 -0
  41. package/dist/schemas/3.1/compliance/runtime-expression.test.js.map +7 -0
  42. package/dist/schemas/3.1/compliance/schema-object.test.js +470 -0
  43. package/dist/schemas/3.1/compliance/schema-object.test.js.map +7 -0
  44. package/dist/schemas/3.1/compliance/security-requirement-object.test.js +54 -0
  45. package/dist/schemas/3.1/compliance/security-requirement-object.test.js.map +7 -0
  46. package/dist/schemas/3.1/compliance/security-scheme-object.test.js +123 -0
  47. package/dist/schemas/3.1/compliance/security-scheme-object.test.js.map +7 -0
  48. package/dist/schemas/3.1/compliance/server-object.test.js +17 -0
  49. package/dist/schemas/3.1/compliance/server-object.test.js.map +7 -0
  50. package/dist/schemas/3.1/compliance/tag-object.test.js +17 -0
  51. package/dist/schemas/3.1/compliance/tag-object.test.js.map +7 -0
  52. package/dist/schemas/3.1/processed/base-path-item-object.js +27 -33
  53. package/dist/schemas/3.1/processed/base-path-item-object.js.map +7 -0
  54. package/dist/schemas/3.1/processed/callback-object.js +7 -16
  55. package/dist/schemas/3.1/processed/callback-object.js.map +7 -0
  56. package/dist/schemas/3.1/processed/components-object.js +55 -62
  57. package/dist/schemas/3.1/processed/components-object.js.map +7 -0
  58. package/dist/schemas/3.1/processed/contact-object.js +11 -17
  59. package/dist/schemas/3.1/processed/contact-object.js.map +7 -0
  60. package/dist/schemas/3.1/processed/discriminator-object.js +15 -26
  61. package/dist/schemas/3.1/processed/discriminator-object.js.map +7 -0
  62. package/dist/schemas/3.1/processed/encoding-object.js +17 -28
  63. package/dist/schemas/3.1/processed/encoding-object.js.map +7 -0
  64. package/dist/schemas/3.1/processed/example-object.js +23 -33
  65. package/dist/schemas/3.1/processed/example-object.js.map +7 -0
  66. package/dist/schemas/3.1/processed/external-documentation-object.js +9 -15
  67. package/dist/schemas/3.1/processed/external-documentation-object.js.map +7 -0
  68. package/dist/schemas/3.1/processed/header-object.js +48 -64
  69. package/dist/schemas/3.1/processed/header-object.js.map +7 -0
  70. package/dist/schemas/3.1/processed/index.js +87 -30
  71. package/dist/schemas/3.1/processed/index.js.map +7 -0
  72. package/dist/schemas/3.1/processed/info-object.js +36 -43
  73. package/dist/schemas/3.1/processed/info-object.js.map +7 -0
  74. package/dist/schemas/3.1/processed/license-object.js +13 -19
  75. package/dist/schemas/3.1/processed/license-object.js.map +7 -0
  76. package/dist/schemas/3.1/processed/link-object.js +36 -50
  77. package/dist/schemas/3.1/processed/link-object.js.map +7 -0
  78. package/dist/schemas/3.1/processed/media-type-object-without-encoding.js +26 -32
  79. package/dist/schemas/3.1/processed/media-type-object-without-encoding.js.map +7 -0
  80. package/dist/schemas/3.1/processed/media-type-object.js +30 -36
  81. package/dist/schemas/3.1/processed/media-type-object.js.map +7 -0
  82. package/dist/schemas/3.1/processed/openapi-object.js +70 -78
  83. package/dist/schemas/3.1/processed/openapi-object.js.map +7 -0
  84. package/dist/schemas/3.1/processed/operation-object-without-callbacks.js +64 -70
  85. package/dist/schemas/3.1/processed/operation-object-without-callbacks.js.map +7 -0
  86. package/dist/schemas/3.1/processed/operation-object.js +14 -20
  87. package/dist/schemas/3.1/processed/operation-object.js.map +7 -0
  88. package/dist/schemas/3.1/processed/parameter-object.js +83 -91
  89. package/dist/schemas/3.1/processed/parameter-object.js.map +7 -0
  90. package/dist/schemas/3.1/processed/path-item-object-without-callbacks.js +38 -46
  91. package/dist/schemas/3.1/processed/path-item-object-without-callbacks.js.map +7 -0
  92. package/dist/schemas/3.1/processed/path-item-object.js +38 -46
  93. package/dist/schemas/3.1/processed/path-item-object.js.map +7 -0
  94. package/dist/schemas/3.1/processed/paths-object.js +16 -22
  95. package/dist/schemas/3.1/processed/paths-object.js.map +7 -0
  96. package/dist/schemas/3.1/processed/request-body-object.js +25 -31
  97. package/dist/schemas/3.1/processed/request-body-object.js.map +7 -0
  98. package/dist/schemas/3.1/processed/response-object.js +28 -34
  99. package/dist/schemas/3.1/processed/response-object.js.map +7 -0
  100. package/dist/schemas/3.1/processed/responses-object.js +17 -30
  101. package/dist/schemas/3.1/processed/responses-object.js.map +7 -0
  102. package/dist/schemas/3.1/processed/runtime-expression.js +50 -81
  103. package/dist/schemas/3.1/processed/runtime-expression.js.map +7 -0
  104. package/dist/schemas/3.1/processed/schema-object.js +88 -89
  105. package/dist/schemas/3.1/processed/schema-object.js.map +7 -0
  106. package/dist/schemas/3.1/processed/schema-object.test.js +310 -0
  107. package/dist/schemas/3.1/processed/schema-object.test.js.map +7 -0
  108. package/dist/schemas/3.1/processed/security-requirement-object.js +20 -36
  109. package/dist/schemas/3.1/processed/security-requirement-object.js.map +7 -0
  110. package/dist/schemas/3.1/processed/security-scheme-object.js +114 -142
  111. package/dist/schemas/3.1/processed/security-scheme-object.js.map +7 -0
  112. package/dist/schemas/3.1/processed/server-object.js +19 -25
  113. package/dist/schemas/3.1/processed/server-object.js.map +7 -0
  114. package/dist/schemas/3.1/processed/server-variable-object.js +19 -25
  115. package/dist/schemas/3.1/processed/server-variable-object.js.map +7 -0
  116. package/dist/schemas/3.1/processed/tag-object.js +12 -19
  117. package/dist/schemas/3.1/processed/tag-object.js.map +7 -0
  118. package/dist/schemas/3.1/processed/webhooks-object.js +6 -18
  119. package/dist/schemas/3.1/processed/webhooks-object.js.map +7 -0
  120. package/dist/schemas/3.1/processed/xml-object.js +28 -38
  121. package/dist/schemas/3.1/processed/xml-object.js.map +7 -0
  122. package/dist/schemas/3.1/unprocessed/base-path-item-object.js +16 -22
  123. package/dist/schemas/3.1/unprocessed/base-path-item-object.js.map +7 -0
  124. package/dist/schemas/3.1/unprocessed/callback-object.js +6 -15
  125. package/dist/schemas/3.1/unprocessed/callback-object.js.map +7 -0
  126. package/dist/schemas/3.1/unprocessed/components-object.js +58 -65
  127. package/dist/schemas/3.1/unprocessed/components-object.js.map +7 -0
  128. package/dist/schemas/3.1/unprocessed/contact-object.js +6 -12
  129. package/dist/schemas/3.1/unprocessed/contact-object.js.map +7 -0
  130. package/dist/schemas/3.1/unprocessed/discriminator-object.js +6 -17
  131. package/dist/schemas/3.1/unprocessed/discriminator-object.js.map +7 -0
  132. package/dist/schemas/3.1/unprocessed/encoding-object.js +14 -25
  133. package/dist/schemas/3.1/unprocessed/encoding-object.js.map +7 -0
  134. package/dist/schemas/3.1/unprocessed/example-object.js +6 -16
  135. package/dist/schemas/3.1/unprocessed/example-object.js.map +7 -0
  136. package/dist/schemas/3.1/unprocessed/external-documentation-object.js +6 -12
  137. package/dist/schemas/3.1/unprocessed/external-documentation-object.js.map +7 -0
  138. package/dist/schemas/3.1/unprocessed/header-object.js +25 -41
  139. package/dist/schemas/3.1/unprocessed/header-object.js.map +7 -0
  140. package/dist/schemas/3.1/unprocessed/index.js +89 -31
  141. package/dist/schemas/3.1/unprocessed/index.js.map +7 -0
  142. package/dist/schemas/3.1/unprocessed/info-object.js +6 -13
  143. package/dist/schemas/3.1/unprocessed/info-object.js.map +7 -0
  144. package/dist/schemas/3.1/unprocessed/license-object.js +6 -12
  145. package/dist/schemas/3.1/unprocessed/license-object.js.map +7 -0
  146. package/dist/schemas/3.1/unprocessed/link-object.js +6 -20
  147. package/dist/schemas/3.1/unprocessed/link-object.js.map +7 -0
  148. package/dist/schemas/3.1/unprocessed/media-type-object-without-encoding.js +6 -12
  149. package/dist/schemas/3.1/unprocessed/media-type-object-without-encoding.js.map +7 -0
  150. package/dist/schemas/3.1/unprocessed/media-type-object.js +33 -39
  151. package/dist/schemas/3.1/unprocessed/media-type-object.js.map +7 -0
  152. package/dist/schemas/3.1/unprocessed/openapi-object.js +6 -12
  153. package/dist/schemas/3.1/unprocessed/openapi-object.js.map +7 -0
  154. package/dist/schemas/3.1/unprocessed/operation-object-without-callbacks.js +38 -44
  155. package/dist/schemas/3.1/unprocessed/operation-object-without-callbacks.js.map +7 -0
  156. package/dist/schemas/3.1/unprocessed/operation-object.js +15 -21
  157. package/dist/schemas/3.1/unprocessed/operation-object.js.map +7 -0
  158. package/dist/schemas/3.1/unprocessed/parameter-object.js +22 -30
  159. package/dist/schemas/3.1/unprocessed/parameter-object.js.map +7 -0
  160. package/dist/schemas/3.1/unprocessed/path-item-object-without-callbacks.js +38 -46
  161. package/dist/schemas/3.1/unprocessed/path-item-object-without-callbacks.js.map +7 -0
  162. package/dist/schemas/3.1/unprocessed/path-item-object.js +52 -60
  163. package/dist/schemas/3.1/unprocessed/path-item-object.js.map +7 -0
  164. package/dist/schemas/3.1/unprocessed/paths-object.js +6 -14
  165. package/dist/schemas/3.1/unprocessed/paths-object.js.map +7 -0
  166. package/dist/schemas/3.1/unprocessed/reference-object.js +20 -28
  167. package/dist/schemas/3.1/unprocessed/reference-object.js.map +7 -0
  168. package/dist/schemas/3.1/unprocessed/request-body-object.js +6 -12
  169. package/dist/schemas/3.1/unprocessed/request-body-object.js.map +7 -0
  170. package/dist/schemas/3.1/unprocessed/response-object.js +27 -33
  171. package/dist/schemas/3.1/unprocessed/response-object.js.map +7 -0
  172. package/dist/schemas/3.1/unprocessed/responses-object.js +18 -31
  173. package/dist/schemas/3.1/unprocessed/responses-object.js.map +7 -0
  174. package/dist/schemas/3.1/unprocessed/runtime-expression.js +6 -17
  175. package/dist/schemas/3.1/unprocessed/runtime-expression.js.map +7 -0
  176. package/dist/schemas/3.1/unprocessed/schema-object.js +31 -32
  177. package/dist/schemas/3.1/unprocessed/schema-object.js.map +7 -0
  178. package/dist/schemas/3.1/unprocessed/security-requirement-object.js +6 -23
  179. package/dist/schemas/3.1/unprocessed/security-requirement-object.js.map +7 -0
  180. package/dist/schemas/3.1/unprocessed/security-scheme-object.js +41 -29
  181. package/dist/schemas/3.1/unprocessed/security-scheme-object.js.map +7 -0
  182. package/dist/schemas/3.1/unprocessed/server-object.js +6 -12
  183. package/dist/schemas/3.1/unprocessed/server-object.js.map +7 -0
  184. package/dist/schemas/3.1/unprocessed/server-variable-object.js +6 -12
  185. package/dist/schemas/3.1/unprocessed/server-variable-object.js.map +7 -0
  186. package/dist/schemas/3.1/unprocessed/tag-object.js +6 -13
  187. package/dist/schemas/3.1/unprocessed/tag-object.js.map +7 -0
  188. package/dist/schemas/3.1/unprocessed/webhooks-object.js +6 -18
  189. package/dist/schemas/3.1/unprocessed/webhooks-object.js.map +7 -0
  190. package/dist/schemas/3.1/unprocessed/xml-object.js +6 -16
  191. package/dist/schemas/3.1/unprocessed/xml-object.js.map +7 -0
  192. package/dist/schemas/extensions/index.d.ts +1 -0
  193. package/dist/schemas/extensions/index.d.ts.map +1 -1
  194. package/dist/schemas/extensions/index.js +31 -11
  195. package/dist/schemas/extensions/index.js.map +7 -0
  196. package/dist/schemas/extensions/x-additional-properties-name.js +6 -12
  197. package/dist/schemas/extensions/x-additional-properties-name.js.map +7 -0
  198. package/dist/schemas/extensions/x-additional-properties-name.test.js +28 -0
  199. package/dist/schemas/extensions/x-additional-properties-name.test.js.map +7 -0
  200. package/dist/schemas/extensions/x-code-samples.js +12 -10
  201. package/dist/schemas/extensions/x-code-samples.js.map +7 -0
  202. package/dist/schemas/extensions/x-code-samples.test.js +82 -0
  203. package/dist/schemas/extensions/x-code-samples.test.js.map +7 -0
  204. package/dist/schemas/extensions/x-display-name.js +8 -0
  205. package/dist/schemas/extensions/x-display-name.js.map +7 -0
  206. package/dist/schemas/extensions/x-display-name.test.js +28 -0
  207. package/dist/schemas/extensions/x-display-name.test.js.map +7 -0
  208. package/dist/schemas/extensions/x-enum-descriptions.js +6 -18
  209. package/dist/schemas/extensions/x-enum-descriptions.js.map +7 -0
  210. package/dist/schemas/extensions/x-enum-descriptions.test.js +36 -0
  211. package/dist/schemas/extensions/x-enum-descriptions.test.js.map +7 -0
  212. package/dist/schemas/extensions/x-internal.js +6 -5
  213. package/dist/schemas/extensions/x-internal.js.map +7 -0
  214. package/dist/schemas/extensions/x-internal.test.js +20 -0
  215. package/dist/schemas/extensions/x-internal.test.js.map +7 -0
  216. package/dist/schemas/extensions/x-scalar-icon.js +6 -5
  217. package/dist/schemas/extensions/x-scalar-icon.js.map +7 -0
  218. package/dist/schemas/extensions/x-scalar-icon.test.js +14 -0
  219. package/dist/schemas/extensions/x-scalar-icon.test.js.map +7 -0
  220. package/dist/schemas/extensions/x-scalar-ignore.js +6 -5
  221. package/dist/schemas/extensions/x-scalar-ignore.js.map +7 -0
  222. package/dist/schemas/extensions/x-scalar-ignore.test.js +20 -0
  223. package/dist/schemas/extensions/x-scalar-ignore.test.js.map +7 -0
  224. package/dist/schemas/extensions/x-scalar-redirect-uri.js +6 -5
  225. package/dist/schemas/extensions/x-scalar-redirect-uri.js.map +7 -0
  226. package/dist/schemas/extensions/x-scalar-redirect-uri.test.js +23 -0
  227. package/dist/schemas/extensions/x-scalar-redirect-uri.test.js.map +7 -0
  228. package/dist/schemas/extensions/x-scalar-sdk-installation.js +10 -13
  229. package/dist/schemas/extensions/x-scalar-sdk-installation.js.map +7 -0
  230. package/dist/schemas/extensions/x-scalar-sdk-installation.test.js +25 -0
  231. package/dist/schemas/extensions/x-scalar-sdk-installation.test.js.map +7 -0
  232. package/dist/schemas/extensions/x-scalar-security-query.d.ts +20 -0
  233. package/dist/schemas/extensions/x-scalar-security-query.d.ts.map +1 -0
  234. package/dist/schemas/extensions/x-scalar-security-query.js +8 -0
  235. package/dist/schemas/extensions/x-scalar-security-query.js.map +7 -0
  236. package/dist/schemas/extensions/x-scalar-security-query.test.js +35 -0
  237. package/dist/schemas/extensions/x-scalar-security-query.test.js.map +7 -0
  238. package/dist/schemas/extensions/x-scalar-stability.js +10 -19
  239. package/dist/schemas/extensions/x-scalar-stability.js.map +7 -0
  240. package/dist/schemas/extensions/x-scalar-stability.test.js +33 -0
  241. package/dist/schemas/extensions/x-scalar-stability.test.js.map +7 -0
  242. package/dist/schemas/extensions/x-tag-groups.js +14 -17
  243. package/dist/schemas/extensions/x-tag-groups.js.map +7 -0
  244. package/dist/schemas/extensions/x-tag-groups.test.js +55 -0
  245. package/dist/schemas/extensions/x-tag-groups.test.js.map +7 -0
  246. package/dist/schemas/extensions/x-use-pkce.js +11 -10
  247. package/dist/schemas/extensions/x-use-pkce.js.map +7 -0
  248. package/dist/schemas/extensions/x-use-pkce.test.js +34 -0
  249. package/dist/schemas/extensions/x-use-pkce.test.js.map +7 -0
  250. package/package.json +4 -5
@@ -1,170 +1,142 @@
1
- import { z } from 'zod';
2
-
1
+ import { z } from "zod";
3
2
  const DescriptionSchema = z.object({
4
- /**
5
- * A description for security scheme. CommonMark syntax MAY be used for rich text representation.
6
- */
7
- description: z.string().optional(),
3
+ /**
4
+ * A description for security scheme. CommonMark syntax MAY be used for rich text representation.
5
+ */
6
+ description: z.string().optional()
8
7
  });
9
- const ApiKeyInValues = ['query', 'header', 'cookie'];
8
+ const ApiKeyInValues = ["query", "header", "cookie"];
10
9
  const ApiKeySchema = DescriptionSchema.extend({
11
- /**
12
- * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
13
- * "openIdConnect".
14
- */
15
- type: z.literal('apiKey'),
16
- /**
17
- * REQUIRED. The name of the header, query or cookie parameter to be used.
18
- *
19
- * TODO: Why do we use an empty string as the default?
20
- */
21
- name: z.string().optional().default(''),
22
- /**
23
- * REQUIRED. The location of the API key. Valid values are "query", "header", or "cookie".
24
- */
25
- in: z.enum(ApiKeyInValues).optional().default('header').catch('header'),
10
+ /**
11
+ * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
12
+ * "openIdConnect".
13
+ */
14
+ type: z.literal("apiKey"),
15
+ /**
16
+ * REQUIRED. The name of the header, query or cookie parameter to be used.
17
+ *
18
+ * TODO: Why do we use an empty string as the default?
19
+ */
20
+ name: z.string().optional().default(""),
21
+ /**
22
+ * REQUIRED. The location of the API key. Valid values are "query", "header", or "cookie".
23
+ */
24
+ in: z.enum(ApiKeyInValues).optional().default("header").catch("header")
26
25
  });
27
26
  const HttpSchema = DescriptionSchema.extend({
28
- /**
29
- * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
30
- * "openIdConnect".
31
- */
32
- type: z.literal('http'),
33
- /**
34
- * REQUIRED. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235.
35
- * The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive,
36
- * as defined in RFC7235.
37
- */
38
- scheme: z
39
- .string()
40
- .toLowerCase()
41
- .pipe(z.enum(['basic', 'bearer']))
42
- .optional()
43
- .default('basic'),
44
- /**
45
- * A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an
46
- * authorization server, so this information is primarily for documentation purposes.
47
- */
48
- bearerFormat: z.union([z.literal('JWT'), z.literal('bearer'), z.string()]).optional(),
27
+ /**
28
+ * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
29
+ * "openIdConnect".
30
+ */
31
+ type: z.literal("http"),
32
+ /**
33
+ * REQUIRED. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235.
34
+ * The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive,
35
+ * as defined in RFC7235.
36
+ */
37
+ scheme: z.string().toLowerCase().pipe(z.enum(["basic", "bearer"])).optional().default("basic"),
38
+ /**
39
+ * A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an
40
+ * authorization server, so this information is primarily for documentation purposes.
41
+ */
42
+ bearerFormat: z.union([z.literal("JWT"), z.literal("bearer"), z.string()]).optional()
49
43
  });
50
44
  const OpenIdConnectSchema = DescriptionSchema.extend({
51
- /**
52
- * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
53
- * "openIdConnect".
54
- */
55
- type: z.literal('openIdConnect'),
56
- /**
57
- * REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata.
58
- */
59
- openIdConnectUrl: z.string().optional().default(''),
45
+ /**
46
+ * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
47
+ * "openIdConnect".
48
+ */
49
+ type: z.literal("openIdConnect"),
50
+ /**
51
+ * REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata.
52
+ */
53
+ openIdConnectUrl: z.string().optional().default("")
60
54
  });
61
- /**
62
- * REQUIRED. The authorization URL to be used for this flow. This MUST be in
63
- * the form of a URL. The OAuth2 standard requires the use of TLS.
64
- */
65
- const authorizationUrl = z.string().default('');
66
- /**
67
- * REQUIRED. The token URL to be used for this flow. This MUST be in the
68
- * form of a URL. The OAuth2 standard requires the use of TLS.
69
- */
70
- const tokenUrl = z.string().default('');
71
- /**
72
- * OAuth Flow Object
73
- *
74
- * Configuration details for a supported OAuth Flow
75
- */
55
+ const authorizationUrl = z.string().default("");
56
+ const tokenUrl = z.string().default("");
76
57
  const OAuthFlowObjectSchema = z.object({
77
- /**
78
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires
79
- * the use of TLS.
80
- */
81
- refreshUrl: z.string().optional(),
82
- /**
83
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
84
- * between the scope name and a short description for it. The map MAY be empty.
85
- */
86
- scopes: z.record(z.string(), z.string().optional()).optional().default({}).catch({}),
58
+ /**
59
+ * The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires
60
+ * the use of TLS.
61
+ */
62
+ refreshUrl: z.string().optional(),
63
+ /**
64
+ * REQUIRED. The available scopes for the OAuth2 security scheme. A map
65
+ * between the scope name and a short description for it. The map MAY be empty.
66
+ */
67
+ scopes: z.record(z.string(), z.string().optional()).optional().default({}).catch({})
87
68
  });
88
69
  const ImplicitFlowSchema = OAuthFlowObjectSchema.extend({
89
- type: z.literal('implicit').optional(),
90
- authorizationUrl,
70
+ type: z.literal("implicit").optional(),
71
+ authorizationUrl
91
72
  });
92
73
  const PasswordFlowSchema = OAuthFlowObjectSchema.extend({
93
- type: z.literal('password').optional(),
94
- tokenUrl,
74
+ type: z.literal("password").optional(),
75
+ tokenUrl
95
76
  });
96
77
  const ClientCredentialsFlowSchema = OAuthFlowObjectSchema.extend({
97
- type: z.literal('clientCredentials').optional(),
98
- tokenUrl,
78
+ type: z.literal("clientCredentials").optional(),
79
+ tokenUrl
99
80
  });
100
81
  const AuthorizationCodeFlowSchema = OAuthFlowObjectSchema.extend({
101
- type: z.literal('authorizationCode').optional(),
102
- authorizationUrl,
103
- tokenUrl,
82
+ type: z.literal("authorizationCode").optional(),
83
+ authorizationUrl,
84
+ tokenUrl
104
85
  });
105
- /**
106
- * OAuth Flows Object
107
- *
108
- * Allows configuration of the supported OAuth Flows.
109
- *
110
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#oauth-flows-object
111
- */
112
86
  const OAuthFlowsObjectSchema = DescriptionSchema.extend({
87
+ /**
88
+ * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
89
+ * "openIdConnect".
90
+ */
91
+ type: z.literal("oauth2"),
92
+ /**
93
+ * REQUIRED. An object containing configuration information for the flow types supported.
94
+ */
95
+ flows: z.object({
113
96
  /**
114
- * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
115
- * "openIdConnect".
97
+ * Configuration for the OAuth Implicit flow
116
98
  */
117
- type: z.literal('oauth2'),
99
+ implicit: ImplicitFlowSchema.optional(),
118
100
  /**
119
- * REQUIRED. An object containing configuration information for the flow types supported.
101
+ * Configuration for the OAuth Resource Owner Password flow
120
102
  */
121
- flows: z
122
- .object({
123
- /**
124
- * Configuration for the OAuth Implicit flow
125
- */
126
- implicit: ImplicitFlowSchema.optional(),
127
- /**
128
- * Configuration for the OAuth Resource Owner Password flow
129
- */
130
- password: PasswordFlowSchema.optional(),
131
- /**
132
- * Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.
133
- */
134
- clientCredentials: ClientCredentialsFlowSchema.optional(),
135
- /**
136
- * Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.
137
- */
138
- authorizationCode: AuthorizationCodeFlowSchema.optional(),
139
- })
140
- .partial(),
141
- });
142
- const MutualTlsSchema = DescriptionSchema.extend({
103
+ password: PasswordFlowSchema.optional(),
143
104
  /**
144
- * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
145
- * "openIdConnect".
105
+ * Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.
146
106
  */
147
- type: z.literal('mutualTLS'),
107
+ clientCredentials: ClientCredentialsFlowSchema.optional(),
108
+ /**
109
+ * Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.
110
+ */
111
+ authorizationCode: AuthorizationCodeFlowSchema.optional()
112
+ }).partial()
113
+ });
114
+ const MutualTlsSchema = DescriptionSchema.extend({
115
+ /**
116
+ * REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2",
117
+ * "openIdConnect".
118
+ */
119
+ type: z.literal("mutualTLS")
148
120
  });
149
- /**
150
- * Security Scheme Object
151
- *
152
- * Defines a security scheme that can be used by the operations.
153
- *
154
- * Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query
155
- * parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, client credentials
156
- * and authorization code) as defined in RFC6749, and [[OpenID-Connect-Core]]. Please note that as of 2020, the implicit
157
- * flow is about to be deprecated by OAuth 2.0 Security Best Current Practice. Recommended for most use cases is
158
- * Authorization Code Grant flow with PKCE.
159
- *
160
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#security-scheme-object
161
- */
162
121
  const SecuritySchemeObjectSchema = z.union([
163
- ApiKeySchema,
164
- HttpSchema,
165
- MutualTlsSchema,
166
- OAuthFlowsObjectSchema,
167
- OpenIdConnectSchema,
122
+ ApiKeySchema,
123
+ HttpSchema,
124
+ MutualTlsSchema,
125
+ OAuthFlowsObjectSchema,
126
+ OpenIdConnectSchema
168
127
  ]);
169
-
170
- export { ApiKeyInValues, ApiKeySchema, AuthorizationCodeFlowSchema, ClientCredentialsFlowSchema, HttpSchema, ImplicitFlowSchema, MutualTlsSchema, OAuthFlowObjectSchema, OAuthFlowsObjectSchema, OpenIdConnectSchema, PasswordFlowSchema, SecuritySchemeObjectSchema };
128
+ export {
129
+ ApiKeyInValues,
130
+ ApiKeySchema,
131
+ AuthorizationCodeFlowSchema,
132
+ ClientCredentialsFlowSchema,
133
+ HttpSchema,
134
+ ImplicitFlowSchema,
135
+ MutualTlsSchema,
136
+ OAuthFlowObjectSchema,
137
+ OAuthFlowsObjectSchema,
138
+ OpenIdConnectSchema,
139
+ PasswordFlowSchema,
140
+ SecuritySchemeObjectSchema
141
+ };
142
+ //# sourceMappingURL=security-scheme-object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/3.1/processed/security-scheme-object.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\nconst DescriptionSchema = z.object({\n /**\n * A description for security scheme. CommonMark syntax MAY be used for rich text representation.\n */\n description: z.string().optional(),\n})\n\nexport const ApiKeyInValues = ['query', 'header', 'cookie'] as const\n\nexport const ApiKeySchema = DescriptionSchema.extend({\n /**\n * REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\",\n * \"openIdConnect\".\n */\n type: z.literal('apiKey'),\n /**\n * REQUIRED. The name of the header, query or cookie parameter to be used.\n *\n * TODO: Why do we use an empty string as the default?\n */\n name: z.string().optional().default(''),\n /**\n * REQUIRED. The location of the API key. Valid values are \"query\", \"header\", or \"cookie\".\n */\n in: z.enum(ApiKeyInValues).optional().default('header').catch('header'),\n})\n\nexport const HttpSchema = DescriptionSchema.extend({\n /**\n * REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\",\n * \"openIdConnect\".\n */\n type: z.literal('http'),\n /**\n * REQUIRED. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235.\n * The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive,\n * as defined in RFC7235.\n */\n scheme: z\n .string()\n .toLowerCase()\n .pipe(z.enum(['basic', 'bearer']))\n .optional()\n .default('basic'),\n /**\n * A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an\n * authorization server, so this information is primarily for documentation purposes.\n */\n bearerFormat: z.union([z.literal('JWT'), z.literal('bearer'), z.string()]).optional(),\n})\n\nexport const OpenIdConnectSchema = DescriptionSchema.extend({\n /**\n * REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\",\n * \"openIdConnect\".\n */\n type: z.literal('openIdConnect'),\n /**\n * REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata.\n */\n openIdConnectUrl: z.string().optional().default(''),\n})\n\n/**\n * REQUIRED. The authorization URL to be used for this flow. This MUST be in\n * the form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst authorizationUrl = z.string().default('')\n\n/**\n * REQUIRED. The token URL to be used for this flow. This MUST be in the\n * form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst tokenUrl = z.string().default('')\n\n/**\n * OAuth Flow Object\n *\n * Configuration details for a supported OAuth Flow\n */\nexport const OAuthFlowObjectSchema = z.object({\n /**\n * The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires\n * the use of TLS.\n */\n refreshUrl: z.string().optional(),\n /**\n * REQUIRED. The available scopes for the OAuth2 security scheme. A map\n * between the scope name and a short description for it. The map MAY be empty.\n */\n scopes: z.record(z.string(), z.string().optional()).optional().default({}).catch({}),\n})\n\nexport const ImplicitFlowSchema = OAuthFlowObjectSchema.extend({\n type: z.literal('implicit').optional(),\n authorizationUrl,\n})\n\nexport const PasswordFlowSchema = OAuthFlowObjectSchema.extend({\n type: z.literal('password').optional(),\n tokenUrl,\n})\n\nexport const ClientCredentialsFlowSchema = OAuthFlowObjectSchema.extend({\n type: z.literal('clientCredentials').optional(),\n tokenUrl,\n})\n\nexport const AuthorizationCodeFlowSchema = OAuthFlowObjectSchema.extend({\n type: z.literal('authorizationCode').optional(),\n authorizationUrl,\n tokenUrl,\n})\n\n/**\n * OAuth Flows Object\n *\n * Allows configuration of the supported OAuth Flows.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#oauth-flows-object\n */\nexport const OAuthFlowsObjectSchema = DescriptionSchema.extend({\n /**\n * REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\",\n * \"openIdConnect\".\n */\n type: z.literal('oauth2'),\n /**\n * REQUIRED. An object containing configuration information for the flow types supported.\n */\n flows: z\n .object({\n /**\n * Configuration for the OAuth Implicit flow\n */\n implicit: ImplicitFlowSchema.optional(),\n /**\n * Configuration for the OAuth Resource Owner Password flow\n */\n password: PasswordFlowSchema.optional(),\n /**\n * Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.\n */\n clientCredentials: ClientCredentialsFlowSchema.optional(),\n /**\n * Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.\n */\n authorizationCode: AuthorizationCodeFlowSchema.optional(),\n })\n .partial(),\n})\n\nexport const MutualTlsSchema = DescriptionSchema.extend({\n /**\n * REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\",\n * \"openIdConnect\".\n */\n type: z.literal('mutualTLS'),\n})\n\n/**\n * Security Scheme Object\n *\n * Defines a security scheme that can be used by the operations.\n *\n * Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query\n * parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, client credentials\n * and authorization code) as defined in RFC6749, and [[OpenID-Connect-Core]]. Please note that as of 2020, the implicit\n * flow is about to be deprecated by OAuth 2.0 Security Best Current Practice. Recommended for most use cases is\n * Authorization Code Grant flow with PKCE.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#security-scheme-object\n */\nexport const SecuritySchemeObjectSchema = z.union([\n ApiKeySchema,\n HttpSchema,\n MutualTlsSchema,\n OAuthFlowsObjectSchema,\n OpenIdConnectSchema,\n])\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB,MAAM,oBAAoB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAIjC,aAAa,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAEM,MAAM,iBAAiB,CAAC,SAAS,UAAU,QAAQ;AAEnD,MAAM,eAAe,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnD,MAAM,EAAE,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA;AAAA;AAAA;AAAA,EAItC,IAAI,EAAE,KAAK,cAAc,EAAE,SAAS,EAAE,QAAQ,QAAQ,EAAE,MAAM,QAAQ;AACxE,CAAC;AAEM,MAAM,aAAa,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjD,MAAM,EAAE,QAAQ,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,QAAQ,EACL,OAAO,EACP,YAAY,EACZ,KAAK,EAAE,KAAK,CAAC,SAAS,QAAQ,CAAC,CAAC,EAChC,SAAS,EACT,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,KAAK,GAAG,EAAE,QAAQ,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AACtF,CAAC;AAEM,MAAM,sBAAsB,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1D,MAAM,EAAE,QAAQ,eAAe;AAAA;AAAA;AAAA;AAAA,EAI/B,kBAAkB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AACpD,CAAC;AAMD,MAAM,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE;AAM9C,MAAM,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE;AAO/B,MAAM,wBAAwB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhC,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACrF,CAAC;AAEM,MAAM,qBAAqB,sBAAsB,OAAO;AAAA,EAC7D,MAAM,EAAE,QAAQ,UAAU,EAAE,SAAS;AAAA,EACrC;AACF,CAAC;AAEM,MAAM,qBAAqB,sBAAsB,OAAO;AAAA,EAC7D,MAAM,EAAE,QAAQ,UAAU,EAAE,SAAS;AAAA,EACrC;AACF,CAAC;AAEM,MAAM,8BAA8B,sBAAsB,OAAO;AAAA,EACtE,MAAM,EAAE,QAAQ,mBAAmB,EAAE,SAAS;AAAA,EAC9C;AACF,CAAC;AAEM,MAAM,8BAA8B,sBAAsB,OAAO;AAAA,EACtE,MAAM,EAAE,QAAQ,mBAAmB,EAAE,SAAS;AAAA,EAC9C;AAAA,EACA;AACF,CAAC;AASM,MAAM,yBAAyB,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7D,MAAM,EAAE,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIxB,OAAO,EACJ,OAAO;AAAA;AAAA;AAAA;AAAA,IAIN,UAAU,mBAAmB,SAAS;AAAA;AAAA;AAAA;AAAA,IAItC,UAAU,mBAAmB,SAAS;AAAA;AAAA;AAAA;AAAA,IAItC,mBAAmB,4BAA4B,SAAS;AAAA;AAAA;AAAA;AAAA,IAIxD,mBAAmB,4BAA4B,SAAS;AAAA,EAC1D,CAAC,EACA,QAAQ;AACb,CAAC;AAEM,MAAM,kBAAkB,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtD,MAAM,EAAE,QAAQ,WAAW;AAC7B,CAAC;AAeM,MAAM,6BAA6B,EAAE,MAAM;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -1,27 +1,21 @@
1
- import { z } from 'zod';
2
- import { ServerVariableObjectSchema } from './server-variable-object.js';
3
-
4
- /**
5
- * Server Object
6
- *
7
- * An object representing a Server.
8
- *
9
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#server-object
10
- */
1
+ import { z } from "zod";
2
+ import { ServerVariableObjectSchema } from "./server-variable-object.js";
11
3
  const ServerObjectSchema = z.object({
12
- /**
13
- * REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that
14
- * the host location is relative to the location where the OpenAPI document is being served. Variable substitutions
15
- * will be made when a variable is named in {brackets}.
16
- */
17
- url: z.string(),
18
- /**
19
- * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text
20
- * representation.
21
- */
22
- description: z.string().optional(),
23
- /** A map between a variable name and its value. The value is used for substitution in the server's URL template. */
24
- variables: z.record(z.string(), ServerVariableObjectSchema).optional(),
4
+ /**
5
+ * REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that
6
+ * the host location is relative to the location where the OpenAPI document is being served. Variable substitutions
7
+ * will be made when a variable is named in {brackets}.
8
+ */
9
+ url: z.string(),
10
+ /**
11
+ * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text
12
+ * representation.
13
+ */
14
+ description: z.string().optional(),
15
+ /** A map between a variable name and its value. The value is used for substitution in the server's URL template. */
16
+ variables: z.record(z.string(), ServerVariableObjectSchema).optional()
25
17
  });
26
-
27
- export { ServerObjectSchema };
18
+ export {
19
+ ServerObjectSchema
20
+ };
21
+ //# sourceMappingURL=server-object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/3.1/processed/server-object.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\nimport { ServerVariableObjectSchema } from './server-variable-object'\n\n/**\n * Server Object\n *\n * An object representing a Server.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#server-object\n */\nexport const ServerObjectSchema = z.object({\n /**\n * REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that\n * the host location is relative to the location where the OpenAPI document is being served. Variable substitutions\n * will be made when a variable is named in {brackets}.\n */\n url: z.string(),\n /**\n * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text\n * representation.\n */\n description: z.string().optional(),\n /** A map between a variable name and its value. The value is used for substitution in the server's URL template. */\n variables: z.record(z.string(), ServerVariableObjectSchema).optional(),\n})\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,kCAAkC;AASpC,MAAM,qBAAqB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzC,KAAK,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKd,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAEjC,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,0BAA0B,EAAE,SAAS;AACvE,CAAC;",
6
+ "names": []
7
+ }
@@ -1,27 +1,21 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Server Variable Object
5
- *
6
- * An object representing a Server Variable for server URL template substitution.
7
- *
8
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#server-variable-object
9
- */
1
+ import { z } from "zod";
10
2
  const ServerVariableObjectSchema = z.object({
11
- /**
12
- * An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.
13
- */
14
- enum: z.array(z.string()).optional(),
15
- /**
16
- * REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied.
17
- * Note this behavior is different than the Schema Object's treatment of default values, because in those cases
18
- * parameter values are optional. If the enum is defined, the value MUST exist in the enum's values.
19
- */
20
- default: z.string().optional(),
21
- /**
22
- * An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.
23
- */
24
- description: z.string().optional(),
3
+ /**
4
+ * An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.
5
+ */
6
+ enum: z.array(z.string()).optional(),
7
+ /**
8
+ * REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied.
9
+ * Note this behavior is different than the Schema Object's treatment of default values, because in those cases
10
+ * parameter values are optional. If the enum is defined, the value MUST exist in the enum's values.
11
+ */
12
+ default: z.string().optional(),
13
+ /**
14
+ * An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.
15
+ */
16
+ description: z.string().optional()
25
17
  });
26
-
27
- export { ServerVariableObjectSchema };
18
+ export {
19
+ ServerVariableObjectSchema
20
+ };
21
+ //# sourceMappingURL=server-variable-object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/3.1/processed/server-variable-object.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\n/**\n * Server Variable Object\n *\n * An object representing a Server Variable for server URL template substitution.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#server-variable-object\n */\nexport const ServerVariableObjectSchema = z.object({\n /**\n * An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.\n */\n enum: z.array(z.string()).optional(),\n /**\n * REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied.\n * Note this behavior is different than the Schema Object's treatment of default values, because in those cases\n * parameter values are optional. If the enum is defined, the value MUST exist in the enum's values.\n */\n default: z.string().optional(),\n /**\n * An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.\n */\n description: z.string().optional(),\n})\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AASX,MAAM,6BAA6B,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAIjD,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI7B,aAAa,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;",
6
+ "names": []
7
+ }
@@ -1,21 +1,14 @@
1
- import { z } from 'zod';
2
- import { ExternalDocumentationObjectSchema } from './external-documentation-object.js';
3
-
4
- /**
5
- * Tag Object
6
- *
7
- * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag
8
- * defined in the Operation Object instances.
9
- *
10
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object
11
- */
1
+ import { z } from "zod";
2
+ import { ExternalDocumentationObjectSchema } from "./external-documentation-object.js";
12
3
  const TagObjectSchema = z.object({
13
- /** REQUIRED. The name of the tag. */
14
- 'name': z.string(),
15
- /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
16
- 'description': z.string().optional().catch(undefined),
17
- /** Additional external documentation for this tag. */
18
- 'externalDocs': ExternalDocumentationObjectSchema.optional(),
4
+ /** REQUIRED. The name of the tag. */
5
+ "name": z.string(),
6
+ /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
7
+ "description": z.string().optional().catch(void 0),
8
+ /** Additional external documentation for this tag. */
9
+ "externalDocs": ExternalDocumentationObjectSchema.optional()
19
10
  });
20
-
21
- export { TagObjectSchema };
11
+ export {
12
+ TagObjectSchema
13
+ };
14
+ //# sourceMappingURL=tag-object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/3.1/processed/tag-object.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\nimport { ExternalDocumentationObjectSchema } from './external-documentation-object'\n\n/**\n * Tag Object\n *\n * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag\n * defined in the Operation Object instances.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object\n */\nexport const TagObjectSchema = z.object({\n /** REQUIRED. The name of the tag. */\n 'name': z.string(),\n /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */\n 'description': z.string().optional().catch(undefined),\n /** Additional external documentation for this tag. */\n 'externalDocs': ExternalDocumentationObjectSchema.optional(),\n})\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,yCAAyC;AAU3C,MAAM,kBAAkB,EAAE,OAAO;AAAA;AAAA,EAEtC,QAAQ,EAAE,OAAO;AAAA;AAAA,EAEjB,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAS;AAAA;AAAA,EAEpD,gBAAgB,kCAAkC,SAAS;AAC7D,CAAC;",
6
+ "names": []
7
+ }
@@ -1,19 +1,7 @@
1
- import { z } from 'zod';
2
- import { PathItemObjectSchemaWithoutCallbacks } from './path-item-object-without-callbacks.js';
3
-
4
- /**
5
- * Webhooks Object
6
- *
7
- * The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement.
8
- * Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for
9
- * example by an out of band registration.
10
- *
11
- * The key name is a unique string to refer to each webhook, while the
12
- * (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the
13
- * expected responses. An example is available.
14
- *
15
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#oas-webhooks
16
- */
1
+ import { z } from "zod";
2
+ import { PathItemObjectSchemaWithoutCallbacks } from "./path-item-object-without-callbacks.js";
17
3
  const WebhooksObjectSchema = z.record(z.string(), PathItemObjectSchemaWithoutCallbacks);
18
-
19
- export { WebhooksObjectSchema };
4
+ export {
5
+ WebhooksObjectSchema
6
+ };
7
+ //# sourceMappingURL=webhooks-object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/3.1/processed/webhooks-object.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\nimport { PathItemObjectSchemaWithoutCallbacks } from './path-item-object-without-callbacks'\n\n/**\n * Webhooks Object\n *\n * The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement.\n * Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for\n * example by an out of band registration.\n *\n * The key name is a unique string to refer to each webhook, while the\n * (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the\n * expected responses. An example is available.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#oas-webhooks\n */\nexport const WebhooksObjectSchema = z.record(z.string(), PathItemObjectSchemaWithoutCallbacks)\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,4CAA4C;AAe9C,MAAM,uBAAuB,EAAE,OAAO,EAAE,OAAO,GAAG,oCAAoC;",
6
+ "names": []
7
+ }
@@ -1,40 +1,30 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- *
5
- * XML Object
6
- *
7
- * A metadata object that allows for more fine-tuned XML model definitions.
8
- *
9
- * When using arrays, XML element names are not inferred (for singular/plural forms) and the name field SHOULD be used
10
- * to add that information. See examples for expected behavior.
11
- *
12
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#xml-object
13
- */
1
+ import { z } from "zod";
14
2
  const XmlObjectSchema = z.object({
15
- /**
16
- * Replaces the name of the element/attribute used for the described schema property.
17
- */
18
- name: z.string().optional(),
19
- /**
20
- * The URI of the namespace definition. Value MUST be in the form of a URL.
21
- */
22
- namespace: z.string().optional(),
23
- /**
24
- * The prefix to be used for the name.
25
- */
26
- prefix: z.string().optional(),
27
- /**
28
- * Declares whether the property definition translates to an attribute instead of an element.
29
- * Default value is false.
30
- */
31
- attribute: z.boolean().optional(),
32
- /**
33
- * MAY be used only for an array definition.
34
- * Signifies whether the array is wrapped (for example, <books><book/><book/></books>)
35
- * or unwrapped (<book/><book/>). Default value is false.
36
- */
37
- wrapped: z.boolean().optional(),
3
+ /**
4
+ * Replaces the name of the element/attribute used for the described schema property.
5
+ */
6
+ name: z.string().optional(),
7
+ /**
8
+ * The URI of the namespace definition. Value MUST be in the form of a URL.
9
+ */
10
+ namespace: z.string().optional(),
11
+ /**
12
+ * The prefix to be used for the name.
13
+ */
14
+ prefix: z.string().optional(),
15
+ /**
16
+ * Declares whether the property definition translates to an attribute instead of an element.
17
+ * Default value is false.
18
+ */
19
+ attribute: z.boolean().optional(),
20
+ /**
21
+ * MAY be used only for an array definition.
22
+ * Signifies whether the array is wrapped (for example, <books><book/><book/></books>)
23
+ * or unwrapped (<book/><book/>). Default value is false.
24
+ */
25
+ wrapped: z.boolean().optional()
38
26
  });
39
-
40
- export { XmlObjectSchema };
27
+ export {
28
+ XmlObjectSchema
29
+ };
30
+ //# sourceMappingURL=xml-object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/3.1/processed/xml-object.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\n/**\n *\n * XML Object\n *\n * A metadata object that allows for more fine-tuned XML model definitions.\n *\n * When using arrays, XML element names are not inferred (for singular/plural forms) and the name field SHOULD be used\n * to add that information. See examples for expected behavior.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#xml-object\n */\nexport const XmlObjectSchema = z.object({\n /**\n * Replaces the name of the element/attribute used for the described schema property.\n */\n name: z.string().optional(),\n\n /**\n * The URI of the namespace definition. Value MUST be in the form of a URL.\n */\n namespace: z.string().optional(),\n\n /**\n * The prefix to be used for the name.\n */\n prefix: z.string().optional(),\n\n /**\n * Declares whether the property definition translates to an attribute instead of an element.\n * Default value is false.\n */\n attribute: z.boolean().optional(),\n\n /**\n * MAY be used only for an array definition.\n * Signifies whether the array is wrapped (for example, <books><book/><book/></books>)\n * or unwrapped (<book/><book/>). Default value is false.\n */\n wrapped: z.boolean().optional(),\n})\n\nexport type XMLObject = z.infer<typeof XmlObjectSchema>\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAaX,MAAM,kBAAkB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAItC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAK1B,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAK/B,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5B,WAAW,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,SAAS,EAAE,QAAQ,EAAE,SAAS;AAChC,CAAC;",
6
+ "names": []
7
+ }
@@ -1,23 +1,17 @@
1
- import { z } from 'zod';
2
- import { BasePathItemObjectSchema as BasePathItemObjectSchema$1 } from '../processed/base-path-item-object.js';
3
- import { ParameterObjectSchema } from './parameter-object.js';
4
- import { ReferenceObjectSchema } from './reference-object.js';
5
-
6
- /**
7
- * Base Path Item Object Schema
8
- *
9
- * This helps break circular dependencies between path-item-object and callback-object
10
- *
11
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#path-item-object
12
- */
13
- const BasePathItemObjectSchema = BasePathItemObjectSchema$1.extend({
14
- /**
15
- * A list of parameters that are applicable for all the operations described under this path. These parameters can be
16
- * overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A
17
- * unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link
18
- * to parameters that are defined at the OpenAPI Object's components/parameters.
19
- */
20
- parameters: z.array(z.union([ReferenceObjectSchema, ParameterObjectSchema])).optional(),
1
+ import { z } from "zod";
2
+ import { BasePathItemObjectSchema as OriginalBasePathItemObjectSchema } from "../processed/base-path-item-object.js";
3
+ import { ParameterObjectSchema } from "./parameter-object.js";
4
+ import { ReferenceObjectSchema } from "./reference-object.js";
5
+ const BasePathItemObjectSchema = OriginalBasePathItemObjectSchema.extend({
6
+ /**
7
+ * A list of parameters that are applicable for all the operations described under this path. These parameters can be
8
+ * overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A
9
+ * unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link
10
+ * to parameters that are defined at the OpenAPI Object's components/parameters.
11
+ */
12
+ parameters: z.array(z.union([ReferenceObjectSchema, ParameterObjectSchema])).optional()
21
13
  });
22
-
23
- export { BasePathItemObjectSchema };
14
+ export {
15
+ BasePathItemObjectSchema
16
+ };
17
+ //# sourceMappingURL=base-path-item-object.js.map