@fern-api/fdr-sdk 1.2.42-e01a8637c3 → 1.2.43-60e226c2d6
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.
- package/dist/js/client/FdrClient.js +12 -0
- package/dist/js/client/FdrClient.js.map +1 -1
- package/dist/js/client/FdrClient.mjs +12 -0
- package/dist/js/client/FdrClient.mjs.map +1 -1
- package/dist/js/index.js +12 -0
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +12 -0
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +54 -13
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +54 -13
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/js/orpc-client.js +59 -0
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +58 -0
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.js +230 -0
- package/dist/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.js.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js +167 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js +255 -1
- package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/navigation/ledger-root-builder.js +95 -17
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts +2 -0
- package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts.map +1 -0
- package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js +153 -0
- package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js.map +1 -0
- package/dist/orpc-client/docs-ledger/config-files.d.ts +8 -0
- package/dist/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
- package/dist/orpc-client/docs-ledger/config-files.js +69 -0
- package/dist/orpc-client/docs-ledger/config-files.js.map +1 -1
- package/dist/orpc-client/docs-ledger/contract.d.ts +424 -28
- package/dist/orpc-client/docs-ledger/contract.d.ts.map +1 -1
- package/dist/orpc-client/docs-ledger/contract.js +14 -0
- package/dist/orpc-client/docs-ledger/contract.js.map +1 -1
- package/dist/orpc-client/docs-ledger/ledger-manifest.d.ts +92 -0
- package/dist/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.crossTabPrevNext.test.d.ts.map +1 -0
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts +2 -0
- package/dist/types/orpc-client/docs-ledger/__test__/config-files.navFiles.test.d.ts.map +1 -0
- package/dist/types/orpc-client/docs-ledger/config-files.d.ts +8 -0
- package/dist/types/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/contract.d.ts +424 -28
- package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts +92 -0
- package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -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
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
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
|
|
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
|
|
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
|
|
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);
|