@scalar/workspace-store 0.40.2 → 0.40.4

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 (368) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/client.d.ts +7 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +820 -681
  5. package/dist/entities/auth/index.js +96 -101
  6. package/dist/entities/auth/schema.d.ts +10 -0
  7. package/dist/entities/auth/schema.d.ts.map +1 -1
  8. package/dist/entities/auth/schema.js +42 -116
  9. package/dist/entities/history/index.js +80 -60
  10. package/dist/entities/history/schema.js +94 -88
  11. package/dist/events/bus.js +146 -93
  12. package/dist/events/definitions/analytics.js +1 -1
  13. package/dist/events/definitions/auth.js +1 -1
  14. package/dist/events/definitions/common.js +1 -1
  15. package/dist/events/definitions/cookie.js +1 -1
  16. package/dist/events/definitions/document.js +1 -1
  17. package/dist/events/definitions/environment.js +1 -1
  18. package/dist/events/definitions/hooks.js +1 -1
  19. package/dist/events/definitions/index.js +1 -1
  20. package/dist/events/definitions/meta.js +1 -1
  21. package/dist/events/definitions/operation.js +1 -1
  22. package/dist/events/definitions/server.js +1 -1
  23. package/dist/events/definitions/tabs.js +1 -1
  24. package/dist/events/definitions/tag.js +1 -1
  25. package/dist/events/definitions/ui.js +1 -1
  26. package/dist/events/definitions/workspace.js +1 -1
  27. package/dist/events/index.js +3 -9
  28. package/dist/events/listeners.js +20 -22
  29. package/dist/events/old-definitions.js +15 -12
  30. package/dist/helpers/deep-clone.js +33 -17
  31. package/dist/helpers/detect-changes-proxy.js +95 -57
  32. package/dist/helpers/general.js +78 -23
  33. package/dist/helpers/generate-unique-value.js +77 -45
  34. package/dist/helpers/get-fetch.js +12 -10
  35. package/dist/helpers/get-resolved-ref.js +11 -10
  36. package/dist/helpers/is-non-optional-security-requirement.js +3 -6
  37. package/dist/helpers/merge-object.js +71 -30
  38. package/dist/helpers/overrides-proxy.js +98 -58
  39. package/dist/helpers/unpack-proxy.js +60 -58
  40. package/dist/mutators/auth.js +358 -230
  41. package/dist/mutators/cookie.js +59 -42
  42. package/dist/mutators/document.js +104 -66
  43. package/dist/mutators/environment.js +97 -72
  44. package/dist/mutators/helpers.js +9 -13
  45. package/dist/mutators/index.js +62 -49
  46. package/dist/mutators/operation/body.js +88 -57
  47. package/dist/mutators/operation/extensions.js +20 -12
  48. package/dist/mutators/operation/helpers/fetch-request-to-har.js +144 -107
  49. package/dist/mutators/operation/helpers/fetch-response-to-har.js +143 -95
  50. package/dist/mutators/operation/helpers/get-parameter-position.js +12 -12
  51. package/dist/mutators/operation/helpers/har-to-operation.js +169 -132
  52. package/dist/mutators/operation/helpers/sync-path-parameters.js +109 -60
  53. package/dist/mutators/operation/history.js +60 -64
  54. package/dist/mutators/operation/index.js +25 -49
  55. package/dist/mutators/operation/operation.js +349 -240
  56. package/dist/mutators/operation/parameters.js +157 -93
  57. package/dist/mutators/server.js +213 -152
  58. package/dist/mutators/tabs.js +173 -130
  59. package/dist/mutators/tag.js +131 -97
  60. package/dist/mutators/workspace.js +72 -42
  61. package/dist/navigation/get-navigation-options.js +97 -84
  62. package/dist/navigation/helpers/get-openapi-object.js +46 -29
  63. package/dist/navigation/helpers/get-operation-entries.js +72 -32
  64. package/dist/navigation/helpers/get-parent-entry.js +16 -12
  65. package/dist/navigation/helpers/get-tag-entries.js +56 -29
  66. package/dist/navigation/helpers/get-tag.js +22 -23
  67. package/dist/navigation/helpers/get-x-keys.js +13 -9
  68. package/dist/navigation/helpers/traverse-description.js +90 -72
  69. package/dist/navigation/helpers/traverse-document.js +111 -98
  70. package/dist/navigation/helpers/traverse-examples.js +35 -31
  71. package/dist/navigation/helpers/traverse-paths.js +118 -106
  72. package/dist/navigation/helpers/traverse-schemas.js +65 -64
  73. package/dist/navigation/helpers/traverse-tags.js +158 -129
  74. package/dist/navigation/helpers/traverse-webhooks.js +96 -90
  75. package/dist/navigation/helpers/update-order-ids.js +59 -51
  76. package/dist/navigation/helpers/utils.js +71 -21
  77. package/dist/navigation/index.js +5 -13
  78. package/dist/navigation/types.js +1 -1
  79. package/dist/persistence/index.js +283 -285
  80. package/dist/persistence/indexdb.js +263 -126
  81. package/dist/plugins/bundler/helpers.js +21 -12
  82. package/dist/plugins/bundler/index.d.ts +7 -0
  83. package/dist/plugins/bundler/index.d.ts.map +1 -1
  84. package/dist/plugins/bundler/index.js +305 -171
  85. package/dist/plugins/client/index.js +1 -5
  86. package/dist/plugins/client/persistence.js +95 -90
  87. package/dist/resolve.js +18 -25
  88. package/dist/schemas/compose.js +6 -7
  89. package/dist/schemas/extensions/document/x-internal.js +3 -7
  90. package/dist/schemas/extensions/document/x-scalar-environments.js +16 -22
  91. package/dist/schemas/extensions/document/x-scalar-icon.js +3 -7
  92. package/dist/schemas/extensions/document/x-scalar-ignore.js +3 -7
  93. package/dist/schemas/extensions/document/x-scalar-is-dirty.js +21 -8
  94. package/dist/schemas/extensions/document/x-scalar-original-document-hash.js +17 -8
  95. package/dist/schemas/extensions/document/x-scalar-registry-meta.js +15 -21
  96. package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +5 -13
  97. package/dist/schemas/extensions/document/x-scalar-watch-mode.js +4 -8
  98. package/dist/schemas/extensions/document/x-tags.js +3 -7
  99. package/dist/schemas/extensions/example/x-disabled.js +17 -7
  100. package/dist/schemas/extensions/general/x-scalar-active-environment.js +4 -7
  101. package/dist/schemas/extensions/general/x-scalar-cookies.js +9 -14
  102. package/dist/schemas/extensions/general/x-scalar-order.js +8 -7
  103. package/dist/schemas/extensions/operation/index.js +4 -23
  104. package/dist/schemas/extensions/operation/x-badge.js +42 -50
  105. package/dist/schemas/extensions/operation/x-code-samples.js +8 -12
  106. package/dist/schemas/extensions/operation/x-draft-examples.js +3 -7
  107. package/dist/schemas/extensions/operation/x-post-response.js +18 -7
  108. package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js +57 -13
  109. package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js +9 -7
  110. package/dist/schemas/extensions/operation/x-scalar-stability.js +15 -14
  111. package/dist/schemas/extensions/parameter/x-global.js +12 -7
  112. package/dist/schemas/extensions/schema/x-additional-properties-name.js +10 -7
  113. package/dist/schemas/extensions/schema/x-enum-descriptions.js +17 -12
  114. package/dist/schemas/extensions/schema/x-enum-varnames.js +21 -8
  115. package/dist/schemas/extensions/schema/x-examples.js +3 -7
  116. package/dist/schemas/extensions/schema/x-variable.js +3 -7
  117. package/dist/schemas/extensions/security/index.js +1 -1
  118. package/dist/schemas/extensions/security/x-default-scopes.js +16 -7
  119. package/dist/schemas/extensions/security/x-scalar-credentials-location.js +16 -7
  120. package/dist/schemas/extensions/security/x-scalar-security-body.js +14 -7
  121. package/dist/schemas/extensions/security/x-scalar-security-query.js +14 -7
  122. package/dist/schemas/extensions/security/x-scalar-security-secrets.js +66 -37
  123. package/dist/schemas/extensions/security/x-tokenName.js +11 -7
  124. package/dist/schemas/extensions/security/x-use-pkce.js +6 -10
  125. package/dist/schemas/extensions/server/x-scalar-selected-server.js +3 -7
  126. package/dist/schemas/extensions/tag/index.js +1 -1
  127. package/dist/schemas/extensions/tag/x-display-name.js +11 -7
  128. package/dist/schemas/extensions/tag/x-tag-groups.js +13 -15
  129. package/dist/schemas/extensions/workspace/index.js +2 -11
  130. package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js +13 -7
  131. package/dist/schemas/extensions/workspace/x-scalar-tabs.js +15 -13
  132. package/dist/schemas/extensions.js +11 -15
  133. package/dist/schemas/inmemory-workspace.d.ts +6 -0
  134. package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
  135. package/dist/schemas/inmemory-workspace.js +13 -21
  136. package/dist/schemas/navigation.js +48 -85
  137. package/dist/schemas/reference-config/appearance.js +15 -22
  138. package/dist/schemas/reference-config/features.js +14 -21
  139. package/dist/schemas/reference-config/index.d.ts +2 -0
  140. package/dist/schemas/reference-config/index.d.ts.map +1 -1
  141. package/dist/schemas/reference-config/index.js +42 -44
  142. package/dist/schemas/reference-config/meta.js +11 -18
  143. package/dist/schemas/reference-config/routing.js +7 -14
  144. package/dist/schemas/reference-config/settings.d.ts +2 -0
  145. package/dist/schemas/reference-config/settings.d.ts.map +1 -1
  146. package/dist/schemas/reference-config/settings.js +10 -17
  147. package/dist/schemas/typebox-coerce.js +23 -6
  148. package/dist/schemas/v3.1/strict/callback.js +6 -12
  149. package/dist/schemas/v3.1/strict/components.js +26 -48
  150. package/dist/schemas/v3.1/strict/contact.js +9 -12
  151. package/dist/schemas/v3.1/strict/discriminator.js +11 -10
  152. package/dist/schemas/v3.1/strict/encoding.js +15 -12
  153. package/dist/schemas/v3.1/strict/example.js +11 -13
  154. package/dist/schemas/v3.1/strict/external-documentation.js +7 -10
  155. package/dist/schemas/v3.1/strict/header.js +27 -28
  156. package/dist/schemas/v3.1/strict/info.js +10 -16
  157. package/dist/schemas/v3.1/strict/license.js +9 -12
  158. package/dist/schemas/v3.1/strict/link.js +22 -19
  159. package/dist/schemas/v3.1/strict/media-type.js +17 -16
  160. package/dist/schemas/v3.1/strict/oauth-flow.js +28 -62
  161. package/dist/schemas/v3.1/strict/oauthflows.js +14 -20
  162. package/dist/schemas/v3.1/strict/openapi-document.d.ts +70 -0
  163. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  164. package/dist/schemas/v3.1/strict/openapi-document.js +126 -210
  165. package/dist/schemas/v3.1/strict/operation.js +16 -43
  166. package/dist/schemas/v3.1/strict/parameter.d.ts +6 -0
  167. package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
  168. package/dist/schemas/v3.1/strict/parameter.js +29 -35
  169. package/dist/schemas/v3.1/strict/path-item.js +36 -40
  170. package/dist/schemas/v3.1/strict/paths.js +8 -11
  171. package/dist/schemas/v3.1/strict/ref-definitions.js +76 -100
  172. package/dist/schemas/v3.1/strict/reference.js +18 -21
  173. package/dist/schemas/v3.1/strict/request-body.js +8 -16
  174. package/dist/schemas/v3.1/strict/response.js +12 -16
  175. package/dist/schemas/v3.1/strict/responses.js +13 -11
  176. package/dist/schemas/v3.1/strict/schema.js +149 -157
  177. package/dist/schemas/v3.1/strict/security-requirement.js +13 -12
  178. package/dist/schemas/v3.1/strict/security-scheme.js +29 -41
  179. package/dist/schemas/v3.1/strict/server-variable.js +9 -12
  180. package/dist/schemas/v3.1/strict/server.js +10 -13
  181. package/dist/schemas/v3.1/strict/tag.js +11 -20
  182. package/dist/schemas/v3.1/strict/type-guards.js +20 -20
  183. package/dist/schemas/v3.1/strict/xml.js +17 -16
  184. package/dist/schemas/workspace-specification/index.js +11 -23
  185. package/dist/schemas/workspace-specification/info.js +4 -8
  186. package/dist/schemas/workspace.d.ts +6 -0
  187. package/dist/schemas/workspace.d.ts.map +1 -1
  188. package/dist/schemas/workspace.js +25 -51
  189. package/dist/schemas.js +2 -6
  190. package/dist/server.js +286 -176
  191. package/dist/workspace-plugin.js +1 -1
  192. package/package.json +13 -19
  193. package/dist/client.js.map +0 -7
  194. package/dist/entities/auth/index.js.map +0 -7
  195. package/dist/entities/auth/schema.js.map +0 -7
  196. package/dist/entities/history/index.js.map +0 -7
  197. package/dist/entities/history/schema.js.map +0 -7
  198. package/dist/events/bus.js.map +0 -7
  199. package/dist/events/definitions/analytics.js.map +0 -7
  200. package/dist/events/definitions/auth.js.map +0 -7
  201. package/dist/events/definitions/common.js.map +0 -7
  202. package/dist/events/definitions/cookie.js.map +0 -7
  203. package/dist/events/definitions/document.js.map +0 -7
  204. package/dist/events/definitions/environment.js.map +0 -7
  205. package/dist/events/definitions/hooks.js.map +0 -7
  206. package/dist/events/definitions/index.js.map +0 -7
  207. package/dist/events/definitions/meta.js.map +0 -7
  208. package/dist/events/definitions/operation.js.map +0 -7
  209. package/dist/events/definitions/server.js.map +0 -7
  210. package/dist/events/definitions/tabs.js.map +0 -7
  211. package/dist/events/definitions/tag.js.map +0 -7
  212. package/dist/events/definitions/ui.js.map +0 -7
  213. package/dist/events/definitions/workspace.js.map +0 -7
  214. package/dist/events/index.js.map +0 -7
  215. package/dist/events/listeners.js.map +0 -7
  216. package/dist/events/old-definitions.js.map +0 -7
  217. package/dist/helpers/apply-selective-updates.d.ts +0 -19
  218. package/dist/helpers/apply-selective-updates.d.ts.map +0 -1
  219. package/dist/helpers/apply-selective-updates.js +0 -37
  220. package/dist/helpers/apply-selective-updates.js.map +0 -7
  221. package/dist/helpers/deep-clone.js.map +0 -7
  222. package/dist/helpers/detect-changes-proxy.js.map +0 -7
  223. package/dist/helpers/general.js.map +0 -7
  224. package/dist/helpers/generate-unique-value.js.map +0 -7
  225. package/dist/helpers/get-fetch.js.map +0 -7
  226. package/dist/helpers/get-resolved-ref.js.map +0 -7
  227. package/dist/helpers/is-non-optional-security-requirement.js.map +0 -7
  228. package/dist/helpers/merge-object.js.map +0 -7
  229. package/dist/helpers/overrides-proxy.js.map +0 -7
  230. package/dist/helpers/unpack-proxy.js.map +0 -7
  231. package/dist/mutators/auth.js.map +0 -7
  232. package/dist/mutators/cookie.js.map +0 -7
  233. package/dist/mutators/document.js.map +0 -7
  234. package/dist/mutators/environment.js.map +0 -7
  235. package/dist/mutators/helpers.js.map +0 -7
  236. package/dist/mutators/index.js.map +0 -7
  237. package/dist/mutators/operation/body.js.map +0 -7
  238. package/dist/mutators/operation/extensions.js.map +0 -7
  239. package/dist/mutators/operation/helpers/fetch-request-to-har.js.map +0 -7
  240. package/dist/mutators/operation/helpers/fetch-response-to-har.js.map +0 -7
  241. package/dist/mutators/operation/helpers/get-parameter-position.js.map +0 -7
  242. package/dist/mutators/operation/helpers/har-to-operation.js.map +0 -7
  243. package/dist/mutators/operation/helpers/sync-path-parameters.js.map +0 -7
  244. package/dist/mutators/operation/history.js.map +0 -7
  245. package/dist/mutators/operation/index.js.map +0 -7
  246. package/dist/mutators/operation/operation.js.map +0 -7
  247. package/dist/mutators/operation/parameters.js.map +0 -7
  248. package/dist/mutators/server.js.map +0 -7
  249. package/dist/mutators/tabs.js.map +0 -7
  250. package/dist/mutators/tag.js.map +0 -7
  251. package/dist/mutators/workspace.js.map +0 -7
  252. package/dist/navigation/get-navigation-options.js.map +0 -7
  253. package/dist/navigation/helpers/get-openapi-object.js.map +0 -7
  254. package/dist/navigation/helpers/get-operation-entries.js.map +0 -7
  255. package/dist/navigation/helpers/get-parent-entry.js.map +0 -7
  256. package/dist/navigation/helpers/get-tag-entries.js.map +0 -7
  257. package/dist/navigation/helpers/get-tag.js.map +0 -7
  258. package/dist/navigation/helpers/get-x-keys.js.map +0 -7
  259. package/dist/navigation/helpers/traverse-description.js.map +0 -7
  260. package/dist/navigation/helpers/traverse-document.js.map +0 -7
  261. package/dist/navigation/helpers/traverse-examples.js.map +0 -7
  262. package/dist/navigation/helpers/traverse-paths.js.map +0 -7
  263. package/dist/navigation/helpers/traverse-schemas.js.map +0 -7
  264. package/dist/navigation/helpers/traverse-tags.js.map +0 -7
  265. package/dist/navigation/helpers/traverse-webhooks.js.map +0 -7
  266. package/dist/navigation/helpers/update-order-ids.js.map +0 -7
  267. package/dist/navigation/helpers/utils.js.map +0 -7
  268. package/dist/navigation/index.js.map +0 -7
  269. package/dist/navigation/types.js.map +0 -7
  270. package/dist/persistence/index.js.map +0 -7
  271. package/dist/persistence/indexdb.js.map +0 -7
  272. package/dist/plugins/bundler/helpers.js.map +0 -7
  273. package/dist/plugins/bundler/index.js.map +0 -7
  274. package/dist/plugins/client/index.js.map +0 -7
  275. package/dist/plugins/client/persistence.js.map +0 -7
  276. package/dist/resolve.js.map +0 -7
  277. package/dist/schemas/compose.js.map +0 -7
  278. package/dist/schemas/extensions/document/x-internal.js.map +0 -7
  279. package/dist/schemas/extensions/document/x-scalar-environments.js.map +0 -7
  280. package/dist/schemas/extensions/document/x-scalar-icon.js.map +0 -7
  281. package/dist/schemas/extensions/document/x-scalar-ignore.js.map +0 -7
  282. package/dist/schemas/extensions/document/x-scalar-is-dirty.js.map +0 -7
  283. package/dist/schemas/extensions/document/x-scalar-original-document-hash.js.map +0 -7
  284. package/dist/schemas/extensions/document/x-scalar-registry-meta.js.map +0 -7
  285. package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +0 -7
  286. package/dist/schemas/extensions/document/x-scalar-watch-mode.js.map +0 -7
  287. package/dist/schemas/extensions/document/x-tags.js.map +0 -7
  288. package/dist/schemas/extensions/example/x-disabled.js.map +0 -7
  289. package/dist/schemas/extensions/general/x-scalar-active-environment.js.map +0 -7
  290. package/dist/schemas/extensions/general/x-scalar-cookies.js.map +0 -7
  291. package/dist/schemas/extensions/general/x-scalar-order.js.map +0 -7
  292. package/dist/schemas/extensions/operation/index.js.map +0 -7
  293. package/dist/schemas/extensions/operation/x-badge.js.map +0 -7
  294. package/dist/schemas/extensions/operation/x-code-samples.js.map +0 -7
  295. package/dist/schemas/extensions/operation/x-draft-examples.js.map +0 -7
  296. package/dist/schemas/extensions/operation/x-post-response.js.map +0 -7
  297. package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js.map +0 -7
  298. package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js.map +0 -7
  299. package/dist/schemas/extensions/operation/x-scalar-stability.js.map +0 -7
  300. package/dist/schemas/extensions/parameter/x-global.js.map +0 -7
  301. package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +0 -7
  302. package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +0 -7
  303. package/dist/schemas/extensions/schema/x-enum-varnames.js.map +0 -7
  304. package/dist/schemas/extensions/schema/x-examples.js.map +0 -7
  305. package/dist/schemas/extensions/schema/x-variable.js.map +0 -7
  306. package/dist/schemas/extensions/security/index.js.map +0 -7
  307. package/dist/schemas/extensions/security/x-default-scopes.js.map +0 -7
  308. package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +0 -7
  309. package/dist/schemas/extensions/security/x-scalar-security-body.js.map +0 -7
  310. package/dist/schemas/extensions/security/x-scalar-security-query.js.map +0 -7
  311. package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +0 -7
  312. package/dist/schemas/extensions/security/x-tokenName.js.map +0 -7
  313. package/dist/schemas/extensions/security/x-use-pkce.js.map +0 -7
  314. package/dist/schemas/extensions/server/x-scalar-selected-server.js.map +0 -7
  315. package/dist/schemas/extensions/tag/index.js.map +0 -7
  316. package/dist/schemas/extensions/tag/x-display-name.js.map +0 -7
  317. package/dist/schemas/extensions/tag/x-tag-groups.js.map +0 -7
  318. package/dist/schemas/extensions/workspace/index.js.map +0 -7
  319. package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js.map +0 -7
  320. package/dist/schemas/extensions/workspace/x-scalar-tabs.js.map +0 -7
  321. package/dist/schemas/extensions.js.map +0 -7
  322. package/dist/schemas/inmemory-workspace.js.map +0 -7
  323. package/dist/schemas/navigation.js.map +0 -7
  324. package/dist/schemas/reference-config/appearance.js.map +0 -7
  325. package/dist/schemas/reference-config/features.js.map +0 -7
  326. package/dist/schemas/reference-config/index.js.map +0 -7
  327. package/dist/schemas/reference-config/meta.js.map +0 -7
  328. package/dist/schemas/reference-config/routing.js.map +0 -7
  329. package/dist/schemas/reference-config/settings.js.map +0 -7
  330. package/dist/schemas/typebox-coerce.js.map +0 -7
  331. package/dist/schemas/v3.1/strict/callback.js.map +0 -7
  332. package/dist/schemas/v3.1/strict/components.js.map +0 -7
  333. package/dist/schemas/v3.1/strict/contact.js.map +0 -7
  334. package/dist/schemas/v3.1/strict/discriminator.js.map +0 -7
  335. package/dist/schemas/v3.1/strict/encoding.js.map +0 -7
  336. package/dist/schemas/v3.1/strict/example.js.map +0 -7
  337. package/dist/schemas/v3.1/strict/external-documentation.js.map +0 -7
  338. package/dist/schemas/v3.1/strict/header.js.map +0 -7
  339. package/dist/schemas/v3.1/strict/info.js.map +0 -7
  340. package/dist/schemas/v3.1/strict/license.js.map +0 -7
  341. package/dist/schemas/v3.1/strict/link.js.map +0 -7
  342. package/dist/schemas/v3.1/strict/media-type.js.map +0 -7
  343. package/dist/schemas/v3.1/strict/oauth-flow.js.map +0 -7
  344. package/dist/schemas/v3.1/strict/oauthflows.js.map +0 -7
  345. package/dist/schemas/v3.1/strict/openapi-document.js.map +0 -7
  346. package/dist/schemas/v3.1/strict/operation.js.map +0 -7
  347. package/dist/schemas/v3.1/strict/parameter.js.map +0 -7
  348. package/dist/schemas/v3.1/strict/path-item.js.map +0 -7
  349. package/dist/schemas/v3.1/strict/paths.js.map +0 -7
  350. package/dist/schemas/v3.1/strict/ref-definitions.js.map +0 -7
  351. package/dist/schemas/v3.1/strict/reference.js.map +0 -7
  352. package/dist/schemas/v3.1/strict/request-body.js.map +0 -7
  353. package/dist/schemas/v3.1/strict/response.js.map +0 -7
  354. package/dist/schemas/v3.1/strict/responses.js.map +0 -7
  355. package/dist/schemas/v3.1/strict/schema.js.map +0 -7
  356. package/dist/schemas/v3.1/strict/security-requirement.js.map +0 -7
  357. package/dist/schemas/v3.1/strict/security-scheme.js.map +0 -7
  358. package/dist/schemas/v3.1/strict/server-variable.js.map +0 -7
  359. package/dist/schemas/v3.1/strict/server.js.map +0 -7
  360. package/dist/schemas/v3.1/strict/tag.js.map +0 -7
  361. package/dist/schemas/v3.1/strict/type-guards.js.map +0 -7
  362. package/dist/schemas/v3.1/strict/xml.js.map +0 -7
  363. package/dist/schemas/workspace-specification/index.js.map +0 -7
  364. package/dist/schemas/workspace-specification/info.js.map +0 -7
  365. package/dist/schemas/workspace.js.map +0 -7
  366. package/dist/schemas.js.map +0 -7
  367. package/dist/server.js.map +0 -7
  368. package/dist/workspace-plugin.js.map +0 -7
