fern-api 0.26.5 → 0.26.6

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 +57 -15
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -372886,7 +372886,8 @@ var init_ArraySchemaWithExample2 = __esm({
372886
372886
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/parseIr/types/ArraySchemaWithExample.js"() {
372887
372887
  init_core3();
372888
372888
  ArraySchemaWithExample = schemas_exports5.objectWithoutOptionalProperties({
372889
- value: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample)
372889
+ value: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample),
372890
+ example: schemas_exports5.list(schemas_exports5.unknown()).optional()
372890
372891
  }).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithSdkGroupName)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithName)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
372891
372892
  }
372892
372893
  });
@@ -977715,7 +977716,7 @@ var AccessTokenPosthogManager = class {
977715
977716
  properties: {
977716
977717
  ...event,
977717
977718
  ...event.properties,
977718
- version: "0.26.5",
977719
+ version: "0.26.6",
977719
977720
  usingAccessToken: true
977720
977721
  }
977721
977722
  });
@@ -977777,7 +977778,7 @@ var UserPosthogManager = class {
977777
977778
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
977778
977779
  event: "CLI",
977779
977780
  properties: {
977780
- version: "0.26.5",
977781
+ version: "0.26.6",
977781
977782
  ...event,
977782
977783
  ...event.properties
977783
977784
  }
@@ -990876,7 +990877,8 @@ function getSchemaFromFernType({ fernType, nameOverride, generatedName, descript
990876
990877
  generatedName,
990877
990878
  value: itemType,
990878
990879
  description,
990879
- groupName
990880
+ groupName,
990881
+ example: void 0
990880
990882
  }) : void 0,
990881
990883
  optional: (itemType) => itemType != null ? SchemaWithExample.optional({
990882
990884
  nameOverride,
@@ -990890,7 +990892,8 @@ function getSchemaFromFernType({ fernType, nameOverride, generatedName, descript
990890
990892
  generatedName,
990891
990893
  value: itemType,
990892
990894
  description,
990893
- groupName
990895
+ groupName,
990896
+ example: void 0
990894
990897
  }) : void 0,
990895
990898
  literal: (literal2) => SchemaWithExample.literal({
990896
990899
  nameOverride,
@@ -991002,7 +991005,7 @@ function wrapMap({ nameOverride, generatedName, keySchema, valueSchema, wrapAsNu
991002
991005
  }
991003
991006
 
991004
991007
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertArray.js
991005
- function convertArray({ nameOverride, generatedName, breadcrumbs, item, description, wrapAsNullable, context, groupName }) {
991008
+ function convertArray({ nameOverride, generatedName, breadcrumbs, item, description, wrapAsNullable, context, groupName, example }) {
991006
991009
  const itemSchema = item == null ? SchemaWithExample.unknown({
991007
991010
  nameOverride,
991008
991011
  generatedName,
@@ -991016,10 +991019,11 @@ function convertArray({ nameOverride, generatedName, breadcrumbs, item, descript
991016
991019
  groupName,
991017
991020
  itemSchema,
991018
991021
  wrapAsNullable,
991019
- description
991022
+ description,
991023
+ example
991020
991024
  });
991021
991025
  }
991022
- function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, description, groupName }) {
991026
+ function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, description, groupName, example }) {
991023
991027
  if (wrapAsNullable) {
991024
991028
  return SchemaWithExample.nullable({
991025
991029
  nameOverride,
@@ -991029,7 +991033,8 @@ function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, de
991029
991033
  generatedName,
991030
991034
  value: itemSchema,
991031
991035
  description,
991032
- groupName
991036
+ groupName,
991037
+ example
991033
991038
  }),
991034
991039
  description,
991035
991040
  groupName
@@ -991040,7 +991045,8 @@ function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, de
991040
991045
  generatedName,
991041
991046
  value: itemSchema,
991042
991047
  description,
991043
- groupName
991048
+ groupName,
991049
+ example
991044
991050
  });
991045
991051
  }
991046
991052
 
@@ -992115,6 +992121,12 @@ function getExamplesString(schema2) {
992115
992121
  }
992116
992122
  return void 0;
992117
992123
  }
992124
+ function getExampleAsArray(schema2) {
992125
+ if (schema2.example != null && Array.isArray(schema2.example)) {
992126
+ return schema2.example;
992127
+ }
992128
+ return void 0;
992129
+ }
992118
992130
 
992119
992131
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertSchemas.js
992120
992132
  var SCHEMA_REFERENCE_PREFIX = "#/components/schemas/";
@@ -992381,7 +992393,8 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
992381
992393
  description,
992382
992394
  wrapAsNullable,
992383
992395
  context,
992384
- groupName
992396
+ groupName,
992397
+ example: getExampleAsArray(schema2)
992385
992398
  });
992386
992399
  }
992387
992400
  if (schema2.additionalProperties != null && schema2.additionalProperties !== false && hasNoProperties(schema2)) {
@@ -992776,7 +992789,7 @@ function getPossibleDiscriminantsForSchemaObject({ schema: schema2, context }) {
992776
992789
  }
992777
992790
  for (const [propertyName, propertySchema] of Object.entries(schema2.properties ?? {})) {
992778
992791
  const resolvedPropertySchema = isReferenceObject(propertySchema) ? context.resolveSchemaReference(propertySchema) : propertySchema;
992779
- if (resolvedPropertySchema.type === "string" && resolvedPropertySchema.enum != null && isListOfStrings(resolvedPropertySchema.enum) && resolvedPropertySchema.enum.length === 1 && resolvedPropertySchema.enum[0] != null) {
992792
+ if (resolvedPropertySchema.type === "string" && resolvedPropertySchema.enum != null && isListOfStrings(resolvedPropertySchema.enum) && getEnumSet(resolvedPropertySchema.enum).length === 1 && resolvedPropertySchema.enum[0] != null) {
992780
992793
  possibleDiscrimimants[propertyName] = resolvedPropertySchema.enum[0];
992781
992794
  }
992782
992795
  const maybeConstValue = getProperty(resolvedPropertySchema, "const");
@@ -992789,6 +992802,20 @@ function getPossibleDiscriminantsForSchemaObject({ schema: schema2, context }) {
992789
992802
  }
992790
992803
  return possibleDiscrimimants;
992791
992804
  }
992805
+ function getEnumSet(enums) {
992806
+ if (!enums) {
992807
+ return [];
992808
+ }
992809
+ const set7 = /* @__PURE__ */ new Set();
992810
+ enums.forEach((item) => {
992811
+ if (typeof item === "string") {
992812
+ set7.add(item.toLowerCase());
992813
+ } else {
992814
+ set7.add(item);
992815
+ }
992816
+ });
992817
+ return Array.from(set7);
992818
+ }
992792
992819
  function getProperty(object4, property5) {
992793
992820
  const extensionValue = object4[property5];
992794
992821
  if (extensionValue != null) {
@@ -993127,6 +993154,20 @@ var ExampleTypeFactory = class {
993127
993154
  itemExamples.push(itemExample);
993128
993155
  }
993129
993156
  }
993157
+ } else if (schema2.example != null && schema2.example.length > 0) {
993158
+ for (const item of schema2.example) {
993159
+ const itemExample = this.buildExampleHelper({
993160
+ exampleId,
993161
+ example: item,
993162
+ schema: schema2.value,
993163
+ depth: depth + 1,
993164
+ visitedSchemaIds,
993165
+ options: options2
993166
+ });
993167
+ if (itemExample != null) {
993168
+ itemExamples.push(itemExample);
993169
+ }
993170
+ }
993130
993171
  } else {
993131
993172
  const itemExample = this.buildExampleHelper({
993132
993173
  exampleId,
@@ -993545,7 +993586,8 @@ function convertSchemaToSchemaWithExample(schema2) {
993545
993586
  value: convertSchemaToSchemaWithExample(schema2.value),
993546
993587
  generatedName: schema2.generatedName,
993547
993588
  nameOverride: schema2.nameOverride,
993548
- groupName: schema2.groupName
993589
+ groupName: schema2.groupName,
993590
+ example: void 0
993549
993591
  });
993550
993592
  case "enum":
993551
993593
  return SchemaWithExample.enum({
@@ -1002542,10 +1002584,10 @@ var CliContext = class {
1002542
1002584
  return "fern-api";
1002543
1002585
  }
1002544
1002586
  getPackageVersion() {
1002545
- if ("0.26.5" == null) {
1002587
+ if ("0.26.6" == null) {
1002546
1002588
  this.logger.error("CLI_VERSION is not defined");
1002547
1002589
  }
1002548
- return "0.26.5";
1002590
+ return "0.26.6";
1002549
1002591
  }
1002550
1002592
  getCliName() {
1002551
1002593
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.26.5",
3
+ "version": "0.26.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",