@fern-api/fdr-sdk 1.2.39-2432856e2e → 1.2.39-363aefacdc
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 +4 -9
- package/dist/js/converters/index.js.map +1 -1
- package/dist/js/converters/index.mjs +4 -9
- package/dist/js/converters/index.mjs.map +1 -1
- package/dist/js/index.js +4 -9
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +4 -9
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/index.js +4 -9
- package/dist/js/navigation/index.js.map +1 -1
- package/dist/js/navigation/index.mjs +4 -9
- package/dist/js/navigation/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +32 -12
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +32 -12
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/findNode.authedRedirect.test.d.ts +2 -0
- package/dist/types/navigation/__test__/findNode.authedRedirect.test.d.ts.map +1 -0
- 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 +1 -0
- 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 +1 -1
|
@@ -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;
|
|
@@ -1289,12 +1297,10 @@ function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
|
|
|
1289
1297
|
return {
|
|
1290
1298
|
type: "section",
|
|
1291
1299
|
...defaults,
|
|
1292
|
-
|
|
1293
|
-
// so getInitiallyOpenByDefaultNodes picks it up and the UI starts open.
|
|
1294
|
-
collapsed: metaCollapsed(seg.metadata) === false ? "open-by-default" : metaCollapsed(seg.metadata) ?? defaults.collapsed,
|
|
1300
|
+
collapsed: metaCollapsed(seg.metadata) ?? defaults.collapsed,
|
|
1295
1301
|
overviewPageId: overviewPageId != null ? PageId(overviewPageId) : void 0,
|
|
1296
1302
|
noindex: metaBool(overview?.metadata, "noindex") ?? metaBool(seg.metadata, "noindex"),
|
|
1297
|
-
collapsible: metaBool(seg.metadata, "collapsible") ?? (metaCollapsed(seg.metadata)
|
|
1303
|
+
collapsible: metaBool(seg.metadata, "collapsible") ?? (metaCollapsed(seg.metadata) === true ? true : void 0),
|
|
1298
1304
|
collapsedByDefault: metaBool(seg.metadata, "collapsedByDefault") ?? (metaCollapsed(seg.metadata) === true ? true : void 0),
|
|
1299
1305
|
availability: metaStr(seg.metadata, "availability"),
|
|
1300
1306
|
pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : void 0,
|
|
@@ -1613,7 +1619,7 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1613
1619
|
const type = metaStr(s.seg.metadata, "type");
|
|
1614
1620
|
const childIndex = metaNum(s.seg.metadata, "childIndex");
|
|
1615
1621
|
let node;
|
|
1616
|
-
if (type
|
|
1622
|
+
if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
|
|
1617
1623
|
node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
|
|
1618
1624
|
} else if (type === "changelog") {
|
|
1619
1625
|
node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
|
|
@@ -1677,7 +1683,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1677
1683
|
if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
|
|
1678
1684
|
continue;
|
|
1679
1685
|
}
|
|
1680
|
-
if (type === "tabRoot" || sec === "" && type
|
|
1686
|
+
if (type === "tabRoot" || sec === "" && !STRUCTURAL_SEGMENT_TYPES.has(type ?? "")) {
|
|
1681
1687
|
for (const r of s.nav) {
|
|
1682
1688
|
const node = artifactToNode(ctx, r);
|
|
1683
1689
|
if (node != null) {
|
|
@@ -1694,12 +1700,12 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1694
1700
|
}
|
|
1695
1701
|
const parent = parentSectionPath(sec);
|
|
1696
1702
|
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1697
|
-
if (isRootLevel && hasRootSection) {
|
|
1703
|
+
if (isRootLevel && hasRootSection && sec !== "") {
|
|
1698
1704
|
continue;
|
|
1699
1705
|
}
|
|
1700
1706
|
if (isRootLevel) {
|
|
1701
1707
|
let node;
|
|
1702
|
-
if (type
|
|
1708
|
+
if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
|
|
1703
1709
|
node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
|
|
1704
1710
|
} else if (type === "changelog") {
|
|
1705
1711
|
node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
|
|
@@ -1774,7 +1780,7 @@ function buildFullRootFromSegments(options) {
|
|
|
1774
1780
|
const ctx = createBuildContext(basePath);
|
|
1775
1781
|
const scoped = segments.filter((seg) => {
|
|
1776
1782
|
const t = metaStr(seg.metadata, "type");
|
|
1777
|
-
return t
|
|
1783
|
+
return !INFRA_SEGMENT_TYPES.has(t ?? "");
|
|
1778
1784
|
}).map((seg) => ({ seg, nav: navBySegment.get(seg.segmentHash) ?? [] }));
|
|
1779
1785
|
const rootSlug = asSlug(sourceRootSlug ?? basePath);
|
|
1780
1786
|
const scopesByKey = /* @__PURE__ */ new Map();
|
|
@@ -1898,20 +1904,34 @@ function buildSidebarRootWithVariants(ctx, scopeSegs, scopePrefix, changelogScop
|
|
|
1898
1904
|
if (variants.length <= 1) {
|
|
1899
1905
|
return buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix);
|
|
1900
1906
|
}
|
|
1907
|
+
const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
|
|
1901
1908
|
const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
|
|
1909
|
+
const sharedChildren = sharedSegs.length > 0 ? buildSidebarRootChildren(ctx, sharedSegs, scopePrefix, changelogScopePrefix) : [];
|
|
1902
1910
|
const first = scopeSegs[0];
|
|
1903
1911
|
return {
|
|
1904
1912
|
type: "sidebarRoot",
|
|
1905
1913
|
id: ctx.nodeId(`sidebar:${first != null ? scopeKey(first.seg) : "root"}`),
|
|
1906
1914
|
collapsed: void 0,
|
|
1907
|
-
children: [variantedNode]
|
|
1915
|
+
children: [...sharedChildren, variantedNode]
|
|
1908
1916
|
};
|
|
1909
1917
|
}
|
|
1910
1918
|
function buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix) {
|
|
1911
1919
|
if (!tabsPresent) {
|
|
1912
1920
|
const variants = uniqueDetails(scopeSegs, "variant");
|
|
1913
1921
|
if (variants.length > 1) {
|
|
1914
|
-
|
|
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;
|
|
1915
1935
|
}
|
|
1916
1936
|
return buildSidebarRoot(ctx, scopeSegs, scopePrefix);
|
|
1917
1937
|
}
|