@@ -1,11 +1,13 @@
1
- import { Type } from "@scalar/typebox";
2
- import { ResponseObjectRef } from "./ref-definitions.js";
3
- import { reference } from "./reference.js";
4
- const ResponsesObjectSchemaDefinition = Type.Record(
5
- Type.String(),
6
- Type.Union([ResponseObjectRef, reference(ResponseObjectRef)])
7
- );
8
- export {
9
- ResponsesObjectSchemaDefinition
10
- };
11
- //# sourceMappingURL=responses.js.map
1
+ import { Type } from '@scalar/typebox';
2
+ import { ResponseObjectRef } from './ref-definitions.js';
3
+ import { reference } from './reference.js';
4
+ /**
5
+ * A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
6
+ *
7
+ * The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors.
8
+ *
9
+ * The default MAY be used as a default Response Object for all HTTP codes that are not covered individually by the Responses Object.
10
+ *
11
+ * The Responses Object MUST contain at least one response code, and if only one response code is provided it SHOULD be the response for a successful operation call.
12
+ */
13
+ export const ResponsesObjectSchemaDefinition = Type.Record(Type.String(), Type.Union([ResponseObjectRef, reference(ResponseObjectRef)]));
@@ -1,172 +1,164 @@
1
- import { Type } from "@scalar/typebox";
2
- import { compose } from "../../../schemas/compose.js";
3
- import { XInternalSchema } from "../../../schemas/extensions/document/x-internal.js";
4
- import { XScalarIgnoreSchema } from "../../../schemas/extensions/document/x-scalar-ignore.js";
5
- import { XTags } from "../../../schemas/extensions/document/x-tags.js";
6
- import {
7
- XAdditionalPropertiesNameSchema
8
- } from "../../../schemas/extensions/schema/x-additional-properties-name.js";
9
- import { XEnumDescriptionsSchema } from "../../../schemas/extensions/schema/x-enum-descriptions.js";
10
- import { XEnumVarNamesSchema } from "../../../schemas/extensions/schema/x-enum-varnames.js";
11
- import { XExamplesSchema } from "../../../schemas/extensions/schema/x-examples.js";
12
- import { XVariableSchema } from "../../../schemas/extensions/schema/x-variable.js";
13
- import {
14
- DiscriminatorObjectRef,
15
- ExternalDocumentationObjectRef,
16
- SchemaObjectRef,
17
- XMLObjectRef
18
- } from "./ref-definitions.js";
19
- import { ReferenceObjectSchema } from "./reference.js";
1
+ import { Type } from '@scalar/typebox';
2
+ import { compose } from '../../../schemas/compose.js';
3
+ import { XInternalSchema } from '../../../schemas/extensions/document/x-internal.js';
4
+ import { XScalarIgnoreSchema } from '../../../schemas/extensions/document/x-scalar-ignore.js';
5
+ import { XTags } from '../../../schemas/extensions/document/x-tags.js';
6
+ import { XAdditionalPropertiesNameSchema, } from '../../../schemas/extensions/schema/x-additional-properties-name.js';
7
+ import { XEnumDescriptionsSchema } from '../../../schemas/extensions/schema/x-enum-descriptions.js';
8
+ import { XEnumVarNamesSchema } from '../../../schemas/extensions/schema/x-enum-varnames.js';
9
+ import { XExamplesSchema } from '../../../schemas/extensions/schema/x-examples.js';
10
+ import { XVariableSchema } from '../../../schemas/extensions/schema/x-variable.js';
11
+ import { DiscriminatorObjectRef, ExternalDocumentationObjectRef, SchemaObjectRef, XMLObjectRef, } from './ref-definitions.js';
12
+ import { ReferenceObjectSchema } from './reference.js';
20
13
  const schemaOrReference = Type.Union([
21
- SchemaObjectRef,
22
- compose(ReferenceObjectSchema, Type.Object({ "$ref-value": Type.Unknown() }))
14
+ SchemaObjectRef,
15
+ compose(ReferenceObjectSchema, Type.Object({ '$ref-value': Type.Unknown() })),
23
16
  ]);
