@scalar/workspace-store 0.14.2 → 0.15.1

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 (499) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/client.d.ts +24 -4
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +58 -52
  5. package/dist/client.js.map +2 -2
  6. package/dist/events/definitions.d.ts +155 -0
  7. package/dist/events/definitions.d.ts.map +1 -0
  8. package/dist/events/definitions.js +13 -0
  9. package/dist/events/definitions.js.map +7 -0
  10. package/dist/events/index.d.ts +3 -0
  11. package/dist/events/index.d.ts.map +1 -0
  12. package/dist/events/index.js +7 -0
  13. package/dist/events/index.js.map +7 -0
  14. package/dist/events/listeners.d.ts +8 -0
  15. package/dist/events/listeners.d.ts.map +1 -0
  16. package/dist/events/listeners.js +23 -0
  17. package/dist/events/listeners.js.map +7 -0
  18. package/dist/helpers/apply-selective-updates.d.ts +1 -1
  19. package/dist/helpers/apply-selective-updates.d.ts.map +1 -1
  20. package/dist/helpers/apply-selective-updates.js +1 -1
  21. package/dist/helpers/apply-selective-updates.js.map +2 -2
  22. package/dist/helpers/deep-clone.d.ts.map +1 -1
  23. package/dist/helpers/general.d.ts.map +1 -1
  24. package/dist/helpers/get-resolved-ref.d.ts.map +1 -1
  25. package/dist/helpers/merge-object.d.ts.map +1 -1
  26. package/dist/helpers/merge-object.js.map +2 -2
  27. package/dist/helpers/overrides-proxy.d.ts.map +1 -1
  28. package/dist/helpers/overrides-proxy.js.map +2 -2
  29. package/dist/mutators/cookie.d.ts.map +1 -1
  30. package/dist/mutators/environment.d.ts +1 -1
  31. package/dist/mutators/environment.d.ts.map +1 -1
  32. package/dist/mutators/environment.js.map +1 -1
  33. package/dist/mutators/helpers.d.ts.map +1 -1
  34. package/dist/mutators/index.d.ts +9 -9
  35. package/dist/mutators/request-example.d.ts.map +1 -1
  36. package/dist/mutators/request.d.ts +1 -1
  37. package/dist/mutators/request.d.ts.map +1 -1
  38. package/dist/mutators/request.js.map +2 -2
  39. package/dist/mutators/security-schemes.d.ts +1 -2
  40. package/dist/mutators/security-schemes.d.ts.map +1 -1
  41. package/dist/mutators/security-schemes.js.map +2 -2
  42. package/dist/mutators/server.d.ts +2 -2
  43. package/dist/mutators/server.d.ts.map +1 -1
  44. package/dist/mutators/server.js +4 -2
  45. package/dist/mutators/server.js.map +2 -2
  46. package/dist/navigation/helpers/get-tag.d.ts.map +1 -1
  47. package/dist/navigation/helpers/traverse-description.d.ts +3 -1
  48. package/dist/navigation/helpers/traverse-description.d.ts.map +1 -1
  49. package/dist/navigation/helpers/traverse-document.d.ts +30 -30
  50. package/dist/navigation/helpers/traverse-document.d.ts.map +1 -1
  51. package/dist/navigation/helpers/traverse-document.js.map +2 -2
  52. package/dist/navigation/helpers/traverse-paths.d.ts +5 -1
  53. package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
  54. package/dist/navigation/helpers/traverse-paths.js +3 -3
  55. package/dist/navigation/helpers/traverse-paths.js.map +2 -2
  56. package/dist/navigation/helpers/traverse-schemas.d.ts +5 -1
  57. package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
  58. package/dist/navigation/helpers/traverse-schemas.js +1 -1
  59. package/dist/navigation/helpers/traverse-schemas.js.map +2 -2
  60. package/dist/navigation/helpers/traverse-tags.d.ts +6 -2
  61. package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
  62. package/dist/navigation/helpers/traverse-tags.js.map +2 -2
  63. package/dist/navigation/helpers/traverse-webhooks.d.ts +6 -2
  64. package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
  65. package/dist/navigation/helpers/traverse-webhooks.js +2 -2
  66. package/dist/navigation/helpers/traverse-webhooks.js.map +2 -2
  67. package/dist/navigation/helpers/utils.d.ts.map +1 -1
  68. package/dist/navigation/helpers/utils.js.map +2 -2
  69. package/dist/navigation/index.d.ts +1 -1
  70. package/dist/navigation/index.d.ts.map +1 -1
  71. package/dist/navigation/index.js.map +2 -2
  72. package/dist/navigation/types.d.ts +1 -2
  73. package/dist/navigation/types.d.ts.map +1 -1
  74. package/dist/plugins.d.ts +5 -37
  75. package/dist/plugins.d.ts.map +1 -1
  76. package/dist/plugins.js +0 -21
  77. package/dist/plugins.js.map +2 -2
  78. package/dist/preprocessing/server.d.ts +23 -0
  79. package/dist/preprocessing/server.d.ts.map +1 -0
  80. package/dist/preprocessing/server.js +84 -0
  81. package/dist/preprocessing/server.js.map +7 -0
  82. package/dist/schemas/compose.d.ts +1 -1
  83. package/dist/schemas/compose.d.ts.map +1 -1
  84. package/dist/schemas/compose.js +1 -1
  85. package/dist/schemas/compose.js.map +2 -2
  86. package/dist/schemas/extensions/document/x-internal.d.ts +2 -2
  87. package/dist/schemas/extensions/document/x-internal.js +1 -1
  88. package/dist/schemas/extensions/document/x-internal.js.map +1 -1
  89. package/dist/schemas/extensions/document/x-scalar-icon.d.ts +2 -2
  90. package/dist/schemas/extensions/document/x-scalar-icon.js +1 -1
  91. package/dist/schemas/extensions/document/x-scalar-icon.js.map +1 -1
  92. package/dist/schemas/extensions/document/x-scalar-ignore.d.ts +2 -2
  93. package/dist/schemas/extensions/document/x-scalar-ignore.js +1 -1
  94. package/dist/schemas/extensions/document/x-scalar-ignore.js.map +1 -1
  95. package/dist/schemas/extensions/document/x-scalar-sdk-installation.d.ts +7 -5
  96. package/dist/schemas/extensions/document/x-scalar-sdk-installation.d.ts.map +1 -1
  97. package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +1 -1
  98. package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +2 -2
  99. package/dist/schemas/extensions/document/x-tags.d.ts +4 -0
  100. package/dist/schemas/extensions/document/x-tags.d.ts.map +1 -0
  101. package/dist/schemas/extensions/document/x-tags.js +8 -0
  102. package/dist/schemas/extensions/document/x-tags.js.map +7 -0
  103. package/dist/schemas/extensions/operation/x-badge.d.ts +10 -10
  104. package/dist/schemas/extensions/operation/x-badge.d.ts.map +1 -1
  105. package/dist/schemas/extensions/operation/x-badge.js +1 -1
  106. package/dist/schemas/extensions/operation/x-badge.js.map +2 -2
  107. package/dist/schemas/extensions/operation/x-code-samples.d.ts +17 -17
  108. package/dist/schemas/extensions/operation/x-code-samples.js +1 -1
  109. package/dist/schemas/extensions/operation/x-code-samples.js.map +1 -1
  110. package/dist/schemas/extensions/operation/x-post-response.d.ts +2 -2
  111. package/dist/schemas/extensions/operation/x-post-response.js +1 -1
  112. package/dist/schemas/extensions/operation/x-post-response.js.map +1 -1
  113. package/dist/schemas/extensions/operation/x-scalar-stability.d.ts +2 -2
  114. package/dist/schemas/extensions/operation/x-scalar-stability.js +1 -1
  115. package/dist/schemas/extensions/operation/x-scalar-stability.js.map +1 -1
  116. package/dist/schemas/extensions/schema/x-additional-properties-name.d.ts +2 -2
  117. package/dist/schemas/extensions/schema/x-additional-properties-name.js +1 -1
  118. package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +1 -1
  119. package/dist/schemas/extensions/schema/x-enum-descriptions.d.ts +2 -2
  120. package/dist/schemas/extensions/schema/x-enum-descriptions.js +1 -1
  121. package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +1 -1
  122. package/dist/schemas/extensions/schema/x-variable.d.ts +2 -2
  123. package/dist/schemas/extensions/schema/x-variable.js +1 -1
  124. package/dist/schemas/extensions/schema/x-variable.js.map +1 -1
  125. package/dist/schemas/extensions/security/x-scalar-credentials-location.d.ts +2 -2
  126. package/dist/schemas/extensions/security/x-scalar-credentials-location.js +1 -1
  127. package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +1 -1
  128. package/dist/schemas/extensions/security/x-scalar-redirect-uri.d.ts +2 -2
  129. package/dist/schemas/extensions/security/x-scalar-redirect-uri.js +1 -1
  130. package/dist/schemas/extensions/security/x-scalar-redirect-uri.js.map +1 -1
  131. package/dist/schemas/extensions/security/x-scalar-security-body.d.ts +2 -2
  132. package/dist/schemas/extensions/security/x-scalar-security-body.js +1 -1
  133. package/dist/schemas/extensions/security/x-scalar-security-body.js.map +1 -1
  134. package/dist/schemas/extensions/security/x-scalar-security-query.d.ts +2 -2
  135. package/dist/schemas/extensions/security/x-scalar-security-query.js +1 -1
  136. package/dist/schemas/extensions/security/x-scalar-security-query.js.map +1 -1
  137. package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts +5 -5
  138. package/dist/schemas/extensions/security/x-scalar-security-secrets.js +1 -1
  139. package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +1 -1
  140. package/dist/schemas/extensions/security/x-tokenName.d.ts +2 -2
  141. package/dist/schemas/extensions/security/x-tokenName.js +1 -1
  142. package/dist/schemas/extensions/security/x-tokenName.js.map +1 -1
  143. package/dist/schemas/extensions/security/x-use-pkce.d.ts +2 -2
  144. package/dist/schemas/extensions/security/x-use-pkce.js +1 -1
  145. package/dist/schemas/extensions/security/x-use-pkce.js.map +1 -1
  146. package/dist/schemas/extensions/tag/x-display-name.d.ts +2 -2
  147. package/dist/schemas/extensions/tag/x-display-name.js +1 -1
  148. package/dist/schemas/extensions/tag/x-display-name.js.map +1 -1
  149. package/dist/schemas/extensions/tag/x-tag-groups.d.ts +7 -7
  150. package/dist/schemas/extensions/tag/x-tag-groups.js +1 -1
  151. package/dist/schemas/extensions/tag/x-tag-groups.js.map +1 -1
  152. package/dist/schemas/inmemory-workspace.d.ts +2470 -190
  153. package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
  154. package/dist/schemas/inmemory-workspace.js +2 -3
  155. package/dist/schemas/inmemory-workspace.js.map +2 -2
  156. package/dist/schemas/navigation.d.ts +140 -134
  157. package/dist/schemas/navigation.d.ts.map +1 -1
  158. package/dist/schemas/navigation.js +13 -9
  159. package/dist/schemas/navigation.js.map +2 -2
  160. package/dist/schemas/reference-config/appearance.d.ts +9 -9
  161. package/dist/schemas/reference-config/appearance.d.ts.map +1 -1
  162. package/dist/schemas/reference-config/appearance.js +1 -1
  163. package/dist/schemas/reference-config/appearance.js.map +2 -2
  164. package/dist/schemas/reference-config/features.d.ts +11 -11
  165. package/dist/schemas/reference-config/features.d.ts.map +1 -1
  166. package/dist/schemas/reference-config/features.js +1 -1
  167. package/dist/schemas/reference-config/features.js.map +2 -2
  168. package/dist/schemas/reference-config/index.d.ts +1247 -46
  169. package/dist/schemas/reference-config/index.d.ts.map +1 -1
  170. package/dist/schemas/reference-config/index.js +5 -5
  171. package/dist/schemas/reference-config/index.js.map +2 -2
  172. package/dist/schemas/reference-config/meta.d.ts +8 -8
  173. package/dist/schemas/reference-config/meta.d.ts.map +1 -1
  174. package/dist/schemas/reference-config/meta.js +1 -1
  175. package/dist/schemas/reference-config/meta.js.map +2 -2
  176. package/dist/schemas/reference-config/routing.d.ts +4 -4
  177. package/dist/schemas/reference-config/routing.d.ts.map +1 -1
  178. package/dist/schemas/reference-config/routing.js +1 -1
  179. package/dist/schemas/reference-config/routing.js.map +2 -2
  180. package/dist/schemas/reference-config/settings.d.ts +1215 -14
  181. package/dist/schemas/reference-config/settings.d.ts.map +1 -1
  182. package/dist/schemas/reference-config/settings.js +2 -2
  183. package/dist/schemas/reference-config/settings.js.map +2 -2
  184. package/dist/schemas/typebox-coerce.d.ts +1 -1
  185. package/dist/schemas/typebox-coerce.d.ts.map +1 -1
  186. package/dist/schemas/typebox-coerce.js +2 -2
  187. package/dist/schemas/typebox-coerce.js.map +2 -2
  188. package/dist/schemas/v3.1/strict/callback.d.ts +1 -2
  189. package/dist/schemas/v3.1/strict/callback.d.ts.map +1 -1
  190. package/dist/schemas/v3.1/strict/callback.js +5 -4
  191. package/dist/schemas/v3.1/strict/callback.js.map +2 -2
  192. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.d.ts +11 -11
  193. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.d.ts.map +1 -1
  194. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.js +1 -1
  195. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.js.map +2 -2
  196. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.d.ts +19 -19
  197. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.d.ts.map +1 -1
  198. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.js +1 -1
  199. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.js.map +2 -2
  200. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.d.ts +27 -27
  201. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.d.ts.map +1 -1
  202. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.js +1 -1
  203. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.js.map +2 -2
  204. package/dist/schemas/v3.1/strict/components.d.ts +22 -42
  205. package/dist/schemas/v3.1/strict/components.d.ts.map +1 -1
  206. package/dist/schemas/v3.1/strict/components.js +24 -29
  207. package/dist/schemas/v3.1/strict/components.js.map +2 -2
  208. package/dist/schemas/v3.1/strict/contact.d.ts +4 -6
  209. package/dist/schemas/v3.1/strict/contact.d.ts.map +1 -1
  210. package/dist/schemas/v3.1/strict/contact.js +3 -3
  211. package/dist/schemas/v3.1/strict/contact.js.map +2 -2
  212. package/dist/schemas/v3.1/strict/discriminator.d.ts +3 -5
  213. package/dist/schemas/v3.1/strict/discriminator.d.ts.map +1 -1
  214. package/dist/schemas/v3.1/strict/discriminator.js +3 -3
  215. package/dist/schemas/v3.1/strict/discriminator.js.map +2 -2
  216. package/dist/schemas/v3.1/strict/encoding.d.ts +10 -4
  217. package/dist/schemas/v3.1/strict/encoding.d.ts.map +1 -1
  218. package/dist/schemas/v3.1/strict/encoding.js +5 -4
  219. package/dist/schemas/v3.1/strict/encoding.js.map +2 -2
  220. package/dist/schemas/v3.1/strict/example.d.ts +5 -7
  221. package/dist/schemas/v3.1/strict/example.d.ts.map +1 -1
  222. package/dist/schemas/v3.1/strict/example.js +3 -3
  223. package/dist/schemas/v3.1/strict/example.js.map +2 -2
  224. package/dist/schemas/v3.1/strict/external-documentation.d.ts +3 -5
  225. package/dist/schemas/v3.1/strict/external-documentation.d.ts.map +1 -1
  226. package/dist/schemas/v3.1/strict/external-documentation.js +3 -3
  227. package/dist/schemas/v3.1/strict/external-documentation.js.map +2 -2
  228. package/dist/schemas/v3.1/strict/header.d.ts +39 -347
  229. package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
  230. package/dist/schemas/v3.1/strict/header.js +8 -11
  231. package/dist/schemas/v3.1/strict/header.js.map +2 -2
  232. package/dist/schemas/v3.1/strict/info.d.ts +13 -23
  233. package/dist/schemas/v3.1/strict/info.d.ts.map +1 -1
  234. package/dist/schemas/v3.1/strict/info.js +7 -8
  235. package/dist/schemas/v3.1/strict/info.js.map +2 -2
  236. package/dist/schemas/v3.1/strict/license.d.ts +4 -6
  237. package/dist/schemas/v3.1/strict/license.d.ts.map +1 -1
  238. package/dist/schemas/v3.1/strict/license.js +3 -3
  239. package/dist/schemas/v3.1/strict/license.js.map +2 -2
  240. package/dist/schemas/v3.1/strict/link.d.ts +7 -17
  241. package/dist/schemas/v3.1/strict/link.d.ts.map +1 -1
  242. package/dist/schemas/v3.1/strict/link.js +5 -5
  243. package/dist/schemas/v3.1/strict/link.js.map +2 -2
  244. package/dist/schemas/v3.1/strict/media-type.d.ts +10 -164
  245. package/dist/schemas/v3.1/strict/media-type.d.ts.map +1 -1
  246. package/dist/schemas/v3.1/strict/media-type.js +7 -10
  247. package/dist/schemas/v3.1/strict/media-type.js.map +2 -2
  248. package/dist/schemas/v3.1/strict/oauth-flow.d.ts +59 -60
  249. package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
  250. package/dist/schemas/v3.1/strict/oauth-flow.js +3 -3
  251. package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
  252. package/dist/schemas/v3.1/strict/oauthflows.d.ts +30 -32
  253. package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
  254. package/dist/schemas/v3.1/strict/oauthflows.js +6 -6
  255. package/dist/schemas/v3.1/strict/oauthflows.js.map +2 -2
  256. package/dist/schemas/v3.1/strict/openapi-document.d.ts +33908 -112
  257. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  258. package/dist/schemas/v3.1/strict/openapi-document.js +139 -24
  259. package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
  260. package/dist/schemas/v3.1/strict/operation.d.ts +52 -4946
  261. package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
  262. package/dist/schemas/v3.1/strict/operation.js +22 -19
  263. package/dist/schemas/v3.1/strict/operation.js.map +2 -2
  264. package/dist/schemas/v3.1/strict/parameter.d.ts +51 -1397
  265. package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
  266. package/dist/schemas/v3.1/strict/parameter.js +10 -11
  267. package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
  268. package/dist/schemas/v3.1/strict/path-item.d.ts +15 -1412
  269. package/dist/schemas/v3.1/strict/path-item.d.ts.map +1 -1
  270. package/dist/schemas/v3.1/strict/path-item.js +15 -16
  271. package/dist/schemas/v3.1/strict/path-item.js.map +2 -2
  272. package/dist/schemas/v3.1/strict/paths.d.ts +1 -4
  273. package/dist/schemas/v3.1/strict/paths.d.ts.map +1 -1
  274. package/dist/schemas/v3.1/strict/paths.js +5 -5
  275. package/dist/schemas/v3.1/strict/paths.js.map +2 -2
  276. package/dist/schemas/v3.1/strict/ref-definitions.d.ts +63 -0
  277. package/dist/schemas/v3.1/strict/ref-definitions.d.ts.map +1 -0
  278. package/dist/schemas/v3.1/strict/ref-definitions.js +88 -0
  279. package/dist/schemas/v3.1/strict/ref-definitions.js.map +7 -0
  280. package/dist/schemas/v3.1/strict/reference.d.ts +8 -8
  281. package/dist/schemas/v3.1/strict/reference.d.ts.map +1 -1
  282. package/dist/schemas/v3.1/strict/reference.js +1 -1
  283. package/dist/schemas/v3.1/strict/reference.js.map +2 -2
  284. package/dist/schemas/v3.1/strict/request-body.d.ts +4 -520
  285. package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
  286. package/dist/schemas/v3.1/strict/request-body.js +5 -5
  287. package/dist/schemas/v3.1/strict/request-body.js.map +2 -2
  288. package/dist/schemas/v3.1/strict/response.d.ts +5 -1231
  289. package/dist/schemas/v3.1/strict/response.d.ts.map +1 -1
  290. package/dist/schemas/v3.1/strict/response.js +7 -8
  291. package/dist/schemas/v3.1/strict/response.js.map +2 -2
  292. package/dist/schemas/v3.1/strict/responses.d.ts +1 -2461
  293. package/dist/schemas/v3.1/strict/responses.d.ts.map +1 -1
  294. package/dist/schemas/v3.1/strict/responses.js +5 -5
  295. package/dist/schemas/v3.1/strict/responses.js.map +2 -2
  296. package/dist/schemas/v3.1/strict/schema.d.ts +337 -192
  297. package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
  298. package/dist/schemas/v3.1/strict/schema.js +215 -207
  299. package/dist/schemas/v3.1/strict/schema.js.map +2 -2
  300. package/dist/schemas/v3.1/strict/security-requirement.d.ts +1 -3
  301. package/dist/schemas/v3.1/strict/security-requirement.d.ts.map +1 -1
  302. package/dist/schemas/v3.1/strict/security-requirement.js +3 -3
  303. package/dist/schemas/v3.1/strict/security-requirement.js.map +2 -2
  304. package/dist/schemas/v3.1/strict/security-scheme.d.ts +60 -130
  305. package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
  306. package/dist/schemas/v3.1/strict/security-scheme.js +5 -5
  307. package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
  308. package/dist/schemas/v3.1/strict/server-variable.d.ts +4 -6
  309. package/dist/schemas/v3.1/strict/server-variable.d.ts.map +1 -1
  310. package/dist/schemas/v3.1/strict/server-variable.js +3 -3
  311. package/dist/schemas/v3.1/strict/server-variable.js.map +2 -2
  312. package/dist/schemas/v3.1/strict/server.d.ts +4 -10
  313. package/dist/schemas/v3.1/strict/server.d.ts.map +1 -1
  314. package/dist/schemas/v3.1/strict/server.js +5 -5
  315. package/dist/schemas/v3.1/strict/server.js.map +2 -2
  316. package/dist/schemas/v3.1/strict/tag.d.ts +10 -15
  317. package/dist/schemas/v3.1/strict/tag.d.ts.map +1 -1
  318. package/dist/schemas/v3.1/strict/tag.js +6 -6
  319. package/dist/schemas/v3.1/strict/tag.js.map +2 -2
  320. package/dist/schemas/v3.1/strict/xml.d.ts +6 -8
  321. package/dist/schemas/v3.1/strict/xml.d.ts.map +1 -1
  322. package/dist/schemas/v3.1/strict/xml.js +3 -3
  323. package/dist/schemas/v3.1/strict/xml.js.map +2 -2
  324. package/dist/schemas/workspace-specification/config.d.ts +1248 -47
  325. package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
  326. package/dist/schemas/workspace-specification/config.js +1 -1
  327. package/dist/schemas/workspace-specification/config.js.map +2 -2
  328. package/dist/schemas/workspace-specification/index.d.ts +1260 -224
  329. package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
  330. package/dist/schemas/workspace-specification/index.js +2 -3
  331. package/dist/schemas/workspace-specification/index.js.map +2 -2
  332. package/dist/schemas/workspace-specification/info.d.ts +3 -3
  333. package/dist/schemas/workspace-specification/info.js +1 -1
  334. package/dist/schemas/workspace-specification/info.js.map +1 -1
  335. package/dist/schemas/workspace.d.ts +8520 -199
  336. package/dist/schemas/workspace.d.ts.map +1 -1
  337. package/dist/schemas/workspace.js +6 -8
  338. package/dist/schemas/workspace.js.map +2 -2
  339. package/dist/schemas.d.ts +1 -1
  340. package/dist/schemas.d.ts.map +1 -1
  341. package/dist/schemas.js +1 -4
  342. package/dist/schemas.js.map +2 -2
  343. package/dist/server.d.ts +2 -4
  344. package/dist/server.d.ts.map +1 -1
  345. package/dist/server.js +7 -5
  346. package/dist/server.js.map +2 -2
  347. package/package.json +12 -6
  348. package/dist/schemas/typebox-types.d.ts +0 -14
  349. package/dist/schemas/typebox-types.d.ts.map +0 -1
  350. package/dist/schemas/typebox-types.js +0 -19
  351. package/dist/schemas/typebox-types.js.map +0 -7
  352. package/dist/schemas/v3.1/loose/callback.d.ts +0 -10
  353. package/dist/schemas/v3.1/loose/callback.d.ts.map +0 -1
  354. package/dist/schemas/v3.1/loose/callback.js +0 -11
  355. package/dist/schemas/v3.1/loose/callback.js.map +0 -7
  356. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.d.ts +0 -16
  357. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.d.ts.map +0 -1
  358. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.js +0 -13
  359. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.js.map +0 -7
  360. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.d.ts +0 -27
  361. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.d.ts.map +0 -1
  362. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.js +0 -23
  363. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.js.map +0 -7
  364. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.d.ts +0 -38
  365. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.d.ts.map +0 -1
  366. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.js +0 -45
  367. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.js.map +0 -7
  368. package/dist/schemas/v3.1/loose/components.d.ts +0 -43
  369. package/dist/schemas/v3.1/loose/components.d.ts.map +0 -1
  370. package/dist/schemas/v3.1/loose/components.js +0 -41
  371. package/dist/schemas/v3.1/loose/components.js.map +0 -7
  372. package/dist/schemas/v3.1/loose/contact.d.ts +0 -10
  373. package/dist/schemas/v3.1/loose/contact.d.ts.map +0 -1
  374. package/dist/schemas/v3.1/loose/contact.js +0 -13
  375. package/dist/schemas/v3.1/loose/contact.js.map +0 -7
  376. package/dist/schemas/v3.1/loose/discriminator.d.ts +0 -12
  377. package/dist/schemas/v3.1/loose/discriminator.d.ts.map +0 -1
  378. package/dist/schemas/v3.1/loose/discriminator.js +0 -11
  379. package/dist/schemas/v3.1/loose/discriminator.js.map +0 -7
  380. package/dist/schemas/v3.1/loose/encoding.d.ts +0 -15
  381. package/dist/schemas/v3.1/loose/encoding.d.ts.map +0 -1
  382. package/dist/schemas/v3.1/loose/encoding.js +0 -12
  383. package/dist/schemas/v3.1/loose/encoding.js.map +0 -7
  384. package/dist/schemas/v3.1/loose/example.d.ts +0 -16
  385. package/dist/schemas/v3.1/loose/example.d.ts.map +0 -1
  386. package/dist/schemas/v3.1/loose/example.js +0 -15
  387. package/dist/schemas/v3.1/loose/example.js.map +0 -7
  388. package/dist/schemas/v3.1/loose/external-documentation.d.ts +0 -8
  389. package/dist/schemas/v3.1/loose/external-documentation.d.ts.map +0 -1
  390. package/dist/schemas/v3.1/loose/external-documentation.js +0 -11
  391. package/dist/schemas/v3.1/loose/external-documentation.js.map +0 -7
  392. package/dist/schemas/v3.1/loose/header.d.ts +0 -355
  393. package/dist/schemas/v3.1/loose/header.d.ts.map +0 -1
  394. package/dist/schemas/v3.1/loose/header.js +0 -43
  395. package/dist/schemas/v3.1/loose/header.js.map +0 -7
  396. package/dist/schemas/v3.1/loose/info.d.ts +0 -48
  397. package/dist/schemas/v3.1/loose/info.d.ts.map +0 -1
  398. package/dist/schemas/v3.1/loose/info.js +0 -29
  399. package/dist/schemas/v3.1/loose/info.js.map +0 -7
  400. package/dist/schemas/v3.1/loose/license.d.ts +0 -10
  401. package/dist/schemas/v3.1/loose/license.d.ts.map +0 -1
  402. package/dist/schemas/v3.1/loose/license.js +0 -13
  403. package/dist/schemas/v3.1/loose/license.js.map +0 -7
  404. package/dist/schemas/v3.1/loose/link.d.ts +0 -30
  405. package/dist/schemas/v3.1/loose/link.d.ts.map +0 -1
  406. package/dist/schemas/v3.1/loose/link.js +0 -20
  407. package/dist/schemas/v3.1/loose/link.js.map +0 -7
  408. package/dist/schemas/v3.1/loose/media-header-encoding.d.ts +0 -1012
  409. package/dist/schemas/v3.1/loose/media-header-encoding.d.ts.map +0 -1
  410. package/dist/schemas/v3.1/loose/media-header-encoding.js +0 -19
  411. package/dist/schemas/v3.1/loose/media-header-encoding.js.map +0 -7
  412. package/dist/schemas/v3.1/loose/media-type.d.ts +0 -161
  413. package/dist/schemas/v3.1/loose/media-type.d.ts.map +0 -1
  414. package/dist/schemas/v3.1/loose/media-type.js +0 -18
  415. package/dist/schemas/v3.1/loose/media-type.js.map +0 -7
  416. package/dist/schemas/v3.1/loose/oauth-flow.d.ts +0 -95
  417. package/dist/schemas/v3.1/loose/oauth-flow.d.ts.map +0 -1
  418. package/dist/schemas/v3.1/loose/oauth-flow.js +0 -57
  419. package/dist/schemas/v3.1/loose/oauth-flow.js.map +0 -7
  420. package/dist/schemas/v3.1/loose/oauthflows.d.ts +0 -43
  421. package/dist/schemas/v3.1/loose/oauthflows.d.ts.map +0 -1
  422. package/dist/schemas/v3.1/loose/oauthflows.js +0 -21
  423. package/dist/schemas/v3.1/loose/oauthflows.js.map +0 -7
  424. package/dist/schemas/v3.1/loose/openapi-document.d.ts +0 -115
  425. package/dist/schemas/v3.1/loose/openapi-document.d.ts.map +0 -1
  426. package/dist/schemas/v3.1/loose/openapi-document.js +0 -64
  427. package/dist/schemas/v3.1/loose/openapi-document.js.map +0 -7
  428. package/dist/schemas/v3.1/loose/operation.d.ts +0 -1645
  429. package/dist/schemas/v3.1/loose/operation.d.ts.map +0 -1
  430. package/dist/schemas/v3.1/loose/operation.js +0 -61
  431. package/dist/schemas/v3.1/loose/operation.js.map +0 -7
  432. package/dist/schemas/v3.1/loose/parameter.d.ts +0 -1074
  433. package/dist/schemas/v3.1/loose/parameter.d.ts.map +0 -1
  434. package/dist/schemas/v3.1/loose/parameter.js +0 -54
  435. package/dist/schemas/v3.1/loose/parameter.js.map +0 -7
  436. package/dist/schemas/v3.1/loose/path-item.d.ts +0 -551
  437. package/dist/schemas/v3.1/loose/path-item.d.ts.map +0 -1
  438. package/dist/schemas/v3.1/loose/path-item.js +0 -42
  439. package/dist/schemas/v3.1/loose/path-item.js.map +0 -7
  440. package/dist/schemas/v3.1/loose/path-operations.d.ts +0 -2196
  441. package/dist/schemas/v3.1/loose/path-operations.d.ts.map +0 -1
  442. package/dist/schemas/v3.1/loose/path-operations.js +0 -21
  443. package/dist/schemas/v3.1/loose/path-operations.js.map +0 -7
  444. package/dist/schemas/v3.1/loose/paths.d.ts +0 -20
  445. package/dist/schemas/v3.1/loose/paths.d.ts.map +0 -1
  446. package/dist/schemas/v3.1/loose/paths.js +0 -11
  447. package/dist/schemas/v3.1/loose/paths.js.map +0 -7
  448. package/dist/schemas/v3.1/loose/reference.d.ts +0 -26
  449. package/dist/schemas/v3.1/loose/reference.d.ts.map +0 -1
  450. package/dist/schemas/v3.1/loose/reference.js +0 -24
  451. package/dist/schemas/v3.1/loose/reference.js.map +0 -7
  452. package/dist/schemas/v3.1/loose/request-body.d.ts +0 -339
  453. package/dist/schemas/v3.1/loose/request-body.d.ts.map +0 -1
  454. package/dist/schemas/v3.1/loose/request-body.js +0 -14
  455. package/dist/schemas/v3.1/loose/request-body.js.map +0 -7
  456. package/dist/schemas/v3.1/loose/response.d.ts +0 -698
  457. package/dist/schemas/v3.1/loose/response.d.ts.map +0 -1
  458. package/dist/schemas/v3.1/loose/response.js +0 -18
  459. package/dist/schemas/v3.1/loose/response.js.map +0 -7
  460. package/dist/schemas/v3.1/loose/responses.d.ts +0 -710
  461. package/dist/schemas/v3.1/loose/responses.d.ts.map +0 -1
  462. package/dist/schemas/v3.1/loose/responses.js +0 -11
  463. package/dist/schemas/v3.1/loose/responses.js.map +0 -7
  464. package/dist/schemas/v3.1/loose/schema.d.ts +0 -373
  465. package/dist/schemas/v3.1/loose/schema.d.ts.map +0 -1
  466. package/dist/schemas/v3.1/loose/schema.js +0 -146
  467. package/dist/schemas/v3.1/loose/schema.js.map +0 -7
  468. package/dist/schemas/v3.1/loose/security-requirement.d.ts +0 -11
  469. package/dist/schemas/v3.1/loose/security-requirement.d.ts.map +0 -1
  470. package/dist/schemas/v3.1/loose/security-requirement.js +0 -10
  471. package/dist/schemas/v3.1/loose/security-requirement.js.map +0 -7
  472. package/dist/schemas/v3.1/loose/security-scheme.d.ts +0 -169
  473. package/dist/schemas/v3.1/loose/security-scheme.d.ts.map +0 -1
  474. package/dist/schemas/v3.1/loose/security-scheme.js +0 -64
  475. package/dist/schemas/v3.1/loose/security-scheme.js.map +0 -7
  476. package/dist/schemas/v3.1/loose/server-variable.d.ts +0 -10
  477. package/dist/schemas/v3.1/loose/server-variable.d.ts.map +0 -1
  478. package/dist/schemas/v3.1/loose/server-variable.js +0 -13
  479. package/dist/schemas/v3.1/loose/server-variable.js.map +0 -7
  480. package/dist/schemas/v3.1/loose/server.d.ts +0 -14
  481. package/dist/schemas/v3.1/loose/server.d.ts.map +0 -1
  482. package/dist/schemas/v3.1/loose/server.js +0 -14
  483. package/dist/schemas/v3.1/loose/server.js.map +0 -7
  484. package/dist/schemas/v3.1/loose/tag.d.ts +0 -19
  485. package/dist/schemas/v3.1/loose/tag.d.ts.map +0 -1
  486. package/dist/schemas/v3.1/loose/tag.js +0 -23
  487. package/dist/schemas/v3.1/loose/tag.js.map +0 -7
  488. package/dist/schemas/v3.1/loose/xml.d.ts +0 -18
  489. package/dist/schemas/v3.1/loose/xml.d.ts.map +0 -1
  490. package/dist/schemas/v3.1/loose/xml.js +0 -17
  491. package/dist/schemas/v3.1/loose/xml.js.map +0 -7
  492. package/dist/schemas/v3.1/strict/media-header-encoding.d.ts +0 -1560
  493. package/dist/schemas/v3.1/strict/media-header-encoding.d.ts.map +0 -1
  494. package/dist/schemas/v3.1/strict/media-header-encoding.js +0 -19
  495. package/dist/schemas/v3.1/strict/media-header-encoding.js.map +0 -7
  496. package/dist/schemas/v3.1/strict/path-operations.d.ts +0 -10628
  497. package/dist/schemas/v3.1/strict/path-operations.d.ts.map +0 -1
  498. package/dist/schemas/v3.1/strict/path-operations.js +0 -21
  499. package/dist/schemas/v3.1/strict/path-operations.js.map +0 -7
