fern-api 0.26.7 → 0.26.9-rc0

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/bundle.cjs +29 -67
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -977842,7 +977842,7 @@ var AccessTokenPosthogManager = class {
977842
977842
  properties: {
977843
977843
  ...event,
977844
977844
  ...event.properties,
977845
- version: "0.26.7",
977845
+ version: "0.26.9-rc0",
977846
977846
  usingAccessToken: true
977847
977847
  }
977848
977848
  });
@@ -977904,7 +977904,7 @@ var UserPosthogManager = class {
977904
977904
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
977905
977905
  event: "CLI",
977906
977906
  properties: {
977907
- version: "0.26.7",
977907
+ version: "0.26.9-rc0",
977908
977908
  ...event,
977909
977909
  ...event.properties
977910
977910
  }
@@ -992300,7 +992300,7 @@ function getTitleAsName(title) {
992300
992300
  }
992301
992301
  function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set(), referencedAsRequest = false) {
992302
992302
  var _a5;
992303
- const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? context.shouldUseTitleAsName ? getTitleAsName(schema2.title) : void 0;
992303
+ const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? (context.shouldUseTitleAsName ? getTitleAsName(schema2.title) : void 0);
992304
992304
  const mixedGroupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME) ?? ((_a5 = getExtension(schema2, OpenAPIExtension.TAGS)) == null ? void 0 : _a5[0]);
992305
992305
  const groupName = typeof mixedGroupName === "string" ? [mixedGroupName] : mixedGroupName;
992306
992306
  const generatedName = getGeneratedTypeName(breadcrumbs);
@@ -1002759,10 +1002759,10 @@ var CliContext = class {
1002759
1002759
  return "fern-api";
1002760
1002760
  }
1002761
1002761
  getPackageVersion() {
1002762
- if ("0.26.7" == null) {
1002762
+ if ("0.26.9-rc0" == null) {
1002763
1002763
  this.logger.error("CLI_VERSION is not defined");
1002764
1002764
  }
1002765
- return "0.26.7";
1002765
+ return "0.26.9-rc0";
1002766
1002766
  }
1002767
1002767
  getCliName() {
1002768
1002768
  if ("fern" == null) {
@@ -1053278,6 +1053278,18 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
1053278
1053278
  absolutePathToFernFolder: docsWorkspace.absoluteFilepath,
1053279
1053279
  absoluteFilepathToDocsConfig: docsWorkspace.absoluteFilepathToDocsConfig
1053280
1053280
  });
1053281
+ fernWorkspaces.forEach((workspace) => {
1053282
+ if (workspace.changelog != null) {
1053283
+ workspace.changelog.files.forEach((file) => {
1053284
+ const filename = last_default(file.absoluteFilepath.split("/"));
1053285
+ if (filename == null) {
1053286
+ return;
1053287
+ }
1053288
+ const relativePath = relative(docsWorkspace.absoluteFilepath, file.absoluteFilepath);
1053289
+ parsedDocsConfig.pages[relativePath] = file.contents;
1053290
+ });
1053291
+ }
1053292
+ });
1053281
1053293
  const mdxImageReferences = [];
1053282
1053294
  for (const [relativePath, markdown] of Object.entries(parsedDocsConfig.pages)) {
1053283
1053295
  const { filepaths, markdown: newMarkdown } = parseImagePaths(RelativeFilePath.of(relativePath), markdown);
@@ -1053433,8 +1053445,7 @@ async function constructRegisterDocsRequest({ parsedDocsConfig, organization, fe
1053433
1053445
  markdown: pageContents,
1053434
1053446
  editThisPageUrl: createEditThisPageUrl(editThisPage, pageFilepath)
1053435
1053447
  }
1053436
- }), {}),
1053437
- ...convertedDocsConfiguration.pages
1053448
+ }), {})
1053438
1053449
  };
