@fern-api/fern-api-dev 4.65.0-1-gee48bb4339f → 4.65.0-3-g7e0c736ca5b

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 +19 -21
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -603773,7 +603773,7 @@ var AccessTokenPosthogManager = class {
603773
603773
  properties: {
603774
603774
  ...event,
603775
603775
  ...event.properties,
603776
- version: "4.65.0-1-gee48bb4339f",
603776
+ version: "4.65.0-3-g7e0c736ca5b",
603777
603777
  usingAccessToken: true
603778
603778
  }
603779
603779
  });
@@ -603824,7 +603824,7 @@ var UserPosthogManager = class {
603824
603824
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
603825
603825
  event: "CLI",
603826
603826
  properties: {
603827
- version: "4.65.0-1-gee48bb4339f",
603827
+ version: "4.65.0-3-g7e0c736ca5b",
603828
603828
  ...event,
603829
603829
  ...event.properties,
603830
603830
  usingAccessToken: false,
@@ -840794,7 +840794,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
840794
840794
  var LOGS_FOLDER_NAME = "logs";
840795
840795
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
840796
840796
  function getCliSource() {
840797
- const version7 = "4.65.0-1-gee48bb4339f";
840797
+ const version7 = "4.65.0-3-g7e0c736ca5b";
840798
840798
  return `cli@${version7}`;
840799
840799
  }
840800
840800
  var DebugLogger = class {
@@ -851992,7 +851992,7 @@ var LegacyDocsPublisher = class {
851992
851992
  previewId,
851993
851993
  disableTemplates: void 0,
851994
851994
  skipUpload,
851995
- cliVersion: "4.65.0-1-gee48bb4339f"
851995
+ cliVersion: "4.65.0-3-g7e0c736ca5b"
851996
851996
  });
851997
851997
  if (taskContext.getResult() === TaskResult.Failure) {
851998
851998
  return { success: false };
@@ -872557,10 +872557,16 @@ var DynamicLiteralMapper = class extends WithGeneration {
872557
872557
  }
872558
872558
  findMatchingUndiscriminatedUnionType({ undiscriminatedUnion: undiscriminatedUnion20, value }) {
872559
872559
  for (const typeReference2 of undiscriminatedUnion20.types) {
872560
+ const errorsBefore = this.context.errors.size();
872560
872561
  try {
872561
872562
  const typeLiteral = this.convert({ typeReference: typeReference2, value });
872563
+ if (is9.Literal.nop(typeLiteral) || this.context.errors.size() > errorsBefore) {
872564
+ this.context.errors.truncate(errorsBefore);
872565
+ continue;
872566
+ }
872562
872567
  return { valueTypeReference: typeReference2, typeLiteral };
872563
872568
  } catch (e6) {
872569
+ this.context.errors.truncate(errorsBefore);
872564
872570
  continue;
872565
872571
  }
872566
872572
  }
@@ -875981,13 +875987,16 @@ var DynamicTypeInstantiationMapper = class {
875981
875987
  }
875982
875988
  findMatchingUndiscriminatedUnionType({ undiscriminatedUnion: undiscriminatedUnion20, value }) {
875983
875989
  for (const typeReference2 of undiscriminatedUnion20.types) {
875990
+ const errorsBefore = this.context.errors.size();
875984
875991
  try {
875985
875992
  const typeInstantiation = this.convert({ typeReference: typeReference2, value });
875986
- if (go_exports.TypeInstantiation.isNop(typeInstantiation)) {
875993
+ if (go_exports.TypeInstantiation.isNop(typeInstantiation) || this.context.errors.size() > errorsBefore) {
875994
+ this.context.errors.truncate(errorsBefore);
875987
875995
  continue;
875988
875996
  }
875989
875997
  return { valueTypeReference: typeReference2, typeInstantiation };
875990
875998
  } catch (e6) {
875999
+ this.context.errors.truncate(errorsBefore);
875991
876000
  continue;
875992
876001
  }
875993
876002
  }
@@ -879191,40 +879200,29 @@ var DynamicTypeLiteralMapper = class {
879191
879200
  }));
879192
879201
  }
879193
879202
  findMatchingUndiscriminatedUnionType({ undiscriminatedUnion: undiscriminatedUnion20, value }) {
879194
- const attemptedVariants = [];
879195
- const variantErrors = [];
879196
879203
  for (const typeReference2 of undiscriminatedUnion20.types) {
879197
879204
  const errorsBefore = this.context.errors.size();
879198
879205
  try {
879199
- attemptedVariants.push(JSON.stringify(typeReference2));
879200
879206
  const typeInstantiation = this.convert({
879201
879207
  typeReference: typeReference2,
879202
879208
  value,
879203
879209
  inUndiscriminatedUnion: true
879204
879210
  });
879205
- if (java_exports.TypeLiteral.isNop(typeInstantiation)) {
879211
+ if (java_exports.TypeLiteral.isNop(typeInstantiation) || this.context.errors.size() > errorsBefore) {
879206
879212
  this.context.errors.truncate(errorsBefore);
879207
879213
  continue;
879208
879214
  }
879209
879215
  return { valueTypeReference: typeReference2, typeInstantiation };
879210
879216
  } catch (e6) {
879211
879217
  this.context.errors.truncate(errorsBefore);
879212
- variantErrors.push(`Type ${JSON.stringify(typeReference2)}: ${extractErrorMessage(e6)}`);
879213
879218
  continue;
879214
879219
  }
879215
879220
  }
879216
879221
  this.context.errors.add({
879217
879222
  severity: Severity.Critical,
879218
- message: `None of the types in the undiscriminated union matched the given "${typeof value}" value. Tried ${attemptedVariants.length} variants. Errors: ${variantErrors.join("; ")}`
879223
+ message: `None of the types in the undiscriminated union matched the given "${typeof value}" value`
879219
879224
  });
879220
- const unionName = undiscriminatedUnion20.declaration.name ?? "UnknownUnion";
879221
- const detailedErrors = variantErrors.map((error50, index3) => ` ${index3 + 1}. ${error50}`).join("\n");
879222
- throw new Error(`Failed to match undiscriminated union "${unionName}" for ${typeof value} value.
879223
- Value: ${JSON.stringify(value)}
879224
- Attempted ${attemptedVariants.length} variants:
879225
- ${detailedErrors}
879226
-
879227
- This prevents invalid snippet code generation that would cause formatter errors.`);
879225
+ return void 0;
879228
879226
  }
879229
879227
  getUndiscriminatedUnionFieldName({ typeReference: typeReference2 }) {
879230
879228
  switch (typeReference2.type) {
@@ -901436,7 +901434,7 @@ var DynamicTypeLiteralMapper7 = class {
901436
901434
  const errorsBefore = this.context.errors.size();
901437
901435
  try {
901438
901436
  const result = this.convert({ typeReference: typeReference2, value, convertOpts });
901439
- if (typescript_exports.TypeLiteral.isNop(result)) {
901437
+ if (typescript_exports.TypeLiteral.isNop(result) || this.context.errors.size() > errorsBefore) {
901440
901438
  this.context.errors.truncate(errorsBefore);
901441
901439
  continue;
901442
901440
  }
@@ -925583,7 +925581,7 @@ var CliContext = class {
925583
925581
  if (false) {
925584
925582
  this.logger.error("CLI_VERSION is not defined");
925585
925583
  }
925586
- return "4.65.0-1-gee48bb4339f";
925584
+ return "4.65.0-3-g7e0c736ca5b";
925587
925585
  }
925588
925586
  getCliName() {
925589
925587
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.65.0-1-gee48bb4339f",
2
+ "version": "4.65.0-3-g7e0c736ca5b",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",