@scalar/oas-utils 0.2.140 → 0.2.142

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 (280) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/entities/cookie/cookie.js +14 -13
  3. package/dist/entities/cookie/cookie.js.map +7 -0
  4. package/dist/entities/cookie/index.d.ts +1 -1
  5. package/dist/entities/cookie/index.d.ts.map +1 -1
  6. package/dist/entities/cookie/index.js +5 -1
  7. package/dist/entities/cookie/index.js.map +7 -0
  8. package/dist/entities/environment/environment.js +10 -9
  9. package/dist/entities/environment/environment.js.map +7 -0
  10. package/dist/entities/environment/index.d.ts +1 -1
  11. package/dist/entities/environment/index.d.ts.map +1 -1
  12. package/dist/entities/environment/index.js +5 -1
  13. package/dist/entities/environment/index.js.map +7 -0
  14. package/dist/entities/hotkeys/hotkeys.js +109 -116
  15. package/dist/entities/hotkeys/hotkeys.js.map +7 -0
  16. package/dist/entities/hotkeys/index.d.ts +1 -1
  17. package/dist/entities/hotkeys/index.d.ts.map +1 -1
  18. package/dist/entities/hotkeys/index.js +6 -1
  19. package/dist/entities/hotkeys/index.js.map +7 -0
  20. package/dist/entities/shared/index.d.ts +1 -1
  21. package/dist/entities/shared/index.d.ts.map +1 -1
  22. package/dist/entities/shared/index.js +7 -1
  23. package/dist/entities/shared/index.js.map +7 -0
  24. package/dist/entities/shared/utility.js +9 -12
  25. package/dist/entities/shared/utility.js.map +7 -0
  26. package/dist/entities/spec/collection.d.ts.map +1 -1
  27. package/dist/entities/spec/collection.js +91 -94
  28. package/dist/entities/spec/collection.js.map +7 -0
  29. package/dist/entities/spec/index.d.ts +8 -8
  30. package/dist/entities/spec/index.d.ts.map +1 -1
  31. package/dist/entities/spec/index.js +59 -9
  32. package/dist/entities/spec/index.js.map +7 -0
  33. package/dist/entities/spec/operation.d.ts +1 -1
  34. package/dist/entities/spec/operation.d.ts.map +1 -1
  35. package/dist/entities/spec/operation.js +5 -8
  36. package/dist/entities/spec/operation.js.map +7 -0
  37. package/dist/entities/spec/operation.test.js +43 -0
  38. package/dist/entities/spec/operation.test.js.map +7 -0
  39. package/dist/entities/spec/parameters.d.ts +1 -1
  40. package/dist/entities/spec/parameters.d.ts.map +1 -1
  41. package/dist/entities/spec/parameters.js +40 -38
  42. package/dist/entities/spec/parameters.js.map +7 -0
  43. package/dist/entities/spec/parameters.test.js +71 -0
  44. package/dist/entities/spec/parameters.test.js.map +7 -0
  45. package/dist/entities/spec/request-example.test.js +637 -0
  46. package/dist/entities/spec/request-example.test.js.map +7 -0
  47. package/dist/entities/spec/request-examples.d.ts +3 -3
  48. package/dist/entities/spec/request-examples.d.ts.map +1 -1
  49. package/dist/entities/spec/request-examples.js +323 -338
  50. package/dist/entities/spec/request-examples.js.map +7 -0
  51. package/dist/entities/spec/requests.d.ts +6 -8
  52. package/dist/entities/spec/requests.d.ts.map +1 -1
  53. package/dist/entities/spec/requests.js +80 -101
  54. package/dist/entities/spec/requests.js.map +7 -0
  55. package/dist/entities/spec/server.js +47 -63
  56. package/dist/entities/spec/server.js.map +7 -0
  57. package/dist/entities/spec/server.test.js +120 -0
  58. package/dist/entities/spec/server.test.js.map +7 -0
  59. package/dist/entities/spec/spec-objects.d.ts.map +1 -1
  60. package/dist/entities/spec/spec-objects.js +77 -121
  61. package/dist/entities/spec/spec-objects.js.map +7 -0
  62. package/dist/entities/spec/spec-objects.test.js +205 -0
  63. package/dist/entities/spec/spec-objects.test.js.map +7 -0
  64. package/dist/entities/spec/x-scalar-environments.js +21 -18
  65. package/dist/entities/spec/x-scalar-environments.js.map +7 -0
  66. package/dist/entities/spec/x-scalar-environments.test.js +11 -0
  67. package/dist/entities/spec/x-scalar-environments.test.js.map +7 -0
  68. package/dist/entities/spec/x-scalar-secrets.js +8 -6
  69. package/dist/entities/spec/x-scalar-secrets.js.map +7 -0
  70. package/dist/entities/spec/x-scalar-secrets.test.js +11 -0
  71. package/dist/entities/spec/x-scalar-secrets.test.js.map +7 -0
  72. package/dist/entities/workspace/index.d.ts +1 -1
  73. package/dist/entities/workspace/index.d.ts.map +1 -1
  74. package/dist/entities/workspace/index.js +7 -1
  75. package/dist/entities/workspace/index.js.map +7 -0
  76. package/dist/entities/workspace/workspace.js +46 -50
  77. package/dist/entities/workspace/workspace.js.map +7 -0
  78. package/dist/helpers/create-hash.js +15 -18
  79. package/dist/helpers/create-hash.js.map +7 -0
  80. package/dist/helpers/ensure-protocol.js +9 -10
  81. package/dist/helpers/ensure-protocol.js.map +7 -0
  82. package/dist/helpers/ensure-protocol.test.js +70 -0
  83. package/dist/helpers/ensure-protocol.test.js.map +7 -0
  84. package/dist/helpers/fetch-document.js +24 -32
  85. package/dist/helpers/fetch-document.js.map +7 -0
  86. package/dist/helpers/fetch-document.test.js +63 -0
  87. package/dist/helpers/fetch-document.test.js.map +7 -0
  88. package/dist/helpers/fetch-with-proxy-fallback.js +20 -28
  89. package/dist/helpers/fetch-with-proxy-fallback.js.map +7 -0
  90. package/dist/helpers/find-variables.d.ts +1 -1
  91. package/dist/helpers/find-variables.d.ts.map +1 -1
  92. package/dist/helpers/find-variables.js +6 -8
  93. package/dist/helpers/find-variables.js.map +7 -0
  94. package/dist/helpers/find-variables.test.js +20 -0
  95. package/dist/helpers/find-variables.test.js.map +7 -0
  96. package/dist/helpers/http-methods.d.ts +1 -1
  97. package/dist/helpers/http-methods.d.ts.map +1 -1
  98. package/dist/helpers/http-methods.js +60 -66
  99. package/dist/helpers/http-methods.js.map +7 -0
  100. package/dist/helpers/http-status-codes.js +319 -317
  101. package/dist/helpers/http-status-codes.js.map +7 -0
  102. package/dist/helpers/index.d.ts +27 -27
  103. package/dist/helpers/index.d.ts.map +1 -1
  104. package/dist/helpers/index.js +73 -27
  105. package/dist/helpers/index.js.map +7 -0
  106. package/dist/helpers/is-defined.js +5 -14
  107. package/dist/helpers/is-defined.js.map +7 -0
  108. package/dist/helpers/is-defined.test.js +37 -0
  109. package/dist/helpers/is-defined.test.js.map +7 -0
  110. package/dist/helpers/is-local-url.js +11 -16
  111. package/dist/helpers/is-local-url.js.map +7 -0
  112. package/dist/helpers/is-local-url.test.js +40 -0
  113. package/dist/helpers/is-local-url.test.js.map +7 -0
  114. package/dist/helpers/is-valid-url.js +9 -18
  115. package/dist/helpers/is-valid-url.js.map +7 -0
  116. package/dist/helpers/is-valid-url.test.js +17 -0
  117. package/dist/helpers/is-valid-url.test.js.map +7 -0
  118. package/dist/helpers/iterate-title.js +11 -15
  119. package/dist/helpers/iterate-title.js.map +7 -0
  120. package/dist/helpers/json2xml.js +40 -47
  121. package/dist/helpers/json2xml.js.map +7 -0
  122. package/dist/helpers/json2xml.test.js +19 -0
  123. package/dist/helpers/json2xml.test.js.map +7 -0
  124. package/dist/helpers/local-storage.js +13 -15
  125. package/dist/helpers/local-storage.js.map +7 -0
  126. package/dist/helpers/make-url-absolute.js +11 -17
  127. package/dist/helpers/make-url-absolute.js.map +7 -0
  128. package/dist/helpers/make-url-absolute.test.js +61 -0
  129. package/dist/helpers/make-url-absolute.test.js.map +7 -0
  130. package/dist/helpers/merge-urls.js +50 -75
  131. package/dist/helpers/merge-urls.js.map +7 -0
  132. package/dist/helpers/merge-urls.test.js +339 -0
  133. package/dist/helpers/merge-urls.test.js.map +7 -0
  134. package/dist/helpers/normalize-mime-type-object.js +21 -31
  135. package/dist/helpers/normalize-mime-type-object.js.map +7 -0
  136. package/dist/helpers/normalize-mime-type-object.test.js +53 -0
  137. package/dist/helpers/normalize-mime-type-object.test.js.map +7 -0
  138. package/dist/helpers/normalize-mime-type.js +8 -18
  139. package/dist/helpers/normalize-mime-type.js.map +7 -0
  140. package/dist/helpers/normalize-mime-type.test.js +33 -0
  141. package/dist/helpers/normalize-mime-type.test.js.map +7 -0
  142. package/dist/helpers/object.js +12 -18
  143. package/dist/helpers/object.js.map +7 -0
  144. package/dist/helpers/omit-undefined-values.js +17 -19
  145. package/dist/helpers/omit-undefined-values.js.map +7 -0
  146. package/dist/helpers/omit-undefined-values.test.js +89 -0
  147. package/dist/helpers/omit-undefined-values.test.js.map +7 -0
  148. package/dist/helpers/parse.js +71 -83
  149. package/dist/helpers/parse.js.map +7 -0
  150. package/dist/helpers/parse.test.js +45 -0
  151. package/dist/helpers/parse.test.js.map +7 -0
  152. package/dist/helpers/pretty-print-json.js +31 -35
  153. package/dist/helpers/pretty-print-json.js.map +7 -0
  154. package/dist/helpers/pretty-print-json.test.js +28 -0
  155. package/dist/helpers/pretty-print-json.test.js.map +7 -0
  156. package/dist/helpers/redirect-to-proxy.js +46 -83
  157. package/dist/helpers/redirect-to-proxy.js.map +7 -0
  158. package/dist/helpers/redirect-to-proxy.test.js +54 -0
  159. package/dist/helpers/redirect-to-proxy.test.js.map +7 -0
  160. package/dist/helpers/regex-helpers.js +11 -9
  161. package/dist/helpers/regex-helpers.js.map +7 -0
  162. package/dist/helpers/regex-helpers.test.js +154 -0
  163. package/dist/helpers/regex-helpers.test.js.map +7 -0
  164. package/dist/helpers/replace-variables.js +13 -16
  165. package/dist/helpers/replace-variables.js.map +7 -0
  166. package/dist/helpers/replace-variables.test.js +30 -0
  167. package/dist/helpers/replace-variables.test.js.map +7 -0
  168. package/dist/helpers/schema-model.js +15 -14
  169. package/dist/helpers/schema-model.js.map +7 -0
  170. package/dist/helpers/security/get-schemes.d.ts +1 -1
  171. package/dist/helpers/security/get-schemes.d.ts.map +1 -1
  172. package/dist/helpers/security/get-schemes.js +7 -9
  173. package/dist/helpers/security/get-schemes.js.map +7 -0
  174. package/dist/helpers/security/get-schemes.test.js +71 -0
  175. package/dist/helpers/security/get-schemes.test.js.map +7 -0
  176. package/dist/helpers/security/has-token.js +18 -19
  177. package/dist/helpers/security/has-token.js.map +7 -0
  178. package/dist/helpers/security/has-token.test.js +157 -0
  179. package/dist/helpers/security/has-token.test.js.map +7 -0
  180. package/dist/helpers/security/index.d.ts +2 -2
  181. package/dist/helpers/security/index.d.ts.map +1 -1
  182. package/dist/helpers/security/index.js +7 -2
  183. package/dist/helpers/security/index.js.map +7 -0
  184. package/dist/helpers/should-ignore-entity.d.ts +2 -2
  185. package/dist/helpers/should-ignore-entity.d.ts.map +1 -1
  186. package/dist/helpers/should-ignore-entity.js +5 -6
  187. package/dist/helpers/should-ignore-entity.js.map +7 -0
  188. package/dist/helpers/ssr-state.js +6 -6
  189. package/dist/helpers/ssr-state.js.map +7 -0
  190. package/dist/helpers/string.js +6 -18
  191. package/dist/helpers/string.js.map +7 -0
  192. package/dist/migrations/data-version.js +7 -17
  193. package/dist/migrations/data-version.js.map +7 -0
  194. package/dist/migrations/generate-types.js +56 -0
  195. package/dist/migrations/generate-types.js.map +7 -0
  196. package/dist/migrations/index.d.ts +3 -3
  197. package/dist/migrations/index.d.ts.map +1 -1
  198. package/dist/migrations/index.js +10 -3
  199. package/dist/migrations/index.js.map +7 -0
  200. package/dist/migrations/local-storage.d.ts +1 -1
  201. package/dist/migrations/local-storage.d.ts.map +1 -1
  202. package/dist/migrations/local-storage.js +27 -32
  203. package/dist/migrations/local-storage.js.map +7 -0
  204. package/dist/migrations/migrator.d.ts +1 -1
  205. package/dist/migrations/migrator.d.ts.map +1 -1
  206. package/dist/migrations/migrator.js +51 -58
  207. package/dist/migrations/migrator.js.map +7 -0
  208. package/dist/migrations/semver.js +23 -25
  209. package/dist/migrations/semver.js.map +7 -0
  210. package/dist/migrations/semver.test.js +21 -0
  211. package/dist/migrations/semver.test.js.map +7 -0
  212. package/dist/migrations/v-0.0.0/types.generated.js +1 -0
  213. package/dist/migrations/v-0.0.0/types.generated.js.map +7 -0
  214. package/dist/migrations/v-2.1.0/migration.d.ts +2 -2
  215. package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -1
  216. package/dist/migrations/v-2.1.0/migration.js +256 -273
  217. package/dist/migrations/v-2.1.0/migration.js.map +7 -0
  218. package/dist/migrations/v-2.1.0/types.generated.js +1 -0
  219. package/dist/migrations/v-2.1.0/types.generated.js.map +7 -0
  220. package/dist/migrations/v-2.2.0/migration.d.ts +2 -2
  221. package/dist/migrations/v-2.2.0/migration.d.ts.map +1 -1
  222. package/dist/migrations/v-2.2.0/migration.js +95 -100
  223. package/dist/migrations/v-2.2.0/migration.js.map +7 -0
  224. package/dist/migrations/v-2.2.0/types.generated.js +1 -0
  225. package/dist/migrations/v-2.2.0/types.generated.js.map +7 -0
  226. package/dist/migrations/v-2.3.0/migration.d.ts +2 -2
  227. package/dist/migrations/v-2.3.0/migration.d.ts.map +1 -1
  228. package/dist/migrations/v-2.3.0/migration.js +47 -46
  229. package/dist/migrations/v-2.3.0/migration.js.map +7 -0
  230. package/dist/migrations/v-2.3.0/types.generated.js +1 -0
  231. package/dist/migrations/v-2.3.0/types.generated.js.map +7 -0
  232. package/dist/migrations/v-2.4.0/migration.d.ts +2 -2
  233. package/dist/migrations/v-2.4.0/migration.d.ts.map +1 -1
  234. package/dist/migrations/v-2.4.0/migration.js +24 -26
  235. package/dist/migrations/v-2.4.0/migration.js.map +7 -0
  236. package/dist/migrations/v-2.4.0/migration.test.js +90 -0
  237. package/dist/migrations/v-2.4.0/migration.test.js.map +7 -0
  238. package/dist/migrations/v-2.4.0/types.generated.js +1 -0
  239. package/dist/migrations/v-2.4.0/types.generated.js.map +7 -0
  240. package/dist/migrations/v-2.5.0/migration.d.ts +2 -2
  241. package/dist/migrations/v-2.5.0/migration.d.ts.map +1 -1
  242. package/dist/migrations/v-2.5.0/migration.js +135 -119
  243. package/dist/migrations/v-2.5.0/migration.js.map +7 -0
  244. package/dist/migrations/v-2.5.0/migration.test.js +108 -0
  245. package/dist/migrations/v-2.5.0/migration.test.js.map +7 -0
  246. package/dist/migrations/v-2.5.0/types.generated.d.ts +8 -8
  247. package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
  248. package/dist/migrations/v-2.5.0/types.generated.js +1 -0
  249. package/dist/migrations/v-2.5.0/types.generated.js.map +7 -0
  250. package/dist/spec-getters/get-example-from-schema.js +206 -268
  251. package/dist/spec-getters/get-example-from-schema.js.map +7 -0
  252. package/dist/spec-getters/get-example-from-schema.test.js +1092 -0
  253. package/dist/spec-getters/get-example-from-schema.test.js.map +7 -0
  254. package/dist/spec-getters/get-parameters-from-operation.js +22 -42
  255. package/dist/spec-getters/get-parameters-from-operation.js.map +7 -0
  256. package/dist/spec-getters/get-parameters-from-operation.test.js +178 -0
  257. package/dist/spec-getters/get-parameters-from-operation.test.js.map +7 -0
  258. package/dist/spec-getters/get-request-body-from-operation.js +110 -162
  259. package/dist/spec-getters/get-request-body-from-operation.js.map +7 -0
  260. package/dist/spec-getters/get-request-body-from-operation.test.js +289 -0
  261. package/dist/spec-getters/get-request-body-from-operation.test.js.map +7 -0
  262. package/dist/spec-getters/get-server-variable-examples.d.ts +1 -1
  263. package/dist/spec-getters/get-server-variable-examples.d.ts.map +1 -1
  264. package/dist/spec-getters/get-server-variable-examples.js +12 -11
  265. package/dist/spec-getters/get-server-variable-examples.js.map +7 -0
  266. package/dist/spec-getters/index.d.ts +4 -4
  267. package/dist/spec-getters/index.d.ts.map +1 -1
  268. package/dist/spec-getters/index.js +11 -4
  269. package/dist/spec-getters/index.js.map +7 -0
  270. package/dist/transforms/import-spec.d.ts +6 -6
  271. package/dist/transforms/import-spec.d.ts.map +1 -1
  272. package/dist/transforms/import-spec.js +313 -425
  273. package/dist/transforms/import-spec.js.map +7 -0
  274. package/dist/transforms/import-spec.test.js +1124 -0
  275. package/dist/transforms/import-spec.test.js.map +7 -0
  276. package/dist/transforms/index.d.ts +1 -1
  277. package/dist/transforms/index.d.ts.map +1 -1
  278. package/dist/transforms/index.js +13 -1
  279. package/dist/transforms/index.js.map +7 -0
  280. package/package.json +10 -11
