@fern-api/fern-api-dev 4.50.4 → 4.50.5-2-gdd942ffc855

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 +43 -18
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -537958,10 +537958,22 @@ function generatePathParameterExamples2(pathParameters, options2) {
537958
537958
  if (generatedExample.type === "failure") {
537959
537959
  return generatedExample;
537960
537960
  }
537961
- result.push({
537962
- name: p10.name,
537963
- value: generatedExample.example
537964
- });
537961
+ const json3 = generatedExample.example.jsonExample;
537962
+ if (typeof json3 !== "string" && typeof json3 !== "number" && typeof json3 !== "boolean") {
537963
+ const fallback2 = p10.name.originalName;
537964
+ result.push({
537965
+ name: p10.name,
537966
+ value: {
537967
+ jsonExample: fallback2,
537968
+ shape: ExampleTypeReferenceShape.primitive(ExamplePrimitive.string({ original: fallback2 }))
537969
+ }
537970
+ });
537971
+ } else {
537972
+ result.push({
537973
+ name: p10.name,
537974
+ value: generatedExample.example
537975
+ });
537976
+ }
537965
537977
  }
537966
537978
  return { type: "success", example: result, jsonExample: void 0 };
537967
537979
  }
@@ -582503,6 +582515,19 @@ init_lodash();
582503
582515
  // ../api-importers/v3-importer-commons/lib/converters/ExampleConverter.js
582504
582516
  init_lib4();
582505
582517
  var LITERAL_REGEX = /^literal<\s*(?:"(.*)"|(true|false))\s*>$/;
582518
+ function isInlineSchema(schema2) {
582519
+ return typeof schema2 === "object" && schema2 !== null && !("$ref" in schema2);
582520
+ }
582521
+ function schemaAllowsNull(schema2) {
582522
+ if (!isInlineSchema(schema2)) {
582523
+ return false;
582524
+ }
582525
+ if ("nullable" in schema2 && schema2.nullable === true) {
582526
+ return true;
582527
+ }
582528
+ const hasNullVariant = (variants) => Array.isArray(variants) && variants.some((s11) => isInlineSchema(s11) && s11.type === "null");
582529
+ return hasNullVariant(schema2.anyOf) || hasNullVariant(schema2.oneOf);
582530
+ }
582506
582531
  function isSimpleSchema(schema2) {
582507
582532
  if (schema2.type === "array") {
582508
582533
  return false;
@@ -583084,7 +583109,8 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
583084
583109
  }
583085
583110
  };
583086
583111
  }
583087
- const propertyIsOmittedFromExample = !(key2 in exampleObj) || !("nullable" in property22) && exampleObj[key2] == null || "nullable" in property22 && property22.nullable === true && exampleObj[key2] === void 0;
583112
+ const propertyAllowsNull = schemaAllowsNull(property22);
583113
+ const propertyIsOmittedFromExample = !(key2 in exampleObj) || !propertyAllowsNull && exampleObj[key2] == null || propertyAllowsNull && exampleObj[key2] === void 0;
583088
583114
  const propertyIsOptional = !resolvedSchema.required?.includes(key2);
583089
583115
  if (propertyIsOmittedFromExample && propertyIsOptional) {
583090
583116
  if (this.example === void 0 && this.generateOptionalProperties) {
@@ -583293,7 +583319,7 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
583293
583319
  if (!(unionType2 in resolvedSchema) || unionSchemas == null) {
583294
583320
  return { isValid: false, coerced: false, usedProvidedExample: false, validExample: null, errors: [] };
583295
583321
  }
583296
- const containerExample = this.example ?? this.maybeResolveSchemaExample(resolvedSchema);
583322
+ const containerExample = this.example !== void 0 ? this.example : this.maybeResolveSchemaExample(resolvedSchema);
583297
583323
  if (this.example === void 0) {
583298
583324
  const resolvedUnionSchemas = [];
583299
583325
  for (const subSchema of unionSchemas) {
@@ -583350,7 +583376,7 @@ var ExampleConverter = class _ExampleConverter extends AbstractConverter {
583350
583376
  continue;
583351
583377
  }
583352
583378
  const schemaToUse = unionType2 === "oneOf" ? { ...resolvedSchema, ...subSchema, oneOf: void 0 } : subSchema;
583353
- const variantExample = containerExample ?? this.maybeResolveSchemaExample(schemaToUse);
583379
+ const variantExample = containerExample !== void 0 ? containerExample : this.maybeResolveSchemaExample(schemaToUse);
583354
583380
  const exampleConverter = new _ExampleConverter({
583355
583381
  breadcrumbs: [...this.breadcrumbs, `${unionType2}[${index3}]`],
583356
583382
  context: this.context,
@@ -602284,7 +602310,7 @@ var AccessTokenPosthogManager = class {
602284
602310
  properties: {
602285
602311
  ...event,
602286
602312
  ...event.properties,
602287
- version: "4.50.4",
602313
+ version: "4.50.5-2-gdd942ffc855",
602288
602314
  usingAccessToken: true
602289
602315
  }
602290
602316
  });
@@ -602335,7 +602361,7 @@ var UserPosthogManager = class {
602335
602361
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602336
602362
  event: "CLI",
602337
602363
  properties: {
602338
- version: "4.50.4",
602364
+ version: "4.50.5-2-gdd942ffc855",
602339
602365
  ...event,
602340
602366
  ...event.properties,
602341
602367
  usingAccessToken: false,
@@ -826190,7 +826216,7 @@ var import_path54 = __toESM(require("path"), 1);
826190
826216
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
826191
826217
  var LOGS_FOLDER_NAME = "logs";
826192
826218
  function getCliSource() {
826193
- const version7 = "4.50.4";
826219
+ const version7 = "4.50.5-2-gdd942ffc855";
826194
826220
  return `cli@${version7}`;
826195
826221
  }
826196
826222
  var DebugLogger = class {
@@ -837192,7 +837218,7 @@ var LegacyDocsPublisher = class {
837192
837218
  previewId: void 0,
837193
837219
  disableTemplates: void 0,
837194
837220
  skipUpload,
837195
- cliVersion: "4.50.4"
837221
+ cliVersion: "4.50.5-2-gdd942ffc855"
837196
837222
  });
837197
837223
  if (taskContext.getResult() === TaskResult.Failure) {
837198
837224
  return { success: false };
@@ -910311,7 +910337,7 @@ var CliContext = class {
910311
910337
  if (false) {
910312
910338
  this.logger.error("CLI_VERSION is not defined");
910313
910339
  }
910314
- return "4.50.4";
910340
+ return "4.50.5-2-gdd942ffc855";
910315
910341
  }
910316
910342
  getCliName() {
910317
910343
  if (false) {
@@ -919966,15 +919992,14 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
919966
919992
  }
919967
919993
  let token = null;
919968
919994
  if (hasFdrOriginOverride) {
919969
- const fernToken = process.env["FERN_TOKEN"];
919995
+ const fernToken = await getToken2();
919970
919996
  if (!fernToken) {
919971
- cliContext.failAndThrow("No token found. Please set the FERN_TOKEN environment variable.");
919997
+ cliContext.failAndThrow(
919998
+ "No token found. Please set the FERN_TOKEN environment variable or run `fern login`."
919999
+ );
919972
920000
  return;
919973
920001
  }
919974
- token = {
919975
- type: "organization",
919976
- value: fernToken
919977
- };
920002
+ token = fernToken;
919978
920003
  } else {
919979
920004
  token = await cliContext.runTask(async (context3) => {
919980
920005
  return askToLogin(context3);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.50.4",
2
+ "version": "4.50.5-2-gdd942ffc855",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",