17
+ /**
18
+ * Primitive types that don't have additional validation properties.
19
+ * These types (null, boolean, string, number, integer, object, array) can be used
20
+ * without additional validation constraints.
21
+ *
22
+ * TODO: Type array will actually validate against every union type but we can cross that bridge when we come to it
23
+ */
24
24
  const OtherTypes = Type.Object({
25
- type: Type.Union([
26
- Type.Literal("null"),
27
- Type.Literal("boolean"),
28
- Type.Array(
29
- Type.Union([
30
- Type.Literal("null"),
31
- Type.Literal("boolean"),
32
- Type.Literal("string"),
33
- Type.Literal("number"),
34
- Type.Literal("integer"),
35
- Type.Literal("object"),
36
- Type.Literal("array")
37
- ])
38
- )
39
- ])
25
+ type: Type.Union([
26
+ Type.Literal('null'),
27
+ Type.Literal('boolean'),
28
+ Type.Array(Type.Union([
29
+ Type.Literal('null'),
30
+ Type.Literal('boolean'),
31
+ Type.Literal('string'),
32
+ Type.Literal('number'),
33
+ Type.Literal('integer'),
34
+ Type.Literal('object'),
35
+ Type.Literal('array'),
36
+ ])),
37
+ ]),
40
38
  });