@@ -1,99 +1,96 @@
1
- import { selectedSecuritySchemeUidSchema } from '../shared/utility.js';
2
- import { xScalarEnvironmentsSchema } from './x-scalar-environments.js';
3
- import { xScalarSecretsSchema } from './x-scalar-secrets.js';
4
- import { oasSecurityRequirementSchema } from '@scalar/types/entities';
5
- import { nanoidSchema } from '@scalar/types/utils';
6
- import { z } from 'zod';
7
- import { oasInfoSchema, oasExternalDocumentationSchema } from './spec-objects.js';
8
-
1
+ import { selectedSecuritySchemeUidSchema } from "../../entities/shared/utility.js";
2
+ import { xScalarEnvironmentsSchema } from "../../entities/spec/x-scalar-environments.js";
3
+ import { xScalarSecretsSchema } from "../../entities/spec/x-scalar-secrets.js";
4
+ import { oasSecurityRequirementSchema } from "@scalar/types/entities";
5
+ import { nanoidSchema } from "@scalar/types/utils";
6
+ import { z } from "zod";
7
+ import { oasExternalDocumentationSchema, oasInfoSchema } from "./spec-objects.js";
9
8
  const oasCollectionSchema = z.object({
10
- /**
11
- * @deprecated
12
- *
13
- * Needs to be remove as it is not a spec property
14
- */
15
- 'type': z.literal('collection').optional().default('collection'),
16
- 'openapi': z
17
- .union([z.string(), z.literal('3.0.0'), z.literal('3.1.0'), z.literal('4.0.0')])
18
- .optional()
19
- .default('3.1.0'),
20
- 'jsonSchemaDialect': z.string().optional(),
21
- 'info': oasInfoSchema.catch({
22
- title: 'API',
23
- version: '1.0',
24
- }),
25
- /**
26
- * A declaration of which security mechanisms can be used across the API. The list of
27
- * values includes alternative security requirement objects that can be used. Only
28
- * one of the security requirement objects need to be satisfied to authorize a request.
29
- * Individual operations can override this definition. To make security optional, an empty
30
- * security requirement ({}) can be included in the array.
31
- */
32
- 'security': z.array(oasSecurityRequirementSchema).optional().default([]),
33
- 'externalDocs': oasExternalDocumentationSchema.optional(),
34
- /** TODO: Type these */
35
- 'components': z.record(z.string(), z.unknown()).optional(),
36
- /** TODO: Type these */
37
- 'webhooks': z.record(z.string(), z.unknown()).optional(),
38
- /** A custom icon representing the collection */
39
- 'x-scalar-icon': z.string().optional().default('interface-content-folder'),
40
- 'x-scalar-active-environment': z.string().optional(),
41
- 'x-scalar-environments': xScalarEnvironmentsSchema.optional(),
42
- 'x-scalar-secrets': xScalarSecretsSchema.optional(),
43
- // These properties will be stripped out and mapped back as id lists
44
- // servers
45
- // paths/**
46
- // servers
47
- // tags
48
- // security
9
+ /**
10
+ * @deprecated
11
+ *
12
+ * Needs to be remove as it is not a spec property
13
+ */
14
+ "type": z.literal("collection").optional().default("collection"),
15
+ "openapi": z.union([z.string(), z.literal("3.0.0"), z.literal("3.1.0"), z.literal("4.0.0")]).optional().default("3.1.0"),
16
+ "jsonSchemaDialect": z.string().optional(),
17
+ "info": oasInfoSchema.catch({
18
+ title: "API",
19
+ version: "1.0"
20
+ }),
21
+ /**
22
+ * A declaration of which security mechanisms can be used across the API. The list of
23
+ * values includes alternative security requirement objects that can be used. Only
24
+ * one of the security requirement objects need to be satisfied to authorize a request.
25
+ * Individual operations can override this definition. To make security optional, an empty
26
+ * security requirement ({}) can be included in the array.
27
+ */
28
+ "security": z.array(oasSecurityRequirementSchema).optional().default([]),
29
+ "externalDocs": oasExternalDocumentationSchema.optional(),
30
+ /** TODO: Type these */
31
+ "components": z.record(z.string(), z.unknown()).optional(),
32
+ /** TODO: Type these */
33
+ "webhooks": z.record(z.string(), z.unknown()).optional(),
34
+ /** A custom icon representing the collection */
35
+ "x-scalar-icon": z.string().optional().default("interface-content-folder"),
36
+ "x-scalar-active-environment": z.string().optional(),
37
+ "x-scalar-environments": xScalarEnvironmentsSchema.optional(),
38
+ "x-scalar-secrets": xScalarSecretsSchema.optional()
39
+ // These properties will be stripped out and mapped back as id lists
40
+ // servers
41
+ // paths/**
42
+ // servers
43
+ // tags
44
+ // security
49
45
  });
