@fern-api/fdr-sdk 1.2.40-bcfd2ff480 → 1.2.41-02971594aa

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 (1369) hide show
  1. package/dist/__test__/SdkSnippetHolder.test.d.ts +2 -0
  2. package/dist/__test__/SdkSnippetHolder.test.d.ts.map +1 -0
  3. package/dist/__test__/SdkSnippetHolder.test.js +58 -0
  4. package/dist/__test__/SdkSnippetHolder.test.js.map +1 -0
  5. package/dist/__test__/fixtures.test.d.ts +2 -0
  6. package/dist/__test__/fixtures.test.d.ts.map +1 -0
  7. package/dist/__test__/fixtures.test.js +128 -0
  8. package/dist/__test__/fixtures.test.js.map +1 -0
  9. package/dist/__test__/hume.test.d.ts +2 -0
  10. package/dist/__test__/hume.test.d.ts.map +1 -0
  11. package/dist/__test__/hume.test.js +18 -0
  12. package/dist/__test__/hume.test.js.map +1 -0
  13. package/dist/__test__/no-version-no-tabs.test.d.ts +2 -0
  14. package/dist/__test__/no-version-no-tabs.test.d.ts.map +1 -0
  15. package/dist/__test__/no-version-no-tabs.test.js +17 -0
  16. package/dist/__test__/no-version-no-tabs.test.js.map +1 -0
  17. package/dist/__test__/no-version-yes-tabs.test.d.ts +2 -0
  18. package/dist/__test__/no-version-yes-tabs.test.d.ts.map +1 -0
  19. package/dist/__test__/no-version-yes-tabs.test.js +24 -0
  20. package/dist/__test__/no-version-yes-tabs.test.js.map +1 -0
  21. package/dist/__test__/octoai.test.d.ts +2 -0
  22. package/dist/__test__/octoai.test.d.ts.map +1 -0
  23. package/dist/__test__/octoai.test.js +24 -0
  24. package/dist/__test__/octoai.test.js.map +1 -0
  25. package/dist/__test__/polytomic.test.d.ts +2 -0
  26. package/dist/__test__/polytomic.test.d.ts.map +1 -0
  27. package/dist/__test__/polytomic.test.js +22 -0
  28. package/dist/__test__/polytomic.test.js.map +1 -0
  29. package/dist/__test__/primer.test.d.ts +2 -0
  30. package/dist/__test__/primer.test.d.ts.map +1 -0
  31. package/dist/__test__/primer.test.js +20 -0
  32. package/dist/__test__/primer.test.js.map +1 -0
  33. package/dist/__test__/readFixtures.d.ts +3 -0
  34. package/dist/__test__/readFixtures.d.ts.map +1 -0
  35. package/dist/__test__/readFixtures.js +8 -0
  36. package/dist/__test__/readFixtures.js.map +1 -0
  37. package/dist/__test__/testGetAllUrlsFromDocsConfig.d.ts +3 -0
  38. package/dist/__test__/testGetAllUrlsFromDocsConfig.d.ts.map +1 -0
  39. package/dist/__test__/testGetAllUrlsFromDocsConfig.js +10 -0
  40. package/dist/__test__/testGetAllUrlsFromDocsConfig.js.map +1 -0
  41. package/dist/__test__/testGetNavigationRoot.d.ts +3 -0
  42. package/dist/__test__/testGetNavigationRoot.d.ts.map +1 -0
  43. package/dist/__test__/testGetNavigationRoot.js +16 -0
  44. package/dist/__test__/testGetNavigationRoot.js.map +1 -0
  45. package/dist/__test__/uploadcare.test.d.ts +2 -0
  46. package/dist/__test__/uploadcare.test.d.ts.map +1 -0
  47. package/dist/__test__/uploadcare.test.js +25 -0
  48. package/dist/__test__/uploadcare.test.js.map +1 -0
  49. package/dist/__test__/yes-version-no-tabs.test.d.ts +2 -0
  50. package/dist/__test__/yes-version-no-tabs.test.d.ts.map +1 -0
  51. package/dist/__test__/yes-version-no-tabs.test.js +27 -0
  52. package/dist/__test__/yes-version-no-tabs.test.js.map +1 -0
  53. package/dist/__test__/yes-version-yes-tabs.test.d.ts +2 -0
  54. package/dist/__test__/yes-version-yes-tabs.test.d.ts.map +1 -0
  55. package/dist/__test__/yes-version-yes-tabs.test.js +26 -0
  56. package/dist/__test__/yes-version-yes-tabs.test.js.map +1 -0
  57. package/dist/api-definition/__test__/availability.test.d.ts +2 -0
  58. package/dist/api-definition/__test__/availability.test.d.ts.map +1 -0
  59. package/dist/api-definition/__test__/availability.test.js +15 -0
  60. package/dist/api-definition/__test__/availability.test.js.map +1 -0
  61. package/dist/api-definition/__test__/collect-type-tree.test.d.ts +2 -0
  62. package/dist/api-definition/__test__/collect-type-tree.test.d.ts.map +1 -0
  63. package/dist/api-definition/__test__/collect-type-tree.test.js +124 -0
  64. package/dist/api-definition/__test__/collect-type-tree.test.js.map +1 -0
  65. package/dist/api-definition/__test__/join.test.d.ts +2 -0
  66. package/dist/api-definition/__test__/join.test.d.ts.map +1 -0
  67. package/dist/api-definition/__test__/join.test.js +325 -0
  68. package/dist/api-definition/__test__/join.test.js.map +1 -0
  69. package/dist/api-definition/__test__/prune.test.d.ts +2 -0
  70. package/dist/api-definition/__test__/prune.test.d.ts.map +1 -0
  71. package/dist/api-definition/__test__/prune.test.js +271 -0
  72. package/dist/api-definition/__test__/prune.test.js.map +1 -0
  73. package/dist/api-definition/__test__/schemaless-pipeline.test.d.ts +2 -0
  74. package/dist/api-definition/__test__/schemaless-pipeline.test.d.ts.map +1 -0
  75. package/dist/api-definition/__test__/schemaless-pipeline.test.js +258 -0
  76. package/dist/api-definition/__test__/schemaless-pipeline.test.js.map +1 -0
  77. package/dist/api-definition/__test__/unwrap.test.d.ts +2 -0
  78. package/dist/api-definition/__test__/unwrap.test.d.ts.map +1 -0
  79. package/dist/api-definition/__test__/unwrap.test.js +669 -0
  80. package/dist/api-definition/__test__/unwrap.test.js.map +1 -0
  81. package/dist/api-definition/__test__/v1ToV2.test.d.ts +2 -0
  82. package/dist/api-definition/__test__/v1ToV2.test.d.ts.map +1 -0
  83. package/dist/api-definition/__test__/v1ToV2.test.js +1288 -0
  84. package/dist/api-definition/__test__/v1ToV2.test.js.map +1 -0
  85. package/dist/api-definition/availability.d.ts +18 -0
  86. package/dist/api-definition/availability.d.ts.map +1 -0
  87. package/dist/api-definition/availability.js +30 -0
  88. package/dist/api-definition/availability.js.map +1 -0
  89. package/dist/api-definition/collect-referenced-types.d.ts +29 -0
  90. package/dist/api-definition/collect-referenced-types.d.ts.map +1 -0
  91. package/dist/api-definition/collect-referenced-types.js +133 -0
  92. package/dist/api-definition/collect-referenced-types.js.map +1 -0
  93. package/dist/api-definition/collect-type-tree.d.ts +62 -0
  94. package/dist/api-definition/collect-type-tree.d.ts.map +1 -0
  95. package/dist/api-definition/collect-type-tree.js +234 -0
  96. package/dist/api-definition/collect-type-tree.js.map +1 -0
  97. package/dist/api-definition/const.d.ts +11 -0
  98. package/dist/api-definition/const.d.ts.map +1 -0
  99. package/dist/api-definition/const.js +11 -0
  100. package/dist/api-definition/const.js.map +1 -0
  101. package/dist/api-definition/endpoint-context.d.ts +56 -0
  102. package/dist/api-definition/endpoint-context.d.ts.map +1 -0
  103. package/dist/api-definition/endpoint-context.js +250 -0
  104. package/dist/api-definition/endpoint-context.js.map +1 -0
  105. package/dist/api-definition/endpoint-path-literal.d.ts +11 -0
  106. package/dist/api-definition/endpoint-path-literal.d.ts.map +1 -0
  107. package/dist/api-definition/endpoint-path-literal.js +14 -0
  108. package/dist/api-definition/endpoint-path-literal.js.map +1 -0
  109. package/dist/api-definition/index.d.ts +17 -0
  110. package/dist/api-definition/index.d.ts.map +1 -0
  111. package/dist/api-definition/index.js +17 -0
  112. package/dist/api-definition/index.js.map +1 -0
  113. package/dist/api-definition/join.d.ts +11 -0
  114. package/dist/api-definition/join.d.ts.map +1 -0
  115. package/dist/api-definition/join.js +80 -0
  116. package/dist/api-definition/join.js.map +1 -0
  117. package/dist/api-definition/lang.d.ts +2 -0
  118. package/dist/api-definition/lang.d.ts.map +1 -0
  119. package/dist/api-definition/lang.js +17 -0
  120. package/dist/api-definition/lang.js.map +1 -0
  121. package/dist/api-definition/latest.d.ts +54 -0
  122. package/dist/api-definition/latest.d.ts.map +1 -0
  123. package/dist/api-definition/latest.js +7 -0
  124. package/dist/api-definition/latest.js.map +1 -0
  125. package/dist/api-definition/migrators/v1ToV2.d.ts +866 -0
  126. package/dist/api-definition/migrators/v1ToV2.d.ts.map +1 -0
  127. package/dist/api-definition/migrators/v1ToV2.js +839 -0
  128. package/dist/api-definition/migrators/v1ToV2.js.map +1 -0
  129. package/dist/api-definition/prune.d.ts +20 -0
  130. package/dist/api-definition/prune.d.ts.map +1 -0
  131. package/dist/api-definition/prune.js +146 -0
  132. package/dist/api-definition/prune.js.map +1 -0
  133. package/dist/api-definition/snippets/HttpSnippetConverter.d.ts +18 -0
  134. package/dist/api-definition/snippets/HttpSnippetConverter.d.ts.map +1 -0
  135. package/dist/api-definition/snippets/HttpSnippetConverter.js +228 -0
  136. package/dist/api-definition/snippets/HttpSnippetConverter.js.map +1 -0
  137. package/dist/api-definition/snippets/HttpSnippetConverter.test.d.ts +2 -0
  138. package/dist/api-definition/snippets/HttpSnippetConverter.test.d.ts.map +1 -0
  139. package/dist/api-definition/snippets/HttpSnippetConverter.test.js +290 -0
  140. package/dist/api-definition/snippets/HttpSnippetConverter.test.js.map +1 -0
  141. package/dist/api-definition/snippets/SnippetHttpRequest.d.ts +44 -0
  142. package/dist/api-definition/snippets/SnippetHttpRequest.d.ts.map +1 -0
  143. package/dist/api-definition/snippets/SnippetHttpRequest.js +140 -0
  144. package/dist/api-definition/snippets/SnippetHttpRequest.js.map +1 -0
  145. package/dist/api-definition/snippets/auth-scheme.d.ts +41 -0
  146. package/dist/api-definition/snippets/auth-scheme.d.ts.map +1 -0
  147. package/dist/api-definition/snippets/auth-scheme.js +128 -0
  148. package/dist/api-definition/snippets/auth-scheme.js.map +1 -0
  149. package/dist/api-definition/snippets/auth-scheme.test.d.ts +2 -0
  150. package/dist/api-definition/snippets/auth-scheme.test.d.ts.map +1 -0
  151. package/dist/api-definition/snippets/auth-scheme.test.js +166 -0
  152. package/dist/api-definition/snippets/auth-scheme.test.js.map +1 -0
  153. package/dist/api-definition/snippets/backfill.d.ts +18 -0
  154. package/dist/api-definition/snippets/backfill.d.ts.map +1 -0
  155. package/dist/api-definition/snippets/backfill.js +110 -0
  156. package/dist/api-definition/snippets/backfill.js.map +1 -0
  157. package/dist/api-definition/snippets/backfill.test.d.ts +2 -0
  158. package/dist/api-definition/snippets/backfill.test.d.ts.map +1 -0
  159. package/dist/api-definition/snippets/backfill.test.js +2618 -0
  160. package/dist/api-definition/snippets/backfill.test.js.map +1 -0
  161. package/dist/api-definition/snippets/constants.d.ts +7 -0
  162. package/dist/api-definition/snippets/constants.d.ts.map +1 -0
  163. package/dist/api-definition/snippets/constants.js +15 -0
  164. package/dist/api-definition/snippets/constants.js.map +1 -0
  165. package/dist/api-definition/snippets/curl.d.ts +4 -0
  166. package/dist/api-definition/snippets/curl.d.ts.map +1 -0
  167. package/dist/api-definition/snippets/curl.js +194 -0
  168. package/dist/api-definition/snippets/curl.js.map +1 -0
  169. package/dist/api-definition/snippets/curl.test.d.ts +2 -0
  170. package/dist/api-definition/snippets/curl.test.d.ts.map +1 -0
  171. package/dist/api-definition/snippets/curl.test.js +552 -0
  172. package/dist/api-definition/snippets/curl.test.js.map +1 -0
  173. package/dist/api-definition/snippets/generators.d.ts +14 -0
  174. package/dist/api-definition/snippets/generators.d.ts.map +1 -0
  175. package/dist/api-definition/snippets/generators.js +85 -0
  176. package/dist/api-definition/snippets/generators.js.map +1 -0
  177. package/dist/api-definition/snippets/get-har-request.d.ts +11 -0
  178. package/dist/api-definition/snippets/get-har-request.d.ts.map +1 -0
  179. package/dist/api-definition/snippets/get-har-request.js +172 -0
  180. package/dist/api-definition/snippets/get-har-request.js.map +1 -0
  181. package/dist/api-definition/snippets/get-har-request.test.d.ts +2 -0
  182. package/dist/api-definition/snippets/get-har-request.test.d.ts.map +1 -0
  183. package/dist/api-definition/snippets/get-har-request.test.js +282 -0
  184. package/dist/api-definition/snippets/get-har-request.test.js.map +1 -0
  185. package/dist/api-definition/snippets/graphql-snippets.d.ts +22 -0
  186. package/dist/api-definition/snippets/graphql-snippets.d.ts.map +1 -0
  187. package/dist/api-definition/snippets/graphql-snippets.js +492 -0
  188. package/dist/api-definition/snippets/graphql-snippets.js.map +1 -0
  189. package/dist/api-definition/snippets/graphql-snippets.test.d.ts +2 -0
  190. package/dist/api-definition/snippets/graphql-snippets.test.d.ts.map +1 -0
  191. package/dist/api-definition/snippets/graphql-snippets.test.js +973 -0
  192. package/dist/api-definition/snippets/graphql-snippets.test.js.map +1 -0
  193. package/dist/api-definition/snippets/http-snippets.d.ts +26 -0
  194. package/dist/api-definition/snippets/http-snippets.d.ts.map +1 -0
  195. package/dist/api-definition/snippets/http-snippets.js +96 -0
  196. package/dist/api-definition/snippets/http-snippets.js.map +1 -0
  197. package/dist/api-definition/snippets/index.d.ts +12 -0
  198. package/dist/api-definition/snippets/index.d.ts.map +1 -0
  199. package/dist/api-definition/snippets/index.js +19 -0
  200. package/dist/api-definition/snippets/index.js.map +1 -0
  201. package/dist/api-definition/snippets/multipart-filename-placeholder.d.ts +16 -0
  202. package/dist/api-definition/snippets/multipart-filename-placeholder.d.ts.map +1 -0
  203. package/dist/api-definition/snippets/multipart-filename-placeholder.js +32 -0
  204. package/dist/api-definition/snippets/multipart-filename-placeholder.js.map +1 -0
  205. package/dist/api-definition/snippets/multipart-filename-placeholder.test.d.ts +2 -0
  206. package/dist/api-definition/snippets/multipart-filename-placeholder.test.d.ts.map +1 -0
  207. package/dist/api-definition/snippets/multipart-filename-placeholder.test.js +33 -0
  208. package/dist/api-definition/snippets/multipart-filename-placeholder.test.js.map +1 -0
  209. package/dist/api-definition/snippets/sdk-snippets.d.ts +16 -0
  210. package/dist/api-definition/snippets/sdk-snippets.d.ts.map +1 -0
  211. package/dist/api-definition/snippets/sdk-snippets.js +139 -0
  212. package/dist/api-definition/snippets/sdk-snippets.js.map +1 -0
  213. package/dist/api-definition/snippets/sdk-snippets.test.d.ts +2 -0
  214. package/dist/api-definition/snippets/sdk-snippets.test.d.ts.map +1 -0
  215. package/dist/api-definition/snippets/sdk-snippets.test.js +132 -0
  216. package/dist/api-definition/snippets/sdk-snippets.test.js.map +1 -0
  217. package/dist/api-definition/snippets/server.d.ts +16 -0
  218. package/dist/api-definition/snippets/server.d.ts.map +1 -0
  219. package/dist/api-definition/snippets/server.js +16 -0
  220. package/dist/api-definition/snippets/server.js.map +1 -0
  221. package/dist/api-definition/snippets/types.d.ts +43 -0
  222. package/dist/api-definition/snippets/types.d.ts.map +1 -0
  223. package/dist/api-definition/snippets/types.js +11 -0
  224. package/dist/api-definition/snippets/types.js.map +1 -0
  225. package/dist/api-definition/sort-keys.d.ts +5 -0
  226. package/dist/api-definition/sort-keys.d.ts.map +1 -0
  227. package/dist/api-definition/sort-keys.js +103 -0
  228. package/dist/api-definition/sort-keys.js.map +1 -0
  229. package/dist/api-definition/status-message.d.ts +9 -0
  230. package/dist/api-definition/status-message.d.ts.map +1 -0
  231. package/dist/api-definition/status-message.js +111 -0
  232. package/dist/api-definition/status-message.js.map +1 -0
  233. package/dist/api-definition/transformer.d.ts +68 -0
  234. package/dist/api-definition/transformer.d.ts.map +1 -0
  235. package/dist/api-definition/transformer.js +370 -0
  236. package/dist/api-definition/transformer.js.map +1 -0
  237. package/dist/api-definition/typeid-visitor.d.ts +16 -0
  238. package/dist/api-definition/typeid-visitor.d.ts.map +1 -0
  239. package/dist/api-definition/typeid-visitor.js +136 -0
  240. package/dist/api-definition/typeid-visitor.js.map +1 -0
  241. package/dist/api-definition/types.d.ts +7 -0
  242. package/dist/api-definition/types.d.ts.map +1 -0
  243. package/dist/api-definition/types.js +2 -0
  244. package/dist/api-definition/types.js.map +1 -0
  245. package/dist/api-definition/unwrap.d.ts +48 -0
  246. package/dist/api-definition/unwrap.d.ts.map +1 -0
  247. package/dist/api-definition/unwrap.js +294 -0
  248. package/dist/api-definition/unwrap.js.map +1 -0
  249. package/dist/api-definition/url.d.ts +22 -0
  250. package/dist/api-definition/url.d.ts.map +1 -0
  251. package/dist/api-definition/url.js +89 -0
  252. package/dist/api-definition/url.js.map +1 -0
  253. package/dist/api-definition/wrapOpenRPCRequest.d.ts +14 -0
  254. package/dist/api-definition/wrapOpenRPCRequest.d.ts.map +1 -0
  255. package/dist/api-definition/wrapOpenRPCRequest.js +20 -0
  256. package/dist/api-definition/wrapOpenRPCRequest.js.map +1 -0
  257. package/dist/api-definition-lite/index.d.ts +17 -0
  258. package/dist/api-definition-lite/index.d.ts.map +1 -0
  259. package/dist/api-definition-lite/index.js +17 -0
  260. package/dist/api-definition-lite/index.js.map +1 -0
  261. package/dist/client/APIV1Db.d.ts +5 -0
  262. package/dist/client/APIV1Db.d.ts.map +1 -0
  263. package/dist/client/APIV1Db.js +7 -0
  264. package/dist/client/APIV1Db.js.map +1 -0
  265. package/dist/client/APIV1Read.d.ts +16 -0
  266. package/dist/client/APIV1Read.d.ts.map +1 -0
  267. package/dist/client/APIV1Read.js +15 -0
  268. package/dist/client/APIV1Read.js.map +1 -0
  269. package/dist/client/APIV1Write.d.ts +5 -0
  270. package/dist/client/APIV1Write.d.ts.map +1 -0
  271. package/dist/client/APIV1Write.js +7 -0
  272. package/dist/client/APIV1Write.js.map +1 -0
  273. package/dist/client/ApiLatestEndpoint.d.ts +2 -0
  274. package/dist/client/ApiLatestEndpoint.d.ts.map +1 -0
  275. package/dist/client/ApiLatestEndpoint.js +2 -0
  276. package/dist/client/ApiLatestEndpoint.js.map +1 -0
  277. package/dist/client/ApiLatestWebhook.d.ts +2 -0
  278. package/dist/client/ApiLatestWebhook.d.ts.map +1 -0
  279. package/dist/client/ApiLatestWebhook.js +2 -0
  280. package/dist/client/ApiLatestWebhook.js.map +1 -0
  281. package/dist/client/ApiLatestWebsocket.d.ts +2 -0
  282. package/dist/client/ApiLatestWebsocket.d.ts.map +1 -0
  283. package/dist/client/ApiLatestWebsocket.js +2 -0
  284. package/dist/client/ApiLatestWebsocket.js.map +1 -0
  285. package/dist/client/ApiLatestWithSubs.d.ts +5 -0
  286. package/dist/client/ApiLatestWithSubs.d.ts.map +1 -0
  287. package/dist/client/ApiLatestWithSubs.js +5 -0
  288. package/dist/client/ApiLatestWithSubs.js.map +1 -0
  289. package/dist/client/DocsLatest.d.ts +2 -0
  290. package/dist/client/DocsLatest.d.ts.map +1 -0
  291. package/dist/client/DocsLatest.js +2 -0
  292. package/dist/client/DocsLatest.js.map +1 -0
  293. package/dist/client/DocsV1Commons.d.ts +2 -0
  294. package/dist/client/DocsV1Commons.d.ts.map +1 -0
  295. package/dist/client/DocsV1Commons.js +2 -0
  296. package/dist/client/DocsV1Commons.js.map +1 -0
  297. package/dist/client/DocsV1Db.d.ts +2 -0
  298. package/dist/client/DocsV1Db.d.ts.map +1 -0
  299. package/dist/client/DocsV1Db.js +2 -0
  300. package/dist/client/DocsV1Db.js.map +1 -0
  301. package/dist/client/DocsV1Read.d.ts +2 -0
  302. package/dist/client/DocsV1Read.d.ts.map +1 -0
  303. package/dist/client/DocsV1Read.js +2 -0
  304. package/dist/client/DocsV1Read.js.map +1 -0
  305. package/dist/client/DocsV1Write.d.ts +2 -0
  306. package/dist/client/DocsV1Write.d.ts.map +1 -0
  307. package/dist/client/DocsV1Write.js +2 -0
  308. package/dist/client/DocsV1Write.js.map +1 -0
  309. package/dist/client/FdrAPI.d.ts +71 -0
  310. package/dist/client/FdrAPI.d.ts.map +1 -0
  311. package/dist/client/FdrAPI.js +59 -0
  312. package/dist/client/FdrAPI.js.map +1 -0
  313. package/dist/client/FdrClient.d.ts +881 -0
  314. package/dist/client/FdrClient.d.ts.map +1 -0
  315. package/dist/client/FdrClient.js +57 -0
  316. package/dist/client/FdrClient.js.map +1 -0
  317. package/dist/client/Sdks.d.ts +2 -0
  318. package/dist/client/Sdks.d.ts.map +1 -0
  319. package/dist/client/Sdks.js +2 -0
  320. package/dist/client/Sdks.js.map +1 -0
  321. package/dist/client/docs-types/__test__/collapsed.test.d.ts +2 -0
  322. package/dist/client/docs-types/__test__/collapsed.test.d.ts.map +1 -0
  323. package/dist/client/docs-types/__test__/collapsed.test.js +72 -0
  324. package/dist/client/docs-types/__test__/collapsed.test.js.map +1 -0
  325. package/dist/client/docs-types/db-commons.d.ts +3 -0
  326. package/dist/client/docs-types/db-commons.d.ts.map +1 -0
  327. package/dist/client/docs-types/db-commons.js +2 -0
  328. package/dist/client/docs-types/db-commons.js.map +1 -0
  329. package/dist/client/docs-types/db-docsCommons.d.ts +3 -0
  330. package/dist/client/docs-types/db-docsCommons.d.ts.map +1 -0
  331. package/dist/client/docs-types/db-docsCommons.js +2 -0
  332. package/dist/client/docs-types/db-docsCommons.js.map +1 -0
  333. package/dist/client/docs-types/db-docsRead.d.ts +4671 -0
  334. package/dist/client/docs-types/db-docsRead.d.ts.map +1 -0
  335. package/dist/client/docs-types/db-docsRead.js +40 -0
  336. package/dist/client/docs-types/db-docsRead.js.map +1 -0
  337. package/dist/client/docs-types/db.d.ts +68568 -0
  338. package/dist/client/docs-types/db.d.ts.map +1 -0
  339. package/dist/client/docs-types/db.js +202 -0
  340. package/dist/client/docs-types/db.js.map +1 -0
  341. package/dist/client/docs-types/latest.d.ts +2421 -0
  342. package/dist/client/docs-types/latest.d.ts.map +1 -0
  343. package/dist/client/docs-types/latest.js +90 -0
  344. package/dist/client/docs-types/latest.js.map +1 -0
  345. package/dist/client/docs-types/read-commons.d.ts +9 -0
  346. package/dist/client/docs-types/read-commons.d.ts.map +1 -0
  347. package/dist/client/docs-types/read-commons.js +7 -0
  348. package/dist/client/docs-types/read-commons.js.map +1 -0
  349. package/dist/client/docs-types/read.d.ts +37090 -0
  350. package/dist/client/docs-types/read.d.ts.map +1 -0
  351. package/dist/client/docs-types/read.js +190 -0
  352. package/dist/client/docs-types/read.js.map +1 -0
  353. package/dist/client/docs-types/shared.d.ts +4139 -0
  354. package/dist/client/docs-types/shared.d.ts.map +1 -0
  355. package/dist/client/docs-types/shared.js +611 -0
  356. package/dist/client/docs-types/shared.js.map +1 -0
  357. package/dist/client/docs-types/write-commons.d.ts +9 -0
  358. package/dist/client/docs-types/write-commons.d.ts.map +1 -0
  359. package/dist/client/docs-types/write-commons.js +7 -0
  360. package/dist/client/docs-types/write-commons.js.map +1 -0
  361. package/dist/client/docs-types/write.d.ts +27765 -0
  362. package/dist/client/docs-types/write.d.ts.map +1 -0
  363. package/dist/client/docs-types/write.js +316 -0
  364. package/dist/client/docs-types/write.js.map +1 -0
  365. package/dist/client/index.d.ts +7 -0
  366. package/dist/client/index.d.ts.map +1 -0
  367. package/dist/client/index.js +7 -0
  368. package/dist/client/index.js.map +1 -0
  369. package/dist/client/libraryDocs.d.ts +381 -0
  370. package/dist/client/libraryDocs.d.ts.map +1 -0
  371. package/dist/client/libraryDocs.js +23 -0
  372. package/dist/client/libraryDocs.js.map +1 -0
  373. package/dist/client/types.d.ts +24 -0
  374. package/dist/client/types.d.ts.map +1 -0
  375. package/dist/client/types.js +11 -0
  376. package/dist/client/types.js.map +1 -0
  377. package/dist/client/visitDbNavigationConfig.d.ts +13 -0
  378. package/dist/client/visitDbNavigationConfig.d.ts.map +1 -0
  379. package/dist/client/visitDbNavigationConfig.js +24 -0
  380. package/dist/client/visitDbNavigationConfig.js.map +1 -0
  381. package/dist/client/visitNavigationTab.d.ts +13 -0
  382. package/dist/client/visitNavigationTab.d.ts.map +1 -0
  383. package/dist/client/visitNavigationTab.js +20 -0
  384. package/dist/client/visitNavigationTab.js.map +1 -0
  385. package/dist/client/visitReadNavigationConfig.d.ts +13 -0
  386. package/dist/client/visitReadNavigationConfig.d.ts.map +1 -0
  387. package/dist/client/visitReadNavigationConfig.js +23 -0
  388. package/dist/client/visitReadNavigationConfig.js.map +1 -0
  389. package/dist/client/visitWriteNavigationConfig.d.ts +13 -0
  390. package/dist/client/visitWriteNavigationConfig.d.ts.map +1 -0
  391. package/dist/client/visitWriteNavigationConfig.js +24 -0
  392. package/dist/client/visitWriteNavigationConfig.js.map +1 -0
  393. package/dist/converters/__test__/subtitle-round-trip.test.d.ts +2 -0
  394. package/dist/converters/__test__/subtitle-round-trip.test.d.ts.map +1 -0
  395. package/dist/converters/__test__/subtitle-round-trip.test.js +53 -0
  396. package/dist/converters/__test__/subtitle-round-trip.test.js.map +1 -0
  397. package/dist/converters/db/convertAPIDefinitionToDb.d.ts +9 -0
  398. package/dist/converters/db/convertAPIDefinitionToDb.d.ts.map +1 -0
  399. package/dist/converters/db/convertAPIDefinitionToDb.js +617 -0
  400. package/dist/converters/db/convertAPIDefinitionToDb.js.map +1 -0
  401. package/dist/converters/db/convertDocsDefinitionToDb.d.ts +25 -0
  402. package/dist/converters/db/convertDocsDefinitionToDb.d.ts.map +1 -0
  403. package/dist/converters/db/convertDocsDefinitionToDb.js +505 -0
  404. package/dist/converters/db/convertDocsDefinitionToDb.js.map +1 -0
  405. package/dist/converters/db/examples/generateEndpointExampleCall.d.ts +21 -0
  406. package/dist/converters/db/examples/generateEndpointExampleCall.d.ts.map +1 -0
  407. package/dist/converters/db/examples/generateEndpointExampleCall.js +171 -0
  408. package/dist/converters/db/examples/generateEndpointExampleCall.js.map +1 -0
  409. package/dist/converters/db/examples/generateEndpointExampleCall.test.d.ts +2 -0
  410. package/dist/converters/db/examples/generateEndpointExampleCall.test.d.ts.map +1 -0
  411. package/dist/converters/db/examples/generateEndpointExampleCall.test.js +102 -0
  412. package/dist/converters/db/examples/generateEndpointExampleCall.test.js.map +1 -0
  413. package/dist/converters/db/examples/generateHttpBodyExample.d.ts +9 -0
  414. package/dist/converters/db/examples/generateHttpBodyExample.d.ts.map +1 -0
  415. package/dist/converters/db/examples/generateHttpBodyExample.js +344 -0
  416. package/dist/converters/db/examples/generateHttpBodyExample.js.map +1 -0
  417. package/dist/converters/db/examples/generateWebhookExample.d.ts +6 -0
  418. package/dist/converters/db/examples/generateWebhookExample.d.ts.map +1 -0
  419. package/dist/converters/db/examples/generateWebhookExample.js +11 -0
  420. package/dist/converters/db/examples/generateWebhookExample.js.map +1 -0
  421. package/dist/converters/db/snippets/SDKSnippetHolder.d.ts +82 -0
  422. package/dist/converters/db/snippets/SDKSnippetHolder.d.ts.map +1 -0
  423. package/dist/converters/db/snippets/SDKSnippetHolder.js +125 -0
  424. package/dist/converters/db/snippets/SDKSnippetHolder.js.map +1 -0
  425. package/dist/converters/db/upgrade/migrateDocsDbDefinition.d.ts +3 -0
  426. package/dist/converters/db/upgrade/migrateDocsDbDefinition.d.ts.map +1 -0
  427. package/dist/converters/db/upgrade/migrateDocsDbDefinition.js +22 -0
  428. package/dist/converters/db/upgrade/migrateDocsDbDefinition.js.map +1 -0
  429. package/dist/converters/db/upgrade/upgradeV1ToV2.d.ts +3 -0
  430. package/dist/converters/db/upgrade/upgradeV1ToV2.d.ts.map +1 -0
  431. package/dist/converters/db/upgrade/upgradeV1ToV2.js +4 -0
  432. package/dist/converters/db/upgrade/upgradeV1ToV2.js.map +1 -0
  433. package/dist/converters/db/upgrade/upgradeV2ToV3.d.ts +3 -0
  434. package/dist/converters/db/upgrade/upgradeV2ToV3.d.ts.map +1 -0
  435. package/dist/converters/db/upgrade/upgradeV2ToV3.js +15 -0
  436. package/dist/converters/db/upgrade/upgradeV2ToV3.js.map +1 -0
  437. package/dist/converters/index.d.ts +8 -0
  438. package/dist/converters/index.d.ts.map +1 -0
  439. package/dist/converters/index.js +8 -0
  440. package/dist/converters/index.js.map +1 -0
  441. package/dist/converters/read/convertDbAPIDefinitionToRead.d.ts +2582 -0
  442. package/dist/converters/read/convertDbAPIDefinitionToRead.d.ts.map +1 -0
  443. package/dist/converters/read/convertDbAPIDefinitionToRead.js +200 -0
  444. package/dist/converters/read/convertDbAPIDefinitionToRead.js.map +1 -0
  445. package/dist/converters/read/convertDbDocsConfigToRead.d.ts +11 -0
  446. package/dist/converters/read/convertDbDocsConfigToRead.d.ts.map +1 -0
  447. package/dist/converters/read/convertDbDocsConfigToRead.js +380 -0
  448. package/dist/converters/read/convertDbDocsConfigToRead.js.map +1 -0
  449. package/dist/converters/read/convertDocsDefinitionToRead.d.ts +10 -0
  450. package/dist/converters/read/convertDocsDefinitionToRead.d.ts.map +1 -0
  451. package/dist/converters/read/convertDocsDefinitionToRead.js +19 -0
  452. package/dist/converters/read/convertDocsDefinitionToRead.js.map +1 -0
  453. package/dist/converters/utils/colors.d.ts +4 -0
  454. package/dist/converters/utils/colors.d.ts.map +1 -0
  455. package/dist/converters/utils/colors.js +13 -0
  456. package/dist/converters/utils/colors.js.map +1 -0
  457. package/dist/docs/frontmatter.d.ts +3 -0
  458. package/dist/docs/frontmatter.d.ts.map +1 -0
  459. package/dist/docs/frontmatter.js +44 -0
  460. package/dist/docs/frontmatter.js.map +1 -0
  461. package/dist/docs/index.d.ts +4 -0
  462. package/dist/docs/index.d.ts.map +1 -0
  463. package/dist/docs/index.js +4 -0
  464. package/dist/docs/index.js.map +1 -0
  465. package/dist/docs/s3-docs-definition.d.ts +7 -0
  466. package/dist/docs/s3-docs-definition.d.ts.map +1 -0
  467. package/dist/docs/s3-docs-definition.js +15 -0
  468. package/dist/docs/s3-docs-definition.js.map +1 -0
  469. package/dist/docs/s3-docs-definition.test.d.ts +2 -0
  470. package/dist/docs/s3-docs-definition.test.d.ts.map +1 -0
  471. package/dist/docs/s3-docs-definition.test.js +29 -0
  472. package/dist/docs/s3-docs-definition.test.js.map +1 -0
  473. package/dist/index.d.ts +7 -0
  474. package/dist/index.d.ts.map +1 -0
  475. package/dist/index.js +7 -0
  476. package/dist/index.js.map +1 -0
  477. package/dist/navigation/ApiDefinitionHolder.d.ts +18 -0
  478. package/dist/navigation/ApiDefinitionHolder.d.ts.map +1 -0
  479. package/dist/navigation/ApiDefinitionHolder.js +59 -0
  480. package/dist/navigation/ApiDefinitionHolder.js.map +1 -0
  481. package/dist/navigation/ApiDefinitionPruner.d.ts +17 -0
  482. package/dist/navigation/ApiDefinitionPruner.d.ts.map +1 -0
  483. package/dist/navigation/ApiDefinitionPruner.js +137 -0
  484. package/dist/navigation/ApiDefinitionPruner.js.map +1 -0
  485. package/dist/navigation/ApiTypeIdVisitor.d.ts +17 -0
  486. package/dist/navigation/ApiTypeIdVisitor.d.ts.map +1 -0
  487. package/dist/navigation/ApiTypeIdVisitor.js +133 -0
  488. package/dist/navigation/ApiTypeIdVisitor.js.map +1 -0
  489. package/dist/navigation/NodeCollector.d.ts +55 -0
  490. package/dist/navigation/NodeCollector.d.ts.map +1 -0
  491. package/dist/navigation/NodeCollector.js +365 -0
  492. package/dist/navigation/NodeCollector.js.map +1 -0
  493. package/dist/navigation/__test__/NodeCollector.canonicalSlug.test.d.ts +2 -0
  494. package/dist/navigation/__test__/NodeCollector.canonicalSlug.test.d.ts.map +1 -0
  495. package/dist/navigation/__test__/NodeCollector.canonicalSlug.test.js +109 -0
  496. package/dist/navigation/__test__/NodeCollector.canonicalSlug.test.js.map +1 -0
  497. package/dist/navigation/__test__/NodeCollector.revalidationPageSlugs.test.d.ts +2 -0
  498. package/dist/navigation/__test__/NodeCollector.revalidationPageSlugs.test.d.ts.map +1 -0
  499. package/dist/navigation/__test__/NodeCollector.revalidationPageSlugs.test.js +593 -0
  500. package/dist/navigation/__test__/NodeCollector.revalidationPageSlugs.test.js.map +1 -0
  501. package/dist/navigation/__test__/collectLinkRedirects.test.d.ts +2 -0
  502. package/dist/navigation/__test__/collectLinkRedirects.test.d.ts.map +1 -0
  503. package/dist/navigation/__test__/collectLinkRedirects.test.js +157 -0
  504. package/dist/navigation/__test__/collectLinkRedirects.test.js.map +1 -0
  505. package/dist/navigation/__test__/findNode.authedRedirect.test.d.ts +2 -0
  506. package/dist/navigation/__test__/findNode.authedRedirect.test.d.ts.map +1 -0
  507. package/dist/navigation/__test__/findNode.authedRedirect.test.js +184 -0
  508. package/dist/navigation/__test__/findNode.authedRedirect.test.js.map +1 -0
  509. package/dist/navigation/__test__/ledger-root-builder.apiReferenceChildren.test.d.ts +2 -0
  510. package/dist/navigation/__test__/ledger-root-builder.apiReferenceChildren.test.d.ts.map +1 -0
  511. package/dist/navigation/__test__/ledger-root-builder.apiReferenceChildren.test.js +85 -0
  512. package/dist/navigation/__test__/ledger-root-builder.apiReferenceChildren.test.js.map +1 -0
  513. package/dist/navigation/__test__/ledger-root-builder.changelogSlug.test.d.ts +2 -0
  514. package/dist/navigation/__test__/ledger-root-builder.changelogSlug.test.d.ts.map +1 -0
  515. package/dist/navigation/__test__/ledger-root-builder.changelogSlug.test.js +204 -0
  516. package/dist/navigation/__test__/ledger-root-builder.changelogSlug.test.js.map +1 -0
  517. package/dist/navigation/__test__/ledger-root-builder.collapsedDeterminism.test.d.ts +2 -0
  518. package/dist/navigation/__test__/ledger-root-builder.collapsedDeterminism.test.d.ts.map +1 -0
  519. package/dist/navigation/__test__/ledger-root-builder.collapsedDeterminism.test.js +85 -0
  520. package/dist/navigation/__test__/ledger-root-builder.collapsedDeterminism.test.js.map +1 -0
  521. package/dist/navigation/__test__/ledger-root-builder.defaultVersionElision.test.d.ts +2 -0
  522. package/dist/navigation/__test__/ledger-root-builder.defaultVersionElision.test.d.ts.map +1 -0
  523. package/dist/navigation/__test__/ledger-root-builder.defaultVersionElision.test.js +267 -0
  524. package/dist/navigation/__test__/ledger-root-builder.defaultVersionElision.test.js.map +1 -0
  525. package/dist/navigation/__test__/ledger-root-builder.landingPage.test.d.ts +2 -0
  526. package/dist/navigation/__test__/ledger-root-builder.landingPage.test.d.ts.map +1 -0
  527. package/dist/navigation/__test__/ledger-root-builder.landingPage.test.js +82 -0
  528. package/dist/navigation/__test__/ledger-root-builder.landingPage.test.js.map +1 -0
  529. package/dist/navigation/__test__/ledger-root-builder.linkRepro.test.d.ts +2 -0
  530. package/dist/navigation/__test__/ledger-root-builder.linkRepro.test.d.ts.map +1 -0
  531. package/dist/navigation/__test__/ledger-root-builder.linkRepro.test.js +164 -0
  532. package/dist/navigation/__test__/ledger-root-builder.linkRepro.test.js.map +1 -0
  533. package/dist/navigation/__test__/ledger-root-builder.mergeEndpointPairs.test.d.ts +2 -0
  534. package/dist/navigation/__test__/ledger-root-builder.mergeEndpointPairs.test.d.ts.map +1 -0
  535. package/dist/navigation/__test__/ledger-root-builder.mergeEndpointPairs.test.js +72 -0
  536. package/dist/navigation/__test__/ledger-root-builder.mergeEndpointPairs.test.js.map +1 -0
  537. package/dist/navigation/__test__/ledger-root-builder.metadataPreservation.test.d.ts +2 -0
  538. package/dist/navigation/__test__/ledger-root-builder.metadataPreservation.test.d.ts.map +1 -0
  539. package/dist/navigation/__test__/ledger-root-builder.metadataPreservation.test.js +1031 -0
  540. package/dist/navigation/__test__/ledger-root-builder.metadataPreservation.test.js.map +1 -0
  541. package/dist/navigation/__test__/ledger-root-builder.pointsTo.test.d.ts +2 -0
  542. package/dist/navigation/__test__/ledger-root-builder.pointsTo.test.d.ts.map +1 -0
  543. package/dist/navigation/__test__/ledger-root-builder.pointsTo.test.js +94 -0
  544. package/dist/navigation/__test__/ledger-root-builder.pointsTo.test.js.map +1 -0
  545. package/dist/navigation/__test__/ledger-root-builder.productId.test.d.ts +2 -0
  546. package/dist/navigation/__test__/ledger-root-builder.productId.test.d.ts.map +1 -0
  547. package/dist/navigation/__test__/ledger-root-builder.productId.test.js +102 -0
  548. package/dist/navigation/__test__/ledger-root-builder.productId.test.js.map +1 -0
  549. package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.d.ts +2 -0
  550. package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.d.ts.map +1 -0
  551. package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js +205 -0
  552. package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js.map +1 -0
  553. package/dist/navigation/__test__/ledger-root-builder.rootSectionSlug.test.d.ts +2 -0
  554. package/dist/navigation/__test__/ledger-root-builder.rootSectionSlug.test.d.ts.map +1 -0
  555. package/dist/navigation/__test__/ledger-root-builder.rootSectionSlug.test.js +439 -0
  556. package/dist/navigation/__test__/ledger-root-builder.rootSectionSlug.test.js.map +1 -0
  557. package/dist/navigation/__test__/ledger-root-builder.rootSlug.test.d.ts +2 -0
  558. package/dist/navigation/__test__/ledger-root-builder.rootSlug.test.d.ts.map +1 -0
  559. package/dist/navigation/__test__/ledger-root-builder.rootSlug.test.js +47 -0
  560. package/dist/navigation/__test__/ledger-root-builder.rootSlug.test.js.map +1 -0
  561. package/dist/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.d.ts +2 -0
  562. package/dist/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.d.ts.map +1 -0
  563. package/dist/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.js +210 -0
  564. package/dist/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.js.map +1 -0
  565. package/dist/navigation/__test__/ledger-root-builder.skipSlugTabs.test.d.ts +2 -0
  566. package/dist/navigation/__test__/ledger-root-builder.skipSlugTabs.test.d.ts.map +1 -0
  567. package/dist/navigation/__test__/ledger-root-builder.skipSlugTabs.test.js +284 -0
  568. package/dist/navigation/__test__/ledger-root-builder.skipSlugTabs.test.js.map +1 -0
  569. package/dist/navigation/__test__/ledger-root-builder.tabSlug.test.d.ts +2 -0
  570. package/dist/navigation/__test__/ledger-root-builder.tabSlug.test.d.ts.map +1 -0
  571. package/dist/navigation/__test__/ledger-root-builder.tabSlug.test.js +308 -0
  572. package/dist/navigation/__test__/ledger-root-builder.tabSlug.test.js.map +1 -0
  573. package/dist/navigation/__test__/ledger-root-builder.unversionedPointsTo.test.d.ts +2 -0
  574. package/dist/navigation/__test__/ledger-root-builder.unversionedPointsTo.test.d.ts.map +1 -0
  575. package/dist/navigation/__test__/ledger-root-builder.unversionedPointsTo.test.js +150 -0
  576. package/dist/navigation/__test__/ledger-root-builder.unversionedPointsTo.test.js.map +1 -0
  577. package/dist/navigation/__test__/ledger-root-builder.variantSharedSegments.test.d.ts +2 -0
  578. package/dist/navigation/__test__/ledger-root-builder.variantSharedSegments.test.d.ts.map +1 -0
  579. package/dist/navigation/__test__/ledger-root-builder.variantSharedSegments.test.js +262 -0
  580. package/dist/navigation/__test__/ledger-root-builder.variantSharedSegments.test.js.map +1 -0
  581. package/dist/navigation/consts.d.ts +2 -0
  582. package/dist/navigation/consts.d.ts.map +1 -0
  583. package/dist/navigation/consts.js +2 -0
  584. package/dist/navigation/consts.js.map +1 -0
  585. package/dist/navigation/index.d.ts +13 -0
  586. package/dist/navigation/index.d.ts.map +1 -0
  587. package/dist/navigation/index.js +13 -0
  588. package/dist/navigation/index.js.map +1 -0
  589. package/dist/navigation/ledger-root-builder.d.ts +124 -0
  590. package/dist/navigation/ledger-root-builder.d.ts.map +1 -0
  591. package/dist/navigation/ledger-root-builder.js +1923 -0
  592. package/dist/navigation/ledger-root-builder.js.map +1 -0
  593. package/dist/navigation/migrators/__test__/collapsed.test.d.ts +2 -0
  594. package/dist/navigation/migrators/__test__/collapsed.test.d.ts.map +1 -0
  595. package/dist/navigation/migrators/__test__/collapsed.test.js +100 -0
  596. package/dist/navigation/migrators/__test__/collapsed.test.js.map +1 -0
  597. package/dist/navigation/migrators/index.d.ts +2 -0
  598. package/dist/navigation/migrators/index.d.ts.map +1 -0
  599. package/dist/navigation/migrators/index.js +2 -0
  600. package/dist/navigation/migrators/index.js.map +1 -0
  601. package/dist/navigation/migrators/v1ToV2.d.ts +42 -0
  602. package/dist/navigation/migrators/v1ToV2.d.ts.map +1 -0
  603. package/dist/navigation/migrators/v1ToV2.js +846 -0
  604. package/dist/navigation/migrators/v1ToV2.js.map +1 -0
  605. package/dist/navigation/types/latest.d.ts +268 -0
  606. package/dist/navigation/types/latest.d.ts.map +1 -0
  607. package/dist/navigation/types/latest.js +16 -0
  608. package/dist/navigation/types/latest.js.map +1 -0
  609. package/dist/navigation/types/v1.d.ts +255 -0
  610. package/dist/navigation/types/v1.d.ts.map +1 -0
  611. package/dist/navigation/types/v1.js +27 -0
  612. package/dist/navigation/types/v1.js.map +1 -0
  613. package/dist/navigation/utils/__test__/canonicalSlugKey.test.d.ts +2 -0
  614. package/dist/navigation/utils/__test__/canonicalSlugKey.test.d.ts.map +1 -0
  615. package/dist/navigation/utils/__test__/canonicalSlugKey.test.js +41 -0
  616. package/dist/navigation/utils/__test__/canonicalSlugKey.test.js.map +1 -0
  617. package/dist/navigation/utils/__test__/followRedirects.test.d.ts +2 -0
  618. package/dist/navigation/utils/__test__/followRedirects.test.d.ts.map +1 -0
  619. package/dist/navigation/utils/__test__/followRedirects.test.js +134 -0
  620. package/dist/navigation/utils/__test__/followRedirects.test.js.map +1 -0
  621. package/dist/navigation/utils/__test__/pruneNavigationTree.test.d.ts +2 -0
  622. package/dist/navigation/utils/__test__/pruneNavigationTree.test.d.ts.map +1 -0
  623. package/dist/navigation/utils/__test__/pruneNavigationTree.test.js +841 -0
  624. package/dist/navigation/utils/__test__/pruneNavigationTree.test.js.map +1 -0
  625. package/dist/navigation/utils/__test__/skip-slug-tab-pointsto.test.d.ts +2 -0
  626. package/dist/navigation/utils/__test__/skip-slug-tab-pointsto.test.d.ts.map +1 -0
  627. package/dist/navigation/utils/__test__/skip-slug-tab-pointsto.test.js +265 -0
  628. package/dist/navigation/utils/__test__/skip-slug-tab-pointsto.test.js.map +1 -0
  629. package/dist/navigation/utils/__test__/toUnversionedSlug.test.d.ts +2 -0
  630. package/dist/navigation/utils/__test__/toUnversionedSlug.test.d.ts.map +1 -0
  631. package/dist/navigation/utils/__test__/toUnversionedSlug.test.js +17 -0
  632. package/dist/navigation/utils/__test__/toUnversionedSlug.test.js.map +1 -0
  633. package/dist/navigation/utils/buildPageIdToSlugMap.d.ts +14 -0
  634. package/dist/navigation/utils/buildPageIdToSlugMap.d.ts.map +1 -0
  635. package/dist/navigation/utils/buildPageIdToSlugMap.js +39 -0
  636. package/dist/navigation/utils/buildPageIdToSlugMap.js.map +1 -0
  637. package/dist/navigation/utils/canonicalSlugKey.d.ts +22 -0
  638. package/dist/navigation/utils/canonicalSlugKey.d.ts.map +1 -0
  639. package/dist/navigation/utils/canonicalSlugKey.js +29 -0
  640. package/dist/navigation/utils/canonicalSlugKey.js.map +1 -0
  641. package/dist/navigation/utils/collectApiReferences.d.ts +3 -0
  642. package/dist/navigation/utils/collectApiReferences.d.ts.map +1 -0
  643. package/dist/navigation/utils/collectApiReferences.js +13 -0
  644. package/dist/navigation/utils/collectApiReferences.js.map +1 -0
  645. package/dist/navigation/utils/collectLinkRedirects.d.ts +20 -0
  646. package/dist/navigation/utils/collectLinkRedirects.d.ts.map +1 -0
  647. package/dist/navigation/utils/collectLinkRedirects.js +47 -0
  648. package/dist/navigation/utils/collectLinkRedirects.js.map +1 -0
  649. package/dist/navigation/utils/collectPageIds.d.ts +3 -0
  650. package/dist/navigation/utils/collectPageIds.d.ts.map +1 -0
  651. package/dist/navigation/utils/collectPageIds.js +15 -0
  652. package/dist/navigation/utils/collectPageIds.js.map +1 -0
  653. package/dist/navigation/utils/createBreadcrumb.d.ts +3 -0
  654. package/dist/navigation/utils/createBreadcrumb.d.ts.map +1 -0
  655. package/dist/navigation/utils/createBreadcrumb.js +59 -0
  656. package/dist/navigation/utils/createBreadcrumb.js.map +1 -0
  657. package/dist/navigation/utils/deleteChild.d.ts +9 -0
  658. package/dist/navigation/utils/deleteChild.d.ts.map +1 -0
  659. package/dist/navigation/utils/deleteChild.js +111 -0
  660. package/dist/navigation/utils/deleteChild.js.map +1 -0
  661. package/dist/navigation/utils/findNode.d.ts +56 -0
  662. package/dist/navigation/utils/findNode.d.ts.map +1 -0
  663. package/dist/navigation/utils/findNode.js +201 -0
  664. package/dist/navigation/utils/findNode.js.map +1 -0
  665. package/dist/navigation/utils/followRedirect.d.ts +4 -0
  666. package/dist/navigation/utils/followRedirect.d.ts.map +1 -0
  667. package/dist/navigation/utils/followRedirect.js +67 -0
  668. package/dist/navigation/utils/followRedirect.js.map +1 -0
  669. package/dist/navigation/utils/getApiReferenceId.d.ts +3 -0
  670. package/dist/navigation/utils/getApiReferenceId.d.ts.map +1 -0
  671. package/dist/navigation/utils/getApiReferenceId.js +42 -0
  672. package/dist/navigation/utils/getApiReferenceId.js.map +1 -0
  673. package/dist/navigation/utils/getFrontmatter.d.ts +6 -0
  674. package/dist/navigation/utils/getFrontmatter.d.ts.map +1 -0
  675. package/dist/navigation/utils/getFrontmatter.js +12 -0
  676. package/dist/navigation/utils/getFrontmatter.js.map +1 -0
  677. package/dist/navigation/utils/getNoIndexFromFrontmatter.d.ts +5 -0
  678. package/dist/navigation/utils/getNoIndexFromFrontmatter.d.ts.map +1 -0
  679. package/dist/navigation/utils/getNoIndexFromFrontmatter.js +13 -0
  680. package/dist/navigation/utils/getNoIndexFromFrontmatter.js.map +1 -0
  681. package/dist/navigation/utils/index.d.ts +15 -0
  682. package/dist/navigation/utils/index.d.ts.map +1 -0
  683. package/dist/navigation/utils/index.js +15 -0
  684. package/dist/navigation/utils/index.js.map +1 -0
  685. package/dist/navigation/utils/isSubpackage.d.ts +3 -0
  686. package/dist/navigation/utils/isSubpackage.d.ts.map +1 -0
  687. package/dist/navigation/utils/isSubpackage.js +4 -0
  688. package/dist/navigation/utils/isSubpackage.js.map +1 -0
  689. package/dist/navigation/utils/pruneNavigationTree.d.ts +21 -0
  690. package/dist/navigation/utils/pruneNavigationTree.d.ts.map +1 -0
  691. package/dist/navigation/utils/pruneNavigationTree.js +79 -0
  692. package/dist/navigation/utils/pruneNavigationTree.js.map +1 -0
  693. package/dist/navigation/utils/pruneVersionNode.d.ts +4 -0
  694. package/dist/navigation/utils/pruneVersionNode.d.ts.map +1 -0
  695. package/dist/navigation/utils/pruneVersionNode.js +23 -0
  696. package/dist/navigation/utils/pruneVersionNode.js.map +1 -0
  697. package/dist/navigation/utils/stringifyEndpointPathParts.d.ts +3 -0
  698. package/dist/navigation/utils/stringifyEndpointPathParts.d.ts.map +1 -0
  699. package/dist/navigation/utils/stringifyEndpointPathParts.js +5 -0
  700. package/dist/navigation/utils/stringifyEndpointPathParts.js.map +1 -0
  701. package/dist/navigation/utils/toApis.d.ts +314 -0
  702. package/dist/navigation/utils/toApis.d.ts.map +1 -0
  703. package/dist/navigation/utils/toApis.js +6 -0
  704. package/dist/navigation/utils/toApis.js.map +1 -0
  705. package/dist/navigation/utils/toPages.d.ts +3 -0
  706. package/dist/navigation/utils/toPages.d.ts.map +1 -0
  707. package/dist/navigation/utils/toPages.js +5 -0
  708. package/dist/navigation/utils/toPages.js.map +1 -0
  709. package/dist/navigation/utils/toRootNode.d.ts +3 -0
  710. package/dist/navigation/utils/toRootNode.d.ts.map +1 -0
  711. package/dist/navigation/utils/toRootNode.js +11 -0
  712. package/dist/navigation/utils/toRootNode.js.map +1 -0
  713. package/dist/navigation/utils/toUnversionedSlug.d.ts +8 -0
  714. package/dist/navigation/utils/toUnversionedSlug.d.ts.map +1 -0
  715. package/dist/navigation/utils/toUnversionedSlug.js +11 -0
  716. package/dist/navigation/utils/toUnversionedSlug.js.map +1 -0
  717. package/dist/navigation/utils/updatePointsTo.d.ts +8 -0
  718. package/dist/navigation/utils/updatePointsTo.d.ts.map +1 -0
  719. package/dist/navigation/utils/updatePointsTo.js +48 -0
  720. package/dist/navigation/utils/updatePointsTo.js.map +1 -0
  721. package/dist/navigation/versions/index.d.ts +3 -0
  722. package/dist/navigation/versions/index.d.ts.map +1 -0
  723. package/dist/navigation/versions/index.js +3 -0
  724. package/dist/navigation/versions/index.js.map +1 -0
  725. package/dist/navigation/versions/latest/NavigationNode.d.ts +6 -0
  726. package/dist/navigation/versions/latest/NavigationNode.d.ts.map +1 -0
  727. package/dist/navigation/versions/latest/NavigationNode.js +2 -0
  728. package/dist/navigation/versions/latest/NavigationNode.js.map +1 -0
  729. package/dist/navigation/versions/latest/NavigationNodeApiLeaf.d.ts +8 -0
  730. package/dist/navigation/versions/latest/NavigationNodeApiLeaf.d.ts.map +1 -0
  731. package/dist/navigation/versions/latest/NavigationNodeApiLeaf.js +9 -0
  732. package/dist/navigation/versions/latest/NavigationNodeApiLeaf.js.map +1 -0
  733. package/dist/navigation/versions/latest/NavigationNodeLeaf.d.ts +10 -0
  734. package/dist/navigation/versions/latest/NavigationNodeLeaf.d.ts.map +1 -0
  735. package/dist/navigation/versions/latest/NavigationNodeLeaf.js +6 -0
  736. package/dist/navigation/versions/latest/NavigationNodeLeaf.js.map +1 -0
  737. package/dist/navigation/versions/latest/NavigationNodeMarkdown.d.ts +9 -0
  738. package/dist/navigation/versions/latest/NavigationNodeMarkdown.d.ts.map +1 -0
  739. package/dist/navigation/versions/latest/NavigationNodeMarkdown.js +6 -0
  740. package/dist/navigation/versions/latest/NavigationNodeMarkdown.js.map +1 -0
  741. package/dist/navigation/versions/latest/NavigationNodeNeighbor.d.ts +7 -0
  742. package/dist/navigation/versions/latest/NavigationNodeNeighbor.d.ts.map +1 -0
  743. package/dist/navigation/versions/latest/NavigationNodeNeighbor.js +10 -0
  744. package/dist/navigation/versions/latest/NavigationNodeNeighbor.js.map +1 -0
  745. package/dist/navigation/versions/latest/NavigationNodePage.d.ts +10 -0
  746. package/dist/navigation/versions/latest/NavigationNodePage.d.ts.map +1 -0
  747. package/dist/navigation/versions/latest/NavigationNodePage.js +13 -0
  748. package/dist/navigation/versions/latest/NavigationNodePage.js.map +1 -0
  749. package/dist/navigation/versions/latest/NavigationNodePageLeaf.d.ts +8 -0
  750. package/dist/navigation/versions/latest/NavigationNodePageLeaf.d.ts.map +1 -0
  751. package/dist/navigation/versions/latest/NavigationNodePageLeaf.js +4 -0
  752. package/dist/navigation/versions/latest/NavigationNodePageLeaf.js.map +1 -0
  753. package/dist/navigation/versions/latest/NavigationNodeParent.d.ts +4 -0
  754. package/dist/navigation/versions/latest/NavigationNodeParent.d.ts.map +1 -0
  755. package/dist/navigation/versions/latest/NavigationNodeParent.js +2 -0
  756. package/dist/navigation/versions/latest/NavigationNodeParent.js.map +1 -0
  757. package/dist/navigation/versions/latest/NavigationNodeSection.d.ts +8 -0
  758. package/dist/navigation/versions/latest/NavigationNodeSection.d.ts.map +1 -0
  759. package/dist/navigation/versions/latest/NavigationNodeSection.js +7 -0
  760. package/dist/navigation/versions/latest/NavigationNodeSection.js.map +1 -0
  761. package/dist/navigation/versions/latest/NavigationNodeSectionOverview.d.ts +13 -0
  762. package/dist/navigation/versions/latest/NavigationNodeSectionOverview.d.ts.map +1 -0
  763. package/dist/navigation/versions/latest/NavigationNodeSectionOverview.js +5 -0
  764. package/dist/navigation/versions/latest/NavigationNodeSectionOverview.js.map +1 -0
  765. package/dist/navigation/versions/latest/NavigationNodeWithMetadata.d.ts +8 -0
  766. package/dist/navigation/versions/latest/NavigationNodeWithMetadata.d.ts.map +1 -0
  767. package/dist/navigation/versions/latest/NavigationNodeWithMetadata.js +5 -0
  768. package/dist/navigation/versions/latest/NavigationNodeWithMetadata.js.map +1 -0
  769. package/dist/navigation/versions/latest/NavigationNodeWithRedirect.d.ts +14 -0
  770. package/dist/navigation/versions/latest/NavigationNodeWithRedirect.d.ts.map +1 -0
  771. package/dist/navigation/versions/latest/NavigationNodeWithRedirect.js +19 -0
  772. package/dist/navigation/versions/latest/NavigationNodeWithRedirect.js.map +1 -0
  773. package/dist/navigation/versions/latest/NavigationNodeWithSlug.d.ts +10 -0
  774. package/dist/navigation/versions/latest/NavigationNodeWithSlug.d.ts.map +1 -0
  775. package/dist/navigation/versions/latest/NavigationNodeWithSlug.js +4 -0
  776. package/dist/navigation/versions/latest/NavigationNodeWithSlug.js.map +1 -0
  777. package/dist/navigation/versions/latest/__test__/GraphQlTypeNode.test.d.ts +2 -0
  778. package/dist/navigation/versions/latest/__test__/GraphQlTypeNode.test.d.ts.map +1 -0
  779. package/dist/navigation/versions/latest/__test__/GraphQlTypeNode.test.js +56 -0
  780. package/dist/navigation/versions/latest/__test__/GraphQlTypeNode.test.js.map +1 -0
  781. package/dist/navigation/versions/latest/__test__/slugjoin.test.d.ts +2 -0
  782. package/dist/navigation/versions/latest/__test__/slugjoin.test.d.ts.map +1 -0
  783. package/dist/navigation/versions/latest/__test__/slugjoin.test.js +22 -0
  784. package/dist/navigation/versions/latest/__test__/slugjoin.test.js.map +1 -0
  785. package/dist/navigation/versions/latest/getChildren.d.ts +3 -0
  786. package/dist/navigation/versions/latest/getChildren.d.ts.map +1 -0
  787. package/dist/navigation/versions/latest/getChildren.js +40 -0
  788. package/dist/navigation/versions/latest/getChildren.js.map +1 -0
  789. package/dist/navigation/versions/latest/getPageId.d.ts +3 -0
  790. package/dist/navigation/versions/latest/getPageId.d.ts.map +1 -0
  791. package/dist/navigation/versions/latest/getPageId.js +25 -0
  792. package/dist/navigation/versions/latest/getPageId.js.map +1 -0
  793. package/dist/navigation/versions/latest/index.d.ts +34 -0
  794. package/dist/navigation/versions/latest/index.d.ts.map +1 -0
  795. package/dist/navigation/versions/latest/index.js +34 -0
  796. package/dist/navigation/versions/latest/index.js.map +1 -0
  797. package/dist/navigation/versions/latest/isApiReferenceNode.d.ts +3 -0
  798. package/dist/navigation/versions/latest/isApiReferenceNode.d.ts.map +1 -0
  799. package/dist/navigation/versions/latest/isApiReferenceNode.js +4 -0
  800. package/dist/navigation/versions/latest/isApiReferenceNode.js.map +1 -0
  801. package/dist/navigation/versions/latest/isExternalProductNode.d.ts +3 -0
  802. package/dist/navigation/versions/latest/isExternalProductNode.d.ts.map +1 -0
  803. package/dist/navigation/versions/latest/isExternalProductNode.js +4 -0
  804. package/dist/navigation/versions/latest/isExternalProductNode.js.map +1 -0
  805. package/dist/navigation/versions/latest/isInternalProductNode.d.ts +3 -0
  806. package/dist/navigation/versions/latest/isInternalProductNode.d.ts.map +1 -0
  807. package/dist/navigation/versions/latest/isInternalProductNode.js +4 -0
  808. package/dist/navigation/versions/latest/isInternalProductNode.js.map +1 -0
  809. package/dist/navigation/versions/latest/isProductGroupNode.d.ts +3 -0
  810. package/dist/navigation/versions/latest/isProductGroupNode.d.ts.map +1 -0
  811. package/dist/navigation/versions/latest/isProductGroupNode.js +4 -0
  812. package/dist/navigation/versions/latest/isProductGroupNode.js.map +1 -0
  813. package/dist/navigation/versions/latest/isProductNode.d.ts +3 -0
  814. package/dist/navigation/versions/latest/isProductNode.d.ts.map +1 -0
  815. package/dist/navigation/versions/latest/isProductNode.js +4 -0
  816. package/dist/navigation/versions/latest/isProductNode.js.map +1 -0
  817. package/dist/navigation/versions/latest/isSidebarRootNode.d.ts +3 -0
  818. package/dist/navigation/versions/latest/isSidebarRootNode.d.ts.map +1 -0
  819. package/dist/navigation/versions/latest/isSidebarRootNode.js +4 -0
  820. package/dist/navigation/versions/latest/isSidebarRootNode.js.map +1 -0
  821. package/dist/navigation/versions/latest/isTabbedNode.d.ts +3 -0
  822. package/dist/navigation/versions/latest/isTabbedNode.d.ts.map +1 -0
  823. package/dist/navigation/versions/latest/isTabbedNode.js +4 -0
  824. package/dist/navigation/versions/latest/isTabbedNode.js.map +1 -0
  825. package/dist/navigation/versions/latest/isUnversionedNode.d.ts +3 -0
  826. package/dist/navigation/versions/latest/isUnversionedNode.d.ts.map +1 -0
  827. package/dist/navigation/versions/latest/isUnversionedNode.js +4 -0
  828. package/dist/navigation/versions/latest/isUnversionedNode.js.map +1 -0
  829. package/dist/navigation/versions/latest/isVariantNode.d.ts +3 -0
  830. package/dist/navigation/versions/latest/isVariantNode.d.ts.map +1 -0
  831. package/dist/navigation/versions/latest/isVariantNode.js +4 -0
  832. package/dist/navigation/versions/latest/isVariantNode.js.map +1 -0
  833. package/dist/navigation/versions/latest/isVariantedNode.d.ts +3 -0
  834. package/dist/navigation/versions/latest/isVariantedNode.d.ts.map +1 -0
  835. package/dist/navigation/versions/latest/isVariantedNode.js +4 -0
  836. package/dist/navigation/versions/latest/isVariantedNode.js.map +1 -0
  837. package/dist/navigation/versions/latest/isVersionNode.d.ts +3 -0
  838. package/dist/navigation/versions/latest/isVersionNode.d.ts.map +1 -0
  839. package/dist/navigation/versions/latest/isVersionNode.js +4 -0
  840. package/dist/navigation/versions/latest/isVersionNode.js.map +1 -0
  841. package/dist/navigation/versions/latest/slugjoin.d.ts +3 -0
  842. package/dist/navigation/versions/latest/slugjoin.d.ts.map +1 -0
  843. package/dist/navigation/versions/latest/slugjoin.js +17 -0
  844. package/dist/navigation/versions/latest/slugjoin.js.map +1 -0
  845. package/dist/navigation/versions/latest/toDefaultSlug.d.ts +9 -0
  846. package/dist/navigation/versions/latest/toDefaultSlug.d.ts.map +1 -0
  847. package/dist/navigation/versions/latest/toDefaultSlug.js +12 -0
  848. package/dist/navigation/versions/latest/toDefaultSlug.js.map +1 -0
  849. package/dist/navigation/versions/latest/traverseBF.d.ts +8 -0
  850. package/dist/navigation/versions/latest/traverseBF.d.ts.map +1 -0
  851. package/dist/navigation/versions/latest/traverseBF.js +9 -0
  852. package/dist/navigation/versions/latest/traverseBF.js.map +1 -0
  853. package/dist/navigation/versions/latest/traverseDF.d.ts +8 -0
  854. package/dist/navigation/versions/latest/traverseDF.d.ts.map +1 -0
  855. package/dist/navigation/versions/latest/traverseDF.js +9 -0
  856. package/dist/navigation/versions/latest/traverseDF.js.map +1 -0
  857. package/dist/navigation/versions/v1/NavigationNode.d.ts +6 -0
  858. package/dist/navigation/versions/v1/NavigationNode.d.ts.map +1 -0
  859. package/dist/navigation/versions/v1/NavigationNode.js +2 -0
  860. package/dist/navigation/versions/v1/NavigationNode.js.map +1 -0
  861. package/dist/navigation/versions/v1/NavigationNodeApiLeaf.d.ts +8 -0
  862. package/dist/navigation/versions/v1/NavigationNodeApiLeaf.d.ts.map +1 -0
  863. package/dist/navigation/versions/v1/NavigationNodeApiLeaf.js +8 -0
  864. package/dist/navigation/versions/v1/NavigationNodeApiLeaf.js.map +1 -0
  865. package/dist/navigation/versions/v1/NavigationNodeLeaf.d.ts +10 -0
  866. package/dist/navigation/versions/v1/NavigationNodeLeaf.d.ts.map +1 -0
  867. package/dist/navigation/versions/v1/NavigationNodeLeaf.js +6 -0
  868. package/dist/navigation/versions/v1/NavigationNodeLeaf.js.map +1 -0
  869. package/dist/navigation/versions/v1/NavigationNodeMarkdown.d.ts +9 -0
  870. package/dist/navigation/versions/v1/NavigationNodeMarkdown.d.ts.map +1 -0
  871. package/dist/navigation/versions/v1/NavigationNodeMarkdown.js +6 -0
  872. package/dist/navigation/versions/v1/NavigationNodeMarkdown.js.map +1 -0
  873. package/dist/navigation/versions/v1/NavigationNodeNeighbor.d.ts +7 -0
  874. package/dist/navigation/versions/v1/NavigationNodeNeighbor.d.ts.map +1 -0
  875. package/dist/navigation/versions/v1/NavigationNodeNeighbor.js +10 -0
  876. package/dist/navigation/versions/v1/NavigationNodeNeighbor.js.map +1 -0
  877. package/dist/navigation/versions/v1/NavigationNodePage.d.ts +10 -0
  878. package/dist/navigation/versions/v1/NavigationNodePage.d.ts.map +1 -0
  879. package/dist/navigation/versions/v1/NavigationNodePage.js +11 -0
  880. package/dist/navigation/versions/v1/NavigationNodePage.js.map +1 -0
  881. package/dist/navigation/versions/v1/NavigationNodePageLeaf.d.ts +8 -0
  882. package/dist/navigation/versions/v1/NavigationNodePageLeaf.d.ts.map +1 -0
  883. package/dist/navigation/versions/v1/NavigationNodePageLeaf.js +4 -0
  884. package/dist/navigation/versions/v1/NavigationNodePageLeaf.js.map +1 -0
  885. package/dist/navigation/versions/v1/NavigationNodeSection.d.ts +8 -0
  886. package/dist/navigation/versions/v1/NavigationNodeSection.d.ts.map +1 -0
  887. package/dist/navigation/versions/v1/NavigationNodeSection.js +7 -0
  888. package/dist/navigation/versions/v1/NavigationNodeSection.js.map +1 -0
  889. package/dist/navigation/versions/v1/NavigationNodeSectionOverview.d.ts +13 -0
  890. package/dist/navigation/versions/v1/NavigationNodeSectionOverview.d.ts.map +1 -0
  891. package/dist/navigation/versions/v1/NavigationNodeSectionOverview.js +5 -0
  892. package/dist/navigation/versions/v1/NavigationNodeSectionOverview.js.map +1 -0
  893. package/dist/navigation/versions/v1/NavigationNodeWithMetadata.d.ts +8 -0
  894. package/dist/navigation/versions/v1/NavigationNodeWithMetadata.d.ts.map +1 -0
  895. package/dist/navigation/versions/v1/NavigationNodeWithMetadata.js +5 -0
  896. package/dist/navigation/versions/v1/NavigationNodeWithMetadata.js.map +1 -0
  897. package/dist/navigation/versions/v1/NavigationNodeWithRedirect.d.ts +8 -0
  898. package/dist/navigation/versions/v1/NavigationNodeWithRedirect.d.ts.map +1 -0
  899. package/dist/navigation/versions/v1/NavigationNodeWithRedirect.js +4 -0
  900. package/dist/navigation/versions/v1/NavigationNodeWithRedirect.js.map +1 -0
  901. package/dist/navigation/versions/v1/__test__/slugjoin.test.d.ts +2 -0
  902. package/dist/navigation/versions/v1/__test__/slugjoin.test.d.ts.map +1 -0
  903. package/dist/navigation/versions/v1/__test__/slugjoin.test.js +14 -0
  904. package/dist/navigation/versions/v1/__test__/slugjoin.test.js.map +1 -0
  905. package/dist/navigation/versions/v1/convertAvailability.d.ts +4 -0
  906. package/dist/navigation/versions/v1/convertAvailability.d.ts.map +1 -0
  907. package/dist/navigation/versions/v1/convertAvailability.js +31 -0
  908. package/dist/navigation/versions/v1/convertAvailability.js.map +1 -0
  909. package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.d.ts +30 -0
  910. package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.d.ts.map +1 -0
  911. package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.js +566 -0
  912. package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.js.map +1 -0
  913. package/dist/navigation/versions/v1/converters/ChangelogConverter.d.ts +19 -0
  914. package/dist/navigation/versions/v1/converters/ChangelogConverter.d.ts.map +1 -0
  915. package/dist/navigation/versions/v1/converters/ChangelogConverter.js +147 -0
  916. package/dist/navigation/versions/v1/converters/ChangelogConverter.js.map +1 -0
  917. package/dist/navigation/versions/v1/converters/NavigationConfigConverter.d.ts +22 -0
  918. package/dist/navigation/versions/v1/converters/NavigationConfigConverter.d.ts.map +1 -0
  919. package/dist/navigation/versions/v1/converters/NavigationConfigConverter.js +345 -0
  920. package/dist/navigation/versions/v1/converters/NavigationConfigConverter.js.map +1 -0
  921. package/dist/navigation/versions/v1/converters/NodeIdGenerator.d.ts +6 -0
  922. package/dist/navigation/versions/v1/converters/NodeIdGenerator.d.ts.map +1 -0
  923. package/dist/navigation/versions/v1/converters/NodeIdGenerator.js +23 -0
  924. package/dist/navigation/versions/v1/converters/NodeIdGenerator.js.map +1 -0
  925. package/dist/navigation/versions/v1/converters/SlugGenerator.d.ts +20 -0
  926. package/dist/navigation/versions/v1/converters/SlugGenerator.d.ts.map +1 -0
  927. package/dist/navigation/versions/v1/converters/SlugGenerator.js +132 -0
  928. package/dist/navigation/versions/v1/converters/SlugGenerator.js.map +1 -0
  929. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.graphql.test.d.ts +2 -0
  930. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.graphql.test.d.ts.map +1 -0
  931. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.graphql.test.js +180 -0
  932. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.graphql.test.js.map +1 -0
  933. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.titleCase.test.d.ts +2 -0
  934. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.titleCase.test.d.ts.map +1 -0
  935. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.titleCase.test.js +115 -0
  936. package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.titleCase.test.js.map +1 -0
  937. package/dist/navigation/versions/v1/converters/__test__/SlugGenerator.test.d.ts +2 -0
  938. package/dist/navigation/versions/v1/converters/__test__/SlugGenerator.test.d.ts.map +1 -0
  939. package/dist/navigation/versions/v1/converters/__test__/SlugGenerator.test.js +126 -0
  940. package/dist/navigation/versions/v1/converters/__test__/SlugGenerator.test.js.map +1 -0
  941. package/dist/navigation/versions/v1/converters/__test__/getFullSlugFromFrontmatter.test.d.ts +2 -0
  942. package/dist/navigation/versions/v1/converters/__test__/getFullSlugFromFrontmatter.test.d.ts.map +1 -0
  943. package/dist/navigation/versions/v1/converters/__test__/getFullSlugFromFrontmatter.test.js +42 -0
  944. package/dist/navigation/versions/v1/converters/__test__/getFullSlugFromFrontmatter.test.js.map +1 -0
  945. package/dist/navigation/versions/v1/converters/__test__/getNoIndexFromFrontmatter.test.d.ts +2 -0
  946. package/dist/navigation/versions/v1/converters/__test__/getNoIndexFromFrontmatter.test.d.ts.map +1 -0
  947. package/dist/navigation/versions/v1/converters/__test__/getNoIndexFromFrontmatter.test.js +44 -0
  948. package/dist/navigation/versions/v1/converters/__test__/getNoIndexFromFrontmatter.test.js.map +1 -0
  949. package/dist/navigation/versions/v1/converters/__test__/groupByTime.test.d.ts +2 -0
  950. package/dist/navigation/versions/v1/converters/__test__/groupByTime.test.d.ts.map +1 -0
  951. package/dist/navigation/versions/v1/converters/__test__/groupByTime.test.js +103 -0
  952. package/dist/navigation/versions/v1/converters/__test__/groupByTime.test.js.map +1 -0
  953. package/dist/navigation/versions/v1/converters/__test__/pruneVersionNode.test.d.ts +2 -0
  954. package/dist/navigation/versions/v1/converters/__test__/pruneVersionNode.test.d.ts.map +1 -0
  955. package/dist/navigation/versions/v1/converters/__test__/pruneVersionNode.test.js +10 -0
  956. package/dist/navigation/versions/v1/converters/__test__/pruneVersionNode.test.js.map +1 -0
  957. package/dist/navigation/versions/v1/converters/getFullSlugFromFrontmatter.d.ts +7 -0
  958. package/dist/navigation/versions/v1/converters/getFullSlugFromFrontmatter.d.ts.map +1 -0
  959. package/dist/navigation/versions/v1/converters/getFullSlugFromFrontmatter.js +13 -0
  960. package/dist/navigation/versions/v1/converters/getFullSlugFromFrontmatter.js.map +1 -0
  961. package/dist/navigation/versions/v1/converters/toRootNode.d.ts +4 -0
  962. package/dist/navigation/versions/v1/converters/toRootNode.d.ts.map +1 -0
  963. package/dist/navigation/versions/v1/converters/toRootNode.js +93 -0
  964. package/dist/navigation/versions/v1/converters/toRootNode.js.map +1 -0
  965. package/dist/navigation/versions/v1/followRedirect.d.ts +4 -0
  966. package/dist/navigation/versions/v1/followRedirect.d.ts.map +1 -0
  967. package/dist/navigation/versions/v1/followRedirect.js +55 -0
  968. package/dist/navigation/versions/v1/followRedirect.js.map +1 -0
  969. package/dist/navigation/versions/v1/getChildren.d.ts +3 -0
  970. package/dist/navigation/versions/v1/getChildren.d.ts.map +1 -0
  971. package/dist/navigation/versions/v1/getChildren.js +39 -0
  972. package/dist/navigation/versions/v1/getChildren.js.map +1 -0
  973. package/dist/navigation/versions/v1/getPageId.d.ts +3 -0
  974. package/dist/navigation/versions/v1/getPageId.d.ts.map +1 -0
  975. package/dist/navigation/versions/v1/getPageId.js +24 -0
  976. package/dist/navigation/versions/v1/getPageId.js.map +1 -0
  977. package/dist/navigation/versions/v1/index.d.ts +24 -0
  978. package/dist/navigation/versions/v1/index.d.ts.map +1 -0
  979. package/dist/navigation/versions/v1/index.js +24 -0
  980. package/dist/navigation/versions/v1/index.js.map +1 -0
  981. package/dist/navigation/versions/v1/slugjoin.d.ts +3 -0
  982. package/dist/navigation/versions/v1/slugjoin.d.ts.map +1 -0
  983. package/dist/navigation/versions/v1/slugjoin.js +10 -0
  984. package/dist/navigation/versions/v1/slugjoin.js.map +1 -0
  985. package/dist/navigation/versions/v1/toDefaultSlug.d.ts +9 -0
  986. package/dist/navigation/versions/v1/toDefaultSlug.d.ts.map +1 -0
  987. package/dist/navigation/versions/v1/toDefaultSlug.js +12 -0
  988. package/dist/navigation/versions/v1/toDefaultSlug.js.map +1 -0
  989. package/dist/navigation/versions/v1/traverseDF.d.ts +4 -0
  990. package/dist/navigation/versions/v1/traverseDF.d.ts.map +1 -0
  991. package/dist/navigation/versions/v1/traverseDF.js +6 -0
  992. package/dist/navigation/versions/v1/traverseDF.js.map +1 -0
  993. package/dist/orpc-client/api/client.d.ts +59 -0
  994. package/dist/orpc-client/api/client.d.ts.map +1 -0
  995. package/dist/orpc-client/api/client.js +103 -0
  996. package/dist/orpc-client/api/client.js.map +1 -0
  997. package/dist/orpc-client/api/contract-db.d.ts +75043 -0
  998. package/dist/orpc-client/api/contract-db.d.ts.map +1 -0
  999. package/dist/orpc-client/api/contract-db.js +84 -0
  1000. package/dist/orpc-client/api/contract-db.js.map +1 -0
  1001. package/dist/orpc-client/api/contract-latest.d.ts +6523 -0
  1002. package/dist/orpc-client/api/contract-latest.d.ts.map +1 -0
  1003. package/dist/orpc-client/api/contract-latest.js +483 -0
  1004. package/dist/orpc-client/api/contract-latest.js.map +1 -0
  1005. package/dist/orpc-client/api/contract-read.d.ts +90206 -0
  1006. package/dist/orpc-client/api/contract-read.d.ts.map +1 -0
  1007. package/dist/orpc-client/api/contract-read.js +262 -0
  1008. package/dist/orpc-client/api/contract-read.js.map +1 -0
  1009. package/dist/orpc-client/api/contract-register.d.ts +76878 -0
  1010. package/dist/orpc-client/api/contract-register.d.ts.map +1 -0
  1011. package/dist/orpc-client/api/contract-register.js +304 -0
  1012. package/dist/orpc-client/api/contract-register.js.map +1 -0
  1013. package/dist/orpc-client/api/index.d.ts +7 -0
  1014. package/dist/orpc-client/api/index.d.ts.map +1 -0
  1015. package/dist/orpc-client/api/index.js +7 -0
  1016. package/dist/orpc-client/api/index.js.map +1 -0
  1017. package/dist/orpc-client/api/shared.d.ts +3249 -0
  1018. package/dist/orpc-client/api/shared.d.ts.map +1 -0
  1019. package/dist/orpc-client/api/shared.js +537 -0
  1020. package/dist/orpc-client/api/shared.js.map +1 -0
  1021. package/dist/orpc-client/client.d.ts +53 -0
  1022. package/dist/orpc-client/client.d.ts.map +1 -0
  1023. package/dist/orpc-client/client.js +51 -0
  1024. package/dist/orpc-client/client.js.map +1 -0
  1025. package/dist/orpc-client/dashboard/client.d.ts +13 -0
  1026. package/dist/orpc-client/dashboard/client.d.ts.map +1 -0
  1027. package/dist/orpc-client/dashboard/client.js +15 -0
  1028. package/dist/orpc-client/dashboard/client.js.map +1 -0
  1029. package/dist/orpc-client/dashboard/contract.d.ts +282 -0
  1030. package/dist/orpc-client/dashboard/contract.d.ts.map +1 -0
  1031. package/dist/orpc-client/dashboard/contract.js +49 -0
  1032. package/dist/orpc-client/dashboard/contract.js.map +1 -0
  1033. package/dist/orpc-client/dashboard/index.d.ts +3 -0
  1034. package/dist/orpc-client/dashboard/index.d.ts.map +1 -0
  1035. package/dist/orpc-client/dashboard/index.js +3 -0
  1036. package/dist/orpc-client/dashboard/index.js.map +1 -0
  1037. package/dist/orpc-client/docs/client.d.ts +27 -0
  1038. package/dist/orpc-client/docs/client.d.ts.map +1 -0
  1039. package/dist/orpc-client/docs/client.js +21 -0
  1040. package/dist/orpc-client/docs/client.js.map +1 -0
  1041. package/dist/orpc-client/docs/index.d.ts +4 -0
  1042. package/dist/orpc-client/docs/index.d.ts.map +1 -0
  1043. package/dist/orpc-client/docs/index.js +4 -0
  1044. package/dist/orpc-client/docs/index.js.map +1 -0
  1045. package/dist/orpc-client/docs/v1/index.d.ts +3 -0
  1046. package/dist/orpc-client/docs/v1/index.d.ts.map +1 -0
  1047. package/dist/orpc-client/docs/v1/index.js +3 -0
  1048. package/dist/orpc-client/docs/v1/index.js.map +1 -0
  1049. package/dist/orpc-client/docs/v1/read/client.d.ts +13 -0
  1050. package/dist/orpc-client/docs/v1/read/client.d.ts.map +1 -0
  1051. package/dist/orpc-client/docs/v1/read/client.js +15 -0
  1052. package/dist/orpc-client/docs/v1/read/client.js.map +1 -0
  1053. package/dist/orpc-client/docs/v1/read/contract.d.ts +19496 -0
  1054. package/dist/orpc-client/docs/v1/read/contract.d.ts.map +1 -0
  1055. package/dist/orpc-client/docs/v1/read/contract.js +21 -0
  1056. package/dist/orpc-client/docs/v1/read/contract.js.map +1 -0
  1057. package/dist/orpc-client/docs/v1/read/index.d.ts +3 -0
  1058. package/dist/orpc-client/docs/v1/read/index.d.ts.map +1 -0
  1059. package/dist/orpc-client/docs/v1/read/index.js +3 -0
  1060. package/dist/orpc-client/docs/v1/read/index.js.map +1 -0
  1061. package/dist/orpc-client/docs/v1/write/client.d.ts +13 -0
  1062. package/dist/orpc-client/docs/v1/write/client.d.ts.map +1 -0
  1063. package/dist/orpc-client/docs/v1/write/client.js +15 -0
  1064. package/dist/orpc-client/docs/v1/write/client.js.map +1 -0
  1065. package/dist/orpc-client/docs/v1/write/contract.d.ts +4905 -0
  1066. package/dist/orpc-client/docs/v1/write/contract.d.ts.map +1 -0
  1067. package/dist/orpc-client/docs/v1/write/contract.js +29 -0
  1068. package/dist/orpc-client/docs/v1/write/contract.js.map +1 -0
  1069. package/dist/orpc-client/docs/v1/write/index.d.ts +3 -0
  1070. package/dist/orpc-client/docs/v1/write/index.d.ts.map +1 -0
  1071. package/dist/orpc-client/docs/v1/write/index.js +3 -0
  1072. package/dist/orpc-client/docs/v1/write/index.js.map +1 -0
  1073. package/dist/orpc-client/docs/v2/index.d.ts +5 -0
  1074. package/dist/orpc-client/docs/v2/index.d.ts.map +1 -0
  1075. package/dist/orpc-client/docs/v2/index.js +5 -0
  1076. package/dist/orpc-client/docs/v2/index.js.map +1 -0
  1077. package/dist/orpc-client/docs/v2/library-docs/__test__/contract.test.d.ts +2 -0
  1078. package/dist/orpc-client/docs/v2/library-docs/__test__/contract.test.d.ts.map +1 -0
  1079. package/dist/orpc-client/docs/v2/library-docs/__test__/contract.test.js +49 -0
  1080. package/dist/orpc-client/docs/v2/library-docs/__test__/contract.test.js.map +1 -0
  1081. package/dist/orpc-client/docs/v2/library-docs/client.d.ts +13 -0
  1082. package/dist/orpc-client/docs/v2/library-docs/client.d.ts.map +1 -0
  1083. package/dist/orpc-client/docs/v2/library-docs/client.js +15 -0
  1084. package/dist/orpc-client/docs/v2/library-docs/client.js.map +1 -0
  1085. package/dist/orpc-client/docs/v2/library-docs/contract.d.ts +361 -0
  1086. package/dist/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -0
  1087. package/dist/orpc-client/docs/v2/library-docs/contract.js +106 -0
  1088. package/dist/orpc-client/docs/v2/library-docs/contract.js.map +1 -0
  1089. package/dist/orpc-client/docs/v2/library-docs/index.d.ts +3 -0
  1090. package/dist/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -0
  1091. package/dist/orpc-client/docs/v2/library-docs/index.js +3 -0
  1092. package/dist/orpc-client/docs/v2/library-docs/index.js.map +1 -0
  1093. package/dist/orpc-client/docs/v2/organization/client.d.ts +13 -0
  1094. package/dist/orpc-client/docs/v2/organization/client.d.ts.map +1 -0
  1095. package/dist/orpc-client/docs/v2/organization/client.js +15 -0
  1096. package/dist/orpc-client/docs/v2/organization/client.js.map +1 -0
  1097. package/dist/orpc-client/docs/v2/organization/contract.d.ts +18 -0
  1098. package/dist/orpc-client/docs/v2/organization/contract.d.ts.map +1 -0
  1099. package/dist/orpc-client/docs/v2/organization/contract.js +12 -0
  1100. package/dist/orpc-client/docs/v2/organization/contract.js.map +1 -0
  1101. package/dist/orpc-client/docs/v2/organization/index.d.ts +3 -0
  1102. package/dist/orpc-client/docs/v2/organization/index.d.ts.map +1 -0
  1103. package/dist/orpc-client/docs/v2/organization/index.js +3 -0
  1104. package/dist/orpc-client/docs/v2/organization/index.js.map +1 -0
  1105. package/dist/orpc-client/docs/v2/read/client.d.ts +13 -0
  1106. package/dist/orpc-client/docs/v2/read/client.d.ts.map +1 -0
  1107. package/dist/orpc-client/docs/v2/read/client.js +15 -0
  1108. package/dist/orpc-client/docs/v2/read/client.js.map +1 -0
  1109. package/dist/orpc-client/docs/v2/read/contract.d.ts +43524 -0
  1110. package/dist/orpc-client/docs/v2/read/contract.d.ts.map +1 -0
  1111. package/dist/orpc-client/docs/v2/read/contract.js +92 -0
  1112. package/dist/orpc-client/docs/v2/read/contract.js.map +1 -0
  1113. package/dist/orpc-client/docs/v2/read/index.d.ts +3 -0
  1114. package/dist/orpc-client/docs/v2/read/index.d.ts.map +1 -0
  1115. package/dist/orpc-client/docs/v2/read/index.js +3 -0
  1116. package/dist/orpc-client/docs/v2/read/index.js.map +1 -0
  1117. package/dist/orpc-client/docs/v2/write/client.d.ts +13 -0
  1118. package/dist/orpc-client/docs/v2/write/client.d.ts.map +1 -0
  1119. package/dist/orpc-client/docs/v2/write/client.js +15 -0
  1120. package/dist/orpc-client/docs/v2/write/client.js.map +1 -0
  1121. package/dist/orpc-client/docs/v2/write/contract.d.ts +10407 -0
  1122. package/dist/orpc-client/docs/v2/write/contract.d.ts.map +1 -0
  1123. package/dist/orpc-client/docs/v2/write/contract.js +163 -0
  1124. package/dist/orpc-client/docs/v2/write/contract.js.map +1 -0
  1125. package/dist/orpc-client/docs/v2/write/index.d.ts +3 -0
  1126. package/dist/orpc-client/docs/v2/write/index.d.ts.map +1 -0
  1127. package/dist/orpc-client/docs/v2/write/index.js +3 -0
  1128. package/dist/orpc-client/docs/v2/write/index.js.map +1 -0
  1129. package/dist/orpc-client/docs-cache/client.d.ts +13 -0
  1130. package/dist/orpc-client/docs-cache/client.d.ts.map +1 -0
  1131. package/dist/orpc-client/docs-cache/client.js +15 -0
  1132. package/dist/orpc-client/docs-cache/client.js.map +1 -0
  1133. package/dist/orpc-client/docs-cache/contract.d.ts +19 -0
  1134. package/dist/orpc-client/docs-cache/contract.d.ts.map +1 -0
  1135. package/dist/orpc-client/docs-cache/contract.js +12 -0
  1136. package/dist/orpc-client/docs-cache/contract.js.map +1 -0
  1137. package/dist/orpc-client/docs-cache/index.d.ts +3 -0
  1138. package/dist/orpc-client/docs-cache/index.d.ts.map +1 -0
  1139. package/dist/orpc-client/docs-cache/index.js +3 -0
  1140. package/dist/orpc-client/docs-cache/index.js.map +1 -0
  1141. package/dist/orpc-client/docs-deployment/client.d.ts +13 -0
  1142. package/dist/orpc-client/docs-deployment/client.d.ts.map +1 -0
  1143. package/dist/orpc-client/docs-deployment/client.js +15 -0
  1144. package/dist/orpc-client/docs-deployment/client.js.map +1 -0
  1145. package/dist/orpc-client/docs-deployment/contract.d.ts +988 -0
  1146. package/dist/orpc-client/docs-deployment/contract.d.ts.map +1 -0
  1147. package/dist/orpc-client/docs-deployment/contract.js +215 -0
  1148. package/dist/orpc-client/docs-deployment/contract.js.map +1 -0
  1149. package/dist/orpc-client/docs-deployment/index.d.ts +3 -0
  1150. package/dist/orpc-client/docs-deployment/index.d.ts.map +1 -0
  1151. package/dist/orpc-client/docs-deployment/index.js +3 -0
  1152. package/dist/orpc-client/docs-deployment/index.js.map +1 -0
  1153. package/dist/orpc-client/docs-ledger/__test__/contract.test.d.ts +2 -0
  1154. package/dist/orpc-client/docs-ledger/__test__/contract.test.d.ts.map +1 -0
  1155. package/dist/orpc-client/docs-ledger/__test__/contract.test.js +64 -0
  1156. package/dist/orpc-client/docs-ledger/__test__/contract.test.js.map +1 -0
  1157. package/dist/orpc-client/docs-ledger/client.d.ts +13 -0
  1158. package/dist/orpc-client/docs-ledger/client.d.ts.map +1 -0
  1159. package/dist/orpc-client/docs-ledger/client.js +16 -0
  1160. package/dist/orpc-client/docs-ledger/client.js.map +1 -0
  1161. package/dist/orpc-client/docs-ledger/config-files.d.ts +16 -0
  1162. package/dist/orpc-client/docs-ledger/config-files.d.ts.map +1 -0
  1163. package/dist/orpc-client/docs-ledger/config-files.js +130 -0
  1164. package/dist/orpc-client/docs-ledger/config-files.js.map +1 -0
  1165. package/dist/orpc-client/docs-ledger/contract.d.ts +92817 -0
  1166. package/dist/orpc-client/docs-ledger/contract.d.ts.map +1 -0
  1167. package/dist/orpc-client/docs-ledger/contract.js +1097 -0
  1168. package/dist/orpc-client/docs-ledger/contract.js.map +1 -0
  1169. package/dist/orpc-client/docs-ledger/index.d.ts +6 -0
  1170. package/dist/orpc-client/docs-ledger/index.d.ts.map +1 -0
  1171. package/dist/orpc-client/docs-ledger/index.js +6 -0
  1172. package/dist/orpc-client/docs-ledger/index.js.map +1 -0
  1173. package/dist/orpc-client/docs-ledger/ledger-manifest.d.ts +40360 -0
  1174. package/dist/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -0
  1175. package/dist/orpc-client/docs-ledger/ledger-manifest.js +309 -0
  1176. package/dist/orpc-client/docs-ledger/ledger-manifest.js.map +1 -0
  1177. package/dist/orpc-client/docs-ledger/stable-stringify.d.ts +18 -0
  1178. package/dist/orpc-client/docs-ledger/stable-stringify.d.ts.map +1 -0
  1179. package/dist/orpc-client/docs-ledger/stable-stringify.js +25 -0
  1180. package/dist/orpc-client/docs-ledger/stable-stringify.js.map +1 -0
  1181. package/dist/orpc-client/editor-snapshot/client.d.ts +13 -0
  1182. package/dist/orpc-client/editor-snapshot/client.d.ts.map +1 -0
  1183. package/dist/orpc-client/editor-snapshot/client.js +15 -0
  1184. package/dist/orpc-client/editor-snapshot/client.js.map +1 -0
  1185. package/dist/orpc-client/editor-snapshot/contract.d.ts +207 -0
  1186. package/dist/orpc-client/editor-snapshot/contract.d.ts.map +1 -0
  1187. package/dist/orpc-client/editor-snapshot/contract.js +42 -0
  1188. package/dist/orpc-client/editor-snapshot/contract.js.map +1 -0
  1189. package/dist/orpc-client/editor-snapshot/index.d.ts +3 -0
  1190. package/dist/orpc-client/editor-snapshot/index.d.ts.map +1 -0
  1191. package/dist/orpc-client/editor-snapshot/index.js +3 -0
  1192. package/dist/orpc-client/editor-snapshot/index.js.map +1 -0
  1193. package/dist/orpc-client/files/contract.d.ts +142 -0
  1194. package/dist/orpc-client/files/contract.d.ts.map +1 -0
  1195. package/dist/orpc-client/files/contract.js +60 -0
  1196. package/dist/orpc-client/files/contract.js.map +1 -0
  1197. package/dist/orpc-client/files/index.d.ts +2 -0
  1198. package/dist/orpc-client/files/index.d.ts.map +1 -0
  1199. package/dist/orpc-client/files/index.js +2 -0
  1200. package/dist/orpc-client/files/index.js.map +1 -0
  1201. package/dist/orpc-client/generators/cli/client.d.ts +13 -0
  1202. package/dist/orpc-client/generators/cli/client.d.ts.map +1 -0
  1203. package/dist/orpc-client/generators/cli/client.js +15 -0
  1204. package/dist/orpc-client/generators/cli/client.js.map +1 -0
  1205. package/dist/orpc-client/generators/cli/index.d.ts +2 -0
  1206. package/dist/orpc-client/generators/cli/index.d.ts.map +1 -0
  1207. package/dist/orpc-client/generators/cli/index.js +2 -0
  1208. package/dist/orpc-client/generators/cli/index.js.map +1 -0
  1209. package/dist/orpc-client/generators/client.d.ts +13 -0
  1210. package/dist/orpc-client/generators/client.d.ts.map +1 -0
  1211. package/dist/orpc-client/generators/client.js +15 -0
  1212. package/dist/orpc-client/generators/client.js.map +1 -0
  1213. package/dist/orpc-client/generators/contract.d.ts +3396 -0
  1214. package/dist/orpc-client/generators/contract.d.ts.map +1 -0
  1215. package/dist/orpc-client/generators/contract.js +246 -0
  1216. package/dist/orpc-client/generators/contract.js.map +1 -0
  1217. package/dist/orpc-client/generators/index.d.ts +5 -0
  1218. package/dist/orpc-client/generators/index.d.ts.map +1 -0
  1219. package/dist/orpc-client/generators/index.js +5 -0
  1220. package/dist/orpc-client/generators/index.js.map +1 -0
  1221. package/dist/orpc-client/generators/versions/client.d.ts +13 -0
  1222. package/dist/orpc-client/generators/versions/client.d.ts.map +1 -0
  1223. package/dist/orpc-client/generators/versions/client.js +15 -0
  1224. package/dist/orpc-client/generators/versions/client.js.map +1 -0
  1225. package/dist/orpc-client/generators/versions/index.d.ts +2 -0
  1226. package/dist/orpc-client/generators/versions/index.d.ts.map +1 -0
  1227. package/dist/orpc-client/generators/versions/index.js +2 -0
  1228. package/dist/orpc-client/generators/versions/index.js.map +1 -0
  1229. package/dist/orpc-client/git/client.d.ts +13 -0
  1230. package/dist/orpc-client/git/client.d.ts.map +1 -0
  1231. package/dist/orpc-client/git/client.js +15 -0
  1232. package/dist/orpc-client/git/client.js.map +1 -0
  1233. package/dist/orpc-client/git/contract.d.ts +2914 -0
  1234. package/dist/orpc-client/git/contract.d.ts.map +1 -0
  1235. package/dist/orpc-client/git/contract.js +145 -0
  1236. package/dist/orpc-client/git/contract.js.map +1 -0
  1237. package/dist/orpc-client/git/index.d.ts +3 -0
  1238. package/dist/orpc-client/git/index.d.ts.map +1 -0
  1239. package/dist/orpc-client/git/index.js +3 -0
  1240. package/dist/orpc-client/git/index.js.map +1 -0
  1241. package/dist/orpc-client/index.d.ts +21 -0
  1242. package/dist/orpc-client/index.d.ts.map +1 -0
  1243. package/dist/orpc-client/index.js +21 -0
  1244. package/dist/orpc-client/index.js.map +1 -0
  1245. package/dist/orpc-client/pdf-export/client.d.ts +13 -0
  1246. package/dist/orpc-client/pdf-export/client.d.ts.map +1 -0
  1247. package/dist/orpc-client/pdf-export/client.js +15 -0
  1248. package/dist/orpc-client/pdf-export/client.js.map +1 -0
  1249. package/dist/orpc-client/pdf-export/contract.d.ts +1344 -0
  1250. package/dist/orpc-client/pdf-export/contract.d.ts.map +1 -0
  1251. package/dist/orpc-client/pdf-export/contract.js +104 -0
  1252. package/dist/orpc-client/pdf-export/contract.js.map +1 -0
  1253. package/dist/orpc-client/pdf-export/index.d.ts +3 -0
  1254. package/dist/orpc-client/pdf-export/index.d.ts.map +1 -0
  1255. package/dist/orpc-client/pdf-export/index.js +3 -0
  1256. package/dist/orpc-client/pdf-export/index.js.map +1 -0
  1257. package/dist/orpc-client/sdks/client.d.ts +13 -0
  1258. package/dist/orpc-client/sdks/client.d.ts.map +1 -0
  1259. package/dist/orpc-client/sdks/client.js +15 -0
  1260. package/dist/orpc-client/sdks/client.js.map +1 -0
  1261. package/dist/orpc-client/sdks/contract.d.ts +55 -0
  1262. package/dist/orpc-client/sdks/contract.d.ts.map +1 -0
  1263. package/dist/orpc-client/sdks/contract.js +33 -0
  1264. package/dist/orpc-client/sdks/contract.js.map +1 -0
  1265. package/dist/orpc-client/sdks/index.d.ts +3 -0
  1266. package/dist/orpc-client/sdks/index.d.ts.map +1 -0
  1267. package/dist/orpc-client/sdks/index.js +3 -0
  1268. package/dist/orpc-client/sdks/index.js.map +1 -0
  1269. package/dist/orpc-client/shared.d.ts +327 -0
  1270. package/dist/orpc-client/shared.d.ts.map +1 -0
  1271. package/dist/orpc-client/shared.js +140 -0
  1272. package/dist/orpc-client/shared.js.map +1 -0
  1273. package/dist/orpc-client/slugs/client.d.ts +13 -0
  1274. package/dist/orpc-client/slugs/client.d.ts.map +1 -0
  1275. package/dist/orpc-client/slugs/client.js +15 -0
  1276. package/dist/orpc-client/slugs/client.js.map +1 -0
  1277. package/dist/orpc-client/slugs/contract.d.ts +251 -0
  1278. package/dist/orpc-client/slugs/contract.d.ts.map +1 -0
  1279. package/dist/orpc-client/slugs/contract.js +41 -0
  1280. package/dist/orpc-client/slugs/contract.js.map +1 -0
  1281. package/dist/orpc-client/slugs/index.d.ts +3 -0
  1282. package/dist/orpc-client/slugs/index.d.ts.map +1 -0
  1283. package/dist/orpc-client/slugs/index.js +3 -0
  1284. package/dist/orpc-client/slugs/index.js.map +1 -0
  1285. package/dist/orpc-client/snippets/client.d.ts +15 -0
  1286. package/dist/orpc-client/snippets/client.d.ts.map +1 -0
  1287. package/dist/orpc-client/snippets/client.js +26 -0
  1288. package/dist/orpc-client/snippets/client.js.map +1 -0
  1289. package/dist/orpc-client/snippets/contract.d.ts +1680 -0
  1290. package/dist/orpc-client/snippets/contract.d.ts.map +1 -0
  1291. package/dist/orpc-client/snippets/contract.js +98 -0
  1292. package/dist/orpc-client/snippets/contract.js.map +1 -0
  1293. package/dist/orpc-client/snippets/index.d.ts +3 -0
  1294. package/dist/orpc-client/snippets/index.d.ts.map +1 -0
  1295. package/dist/orpc-client/snippets/index.js +3 -0
  1296. package/dist/orpc-client/snippets/index.js.map +1 -0
  1297. package/dist/orpc-client/templates/client.d.ts +13 -0
  1298. package/dist/orpc-client/templates/client.d.ts.map +1 -0
  1299. package/dist/orpc-client/templates/client.js +16 -0
  1300. package/dist/orpc-client/templates/client.js.map +1 -0
  1301. package/dist/orpc-client/templates/contract.d.ts +1601 -0
  1302. package/dist/orpc-client/templates/contract.d.ts.map +1 -0
  1303. package/dist/orpc-client/templates/contract.js +52 -0
  1304. package/dist/orpc-client/templates/contract.js.map +1 -0
  1305. package/dist/orpc-client/templates/index.d.ts +3 -0
  1306. package/dist/orpc-client/templates/index.d.ts.map +1 -0
  1307. package/dist/orpc-client/templates/index.js +3 -0
  1308. package/dist/orpc-client/templates/index.js.map +1 -0
  1309. package/dist/orpc-client/themes/contract.d.ts +111 -0
  1310. package/dist/orpc-client/themes/contract.d.ts.map +1 -0
  1311. package/dist/orpc-client/themes/contract.js +66 -0
  1312. package/dist/orpc-client/themes/contract.js.map +1 -0
  1313. package/dist/orpc-client/themes/index.d.ts +2 -0
  1314. package/dist/orpc-client/themes/index.d.ts.map +1 -0
  1315. package/dist/orpc-client/themes/index.js +2 -0
  1316. package/dist/orpc-client/themes/index.js.map +1 -0
  1317. package/dist/orpc-client/tokens/client.d.ts +13 -0
  1318. package/dist/orpc-client/tokens/client.d.ts.map +1 -0
  1319. package/dist/orpc-client/tokens/client.js +15 -0
  1320. package/dist/orpc-client/tokens/client.js.map +1 -0
  1321. package/dist/orpc-client/tokens/contract.d.ts +66 -0
  1322. package/dist/orpc-client/tokens/contract.d.ts.map +1 -0
  1323. package/dist/orpc-client/tokens/contract.js +25 -0
  1324. package/dist/orpc-client/tokens/contract.js.map +1 -0
  1325. package/dist/orpc-client/tokens/index.d.ts +3 -0
  1326. package/dist/orpc-client/tokens/index.d.ts.map +1 -0
  1327. package/dist/orpc-client/tokens/index.js +3 -0
  1328. package/dist/orpc-client/tokens/index.js.map +1 -0
  1329. package/dist/utils/obfuscate-secret.d.ts +2 -0
  1330. package/dist/utils/obfuscate-secret.d.ts.map +1 -0
  1331. package/dist/utils/obfuscate-secret.js +10 -0
  1332. package/dist/utils/obfuscate-secret.js.map +1 -0
  1333. package/dist/utils/traversers/__test__/bfs.test.d.ts +2 -0
  1334. package/dist/utils/traversers/__test__/bfs.test.d.ts.map +1 -0
  1335. package/dist/utils/traversers/__test__/bfs.test.js +51 -0
  1336. package/dist/utils/traversers/__test__/bfs.test.js.map +1 -0
  1337. package/dist/utils/traversers/__test__/dfs.test.d.ts +2 -0
  1338. package/dist/utils/traversers/__test__/dfs.test.d.ts.map +1 -0
  1339. package/dist/utils/traversers/__test__/dfs.test.js +51 -0
  1340. package/dist/utils/traversers/__test__/dfs.test.js.map +1 -0
  1341. package/dist/utils/traversers/__test__/fixture.d.ts +6 -0
  1342. package/dist/utils/traversers/__test__/fixture.d.ts.map +1 -0
  1343. package/dist/utils/traversers/__test__/fixture.js +38 -0
  1344. package/dist/utils/traversers/__test__/fixture.js.map +1 -0
  1345. package/dist/utils/traversers/__test__/prunetree.test.d.ts +2 -0
  1346. package/dist/utils/traversers/__test__/prunetree.test.d.ts.map +1 -0
  1347. package/dist/utils/traversers/__test__/prunetree.test.js +79 -0
  1348. package/dist/utils/traversers/__test__/prunetree.test.js.map +1 -0
  1349. package/dist/utils/traversers/bfs.d.ts +3 -0
  1350. package/dist/utils/traversers/bfs.d.ts.map +1 -0
  1351. package/dist/utils/traversers/bfs.js +23 -0
  1352. package/dist/utils/traversers/bfs.js.map +1 -0
  1353. package/dist/utils/traversers/dfs.d.ts +3 -0
  1354. package/dist/utils/traversers/dfs.d.ts.map +1 -0
  1355. package/dist/utils/traversers/dfs.js +23 -0
  1356. package/dist/utils/traversers/dfs.js.map +1 -0
  1357. package/dist/utils/traversers/index.d.ts +4 -0
  1358. package/dist/utils/traversers/index.d.ts.map +1 -0
  1359. package/dist/utils/traversers/index.js +4 -0
  1360. package/dist/utils/traversers/index.js.map +1 -0
  1361. package/dist/utils/traversers/prunetree.d.ts +26 -0
  1362. package/dist/utils/traversers/prunetree.d.ts.map +1 -0
  1363. package/dist/utils/traversers/prunetree.js +39 -0
  1364. package/dist/utils/traversers/prunetree.js.map +1 -0
  1365. package/dist/utils/traversers/types.d.ts +8 -0
  1366. package/dist/utils/traversers/types.d.ts.map +1 -0
  1367. package/dist/utils/traversers/types.js +4 -0
  1368. package/dist/utils/traversers/types.js.map +1 -0
  1369. package/package.json +1 -1
