@fern-api/fern-api-dev 4.106.3 → 4.107.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 +649 -578
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -516846,7 +516846,8 @@ var OpenApiSettingsSchema = schemas_exports8.object({
516846
516846
  "inline-all-of-schemas": schemas_exports8.boolean().optional(),
516847
516847
  "resolve-aliases": ResolveAliases.optional(),
516848
516848
  "group-multi-api-environments": schemas_exports8.boolean().optional(),
516849
- "default-integer-format": DefaultIntegerFormat2.optional()
516849
+ "default-integer-format": DefaultIntegerFormat2.optional(),
516850
+ "infer-discriminated-union-base-properties": schemas_exports8.boolean().optional()
516850
516851
  }).extend(BaseApiSettingsSchema);
516851
516852
 
516852
516853
  // ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/ApiConfigurationV2SettingsSchema.js
@@ -529828,7 +529829,8 @@ var DEFAULT_PARSE_OPENAPI_SETTINGS = {
529828
529829
  resolveSchemaCollisions: false,
529829
529830
  inferForwardCompatible: false,
529830
529831
  coerceConstsTo: "enums-coerceable-to-literals",
529831
- respectByteFormat: false
529832
+ respectByteFormat: false,
529833
+ shouldInferDiscriminatedUnionBaseProperties: false
529832
529834
  };
