@fern-api/fdr-sdk 1.2.42-e01a8637c3 → 1.2.43-345d4ef0ea

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 (54) hide show
  1. package/dist/js/client/FdrClient.js +12 -0
  2. package/dist/js/client/FdrClient.js.map +1 -1
  3. package/dist/js/client/FdrClient.mjs +12 -0
  4. package/dist/js/client/FdrClient.mjs.map +1 -1
  5. package/dist/js/index.js +12 -0
  6. package/dist/js/index.js.map +1 -1
  7. package/dist/js/index.mjs +12 -0
  8. package/dist/js/index.mjs.map +1 -1
  9. package/dist/js/navigation/ledger-root-builder.js +54 -13
  10. package/dist/js/navigation/ledger-root-builder.js.map +1 -1
  11. package/dist/js/navigation/ledger-root-builder.mjs +54 -13
  12. package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
  13. package/dist/js/orpc-client.js +59 -0
  14. package/dist/js/orpc-client.js.map +1 -1
  15. package/dist/js/orpc-client.mjs +58 -0
  16. package/dist/js/orpc-client.mjs.map +1 -1
  17. package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts +2 -0
  18. package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts.map +1 -0
  19. package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.js +230 -0
  20. package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.js.map +1 -0
  21. package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js +167 -0
  22. package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js.map +1 -1
  23. package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js +255 -1
  24. package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js.map +1 -1
  25. package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
  26. package/dist/navigation/ledger-root-builder.js +95 -17
  27. package/dist/navigation/ledger-root-builder.js.map +1 -1
  28. package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts +2 -0
  29. package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts.map +1 -0
  30. package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js +153 -0
  31. package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js.map +1 -0
  32. package/dist/orpc-client/docs-ledger/config-files.d.ts +8 -0
  33. package/dist/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
  34. package/dist/orpc-client/docs-ledger/config-files.js +69 -0
  35. package/dist/orpc-client/docs-ledger/config-files.js.map +1 -1
  36. package/dist/orpc-client/docs-ledger/contract.d.ts +424 -28
  37. package/dist/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  38. package/dist/orpc-client/docs-ledger/contract.js +14 -0
  39. package/dist/orpc-client/docs-ledger/contract.js.map +1 -1
  40. package/dist/orpc-client/docs-ledger/ledger-manifest.d.ts +92 -0
  41. package/dist/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/dist/types/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts +2 -0
  44. package/dist/types/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts.map +1 -0
  45. package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
  46. package/dist/types/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts +2 -0
  47. package/dist/types/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts.map +1 -0
  48. package/dist/types/orpc-client/docs-ledger/config-files.d.ts +8 -0
  49. package/dist/types/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
  50. package/dist/types/orpc-client/docs-ledger/contract.d.ts +424 -28
  51. package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  52. package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts +92 -0
  53. package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -1
  54. package/package.json +1 -1
@@ -1726,6 +1726,13 @@ function nearestExistingAncestor(sectionPath, existing) {
1726
1726
  }
1727
1727
  function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScopePrefix) {
1728
1728
  const sectionPaths = new Set(scopeSegs.map((s) => s.seg.section));
1729
+ const parentCandidates = scopeSegs.filter((s) => s.seg.section === parentPath);
1730
+ const parentSeg = parentCandidates.length > 1 ? parentCandidates.reduce((best, cur) => {
1731
+ const bd = metaNum(best.seg.metadata, "sidebarDepth") ?? Number.MAX_SAFE_INTEGER;
1732
+ const cd = metaNum(cur.seg.metadata, "sidebarDepth") ?? Number.MAX_SAFE_INTEGER;
1733
+ return cd < bd ? cur : best;
1734
+ }) : parentCandidates[0];
1735
+ const parentDepth = parentSeg != null ? metaNum(parentSeg.seg.metadata, "sidebarDepth") : void 0;
1729
1736
  const direct = scopeSegs.filter((s) => {
1730
1737
  const sec = s.seg.section;
1731
1738
  const type = metaStr(s.seg.metadata, "type");
@@ -1739,6 +1746,12 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
1739
1746
  if (depth === 0) {
1740
1747
  return false;
1741
1748
  }
1749
+ if (sec === parentPath && s !== parentSeg && depth != null && parentDepth != null && depth > parentDepth) {
1750
+ return true;
1751
+ }
1752
+ if (parentDepth != null && depth != null && depth <= parentDepth) {
1753
+ return false;
1754
+ }
1742
1755
  const parent = parentSectionPath(sec);
1743
1756
  if (parent === parentPath) {
1744
1757
  return true;
@@ -1758,16 +1771,21 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
1758
1771
  } else if (type === "changelog") {
1759
1772
  node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
1760
1773
  } else {
1761
- const boundary = siblingBoundaries.get(s);
1762
- const childScopeSegs = boundary != null ? scopeSegs.filter(
1763
- (candidate) => candidate.seg.sortOrder >= boundary.lo && candidate.seg.sortOrder < boundary.hi
1764
- ) : scopeSegs;
1765
- node = sectionNode(
1766
- ctx,
1767
- s,
1768
- buildSectionTree(ctx, childScopeSegs, s.seg.section, scopePrefix, changelogScopePrefix),
1769
- scopePrefix
1770
- );
1774
+ const isSkipSlugChild = s.seg.section === parentPath;
1775
+ if (isSkipSlugChild) {
1776
+ node = sectionNode(ctx, s, [], scopePrefix);
1777
+ } else {
1778
+ const boundary = siblingBoundaries.get(s);
1779
+ const childScopeSegs = boundary != null ? scopeSegs.filter(
1780
+ (candidate) => candidate.seg.sortOrder >= boundary.lo && candidate.seg.sortOrder < boundary.hi
1781
+ ) : scopeSegs;
1782
+ node = sectionNode(
1783
+ ctx,
1784
+ s,
1785
+ buildSectionTree(ctx, childScopeSegs, s.seg.section, scopePrefix, changelogScopePrefix),
1786
+ scopePrefix
1787
+ );
1788
+ }
1771
1789
  }
1772
1790
  return { node, childIndex };
1773
1791
  });
@@ -1793,8 +1811,18 @@ function computeSiblingSortBoundaries(ordered) {
1793
1811
  rootSections.push(s);
1794
1812
  }
1795
1813
  }
