@fern-api/fdr-sdk 1.2.43-345d4ef0ea → 1.2.44-08a3a65358
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/api-definition/migrators/v1ToV2.d.ts.map +1 -1
- package/dist/api-definition/migrators/v1ToV2.js +1 -0
- package/dist/api-definition/migrators/v1ToV2.js.map +1 -1
- package/dist/converters/db/convertAPIDefinitionToDb.d.ts.map +1 -1
- package/dist/converters/db/convertAPIDefinitionToDb.js +1 -0
- package/dist/converters/db/convertAPIDefinitionToDb.js.map +1 -1
- package/dist/converters/read/convertDbAPIDefinitionToRead.d.ts +1 -0
- package/dist/converters/read/convertDbAPIDefinitionToRead.d.ts.map +1 -1
- package/dist/converters/read/convertDbAPIDefinitionToRead.js +1 -0
- package/dist/converters/read/convertDbAPIDefinitionToRead.js.map +1 -1
- package/dist/js/api-definition/index.js +3 -0
- package/dist/js/api-definition/index.js.map +1 -1
- package/dist/js/api-definition/index.mjs +3 -0
- package/dist/js/api-definition/index.mjs.map +1 -1
- package/dist/js/client/FdrClient.js +3 -0
- package/dist/js/client/FdrClient.js.map +1 -1
- package/dist/js/client/FdrClient.mjs +3 -0
- package/dist/js/client/FdrClient.mjs.map +1 -1
- package/dist/js/client/types.js +4 -0
- package/dist/js/client/types.js.map +1 -1
- package/dist/js/client/types.mjs +4 -0
- package/dist/js/client/types.mjs.map +1 -1
- package/dist/js/converters/index.js +16 -2
- package/dist/js/converters/index.js.map +1 -1
- package/dist/js/converters/index.mjs +16 -2
- package/dist/js/converters/index.mjs.map +1 -1
- package/dist/js/index.js +16 -2
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +16 -2
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/index.js +14 -2
- package/dist/js/navigation/index.js.map +1 -1
- package/dist/js/navigation/index.mjs +14 -2
- package/dist/js/navigation/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +33 -4
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +33 -4
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/js/orpc-client.js +4 -0
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +4 -0
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.js +308 -0
- package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.js.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.pointsTo.test.js +122 -10
- package/dist/navigation/__test__/ledger-root-builder.pointsTo.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js +5 -5
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js +194 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js +403 -0
- 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 +58 -7
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/navigation/utils/toApis.d.ts +1 -0
- package/dist/navigation/utils/toApis.d.ts.map +1 -1
- package/dist/navigation/utils/updatePointsTo.d.ts.map +1 -1
- package/dist/navigation/utils/updatePointsTo.js +12 -4
- package/dist/navigation/utils/updatePointsTo.js.map +1 -1
- package/dist/orpc-client/api/contract-db.d.ts +3 -0
- package/dist/orpc-client/api/contract-db.d.ts.map +1 -1
- package/dist/orpc-client/api/contract-db.js +1 -0
- package/dist/orpc-client/api/contract-db.js.map +1 -1
- package/dist/orpc-client/api/contract-latest.d.ts +6 -0
- package/dist/orpc-client/api/contract-latest.d.ts.map +1 -1
- package/dist/orpc-client/api/contract-latest.js +1 -0
- package/dist/orpc-client/api/contract-latest.js.map +1 -1
- package/dist/orpc-client/api/contract-read.d.ts +3 -0
- package/dist/orpc-client/api/contract-read.d.ts.map +1 -1
- package/dist/orpc-client/api/contract-read.js +1 -0
- package/dist/orpc-client/api/contract-read.js.map +1 -1
- package/dist/orpc-client/api/contract-register.d.ts +3 -0
- package/dist/orpc-client/api/contract-register.d.ts.map +1 -1
- package/dist/orpc-client/api/contract-register.js +1 -0
- package/dist/orpc-client/api/contract-register.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api-definition/migrators/v1ToV2.d.ts.map +1 -1
- package/dist/types/converters/db/convertAPIDefinitionToDb.d.ts.map +1 -1
- package/dist/types/converters/read/convertDbAPIDefinitionToRead.d.ts +1 -0
- package/dist/types/converters/read/convertDbAPIDefinitionToRead.d.ts.map +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.d.ts.map +1 -0
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/types/navigation/utils/toApis.d.ts +1 -0
- package/dist/types/navigation/utils/toApis.d.ts.map +1 -1
- package/dist/types/navigation/utils/updatePointsTo.d.ts.map +1 -1
- package/dist/types/orpc-client/api/contract-db.d.ts +3 -0
- package/dist/types/orpc-client/api/contract-db.d.ts.map +1 -1
- package/dist/types/orpc-client/api/contract-latest.d.ts +6 -0
- package/dist/types/orpc-client/api/contract-latest.d.ts.map +1 -1
- package/dist/types/orpc-client/api/contract-read.d.ts +3 -0
- package/dist/types/orpc-client/api/contract-read.d.ts.map +1 -1
- package/dist/types/orpc-client/api/contract-register.d.ts +3 -0
- package/dist/types/orpc-client/api/contract-register.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1310,7 +1310,14 @@ function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
|
|
|
1310
1310
|
const relSection = stripLeadingScopePrefix(seg.section, scopePrefix);
|
|
1311
1311
|
let slug = structuralNodeSlug(ctx, overview?.fullPath, relSection, scopePrefix);
|
|
1312
1312
|
if (relSection === "" && overview?.fullPath == null) {
|
|
1313
|
-
|
|
1313
|
+
const inferred = inferSectionSlugFromNav(ctx, nav, scopePrefix);
|
|
1314
|
+
if (inferred != null) {
|
|
1315
|
+
const inferredStr = String(inferred);
|
|
1316
|
+
const collides = nav.some((r) => r.fullPath != null && String(ctx.contentSlug(r.fullPath)) === inferredStr);
|
|
1317
|
+
if (!collides) {
|
|
1318
|
+
slug = inferred;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1314
1321
|
}
|
|
1315
1322
|
const metaPointsTo = metaStr(seg.metadata, "pointsTo");
|
|
1316
1323
|
const defaults = withMetadataDefaults({
|
|
@@ -1718,6 +1725,13 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1718
1725
|
if (!sectionPaths.has(parent)) {
|
|
1719
1726
|
return nearestExistingAncestor(sec, sectionPaths) === parentPath;
|
|
1720
1727
|
}
|
|
1728
|
+
if (depth != null) {
|
|
1729
|
+
const pSeg = scopeSegs.find((c) => c.seg.section === parent);
|
|
1730
|
+
const pDepth = pSeg != null ? metaNum(pSeg.seg.metadata, "sidebarDepth") : void 0;
|
|
1731
|
+
if (pDepth != null && depth <= pDepth) {
|
|
1732
|
+
return nearestExistingAncestor(parent, sectionPaths) === parentPath;
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1721
1735
|
return false;
|
|
1722
1736
|
}).sort((a, b) => a.seg.sortOrder - b.seg.sortOrder);
|
|
1723
1737
|
const siblingBoundaries = computeDuplicateSiblingSortBoundaries(direct);
|
|
@@ -1806,6 +1820,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1806
1820
|
const hasRootSection = ordered.some(
|
|
1807
1821
|
(s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && (metaNum(s.seg.metadata, "childIndex") == null || siblingBoundaries.has(s))
|
|
1808
1822
|
);
|
|
1823
|
+
const hasTrueRootWrapper = ordered.some(
|
|
1824
|
+
(s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && metaNum(s.seg.metadata, "childIndex") == null
|
|
1825
|
+
);
|
|
1809
1826
|
const depth0SectionPaths = /* @__PURE__ */ new Set();
|
|
1810
1827
|
for (const s of ordered) {
|
|
1811
1828
|
if (metaStr(s.seg.metadata, "type") === "section" && metaNum(s.seg.metadata, "sidebarDepth") === 0) {
|
|
@@ -1840,7 +1857,15 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1840
1857
|
}
|
|
1841
1858
|
if (type === "section" && sec === "" && hasRootSection) {
|
|
1842
1859
|
const bounds = siblingBoundaries.get(s);
|
|
1843
|
-
|
|
1860
|
+
let ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
|
|
1861
|
+
if (!hasTrueRootWrapper) {
|
|
1862
|
+
ownedSegs = ownedSegs.filter((o) => {
|
|
1863
|
+
if (o.seg.section === "") {
|
|
1864
|
+
return true;
|
|
1865
|
+
}
|
|
1866
|
+
return metaNum(o.seg.metadata, "sidebarDepth") != null;
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1844
1869
|
const sectionChildren = buildSectionTree(ctx, ownedSegs, "", scopePrefix, changelogScopePrefix);
|
|
1845
1870
|
const node = sectionNode(ctx, s, sectionChildren, scopePrefix);
|
|
1846
1871
|
annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
|
|
@@ -1849,7 +1874,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1849
1874
|
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1850
1875
|
const parent = parentSectionPath(sec);
|
|
1851
1876
|
const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1852
|
-
if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
|
|
1877
|
+
if (isRootLevel && hasRootSection && sec !== "" && (depth != null ? depth !== 0 : hasTrueRootWrapper)) {
|
|
1853
1878
|
continue;
|
|
1854
1879
|
}
|
|
1855
1880
|
if (isRootLevel && depth != null && depth > 0 && depth0SectionPaths.has(sec)) {
|
|
@@ -1883,7 +1908,11 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1883
1908
|
const hasLeafPos = annotated.some((a) => a.isLeaf && a.pos != null);
|
|
1884
1909
|
const hasSegmentPos = annotated.some((a) => !a.isLeaf && a.pos != null);
|
|
1885
1910
|
const flat = hasLeafPos && hasSegmentPos ? annotated.map((a, seq) => ({ ...a, seq })).sort(
|
|
1886
|
-
(x, y) => (x.pos ?? Number.MAX_SAFE_INTEGER) - (y.pos ?? Number.MAX_SAFE_INTEGER) ||
|
|
1911
|
+
(x, y) => (x.pos ?? Number.MAX_SAFE_INTEGER) - (y.pos ?? Number.MAX_SAFE_INTEGER) || // When positions tie, prefer structural nodes (sections) over
|
|
1912
|
+
// leaves (pages). This handles stale tabRoot nav entries whose
|
|
1913
|
+
// displaySortOrder wasn't updated due to content-addressing
|
|
1914
|
+
// (the segment hash doesn't include childPosition).
|
|
1915
|
+
(x.isLeaf === y.isLeaf ? 0 : x.isLeaf ? 1 : -1) || x.seq - y.seq
|
|
1887
1916
|
).map((a) => a.node) : annotated.map((a) => a.node);
|
|
1888
1917
|
return groupSidebarRootChildren(ctx, flat);
|
|
1889
1918
|
}
|