package/dist/plugins.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This file contains a collection of plugins used for the bundler.
3
+ * Plugins defined here can extend or modify the behavior of the bundling process,
4
+ * such as adding lifecycle hooks or custom processing logic.
5
+ */
1
6
  import type { LifecyclePlugin } from '@scalar/json-magic/bundle';
2
7
  /**
3
8
  * A lifecycle plugin that adds a `$status` property to nodes during resolution.
@@ -53,41 +58,4 @@ export declare const refsEverywhere: () => LifecyclePlugin;
53
58
  * @returns {LifecyclePlugin} The plugin object for use in the bundler.
54
59
  */
55
60
  export declare const restoreOriginalRefs: () => LifecyclePlugin;
56
- /**
57
- * Lifecycle plugin to automatically add missing "type" fields to OpenAPI/JSON Schema nodes.
58
- *
59
- * This plugin is intended for use as a "lifecycle" plugin during the bundling process.
60
- * It ensures that schema objects are explicitly typed, improving compatibility with OpenAPI tools and validators.
61
- *
62
- * Behavior:
63
- * - If a schema object has a "properties" field but no "type", it sets "type" to "object".
64
- * This is required for schemas that define properties but omit the type.
65
- *
66
- * - If a schema object contains any array-related keywords ("items", "prefixItems", "minItems", "maxItems", or "uniqueItems")
67
- * and lacks a "type", it sets "type" to "array". This clarifies the intent for array schemas missing an explicit type.
68
- *
69
- * - If a schema object has a "pattern" field but no "type", it sets "type" to "string".
70
- * This ensures that pattern constraints are only applied to string-typed schemas.
71
- *
72
- * Usage:
73
- * Add this plugin to the bundler to automatically fix schemas missing "type: object", "type: array", or "type: string"
74
- * when defining properties, array-related keywords, or pattern constraints.
75
- *
76
- * Examples:
77
- * // Before:
78
- * { properties: { foo: { type: "string" } } }
79
- * // After:
80
- * { type: "object", properties: { foo: { type: "string" } } }
81
- *
82
- * // Before:
83
- * { items: { type: "string" } }
84
- * // After:
85
- * { type: "array", items: { type: "string" } }
86
- *
87
- * // Before:
88
- * { pattern: "^[a-z]+$" }
89
- * // After:
90
- * { type: "string", pattern: "^[a-z]+$" }
91
- */
92
- export declare const cleanUp: () => LifecyclePlugin;
93
61
  //# sourceMappingURL=plugins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QAAO,eAahC,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAAO,eA+BxC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,QAAO,eAwCjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,QAAO,eAuBtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,OAAO,QAAO,eA0B1B,CAAA"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAIhE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QAAO,eAahC,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAAO,eA+BxC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,QAAO,eAwCjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,QAAO,eAuBtC,CAAA"}