50
46
  const extendedCollectionSchema = z.object({
51
- uid: nanoidSchema.brand(),
52
- /** A list of security schemes UIDs associated with the collection */
53
- securitySchemes: z.string().array().default([]),
54
- /** List of currently selected security scheme UIDs, these can be overridden per request */
55
- selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
56
- /** The currently selected server */
57
- selectedServerUid: z.string().brand().optional(),
58
- /** UIDs which refer to servers on the workspace base */
59
- servers: z.string().brand().array().default([]),
60
- /** Request UIDs associated with a collection */
61
- requests: z.string().brand().array().default([]),
62
- /** Tag UIDs associated with the collection */
63
- tags: z.string().brand().array().default([]),
64
- /** List of requests without tags and top level tag "folders" */
65
- children: z
66
- .union([z.string().brand(), z.string().brand()])
67
- .array()
68
- .default([]),
69
- /**
70
- * A link to where this document is stored
71
- *
72
- * - Used for watch mode
73
- * - Possibly useful for Git sync down the line
74
- */
75
- documentUrl: z.string().optional(),
76
- /**
77
- * Enables polling of OpenAPI document urls
78
- *
79
- * @remarks Only effective when `documentUrl` is set
80
- */
81
- watchMode: z.boolean().optional().default(false),
82
- /** Keeps track of which integration is associated with the specific collection */
83
- integration: z.string().nullable().optional(),
84
- /**
85
- * Selected authentication will be set at the collection level instead of the request level
86
- *
87
- * @default false
88
- */
89
- useCollectionSecurity: z.boolean().optional().default(false),
90
- /**
91
- * Status of the watcher from above
92
- *
93
- * @defaults to idle for all collections, doesn't mean that it can watch for changes
94
- */
95
- watchModeStatus: z.enum(['IDLE', 'WATCHING', 'ERROR']).optional().default('IDLE'),
47
+ uid: nanoidSchema.brand(),
48
+ /** A list of security schemes UIDs associated with the collection */
49
+ securitySchemes: z.string().array().default([]),
50
+ /** List of currently selected security scheme UIDs, these can be overridden per request */
51
+ selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
52
+ /** The currently selected server */
53
+ selectedServerUid: z.string().brand().optional(),
54
+ /** UIDs which refer to servers on the workspace base */
55
+ servers: z.string().brand().array().default([]),
56
+ /** Request UIDs associated with a collection */
57
+ requests: z.string().brand().array().default([]),
58
+ /** Tag UIDs associated with the collection */
59
+ tags: z.string().brand().array().default([]),
60
+ /** List of requests without tags and top level tag "folders" */
61
+ children: z.union([z.string().brand(), z.string().brand()]).array().default([]),
62
+ /**
63
+ * A link to where this document is stored
64
+ *
65
+ * - Used for watch mode
66
+ * - Possibly useful for Git sync down the line
67
+ */
68
+ documentUrl: z.string().optional(),
69
+ /**
70
+ * Enables polling of OpenAPI document urls
71
+ *
72
+ * @remarks Only effective when `documentUrl` is set
73
+ */
74
+ watchMode: z.boolean().optional().default(false),
75
+ /** Keeps track of which integration is associated with the specific collection */
76
+ integration: z.string().nullable().optional(),
77
+ /**
78
+ * Selected authentication will be set at the collection level instead of the request level
79
+ *
80
+ * @default false
81
+ */
82
+ useCollectionSecurity: z.boolean().optional().default(false),
83
+ /**
84
+ * Status of the watcher from above
85
+ *
86
+ * @defaults to idle for all collections, doesn't mean that it can watch for changes
87
+ */
88
+ watchModeStatus: z.enum(["IDLE", "WATCHING", "ERROR"]).optional().default("IDLE")
96
89
  });
