fern-api 0.16.23 → 0.16.25

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/bundle.cjs +55 -11
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -736951,7 +736951,7 @@ var AccessTokenPosthogManager = class {
736951
736951
  properties: {
736952
736952
  ...event,
736953
736953
  ...event.properties,
736954
- version: "0.16.23",
736954
+ version: "0.16.25",
736955
736955
  usingAccessToken: true
736956
736956
  }
736957
736957
  });
@@ -737013,7 +737013,7 @@ var UserPosthogManager = class {
737013
737013
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
737014
737014
  event: "CLI",
737015
737015
  properties: {
737016
- version: "0.16.23",
737016
+ version: "0.16.25",
737017
737017
  ...event,
737018
737018
  ...event.properties
737019
737019
  }
@@ -749759,6 +749759,22 @@ function getQueryParameterTypeReference({ schema: schema2, context, fileContaini
749759
749759
  allowMultiple: true
749760
749760
  };
749761
749761
  } else if (resolvedSchema.type === "oneOf" && resolvedSchema.oneOf.type === "undisciminated") {
749762
+ const literalValues = [];
749763
+ for (const [_4, schema3] of Object.entries(resolvedSchema.oneOf.schemas)) {
749764
+ if (schema3.type === "literal" && schema3.value.type === "string") {
749765
+ literalValues.push(schema3.value.string);
749766
+ }
749767
+ }
749768
+ if (literalValues.length > 0) {
749769
+ context.builder.addType(fileContainingReference, {
749770
+ name: schema2.generatedName,
749771
+ schema: { enum: literalValues }
749772
+ });
749773
+ return {
749774
+ value: schema2.generatedName,
749775
+ allowMultiple: false
749776
+ };
749777
+ }
749762
749778
  for (const [_4, schema3] of Object.entries(resolvedSchema.oneOf.schemas)) {
749763
749779
  return getQueryParameterTypeReference({
749764
749780
  schema: schema3,
@@ -749802,6 +749818,22 @@ function getQueryParameterTypeReference({ schema: schema2, context, fileContaini
749802
749818
  allowMultiple: true
749803
749819
  };
749804
749820
  } else if (schema2.value.type === "oneOf" && schema2.value.oneOf.type === "undisciminated") {
749821
+ const literalValues = [];
749822
+ for (const [_4, oneOfSchema] of Object.entries(schema2.value.oneOf.schemas)) {
749823
+ if (oneOfSchema.type === "literal" && oneOfSchema.value.type === "string") {
749824
+ literalValues.push(oneOfSchema.value.string);
749825
+ }
749826
+ }
749827
+ if (literalValues.length > 0) {
749828
+ context.builder.addType(fileContainingReference, {
749829
+ name: schema2.value.oneOf.generatedName,
749830
+ schema: { enum: literalValues }
749831
+ });
749832
+ return {
749833
+ value: `optional<${schema2.value.oneOf.generatedName}>`,
749834
+ allowMultiple: false
749835
+ };
749836
+ }
749805
749837
  for (const [_4, oneOfSchema] of Object.entries(schema2.value.oneOf.schemas)) {
749806
749838
  return getQueryParameterTypeReference({
749807
749839
  schema: import_finalIr3.Schema.optional({ value: oneOfSchema, description: void 0, groupName: void 0 }),
@@ -751649,8 +751681,20 @@ function getAllProperties2({ schema: schema2, context, breadcrumbs }) {
751649
751681
  var import_parseIr9 = __toESM(require_parseIr());
751650
751682
  function convertUndiscriminatedOneOf({ nameOverride, generatedName, breadcrumbs, description, wrapAsNullable, context, subtypes, groupName }) {
751651
751683
  const subtypePrefixes = getUniqueSubTypeNames({ schemas: subtypes });
751652
- const convertedSubtypes = subtypes.map((schema2, index2) => {
751653
- return convertSchema(schema2, false, context, [...breadcrumbs, subtypePrefixes[index2] ?? `${index2}`]);
751684
+ const convertedSubtypes = subtypes.flatMap((schema2, index2) => {
751685
+ if (!isReferenceObject(schema2) && schema2.enum != null) {
751686
+ return schema2.enum.map((enumValue) => {
751687
+ return import_parseIr9.SchemaWithExample.literal({
751688
+ value: {
751689
+ type: "string",
751690
+ string: enumValue
751691
+ },
751692
+ groupName: void 0,
751693
+ description: void 0
751694
+ });
751695
+ });
751696
+ }
751697
+ return [convertSchema(schema2, false, context, [...breadcrumbs, subtypePrefixes[index2] ?? `${index2}`])];
751654
751698
  });
751655
751699
  const uniqueSubtypes = [];
751656
751700
  for (let i2 = 0; i2 < convertedSubtypes.length; ++i2) {
@@ -751784,7 +751828,7 @@ function convertSchema(schema2, wrapAsNullable, context, breadcrumbs, referenced
751784
751828
  }
751785
751829
  return convertReferenceObject(schema2, wrapAsNullable, context, breadcrumbs);
751786
751830
  } else {
751787
- return convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude);
751831
+ return convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude, referencedAsRequest);
751788
751832
  }
751789
751833
  }
751790
751834
  function convertReferenceObject(schema2, wrapAsNullable, context, breadcrumbs) {
@@ -751799,7 +751843,7 @@ function convertReferenceObject(schema2, wrapAsNullable, context, breadcrumbs) {
751799
751843
  return referenceSchema;
751800
751844
  }
751801
751845
  }
751802
- function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set()) {
751846
+ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set(), referencedAsRequest = false) {
751803
751847
  const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME);
751804
751848
  const groupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME);
751805
751849
  const generatedName = getGeneratedTypeName(breadcrumbs);
@@ -751996,7 +752040,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
751996
752040
  groupName
751997
752041
  });
751998
752042
  } else if (schema2.oneOf.length === 1 && schema2.oneOf[0] != null) {
751999
- const convertedSchema = convertSchema(schema2.oneOf[0], wrapAsNullable, context, breadcrumbs);
752043
+ const convertedSchema = convertSchema(schema2.oneOf[0], wrapAsNullable, context, breadcrumbs, referencedAsRequest);
752000
752044
  return maybeInjectDescriptionOrGroupName(convertedSchema, description, groupName);
752001
752045
  } else if (schema2.oneOf.length > 1) {
752002
752046
  if (schema2.oneOf.length === 2 && schema2.oneOf[0] != null && schema2.oneOf[1] != null) {
@@ -752056,7 +752100,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
752056
752100
  }
752057
752101
  if (schema2.anyOf != null && schema2.anyOf.length > 0) {
752058
752102
  if (schema2.anyOf.length === 1 && schema2.anyOf[0] != null) {
752059
- const convertedSchema = convertSchema(schema2.anyOf[0], wrapAsNullable, context, breadcrumbs);
752103
+ const convertedSchema = convertSchema(schema2.anyOf[0], wrapAsNullable, context, breadcrumbs, referencedAsRequest);
752060
752104
  return maybeInjectDescriptionOrGroupName(convertedSchema, description, groupName);
752061
752105
  }
752062
752106
  if (schema2.anyOf.length === 2 && schema2.anyOf[0] != null && schema2.anyOf[1] != null) {
@@ -752102,7 +752146,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
752102
752146
  if (schema2.allOf != null) {
752103
752147
  const maybeSingularAllOf = getSingularAllOf({ properties: schema2.properties ?? {}, allOf: schema2.allOf });
752104
752148
  if (maybeSingularAllOf != null) {
752105
- const convertedSchema = convertSchema(maybeSingularAllOf, wrapAsNullable, context, breadcrumbs);
752149
+ const convertedSchema = convertSchema(maybeSingularAllOf, wrapAsNullable, context, breadcrumbs, referencedAsRequest);
752106
752150
  return maybeInjectDescriptionOrGroupName(convertedSchema, description, groupName);
752107
752151
  }
752108
752152
  }
@@ -761576,10 +761620,10 @@ var CliContext = class {
761576
761620
  return "fern-api";
761577
761621
  }
761578
761622
  getPackageVersion() {
761579
- if ("0.16.23" == null) {
761623
+ if ("0.16.25" == null) {
761580
761624
  this.logger.error("CLI_VERSION is not defined");
761581
761625
  }
761582
- return "0.16.23";
761626
+ return "0.16.25";
761583
761627
  }
761584
761628
  getCliName() {
761585
761629
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.16.23",
3
+ "version": "0.16.25",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",