package/dist/plugins.js CHANGED
@@ -80,28 +80,7 @@ const restoreOriginalRefs = () => {
80
80
  }
81
81
  };
82
82
  };
83
- const cleanUp = () => {
84
- return {
85
- type: "lifecycle",
86
- onBeforeNodeProcess: (node) => {
87
- if ("properties" in node && !("type" in node)) {
88
- node["type"] = "object";
89
- }
90
- const arrayKeywords = ["items", "prefixItems", "minItems", "maxItems", "uniqueItems"];
91
- if (arrayKeywords.some((it) => Object.hasOwn(node, it)) && !("type" in node)) {
92
- node["type"] = "array";
93
- }
94
- if ("pattern" in node && !("type" in node)) {
95
- node["type"] = "string";
96
- }
97
- if ("required" in node && node.required === null && "properties" in node) {
98
- node.required = [];
99
- }
100
- }
101
- };
102
- };
103
83
  export {
104
- cleanUp,
105
84
  externalValueResolver,
106
85
  loadingStatus,
107
86
  refsEverywhere,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/plugins.ts"],
4
- "sourcesContent": ["/**\n * This file contains a collection of plugins used for the bundler.\n * Plugins defined here can extend or modify the behavior of the bundling process,\n * such as adding lifecycle hooks or custom processing logic.\n */\nimport { isLocalRef } from '@/helpers/general'\nimport type { LifecyclePlugin } from '@scalar/json-magic/bundle'\n\n/**\n * A lifecycle plugin that adds a `$status` property to nodes during resolution.\n * - Sets `$status` to 'loading' when resolution starts.\n * - Sets `$status` to 'error' if resolution fails.\n * - Removes `$status` when resolution succeeds.\n */\nexport const loadingStatus = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onResolveStart: (node) => {\n node['$status'] = 'loading'\n },\n onResolveError: (node) => {\n node['$status'] = 'error'\n },\n onResolveSuccess: (node) => {\n delete node['$status']\n },\n }\n}\n\n/**\n * Lifecycle plugin to resolve and embed external content referenced by an 'externalValue' property in a node.\n *\n * When a node contains an 'externalValue' property (as a string), this plugin will:\n * - Fetch the external resource (such as a URL or file) using the fetchUrls plugin.\n * - If the fetch is successful, assign the fetched data to the node's 'value' property.\n *\n * This is useful for inlining external content (like examples or schemas) into the OpenAPI document during bundling.\n *\n * @param node - The node being processed, which may contain an 'externalValue' property.\n */\nexport const externalValueResolver = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onAfterNodeProcess: async (node, context) => {\n const externalValue = node['externalValue']\n const cache = context.resolutionCache\n\n // Only process if 'externalValue' is a string\n if (typeof externalValue !== 'string') {\n return\n }\n\n const loader = context.loaders.find((it) => it.validate(externalValue))\n\n // We can not process the external value\n if (!loader) {\n return\n }\n\n if (!cache.has(externalValue)) {\n cache.set(externalValue, loader.exec(externalValue))\n }\n\n const result = await cache.get(externalValue)\n\n // If fetch is successful, assign the data to the node's 'value' property\n if (result?.ok) {\n node['value'] = result.data\n }\n },\n }\n}\n\n/**\n * Lifecycle plugin to resolve $ref on any object, including non-standard locations like the info object.\n *\n * This plugin will:\n * - Detect if a node contains a $ref property (as a string).\n * - If the node is under the 'info' path, attempt to resolve the reference using fetchUrls.\n * - Replace the node's properties with the resolved data if successful.\n *\n * Note: This currently only supports refs on the 'info' object and does not handle primitive types.\n */\nexport const refsEverywhere = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onBeforeNodeProcess: async (node, context) => {\n const { path, resolutionCache, parentNode } = context\n const ref = node['$ref']\n\n // Only process nodes that have a $ref property as a string\n if (typeof ref !== 'string') {\n return\n }\n\n // Can not resolve top level refs\n if (!parentNode || !path.length) {\n return\n }\n\n const loader = context.loaders.find((it) => it.validate(ref))\n\n // Can not load the external ref\n if (!loader) {\n return\n }\n\n // Support resolving $ref on the info object\n if (path[0] === 'info') {\n // Use the cache to avoid duplicate fetches\n if (!resolutionCache.has(ref)) {\n resolutionCache.set(ref, loader.exec(ref))\n }\n\n const result = await resolutionCache.get(ref)\n\n if (result?.ok) {\n // Replace the ref with the resolved data\n parentNode[path.at(-1)!] = result.data\n }\n }\n },\n }\n}\n\n/**\n * Lifecycle plugin to restore original $ref values after processing.\n *\n * This plugin is intended to be used as a \"lifecycle\" plugin in the bundling process.\n * It operates in the `onAfterNodeProcess` hook, and its main purpose is to restore\n * the original $ref values for external references that may have been replaced or\n * rewritten during the bundling process.\n *\n * How it works:\n * - For each node processed, if the node contains a $ref property (as a string),\n * and the root document contains an \"x-ext-urls\" mapping object,\n * the plugin will attempt to restore the original $ref value.\n * - The \"x-ext-urls\" object is expected to be a mapping from the rewritten $ref\n * (e.g., a hashed or compressed reference) back to the original external URL or path.\n * - If a mapping exists for the current $ref, the plugin replaces the $ref value\n * with the original value from the mapping. If no mapping exists (e.g., for local refs),\n * the $ref value is left unchanged.\n *\n * This is useful for scenarios where you want to present or export the bundled document\n * with the original external $ref values, rather than the internal or rewritten ones.\n *\n * @returns {LifecyclePlugin} The plugin object for use in the bundler.\n */\nexport const restoreOriginalRefs = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onBeforeNodeProcess: (node, context) => {\n const ref = node['$ref']\n const root = context.rootNode\n const extUrls = root['x-ext-urls']\n\n // Only process if $ref is a string and x-ext-urls is a valid object\n if (typeof ref !== 'string' || typeof extUrls !== 'object' || extUrls === null || !isLocalRef(ref)) {\n return\n }\n\n // Working with local refs\n\n const segments = ref.split('/')\n const key = segments.at(-1) ?? ''\n\n // Replace the $ref with the original version from the mapping,\n // or keep the current version if there is no mapping (e.g., for local refs)\n node['$ref'] = (extUrls as Record<string, string>)[key] ?? ref\n },\n }\n}\n\n/**\n * Lifecycle plugin to automatically add missing \"type\" fields to OpenAPI/JSON Schema nodes.\n *\n * This plugin is intended for use as a \"lifecycle\" plugin during the bundling process.\n * It ensures that schema objects are explicitly typed, improving compatibility with OpenAPI tools and validators.\n *\n * Behavior:\n * - If a schema object has a \"properties\" field but no \"type\", it sets \"type\" to \"object\".\n * This is required for schemas that define properties but omit the type.\n *\n * - If a schema object contains any array-related keywords (\"items\", \"prefixItems\", \"minItems\", \"maxItems\", or \"uniqueItems\")\n * and lacks a \"type\", it sets \"type\" to \"array\". This clarifies the intent for array schemas missing an explicit type.\n *\n * - If a schema object has a \"pattern\" field but no \"type\", it sets \"type\" to \"string\".\n * This ensures that pattern constraints are only applied to string-typed schemas.\n *\n * Usage:\n * Add this plugin to the bundler to automatically fix schemas missing \"type: object\", \"type: array\", or \"type: string\"\n * when defining properties, array-related keywords, or pattern constraints.\n *\n * Examples:\n * // Before:\n * { properties: { foo: { type: \"string\" } } }\n * // After:\n * { type: \"object\", properties: { foo: { type: \"string\" } } }\n *\n * // Before:\n * { items: { type: \"string\" } }\n * // After:\n * { type: \"array\", items: { type: \"string\" } }\n *\n * // Before:\n * { pattern: \"^[a-z]+$\" }\n * // After:\n * { type: \"string\", pattern: \"^[a-z]+$\" }\n */\nexport const cleanUp = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onBeforeNodeProcess: (node) => {\n // If the node has \"properties\" but no \"type\", set \"type\" to \"object\"\n if ('properties' in node && !('type' in node)) {\n node['type'] = 'object'\n }\n\n // Set type to 'array' for schemas that have array-related keywords but are missing a type\n const arrayKeywords = ['items', 'prefixItems', 'minItems', 'maxItems', 'uniqueItems']\n if (arrayKeywords.some((it) => Object.hasOwn(node, it)) && !('type' in node)) {\n node['type'] = 'array'\n }\n\n // If the node has \"pattern\" but no \"type\", set \"type\" to \"string\"\n if ('pattern' in node && !('type' in node)) {\n node['type'] = 'string'\n }\n\n // Convert required: null to required: [] for object schemas\n if ('required' in node && node.required === null && 'properties' in node) {\n node.required = []\n }\n },\n }\n}\n"],
5
- "mappings": "AAKA,SAAS,kBAAkB;AASpB,MAAM,gBAAgB,MAAuB;AAClD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,gBAAgB,CAAC,SAAS;AACxB,WAAK,SAAS,IAAI;AAAA,IACpB;AAAA,IACA,gBAAgB,CAAC,SAAS;AACxB,WAAK,SAAS,IAAI;AAAA,IACpB;AAAA,IACA,kBAAkB,CAAC,SAAS;AAC1B,aAAO,KAAK,SAAS;AAAA,IACvB;AAAA,EACF;AACF;AAaO,MAAM,wBAAwB,MAAuB;AAC1D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,oBAAoB,OAAO,MAAM,YAAY;AAC3C,YAAM,gBAAgB,KAAK,eAAe;AAC1C,YAAM,QAAQ,QAAQ;AAGtB,UAAI,OAAO,kBAAkB,UAAU;AACrC;AAAA,MACF;AAEA,YAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,OAAO,GAAG,SAAS,aAAa,CAAC;AAGtE,UAAI,CAAC,QAAQ;AACX;AAAA,MACF;AAEA,UAAI,CAAC,MAAM,IAAI,aAAa,GAAG;AAC7B,cAAM,IAAI,eAAe,OAAO,KAAK,aAAa,CAAC;AAAA,MACrD;AAEA,YAAM,SAAS,MAAM,MAAM,IAAI,aAAa;AAG5C,UAAI,QAAQ,IAAI;AACd,aAAK,OAAO,IAAI,OAAO;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AACF;AAYO,MAAM,iBAAiB,MAAuB;AACnD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,qBAAqB,OAAO,MAAM,YAAY;AAC5C,YAAM,EAAE,MAAM,iBAAiB,WAAW,IAAI;AAC9C,YAAM,MAAM,KAAK,MAAM;AAGvB,UAAI,OAAO,QAAQ,UAAU;AAC3B;AAAA,MACF;AAGA,UAAI,CAAC,cAAc,CAAC,KAAK,QAAQ;AAC/B;AAAA,MACF;AAEA,YAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,OAAO,GAAG,SAAS,GAAG,CAAC;AAG5D,UAAI,CAAC,QAAQ;AACX;AAAA,MACF;AAGA,UAAI,KAAK,CAAC,MAAM,QAAQ;AAEtB,YAAI,CAAC,gBAAgB,IAAI,GAAG,GAAG;AAC7B,0BAAgB,IAAI,KAAK,OAAO,KAAK,GAAG,CAAC;AAAA,QAC3C;AAEA,cAAM,SAAS,MAAM,gBAAgB,IAAI,GAAG;AAE5C,YAAI,QAAQ,IAAI;AAEd,qBAAW,KAAK,GAAG,EAAE,CAAE,IAAI,OAAO;AAAA,QACpC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAyBO,MAAM,sBAAsB,MAAuB;AACxD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,qBAAqB,CAAC,MAAM,YAAY;AACtC,YAAM,MAAM,KAAK,MAAM;AACvB,YAAM,OAAO,QAAQ;AACrB,YAAM,UAAU,KAAK,YAAY;AAGjC,UAAI,OAAO,QAAQ,YAAY,OAAO,YAAY,YAAY,YAAY,QAAQ,CAAC,WAAW,GAAG,GAAG;AAClG;AAAA,MACF;AAIA,YAAM,WAAW,IAAI,MAAM,GAAG;AAC9B,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK;AAI/B,WAAK,MAAM,IAAK,QAAmC,GAAG,KAAK;AAAA,IAC7D;AAAA,EACF;AACF;AAsCO,MAAM,UAAU,MAAuB;AAC5C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,qBAAqB,CAAC,SAAS;AAE7B,UAAI,gBAAgB,QAAQ,EAAE,UAAU,OAAO;AAC7C,aAAK,MAAM,IAAI;AAAA,MACjB;AAGA,YAAM,gBAAgB,CAAC,SAAS,eAAe,YAAY,YAAY,aAAa;AACpF,UAAI,cAAc,KAAK,CAAC,OAAO,OAAO,OAAO,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,OAAO;AAC5E,aAAK,MAAM,IAAI;AAAA,MACjB;AAGA,UAAI,aAAa,QAAQ,EAAE,UAAU,OAAO;AAC1C,aAAK,MAAM,IAAI;AAAA,MACjB;AAGA,UAAI,cAAc,QAAQ,KAAK,aAAa,QAAQ,gBAAgB,MAAM;AACxE,aAAK,WAAW,CAAC;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/**\n * This file contains a collection of plugins used for the bundler.\n * Plugins defined here can extend or modify the behavior of the bundling process,\n * such as adding lifecycle hooks or custom processing logic.\n */\n\nimport type { LifecyclePlugin } from '@scalar/json-magic/bundle'\n\nimport { isLocalRef } from '@/helpers/general'\n\n/**\n * A lifecycle plugin that adds a `$status` property to nodes during resolution.\n * - Sets `$status` to 'loading' when resolution starts.\n * - Sets `$status` to 'error' if resolution fails.\n * - Removes `$status` when resolution succeeds.\n */\nexport const loadingStatus = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onResolveStart: (node) => {\n node['$status'] = 'loading'\n },\n onResolveError: (node) => {\n node['$status'] = 'error'\n },\n onResolveSuccess: (node) => {\n delete node['$status']\n },\n }\n}\n\n/**\n * Lifecycle plugin to resolve and embed external content referenced by an 'externalValue' property in a node.\n *\n * When a node contains an 'externalValue' property (as a string), this plugin will:\n * - Fetch the external resource (such as a URL or file) using the fetchUrls plugin.\n * - If the fetch is successful, assign the fetched data to the node's 'value' property.\n *\n * This is useful for inlining external content (like examples or schemas) into the OpenAPI document during bundling.\n *\n * @param node - The node being processed, which may contain an 'externalValue' property.\n */\nexport const externalValueResolver = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onAfterNodeProcess: async (node, context) => {\n const externalValue = node['externalValue']\n const cache = context.resolutionCache\n\n // Only process if 'externalValue' is a string\n if (typeof externalValue !== 'string') {\n return\n }\n\n const loader = context.loaders.find((it) => it.validate(externalValue))\n\n // We can not process the external value\n if (!loader) {\n return\n }\n\n if (!cache.has(externalValue)) {\n cache.set(externalValue, loader.exec(externalValue))\n }\n\n const result = await cache.get(externalValue)\n\n // If fetch is successful, assign the data to the node's 'value' property\n if (result?.ok) {\n node['value'] = result.data\n }\n },\n }\n}\n\n/**\n * Lifecycle plugin to resolve $ref on any object, including non-standard locations like the info object.\n *\n * This plugin will:\n * - Detect if a node contains a $ref property (as a string).\n * - If the node is under the 'info' path, attempt to resolve the reference using fetchUrls.\n * - Replace the node's properties with the resolved data if successful.\n *\n * Note: This currently only supports refs on the 'info' object and does not handle primitive types.\n */\nexport const refsEverywhere = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onBeforeNodeProcess: async (node, context) => {\n const { path, resolutionCache, parentNode } = context\n const ref = node['$ref']\n\n // Only process nodes that have a $ref property as a string\n if (typeof ref !== 'string') {\n return\n }\n\n // Can not resolve top level refs\n if (!parentNode || !path.length) {\n return\n }\n\n const loader = context.loaders.find((it) => it.validate(ref))\n\n // Can not load the external ref\n if (!loader) {\n return\n }\n\n // Support resolving $ref on the info object\n if (path[0] === 'info') {\n // Use the cache to avoid duplicate fetches\n if (!resolutionCache.has(ref)) {\n resolutionCache.set(ref, loader.exec(ref))\n }\n\n const result = await resolutionCache.get(ref)\n\n if (result?.ok) {\n // Replace the ref with the resolved data\n parentNode[path.at(-1)!] = result.data\n }\n }\n },\n }\n}\n\n/**\n * Lifecycle plugin to restore original $ref values after processing.\n *\n * This plugin is intended to be used as a \"lifecycle\" plugin in the bundling process.\n * It operates in the `onAfterNodeProcess` hook, and its main purpose is to restore\n * the original $ref values for external references that may have been replaced or\n * rewritten during the bundling process.\n *\n * How it works:\n * - For each node processed, if the node contains a $ref property (as a string),\n * and the root document contains an \"x-ext-urls\" mapping object,\n * the plugin will attempt to restore the original $ref value.\n * - The \"x-ext-urls\" object is expected to be a mapping from the rewritten $ref\n * (e.g., a hashed or compressed reference) back to the original external URL or path.\n * - If a mapping exists for the current $ref, the plugin replaces the $ref value\n * with the original value from the mapping. If no mapping exists (e.g., for local refs),\n * the $ref value is left unchanged.\n *\n * This is useful for scenarios where you want to present or export the bundled document\n * with the original external $ref values, rather than the internal or rewritten ones.\n *\n * @returns {LifecyclePlugin} The plugin object for use in the bundler.\n */\nexport const restoreOriginalRefs = (): LifecyclePlugin => {\n return {\n type: 'lifecycle',\n onBeforeNodeProcess: (node, context) => {\n const ref = node['$ref']\n const root = context.rootNode\n const extUrls = root['x-ext-urls']\n\n // Only process if $ref is a string and x-ext-urls is a valid object\n if (typeof ref !== 'string' || typeof extUrls !== 'object' || extUrls === null || !isLocalRef(ref)) {\n return\n }\n\n // Working with local refs\n\n const segments = ref.split('/')\n const key = segments.at(-1) ?? ''\n\n // Replace the $ref with the original version from the mapping,\n // or keep the current version if there is no mapping (e.g., for local refs)\n node['$ref'] = (extUrls as Record<string, string>)[key] ?? ref\n },\n }\n}\n"],
5
+ "mappings": "AAQA,SAAS,kBAAkB;AAQpB,MAAM,gBAAgB,MAAuB;AAClD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,gBAAgB,CAAC,SAAS;AACxB,WAAK,SAAS,IAAI;AAAA,IACpB;AAAA,IACA,gBAAgB,CAAC,SAAS;AACxB,WAAK,SAAS,IAAI;AAAA,IACpB;AAAA,IACA,kBAAkB,CAAC,SAAS;AAC1B,aAAO,KAAK,SAAS;AAAA,IACvB;AAAA,EACF;AACF;AAaO,MAAM,wBAAwB,MAAuB;AAC1D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,oBAAoB,OAAO,MAAM,YAAY;AAC3C,YAAM,gBAAgB,KAAK,eAAe;AAC1C,YAAM,QAAQ,QAAQ;AAGtB,UAAI,OAAO,kBAAkB,UAAU;AACrC;AAAA,MACF;AAEA,YAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,OAAO,GAAG,SAAS,aAAa,CAAC;AAGtE,UAAI,CAAC,QAAQ;AACX;AAAA,MACF;AAEA,UAAI,CAAC,MAAM,IAAI,aAAa,GAAG;AAC7B,cAAM,IAAI,eAAe,OAAO,KAAK,aAAa,CAAC;AAAA,MACrD;AAEA,YAAM,SAAS,MAAM,MAAM,IAAI,aAAa;AAG5C,UAAI,QAAQ,IAAI;AACd,aAAK,OAAO,IAAI,OAAO;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AACF;AAYO,MAAM,iBAAiB,MAAuB;AACnD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,qBAAqB,OAAO,MAAM,YAAY;AAC5C,YAAM,EAAE,MAAM,iBAAiB,WAAW,IAAI;AAC9C,YAAM,MAAM,KAAK,MAAM;AAGvB,UAAI,OAAO,QAAQ,UAAU;AAC3B;AAAA,MACF;AAGA,UAAI,CAAC,cAAc,CAAC,KAAK,QAAQ;AAC/B;AAAA,MACF;AAEA,YAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,OAAO,GAAG,SAAS,GAAG,CAAC;AAG5D,UAAI,CAAC,QAAQ;AACX;AAAA,MACF;AAGA,UAAI,KAAK,CAAC,MAAM,QAAQ;AAEtB,YAAI,CAAC,gBAAgB,IAAI,GAAG,GAAG;AAC7B,0BAAgB,IAAI,KAAK,OAAO,KAAK,GAAG,CAAC;AAAA,QAC3C;AAEA,cAAM,SAAS,MAAM,gBAAgB,IAAI,GAAG;AAE5C,YAAI,QAAQ,IAAI;AAEd,qBAAW,KAAK,GAAG,EAAE,CAAE,IAAI,OAAO;AAAA,QACpC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAyBO,MAAM,sBAAsB,MAAuB;AACxD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,qBAAqB,CAAC,MAAM,YAAY;AACtC,YAAM,MAAM,KAAK,MAAM;AACvB,YAAM,OAAO,QAAQ;AACrB,YAAM,UAAU,KAAK,YAAY;AAGjC,UAAI,OAAO,QAAQ,YAAY,OAAO,YAAY,YAAY,YAAY,QAAQ,CAAC,WAAW,GAAG,GAAG;AAClG;AAAA,MACF;AAIA,YAAM,WAAW,IAAI,MAAM,GAAG;AAC9B,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK;AAI/B,WAAK,MAAM,IAAK,QAAmC,GAAG,KAAK;AAAA,IAC7D;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,23 @@
1
+ import type { ServerObject } from '../schemas/v3.1/strict/openapi-document.js';
2
+ /**
3
+ * Server processing options containing base URLs for resolving relative server URLs.
4
+ */
5
+ type ServerProcessingOptions = {
6
+ baseServerUrl?: string;
7
+ documentUrl?: string;
8
+ };
9
+ /**
10
+ * Retrieves and processes servers from an OpenAPI document.
11
+ *
12
+ * This function handles several scenarios:
13
+ * 1. No servers provided - creates a default server from document URL or fallback
14
+ * 2. Invalid server configurations - filters them out with warnings
15
+ * 3. Relative URLs - resolves them to absolute URLs using available base URLs
16
+ *
17
+ * @param servers - Array of OpenAPI server objects from the document
18
+ * @param options - Configuration options for server processing
19
+ * @returns Array of validated Server entities
20
+ */
21
+ export declare function getServersFromDocument(servers: ServerObject[] | undefined, options?: ServerProcessingOptions): ServerObject[];
22
+ export {};
23
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/preprocessing/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAE1E;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,YAAY,EAAE,GAAG,SAAS,EACnC,OAAO,GAAE,uBAA4B,GACpC,YAAY,EAAE,CAsBhB"}
@@ -0,0 +1,84 @@
1
+ import { combineUrlAndPath } from "@scalar/helpers/url/merge-urls";
2
+ function getServersFromDocument(servers, options = {}) {
3
+ if (!servers?.length) {
4
+ const fallbackServer = createFallbackServer(options);
5
+ return fallbackServer ? [fallbackServer] : [];
6
+ }
7
+ if (!Array.isArray(servers)) {
8
+ return [];
9
+ }
10
+ const validServers = servers.map((server) => processServerObject(server, options));
11
+ if (validServers.length === 0) {
12
+ const fallbackServer = createFallbackServer(options);
13
+ return fallbackServer ? [fallbackServer] : [];
14
+ }
15
+ return validServers;
16
+ }
17
+ function extractBaseUrlFromDocumentUrl(documentUrl) {
18
+ try {
19
+ const url = new URL(documentUrl);
20
+ const port = url.port ? `:${url.port}` : "";
21
+ return `${url.protocol}//${url.hostname}${port}`;
22
+ } catch {
23
+ return void 0;
24
+ }
25
+ }
26
+ function getFallbackUrl() {
27
+ if (typeof window === "undefined" || typeof window?.location?.origin !== "string") {
28
+ return void 0;
29
+ }
30
+ return window.location.origin;
31
+ }
32
+ function createServerFromUrl(url) {
33
+ return { url };
34
+ }
35
+ function createDefaultServerFromDocumentUrl(documentUrl) {
36
+ const baseUrl = extractBaseUrlFromDocumentUrl(documentUrl);
37
+ if (!baseUrl) {
38
+ return void 0;
39
+ }
40
+ return createServerFromUrl(baseUrl);
41
+ }
42
+ function createDefaultServerFromFallback() {
43
+ const fallbackUrl = getFallbackUrl();
44
+ if (!fallbackUrl) {
45
+ return void 0;
46
+ }
47
+ return createServerFromUrl(fallbackUrl);
48
+ }
49
+ function resolveRelativeServerUrl(serverUrl, options) {
50
+ const { baseServerUrl: baseServerURL, documentUrl } = options;
51
+ if (baseServerURL) {
52
+ return combineUrlAndPath(baseServerURL, serverUrl);
53
+ }
54
+ if (documentUrl) {
55
+ const baseUrl = extractBaseUrlFromDocumentUrl(documentUrl);
56
+ if (baseUrl) {
57
+ return combineUrlAndPath(baseUrl, serverUrl);
58
+ }
59
+ }
60
+ const fallbackUrl = getFallbackUrl();
61
+ if (fallbackUrl) {
62
+ return combineUrlAndPath(fallbackUrl, serverUrl);
63
+ }
64
+ return serverUrl;
65
+ }
66
+ function processServerObject(server, options) {
67
+ if (server.url?.startsWith("/")) {
68
+ server.url = resolveRelativeServerUrl(server.url, options);
69
+ }
70
+ return server;
71
+ }
72
+ function createFallbackServer(options) {
73
+ if (options.documentUrl) {
74
+ const defaultServer = createDefaultServerFromDocumentUrl(options.documentUrl);
75
+ if (defaultServer) {
76
+ return defaultServer;
77
+ }
78
+ }
79
+ return createDefaultServerFromFallback();
80
+ }
81
+ export {
82
+ getServersFromDocument
83
+ };
84
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/preprocessing/server.ts"],
4
+ "sourcesContent": ["import { combineUrlAndPath } from '@scalar/helpers/url/merge-urls'\n\nimport type { ServerObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Server processing options containing base URLs for resolving relative server URLs.\n */\ntype ServerProcessingOptions = {\n baseServerUrl?: string\n documentUrl?: string\n}\n\n/**\n * Retrieves and processes servers from an OpenAPI document.\n *\n * This function handles several scenarios:\n * 1. No servers provided - creates a default server from document URL or fallback\n * 2. Invalid server configurations - filters them out with warnings\n * 3. Relative URLs - resolves them to absolute URLs using available base URLs\n *\n * @param servers - Array of OpenAPI server objects from the document\n * @param options - Configuration options for server processing\n * @returns Array of validated Server entities\n */\nexport function getServersFromDocument(\n servers: ServerObject[] | undefined,\n options: ServerProcessingOptions = {},\n): ServerObject[] {\n // Handle case where no servers are provided\n if (!servers?.length) {\n const fallbackServer = createFallbackServer(options)\n return fallbackServer ? [fallbackServer] : []\n }\n\n // Handle invalid server array\n if (!Array.isArray(servers)) {\n return []\n }\n\n // Process each server and filter out invalid ones\n const validServers = servers.map((server) => processServerObject(server, options))\n\n // If all servers were invalid, provide a fallback\n if (validServers.length === 0) {\n const fallbackServer = createFallbackServer(options)\n return fallbackServer ? [fallbackServer] : []\n }\n\n return validServers\n}\n\n/**\n * Extracts the base URL (protocol + hostname) from a document URL.\n * Returns undefined if the URL is invalid.\n */\nfunction extractBaseUrlFromDocumentUrl(documentUrl: string): string | undefined {\n try {\n const url = new URL(documentUrl)\n const port = url.port ? `:${url.port}` : ''\n return `${url.protocol}//${url.hostname}${port}`\n } catch {\n return undefined\n }\n}\n\n/**\n * Gets the fallback URL from window.location.origin if available.\n */\nfunction getFallbackUrl(): string | undefined {\n if (typeof window === 'undefined' || typeof window?.location?.origin !== 'string') {\n return undefined\n }\n return window.location.origin\n}\n\n/**\n * Creates a server object from a URL string, with error handling.\n */\nfunction createServerFromUrl(url: string): ServerObject | undefined {\n return { url }\n}\n\n/**\n * Creates a default server using the document URL as the base.\n */\nfunction createDefaultServerFromDocumentUrl(documentUrl: string): ServerObject | undefined {\n const baseUrl = extractBaseUrlFromDocumentUrl(documentUrl)\n if (!baseUrl) {\n return undefined\n }\n\n return createServerFromUrl(baseUrl)\n}\n\n/**\n * Creates a default server using the fallback URL (window.location.origin).\n */\nfunction createDefaultServerFromFallback(): ServerObject | undefined {\n const fallbackUrl = getFallbackUrl()\n if (!fallbackUrl) {\n return undefined\n }\n\n return createServerFromUrl(fallbackUrl)\n}\n\n/**\n * Resolves a relative server URL to an absolute URL using available base URLs.\n * Uses a priority system: baseServerURL > documentUrl > fallbackUrl.\n */\nfunction resolveRelativeServerUrl(serverUrl: string, options: ServerProcessingOptions): string {\n const { baseServerUrl: baseServerURL, documentUrl } = options\n\n // Priority 1: Use provided base server URL\n if (baseServerURL) {\n return combineUrlAndPath(baseServerURL, serverUrl)\n }\n\n // Priority 2: Extract base URL from document URL\n if (documentUrl) {\n const baseUrl = extractBaseUrlFromDocumentUrl(documentUrl)\n if (baseUrl) {\n return combineUrlAndPath(baseUrl, serverUrl)\n }\n }\n\n // Priority 3: Use fallback URL (window.location.origin)\n const fallbackUrl = getFallbackUrl()\n if (fallbackUrl) {\n return combineUrlAndPath(fallbackUrl, serverUrl)\n }\n\n // If no base URL is available, return the original URL\n return serverUrl\n}\n\n/**\n * Processes a single server object, handling validation and URL resolution.\n */\nfunction processServerObject(server: ServerObject, options: ServerProcessingOptions): ServerObject {\n // Resolve relative URLs to absolute URLs\n if (server.url?.startsWith('/')) {\n server.url = resolveRelativeServerUrl(server.url, options)\n }\n\n return server\n}\n\n/**\n * Creates a fallback server when no valid servers are available.\n * Uses document URL first, then fallback URL.\n */\nfunction createFallbackServer(options: ServerProcessingOptions): ServerObject | undefined {\n // Priority 1: Try to create default server from document URL\n if (options.documentUrl) {\n const defaultServer = createDefaultServerFromDocumentUrl(options.documentUrl)\n\n if (defaultServer) {\n return defaultServer\n }\n }\n\n // Priority 2: Try to create default server from fallback URL\n return createDefaultServerFromFallback()\n}\n"],
5
+ "mappings": "AAAA,SAAS,yBAAyB;AAwB3B,SAAS,uBACd,SACA,UAAmC,CAAC,GACpB;AAEhB,MAAI,CAAC,SAAS,QAAQ;AACpB,UAAM,iBAAiB,qBAAqB,OAAO;AACnD,WAAO,iBAAiB,CAAC,cAAc,IAAI,CAAC;AAAA,EAC9C;AAGA,MAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAO,CAAC;AAAA,EACV;AAGA,QAAM,eAAe,QAAQ,IAAI,CAAC,WAAW,oBAAoB,QAAQ,OAAO,CAAC;AAGjF,MAAI,aAAa,WAAW,GAAG;AAC7B,UAAM,iBAAiB,qBAAqB,OAAO;AACnD,WAAO,iBAAiB,CAAC,cAAc,IAAI,CAAC;AAAA,EAC9C;AAEA,SAAO;AACT;AAMA,SAAS,8BAA8B,aAAyC;AAC9E,MAAI;AACF,UAAM,MAAM,IAAI,IAAI,WAAW;AAC/B,UAAM,OAAO,IAAI,OAAO,IAAI,IAAI,IAAI,KAAK;AACzC,WAAO,GAAG,IAAI,QAAQ,KAAK,IAAI,QAAQ,GAAG,IAAI;AAAA,EAChD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAKA,SAAS,iBAAqC;AAC5C,MAAI,OAAO,WAAW,eAAe,OAAO,QAAQ,UAAU,WAAW,UAAU;AACjF,WAAO;AAAA,EACT;AACA,SAAO,OAAO,SAAS;AACzB;AAKA,SAAS,oBAAoB,KAAuC;AAClE,SAAO,EAAE,IAAI;AACf;AAKA,SAAS,mCAAmC,aAA+C;AACzF,QAAM,UAAU,8BAA8B,WAAW;AACzD,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,oBAAoB,OAAO;AACpC;AAKA,SAAS,kCAA4D;AACnE,QAAM,cAAc,eAAe;AACnC,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,SAAO,oBAAoB,WAAW;AACxC;AAMA,SAAS,yBAAyB,WAAmB,SAA0C;AAC7F,QAAM,EAAE,eAAe,eAAe,YAAY,IAAI;AAGtD,MAAI,eAAe;AACjB,WAAO,kBAAkB,eAAe,SAAS;AAAA,EACnD;AAGA,MAAI,aAAa;AACf,UAAM,UAAU,8BAA8B,WAAW;AACzD,QAAI,SAAS;AACX,aAAO,kBAAkB,SAAS,SAAS;AAAA,IAC7C;AAAA,EACF;AAGA,QAAM,cAAc,eAAe;AACnC,MAAI,aAAa;AACf,WAAO,kBAAkB,aAAa,SAAS;AAAA,EACjD;AAGA,SAAO;AACT;AAKA,SAAS,oBAAoB,QAAsB,SAAgD;AAEjG,MAAI,OAAO,KAAK,WAAW,GAAG,GAAG;AAC/B,WAAO,MAAM,yBAAyB,OAAO,KAAK,OAAO;AAAA,EAC3D;AAEA,SAAO;AACT;AAMA,SAAS,qBAAqB,SAA4D;AAExF,MAAI,QAAQ,aAAa;AACvB,UAAM,gBAAgB,mCAAmC,QAAQ,WAAW;AAE5E,QAAI,eAAe;AACjB,aAAO;AAAA,IACT;AAAA,EACF;AAGA,SAAO,gCAAgC;AACzC;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import { Type, type TSchema } from '@sinclair/typebox';
1
+ import { type TSchema, Type } from '@scalar/typebox';
2
2
  /**
3
3
  * Work around for: https://github.com/sinclairzx81/typebox/issues/1264
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/schemas/compose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,OAAO,EAAE,WAAW,CAAC,KACX,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAC9E,CAAA"}
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/schemas/compose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,KACX,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAC9E,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const compose = (...args) => {
3
3
  return Type.Composite(args);
4
4
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/schemas/compose.ts"],
4
- "sourcesContent": ["import { Type, type TSchema } from '@sinclair/typebox'\n\n/**\n * Work around for: https://github.com/sinclairzx81/typebox/issues/1264\n */\nexport const compose = <A extends TSchema[]>(...args: A) => {\n return Type.Composite(args) as unknown as ReturnType<typeof Type.Intersect<A>>\n}\n"],
5
- "mappings": "AAAA,SAAS,YAA0B;AAK5B,MAAM,UAAU,IAAyB,SAAY;AAC1D,SAAO,KAAK,UAAU,IAAI;AAC5B;",
4
+ "sourcesContent": ["import { type TSchema, Type } from '@scalar/typebox'\n\n/**\n * Work around for: https://github.com/sinclairzx81/typebox/issues/1264\n */\nexport const compose = <A extends TSchema[]>(...args: A) => {\n return Type.Composite(args) as unknown as ReturnType<typeof Type.Intersect<A>>\n}\n"],
5
+ "mappings": "AAAA,SAAuB,YAAY;AAK5B,MAAM,UAAU,IAAyB,SAAY;AAC1D,SAAO,KAAK,UAAU,IAAI;AAC5B;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- export declare const XInternalSchema: import("@sinclair/typebox").TObject<{
2
- 'x-internal': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
1
+ export declare const XInternalSchema: import("@scalar/typebox").TObject<{
2
+ 'x-internal': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
3
3
  }>;
