@fern-api/fern-api-dev 4.106.3 → 4.107.0-5-g8e65b2fdec8
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.
- package/cli.cjs +869 -668
- 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"
|
|
@@ -531828,42 +531264,665 @@ function wrapObject({ nameOverride, generatedName, title: title2, wrapAsOptional
|
|
|
531828
531264
|
}
|
|
531829
531265
|
return result;
|
|
531830
531266
|
}
|
|
531831
|
-
function getNonIgnoredProperties({ properties: properties7, breadcrumbs, context: context3 }) {
|
|
531832
|
-
return Object.fromEntries(Object.entries(properties7).filter(([key2, propertySchema]) => {
|
|
531833
|
-
const shouldIgnore = getExtension(propertySchema, FernOpenAPIExtension.IGNORE);
|
|
531834
|
-
if (shouldIgnore) {
|
|
531835
|
-
context3.logger.debug(`Property ${breadcrumbs.join(".")}.${key2} is marked with x-fern-ignore. Skipping.`);
|
|
531836
|
-
}
|
|
531837
|
-
return !shouldIgnore;
|
|
531838
|
-
}));
|
|
531839
|
-
}
|
|
531840
|
-
function filterNotProperties(schema2) {
|
|
531841
|
-
if (schema2.properties == null) {
|
|
531842
|
-
return schema2;
|
|
531843
|
-
}
|
|
531844
|
-
const filteredProperties = {};
|
|
531845
|
-
for (const [key2, propertySchema] of Object.entries(schema2.properties)) {
|
|
531846
|
-
if (!isReferenceObject(propertySchema) && "not" in propertySchema) {
|
|
531847
|
-
continue;
|
|
531848
|
-
}
|
|
531849
|
-
filteredProperties[key2] = propertySchema;
|
|
531850
|
-
}
|
|
531851
|
-
return { ...schema2, properties: filteredProperties };
|
|
531852
|
-
}
|
|
531853
|
-
function getAllProperties({ schema: schema2, context: context3, breadcrumbs, source: source2, namespace }) {
|
|
531854
|
-
let properties7 = {};
|
|
531855
|
-
const [resolvedSchema, resolvedBreadCrumbs] = isReferenceObject(schema2) ? [context3.resolveSchemaReference(schema2), getBreadcrumbsFromReference(schema2.$ref)] : [schema2, breadcrumbs];
|
|
531856
|
-
for (const allOfElement of resolvedSchema.allOf ?? []) {
|
|
531857
|
-
properties7 = {
|
|
531858
|
-
...properties7,
|
|
531859
|
-
...getAllProperties({ schema: allOfElement, context: context3, breadcrumbs: resolvedBreadCrumbs, source: source2, namespace })
|
|
531860
|
-
};
|
|
531861
|
-
}
|
|
531862
|
-
for (const [propertyName, propertySchema] of Object.entries(getNonIgnoredProperties({ properties: resolvedSchema.properties ?? {}, breadcrumbs, context: context3 }))) {
|
|
531863
|
-
const convertedPropertySchema = convertSchema2(propertySchema, false, false, context3, [...resolvedBreadCrumbs, propertyName], source2, namespace);
|
|
531864
|
-
properties7[propertyName] = convertedPropertySchema;
|
|
531267
|
+
function getNonIgnoredProperties({ properties: properties7, breadcrumbs, context: context3 }) {
|
|
531268
|
+
return Object.fromEntries(Object.entries(properties7).filter(([key2, propertySchema]) => {
|
|
531269
|
+
const shouldIgnore = getExtension(propertySchema, FernOpenAPIExtension.IGNORE);
|
|
531270
|
+
if (shouldIgnore) {
|
|
531271
|
+
context3.logger.debug(`Property ${breadcrumbs.join(".")}.${key2} is marked with x-fern-ignore. Skipping.`);
|
|
531272
|
+
}
|
|
531273
|
+
return !shouldIgnore;
|
|
531274
|
+
}));
|
|
531275
|
+
}
|
|
531276
|
+
function filterNotProperties(schema2) {
|
|
531277
|
+
if (schema2.properties == null) {
|
|
531278
|
+
return schema2;
|
|
531279
|
+
}
|
|
531280
|
+
const filteredProperties = {};
|
|
531281
|
+
for (const [key2, propertySchema] of Object.entries(schema2.properties)) {
|
|
531282
|
+
if (!isReferenceObject(propertySchema) && "not" in propertySchema) {
|
|
531283
|
+
continue;
|
|
531284
|
+
}
|
|
531285
|
+
filteredProperties[key2] = propertySchema;
|
|
531286
|
+
}
|
|
531287
|
+
return { ...schema2, properties: filteredProperties };
|
|
531288
|
+
}
|
|
531289
|
+
function getAllProperties({ schema: schema2, context: context3, breadcrumbs, source: source2, namespace }) {
|
|
531290
|
+
let properties7 = {};
|
|
531291
|
+
const [resolvedSchema, resolvedBreadCrumbs] = isReferenceObject(schema2) ? [context3.resolveSchemaReference(schema2), getBreadcrumbsFromReference(schema2.$ref)] : [schema2, breadcrumbs];
|
|
531292
|
+
for (const allOfElement of resolvedSchema.allOf ?? []) {
|
|
531293
|
+
properties7 = {
|
|
531294
|
+
...properties7,
|
|
531295
|
+
...getAllProperties({ schema: allOfElement, context: context3, breadcrumbs: resolvedBreadCrumbs, source: source2, namespace })
|
|
531296
|
+
};
|
|
531297
|
+
}
|
|
531298
|
+
for (const [propertyName, propertySchema] of Object.entries(getNonIgnoredProperties({ properties: resolvedSchema.properties ?? {}, breadcrumbs, context: context3 }))) {
|
|
531299
|
+
const convertedPropertySchema = convertSchema2(propertySchema, false, false, context3, [...resolvedBreadCrumbs, propertyName], source2, namespace);
|
|
531300
|
+
properties7[propertyName] = convertedPropertySchema;
|
|
531301
|
+
}
|
|
531302
|
+
return properties7;
|
|
531303
|
+
}
|
|
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
|
+
});
|
|
531865
531911
|
}
|
|
531866
|
-
return
|
|
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
|
+
});
|
|
531867
531926
|
}
|
|
531868
531927
|
|
|
531869
531928
|
// ../api-importers/openapi/openapi-ir-parser/lib/schema/convertUndiscriminatedOneOf.js
|
|
@@ -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.
|
|
621268
|
+
version: "4.107.0-5-g8e65b2fdec8",
|
|
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.
|
|
621322
|
+
version: "4.107.0-5-g8e65b2fdec8",
|
|
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.
|
|
832965
|
+
const version7 = "4.107.0-5-g8e65b2fdec8";
|
|
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.
|
|
845374
|
+
cliVersion: "4.107.0-5-g8e65b2fdec8",
|
|
845304
845375
|
loginCommand: "fern auth login"
|
|
845305
845376
|
});
|
|
845306
845377
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -881373,52 +881444,6 @@ var Begin = class extends AstNode6 {
|
|
|
881373
881444
|
}
|
|
881374
881445
|
};
|
|
881375
881446
|
|
|
881376
|
-
// ../../../generators/ruby-v2/ast/lib/ast/IfElse.js
|
|
881377
|
-
var IfElse = class extends AstNode6 {
|
|
881378
|
-
ifBranch;
|
|
881379
|
-
elseIfs;
|
|
881380
|
-
elseBody;
|
|
881381
|
-
constructor({ if: ifBranch, elseIf, elseBody }) {
|
|
881382
|
-
super();
|
|
881383
|
-
this.ifBranch = ifBranch;
|
|
881384
|
-
this.elseIfs = elseIf ?? [];
|
|
881385
|
-
this.elseBody = elseBody ? Array.isArray(elseBody) ? elseBody : [elseBody] : void 0;
|
|
881386
|
-
}
|
|
881387
|
-
write(writer2) {
|
|
881388
|
-
writer2.write("if ");
|
|
881389
|
-
this.ifBranch.condition.write(writer2);
|
|
881390
|
-
writer2.writeLine();
|
|
881391
|
-
writer2.indent();
|
|
881392
|
-
for (const stmt of this.ifBranch.thenBody) {
|
|
881393
|
-
stmt.write(writer2);
|
|
881394
|
-
writer2.writeNewLineIfLastLineNot();
|
|
881395
|
-
}
|
|
881396
|
-
writer2.dedent();
|
|
881397
|
-
for (const elseIf of this.elseIfs) {
|
|
881398
|
-
writer2.write("elsif ");
|
|
881399
|
-
elseIf.condition.write(writer2);
|
|
881400
|
-
writer2.writeLine();
|
|
881401
|
-
writer2.indent();
|
|
881402
|
-
for (const stmt of elseIf.thenBody) {
|
|
881403
|
-
stmt.write(writer2);
|
|
881404
|
-
writer2.writeNewLineIfLastLineNot();
|
|
881405
|
-
}
|
|
881406
|
-
writer2.dedent();
|
|
881407
|
-
}
|
|
881408
|
-
if (this.elseBody && this.elseBody.length > 0) {
|
|
881409
|
-
writer2.writeLine("else");
|
|
881410
|
-
writer2.indent();
|
|
881411
|
-
for (const stmt of this.elseBody) {
|
|
881412
|
-
stmt.write(writer2);
|
|
881413
|
-
writer2.writeNewLineIfLastLineNot();
|
|
881414
|
-
}
|
|
881415
|
-
writer2.dedent();
|
|
881416
|
-
}
|
|
881417
|
-
writer2.write("end");
|
|
881418
|
-
writer2.writeNewLineIfLastLineNot();
|
|
881419
|
-
}
|
|
881420
|
-
};
|
|
881421
|
-
|
|
881422
881447
|
// ../../../generators/ruby-v2/ast/lib/ast/Comment.js
|
|
881423
881448
|
var MAX_LINE_LENGTH2 = 120;
|
|
881424
881449
|
var COMMENT_PREFIX_LENGTH = 2;
|
|
@@ -882065,19 +882090,20 @@ var Class_ = class extends Module_ {
|
|
|
882065
882090
|
writer2.writeLine("; end");
|
|
882066
882091
|
return;
|
|
882067
882092
|
}
|
|
882068
|
-
if (this.statements.length) {
|
|
882093
|
+
if (this.statements.length || this.methods.length) {
|
|
882069
882094
|
writer2.newLine();
|
|
882070
882095
|
writer2.indent();
|
|
882071
882096
|
this.statements.forEach((statement, index3) => {
|
|
882072
882097
|
statement.write(writer2);
|
|
882073
|
-
writer2.
|
|
882098
|
+
writer2.writeNewLineIfLastLineNot();
|
|
882099
|
+
if (index3 < this.statements.length - 1) {
|
|
882100
|
+
writer2.newLine();
|
|
882101
|
+
}
|
|
882074
882102
|
});
|
|
882075
|
-
|
|
882076
|
-
|
|
882077
|
-
|
|
882078
|
-
|
|
882079
|
-
writer2.indent();
|
|
882080
|
-
this.methods.forEach((method8) => {
|
|
882103
|
+
this.methods.forEach((method8, index3) => {
|
|
882104
|
+
if (index3 > 0 || this.statements.length > 0) {
|
|
882105
|
+
writer2.newLine();
|
|
882106
|
+
}
|
|
882081
882107
|
method8.write(writer2);
|
|
882082
882108
|
});
|
|
882083
882109
|
writer2.dedent();
|
|
@@ -882115,6 +882141,112 @@ var Class_ = class extends Module_ {
|
|
|
882115
882141
|
}
|
|
882116
882142
|
};
|
|
882117
882143
|
|
|
882144
|
+
// ../../../generators/ruby-v2/ast/lib/ast/IfElse.js
|
|
882145
|
+
var IfElse = class extends AstNode6 {
|
|
882146
|
+
ifBranch;
|
|
882147
|
+
elseIfs;
|
|
882148
|
+
elseBody;
|
|
882149
|
+
constructor({ if: ifBranch, elseIf, elseBody }) {
|
|
882150
|
+
super();
|
|
882151
|
+
this.ifBranch = ifBranch;
|
|
882152
|
+
this.elseIfs = elseIf ?? [];
|
|
882153
|
+
this.elseBody = elseBody ? Array.isArray(elseBody) ? elseBody : [elseBody] : void 0;
|
|
882154
|
+
}
|
|
882155
|
+
write(writer2) {
|
|
882156
|
+
const modifier = this.renderAsModifier(writer2);
|
|
882157
|
+
if (modifier != null) {
|
|
882158
|
+
writer2.write(modifier);
|
|
882159
|
+
writer2.writeNewLineIfLastLineNot();
|
|
882160
|
+
return;
|
|
882161
|
+
}
|
|
882162
|
+
writer2.write("if ");
|
|
882163
|
+
this.ifBranch.condition.write(writer2);
|
|
882164
|
+
writer2.writeLine();
|
|
882165
|
+
writer2.indent();
|
|
882166
|
+
for (const stmt of this.ifBranch.thenBody) {
|
|
882167
|
+
stmt.write(writer2);
|
|
882168
|
+
writer2.writeNewLineIfLastLineNot();
|
|
882169
|
+
}
|
|
882170
|
+
writer2.dedent();
|
|
882171
|
+
for (const elseIf of this.elseIfs) {
|
|
882172
|
+
writer2.write("elsif ");
|
|
882173
|
+
elseIf.condition.write(writer2);
|
|
882174
|
+
writer2.writeLine();
|
|
882175
|
+
writer2.indent();
|
|
882176
|
+
for (const stmt of elseIf.thenBody) {
|
|
882177
|
+
stmt.write(writer2);
|
|
882178
|
+
writer2.writeNewLineIfLastLineNot();
|
|
882179
|
+
}
|
|
882180
|
+
writer2.dedent();
|
|
882181
|
+
}
|
|
882182
|
+
if (this.elseBody && this.elseBody.length > 0) {
|
|
882183
|
+
writer2.writeLine("else");
|
|
882184
|
+
writer2.indent();
|
|
882185
|
+
for (const stmt of this.elseBody) {
|
|
882186
|
+
stmt.write(writer2);
|
|
882187
|
+
writer2.writeNewLineIfLastLineNot();
|
|
882188
|
+
}
|
|
882189
|
+
writer2.dedent();
|
|
882190
|
+
}
|
|
882191
|
+
writer2.write("end");
|
|
882192
|
+
writer2.writeNewLineIfLastLineNot();
|
|
882193
|
+
}
|
|
882194
|
+
/**
|
|
882195
|
+
* Returns the modifier-form rendering (`stmt if cond`) when this if is
|
|
882196
|
+
* eligible:
|
|
882197
|
+
* - exactly one statement in the then-body
|
|
882198
|
+
* - no elsif and no else
|
|
882199
|
+
* - the single statement is not an intrinsically multi-line AST node
|
|
882200
|
+
* (Class, Module, Method, Begin, IfElse)
|
|
882201
|
+
* - the rendered statement and condition each fit on a single line
|
|
882202
|
+
*
|
|
882203
|
+
* Returns undefined when the shape isn't eligible, in which case the caller
|
|
882204
|
+
* falls back to explicit if/end form.
|
|
882205
|
+
*
|
|
882206
|
+
* The generator's .rubocop.yml disables Layout/LineLength, so rubocop's
|
|
882207
|
+
* Style/IfUnlessModifier accepts modifier form at any line length. Shape
|
|
882208
|
+
* eligibility is therefore sufficient; we don't gate on a max-line-length
|
|
882209
|
+
* budget here.
|
|
882210
|
+
*/
|
|
882211
|
+
renderAsModifier(writer2) {
|
|
882212
|
+
if (this.ifBranch.thenBody.length !== 1) {
|
|
882213
|
+
return void 0;
|
|
882214
|
+
}
|
|
882215
|
+
if (this.elseIfs.length > 0) {
|
|
882216
|
+
return void 0;
|
|
882217
|
+
}
|
|
882218
|
+
if (this.elseBody != null && this.elseBody.length > 0) {
|
|
882219
|
+
return void 0;
|
|
882220
|
+
}
|
|
882221
|
+
const stmt = this.ifBranch.thenBody[0];
|
|
882222
|
+
if (stmt == null) {
|
|
882223
|
+
return void 0;
|
|
882224
|
+
}
|
|
882225
|
+
if (isKnownMultiLineNode(stmt) || isKnownMultiLineNode(this.ifBranch.condition)) {
|
|
882226
|
+
return void 0;
|
|
882227
|
+
}
|
|
882228
|
+
const stmtRendered = renderNode(stmt, writer2);
|
|
882229
|
+
const conditionRendered = renderNode(this.ifBranch.condition, writer2);
|
|
882230
|
+
if (stmtRendered.length === 0 || conditionRendered.length === 0) {
|
|
882231
|
+
return void 0;
|
|
882232
|
+
}
|
|
882233
|
+
if (stmtRendered.includes("\n") || conditionRendered.includes("\n")) {
|
|
882234
|
+
return void 0;
|
|
882235
|
+
}
|
|
882236
|
+
return `${stmtRendered} if ${conditionRendered}`;
|
|
882237
|
+
}
|
|
882238
|
+
};
|
|
882239
|
+
function isKnownMultiLineNode(node4) {
|
|
882240
|
+
return node4 instanceof Class_ || node4 instanceof Module_ || node4 instanceof Method6 || node4 instanceof Begin || node4 instanceof IfElse;
|
|
882241
|
+
}
|
|
882242
|
+
function renderNode(node4, parentWriter) {
|
|
882243
|
+
const rendered = node4.toString({
|
|
882244
|
+
customConfig: parentWriter.customConfig,
|
|
882245
|
+
formatter: parentWriter.formatter
|
|
882246
|
+
});
|
|
882247
|
+
return rendered.replace(/\n+$/, "");
|
|
882248
|
+
}
|
|
882249
|
+
|
|
882118
882250
|
// ../../../generators/ruby-v2/ast/lib/ast/ClassInstantiation.js
|
|
882119
882251
|
var ClassInstantiation5 = class extends AstNode6 {
|
|
882120
882252
|
classReference;
|
|
@@ -882375,9 +882507,36 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
|
|
|
882375
882507
|
super();
|
|
882376
882508
|
this.internalType = internalType;
|
|
882377
882509
|
}
|
|
882510
|
+
/**
|
|
882511
|
+
* Returns a stable string representation of this literal suitable for
|
|
882512
|
+
* deduplicating hash keys (see Lint/DuplicateHashKey). Returns undefined
|
|
882513
|
+
* for compound/dynamic shapes where value equality isn't decidable at
|
|
882514
|
+
* emit time.
|
|
882515
|
+
*/
|
|
882516
|
+
getDedupKey() {
|
|
882517
|
+
switch (this.internalType.type) {
|
|
882518
|
+
case "str":
|
|
882519
|
+
return `str:${this.internalType.value}`;
|
|
882520
|
+
case "interpolatedStr":
|
|
882521
|
+
return `istr:${this.internalType.value}`;
|
|
882522
|
+
case "int":
|
|
882523
|
+
return `int:${this.internalType.value}`;
|
|
882524
|
+
case "float":
|
|
882525
|
+
return `float:${this.internalType.value}`;
|
|
882526
|
+
case "bool":
|
|
882527
|
+
return `bool:${this.internalType.value}`;
|
|
882528
|
+
case "nil":
|
|
882529
|
+
return "nil";
|
|
882530
|
+
default:
|
|
882531
|
+
return void 0;
|
|
882532
|
+
}
|
|
882533
|
+
}
|
|
882378
882534
|
static string(value2) {
|
|
882379
882535
|
return new this({ type: "str", value: value2 });
|
|
882380
882536
|
}
|
|
882537
|
+
static interpolatedString(value2) {
|
|
882538
|
+
return new this({ type: "interpolatedStr", value: value2 });
|
|
882539
|
+
}
|
|
882381
882540
|
static integer(value2) {
|
|
882382
882541
|
return new this({ type: "int", value: value2 });
|
|
882383
882542
|
}
|
|
@@ -882414,6 +882573,11 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
|
|
|
882414
882573
|
write(writer2) {
|
|
882415
882574
|
switch (this.internalType.type) {
|
|
882416
882575
|
case "str": {
|
|
882576
|
+
const value2 = this.internalType.value.replaceAll("\r\n", "\n");
|
|
882577
|
+
writer2.write(`"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replace(/#(?=[{$@])/g, "\\#")}"`);
|
|
882578
|
+
break;
|
|
882579
|
+
}
|
|
882580
|
+
case "interpolatedStr": {
|
|
882417
882581
|
const value2 = this.internalType.value.replaceAll("\r\n", "\n");
|
|
882418
882582
|
writer2.write(`"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`);
|
|
882419
882583
|
break;
|
|
@@ -882431,7 +882595,21 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
|
|
|
882431
882595
|
break;
|
|
882432
882596
|
}
|
|
882433
882597
|
case "hash": {
|
|
882434
|
-
const
|
|
882598
|
+
const filteredEntries = this.internalType.entries.filter((entry) => !_TypeLiteral.isNop(entry.key) && !_TypeLiteral.isNop(entry.value));
|
|
882599
|
+
const seenKeys = /* @__PURE__ */ new Map();
|
|
882600
|
+
filteredEntries.forEach((entry, index3) => {
|
|
882601
|
+
const rendered = renderKeyForDedup(entry.key);
|
|
882602
|
+
if (rendered != null) {
|
|
882603
|
+
seenKeys.set(rendered, index3);
|
|
882604
|
+
}
|
|
882605
|
+
});
|
|
882606
|
+
const entries23 = filteredEntries.filter((entry, index3) => {
|
|
882607
|
+
const rendered = renderKeyForDedup(entry.key);
|
|
882608
|
+
if (rendered == null) {
|
|
882609
|
+
return true;
|
|
882610
|
+
}
|
|
882611
|
+
return seenKeys.get(rendered) === index3;
|
|
882612
|
+
});
|
|
882435
882613
|
if (entries23.length === 0) {
|
|
882436
882614
|
writer2.write("{}");
|
|
882437
882615
|
break;
|
|
@@ -882511,6 +882689,12 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
|
|
|
882511
882689
|
}
|
|
882512
882690
|
}
|
|
882513
882691
|
};
|
|
882692
|
+
function renderKeyForDedup(key2) {
|
|
882693
|
+
if (!(key2 instanceof TypeLiteral3)) {
|
|
882694
|
+
return void 0;
|
|
882695
|
+
}
|
|
882696
|
+
return key2.getDedupKey();
|
|
882697
|
+
}
|
|
882514
882698
|
|
|
882515
882699
|
// ../../../generators/ruby-v2/ast/lib/ast/TypeParameter.js
|
|
882516
882700
|
var Variance;
|
|
@@ -883473,6 +883657,7 @@ var EndpointSnippetGenerator7 = class {
|
|
|
883473
883657
|
invokeMethodArgs.keywordArguments = invokeMethodArgs.keywordArguments ?? [];
|
|
883474
883658
|
invokeMethodArgs.keywordArguments.push(requestOptions);
|
|
883475
883659
|
}
|
|
883660
|
+
invokeMethodArgs.keywordArguments = dedupeKeywordArguments(invokeMethodArgs.keywordArguments);
|
|
883476
883661
|
return ruby_exports.invokeMethod(invokeMethodArgs);
|
|
883477
883662
|
}
|
|
883478
883663
|
/**
|
|
@@ -883506,6 +883691,7 @@ var EndpointSnippetGenerator7 = class {
|
|
|
883506
883691
|
invokeMethodArgs.keywordArguments = invokeMethodArgs.keywordArguments ?? [];
|
|
883507
883692
|
invokeMethodArgs.keywordArguments.push(requestOptions);
|
|
883508
883693
|
}
|
|
883694
|
+
invokeMethodArgs.keywordArguments = dedupeKeywordArguments(invokeMethodArgs.keywordArguments);
|
|
883509
883695
|
return ruby_exports.invokeMethod(invokeMethodArgs);
|
|
883510
883696
|
}
|
|
883511
883697
|
/**
|
|
@@ -883842,6 +884028,21 @@ var EndpointSnippetGenerator7 = class {
|
|
|
883842
884028
|
return this.context.getMethodName(endpoint3.declaration.name);
|
|
883843
884029
|
}
|
|
883844
884030
|
};
|
|
884031
|
+
function dedupeKeywordArguments(kwargs) {
|
|
884032
|
+
if (kwargs == null || kwargs.length <= 1) {
|
|
884033
|
+
return kwargs;
|
|
884034
|
+
}
|
|
884035
|
+
const lastIndexByName = /* @__PURE__ */ new Map();
|
|
884036
|
+
kwargs.forEach((arg, index3) => {
|
|
884037
|
+
lastIndexByName.set(arg.name, index3);
|
|
884038
|
+
});
|
|
884039
|
+
const deduped = kwargs.filter((arg, index3) => lastIndexByName.get(arg.name) === index3);
|
|
884040
|
+
if (deduped.length !== kwargs.length) {
|
|
884041
|
+
const droppedNames = Array.from(new Set(kwargs.map((arg) => arg.name).filter((name2, index3) => lastIndexByName.get(name2) !== index3)));
|
|
884042
|
+
console.warn(`[ruby-v2 dynamic-snippets] duplicate keyword argument name(s) [${droppedNames.join(", ")}] in a generated snippet; keeping last occurrence to match **params runtime behavior. This indicates a latent name collision in the Ruby SDK method signature that should be disambiguated at the generator level.`);
|
|
884043
|
+
}
|
|
884044
|
+
return deduped;
|
|
884045
|
+
}
|
|
883845
884046
|
|
|
883846
884047
|
// ../../../generators/ruby-v2/dynamic-snippets/lib/DynamicSnippetsGenerator.js
|
|
883847
884048
|
var DynamicSnippetsGenerator6 = class extends AbstractDynamicSnippetsGenerator {
|
|
@@ -919401,7 +919602,7 @@ var CliContext = class _CliContext {
|
|
|
919401
919602
|
if (false) {
|
|
919402
919603
|
this.logger.error("CLI_VERSION is not defined");
|
|
919403
919604
|
}
|
|
919404
|
-
return "4.
|
|
919605
|
+
return "4.107.0-5-g8e65b2fdec8";
|
|
919405
919606
|
}
|
|
919406
919607
|
getCliName() {
|
|
919407
919608
|
if (false) {
|