@fern-api/fern-api-dev 5.85.0 → 5.86.0

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 +121 -6
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -130521,6 +130521,7 @@ var init_OpenApiSettingsSchema2 = __esm({
130521
130521
  "additional-properties-defaults-to": schemas_exports8.boolean().optional(),
130522
130522
  "type-dates-as-strings": schemas_exports8.boolean().optional(),
130523
130523
  "preserve-single-schema-oneof": schemas_exports8.boolean().optional(),
130524
+ "preserve-one-of-in-all-of": schemas_exports8.boolean().optional(),
130524
130525
  "inline-all-of-schemas": schemas_exports8.boolean().optional(),
130525
130526
  "resolve-aliases": ResolveAliases.optional(),
130526
130527
  "group-multi-api-environments": schemas_exports8.boolean().optional(),
@@ -152350,6 +152351,7 @@ var init_options2 = __esm({
152350
152351
  additionalPropertiesDefaultsTo: false,
152351
152352
  typeDatesAsStrings: false,
152352
152353
  preserveSingleSchemaOneOf: false,
152354
+ preserveOneOfInAllOf: false,
152353
152355
  inlineAllOfSchemas: false,
152354
152356
  resolveAliases: false,
152355
152357
  groupMultiApiEnvironments: false,
@@ -199499,6 +199501,7 @@ var init_getAPIDefinitionSettings = __esm({
199499
199501
  additionalPropertiesDefaultsTo: "additionalPropertiesDefaultsTo",
199500
199502
  typeDatesAsStrings: "typeDatesAsStrings",
199501
199503
  preserveSingleSchemaOneOf: "preserveSingleSchemaOneOf",
199504
+ preserveOneOfInAllOf: "preserveOneOfInAllOf",
199502
199505
  inlineAllOfSchemas: "inlineAllOfSchemas",
199503
199506
  resolveAliases: "resolveAliases",
199504
199507
  groupMultiApiEnvironments: "groupMultiApiEnvironments",
@@ -261165,6 +261168,7 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
261165
261168
  additionalPropertiesDefaultsTo: settings?.["additional-properties-defaults-to"],
261166
261169
  typeDatesAsStrings: settings?.["type-dates-as-strings"],
261167
261170
  preserveSingleSchemaOneOf: settings?.["preserve-single-schema-oneof"],
261171
+ preserveOneOfInAllOf: settings?.["preserve-one-of-in-all-of"],
261168
261172
  inlineAllOfSchemas: settings?.["inline-all-of-schemas"],
261169
261173
  resolveAliases: settings?.["resolve-aliases"],
261170
261174
  groupMultiApiEnvironments: settings?.["group-multi-api-environments"],
@@ -262023,6 +262027,7 @@ var init_convertGeneratorsConfiguration = __esm({
262023
262027
  additionalPropertiesDefaultsTo: void 0,
262024
262028
  typeDatesAsStrings: void 0,
262025
262029
  preserveSingleSchemaOneOf: void 0,
262030
+ preserveOneOfInAllOf: void 0,
262026
262031
  inlineAllOfSchemas: void 0,
262027
262032
  resolveAliases: void 0,
262028
262033
  groupMultiApiEnvironments: void 0,
@@ -347777,6 +347782,8 @@ var init_SchemaConverter = __esm({
347777
347782
  "extensions"
347778
347783
  ];
347779
347784
  SchemaConverter = class _SchemaConverter extends AbstractConverter {
347785
+ /** Upper bound on the variants produced by distributing an allOf over its unions. */
347786
+ static MAX_DISTRIBUTED_VARIANTS = 64;
347780
347787
  schema;
347781
347788
  id;
347782
347789
  inlined;
@@ -347804,6 +347811,10 @@ var init_SchemaConverter = __esm({
347804
347811
  if (maybeConvertedEnumSchema != null) {
347805
347812
  return maybeConvertedEnumSchema;
347806
347813
  }
347814
+ const maybeDistributedAllOfOverOneOf = this.tryDistributeAllOfOverOneOf();
347815
+ if (maybeDistributedAllOfOverOneOf != null) {
347816
+ return maybeDistributedAllOfOverOneOf;
347817
+ }
347807
347818
  const maybeConvertedSingularAllOfSchema = this.tryConvertSingularAllOfSchema();
347808
347819
  if (maybeConvertedSingularAllOfSchema != null) {
347809
347820
  return maybeConvertedSingularAllOfSchema;
@@ -348001,6 +348012,101 @@ var init_SchemaConverter = __esm({
348001
348012
  }
348002
348013
  return void 0;
348003
348014
  }
348015
+ /**
348016
+ * Distributes an allOf whose members include a union over that union, so that
348017
+ * `allOf: [oneOf: [A, B], S]` is converted as `oneOf: [allOf: [A, S], allOf: [B, S]]`.
348018
+ * Otherwise the union member is flattened into the parent object and its variants are lost.
348019
+ *
348020
+ * Only the first union is distributed here; the remaining allOf members are re-injected into
348021
+ * every variant, so any further unions are distributed by the recursive conversion below.
348022
+ */
348023
+ tryDistributeAllOfOverOneOf() {
348024
+ if (!this.context.settings.preserveOneOfInAllOf) {
348025
+ return void 0;
348026
+ }
348027
+ const allOf = this.schema.allOf;
348028
+ if (!Array.isArray(allOf) || allOf.length === 0) {
348029
+ return void 0;
348030
+ }
348031
+ if (this.schema.oneOf != null || this.schema.anyOf != null) {
348032
+ return void 0;
348033
+ }
348034
+ const unions = this.getDistributableUnions(allOf);
348035
+ const firstUnion = unions[0];
348036
+ if (firstUnion == null) {
348037
+ return void 0;
348038
+ }
348039
+ const variantCount = unions.reduce((count, union23) => count * union23.variants.length, 1);
348040
+ if (variantCount > _SchemaConverter.MAX_DISTRIBUTED_VARIANTS) {
348041
+ this.context.logger.warn(`Not distributing allOf over its ${unions.length} unions at ${this.breadcrumbs.join(".")}: it would produce ${variantCount} variants (max ${_SchemaConverter.MAX_DISTRIBUTED_VARIANTS}).`);
348042
+ return void 0;
348043
+ }
348044
+ const sharedElements = allOf.filter((_5, index3) => index3 !== firstUnion.index);
348045
+ if (this.schema.properties != null || this.schema.required != null) {
348046
+ sharedElements.push({
348047
+ type: "object",
348048
+ properties: this.schema.properties,
348049
+ required: this.schema.required
348050
+ });
348051
+ }
348052
+ const siblings = { ...this.schema };
348053
+ delete siblings.allOf;
348054
+ delete siblings.properties;
348055
+ delete siblings.required;
348056
+ const distributedConverter = new _SchemaConverter({
348057
+ context: this.context,
348058
+ breadcrumbs: this.breadcrumbs,
348059
+ schema: {
348060
+ ...siblings,
348061
+ oneOf: firstUnion.variants.map((variant) => {
348062
+ const title2 = this.getVariantTitle(variant);
348063
+ return { ...title2 != null ? { title: title2 } : {}, allOf: [variant, ...sharedElements] };
348064
+ })
348065
+ },
348066
+ id: this.id,
348067
+ inlined: this.inlined,
348068
+ nameOverride: this.nameOverride,
348069
+ visitedRefs: this.visitedRefs
348070
+ });
348071
+ return distributedConverter.convert();
348072
+ }
348073
+ getVariantTitle(variant) {
348074
+ if (!this.context.isReferenceObject(variant)) {
348075
+ return variant.title;
348076
+ }
348077
+ const resolved = this.context.resolveMaybeReference({
348078
+ schemaOrReference: variant,
348079
+ breadcrumbs: this.breadcrumbs
348080
+ });
348081
+ return resolved?.title ?? variant.$ref.split("/").pop();
348082
+ }
348083
+ /**
348084
+ * The allOf members that are plain unions of the parent's shape, in declaration order.
348085
+ */
348086
+ getDistributableUnions(allOf) {
348087
+ const unions = [];
348088
+ for (const [index3, element4] of allOf.entries()) {
348089
+ const resolved = this.context.isReferenceObject(element4) ? this.context.resolveMaybeReference({
348090
+ schemaOrReference: element4,
348091
+ breadcrumbs: this.breadcrumbs
348092
+ }) : element4;
348093
+ if (resolved == null || resolved.properties != null) {
348094
+ continue;
348095
+ }
348096
+ if (resolved.type != null && resolved.type !== "object") {
348097
+ continue;
348098
+ }
348099
+ if (resolved.discriminator != null) {
348100
+ continue;
348101
+ }
348102
+ const variants = resolved.oneOf ?? resolved.anyOf;
348103
+ if (variants == null || variants.length === 0) {
348104
+ continue;
348105
+ }
348106
+ unions.push({ index: index3, variants });
348107
+ }
348108
+ return unions;
348109
+ }
348004
348110
  tryConvertPrimitiveSchema() {
348005
348111
  const primitiveConverter = new PrimitiveSchemaConverter({ context: this.context, schema: this.schema });
348006
348112
  const primitiveType2 = primitiveConverter.convert();
@@ -684399,6 +684505,13 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
684399
684505
  * Defaults to false.
684400
684506
  */
684401
684507
  preserveSingleSchemaOneof: external_exports.boolean().optional(),
684508
+ /**
684509
+ * If true, an allOf containing a oneOf/anyOf member is distributed into a union, where each
684510
+ * variant is the union member merged with the remaining allOf members.
684511
+ * If false, the variants' properties are flattened into a single object and marked optional.
684512
+ * Defaults to false.
684513
+ */
684514
+ preserveOneOfInAllOf: external_exports.boolean().optional(),
684402
684515
  /**
684403
684516
  * Whether to inline allOf schemas. If false, allOf schemas will be
684404
684517
  * extended in the code generation.
@@ -693029,7 +693142,7 @@ var AccessTokenPosthogManager = class {
693029
693142
  properties: {
693030
693143
  ...event,
693031
693144
  ...event.properties,
693032
- version: "5.85.0",
693145
+ version: "5.86.0",
693033
693146
  usingAccessToken: true,
693034
693147
  ...getRunIdProperties()
693035
693148
  }
@@ -693095,7 +693208,7 @@ var UserPosthogManager = class {
693095
693208
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
693096
693209
  event: "CLI",
693097
693210
  properties: {
693098
- version: "5.85.0",
693211
+ version: "5.86.0",
693099
693212
  ...event,
693100
693213
  ...event.properties,
693101
693214
  usingAccessToken: false,
@@ -699902,6 +700015,7 @@ var LegacyApiSpecAdapter = class {
699902
700015
  additionalPropertiesDefaultsTo: settings.additionalPropertiesDefaultsTo,
699903
700016
  typeDatesAsStrings: settings.typeDatesAsStrings,
699904
700017
  preserveSingleSchemaOneOf: settings.preserveSingleSchemaOneof,
700018
+ preserveOneOfInAllOf: settings.preserveOneOfInAllOf,
699905
700019
  inlineAllOfSchemas: settings.inlineAllOfSchemas,
699906
700020
  resolveAliases: settings.resolveAliases,
699907
700021
  groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
@@ -872292,6 +872406,7 @@ var SETTINGS_KEY_MAP = {
872292
872406
  "additional-properties-defaults-to": "additionalPropertiesDefaultsTo",
872293
872407
  "type-dates-as-strings": "typeDatesAsStrings",
872294
872408
  "preserve-single-schema-oneof": "preserveSingleSchemaOneof",
872409
+ "preserve-one-of-in-all-of": "preserveOneOfInAllOf",
872295
872410
  "inline-all-of-schemas": "inlineAllOfSchemas",
872296
872411
  "resolve-aliases": "resolveAliases",
872297
872412
  "group-multi-api-environments": "groupMultiApiEnvironments",
@@ -874201,7 +874316,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
874201
874316
  var LOGS_FOLDER_NAME = "logs";
874202
874317
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
874203
874318
  function getCliSource() {
874204
- const version7 = "5.85.0";
874319
+ const version7 = "5.86.0";
874205
874320
  return `cli@${version7}`;
874206
874321
  }
874207
874322
  var DebugLogger = class {
@@ -906900,7 +907015,7 @@ var LegacyDocsPublisher = class {
906900
907015
  previewId,
906901
907016
  disableTemplates: void 0,
906902
907017
  skipUpload,
906903
- cliVersion: "5.85.0",
907018
+ cliVersion: "5.86.0",
906904
907019
  loginCommand: "fern auth login"
906905
907020
  });
906906
907021
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -973775,7 +973890,7 @@ function getAutomationContextFromEnv() {
973775
973890
  config_branch: process.env.FERN_CONFIG_BRANCH,
973776
973891
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
973777
973892
  trigger: process.env.GITHUB_EVENT_NAME,
973778
- cli_version: "5.85.0"
973893
+ cli_version: "5.86.0"
973779
973894
  };
973780
973895
  }
973781
973896
  function isAutomationMode() {
@@ -974607,7 +974722,7 @@ var CliContext = class _CliContext {
974607
974722
  if (false) {
974608
974723
  this.logger.error("CLI_VERSION is not defined");
974609
974724
  }
974610
- return "5.85.0";
974725
+ return "5.86.0";
974611
974726
  }
974612
974727
  getCliName() {
974613
974728
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.85.0",
2
+ "version": "5.86.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",