529833
529835
  function mergeOptions2(params2) {
529834
529836
  const { defaults: defaults3, options: options2, overrides, overrideOnly = /* @__PURE__ */ new Set(), undefinedIfAbsent = /* @__PURE__ */ new Set() } = params2;
@@ -530571,572 +530573,6 @@ function convertAvailability2(propertySchema) {
530571
530573
  return void 0;
530572
530574
  }
530573
530575
 
530574
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/inferDiscriminatorContext.js
530575
- var SSE_SPEC_FIELDS = /* @__PURE__ */ new Set(["event", "data", "id", "retry"]);
530576
- function collectAllProperties(schema2, context3) {
530577
- let allProperties = {
530578
- ...schema2.properties ?? {}
530579
- };
530580
- for (const allOfElement of schema2.allOf ?? []) {
530581
- if (isReferenceObject(allOfElement)) {
530582
- const resolved = context3.resolveSchemaReference(allOfElement);
530583
- const inheritedProperties = collectAllProperties(resolved, context3);
530584
- allProperties = { ...inheritedProperties, ...allProperties };
530585
- } else {
530586
- const inheritedProperties = collectAllProperties(allOfElement, context3);
530587
- allProperties = { ...inheritedProperties, ...allProperties };
530588
- }
530589
- }
530590
- return allProperties;
530591
- }
530592
- function resolvePropertySchema(schema2, context3) {
530593
- if (isReferenceObject(schema2)) {
530594
- return context3.resolveSchemaReference(schema2);
530595
- }
530596
- return schema2;
530597
- }
530598
- function variantMatchesSseSpec(schema2, context3) {
530599
- const allProperties = collectAllProperties(schema2, context3);
530600
- const propertyEntries = Object.entries(allProperties);
530601
- if (propertyEntries.length === 0) {
530602
- return false;
530603
- }
530604
- let hasEvent = false;
530605
- for (const [propName, propSchema] of propertyEntries) {
530606
- if (!SSE_SPEC_FIELDS.has(propName)) {
530607
- return false;
530608
- }
530609
- const resolved = resolvePropertySchema(propSchema, context3);
530610
- switch (propName) {
530611
- case "event":
530612
- hasEvent = true;
530613
- if (resolved.type !== "string") {
530614
- return false;
530615
- }
530616
- break;
530617
- case "id":
530618
- if (resolved.type !== "string") {
530619
- return false;
530620
- }
530621
- break;
530622
- case "retry":
530623
- if (resolved.type !== "integer") {
530624
- return false;
530625
- }
530626
- break;
530627
- case "data":
530628
- break;
530629
- }
530630
- }
530631
- return hasEvent;
530632
- }
530633
- function resolveDiscriminatorContext({ discriminator, context: context3 }) {
530634
- return getExtension(discriminator, FernOpenAPIExtension.DISCRIMINATOR_CONTEXT) ?? inferDiscriminatorContext({ discriminator, context: context3 });
530635
- }
530636
- function inferDiscriminatorContext({ discriminator, context: context3 }) {
530637
- const mapping = discriminator.mapping;
530638
- if (mapping == null || Object.keys(mapping).length === 0) {
530639
- return "data";
530640
- }
530641
- for (const schema2 of Object.values(mapping)) {
530642
- try {
530643
- const resolved = context3.resolveSchemaReference({ $ref: schema2 });
530644
- if (!variantMatchesSseSpec(resolved, context3)) {
530645
- return "data";
530646
- }
530647
- } catch {
530648
- return "data";
530649
- }
530650
- }
530651
- return "protocol";
530652
- }
530653
- function inferDiscriminatorContextFromVariants({ variants, context: context3 }) {
530654
- const variantEntries = Object.values(variants);
530655
- if (variantEntries.length === 0) {
530656
- return "data";
530657
- }
530658
- for (const variantSchema of variantEntries) {
530659
- try {
530660
- const resolved = isReferenceObject(variantSchema) ? context3.resolveSchemaReference(variantSchema) : variantSchema;
530661
- if (!variantMatchesSseSpec(resolved, context3)) {
530662
- return "data";
530663
- }
530664
- } catch {
530665
- return "data";
530666
- }
530667
- }
530668
- return "protocol";
530669
- }
530670
-
530671
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertDiscriminatedOneOf.js
530672
- function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminator, context: context3, namespace, groupName, encoding, source: source2 }) {
530673
- const discriminant21 = discriminator.propertyName;
530674
- const discriminantNameOverride = getExtension(discriminator, FernOpenAPIExtension.FERN_PROPERTY_NAME);
530675
- const discriminatorContext = resolveDiscriminatorContext({ discriminator, context: context3 });
530676
- const unionSubTypes = Object.fromEntries(Object.entries(discriminator.mapping ?? {}).map(([discriminantValue, schema2]) => {
530677
- const subtypeReference = convertReferenceObject({
530678
- $ref: schema2
530679
- }, false, false, context3, [schema2], encoding, source2, namespace);
530680
- context3.markReferencedByDiscriminatedUnion({
530681
- $ref: schema2
530682
- }, discriminant21, 1);
530683
- return [discriminantValue, subtypeReference];
530684
- }));
530685
- const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
530686
- return propertyName !== discriminant21;
530687
- }).map(([propertyName, propertySchema]) => {
530688
- const isRequired = required6 != null && required6.includes(propertyName);
530689
- const [isOptional, isNullable] = context3.options.coerceOptionalSchemasToNullable ? [false, !isRequired] : [!isRequired, false];
530690
- const schema2 = convertSchema2(propertySchema, isOptional, isNullable, context3, [...breadcrumbs, propertyName], source2, namespace);
530691
- return {
530692
- key: propertyName,
530693
- schema: schema2
530694
- };
530695
- });
530696
- return wrapDiscriminatedOneOf({
530697
- nameOverride,
530698
- generatedName,
530699
- title: title2,
530700
- wrapAsOptional,
530701
- wrapAsNullable,
530702
- properties: convertedProperties,
530703
- description,
530704
- availability,
530705
- discriminant: discriminant21,
530706
- discriminantNameOverride,
530707
- discriminatorContext,
530708
- subtypes: unionSubTypes,
530709
- defaultDiscriminantValue: void 0,
530710
- namespace,
530711
- groupName,
530712
- source: source2
530713
- });
530714
- }
530715
- function convertDiscriminatedOneOfWithVariants({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminant: discriminant21, variants, defaultDiscriminantValue, context: context3, namespace, groupName, encoding, source: source2 }) {
530716
- const unionSubTypes = Object.fromEntries(Object.entries(variants).map(([discriminantValue, schema2]) => {
530717
- if (isReferenceObject(schema2)) {
530718
- const subtypeReference = convertReferenceObject(schema2, false, false, context3, [schema2.$ref], encoding, source2, namespace);
530719
- context3.markReferencedByDiscriminatedUnion(schema2, discriminant21, 1);
530720
- return [discriminantValue, subtypeReference];
530721
- } else {
530722
- const variantSchema = convertSchemaObject(schema2, false, false, context3, [...breadcrumbs, discriminantValue], encoding, source2, namespace, /* @__PURE__ */ new Set([discriminant21]));
530723
- return [discriminantValue, variantSchema];
530724
- }
530725
- }));
530726
- const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
530727
- return propertyName !== discriminant21;
530728
- }).map(([propertyName, propertySchema]) => {
530729
- const isRequired = required6 != null && required6.includes(propertyName);
530730
- const [isOptional, isNullable] = context3.options.coerceOptionalSchemasToNullable ? [false, !isRequired] : [!isRequired, false];
530731
- const schema2 = convertSchema2(propertySchema, isOptional, isNullable, context3, [...breadcrumbs, propertyName], source2, namespace);
530732
- return {
530733
- key: propertyName,
530734
- schema: schema2
530735
- };
530736
- });
530737
- return wrapDiscriminatedOneOf({
530738
- nameOverride,
530739
- generatedName,
530740
- title: title2,
530741
- wrapAsOptional,
530742
- wrapAsNullable,
530743
- properties: convertedProperties,
530744
- description,
530745
- availability,
530746
- discriminant: discriminant21,
530747
- discriminantNameOverride: void 0,
530748
- discriminatorContext: inferDiscriminatorContextFromVariants({ variants, context: context3 }),
530749
- subtypes: unionSubTypes,
530750
- defaultDiscriminantValue,
530751
- namespace,
530752
- groupName,
530753
- source: source2
530754
- });
530755
- }
530756
- function wrapDiscriminatedOneOf({ nameOverride, generatedName, title: title2, wrapAsOptional, wrapAsNullable, properties: properties7, description, availability, discriminant: discriminant21, discriminantNameOverride, discriminatorContext, subtypes, defaultDiscriminantValue, namespace, groupName, source: source2 }) {
530757
- let result = SchemaWithExample.oneOf(OneOfSchemaWithExample.discriminated({
530758
- description,
530759
- availability,
530760
- discriminantProperty: discriminant21,
530761
- discriminantPropertyNameOverride: discriminantNameOverride,
530762
- discriminatorContext,
530763
- defaultDiscriminantValue,
530764
- nameOverride,
530765
- generatedName,
530766
- title: title2,
530767
- schemas: subtypes,
530768
- commonProperties: properties7,
530769
- namespace,
530770
- groupName,
530771
- encoding: void 0,
530772
- source: source2,
530773
- inline: void 0
530774
- }));
530775
- if (wrapAsNullable) {
530776
- result = SchemaWithExample.nullable({
530777
- nameOverride,
530778
- generatedName,
530779
- title: title2,
530780
- value: result,
530781
- namespace,
530782
- groupName,
530783
- description,
530784
- availability,
530785
- inline: void 0
530786
- });
530787
- }
530788
- if (wrapAsOptional) {
530789
- result = SchemaWithExample.optional({
530790
- nameOverride,
530791
- generatedName,
530792
- title: title2,
530793
- value: result,
530794
- namespace,
530795
- groupName,
530796
- description,
530797
- availability,
530798
- inline: void 0
530799
- });
530800
- }
530801
- return result;
530802
- }
530803
-
530804
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertEncoding.js
530805
- function convertEncoding(encodingSchema) {
530806
- if (encodingSchema.proto != null) {
530807
- return Encoding2.protobuf({
530808
- typeName: encodingSchema.proto.type
530809
- });
530810
- }
530811
- return void 0;
530812
- }
530813
-
530814
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertEnum.js
530815
- function convertEnum({ nameOverride, generatedName, title: title2, fernEnum, enumVarNames, enumValues, _default: _default4, description, availability, wrapAsOptional, wrapAsNullable, namespace, groupName, context: context3, source: source2, inline }) {
530816
- const strippedEnumVarNames = stripCommonPrefix(enumVarNames ?? []);
530817
- const uniqueValues = new Set(enumValues);
530818
- const values2 = Array.from(uniqueValues).map((value2, index3) => {
530819
- const fernEnumValue = fernEnum?.[value2];
530820
- const enumVarName = strippedEnumVarNames[index3];
530821
- const valueIsValidName = VALID_ENUM_NAME_REGEX.test(value2);
530822
- let nameOverride2 = fernEnumValue?.name ?? enumVarName;
530823
- const generatedName2 = valueIsValidName ? value2 : generateEnumNameFromValue(value2);
530824
- if (nameOverride2 != null && !VALID_ENUM_NAME_REGEX.test(nameOverride2)) {
530825
- context3?.logger.warn(`Enum name override ${nameOverride2} is not a valid name. Falling back on ${generatedName2}.`);
530826
- nameOverride2 = void 0;
530827
- }
530828
- return {
530829
- nameOverride: nameOverride2,
530830
- generatedName: generatedName2,
530831
- value: value2,
530832
- description: fernEnumValue?.description,
530833
- availability,
530834
- casing: {
530835
- snake: fernEnumValue?.casing?.snake ?? void 0,
530836
- pascal: fernEnumValue?.casing?.pascal ?? void 0,
530837
- screamingSnake: fernEnumValue?.casing?.screamingSnake ?? void 0,
530838
- camel: fernEnumValue?.casing?.camel ?? void 0
530839
- }
530840
- };
530841
- });
530842
- const _defaultEnumValue = _default4 != null ? values2.find((value2) => value2.value === _default4) : void 0;
530843
- return wrapEnum({
530844
- wrapAsOptional,
530845
- wrapAsNullable,
530846
- nameOverride,
530847
- generatedName,
530848
- title: title2,
530849
- values: values2,
530850
- _default: _defaultEnumValue,
530851
- description,
530852
- availability,
530853
- namespace,
530854
- groupName,
530855
- source: source2,
530856
- inline
530857
- });
530858
- }
530859
- function wrapEnum({ wrapAsOptional, wrapAsNullable, nameOverride, generatedName, title: title2, values: values2, _default: _default4, description, availability, namespace, groupName, source: source2, inline }) {
530860
- let result = SchemaWithExample.enum({
530861
- nameOverride,
530862
- generatedName,
530863
- title: title2,
530864
- values: values2,
530865
- description,
530866
- availability,
530867
- default: _default4,
530868
- example: void 0,
530869
- namespace,
530870
- groupName,
530871
- source: source2,
530872
- inline
530873
- });
530874
- if (wrapAsNullable) {
530875
- result = SchemaWithExample.nullable({
530876
- nameOverride,
530877
- generatedName,
530878
- title: title2,
530879
- value: result,
530880
- description,
530881
- availability,
530882
- namespace,
530883
- groupName,
530884
- inline
530885
- });
530886
- }
530887
- if (wrapAsOptional) {
530888
- result = SchemaWithExample.optional({
530889
- nameOverride,
530890
- generatedName,
530891
- title: title2,
530892
- value: result,
530893
- description,
530894
- availability,
530895
- namespace,
530896
- groupName,
530897
- inline
530898
- });
530899
- }
530900
- return result;
530901
- }
530902
- function stripCommonPrefix(names2) {
530903
- if (names2.length <= 1 || names2[0] == null) {
530904
- return names2;
530905
- }
530906
- const nameZero = names2[0];
530907
- let i9 = 0;
530908
- while (nameZero[i9] != null && names2.every((name2) => name2[i9] === nameZero[i9])) {
530909
- i9++;
530910
- }
530911
- return names2.map((name2) => name2.substring(i9));
530912
- }
530913
-
530914
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertInteger.js
530915
- function convertInteger({ nameOverride, generatedName, title: title2, format: format3, _default: _default4, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, description, availability, wrapAsOptional, wrapAsNullable, example, namespace, groupName, defaultIntegerFormat = generators_yml_exports.DefaultIntegerFormat.Int32 }) {
530916
- const effectiveFormat = format3 ?? defaultIntegerFormat;
530917
- const primitive = (() => {
530918
- switch (effectiveFormat) {
530919
- case generators_yml_exports.DefaultIntegerFormat.Int64:
530920
- return PrimitiveSchemaValueWithExample.int64({ default: _default4, example });
530921
- case generators_yml_exports.DefaultIntegerFormat.Uint32:
530922
- return PrimitiveSchemaValueWithExample.uint({ default: _default4, example });
530923
- case generators_yml_exports.DefaultIntegerFormat.Uint64:
530924
- return PrimitiveSchemaValueWithExample.uint64({ default: _default4, example });
530925
- default:
530926
- return PrimitiveSchemaValueWithExample.int({
530927
- default: _default4,
530928
- minimum,
530929
- maximum,
530930
- exclusiveMinimum,
530931
- exclusiveMaximum,
530932
- multipleOf,
530933
- example
530934
- });
530935
- }
530936
- })();
530937
- return wrapPrimitive({
530938
- nameOverride,
530939
- generatedName,
530940
- title: title2,
530941
- primitive,
530942
- wrapAsOptional,
530943
- wrapAsNullable,
530944
- description,
530945
- availability,
530946
- namespace,
530947
- groupName
530948
- });
530949
- }
530950
-
530951
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertLiteral.js
530952
- function createLiteralSchemaValue(value2) {
530953
- if (typeof value2 === "string") {
530954
- return LiteralSchemaValue.string(value2);
530955
- } else if (typeof value2 === "boolean") {
530956
- return LiteralSchemaValue.boolean(value2);
530957
- } else {
530958
- return LiteralSchemaValue.string(`${value2}`);
530959
- }
530960
- }
530961
- function convertLiteral({ nameOverride, generatedName, title: title2, wrapAsOptional, wrapAsNullable, value: value2, description, availability, namespace, groupName }) {
530962
- let result = SchemaWithExample.literal({
530963
- nameOverride,
530964
- generatedName,
530965
- title: title2,
530966
- value: createLiteralSchemaValue(value2),
530967
- description,
530968
- availability,
530969
- namespace,
530970
- groupName
530971
- });
530972
- if (wrapAsNullable) {
530973
- result = SchemaWithExample.nullable({
530974
- nameOverride,
530975
- generatedName,
530976
- title: title2,
530977
- value: result,
530978
- description,
530979
- availability,
530980
- namespace,
530981
- groupName,
530982
- inline: void 0
530983
- });
530984
- }
530985
- if (wrapAsOptional) {
530986
- result = SchemaWithExample.optional({
530987
- nameOverride,
530988
- generatedName,
530989
- title: title2,
530990
- value: result,
530991
- description,
530992
- availability,
530993
- namespace,
530994
- groupName,
530995
- inline: void 0
530996
- });
530997
- }
530998
- return result;
530999
- }
531000
-
531001
- // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertNumber.js
531002
- function convertNumber({ nameOverride, generatedName, title: title2, format: format3, _default: _default4, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, description, availability, wrapAsOptional, wrapAsNullable, example, namespace, groupName }) {
531003
- if (format3 == null || format3 === "double") {
531004
- return wrapPrimitive({
531005
- nameOverride,
531006
- generatedName,
531007
- title: title2,
531008
- primitive: PrimitiveSchemaValueWithExample.double({
531009
- default: _default4,
531010
- minimum,
531011
- maximum,
531012
- exclusiveMinimum,
531013
- exclusiveMaximum,
531014
- multipleOf,
531015
- example
531016
- }),
531017
- wrapAsOptional,
531018
- wrapAsNullable,
531019
- description,
531020
- availability,
531021
- namespace,
531022
- groupName
531023
- });
531024
- } else if (format3 === "float") {
531025
- return wrapPrimitive({
531026
- nameOverride,
531027
- generatedName,
531028
- title: title2,
531029
- primitive: PrimitiveSchemaValueWithExample.float({
531030
- example
531031
- }),
531032
- wrapAsOptional,
531033
- wrapAsNullable,
531034
- description,
531035
- availability,
531036
- namespace,
531037
- groupName
531038
- });
531039
- } else if (format3 === "int32") {
531040
- return wrapPrimitive({
531041
- nameOverride,
531042
- generatedName,
531043
- title: title2,
531044
- primitive: PrimitiveSchemaValueWithExample.int({
531045
- default: _default4,
531046
- minimum,
531047
- maximum,
531048
- exclusiveMinimum,
531049
- exclusiveMaximum,
531050
- multipleOf,
531051
- example
531052
- }),
531053
- wrapAsOptional,
531054
- wrapAsNullable,
531055
- description,
531056
- availability,
531057
- namespace,
531058
- groupName
531059
- });
531060
- } else if (format3 === "int64") {
531061
- return wrapPrimitive({
531062
- nameOverride,
531063
- generatedName,
531064
- title: title2,
531065
- primitive: PrimitiveSchemaValueWithExample.int64({
531066
- default: _default4,
531067
- example
531068
- }),
531069
- wrapAsOptional,
531070
- wrapAsNullable,
531071
- description,
531072
- availability,
531073
- namespace,
531074
- groupName
531075
- });
531076
- } else if (format3 === "uint32") {
531077
- return wrapPrimitive({
531078
- nameOverride,
531079
- generatedName,
531080
- title: title2,
531081
- primitive: PrimitiveSchemaValueWithExample.uint({
531082
- default: _default4,
531083
- example
531084
- }),
531085
- wrapAsOptional,
531086
- wrapAsNullable,
531087
- description,
531088
- availability,
531089
- namespace,
531090
- groupName
531091
- });
531092
- } else if (format3 === "uint64") {
531093
- return wrapPrimitive({
531094
- nameOverride,
531095
- generatedName,
531096
- title: title2,
531097
- primitive: PrimitiveSchemaValueWithExample.uint64({
531098
- default: _default4,
531099
- example
531100
- }),
531101
- wrapAsOptional,
531102
- wrapAsNullable,
531103
- description,
531104
- availability,
531105
- namespace,
531106
- groupName
531107
- });
531108
- } else if (format3 === "time-delta") {
531109
- return wrapPrimitive({
531110
- nameOverride,
531111
- generatedName,
531112
- title: title2,
531113
- primitive: PrimitiveSchemaValueWithExample.float({
531114
- example
531115
- }),
531116
- wrapAsOptional,
531117
- wrapAsNullable,
531118
- description,
531119
- availability,
531120
- namespace,
531121
- groupName
531122
- });
531123
- }
531124
- return wrapPrimitive({
531125
- nameOverride,
531126
- generatedName,
531127
- title: title2,
531128
- primitive: PrimitiveSchemaValueWithExample.float({
531129
- example
531130
- }),
531131
- wrapAsOptional,
531132
- wrapAsNullable,
531133
- description,
531134
- availability,
531135
- namespace,
531136
- groupName
531137
- });
531138
- }
531139
-
531140
530576
  // ../api-importers/openapi/openapi-ir-parser/lib/schema/utils/getBreadcrumbsFromReference.js
