@fern-api/fern-api-dev 5.7.10 → 5.8.0-3-g7ca2bd1df31

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 +220 -13
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -511686,7 +511686,8 @@ var CheckRulesConfig = external_exports.object({
511686
511686
  "valid-local-references": CheckRuleSeverity.optional(),
511687
511687
  "no-circular-redirects": CheckRuleSeverity.optional(),
511688
511688
  "valid-docs-endpoints": CheckRuleSeverity.optional(),
511689
- "missing-redirects": CheckRuleSeverity.optional()
511689
+ "missing-redirects": CheckRuleSeverity.optional(),
511690
+ "valid-changelog-slug": CheckRuleSeverity.optional()
511690
511691
  });
511691
511692
  var CheckConfig = external_exports.object({
511692
511693
  rules: CheckRulesConfig.optional()
@@ -514329,7 +514330,8 @@ var AgentsConfig2 = schemas_exports6.object({
514329
514330
  pageDirective: schemas_exports6.property("page-directive", schemas_exports6.string().optional()),
514330
514331
  pageDescriptionSource: schemas_exports6.property("page-description-source", PageDescriptionSource3.optional()),
514331
514332
  llmsTxt: schemas_exports6.property("llms-txt", schemas_exports6.string().optional()),
514332
- llmsFullTxt: schemas_exports6.property("llms-full-txt", schemas_exports6.string().optional())
514333
+ llmsFullTxt: schemas_exports6.property("llms-full-txt", schemas_exports6.string().optional()),
514334
+ robotsTxt: schemas_exports6.property("robots-txt", schemas_exports6.string().optional())
514333
514335
  });
514334
514336
 
514335
514337
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/AiChatWebsiteDatasource.js
@@ -514648,7 +514650,8 @@ var CheckRulesConfig2 = schemas_exports6.object({
514648
514650
  validLocalReferences: schemas_exports6.property("valid-local-references", CheckRuleSeverity3.optional()),
514649
514651
  noCircularRedirects: schemas_exports6.property("no-circular-redirects", CheckRuleSeverity3.optional()),
514650
514652
  validDocsEndpoints: schemas_exports6.property("valid-docs-endpoints", CheckRuleSeverity3.optional()),
514651
- missingRedirects: schemas_exports6.property("missing-redirects", CheckRuleSeverity3.optional())
514653
+ missingRedirects: schemas_exports6.property("missing-redirects", CheckRuleSeverity3.optional()),
514654
+ validChangelogSlug: schemas_exports6.property("valid-changelog-slug", CheckRuleSeverity3.optional())
514652
514655
  });
514653
514656
 
514654
514657
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/CheckConfig.js
@@ -543151,6 +543154,10 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
543151
543154
  rawPath: agents?.llmsFullTxt,
543152
543155
  absoluteFilepathToDocsConfig
543153
543156
  });
543157
+ const robotsTxtFilePromise = parseTextFile({
543158
+ rawPath: agents?.robotsTxt,
543159
+ absoluteFilepathToDocsConfig
543160
+ });
543154
543161
  const defaultLocale = rawDocsConfiguration.translations?.map((t3) => docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(t3)).find((t3) => t3.default === true)?.lang ?? (rawDocsConfiguration.translations?.[0] != null ? docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(rawDocsConfiguration.translations[0]).lang : void 0);
