@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
|
@@ -805,6 +805,14 @@ function traverseDF(node, visit) {
|
|
|
805
805
|
}
|
|
806
806
|
|
|
807
807
|
// src/navigation/ledger-root-builder.ts
|
|
808
|
+
var STRUCTURAL_SEGMENT_TYPES = /* @__PURE__ */ new Set([
|
|
809
|
+
"section",
|
|
810
|
+
"apiReference",
|
|
811
|
+
"apiPackage",
|
|
812
|
+
"changelog"
|
|
813
|
+
]);
|
|
814
|
+
var API_NODE_SEGMENT_TYPES = /* @__PURE__ */ new Set(["apiReference", "apiPackage"]);
|
|
815
|
+
var INFRA_SEGMENT_TYPES = /* @__PURE__ */ new Set(["files", "redirects"]);
|
|
808
816
|
function createBuildContext(basePath) {
|
|
809
817
|
const seen = /* @__PURE__ */ new Map();
|
|
810
818
|
const basePrefix = basePath.replace(/^\/+|\/+$/g, "");
|
|
@@ -882,7 +890,7 @@ function toViewers(viewers) {
|
|
|
882
890
|
return viewers.map((v) => RoleId(v));
|
|
883
891
|
}
|
|
884
892
|
function mergeVariantViewers(seg) {
|
|
885
|
-
const segViewers =
|
|
893
|
+
const segViewers = STRUCTURAL_SEGMENT_TYPES.has(seg.metadata.type) ? seg.metadata.viewers : void 0;
|
|
886
894
|
const variantViewers = seg.variant?.viewers;
|
|
887
895
|
if ((segViewers == null || segViewers.length === 0) && (variantViewers == null || variantViewers.length === 0)) {
|
|
888
896
|
return void 0;
|
|
@@ -1248,12 +1256,10 @@ function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
|
|
|
1248
1256
|
return {
|
|
1249
1257
|
type: "section",
|
|
1250
1258
|
...defaults,
|
|
1251
|
-
|
|
1252
|
-
// so getInitiallyOpenByDefaultNodes picks it up and the UI starts open.
|
|
1253
|
-
collapsed: metaCollapsed(seg.metadata) === false ? "open-by-default" : metaCollapsed(seg.metadata) ?? defaults.collapsed,
|
|
1259
|
+
collapsed: metaCollapsed(seg.metadata) ?? defaults.collapsed,
|
|
1254
1260
|
overviewPageId: overviewPageId != null ? PageId(overviewPageId) : void 0,
|
|
1255
1261
|
noindex: metaBool(overview?.metadata, "noindex") ?? metaBool(seg.metadata, "noindex"),
|
|
1256
|
-
collapsible: metaBool(seg.metadata, "collapsible") ?? (metaCollapsed(seg.metadata)
|
|
1262
|
+
collapsible: metaBool(seg.metadata, "collapsible") ?? (metaCollapsed(seg.metadata) === true ? true : void 0),
|
|
1257
1263
|
collapsedByDefault: metaBool(seg.metadata, "collapsedByDefault") ?? (metaCollapsed(seg.metadata) === true ? true : void 0),
|
|
1258
1264
|
availability: metaStr(seg.metadata, "availability"),
|
|
1259
1265
|
pointsTo: metaPointsTo != null ? pointsToSlug(metaPointsTo) : void 0,
|
|
@@ -1572,7 +1578,7 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1572
1578
|
const type = metaStr(s.seg.metadata, "type");
|
|
1573
1579
|
const childIndex = metaNum(s.seg.metadata, "childIndex");
|
|
1574
1580
|
let node;
|
|
1575
|
-
if (type
|
|
1581
|
+
if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
|
|
1576
1582
|
node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
|
|
1577
1583
|
} else if (type === "changelog") {
|
|
1578
1584
|
node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
|
|
@@ -1636,7 +1642,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1636
1642
|
if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
|
|
1637
1643
|
continue;
|
|
1638
1644
|
}
|
|
1639
|
-
if (type === "tabRoot" || sec === "" && type
|
|
1645
|
+
if (type === "tabRoot" || sec === "" && !STRUCTURAL_SEGMENT_TYPES.has(type ?? "")) {
|
|
1640
1646
|
for (const r of s.nav) {
|
|
1641
1647
|
const node = artifactToNode(ctx, r);
|
|
1642
1648
|
if (node != null) {
|
|
@@ -1653,12 +1659,12 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1653
1659
|
}
|
|
1654
1660
|
const parent = parentSectionPath(sec);
|
|
1655
1661
|
const isRootLevel = parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1656
|
-
if (isRootLevel && hasRootSection) {
|
|
1662
|
+
if (isRootLevel && hasRootSection && sec !== "") {
|
|
1657
1663
|
continue;
|
|
1658
1664
|
}
|
|
1659
1665
|
if (isRootLevel) {
|
|
1660
1666
|
let node;
|
|
1661
|
-
if (type
|
|
1667
|
+
if (API_NODE_SEGMENT_TYPES.has(type ?? "")) {
|
|
1662
1668
|
node = apiReferenceNode(ctx, s, scopeSegs, scopePrefix);
|
|
1663
1669
|
} else if (type === "changelog") {
|
|
1664
1670
|
node = changelogNode(ctx, s, changelogScopePrefix ?? scopePrefix);
|
|
@@ -1733,7 +1739,7 @@ function buildFullRootFromSegments(options) {
|
|
|
1733
1739
|
const ctx = createBuildContext(basePath);
|
|
1734
1740
|
const scoped = segments.filter((seg) => {
|
|
1735
1741
|
const t = metaStr(seg.metadata, "type");
|
|
1736
|
-
return t
|
|
1742
|
+
return !INFRA_SEGMENT_TYPES.has(t ?? "");
|
|
1737
1743
|
}).map((seg) => ({ seg, nav: navBySegment.get(seg.segmentHash) ?? [] }));
|
|
1738
1744
|
const rootSlug = asSlug(sourceRootSlug ?? basePath);
|
|
1739
1745
|
const scopesByKey = /* @__PURE__ */ new Map();
|
|
@@ -1857,20 +1863,34 @@ function buildSidebarRootWithVariants(ctx, scopeSegs, scopePrefix, changelogScop
|
|
|
1857
1863
|
if (variants.length <= 1) {
|
|
1858
1864
|
return buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix);
|
|
1859
1865
|
}
|
|
1866
|
+
const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
|
|
1860
1867
|
const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
|
|
1868
|
+
const sharedChildren = sharedSegs.length > 0 ? buildSidebarRootChildren(ctx, sharedSegs, scopePrefix, changelogScopePrefix) : [];
|
|
1861
1869
|
const first = scopeSegs[0];
|
|
1862
1870
|
return {
|
|
1863
1871
|
type: "sidebarRoot",
|
|
1864
1872
|
id: ctx.nodeId(`sidebar:${first != null ? scopeKey(first.seg) : "root"}`),
|
|
1865
1873
|
collapsed: void 0,
|
|
1866
|
-
children: [variantedNode]
|
|
1874
|
+
children: [...sharedChildren, variantedNode]
|
|
1867
1875
|
};
|
|
1868
1876
|
}
|
|
1869
1877
|
function buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix) {
|
|
1870
1878
|
if (!tabsPresent) {
|
|
1871
1879
|
const variants = uniqueDetails(scopeSegs, "variant");
|
|
1872
1880
|
if (variants.length > 1) {
|
|
1873
|
-
|
|
1881
|
+
const sharedSegs = scopeSegs.filter((s) => s.seg.variant == null);
|
|
1882
|
+
const variantedNode = buildVariantedNode(ctx, variants, scopeSegs, scopePrefix);
|
|
1883
|
+
if (sharedSegs.length > 0) {
|
|
1884
|
+
const sharedChildren = buildSidebarRootChildren(ctx, sharedSegs, scopePrefix);
|
|
1885
|
+
const first2 = scopeSegs[0];
|
|
1886
|
+
return {
|
|
1887
|
+
type: "sidebarRoot",
|
|
1888
|
+
id: ctx.nodeId(`sidebar:${first2 != null ? scopeKey(first2.seg) : "root"}`),
|
|
1889
|
+
collapsed: void 0,
|
|
1890
|
+
children: [...sharedChildren, variantedNode]
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
return variantedNode;
|
|
1874
1894
|
}
|
|
1875
1895
|
return buildSidebarRoot(ctx, scopeSegs, scopePrefix);
|
|
1876
1896
|
}
|