@fern-api/fern-api-dev 5.75.1 → 5.75.2

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 +51 -7
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -153415,7 +153415,7 @@ var init_inferDiscriminatorContext = __esm({
153415
153415
  });
153416
153416
 
153417
153417
  // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertDiscriminatedOneOf.js
153418
- function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminator, context: context3, namespace, groupName, encoding, source: source2 }) {
153418
+ function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminator, oneOfSchemas, context: context3, namespace, groupName, encoding, source: source2 }) {
153419
153419
  const discriminant22 = discriminator.propertyName;
153420
153420
  const discriminantNameOverride = getExtension(discriminator, FernOpenAPIExtension.FERN_PROPERTY_NAME);
153421
153421
  const discriminatorContext = resolveDiscriminatorContext({ discriminator, context: context3 });
@@ -153439,6 +153439,13 @@ function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2,
153439
153439
  context3.markReferencedByDiscriminatedUnion(ref2, discriminant22, 1);
153440
153440
  return [discriminantValue, subtypeReference];
153441
153441
  }));
153442
+ warnAboutUnmappedOneOfMembers({
153443
+ oneOfSchemas,
153444
+ mapping: discriminator.mapping,
153445
+ generatedName,
153446
+ breadcrumbs,
153447
+ context: context3
153448
+ });
153442
153449
  const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
153443
153450
  return propertyName !== discriminant22;
153444
153451
  }).map(([propertyName, propertySchema]) => {
@@ -153482,6 +153489,38 @@ function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2,
153482
153489
  source: source2
153483
153490
  });
153484
153491
  }
