@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
@@ -1598,6 +1598,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1598
1598
  if (hasOwningApiReference(s, scopeSegs)) {
1599
1599
  continue;
1600
1600
  }
1601
+ if (type === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true) {
1602
+ continue;
1603
+ }
1601
1604
  if (type === "tabRoot" || sec === "" && type !== "section") {
1602
1605
  for (const r of s.nav) {
1603
1606
  const node = artifactToNode(ctx, r);
@@ -1684,13 +1687,13 @@ function buildSidebarRoot(ctx, scopeSegs, scopePrefix, changelogScopePrefix) {
1684
1687
  };
1685
1688
  }
1686
1689
  function buildFullRootFromSegments(options) {
1687
- const { basePath, title, segments, navBySegment } = options;
1690
+ const { basePath, rootSlug: sourceRootSlug, title, segments, navBySegment } = options;
1688
1691
  const ctx = createBuildContext(basePath);
1689
1692
  const scoped = segments.filter((seg) => {
1690
1693
  const t = metaStr(seg.metadata, "type");
1691
1694
  return t !== "files" && t !== "redirects";
1692
1695
  }).map((seg) => ({ seg, nav: navBySegment.get(seg.segmentHash) ?? [] }));
1693
- const rootSlug = asSlug(basePath);
1696
+ const rootSlug = asSlug(sourceRootSlug ?? basePath);
1694
1697
  const scopesByKey = /* @__PURE__ */ new Map();
1695
1698
  for (const s of scoped) {
1696
1699
  const key = scopeKey(s.seg);
@@ -1905,7 +1908,7 @@ function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
1905
1908
  type: "unversioned",
1906
1909
  id: ctx.nodeId(`unversioned:${first?.seg.product?.id ?? "root"}`),
1907
1910
  collapsed: void 0,
1908
- landingPage: void 0,
1911
+ landingPage: buildLandingPage(ctx, scopeSegs),
1909
1912
  // The enclosing scope prefix (product slug, or rootSlug at the top
1910
1913
  // level) roots structural sections so they share the scope's slug
1911
1914
  // namespace.
@@ -1932,7 +1935,7 @@ function buildVersioned(ctx, versions, scoped, rootSlug, productPrefix) {
1932
1935
  default: detailIsDefault(version),
1933
1936
  versionId: VersionId(version.id),
1934
1937
  availability: void 0,
1935
- landingPage: buildVersionLandingPage(ctx, versionSegs, asSlug(slug)),
1938
+ landingPage: buildLandingPage(ctx, versionSegs),
1936
1939
  announcement: void 0,
1937
1940
  pointsTo: metaStr(version.metadata, "pointsTo") != null ? pointsToSlug(metaStr(version.metadata, "pointsTo")) : void 0,
1938
1941
  // The version's full slug roots structural sections so the whole
@@ -2013,34 +2016,41 @@ function crossVersionDedupKeys(node, parents) {
2013
2016
  keys.push([...parentTitles, node.title].join("###"));
2014
2017
  return keys;
2015
2018
  }
2016
- function buildVersionLandingPage(ctx, versionSegs, versionSlug) {
2017
- const tablessSegs = versionSegs.filter((s) => s.seg.tab == null);
2018
- if (tablessSegs.length === 0) {
2019
+ function routeToLandingPage(ctx, route) {
2020
+ if (route == null || route.type !== "markdown" || route.fullPath == null) {
2019
2021
  return void 0;
2020
2022
  }
2021
- for (const s of tablessSegs) {
2022
- for (const r of s.nav) {
2023
- if (r.type === "markdown" && r.fullPath != null) {
2024
- const md = r.metadata;
2025
- const pageId = metaStr(md, "pageId") ?? "";
2026
- const slug = ctx.contentSlug(r.fullPath);
2027
- return {
2028
- type: "landingPage",
2029
- ...withMetadataDefaults({
2030
- id: ctx.nodeId(`landing:${slug}`),
2031
- title: metaStr(md, "title") ?? "",
2032
- slug,
2033
- icon: metaStr(md, "icon"),
2034
- hidden: r.hidden,
2035
- viewers: toViewers(metaStrArr(md, "viewers"))
2036
- }),
2037
- pageId: PageId(pageId),
2038
- noindex: metaBool(md, "noindex")
2039
- };
2040
- }
2041
- }
2023
+ const md = route.metadata;
2024
+ const pageId = metaStr(md, "pageId");
2025
+ if (pageId == null) {
2026
+ return void 0;
2042
2027
  }
2043
- return void 0;
2028
+ const slug = ctx.contentSlug(route.fullPath);
2029
+ return {
2030
+ type: "landingPage",
2031
+ ...withMetadataDefaults({
2032
+ id: ctx.nodeId(`landing:${slug}`),
2033
+ title: metaStr(md, "title") ?? "",
2034
+ slug,
2035
+ icon: metaStr(md, "icon"),
2036
+ hidden: route.hidden,
2037
+ authed: metaBool(md, "authed"),
2038
+ viewers: toViewers(metaStrArr(md, "viewers")),
2039
+ orphaned: metaBool(md, "orphaned"),
2040
+ featureFlags: metaFeatureFlags(md)
2041
+ }),
2042
+ pageId: PageId(pageId),
2043
+ noindex: metaBool(md, "noindex")
2044
+ };
2045
+ }
2046
+ function buildLandingPage(ctx, scopeSegs) {
2047
+ const landingSegment = scopeSegs.find(
2048
+ (s) => metaStr(s.seg.metadata, "type") === "tabRoot" && metaBool(s.seg.metadata, "landingPage") === true
2049
+ );
2050
+ return routeToLandingPage(
2051
+ ctx,
2052
+ landingSegment?.nav.find((route) => route.type === "markdown")
2053
+ );
2044
2054
  }
2045
2055
  function markCrossVersionCanonicalSlugs(versionNodes) {
2046
2056
  const keyToCanonical = /* @__PURE__ */ new Map();
@@ -2111,7 +2121,10 @@ function buildProductGroup(ctx, products, scoped, rootSlug) {
2111
2121
  type: "productgroup",
2112
2122
  id: ctx.nodeId("productgroup"),
2113
2123
  collapsed: void 0,
2114
- landingPage: void 0,
2124
+ landingPage: buildLandingPage(
2125
+ ctx,
2126
+ scoped.filter((s) => s.seg.product == null)
2127
+ ),
2115
2128
  children
2116
2129
  };
2117
2130
  }