@fern-api/fdr-sdk 1.2.39-bf608e8e3c → 1.2.39-d0fa0d2c40
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/converters/index.js +1 -6
- package/dist/js/converters/index.js.map +1 -1
- package/dist/js/converters/index.mjs +1 -6
- package/dist/js/converters/index.mjs.map +1 -1
- package/dist/js/index.js +1 -6
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +1 -6
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/index.js +1 -6
- package/dist/js/navigation/index.js.map +1 -1
- package/dist/js/navigation/index.mjs +1 -6
- package/dist/js/navigation/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +30 -8
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +30 -8
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.collapsedDeterminism.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.collapsedDeterminism.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.skipSlugApiReference.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.variantSharedSegments.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.variantSharedSegments.test.d.ts.map +1 -0
- package/dist/types/navigation/ledger-root-builder.d.ts +5 -1
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/types/navigation/utils/findNode.d.ts.map +1 -1
- package/dist/types/navigation/utils/followRedirect.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -846,6 +846,14 @@ function traverseDF(node, visit) {
|
|
|
846
846
|
}
|
|
847
847
|
|
|
848
848
|
// src/navigation/ledger-root-builder.ts
|
|
849
|
+
var STRUCTURAL_SEGMENT_TYPES = /* @__PURE__ */ new Set([
|
|
850
|
+
"section",
|
|
851
|
+
"apiReference",
|
|
852
|
+
"apiPackage",
|
|
853
|
+
"changelog"
|
|
854
|
+
]);
|
|
855
|
+
var API_NODE_SEGMENT_TYPES = /* @__PURE__ */ new Set(["apiReference", "apiPackage"]);
|
|
856
|
+
var INFRA_SEGMENT_TYPES = /* @__PURE__ */ new Set(["files", "redirects"]);
|
|
849
857
|
function createBuildContext(basePath) {
|
|
850
858
|
const seen = /* @__PURE__ */ new Map();
|
|
851
859
|
const basePrefix = basePath.replace(/^\/+|\/+$/g, "");
|
|
@@ -923,7 +931,7 @@ function toViewers(viewers) {
|
|
|
923
931
|
return viewers.map((v) => RoleId(v));
|
|
924
932
|
}
|
|
925
933
|
function mergeVariantViewers(seg) {
|
|
926
|
-
const segViewers =
|
|
934
|
+
const segViewers = STRUCTURAL_SEGMENT_TYPES.has(seg.metadata.type) ? seg.metadata.viewers : void 0;
|
|
927
935
|
const variantViewers = seg.variant?.viewers;
|
|
928
936
|
if ((segViewers == null || segViewers.length === 0) && (variantViewers == null || variantViewers.length === 0)) {
|
|
929
937
|
return void 0;
|
|
@@ -1611,7 +1619,7 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1611
1619
|
const type = metaStr(s.seg.metadata, "type");
|
|
1612
1620
|
const childIndex = metaNum(s.seg.metadata, "childIndex");
|
|
1613
1621
|
let node;
|
|
1614
|
-
if (type
|
|
1622
|
+
if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
|
|
1615
1623
|
node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
|
|
1616
1624
|
} else if (type === "changelog") {
|
|
1617
1625
|
node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
|
|
@@ -1675,7 +1683,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1675
1683
|
if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
|
|
1676
1684
|
continue;
|
|
1677
1685
|
}
|
|
1678
|
-
if (type === "tabRoot" || sec === "" && type
|
|
1686
|
+
if (type === "tabRoot" || sec === "" && !STRUCTURAL_SEGMENT_TYPES.has(type ?? "")) {
|
|
1679
1687
|
for (const r of s.nav) {
|
|
1680
1688
|
const node = artifactToNode(ctx, r);
|
|
1681
1689
|
if (node != null) {
|
|
@@ -1692,12 +1700,12 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1692
1700
|
}
|
|
1693
1701
|
const parent = parentSectionPath(sec);
|
|
1694
1702
|
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1695
|
-
if (isRootLevel && hasRootSection) {
|
|
1703
|
+
if (isRootLevel && hasRootSection && sec !== "") {
|
|
1696
1704
|
continue;
|
|
1697
1705
|
}
|
|
1698
1706
|
if (isRootLevel) {
|
|
1699
1707
|
let node;
|
|
1700
|
-
if (type
|
|
1708
|
+
if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
|
|
1701
1709
|
node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
|
|
1702
1710
|
} else if (type === "changelog") {
|
|
1703
1711
|
node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
|
|
@@ -1772,7 +1780,7 @@ function buildFullRootFromSegments(options) {
|
|
|
1772
1780
|
const ctx = createBuildContext(basePath);
|
|
1773
1781
|
const scoped = segments.filter((seg) => {
|
|
1774
1782
|
const t = metaStr(seg.metadata, "type");
|
|
1775
|
-
return t
|
|
1783
|
+
return !INFRA_SEGMENT_TYPES.has(t ?? "");
|
|
1776
1784
|
}).map((seg) => ({ seg, nav: navBySegment.get(seg.segmentHash) ?? [] }));
|
|
1777
1785
|
const rootSlug = asSlug(sourceRootSlug ?? basePath);
|
|
1778
1786
|
const scopesByKey = /* @__PURE__ */ new Map();
|
|
@@ -1896,20 +1904,34 @@ function buildSidebarRootWithVariants(ctx, scopeSegs, scopePrefix, changelogScop
|
|
|
1896
1904
|
if (variants.length <= 1) {
|
|
1897
1905
|
return buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix);
|
|
1898
1906
|
}
|
|
1907
|
+
const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
|
|
1899
1908
|
const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
|
|
1909
|
+
const sharedChildren = sharedSegs.length > 0 ? buildSidebarRootChildren(ctx, sharedSegs, scopePrefix, changelogScopePrefix) : [];
|
|
1900
1910
|
const first = scopeSegs[0];
|
|
1901
1911
|
return {
|
|
1902
1912
|
type: "sidebarRoot",
|
|
1903
1913
|
id: ctx.nodeId(`sidebar:${first != null ? scopeKey(first.seg) : "root"}`),
|
|
1904
1914
|
collapsed: void 0,
|
|
1905
|
-
children: [variantedNode]
|
|
1915
|
+
children: [...sharedChildren, variantedNode]
|
|
1906
1916
|
};
|
|
1907
1917
|
}
|
|
1908
1918
|
function buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix) {
|
|
1909
1919
|
if (!tabsPresent) {
|
|
1910
1920
|
const variants = uniqueDetails(scopeSegs, "variant");
|
|
1911
1921
|
if (variants.length > 1) {
|
|
1912
|
-
|
|
1922
|
+
const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
|
|
1923
|
+
const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
|
|
1924
|
+
if (sharedSegs.length > 0) {
|
|
1925
|
+
const sharedChildren = buildSidebarRootChildren(ctx, sharedSegs, scopePrefix);
|
|
1926
|
+
const first2 = scopeSegs[0];
|
|
1927
|
+
return {
|
|
1928
|
+
type: "sidebarRoot",
|
|
1929
|
+
id: ctx.nodeId(`sidebar:${first2 != null ? scopeKey(first2.seg) : "root"}`),
|
|
1930
|
+
collapsed: void 0,
|
|
1931
|
+
children: [...sharedChildren, variantedNode]
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
return variantedNode;
|
|
1913
1935
|
}
|
|
1914
1936
|
return buildSidebarRoot(ctx, scopeSegs, scopePrefix);
|
|
1915
1937
|
}
|