1796
- const byPath = /* @__PURE__ */ new Map();
1814
+ const depth0Paths = /* @__PURE__ */ new Set();
1797
1815
  for (const s of rootSections) {
1816
+ if (metaNum(s.seg.metadata, "sidebarDepth") === 0) {
1817
+ depth0Paths.add(s.seg.section);
1818
+ }
1819
+ }
1820
+ const effectiveRootSections = rootSections.filter((s) => {
1821
+ const d = metaNum(s.seg.metadata, "sidebarDepth");
1822
+ return d === 0 || d == null || !depth0Paths.has(s.seg.section);
1823
+ });
1824
+ const byPath = /* @__PURE__ */ new Map();
1825
+ for (const s of effectiveRootSections) {
1798
1826
  const group = byPath.get(s.seg.section) ?? [];
1799
1827
  group.push(s);
1800
1828
  byPath.set(s.seg.section, group);
@@ -1819,6 +1847,12 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1819
1847
  const hasRootSection = ordered.some(
1820
1848
  (s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && (metaNum(s.seg.metadata, "childIndex") == null || siblingBoundaries.has(s))
1821
1849
  );
1850
+ const depth0SectionPaths = /* @__PURE__ */ new Set();
1851
+ for (const s of ordered) {
1852
+ if (metaStr(s.seg.metadata, "type") === "section" && metaNum(s.seg.metadata, "sidebarDepth") === 0) {
1853
+ depth0SectionPaths.add(s.seg.section);
1854
+ }
1855
+ }
1822
1856
  for (const s of ordered) {
1823
1857
  const type = metaStr(s.seg.metadata, "type");
1824
1858
  const sec = s.seg.section;
@@ -1856,7 +1890,10 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1856
1890
  const depth = metaNum(s.seg.metadata, "sidebarDepth");
1857
1891
  const parent = parentSectionPath(sec);
1858
1892
  const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
1859
- if (isRootLevel && hasRootSection && sec !== "" && depth == null) {
1893
+ if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
1894
+ continue;
1895
+ }
1896
+ if (isRootLevel && depth != null && depth > 0 && depth0SectionPaths.has(sec)) {
1860
1897
  continue;
1861
1898
  }
1862
1899
  if (isRootLevel) {
@@ -1869,7 +1906,11 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1869
1906
  const bounds = siblingBoundaries.get(s);
1870
1907
  const ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
1871
1908
  const isUnboundedSkipSlugSibling = sec === "" && metaNum(s.seg.metadata, "childIndex") != null && bounds == null;
1872
- const sectionChildren = isUnboundedSkipSlugSibling ? [] : buildSectionTree(ctx, ownedSegs, sec, scopePrefix, changelogScopePrefix);
1909
+ const hasDepthMarkedChildren = isUnboundedSkipSlugSibling && ownedSegs.some((candidate) => {
1910
+ const d = metaNum(candidate.seg.metadata, "sidebarDepth");
1911
+ return d != null && d > 0 && parentSectionPath(candidate.seg.section) === sec;
1912
+ });
1913
+ const sectionChildren = isUnboundedSkipSlugSibling && !hasDepthMarkedChildren ? [] : buildSectionTree(ctx, ownedSegs, sec, scopePrefix, changelogScopePrefix);
1873
1914
  node = sectionNode(ctx, s, sectionChildren, scopePrefix);
1874
1915
  }
1875
1916
  const isSharedSection = siblingBoundaries.size > 0 && scopePrefix !== "" && sec !== "" && !sec.startsWith(scopePrefix);