4
4
  //# sourceMappingURL=x-internal.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const XInternalSchema = Type.Object({
3
3
  "x-internal": Type.Optional(Type.Boolean())
4
4
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/schemas/extensions/document/x-internal.ts"],
4
- "sourcesContent": ["import { Type } from '@sinclair/typebox'\n\nexport const XInternalSchema = Type.Object({\n 'x-internal': Type.Optional(Type.Boolean()),\n})\n"],
4
+ "sourcesContent": ["import { Type } from '@scalar/typebox'\n\nexport const XInternalSchema = Type.Object({\n 'x-internal': Type.Optional(Type.Boolean()),\n})\n"],
5
5
  "mappings": "AAAA,SAAS,YAAY;AAEd,MAAM,kBAAkB,KAAK,OAAO;AAAA,EACzC,cAAc,KAAK,SAAS,KAAK,QAAQ,CAAC;AAC5C,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- export declare const XScalarIconSchema: import("@sinclair/typebox").TObject<{
2
- 'x-scalar-icon': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1
+ export declare const XScalarIconSchema: import("@scalar/typebox").TObject<{
2
+ 'x-scalar-icon': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
3
3
  }>;
4
4
  //# sourceMappingURL=x-scalar-icon.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const XScalarIconSchema = Type.Object({
