@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
@@ -1685,6 +1685,13 @@ function nearestExistingAncestor(sectionPath, existing) {
1685
1685
  }
1686
1686
  function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScopePrefix) {
1687
1687
  const sectionPaths = new Set(scopeSegs.map((s) => s.seg.section));
1688
+ const parentCandidates = scopeSegs.filter((s) => s.seg.section === parentPath);
1689
+ const parentSeg = parentCandidates.length > 1 ? parentCandidates.reduce((best, cur) => {
1690
+ const bd = metaNum(best.seg.metadata, "sidebarDepth") ?? Number.MAX_SAFE_INTEGER;
1691
+ const cd = metaNum(cur.seg.metadata, "sidebarDepth") ?? Number.MAX_SAFE_INTEGER;
1692
+ return cd < bd ? cur : best;
1693
+ }) : parentCandidates[0];
1694
+ const parentDepth = parentSeg != null ? metaNum(parentSeg.seg.metadata, "sidebarDepth") : void 0;
1688
1695
  const direct = scopeSegs.filter((s) => {
1689
1696
  const sec = s.seg.section;
1690
1697
  const type = metaStr(s.seg.metadata, "type");
@@ -1698,6 +1705,12 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
1698
1705
  if (depth === 0) {
1699
1706
  return false;
1700
1707
  }
1708
+ if (sec === parentPath && s !== parentSeg && depth != null && parentDepth != null && depth > parentDepth) {
1709
+ return true;
1710
+ }
1711
+ if (parentDepth != null && depth != null && depth <= parentDepth) {
1712
+ return false;
1713
+ }
1701
1714
  const parent = parentSectionPath(sec);
1702
1715
  if (parent === parentPath) {
1703
1716
  return true;
@@ -1717,16 +1730,21 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
1717
1730
  } else if (type === "changelog") {
1718
1731
  node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
1719
1732
  } else {
1720
- const boundary = siblingBoundaries.get(s);
1721
- const childScopeSegs = boundary != null ? scopeSegs.filter(
1722
- (candidate) => candidate.seg.sortOrder >= boundary.lo && candidate.seg.sortOrder < boundary.hi
1723
- ) : scopeSegs;
1724
- node = sectionNode(
1725
- ctx,
1726
- s,
1727
- buildSectionTree(ctx, childScopeSegs, s.seg.section, scopePrefix, changelogScopePrefix),
1728
- scopePrefix
1729
- );
1733
+ const isSkipSlugChild = s.seg.section === parentPath;
1734
+ if (isSkipSlugChild) {
1735
+ node = sectionNode(ctx, s, [], scopePrefix);
1736
+ } else {
1737
+ const boundary = siblingBoundaries.get(s);
1738
+ const childScopeSegs = boundary != null ? scopeSegs.filter(
1739
+ (candidate) => candidate.seg.sortOrder >= boundary.lo && candidate.seg.sortOrder < boundary.hi
1740
+ ) : scopeSegs;
1741
+ node = sectionNode(
1742
+ ctx,
1743
+ s,
1744
+ buildSectionTree(ctx, childScopeSegs, s.seg.section, scopePrefix, changelogScopePrefix),
1745
+ scopePrefix
1746
+ );
1747
+ }
1730
1748
  }
1731
1749
  return { node, childIndex };
1732
1750
  });
@@ -1752,8 +1770,18 @@ function computeSiblingSortBoundaries(ordered) {
1752
1770
  rootSections.push(s);
1753
1771
  }
1754
1772
  }
1755
- const byPath = /* @__PURE__ */ new Map();
1773
+ const depth0Paths = /* @__PURE__ */ new Set();
1756
1774
  for (const s of rootSections) {
1775
+ if (metaNum(s.seg.metadata, "sidebarDepth") === 0) {
1776
+ depth0Paths.add(s.seg.section);
1777
+ }
1778
+ }
1779
+ const effectiveRootSections = rootSections.filter((s) => {
1780
+ const d = metaNum(s.seg.metadata, "sidebarDepth");
1781
+ return d === 0 || d == null || !depth0Paths.has(s.seg.section);
1782
+ });
1783
+ const byPath = /* @__PURE__ */ new Map();
1784
+ for (const s of effectiveRootSections) {
1757
1785
  const group = byPath.get(s.seg.section) ?? [];
1758
1786
  group.push(s);
1759
1787
  byPath.set(s.seg.section, group);
@@ -1778,6 +1806,12 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1778
1806
  const hasRootSection = ordered.some(
1779
1807
  (s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && (metaNum(s.seg.metadata, "childIndex") == null || siblingBoundaries.has(s))
1780
1808
  );
1809
+ const depth0SectionPaths = /* @__PURE__ */ new Set();
1810
+ for (const s of ordered) {
1811
+ if (metaStr(s.seg.metadata, "type") === "section" && metaNum(s.seg.metadata, "sidebarDepth") === 0) {
1812
+ depth0SectionPaths.add(s.seg.section);
1813
+ }
1814
+ }
1781
1815
  for (const s of ordered) {
1782
1816
  const type = metaStr(s.seg.metadata, "type");
1783
1817
  const sec = s.seg.section;
@@ -1815,7 +1849,10 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1815
1849
  const depth = metaNum(s.seg.metadata, "sidebarDepth");
1816
1850
  const parent = parentSectionPath(sec);
1817
1851
  const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
1818
- if (isRootLevel && hasRootSection && sec !== "" && depth == null) {
1852
+ if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
1853
+ continue;
1854
+ }
1855
+ if (isRootLevel && depth != null && depth > 0 && depth0SectionPaths.has(sec)) {
1819
1856
  continue;
1820
1857
  }
1821
1858
  if (isRootLevel) {
@@ -1828,7 +1865,11 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1828
1865
  const bounds = siblingBoundaries.get(s);
1829
1866
  const ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
1830
1867
  const isUnboundedSkipSlugSibling = sec === "" && metaNum(s.seg.metadata, "childIndex") != null && bounds == null;
1831
- const sectionChildren = isUnboundedSkipSlugSibling ? [] : buildSectionTree(ctx, ownedSegs, sec, scopePrefix, changelogScopePrefix);
1868
+ const hasDepthMarkedChildren = isUnboundedSkipSlugSibling && ownedSegs.some((candidate) => {
1869
+ const d = metaNum(candidate.seg.metadata, "sidebarDepth");
1870
+ return d != null && d > 0 && parentSectionPath(candidate.seg.section) === sec;
1871
+ });
1872
+ const sectionChildren = isUnboundedSkipSlugSibling && !hasDepthMarkedChildren ? [] : buildSectionTree(ctx, ownedSegs, sec, scopePrefix, changelogScopePrefix);
1832
1873
  node = sectionNode(ctx, s, sectionChildren, scopePrefix);
1833
1874
  }
1834
1875
  const isSharedSection = siblingBoundaries.size > 0 && scopePrefix !== "" && sec !== "" && !sec.startsWith(scopePrefix);