@fern-api/fern-api-dev 5.47.0 → 5.47.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 +48 -7
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -651231,6 +651231,46 @@ var OneOfSchemaConverter = class extends AbstractConverter {
651231
651231
  required: filteredRequired
651232
651232
  };
651233
651233
  }
651234
+ /**
651235
+ * When `discriminator.mapping` is absent, infers the mapping from the `oneOf`/`anyOf` $ref schemas.
651236
+ *
651237
+ * Per the OpenAPI 3.x spec, if no mapping is provided the discriminant values are derived from
651238
+ * the schema names in the $ref paths. We also check the resolved schema's discriminant property
651239
+ * for `const` or single-element `enum` values, which take precedence over the schema name.
651240
+ */
651241
+ inferDiscriminatorMapping(discriminantProperty) {
651242
+ const subSchemas = this.schema.oneOf ?? this.schema.anyOf ?? [];
651243
+ const mapping = {};
651244
+ for (const subSchema of subSchemas) {
651245
+ if (!this.context.isReferenceObject(subSchema)) {
651246
+ continue;
651247
+ }
651248
+ const ref2 = subSchema.$ref;
651249
+ const schemaName = ref2.split("/").pop();
651250
+ if (schemaName == null) {
651251
+ continue;
651252
+ }
651253
+ const resolved = this.context.resolveReference({
651254
+ reference: subSchema,
651255
+ breadcrumbs: this.breadcrumbs,
651256
+ skipErrorCollector: true
651257
+ });
651258
+ let discriminantValue = schemaName;
651259
+ if (resolved.resolved) {
651260
+ const discriminantPropSchema = resolved.value.properties?.[discriminantProperty];
651261
+ if (discriminantPropSchema != null && !this.context.isReferenceObject(discriminantPropSchema)) {
651262
+ const constValue = discriminantPropSchema.const;
651263
+ if (typeof constValue === "string") {
651264
+ discriminantValue = constValue;
651265
+ } else if (discriminantPropSchema.enum != null && discriminantPropSchema.enum.length === 1 && typeof discriminantPropSchema.enum[0] === "string") {
651266
+ discriminantValue = discriminantPropSchema.enum[0];
651267
+ }
651268
+ }
651269
+ }
651270
+ mapping[discriminantValue] = ref2;
651271
+ }
651272
+ return mapping;
651273
+ }
651234
651274
  convertAsDiscriminatedUnion() {
651235
651275
  if (this.schema.discriminator == null) {
651236
651276
  return void 0;
@@ -651239,7 +651279,8 @@ var OneOfSchemaConverter = class extends AbstractConverter {
651239
651279
  const unionTypes = [];
651240
651280
  let referencedTypes = /* @__PURE__ */ new Set();
651241
651281
  let inlinedTypes = {};
651242
- for (const [discriminant22, reference4] of Object.entries(this.schema.discriminator.mapping ?? {})) {
651282
+ const effectiveMapping = this.schema.discriminator.mapping ?? this.inferDiscriminatorMapping(discriminantProperty);
651283
+ for (const [discriminant22, reference4] of Object.entries(effectiveMapping)) {
651243
651284
  const typeId = this.context.getTypeIdFromSchemaReference({ $ref: reference4 });
651244
651285
  const breadcrumbs = [...this.breadcrumbs, "discriminator", "mapping", discriminant22];
651245
651286
  const resolvedSchema = this.context.resolveReference({
@@ -670298,7 +670339,7 @@ var AccessTokenPosthogManager = class {
670298
670339
  properties: {
670299
670340
  ...event,
670300
670341
  ...event.properties,
670301
- version: "5.47.0",
670342
+ version: "5.47.1",
670302
670343
  usingAccessToken: true,
670303
670344
  ...getRunIdProperties()
670304
670345
  }
@@ -670362,7 +670403,7 @@ var UserPosthogManager = class {
670362
670403
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
670363
670404
  event: "CLI",
670364
670405
  properties: {
670365
- version: "5.47.0",
670406
+ version: "5.47.1",
670366
670407
  ...event,
670367
670408
  ...event.properties,
670368
670409
  usingAccessToken: false,
@@ -862331,7 +862372,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
862331
862372
  var LOGS_FOLDER_NAME = "logs";
862332
862373
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
862333
862374
  function getCliSource() {
862334
- const version7 = "5.47.0";
862375
+ const version7 = "5.47.1";
862335
862376
  return `cli@${version7}`;
862336
862377
  }
862337
862378
  var DebugLogger = class {
@@ -893560,7 +893601,7 @@ var LegacyDocsPublisher = class {
893560
893601
  previewId,
893561
893602
  disableTemplates: void 0,
893562
893603
  skipUpload,
893563
- cliVersion: "5.47.0",
893604
+ cliVersion: "5.47.1",
893564
893605
  loginCommand: "fern auth login"
893565
893606
  });
893566
893607
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -958828,7 +958869,7 @@ function getAutomationContextFromEnv() {
958828
958869
  config_branch: process.env.FERN_CONFIG_BRANCH,
958829
958870
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
958830
958871
  trigger: process.env.GITHUB_EVENT_NAME,
958831
- cli_version: "5.47.0"
958872
+ cli_version: "5.47.1"
958832
958873
  };
958833
958874
  }
958834
958875
  function isAutomationMode() {
@@ -959654,7 +959695,7 @@ var CliContext = class _CliContext {
959654
959695
  if (false) {
959655
959696
  this.logger.error("CLI_VERSION is not defined");
959656
959697
  }
959657
- return "5.47.0";
959698
+ return "5.47.1";
959658
959699
  }
959659
959700
  getCliName() {
959660
959701
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.47.0",
2
+ "version": "5.47.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",