3
3
  "x-scalar-icon": Type.Optional(Type.String())
4
4
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/schemas/extensions/document/x-scalar-icon.ts"],
4
- "sourcesContent": ["import { Type } from '@sinclair/typebox'\n\nexport const XScalarIconSchema = Type.Object({\n 'x-scalar-icon': Type.Optional(Type.String()),\n})\n"],
4
+ "sourcesContent": ["import { Type } from '@scalar/typebox'\n\nexport const XScalarIconSchema = Type.Object({\n 'x-scalar-icon': Type.Optional(Type.String()),\n})\n"],
5
5
  "mappings": "AAAA,SAAS,YAAY;AAEd,MAAM,oBAAoB,KAAK,OAAO;AAAA,EAC3C,iBAAiB,KAAK,SAAS,KAAK,OAAO,CAAC;AAC9C,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- export declare const XScalarIgnoreSchema: import("@sinclair/typebox").TObject<{
2
- 'x-scalar-ignore': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
1
+ export declare const XScalarIgnoreSchema: import("@scalar/typebox").TObject<{
2
+ 'x-scalar-ignore': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
3
3
  }>;
4
4
  //# sourceMappingURL=x-scalar-ignore.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const XScalarIgnoreSchema = Type.Object({
3
3
  "x-scalar-ignore": Type.Optional(Type.Boolean())