543155
543162
  const translationPagesPromise = pagesPromise.then((resolvedPages) => loadTranslationPages({
543156
543163
  translations: rawDocsConfiguration.translations,
@@ -543165,7 +543172,7 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
543165
543172
  absolutePathToFernFolder,
543166
543173
  context: context3
543167
543174
  });
543168
- const [navigation2, pages, typography, css, js7, metadata, context7File, llmsTxtFile, llmsFullTxtFile, translationPages, translationNavigationOverlays] = await Promise.all([
543175
+ const [navigation2, pages, typography, css, js7, metadata, context7File, llmsTxtFile, llmsFullTxtFile, robotsTxtFile, translationPages, translationNavigationOverlays] = await Promise.all([
543169
543176
  convertedNavigationPromise,
543170
543177
  pagesPromise,
543171
543178
  typographyPromise,
@@ -543175,6 +543182,7 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
543175
543182
  context7FilePromise,
543176
543183
  llmsTxtFilePromise,
543177
543184
  llmsFullTxtFilePromise,
543185
+ robotsTxtFilePromise,
543178
543186
  translationPagesPromise,
543179
543187
  translationNavigationOverlaysPromise
543180
543188
  ]);
@@ -543224,6 +543232,7 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
543224
543232
  context7File,
543225
543233
  llmsTxtFile,
543226
543234
  llmsFullTxtFile,
543235
+ robotsTxtFile,
543227
543236
  theme: resolvedTheme,
543228
543237
  globalTheme: rawDocsConfiguration.globalTheme,
543229
543238
  analyticsConfig: {
@@ -622577,7 +622586,7 @@ var AccessTokenPosthogManager = class {
622577
622586
  properties: {
622578
622587
  ...event,
622579
622588
  ...event.properties,
622580
- version: "5.7.10",
622589
+ version: "5.8.0-3-g7ca2bd1df31",
622581
622590
  usingAccessToken: true
622582
622591
  }
622583
622592
  });
@@ -622631,7 +622640,7 @@ var UserPosthogManager = class {
622631
622640
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622632
622641
  event: "CLI",
622633
622642
  properties: {
622634
- version: "5.7.10",
622643
+ version: "5.8.0-3-g7ca2bd1df31",
622635
622644
  ...event,
622636
622645
  ...event.properties,
622637
622646
  usingAccessToken: false,
@@ -812577,6 +812586,9 @@ async function collectFilesFromDocsConfig({ parsedDocsConfig }) {
812577
812586
  if (parsedDocsConfig.llmsFullTxtFile != null) {
812578
812587
  filepaths.add(parsedDocsConfig.llmsFullTxtFile);
812579
812588
  }
812589
+ if (parsedDocsConfig.robotsTxtFile != null) {
812590
+ filepaths.add(parsedDocsConfig.robotsTxtFile);
812591
+ }
812580
812592
  if (parsedDocsConfig.pageActions?.options?.custom != null) {
812581
812593
  await Promise.all(parsedDocsConfig.pageActions.options.custom.map(async (customAction) => {
812582
812594
  if (customAction.icon != null) {
@@ -813486,10 +813498,11 @@ var DocsDefinitionResolver = class {
813486
813498
  settings: this.parsedDocsConfig.settings,
813487
813499
  css: this.parsedDocsConfig.css,
813488
813500
  js: this.convertJavascriptConfiguration(),
813489
- agents: this.parsedDocsConfig.agents != null || this.parsedDocsConfig.llmsTxtFile != null || this.parsedDocsConfig.llmsFullTxtFile != null ? {
813501
+ agents: this.parsedDocsConfig.agents != null || this.parsedDocsConfig.llmsTxtFile != null || this.parsedDocsConfig.llmsFullTxtFile != null || this.parsedDocsConfig.robotsTxtFile != null ? {
813490
813502
  ...this.parsedDocsConfig.agents,
813491
813503
  llmsTxt: this.getFileId(this.parsedDocsConfig.llmsTxtFile),
813492
- llmsFullTxt: this.getFileId(this.parsedDocsConfig.llmsFullTxtFile)
813504
+ llmsFullTxt: this.getFileId(this.parsedDocsConfig.llmsFullTxtFile),
813505
+ robotsTxt: this.getFileId(this.parsedDocsConfig.robotsTxtFile)
813493
813506
  } : void 0,
813494
813507
  metadata: this.convertMetadata(),
813495
813508
  redirects: this.parsedDocsConfig.redirects,
@@ -819510,6 +819523,15 @@ async function visitDocsConfigFileYamlAst({ contents, visitor, absoluteFilepathT
819510
819523
  willBeUploaded: true
819511
819524
  });
819512
819525
  }
819526
+ if (agents?.robotsTxt != null) {
819527
+ await visitFilepath({
819528
+ absoluteFilepathToConfiguration,
819529
+ rawUnresolvedFilepath: agents.robotsTxt,
819530
+ visitor,
819531
+ nodePath: ["agents", "robots-txt"],
819532
+ willBeUploaded: true
819533
+ });
819534
+ }
819513
819535
  if (agents?.llmsFullTxt != null) {
819514
819536
  await visitFilepath({
819515
819537
  absoluteFilepathToConfiguration,
@@ -819734,12 +819756,14 @@ var rules_exports = {};
819734
819756
  __export(rules_exports, {
819735
819757
  AccentColorContrastRule: () => AccentColorContrastRule,
819736
819758
  AllRolesMustBeDeclaredRule: () => AllRolesMustBeDeclaredRule,
819759
+ CHANGELOG_FEED_ALLOWED_SLUGS: () => CHANGELOG_FEED_ALLOWED_SLUGS,
819737
819760
  FilepathsExistRule: () => FilepathsExistRule,
819738
819761
  MissingRedirectsRule: () => MissingRedirectsRule,
819739
819762
  NoCircularRedirectsRule: () => NoCircularRedirectsRule,
819740
819763
  OnlyVersionedNavigation: () => OnlyVersionedNavigation,
819741
819764
  TabWithHrefRule: () => TabWithHrefRule,
819742
819765
  TranslationDirectoriesExistRule: () => TranslationDirectoriesExistRule,
819766
+ ValidChangelogSlugRule: () => ValidChangelogSlugRule,
819743
819767
  ValidDocsEndpoints: () => ValidDocsEndpoints,
819744
819768
  ValidFileTypes: () => ValidFileTypes,
819745
819769
  ValidFrontmatter: () => ValidFrontmatter,
@@ -819750,6 +819774,8 @@ __export(rules_exports, {
819750
819774
  ValidateProductFileRule: () => ValidateProductFileRule,
819751
819775
  ValidateVersionFileRule: () => ValidateVersionFileRule,
819752
819776
  enforceBackgroundTheme: () => enforceBackgroundTheme,
819777
+ getEffectiveChangelogSlugLastSegment: () => getEffectiveChangelogSlugLastSegment,
819778
+ isAllowedChangelogSlug: () => isAllowedChangelogSlug,
819753
819779
  validateTheme: () => validateTheme
819754
819780
  });
819755
819781
 
@@ -820776,6 +820802,148 @@ function buildExpectedDirectoryTree({ translationsDirExists, missingDirs, fernFo
820776
820802
  return lines.join("\n");
820777
820803
  }
820778
820804
 
820805
+ // ../yaml/docs-validator/lib/rules/valid-changelog-slug/valid-changelog-slug.js
820806
+ init_lodash();
820807
+ var CHANGELOG_FEED_ALLOWED_SLUGS = [
820808
+ "changelog",
820809
+ "changelogs",
820810
+ "release-notes",
820811
+ "releasenotes",
820812
+ "whats-new",
820813
+ "whatsnew"
820814
+ ];
820815
+ var DEFAULT_CHANGELOG_TITLE3 = "Changelog";
820816
+ function getEffectiveChangelogSlugLastSegment(config5) {
820817
+ const raw = config5.slug ?? kebabCase_default(config5.title ?? DEFAULT_CHANGELOG_TITLE3);
820818
+ const segments = raw.split("/").filter((s9) => s9.length > 0);
820819
+ return segments[segments.length - 1] ?? "";
820820
+ }
820821
+ function isAllowedChangelogSlug(lastSegment) {
820822
+ return CHANGELOG_FEED_ALLOWED_SLUGS.includes(lastSegment);
820823
+ }
820824
+ function collectChangelogLocations(items, breadcrumb) {
820825
+ if (items == null) {
820826
+ return [];
820827
+ }
820828
+ const out = [];
820829
+ for (const item of items) {
820830
+ if (isChangelog(item)) {
820831
+ out.push({
820832
+ where: `${breadcrumb} > changelog (${item.changelog})`,
820833
+ slug: item.slug,
820834
+ title: item.title
820835
+ });
820836
+ continue;
820837
+ }
820838
+ if (isSection3(item)) {
820839
+ const next2 = `${breadcrumb} > section "${item.section}"`;
820840
+ out.push(...collectChangelogLocations(item.contents, next2));
820841
+ }
820842
+ }
820843
+ return out;
820844
+ }
820845
+ function collectFromTabs(tabs, breadcrumb) {
820846
+ if (tabs == null) {
820847
+ return [];
820848
+ }
820849
+ const out = [];
820850
+ for (const [tabId, tab2] of Object.entries(tabs)) {
820851
+ if (tab2.changelog != null) {
820852
+ out.push({
820853
+ where: `${breadcrumb} > tab "${tabId}" (changelog: ${tab2.changelog})`,
820854
+ slug: tab2.slug,
820855
+ title: tab2.displayName
820856
+ });
820857
+ }
820858
+ }
820859
+ return out;
820860
+ }
820861
+ function collectFromNavigation(navigation2, breadcrumb) {
820862
+ if (navigation2 == null || !Array.isArray(navigation2) || navigation2.length === 0) {
820863
+ return [];
820864
+ }
820865
+ if (isTabbedNavigation(navigation2)) {
820866
+ const out = [];
820867
+ for (const item of navigation2) {
820868
+ const next2 = `${breadcrumb} > tab "${item.tab}"`;
820869
+ if ("layout" in item && Array.isArray(item.layout)) {
820870
+ out.push(...collectChangelogLocations(item.layout, next2));
820871
+ }
820872
+ if ("variants" in item && Array.isArray(item.variants)) {
820873
+ for (const variant of item.variants) {
820874
+ const variantBreadcrumb = `${next2} > variant "${variant.title}"`;
820875
+ out.push(...collectChangelogLocations(variant.layout, variantBreadcrumb));
820876
+ }
820877
+ }
820878
+ }
820879
+ return out;
820880
+ }
820881
+ return collectChangelogLocations(navigation2, breadcrumb);
820882
+ }
820883
+ function violationsForLocations(locations) {
820884
+ const violations = [];
820885
+ for (const loc of locations) {
820886
+ const lastSegment = getEffectiveChangelogSlugLastSegment(loc);
820887
+ if (lastSegment === "" || isAllowedChangelogSlug(lastSegment)) {
820888
+ continue;
820889
+ }
820890
+ const allowed = CHANGELOG_FEED_ALLOWED_SLUGS.join(", ");
820891
+ const sourceField = loc.slug != null ? `slug: "${loc.slug}"` : `title: "${loc.title ?? DEFAULT_CHANGELOG_TITLE3}"`;
820892
+ violations.push({
820893
+ severity: "error",
820894
+ message: `Changelog at ${loc.where} resolves to URL segment "${lastSegment}" (from ${sourceField}). The docs server only serves changelog feeds (.rss, .atom, .json) when the final URL segment is one of: ${allowed}. Rename the changelog's title or set an explicit slug to one of these values, otherwise subscribers will get a 404 when they request the feed.`
820895
+ });
820896
+ }
820897
+ return violations;
820898
+ }
820899
+ var ValidChangelogSlugRule = {
820900
+ name: "valid-changelog-slug",
820901
+ create: () => {
820902
+ return {
820903
+ file: async ({ config: config5 }) => {
820904
+ const locations = [
820905
+ ...collectFromNavigation(config5.navigation, "navigation"),
820906
+ ...collectFromTabs(config5.tabs, "tabs")
820907
+ ];
820908
+ return violationsForLocations(locations);
820909
+ },
820910
+ versionFile: async ({ path: path106, content: content5 }) => {
820911
+ const parseResult = await validateVersionConfigFileSchema({ value: content5 });
820912
+ if (parseResult.type !== "success") {
820913
+ return [];
820914
+ }
820915
+ const versionConfig = parseResult.contents;
820916
+ const locations = [
820917
+ ...collectFromNavigation(versionConfig.navigation, `version "${path106}" navigation`),
820918
+ ...collectFromTabs(versionConfig.tabs, `version "${path106}" tabs`)
820919
+ ];
820920
+ return violationsForLocations(locations);
820921
+ },
820922
+ productFile: async ({ path: path106, content: content5 }) => {
820923
+ const parseResult = await validateProductConfigFileSchema({ value: content5 });
820924
+ if (parseResult.type !== "success") {
820925
+ return [];
820926
+ }
820927
+ const productConfig = parseResult.contents;
820928
+ const locations = [
820929
+ ...collectFromNavigation(productConfig.navigation, `product "${path106}" navigation`),
820930
+ ...collectFromTabs(productConfig.tabs, `product "${path106}" tabs`)
820931
+ ];
820932
+ return violationsForLocations(locations);
820933
+ }
820934
+ };
820935
+ }
820936
+ };
820937
+ function isChangelog(item) {
820938
+ return item?.changelog != null;
820939
+ }
820940
+ function isSection3(item) {
820941
+ return item?.section != null;
820942
+ }
820943
+ function isTabbedNavigation(navigation2) {
820944
+ return Array.isArray(navigation2) && navigation2.length > 0 && navigation2[0]?.tab != null;
820945
+ }
820946
+
820779
820947
  // ../yaml/docs-validator/lib/rules/valid-docs-endpoints/valid-docs-endpoints.js
820780
820948
  var ValidDocsEndpoints = {
820781
820949
  name: "valid-docs-endpoints",
@@ -843255,7 +843423,8 @@ var allRules = [
843255
843423
  ValidDocsEndpoints,
843256
843424
  AllRolesMustBeDeclaredRule,
843257
843425
  ValidFrontmatter,
843258
- TranslationDirectoriesExistRule
843426
+ TranslationDirectoriesExistRule,
843427
+ ValidChangelogSlugRule
843259
843428
  // ValidMarkdownFileReferences
843260
843429
  ];
843261
843430
  function getAllRules3(exclusions) {
@@ -843284,7 +843453,8 @@ var CHECK_RULE_CONFIG_TO_RULE_NAME = {
843284
843453
  validLocalReferences: ValidLocalReferencesRule.name,
843285
843454
  noCircularRedirects: NoCircularRedirectsRule.name,
843286
843455
  validDocsEndpoints: ValidDocsEndpoints.name,
843287
- missingRedirects: MissingRedirectsRule.name
843456
+ missingRedirects: MissingRedirectsRule.name,
843457
+ validChangelogSlug: ValidChangelogSlugRule.name
843288
843458
  };
843289
843459
  function buildSeverityOverrides(checkConfig) {
843290
843460
  const severityOverrides = /* @__PURE__ */ new Map();
@@ -847364,7 +847534,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
847364
847534
  var LOGS_FOLDER_NAME = "logs";
847365
847535
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
847366
847536
  function getCliSource() {
847367
- const version7 = "5.7.10";
847537
+ const version7 = "5.8.0-3-g7ca2bd1df31";
847368
847538
  return `cli@${version7}`;
847369
847539
  }
847370
847540
  var DebugLogger = class {
@@ -855740,6 +855910,16 @@ var definitions6 = {
855740
855910
  type: "null"
855741
855911
  }
855742
855912
  ]
855913
+ },
855914
+ "robots-txt": {
855915
+ oneOf: [
855916
+ {
855917
+ type: "string"
855918
+ },
855919
+ {
855920
+ type: "null"
855921
+ }
855922
+ ]
855743
855923
  }
855744
855924
  },
855745
855925
  additionalProperties: false
@@ -856141,6 +856321,16 @@ var definitions6 = {
856141
856321
  type: "null"
856142
856322
  }
856143
856323
  ]
856324
+ },
856325
+ "valid-changelog-slug": {
856326
+ oneOf: [
856327
+ {
856328
+ $ref: "#/definitions/docs.CheckRuleSeverity"
856329
+ },
856330
+ {
856331
+ type: "null"
856332
+ }
856333
+ ]
856144
856334
  }
856145
856335
  },
856146
856336
  additionalProperties: false
@@ -857596,6 +857786,12 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
857596
857786
  if (rawError?.content?.reason === "status-code" && rawError.content.statusCode === 429) {
857597
857787
  throw new TooManyRequestsError();
857598
857788
  }
857789
+ const githubAppNotInstalledMessage = extractGithubAppNotInstalledMessage(rawError);
857790
+ if (githubAppNotInstalledMessage != null) {
857791
+ return context3.failAndThrow(githubAppNotInstalledMessage, void 0, {
857792
+ code: CliError.Code.ConfigError
857793
+ });
857794
+ }
857599
857795
  return convertCreateJobError(rawError)._visit({
857600
857796
  illegalApiNameError: () => {
857601
857797
  return context3.failAndThrow("API name is invalid: " + workspace.definition.rootApiFile.contents.name, void 0, { code: CliError.Code.ConfigError });
@@ -857700,6 +857896,17 @@ function extractErrorMessage2(error50) {
857700
857896
  }
857701
857897
  return void 0;
857702
857898
  }
857899
+ function extractGithubAppNotInstalledMessage(error50) {
857900
+ const body = error50?.content?.reason === "status-code" ? error50.content.body : void 0;
857901
+ if (body?.error !== "GithubAppNotInstalled") {
857902
+ return void 0;
857903
+ }
857904
+ if (typeof body?.content?.message === "string") {
857905
+ return body.content.message;
857906
+ }
857907
+ const repo = typeof body?.content?.repositoryName === "string" ? body.content.repositoryName : "the target repository";
857908
+ return `The Fern GitHub App is not installed on ${repo}. Please install it (https://github.com/apps/fern-api) and try again.`;
857909
+ }
857703
857910
  function convertCreateJobError(error50) {
857704
857911
  if (error50?.content?.reason === "status-code") {
857705
857912
  const body = error50.content.body;
@@ -859980,7 +860187,7 @@ var LegacyDocsPublisher = class {
859980
860187
  previewId,
859981
860188
  disableTemplates: void 0,
859982
860189
  skipUpload,
859983
- cliVersion: "5.7.10",
860190
+ cliVersion: "5.8.0-3-g7ca2bd1df31",
859984
860191
  loginCommand: "fern auth login"
859985
860192
  });
859986
860193
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -934422,7 +934629,7 @@ var CliContext = class _CliContext {
934422
934629
  if (false) {
934423
934630
  this.logger.error("CLI_VERSION is not defined");
934424
934631
  }
934425
- return "5.7.10";
934632
+ return "5.8.0-3-g7ca2bd1df31";
934426
934633
  }
934427
934634
  getCliName() {
934428
934635
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.7.10",
2
+ "version": "5.8.0-3-g7ca2bd1df31",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",