@fern-api/fdr-sdk 1.2.42-304ea6b285 → 1.2.42-54880bfeac
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 +1 -0
- package/dist/js/client/FdrClient.js.map +1 -1
- package/dist/js/client/FdrClient.mjs +1 -0
- package/dist/js/client/FdrClient.mjs.map +1 -1
- package/dist/js/index.js +1 -0
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +1 -0
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +58 -4
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +58 -4
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/js/orpc-client.js +1 -0
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +1 -0
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.crossProductDedup.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.crossProductDedup.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.crossProductDedup.test.js +267 -0
- package/dist/navigation/__test__/ledger-root-builder.crossProductDedup.test.js.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js +273 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugGroupOrdering.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugGroupOrdering.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugGroupOrdering.test.js +234 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugGroupOrdering.test.js.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js +105 -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 +108 -12
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/orpc-client/docs-ledger/contract.d.ts +9 -0
- package/dist/orpc-client/docs-ledger/contract.d.ts.map +1 -1
- package/dist/orpc-client/docs-ledger/contract.js +1 -0
- package/dist/orpc-client/docs-ledger/contract.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.crossProductDedup.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.crossProductDedup.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.sidebarDepth.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.sidebarDepth.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.skipSlugGroupOrdering.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.skipSlugGroupOrdering.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/contract.d.ts +9 -0
- package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1400,7 +1400,17 @@ function directChildApiPackages(parentSection, scopeSegs, apiDefinitionId) {
|
|
|
1400
1400
|
function buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix) {
|
|
1401
1401
|
const { seg, nav } = scoped;
|
|
1402
1402
|
const leafNodes = positionedApiLeafChildren(ctx, nav, apiDefinitionId);
|
|
1403
|
-
|
|
1403
|
+
let childPackages = directChildApiPackages(seg.section, scopeSegs, apiDefinitionId);
|
|
1404
|
+
const samePathApiSiblings = scopeSegs.filter(
|
|
1405
|
+
(s) => s.seg.section === seg.section && s.seg.sortOrder !== seg.sortOrder && API_NODE_SEGMENT_TYPES.has(metaStr(s.seg.metadata, "type") ?? "")
|
|
1406
|
+
);
|
|
1407
|
+
const hasCollapsedGroups = samePathApiSiblings.length > 0;
|
|
1408
|
+
if (hasCollapsedGroups && metaStr(seg.metadata, "type") !== "apiReference") {
|
|
1409
|
+
const nextSibling = samePathApiSiblings.filter((s) => s.seg.sortOrder > seg.sortOrder).sort((a, b) => a.seg.sortOrder - b.seg.sortOrder)[0];
|
|
1410
|
+
const lo = seg.sortOrder;
|
|
1411
|
+
const hi = nextSibling?.seg.sortOrder ?? Number.MAX_SAFE_INTEGER;
|
|
1412
|
+
childPackages = childPackages.filter((c) => c.seg.sortOrder > lo && c.seg.sortOrder < hi);
|
|
1413
|
+
}
|
|
1404
1414
|
const packageNodes = childPackages.map((child) => ({
|
|
1405
1415
|
node: apiPackageChildNode(
|
|
1406
1416
|
ctx,
|
|
@@ -1411,6 +1421,9 @@ function buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix)
|
|
|
1411
1421
|
),
|
|
1412
1422
|
childIndex: metaNum(child.seg.metadata, "childIndex")
|
|
1413
1423
|
}));
|
|
1424
|
+
if (hasCollapsedGroups && metaStr(seg.metadata, "type") === "apiReference") {
|
|
1425
|
+
return [...leafNodes, ...packageNodes.map((p, i) => ({ node: p.node, pos: leafNodes.length + i }))].sort((a, b) => a.pos - b.pos).map((p) => p.node);
|
|
1426
|
+
}
|
|
1414
1427
|
const hasChildIndex = packageNodes.some((p) => p.childIndex != null);
|
|
1415
1428
|
if (!hasChildIndex) {
|
|
1416
1429
|
return [...leafNodes, ...packageNodes.map((p) => ({ node: p.node, pos: Number.MAX_SAFE_INTEGER }))].sort((a, b) => a.pos - b.pos).map((p) => p.node);
|
|
@@ -1722,6 +1735,10 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1722
1735
|
if (hasOwningApiReference(s, scopeSegs) || isNestedApiPackage(s, scopeSegs)) {
|
|
1723
1736
|
return false;
|
|
1724
1737
|
}
|
|
1738
|
+
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1739
|
+
if (depth === 0) {
|
|
1740
|
+
return false;
|
|
1741
|
+
}
|
|
1725
1742
|
const parent = parentSectionPath(sec);
|
|
1726
1743
|
if (parent === parentPath) {
|
|
1727
1744
|
return true;
|
|
@@ -1769,8 +1786,9 @@ function computeSiblingSortBoundaries(ordered) {
|
|
|
1769
1786
|
rootSections.push(s);
|
|
1770
1787
|
continue;
|
|
1771
1788
|
}
|
|
1789
|
+
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1772
1790
|
const parent = parentSectionPath(sec);
|
|
1773
|
-
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1791
|
+
const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1774
1792
|
if (isRootLevel) {
|
|
1775
1793
|
rootSections.push(s);
|
|
1776
1794
|
}
|
|
@@ -1807,6 +1825,14 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1807
1825
|
if (hasOwningApiReference(s, scopeSegs) || isNestedApiPackage(s, scopeSegs)) {
|
|
1808
1826
|
continue;
|
|
1809
1827
|
}
|
|
1828
|
+
if (type === "apiPackage") {
|
|
1829
|
+
const hasApiRefSibling = ordered.some(
|
|
1830
|
+
(sib) => sib.seg.section === sec && metaStr(sib.seg.metadata, "type") === "apiReference"
|
|
1831
|
+
);
|
|
1832
|
+
if (hasApiRefSibling) {
|
|
1833
|
+
continue;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1810
1836
|
if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
|
|
1811
1837
|
continue;
|
|
1812
1838
|
}
|
|
@@ -1827,9 +1853,10 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1827
1853
|
annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
|
|
1828
1854
|
continue;
|
|
1829
1855
|
}
|
|
1856
|
+
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1830
1857
|
const parent = parentSectionPath(sec);
|
|
1831
|
-
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1832
|
-
if (isRootLevel && hasRootSection && sec !== "") {
|
|
1858
|
+
const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1859
|
+
if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
|
|
1833
1860
|
continue;
|
|
1834
1861
|
}
|
|
1835
1862
|
if (isRootLevel) {
|
|
@@ -2397,6 +2424,7 @@ function buildProductGroup(ctx, products, scoped, rootSlug, skipSharedSectionMer
|
|
|
2397
2424
|
};
|
|
2398
2425
|
return node;
|
|
2399
2426
|
});
|
|
2427
|
+
markCrossProductCanonicalSlugs(children);
|
|
2400
2428
|
return {
|
|
2401
2429
|
type: "productgroup",
|
|
2402
2430
|
id: ctx.nodeId("productgroup"),
|
|
@@ -2408,6 +2436,32 @@ function buildProductGroup(ctx, products, scoped, rootSlug, skipSharedSectionMer
|
|
|
2408
2436
|
children
|
|
2409
2437
|
};
|
|
2410
2438
|
}
|
|
2439
|
+
function markCrossProductCanonicalSlugs(productNodes) {
|
|
2440
|
+
const pageIdToCanonical = /* @__PURE__ */ new Map();
|
|
2441
|
+
const sorted = [...productNodes].sort((a, b) => {
|
|
2442
|
+
if (a.default !== b.default) {
|
|
2443
|
+
return a.default ? -1 : 1;
|
|
2444
|
+
}
|
|
2445
|
+
return 0;
|
|
2446
|
+
});
|
|
2447
|
+
for (const product of sorted) {
|
|
2448
|
+
traverseDF(product, (child) => {
|
|
2449
|
+
if (hasMetadata(child) && isPage(child)) {
|
|
2450
|
+
const pid = getPageId(child);
|
|
2451
|
+
if (pid == null) {
|
|
2452
|
+
return;
|
|
2453
|
+
}
|
|
2454
|
+
const key = `pid:${pid}`;
|
|
2455
|
+
const canonical = pageIdToCanonical.get(key);
|
|
2456
|
+
if (canonical != null && !product.default) {
|
|
2457
|
+
child.canonicalSlug = canonical;
|
|
2458
|
+
} else if (canonical == null) {
|
|
2459
|
+
pageIdToCanonical.set(key, child.canonicalSlug ?? child.slug);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2411
2465
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2412
2466
|
0 && (module.exports = {
|
|
2413
2467
|
apiLeafNodeFromNavRoute,
|