@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
@@ -1,4 +1,4 @@
1
- import type { ServerObject } from '../schemas/v3.1/strict/server.js';
1
+ import type { ServerObject } from '../schemas/v3.1/strict/openapi-document.js';
2
2
  /**
3
3
  * Provides mutator functions for managing an array of OpenAPI ServerObject entries.
4
4
  *
@@ -7,6 +7,6 @@ import type { ServerObject } from '../schemas/v3.1/strict/server.js';
7
7
  */
8
8
  export declare const serverMutators: (target?: ServerObject[]) => {
9
9
  addServer: (server: ServerObject) => boolean;
10
- deleteServer: (index: number) => boolean;
10
+ deleteServer: (url: string) => boolean;
11
11
  };
12
12
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mutators/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,YAAa,YAAY,EAAE;wBAMzB,YAAY,KAAG,OAAO;0BAapB,MAAM,KAAG,OAAO;CAY9C,CAAA"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mutators/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,YAAY,EAAE;wBAMzB,YAAY,KAAG,OAAO;wBAatB,MAAM,KAAG,OAAO;CAc5C,CAAA"}
@@ -6,11 +6,13 @@ const serverMutators = (target) => {
6
6
  target.push(server);
7
7
  return true;
8
8
  };
9
- const deleteServer = (index) => {
9
+ const deleteServer = (url) => {
10
10
  if (!target) {
11
11
  return false;
12
12
  }
13
- target.splice(index, 1);
13
+ const newTarget = [...target.filter((it) => it.url !== url)];
14
+ target.splice(0, target.length);
15
+ target.push(...newTarget);
14
16
  return true;
15
17
  };
16
18
  return {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/mutators/server.ts"],
4
- "sourcesContent": ["import type { ServerObject } from '@/schemas/v3.1/strict/server'\n\n/**\n * Provides mutator functions for managing an array of OpenAPI ServerObject entries.\n *\n * @param target - The array of ServerObject to mutate. If not provided, mutators will be no-ops.\n * @returns An object with addServer and deleteServer methods.\n */\nexport const serverMutators = (target?: ServerObject[]) => {\n /**\n * Adds a new ServerObject to the target array.\n * @param server - The ServerObject to add.\n * @returns true if the server was added, false if target is undefined.\n */\n const addServer = (server: ServerObject): boolean => {\n if (!target) {\n return false\n }\n target.push(server)\n return true\n }\n\n /**\n * Deletes a ServerObject at the specified index from the target array.\n * @param index - The index of the server to delete.\n * @returns true if the server was deleted, false if target is undefined.\n */\n const deleteServer = (index: number): boolean => {\n if (!target) {\n return false\n }\n target.splice(index, 1)\n return true\n }\n\n return {\n addServer,\n deleteServer,\n }\n}\n"],
5
- "mappings": "AAQO,MAAM,iBAAiB,CAAC,WAA4B;AAMzD,QAAM,YAAY,CAAC,WAAkC;AACnD,QAAI,CAAC,QAAQ;AACX,aAAO;AAAA,IACT;AACA,WAAO,KAAK,MAAM;AAClB,WAAO;AAAA,EACT;AAOA,QAAM,eAAe,CAAC,UAA2B;AAC/C,QAAI,CAAC,QAAQ;AACX,aAAO;AAAA,IACT;AACA,WAAO,OAAO,OAAO,CAAC;AACtB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import type { ServerObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Provides mutator functions for managing an array of OpenAPI ServerObject entries.\n *\n * @param target - The array of ServerObject to mutate. If not provided, mutators will be no-ops.\n * @returns An object with addServer and deleteServer methods.\n */\nexport const serverMutators = (target?: ServerObject[]) => {\n /**\n * Adds a new ServerObject to the target array.\n * @param server - The ServerObject to add.\n * @returns true if the server was added, false if target is undefined.\n */\n const addServer = (server: ServerObject): boolean => {\n if (!target) {\n return false\n }\n target.push(server)\n return true\n }\n\n /**\n * Deletes a ServerObject at the specified index from the target array.\n * @param index - The index of the server to delete.\n * @returns true if the server was deleted, false if target is undefined.\n */\n const deleteServer = (url: string): boolean => {\n if (!target) {\n return false\n }\n const newTarget = [...target.filter((it) => it.url !== url)]\n target.splice(0, target.length)\n target.push(...newTarget)\n return true\n }\n\n return {\n addServer,\n deleteServer,\n }\n}\n"],
5
+ "mappings": "AAQO,MAAM,iBAAiB,CAAC,WAA4B;AAMzD,QAAM,YAAY,CAAC,WAAkC;AACnD,QAAI,CAAC,QAAQ;AACX,aAAO;AAAA,IACT;AACA,WAAO,KAAK,MAAM;AAClB,WAAO;AAAA,EACT;AAOA,QAAM,eAAe,CAAC,QAAyB;AAC7C,QAAI,CAAC,QAAQ;AACX,aAAO;AAAA,IACT;AACA,UAAM,YAAY,CAAC,GAAG,OAAO,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,CAAC;AAC3D,WAAO,OAAO,GAAG,OAAO,MAAM;AAC9B,WAAO,KAAK,GAAG,SAAS;AACxB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-tag.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/get-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,KAAK,WAAW,GAAG,WAAW,CAAC,OAAO,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,YAAa,OAAO,QAAQ,MAAM,KAAG,WAMvD,CAAA"}
1
+ {"version":3,"file":"get-tag.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/get-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,KAAK,WAAW,GAAG,WAAW,CAAC,OAAO,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,EAAE,MAAM,MAAM,KAAG,WAMvD,CAAA"}
@@ -16,5 +16,7 @@ export declare const DEFAULT_INTRODUCTION_SLUG = "introduction";
16
16
  * @param getHeadingId - Function to generate unique IDs for headings
17
17
  * @returns Array of navigation entries with their hierarchy
18
18
  */
19
- export declare const traverseDescription: (description: string | undefined, titlesMap: Map<string, string>, getHeadingId: (heading: Heading) => string) => TraversedDescription[];
19
+ export declare const traverseDescription: (description: string | undefined,
20
+ /** Map of titles for the mobile header */
21
+ titlesMap: Map<string, string>, getHeadingId: (heading: Heading) => string) => TraversedDescription[];
20
22
  //# sourceMappingURL=traverse-description.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-description.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-description.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,gBACjB,MAAM,GAAG,SAAS,aAEpB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAChB,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,KACzC,oBAAoB,EAqDtB,CAAA"}