97
90
  const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
98
-
99
- export { collectionSchema, extendedCollectionSchema, oasCollectionSchema };
91
+ export {
92
+ collectionSchema,
93
+ extendedCollectionSchema,
94
+ oasCollectionSchema
95
+ };
96
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/collection.ts"],
4
+ "sourcesContent": ["import { selectedSecuritySchemeUidSchema } from '@/entities/shared/utility'\nimport { xScalarEnvironmentsSchema } from '@/entities/spec/x-scalar-environments'\nimport { xScalarSecretsSchema } from '@/entities/spec/x-scalar-secrets'\nimport { oasSecurityRequirementSchema } from '@scalar/types/entities'\nimport { type ENTITY_BRANDS, nanoidSchema } from '@scalar/types/utils'\nimport { z } from 'zod'\n\nimport { oasExternalDocumentationSchema, oasInfoSchema } from './spec-objects'\n\nexport const oasCollectionSchema = z.object({\n /**\n * @deprecated\n *\n * Needs to be remove as it is not a spec property\n */\n 'type': z.literal('collection').optional().default('collection'),\n 'openapi': z\n .union([z.string(), z.literal('3.0.0'), z.literal('3.1.0'), z.literal('4.0.0')])\n .optional()\n .default('3.1.0'),\n 'jsonSchemaDialect': z.string().optional(),\n 'info': oasInfoSchema.catch({\n title: 'API',\n version: '1.0',\n }),\n /**\n * A declaration of which security mechanisms can be used across the API. The list of\n * values includes alternative security requirement objects that can be used. Only\n * one of the security requirement objects need to be satisfied to authorize a request.\n * Individual operations can override this definition. To make security optional, an empty\n * security requirement ({}) can be included in the array.\n */\n 'security': z.array(oasSecurityRequirementSchema).optional().default([]),\n 'externalDocs': oasExternalDocumentationSchema.optional(),\n /** TODO: Type these */\n 'components': z.record(z.string(), z.unknown()).optional(),\n /** TODO: Type these */\n 'webhooks': z.record(z.string(), z.unknown()).optional(),\n /** A custom icon representing the collection */\n 'x-scalar-icon': z.string().optional().default('interface-content-folder'),\n 'x-scalar-active-environment': z.string().optional(),\n 'x-scalar-environments': xScalarEnvironmentsSchema.optional(),\n 'x-scalar-secrets': xScalarSecretsSchema.optional(),\n // These properties will be stripped out and mapped back as id lists\n // servers\n // paths/**\n // servers\n // tags\n // security\n})\n\nexport const extendedCollectionSchema = z.object({\n uid: nanoidSchema.brand<ENTITY_BRANDS['COLLECTION']>(),\n /** A list of security schemes UIDs associated with the collection */\n securitySchemes: z.string().array().default([]),\n /** List of currently selected security scheme UIDs, these can be overridden per request */\n selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,\n /** The currently selected server */\n selectedServerUid: z.string().brand<ENTITY_BRANDS['SERVER']>().optional(),\n /** UIDs which refer to servers on the workspace base */\n servers: z.string().brand<ENTITY_BRANDS['SERVER']>().array().default([]),\n /** Request UIDs associated with a collection */\n requests: z.string().brand<ENTITY_BRANDS['OPERATION']>().array().default([]),\n /** Tag UIDs associated with the collection */\n tags: z.string().brand<ENTITY_BRANDS['TAG']>().array().default([]),\n /** List of requests without tags and top level tag \"folders\" */\n children: z\n .union([z.string().brand<ENTITY_BRANDS['OPERATION']>(), z.string().brand<ENTITY_BRANDS['TAG']>()])\n .array()\n .default([]),\n /**\n * A link to where this document is stored\n *\n * - Used for watch mode\n * - Possibly useful for Git sync down the line\n */\n documentUrl: z.string().optional(),\n /**\n * Enables polling of OpenAPI document urls\n *\n * @remarks Only effective when `documentUrl` is set\n */\n watchMode: z.boolean().optional().default(false),\n /** Keeps track of which integration is associated with the specific collection */\n integration: z.string().nullable().optional(),\n /**\n * Selected authentication will be set at the collection level instead of the request level\n *\n * @default false\n */\n useCollectionSecurity: z.boolean().optional().default(false),\n /**\n * Status of the watcher from above\n *\n * @defaults to idle for all collections, doesn't mean that it can watch for changes\n */\n watchModeStatus: z.enum(['IDLE', 'WATCHING', 'ERROR']).optional().default('IDLE'),\n})\n\nexport const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema)\nexport type Collection = z.infer<typeof collectionSchema>\nexport type CollectionPayload = z.input<typeof collectionSchema>\n"],
5
+ "mappings": "AAAA,SAAS,uCAAuC;AAChD,SAAS,iCAAiC;AAC1C,SAAS,4BAA4B;AACrC,SAAS,oCAAoC;AAC7C,SAA6B,oBAAoB;AACjD,SAAS,SAAS;AAElB,SAAS,gCAAgC,qBAAqB;AAEvD,MAAM,sBAAsB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1C,QAAQ,EAAE,QAAQ,YAAY,EAAE,SAAS,EAAE,QAAQ,YAAY;AAAA,EAC/D,WAAW,EACR,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,CAAC,CAAC,EAC9E,SAAS,EACT,QAAQ,OAAO;AAAA,EAClB,qBAAqB,EAAE,OAAO,EAAE,SAAS;AAAA,EACzC,QAAQ,cAAc,MAAM;AAAA,IAC1B,OAAO;AAAA,IACP,SAAS;AAAA,EACX,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQD,YAAY,EAAE,MAAM,4BAA4B,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EACvE,gBAAgB,+BAA+B,SAAS;AAAA;AAAA,EAExD,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,SAAS;AAAA;AAAA,EAEzD,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,SAAS;AAAA;AAAA,EAEvD,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,0BAA0B;AAAA,EACzE,+BAA+B,EAAE,OAAO,EAAE,SAAS;AAAA,EACnD,yBAAyB,0BAA0B,SAAS;AAAA,EAC5D,oBAAoB,qBAAqB,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOpD,CAAC;AAEM,MAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,KAAK,aAAa,MAAmC;AAAA;AAAA,EAErD,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAAA;AAAA,EAE9C,4BAA4B;AAAA;AAAA,EAE5B,mBAAmB,EAAE,OAAO,EAAE,MAA+B,EAAE,SAAS;AAAA;AAAA,EAExE,SAAS,EAAE,OAAO,EAAE,MAA+B,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAAA;AAAA,EAEvE,UAAU,EAAE,OAAO,EAAE,MAAkC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAAA;AAAA,EAE3E,MAAM,EAAE,OAAO,EAAE,MAA4B,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAAA;AAAA,EAEjE,UAAU,EACP,MAAM,CAAC,EAAE,OAAO,EAAE,MAAkC,GAAG,EAAE,OAAO,EAAE,MAA4B,CAAC,CAAC,EAChG,MAAM,EACN,QAAQ,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOb,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA;AAAA,EAE/C,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5C,uBAAuB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3D,iBAAiB,EAAE,KAAK,CAAC,QAAQ,YAAY,OAAO,CAAC,EAAE,SAAS,EAAE,QAAQ,MAAM;AAClF,CAAC;AAEM,MAAM,mBAAmB,oBAAoB,MAAM,wBAAwB;",
6
+ "names": []
7
+ }
@@ -1,11 +1,11 @@
1
- export { collectionSchema, type Collection, type CollectionPayload } from './collection.ts';
2
- export { oasParameterSchema, type RequestParameter, type RequestParameterPayload } from './parameters.ts';
3
- export { serverSchema, type Server, type ServerPayload } from './server.ts';
4
- export { requestSchema, type Request, type RequestPayload, type RequestMethod, type ResponseInstance, type RequestEvent, } from './requests.ts';
5
- export { requestExampleSchema, createExampleFromRequest, requestExampleParametersSchema, type RequestExample, type RequestExampleParameter, } from './request-examples.ts';
6
- export { tagSchema, oasExternalDocumentationSchema, oasInfoSchema, oasContactSchema, oasLicenseSchema, type Tag, type TagPayload, } from './spec-objects.ts';
7
- export { type Operation, type OperationPayload, operationSchema, } from './operation.ts';
8
- export { xScalarEnvironmentsSchema, type XScalarEnvironment, type XScalarEnvironments, } from './x-scalar-environments.ts';
1
+ export { collectionSchema, type Collection, type CollectionPayload } from './collection.js';
2
+ export { oasParameterSchema, type RequestParameter, type RequestParameterPayload } from './parameters.js';
3
+ export { serverSchema, type Server, type ServerPayload } from './server.js';
4
+ export { requestSchema, type Request, type RequestPayload, type RequestMethod, type ResponseInstance, type RequestEvent, } from './requests.js';
5
+ export { requestExampleSchema, createExampleFromRequest, requestExampleParametersSchema, type RequestExample, type RequestExampleParameter, } from './request-examples.js';
6
+ export { tagSchema, oasExternalDocumentationSchema, oasInfoSchema, oasContactSchema, oasLicenseSchema, type Tag, type TagPayload, } from './spec-objects.js';
7
+ export { type Operation, type OperationPayload, operationSchema, } from './operation.js';
8
+ export { xScalarEnvironmentsSchema, type XScalarEnvironment, type XScalarEnvironments, } from './x-scalar-environments.js';
9
9
  /** Re-exported here for ease of use but we should use the other ones directly */