41
- const Extensions = compose(
42
- XScalarIgnoreSchema,
43
- XInternalSchema,
44
- XVariableSchema,
45
- XExamplesSchema,
46
- XEnumDescriptionsSchema,
47
- XEnumVarNamesSchema,
48
- XAdditionalPropertiesNameSchema,
49
- XTags
50
- );
39
+ const Extensions = compose(XScalarIgnoreSchema, XInternalSchema, XVariableSchema, XExamplesSchema, XEnumDescriptionsSchema, XEnumVarNamesSchema, XAdditionalPropertiesNameSchema, XTags);
51
40
  const CorePropertiesWithSchema = Type.Object({
52
- name: Type.Optional(Type.String()),
53
- /** A title for the schema. */
54
- title: Type.Optional(Type.String()),
55
- /** A description of the schema. */
56
- description: Type.Optional(Type.String()),
57
- /** Default value for the schema. */
58
- default: Type.Optional(Type.Unknown()),
59
- /** Array of allowed values. */
60
- enum: Type.Optional(Type.Array(Type.Unknown())),
61
- /** Constant value that must match exactly. */
62
- const: Type.Optional(Type.Unknown()),
63
- /** Media type for content validation. */
64
- contentMediaType: Type.Optional(Type.String()),
65
- /** Content encoding. */
66
- contentEncoding: Type.Optional(Type.String()),
67
- /** Schema for content validation. */
68
- contentSchema: Type.Optional(schemaOrReference),
69
- /** Whether the schema is deprecated. */
70
- deprecated: Type.Optional(Type.Boolean()),
71
- /** Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details. */
72
- discriminator: Type.Optional(DiscriminatorObjectRef),
73
- /** Whether the schema is read-only. */
74
- readOnly: Type.Optional(Type.Boolean()),
75
- /** Whether the schema is write-only. */
76
- writeOnly: Type.Optional(Type.Boolean()),
77
- /** This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */
78
- xml: Type.Optional(XMLObjectRef),
79
- /** Additional external documentation for this schema. */
80
- externalDocs: Type.Optional(ExternalDocumentationObjectRef),
81
- /**
82
- * A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
83
- *
84
- * @deprecated The example field has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.
85
- */
86
- example: Type.Optional(Type.Unknown()),
87
- /**
88
- * An array of examples of valid instances for this schema. This keyword follows the JSON Schema Draft 2020-12 specification.
89
- * Each example should be a valid instance of the schema.
90
- */
91
- examples: Type.Optional(Type.Array(Type.Unknown())),
92
- /** All schemas must be valid. */
93
- allOf: Type.Optional(Type.Array(schemaOrReference)),
94
- /** Exactly one schema must be valid. */
95
- oneOf: Type.Optional(Type.Array(schemaOrReference)),
96
- /** At least one schema must be valid. */
97
- anyOf: Type.Optional(Type.Array(schemaOrReference)),
98
- /** Schema must not be valid. */
99
- not: Type.Optional(schemaOrReference)
41
+ name: Type.Optional(Type.String()),
42
+ /** A title for the schema. */
43
+ title: Type.Optional(Type.String()),
44
+ /** A description of the schema. */
45
+ description: Type.Optional(Type.String()),
46
+ /** Default value for the schema. */
47
+ default: Type.Optional(Type.Unknown()),
48
+ /** Array of allowed values. */
49
+ enum: Type.Optional(Type.Array(Type.Unknown())),
50
+ /** Constant value that must match exactly. */
51
+ const: Type.Optional(Type.Unknown()),
52
+ /** Media type for content validation. */
53
+ contentMediaType: Type.Optional(Type.String()),
54
+ /** Content encoding. */
55
+ contentEncoding: Type.Optional(Type.String()),
56
+ /** Schema for content validation. */
57
+ contentSchema: Type.Optional(schemaOrReference),
58
+ /** Whether the schema is deprecated. */
59
+ deprecated: Type.Optional(Type.Boolean()),
60
+ /** Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details. */
61
+ discriminator: Type.Optional(DiscriminatorObjectRef),
62
+ /** Whether the schema is read-only. */
63
+ readOnly: Type.Optional(Type.Boolean()),
64
+ /** Whether the schema is write-only. */
65
+ writeOnly: Type.Optional(Type.Boolean()),
66
+ /** This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */
67
+ xml: Type.Optional(XMLObjectRef),
68
+ /** Additional external documentation for this schema. */
69
+ externalDocs: Type.Optional(ExternalDocumentationObjectRef),
70
+ /**
71
+ * A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
72
+ *
73
+ * @deprecated The example field has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.
74
+ */
75
+ example: Type.Optional(Type.Unknown()),
76
+ /**
77
+ * An array of examples of valid instances for this schema. This keyword follows the JSON Schema Draft 2020-12 specification.
78
+ * Each example should be a valid instance of the schema.
79
+ */
80
+ examples: Type.Optional(Type.Array(Type.Unknown())),
81
+ /** All schemas must be valid. */
82
+ allOf: Type.Optional(Type.Array(schemaOrReference)),
83
+ /** Exactly one schema must be valid. */
84
+ oneOf: Type.Optional(Type.Array(schemaOrReference)),
85
+ /** At least one schema must be valid. */
86
+ anyOf: Type.Optional(Type.Array(schemaOrReference)),
87
+ /** Schema must not be valid. */
88
+ not: Type.Optional(schemaOrReference),
100
89
  });
