fern-api 0.16.23 → 0.16.24

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 +50 -6
  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.24",
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.24",
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) {
@@ -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.24" == null) {
761580
761624
  this.logger.error("CLI_VERSION is not defined");
761581
761625
  }
761582
- return "0.16.23";
761626
+ return "0.16.24";
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.24",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",