10
10
  export { type Oauth2Flow, type Oauth2FlowPayload, type SecuritySchemaHttp, type SecuritySchemaOpenId, type SecurityScheme, type SecuritySchemeApiKey, type SecuritySchemeOauth2, type SecuritySchemeOauth2Payload, type SecuritySchemePayload, oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema, } from '@scalar/types/entities';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3F,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACzG,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GAAG,EACR,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAA;AAEnC,iFAAiF;AACjF,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACtG,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AACxE,OAAO,EACL,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GAAG,EACR,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAA;AAEhC,iFAAiF;AACjF,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,wBAAwB,CAAA"}
@@ -1,9 +1,59 @@
1
- export { collectionSchema } from './collection.js';
2
- export { oasParameterSchema } from './parameters.js';
3
- export { serverSchema } from './server.js';
4
- export { requestSchema } from './requests.js';
5
- export { createExampleFromRequest, requestExampleParametersSchema, requestExampleSchema } from './request-examples.js';
6
- export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, tagSchema } from './spec-objects.js';
7
- export { operationSchema } from './operation.js';
8
- export { xScalarEnvironmentsSchema } from './x-scalar-environments.js';
9
- export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema } from '@scalar/types/entities';
1
+ import { collectionSchema } from "./collection.js";
2
+ import { oasParameterSchema } from "./parameters.js";
3
+ import { serverSchema } from "./server.js";
4
+ import {
5
+ requestSchema
6
+ } from "./requests.js";
7
+ import {
8
+ requestExampleSchema,
9
+ createExampleFromRequest,
10
+ requestExampleParametersSchema
11
+ } from "./request-examples.js";
12
+ import {
13
+ tagSchema,
14
+ oasExternalDocumentationSchema,
15
+ oasInfoSchema,
16
+ oasContactSchema,
17
+ oasLicenseSchema
18
+ } from "./spec-objects.js";
19
+ import {
20
+ operationSchema
21
+ } from "./operation.js";
22
+ import {
23
+ xScalarEnvironmentsSchema
24
+ } from "./x-scalar-environments.js";
25
+ import {
26
+ oasSecurityRequirementSchema,
27
+ oasSecuritySchemeSchema,
28
+ pkceOptions,
29
+ securityApiKeySchema,
30
+ securityHttpSchema,
31
+ securityOauthSchema,
32
+ securityOpenIdSchema,
33
+ securitySchemeSchema
34
+ } from "@scalar/types/entities";
35
+ export {
36
+ collectionSchema,
37
+ createExampleFromRequest,
38
+ oasContactSchema,
39
+ oasExternalDocumentationSchema,
40
+ oasInfoSchema,
41
+ oasLicenseSchema,
42
+ oasParameterSchema,
43
+ oasSecurityRequirementSchema,
44
+ oasSecuritySchemeSchema,
45
+ operationSchema,
46
+ pkceOptions,
47
+ requestExampleParametersSchema,
48
+ requestExampleSchema,
49
+ requestSchema,
50
+ securityApiKeySchema,
51
+ securityHttpSchema,
52
+ securityOauthSchema,
53
+ securityOpenIdSchema,
54
+ securitySchemeSchema,
55
+ serverSchema,
56
+ tagSchema,
57
+ xScalarEnvironmentsSchema
58
+ };
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/index.ts"],
4
+ "sourcesContent": ["export { collectionSchema, type Collection, type CollectionPayload } from './collection'\nexport { oasParameterSchema, type RequestParameter, type RequestParameterPayload } from './parameters'\nexport { serverSchema, type Server, type ServerPayload } from './server'\nexport {\n requestSchema,\n type Request,\n type RequestPayload,\n type RequestMethod,\n type ResponseInstance,\n type RequestEvent,\n} from './requests'\n\nexport {\n requestExampleSchema,\n createExampleFromRequest,\n requestExampleParametersSchema,\n type RequestExample,\n type RequestExampleParameter,\n} from './request-examples'\n\nexport {\n tagSchema,\n oasExternalDocumentationSchema,\n oasInfoSchema,\n oasContactSchema,\n oasLicenseSchema,\n type Tag,\n type TagPayload,\n} from './spec-objects'\n\nexport {\n type Operation,\n type OperationPayload,\n operationSchema,\n} from './operation'\n\nexport {\n xScalarEnvironmentsSchema,\n type XScalarEnvironment,\n type XScalarEnvironments,\n} from './x-scalar-environments'\n\n/** Re-exported here for ease of use but we should use the other ones directly */\nexport {\n type Oauth2Flow,\n type Oauth2FlowPayload,\n type SecuritySchemaHttp,\n type SecuritySchemaOpenId,\n type SecurityScheme,\n type SecuritySchemeApiKey,\n type SecuritySchemeOauth2,\n type SecuritySchemeOauth2Payload,\n type SecuritySchemePayload,\n oasSecurityRequirementSchema,\n oasSecuritySchemeSchema,\n pkceOptions,\n securityApiKeySchema,\n securityHttpSchema,\n securityOauthSchema,\n securityOpenIdSchema,\n securitySchemeSchema,\n} from '@scalar/types/entities'\n"],
5
+ "mappings": "AAAA,SAAS,wBAAiE;AAC1E,SAAS,0BAA+E;AACxF,SAAS,oBAAqD;AAC9D;AAAA,EACE;AAAA,OAMK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EAGE;AAAA,OACK;AAEP;AAAA,EACE;AAAA,OAGK;AAGP;AAAA,EAUE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
+ "names": []
7
+ }
@@ -2,7 +2,7 @@
2
2
  * Aliases Request to Operation which is closer to the spec,