531141
530577
  var STARTS_WITH_COMPONENTS_SCHEMAS = {
531142
530578
  // if the first three breadcrumbs are "#", "components", "schemas"
@@ -531866,6 +531302,629 @@ function getAllProperties({ schema: schema2, context: context3, breadcrumbs, sou
531866
531302
  return properties7;
531867
531303
  }
531868
531304
 
531305
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/inferDiscriminatorContext.js
531306
+ var SSE_SPEC_FIELDS = /* @__PURE__ */ new Set(["event", "data", "id", "retry"]);
531307
+ function collectAllProperties(schema2, context3) {
531308
+ let allProperties = {
531309
+ ...schema2.properties ?? {}
531310
+ };
531311
+ for (const allOfElement of schema2.allOf ?? []) {
531312
+ if (isReferenceObject(allOfElement)) {
531313
+ const resolved = context3.resolveSchemaReference(allOfElement);
531314
+ const inheritedProperties = collectAllProperties(resolved, context3);
531315
+ allProperties = { ...inheritedProperties, ...allProperties };
531316
+ } else {
531317
+ const inheritedProperties = collectAllProperties(allOfElement, context3);
531318
+ allProperties = { ...inheritedProperties, ...allProperties };
531319
+ }
531320
+ }
531321
+ return allProperties;
531322
+ }
531323
+ function resolvePropertySchema(schema2, context3) {
531324
+ if (isReferenceObject(schema2)) {
531325
+ return context3.resolveSchemaReference(schema2);
531326
+ }
531327
+ return schema2;
531328
+ }
531329
+ function variantMatchesSseSpec(schema2, context3) {
531330
+ const allProperties = collectAllProperties(schema2, context3);
531331
+ const propertyEntries = Object.entries(allProperties);
531332
+ if (propertyEntries.length === 0) {
531333
+ return false;
531334
+ }
531335
+ let hasEvent = false;
531336
+ for (const [propName, propSchema] of propertyEntries) {
531337
+ if (!SSE_SPEC_FIELDS.has(propName)) {
531338
+ return false;
531339
+ }
531340
+ const resolved = resolvePropertySchema(propSchema, context3);
531341
+ switch (propName) {
531342
+ case "event":
531343
+ hasEvent = true;
531344
+ if (resolved.type !== "string") {
531345
+ return false;
531346
+ }
531347
+ break;
531348
+ case "id":
531349
+ if (resolved.type !== "string") {
531350
+ return false;
531351
+ }
531352
+ break;
531353
+ case "retry":
531354
+ if (resolved.type !== "integer") {
531355
+ return false;
531356
+ }
531357
+ break;
531358
+ case "data":
531359
+ break;
531360
+ }
531361
+ }
531362
+ return hasEvent;
531363
+ }
531364
+ function resolveDiscriminatorContext({ discriminator, context: context3 }) {
531365
+ return getExtension(discriminator, FernOpenAPIExtension.DISCRIMINATOR_CONTEXT) ?? inferDiscriminatorContext({ discriminator, context: context3 });
531366
+ }
531367
+ function inferDiscriminatorContext({ discriminator, context: context3 }) {
531368
+ const mapping = discriminator.mapping;
531369
+ if (mapping == null || Object.keys(mapping).length === 0) {
531370
+ return "data";
531371
+ }
531372
+ for (const schema2 of Object.values(mapping)) {
531373
+ try {
531374
+ const resolved = context3.resolveSchemaReference({ $ref: schema2 });
531375
+ if (!variantMatchesSseSpec(resolved, context3)) {
531376
+ return "data";
531377
+ }
531378
+ } catch {
531379
+ return "data";
531380
+ }
531381
+ }
531382
+ return "protocol";
531383
+ }
531384
+ function inferDiscriminatorContextFromVariants({ variants, context: context3 }) {
531385
+ const variantEntries = Object.values(variants);
531386
+ if (variantEntries.length === 0) {
531387
+ return "data";
531388
+ }
531389
+ for (const variantSchema of variantEntries) {
531390
+ try {
531391
+ const resolved = isReferenceObject(variantSchema) ? context3.resolveSchemaReference(variantSchema) : variantSchema;
531392
+ if (!variantMatchesSseSpec(resolved, context3)) {
531393
+ return "data";
531394
+ }
531395
+ } catch {
531396
+ return "data";
531397
+ }
531398
+ }
531399
+ return "protocol";
531400
+ }
531401
+
531402
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertDiscriminatedOneOf.js
531403
+ function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminator, context: context3, namespace, groupName, encoding, source: source2 }) {
531404
+ const discriminant21 = discriminator.propertyName;
531405
+ const discriminantNameOverride = getExtension(discriminator, FernOpenAPIExtension.FERN_PROPERTY_NAME);
531406
+ const discriminatorContext = resolveDiscriminatorContext({ discriminator, context: context3 });
531407
+ const unionSubTypes = Object.fromEntries(Object.entries(discriminator.mapping ?? {}).map(([discriminantValue, schema2]) => {
531408
+ const subtypeReference = convertReferenceObject({
531409
+ $ref: schema2
531410
+ }, false, false, context3, [schema2], encoding, source2, namespace);
531411
+ context3.markReferencedByDiscriminatedUnion({
531412
+ $ref: schema2
531413
+ }, discriminant21, 1);
531414
+ return [discriminantValue, subtypeReference];
531415
+ }));
531416
+ const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
531417
+ return propertyName !== discriminant21;
531418
+ }).map(([propertyName, propertySchema]) => {
531419
+ const isRequired = required6 != null && required6.includes(propertyName);
531420
+ const [isOptional, isNullable] = context3.options.coerceOptionalSchemasToNullable ? [false, !isRequired] : [!isRequired, false];
531421
+ const schema2 = convertSchema2(propertySchema, isOptional, isNullable, context3, [...breadcrumbs, propertyName], source2, namespace);
531422
+ return {
531423
+ key: propertyName,
531424
+ schema: schema2
531425
+ };
531426
+ });
531427
+ if (context3.options.shouldInferDiscriminatedUnionBaseProperties) {
531428
+ const variantSchemas = Object.values(discriminator.mapping ?? {}).map(($ref) => ({ $ref }));
531429
+ const inferredCommonProperties = inferCommonPropertiesFromVariants({
531430
+ variants: variantSchemas,
531431
+ discriminant: discriminant21,
531432
+ existingPropertyNames: new Set(convertedProperties.map((p14) => p14.key)),
531433
+ context: context3,
531434
+ breadcrumbs,
531435
+ source: source2,
531436
+ namespace
531437
+ });
531438
+ convertedProperties.push(...inferredCommonProperties);
531439
+ }
531440
+ return wrapDiscriminatedOneOf({
531441
+ nameOverride,
531442
+ generatedName,
531443
+ title: title2,
531444
+ wrapAsOptional,
531445
+ wrapAsNullable,
531446
+ properties: convertedProperties,
531447
+ description,
531448
+ availability,
531449
+ discriminant: discriminant21,
531450
+ discriminantNameOverride,
531451
+ discriminatorContext,
531452
+ subtypes: unionSubTypes,
531453
+ defaultDiscriminantValue: void 0,
531454
+ namespace,
531455
+ groupName,
531456
+ source: source2
531457
+ });
531458
+ }
531459
+ function convertDiscriminatedOneOfWithVariants({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminant: discriminant21, variants, defaultDiscriminantValue, context: context3, namespace, groupName, encoding, source: source2 }) {
531460
+ const unionSubTypes = Object.fromEntries(Object.entries(variants).map(([discriminantValue, schema2]) => {
531461
+ if (isReferenceObject(schema2)) {
531462
+ const subtypeReference = convertReferenceObject(schema2, false, false, context3, [schema2.$ref], encoding, source2, namespace);
531463
+ context3.markReferencedByDiscriminatedUnion(schema2, discriminant21, 1);
531464
+ return [discriminantValue, subtypeReference];
531465
+ } else {
531466
+ const variantSchema = convertSchemaObject(schema2, false, false, context3, [...breadcrumbs, discriminantValue], encoding, source2, namespace, /* @__PURE__ */ new Set([discriminant21]));
531467
+ return [discriminantValue, variantSchema];
531468
+ }
531469
+ }));
531470
+ const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
531471
+ return propertyName !== discriminant21;
531472
+ }).map(([propertyName, propertySchema]) => {
531473
+ const isRequired = required6 != null && required6.includes(propertyName);
531474
+ const [isOptional, isNullable] = context3.options.coerceOptionalSchemasToNullable ? [false, !isRequired] : [!isRequired, false];
531475
+ const schema2 = convertSchema2(propertySchema, isOptional, isNullable, context3, [...breadcrumbs, propertyName], source2, namespace);
531476
+ return {
531477
+ key: propertyName,
531478
+ schema: schema2
531479
+ };
531480
+ });
531481
+ if (context3.options.shouldInferDiscriminatedUnionBaseProperties) {
531482
+ const inferredCommonProperties = inferCommonPropertiesFromVariants({
531483
+ variants: Object.values(variants),
531484
+ discriminant: discriminant21,
531485
+ existingPropertyNames: new Set(convertedProperties.map((p14) => p14.key)),
531486
+ context: context3,
531487
+ breadcrumbs,
531488
+ source: source2,
531489
+ namespace
531490
+ });
531491
+ convertedProperties.push(...inferredCommonProperties);
531492
+ }
531493
+ return wrapDiscriminatedOneOf({
531494
+ nameOverride,
531495
+ generatedName,
531496
+ title: title2,
531497
+ wrapAsOptional,
531498
+ wrapAsNullable,
531499
+ properties: convertedProperties,
531500
+ description,
531501
+ availability,
531502
+ discriminant: discriminant21,
531503
+ discriminantNameOverride: void 0,
531504
+ discriminatorContext: inferDiscriminatorContextFromVariants({ variants, context: context3 }),
531505
+ subtypes: unionSubTypes,
531506
+ defaultDiscriminantValue,
531507
+ namespace,
531508
+ groupName,
531509
+ source: source2
531510
+ });
531511
+ }
531512
+ function wrapDiscriminatedOneOf({ nameOverride, generatedName, title: title2, wrapAsOptional, wrapAsNullable, properties: properties7, description, availability, discriminant: discriminant21, discriminantNameOverride, discriminatorContext, subtypes, defaultDiscriminantValue, namespace, groupName, source: source2 }) {
531513
+ let result = SchemaWithExample.oneOf(OneOfSchemaWithExample.discriminated({
531514
+ description,
531515
+ availability,
531516
+ discriminantProperty: discriminant21,
531517
+ discriminantPropertyNameOverride: discriminantNameOverride,
531518
+ discriminatorContext,
531519
+ defaultDiscriminantValue,
531520
+ nameOverride,
531521
+ generatedName,
531522
+ title: title2,
531523
+ schemas: subtypes,
531524
+ commonProperties: properties7,
531525
+ namespace,
531526
+ groupName,
531527
+ encoding: void 0,
531528
+ source: source2,
531529
+ inline: void 0
531530
+ }));
531531
+ if (wrapAsNullable) {
531532
+ result = SchemaWithExample.nullable({
531533
+ nameOverride,
531534
+ generatedName,
531535
+ title: title2,
531536
+ value: result,
531537
+ namespace,
531538
+ groupName,
531539
+ description,
531540
+ availability,
531541
+ inline: void 0
531542
+ });
531543
+ }
531544
+ if (wrapAsOptional) {
531545
+ result = SchemaWithExample.optional({
531546
+ nameOverride,
531547
+ generatedName,
531548
+ title: title2,
531549
+ value: result,
531550
+ namespace,
531551
+ groupName,
531552
+ description,
531553
+ availability,
531554
+ inline: void 0
531555
+ });
531556
+ }
531557
+ return result;
531558
+ }
531559
+ function inferCommonPropertiesFromVariants({ variants, discriminant: discriminant21, existingPropertyNames, context: context3, breadcrumbs, source: source2, namespace }) {
531560
+ if (variants.length === 0) {
531561
+ return [];
531562
+ }
531563
+ const variantPropertyMaps = variants.map((variant) => getAllProperties({ schema: variant, context: context3, breadcrumbs, source: source2, namespace }));
531564
+ const firstVariantProps = variantPropertyMaps[0];
531565
+ if (firstVariantProps == null) {
531566
+ return [];
531567
+ }
531568
+ const result = [];
531569
+ for (const [propertyName, firstSchema] of Object.entries(firstVariantProps)) {
531570
+ if (propertyName === discriminant21) {
531571
+ continue;
531572
+ }
531573
+ if (existingPropertyNames.has(propertyName)) {
531574
+ continue;
531575
+ }
531576
+ let presentInAll = true;
531577
+ for (let i9 = 1; i9 < variantPropertyMaps.length; i9++) {
531578
+ const map16 = variantPropertyMaps[i9];
531579
+ const otherSchema = map16?.[propertyName];
531580
+ if (otherSchema == null || !isSchemaWithExampleEqual(firstSchema, otherSchema)) {
531581
+ presentInAll = false;
531582
+ break;
531583
+ }
531584
+ }
531585
+ if (presentInAll) {
531586
+ result.push({ key: propertyName, schema: firstSchema });
531587
+ }
531588
+ }
531589
+ return result;
531590
+ }
531591
+
531592
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertEncoding.js
531593
+ function convertEncoding(encodingSchema) {
531594
+ if (encodingSchema.proto != null) {
531595
+ return Encoding2.protobuf({
531596
+ typeName: encodingSchema.proto.type
531597
+ });
531598
+ }
531599
+ return void 0;
531600
+ }
531601
+
531602
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertEnum.js
531603
+ function convertEnum({ nameOverride, generatedName, title: title2, fernEnum, enumVarNames, enumValues, _default: _default4, description, availability, wrapAsOptional, wrapAsNullable, namespace, groupName, context: context3, source: source2, inline }) {
531604
+ const strippedEnumVarNames = stripCommonPrefix(enumVarNames ?? []);
531605
+ const uniqueValues = new Set(enumValues);
531606
+ const values2 = Array.from(uniqueValues).map((value2, index3) => {
531607
+ const fernEnumValue = fernEnum?.[value2];
531608
+ const enumVarName = strippedEnumVarNames[index3];
531609
+ const valueIsValidName = VALID_ENUM_NAME_REGEX.test(value2);
531610
+ let nameOverride2 = fernEnumValue?.name ?? enumVarName;
531611
+ const generatedName2 = valueIsValidName ? value2 : generateEnumNameFromValue(value2);
531612
+ if (nameOverride2 != null && !VALID_ENUM_NAME_REGEX.test(nameOverride2)) {
531613
+ context3?.logger.warn(`Enum name override ${nameOverride2} is not a valid name. Falling back on ${generatedName2}.`);
531614
+ nameOverride2 = void 0;
531615
+ }
531616
+ return {
531617
+ nameOverride: nameOverride2,
531618
+ generatedName: generatedName2,
531619
+ value: value2,
531620
+ description: fernEnumValue?.description,
531621
+ availability,
531622
+ casing: {
531623
+ snake: fernEnumValue?.casing?.snake ?? void 0,
531624
+ pascal: fernEnumValue?.casing?.pascal ?? void 0,
531625
+ screamingSnake: fernEnumValue?.casing?.screamingSnake ?? void 0,
531626
+ camel: fernEnumValue?.casing?.camel ?? void 0
531627
+ }
531628
+ };
531629
+ });
531630
+ const _defaultEnumValue = _default4 != null ? values2.find((value2) => value2.value === _default4) : void 0;
531631
+ return wrapEnum({
531632
+ wrapAsOptional,
531633
+ wrapAsNullable,
531634
+ nameOverride,
531635
+ generatedName,
531636
+ title: title2,
531637
+ values: values2,
531638
+ _default: _defaultEnumValue,
531639
+ description,
531640
+ availability,
531641
+ namespace,
531642
+ groupName,
531643
+ source: source2,
531644
+ inline
531645
+ });
531646
+ }
531647
+ function wrapEnum({ wrapAsOptional, wrapAsNullable, nameOverride, generatedName, title: title2, values: values2, _default: _default4, description, availability, namespace, groupName, source: source2, inline }) {
531648
+ let result = SchemaWithExample.enum({
531649
+ nameOverride,
531650
+ generatedName,
531651
+ title: title2,
531652
+ values: values2,
531653
+ description,
531654
+ availability,
531655
+ default: _default4,
531656
+ example: void 0,
531657
+ namespace,
531658
+ groupName,
531659
+ source: source2,
531660
+ inline
531661
+ });
531662
+ if (wrapAsNullable) {
531663
+ result = SchemaWithExample.nullable({
531664
+ nameOverride,
531665
+ generatedName,
531666
+ title: title2,
531667
+ value: result,
531668
+ description,
531669
+ availability,
531670
+ namespace,
531671
+ groupName,
531672
+ inline
531673
+ });
531674
+ }
531675
+ if (wrapAsOptional) {
531676
+ result = SchemaWithExample.optional({
531677
+ nameOverride,
531678
+ generatedName,
531679
+ title: title2,
531680
+ value: result,
531681
+ description,
531682
+ availability,
531683
+ namespace,
531684
+ groupName,
531685
+ inline
531686
+ });
531687
+ }
531688
+ return result;
531689
+ }
531690
+ function stripCommonPrefix(names2) {
531691
+ if (names2.length <= 1 || names2[0] == null) {
531692
+ return names2;
531693
+ }
531694
+ const nameZero = names2[0];
531695
+ let i9 = 0;
531696
+ while (nameZero[i9] != null && names2.every((name2) => name2[i9] === nameZero[i9])) {
531697
+ i9++;
531698
+ }
531699
+ return names2.map((name2) => name2.substring(i9));
531700
+ }
531701
+
531702
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertInteger.js
531703
+ function convertInteger({ nameOverride, generatedName, title: title2, format: format3, _default: _default4, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, description, availability, wrapAsOptional, wrapAsNullable, example, namespace, groupName, defaultIntegerFormat = generators_yml_exports.DefaultIntegerFormat.Int32 }) {
531704
+ const effectiveFormat = format3 ?? defaultIntegerFormat;
531705
+ const primitive = (() => {
531706
+ switch (effectiveFormat) {
531707
+ case generators_yml_exports.DefaultIntegerFormat.Int64:
531708
+ return PrimitiveSchemaValueWithExample.int64({ default: _default4, example });
531709
+ case generators_yml_exports.DefaultIntegerFormat.Uint32:
531710
+ return PrimitiveSchemaValueWithExample.uint({ default: _default4, example });
531711
+ case generators_yml_exports.DefaultIntegerFormat.Uint64:
531712
+ return PrimitiveSchemaValueWithExample.uint64({ default: _default4, example });
531713
+ default:
531714
+ return PrimitiveSchemaValueWithExample.int({
531715
+ default: _default4,
531716
+ minimum,
531717
+ maximum,
531718
+ exclusiveMinimum,
531719
+ exclusiveMaximum,
531720
+ multipleOf,
531721
+ example
531722
+ });
531723
+ }
531724
+ })();
531725
+ return wrapPrimitive({
531726
+ nameOverride,
531727
+ generatedName,
531728
+ title: title2,
531729
+ primitive,
531730
+ wrapAsOptional,
531731
+ wrapAsNullable,
531732
+ description,
531733
+ availability,
531734
+ namespace,
531735
+ groupName
531736
+ });
531737
+ }
531738
+
531739
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertLiteral.js
531740
+ function createLiteralSchemaValue(value2) {
531741
+ if (typeof value2 === "string") {
531742
+ return LiteralSchemaValue.string(value2);
531743
+ } else if (typeof value2 === "boolean") {
531744
+ return LiteralSchemaValue.boolean(value2);
531745
+ } else {
531746
+ return LiteralSchemaValue.string(`${value2}`);
531747
+ }
531748
+ }
531749
+ function convertLiteral({ nameOverride, generatedName, title: title2, wrapAsOptional, wrapAsNullable, value: value2, description, availability, namespace, groupName }) {
531750
+ let result = SchemaWithExample.literal({
531751
+ nameOverride,
531752
+ generatedName,
531753
+ title: title2,
531754
+ value: createLiteralSchemaValue(value2),
531755
+ description,
531756
+ availability,
531757
+ namespace,
531758
+ groupName
531759
+ });
531760
+ if (wrapAsNullable) {
531761
+ result = SchemaWithExample.nullable({
531762
+ nameOverride,
531763
+ generatedName,
531764
+ title: title2,
531765
+ value: result,
531766
+ description,
531767
+ availability,
531768
+ namespace,
531769
+ groupName,
531770
+ inline: void 0
531771
+ });
531772
+ }
531773
+ if (wrapAsOptional) {
531774
+ result = SchemaWithExample.optional({
531775
+ nameOverride,
531776
+ generatedName,
531777
+ title: title2,
531778
+ value: result,
531779
+ description,
531780
+ availability,
531781
+ namespace,
531782
+ groupName,
531783
+ inline: void 0
531784
+ });
531785
+ }
531786
+ return result;
531787
+ }
531788
+
531789
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertNumber.js
531790
+ function convertNumber({ nameOverride, generatedName, title: title2, format: format3, _default: _default4, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, description, availability, wrapAsOptional, wrapAsNullable, example, namespace, groupName }) {
531791
+ if (format3 == null || format3 === "double") {
531792
+ return wrapPrimitive({
531793
+ nameOverride,
531794
+ generatedName,
531795
+ title: title2,
531796
+ primitive: PrimitiveSchemaValueWithExample.double({
531797
+ default: _default4,
531798
+ minimum,
531799
+ maximum,
531800
+ exclusiveMinimum,
531801
+ exclusiveMaximum,
531802
+ multipleOf,
531803
+ example
531804
+ }),
531805
+ wrapAsOptional,
531806
+ wrapAsNullable,
531807
+ description,
531808
+ availability,
531809
+ namespace,
531810
+ groupName
531811
+ });
531812
+ } else if (format3 === "float") {
531813
+ return wrapPrimitive({
531814
+ nameOverride,
531815
+ generatedName,
531816
+ title: title2,
531817
+ primitive: PrimitiveSchemaValueWithExample.float({
531818
+ example
531819
+ }),
531820
+ wrapAsOptional,
531821
+ wrapAsNullable,
531822
+ description,
531823
+ availability,
531824
+ namespace,
531825
+ groupName
531826
+ });
531827
+ } else if (format3 === "int32") {
531828
+ return wrapPrimitive({
531829
+ nameOverride,
531830
+ generatedName,
531831
+ title: title2,
531832
+ primitive: PrimitiveSchemaValueWithExample.int({
531833
+ default: _default4,
531834
+ minimum,
531835
+ maximum,
531836
+ exclusiveMinimum,
531837
+ exclusiveMaximum,
531838
+ multipleOf,
531839
+ example
531840
+ }),
531841
+ wrapAsOptional,
531842
+ wrapAsNullable,
531843
+ description,
531844
+ availability,
531845
+ namespace,
531846
+ groupName
531847
+ });
531848
+ } else if (format3 === "int64") {
531849
+ return wrapPrimitive({
531850
+ nameOverride,
531851
+ generatedName,
531852
+ title: title2,
531853
+ primitive: PrimitiveSchemaValueWithExample.int64({
531854
+ default: _default4,
531855
+ example
531856
+ }),
531857
+ wrapAsOptional,
531858
+ wrapAsNullable,
531859
+ description,
531860
+ availability,
531861
+ namespace,
531862
+ groupName
531863
+ });
531864
+ } else if (format3 === "uint32") {
531865
+ return wrapPrimitive({
531866
+ nameOverride,
531867
+ generatedName,
531868
+ title: title2,
531869
+ primitive: PrimitiveSchemaValueWithExample.uint({
531870
+ default: _default4,
531871
+ example
531872
+ }),
531873
+ wrapAsOptional,
531874
+ wrapAsNullable,
531875
+ description,
531876
+ availability,
531877
+ namespace,
531878
+ groupName
531879
+ });
531880
+ } else if (format3 === "uint64") {
531881
+ return wrapPrimitive({
531882
+ nameOverride,
531883
+ generatedName,
531884
+ title: title2,
531885
+ primitive: PrimitiveSchemaValueWithExample.uint64({
531886
+ default: _default4,
531887
+ example
531888
+ }),
531889
+ wrapAsOptional,
531890
+ wrapAsNullable,
531891
+ description,
531892
+ availability,
531893
+ namespace,
531894
+ groupName
531895
+ });
531896
+ } else if (format3 === "time-delta") {
531897
+ return wrapPrimitive({
531898
+ nameOverride,
531899
+ generatedName,
531900
+ title: title2,
531901
+ primitive: PrimitiveSchemaValueWithExample.float({
531902
+ example
531903
+ }),
531904
+ wrapAsOptional,
531905
+ wrapAsNullable,
531906
+ description,
531907
+ availability,
531908
+ namespace,
531909
+ groupName
531910
+ });
531911
+ }
531912
+ return wrapPrimitive({
531913
+ nameOverride,
531914
+ generatedName,
531915
+ title: title2,
531916
+ primitive: PrimitiveSchemaValueWithExample.float({
531917
+ example
531918
+ }),
531919
+ wrapAsOptional,
531920
+ wrapAsNullable,
531921
+ description,
531922
+ availability,
531923
+ namespace,
531924
+ groupName
531925
+ });
531926
+ }
531927
+
531869
531928
  // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertUndiscriminatedOneOf.js
