@fern-api/fern-api-dev 3.67.1 → 3.68.0

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 (2) hide show
  1. package/cli.cjs +71 -27
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1427240,7 +1427240,7 @@ var AccessTokenPosthogManager = class {
1427240
1427240
  properties: {
1427241
1427241
  ...event,
1427242
1427242
  ...event.properties,
1427243
- version: "3.67.1",
1427243
+ version: "3.68.0",
1427244
1427244
  usingAccessToken: true
1427245
1427245
  }
1427246
1427246
  });
@@ -1427339,7 +1427339,7 @@ var UserPosthogManager = class {
1427339
1427339
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1427340
1427340
  event: "CLI",
1427341
1427341
  properties: {
1427342
- version: "3.67.1",
1427342
+ version: "3.68.0",
1427343
1427343
  ...event,
1427344
1427344
  ...event.properties,
1427345
1427345
  usingAccessToken: false,
@@ -1483554,6 +1483554,9 @@ var Language4 = schemas_exports8.enum_([
1483554
1483554
  "tr"
1483555
1483555
  ]);
1483556
1483556
 
1483557
+ // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TitleSource.js
1483558
+ var TitleSource2 = schemas_exports8.enum_(["frontmatter", "filename"]);
1483559
+
1483557
1483560
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/DocsSettingsConfig.js
1483558
1483561
  var DocsSettingsConfig = schemas_exports8.object({
1483559
1483562
  searchText: schemas_exports8.property("search-text", schemas_exports8.string().optional()),
@@ -1483566,6 +1483569,7 @@ var DocsSettingsConfig = schemas_exports8.object({
1483566
1483569
  disableExplorerProxy: schemas_exports8.property("disable-explorer-proxy", schemas_exports8.boolean().optional()),
1483567
1483570
  disableAnalytics: schemas_exports8.property("disable-analytics", schemas_exports8.boolean().optional()),
1483568
1483571
  language: Language4.optional(),
1483572
+ folderTitleSource: schemas_exports8.property("folder-title-source", TitleSource2.optional()),
1483569
1483573
  substituteEnvVars: schemas_exports8.property("substitute-env-vars", schemas_exports8.boolean().optional())
1483570
1483574
  });
1483571
1483575
 
@@ -1483982,9 +1483986,6 @@ var DocsConfiguration = schemas_exports8.object({
1483982
1483986
  footer: schemas_exports8.string().optional()
1483983
1483987
  });
1483984
1483988
 
1483985
- // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TitleSource.js
1483986
- var TitleSource2 = schemas_exports8.enum_(["frontmatter", "filename"]);
1483987
-
1483988
1483989
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/FolderConfiguration.js
1483989
1483990
  var FolderConfiguration = schemas_exports8.object({
1483990
1483991
  folder: schemas_exports8.string(),
@@ -1509002,6 +1509003,7 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
1509002
1509003
  experimental
1509003
1509004
  } = rawDocsConfiguration;
1509004
1509005
  const landingPage = parsePageConfig(rawDocsConfiguration.landingPage, absoluteFilepathToDocsConfig);
1509006
+ const folderTitleSource = rawDocsConfiguration.settings?.folderTitleSource;
1509005
1509007
  const convertedNavigationPromise = getNavigationConfiguration({
1509006
1509008
  tabs,
1509007
1509009
  products,
@@ -1509009,7 +1509011,8 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
1509009
1509011
  navigation: rawNavigation,
1509010
1509012
  absolutePathToFernFolder,
1509011
1509013
  absolutePathToConfig: absoluteFilepathToDocsConfig,
1509012
- context: context2
1509014
+ context: context2,
1509015
+ folderTitleSource
1509013
1509016
  });
1509014
1509017
  const pagesPromise = convertedNavigationPromise.then((convertedNavigation) => loadAllPages({
1509015
1509018
  files: getAllPages({ navigation: convertedNavigation, landingPage }),
@@ -1509290,7 +1509293,7 @@ function parseSizeConfig(sizeAsString) {
1509290
1509293
  }
1509291
1509294
  return void 0;
1509292
1509295
  }
1509293
- async function getVersionedNavigationConfiguration({ versions, absolutePathToFernFolder, context: context2 }) {
1509296
+ async function getVersionedNavigationConfiguration({ versions, absolutePathToFernFolder, context: context2, folderTitleSource }) {
1509294
1509297
  const versionedNavbars = [];
1509295
1509298
  for (const version7 of versions) {
1509296
1509299
  const absoluteFilepathToVersionFile = resolve5(absolutePathToFernFolder, version7.path);
@@ -1509306,7 +1509309,8 @@ async function getVersionedNavigationConfiguration({ versions, absolutePathToFer
1509306
1509309
  rawNavigationConfig: versionResult.navigation,
1509307
1509310
  absolutePathToFernFolder,
1509308
1509311
  absolutePathToConfig: absoluteFilepathToVersionFile,
1509309
- context: context2
1509312
+ context: context2,
1509313
+ folderTitleSource
1509310
1509314
  });
1509311
1509315
  versionedNavbars.push({
1509312
1509316
  landingPage: parsePageConfig(versionResult.landingPage, absoluteFilepathToVersionFile),
@@ -1509326,14 +1509330,15 @@ async function getVersionedNavigationConfiguration({ versions, absolutePathToFer
1509326
1509330
  versions: versionedNavbars
1509327
1509331
  };
1509328
1509332
  }
1509329
- async function getNavigationConfiguration({ tabs, products, versions, navigation, absolutePathToFernFolder, absolutePathToConfig, context: context2 }) {
1509333
+ async function getNavigationConfiguration({ tabs, products, versions, navigation, absolutePathToFernFolder, absolutePathToConfig, context: context2, folderTitleSource }) {
1509330
1509334
  if (navigation != null) {
1509331
1509335
  return await convertNavigationConfiguration({
1509332
1509336
  tabs,
1509333
1509337
  rawNavigationConfig: navigation,
1509334
1509338
  absolutePathToFernFolder,
1509335
1509339
  absolutePathToConfig,
1509336
- context: context2
1509340
+ context: context2,
1509341
+ folderTitleSource
1509337
1509342
  });
1509338
1509343
  } else if (products != null) {
1509339
1509344
  const productNavbars = [];
@@ -1509353,7 +1509358,8 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
1509353
1509358
  navigation2 = await getVersionedNavigationConfiguration({
1509354
1509359
  versions: product.versions,
1509355
1509360
  absolutePathToFernFolder,
1509356
- context: context2
1509361
+ context: context2,
1509362
+ folderTitleSource
1509357
1509363
  });
1509358
1509364
  } else {
1509359
1509365
  navigation2 = await convertNavigationConfiguration({
@@ -1509361,7 +1509367,8 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
1509361
1509367
  rawNavigationConfig: result.navigation,
1509362
1509368
  absolutePathToFernFolder,
1509363
1509369
  absolutePathToConfig: absoluteFilepathToProductFile,
1509364
- context: context2
1509370
+ context: context2,
1509371
+ folderTitleSource
1509365
1509372
  });
1509366
1509373
  }
1509367
1509374
  productNavbars.push({
@@ -1509400,7 +1509407,12 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
1509400
1509407
  products: productNavbars
1509401
1509408
  };
1509402
1509409
  } else if (versions != null) {
1509403
- return await getVersionedNavigationConfiguration({ versions, absolutePathToFernFolder, context: context2 });
1509410
+ return await getVersionedNavigationConfiguration({
1509411
+ versions,
1509412
+ absolutePathToFernFolder,
1509413
+ context: context2,
1509414
+ folderTitleSource
1509415
+ });
1509404
1509416
  }
1509405
1509417
  throw new Error("Unexpected. Docs have neither navigation or versions defined.");
1509406
1509418
  }
@@ -1509497,7 +1509509,7 @@ function parseWeight(weight) {
1509497
1509509
  const weights = weight.split(/\D+/).filter((item) => item !== "" && ["100", "200", "300", "400", "500", "600", "700", "800", "900"].includes(item));
1509498
1509510
  return weights;
1509499
1509511
  }
1509500
- async function convertNavigationTabConfiguration({ tabs, item, absolutePathToFernFolder, absolutePathToConfig, context: context2 }) {
1509512
+ async function convertNavigationTabConfiguration({ tabs, item, absolutePathToFernFolder, absolutePathToConfig, context: context2, folderTitleSource }) {
1509501
1509513
  const tab2 = tabs[item.tab];
1509502
1509514
  if (tab2 == null) {
1509503
1509515
  throw new Error(`Tab ${item.tab} is not defined in the tabs config.`);
@@ -1509508,7 +1509520,8 @@ async function convertNavigationTabConfiguration({ tabs, item, absolutePathToFer
1509508
1509520
  rawConfig: layoutItem,
1509509
1509521
  absolutePathToFernFolder,
1509510
1509522
  absolutePathToConfig,
1509511
- context: context2
1509523
+ context: context2,
1509524
+ folderTitleSource
1509512
1509525
  })));
1509513
1509526
  return {
1509514
1509527
  title: variant.title,
@@ -1509540,7 +1509553,13 @@ async function convertNavigationTabConfiguration({ tabs, item, absolutePathToFer
1509540
1509553
  };
1509541
1509554
  }
1509542
1509555
  if (tabbedNavigationItemHasLayout(item)) {
1509543
- const layout = await Promise.all(item.layout.map((item2) => convertNavigationItem({ rawConfig: item2, absolutePathToFernFolder, absolutePathToConfig, context: context2 })));
1509556
+ const layout = await Promise.all(item.layout.map((item2) => convertNavigationItem({
1509557
+ rawConfig: item2,
1509558
+ absolutePathToFernFolder,
1509559
+ absolutePathToConfig,
1509560
+ context: context2,
1509561
+ folderTitleSource
1509562
+ })));
1509544
1509563
  return {
1509545
1509564
  title: tab2.displayName,
1509546
1509565
  icon: resolveIconPath(tab2.icon, absolutePathToConfig),
@@ -1509591,14 +1509610,15 @@ async function convertNavigationTabConfiguration({ tabs, item, absolutePathToFer
1509591
1509610
  }
1509592
1509611
  assertNever2(tab2);
1509593
1509612
  }
1509594
- async function convertNavigationConfiguration({ tabs = {}, rawNavigationConfig, absolutePathToFernFolder, absolutePathToConfig, context: context2 }) {
1509613
+ async function convertNavigationConfiguration({ tabs = {}, rawNavigationConfig, absolutePathToFernFolder, absolutePathToConfig, context: context2, folderTitleSource }) {
1509595
1509614
  if (isTabbedNavigationConfig4(rawNavigationConfig)) {
1509596
1509615
  const tabbedNavigationItems = await Promise.all(rawNavigationConfig.map((item) => convertNavigationTabConfiguration({
1509597
1509616
  tabs,
1509598
1509617
  item,
1509599
1509618
  absolutePathToFernFolder,
1509600
1509619
  absolutePathToConfig,
1509601
- context: context2
1509620
+ context: context2,
1509621
+ folderTitleSource
1509602
1509622
  })));
1509603
1509623
  return {
1509604
1509624
  type: "tabbed",
@@ -1509607,24 +1509627,31 @@ async function convertNavigationConfiguration({ tabs = {}, rawNavigationConfig,
1509607
1509627
  } else {
1509608
1509628
  return {
1509609
1509629
  type: "untabbed",
1509610
- items: await Promise.all(rawNavigationConfig.map((item) => convertNavigationItem({ rawConfig: item, absolutePathToFernFolder, absolutePathToConfig, context: context2 })))
1509630
+ items: await Promise.all(rawNavigationConfig.map((item) => convertNavigationItem({
1509631
+ rawConfig: item,
1509632
+ absolutePathToFernFolder,
1509633
+ absolutePathToConfig,
1509634
+ context: context2,
1509635
+ folderTitleSource
1509636
+ })))
1509611
1509637
  };
1509612
1509638
  }
1509613
1509639
  }
1509614
1509640
  var DEFAULT_CHANGELOG_TITLE = "Changelog";
1509615
- async function expandFolderConfiguration({ rawConfig, absolutePathToFernFolder, absolutePathToConfig, context: context2 }) {
1509641
+ async function expandFolderConfiguration({ rawConfig, absolutePathToFernFolder, absolutePathToConfig, context: context2, folderTitleSource }) {
1509616
1509642
  const folderPath = resolveFilepath(rawConfig.folder, absolutePathToConfig);
1509617
1509643
  if (!await doesPathExist(folderPath)) {
1509618
1509644
  context2.failAndThrow(`Folder not found: ${rawConfig.folder}`);
1509619
1509645
  }
1509646
+ const effectiveTitleSource = rawConfig.titleSource ?? folderTitleSource;
1509620
1509647
  const contents = await buildNavigationForDirectory({
1509621
1509648
  directoryPath: folderPath,
1509622
- titleSource: rawConfig.titleSource
1509649
+ titleSource: effectiveTitleSource
1509623
1509650
  });
1509624
1509651
  const indexPage = contents.find((item) => item.type === "page" && (item.slug === "index" || item.absolutePath.toLowerCase().endsWith("/index.mdx") || item.absolutePath.toLowerCase().endsWith("/index.md")));
1509625
1509652
  const filteredContents = indexPage ? contents.filter((item) => item !== indexPage) : contents;
1509626
1509653
  const folderName = import_path20.default.basename(folderPath);
1509627
- const indexFrontmatterTitle = rawConfig.titleSource === "frontmatter" && indexPage?.type === "page" ? await getFrontmatterTitle({ absolutePath: indexPage.absolutePath }) : void 0;
1509654
+ const indexFrontmatterTitle = effectiveTitleSource === "frontmatter" && indexPage?.type === "page" ? await getFrontmatterTitle({ absolutePath: indexPage.absolutePath }) : void 0;
1509628
1509655
  const title4 = rawConfig.title ?? indexFrontmatterTitle ?? nameToTitle({ name: folderName });
1509629
1509656
  const slug = rawConfig.slug ?? nameToSlug({ name: folderName });
1509630
1509657
  return {
@@ -1509643,7 +1509670,7 @@ async function expandFolderConfiguration({ rawConfig, absolutePathToFernFolder,
1509643
1509670
  availability: rawConfig.availability
1509644
1509671
  };
1509645
1509672
  }
1509646
- async function convertNavigationItem({ rawConfig, absolutePathToFernFolder, absolutePathToConfig, context: context2 }) {
1509673
+ async function convertNavigationItem({ rawConfig, absolutePathToFernFolder, absolutePathToConfig, context: context2, folderTitleSource }) {
1509647
1509674
  if (isRawPageConfig(rawConfig)) {
1509648
1509675
  return parsePageConfig(rawConfig, absolutePathToConfig);
1509649
1509676
  }
@@ -1509652,7 +1509679,13 @@ async function convertNavigationItem({ rawConfig, absolutePathToFernFolder, abso
1509652
1509679
  type: "section",
1509653
1509680
  title: rawConfig.section,
1509654
1509681
  icon: resolveIconPath(rawConfig.icon, absolutePathToConfig),
1509655
- contents: await Promise.all(rawConfig.contents.map((item) => convertNavigationItem({ rawConfig: item, absolutePathToFernFolder, absolutePathToConfig, context: context2 }))),
1509682
+ contents: await Promise.all(rawConfig.contents.map((item) => convertNavigationItem({
1509683
+ rawConfig: item,
1509684
+ absolutePathToFernFolder,
1509685
+ absolutePathToConfig,
1509686
+ context: context2,
1509687
+ folderTitleSource
1509688
+ }))),
1509656
1509689
  slug: rawConfig.slug ?? void 0,
1509657
1509690
  collapsed: rawConfig.collapsed ?? void 0,
1509658
1509691
  hidden: rawConfig.hidden ?? void 0,
@@ -1509719,7 +1509752,8 @@ async function convertNavigationItem({ rawConfig, absolutePathToFernFolder, abso
1509719
1509752
  rawConfig,
1509720
1509753
  absolutePathToFernFolder,
1509721
1509754
  absolutePathToConfig,
1509722
- context: context2
1509755
+ context: context2,
1509756
+ folderTitleSource
1509723
1509757
  });
1509724
1509758
  }
1509725
1509759
  if (isRawPythonDocsSectionConfig(rawConfig)) {
@@ -1624937,6 +1624971,16 @@ var definitions4 = {
1624937
1624971
  }
1624938
1624972
  ]
1624939
1624973
  },
1624974
+ "folder-title-source": {
1624975
+ oneOf: [
1624976
+ {
1624977
+ $ref: "#/definitions/docs.TitleSource"
1624978
+ },
1624979
+ {
1624980
+ type: "null"
1624981
+ }
1624982
+ ]
1624983
+ },
1624940
1624984
  "substitute-env-vars": {
1624941
1624985
  oneOf: [
1624942
1624986
  {
@@ -1714270,7 +1714314,7 @@ var CliContext = class {
1714270
1714314
  if (false) {
1714271
1714315
  this.logger.error("CLI_VERSION is not defined");
1714272
1714316
  }
1714273
- return "3.67.1";
1714317
+ return "3.68.0";
1714274
1714318
  }
1714275
1714319
  getCliName() {
1714276
1714320
  if (false) {
@@ -1717390,7 +1717434,7 @@ var import_path56 = __toESM(require("path"), 1);
1717390
1717434
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1717391
1717435
  var LOGS_FOLDER_NAME = "logs";
1717392
1717436
  function getCliSource() {
1717393
- const version7 = "3.67.1";
1717437
+ const version7 = "3.68.0";
1717394
1717438
  return `cli@${version7}`;
1717395
1717439
  }
1717396
1717440
  var DebugLogger = class {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.67.1",
2
+ "version": "3.68.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",