4
4
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/schemas/extensions/document/x-scalar-ignore.ts"],
4
- "sourcesContent": ["import { Type } from '@sinclair/typebox'\n\nexport const XScalarIgnoreSchema = Type.Object({\n 'x-scalar-ignore': Type.Optional(Type.Boolean()),\n})\n"],
4
+ "sourcesContent": ["import { Type } from '@scalar/typebox'\n\nexport const XScalarIgnoreSchema = Type.Object({\n 'x-scalar-ignore': Type.Optional(Type.Boolean()),\n})\n"],
5
5
  "mappings": "AAAA,SAAS,YAAY;AAEd,MAAM,sBAAsB,KAAK,OAAO;AAAA,EAC7C,mBAAmB,KAAK,SAAS,KAAK,QAAQ,CAAC;AACjD,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,10 @@
1
- export declare const XScalarSdkInstallationSchema: import("@sinclair/typebox").TObject<{
2
- 'x-scalar-sdk-installation': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
3
- lang: import("@sinclair/typebox").TString;
4
- source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
5
- description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1
+ import type { Static } from '@scalar/typebox';
2
+ export declare const XScalarSdkInstallationSchema: import("@scalar/typebox").TObject<{
3
+ 'x-scalar-sdk-installation': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
4
+ lang: import("@scalar/typebox").TString;
5
+ source: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
6
+ description: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
6
7
  }>>>;
7
8
  }>;