531870
531929
  init_lodash();
531871
531930
  function convertUndiscriminatedOneOf({ nameOverride, generatedName, title: title2, breadcrumbs, description, availability, wrapAsOptional, wrapAsNullable, context: context3, subtypes, namespace, groupName, encoding, source: source2, subtypeSuffixOverrides, properties: properties7, required: required6 }) {
@@ -541303,7 +541362,8 @@ var FIELD_MAPPINGS = {
541303
541362
  pathParameterOrder: "pathParameterOrder",
541304
541363
  resolveSchemaCollisions: "resolveSchemaCollisions",
541305
541364
  inferForwardCompatible: "inferForwardCompatible",
541306
- coerceConstsTo: "coerceConstsTo"
541365
+ coerceConstsTo: "coerceConstsTo",
541366
+ shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties"
541307
541367
  };
541308
541368
  function setIfDefined2(target, key2, value2) {
541309
541369
  if (value2 !== void 0) {
@@ -550402,7 +550462,8 @@ var UNDEFINED_API_DEFINITION_SETTINGS = {
550402
550462
  defaultIntegerFormat: void 0,
550403
550463
  resolveSchemaCollisions: void 0,
550404
550464
  inferForwardCompatible: void 0,
550405
- coerceConstsTo: void 0
550465
+ coerceConstsTo: void 0,
550466
+ shouldInferDiscriminatedUnionBaseProperties: void 0
550406
550467
  };
550407
550468
  async function convertGeneratorsConfiguration({ absolutePathToGeneratorsConfiguration, rawGeneratorsConfiguration, context: context3 }) {
550408
550469
  const maybeTopLevelMetadata = getOutputMetadata(rawGeneratorsConfiguration.metadata);
@@ -550471,7 +550532,8 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
550471
550532
  groupEnvironmentsByHost: settings?.["group-environments-by-host"],
550472
550533
  multiServerStrategy: settings?.["multi-server-strategy"],
550473
550534
  defaultIntegerFormat: settings?.["default-integer-format"],
550474
- pathParameterOrder: settings?.["path-parameter-order"]
550535
+ pathParameterOrder: settings?.["path-parameter-order"],
550536
+ shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"]
550475
550537
  };
550476
550538
  }
550477
550539
  function parseAsyncApiDefinitionSettingsSchema(settings) {
@@ -614311,7 +614373,14 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
614311
614373
  * The default format to use for integer types when no format is specified in the OpenAPI schema.
614312
614374
  * Defaults to int32.
614313
614375
  */
614314
- defaultIntegerFormat: DefaultIntegerFormatSchema.optional()
614376
+ defaultIntegerFormat: DefaultIntegerFormatSchema.optional(),
614377
+ /**
614378
+ * If true, properties shared by every variant of a discriminated `oneOf`
614379
+ * (including via `allOf`/`$ref`) are lifted into the union's base properties
614380
+ * so SDKs can expose them directly on the union type without casting.
614381
+ * Defaults to false.
614382
+ */
614383
+ inferDiscriminatedUnionBaseProperties: external_exports.boolean().optional()
614315
614384
  });
614316
614385
 
614317
614386
  // ../config/lib/schemas/specs/OpenApiSpecSchema.js
@@ -621196,7 +621265,7 @@ var AccessTokenPosthogManager = class {
621196
621265
  properties: {
621197
621266
  ...event,
621198
621267
  ...event.properties,
621199
- version: "4.106.3",
621268
+ version: "4.107.0",
621200
621269
  usingAccessToken: true
621201
621270
  }
621202
621271
  });