90
+ /**
91
+ * Numeric validation properties for number and integer types.
92
+ */
101
93
  const NumericProperties = Type.Object({
102
- type: Type.Union([Type.Literal("number"), Type.Literal("integer")]),
103
- /** Different subtypes */
104
- format: Type.Optional(Type.String()),
105
- /** Number must be a multiple of this value. */
106
- multipleOf: Type.Optional(Type.Number()),
107
- /** Maximum value (inclusive). */
108
- maximum: Type.Optional(Type.Number()),
109
- /** Maximum value (exclusive). */
110
- exclusiveMaximum: Type.Optional(Type.Number({ minimum: 0 })),
111
- /** Minimum value (inclusive). */
112
- minimum: Type.Optional(Type.Number()),
113
- /** Minimum value (exclusive). */
114
- exclusiveMinimum: Type.Optional(Type.Number({ minimum: 0 }))
94
+ type: Type.Union([Type.Literal('number'), Type.Literal('integer')]),
95
+ /** Different subtypes */
96
+ format: Type.Optional(Type.String()),
97
+ /** Number must be a multiple of this value. */
98
+ multipleOf: Type.Optional(Type.Number()),
99
+ /** Maximum value (inclusive). */
100
+ maximum: Type.Optional(Type.Number()),
101
+ /** Maximum value (exclusive). */
102
+ exclusiveMaximum: Type.Optional(Type.Number({ minimum: 0 })),
103
+ /** Minimum value (inclusive). */
104
+ minimum: Type.Optional(Type.Number()),
105
+ /** Minimum value (exclusive). */
106
+ exclusiveMinimum: Type.Optional(Type.Number({ minimum: 0 })),
115
107
  });
