@fern-api/fdr-sdk 1.2.46-282936abd4 → 1.2.46-4b6622be55

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 (26) hide show
  1. package/dist/js/navigation/ledger-root-builder.js +29 -1
  2. package/dist/js/navigation/ledger-root-builder.js.map +1 -1
  3. package/dist/js/navigation/ledger-root-builder.mjs +29 -1
  4. package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
  5. package/dist/js/orpc-client.js +36 -0
  6. package/dist/js/orpc-client.js.map +1 -1
  7. package/dist/js/orpc-client.mjs +36 -0
  8. package/dist/js/orpc-client.mjs.map +1 -1
  9. package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.js +56 -1
  10. package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.js.map +1 -1
  11. package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts +2 -0
  12. package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts.map +1 -0
  13. package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.js +408 -0
  14. package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.js.map +1 -0
  15. package/dist/navigation/ledger-root-builder.js +46 -1
  16. package/dist/navigation/ledger-root-builder.js.map +1 -1
  17. package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js +28 -1
  18. package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js.map +1 -1
  19. package/dist/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
  20. package/dist/orpc-client/docs-ledger/config-files.js +34 -0
  21. package/dist/orpc-client/docs-ledger/config-files.js.map +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/dist/types/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts +2 -0
  24. package/dist/types/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts.map +1 -0
  25. package/dist/types/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
  26. package/package.json +1 -1
@@ -2236,7 +2236,7 @@ function buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix) {
2236
2236
  }
2237
2237
  function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
2238
2238
  const first = scopeSegs[0];
2239
- return {
2239
+ const node = {
2240
2240
  type: "unversioned",
2241
2241
  id: ctx.nodeId(`unversioned:${first?.seg.product?.id ?? "root"}`),
2242
2242
  collapsed: void 0,
@@ -2246,6 +2246,8 @@ function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
2246
2246
  // namespace.
2247
2247
  child: buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix)
2248
2248
  };
2249
+ markWithinScopeCanonicalSlugs(node);
2250
+ return node;
2249
2251
  }
2250
2252
  function mergeSharedSections(defaultSegs, allScoped, defaultVersion, versionSlugs) {
2251
2253
  const defaultTabsByName = /* @__PURE__ */ new Map();
@@ -2329,6 +2331,7 @@ function buildVersioned(ctx, versions, scoped, rootSlug, productPrefix, skipShar
2329
2331
  // version subtree stays inside the default-version prune window.
2330
2332
  child: buildTabbedOrSidebar(ctx, versionSegs, tabsPresent, asSlug(slug))
2331
2333
  };
2334
+ markWithinScopeCanonicalSlugs(node);
2332
2335
  if (node.default) {
2333
2336
  markDefaultVersionCanonicalSlugs(node, productPrefix != null ? asSlug(productPrefix) : rootSlug, node.slug);
2334
2337
  }
@@ -2439,6 +2442,31 @@ function buildLandingPage(ctx, scopeSegs) {
2439
2442
  landingSegment?.nav.find((route) => route.type === "markdown")
2440
2443
  );
2441
2444
  }
2445
+ function markWithinScopeCanonicalSlugs(scopeNode) {
2446
+ const keyToCanonical = /* @__PURE__ */ new Map();
2447
+ traverseDF(scopeNode, (child, parents) => {
2448
+ if (hasMetadata(child) && isPage(child)) {
2449
+ const keys = crossVersionDedupKeys(child, parents);
2450
+ let matched = false;
2451
+ for (const key of keys) {
2452
+ const canonical = keyToCanonical.get(key);
2453
+ if (canonical != null && canonical !== child.slug) {
2454
+ child.canonicalSlug = canonical;
2455
+ matched = true;
2456
+ break;
2457
+ }
2458
+ }
2459
+ if (!matched) {
2460
+ const slug = child.canonicalSlug ?? child.slug;
2461
+ for (const key of keys) {
2462
+ if (!keyToCanonical.has(key)) {
2463
+ keyToCanonical.set(key, slug);
2464
+ }
2465
+ }
2466
+ }
2467
+ }
2468
+ });
2469
+ }
2442
2470
  function markCrossVersionCanonicalSlugs(versionNodes) {
2443
2471
  const keyToCanonical = /* @__PURE__ */ new Map();
2444
2472
  const sorted = [...versionNodes].sort((a, b) => {