@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.
- package/dist/js/navigation/ledger-root-builder.js +29 -1
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +29 -1
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/js/orpc-client.js +36 -0
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +36 -0
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.js +56 -1
- package/dist/navigation/__test__/ledger-root-builder.contentfulRedirectRepro.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.js +408 -0
- package/dist/navigation/__test__/ledger-root-builder.withinVersionDedup.test.js.map +1 -0
- package/dist/navigation/ledger-root-builder.js +46 -1
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js +28 -1
- package/dist/orpc-client/docs-ledger/__test__/config-files.navFiles.test.js.map +1 -1
- package/dist/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
- package/dist/orpc-client/docs-ledger/config-files.js +34 -0
- package/dist/orpc-client/docs-ledger/config-files.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.withinVersionDedup.test.d.ts.map +1 -0
- package/dist/types/orpc-client/docs-ledger/config-files.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2195,7 +2195,7 @@ function buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix) {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
|
|
2197
2197
|
const first = scopeSegs[0];
|
|
2198
|
-
|
|
2198
|
+
const node = {
|
|
2199
2199
|
type: "unversioned",
|
|
2200
2200
|
id: ctx.nodeId(`unversioned:${first?.seg.product?.id ?? "root"}`),
|
|
2201
2201
|
collapsed: void 0,
|
|
@@ -2205,6 +2205,8 @@ function buildUnversioned(ctx, scopeSegs, scopePrefix, tabsPresent) {
|
|
|
2205
2205
|
// namespace.
|
|
2206
2206
|
child: buildTabbedOrSidebar(ctx, scopeSegs, tabsPresent, scopePrefix)
|
|
2207
2207
|
};
|
|
2208
|
+
markWithinScopeCanonicalSlugs(node);
|
|
2209
|
+
return node;
|
|
2208
2210
|
}
|
|
2209
2211
|
function mergeSharedSections(defaultSegs, allScoped, defaultVersion, versionSlugs) {
|
|
2210
2212
|
const defaultTabsByName = /* @__PURE__ */ new Map();
|
|
@@ -2288,6 +2290,7 @@ function buildVersioned(ctx, versions, scoped, rootSlug, productPrefix, skipShar
|
|
|
2288
2290
|
// version subtree stays inside the default-version prune window.
|
|
2289
2291
|
child: buildTabbedOrSidebar(ctx, versionSegs, tabsPresent, asSlug(slug))
|
|
2290
2292
|
};
|
|
2293
|
+
markWithinScopeCanonicalSlugs(node);
|
|
2291
2294
|
if (node.default) {
|
|
2292
2295
|
markDefaultVersionCanonicalSlugs(node, productPrefix != null ? asSlug(productPrefix) : rootSlug, node.slug);
|
|
2293
2296
|
}
|
|
@@ -2398,6 +2401,31 @@ function buildLandingPage(ctx, scopeSegs) {
|
|
|
2398
2401
|
landingSegment?.nav.find((route) => route.type === "markdown")
|
|
2399
2402
|
);
|
|
2400
2403
|
}
|
|
2404
|
+
function markWithinScopeCanonicalSlugs(scopeNode) {
|
|
2405
|
+
const keyToCanonical = /* @__PURE__ */ new Map();
|
|
2406
|
+
traverseDF(scopeNode, (child, parents) => {
|
|
2407
|
+
if (hasMetadata(child) && isPage(child)) {
|
|
2408
|
+
const keys = crossVersionDedupKeys(child, parents);
|
|
2409
|
+
let matched = false;
|
|
2410
|
+
for (const key of keys) {
|
|
2411
|
+
const canonical = keyToCanonical.get(key);
|
|
2412
|
+
if (canonical != null && canonical !== child.slug) {
|
|
2413
|
+
child.canonicalSlug = canonical;
|
|
2414
|
+
matched = true;
|
|
2415
|
+
break;
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
if (!matched) {
|
|
2419
|
+
const slug = child.canonicalSlug ?? child.slug;
|
|
2420
|
+
for (const key of keys) {
|
|
2421
|
+
if (!keyToCanonical.has(key)) {
|
|
2422
|
+
keyToCanonical.set(key, slug);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2401
2429
|
function markCrossVersionCanonicalSlugs(versionNodes) {
|
|
2402
2430
|
const keyToCanonical = /* @__PURE__ */ new Map();
|
|
2403
2431
|
const sorted = [...versionNodes].sort((a, b) => {
|