108
+ /**
109
+ * String validation properties for string types.
110
+ */
116
111
  const StringValidationProperties = Type.Object({
117
- type: Type.Literal("string"),
118
- /** Different subtypes - allow any arbitrary string, this negates the purpose of having a union of formats so we type it in typescript instead */
119
- format: Type.Optional(Type.String()),
120
- /** Maximum string length. */
121
- maxLength: Type.Optional(Type.Integer({ minimum: 0 })),
122
- /** Minimum string length. */
123
- minLength: Type.Optional(Type.Integer({ minimum: 0 })),
124
- /** Regular expression pattern. */
125
- pattern: Type.Optional(Type.String())
112
+ type: Type.Literal('string'),
113
+ /** Different subtypes - allow any arbitrary string, this negates the purpose of having a union of formats so we type it in typescript instead */
114
+ format: Type.Optional(Type.String()),
115
+ /** Maximum string length. */
116
+ maxLength: Type.Optional(Type.Integer({ minimum: 0 })),
117
+ /** Minimum string length. */
118
+ minLength: Type.Optional(Type.Integer({ minimum: 0 })),
119
+ /** Regular expression pattern. */
120
+ pattern: Type.Optional(Type.String()),
126
121
  });
127
122
  const ArrayValidationPropertiesWithSchema = Type.Object({
128
- type: Type.Literal("array"),
129
- /** Maximum number of items in array. */
130
- maxItems: Type.Optional(Type.Integer({ minimum: 0 })),
131
- /** Minimum number of items in array. */
132
- minItems: Type.Optional(Type.Integer({ minimum: 0 })),
133
- /** Whether array items must be unique. */
134
- uniqueItems: Type.Optional(Type.Boolean()),
135
- /** Schema for array items. */
136
- items: Type.Optional(schemaOrReference),
137
- /** Schema for tuple validation. */
138
- prefixItems: Type.Optional(Type.Array(schemaOrReference))
123
+ type: Type.Literal('array'),
124
+ /** Maximum number of items in array. */
125
+ maxItems: Type.Optional(Type.Integer({ minimum: 0 })),
126
+ /** Minimum number of items in array. */
127
+ minItems: Type.Optional(Type.Integer({ minimum: 0 })),
128
+ /** Whether array items must be unique. */
129
+ uniqueItems: Type.Optional(Type.Boolean()),
130
+ /** Schema for array items. */
131
+ items: Type.Optional(schemaOrReference),
132
+ /** Schema for tuple validation. */
133
+ prefixItems: Type.Optional(Type.Array(schemaOrReference)),
139
134
  });
140
135
  const ObjectValidationPropertiesWithSchema = Type.Object({
141
- type: Type.Literal("object"),
142
- /** Maximum number of properties. */
143
- maxProperties: Type.Optional(Type.Integer({ minimum: 0 })),
144
- /** Minimum number of properties. */
145
- minProperties: Type.Optional(Type.Integer({ minimum: 0 })),
146
- /** Array of required property names. */
147
- required: Type.Optional(Type.Array(Type.String())),
148
- /** Object property definitions. */
149
- properties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),
150
- /** Schema for additional properties. */
151
- additionalProperties: Type.Optional(Type.Union([Type.Boolean(), schemaOrReference])),
152
- /** Properties matching regex patterns. */
153
- patternProperties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),
154
- /** Constraints on property names (JSON Schema propertyNames keyword). */
155
- propertyNames: Type.Optional(schemaOrReference)
136
+ type: Type.Literal('object'),
137
+ /** Maximum number of properties. */
138
+ maxProperties: Type.Optional(Type.Integer({ minimum: 0 })),
139
+ /** Minimum number of properties. */
140
+ minProperties: Type.Optional(Type.Integer({ minimum: 0 })),
141
+ /** Array of required property names. */
142
+ required: Type.Optional(Type.Array(Type.String())),
143
+ /** Object property definitions. */
144
+ properties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),
145
+ /** Schema for additional properties. */
146
+ additionalProperties: Type.Optional(Type.Union([Type.Boolean(), schemaOrReference])),
147
+ /** Properties matching regex patterns. */
148
+ patternProperties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),
149
+ /** Constraints on property names (JSON Schema propertyNames keyword). */
150
+ propertyNames: Type.Optional(schemaOrReference),
156
151
  });
