@fern-api/fern-api-dev 4.50.4 → 4.50.5-1-gffeb5000948

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 +27 -14
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -582503,6 +582503,19 @@ init_lodash();
582503
582503
  // ../api-importers/v3-importer-commons/lib/converters/ExampleConverter.js
582504
582504
  init_lib4();
582505
582505
  var LITERAL_REGEX = /^literal<\s*(?:"(.*)"|(true|false))\s*>$/;
582506
+ function isInlineSchema(schema2) {
582507
+ return typeof schema2 === "object" && schema2 !== null && !("$ref" in schema2);
582508
+ }
582509
+ function schemaAllowsNull(schema2) {
582510
+ if (!isInlineSchema(schema2)) {
582511
+ return false;
582512
+ }
582513
+ if ("nullable" in schema2 && schema2.nullable === true) {
582514
+ return true;
582515
+ }
582516
+ const hasNullVariant = (variants) => Array.isArray(variants) && variants.some((s11) => isInlineSchema(s11) && s11.type === "null");
582517
+ return hasNullVariant(schema2.anyOf) || hasNullVariant(schema2.oneOf);
582518
+ }
582506
582519
  function isSimpleSchema(schema2) {
582507
582520
  if (schema2.type === "array") {
582508
582521
  return false;
@@ -583084,7 +583097,8 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
583084
583097
  }
583085
583098
  };
583086
583099
  }
583087
- const propertyIsOmittedFromExample = !(key2 in exampleObj) || !("nullable" in property22) && exampleObj[key2] == null || "nullable" in property22 && property22.nullable === true && exampleObj[key2] === void 0;
583100
+ const propertyAllowsNull = schemaAllowsNull(property22);
583101
+ const propertyIsOmittedFromExample = !(key2 in exampleObj) || !propertyAllowsNull && exampleObj[key2] == null || propertyAllowsNull && exampleObj[key2] === void 0;
583088
583102
  const propertyIsOptional = !resolvedSchema.required?.includes(key2);
583089
583103
  if (propertyIsOmittedFromExample && propertyIsOptional) {
583090
583104
  if (this.example === void 0 && this.generateOptionalProperties) {
@@ -583293,7 +583307,7 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
583293
583307
  if (!(unionType2 in resolvedSchema) || unionSchemas == null) {
583294
583308
  return { isValid: false, coerced: false, usedProvidedExample: false, validExample: null, errors: [] };
583295
583309
  }
583296
- const containerExample = this.example ?? this.maybeResolveSchemaExample(resolvedSchema);
583310
+ const containerExample = this.example !== void 0 ? this.example : this.maybeResolveSchemaExample(resolvedSchema);
583297
583311
  if (this.example === void 0) {
583298
583312
  const resolvedUnionSchemas = [];
583299
583313
  for (const subSchema of unionSchemas) {
@@ -583350,7 +583364,7 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
583350
583364
  continue;
583351
583365
  }
583352
583366
  const schemaToUse = unionType2 === "oneOf" ? { ...resolvedSchema, ...subSchema, oneOf: void 0 } : subSchema;
583353
- const variantExample = containerExample ?? this.maybeResolveSchemaExample(schemaToUse);
583367
+ const variantExample = containerExample !== void 0 ? containerExample : this.maybeResolveSchemaExample(schemaToUse);
583354
583368
  const exampleConverter = new _ExampleConverter({
583355
583369
  breadcrumbs: [...this.breadcrumbs, `${unionType2}[${index3}]`],
583356
583370
  context: this.context,
@@ -602284,7 +602298,7 @@ var AccessTokenPosthogManager = class {
602284
602298
  properties: {
602285
602299
  ...event,
602286
602300
  ...event.properties,
602287
- version: "4.50.4",
602301
+ version: "4.50.5-1-gffeb5000948",
602288
602302
  usingAccessToken: true
602289
602303
  }
602290
602304
  });
@@ -602335,7 +602349,7 @@ var UserPosthogManager = class {
602335
602349
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602336
602350
  event: "CLI",
602337
602351
  properties: {
602338
- version: "4.50.4",
602352
+ version: "4.50.5-1-gffeb5000948",
602339
602353
  ...event,
602340
602354
  ...event.properties,
602341
602355
  usingAccessToken: false,
@@ -826190,7 +826204,7 @@ var import_path54 = __toESM(require("path"), 1);
826190
826204
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
826191
826205
  var LOGS_FOLDER_NAME = "logs";
826192
826206
  function getCliSource() {
826193
- const version7 = "4.50.4";
826207
+ const version7 = "4.50.5-1-gffeb5000948";
826194
826208
  return `cli@${version7}`;
826195
826209
  }
826196
826210
  var DebugLogger = class {
@@ -837192,7 +837206,7 @@ var LegacyDocsPublisher = class {
837192
837206
  previewId: void 0,
837193
837207
  disableTemplates: void 0,
837194
837208
  skipUpload,
837195
- cliVersion: "4.50.4"
837209
+ cliVersion: "4.50.5-1-gffeb5000948"
837196
837210
  });
837197
837211
  if (taskContext.getResult() === TaskResult.Failure) {
837198
837212
  return { success: false };
@@ -910311,7 +910325,7 @@ var CliContext = class {
910311
910325
  if (false) {
910312
910326
  this.logger.error("CLI_VERSION is not defined");
910313
910327
  }
910314
- return "4.50.4";
910328
+ return "4.50.5-1-gffeb5000948";
910315
910329
  }
910316
910330
  getCliName() {
910317
910331
  if (false) {
@@ -919966,15 +919980,14 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
919966
919980
  }
919967
919981
  let token = null;
919968
919982
  if (hasFdrOriginOverride) {
919969
- const fernToken = process.env["FERN_TOKEN"];
919983
+ const fernToken = await getToken2();
919970
919984
  if (!fernToken) {
919971
- cliContext.failAndThrow("No token found. Please set the FERN_TOKEN environment variable.");
919985
+ cliContext.failAndThrow(
919986
+ "No token found. Please set the FERN_TOKEN environment variable or run `fern login`."
919987
+ );
919972
919988
  return;
919973
919989
  }
919974
- token = {
919975
- type: "organization",
919976
- value: fernToken
919977
- };
919990
+ token = fernToken;
919978
919991
  } else {
919979
919992
  token = await cliContext.runTask(async (context3) => {
919980
919993
  return askToLogin(context3);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.50.4",
2
+ "version": "4.50.5-1-gffeb5000948",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",