9
+ export type XScalarSdkInstallation = Static<typeof XScalarSdkInstallationSchema>;
8
10
  //# sourceMappingURL=x-scalar-sdk-installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-scalar-sdk-installation.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/document/x-scalar-sdk-installation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B;;;;;;EAUvC,CAAA"}
1
+ {"version":3,"file":"x-scalar-sdk-installation.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/document/x-scalar-sdk-installation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAG7C,eAAO,MAAM,4BAA4B;;;;;;EAUvC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const XScalarSdkInstallationSchema = Type.Object({
3
3
  "x-scalar-sdk-installation": Type.Optional(
4
4
  Type.Array(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/schemas/extensions/document/x-scalar-sdk-installation.ts"],
4
- "sourcesContent": ["import { Type } from '@sinclair/typebox'\n\nexport const XScalarSdkInstallationSchema = Type.Object({\n 'x-scalar-sdk-installation': Type.Optional(\n Type.Array(\n Type.Object({\n lang: Type.String(),\n source: Type.Optional(Type.String()),\n description: Type.Optional(Type.String()),\n }),\n ),\n ),\n})\n"],
5
- "mappings": "AAAA,SAAS,YAAY;AAEd,MAAM,+BAA+B,KAAK,OAAO;AAAA,EACtD,6BAA6B,KAAK;AAAA,IAChC,KAAK;AAAA,MACH,KAAK,OAAO;AAAA,QACV,MAAM,KAAK,OAAO;AAAA,QAClB,QAAQ,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,QACnC,aAAa,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,MAC1C,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;",
4
+ "sourcesContent": ["import type { Static } from '@scalar/typebox'\nimport { Type } from '@scalar/typebox'\n\nexport const XScalarSdkInstallationSchema = Type.Object({\n 'x-scalar-sdk-installation': Type.Optional(\n Type.Array(\n Type.Object({\n lang: Type.String(),\n source: Type.Optional(Type.String()),\n description: Type.Optional(Type.String()),\n }),\n ),\n ),\n})\n\nexport type XScalarSdkInstallation = Static<typeof XScalarSdkInstallationSchema>\n"],
5
+ "mappings": "AACA,SAAS,YAAY;AAEd,MAAM,+BAA+B,KAAK,OAAO;AAAA,EACtD,6BAA6B,KAAK;AAAA,IAChC,KAAK;AAAA,MACH,KAAK,OAAO;AAAA,QACV,MAAM,KAAK,OAAO;AAAA,QAClB,QAAQ,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,QACnC,aAAa,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,MAC1C,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,4 @@
1
+ export declare const XTags: import("@scalar/typebox").TObject<{
2
+ 'x-tags': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
3
+ }>;
4
+ //# sourceMappingURL=x-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-tags.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/document/x-tags.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;EAEhB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { Type } from "@scalar/typebox";
2
+ const XTags = Type.Object({
3
+ "x-tags": Type.Optional(Type.Array(Type.String()))
4
+ });
5
+ export {
6
+ XTags
7
+ };
8
+ //# sourceMappingURL=x-tags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas/extensions/document/x-tags.ts"],
4
+ "sourcesContent": ["import { Type } from '@scalar/typebox'\n\nexport const XTags = Type.Object({\n 'x-tags': Type.Optional(Type.Array(Type.String())),\n})\n"],
5
+ "mappings": "AAAA,SAAS,YAAY;AAEd,MAAM,QAAQ,KAAK,OAAO;AAAA,EAC/B,UAAU,KAAK,SAAS,KAAK,MAAM,KAAK,OAAO,CAAC,CAAC;AACnD,CAAC;",
6
+ "names": []
7
+ }
@@ -1,21 +1,21 @@
1
- import { type Static } from '@sinclair/typebox';
1
+ import { type Static } from '@scalar/typebox';
2
2
  /**
3
3
  * Schema for individual badge configuration in x-badges extension.
4
4
  * Badges are indicators that can be displayed in API documentation.
5
5
  */
6
- export declare const BadgeSchema: import("@sinclair/typebox").TObject<{
6
+ export declare const BadgeSchema: import("@scalar/typebox").TObject<{
7
7
  /** The text that displays in the badge. This is required for all badges. */
8
- name: import("@sinclair/typebox").TString;
8
+ name: import("@scalar/typebox").TString;
9
9
  /**
10
10
  * The position of the badge in relation to the header.
11
11
  * Defaults to 'after' if not specified.
12
12
  */
13
- position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"before">, import("@sinclair/typebox").TLiteral<"after">]>>;
13
+ position: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"before">, import("@scalar/typebox").TLiteral<"after">]>>;
14
14
  /**
15
15
  * The color of the badge. Can be defined in various formats such as color keywords,
16
16
  * RGB, RGBA, HSL, HSLA, and Hexadecimal.
17
17
  */
18
- color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
18
+ color: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
19
19
  }>;
20
20
  export type XBadge = Static<typeof BadgeSchema>;
21
21
  /**
@@ -39,20 +39,20 @@ export type XBadge = Static<typeof BadgeSchema>;
39
39
  * color: '#ffcc00'
40
40
  ```
41
41
  */
42
- export declare const XBadgesSchema: import("@sinclair/typebox").TObject<{
43
- 'x-badges': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
42
+ export declare const XBadgesSchema: import("@scalar/typebox").TObject<{
43
+ 'x-badges': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
44
44
  /** The text that displays in the badge. This is required for all badges. */
45
- name: import("@sinclair/typebox").TString;
45
+ name: import("@scalar/typebox").TString;
46
46
  /**
47
47
  * The position of the badge in relation to the header.
48
48
  * Defaults to 'after' if not specified.
49
49
  */
50
- position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"before">, import("@sinclair/typebox").TLiteral<"after">]>>;
50
+ position: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"before">, import("@scalar/typebox").TLiteral<"after">]>>;
51
51
  /**
52
52
  * The color of the badge. Can be defined in various formats such as color keywords,
53
53
  * RGB, RGBA, HSL, HSLA, and Hexadecimal.
54
54
  */
55
- color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
55
+ color: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
56
56
  }>>>;