153492
+ function getSchemaNameFromReference(ref2) {
153493
+ const segments = ref2.split("/");
153494
+ return segments[segments.length - 1] ?? ref2;
153495
+ }
153496
+ function warnOnce(context3, message) {
153497
+ let alreadyWarned = alreadyWarnedUnmappedMembersByLogger.get(context3.logger);
153498
+ if (alreadyWarned == null) {
153499
+ alreadyWarned = /* @__PURE__ */ new Set();
153500
+ alreadyWarnedUnmappedMembersByLogger.set(context3.logger, alreadyWarned);
153501
+ }
153502
+ if (alreadyWarned.has(message)) {
153503
+ return;
153504
+ }
153505
+ alreadyWarned.add(message);
153506
+ context3.logger.warn(message);
153507
+ }
153508
+ function warnAboutUnmappedOneOfMembers({ oneOfSchemas, mapping, generatedName, breadcrumbs, context: context3 }) {
153509
+ if (oneOfSchemas == null || oneOfSchemas.length === 0) {
153510
+ return;
153511
+ }
153512
+ const mappedSchemaNames = new Set(Object.values(mapping ?? {}).map(getSchemaNameFromReference));
153513
+ const location2 = breadcrumbs.length > 0 ? `${generatedName} (${breadcrumbs.join(" > ")})` : generatedName;
153514
+ for (const member of oneOfSchemas) {
153515
+ if (isReferenceObject(member)) {
153516
+ if (!mappedSchemaNames.has(getSchemaNameFromReference(member.$ref))) {
153517
+ warnOnce(context3, `Discriminated union "${location2}" lists "${member.$ref}" in its oneOf/anyOf, but it is not present in the discriminator mapping. This variant will be omitted from the generated union, so payloads using it will fail to serialize or deserialize. Add it to the discriminator mapping to include it.`);
153518
+ }
153519
+ } else if (member.type !== "null") {
153520
+ warnOnce(context3, `Discriminated union "${location2}" contains an inline oneOf/anyOf member that is not referenced by the discriminator mapping. This variant will be omitted from the generated union, so payloads using it will fail to serialize or deserialize. Extract it into a named schema and add it to the discriminator mapping to include it.`);
153521
+ }
153522
+ }
153523
+ }
153485
153524
  function convertDiscriminatedOneOfWithVariants({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminant: discriminant22, variants, defaultDiscriminantValue, context: context3, namespace, groupName, encoding, source: source2 }) {
153486
153525
  const unionSubTypes = Object.fromEntries(Object.entries(variants).map(([discriminantValue, schema]) => {
153487
153526
  if (isReferenceObject(schema)) {
@@ -153719,6 +153758,7 @@ function mergeOneOfVariantsIntoObject({ variants, context: context3, discriminan
153719
153758
  required: mergedRequired.length > 0 ? mergedRequired : void 0
153720
153759
  };
153721
153760
  }
153761
+ var alreadyWarnedUnmappedMembersByLogger;
153722
153762
  var init_convertDiscriminatedOneOf = __esm({
153723
153763
  "../api-importers/openapi/openapi-ir-parser/lib/schema/convertDiscriminatedOneOf.js"() {
153724
153764
  "use strict";
@@ -153730,6 +153770,7 @@ var init_convertDiscriminatedOneOf = __esm({
153730
153770
  init_inferDiscriminatorContext();
153731
153771
  init_isReferenceObject();
153732
153772
  init_isSchemaWithExampleEqual();
153773
+ alreadyWarnedUnmappedMembersByLogger = /* @__PURE__ */ new WeakMap();
153733
153774
  }
153734
153775
  });
153735
153776
 
@@ -155172,6 +155213,7 @@ function convertSchemaObject(schema, wrapAsOptional, wrapAsNullable, context3, b
155172
155213
  description,
155173
155214
  availability,
155174
155215
  discriminator: schema.discriminator,
155216
+ oneOfSchemas: schema.oneOf ?? schema.anyOf,
155175
155217
  properties: schema.properties ?? {},
155176
155218
  required: schema.required,
155177
155219
  wrapAsOptional,
@@ -155232,6 +155274,7 @@ function convertSchemaObject(schema, wrapAsOptional, wrapAsNullable, context3, b
155232
155274
  description,
155233
155275
  availability,
155234
155276
  discriminator: schema.discriminator,
155277
+ oneOfSchemas: schema.oneOf ?? schema.anyOf,
155235
155278
  properties: schema.properties ?? {},
155236
155279
  required: schema.required,
155237
155280
  wrapAsOptional,
@@ -155423,6 +155466,7 @@ function convertSchemaObject(schema, wrapAsOptional, wrapAsNullable, context3, b
155423
155466
  description,
155424
155467
  availability,
155425
155468
  discriminator: schema.discriminator,
155469
+ oneOfSchemas: schema.oneOf ?? schema.anyOf,
155426
155470
  properties: schema.properties ?? {},
155427
155471
  required: schema.required,
155428
155472
  wrapAsOptional,
@@ -691017,7 +691061,7 @@ var AccessTokenPosthogManager = class {
691017
691061
  properties: {
691018
691062
  ...event,
691019
691063
  ...event.properties,
691020
- version: "5.75.1",
691064
+ version: "5.75.2",
691021
691065
  usingAccessToken: true,
691022
691066
  ...getRunIdProperties()
691023
691067
  }
@@ -691083,7 +691127,7 @@ var UserPosthogManager = class {
691083
691127
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
691084
691128
  event: "CLI",
691085
691129
  properties: {
691086
- version: "5.75.1",
691130
+ version: "5.75.2",
691087
691131
  ...event,
691088
691132
  ...event.properties,
691089
691133
  usingAccessToken: false,
@@ -872184,7 +872228,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
872184
872228
  var LOGS_FOLDER_NAME = "logs";
872185
872229
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
872186
872230
  function getCliSource() {
872187
- const version7 = "5.75.1";
872231
+ const version7 = "5.75.2";
872188
872232
  return `cli@${version7}`;
872189
872233
  }
872190
872234
  var DebugLogger = class {
@@ -904773,7 +904817,7 @@ var LegacyDocsPublisher = class {
904773
904817
  previewId,
904774
904818
  disableTemplates: void 0,
904775
904819
  skipUpload,
904776
- cliVersion: "5.75.1",
904820
+ cliVersion: "5.75.2",
904777
904821
  loginCommand: "fern auth login"
904778
904822
  });
904779
904823
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -971560,7 +971604,7 @@ function getAutomationContextFromEnv() {
971560
971604
  config_branch: process.env.FERN_CONFIG_BRANCH,
971561
971605
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
971562
971606
  trigger: process.env.GITHUB_EVENT_NAME,
971563
- cli_version: "5.75.1"
971607
+ cli_version: "5.75.2"
971564
971608
  };
971565
971609
  }
971566
971610
  function isAutomationMode() {
@@ -972392,7 +972436,7 @@ var CliContext = class _CliContext {
972392
972436
  if (false) {
972393
972437
  this.logger.error("CLI_VERSION is not defined");
972394
972438
  }
972395
- return "5.75.1";
972439
+ return "5.75.2";
972396
972440
  }
972397
972441
  getCliName() {
972398
972442
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.75.1",
2
+ "version": "5.75.2",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",