1053439
1053450
  pages = Object.fromEntries(Object.entries(pages).map(([pageId, pageContent]) => {
1053440
1053451
  var _a5;
@@ -1053507,14 +1053518,10 @@ async function convertDocsConfiguration({ parsedDocsConfig, organization, fernWo
1053507
1053518
  css: parsedDocsConfig.css,
1053508
1053519
  js: convertJavascriptConfiguration(parsedDocsConfig.js, uploadUrls, parsedDocsConfig)
1053509
1053520
  };
1053510
- return {
1053511
- config,
1053512
- pages: convertedNavigation.pages
1053513
- };
1053521
+ return { config };
1053514
1053522
  }
1053515
1053523
  async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
1053516
1053524
  let config;
1053517
- let pages = {};
1053518
1053525
  switch (navigationConfig.type) {
1053519
1053526
  case "untabbed": {
1053520
1053527
  const untabbedItems = await Promise.all(navigationConfig.items.map((item) => convertNavigationItem2({
@@ -1053528,12 +1053535,6 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
1053528
1053535
  fullSlugs,
1053529
1053536
  absolutePathToFernFolder
1053530
1053537
  })));
1053531
- for (const untabbedItem of untabbedItems) {
1053532
- pages = {
1053533
- ...pages,
1053534
- ...untabbedItem.pages
1053535
- };
1053536
- }
1053537
1053538
  config = {
1053538
1053539
  items: untabbedItems.map((item) => item.item)
1053539
1053540
  };
@@ -1053553,7 +1053554,6 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
1053553
1053554
  config = {
1053554
1053555
  tabs: tabbedItem.tabs
1053555
1053556
  };
1053556
- pages = { ...pages, ...tabbedItem.pages };
1053557
1053557
  break;
1053558
1053558
  }
1053559
1053559
  case "versioned":
@@ -1053571,10 +1053571,6 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
1053571
1053571
  fullSlugs,
1053572
1053572
  absolutePathToFernFolder
1053573
1053573
  });
1053574
- pages = {
1053575
- ...pages,
1053576
- ...convertedNavigation.pages
1053577
- };
1053578
1053574
  return {
1053579
1053575
  version: version4.version,
1053580
1053576
  config: convertedNavigation.config,
@@ -1053587,10 +1053583,7 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
1053587
1053583
  default:
1053588
1053584
  assertNever(navigationConfig);
1053589
1053585
  }
1053590
- return {
1053591
- config,
1053592
- pages
1053593
- };
1053586
+ return { config };
1053594
1053587
  }
1053595
1053588
  function convertAvailability2(availability) {
1053596
1053589
  switch (availability) {
@@ -1053608,7 +1053601,6 @@ function convertAvailability2(availability) {
1053608
1053601
  }
1053609
1053602
  async function convertUnversionedNavigationConfig({ navigationConfig, tabs, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
1053610
1053603
  let config;
1053611
- let pages = {};
1053612
1053604
  switch (navigationConfig.type) {
1053613
1053605
  case "untabbed": {
1053614
1053606
  const untabbedItems = await Promise.all(navigationConfig.items.map((item) => convertNavigationItem2({
@@ -1053625,12 +1053617,6 @@ async function convertUnversionedNavigationConfig({ navigationConfig, tabs, pars
1053625
1053617
  config = {
1053626
1053618
  items: untabbedItems.map((item) => item.item)
1053627
1053619
  };
1053628
- for (const untabbedItem of untabbedItems) {
1053629
- pages = {
1053630
- ...pages,
1053631
- ...untabbedItem.pages
1053632
- };
1053633
- }
1053634
1053620
  break;
1053635
1053621
  }
1053636
1053622
  case "tabbed": {
@@ -1053647,19 +1053633,14 @@ async function convertUnversionedNavigationConfig({ navigationConfig, tabs, pars
1053647
1053633
  config = {
1053648
1053634
  tabs: tabbedItem.tabs
1053649
1053635
  };
1053650
- pages = { ...pages, ...tabbedItem.pages };
1053651
1053636
  break;
1053652
1053637
  }
1053653
1053638
  default:
1053654
1053639
  assertNever(navigationConfig);
1053655
1053640
  }
1053656
- return {
1053657
- config,
1053658
- pages
1053659
- };
1053641
+ return { config };
1053660
1053642
  }
1053661
1053643
  async function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
1053662
- let pages = {};
1053663
1053644
  const convertedTabs = await Promise.all(items.map(async (tabbedItem) => {
1053664
1053645
  const tabConfig = tabs == null ? void 0 : tabs[tabbedItem.tab];
1053665
1053646
  if (tabConfig == null) {
@@ -1053689,12 +1053670,6 @@ async function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organiza
1053689
1053670
  fullSlugs,
1053690
1053671
  absolutePathToFernFolder
1053691
1053672
  })));
1053692
- tabbedItems.forEach((tabbedItem2) => {
1053693
- pages = {
1053694
- ...pages,
1053695
- ...tabbedItem2.pages
1053696
- };
1053697
- });
1053698
1053673
  return {
1053699
1053674
  title: tabConfig.displayName,
1053700
1053675
  icon: tabConfig.icon,
@@ -1053702,10 +1053677,7 @@ async function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organiza
1053702
1053677
  urlSlugOverride: tabConfig.slug
1053703
1053678
  };
1053704
1053679
  }));
1053705
- return {
1053706
- tabs: convertedTabs,
1053707
- pages
1053708
- };
1053680
+ return { tabs: convertedTabs };
1053709
1053681
  }
1053710
1053682
  function convertDocsTypographyConfiguration({ typographyConfiguration, parsedDocsConfig, uploadUrls, context, fullSlugs }) {
1053711
1053683
  if (typographyConfiguration == null) {
@@ -1053867,7 +1053839,6 @@ function convertImageReference2({ imageReference: imageReference2, parsedDocsCon
1053867
1053839
  async function convertNavigationItem2({ item, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
1053868
1053840
  var _a5, _b4;
1053869
1053841
  let convertedItem;
1053870
- let pages = {};
1053871
1053842
  switch (item.type) {
1053872
1053843
  case "page": {
1053873
1053844
  convertedItem = {
@@ -1053903,12 +1053874,6 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
1053903
1053874
  hidden: item.hidden,
1053904
1053875
  skipUrlSlug: item.skipUrlSlug
1053905
1053876
  };
1053906
- for (const sectionItem of sectionItems) {
1053907
- pages = {
1053908
- ...pages,
1053909
- ...sectionItem.pages
1053910
- };
1053911
- }
1053912
1053877
  break;
1053913
1053878
  }
1053914
1053879
  case "apiSection": {
@@ -1053928,7 +1053893,7 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
1053928
1053893
  }
1053929
1053894
  })
1053930
1053895
  });
1053931
- const changelogItems = [];
1053896
+ const unsortedChangelogItems = [];
1053932
1053897
  if (workspace.changelog != null) {
1053933
1053898
  for (const file of workspace.changelog.files) {
1053934
1053899
  const filename = last_default(file.absoluteFilepath.split("/"));
@@ -1053940,15 +1053905,13 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
1053940
1053905
  continue;
1053941
1053906
  }
1053942
1053907
  const relativePath = relative(absolutePathToFernFolder, file.absoluteFilepath);
1053943
- pages[relativePath] = {
1053944
- markdown: file.contents
1053945
- };
1053946
- changelogItems.push({
1053947
- date: changelogDate.toISOString(),
1053948
- pageId: relativePath
1053949
- });
1053908
+ unsortedChangelogItems.push({ date: changelogDate, pageId: relativePath });
1053950
1053909
  }
1053951
1053910
  }
1053911
+ const changelogItems = orderBy_default(unsortedChangelogItems, (item2) => item2.date, "desc").map((item2) => ({
1053912
+ date: item2.date.toISOString(),
1053913
+ pageId: item2.pageId
1053914
+ }));
1053952
1053915
  convertedItem = {
1053953
1053916
  type: "api",
1053954
1053917
  title: item.title,
@@ -1053979,8 +1053942,7 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
1053979
1053942
  assertNever(item);
1053980
1053943
  }
1053981
1053944
  return {
1053982
- item: convertedItem,
1053983
- pages
1053945
+ item: convertedItem
1053984
1053946
  };
1053985
1053947
  }
1053986
1053948
  function convertDocsSnippetsConfigurationToFdr({ snippetsConfiguration }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.26.7",
3
+ "version": "0.26.9-rc0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",