@fern-api/fdr-sdk 1.2.39-b6eaa342cf → 1.2.39-e182f82244

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.
Files changed (28) hide show
  1. package/dist/js/client/FdrClient.js +1 -0
  2. package/dist/js/client/FdrClient.js.map +1 -1
  3. package/dist/js/client/FdrClient.mjs +1 -0
  4. package/dist/js/client/FdrClient.mjs.map +1 -1
  5. package/dist/js/index.js +1 -0
  6. package/dist/js/index.js.map +1 -1
  7. package/dist/js/index.mjs +1 -0
  8. package/dist/js/index.mjs.map +1 -1
  9. package/dist/js/navigation/ledger-root-builder.js +43 -30
  10. package/dist/js/navigation/ledger-root-builder.js.map +1 -1
  11. package/dist/js/navigation/ledger-root-builder.mjs +43 -30
  12. package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
  13. package/dist/js/orpc-client.js +1 -0
  14. package/dist/js/orpc-client.js.map +1 -1
  15. package/dist/js/orpc-client.mjs +1 -0
  16. package/dist/js/orpc-client.mjs.map +1 -1
  17. package/dist/tsconfig.tsbuildinfo +1 -1
  18. package/dist/types/navigation/__test__/ledger-root-builder.landingPage.test.d.ts +2 -0
  19. package/dist/types/navigation/__test__/ledger-root-builder.landingPage.test.d.ts.map +1 -0
  20. package/dist/types/navigation/__test__/ledger-root-builder.rootSlug.test.d.ts +2 -0
  21. package/dist/types/navigation/__test__/ledger-root-builder.rootSlug.test.d.ts.map +1 -0
  22. package/dist/types/navigation/ledger-root-builder.d.ts +2 -0
  23. package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
  24. package/dist/types/orpc-client/docs-ledger/contract.d.ts +50 -0
  25. package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  26. package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts +12 -0
  27. package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -1
  28. package/package.json +1 -1
@@ -1639,6 +1639,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1639
1639
  if (hasOwningApiReference(s, scopeSegs)) {
1640
1640
  continue;
1641
1641
  }
1642
+ if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
1643
+ continue;
1644
+ }
1642
1645
  if (type === "tabRoot" || sec === "" && type !== "section") {
1643
1646
  for (const r of s.nav) {
1644
1647
  const node = artifactToNode(ctx, r);
@@ -1725,13 +1728,13 @@ function buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix) {
1725
1728
  };
1726
1729
  }
