@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
|
@@ -1359,7 +1359,17 @@ function directChildApiPackages(parentSection, scopeSegs, apiDefinitionId) {
|
|
|
1359
1359
|
function buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix) {
|
|
1360
1360
|
const { seg, nav } = scoped;
|
|
1361
1361
|
const leafNodes = positionedApiLeafChildren(ctx, nav, apiDefinitionId);
|
|
1362
|
-
|
|
1362
|
+
let childPackages = directChildApiPackages(seg.section, scopeSegs, apiDefinitionId);
|
|
1363
|
+
const samePathApiSiblings = scopeSegs.filter(
|
|
1364
|
+
(s) => s.seg.section === seg.section && s.seg.sortOrder !== seg.sortOrder && API_NODE_SEGMENT_TYPES.has(metaStr(s.seg.metadata, "type") ?? "")
|
|
1365
|
+
);
|
|
1366
|
+
const hasCollapsedGroups = samePathApiSiblings.length > 0;
|
|
1367
|
+
if (hasCollapsedGroups && metaStr(seg.metadata, "type") !== "apiReference") {
|
|
1368
|
+
const nextSibling = samePathApiSiblings.filter((s) => s.seg.sortOrder > seg.sortOrder).sort((a, b) => a.seg.sortOrder - b.seg.sortOrder)[0];
|
|
1369
|
+
const lo = seg.sortOrder;
|
|
1370
|
+
const hi = nextSibling?.seg.sortOrder ?? Number.MAX_SAFE_INTEGER;
|
|
1371
|
+
childPackages = childPackages.filter((c) => c.seg.sortOrder > lo && c.seg.sortOrder < hi);
|
|
1372
|
+
}
|
|
1363
1373
|
const packageNodes = childPackages.map((child) => ({
|
|
1364
1374
|
node: apiPackageChildNode(
|
|
1365
1375
|
ctx,
|
|
@@ -1370,6 +1380,9 @@ function buildApiChildren(ctx, scoped, scopeSegs, apiDefinitionId, scopePrefix)
|
|
|
1370
1380
|
),
|
|
1371
1381
|
childIndex: metaNum(child.seg.metadata, "childIndex")
|
|
1372
1382
|
}));
|
|
1383
|
+
if (hasCollapsedGroups && metaStr(seg.metadata, "type") === "apiReference") {
|
|
1384
|
+
return [...leafNodes, ...packageNodes.map((p, i) => ({ node: p.node, pos: leafNodes.length + i }))].sort((a, b) => a.pos - b.pos).map((p) => p.node);
|
|
1385
|
+
}
|
|
1373
1386
|
const hasChildIndex = packageNodes.some((p) => p.childIndex != null);
|
|
1374
1387
|
if (!hasChildIndex) {
|
|
1375
1388
|
return [...leafNodes, ...packageNodes.map((p) => ({ node: p.node, pos: Number.MAX_SAFE_INTEGER }))].sort((a, b) => a.pos - b.pos).map((p) => p.node);
|
|
@@ -1681,6 +1694,10 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1681
1694
|
if (hasOwningApiReference(s, scopeSegs) || isNestedApiPackage(s, scopeSegs)) {
|
|
1682
1695
|
return false;
|
|
1683
1696
|
}
|
|
1697
|
+
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1698
|
+
if (depth === 0) {
|
|
1699
|
+
return false;
|
|
1700
|
+
}
|
|
1684
1701
|
const parent = parentSectionPath(sec);
|
|
1685
1702
|
if (parent === parentPath) {
|
|
1686
1703
|
return true;
|
|
@@ -1728,8 +1745,9 @@ function computeSiblingSortBoundaries(ordered) {
|
|
|
1728
1745
|
rootSections.push(s);
|
|
1729
1746
|
continue;
|
|
1730
1747
|
}
|
|
1748
|
+
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1731
1749
|
const parent = parentSectionPath(sec);
|
|
1732
|
-
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1750
|
+
const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1733
1751
|
if (isRootLevel) {
|
|
1734
1752
|
rootSections.push(s);
|
|
1735
1753
|
}
|
|
@@ -1766,6 +1784,14 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1766
1784
|
if (hasOwningApiReference(s, scopeSegs) || isNestedApiPackage(s, scopeSegs)) {
|
|
1767
1785
|
continue;
|
|
1768
1786
|
}
|
|
1787
|
+
if (type === "apiPackage") {
|
|
1788
|
+
const hasApiRefSibling = ordered.some(
|
|
1789
|
+
(sib) => sib.seg.section === sec && metaStr(sib.seg.metadata, "type") === "apiReference"
|
|
1790
|
+
);
|
|
1791
|
+
if (hasApiRefSibling) {
|
|
1792
|
+
continue;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1769
1795
|
if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
|
|
1770
1796
|
continue;
|
|
1771
1797
|
}
|
|
@@ -1786,9 +1812,10 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1786
1812
|
annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
|
|
1787
1813
|
continue;
|
|
1788
1814
|
}
|
|
1815
|
+
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1789
1816
|
const parent = parentSectionPath(sec);
|
|
1790
|
-
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1791
|
-
if (isRootLevel && hasRootSection && sec !== "") {
|
|
1817
|
+
const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1818
|
+
if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
|
|
1792
1819
|
continue;
|
|
1793
1820
|
}
|
|
1794
1821
|
if (isRootLevel) {
|
|
@@ -2356,6 +2383,7 @@ function buildProductGroup(ctx, products, scoped, rootSlug, skipSharedSectionMer
|
|
|
2356
2383
|
};
|
|
2357
2384
|
return node;
|
|
2358
2385
|
});
|
|
2386
|
+
markCrossProductCanonicalSlugs(children);
|
|
2359
2387
|
return {
|
|
2360
2388
|
type: "productgroup",
|
|
2361
2389
|
id: ctx.nodeId("productgroup"),
|
|
@@ -2367,6 +2395,32 @@ function buildProductGroup(ctx, products, scoped, rootSlug, skipSharedSectionMer
|
|
|
2367
2395
|
children
|
|
2368
2396
|
};
|
|
2369
2397
|
}
|
|
2398
|
+
function markCrossProductCanonicalSlugs(productNodes) {
|
|
2399
|
+
const pageIdToCanonical = /* @__PURE__ */ new Map();
|
|
2400
|
+
const sorted = [...productNodes].sort((a, b) => {
|
|
2401
|
+
if (a.default !== b.default) {
|
|
2402
|
+
return a.default ? -1 : 1;
|
|
2403
|
+
}
|
|
2404
|
+
return 0;
|
|
2405
|
+
});
|
|
2406
|
+
for (const product of sorted) {
|
|
2407
|
+
traverseDF(product, (child) => {
|
|
2408
|
+
if (hasMetadata(child) && isPage(child)) {
|
|
2409
|
+
const pid = getPageId(child);
|
|
2410
|
+
if (pid == null) {
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
const key = `pid:${pid}`;
|
|
2414
|
+
const canonical = pageIdToCanonical.get(key);
|
|
2415
|
+
if (canonical != null && !product.default) {
|
|
2416
|
+
child.canonicalSlug = canonical;
|
|
2417
|
+
} else if (canonical == null) {
|
|
2418
|
+
pageIdToCanonical.set(key, child.canonicalSlug ?? child.slug);
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2370
2424
|
export {
|
|
2371
2425
|
apiLeafNodeFromNavRoute,
|
|
2372
2426
|
buildFullRootFromSegments,
|