@@ -0,0 +1,1923 @@
1
+ import * as FernNavigation from "./index.js";
2
+ const STRUCTURAL_SEGMENT_TYPES = new Set([
3
+ "section",
4
+ "apiReference",
5
+ "apiPackage",
6
+ "changelog"
7
+ ]);
8
+ const API_NODE_SEGMENT_TYPES = new Set(["apiReference", "apiPackage"]);
9
+ const INFRA_SEGMENT_TYPES = new Set(["files", "redirects"]);
10
+ /** @internal Exported for testing only. */
11
+ export function createBuildContext(basePath) {
12
+ // Tracks how many times each id key has been handed out, so collisions get
13
+ // a deterministic `-N` suffix. NodeIds only need to be unique within a
14
+ // single tree; keying them off content (slug/scope) instead of a running
15
+ // counter makes them stable across builds — so client state keyed by
16
+ // node.id (e.g. playground form state in localStorage) survives republish
17
+ // as long as the node's slug/position is unchanged.
18
+ const seen = new Map();
19
+ // Nav `fullPath`s are stored relative to the docs root (no basepath);
20
+ // FernNavigation slugs include the basepath prefix, so content node slugs
21
+ // are joined onto this prefix.
22
+ const basePrefix = basePath.replace(/^\/+|\/+$/g, "");
23
+ return {
24
+ nodeId: (key) => {
25
+ const count = seen.get(key) ?? 0;
26
+ seen.set(key, count + 1);
27
+ return FernNavigation.NodeId(count === 0 ? key : `${key}-${count}`);
28
+ },
29
+ contentSlug: (relativePath) => {
30
+ const clean = relativePath.replace(/^\/+|\/+$/g, "");
31
+ return basePrefix === "" ? FernNavigation.Slug(clean) : FernNavigation.slugjoin(basePrefix, clean);
32
+ }
33
+ };
34
+ }
35
+ function asSlug(path) {
36
+ return FernNavigation.Slug(path.replace(/^\/+|\/+$/g, ""));
37
+ }
38
+ /**
39
+ * Resolve a product/version/tab `metadata.pointsTo` value to a node slug.
40
+ *
41
+ * `pointsTo` is written basepath-ABSOLUTE: it is a V1 accumulated slug, rooted
42
+ * at the deployment basepath (`root.slug`), exactly like the `routes` dict
43
+ * keys, the `routing` table, and `versionFirstRoute`. Only sidebar `fullPath`s
44
+ * are stored basepath-RELATIVE and re-prefixed via {@link BuildContext.contentSlug}.
45
+ *
46
+ * Passing `pointsTo` through `contentSlug` would prepend the basepath a SECOND
47
+ * time (`docs/runtime/overview` → `docs/docs/runtime/overview`), so the bare
48
+ * product/version landing redirect targets a non-existent route and 404s on any
49
+ * non-root (`/docs`) site. Treat it as already-absolute — only normalise slashes.
50
+ */
51
+ function pointsToSlug(metaPointsTo) {
52
+ return asSlug(metaPointsTo);
53
+ }
54
+ /** Read a string field off an unknown metadata blob. */
55
+ function metaStr(metadata, key) {
56
+ if (metadata != null && typeof metadata === "object" && key in metadata) {
57
+ const v = metadata[key];
58
+ return typeof v === "string" ? v : undefined;
59
+ }
60
+ return undefined;
61
+ }
62
+ function metaBool(metadata, key) {
63
+ if (metadata != null && typeof metadata === "object" && key in metadata) {
64
+ const v = metadata[key];
65
+ return typeof v === "boolean" ? v : undefined;
66
+ }
67
+ return undefined;
68
+ }
69
+ function metaNum(metadata, key) {
70
+ if (metadata != null && typeof metadata === "object" && key in metadata) {
71
+ const v = metadata[key];
72
+ return typeof v === "number" ? v : undefined;
73
+ }
74
+ return undefined;
75
+ }
76
+ /** Read the `collapsed` field which can be boolean or "open-by-default". */
77
+ function metaCollapsed(metadata) {
78
+ if (metadata != null && typeof metadata === "object" && "collapsed" in metadata) {
79
+ const v = metadata.collapsed;
80
+ if (typeof v === "boolean") {
81
+ return v;
82
+ }
83
+ if (v === "open-by-default") {
84
+ return "open-by-default";
85
+ }
86
+ }
87
+ return undefined;
88
+ }
89
+ /** Extract a string array from a metadata blob (e.g. page-level `viewers`). */
90
+ function metaStrArr(metadata, key) {
91
+ if (metadata != null && typeof metadata === "object" && key in metadata) {
92
+ const v = metadata[key];
93
+ if (Array.isArray(v)) {
94
+ return v.filter((x) => typeof x === "string");
95
+ }
96
+ }
97
+ return undefined;
98
+ }
99
+ function metaFeatureFlags(metadata) {
100
+ if (metadata != null && typeof metadata === "object" && "featureFlags" in metadata) {
101
+ const v = metadata.featureFlags;
102
+ return Array.isArray(v) && v.length > 0 ? v : undefined;
103
+ }
104
+ return undefined;
105
+ }
106
+ /** Map raw viewer role strings to branded RoleIds, or undefined when empty. */
107
+ function toViewers(viewers) {
108
+ if (viewers == null || viewers.length === 0) {
109
+ return undefined;
110
+ }
111
+ return viewers.map((v) => FernNavigation.RoleId(v));
112
+ }
113
+ /**
114
+ * Merge segment-level viewers with the owning variant's viewers so that
115
+ * variant-level RBAC restrictions propagate into section/apiReference/changelog
116
+ * nodes. Without this, removing the variant filter from `inScope` would allow
117
+ * cross-variant prev/next links to disclose restricted content.
118
+ */
119
+ function mergeVariantViewers(seg) {
120
+ const segViewers = STRUCTURAL_SEGMENT_TYPES.has(seg.metadata.type)
121
+ ? seg.metadata.viewers
122
+ : undefined;
123
+ const variantViewers = seg.variant?.viewers;
124
+ if ((segViewers == null || segViewers.length === 0) && (variantViewers == null || variantViewers.length === 0)) {
125
+ return undefined;
126
+ }
127
+ const merged = new Set();
128
+ if (segViewers != null) {
129
+ for (const v of segViewers) {
130
+ merged.add(v);
131
+ }
132
+ }
133
+ if (variantViewers != null) {
134
+ for (const v of variantViewers) {
135
+ merged.add(v);
136
+ }
137
+ }
138
+ return merged.size > 0 ? [...merged].map((v) => FernNavigation.RoleId(v)) : undefined;
139
+ }
140
+ function detailSlug(detail) {
141
+ return detail.metadata?.slug ?? "";
142
+ }
143
+ function detailIsDefault(detail) {
144
+ return detail.metadata?.default ?? false;
145
+ }
146
+ // ── scope grouping ───────────────────────────────────────────────────────
147
+ /** Stable identity for a (product, version, variant, tab) scope. */
148
+ function scopeKey(seg) {
149
+ return [seg.product?.id ?? "", seg.version?.id ?? "", seg.variant?.id ?? "", seg.tab?.id ?? ""].join("|");
150
+ }
151
+ // ── artifact → node conversion ─────────────────────────────────────────────
152
+ function withMetadataDefaults(base) {
153
+ const { viewers, featureFlags, ...rest } = base;
154
+ return {
155
+ ...rest,
156
+ canonicalSlug: undefined,
157
+ authed: base.authed === true ? true : undefined,
158
+ collapsed: undefined,
159
+ // Normalise empty arrays to undefined so unrestricted nodes don't add
160
+ // filter-level noise; a non-empty array engages the RBAC view gate.
161
+ viewers: viewers != null && viewers.length > 0 ? viewers : undefined,
162
+ orphaned: base.orphaned === true ? true : undefined,
163
+ featureFlags: featureFlags != null && featureFlags.length > 0 ? featureFlags : undefined
164
+ };
165
+ }
166
+ /**
167
+ * Convert one sidebar nav artifact into a leaf navigation node. Returns
168
+ * undefined for artifacts that don't become standalone sidebar nodes here
169
+ * (endpoints live under paginated apiReferences; overview pages are folded
170
+ * into their owning section).
171
+ */
172
+ function artifactToNode(ctx, route) {
173
+ const md = route.metadata;
174
+ const title = metaStr(md, "title") ?? "";
175
+ const icon = metaStr(md, "icon");
176
+ const viewers = toViewers(metaStrArr(md, "viewers"));
177
+ const slug = ctx.contentSlug(route.fullPath ?? "");
178
+ switch (route.type) {
179
+ case "markdown": {
180
+ // Overview pages are represented on their section, not as a sibling.
181
+ if (metaBool(md, "isOverview")) {
182
+ return undefined;
183
+ }
184
+ const pageId = metaStr(md, "pageId") ?? "";
185
+ const node = {
186
+ type: "page",
187
+ ...withMetadataDefaults({
188
+ id: ctx.nodeId(`page:${slug}`),
189
+ title,
190
+ slug,
191
+ icon,
192
+ hidden: route.hidden,
193
+ authed: metaBool(md, "authed"),
194
+ viewers,
195
+ orphaned: metaBool(md, "orphaned"),
196
+ featureFlags: metaFeatureFlags(md)
197
+ }),
198
+ pageId: FernNavigation.PageId(pageId),
199
+ noindex: metaBool(md, "noindex"),
200
+ availability: undefined
201
+ };
202
+ return node;
203
+ }
204
+ case "link": {
205
+ const node = {
206
+ type: "link",
207
+ id: ctx.nodeId(`link:${metaStr(md, "url") ?? route.fullPath ?? ""}`),
208
+ collapsed: undefined,
209
+ title,
210
+ icon,
211
+ url: FernNavigation.Url(metaStr(md, "url") ?? ""),
212
+ target: metaStr(md, "target")
213
+ };
214
+ return node;
215
+ }
216
+ // API leaf types are handled by apiReferenceNode (which calls
217
+ // apiLeafNodeFromNavRouteInternal), not by section-level artifact
218
+ // conversion. Returning undefined here prevents them from appearing
219
+ // as duplicate siblings alongside the apiReference node.
220
+ case "rest":
221
+ case "asyncapi":
222
+ case "webhook":
223
+ case "grpc":
224
+ case "graphql":
225
+ return undefined;
226
+ default:
227
+ return undefined;
228
+ }
229
+ }
230
+ /**
231
+ * Convert one API-leaf nav route into its navigation node, or undefined when
232
+ * the route is not an API leaf carrying the required identifiers.
233
+ *
234
+ * @internal Exported for the ledger loader's scoped explorer methods.
235
+ */
236
+ export function apiLeafNodeFromNavRoute(route, basePath, segmentApiDefinitionId) {
237
+ const ctx = createBuildContext(basePath);
238
+ return apiLeafNodeFromNavRouteInternal(ctx, route, segmentApiDefinitionId);
239
+ }
240
+ function apiLeafNodeFromNavRouteInternal(ctx, route, segmentApiDefinitionId) {
241
+ const md = route.metadata;
242
+ const apiDefinitionId = FernNavigation.ApiDefinitionId(metaStr(md, "apiDefinitionId") ?? segmentApiDefinitionId);
243
+ const slug = ctx.contentSlug(route.fullPath ?? "");
244
+ const title = metaStr(md, "title") ?? "";
245
+ const icon = metaStr(md, "icon");
246
+ const viewers = toViewers(metaStrArr(md, "viewers"));
247
+ const meta = withMetadataDefaults({
248
+ id: ctx.nodeId(`api-leaf:${slug}`),
249
+ title,
250
+ slug,
251
+ icon,
252
+ hidden: route.hidden,
253
+ authed: metaBool(md, "authed"),
254
+ viewers,
255
+ orphaned: metaBool(md, "orphaned"),
256
+ featureFlags: metaFeatureFlags(md)
257
+ });
258
+ if (route.type === "rest") {
259
+ const endpointId = metaStr(md, "endpointId");
260
+ const method = metaStr(md, "method");
261
+ if (endpointId == null || method == null) {
262
+ return undefined;
263
+ }
264
+ return {
265
+ type: "endpoint",
266
+ ...meta,
267
+ method: method,
268
+ endpointId: FernNavigation.EndpointId(endpointId),
269
+ apiDefinitionId,
270
+ isResponseStream: metaBool(md, "isResponseStream"),
271
+ availability: metaStr(md, "availability"),
272
+ playground: undefined
273
+ };
274
+ }
275
+ if (route.type === "webhook") {
276
+ const webhookId = metaStr(md, "webhookId");
277
+ const method = metaStr(md, "method");
278
+ if (webhookId == null || method == null) {
279
+ return undefined;
280
+ }
281
+ return {
282
+ type: "webhook",
283
+ ...meta,
284
+ method: method,
285
+ webhookId: FernNavigation.WebhookId(webhookId),
286
+ apiDefinitionId,
287
+ availability: metaStr(md, "availability")
288
+ };
289
+ }
290
+ if (route.type === "asyncapi") {
291
+ const webSocketId = metaStr(md, "webSocketId");
292
+ if (webSocketId == null) {
293
+ return undefined;
294
+ }
295
+ return {
296
+ type: "webSocket",
297
+ ...meta,
298
+ webSocketId: FernNavigation.WebSocketId(webSocketId),
299
+ apiDefinitionId,
300
+ availability: metaStr(md, "availability"),
301
+ playground: undefined
302
+ };
303
+ }
304
+ if (route.type === "grpc") {
305
+ const grpcId = metaStr(md, "grpcId");
306
+ const method = metaStr(md, "method");
307
+ if (grpcId == null || method == null) {
308
+ return undefined;
309
+ }
310
+ return {
311
+ type: "grpc",
312
+ ...meta,
313
+ method: method,
314
+ grpcId: FernNavigation.GrpcId(grpcId),
315
+ apiDefinitionId,
316
+ availability: metaStr(md, "availability")
317
+ };
318
+ }
319
+ if (route.type === "graphql") {
320
+ const graphqlOperationId = metaStr(md, "graphqlOperationId");
321
+ const operationType = metaStr(md, "operationType");
322
+ if (graphqlOperationId == null || operationType == null) {
323
+ return undefined;
324
+ }
325
+ return {
326
+ type: "graphql",
327
+ ...meta,
328
+ operationType: operationType,
329
+ graphqlOperationId: FernNavigation.GraphQlOperationId(graphqlOperationId),
330
+ graphqlOperationIds: undefined,
331
+ apiDefinitionId,
332
+ availability: metaStr(md, "availability"),
333
+ playground: undefined
334
+ };
335
+ }
336
+ return undefined;
337
+ }
338
+ function apiLeafPositionKey(node) {
339
+ switch (node.type) {
340
+ case "endpoint":
341
+ return `endpoint:${node.endpointId}`;
342
+ case "webhook":
343
+ return `webhook:${node.webhookId}`;
344
+ case "webSocket":
345
+ return `webSocket:${node.webSocketId}`;
346
+ case "grpc":
347
+ return `grpc:${node.grpcId}`;
348
+ case "graphql":
349
+ return `graphql:${node.graphqlOperationId}`;
350
+ }
351
+ }
352
+ function apiChildPositionKey(node) {
353
+ switch (node.type) {
354
+ case "endpoint":
355
+ case "webhook":
356
+ case "webSocket":
357
+ case "grpc":
358
+ case "graphql":
359
+ return apiLeafPositionKey(node);
360
+ default:
361
+ return undefined;
362
+ }
363
+ }
364
+ function positionedApiLeafChildren(ctx, nav, apiDefinitionId) {
365
+ const rawLeafNodes = [];
366
+ const leafPositions = new Map();
367
+ const nonApiLeafNodes = [];
368
+ for (let i = 0; i < nav.length; i++) {
369
+ const route = nav[i];
370
+ const pos = route.displaySortOrder ?? i;
371
+ const apiLeaf = apiLeafNodeFromNavRouteInternal(ctx, route, apiDefinitionId);
372
+ if (apiLeaf != null) {
373
+ rawLeafNodes.push(apiLeaf);
374
+ const key = apiLeafPositionKey(apiLeaf);
375
+ leafPositions.set(key, Math.min(leafPositions.get(key) ?? pos, pos));
376
+ continue;
377
+ }
378
+ const node = artifactToNode(ctx, route);
379
+ if (node?.type === "page" || node?.type === "link") {
380
+ nonApiLeafNodes.push({ node, pos });
381
+ }
382
+ }
383
+ const apiLeafNodes = mergeEndpointPairs(ctx, rawLeafNodes, nav);
384
+ const positionedApiLeafNodes = apiLeafNodes.map((node, index) => {
385
+ if (node.type === "endpointPair") {
386
+ const streamPos = leafPositions.get(apiLeafPositionKey(node.stream)) ?? index;
387
+ const nonStreamPos = leafPositions.get(apiLeafPositionKey(node.nonStream)) ?? index;
388
+ return { node, pos: Math.min(streamPos, nonStreamPos) };
389
+ }
390
+ const key = apiChildPositionKey(node);
391
+ return { node, pos: key != null ? (leafPositions.get(key) ?? index) : index };
392
+ });
393
+ return [...positionedApiLeafNodes, ...nonApiLeafNodes];
394
+ }
395
+ /**
396
+ * Collect every endpoint/webhook navigation node from a single API segment's
397
+ * nav routes. The root builder now populates apiReference children directly,
398
+ * but this helper is still used by the ledger loader's per-apiDefinitionId
399
+ * explorer methods (getApiLeafNodes) which scope to a single API definition.
400
+ *
401
+ * @internal Exported for the ledger loader's scoped explorer methods.
402
+ */
403
+ export function collectApiLeafNodesFromNav(routes, basePath, segmentApiDefinitionId) {
404
+ const ctx = createBuildContext(basePath);
405
+ return routes
406
+ .map((route) => apiLeafNodeFromNavRouteInternal(ctx, route, segmentApiDefinitionId))
407
+ .filter((node) => node != null);
408
+ }
409
+ /**
410
+ * Read the apiDefinitionId off a segment's metadata, or undefined.
411
+ * The matched types (apiReference, apiPackage, changelog) are the
412
+ * subset of {@link StructuralSegmentType} that carry an apiDefinitionId.
413
+ */
414
+ export function segmentApiDefinitionId(metadata) {
415
+ switch (metadata.type) {
416
+ case "apiReference":
417
+ case "apiPackage":
418
+ case "changelog":
419
+ return metadata.apiDefinitionId;
420
+ default:
421
+ return undefined;
422
+ }
423
+ }
424
+ /** Find the overview artifact (isOverview) within a segment's nav, if any. */
425
+ function overviewRoute(nav) {
426
+ return nav.find((r) => r.type === "markdown" && metaBool(r.metadata, "isOverview"));
427
+ }
428
+ /**
429
+ * Find the overview page for a section using the segment's own
430
+ * `metadata.overviewPageId` when `overviewRoute` (isOverview flag on nav
431
+ * routes) fails. This handles sections where the CLI stored the overview
432
+ * reference on the segment metadata but didn't set `isOverview` on the page.
433
+ *
434
+ * Legacy compat: older CLI versions wrote `overviewPageId` on the segment
435
+ * metadata but omitted the `isOverview` flag on the nav route itself. This
436
+ * fallback keeps those segments working. Once all published sites have been
437
+ * re-published with a CLI that sets `isOverview`, this path can be removed.
438
+ */
439
+ function overviewRouteFromSegmentMeta(seg, nav) {
440
+ const overviewPageId = metaStr(seg.metadata, "overviewPageId");
441
+ if (overviewPageId == null) {
442
+ return undefined;
443
+ }
444
+ return nav.find((r) => metaStr(r.metadata, "pageId") === overviewPageId);
445
+ }
446
+ /**
447
+ * Infer the section slug for a root section (`seg.section === ""`) from its
448
+ * child pages' fullPaths. When the section path is empty and there is no
449
+ * overview page, we look at the first routable page whose content slug
450
+ * extends beyond the scope prefix. The first path segment past the scope
451
+ * prefix is the section's implicit slug segment (e.g. `overview` in
452
+ * `{scope}/overview/introduction`).
453
+ *
454
+ * Limitations:
455
+ * - Assumes the first routable child's path structure matches the section
456
+ * slug. Heterogeneous child path prefixes (rare) would infer incorrectly.
457
+ * - Sections with only single-segment children (path = `{scope}/pagename`)
458
+ * cannot be distinguished from bare pages, so inference falls through to
459
+ * the bare scope prefix. This is acceptable — the section effectively
460
+ * has no URL-visible slug of its own.
461
+ */
462
+ function inferSectionSlugFromNav(ctx, nav, scopePrefix) {
463
+ const scopeStr = String(scopePrefix);
464
+ const prefix = scopeStr !== "" ? scopeStr + "/" : "";
465
+ for (const r of nav) {
466
+ if (r.fullPath == null) {
467
+ continue;
468
+ }
469
+ if (r.type !== "markdown" && r.type !== "page") {
470
+ continue;
471
+ }
472
+ const contentSlug = String(ctx.contentSlug(r.fullPath));
473
+ const rel = prefix !== "" ? (contentSlug.startsWith(prefix) ? contentSlug.slice(prefix.length) : null) : contentSlug;
474
+ if (rel == null) {
475
+ continue;
476
+ }
477
+ const parts = rel.split("/");
478
+ // Need at least 2 parts (section-slug / page-name) to distinguish
479
+ // a section slug from a bare page slug.
480
+ if (parts.length >= 2 && parts[0] !== "") {
481
+ return FernNavigation.slugjoin(scopePrefix, parts[0]);
482
+ }
483
+ }
484
+ // No child had a multi-segment path past the scope prefix — fall back
485
+ // to the caller's default (bare scope prefix).
486
+ return undefined;
487
+ }
488
+ /**
489
+ * Derive the slug for a structural section / apiReference node.
490
+ *
491
+ * When the section has its own routable overview page, that page's `fullPath`
492
+ * (basepath-relative) is the canonical slug — re-prefix the basepath via
493
+ * {@link BuildContext.contentSlug}. When it does NOT (a pure sidebar grouping
494
+ * with no own route), the node still needs a slug for the tree, but
495
+ * `seg.section` is only a structural path string (`release-information`,
496
+ * `develop-with-the-cli/run-airflow-locally`) that does NOT carry the scope
497
+ * prefix.
498
+ *
499
+ * The fallback MUST be rooted at the enclosing scope (`{basepath}/{product}/
500
+ * {version}/…`) rather than just `{basepath}/{section}`. `NodeCollector`'s
501
+ * default-version pruning (`pruneVersionNode` → `toDefaultSlug`) walks the
502
+ * default version subtree and SKIPS a node — and all its descendants — whose
503
+ * slug does not start with the version slug (it assumes such a node was already
504
+ * pruned). A structural section slugged `{basepath}/{section}` does not start
505
+ * with the version slug, so its child pages (e.g. `…/v-1-42/release-notes`)
506
+ * would never be pruned into their clean default-version alias, and the clean
507
+ * URL 404s with `page-not-in-nav` on basepath sites. Rooting the structural
508
+ * slug at the scope prefix keeps the subtree inside the prune window.
509
+ * (ADR-0014 #6.)
510
+ */
511
+ function structuralNodeSlug(ctx, overviewFullPath, section, scopePrefix) {
512
+ if (overviewFullPath != null) {
513
+ return ctx.contentSlug(overviewFullPath);
514
+ }
515
+ // No own route: derive a structural slug rooted at the enclosing scope so it
516
+ // stays within the default-version prune window. `scopePrefix` is already
517
+ // basepath-absolute (it is the version/product/tab node's slug), so join it
518
+ // directly rather than going through `contentSlug` (which would re-prefix
519
+ // the basepath).
520
+ return section !== "" ? FernNavigation.slugjoin(scopePrefix, section) : scopePrefix;
521
+ }
522
+ function stripLeadingScopePrefix(section, scopePrefix) {
523
+ const prefix = scopePrefix;
524
+ if (prefix === "") {
525
+ return section;
526
+ }
527
+ if (section === prefix) {
528
+ return "";
529
+ }
530
+ if (section.startsWith(prefix + "/")) {
531
+ return section.slice(prefix.length + 1);
532
+ }
533
+ return section;
534
+ }
535
+ /**
536
+ * Merge leaf children and section children by their original V1 tree position.
537
+ * Leaves carry position via `displaySortOrder` (stored in nav routes), sections
538
+ * carry position via `childIndex` in segment metadata. When both have positions,
539
+ * we interleave them in ascending order. When positions are absent (old
540
+ * deployments without childIndex), falls back to `[...leaves, ...sections]`.
541
+ */
542
+ function mergeChildrenByPosition(ctx, nav, sectionChildren) {
543
+ const leafNodes = [];
544
+ for (let i = 0; i < nav.length; i++) {
545
+ const route = nav[i];
546
+ const node = artifactToNode(ctx, route);
547
+ if (node != null) {
548
+ leafNodes.push({ node, pos: route.displaySortOrder ?? i });
549
+ }
550
+ }
551
+ const hasChildIndex = sectionChildren.some((s) => s.childIndex != null);
552
+ if (!hasChildIndex) {
553
+ return [...leafNodes.map((l) => l.node), ...sectionChildren.map((s) => s.node)];
554
+ }
555
+ const positioned = [...leafNodes];
556
+ for (const s of sectionChildren) {
557
+ positioned.push({ node: s.node, pos: s.childIndex ?? Number.MAX_SAFE_INTEGER });
558
+ }
559
+ positioned.sort((a, b) => a.pos - b.pos);
560
+ return positioned.map((p) => p.node);
561
+ }
562
+ function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
563
+ const { seg, nav } = scoped;
564
+ const overview = overviewRoute(nav) ?? overviewRouteFromSegmentMeta(seg, nav);
565
+ const overviewPageId = overview != null ? metaStr(overview.metadata, "pageId") : undefined;
566
+ // Strip the leading scope prefix to prevent double-prefixing when the
567
+ // section path already includes the scope (e.g. section="2026-02-09"
568
+ // with scopePrefix="2026-02-09" would produce "2026-02-09/2026-02-09").
569
+ const relSection = stripLeadingScopePrefix(seg.section, scopePrefix);
570
+ let slug = structuralNodeSlug(ctx, overview?.fullPath, relSection, scopePrefix);
571
+ // When the section path is empty and there is no overview page, the
572
+ // structural slug collapses to the bare scope prefix (the tab slug),
573
+ // losing the section segment that v2 derives from the overview page or
574
+ // the config's urlSlug. Infer it from child page fullPaths instead.
575
+ if (relSection === "" && overview?.fullPath == null) {
576
+ slug = inferSectionSlugFromNav(ctx, nav, scopePrefix) ?? slug;
577
+ }
578
+ const metaPointsTo = metaStr(seg.metadata, "pointsTo");
579
+ const defaults = withMetadataDefaults({
580
+ id: ctx.nodeId(`section:${slug}`),
581
+ title: metaStr(seg.metadata, "title") ?? "",
582
+ slug,
583
+ icon: metaStr(seg.metadata, "icon"),
584
+ hidden: seg.hidden,
585
+ authed: metaBool(seg.metadata, "authed"),
586
+ viewers: mergeVariantViewers(seg),
587
+ orphaned: metaBool(seg.metadata, "orphaned"),
588
+ featureFlags: metaFeatureFlags(seg.metadata)
589
+ });
590
+ return {
591
+ type: "section",
592
+ ...defaults,
593
+ collapsed: metaCollapsed(seg.metadata) ?? defaults.collapsed,
594
+ overviewPageId: overviewPageId != null ? FernNavigation.PageId(overviewPageId) : undefined,
595
+ noindex: metaBool(overview?.metadata, "noindex") ?? metaBool(seg.metadata, "noindex"),
596
+ collapsible: metaBool(seg.metadata, "collapsible") ?? (metaCollapsed(seg.metadata) === true ? true : undefined),
597
+ collapsedByDefault: metaBool(seg.metadata, "collapsedByDefault") ?? (metaCollapsed(seg.metadata) === true ? true : undefined),
598
+ availability: metaStr(seg.metadata, "availability"),
599
+ pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : undefined,
600
+ children: mergeChildrenByPosition(ctx, nav, sectionChildren)
601
+ };
602
+ }
603
+ /**
604
+ * Find direct child apiPackage segments of `parentSection`. A direct child has
605
+ * `parentSectionPath(seg.section) === parentSection`, or is an orphaned segment
606
+ * whose nearest existing ancestor is `parentSection`.
607
+ */
608
+ function directChildApiPackages(parentSection, scopeSegs) {
609
+ const sectionPaths = new Set(scopeSegs.map((s) => s.seg.section));
610
+ return scopeSegs
611
+ .filter((s) => {
612
+ if (metaStr(s.seg.metadata, "type") !== "apiPackage") {
613
+ return false;
614
+ }
615
+ const parent = parentSectionPath(s.seg.section);
616
+ if (parent === parentSection) {
617
+ return true;
618
+ }
619
+ // Orphaned: parent doesn't exist, adopt if nearest ancestor is parentSection.
620
+ if (!sectionPaths.has(parent)) {
621
+ return nearestExistingAncestor(s.seg.section, sectionPaths) === parentSection;
622
+ }
623
+ return false;
624
+ })
625
+ .sort((a, b) => a.seg.sortOrder - b.seg.sortOrder);
626
+ }
627
+ /**
628
+ * Build the children of an API section (apiReference or apiPackage) by combining
629
+ * the segment's own leaf nodes with nested apiPackage children.
630
+ */
631
+ function buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix) {
632
+ const { seg, nav } = scoped;
633
+ // Build leaf nodes from this segment's own nav routes (not descendants).
634
+ // API references can contain normal docs pages and links in addition to
635
+ // endpoint leaves, so include markdown/link artifacts here instead of only
636
+ // API leaf types.
637
+ const leafNodes = positionedApiLeafChildren(ctx, nav, apiDefinitionId);
638
+ // Build nested ApiPackageNodes from direct child apiPackage segments.
639
+ const childPackages = directChildApiPackages(seg.section, scopeSegs);
640
+ const packageNodes = childPackages.map((child) => ({
641
+ node: apiPackageChildNode(ctx, child, scopeSegs, apiDefinitionId, scopePrefix),
642
+ childIndex: metaNum(child.seg.metadata, "childIndex")
643
+ }));
644
+ // Interleave by position when childIndex metadata is available
645
+ const hasChildIndex = packageNodes.some((p) => p.childIndex != null);
646
+ if (!hasChildIndex) {
647
+ return [...leafNodes, ...packageNodes.map((p) => ({ node: p.node, pos: Number.MAX_SAFE_INTEGER }))]
648
+ .sort((a, b) => a.pos - b.pos)
649
+ .map((p) => p.node);
650
+ }
651
+ const positioned = [];
652
+ positioned.push(...leafNodes);
653
+ for (const p of packageNodes) {
654
+ positioned.push({ node: p.node, pos: p.childIndex ?? Number.MAX_SAFE_INTEGER });
655
+ }
656
+ positioned.sort((a, b) => a.pos - b.pos);
657
+ return positioned.map((p) => p.node);
658
+ }
659
+ /**
660
+ * Build an ApiPackageNode from an apiPackage segment, recursively nesting any
661
+ * deeper sub-packages.
662
+ */
663
+ function apiPackageChildNode(ctx, scoped, scopeSegs, parentApiDefinitionId, scopePrefix) {
664
+ const { seg, nav } = scoped;
665
+ const overview = overviewRoute(nav);
666
+ const overviewPageId = overview != null ? metaStr(overview.metadata, "pageId") : undefined;
667
+ const apiDefinitionId = metaStr(seg.metadata, "apiDefinitionId") ?? parentApiDefinitionId;
668
+ // Use structuralNodeSlug so the package gets its own slug (matching V2)
669
+ // rather than inheriting the first endpoint's path.
670
+ const slug = structuralNodeSlug(ctx, overview?.fullPath, stripLeadingScopePrefix(seg.section, scopePrefix), scopePrefix);
671
+ const metaPointsTo = metaStr(seg.metadata, "pointsTo");
672
+ const children = buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix);
673
+ return {
674
+ type: "apiPackage",
675
+ ...withMetadataDefaults({
676
+ id: ctx.nodeId(`api-pkg:${slug}`),
677
+ title: metaStr(seg.metadata, "title") ?? "",
678
+ slug,
679
+ icon: metaStr(seg.metadata, "icon"),
680
+ hidden: seg.hidden,
681
+ authed: metaBool(seg.metadata, "authed"),
682
+ viewers: toViewers(metaStrArr(seg.metadata, "viewers")),
683
+ orphaned: metaBool(seg.metadata, "orphaned"),
684
+ featureFlags: metaFeatureFlags(seg.metadata)
685
+ }),
686
+ apiDefinitionId: FernNavigation.ApiDefinitionId(apiDefinitionId),
687
+ availability: metaStr(seg.metadata, "availability"),
688
+ overviewPageId: overviewPageId != null ? FernNavigation.PageId(overviewPageId) : undefined,
689
+ noindex: metaBool(overview?.metadata, "noindex") ?? metaBool(seg.metadata, "noindex"),
690
+ pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : undefined,
691
+ children,
692
+ playground: undefined
693
+ };
694
+ }
695
+ /**
696
+ * Merge endpoint nodes that were originally part of an `endpointPair` in the V1
697
+ * tree. The publish transform stamps both artifacts with a shared
698
+ * `endpointPairKey` in their route metadata; this function groups endpoints by
699
+ * that key and reconstructs `EndpointPairNode`s — matching the v2 nav tree
700
+ * structure where stream/non-stream variants share a single page with a toggle.
701
+ */
702
+ /** @internal Exported for testing only. */
703
+ export function mergeEndpointPairs(ctx, leafNodes, allNav) {
704
+ // Build a lookup from endpointId → endpointPairKey using route metadata.
705
+ // Only REST routes carry `endpointPairKey`.
706
+ const endpointIdToPairKey = new Map();
707
+ for (const route of allNav) {
708
+ if (route.type !== "rest") {
709
+ continue;
710
+ }
711
+ const pairKey = metaStr(route.metadata, "endpointPairKey");
712
+ const endpointId = metaStr(route.metadata, "endpointId");
713
+ if (pairKey != null && endpointId != null) {
714
+ endpointIdToPairKey.set(endpointId, pairKey);
715
+ }
716
+ }
717
+ // If no pair keys exist (pre-existing data without the key), return as-is.
718
+ if (endpointIdToPairKey.size === 0) {
719
+ return leafNodes;
720
+ }
721
+ const result = [];
722
+ // Track which pair keys we've already merged so we only emit the pair once.
723
+ const mergedPairKeys = new Map();
724
+ for (const node of leafNodes) {
725
+ if (node.type !== "endpoint") {
726
+ result.push(node);
727
+ continue;
728
+ }
729
+ const pairKey = endpointIdToPairKey.get(String(node.endpointId));
730
+ if (pairKey == null) {
731
+ result.push(node);
732
+ continue;
733
+ }
734
+ const existingIdx = mergedPairKeys.get(pairKey);
735
+ if (existingIdx == null) {
736
+ // First endpoint of the pair — push it and record its position.
737
+ mergedPairKeys.set(pairKey, result.length);
738
+ result.push(node);
739
+ }
740
+ else {
741
+ // Second endpoint — merge with the first into an EndpointPairNode.
742
+ const first = result[existingIdx];
743
+ if (first == null || first.type !== "endpoint") {
744
+ result.push(node);
745
+ continue;
746
+ }
747
+ // Determine which is stream and which is non-stream.
748
+ const stream = node.isResponseStream ? node : first;
749
+ const nonStream = node.isResponseStream ? first : node;
750
+ // Point the stream endpoint's canonicalSlug to the non-stream slug
751
+ // so the sitemap deduplicates them (matching v2 behavior where the
752
+ // v1→latest migrator's title-disambiguation cache achieves the same).
753
+ stream.canonicalSlug = nonStream.slug;
754
+ const pairNode = {
755
+ id: ctx.nodeId(`endpoint-pair:${pairKey}`),
756
+ type: "endpointPair",
757
+ collapsed: undefined,
758
+ stream,
759
+ nonStream
760
+ };
761
+ result[existingIdx] = pairNode;
762
+ }
763
+ }
764
+ return result;
765
+ }
766
+ function apiReferenceNode(ctx, scoped, scopeSegs, scopePrefix) {
767
+ const { seg, nav } = scoped;
768
+ const overview = overviewRoute(nav);
769
+ const overviewPageId = overview != null ? metaStr(overview.metadata, "pageId") : undefined;
770
+ const apiDefinitionId = metaStr(seg.metadata, "apiDefinitionId") ?? "";
771
+ // Slug: prefer the overview route, else a structural slug rooted at the
772
+ // enclosing scope (so the subtree stays inside the default-version prune
773
+ // window — see {@link structuralNodeSlug}).
774
+ // NOTE: do NOT fall back to nav[0]?.fullPath here. When the apiReference
775
+ // has direct endpoint children (no sub-packages), that would set the
776
+ // apiReference's slug to the first endpoint's slug. Then
777
+ // mutableUpdatePointsTo clears pointsTo (slug === redirect target),
778
+ // breaking the breadcrumb link.
779
+ const slug = structuralNodeSlug(ctx, overview?.fullPath, stripLeadingScopePrefix(seg.section, scopePrefix), scopePrefix);
780
+ const metaPointsTo = metaStr(seg.metadata, "pointsTo");
781
+ const children = buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix);
782
+ const changelog = attachedApiChangelogNode(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix);
783
+ return {
784
+ type: "apiReference",
785
+ ...withMetadataDefaults({
786
+ id: ctx.nodeId(`api:${slug}`),
787
+ title: metaStr(seg.metadata, "title") ?? "",
788
+ slug,
789
+ icon: metaStr(seg.metadata, "icon"),
790
+ hidden: seg.hidden,
791
+ authed: metaBool(seg.metadata, "authed"),
792
+ viewers: mergeVariantViewers(seg),
793
+ orphaned: metaBool(seg.metadata, "orphaned"),
794
+ featureFlags: metaFeatureFlags(seg.metadata)
795
+ }),
796
+ apiDefinitionId: FernNavigation.ApiDefinitionId(apiDefinitionId),
797
+ availability: metaStr(seg.metadata, "availability"),
798
+ overviewPageId: overviewPageId != null ? FernNavigation.PageId(overviewPageId) : undefined,
799
+ noindex: metaBool(overview?.metadata, "noindex") ?? metaBool(seg.metadata, "noindex"),
800
+ paginated: true,
801
+ showErrors: metaBool(seg.metadata, "showErrors"),
802
+ hideTitle: metaBool(seg.metadata, "hideTitle"),
803
+ pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : undefined,
804
+ children,
805
+ changelog,
806
+ playground: undefined,
807
+ postmanCollectionUrl: undefined
808
+ };
809
+ }
810
+ function attachedApiChangelogNode(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix) {
811
+ const { seg } = scoped;
812
+ const candidates = scopeSegs.filter((candidate) => {
813
+ if (metaStr(candidate.seg.metadata, "type") !== "changelog") {
814
+ return false;
815
+ }
816
+ return metaStr(candidate.seg.metadata, "apiDefinitionId") === apiDefinitionId;
817
+ });
818
+ const changelogSeg = candidates.find((candidate) => parentSectionPath(candidate.seg.section) === seg.section) ?? candidates[0];
819
+ return changelogSeg != null ? changelogNode(ctx, changelogSeg, scopePrefix) : undefined;
820
+ }
821
+ function hasOwningApiReference(scoped, scopeSegs) {
822
+ const apiDefinitionId = metaStr(scoped.seg.metadata, "apiDefinitionId");
823
+ if (apiDefinitionId == null || metaStr(scoped.seg.metadata, "type") !== "changelog") {
824
+ return false;
825
+ }
826
+ return scopeSegs.some((candidate) => {
827
+ if (metaStr(candidate.seg.metadata, "type") !== "apiReference") {
828
+ return false;
829
+ }
830
+ return metaStr(candidate.seg.metadata, "apiDefinitionId") === apiDefinitionId;
831
+ });
832
+ }
833
+ function changelogNode(ctx, scoped, scopePrefix) {
834
+ const { seg, nav } = scoped;
835
+ const overview = overviewRoute(nav);
836
+ const overviewPageId = overview != null ? metaStr(overview.metadata, "pageId") : undefined;
837
+ // Group changelog entries by year → month. Entry dates are ISO strings.
838
+ const entries = nav.filter((r) => r.type === "changelog");
839
+ const byYear = new Map();
840
+ for (const r of entries) {
841
+ const dateStr = metaStr(r.metadata, "date");
842
+ const date = dateStr != null ? new Date(dateStr) : new Date(0);
843
+ const year = date.getUTCFullYear();
844
+ const month = date.getUTCMonth() + 1;
845
+ const entry = {
846
+ type: "changelogEntry",
847
+ ...withMetadataDefaults({
848
+ id: ctx.nodeId(`cl-entry:${r.fullPath ?? metaStr(r.metadata, "pageId") ?? ""}`),
849
+ title: metaStr(r.metadata, "title") ?? "",
850
+ slug: ctx.contentSlug(r.fullPath ?? ""),
851
+ icon: metaStr(r.metadata, "icon"),
852
+ hidden: r.hidden,
853
+ authed: metaBool(r.metadata, "authed"),
854
+ viewers: toViewers(metaStrArr(r.metadata, "viewers")),
855
+ orphaned: metaBool(r.metadata, "orphaned"),
856
+ featureFlags: metaFeatureFlags(r.metadata)
857
+ }),
858
+ pageId: FernNavigation.PageId(metaStr(r.metadata, "pageId") ?? ""),
859
+ noindex: metaBool(r.metadata, "noindex"),
860
+ date: dateStr ?? "",
861
+ tags: metaStrArr(r.metadata, "tags")
862
+ };
863
+ let months = byYear.get(year);
864
+ if (months == null) {
865
+ months = new Map();
866
+ byYear.set(year, months);
867
+ }
868
+ const arr = months.get(month) ?? [];
869
+ arr.push(entry);
870
+ months.set(month, arr);
871
+ }
872
+ // The publish transform stores changelog section paths in two shapes:
873
+ // • Changelog TABs: "home/changelog" (scope prefix baked in)
874
+ // • Changelog sidebar children: "changelog" (relative to the tab)
875
+ // `structuralNodeSlug` unconditionally joins `scopePrefix + section`, so
876
+ // an already-scoped section gets double-prefixed ("home/home/changelog").
877
+ // Strip the leading scope prefix when present so the join is idempotent.
878
+ const relativeSection = stripLeadingScopePrefix(seg.section, scopePrefix);
879
+ const baseSlug = structuralNodeSlug(ctx, overview?.fullPath, relativeSection, scopePrefix);
880
+ const years = [...byYear.entries()]
881
+ .sort((a, b) => b[0] - a[0])
882
+ .map(([year, months]) => ({
883
+ type: "changelogYear",
884
+ ...withMetadataDefaults({
885
+ id: ctx.nodeId(`cl-year:${baseSlug}/${year}`),
886
+ title: String(year),
887
+ slug: asSlug(`${baseSlug}/${year}`),
888
+ icon: undefined,
889
+ hidden: undefined
890
+ }),
891
+ year,
892
+ children: [...months.entries()]
893
+ .sort((a, b) => b[0] - a[0])
894
+ .map(([month, children]) => ({
895
+ type: "changelogMonth",
896
+ ...withMetadataDefaults({
897
+ id: ctx.nodeId(`cl-month:${baseSlug}/${year}/${month}`),
898
+ title: String(month),
899
+ slug: asSlug(`${baseSlug}/${year}/${month}`),
900
+ icon: undefined,
901
+ hidden: undefined
902
+ }),
903
+ month,
904
+ children
905
+ }))
906
+ }));
907
+ return {
908
+ type: "changelog",
909
+ ...withMetadataDefaults({
910
+ id: ctx.nodeId(`changelog:${baseSlug}`),
911
+ title: metaStr(seg.metadata, "title") ?? "",
912
+ slug: baseSlug,
913
+ icon: metaStr(seg.metadata, "icon"),
914
+ hidden: seg.hidden,
915
+ authed: metaBool(seg.metadata, "authed"),
916
+ viewers: mergeVariantViewers(seg),
917
+ orphaned: metaBool(seg.metadata, "orphaned"),
918
+ featureFlags: metaFeatureFlags(seg.metadata)
919
+ }),
920
+ overviewPageId: overviewPageId != null ? FernNavigation.PageId(overviewPageId) : undefined,
921
+ noindex: metaBool(overview?.metadata, "noindex") ?? metaBool(seg.metadata, "noindex"),
922
+ children: years
923
+ };
924
+ }
925
+ /** The immediate parent section path of a section path ("a/b/c" → "a/b", "a" → ""). */
926
+ function parentSectionPath(sectionPath) {
927
+ const idx = sectionPath.lastIndexOf("/");
928
+ return idx === -1 ? "" : sectionPath.slice(0, idx);
929
+ }
930
+ /** Walk up the section path hierarchy to find the nearest ancestor that exists in the set. */
931
+ function nearestExistingAncestor(sectionPath, existing) {
932
+ let current = parentSectionPath(sectionPath);
933
+ while (current !== "") {
934
+ if (existing.has(current)) {
935
+ return current;
936
+ }
937
+ current = parentSectionPath(current);
938
+ }
939
+ return "";
940
+ }
941
+ /**
942
+ * Build the section/api/changelog nodes whose immediate parent is `parentPath`,
943
+ * recursing into nested sections. Also picks up orphaned segments whose parent
944
+ * section doesn't exist but whose nearest existing ancestor is `parentPath`.
945
+ */
946
+ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScopePrefix) {
947
+ const sectionPaths = new Set(scopeSegs.map((s) => s.seg.section));
948
+ const direct = scopeSegs
949
+ .filter((s) => {
950
+ const sec = s.seg.section;
951
+ const type = metaStr(s.seg.metadata, "type");
952
+ if (sec === "" || type === "tabRoot") {
953
+ return false;
954
+ }
955
+ if (hasOwningApiReference(s, scopeSegs)) {
956
+ return false;
957
+ }
958
+ const parent = parentSectionPath(sec);
959
+ if (parent === parentPath) {
960
+ return true;
961
+ }
962
+ // Orphaned segment: parent doesn't exist, walk up to find nearest
963
+ // existing ancestor. If it's parentPath, adopt this segment.
964
+ if (!sectionPaths.has(parent)) {
965
+ return nearestExistingAncestor(sec, sectionPaths) === parentPath;
966
+ }
967
+ return false;
968
+ })
969
+ .sort((a, b) => a.seg.sortOrder - b.seg.sortOrder);
970
+ return direct.map((s) => {
971
+ const type = metaStr(s.seg.metadata, "type");
972
+ const childIndex = metaNum(s.seg.metadata, "childIndex");
973
+ let node;
974
+ if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
975
+ node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
976
+ }
977
+ else if (type === "changelog") {
978
+ node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
979
+ }
980
+ else {
981
+ // section (or unrecognised) → recurse for nested sections.
982
+ node = sectionNode(ctx, s, buildSectionTree(ctx, scopeSegs, s.seg.section, scopePrefix, changelogScopePrefix), scopePrefix);
983
+ }
984
+ return { node, childIndex };
985
+ });
986
+ }
987
+ // ── build a sidebarRoot for a single scope ─────────────────────────────────
988
+ /**
989
+ * When multiple root-level sections share the same section path (common for
990
+ * versioned docs where all tab-level sections receive the version slug as
991
+ * their path), we need to scope buildSectionTree so each section only adopts
992
+ * the child segments that physically belong to it.
993
+ *
994
+ * Ownership is determined by sortOrder ranges: a section owns segments whose
995
+ * sortOrder falls between its own and the next sibling section's sortOrder.
996
+ * Returns a map only for sections that have duplicates; unique sections won't
997
+ * appear (and should pass unfiltered scopeSegs to buildSectionTree).
998
+ */
999
+ function computeSiblingSortBoundaries(ordered) {
1000
+ const result = new Map();
1001
+ // Collect root-level sections grouped by their section path.
1002
+ const sectionPaths = new Set(ordered.map((s) => s.seg.section));
1003
+ const rootSections = [];
1004
+ for (const s of ordered) {
1005
+ const type = metaStr(s.seg.metadata, "type");
1006
+ const sec = s.seg.section;
1007
+ if (type !== "section" || sec === "") {
1008
+ continue;
1009
+ }
1010
+ const parent = parentSectionPath(sec);
1011
+ const isRootLevel = parent === "" || (!sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "");
1012
+ if (isRootLevel) {
1013
+ rootSections.push(s);
1014
+ }
1015
+ }
1016
+ // Group by section path — only paths with >1 section need boundaries.
1017
+ const byPath = new Map();
1018
+ for (const s of rootSections) {
1019
+ const group = byPath.get(s.seg.section) ?? [];
1020
+ group.push(s);
1021
+ byPath.set(s.seg.section, group);
1022
+ }
1023
+ for (const [, siblings] of byPath) {
1024
+ if (siblings.length <= 1) {
1025
+ continue;
1026
+ }
1027
+ // Siblings are already in sortOrder (from `ordered`).
1028
+ for (let i = 0; i < siblings.length; i++) {
1029
+ const lo = siblings[i].seg.sortOrder;
1030
+ const hi = i + 1 < siblings.length ? siblings[i + 1].seg.sortOrder : Number.MAX_SAFE_INTEGER;
1031
+ result.set(siblings[i], { lo, hi });
1032
+ }
1033
+ }
1034
+ return result;
1035
+ }
1036
+ /**
1037
+ * Assemble the children of a scope's sidebar root in cross-segment order.
1038
+ * `tabRoot` segments contribute their page/link artifacts inline at their
1039
+ * sort position; depth-0 `section`/`apiReference`/`changelog` segments become
1040
+ * their own nodes (with nested sections attached recursively).
1041
+ *
1042
+ * Segments whose parent section path doesn't correspond to any existing
1043
+ * segment are "orphaned" and emitted at the top level. This happens when
1044
+ * the publish transform skips segment creation for an apiReference with no
1045
+ * direct artifacts (e.g. no overview page), leaving only apiPackage children
1046
+ * like `rest-api/store` with no `rest-api` parent segment.
1047
+ */
1048
+ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePrefix) {
1049
+ const ordered = [...scopeSegs].sort((a, b) => a.seg.sortOrder - b.seg.sortOrder);
1050
+ const sectionPaths = new Set(ordered.map((s) => s.seg.section));
1051
+ // `pos` is the original V1 child position when known — `displaySortOrder`
1052
+ // for root-level loose artifacts, `metadata.childIndex` for depth-0
1053
+ // segments. Both index into the SAME child list at write time, so they
1054
+ // interleave directly (e.g. [page 0, page 1, section 2…15, page 16, 17]).
1055
+ const annotated = [];
1056
+ // ── Root-section adoption flow ──────────────────────────────────────
1057
+ //
1058
+ // A scope may contain a "root section" — a segment with type "section"
1059
+ // and section path "". When present, it acts as a structural wrapper:
1060
+ //
1061
+ // hasRootSection = true
1062
+ // │
1063
+ // ├─ (A) tabRoot / loose artifacts (sec=="", !STRUCTURAL_SEGMENT_TYPES)
1064
+ // │ → emit pages/links inline at their displaySortOrder
1065
+ // │
1066
+ // ├─ (B) the root section itself (sec=="", type=="section")
1067
+ // │ → buildSectionTree adopts ALL depth-0 children as its own
1068
+ // │ → emit one sectionNode wrapping the whole subtree
1069
+ // │
1070
+ // └─ (C) depth-0 sections (parentSectionPath=="")
1071
+ // → SKIP — already adopted by (B) via buildSectionTree
1072
+ //
1073
+ // Without a root section, depth-0 sections are emitted directly.
1074
+ const hasRootSection = ordered.some((s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "");
1075
+ // ── Sibling section ownership ────────────────────────────────────────
1076
+ //
1077
+ // Multiple root-level sections can share the same section path (e.g.
1078
+ // three sections all with path equal to the version slug). When this
1079
+ // happens, buildSectionTree would incorrectly give ALL child subsections
1080
+ // to each sibling. We resolve ownership via sortOrder: a section owns
1081
+ // segments whose sortOrder falls between its own and the next sibling's.
1082
+ const siblingBoundaries = computeSiblingSortBoundaries(ordered);
1083
+ for (const s of ordered) {
1084
+ const type = metaStr(s.seg.metadata, "type");
1085
+ const sec = s.seg.section;
1086
+ if (hasOwningApiReference(s, scopeSegs)) {
1087
+ continue;
1088
+ }
1089
+ if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
1090
+ continue;
1091
+ }
1092
+ // (A) Loose artifacts: tabRoot or non-structural segments at section path "".
1093
+ // Structural types need their own node builders in (B)/(C) even when
1094
+ // their section path is "" (which happens with skip-slug: true).
1095
+ if (type === "tabRoot" || (sec === "" && !STRUCTURAL_SEGMENT_TYPES.has(type ?? ""))) {
1096
+ for (const r of s.nav) {
1097
+ const node = artifactToNode(ctx, r);
1098
+ if (node != null) {
1099
+ annotated.push({ node, pos: r.displaySortOrder ?? undefined, isLeaf: true });
1100
+ }
1101
+ }
1102
+ continue;
1103
+ }
1104
+ // (B) Root section wrapper — adopts depth-0 children via buildSectionTree.
1105
+ if (type === "section" && sec === "") {
1106
+ const sectionChildren = buildSectionTree(ctx, scopeSegs, "", scopePrefix);
1107
+ const node = sectionNode(ctx, s, sectionChildren, scopePrefix);
1108
+ annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
1109
+ continue;
1110
+ }
1111
+ // (C) Depth-0 or orphaned sections — emit at root unless already
1112
+ // adopted by a root section (B).
1113
+ const parent = parentSectionPath(sec);
1114
+ const isRootLevel = parent === "" || (!sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "");
1115
+ // Skip depth-0 sections already adopted by the root section wrapper (B),
1116
+ // but NOT structural types with sec="" (skip-slug). buildSectionTree
1117
+ // filters out sec="" segments (line 1249), so they wouldn't be adopted
1118
+ // and must be emitted here directly.
1119
+ if (isRootLevel && hasRootSection && sec !== "") {
1120
+ continue;
1121
+ }
1122
+ if (isRootLevel) {
1123
+ let node;
1124
+ if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
1125
+ node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
1126
+ }
1127
+ else if (type === "changelog") {
1128
+ node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
1129
+ }
1130
+ else {
1131
+ // Scope child segments to this section's sortOrder range when
1132
+ // sibling sections share the same path.
1133
+ const bounds = siblingBoundaries.get(s);
1134
+ const ownedSegs = bounds != null
1135
+ ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi)
1136
+ : scopeSegs;
1137
+ node = sectionNode(ctx, s, buildSectionTree(ctx, ownedSegs, sec, scopePrefix, changelogScopePrefix), scopePrefix);
1138
+ }
1139
+ // Shared/merged sections (paths not rooted in scopePrefix) must not
1140
+ // carry childIndex — their source-version positions would sort them
1141
+ // ahead of native sections. Only applies when sibling sections exist
1142
+ // (multiple sections sharing same path), indicating a versioned site
1143
+ // where shared sections were merged from a sibling version.
1144
+ const isSharedSection = siblingBoundaries.size > 0 && scopePrefix !== "" && sec !== "" && !sec.startsWith(scopePrefix);
1145
+ annotated.push({
1146
+ node,
1147
+ pos: isSharedSection ? undefined : metaNum(s.seg.metadata, "childIndex"),
1148
+ isLeaf: false
1149
+ });
1150
+ }
1151
+ }
1152
+ // Interleave by V1 position only when BOTH leaves and segments carry one.
1153
+ // Manifests written before displaySortOrder was carried through have
1154
+ // position-less leaves; reordering on childIndex alone would move every
1155
+ // loose page behind its sibling sections, so those keep the legacy
1156
+ // (segment-sortOrder) order. The seq tiebreak preserves legacy order for
1157
+ // equal or missing positions.
1158
+ const hasLeafPos = annotated.some((a) => a.isLeaf && a.pos != null);
1159
+ const hasSegmentPos = annotated.some((a) => !a.isLeaf && a.pos != null);
1160
+ const flat = hasLeafPos && hasSegmentPos
1161
+ ? annotated
1162
+ .map((a, seq) => ({ ...a, seq }))
1163
+ .sort((x, y) => (x.pos ?? Number.MAX_SAFE_INTEGER) - (y.pos ?? Number.MAX_SAFE_INTEGER) || x.seq - y.seq)
1164
+ .map((a) => a.node)
1165
+ : annotated.map((a) => a.node);
1166
+ return groupSidebarRootChildren(ctx, flat);
1167
+ }
1168
+ /**
1169
+ * `SidebarRootChild` only permits SidebarGroupNode / ApiReferenceNode /
1170
+ * SectionNode / VariantedNode. Sections, apiReferences, and varianted nodes
1171
+ * pass through as direct root children (rendered as static headings via
1172
+ * SidebarRootSectionNode / SidebarRootApiPackageNode — always expanded, no
1173
+ * toggle). Pages, links, and changelogs are wrapped into a SidebarGroupNode
1174
+ * so they render via SidebarNavigationChild (mirroring the V1 tree structure
1175
+ * where sections are always direct SidebarRootChildren).
1176
+ */
1177
+ function groupSidebarRootChildren(ctx, children) {
1178
+ const out = [];
1179
+ let run = [];
1180
+ const flushRun = () => {
1181
+ if (run.length > 0) {
1182
+ // Key off the first child's (already-stable) id so the group id is
1183
+ // stable across builds and unique per run.
1184
+ out.push({
1185
+ type: "sidebarGroup",
1186
+ id: ctx.nodeId(`sidebar-group:${run[0]?.id ?? ""}`),
1187
+ collapsed: undefined,
1188
+ children: run
1189
+ });
1190
+ run = [];
1191
+ }
1192
+ };
1193
+ for (const child of children) {
1194
+ if (child.type === "apiReference" || child.type === "varianted") {
1195
+ flushRun();
1196
+ out.push(child);
1197
+ }
1198
+ else if (child.type === "section" && !child.collapsible) {
1199
+ // Match V2 NavigationConfigConverter.groupSidebarRootChildren:
1200
+ // all non-collapsible sections become direct SidebarRootChildren
1201
+ // (rendered via SidebarRootSectionNode — always-expanded heading).
1202
+ // Only sections with explicit `collapsible: true` stay in a
1203
+ // sidebarGroup.
1204
+ flushRun();
1205
+ out.push(child);
1206
+ }
1207
+ else if (child.type === "changelog") {
1208
+ flushRun();
1209
+ run.push(child);
1210
+ flushRun();
1211
+ }
1212
+ else {
1213
+ run.push(child);
1214
+ }
1215
+ }
1216
+ flushRun();
1217
+ return out;
1218
+ }
1219
+ function buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix) {
1220
+ const first = scopeSegs[0];
1221
+ return {
1222
+ type: "sidebarRoot",
1223
+ id: ctx.nodeId(`sidebar:${first != null ? scopeKey(first.seg) : "root"}`),
1224
+ collapsed: undefined,
1225
+ children: buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePrefix)
1226
+ };
1227
+ }
1228
+ // ── public entrypoint ───────────────────────────────────────────────────────
1229
+ /**
1230
+ * Build a full (un-pruned) `RootNode` from the decomposed ledger model.
1231
+ */
1232
+ export function buildFullRootFromSegments(options) {
1233
+ const { basePath, rootSlug: sourceRootSlug, title, segments, navBySegment, skipSharedSectionMerge } = options;
1234
+ // Per-call state — never shared across concurrent builds.
1235
+ const ctx = createBuildContext(basePath);
1236
+ const scoped = segments
1237
+ // Infrastructure segments (files/redirects) are filtered server-side,
1238
+ // but guard here too.
1239
+ .filter((seg) => {
1240
+ const t = metaStr(seg.metadata, "type");
1241
+ return !INFRA_SEGMENT_TYPES.has(t ?? "");
1242
+ })
1243
+ .map((seg) => ({ seg, nav: navBySegment.get(seg.segmentHash) ?? [] }));
1244
+ const rootSlug = asSlug(sourceRootSlug ?? basePath);
1245
+ // Group by scope identity.
1246
+ const scopesByKey = new Map();
1247
+ for (const s of scoped) {
1248
+ const key = scopeKey(s.seg);
1249
+ const arr = scopesByKey.get(key) ?? [];
1250
+ arr.push(s);
1251
+ scopesByKey.set(key, arr);
1252
+ }
1253
+ const products = uniqueDetails(scoped, "product");
1254
+ const versions = uniqueDetails(scoped, "version");
1255
+ const tabs = uniqueDetails(scoped, "tab");
1256
+ let child;
1257
+ if (products.length > 0) {
1258
+ child = buildProductGroup(ctx, products, scoped, rootSlug, skipSharedSectionMerge);
1259
+ }
1260
+ else if (versions.length > 0) {
1261
+ child = buildVersioned(ctx, versions, scoped, rootSlug, undefined, skipSharedSectionMerge);
1262
+ }
1263
+ else {
1264
+ child = buildUnversioned(ctx, scoped, rootSlug, tabs.length > 0);
1265
+ }
1266
+ // Derive root.pointsTo from the default child's metadata so root-slug
1267
+ // visits redirect correctly even when mutableUpdatePointsTo is skipped
1268
+ // (structure-only roots). On the full root mutableUpdatePointsTo
1269
+ // recomputes this via tree traversal; this seed value is only visible
1270
+ // on structure-only roots where the traversal is intentionally skipped.
1271
+ let rootPointsTo;
1272
+ if (child.type === "productgroup") {
1273
+ const defaultProduct = child.children.find((p) => p.default) ?? child.children[0];
1274
+ rootPointsTo = defaultProduct?.type === "product" ? defaultProduct.pointsTo : undefined;
1275
+ }
1276
+ else if (child.type === "versioned") {
1277
+ const defaultVersion = child.children.find((v) => v.default) ?? child.children[0];
1278
+ rootPointsTo = defaultVersion?.pointsTo;
1279
+ }
1280
+ else if (child.type === "unversioned") {
1281
+ // Unversioned sites have no product/version metadata to seed pointsTo.
1282
+ // Derive from the first tab's or first section segment's metadata.
1283
+ if (tabs.length > 0) {
1284
+ const firstTab = tabs[0];
1285
+ const pt = firstTab != null ? metaStr(firstTab.metadata, "pointsTo") : undefined;
1286
+ rootPointsTo = pt != null ? pointsToSlug(pt) : undefined;
1287
+ }
1288
+ else {
1289
+ const sorted = [...scoped].sort((a, b) => a.seg.sortOrder - b.seg.sortOrder);
1290
+ for (const s of sorted) {
1291
+ if (s.seg.hidden) {
1292
+ continue;
1293
+ }
1294
+ const pt = metaStr(s.seg.metadata, "pointsTo");
1295
+ if (pt != null) {
1296
+ rootPointsTo = pointsToSlug(pt);
1297
+ break;
1298
+ }
1299
+ }
1300
+ }
1301
+ }
1302
+ const root = {
1303
+ type: "root",
1304
+ version: "v2",
1305
+ ...withMetadataDefaults({ id: ctx.nodeId("root"), title, slug: rootSlug, icon: undefined, hidden: undefined }),
1306
+ roles: undefined,
1307
+ pointsTo: rootPointsTo,
1308
+ child
1309
+ };
1310
+ return root;
1311
+ }
1312
+ // ── scaffolding builders ────────────────────────────────────────────────────
1313
+ /**
1314
+ * Collapse segment details by identity.
1315
+ *
1316
+ * Primary key is the detail's slug when non-empty — this deduplicates
1317
+ * stale rows from old publishes that share the same slug but have
1318
+ * different DB ids. When the slug is empty (skip-slug items) we fall
1319
+ * back to `detail.id` so that distinct skip-slug tabs/products aren't
1320
+ * collapsed into a single entry.
1321
+ *
1322
+ * Tabs always key by `d.id` because skip-slug tabs inherit their
1323
+ * parent's slug (e.g. the version slug "v-2"), so multiple distinct
1324
+ * tabs share the same slug — keying by slug would collapse them.
1325
+ *
1326
+ * Among duplicates at the same key we prefer the one whose metadata
1327
+ * carries a `pointsTo` value (richer / more recent publish).
1328
+ */
1329
+ function uniqueDetails(scoped, dim) {
1330
+ const byKey = new Map();
1331
+ for (const s of scoped) {
1332
+ const d = s.seg[dim];
1333
+ if (d == null) {
1334
+ continue;
1335
+ }
1336
+ const slug = detailSlug(d);
1337
+ // Tabs always key by id: skip-slug tabs share the parent slug
1338
+ // (e.g. "v-2") and would otherwise collapse into one entry.
1339
+ const key = dim === "tab" ? d.id : slug !== "" ? slug : d.id;
1340
+ const existing = byKey.get(key);
1341
+ if (existing == null) {
1342
+ byKey.set(key, d);
1343
+ }
1344
+ else if (metaStr(d.metadata, "pointsTo") != null && metaStr(existing.metadata, "pointsTo") == null) {
1345
+ byKey.set(key, d);
1346
+ }
1347
+ }
1348
+ return [...byKey.values()].sort((a, b) => a.sortOrder - b.sortOrder);
1349
+ }
1350
+ function scopeSlugPrefix(rootSlug, ...details) {
1351
+ const parts = [rootSlug];
1352
+ for (const d of details) {
1353
+ if (d != null && !detailIsDefault(d)) {
1354
+ const s = detailSlug(d);
1355
+ if (s !== "") {
1356
+ parts.push(s);
1357
+ }
1358
+ }
1359
+ }
1360
+ return FernNavigation.slugjoin(...parts);
1361
+ }
1362
+ /**
1363
+ * Build a VariantedNode from variant details, grouping segments by variant
1364
+ * so each variant gets its own scoped sidebar children.
1365
+ */
1366
+ function buildVariantedNode(ctx, variants, scopeSegs, scopePrefix) {
1367
+ const variantChildren = variants.map((variant) => {
1368
+ const variantSegs = scopeSegs.filter((s) => s.seg.variant?.id === variant.id);
1369
+ // V2 never elides variant slugs — they always appear in the URL
1370
+ // (unlike product/version defaults which ARE elided). Use the
1371
+ // variant's individual slug directly instead of scopeSlugPrefix
1372
+ // which skips default details.
1373
+ const variantIndividualSlug = detailSlug(variant);
1374
+ const variantSlug = variantIndividualSlug !== ""
1375
+ ? asSlug(FernNavigation.slugjoin(scopePrefix, variantIndividualSlug))
1376
+ : scopePrefix;
1377
+ const metaPointsTo = metaStr(variant.metadata, "pointsTo");
1378
+ const children = buildSidebarRootChildren(ctx, variantSegs, scopePrefix);
1379
+ return {
1380
+ type: "variant",
1381
+ ...withMetadataDefaults({
1382
+ id: ctx.nodeId(`variant:${variantSlug}`),
1383
+ title: variant.displayName,
1384
+ slug: variantSlug,
1385
+ icon: variant.icon ?? undefined,
1386
+ hidden: variant.hidden,
1387
+ viewers: toViewers(variant.viewers)
1388
+ }),
1389
+ default: detailIsDefault(variant),
1390
+ variantId: FernNavigation.VariantId(String(variant.id)),
1391
+ subtitle: metaStr(variant.metadata, "subtitle") ?? undefined,
1392
+ image: metaStr(variant.metadata, "image") != null
1393
+ ? FernNavigation.FileId(metaStr(variant.metadata, "image"))
1394
+ : undefined,
1395
+ pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : undefined,
1396
+ children: children
1397
+ };
1398
+ });
1399
+ return {
1400
+ type: "varianted",
1401
+ id: ctx.nodeId(`varianted:${scopeSegs[0] != null ? scopeKey(scopeSegs[0].seg) : "root"}`),
1402
+ collapsed: undefined,
1403
+ children: variantChildren
1404
+ };
1405
+ }
1406
+ /**
1407
+ * Build a sidebar root, wrapping content in a VariantedNode when variants exist.
1408
+ * Without this, all variant segments merge into one flat sidebar — causing the
1409
+ * "double sidebar" where both variants' nav entries render simultaneously.
1410
+ */
1411
+ function buildSidebarRootWithVariants(ctx, scopeSegs, scopePrefix, changelogScopePrefix) {
1412
+ const variants = uniqueDetails(scopeSegs, "variant");
1413
+ if (variants.length <= 1) {
1414
+ return buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix);
1415
+ }
1416
+ const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
1417
+ const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
1418
+ const sharedChildren = sharedSegs.length > 0 ? buildSidebarRootChildren(ctx, sharedSegs, scopePrefix, changelogScopePrefix) : [];
1419
+ const first = scopeSegs[0];
1420
+ return {
1421
+ type: "sidebarRoot",
1422
+ id: ctx.nodeId(`sidebar:${first != null ? scopeKey(first.seg) : "root"}`),
1423
+ collapsed: undefined,
1424
+ children: [...sharedChildren, variantedNode]
1425
+ };
1426
+ }
1427
+ function buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix) {
1428
+ if (!tabsPresent) {
1429
+ // When no tabs exist but variants do, wrap variant-scoped segments
1430
+ // in a VariantedNode and include non-variant segments alongside it.
1431
+ const variants = uniqueDetails(scopeSegs, "variant");
1432
+ if (variants.length > 1) {
1433
+ const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
1434
+ const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
1435
+ if (sharedSegs.length > 0) {
1436
+ const sharedChildren = buildSidebarRootChildren(ctx, sharedSegs, scopePrefix);
1437
+ const first = scopeSegs[0];
1438
+ return {
1439
+ type: "sidebarRoot",
1440
+ id: ctx.nodeId(`sidebar:${first != null ? scopeKey(first.seg) : "root"}`),
1441
+ collapsed: undefined,
1442
+ children: [...sharedChildren, variantedNode]
1443
+ };
1444
+ }
1445
+ return variantedNode;
1446
+ }
1447
+ return buildSidebarRoot(ctx, scopeSegs, scopePrefix);
1448
+ }
1449
+ // Group this scope's segments by tab.
1450
+ const tabDetails = uniqueDetails(scopeSegs, "tab");
1451
+ const children = tabDetails.map((tab) => {
1452
+ const tabType = metaStr(tab.metadata, "tab_type");
1453
+ // The tab slug ACCUMULATES the enclosing scope prefix (basepath/product/
1454
+ // version) and appends the tab segment, mirroring the canonical V1->V2
1455
+ // converter (`SlugGenerator.apply`, which appends the tab onto the
1456
+ // version/product slug). Rooting at the empty slug instead would drop
1457
+ // the product/version prefix, breaking parity with v2's tab/breadcrumb
1458
+ // slugs AND breaking default-version elision: the tab node's slug would
1459
+ // not start with the version slug, so `toDefaultSlug` (the prune window)
1460
+ // would skip it. Because `scopePrefix` already carries the FULL version
1461
+ // segment, `{...}/{version}/{tab}` still starts with the version slug and
1462
+ // stays inside the prune window (see {@link structuralNodeSlug}).
1463
+ // V2's SlugGenerator.set() treats a tab slug that starts with the
1464
+ // version slug as a fullSlug (absolute path) and uses it as-is.
1465
+ // Without this check, scopeSlugPrefix joins version + tab producing
1466
+ // a doubled prefix (e.g. "2026-02-09/2026-02-09").
1467
+ const rawTabSlug = detailSlug(tab);
1468
+ const versionDetail = scopeSegs[0]?.seg.version;
1469
+ const versionSlugStr = versionDetail != null ? detailSlug(versionDetail) : undefined;
1470
+ const tabSlug = versionSlugStr != null &&
1471
+ rawTabSlug !== "" &&
1472
+ (rawTabSlug === versionSlugStr || rawTabSlug.startsWith(versionSlugStr + "/"))
1473
+ ? asSlug(rawTabSlug)
1474
+ : asSlug(scopeSlugPrefix(scopePrefix, tab));
1475
+ if (tabType === "link") {
1476
+ return {
1477
+ type: "link",
1478
+ id: ctx.nodeId(`link:${metaStr(tab.metadata, "url") ?? tabSlug}`),
1479
+ collapsed: undefined,
1480
+ title: tab.displayName,
1481
+ icon: tab.icon ?? undefined,
1482
+ url: FernNavigation.Url(metaStr(tab.metadata, "url") ?? ""),
1483
+ target: metaStr(tab.metadata, "target")
1484
+ };
1485
+ }
1486
+ if (tabType === "changelog") {
1487
+ const tabSegs = scopeSegs.filter((s) => s.seg.tab?.id === tab.id);
1488
+ const changelogSeg = tabSegs.find((s) => metaStr(s.seg.metadata, "type") === "changelog");
1489
+ if (changelogSeg != null) {
1490
+ // Root the changelog at the TAB slug (`tabSlug`), not the bare
1491
+ // scope prefix. Tab-level changelogs have an empty section path
1492
+ // (the publish transform strips the tab segment because
1493
+ // `extractSlugSegment(tabSlug, tabSlug) === ""`), so
1494
+ // `structuralNodeSlug(ctx, null, "", scopePrefix)` collapses to
1495
+ // just the scope prefix — which is the product/version slug.
1496
+ // That slug collision causes the changelog node to replace the
1497
+ // product node in NodeCollector's slug map, breaking structural
1498
+ // redirects (the product slug renders changelog content instead
1499
+ // of redirecting to the first docs page). Passing `tabSlug`
1500
+ // yields the correct `{...}/{changelog}` structural slug.
1501
+ return changelogNode(ctx, changelogSeg, tabSlug);
1502
+ }
1503
+ // Fallback: empty changelog node for the tab
1504
+ return {
1505
+ type: "changelog",
1506
+ ...withMetadataDefaults({
1507
+ id: ctx.nodeId(`changelog:${tabSlug}`),
1508
+ title: tab.displayName,
1509
+ slug: tabSlug,
1510
+ icon: tab.icon ?? undefined,
1511
+ hidden: tab.hidden,
1512
+ viewers: toViewers(tab.viewers)
1513
+ }),
1514
+ overviewPageId: undefined,
1515
+ noindex: undefined,
1516
+ children: []
1517
+ };
1518
+ }
1519
+ // Default: regular tab
1520
+ const tabSegs = scopeSegs.filter((s) => s.seg.tab?.id === tab.id);
1521
+ const metaPointsTo = metaStr(tab.metadata, "pointsTo");
1522
+ return {
1523
+ type: "tab",
1524
+ ...withMetadataDefaults({
1525
+ id: ctx.nodeId(`tab:${tabSlug}`),
1526
+ title: tab.displayName,
1527
+ slug: tabSlug,
1528
+ icon: tab.icon ?? undefined,
1529
+ hidden: tab.hidden,
1530
+ viewers: toViewers(tab.viewers)
1531
+ }),
1532
+ pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : undefined,
1533
+ // Structural sections under this tab are rooted at the TAB slug
1534
+ // (`{...}/{version}/{tab}`) so their slugs nest under the tab
1535
+ // (matching v2) while still starting with the version slug, keeping
1536
+ // the subtree inside the default-version prune window (see
1537
+ // {@link structuralNodeSlug}).
1538
+ // Changelog sidebar children use the product/version prefix — v2
1539
+ // roots changelogs at the scope level, not under the tab.
1540
+ child: buildSidebarRootWithVariants(ctx, tabSegs, tabSlug, scopePrefix)
1541
+ };
1542
+ });
1543
+ const first = scopeSegs[0];
1544
+ return {
1545
+ type: "tabbed",
1546
+ id: ctx.nodeId(`tabbed:${first != null ? scopeKey(first.seg) : "root"}`),
1547
+ collapsed: undefined,
1548
+ children
1549
+ };
1550
+ }
1551
+ function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
1552
+ const first = scopeSegs[0];
1553
+ return {
1554
+ type: "unversioned",
1555
+ id: ctx.nodeId(`unversioned:${first?.seg.product?.id ?? "root"}`),
1556
+ collapsed: undefined,
1557
+ landingPage: buildLandingPage(ctx, scopeSegs),
1558
+ // The enclosing scope prefix (product slug, or rootSlug at the top
1559
+ // level) roots structural sections so they share the scope's slug
1560
+ // namespace.
1561
+ child: buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix)
1562
+ };
1563
+ }
1564
+ /**
1565
+ * Merge shared (tab-level) sections from sibling versions into the default
1566
+ * version's segment list. A section is considered "shared" when its section
1567
+ * path does NOT start with any version slug — indicating it was authored at
1568
+ * the tab level and the publish transform assigned it to only one version.
1569
+ */
1570
+ function mergeSharedSections(defaultSegs, allScoped, defaultVersion, versionSlugs) {
1571
+ // Build a map of the default version's tabs by displayName for
1572
+ // cross-version matching. Tab slugs can't be used because the "default"
1573
+ // tab's slug equals the version slug (e.g. "2026-02-09" vs "2025-04-21"
1574
+ // for the same logical "Documentation" tab across versions).
1575
+ const defaultTabsByName = new Map();
1576
+ for (const s of defaultSegs) {
1577
+ if (s.seg.tab != null) {
1578
+ const tabName = s.seg.tab.displayName;
1579
+ if (!defaultTabsByName.has(tabName)) {
1580
+ defaultTabsByName.set(tabName, s.seg.tab);
1581
+ }
1582
+ }
1583
+ }
1584
+ // Collect section paths already present in the default version.
1585
+ const existingSections = new Set(defaultSegs.filter((s) => metaStr(s.seg.metadata, "type") === "section").map((s) => s.seg.section));
1586
+ // Merged sections must sort AFTER all native default segments so they
1587
+ // appear in a trailing sidebarGroup (after non-collapsible sections like
1588
+ // "Getting Started", "Dev Tools", "Capabilities") matching v2 ordering.
1589
+ const maxSortOrder = defaultSegs.reduce((max, s) => Math.max(max, s.seg.sortOrder), 0);
1590
+ let nextSortOrder = maxSortOrder + 1;
1591
+ const merged = [...defaultSegs];
1592
+ for (const s of allScoped) {
1593
+ if (s.seg.version?.id === defaultVersion.id) {
1594
+ continue;
1595
+ }
1596
+ const type = metaStr(s.seg.metadata, "type");
1597
+ if (type !== "section") {
1598
+ continue;
1599
+ }
1600
+ const sectionPath = s.seg.section;
1601
+ // Skip version-specific sections (path starts with a version slug).
1602
+ if (versionSlugs.some((vs) => sectionPath === vs || sectionPath.startsWith(vs + "/"))) {
1603
+ continue;
1604
+ }
1605
+ // Skip if the default version already has this section.
1606
+ if (existingSections.has(sectionPath)) {
1607
+ continue;
1608
+ }
1609
+ // Match the source tab to the default version's corresponding tab
1610
+ // by displayName (tab slugs differ across versions for the default tab).
1611
+ const sourceTabName = s.seg.tab?.displayName ?? "";
1612
+ const targetTab = defaultTabsByName.get(sourceTabName);
1613
+ if (targetTab == null) {
1614
+ continue;
1615
+ }
1616
+ // Re-map the segment's tab and version to the default version's.
1617
+ // Strip childIndex from metadata so merged sections don't sort before
1618
+ // native sections in the annotated interleave step, and assign a
1619
+ // sortOrder after all native segments to place them in the trailing
1620
+ // sidebarGroup.
1621
+ const metadata = s.seg.metadata != null ? { ...s.seg.metadata, childIndex: undefined } : s.seg.metadata;
1622
+ merged.push({
1623
+ seg: {
1624
+ ...s.seg,
1625
+ tab: targetTab,
1626
+ version: defaultVersion,
1627
+ sortOrder: nextSortOrder++,
1628
+ metadata
1629
+ },
1630
+ nav: s.nav
1631
+ });
1632
+ existingSections.add(sectionPath);
1633
+ }
1634
+ return merged;
1635
+ }
1636
+ function buildVersioned(ctx, versions, scoped, rootSlug, productPrefix, skipSharedSectionMerge) {
1637
+ // Collect version slugs for detecting version-prefixed section paths.
1638
+ const versionSlugs = versions.map((v) => detailSlug(v)).filter((s) => s !== "");
1639
+ const children = versions.map((version) => {
1640
+ let versionSegs = scoped.filter((s) => s.seg.version?.id === version.id);
1641
+ // Merge shared tab-level sections from sibling versions into the
1642
+ // default version. The publish transform may assign tab-level content
1643
+ // (sections without a version-prefixed path) to a single version;
1644
+ // v2's monolith root includes them in every version's sidebar.
1645
+ // Skipped for scoped roots: the scoped root only loads nav for a
1646
+ // single route's scope, so merged sections carry the source version's
1647
+ // fullPaths into the default tree, creating duplicate slugs that
1648
+ // orphan the real version's pages in NodeCollector.
1649
+ if (detailIsDefault(version) && !skipSharedSectionMerge) {
1650
+ versionSegs = mergeSharedSections(versionSegs, scoped, version, versionSlugs);
1651
+ }
1652
+ const tabsPresent = uniqueDetails(versionSegs, "tab").length > 0;
1653
+ const prefix = productPrefix != null ? productPrefix : rootSlug;
1654
+ // The version node always carries its FULL versioned slug
1655
+ // (`{basepath}/{product}/{version}`), even when it is the default
1656
+ // version. This matches the canonical V1→V2 converter
1657
+ // (`SlugGenerator.setVersionSlug`, which never elides the version
1658
+ // segment) and is REQUIRED for default-version elision: `NodeCollector`
1659
+ // prunes the default version by passing `node.slug` to
1660
+ // `toDefaultSlug(pageSlug, productSlug, versionSlug)`, which strips the
1661
+ // version segment from each page slug to produce the clean alias
1662
+ // (`docs/astro/cli/v-1-42/overview` → `docs/astro/cli/overview`). If the
1663
+ // default version's slug were collapsed to the product prefix
1664
+ // (`versionSlug === productSlug`), `toDefaultSlug` would be a no-op and
1665
+ // the elided slug would never enter the slugMap — so the clean URL 404s
1666
+ // with `page-not-in-nav` on basepath (`/docs`) sites. (ADR-0014 #6.)
1667
+ //
1668
+ // `scopeSlugPrefix(rootSlug, version)` is NOT used here because it joins
1669
+ // only the rootSlug + version segment (dropping the product prefix);
1670
+ // joining the resolved `prefix` (product prefix, or rootSlug when
1671
+ // version-less) with the version's own slug segment yields the correct
1672
+ // fully-qualified slug.
1673
+ const versionSegment = detailSlug(version);
1674
+ const slug = versionSegment !== "" ? FernNavigation.slugjoin(asSlug(prefix), versionSegment) : asSlug(prefix);
1675
+ const node = {
1676
+ type: "version",
1677
+ ...withMetadataDefaults({
1678
+ id: ctx.nodeId(`version:${slug}`),
1679
+ title: version.displayName,
1680
+ slug: asSlug(slug),
1681
+ icon: version.icon ?? undefined,
1682
+ hidden: version.hidden,
1683
+ viewers: toViewers(version.viewers)
1684
+ }),
1685
+ default: detailIsDefault(version),
1686
+ versionId: FernNavigation.VersionId(version.id),
1687
+ availability: undefined,
1688
+ landingPage: buildLandingPage(ctx, versionSegs),
1689
+ announcement: undefined,
1690
+ pointsTo: metaStr(version.metadata, "pointsTo") != null
1691
+ ? pointsToSlug(metaStr(version.metadata, "pointsTo"))
1692
+ : undefined,
1693
+ // The version's full slug roots structural sections so the whole
1694
+ // version subtree stays inside the default-version prune window.
1695
+ child: buildTabbedOrSidebar(ctx, versionSegs, tabsPresent, asSlug(slug))
1696
+ };
1697
+ if (node.default) {
1698
+ markDefaultVersionCanonicalSlugs(node, productPrefix != null ? asSlug(productPrefix) : rootSlug, node.slug);
1699
+ }
1700
+ return node;
1701
+ });
1702
+ // Cross-version canonical slug deduplication (V2 parity).
1703
+ // V2's migrator deduplicates pages across versions using a title-based
1704
+ // disambiguation key. Without this, non-default version pages that have
1705
+ // a title-equivalent in the default version appear as separate sitemap
1706
+ // entries (e.g. `/2024-12-23/evaluation/overview` alongside the default
1707
+ // `/evaluation/overview`).
1708
+ markCrossVersionCanonicalSlugs(children);
1709
+ return {
1710
+ type: "versioned",
1711
+ id: ctx.nodeId(`versioned:${productPrefix ?? "root"}`),
1712
+ collapsed: undefined,
1713
+ children
1714
+ };
1715
+ }
1716
+ function markDefaultVersionCanonicalSlugs(node, pruneSlug, versionSlug) {
1717
+ FernNavigation.traverseDF(node, (child) => {
1718
+ if (FernNavigation.hasMetadata(child)) {
1719
+ const canonicalSlug = FernNavigation.toDefaultSlug(child.canonicalSlug ?? child.slug, pruneSlug, versionSlug);
1720
+ if (canonicalSlug !== child.slug) {
1721
+ child.canonicalSlug = canonicalSlug;
1722
+ }
1723
+ }
1724
+ if (FernNavigation.hasRedirect(child)) {
1725
+ child.pointsTo = FernNavigation.toDefaultSlug(child.pointsTo, pruneSlug, versionSlug);
1726
+ }
1727
+ return;
1728
+ });
1729
+ }
1730
+ /**
1731
+ * Find parents after the innermost version node (unversioned ancestors).
1732
+ */
1733
+ function unversionedParents(parents) {
1734
+ let versionIdx = -1;
1735
+ for (let i = parents.length - 1; i >= 0; i--) {
1736
+ if (parents[i].type === "version") {
1737
+ versionIdx = i;
1738
+ break;
1739
+ }
1740
+ }
1741
+ return versionIdx >= 0 ? parents.slice(versionIdx + 1) : parents;
1742
+ }
1743
+ /**
1744
+ * Build dedup keys for a page node, mirroring V2's `#getAndSetCanonicalSlug`.
1745
+ * V2 uses multiple keys per node so ANY match deduplicates:
1746
+ * - `pageId` / `overviewPageId` — content-addressable, same across versions
1747
+ * - API-specific key (`api:endpoint:METHOD:ID`) — for API leaf nodes
1748
+ * - title disambiguation key — structural fallback using parent titles
1749
+ */
1750
+ function crossVersionDedupKeys(node, parents) {
1751
+ const keys = [];
1752
+ const uParents = unversionedParents(parents);
1753
+ // 1. Content-ID key (pageId or overviewPageId)
1754
+ const pid = FernNavigation.getPageId(node);
1755
+ if (pid != null) {
1756
+ keys.push(`pid:${pid}`);
1757
+ }
1758
+ // 2. API-specific key for endpoints/websockets/webhooks/grpc/graphql
1759
+ if (node.type === "endpoint" ||
1760
+ node.type === "webSocket" ||
1761
+ node.type === "webhook" ||
1762
+ node.type === "grpc" ||
1763
+ node.type === "graphql") {
1764
+ const apiParentTitles = uParents
1765
+ .filter((p) => p.type === "apiReference")
1766
+ .map((p) => p.title.replaceAll(" ", ""));
1767
+ const apiPrefix = apiParentTitles.join(":");
1768
+ if (node.type === "endpoint") {
1769
+ keys.push(`${apiPrefix}:api:endpoint:${node.method}:${node.endpointId}`);
1770
+ }
1771
+ else if (node.type === "webSocket") {
1772
+ keys.push(`${apiPrefix}:api:websocket:${node.webSocketId}`);
1773
+ }
1774
+ else if (node.type === "webhook") {
1775
+ keys.push(`${apiPrefix}:api:webhook:${node.method}:${node.webhookId}`);
1776
+ }
1777
+ else if (node.type === "grpc") {
1778
+ keys.push(`${apiPrefix}:api:grpc:${node.method}:${node.grpcId}`);
1779
+ }
1780
+ else if (node.type === "graphql") {
1781
+ keys.push(`${apiPrefix}:api:graphql:${node.id}`);
1782
+ }
1783
+ }
1784
+ // 3. Title disambiguation key (structural fallback)
1785
+ const parentTitles = [];
1786
+ for (const p of uParents) {
1787
+ if (FernNavigation.hasMetadata(p)) {
1788
+ parentTitles.push(p.title);
1789
+ }
1790
+ }
1791
+ keys.push([...parentTitles, node.title].join("###"));
1792
+ return keys;
1793
+ }
1794
+ function routeToLandingPage(ctx, route) {
1795
+ if (route == null || route.type !== "markdown" || route.fullPath == null) {
1796
+ return undefined;
1797
+ }
1798
+ const md = route.metadata;
1799
+ const pageId = metaStr(md, "pageId");
1800
+ if (pageId == null) {
1801
+ return undefined;
1802
+ }
1803
+ const slug = ctx.contentSlug(route.fullPath);
1804
+ return {
1805
+ type: "landingPage",
1806
+ ...withMetadataDefaults({
1807
+ id: ctx.nodeId(`landing:${slug}`),
1808
+ title: metaStr(md, "title") ?? "",
1809
+ slug,
1810
+ icon: metaStr(md, "icon"),
1811
+ hidden: route.hidden,
1812
+ authed: metaBool(md, "authed"),
1813
+ viewers: toViewers(metaStrArr(md, "viewers")),
1814
+ orphaned: metaBool(md, "orphaned"),
1815
+ featureFlags: metaFeatureFlags(md)
1816
+ }),
1817
+ pageId: FernNavigation.PageId(pageId),
1818
+ noindex: metaBool(md, "noindex")
1819
+ };
1820
+ }
1821
+ /**
1822
+ * Build a LandingPageNode from the explicit landing-page segment emitted by
1823
+ * the publish transform. This avoids confusing ordinary loose tabRoot pages
1824
+ * with root/product/version landing pages.
1825
+ */
1826
+ function buildLandingPage(ctx, scopeSegs) {
1827
+ const landingSegment = scopeSegs.find((s) => metaStr(s.seg.metadata, "type") === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true);
1828
+ return routeToLandingPage(ctx, landingSegment?.nav.find((route) => route.type === "markdown"));
1829
+ }
1830
+ /**
1831
+ * After default-version canonical slugs are marked, propagate them across
1832
+ * ALL versions using a global first-come-first-served approach (matching V2).
1833
+ * V2's migrator uses a single `#canonicalSlugs` map across the entire tree,
1834
+ * so the first version to register a key wins. This deduplicates pages both
1835
+ * default→non-default AND across non-default versions (e.g. v2025-04-21
1836
+ * and v2024-12-23 sharing the same pageId).
1837
+ */
1838
+ function markCrossVersionCanonicalSlugs(versionNodes) {
1839
+ const keyToCanonical = new Map();
1840
+ // Process versions in order (default first, then non-default in tree order).
1841
+ // The first version to register a key wins — matching V2's DFS traversal
1842
+ // which processes the default version before others.
1843
+ const sorted = [...versionNodes].sort((a, b) => {
1844
+ if (a.default !== b.default) {
1845
+ return a.default ? -1 : 1;
1846
+ }
1847
+ return 0;
1848
+ });
1849
+ for (const version of sorted) {
1850
+ FernNavigation.traverseDF(version, (child, parents) => {
1851
+ if (FernNavigation.hasMetadata(child) && FernNavigation.isPage(child)) {
1852
+ const keys = crossVersionDedupKeys(child, parents);
1853
+ let matched = false;
1854
+ for (const key of keys) {
1855
+ const canonical = keyToCanonical.get(key);
1856
+ if (canonical != null && !version.default) {
1857
+ child.canonicalSlug = canonical;
1858
+ matched = true;
1859
+ break;
1860
+ }
1861
+ }
1862
+ if (!matched) {
1863
+ const canonical = child.canonicalSlug ?? child.slug;
1864
+ for (const key of keys) {
1865
+ if (!keyToCanonical.has(key)) {
1866
+ keyToCanonical.set(key, canonical);
1867
+ }
1868
+ }
1869
+ }
1870
+ }
1871
+ });
1872
+ }
1873
+ }
1874
+ function buildProductGroup(ctx, products, scoped, rootSlug, skipSharedSectionMerge) {
1875
+ const children = products.map((product) => {
1876
+ const productSegs = scoped.filter((s) => s.seg.product?.id === product.id);
1877
+ const versions = uniqueDetails(productSegs, "version");
1878
+ const tabsPresent = uniqueDetails(productSegs, "tab").length > 0;
1879
+ const productPrefix = scopeSlugPrefix(rootSlug, product);
1880
+ // ProductChild is VersionedNode | UnversionedNode — a version-less
1881
+ // product wraps its sidebar/tabs in an UnversionedNode.
1882
+ const productChild = versions.length > 0
1883
+ ? buildVersioned(ctx, versions, productSegs, rootSlug, productPrefix, skipSharedSectionMerge)
1884
+ : buildUnversioned(ctx, productSegs, asSlug(productPrefix), tabsPresent);
1885
+ const node = {
1886
+ type: "product",
1887
+ ...withMetadataDefaults({
1888
+ id: ctx.nodeId(`product:${productPrefix}`),
1889
+ title: product.displayName,
1890
+ slug: asSlug(detailIsDefault(product) ? rootSlug : productPrefix),
1891
+ icon: product.icon ?? undefined,
1892
+ hidden: product.hidden,
1893
+ viewers: toViewers(product.viewers)
1894
+ }),
1895
+ default: detailIsDefault(product),
1896
+ // `product.id` is the content-addressed STORAGE hash (the segment
1897
+ // key). `productId` is the SEMANTIC identifier search/UI key off
1898
+ // (the product-scoped search filter does `product.title:${productId}`,
1899
+ // so it must equal the product title). v2 carries the display name
1900
+ // here; sourcing it from the hash makes that filter match nothing.
1901
+ productId: FernNavigation.ProductId(product.displayName),
1902
+ subtitle: metaStr(product.metadata, "subtitle") ?? "",
1903
+ image: metaStr(product.metadata, "image") != null
1904
+ ? FernNavigation.FileId(metaStr(product.metadata, "image"))
1905
+ : undefined,
1906
+ announcement: undefined,
1907
+ pointsTo: metaStr(product.metadata, "pointsTo") != null
1908
+ ? pointsToSlug(metaStr(product.metadata, "pointsTo"))
1909
+ : undefined,
1910
+ child: productChild
1911
+ };
1912
+ return node;
1913
+ });
1914
+ return {
1915
+ type: "productgroup",
1916
+ id: ctx.nodeId("productgroup"),
1917
+ collapsed: undefined,
1918
+ landingPage: buildLandingPage(ctx, scoped.filter((s) => s.seg.product == null)),
1919
+ children
1920
+ };
1921
+ }
1922
+ // (root keeps the bare "root" id; it is the single tree root.)
1923
+ //# sourceMappingURL=ledger-root-builder.js.map