1727
1730
  function buildFullRootFromSegments(options) {
1728
- const { basePath, title, segments, navBySegment } = options;
1731
+ const { basePath, rootSlug: sourceRootSlug, title, segments, navBySegment } = options;
1729
1732
  const ctx = createBuildContext(basePath);
1730
1733
  const scoped = segments.filter((seg) => {
1731
1734
  const t = metaStr(seg.metadata, "type");
1732
1735
  return t !== "files" && t !== "redirects";
1733
1736
  }).map((seg) => ({ seg, nav: navBySegment.get(seg.segmentHash) ?? [] }));
1734
- const rootSlug = asSlug(basePath);
1737
+ const rootSlug = asSlug(sourceRootSlug ?? basePath);
1735
1738
  const scopesByKey = /* @__PURE__ */ new Map();
1736
1739
  for (const s of scoped) {
1737
1740
  const key = scopeKey(s.seg);
@@ -1946,7 +1949,7 @@ function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
1946
1949
  type: "unversioned",
1947
1950
  id: ctx.nodeId(`unversioned:${first?.seg.product?.id ?? "root"}`),
1948
1951
  collapsed: void 0,
1949
- landingPage: void 0,
1952
+ landingPage: buildLandingPage(ctx, scopeSegs),
1950
1953
  // The enclosing scope prefix (product slug, or rootSlug at the top
1951
1954
  // level) roots structural sections so they share the scope's slug
1952
1955
  // namespace.
@@ -1973,7 +1976,7 @@ function buildVersioned(ctx, versions, scoped, rootSlug, productPrefix) {
1973
1976
  default: detailIsDefault(version),
1974
1977
  versionId: VersionId(version.id),
1975
1978
  availability: void 0,
1976
- landingPage: buildVersionLandingPage(ctx, versionSegs, asSlug(slug)),
1979
+ landingPage: buildLandingPage(ctx, versionSegs),
1977
1980
  announcement: void 0,
1978
1981
  pointsTo: metaStr(version.metadata, "pointsTo") != null ? pointsToSlug(metaStr(version.metadata, "pointsTo")) : void 0,
1979
1982
  // The version's full slug roots structural sections so the whole
@@ -2054,34 +2057,41 @@ function crossVersionDedupKeys(node, parents) {
2054
2057
  keys.push([...parentTitles, node.title].join("###"));
2055
2058
  return keys;
2056
2059
  }
2057
- function buildVersionLandingPage(ctx, versionSegs, versionSlug) {
2058
- const tablessSegs = versionSegs.filter((s) => s.seg.tab == null);
2059
- if (tablessSegs.length === 0) {
2060
+ function routeToLandingPage(ctx, route) {
2061
+ if (route == null || route.type !== "markdown" || route.fullPath == null) {
2060
2062
  return void 0;
2061
2063
  }
2062
- for (const s of tablessSegs) {
2063
- for (const r of s.nav) {
2064
- if (r.type === "markdown" && r.fullPath != null) {
2065
- const md = r.metadata;
2066
- const pageId = metaStr(md, "pageId") ?? "";
2067
- const slug = ctx.contentSlug(r.fullPath);
2068
- return {
2069
- type: "landingPage",
2070
- ...withMetadataDefaults({
2071
- id: ctx.nodeId(`landing:${slug}`),
2072
- title: metaStr(md, "title") ?? "",
2073
- slug,
2074
- icon: metaStr(md, "icon"),
2075
- hidden: r.hidden,
2076
- viewers: toViewers(metaStrArr(md, "viewers"))
2077
- }),
2078
- pageId: PageId(pageId),
2079
- noindex: metaBool(md, "noindex")
2080
- };
2081
- }
2082
- }
2064
+ const md = route.metadata;
2065
+ const pageId = metaStr(md, "pageId");
2066
+ if (pageId == null) {
2067
+ return void 0;
2083
2068
  }
2084
- return void 0;
2069
+ const slug = ctx.contentSlug(route.fullPath);
2070
+ return {
2071
+ type: "landingPage",
2072
+ ...withMetadataDefaults({
2073
+ id: ctx.nodeId(`landing:${slug}`),
2074
+ title: metaStr(md, "title") ?? "",
2075
+ slug,
2076
+ icon: metaStr(md, "icon"),
2077
+ hidden: route.hidden,
2078
+ authed: metaBool(md, "authed"),
2079
+ viewers: toViewers(metaStrArr(md, "viewers")),
2080
+ orphaned: metaBool(md, "orphaned"),
2081
+ featureFlags: metaFeatureFlags(md)
2082
+ }),
2083
+ pageId: PageId(pageId),
2084
+ noindex: metaBool(md, "noindex")
2085
+ };
2086
+ }
2087
+ function buildLandingPage(ctx, scopeSegs) {
2088
+ const landingSegment = scopeSegs.find(
2089
+ (s) => metaStr(s.seg.metadata, "type") === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true
2090
+ );
2091
+ return routeToLandingPage(
2092
+ ctx,
2093
+ landingSegment?.nav.find((route) => route.type === "markdown")
2094
+ );
2085
2095
  }
2086
2096
  function markCrossVersionCanonicalSlugs(versionNodes) {
2087
2097
  const keyToCanonical = /* @__PURE__ */ new Map();
@@ -2152,7 +2162,10 @@ function buildProductGroup(ctx, products, scoped, rootSlug) {
2152
2162
  type: "productgroup",
2153
2163
  id: ctx.nodeId("productgroup"),
2154
2164
  collapsed: void 0,
2155
- landingPage: void 0,
2165
+ landingPage: buildLandingPage(
2166
+ ctx,
2167
+ scoped.filter((s) => s.seg.product == null)
2168
+ ),
2156
2169
  children
2157
2170
  };
2158
2171
  }