@fern-api/fern-api-dev 5.109.0 → 5.109.1

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 +84 -28
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -705213,7 +705213,7 @@ var AccessTokenPosthogManager = class {
705213
705213
  properties: {
705214
705214
  ...event,
705215
705215
  ...event.properties,
705216
- version: "5.109.0",
705216
+ version: "5.109.1",
705217
705217
  usingAccessToken: true,
705218
705218
  ...getRunIdProperties()
705219
705219
  }
@@ -705279,7 +705279,7 @@ var UserPosthogManager = class {
705279
705279
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
705280
705280
  event: "CLI",
705281
705281
  properties: {
705282
- version: "5.109.0",
705282
+ version: "5.109.1",
705283
705283
  ...event,
705284
705284
  ...event.properties,
705285
705285
  usingAccessToken: false,
@@ -881625,9 +881625,54 @@ function createDocsResolverValidationContext() {
881625
881625
  function isV1RootNode2(value2) {
881626
881626
  return "type" in value2 && value2.type === "root";
881627
881627
  }
881628
+ async function getIntermediateRepresentation({ apiWorkspace, ossWorkspaces, useOpenApiParserV3, audiences, logger: logger4 }) {
881629
+ const ossWorkspace = useOpenApiParserV3 ? ossWorkspaces.find((ossWorkspace2) => ossWorkspace2 === apiWorkspace) : void 0;
881630
+ if (ossWorkspace != null) {
881631
+ try {
881632
+ return await ossWorkspace.getIntermediateRepresentation({
881633
+ context: NOOP_CONTEXT,
881634
+ audiences,
881635
+ enableUniqueErrorsPerEndpoint: true,
881636
+ generateV1Examples: false,
881637
+ logWarnings: false
881638
+ });
881639
+ } catch (error50) {
881640
+ logger4.debug(`Failed to load API definition with the OpenAPI parser: ${error50}`);
881641
+ }
881642
+ }
881643
+ try {
881644
+ const fernWorkspace = await apiWorkspace.toFernWorkspace({ context: NOOP_CONTEXT }, {
881645
+ enableUniqueErrorsPerEndpoint: true,
881646
+ detectGlobalHeaders: false,
881647
+ objectQueryParameters: true,
881648
+ preserveSchemaIds: true
881649
+ });
881650
+ return generateIntermediateRepresentation({
881651
+ workspace: fernWorkspace,
881652
+ audiences,
881653
+ generationLanguage: void 0,
881654
+ keywords: void 0,
881655
+ smartCasing: false,
881656
+ exampleGeneration: {
881657
+ disabled: false,
881658
+ skipAutogenerationIfManualExamplesExist: true,
881659
+ skipErrorAutogenerationIfManualErrorExamplesExist: true
881660
+ },
881661
+ readme: void 0,
881662
+ version: void 0,
881663
+ packageName: void 0,
881664
+ context: NOOP_CONTEXT,
881665
+ sourceResolver: new SourceResolverImpl(NOOP_CONTEXT, fernWorkspace)
881666
+ });
881667
+ } catch (error50) {
881668
+ logger4.debug(`Failed to load API definition; skipping link validation for it: ${error50}`);
881669
+ return void 0;
881670
+ }
881671
+ }
881628
881672
  var ValidMarkdownLinks = {
881629
881673
  name: "valid-markdown-links",
881630
- create: async ({ workspace, apiWorkspaces, ossWorkspaces }) => {
881674
+ create: async ({ workspace, apiWorkspaces, ossWorkspaces, logger: logger4 }) => {
881675
+ const useOpenApiParserV3 = workspace.config.experimental?.openapiParserV3 !== false;
881631
881676
  const instanceUrls = getInstanceUrls(workspace);
881632
881677
  const url3 = instanceUrls[0] ?? "http://localhost";
881633
881678
  const baseUrl = toBaseUrl(instanceUrls[0] ?? "http://localhost");
@@ -881737,23 +881782,20 @@ var ValidMarkdownLinks = {
881737
881782
  return [...violations, ...pathToCheckViolations.flat()];
881738
881783
  },
881739
881784
  apiSection: async ({ workspace: apiWorkspace, config: config5 }) => {
881740
- const fernWorkspace = await apiWorkspace.toFernWorkspace({ context: NOOP_CONTEXT }, { enableUniqueErrorsPerEndpoint: true, detectGlobalHeaders: false });
881741
- const ir3 = generateIntermediateRepresentation({
881742
- workspace: fernWorkspace,
881743
- audiences: config5.audiences ? {
881744
- type: "select",
881745
- audiences: Array.isArray(config5.audiences) ? config5.audiences : [config5.audiences]
881746
- } : { type: "all" },
881747
- generationLanguage: void 0,
881748
- keywords: void 0,
881749
- smartCasing: false,
881750
- exampleGeneration: { disabled: false },
881751
- readme: void 0,
881752
- version: void 0,
881753
- packageName: void 0,
881754
- context: NOOP_CONTEXT,
881755
- sourceResolver: new SourceResolverImpl(NOOP_CONTEXT, fernWorkspace)
881785
+ const audiences = config5.audiences ? {
881786
+ type: "select",
881787
+ audiences: Array.isArray(config5.audiences) ? config5.audiences : [config5.audiences]
881788
+ } : { type: "all" };
881789
+ const ir3 = await getIntermediateRepresentation({
881790
+ apiWorkspace,
881791
+ ossWorkspaces,
881792
+ useOpenApiParserV3,
881793
+ audiences,
881794
+ logger: logger4
881756
881795
  });
881796
+ if (ir3 == null) {
881797
+ return [];
881798
+ }
881757
881799
  const api2 = toLatest(convertIrToApiDefinition({ ir: ir3, apiDefinitionId: (0, import_crypto9.randomUUID)(), context: NOOP_CONTEXT }));
881758
881800
  const uniqueDescriptions = collectUniqueDescriptions(api2);
881759
881801
  const violations = [];
@@ -882430,8 +882472,22 @@ function createDocsConfigFileAstVisitorForRules({ relativeFilepath, allRulesWith
882430
882472
  for (const { ruleName, visitor } of allRulesWithVisitors) {
882431
882473
  const visitFromRule = visitor[nodeType];
882432
882474
  if (visitFromRule != null) {
882433
- const ruleViolations = await visitFromRule(node4);
882434
882475
  const severityOverride = severityOverrides?.get(ruleName);
882476
+ let ruleViolations;
882477
+ try {
882478
+ ruleViolations = await visitFromRule(node4);
882479
+ } catch (error50) {
882480
+ addViolations([
882481
+ {
882482
+ name: ruleName,
882483
+ severity: severityOverride ?? "fatal",
882484
+ relativeFilepath: RelativeFilePath2.of(""),
882485
+ nodePath,
882486
+ message: `Rule "${ruleName}" failed to run: ${formatInitError(error50)}`
882487
+ }
882488
+ ]);
882489
+ continue;
882490
+ }
882435
882491
  addViolations(ruleViolations.map((violation) => ({
882436
882492
  name: violation.name ?? ruleName,
882437
882493
  severity: severityOverride ?? violation.severity,
@@ -886897,7 +886953,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
886897
886953
  var LOGS_FOLDER_NAME = "logs";
886898
886954
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
886899
886955
  function getCliSource() {
886900
- const version7 = "5.109.0";
886956
+ const version7 = "5.109.1";
886901
886957
  return `cli@${version7}`;
886902
886958
  }
886903
886959
  var DebugLogger = class {
@@ -913861,7 +913917,7 @@ var LegacyDocsPublisher = class {
913861
913917
  previewId,
913862
913918
  disableTemplates: void 0,
913863
913919
  skipUpload,
913864
- cliVersion: "5.109.0",
913920
+ cliVersion: "5.109.1",
913865
913921
  loginCommand: "fern auth login"
913866
913922
  });
913867
913923
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -967278,7 +967334,7 @@ init_lib17();
967278
967334
  init_lib36();
967279
967335
  init_lib27();
967280
967336
  init_lib23();
967281
- async function getIntermediateRepresentation({ workspace, audiences, generatorInvocation, context: context3, irVersionOverride, version: version7, packageName, userAgentTemplate, organization, sourceConfig, includeOptionalRequestPropertyExamples, ir: ir3 }) {
967337
+ async function getIntermediateRepresentation2({ workspace, audiences, generatorInvocation, context: context3, irVersionOverride, version: version7, packageName, userAgentTemplate, organization, sourceConfig, includeOptionalRequestPropertyExamples, ir: ir3 }) {
967282
967338
  const resolvedUserAgentTemplate = userAgentTemplate ?? getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
967283
967339
  const idempotencyKeyGeneration = getIdempotencyKeyGenerationFromGeneratorConfig(generatorInvocation);
967284
967340
  const intermediateRepresentation = ir3 ?? generateIntermediateRepresentation({
@@ -968448,7 +968504,7 @@ function extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig) {
968448
968504
  async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFernConfig, workspace, generatorInvocation, absolutePathToLocalOutput, absolutePathToLocalSnippetJSON, absolutePathToLocalSnippetTemplateJSON, audiences, version: version7, workspaceTempDir, keepDocker, context: context3, irVersionOverride, outputVersionOverride, writeUnitTests, generateOauthClients, generatePaginatedClients, includeOptionalRequestPropertyExamples, inspect: inspect6, executionEnvironment, runner, whiteLabel, publishToRegistry, ir: ir3, ai: ai2, autoVersioningCache, absolutePathToSpecRepo, skipFernignore, disableTelemetry, rawApiSpecs }) {
968449
968505
  const irVersion = version7 ?? outputVersionOverride;
968450
968506
  const effectiveIrVersion = irVersion != null && (0, import_autoversion4.isAutoVersion)(irVersion) ? import_autoversion4.MAGIC_VERSION : irVersion;
968451
- const { latest: latest2, migrated } = await getIntermediateRepresentation({
968507
+ const { latest: latest2, migrated } = await getIntermediateRepresentation2({
968452
968508
  workspace,
968453
968509
  audiences,
968454
968510
  generatorInvocation,
@@ -980781,7 +980837,7 @@ function getAutomationContextFromEnv() {
980781
980837
  config_branch: process.env.FERN_CONFIG_BRANCH,
980782
980838
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
980783
980839
  trigger: process.env.GITHUB_EVENT_NAME,
980784
- cli_version: "5.109.0"
980840
+ cli_version: "5.109.1"
980785
980841
  };
980786
980842
  }
980787
980843
  function isAutomationMode() {
@@ -981613,7 +981669,7 @@ var CliContext = class _CliContext {
981613
981669
  if (false) {
981614
981670
  this.logger.error("CLI_VERSION is not defined");
981615
981671
  }
981616
- return "5.109.0";
981672
+ return "5.109.1";
981617
981673
  }
981618
981674
  getCliName() {
981619
981675
  if (false) {
@@ -993853,7 +993909,7 @@ async function generateIrForWorkspaces({
993853
993909
  project.apiWorkspaces.map(async (workspace) => {
993854
993910
  await cliContext.runTaskForWorkspace(workspace, async (context3) => {
993855
993911
  cliContext.logger.info(`Generating IR for workspace ${workspace.workspaceName ?? "api"}`);
993856
- const intermediateRepresentation = await getIntermediateRepresentation2({
993912
+ const intermediateRepresentation = await getIntermediateRepresentation3({
993857
993913
  workspace,
993858
993914
  context: context3,
993859
993915
  generationLanguage,
@@ -993872,7 +993928,7 @@ async function generateIrForWorkspaces({
993872
993928
  })
993873
993929
  );
993874
993930
  }
993875
- async function getIntermediateRepresentation2({
993931
+ async function getIntermediateRepresentation3({
993876
993932
  workspace,
993877
993933
  context: context3,
993878
993934
  generationLanguage,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.109.0",
2
+ "version": "5.109.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",