3
3
  * also will not conflict with the builtin Request class
4
4
  */
5
- import { type RequestPayload, type Request as RequestType } from './requests.ts';
5
+ import { type RequestPayload, type Request as RequestType } from './requests.js';
6
6
  export type Operation = RequestType;
7
7
  export type OperationPayload = RequestPayload;
8
8
  export declare const operationSchema: import("zod").ZodObject<import("zod").objectUtil.extendShape<import("zod").objectUtil.extendShape<import("zod").objectUtil.extendShape<Omit<{
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,IAAI,WAAW,EAAiB,MAAM,eAAe,CAAA;AAE/F,MAAM,MAAM,SAAS,GAAG,WAAW,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAC7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACqV,CAAC;YAAkC,CAAC;;;aAAoE,CAAC;YAAuB,CAAC;;;;;;;;aAAqT,CAAC;YAAkC,CAAC;;;aAAoE,CAAC;YAAuB,CAAC;;;;;;;;aAAwT,CAAC;YAAkC,CAAC;;;aAAoE,CAAC;YAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADrzC,CAAA"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,IAAI,WAAW,EAAiB,MAAM,YAAY,CAAA;AAE5F,MAAM,MAAM,SAAS,GAAG,WAAW,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAC7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACwV,CAAC;YAAkC,CAAC;;;aAAoE,CAAC;YAAuB,CAAC;;;;;;;;aAAqT,CAAC;YAAkC,CAAC;;;aAAoE,CAAC;YAAuB,CAAC;;;;;;;;aAAwT,CAAC;YAAkC,CAAC;;;aAAoE,CAAC;YAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADxzC,CAAA"}
@@ -1,9 +1,6 @@
1
- import { requestSchema } from './requests.js';
2
-
3
- /**
4
- * Aliases Request to Operation which is closer to the spec,
5
- * also will not conflict with the builtin Request class
6
- */
1
+ import { requestSchema } from "./requests.js";
7
2
  const operationSchema = requestSchema;