1
+ {"version":3,"file":"traverse-description.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-description.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,MAAM,GAAG,SAAS;AAC/B,0CAA0C;AAC1C,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,KACzC,oBAAoB,EAqDtB,CAAA"}
@@ -15,35 +15,11 @@ export declare const traverseDocument: (document: OpenApiDocument, { hideModels,
15
15
  id: string;
16
16
  title: string;
17
17
  } & {
18
- children?: {
18
+ children?: (({
19
19
  type: "text" | "operation" | "model" | "tag" | "webhook";
20
20
  id: string;
21
21
  title: string;
22
- }[] | undefined;
23
- type: "text";
24
- }) | ({
25
- type: "text" | "operation" | "model" | "tag" | "webhook";
26
- id: string;
27
- title: string;
28
- } & {
29
- type: "operation";
30
- ref: string;
31
- method: string;
32
- path: string;
33
- }) | ({
34
- type: "text" | "operation" | "model" | "tag" | "webhook";
35
- id: string;
36
- title: string;
37
- } & {
38
- type: "model";
39
- ref: string;
40
- name: string;
41
- }) | ({
42
- type: "text" | "operation" | "model" | "tag" | "webhook";
43
- id: string;
44
- title: string;
45
- } & {
46
- children?: (({
22
+ } & /*elided*/ any) | ({
47
23
  type: "text" | "operation" | "model" | "tag" | "webhook";
48
24
  id: string;
49
25
  title: string;
@@ -75,10 +51,6 @@ export declare const traverseDocument: (document: OpenApiDocument, { hideModels,
75
51
  type: "text" | "operation" | "model" | "tag" | "webhook";
76
52
  id: string;
77
53
  title: string;
78
- } & any) | ({
79
- type: "text" | "operation" | "model" | "tag" | "webhook";
80
- id: string;
81
- title: string;
82
54
  } & {
83
55
  type: "webhook";
84
56
  ref: string;
@@ -92,6 +64,34 @@ export declare const traverseDocument: (document: OpenApiDocument, { hideModels,
92
64
  type: "text" | "operation" | "model" | "tag" | "webhook";
93
65
  id: string;
94
66
  title: string;
67
+ } & {
68
+ children?: {
69
+ type: "text" | "operation" | "model" | "tag" | "webhook";
70
+ id: string;
71
+ title: string;
72
+ }[] | undefined;
73
+ type: "text";
74
+ }) | ({
75
+ type: "text" | "operation" | "model" | "tag" | "webhook";
76
+ id: string;
77
+ title: string;
78
+ } & {
79
+ type: "operation";
80
+ ref: string;
81
+ method: string;
82
+ path: string;
83
+ }) | ({
84
+ type: "text" | "operation" | "model" | "tag" | "webhook";
85
+ id: string;
86
+ title: string;
87
+ } & {
88
+ type: "model";
89
+ ref: string;
90
+ name: string;
91
+ }) | ({
92
+ type: "text" | "operation" | "model" | "tag" | "webhook";
93
+ id: string;
94
+ title: string;
95
95
  } & {
96
96
  type: "webhook";
97
97
  ref: string;
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-document.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-document.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAE7E;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,aACjB,eAAe,mHAUtB,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+ChC,CAAA"}
1
+ {"version":3,"file":"traverse-document.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAQ7E;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,eAAe,EACzB,iHASG,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+ChC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/navigation/helpers/traverse-document.ts"],
4
- "sourcesContent": ["import type { TraversedEntry } from '@/schemas/navigation'\nimport { traverseDescription } from './traverse-description'\nimport { traversePaths } from './traverse-paths'\nimport { traverseSchemas } from './traverse-schemas'\nimport { traverseTags } from './traverse-tags'\nimport { traverseWebhooks } from './traverse-webhooks'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { OpenApiDocument } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Traverses an OpenAPI Document to generate navigation structure and metadata.\n *\n * This function processes the OpenAPI document to create:\n * - A hierarchical navigation structure for the sidebar\n * - A mapping of IDs to titles for mobile header navigation\n * - Tag-based organization of operations and webhooks\n * - Optional schema/model documentation\n */\nexport const traverseDocument = (\n document: OpenApiDocument,\n {\n hideModels = false,\n tagsSorter = 'alpha',\n operationsSorter = 'alpha',\n getHeadingId = (heading) => heading.value,\n getOperationId = (operation) => operation.summary ?? '',\n getWebhookId = (webhook) => webhook?.name ?? 'webhooks',\n getModelId = (model) => model?.name ?? '',\n getTagId = (tag) => tag.name ?? '',\n }: Partial<TraverseSpecOptions>,\n) => {\n /** Map it ID to title for the mobile header */\n const titles = new Map<string, string>()\n\n /** Map of tags and their entries */\n const tagsMap: TagsMap = new Map(\n document.tags?.map((tag) => [tag.name ?? 'Untitled Tag', { tag, entries: [] }]) ?? [],\n )\n\n const entries: TraversedEntry[] = traverseDescription(document.info?.description, titles, getHeadingId)\n traversePaths(document, tagsMap, titles, getOperationId)\n const untaggedWebhooks = traverseWebhooks(document, tagsMap, titles, getWebhookId)\n const tagsEntries = traverseTags(document, tagsMap, titles, {\n getTagId,\n tagsSorter,\n operationsSorter,\n })\n\n // Add tagged operations, webhooks and tagGroups\n entries.push(...tagsEntries)\n\n // Add untagged webhooks\n if (untaggedWebhooks.length) {\n entries.push({\n id: getWebhookId({ name: '' }),\n title: 'Webhooks',\n children: untaggedWebhooks,\n type: 'text',\n })\n }\n\n // Add models if they are not hidden\n if (!hideModels && document.components?.schemas) {\n const untaggedModels = traverseSchemas(document, tagsMap, titles, getModelId)\n\n if (untaggedModels.length) {\n entries.push({\n id: getModelId({}),\n title: 'Models',\n children: untaggedModels,\n type: 'text',\n })\n }\n }\n\n return { entries, titles }\n}\n"],
5
- "mappings": "AACA,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAa1B,MAAM,mBAAmB,CAC9B,UACA;AAAA,EACE,aAAa;AAAA,EACb,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,eAAe,CAAC,YAAY,QAAQ;AAAA,EACpC,iBAAiB,CAAC,cAAc,UAAU,WAAW;AAAA,EACrD,eAAe,CAAC,YAAY,SAAS,QAAQ;AAAA,EAC7C,aAAa,CAAC,UAAU,OAAO,QAAQ;AAAA,EACvC,WAAW,CAAC,QAAQ,IAAI,QAAQ;AAClC,MACG;AAEH,QAAM,SAAS,oBAAI,IAAoB;AAGvC,QAAM,UAAmB,IAAI;AAAA,IAC3B,SAAS,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,QAAQ,gBAAgB,EAAE,KAAK,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC;AAAA,EACtF;AAEA,QAAM,UAA4B,oBAAoB,SAAS,MAAM,aAAa,QAAQ,YAAY;AACtG,gBAAc,UAAU,SAAS,QAAQ,cAAc;AACvD,QAAM,mBAAmB,iBAAiB,UAAU,SAAS,QAAQ,YAAY;AACjF,QAAM,cAAc,aAAa,UAAU,SAAS,QAAQ;AAAA,IAC1D;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAGD,UAAQ,KAAK,GAAG,WAAW;AAG3B,MAAI,iBAAiB,QAAQ;AAC3B,YAAQ,KAAK;AAAA,MACX,IAAI,aAAa,EAAE,MAAM,GAAG,CAAC;AAAA,MAC7B,OAAO;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAGA,MAAI,CAAC,cAAc,SAAS,YAAY,SAAS;AAC/C,UAAM,iBAAiB,gBAAgB,UAAU,SAAS,QAAQ,UAAU;AAE5E,QAAI,eAAe,QAAQ;AACzB,cAAQ,KAAK;AAAA,QACX,IAAI,WAAW,CAAC,CAAC;AAAA,QACjB,OAAO;AAAA,QACP,UAAU;AAAA,QACV,MAAM;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,OAAO;AAC3B;",
4
+ "sourcesContent": ["import type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { TraversedEntry } from '@/schemas/navigation'\nimport type { OpenApiDocument } from '@/schemas/v3.1/strict/openapi-document'\n\nimport { traverseDescription } from './traverse-description'\nimport { traversePaths } from './traverse-paths'\nimport { traverseSchemas } from './traverse-schemas'\nimport { traverseTags } from './traverse-tags'\nimport { traverseWebhooks } from './traverse-webhooks'\n\n/**\n * Traverses an OpenAPI Document to generate navigation structure and metadata.\n *\n * This function processes the OpenAPI document to create:\n * - A hierarchical navigation structure for the sidebar\n * - A mapping of IDs to titles for mobile header navigation\n * - Tag-based organization of operations and webhooks\n * - Optional schema/model documentation\n */\nexport const traverseDocument = (\n document: OpenApiDocument,\n {\n hideModels = false,\n tagsSorter = 'alpha',\n operationsSorter = 'alpha',\n getHeadingId = (heading) => heading.value,\n getOperationId = (operation) => operation.summary ?? '',\n getWebhookId = (webhook) => webhook?.name ?? 'webhooks',\n getModelId = (model) => model?.name ?? '',\n getTagId = (tag) => tag.name ?? '',\n }: Partial<TraverseSpecOptions>,\n) => {\n /** Map it ID to title for the mobile header */\n const titles = new Map<string, string>()\n\n /** Map of tags and their entries */\n const tagsMap: TagsMap = new Map(\n document.tags?.map((tag) => [tag.name ?? 'Untitled Tag', { tag, entries: [] }]) ?? [],\n )\n\n const entries: TraversedEntry[] = traverseDescription(document.info?.description, titles, getHeadingId)\n traversePaths(document, tagsMap, titles, getOperationId)\n const untaggedWebhooks = traverseWebhooks(document, tagsMap, titles, getWebhookId)\n const tagsEntries = traverseTags(document, tagsMap, titles, {\n getTagId,\n tagsSorter,\n operationsSorter,\n })\n\n // Add tagged operations, webhooks and tagGroups\n entries.push(...tagsEntries)\n\n // Add untagged webhooks\n if (untaggedWebhooks.length) {\n entries.push({\n id: getWebhookId({ name: '' }),\n title: 'Webhooks',\n children: untaggedWebhooks,\n type: 'text',\n })\n }\n\n // Add models if they are not hidden\n if (!hideModels && document.components?.schemas) {\n const untaggedModels = traverseSchemas(document, tagsMap, titles, getModelId)\n\n if (untaggedModels.length) {\n entries.push({\n id: getModelId({}),\n title: 'Models',\n children: untaggedModels,\n type: 'text',\n })\n }\n }\n\n return { entries, titles }\n}\n"],
5
+ "mappings": "AAIA,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAW1B,MAAM,mBAAmB,CAC9B,UACA;AAAA,EACE,aAAa;AAAA,EACb,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,eAAe,CAAC,YAAY,QAAQ;AAAA,EACpC,iBAAiB,CAAC,cAAc,UAAU,WAAW;AAAA,EACrD,eAAe,CAAC,YAAY,SAAS,QAAQ;AAAA,EAC7C,aAAa,CAAC,UAAU,OAAO,QAAQ;AAAA,EACvC,WAAW,CAAC,QAAQ,IAAI,QAAQ;AAClC,MACG;AAEH,QAAM,SAAS,oBAAI,IAAoB;AAGvC,QAAM,UAAmB,IAAI;AAAA,IAC3B,SAAS,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,QAAQ,gBAAgB,EAAE,KAAK,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC;AAAA,EACtF;AAEA,QAAM,UAA4B,oBAAoB,SAAS,MAAM,aAAa,QAAQ,YAAY;AACtG,gBAAc,UAAU,SAAS,QAAQ,cAAc;AACvD,QAAM,mBAAmB,iBAAiB,UAAU,SAAS,QAAQ,YAAY;AACjF,QAAM,cAAc,aAAa,UAAU,SAAS,QAAQ;AAAA,IAC1D;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAGD,UAAQ,KAAK,GAAG,WAAW;AAG3B,MAAI,iBAAiB,QAAQ;AAC3B,YAAQ,KAAK;AAAA,MACX,IAAI,aAAa,EAAE,MAAM,GAAG,CAAC;AAAA,MAC7B,OAAO;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAGA,MAAI,CAAC,cAAc,SAAS,YAAY,SAAS;AAC/C,UAAM,iBAAiB,gBAAgB,UAAU,SAAS,QAAQ,UAAU;AAE5E,QAAI,eAAe,QAAQ;AACzB,cAAQ,KAAK;AAAA,QACX,IAAI,WAAW,CAAC,CAAC;AAAA,QACjB,OAAO;AAAA,QACP,UAAU;AAAA,QACV,MAAM;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,OAAO;AAC3B;",
6
6
  "names": []
7
7
  }
@@ -17,5 +17,9 @@ import type { OpenApiDocument } from '../../schemas/v3.1/strict/openapi-document
17
17
  * @param getOperationId - Function to generate unique IDs for operations
18
18
  * @returns Map of tag names to arrays of traversed operations
19
19
  */
20
- export declare const traversePaths: (content: OpenApiDocument, tagsMap: TagsMap, titlesMap: Map<string, string>, getOperationId: TraverseSpecOptions["getOperationId"]) => void;
20
+ export declare const traversePaths: (content: OpenApiDocument,
21
+ /** Map of tags and their entries */
22
+ tagsMap: TagsMap,
23
+ /** Map of titles for the mobile header */
24
+ titlesMap: Map<string, string>, getOperationId: TraverseSpecOptions["getOperationId"]) => void;
21
25
  //# sourceMappingURL=traverse-paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-paths.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-paths.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AA2C7E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,YACf,eAAe,WAEf,OAAO,aAEL,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,kBACd,mBAAmB,CAAC,gBAAgB,CAAC,SAsCtD,CAAA"}
1
+ {"version":3,"file":"traverse-paths.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-paths.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEtE,OAAO,KAAK,EAAE,eAAe,EAA8B,MAAM,wCAAwC,CAAA;AAwCzG;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,eAAe;AACxB,oCAAoC;AACpC,SAAS,OAAO;AAChB,0CAA0C;AAC1C,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,gBAAgB,mBAAmB,CAAC,gBAAgB,CAAC,SAsCtD,CAAA"}
@@ -1,8 +1,8 @@
1
- import { getTag } from "./get-tag.js";
2
- import { escapeJsonPointer } from "@scalar/openapi-parser";
3
1
  import { isHttpMethod } from "@scalar/helpers/http/is-http-method";
4
- import { getResolvedRef } from "../../helpers/get-resolved-ref.js";
5
2
  import { objectKeys } from "@scalar/helpers/object/object-keys";
3
+ import { escapeJsonPointer } from "@scalar/openapi-parser";
4
+ import { getResolvedRef } from "../../helpers/get-resolved-ref.js";
5
+ import { getTag } from "./get-tag.js";
6
6
  const createOperationEntry = (ref, operation, method, path = "Unknown", tag, titlesMap, getOperationId) => {
7
7
  const id = getOperationId({ ...operation, method, path }, tag);
8
8
  const title = operation.summary?.trim() ? operation.summary : path;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/navigation/helpers/traverse-paths.ts"],
4
- "sourcesContent": ["import { getTag } from './get-tag'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport { escapeJsonPointer } from '@scalar/openapi-parser'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport type { OpenApiDocument } from '@/schemas/v3.1/strict/openapi-document'\nimport type { TagObject } from '@/schemas/v3.1/strict/tag'\nimport type { OperationObject } from '@/schemas/v3.1/strict/path-operations'\nimport type { TraversedOperation } from '@/schemas/navigation'\nimport { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\n\n/**\n * Creates a traversed operation entry from an OpenAPI operation object.\n *\n * @param ref - JSON pointer reference to the operation in the OpenAPI document\n * @param operation - The OpenAPI operation object\n * @param method - HTTP method of the operation\n * @param path - API path of the operation, defaults to 'Unknown'\n * @param tag - Tag object associated with the operation\n * @param titlesMap - Map to store operation IDs and titles for mobile header navigation\n * @param getOperationId - Function to generate unique IDs for operations\n * @returns A traversed operation entry with ID, title, path, method and reference\n */\nconst createOperationEntry = (\n ref: string,\n operation: OperationObject,\n method: string,\n path = 'Unknown',\n tag: TagObject,\n titlesMap: Map<string, string>,\n getOperationId: TraverseSpecOptions['getOperationId'],\n): TraversedOperation => {\n const id = getOperationId({ ...operation, method, path }, tag)\n const title = operation.summary?.trim() ? operation.summary : path\n\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n path,\n method,\n ref,\n type: 'operation',\n }\n}\n\n/**\n * Traverses the paths in an OpenAPI document to build a map of operations organized by tags.\n *\n * This function processes each path and its operations to:\n * - Filter out internal operations (marked with x-internal) and operations to ignore (marked with x-scalar-ignore)\n * - Group operations by their tags\n * - Create a default tag group for untagged operations\n * - Generate unique references and IDs for each operation\n *\n * TODO: filter out internal and scalar-ignore tags\n *\n * @param content - The OpenAPI document to traverse\n * @param tagsDict - Dictionary mapping tag names to their OpenAPI tag objects\n * @param titlesMap - Map to store operation IDs and titles for mobile header navigation\n * @param getOperationId - Function to generate unique IDs for operations\n * @returns Map of tag names to arrays of traversed operations\n */\nexport const traversePaths = (\n content: OpenApiDocument,\n /** Map of tags and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile header */\n titlesMap: Map<string, string>,\n getOperationId: TraverseSpecOptions['getOperationId'],\n) => {\n // Traverse paths\n Object.entries(content.paths ?? {}).forEach(([path, pathItemObject]) => {\n const pathKeys = objectKeys(pathItemObject ?? {}).filter((key) => isHttpMethod(key))\n\n pathKeys.forEach((method) => {\n const _operation = pathItemObject?.[method]\n const operation = getResolvedRef(_operation)\n if (!operation) {\n return\n }\n\n // Skip if the operation is internal or scalar-ignore\n if (operation['x-internal'] || operation['x-scalar-ignore'] || !isHttpMethod(method)) {\n return\n }\n\n const ref = `#/paths/${escapeJsonPointer(path)}/${method}`\n\n // Traverse tags\n if (operation.tags?.length) {\n operation.tags.forEach((tagName: string) => {\n const { tag } = getTag(tagsMap, tagName)\n tagsMap\n .get(tagName)\n ?.entries.push(createOperationEntry(ref, operation, method, path, tag, titlesMap, getOperationId))\n })\n }\n // Add to default tag\n else {\n const { tag } = getTag(tagsMap, 'default')\n tagsMap\n .get('default')\n ?.entries.push(createOperationEntry(ref, operation, method, path, tag, titlesMap, getOperationId))\n }\n })\n })\n}\n"],
5
- "mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAK7B,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAc3B,MAAM,uBAAuB,CAC3B,KACA,WACA,QACA,OAAO,WACP,KACA,WACA,mBACuB;AACvB,QAAM,KAAK,eAAe,EAAE,GAAG,WAAW,QAAQ,KAAK,GAAG,GAAG;AAC7D,QAAM,QAAQ,UAAU,SAAS,KAAK,IAAI,UAAU,UAAU;AAE9D,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAmBO,MAAM,gBAAgB,CAC3B,SAEA,SAEA,WACA,mBACG;AAEH,SAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,cAAc,MAAM;AACtE,UAAM,WAAW,WAAW,kBAAkB,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,aAAa,GAAG,CAAC;AAEnF,aAAS,QAAQ,CAAC,WAAW;AAC3B,YAAM,aAAa,iBAAiB,MAAM;AAC1C,YAAM,YAAY,eAAe,UAAU;AAC3C,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAGA,UAAI,UAAU,YAAY,KAAK,UAAU,iBAAiB,KAAK,CAAC,aAAa,MAAM,GAAG;AACpF;AAAA,MACF;AAEA,YAAM,MAAM,WAAW,kBAAkB,IAAI,CAAC,IAAI,MAAM;AAGxD,UAAI,UAAU,MAAM,QAAQ;AAC1B,kBAAU,KAAK,QAAQ,CAAC,YAAoB;AAC1C,gBAAM,EAAE,IAAI,IAAI,OAAO,SAAS,OAAO;AACvC,kBACG,IAAI,OAAO,GACV,QAAQ,KAAK,qBAAqB,KAAK,WAAW,QAAQ,MAAM,KAAK,WAAW,cAAc,CAAC;AAAA,QACrG,CAAC;AAAA,MACH,OAEK;AACH,cAAM,EAAE,IAAI,IAAI,OAAO,SAAS,SAAS;AACzC,gBACG,IAAI,SAAS,GACZ,QAAQ,KAAK,qBAAqB,KAAK,WAAW,QAAQ,MAAM,KAAK,WAAW,cAAc,CAAC;AAAA,MACrG;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;",
4
+ "sourcesContent": ["import { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { escapeJsonPointer } from '@scalar/openapi-parser'\n\nimport { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { TraversedOperation } from '@/schemas/navigation'\nimport type { OpenApiDocument, OperationObject, TagObject } from '@/schemas/v3.1/strict/openapi-document'\n\nimport { getTag } from './get-tag'\n\n/**\n * Creates a traversed operation entry from an OpenAPI operation object.\n *\n * @param ref - JSON pointer reference to the operation in the OpenAPI document\n * @param operation - The OpenAPI operation object\n * @param method - HTTP method of the operation\n * @param path - API path of the operation, defaults to 'Unknown'\n * @param tag - Tag object associated with the operation\n * @param titlesMap - Map to store operation IDs and titles for mobile header navigation\n * @param getOperationId - Function to generate unique IDs for operations\n * @returns A traversed operation entry with ID, title, path, method and reference\n */\nconst createOperationEntry = (\n ref: string,\n operation: OperationObject,\n method: string,\n path = 'Unknown',\n tag: TagObject,\n titlesMap: Map<string, string>,\n getOperationId: TraverseSpecOptions['getOperationId'],\n): TraversedOperation => {\n const id = getOperationId({ ...operation, method, path }, tag)\n const title = operation.summary?.trim() ? operation.summary : path\n\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n path,\n method,\n ref,\n type: 'operation',\n }\n}\n\n/**\n * Traverses the paths in an OpenAPI document to build a map of operations organized by tags.\n *\n * This function processes each path and its operations to:\n * - Filter out internal operations (marked with x-internal) and operations to ignore (marked with x-scalar-ignore)\n * - Group operations by their tags\n * - Create a default tag group for untagged operations\n * - Generate unique references and IDs for each operation\n *\n * TODO: filter out internal and scalar-ignore tags\n *\n * @param content - The OpenAPI document to traverse\n * @param tagsDict - Dictionary mapping tag names to their OpenAPI tag objects\n * @param titlesMap - Map to store operation IDs and titles for mobile header navigation\n * @param getOperationId - Function to generate unique IDs for operations\n * @returns Map of tag names to arrays of traversed operations\n */\nexport const traversePaths = (\n content: OpenApiDocument,\n /** Map of tags and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile header */\n titlesMap: Map<string, string>,\n getOperationId: TraverseSpecOptions['getOperationId'],\n) => {\n // Traverse paths\n Object.entries(content.paths ?? {}).forEach(([path, pathItemObject]) => {\n const pathKeys = objectKeys(pathItemObject ?? {}).filter((key) => isHttpMethod(key))\n\n pathKeys.forEach((method) => {\n const _operation = pathItemObject?.[method]\n const operation = getResolvedRef(_operation)\n if (!operation) {\n return\n }\n\n // Skip if the operation is internal or scalar-ignore\n if (operation['x-internal'] || operation['x-scalar-ignore'] || !isHttpMethod(method)) {\n return\n }\n\n const ref = `#/paths/${escapeJsonPointer(path)}/${method}`\n\n // Traverse tags\n if (operation.tags?.length) {\n operation.tags.forEach((tagName: string) => {\n const { tag } = getTag(tagsMap, tagName)\n tagsMap\n .get(tagName)\n ?.entries.push(createOperationEntry(ref, operation, method, path, tag, titlesMap, getOperationId))\n })\n }\n // Add to default tag\n else {\n const { tag } = getTag(tagsMap, 'default')\n tagsMap\n .get('default')\n ?.entries.push(createOperationEntry(ref, operation, method, path, tag, titlesMap, getOperationId))\n }\n })\n })\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAElC,SAAS,sBAAsB;AAK/B,SAAS,cAAc;AAcvB,MAAM,uBAAuB,CAC3B,KACA,WACA,QACA,OAAO,WACP,KACA,WACA,mBACuB;AACvB,QAAM,KAAK,eAAe,EAAE,GAAG,WAAW,QAAQ,KAAK,GAAG,GAAG;AAC7D,QAAM,QAAQ,UAAU,SAAS,KAAK,IAAI,UAAU,UAAU;AAE9D,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAmBO,MAAM,gBAAgB,CAC3B,SAEA,SAEA,WACA,mBACG;AAEH,SAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,cAAc,MAAM;AACtE,UAAM,WAAW,WAAW,kBAAkB,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,aAAa,GAAG,CAAC;AAEnF,aAAS,QAAQ,CAAC,WAAW;AAC3B,YAAM,aAAa,iBAAiB,MAAM;AAC1C,YAAM,YAAY,eAAe,UAAU;AAC3C,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAGA,UAAI,UAAU,YAAY,KAAK,UAAU,iBAAiB,KAAK,CAAC,aAAa,MAAM,GAAG;AACpF;AAAA,MACF;AAEA,YAAM,MAAM,WAAW,kBAAkB,IAAI,CAAC,IAAI,MAAM;AAGxD,UAAI,UAAU,MAAM,QAAQ;AAC1B,kBAAU,KAAK,QAAQ,CAAC,YAAoB;AAC1C,gBAAM,EAAE,IAAI,IAAI,OAAO,SAAS,OAAO;AACvC,kBACG,IAAI,OAAO,GACV,QAAQ,KAAK,qBAAqB,KAAK,WAAW,QAAQ,MAAM,KAAK,WAAW,cAAc,CAAC;AAAA,QACrG,CAAC;AAAA,MACH,OAEK;AACH,cAAM,EAAE,IAAI,IAAI,OAAO,SAAS,SAAS;AACzC,gBACG,IAAI,SAAS,GACZ,QAAQ,KAAK,qBAAqB,KAAK,WAAW,QAAQ,MAAM,KAAK,WAAW,cAAc,CAAC;AAAA,MACrG;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -13,5 +13,9 @@ import type { OpenApiDocument } from '../../schemas/v3.1/strict/openapi-document
13
13
  * @param getModelId - Function to generate unique IDs for schemas
14
14
  * @returns Array of traversed schema entries
15
15
  */
16
- export declare const traverseSchemas: (content: OpenApiDocument, tagsMap: TagsMap, titlesMap: Map<string, string>, getModelId: TraverseSpecOptions["getModelId"]) => TraversedSchema[];
16
+ export declare const traverseSchemas: (content: OpenApiDocument,
17
+ /** Map of tagNames and their entries */
18
+ tagsMap: TagsMap,
19
+ /** Map of titles for the mobile header */
20
+ titlesMap: Map<string, string>, getModelId: TraverseSpecOptions["getModelId"]) => TraversedSchema[];
17
21
  //# sourceMappingURL=traverse-schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-schemas.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-schemas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAsC7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,YACjB,eAAe,WAEf,OAAO,aAEL,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAClB,mBAAmB,CAAC,YAAY,CAAC,KAC5C,eAAe,EA4BjB,CAAA"}
1
+ {"version":3,"file":"traverse-schemas.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-schemas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,wCAAwC,CAAA;AAoCtG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,eAAe;AACxB,wCAAwC;AACxC,SAAS,OAAO;AAChB,0CAA0C;AAC1C,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,YAAY,mBAAmB,CAAC,YAAY,CAAC,KAC5C,eAAe,EA4BjB,CAAA"}
@@ -3,7 +3,7 @@ import { getTag } from "../../navigation/helpers/get-tag.js";
3
3
  const createSchemaEntry = (ref, name = "Unknown", titlesMap, getModelId, tag, _schema) => {
4
4
  const id = getModelId({ name }, tag);
5
5
  const schema = getResolvedRef(_schema);
6
- const title = schema?.title || name;
6
+ const title = schema && "title" in schema && schema.title || name;
7
7
  titlesMap.set(id, title);
8
8
  return {
9
9
  id,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/navigation/helpers/traverse-schemas.ts"],
4
- "sourcesContent": ["import { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport { getTag } from '@/navigation/helpers/get-tag'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { TraversedSchema } from '@/schemas/navigation'\nimport type { OpenApiDocument } from '@/schemas/v3.1/strict/openapi-document'\nimport type { SchemaObject } from '@/schemas/v3.1/strict/schema'\nimport type { TagObject } from '@/schemas/v3.1/strict/tag'\n\n/** Creates a traversed schema entry from an OpenAPI schema object.\n *\n * @param ref - JSON pointer reference to the schema in the OpenAPI document\n * @param name - Name of the schema, defaults to 'Unknown'\n * @param titlesMap - Map to store schema IDs and titles for mobile header navigation\n * @param getModelId - Function to generate unique IDs for schemas\n * @returns A traversed schema entry with ID, title, name and reference\n */\nconst createSchemaEntry = (\n ref: string,\n name = 'Unknown',\n titlesMap: Map<string, string>,\n getModelId: TraverseSpecOptions['getModelId'],\n tag?: TagObject,\n _schema?: SchemaObject,\n): TraversedSchema => {\n const id = getModelId({ name }, tag)\n const schema = getResolvedRef(_schema)\n\n // Use schema.title if available, otherwise fall back to name\n // @see https://json-schema.org/draft/2020-12/json-schema-core#section-4.3.5\n const title = (schema?.title as string) || name\n\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n name,\n ref,\n type: 'model',\n }\n}\n\n/** Traverses the schemas in an OpenAPI document to build an array of model entries.\n *\n * This function processes each schema in components.schemas to:\n * - Filter out internal schemas (marked with x-internal) and schemas to ignore (marked with x-scalar-ignore)\n * - Create model entries with unique references and IDs\n * - Store model IDs and titles for mobile header navigation\n *\n * @param content - The OpenAPI document to traverse\n * @param titlesMap - Map to store schema IDs and titles for mobile header navigation\n * @param getModelId - Function to generate unique IDs for schemas\n * @returns Array of traversed schema entries\n */\nexport const traverseSchemas = (\n content: OpenApiDocument,\n /** Map of tagNames and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile header */\n titlesMap: Map<string, string>,\n getModelId: TraverseSpecOptions['getModelId'],\n): TraversedSchema[] => {\n const schemas = content.components?.schemas ?? {}\n const untagged: TraversedSchema[] = []\n\n // biome-ignore lint/nursery/useGuardForIn: we do have an if statement after de-ref\n for (const name in schemas) {\n const schema = getResolvedRef(schemas[name])\n\n if (schema?.['x-internal'] || schema?.['x-scalar-ignore'] || !Object.hasOwn(schemas, name)) {\n continue\n }\n\n const ref = `#/content/components/schemas/${name}`\n\n // Add to tags\n if (schema?.['x-tags']) {\n schema['x-tags'].forEach((tagName: string) => {\n const { tag } = getTag(tagsMap, tagName)\n tagsMap.get(tagName)?.entries.push(createSchemaEntry(ref, name, titlesMap, getModelId, tag))\n })\n }\n // Add to untagged\n else {\n untagged.push(createSchemaEntry(ref, name, titlesMap, getModelId, undefined, getResolvedRef(schemas[name])))\n }\n }\n\n return untagged\n}\n"],
5
- "mappings": "AAAA,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AAevB,MAAM,oBAAoB,CACxB,KACA,OAAO,WACP,WACA,YACA,KACA,YACoB;AACpB,QAAM,KAAK,WAAW,EAAE,KAAK,GAAG,GAAG;AACnC,QAAM,SAAS,eAAe,OAAO;AAIrC,QAAM,QAAS,QAAQ,SAAoB;AAE3C,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAcO,MAAM,kBAAkB,CAC7B,SAEA,SAEA,WACA,eACsB;AACtB,QAAM,UAAU,QAAQ,YAAY,WAAW,CAAC;AAChD,QAAM,WAA8B,CAAC;AAGrC,aAAW,QAAQ,SAAS;AAC1B,UAAM,SAAS,eAAe,QAAQ,IAAI,CAAC;AAE3C,QAAI,SAAS,YAAY,KAAK,SAAS,iBAAiB,KAAK,CAAC,OAAO,OAAO,SAAS,IAAI,GAAG;AAC1F;AAAA,IACF;AAEA,UAAM,MAAM,gCAAgC,IAAI;AAGhD,QAAI,SAAS,QAAQ,GAAG;AACtB,aAAO,QAAQ,EAAE,QAAQ,CAAC,YAAoB;AAC5C,cAAM,EAAE,IAAI,IAAI,OAAO,SAAS,OAAO;AACvC,gBAAQ,IAAI,OAAO,GAAG,QAAQ,KAAK,kBAAkB,KAAK,MAAM,WAAW,YAAY,GAAG,CAAC;AAAA,MAC7F,CAAC;AAAA,IACH,OAEK;AACH,eAAS,KAAK,kBAAkB,KAAK,MAAM,WAAW,YAAY,QAAW,eAAe,QAAQ,IAAI,CAAC,CAAC,CAAC;AAAA,IAC7G;AAAA,EACF;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport { getTag } from '@/navigation/helpers/get-tag'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { TraversedSchema } from '@/schemas/navigation'\nimport type { OpenApiDocument, SchemaObject, TagObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/** Creates a traversed schema entry from an OpenAPI schema object.\n *\n * @param ref - JSON pointer reference to the schema in the OpenAPI document\n * @param name - Name of the schema, defaults to 'Unknown'\n * @param titlesMap - Map to store schema IDs and titles for mobile header navigation\n * @param getModelId - Function to generate unique IDs for schemas\n * @returns A traversed schema entry with ID, title, name and reference\n */\nconst createSchemaEntry = (\n ref: string,\n name = 'Unknown',\n titlesMap: Map<string, string>,\n getModelId: TraverseSpecOptions['getModelId'],\n tag?: TagObject,\n _schema?: SchemaObject,\n): TraversedSchema => {\n const id = getModelId({ name }, tag)\n const schema = getResolvedRef(_schema)\n\n // Use schema.title if available, otherwise fall back to name\n // @see https://json-schema.org/draft/2020-12/json-schema-core#section-4.3.5\n const title = (schema && 'title' in schema && (schema.title as string)) || name\n\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n name,\n ref,\n type: 'model',\n }\n}\n\n/** Traverses the schemas in an OpenAPI document to build an array of model entries.\n *\n * This function processes each schema in components.schemas to:\n * - Filter out internal schemas (marked with x-internal) and schemas to ignore (marked with x-scalar-ignore)\n * - Create model entries with unique references and IDs\n * - Store model IDs and titles for mobile header navigation\n *\n * @param content - The OpenAPI document to traverse\n * @param titlesMap - Map to store schema IDs and titles for mobile header navigation\n * @param getModelId - Function to generate unique IDs for schemas\n * @returns Array of traversed schema entries\n */\nexport const traverseSchemas = (\n content: OpenApiDocument,\n /** Map of tagNames and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile header */\n titlesMap: Map<string, string>,\n getModelId: TraverseSpecOptions['getModelId'],\n): TraversedSchema[] => {\n const schemas = content.components?.schemas ?? {}\n const untagged: TraversedSchema[] = []\n\n // biome-ignore lint/suspicious/useGuardForIn: we do have an if statement after de-ref\n for (const name in schemas) {\n const schema = getResolvedRef(schemas[name])\n\n if (schema?.['x-internal'] || schema?.['x-scalar-ignore'] || !Object.hasOwn(schemas, name)) {\n continue\n }\n\n const ref = `#/content/components/schemas/${name}`\n\n // Add to tags\n if (schema?.['x-tags']) {\n schema['x-tags'].forEach((tagName: string) => {\n const { tag } = getTag(tagsMap, tagName)\n tagsMap.get(tagName)?.entries.push(createSchemaEntry(ref, name, titlesMap, getModelId, tag))\n })\n }\n // Add to untagged\n else {\n untagged.push(createSchemaEntry(ref, name, titlesMap, getModelId, undefined, getResolvedRef(schemas[name])))\n }\n }\n\n return untagged\n}\n"],
5
+ "mappings": "AAAA,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AAavB,MAAM,oBAAoB,CACxB,KACA,OAAO,WACP,WACA,YACA,KACA,YACoB;AACpB,QAAM,KAAK,WAAW,EAAE,KAAK,GAAG,GAAG;AACnC,QAAM,SAAS,eAAe,OAAO;AAIrC,QAAM,QAAS,UAAU,WAAW,UAAW,OAAO,SAAqB;AAE3E,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAcO,MAAM,kBAAkB,CAC7B,SAEA,SAEA,WACA,eACsB;AACtB,QAAM,UAAU,QAAQ,YAAY,WAAW,CAAC;AAChD,QAAM,WAA8B,CAAC;AAGrC,aAAW,QAAQ,SAAS;AAC1B,UAAM,SAAS,eAAe,QAAQ,IAAI,CAAC;AAE3C,QAAI,SAAS,YAAY,KAAK,SAAS,iBAAiB,KAAK,CAAC,OAAO,OAAO,SAAS,IAAI,GAAG;AAC1F;AAAA,IACF;AAEA,UAAM,MAAM,gCAAgC,IAAI;AAGhD,QAAI,SAAS,QAAQ,GAAG;AACtB,aAAO,QAAQ,EAAE,QAAQ,CAAC,YAAoB;AAC5C,cAAM,EAAE,IAAI,IAAI,OAAO,SAAS,OAAO;AACvC,gBAAQ,IAAI,OAAO,GAAG,QAAQ,KAAK,kBAAkB,KAAK,MAAM,WAAW,YAAY,GAAG,CAAC;AAAA,MAC7F,CAAC;AAAA,IACH,OAEK;AACH,eAAS,KAAK,kBAAkB,KAAK,MAAM,WAAW,YAAY,QAAW,eAAe,QAAQ,IAAI,CAAC,CAAC,CAAC;AAAA,IAC7G;AAAA,EACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { TagsMap, TraverseSpecOptions } from '../../navigation/types.js';
2
- import type { OpenApiDocument } from '../../schemas/v3.1/strict/openapi-document.js';
3
2
  import type { TraversedEntry } from '../../schemas/navigation.js';
3
+ import type { OpenApiDocument } from '../../schemas/v3.1/strict/openapi-document.js';
4
4
  type Options = Pick<TraverseSpecOptions, 'getTagId' | 'tagsSorter' | 'operationsSorter'>;
5
5
  /**
6
6
  * Traverses the tags map to create navigation entries, handling both grouped and ungrouped tags.
@@ -11,6 +11,10 @@ type Options = Pick<TraverseSpecOptions, 'getTagId' | 'tagsSorter' | 'operations
11
11
  * - Create navigation entries for each tag or tag group
12
12
  * - Flatten default tag entries if it's the only tag present
13
13
  */
14
- export declare const traverseTags: (content: OpenApiDocument, tagsMap: TagsMap, titlesMap: Map<string, string>, { getTagId, tagsSorter, operationsSorter }: Options) => TraversedEntry[];
14
+ export declare const traverseTags: (content: OpenApiDocument,
15
+ /** Map of tags and their entries */
16
+ tagsMap: TagsMap,
17
+ /** Map of titles for the mobile title */
18
+ titlesMap: Map<string, string>, { getTagId, tagsSorter, operationsSorter }: Options) => TraversedEntry[];
15
19
  export {};
16
20
  //# sourceMappingURL=traverse-tags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-tags.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,sBAAsB,CAAA;AAExE,KAAK,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,YAAY,GAAG,kBAAkB,CAAC,CAAA;AA2HxF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,YACd,eAAe,WAEf,OAAO,aAEL,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,8CACc,OAAO,KAClD,cAAc,EAyBhB,CAAA"}
1
+ {"version":3,"file":"traverse-tags.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,wCAAwC,CAAA;AAIxF,KAAK,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,YAAY,GAAG,kBAAkB,CAAC,CAAA;AA2HxF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,eAAe;AACxB,oCAAoC;AACpC,SAAS,OAAO;AAChB,yCAAyC;AACzC,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,4CAA4C,OAAO,KAClD,cAAc,EAyBhB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/navigation/helpers/traverse-tags.ts"],
4
- "sourcesContent": ["import type { TagObject } from '@/schemas/v3.1/strict/tag'\nimport { getTag } from './get-tag'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { OpenApiDocument } from '@/schemas/v3.1/strict/openapi-document'\nimport type { TraversedEntry, TraversedTag } from '@/schemas/navigation'\n\ntype Options = Pick<TraverseSpecOptions, 'getTagId' | 'tagsSorter' | 'operationsSorter'>\n\n/** Creates a traversed tag entry from an OpenAPI tag object.\n *\n * @param tag - The OpenAPI tag object\n * @param titlesMap - Map to store tag IDs and titles for mobile header navigation\n * @param getTagId - Function to generate unique IDs for tags\n * @param children - Array of child entries (operations, webhooks, etc.)\n * @param isGroup - Whether this tag represents a group of tags\n * @returns A traversed tag entry with ID, title, name and children\n */\nconst createTagEntry = (\n tag: TagObject,\n titlesMap: Map<string, string>,\n getTagId: TraverseSpecOptions['getTagId'],\n children: TraversedEntry[],\n isGroup = false,\n): TraversedTag => {\n const id = getTagId(tag)\n const title = tag['x-displayName'] ?? tag.name ?? 'Untitled Tag'\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n name: tag.name || title,\n children,\n isGroup,\n type: 'tag',\n }\n}\n\n/** Sorts and processes tags to create a hierarchical structure of tag entries.\n *\n * This function handles:\n * - Sorting tags alphabetically or using a custom sort function\n * - Ensuring the default tag appears last\n * - Sorting operations within tags by title, method, or custom function\n * - Filtering out internal and ignored tags\n * - Creating tag entries with their associated operations\n *\n * @param _keys - Array of tag keys to process\n * @param tagsMap - Map of tags and their entries\n * @param tagsDict - Dictionary of OpenAPI tags by name\n * @param titlesMap - Map of titles for the mobile header\n * @param options - Sorting and ID generation options\n * @returns Array of processed and sorted tag entries\n */\n/** Sorts tags and returns entries */\nconst getSortedTagEntries = (\n _keys: string[],\n /** Map of tags and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile header */\n titlesMap: Map<string, string>,\n { getTagId, tagsSorter, operationsSorter }: Options,\n) => {\n // Ensure that default is last if it exists\n const hasDefault = _keys.includes('default')\n const keys = hasDefault ? _keys.filter((key) => key !== 'default') : _keys\n\n // Alpha sort\n if (tagsSorter === 'alpha') {\n keys.sort((a, b) => {\n const nameA = getTag(tagsMap, a).tag['x-displayName'] || a || 'Untitled Tag'\n const nameB = getTag(tagsMap, b).tag['x-displayName'] || b || 'Untitled Tag'\n return nameA.localeCompare(nameB)\n })\n }\n // Custom sort\n else if (typeof tagsSorter === 'function') {\n keys.sort((a, b) => tagsSorter(getTag(tagsMap, a).tag, getTag(tagsMap, b).tag))\n }\n\n if (hasDefault) {\n keys.push('default')\n }\n\n /**\n * Process each tag and its entries:\n * - Skip internal and ignored tags\n * - Sort operations within tags\n * - Create tag entries with sorted operations\n */\n return keys.flatMap((key) => {\n const { tag, entries } = getTag(tagsMap, key)\n\n // Skip if the tag is internal or scalar-ignore\n if (tag['x-internal'] || tag['x-scalar-ignore']) {\n return []\n }\n\n // Alpha sort\n if (operationsSorter === 'alpha') {\n entries.sort((a, b) => ('method' in a && 'method' in b ? a.title.localeCompare(b.title) : 0))\n }\n // Method sort\n else if (operationsSorter === 'method') {\n entries.sort((a, b) => ('method' in a && 'method' in b ? a.method.localeCompare(b.method) : 0))\n }\n // Custom sort\n else if (typeof operationsSorter === 'function') {\n entries.sort((a, b) => {\n // Guard against tags\n if ((a.type !== 'operation' && a.type !== 'webhook') || (b.type !== 'operation' && b.type !== 'webhook')) {\n return 0\n }\n\n // Handle webhooks as well as operations\n const pathA = a.type === 'operation' ? a.path : a.name\n const pathB = b.type === 'operation' ? b.path : b.name\n\n return operationsSorter(\n { method: a.method, path: pathA, ref: a.ref, httpVerb: a.method },\n { method: b.method, path: pathB, ref: b.ref, httpVerb: b.method },\n )\n })\n }\n\n return entries.length ? createTagEntry(tag, titlesMap, getTagId, entries) : []\n })\n}\n\n/**\n * Traverses the tags map to create navigation entries, handling both grouped and ungrouped tags.\n *\n * This function processes the OpenAPI document's tags to:\n * - Handle tag groups if specified via x-tagGroups\n * - Sort tags and their operations according to provided sorters\n * - Create navigation entries for each tag or tag group\n * - Flatten default tag entries if it's the only tag present\n */\nexport const traverseTags = (\n content: OpenApiDocument,\n /** Map of tags and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile title */\n titlesMap: Map<string, string>,\n { getTagId, tagsSorter, operationsSorter }: Options,\n): TraversedEntry[] => {\n // x-tagGroups\n if (content['x-tagGroups']) {\n const tagGroups = content['x-tagGroups']\n\n return tagGroups.flatMap((tagGroup) => {\n const entries = getSortedTagEntries(tagGroup.tags ?? [], tagsMap, titlesMap, {\n getTagId,\n tagsSorter,\n operationsSorter,\n })\n return entries.length ? createTagEntry(tagGroup, titlesMap, getTagId, entries, true) : []\n })\n }\n\n // Ungrouped regular tags\n const keys = Array.from(tagsMap.keys())\n const tags = getSortedTagEntries(keys, tagsMap, titlesMap, { getTagId, tagsSorter, operationsSorter })\n\n // Flatten if we only have default tag\n if (tags.length === 1 && tags[0]?.title === 'default') {\n return tags[0]?.children ?? []\n }\n\n return tags\n}\n"],
5
- "mappings": "AACA,SAAS,cAAc;AAgBvB,MAAM,iBAAiB,CACrB,KACA,WACA,UACA,UACA,UAAU,UACO;AACjB,QAAM,KAAK,SAAS,GAAG;AACvB,QAAM,QAAQ,IAAI,eAAe,KAAK,IAAI,QAAQ;AAClD,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,MAAM,IAAI,QAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAmBA,MAAM,sBAAsB,CAC1B,OAEA,SAEA,WACA,EAAE,UAAU,YAAY,iBAAiB,MACtC;AAEH,QAAM,aAAa,MAAM,SAAS,SAAS;AAC3C,QAAM,OAAO,aAAa,MAAM,OAAO,CAAC,QAAQ,QAAQ,SAAS,IAAI;AAGrE,MAAI,eAAe,SAAS;AAC1B,SAAK,KAAK,CAAC,GAAG,MAAM;AAClB,YAAM,QAAQ,OAAO,SAAS,CAAC,EAAE,IAAI,eAAe,KAAK,KAAK;AAC9D,YAAM,QAAQ,OAAO,SAAS,CAAC,EAAE,IAAI,eAAe,KAAK,KAAK;AAC9D,aAAO,MAAM,cAAc,KAAK;AAAA,IAClC,CAAC;AAAA,EACH,WAES,OAAO,eAAe,YAAY;AACzC,SAAK,KAAK,CAAC,GAAG,MAAM,WAAW,OAAO,SAAS,CAAC,EAAE,KAAK,OAAO,SAAS,CAAC,EAAE,GAAG,CAAC;AAAA,EAChF;AAEA,MAAI,YAAY;AACd,SAAK,KAAK,SAAS;AAAA,EACrB;AAQA,SAAO,KAAK,QAAQ,CAAC,QAAQ;AAC3B,UAAM,EAAE,KAAK,QAAQ,IAAI,OAAO,SAAS,GAAG;AAG5C,QAAI,IAAI,YAAY,KAAK,IAAI,iBAAiB,GAAG;AAC/C,aAAO,CAAC;AAAA,IACV;AAGA,QAAI,qBAAqB,SAAS;AAChC,cAAQ,KAAK,CAAC,GAAG,MAAO,YAAY,KAAK,YAAY,IAAI,EAAE,MAAM,cAAc,EAAE,KAAK,IAAI,CAAE;AAAA,IAC9F,WAES,qBAAqB,UAAU;AACtC,cAAQ,KAAK,CAAC,GAAG,MAAO,YAAY,KAAK,YAAY,IAAI,EAAE,OAAO,cAAc,EAAE,MAAM,IAAI,CAAE;AAAA,IAChG,WAES,OAAO,qBAAqB,YAAY;AAC/C,cAAQ,KAAK,CAAC,GAAG,MAAM;AAErB,YAAK,EAAE,SAAS,eAAe,EAAE,SAAS,aAAe,EAAE,SAAS,eAAe,EAAE,SAAS,WAAY;AACxG,iBAAO;AAAA,QACT;AAGA,cAAM,QAAQ,EAAE,SAAS,cAAc,EAAE,OAAO,EAAE;AAClD,cAAM,QAAQ,EAAE,SAAS,cAAc,EAAE,OAAO,EAAE;AAElD,eAAO;AAAA,UACL,EAAE,QAAQ,EAAE,QAAQ,MAAM,OAAO,KAAK,EAAE,KAAK,UAAU,EAAE,OAAO;AAAA,UAChE,EAAE,QAAQ,EAAE,QAAQ,MAAM,OAAO,KAAK,EAAE,KAAK,UAAU,EAAE,OAAO;AAAA,QAClE;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO,QAAQ,SAAS,eAAe,KAAK,WAAW,UAAU,OAAO,IAAI,CAAC;AAAA,EAC/E,CAAC;AACH;AAWO,MAAM,eAAe,CAC1B,SAEA,SAEA,WACA,EAAE,UAAU,YAAY,iBAAiB,MACpB;AAErB,MAAI,QAAQ,aAAa,GAAG;AAC1B,UAAM,YAAY,QAAQ,aAAa;AAEvC,WAAO,UAAU,QAAQ,CAAC,aAAa;AACrC,YAAM,UAAU,oBAAoB,SAAS,QAAQ,CAAC,GAAG,SAAS,WAAW;AAAA,QAC3E;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AACD,aAAO,QAAQ,SAAS,eAAe,UAAU,WAAW,UAAU,SAAS,IAAI,IAAI,CAAC;AAAA,IAC1F,CAAC;AAAA,EACH;AAGA,QAAM,OAAO,MAAM,KAAK,QAAQ,KAAK,CAAC;AACtC,QAAM,OAAO,oBAAoB,MAAM,SAAS,WAAW,EAAE,UAAU,YAAY,iBAAiB,CAAC;AAGrG,MAAI,KAAK,WAAW,KAAK,KAAK,CAAC,GAAG,UAAU,WAAW;AACrD,WAAO,KAAK,CAAC,GAAG,YAAY,CAAC;AAAA,EAC/B;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { TraversedEntry, TraversedTag } from '@/schemas/navigation'\nimport type { OpenApiDocument, TagObject } from '@/schemas/v3.1/strict/openapi-document'\n\nimport { getTag } from './get-tag'\n\ntype Options = Pick<TraverseSpecOptions, 'getTagId' | 'tagsSorter' | 'operationsSorter'>\n\n/** Creates a traversed tag entry from an OpenAPI tag object.\n *\n * @param tag - The OpenAPI tag object\n * @param titlesMap - Map to store tag IDs and titles for mobile header navigation\n * @param getTagId - Function to generate unique IDs for tags\n * @param children - Array of child entries (operations, webhooks, etc.)\n * @param isGroup - Whether this tag represents a group of tags\n * @returns A traversed tag entry with ID, title, name and children\n */\nconst createTagEntry = (\n tag: TagObject,\n titlesMap: Map<string, string>,\n getTagId: TraverseSpecOptions['getTagId'],\n children: TraversedEntry[],\n isGroup = false,\n): TraversedTag => {\n const id = getTagId(tag)\n const title = tag['x-displayName'] ?? tag.name ?? 'Untitled Tag'\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n name: tag.name || title,\n children,\n isGroup,\n type: 'tag',\n }\n}\n\n/** Sorts and processes tags to create a hierarchical structure of tag entries.\n *\n * This function handles:\n * - Sorting tags alphabetically or using a custom sort function\n * - Ensuring the default tag appears last\n * - Sorting operations within tags by title, method, or custom function\n * - Filtering out internal and ignored tags\n * - Creating tag entries with their associated operations\n *\n * @param _keys - Array of tag keys to process\n * @param tagsMap - Map of tags and their entries\n * @param tagsDict - Dictionary of OpenAPI tags by name\n * @param titlesMap - Map of titles for the mobile header\n * @param options - Sorting and ID generation options\n * @returns Array of processed and sorted tag entries\n */\n/** Sorts tags and returns entries */\nconst getSortedTagEntries = (\n _keys: string[],\n /** Map of tags and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile header */\n titlesMap: Map<string, string>,\n { getTagId, tagsSorter, operationsSorter }: Options,\n) => {\n // Ensure that default is last if it exists\n const hasDefault = _keys.includes('default')\n const keys = hasDefault ? _keys.filter((key) => key !== 'default') : _keys\n\n // Alpha sort\n if (tagsSorter === 'alpha') {\n keys.sort((a, b) => {\n const nameA = getTag(tagsMap, a).tag['x-displayName'] || a || 'Untitled Tag'\n const nameB = getTag(tagsMap, b).tag['x-displayName'] || b || 'Untitled Tag'\n return nameA.localeCompare(nameB)\n })\n }\n // Custom sort\n else if (typeof tagsSorter === 'function') {\n keys.sort((a, b) => tagsSorter(getTag(tagsMap, a).tag, getTag(tagsMap, b).tag))\n }\n\n if (hasDefault) {\n keys.push('default')\n }\n\n /**\n * Process each tag and its entries:\n * - Skip internal and ignored tags\n * - Sort operations within tags\n * - Create tag entries with sorted operations\n */\n return keys.flatMap((key) => {\n const { tag, entries } = getTag(tagsMap, key)\n\n // Skip if the tag is internal or scalar-ignore\n if (tag['x-internal'] || tag['x-scalar-ignore']) {\n return []\n }\n\n // Alpha sort\n if (operationsSorter === 'alpha') {\n entries.sort((a, b) => ('method' in a && 'method' in b ? a.title.localeCompare(b.title) : 0))\n }\n // Method sort\n else if (operationsSorter === 'method') {\n entries.sort((a, b) => ('method' in a && 'method' in b ? a.method.localeCompare(b.method) : 0))\n }\n // Custom sort\n else if (typeof operationsSorter === 'function') {\n entries.sort((a, b) => {\n // Guard against tags\n if ((a.type !== 'operation' && a.type !== 'webhook') || (b.type !== 'operation' && b.type !== 'webhook')) {\n return 0\n }\n\n // Handle webhooks as well as operations\n const pathA = a.type === 'operation' ? a.path : a.name\n const pathB = b.type === 'operation' ? b.path : b.name\n\n return operationsSorter(\n { method: a.method, path: pathA, ref: a.ref, httpVerb: a.method },\n { method: b.method, path: pathB, ref: b.ref, httpVerb: b.method },\n )\n })\n }\n\n return entries.length ? createTagEntry(tag, titlesMap, getTagId, entries) : []\n })\n}\n\n/**\n * Traverses the tags map to create navigation entries, handling both grouped and ungrouped tags.\n *\n * This function processes the OpenAPI document's tags to:\n * - Handle tag groups if specified via x-tagGroups\n * - Sort tags and their operations according to provided sorters\n * - Create navigation entries for each tag or tag group\n * - Flatten default tag entries if it's the only tag present\n */\nexport const traverseTags = (\n content: OpenApiDocument,\n /** Map of tags and their entries */\n tagsMap: TagsMap,\n /** Map of titles for the mobile title */\n titlesMap: Map<string, string>,\n { getTagId, tagsSorter, operationsSorter }: Options,\n): TraversedEntry[] => {\n // x-tagGroups\n if (content['x-tagGroups']) {\n const tagGroups = content['x-tagGroups']\n\n return tagGroups.flatMap((tagGroup) => {\n const entries = getSortedTagEntries(tagGroup.tags ?? [], tagsMap, titlesMap, {\n getTagId,\n tagsSorter,\n operationsSorter,\n })\n return entries.length ? createTagEntry(tagGroup, titlesMap, getTagId, entries, true) : []\n })\n }\n\n // Ungrouped regular tags\n const keys = Array.from(tagsMap.keys())\n const tags = getSortedTagEntries(keys, tagsMap, titlesMap, { getTagId, tagsSorter, operationsSorter })\n\n // Flatten if we only have default tag\n if (tags.length === 1 && tags[0]?.title === 'default') {\n return tags[0]?.children ?? []\n }\n\n return tags\n}\n"],
5
+ "mappings": "AAIA,SAAS,cAAc;AAavB,MAAM,iBAAiB,CACrB,KACA,WACA,UACA,UACA,UAAU,UACO;AACjB,QAAM,KAAK,SAAS,GAAG;AACvB,QAAM,QAAQ,IAAI,eAAe,KAAK,IAAI,QAAQ;AAClD,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,MAAM,IAAI,QAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAmBA,MAAM,sBAAsB,CAC1B,OAEA,SAEA,WACA,EAAE,UAAU,YAAY,iBAAiB,MACtC;AAEH,QAAM,aAAa,MAAM,SAAS,SAAS;AAC3C,QAAM,OAAO,aAAa,MAAM,OAAO,CAAC,QAAQ,QAAQ,SAAS,IAAI;AAGrE,MAAI,eAAe,SAAS;AAC1B,SAAK,KAAK,CAAC,GAAG,MAAM;AAClB,YAAM,QAAQ,OAAO,SAAS,CAAC,EAAE,IAAI,eAAe,KAAK,KAAK;AAC9D,YAAM,QAAQ,OAAO,SAAS,CAAC,EAAE,IAAI,eAAe,KAAK,KAAK;AAC9D,aAAO,MAAM,cAAc,KAAK;AAAA,IAClC,CAAC;AAAA,EACH,WAES,OAAO,eAAe,YAAY;AACzC,SAAK,KAAK,CAAC,GAAG,MAAM,WAAW,OAAO,SAAS,CAAC,EAAE,KAAK,OAAO,SAAS,CAAC,EAAE,GAAG,CAAC;AAAA,EAChF;AAEA,MAAI,YAAY;AACd,SAAK,KAAK,SAAS;AAAA,EACrB;AAQA,SAAO,KAAK,QAAQ,CAAC,QAAQ;AAC3B,UAAM,EAAE,KAAK,QAAQ,IAAI,OAAO,SAAS,GAAG;AAG5C,QAAI,IAAI,YAAY,KAAK,IAAI,iBAAiB,GAAG;AAC/C,aAAO,CAAC;AAAA,IACV;AAGA,QAAI,qBAAqB,SAAS;AAChC,cAAQ,KAAK,CAAC,GAAG,MAAO,YAAY,KAAK,YAAY,IAAI,EAAE,MAAM,cAAc,EAAE,KAAK,IAAI,CAAE;AAAA,IAC9F,WAES,qBAAqB,UAAU;AACtC,cAAQ,KAAK,CAAC,GAAG,MAAO,YAAY,KAAK,YAAY,IAAI,EAAE,OAAO,cAAc,EAAE,MAAM,IAAI,CAAE;AAAA,IAChG,WAES,OAAO,qBAAqB,YAAY;AAC/C,cAAQ,KAAK,CAAC,GAAG,MAAM;AAErB,YAAK,EAAE,SAAS,eAAe,EAAE,SAAS,aAAe,EAAE,SAAS,eAAe,EAAE,SAAS,WAAY;AACxG,iBAAO;AAAA,QACT;AAGA,cAAM,QAAQ,EAAE,SAAS,cAAc,EAAE,OAAO,EAAE;AAClD,cAAM,QAAQ,EAAE,SAAS,cAAc,EAAE,OAAO,EAAE;AAElD,eAAO;AAAA,UACL,EAAE,QAAQ,EAAE,QAAQ,MAAM,OAAO,KAAK,EAAE,KAAK,UAAU,EAAE,OAAO;AAAA,UAChE,EAAE,QAAQ,EAAE,QAAQ,MAAM,OAAO,KAAK,EAAE,KAAK,UAAU,EAAE,OAAO;AAAA,QAClE;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO,QAAQ,SAAS,eAAe,KAAK,WAAW,UAAU,OAAO,IAAI,CAAC;AAAA,EAC/E,CAAC;AACH;AAWO,MAAM,eAAe,CAC1B,SAEA,SAEA,WACA,EAAE,UAAU,YAAY,iBAAiB,MACpB;AAErB,MAAI,QAAQ,aAAa,GAAG;AAC1B,UAAM,YAAY,QAAQ,aAAa;AAEvC,WAAO,UAAU,QAAQ,CAAC,aAAa;AACrC,YAAM,UAAU,oBAAoB,SAAS,QAAQ,CAAC,GAAG,SAAS,WAAW;AAAA,QAC3E;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AACD,aAAO,QAAQ,SAAS,eAAe,UAAU,WAAW,UAAU,SAAS,IAAI,IAAI,CAAC;AAAA,IAC1F,CAAC;AAAA,EACH;AAGA,QAAM,OAAO,MAAM,KAAK,QAAQ,KAAK,CAAC;AACtC,QAAM,OAAO,oBAAoB,MAAM,SAAS,WAAW,EAAE,UAAU,YAAY,iBAAiB,CAAC;AAGrG,MAAI,KAAK,WAAW,KAAK,KAAK,CAAC,GAAG,UAAU,WAAW;AACrD,WAAO,KAAK,CAAC,GAAG,YAAY,CAAC;AAAA,EAC/B;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
- import type { TraversedWebhook } from '../../schemas/navigation.js';
2
1
  import type { TagsMap, TraverseSpecOptions } from '../../navigation/types.js';
2
+ import type { TraversedWebhook } from '../../schemas/navigation.js';
3
3
  import type { OpenApiDocument } from '../../schemas/v3.1/strict/openapi-document.js';
4
4
  /** Traverses the webhooks in an OpenAPI document to build an array of webhook entries.
5
5
  *
@@ -16,5 +16,9 @@ import type { OpenApiDocument } from '../../schemas/v3.1/strict/openapi-document
16
16
  * @param getWebhookId - Function to generate unique IDs for webhooks
17
17
  * @returns Array of untagged webhook entries
18
18
  */
19
- export declare const traverseWebhooks: (content: OpenApiDocument, tagsMap: TagsMap, titlesMap: Map<string, string>, getWebhookId: TraverseSpecOptions["getWebhookId"]) => TraversedWebhook[];
19
+ export declare const traverseWebhooks: (content: OpenApiDocument,
20
+ /** The tag map from from traversing paths */
21
+ tagsMap: TagsMap,
22
+ /** Map of titles for the mobile title */
23
+ titlesMap: Map<string, string>, getWebhookId: TraverseSpecOptions["getWebhookId"]) => TraversedWebhook[];
20
24
  //# sourceMappingURL=traverse-webhooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-webhooks.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAuC7E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,YAClB,eAAe,WAEf,OAAO,aAEL,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAChB,mBAAmB,CAAC,cAAc,CAAC,KAChD,gBAAgB,EAuClB,CAAA"}
1
+ {"version":3,"file":"traverse-webhooks.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-webhooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,wCAAwC,CAAA;AAqCxF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,eAAe;AACxB,6CAA6C;AAC7C,SAAS,OAAO;AAChB,yCAAyC;AACzC,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,cAAc,mBAAmB,CAAC,cAAc,CAAC,KAChD,gBAAgB,EAuClB,CAAA"}
@@ -1,7 +1,7 @@
1
- import { getTag } from "./get-tag.js";
2
- import { getResolvedRef } from "../../helpers/get-resolved-ref.js";
3
1
  import { isHttpMethod } from "@scalar/helpers/http/is-http-method";
4
2
  import { objectKeys } from "@scalar/helpers/object/object-keys";
3
+ import { getResolvedRef } from "../../helpers/get-resolved-ref.js";
4
+ import { getTag } from "./get-tag.js";
5
5
  const createWebhookEntry = (ref, method, name = "Unknown", title = "Unknown", titlesMap, getWebhookId, tag) => {
6
6
  const id = getWebhookId({ name, method }, tag);
7
7
  titlesMap.set(id, title);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/navigation/helpers/traverse-webhooks.ts"],
4
- "sourcesContent": ["import type { TraversedWebhook } from '@/schemas/navigation'\nimport { getTag } from './get-tag'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { OpenApiDocument } from '@/schemas/v3.1/strict/openapi-document'\nimport { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport type { TagObject } from '@/schemas/v3.1/strict/tag'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\n\n/** Creates a traversed webhook entry from an OpenAPI webhook object.\n *\n * @param ref - JSON pointer reference to the webhook in the OpenAPI document\n * @param method - HTTP method of the webhook\n * @param name - Name of the webhook, defaults to 'Unknown'\n * @param title - Title of the webhook, defaults to 'Unknown'\n * @param titlesMap - Map to store webhook IDs and titles for mobile header navigation\n * @param getWebhookId - Function to generate unique IDs for webhooks\n * @param tag - Optional tag object associated with the webhook\n * @returns A traversed webhook entry with ID, title, name, method and reference\n */\nconst createWebhookEntry = (\n ref: string,\n method: string,\n name = 'Unknown',\n title = 'Unknown',\n titlesMap: Map<string, string>,\n getWebhookId: TraverseSpecOptions['getWebhookId'],\n tag?: TagObject,\n): TraversedWebhook => {\n const id = getWebhookId({ name, method }, tag)\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n name,\n ref,\n method: method,\n type: 'webhook',\n }\n}\n\n/** Traverses the webhooks in an OpenAPI document to build an array of webhook entries.\n *\n * This function processes each webhook in the document to:\n * - Filter out internal webhooks (marked with x-internal) and webhooks to ignore (marked with x-scalar-ignore)\n * - Group webhooks by their tags\n * - Create webhook entries with unique references and IDs\n * - Store webhook IDs and titles for mobile header navigation\n *\n * @param content - The OpenAPI document to traverse\n * @param tagsMap - Map of tag names to arrays of traversed entries from operations\n * @param tagsDict - Dictionary mapping tag names to their OpenAPI tag objects\n * @param titlesMap - Map to store webhook IDs and titles for mobile header navigation\n * @param getWebhookId - Function to generate unique IDs for webhooks\n * @returns Array of untagged webhook entries\n */\nexport const traverseWebhooks = (\n content: OpenApiDocument,\n /** The tag map from from traversing paths */\n tagsMap: TagsMap,\n /** Map of titles for the mobile title */\n titlesMap: Map<string, string>,\n getWebhookId: TraverseSpecOptions['getWebhookId'],\n): TraversedWebhook[] => {\n const untagged: TraversedWebhook[] = []\n\n // Traverse webhooks\n Object.entries(content.webhooks ?? {}).forEach(([name, pathItemObject]) => {\n const pathKeys = objectKeys(pathItemObject ?? {}).filter((key) => isHttpMethod(key))\n\n pathKeys.forEach((method) => {\n const _operation = pathItemObject?.[method]\n const operation = getResolvedRef(_operation)\n if (!operation) {\n return\n }\n\n // Skip if the operation is internal or scalar-ignore\n if (operation['x-internal'] || operation['x-scalar-ignore']) {\n return\n }\n\n const ref = `#/webhooks/${name}/${method}`\n\n if (operation.tags?.length) {\n operation.tags.forEach((tagName: string) => {\n const { tag } = getTag(tagsMap, tagName)\n tagsMap\n .get(tagName)\n ?.entries.push(\n createWebhookEntry(ref, method, name, operation.summary ?? name, titlesMap, getWebhookId, tag),\n )\n })\n }\n // Add to untagged\n else {\n untagged.push(createWebhookEntry(ref, method, name, operation.summary ?? name, titlesMap, getWebhookId))\n }\n })\n })\n\n return untagged\n}\n"],
5
- "mappings": "AACA,SAAS,cAAc;AAGvB,SAAS,sBAAsB;AAE/B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAa3B,MAAM,qBAAqB,CACzB,KACA,QACA,OAAO,WACP,QAAQ,WACR,WACA,cACA,QACqB;AACrB,QAAM,KAAK,aAAa,EAAE,MAAM,OAAO,GAAG,GAAG;AAC7C,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAiBO,MAAM,mBAAmB,CAC9B,SAEA,SAEA,WACA,iBACuB;AACvB,QAAM,WAA+B,CAAC;AAGtC,SAAO,QAAQ,QAAQ,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,cAAc,MAAM;AACzE,UAAM,WAAW,WAAW,kBAAkB,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,aAAa,GAAG,CAAC;AAEnF,aAAS,QAAQ,CAAC,WAAW;AAC3B,YAAM,aAAa,iBAAiB,MAAM;AAC1C,YAAM,YAAY,eAAe,UAAU;AAC3C,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAGA,UAAI,UAAU,YAAY,KAAK,UAAU,iBAAiB,GAAG;AAC3D;AAAA,MACF;AAEA,YAAM,MAAM,cAAc,IAAI,IAAI,MAAM;AAExC,UAAI,UAAU,MAAM,QAAQ;AAC1B,kBAAU,KAAK,QAAQ,CAAC,YAAoB;AAC1C,gBAAM,EAAE,IAAI,IAAI,OAAO,SAAS,OAAO;AACvC,kBACG,IAAI,OAAO,GACV,QAAQ;AAAA,YACR,mBAAmB,KAAK,QAAQ,MAAM,UAAU,WAAW,MAAM,WAAW,cAAc,GAAG;AAAA,UAC/F;AAAA,QACJ,CAAC;AAAA,MACH,OAEK;AACH,iBAAS,KAAK,mBAAmB,KAAK,QAAQ,MAAM,UAAU,WAAW,MAAM,WAAW,YAAY,CAAC;AAAA,MACzG;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,SAAO;AACT;",
4
+ "sourcesContent": ["import { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\n\nimport { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport type { TagsMap, TraverseSpecOptions } from '@/navigation/types'\nimport type { TraversedWebhook } from '@/schemas/navigation'\nimport type { OpenApiDocument, TagObject } from '@/schemas/v3.1/strict/openapi-document'\n\nimport { getTag } from './get-tag'\n\n/** Creates a traversed webhook entry from an OpenAPI webhook object.\n *\n * @param ref - JSON pointer reference to the webhook in the OpenAPI document\n * @param method - HTTP method of the webhook\n * @param name - Name of the webhook, defaults to 'Unknown'\n * @param title - Title of the webhook, defaults to 'Unknown'\n * @param titlesMap - Map to store webhook IDs and titles for mobile header navigation\n * @param getWebhookId - Function to generate unique IDs for webhooks\n * @param tag - Optional tag object associated with the webhook\n * @returns A traversed webhook entry with ID, title, name, method and reference\n */\nconst createWebhookEntry = (\n ref: string,\n method: string,\n name = 'Unknown',\n title = 'Unknown',\n titlesMap: Map<string, string>,\n getWebhookId: TraverseSpecOptions['getWebhookId'],\n tag?: TagObject,\n): TraversedWebhook => {\n const id = getWebhookId({ name, method }, tag)\n titlesMap.set(id, title)\n\n return {\n id,\n title,\n name,\n ref,\n method: method,\n type: 'webhook',\n }\n}\n\n/** Traverses the webhooks in an OpenAPI document to build an array of webhook entries.\n *\n * This function processes each webhook in the document to:\n * - Filter out internal webhooks (marked with x-internal) and webhooks to ignore (marked with x-scalar-ignore)\n * - Group webhooks by their tags\n * - Create webhook entries with unique references and IDs\n * - Store webhook IDs and titles for mobile header navigation\n *\n * @param content - The OpenAPI document to traverse\n * @param tagsMap - Map of tag names to arrays of traversed entries from operations\n * @param tagsDict - Dictionary mapping tag names to their OpenAPI tag objects\n * @param titlesMap - Map to store webhook IDs and titles for mobile header navigation\n * @param getWebhookId - Function to generate unique IDs for webhooks\n * @returns Array of untagged webhook entries\n */\nexport const traverseWebhooks = (\n content: OpenApiDocument,\n /** The tag map from from traversing paths */\n tagsMap: TagsMap,\n /** Map of titles for the mobile title */\n titlesMap: Map<string, string>,\n getWebhookId: TraverseSpecOptions['getWebhookId'],\n): TraversedWebhook[] => {\n const untagged: TraversedWebhook[] = []\n\n // Traverse webhooks\n Object.entries(content.webhooks ?? {}).forEach(([name, pathItemObject]) => {\n const pathKeys = objectKeys(pathItemObject ?? {}).filter((key) => isHttpMethod(key))\n\n pathKeys.forEach((method) => {\n const _operation = pathItemObject?.[method]\n const operation = getResolvedRef(_operation)\n if (!operation) {\n return\n }\n\n // Skip if the operation is internal or scalar-ignore\n if (operation['x-internal'] || operation['x-scalar-ignore']) {\n return\n }\n\n const ref = `#/webhooks/${name}/${method}`\n\n if (operation.tags?.length) {\n operation.tags.forEach((tagName: string) => {\n const { tag } = getTag(tagsMap, tagName)\n tagsMap\n .get(tagName)\n ?.entries.push(\n createWebhookEntry(ref, method, name, operation.summary ?? name, titlesMap, getWebhookId, tag),\n )\n })\n }\n // Add to untagged\n else {\n untagged.push(createWebhookEntry(ref, method, name, operation.summary ?? name, titlesMap, getWebhookId))\n }\n })\n })\n\n return untagged\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAE3B,SAAS,sBAAsB;AAK/B,SAAS,cAAc;AAavB,MAAM,qBAAqB,CACzB,KACA,QACA,OAAO,WACP,QAAQ,WACR,WACA,cACA,QACqB;AACrB,QAAM,KAAK,aAAa,EAAE,MAAM,OAAO,GAAG,GAAG;AAC7C,YAAU,IAAI,IAAI,KAAK;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAiBO,MAAM,mBAAmB,CAC9B,SAEA,SAEA,WACA,iBACuB;AACvB,QAAM,WAA+B,CAAC;AAGtC,SAAO,QAAQ,QAAQ,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,cAAc,MAAM;AACzE,UAAM,WAAW,WAAW,kBAAkB,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,aAAa,GAAG,CAAC;AAEnF,aAAS,QAAQ,CAAC,WAAW;AAC3B,YAAM,aAAa,iBAAiB,MAAM;AAC1C,YAAM,YAAY,eAAe,UAAU;AAC3C,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAGA,UAAI,UAAU,YAAY,KAAK,UAAU,iBAAiB,GAAG;AAC3D;AAAA,MACF;AAEA,YAAM,MAAM,cAAc,IAAI,IAAI,MAAM;AAExC,UAAI,UAAU,MAAM,QAAQ;AAC1B,kBAAU,KAAK,QAAQ,CAAC,YAAoB;AAC1C,gBAAM,EAAE,IAAI,IAAI,OAAO,SAAS,OAAO;AACvC,kBACG,IAAI,OAAO,GACV,QAAQ;AAAA,YACR,mBAAmB,KAAK,QAAQ,MAAM,UAAU,WAAW,MAAM,WAAW,cAAc,GAAG;AAAA,UAC/F;AAAA,QACJ,CAAC;AAAA,MACH,OAEK;AACH,iBAAS,KAAK,mBAAmB,KAAK,QAAQ,MAAM,UAAU,WAAW,MAAM,WAAW,YAAY,CAAC;AAAA,MACzG;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAiCjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAMhE;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEjD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,aAAc,OAAO,EAAE,KAAG,aAQ3D,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AA+BjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAMhE;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEjD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,OAAO,EAAE,KAAG,aAQ3D,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/navigation/helpers/utils.ts"],
4
- "sourcesContent": ["import type { Heading } from '@/navigation/types'\nimport { getHeadings } from '@scalar/code-highlight/markdown'\nimport GithubSlugger from 'github-slugger'\n\n/**\n * Adds URL-friendly slugs to each heading in the array.\n * Uses GithubSlugger to generate consistent slugs that match GitHub's heading anchor format.\n *\n * @param headings - Array of heading objects containing value and depth\n * @param slugger - GithubSlugger instance for generating consistent slugs\n * @returns Array of headings with added slug property\n *\n * @example\n * const headings = [\n * { value: 'Getting Started', depth: 1 },\n * { value: 'Installation', depth: 2 }\n * ]\n * const slugger = new GithubSlugger()\n * withSlugs(headings, slugger)\n * // Returns:\n * // [\n * // { value: 'Getting Started', depth: 1, slug: 'getting-started' },\n * // { value: 'Installation', depth: 2, slug: 'installation' }\n * // ]\n */\nconst withSlugs = (headings: Heading[], slugger: GithubSlugger): Heading[] =>\n headings.map((heading) => {\n return {\n ...heading,\n slug: slugger.slug(heading.value),\n }\n })\n\n/**\n * Extracts all headings from a Markdown string and adds URL-friendly slugs to each heading.\n * Uses GithubSlugger to generate consistent slugs that match GitHub's heading anchor format.\n *\n * @param input - The Markdown string to extract headings from\n * @returns Array of heading objects containing value, depth, and slug\n *\n * @example\n * const markdown = `\n * # Getting Started\n * ## Installation\n * ### Requirements\n * `\n * const headings = getHeadingsFromMarkdown(markdown)\n * // Returns:\n * // [\n * // { value: 'Getting Started', depth: 1, slug: 'getting-started' },\n * // { value: 'Installation', depth: 2, slug: 'installation' },\n * // { value: 'Requirements', depth: 3, slug: 'requirements' }\n * // ]\n */\nexport function getHeadingsFromMarkdown(input: string): Heading[] {\n const slugger = new GithubSlugger()\n\n const headings = getHeadings(input)\n\n return withSlugs(headings as Heading[], slugger)\n}\n\nexport type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6\n\n/**\n * Returns the lowest heading level from a list of headings.\n *\n * @param headings - Array of heading objects containing depth property\n * @returns The lowest heading level (1-6) or 1 if no valid headings found\n *\n * @example\n * const headings = [\n * { value: 'Getting Started', depth: 1 },\n * { value: 'Installation', depth: 2 }\n * ]\n * getLowestHeadingLevel(headings) // Returns: 1\n */\nexport const getLowestHeadingLevel = (headings: Heading[]): HeadingLevels => {\n const lowestLevel = Math.min(...headings.map((heading) => heading.depth))\n\n if (lowestLevel >= 1 && lowestLevel <= 6) {\n return lowestLevel as HeadingLevels\n }\n\n return 1\n}\n"],
5
- "mappings": "AACA,SAAS,mBAAmB;AAC5B,OAAO,mBAAmB;AAuB1B,MAAM,YAAY,CAAC,UAAqB,YACtC,SAAS,IAAI,CAAC,YAAY;AACxB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM,QAAQ,KAAK,QAAQ,KAAK;AAAA,EAClC;AACF,CAAC;AAuBI,SAAS,wBAAwB,OAA0B;AAChE,QAAM,UAAU,IAAI,cAAc;AAElC,QAAM,WAAW,YAAY,KAAK;AAElC,SAAO,UAAU,UAAuB,OAAO;AACjD;AAiBO,MAAM,wBAAwB,CAAC,aAAuC;AAC3E,QAAM,cAAc,KAAK,IAAI,GAAG,SAAS,IAAI,CAAC,YAAY,QAAQ,KAAK,CAAC;AAExE,MAAI,eAAe,KAAK,eAAe,GAAG;AACxC,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { getHeadings } from '@scalar/code-highlight/markdown'\nimport GithubSlugger from 'github-slugger'\n\nimport type { Heading } from '@/navigation/types'\n\n/**\n * Adds URL-friendly slugs to each heading in the array.\n * Uses GithubSlugger to generate consistent slugs that match GitHub's heading anchor format.\n *\n * @param headings - Array of heading objects containing value and depth\n * @param slugger - GithubSlugger instance for generating consistent slugs\n * @returns Array of headings with added slug property\n *\n * @example\n * const headings = [\n * { value: 'Getting Started', depth: 1 },\n * { value: 'Installation', depth: 2 }\n * ]\n * const slugger = new GithubSlugger()\n * withSlugs(headings, slugger)\n * // Returns:\n * // [\n * // { value: 'Getting Started', depth: 1, slug: 'getting-started' },\n * // { value: 'Installation', depth: 2, slug: 'installation' }\n * // ]\n */\nconst withSlugs = (headings: Heading[], slugger: GithubSlugger): Heading[] =>\n headings.map((heading) => {\n return {\n ...heading,\n slug: slugger.slug(heading.value),\n }\n })\n\n/**\n * Extracts all headings from a Markdown string and adds URL-friendly slugs to each heading.\n * Uses GithubSlugger to generate consistent slugs that match GitHub's heading anchor format.\n *\n * @param input - The Markdown string to extract headings from\n * @returns Array of heading objects containing value, depth, and slug\n *\n * @example\n * const markdown = `\n * # Getting Started\n * ## Installation\n * ### Requirements\n * `\n * const headings = getHeadingsFromMarkdown(markdown)\n * // Returns:\n * // [\n * // { value: 'Getting Started', depth: 1, slug: 'getting-started' },\n * // { value: 'Installation', depth: 2, slug: 'installation' },\n * // { value: 'Requirements', depth: 3, slug: 'requirements' }\n * // ]\n */\nexport function getHeadingsFromMarkdown(input: string): Heading[] {\n const slugger = new GithubSlugger()\n\n const headings = getHeadings(input)\n\n return withSlugs(headings as Heading[], slugger)\n}\n\nexport type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6\n\n/**\n * Returns the lowest heading level from a list of headings.\n *\n * @param headings - Array of heading objects containing depth property\n * @returns The lowest heading level (1-6) or 1 if no valid headings found\n *\n * @example\n * const headings = [\n * { value: 'Getting Started', depth: 1 },\n * { value: 'Installation', depth: 2 }\n * ]\n * getLowestHeadingLevel(headings) // Returns: 1\n */\nexport const getLowestHeadingLevel = (headings: Heading[]): HeadingLevels => {\n const lowestLevel = Math.min(...headings.map((heading) => heading.depth))\n\n if (lowestLevel >= 1 && lowestLevel <= 6) {\n return lowestLevel as HeadingLevels\n }\n\n return 1\n}\n"],
5
+ "mappings": "AAAA,SAAS,mBAAmB;AAC5B,OAAO,mBAAmB;AAyB1B,MAAM,YAAY,CAAC,UAAqB,YACtC,SAAS,IAAI,CAAC,YAAY;AACxB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM,QAAQ,KAAK,QAAQ,KAAK;AAAA,EAClC;AACF,CAAC;AAuBI,SAAS,wBAAwB,OAA0B;AAChE,QAAM,UAAU,IAAI,cAAc;AAElC,QAAM,WAAW,YAAY,KAAK;AAElC,SAAO,UAAU,UAAuB,OAAO;AACjD;AAiBO,MAAM,wBAAwB,CAAC,aAAuC;AAC3E,QAAM,cAAc,KAAK,IAAI,GAAG,SAAS,IAAI,CAAC,YAAY,QAAQ,KAAK,CAAC;AAExE,MAAI,eAAe,KAAK,eAAe,GAAG;AACxC,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- export type { TraverseSpecOptions as createNavigationOptions } from './types.js';
2
1
  export { traverseDocument as createNavigation } from './helpers/traverse-document.js';
2
+ export type { TraverseSpecOptions as createNavigationOptions } from './types.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAG7E,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAClF,YAAY,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,SAAS,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/navigation/index.ts"],
4
- "sourcesContent": ["export type { TraverseSpecOptions as createNavigationOptions } from './types'\n\n// biome-ignore lint/performance/noBarrelFile: <explanation>\nexport { traverseDocument as createNavigation } from './helpers/traverse-document'\n"],
5
- "mappings": "AAGA,SAA6B,wBAAwB;",
4
+ "sourcesContent": ["// biome-ignore lint/performance/noBarrelFile: Entry point for /navigation\nexport { traverseDocument as createNavigation } from './helpers/traverse-document'\nexport type { TraverseSpecOptions as createNavigationOptions } from './types'\n"],
5
+ "mappings": "AACA,SAA6B,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,5 @@
1
1
  import type { TraversedEntry } from '../schemas/navigation.js';
2
- import type { OperationObject } from '../schemas/v3.1/strict/path-operations.js';
3
- import type { TagObject } from '../schemas/v3.1/strict/tag.js';
2
+ import type { OperationObject, TagObject } from '../schemas/v3.1/strict/openapi-document.js';
4
3
  /** Map of tagNames and their entries */
5
4
  export type TagsMap = Map<string, {
6
5
  tag: TagObject;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,wCAAwC;AACxC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAAA;AAEhF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,2FAA2F;IAC3F,UAAU,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,MAAM,CAAC,CAAA;IAE9D,sGAAsG;IACtG,gBAAgB,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,kBAAkB,KAAK,MAAM,CAAC,CAAA;IAEjG,wDAAwD;IACxD,UAAU,EAAE,OAAO,CAAA;IAEnB,4DAA4D;IAC5D,YAAY,EAAE,CAAC,OAAO,EAAE;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,KAAK,MAAM,CAAA;IAEZ,qDAAqD;IACrD,cAAc,EAAE,CACd,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACf,GAAG,eAAe,EACnB,SAAS,EAAE,SAAS,KACjB,MAAM,CAAA;IAEX,mDAAmD;IACnD,YAAY,EAAE,CACZ,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,EACD,SAAS,CAAC,EAAE,SAAS,KAClB,MAAM,CAAA;IAEX,yDAAyD;IACzD,UAAU,EAAE,CACV,KAAK,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,EACD,SAAS,CAAC,EAAE,SAAS,KAClB,MAAM,CAAA;IAEX,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAA;AACxF,wCAAwC;AACxC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAAA;AAEhF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,2FAA2F;IAC3F,UAAU,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,MAAM,CAAC,CAAA;IAE9D,sGAAsG;IACtG,gBAAgB,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,kBAAkB,KAAK,MAAM,CAAC,CAAA;IAEjG,wDAAwD;IACxD,UAAU,EAAE,OAAO,CAAA;IAEnB,4DAA4D;IAC5D,YAAY,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAA;IAElF,qDAAqD;IACrD,cAAc,EAAE,CACd,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACf,GAAG,eAAe,EACnB,SAAS,EAAE,SAAS,KACjB,MAAM,CAAA;IAEX,mDAAmD;IACnD,YAAY,EAAE,CACZ,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,EACD,SAAS,CAAC,EAAE,SAAS,KAClB,MAAM,CAAA;IAEX,yDAAyD;IACzD,UAAU,EAAE,CACV,KAAK,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,EACD,SAAS,CAAC,EAAE,SAAS,KAClB,MAAM,CAAA;IAEX,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}