@fern-api/fdr-sdk 1.2.41-f793e24db2 → 1.2.42-0009e24002
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/navigation/ledger-root-builder.js +41 -3
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +41 -3
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.metadataPreservation.test.js +58 -0
- package/dist/navigation/__test__/ledger-root-builder.metadataPreservation.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.js +117 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/navigation/ledger-root-builder.js +57 -3
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -999,7 +999,7 @@ function artifactToNode(ctx, route) {
|
|
|
999
999
|
}),
|
|
1000
1000
|
pageId: PageId(pageId),
|
|
1001
1001
|
noindex: metaBool(md, "noindex"),
|
|
1002
|
-
availability:
|
|
1002
|
+
availability: metaStr(md, "availability")
|
|
1003
1003
|
};
|
|
1004
1004
|
return node;
|
|
1005
1005
|
}
|
|
@@ -1500,6 +1500,44 @@ function hasOwningApiReference(scoped, scopeSegs) {
|
|
|
1500
1500
|
return metaStr(candidate.seg.metadata, "apiDefinitionId") === apiDefinitionId;
|
|
1501
1501
|
});
|
|
1502
1502
|
}
|
|
1503
|
+
function isNestedApiPackage(scoped, scopeSegs) {
|
|
1504
|
+
if (metaStr(scoped.seg.metadata, "type") !== "apiPackage") {
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
const apiDefinitionId = metaStr(scoped.seg.metadata, "apiDefinitionId");
|
|
1508
|
+
if (apiDefinitionId == null) {
|
|
1509
|
+
return false;
|
|
1510
|
+
}
|
|
1511
|
+
const apiReferenceSections = new Set(
|
|
1512
|
+
scopeSegs.filter(
|
|
1513
|
+
(s) => metaStr(s.seg.metadata, "type") === "apiReference" && metaStr(s.seg.metadata, "apiDefinitionId") === apiDefinitionId
|
|
1514
|
+
).map((s) => s.seg.section)
|
|
1515
|
+
);
|
|
1516
|
+
if (apiReferenceSections.size === 0) {
|
|
1517
|
+
return false;
|
|
1518
|
+
}
|
|
1519
|
+
const sectionPaths = new Set(scopeSegs.map((s) => s.seg.section));
|
|
1520
|
+
const resolveParent = (section) => {
|
|
1521
|
+
const parent = parentSectionPath(section);
|
|
1522
|
+
if (parent === "" || sectionPaths.has(parent)) {
|
|
1523
|
+
return parent;
|
|
1524
|
+
}
|
|
1525
|
+
return nearestExistingAncestor(section, sectionPaths);
|
|
1526
|
+
};
|
|
1527
|
+
let current = scoped.seg.section;
|
|
1528
|
+
const seen = /* @__PURE__ */ new Set([current]);
|
|
1529
|
+
for (; ; ) {
|
|
1530
|
+
const parent = resolveParent(current);
|
|
1531
|
+
if (apiReferenceSections.has(parent)) {
|
|
1532
|
+
return true;
|
|
1533
|
+
}
|
|
1534
|
+
if (parent === "" || seen.has(parent)) {
|
|
1535
|
+
return false;
|
|
1536
|
+
}
|
|
1537
|
+
seen.add(parent);
|
|
1538
|
+
current = parent;
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1503
1541
|
function changelogNode(ctx, scoped, scopePrefix) {
|
|
1504
1542
|
const { seg, nav } = scoped;
|
|
1505
1543
|
const overview = overviewRoute(nav);
|
|
@@ -1603,7 +1641,7 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1603
1641
|
if (sec === "" || type === "tabRoot") {
|
|
1604
1642
|
return false;
|
|
1605
1643
|
}
|
|
1606
|
-
if (hasOwningApiReference(s, scopeSegs)) {
|
|
1644
|
+
if (hasOwningApiReference(s, scopeSegs) || isNestedApiPackage(s, scopeSegs)) {
|
|
1607
1645
|
return false;
|
|
1608
1646
|
}
|
|
1609
1647
|
const parent = parentSectionPath(sec);
|
|
@@ -1677,7 +1715,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1677
1715
|
for (const s of ordered) {
|
|
1678
1716
|
const type = metaStr(s.seg.metadata, "type");
|
|
1679
1717
|
const sec = s.seg.section;
|
|
1680
|
-
if (hasOwningApiReference(s, scopeSegs)) {
|
|
1718
|
+
if (hasOwningApiReference(s, scopeSegs) || isNestedApiPackage(s, scopeSegs)) {
|
|
1681
1719
|
continue;
|
|
1682
1720
|
}
|
|
1683
1721
|
if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
|