8
-
9
- export { operationSchema };
3
+ export {
4
+ operationSchema
5
+ };
6
+ //# sourceMappingURL=operation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/operation.ts"],
4
+ "sourcesContent": ["/**\n * Aliases Request to Operation which is closer to the spec,\n * also will not conflict with the builtin Request class\n */\nimport { type RequestPayload, type Request as RequestType, requestSchema } from './requests'\n\nexport type Operation = RequestType\nexport type OperationPayload = RequestPayload\nexport const operationSchema = requestSchema\n"],
5
+ "mappings": "AAIA,SAA2D,qBAAqB;AAIzE,MAAM,kBAAkB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,43 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { operationSchema } from "./operation.js";
3
+ describe("operationSchema", () => {
4
+ describe("x-scalar-stability", () => {
5
+ it("parses deprecated", () => {
6
+ expect(
7
+ operationSchema.parse({
8
+ "x-scalar-stability": "deprecated"
9
+ })
10
+ ).toMatchObject({
11
+ "x-scalar-stability": "deprecated"
12
+ });
13
+ });
14
+ it("parses experimental", () => {
15
+ expect(
16
+ operationSchema.parse({
17
+ "x-scalar-stability": "experimental"
18
+ })
19
+ ).toMatchObject({
20
+ "x-scalar-stability": "experimental"
21
+ });
22
+ });
23
+ it("parses stable", () => {
24
+ expect(
25
+ operationSchema.parse({
26
+ "x-scalar-stability": "stable"
27
+ })
28
+ ).toMatchObject({
29
+ "x-scalar-stability": "stable"
30
+ });
31
+ });
32
+ it("parses unknown", () => {
33
+ expect(
34
+ operationSchema.parse({
35
+ "x-scalar-stability": "unknown"
36
+ })
37
+ ).toMatchObject({
38
+ "x-scalar-stability": void 0
39
+ });
40
+ });
41
+ });
42
+ });
43
+ //# sourceMappingURL=operation.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/operation.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { operationSchema } from './operation'\n\ndescribe('operationSchema', () => {\n describe('x-scalar-stability', () => {\n it('parses deprecated', () => {\n expect(\n operationSchema.parse({\n 'x-scalar-stability': 'deprecated',\n }),\n ).toMatchObject({\n 'x-scalar-stability': 'deprecated',\n })\n })\n\n it('parses experimental', () => {\n expect(\n operationSchema.parse({\n 'x-scalar-stability': 'experimental',\n }),\n ).toMatchObject({\n 'x-scalar-stability': 'experimental',\n })\n })\n\n it('parses stable', () => {\n expect(\n operationSchema.parse({\n 'x-scalar-stability': 'stable',\n }),\n ).toMatchObject({\n 'x-scalar-stability': 'stable',\n })\n })\n\n it('parses unknown', () => {\n expect(\n operationSchema.parse({\n 'x-scalar-stability': 'unknown',\n }),\n ).toMatchObject({\n 'x-scalar-stability': undefined,\n })\n })\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,uBAAuB;AAEhC,SAAS,mBAAmB,MAAM;AAChC,WAAS,sBAAsB,MAAM;AACnC,OAAG,qBAAqB,MAAM;AAC5B;AAAA,QACE,gBAAgB,MAAM;AAAA,UACpB,sBAAsB;AAAA,QACxB,CAAC;AAAA,MACH,EAAE,cAAc;AAAA,QACd,sBAAsB;AAAA,MACxB,CAAC;AAAA,IACH,CAAC;AAED,OAAG,uBAAuB,MAAM;AAC9B;AAAA,QACE,gBAAgB,MAAM;AAAA,UACpB,sBAAsB;AAAA,QACxB,CAAC;AAAA,MACH,EAAE,cAAc;AAAA,QACd,sBAAsB;AAAA,MACxB,CAAC;AAAA,IACH,CAAC;AAED,OAAG,iBAAiB,MAAM;AACxB;AAAA,QACE,gBAAgB,MAAM;AAAA,UACpB,sBAAsB;AAAA,QACxB,CAAC;AAAA,MACH,EAAE,cAAc;AAAA,QACd,sBAAsB;AAAA,MACxB,CAAC;AAAA,IACH,CAAC;AAED,OAAG,kBAAkB,MAAM;AACzB;AAAA,QACE,gBAAgB,MAAM;AAAA,UACpB,sBAAsB;AAAA,QACxB,CAAC;AAAA,MACH,EAAE,cAAc;AAAA,QACd,sBAAsB;AAAA,MACxB,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
3
- import type { RequestExampleParameter } from './request-examples.ts';
3
+ import type { RequestExampleParameter } from './request-examples.js';
4
4
  export declare const parameterTypeSchema: z.ZodEnum<["path", "query", "header", "cookie"]>;
5
5
  export type ParamType = z.infer<typeof parameterTypeSchema>;
6
6
  export declare const parameterStyleSchema: z.ZodEnum<["matrix", "simple", "form", "label", "spaceDelimited", "pipeDelimited", "deepObject"]>;
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/parameters.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAEpE,eAAO,MAAM,mBAAmB,kDAAgD,CAAA;AAChF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE3D,eAAO,MAAM,oBAAoB,mGAQ/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CACnC,MAAM,EACN;IACE,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IAClD,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC,CACF,CAAA;AACD,eAAO,MAAM,sBAAsB,cAAc,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;IAI7B,yBAAyB;;IAEzB,yBAAyB;;;;IAIzB,wFAAwF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBjD,CAAA;AAEzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AACjE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/parameters.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAEjE,eAAO,MAAM,mBAAmB,kDAAgD,CAAA;AAChF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE3D,eAAO,MAAM,oBAAoB,mGAQ/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CACnC,MAAM,EACN;IACE,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IAClD,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC,CACF,CAAA;AACD,eAAO,MAAM,sBAAsB,cAAc,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;IAI7B,yBAAyB;;IAEzB,yBAAyB;;;;IAIzB,wFAAwF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBjD,CAAA;AAEzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AACjE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
@@ -1,42 +1,44 @@
1
- import { z } from 'zod';
2
-
3
- const parameterTypeSchema = z.enum(['path', 'query', 'header', 'cookie']);
1
+ import { z } from "zod";
2
+ const parameterTypeSchema = z.enum(["path", "query", "header", "cookie"]);
4
3
  const parameterStyleSchema = z.enum([
5
- 'matrix',
6
- 'simple',
7
- 'form',
8
- 'label',
9
- 'spaceDelimited',
10
- 'pipeDelimited',
11
- 'deepObject',
4
+ "matrix",
5
+ "simple",
6
+ "form",
7
+ "label",
8
+ "spaceDelimited",
9
+ "pipeDelimited",
10
+ "deepObject"
12
11
  ]);