57
57
  }>;
58
58
  //# sourceMappingURL=x-badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-badge.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/operation/x-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,WAAW;IAEpB,4EAA4E;;IAK5E;;;OAGG;;IAOH;;;OAGG;;EAYN,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa;;QAvDtB,4EAA4E;;QAK5E;;;WAGG;;QAOH;;;WAGG;;;EAuCL,CAAA"}
1
+ {"version":3,"file":"x-badge.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/operation/x-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,iBAAiB,CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,WAAW;IAEpB,4EAA4E;;IAK5E;;;OAGG;;IAOH;;;OAGG;;EAYN,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa;;QAvDtB,4EAA4E;;QAK5E;;;WAGG;;QAOH;;;WAGG;;;EAuCL,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const BadgeSchema = Type.Object(
3
3
  {
4
4
  /** The text that displays in the badge. This is required for all badges. */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/schemas/extensions/operation/x-badge.ts"],
4
- "sourcesContent": ["import { Type, type Static } from '@sinclair/typebox'\n\n/**\n * Schema for individual badge configuration in x-badges extension.\n * Badges are indicators that can be displayed in API documentation.\n */\nexport const BadgeSchema = Type.Object(\n {\n /** The text that displays in the badge. This is required for all badges. */\n name: Type.String({\n description: 'The text that displays in the badge',\n minLength: 1,\n }),\n /**\n * The position of the badge in relation to the header.\n * Defaults to 'after' if not specified.\n */\n position: Type.Optional(\n Type.Union([Type.Literal('before'), Type.Literal('after')], {\n description: 'The position of the badge in relation to the header',\n default: 'after',\n }),\n ),\n /**\n * The color of the badge. Can be defined in various formats such as color keywords,\n * RGB, RGBA, HSL, HSLA, and Hexadecimal.\n */\n color: Type.Optional(\n Type.String({\n description: 'The color of the badge in various formats (keywords, RGB, RGBA, HSL, HSLA, Hexadecimal)',\n pattern:\n '^(#([0-9A-Fa-f]{3}){1,2}|rgb\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*\\\\)|rgba\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*,\\\\s*[0-9.]*\\\\s*\\\\)|hsl\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+%\\\\s*,\\\\s*\\\\d+%\\\\s*\\\\)|hsla\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+%\\\\s*,\\\\s*\\\\d+%\\\\s*,\\\\s*[0-9.]*\\\\s*\\\\)|[a-zA-Z]+)$',\n }),\n ),\n },\n {\n description: 'Configuration for a single badge in the x-badges extension',\n },\n)\n\nexport type XBadge = Static<typeof BadgeSchema>\n\n/**\n * You can add badges to operations to use as indicators in documentation. Each operation can have multiple badges, and the displayed color is also configurable. The following example sets badges on the GET `/hello-world` operation:\n *\n * ```yaml\n * openapi: 3.1.0\n * info:\n * title: x-badges\n * version: 1.0.0\n * paths:\n * /hello-world:\n * get:\n * summary: Hello World\n * x-badges:\n * - name: 'Alpha'\n * - name: 'Beta'\n * position: before\n * - name: 'Gamma'\n * position: after\n * color: '#ffcc00'\n```\n */\nexport const XBadgesSchema = Type.Object({\n 'x-badges': Type.Optional(Type.Array(BadgeSchema)),\n})\n"],
5
- "mappings": "AAAA,SAAS,YAAyB;AAM3B,MAAM,cAAc,KAAK;AAAA,EAC9B;AAAA;AAAA,IAEE,MAAM,KAAK,OAAO;AAAA,MAChB,aAAa;AAAA,MACb,WAAW;AAAA,IACb,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU,KAAK;AAAA,MACb,KAAK,MAAM,CAAC,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,OAAO,CAAC,GAAG;AAAA,QAC1D,aAAa;AAAA,QACb,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO,KAAK;AAAA,MACV,KAAK,OAAO;AAAA,QACV,aAAa;AAAA,QACb,SACE;AAAA,MACJ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA;AAAA,IACE,aAAa;AAAA,EACf;AACF;AAyBO,MAAM,gBAAgB,KAAK,OAAO;AAAA,EACvC,YAAY,KAAK,SAAS,KAAK,MAAM,WAAW,CAAC;AACnD,CAAC;",
4
+ "sourcesContent": ["import { type Static, Type } from '@scalar/typebox'\n\n/**\n * Schema for individual badge configuration in x-badges extension.\n * Badges are indicators that can be displayed in API documentation.\n */\nexport const BadgeSchema = Type.Object(\n {\n /** The text that displays in the badge. This is required for all badges. */\n name: Type.String({\n description: 'The text that displays in the badge',\n minLength: 1,\n }),\n /**\n * The position of the badge in relation to the header.\n * Defaults to 'after' if not specified.\n */\n position: Type.Optional(\n Type.Union([Type.Literal('before'), Type.Literal('after')], {\n description: 'The position of the badge in relation to the header',\n default: 'after',\n }),\n ),\n /**\n * The color of the badge. Can be defined in various formats such as color keywords,\n * RGB, RGBA, HSL, HSLA, and Hexadecimal.\n */\n color: Type.Optional(\n Type.String({\n description: 'The color of the badge in various formats (keywords, RGB, RGBA, HSL, HSLA, Hexadecimal)',\n pattern:\n '^(#([0-9A-Fa-f]{3}){1,2}|rgb\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*\\\\)|rgba\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+\\\\s*,\\\\s*[0-9.]*\\\\s*\\\\)|hsl\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+%\\\\s*,\\\\s*\\\\d+%\\\\s*\\\\)|hsla\\\\(\\\\s*\\\\d+\\\\s*,\\\\s*\\\\d+%\\\\s*,\\\\s*\\\\d+%\\\\s*,\\\\s*[0-9.]*\\\\s*\\\\)|[a-zA-Z]+)$',\n }),\n ),\n },\n {\n description: 'Configuration for a single badge in the x-badges extension',\n },\n)\n\nexport type XBadge = Static<typeof BadgeSchema>\n\n/**\n * You can add badges to operations to use as indicators in documentation. Each operation can have multiple badges, and the displayed color is also configurable. The following example sets badges on the GET `/hello-world` operation:\n *\n * ```yaml\n * openapi: 3.1.0\n * info:\n * title: x-badges\n * version: 1.0.0\n * paths:\n * /hello-world:\n * get:\n * summary: Hello World\n * x-badges:\n * - name: 'Alpha'\n * - name: 'Beta'\n * position: before\n * - name: 'Gamma'\n * position: after\n * color: '#ffcc00'\n```\n */\nexport const XBadgesSchema = Type.Object({\n 'x-badges': Type.Optional(Type.Array(BadgeSchema)),\n})\n"],
5
+ "mappings": "AAAA,SAAsB,YAAY;AAM3B,MAAM,cAAc,KAAK;AAAA,EAC9B;AAAA;AAAA,IAEE,MAAM,KAAK,OAAO;AAAA,MAChB,aAAa;AAAA,MACb,WAAW;AAAA,IACb,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU,KAAK;AAAA,MACb,KAAK,MAAM,CAAC,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,OAAO,CAAC,GAAG;AAAA,QAC1D,aAAa;AAAA,QACb,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO,KAAK;AAAA,MACV,KAAK,OAAO;AAAA,QACV,aAAa;AAAA,QACb,SACE;AAAA,MACJ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA;AAAA,IACE,aAAa;AAAA,EACf;AACF;AAyBO,MAAM,gBAAgB,KAAK,OAAO;AAAA,EACvC,YAAY,KAAK,SAAS,KAAK,MAAM,WAAW,CAAC;AACnD,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,23 +1,23 @@
1
- export declare const XCodeSampleSchema: import("@sinclair/typebox").TObject<{
2
- lang: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
3
- label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
4
- source: import("@sinclair/typebox").TString;
1
+ export declare const XCodeSampleSchema: import("@scalar/typebox").TObject<{
2
+ lang: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
3
+ label: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
4
+ source: import("@scalar/typebox").TString;
5
5
  }>;
6
- export declare const XCodeSamplesSchema: import("@sinclair/typebox").TObject<{
7
- 'x-codeSamples': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
8
- lang: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
- label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
10
- source: import("@sinclair/typebox").TString;
6
+ export declare const XCodeSamplesSchema: import("@scalar/typebox").TObject<{
7
+ 'x-codeSamples': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
8
+ lang: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
9
+ label: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
10
+ source: import("@scalar/typebox").TString;
11
11
  }>>>;
12
- 'x-code-samples': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
13
- lang: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
14
- label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
15
- source: import("@sinclair/typebox").TString;
12
+ 'x-code-samples': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
13
+ lang: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
14
+ label: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
15
+ source: import("@scalar/typebox").TString;
16
16
  }>>>;
17
- 'x-custom-examples': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
18
- lang: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
19
- label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
20
- source: import("@sinclair/typebox").TString;
17
+ 'x-custom-examples': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
18
+ lang: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
19
+ label: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
20
+ source: import("@scalar/typebox").TString;
21
21
  }>>>;
22
22
  }>;
23
23
  //# sourceMappingURL=x-code-samples.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Type } from "@sinclair/typebox";
1
+ import { Type } from "@scalar/typebox";
2
2
  const XCodeSampleSchema = Type.Object({
3
3
  lang: Type.Optional(Type.String()),
4
4
  label: Type.Optional(Type.String()),