157
- const SchemaObjectSchemaDefinition = Type.Union([
158
- // Keep compositions first so they get priority when union is evaluated
159
- // Make sure there is always a required field so not all properties are optional
160
- // When all properties are optional (1) typescript will not throw any warnings/error and accepts anything
161
- // even a non resolved ref and (2) it will match any schema so it will not validate the refs correctly
162
- compose(Type.Object({ __scalar_: Type.String() }), CorePropertiesWithSchema, Extensions),
163
- compose(OtherTypes, CorePropertiesWithSchema, Extensions),
164
- compose(NumericProperties, CorePropertiesWithSchema, Extensions),
165
- compose(StringValidationProperties, CorePropertiesWithSchema, Extensions),
166
- compose(ObjectValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),
167
- compose(ArrayValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions)
152
+ /** Builds the recursive schema schema */
153
+ export const SchemaObjectSchemaDefinition = Type.Union([
154
+ // Keep compositions first so they get priority when union is evaluated
155
+ // Make sure there is always a required field so not all properties are optional
156
+ // When all properties are optional (1) typescript will not throw any warnings/error and accepts anything
157
+ // even a non resolved ref and (2) it will match any schema so it will not validate the refs correctly
158
+ compose(Type.Object({ __scalar_: Type.String() }), CorePropertiesWithSchema, Extensions),
159
+ compose(OtherTypes, CorePropertiesWithSchema, Extensions),
160
+ compose(NumericProperties, CorePropertiesWithSchema, Extensions),
161
+ compose(StringValidationProperties, CorePropertiesWithSchema, Extensions),
162
+ compose(ObjectValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),
163
+ compose(ArrayValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),
168
164
  ]);
169
- export {
170
- SchemaObjectSchemaDefinition
171
- };
172
- //# sourceMappingURL=schema.js.map
@@ -1,12 +1,13 @@
1
- import { Type } from "@scalar/typebox";
2
- const SecurityRequirementObjectSchemaDefinition = Type.Partial(
3
- Type.Record(
4
- /** Each name MUST correspond to a security scheme which is declared in the Security Schemes under the Components Object. If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MAY contain a list of role names which are required for the execution, but are not otherwise defined or exchanged in-band. */
5
- Type.String(),
6
- Type.Array(Type.String())
7
- )
8
- );
9
- export {
10
- SecurityRequirementObjectSchemaDefinition
11
- };
12
- //# sourceMappingURL=security-requirement.js.map
1
+ import { Type } from '@scalar/typebox';
2
+ /**
3
+ * Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object.
4
+ *
5
+ * A Security Requirement Object MAY refer to multiple security schemes in which case all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
6
+ *
7
+ * When the security field is defined on the OpenAPI Object or Operation Object and contains multiple Security Requirement Objects, only one of the entries in the list needs to be satisfied to authorize the request. This enables support for scenarios where the API allows multiple, independent security schemes.
8
+ *
9
+ * An empty Security Requirement Object ({}) indicates anonymous access is supported.
10
+ */
11
+ export const SecurityRequirementObjectSchemaDefinition = Type.Partial(Type.Record(
12
+ /** Each name MUST correspond to a security scheme which is declared in the Security Schemes under the Components Object. If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MAY contain a list of role names which are required for the execution, but are not otherwise defined or exchanged in-band. */
13
+ Type.String(), Type.Array(Type.String())));
@@ -1,54 +1,42 @@
1
- import { Type } from "@scalar/typebox";
2
- import { compose } from "../../../schemas/compose.js";
3
- import { XDefaultScopesSchema } from "../../../schemas/extensions/security/x-default-scopes.js";
4
- import { OAuthFlowsObjectRef } from "../../../schemas/v3.1/strict/ref-definitions.js";
1
+ import { Type } from '@scalar/typebox';
2
+ import { compose } from '../../../schemas/compose.js';
3
+ import { XDefaultScopesSchema } from '../../../schemas/extensions/security/x-default-scopes.js';
4
+ import { OAuthFlowsObjectRef } from '../../../schemas/v3.1/strict/ref-definitions.js';
5
5
  const DescriptionSchema = Type.Object({
6
- /** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
7
- description: Type.Optional(Type.String())
6
+ /** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
7
+ description: Type.Optional(Type.String()),
8
8
  });
9
- const ApiKeySchema = compose(
10
- DescriptionSchema,
11
- Type.Object({
9
+ const ApiKeySchema = compose(DescriptionSchema, Type.Object({
12
10
  /** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
13
- type: Type.Literal("apiKey"),
11
+ type: Type.Literal('apiKey'),
14
12
  /** REQUIRED. The name of the header, query or cookie parameter to be used. */
15
13
  name: Type.String(),
16
14
  /** REQUIRED. The location of the API key. Valid values are "query", "header", or "cookie". */
17
- in: Type.Union([Type.Literal("query"), Type.Literal("header"), Type.Literal("cookie")])
18
- })
19
- );
20
- const HttpSchema = compose(
21
- DescriptionSchema,
22
- Type.Object({
15
+ in: Type.Union([Type.Literal('query'), Type.Literal('header'), Type.Literal('cookie')]),
16
+ }));
17
+ const HttpSchema = compose(DescriptionSchema, Type.Object({
23
18
  /** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
24
- type: Type.Literal("http"),
19
+ type: Type.Literal('http'),
25
20
  /** REQUIRED. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive, as defined in RFC7235. */
26
- scheme: Type.Union([Type.Literal("basic"), Type.Literal("bearer")]),
21
+ scheme: Type.Union([Type.Literal('basic'), Type.Literal('bearer')]),
27
22
  /** A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. */
28
- bearerFormat: Type.Optional(Type.String())
29
- })
30
- );
31
- const OAuth2 = compose(
32
- DescriptionSchema,
33
- Type.Object({
23
+ bearerFormat: Type.Optional(Type.String()),
24
+ }));
25
+ const OAuth2 = compose(DescriptionSchema, Type.Object({
34
26
  /** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
35
- type: Type.Literal("oauth2"),
27
+ type: Type.Literal('oauth2'),
36
28
  /** REQUIRED. An object containing configuration information for the flow types supported. */
37
- flows: OAuthFlowsObjectRef
38
- }),
39
- XDefaultScopesSchema
40
- );
41
- const OpenIdConnect = compose(
42
- DescriptionSchema,
43
- Type.Object({
29
+ flows: OAuthFlowsObjectRef,
30
+ }), XDefaultScopesSchema);
31
+ const OpenIdConnect = compose(DescriptionSchema, Type.Object({
44
32
  /** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
45
- type: Type.Literal("openIdConnect"),
33
+ type: Type.Literal('openIdConnect'),
46
34
  /** REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata. */
47
- openIdConnectUrl: Type.String()
48
- })
49
- );
50
- const SecuritySchemeObjectSchemaDefinition = Type.Union([ApiKeySchema, HttpSchema, OAuth2, OpenIdConnect]);
51
- export {
52
- SecuritySchemeObjectSchemaDefinition
53
- };
54
- //# sourceMappingURL=security-scheme.js.map
35
+ openIdConnectUrl: Type.String(),
36
+ }));
37
+ /**
38
+ * Defines a security scheme that can be used by the operations.
39
+ *
40
+ * Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, client credentials and authorization code) as defined in RFC6749, and [[OpenID-Connect-Core]]. Please note that as of 2020, the implicit flow is about to be deprecated by OAuth 2.0 Security Best Current Practice. Recommended for most use cases is Authorization Code Grant flow with PKCE.
41
+ */
42
+ export const SecuritySchemeObjectSchemaDefinition = Type.Union([ApiKeySchema, HttpSchema, OAuth2, OpenIdConnect]);
@@ -1,13 +1,10 @@
1
- import { Type } from "@scalar/typebox";
2
- const ServerVariableObjectSchemaDefinition = Type.Object({
3
- /** An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. */
4
- enum: Type.Optional(Type.Array(Type.String())),
5
- /** REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied. If the enum is defined, the value MUST exist in the enum's values. Note that this behavior is different from the Schema Object's default keyword, which documents the receiver's behavior rather than inserting the value into the data. */
6
- default: Type.Optional(Type.String()),
7
- /** An optional description for the server variable. CommonMark syntax MAY be used for rich text representation. */
8
- description: Type.Optional(Type.String())
1
+ import { Type } from '@scalar/typebox';
2
+ /** An object representing a Server Variable for server URL template substitution. */
3
+ export const ServerVariableObjectSchemaDefinition = Type.Object({
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
+ enum: Type.Optional(Type.Array(Type.String())),
6
+ /** REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied. If the enum is defined, the value MUST exist in the enum's values. Note that this behavior is different from the Schema Object's default keyword, which documents the receiver's behavior rather than inserting the value into the data. */
7
+ default: Type.Optional(Type.String()),
8
+ /** An optional description for the server variable. CommonMark syntax MAY be used for rich text representation. */
9
+ description: Type.Optional(Type.String()),
9
10
  });
10
- export {
11
- ServerVariableObjectSchemaDefinition
12
- };
13
- //# sourceMappingURL=server-variable.js.map
@@ -1,14 +1,11 @@
1
- import { Type } from "@scalar/typebox";
2
- import { ServerVariableObjectRef } from "./ref-definitions.js";
3
- const ServerObjectSchemaDefinition = Type.Object({
4
- /** REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Variable substitutions will be made when a variable is named in {braces}. */
5
- url: Type.String(),
6
- /** An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation. */
7
- description: Type.Optional(Type.String()),
8
- /** A map between a variable name and its value. The value is used for substitution in the server's URL template. */
9
- variables: Type.Optional(Type.Record(Type.String(), ServerVariableObjectRef))
1
+ import { Type } from '@scalar/typebox';
2
+ import { ServerVariableObjectRef } from './ref-definitions.js';
3
+ /** An object representing a Server. */
4
+ export const ServerObjectSchemaDefinition = Type.Object({
5
+ /** REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Variable substitutions will be made when a variable is named in {braces}. */
6
+ url: Type.String(),
7
+ /** An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation. */
8
+ description: Type.Optional(Type.String()),
9
+ /** A map between a variable name and its value. The value is used for substitution in the server's URL template. */
10
+ variables: Type.Optional(Type.Record(Type.String(), ServerVariableObjectRef)),
10
11
  });
11
- export {
12
- ServerObjectSchemaDefinition
13
- };
14
- //# sourceMappingURL=server.js.map
@@ -1,25 +1,16 @@
1
- import { Type } from "@scalar/typebox";
2
- import { compose } from "../../../schemas/compose.js";
3
- import { XInternalSchema } from "../../../schemas/extensions/document/x-internal.js";
4
- import { XScalarIgnoreSchema } from "../../../schemas/extensions/document/x-scalar-ignore.js";
5
- import { XScalarOrderSchema } from "../../../schemas/extensions/general/x-scalar-order.js";
6
- import { XDisplayNameSchema } from "../../../schemas/extensions/tag/x-display-name.js";
7
- import { ExternalDocumentationObjectRef } from "./ref-definitions.js";
8
- const TagObjectSchemaDefinition = compose(
9
- Type.Object({
1
+ import { Type } from '@scalar/typebox';
2
+ import { compose } from '../../../schemas/compose.js';
3
+ import { XInternalSchema } from '../../../schemas/extensions/document/x-internal.js';
4
+ import { XScalarIgnoreSchema } from '../../../schemas/extensions/document/x-scalar-ignore.js';
5
+ import { XScalarOrderSchema } from '../../../schemas/extensions/general/x-scalar-order.js';
6
+ import { XDisplayNameSchema } from '../../../schemas/extensions/tag/x-display-name.js';
7
+ import { ExternalDocumentationObjectRef } from './ref-definitions.js';
8
+ /** Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. */
9
+ export const TagObjectSchemaDefinition = compose(Type.Object({
10
10
  /** REQUIRED. The name of the tag. */
11
11
  name: Type.String(),
12
12
  /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
13
13
  description: Type.Optional(Type.String()),
14
14
  /** Additional external documentation for this tag. */
15
- externalDocs: Type.Optional(ExternalDocumentationObjectRef)
16
- }),
17
- XDisplayNameSchema,
18
- XInternalSchema,
19
- XScalarIgnoreSchema,
20
- XScalarOrderSchema
21
- );
22
- export {
23
- TagObjectSchemaDefinition
24
- };
25
- //# sourceMappingURL=tag.js.map
15
+ externalDocs: Type.Optional(ExternalDocumentationObjectRef),
16
+ }), XDisplayNameSchema, XInternalSchema, XScalarIgnoreSchema, XScalarOrderSchema);
@@ -1,25 +1,25 @@
1
- const isObjectSchema = (schema) => {
2
- return "type" in schema && (schema.type === "object" || Array.isArray(schema.type) && schema.type.includes("object"));
1
+ export const isObjectSchema = (schema) => {
2
+ return ('type' in schema && (schema.type === 'object' || (Array.isArray(schema.type) && schema.type.includes('object'))));
3
3
  };
4
- const isArraySchema = (schema) => {
5
- return "type" in schema && (schema.type === "array" || Array.isArray(schema.type) && schema.type.includes("array"));
4
+ export const isArraySchema = (schema) => {
5
+ return 'type' in schema && (schema.type === 'array' || (Array.isArray(schema.type) && schema.type.includes('array')));
6
6
  };
7
- const isStringSchema = (schema) => {
8
- return "type" in schema && (schema.type === "string" || Array.isArray(schema.type) && schema.type.includes("string"));
7
+ export const isStringSchema = (schema) => {
8
+ return ('type' in schema && (schema.type === 'string' || (Array.isArray(schema.type) && schema.type.includes('string'))));
9
9
  };
10
- const isNumberSchema = (schema) => {
11
- return "type" in schema && (schema.type === "number" || schema.type === "integer" || Array.isArray(schema.type) && schema.type.includes("number") || Array.isArray(schema.type) && schema.type.includes("integer"));
10
+ export const isNumberSchema = (schema) => {
11
+ return ('type' in schema &&
12
+ (schema.type === 'number' ||
13
+ schema.type === 'integer' ||
14
+ (Array.isArray(schema.type) && schema.type.includes('number')) ||
15
+ (Array.isArray(schema.type) && schema.type.includes('integer'))));
12
16
  };
13
- const isSchema = (schema) => schema !== void 0 && "type" in schema;
14
- const isContentTypeParameterObject = (parameter) => {
15
- return "content" in parameter && parameter.content !== void 0;
17
+ /** Special type guard to remove our internal type */
18
+ export const isSchema = (schema) => schema !== undefined && 'type' in schema;
19
+ /**
20
+ * Type guard to check if the given parameter is a ParameterWithContentObject,
21
+ * i.e., it has a 'content' property defined.
22
+ */
23
+ export const isContentTypeParameterObject = (parameter) => {
24
+ return 'content' in parameter && parameter.content !== undefined;
16
25
  };
17
- export {
18
- isArraySchema,
19
- isContentTypeParameterObject,
20
- isNumberSchema,
21
- isObjectSchema,
22
- isSchema,
23
- isStringSchema
24
- };
25
- //# sourceMappingURL=type-guards.js.map