13
- z.unknown();
14
- /**
15
- * OpenAPI compliant parameters object
16
- */
12
+ const parameterExampleSchema = z.unknown();
17
13
  const oasParameterSchema = z.object({
18
- in: parameterTypeSchema,
19
- name: z.string(),
20
- description: z.string().optional(),
21
- /** Defaulted to false */
22
- required: z.boolean().optional().default(false),
23
- /** Defaulted to false */
24
- deprecated: z.boolean().optional().default(false),
25
- schema: z.unknown().optional(),
26
- content: z.unknown().optional(),
27
- /** Defaulted according to @url https://spec.openapis.org/oas/v3.1.0#parameter-object */
28
- style: parameterStyleSchema.optional(),
29
- example: z.unknown().optional(),
30
- examples: z
31
- .union([
32
- z.record(z.string(), z.object({
33
- value: z.unknown().optional(),
34
- summary: z.string().optional(),
35
- externalValue: z.string().optional(),
36
- })),
37
- z.array(z.unknown()),
38
- ])
39
- .optional(),
14
+ in: parameterTypeSchema,
15
+ name: z.string(),
16
+ description: z.string().optional(),
17
+ /** Defaulted to false */
18
+ required: z.boolean().optional().default(false),
19
+ /** Defaulted to false */
20
+ deprecated: z.boolean().optional().default(false),
21
+ schema: z.unknown().optional(),
22
+ content: z.unknown().optional(),
23
+ /** Defaulted according to @url https://spec.openapis.org/oas/v3.1.0#parameter-object */
24
+ style: parameterStyleSchema.optional(),
25
+ example: z.unknown().optional(),
26
+ examples: z.union([
27
+ z.record(
28
+ z.string(),
29
+ z.object({
30
+ value: z.unknown().optional(),
31
+ summary: z.string().optional(),
32
+ externalValue: z.string().optional()
33
+ })
34
+ ),
35
+ z.array(z.unknown())
36
+ ]).optional()
40
37
  });
41
-
42
- export { oasParameterSchema, parameterStyleSchema, parameterTypeSchema };
38
+ export {
39
+ oasParameterSchema,
40
+ parameterExampleSchema,
41
+ parameterStyleSchema,
42
+ parameterTypeSchema
43
+ };
44
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/parameters.ts"],
4
+ "sourcesContent": ["import type { OpenAPI } from '@scalar/openapi-types'\nimport { type ZodSchema, z } from 'zod'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport type { RequestExampleParameter } from './request-examples'\n\nexport const parameterTypeSchema = z.enum(['path', 'query', 'header', 'cookie'])\nexport type ParamType = z.infer<typeof parameterTypeSchema>\n\nexport const parameterStyleSchema = z.enum([\n 'matrix',\n 'simple',\n 'form',\n 'label',\n 'spaceDelimited',\n 'pipeDelimited',\n 'deepObject',\n])\nexport type ParameterStyle = z.infer<typeof parameterStyleSchema>\nexport type ParameterContent = Record<\n string,\n {\n schema?: OpenAPIV3_1.Document\n examples?: Record<string, RequestExampleParameter>\n example?: RequestExampleParameter\n }\n>\nexport const parameterExampleSchema = z.unknown()\n\n/**\n * OpenAPI compliant parameters object\n */\nexport const oasParameterSchema = z.object({\n in: parameterTypeSchema,\n name: z.string(),\n description: z.string().optional(),\n /** Defaulted to false */\n required: z.boolean().optional().default(false),\n /** Defaulted to false */\n deprecated: z.boolean().optional().default(false),\n schema: z.unknown().optional(),\n content: z.unknown().optional(),\n /** Defaulted according to @url https://spec.openapis.org/oas/v3.1.0#parameter-object */\n style: parameterStyleSchema.optional(),\n example: z.unknown().optional(),\n examples: z\n .union([\n z.record(\n z.string(),\n z.object({\n value: z.unknown().optional(),\n summary: z.string().optional(),\n externalValue: z.string().optional(),\n }),\n ),\n z.array(z.unknown()),\n ])\n .optional(),\n}) satisfies ZodSchema<OpenAPI.Parameter>\n\nexport type RequestParameter = z.infer<typeof oasParameterSchema>\nexport type RequestParameterPayload = z.input<typeof oasParameterSchema>\n"],
5
+ "mappings": "AACA,SAAyB,SAAS;AAI3B,MAAM,sBAAsB,EAAE,KAAK,CAAC,QAAQ,SAAS,UAAU,QAAQ,CAAC;AAGxE,MAAM,uBAAuB,EAAE,KAAK;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAUM,MAAM,yBAAyB,EAAE,QAAQ;AAKzC,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,IAAI;AAAA,EACJ,MAAM,EAAE,OAAO;AAAA,EACf,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAEjC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA;AAAA,EAE9C,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA,EAChD,QAAQ,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7B,SAAS,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA,EAE9B,OAAO,qBAAqB,SAAS;AAAA,EACrC,SAAS,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC9B,UAAU,EACP,MAAM;AAAA,IACL,EAAE;AAAA,MACA,EAAE,OAAO;AAAA,MACT,EAAE,OAAO;AAAA,QACP,OAAO,EAAE,QAAQ,EAAE,SAAS;AAAA,QAC5B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,QAC7B,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,MACrC,CAAC;AAAA,IACH;AAAA,IACA,EAAE,MAAM,EAAE,QAAQ,CAAC;AAAA,EACrB,CAAC,EACA,SAAS;AACd,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,71 @@
1
+ import { oasParameterSchema } from "../../entities/spec/parameters.js";
2
+ import { describe, expect, it } from "vitest";
3
+ import { z } from "zod";
4
+ describe("oasParameterSchema", () => {
5
+ it("should validate a parameter with a correct example", () => {
6
+ const validParameterWithExample = {
7
+ in: "query",
8
+ name: "limit",
9
+ example: 10
10
+ };
11
+ expect(() => oasParameterSchema.parse(validParameterWithExample)).not.toThrow();
12
+ });
13
+ it("should validate examples as a record with correct structure", () => {
14
+ const validExamples = {
15
+ milkyWay: {
16
+ value: "Milky Way",
17
+ summary: "Our galaxy"
18
+ },
19
+ andromeda: {
20
+ value: "Andromeda",
21
+ summary: "Nearest major galaxy"
22
+ }
23
+ };
24
+ const validParameter = {
25
+ in: "query",
26
+ name: "galaxy",
27
+ examples: validExamples
28
+ };
29
+ expect(() => oasParameterSchema.parse(validParameter)).not.toThrow();
30
+ });
31
+ it("should fail validation if examples have incorrect structure", () => {
32
+ const invalidExamples = {
33
+ milkyWay: {
34
+ value: "Milky Way"
35
+ // Summary is optional, so this should not cause a failure
36
+ },
37
+ andromeda: "This should be an object, not a string"
38
+ };
39
+ const invalidParameter = {
40
+ in: "query",
41
+ name: "galaxy",
42
+ examples: invalidExamples
43
+ };
44
+ expect(() => oasParameterSchema.parse(invalidParameter)).toThrow(z.ZodError);
45
+ });
46
+ it("should validate examples as an array", () => {
47
+ const validParameter = {
48
+ in: "query",
49
+ name: "galaxy",
50
+ examples: ["Milky Way", "Andromeda"]
51
+ };
52
+ expect(() => oasParameterSchema.parse(validParameter)).not.toThrow();
53
+ });
54
+ it("should validate examples with a single array item", () => {
55
+ const validParameter = {
56
+ in: "query",
57
+ name: "galaxy",
58
+ examples: ["Milky Way"]
59
+ };
60
+ expect(() => oasParameterSchema.parse(validParameter)).not.toThrow();
61
+ });
62
+ it("should validate with an empty array of examples", () => {
63
+ const validParameter = {
64
+ in: "query",
65
+ name: "galaxy",
66
+ examples: []
67
+ };
68
+ expect(() => oasParameterSchema.parse(validParameter)).not.toThrow();
69
+ });
70
+ });
71
+ //# sourceMappingURL=parameters.test.js.map