@@ -621250,7 +621319,7 @@ var UserPosthogManager = class {
621250
621319
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
621251
621320
  event: "CLI",
621252
621321
  properties: {
621253
- version: "4.106.3",
621322
+ version: "4.107.0",
621254
621323
  ...event,
621255
621324
  ...event.properties,
621256
621325
  usingAccessToken: false,
@@ -626585,7 +626654,8 @@ var LegacyApiSpecAdapter = class {
626585
626654
  resolveAliases: settings.resolveAliases,
626586
626655
  groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
626587
626656
  defaultIntegerFormat: this.adaptDefaultIntegerFormat(settings.defaultIntegerFormat),
626588
- coerceConstsTo: settings.coerceConstsTo
626657
+ coerceConstsTo: settings.coerceConstsTo,
626658
+ shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties
626589
626659
  };
626590
626660
  const hasSettings = Object.values(result).some((v9) => v9 != null);
626591
626661
  return hasSettings ? result : void 0;
@@ -829478,6 +829548,7 @@ var SETTINGS_KEY_MAP = {
829478
829548
  "resolve-aliases": "resolveAliases",
829479
829549
  "group-multi-api-environments": "groupMultiApiEnvironments",
829480
829550
  "default-integer-format": "defaultIntegerFormat",
829551
+ "infer-discriminated-union-base-properties": "inferDiscriminatedUnionBaseProperties",
829481
829552
  // AsyncAPI-specific settings
829482
829553
  "message-naming": "messageNaming"
829483
829554
  };
@@ -832891,7 +832962,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
832891
832962
  var LOGS_FOLDER_NAME = "logs";
832892
832963
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
832893
832964
  function getCliSource() {
832894
- const version7 = "4.106.3";
832965
+ const version7 = "4.107.0";
832895
832966
  return `cli@${version7}`;
832896
832967
  }
832897
832968
  var DebugLogger = class {
@@ -845300,7 +845371,7 @@ var LegacyDocsPublisher = class {
845300
845371
  previewId,
845301
845372
  disableTemplates: void 0,
845302
845373
  skipUpload,
845303
- cliVersion: "4.106.3",
845374
+ cliVersion: "4.107.0",
845304
845375
  loginCommand: "fern auth login"
845305
845376
  });
845306
845377
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -919401,7 +919472,7 @@ var CliContext = class _CliContext {
919401
919472
  if (false) {
919402
919473
  this.logger.error("CLI_VERSION is not defined");
919403
919474
  }
919404
- return "4.106.3";
919475
+ return "4.107.0";
919405
919476
  }
919406
919477
  getCliName() {
919407
919478
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.106.3",
2
+ "version": "4.107.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",