@fern-api/fern-api-dev 4.106.3 → 4.107.0-11-g58f57e9e0ec

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 +912 -671
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -340394,9 +340394,9 @@ var require_diff3 = __commonJS({
340394
340394
  }
340395
340395
  });
340396
340396
 
340397
- // ../../../node_modules/.pnpm/@fern-api+replay@0.12.0/node_modules/@fern-api/replay/dist/index.cjs
340397
+ // ../../../node_modules/.pnpm/@fern-api+replay@0.13.0/node_modules/@fern-api/replay/dist/index.cjs
340398
340398
  var require_dist14 = __commonJS({
340399
- "../../../node_modules/.pnpm/@fern-api+replay@0.12.0/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
340399
+ "../../../node_modules/.pnpm/@fern-api+replay@0.13.0/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
340400
340400
  "use strict";
340401
340401
  var __defProp4 = Object.defineProperty;
340402
340402
  var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
@@ -341136,17 +341136,57 @@ var require_dist14 = __commonJS({
341136
341136
  }
341137
341137
  const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
341138
341138
  if (!isAncestor) {
341139
+ return this.detectPatchesViaMergeBase(lastGen, lock);
341140
+ }
341141
+ return this.detectPatchesInRange(lastGen.commit_sha, lastGen, lock);
341142
+ }
341143
+ /**
341144
+ * FER-10201 — Non-linear-history detection via `merge-base(prevGen, HEAD)`.
341145
+ *
341146
+ * After a squash-merge of a Fern-bot PR, `lastGen.commit_sha` (the previous
341147
+ * `[fern-generated]`) is orphaned but still in git's object database. The
341148
+ * merge-base is the commit on main from which the bot's branch was created —
341149
+ * a reachable ancestor of HEAD. Walking that range and classifying each
341150
+ * commit via `isGenerationCommit` mirrors the linear path and eliminates
341151
+ * the bug class where pipeline-driven changes (autoversion, replay,
341152
+ * generation) get bundled as customer customizations.
341153
+ *
341154
+ * Falls through to the legacy composite path when no common ancestor exists
341155
+ * (truly disjoint history — orphan branches with no shared root).
341156
+ */
341157
+ async detectPatchesViaMergeBase(lastGen, lock) {
341158
+ let mergeBase = "";
341159
+ try {
341160
+ mergeBase = (await this.git.exec(["merge-base", lastGen.commit_sha, "HEAD"])).trim();
341161
+ } catch {
341162
+ }
341163
+ if (!mergeBase) {
341164
+ this.warnings.push(
341165
+ `No common ancestor between previous generation ${lastGen.commit_sha.slice(0, 7)} and HEAD. Falling back to composite tree-diff detection.`
341166
+ );
341139
341167
  return this.detectPatchesViaTreeDiff(
341140
341168
  lastGen,
341141
341169
  /* commitKnownMissing */
341142
341170
  false
341143
341171
  );
341144
341172
  }
341173
+ return this.detectPatchesInRange(mergeBase, lastGen, lock);
341174
+ }
341175
+ /**
341176
+ * FER-10201 — Walk `${rangeStart}..HEAD`, classify each commit, emit one
341177
+ * `StoredPatch` per customer commit. Body shared by the linear path
341178
+ * (rangeStart = lastGen.commit_sha) and the merge-base path.
341179
+ *
341180
+ * Patch `base_generation` is always `lastGen.commit_sha` — the
341181
+ * lockfile-tracked reference the applicator uses to fetch base file
341182
+ * content, regardless of where the walk actually started.
341183
+ */
341184
+ async detectPatchesInRange(rangeStart, lastGen, lock) {
341145
341185
  const log4 = await this.git.exec([
341146
341186
  "log",
341147
341187
  "--first-parent",
341148
341188
  "--format=%H%x00%an%x00%ae%x00%s",
341149
- `${lastGen.commit_sha}..HEAD`,
341189
+ `${rangeStart}..HEAD`,
341150
341190
  "--",
341151
341191
  this.sdkOutputDir
341152
341192
  ]);
@@ -516846,7 +516886,8 @@ var OpenApiSettingsSchema = schemas_exports8.object({
516846
516886
  "inline-all-of-schemas": schemas_exports8.boolean().optional(),
516847
516887
  "resolve-aliases": ResolveAliases.optional(),
516848
516888
  "group-multi-api-environments": schemas_exports8.boolean().optional(),
516849
- "default-integer-format": DefaultIntegerFormat2.optional()
516889
+ "default-integer-format": DefaultIntegerFormat2.optional(),
516890
+ "infer-discriminated-union-base-properties": schemas_exports8.boolean().optional()
516850
516891
  }).extend(BaseApiSettingsSchema);
516851
516892
 
516852
516893
  // ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/ApiConfigurationV2SettingsSchema.js
@@ -529828,7 +529869,8 @@ var DEFAULT_PARSE_OPENAPI_SETTINGS = {
529828
529869
  resolveSchemaCollisions: false,
529829
529870
  inferForwardCompatible: false,
529830
529871
  coerceConstsTo: "enums-coerceable-to-literals",
529831
- respectByteFormat: false
529872
+ respectByteFormat: false,
529873
+ shouldInferDiscriminatedUnionBaseProperties: false
529832
529874
  };
529833
529875
  function mergeOptions2(params2) {
529834
529876
  const { defaults: defaults3, options: options2, overrides, overrideOnly = /* @__PURE__ */ new Set(), undefinedIfAbsent = /* @__PURE__ */ new Set() } = params2;
@@ -530571,572 +530613,6 @@ function convertAvailability2(propertySchema) {
530571
530613
  return void 0;
530572
530614
  }
530573
530615
 
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
530616
  // ../api-importers/openapi/openapi-ir-parser/lib/schema/utils/getBreadcrumbsFromReference.js
531141
530617
  var STARTS_WITH_COMPONENTS_SCHEMAS = {
531142
530618
  // if the first three breadcrumbs are "#", "components", "schemas"
@@ -531828,42 +531304,665 @@ function wrapObject({ nameOverride, generatedName, title: title2, wrapAsOptional
531828
531304
  }
531829
531305
  return result;
531830
531306
  }
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;
531307
+ function getNonIgnoredProperties({ properties: properties7, breadcrumbs, context: context3 }) {
531308
+ return Object.fromEntries(Object.entries(properties7).filter(([key2, propertySchema]) => {
531309
+ const shouldIgnore = getExtension(propertySchema, FernOpenAPIExtension.IGNORE);
531310
+ if (shouldIgnore) {
531311
+ context3.logger.debug(`Property ${breadcrumbs.join(".")}.${key2} is marked with x-fern-ignore. Skipping.`);
531312
+ }
531313
+ return !shouldIgnore;
531314
+ }));
531315
+ }
531316
+ function filterNotProperties(schema2) {
531317
+ if (schema2.properties == null) {
531318
+ return schema2;
531319
+ }
531320
+ const filteredProperties = {};
531321
+ for (const [key2, propertySchema] of Object.entries(schema2.properties)) {
531322
+ if (!isReferenceObject(propertySchema) && "not" in propertySchema) {
531323
+ continue;
531324
+ }
531325
+ filteredProperties[key2] = propertySchema;
531326
+ }
531327
+ return { ...schema2, properties: filteredProperties };
531328
+ }
531329
+ function getAllProperties({ schema: schema2, context: context3, breadcrumbs, source: source2, namespace }) {
531330
+ let properties7 = {};
531331
+ const [resolvedSchema, resolvedBreadCrumbs] = isReferenceObject(schema2) ? [context3.resolveSchemaReference(schema2), getBreadcrumbsFromReference(schema2.$ref)] : [schema2, breadcrumbs];
531332
+ for (const allOfElement of resolvedSchema.allOf ?? []) {
531333
+ properties7 = {
531334
+ ...properties7,
531335
+ ...getAllProperties({ schema: allOfElement, context: context3, breadcrumbs: resolvedBreadCrumbs, source: source2, namespace })
531336
+ };
531337
+ }
531338
+ for (const [propertyName, propertySchema] of Object.entries(getNonIgnoredProperties({ properties: resolvedSchema.properties ?? {}, breadcrumbs, context: context3 }))) {
531339
+ const convertedPropertySchema = convertSchema2(propertySchema, false, false, context3, [...resolvedBreadCrumbs, propertyName], source2, namespace);
531340
+ properties7[propertyName] = convertedPropertySchema;
531341
+ }
531342
+ return properties7;
531343
+ }
531344
+
531345
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/inferDiscriminatorContext.js
531346
+ var SSE_SPEC_FIELDS = /* @__PURE__ */ new Set(["event", "data", "id", "retry"]);
531347
+ function collectAllProperties(schema2, context3) {
531348
+ let allProperties = {
531349
+ ...schema2.properties ?? {}
531350
+ };
531351
+ for (const allOfElement of schema2.allOf ?? []) {
531352
+ if (isReferenceObject(allOfElement)) {
531353
+ const resolved = context3.resolveSchemaReference(allOfElement);
531354
+ const inheritedProperties = collectAllProperties(resolved, context3);
531355
+ allProperties = { ...inheritedProperties, ...allProperties };
531356
+ } else {
531357
+ const inheritedProperties = collectAllProperties(allOfElement, context3);
531358
+ allProperties = { ...inheritedProperties, ...allProperties };
531359
+ }
531360
+ }
531361
+ return allProperties;
531362
+ }
531363
+ function resolvePropertySchema(schema2, context3) {
531364
+ if (isReferenceObject(schema2)) {
531365
+ return context3.resolveSchemaReference(schema2);
531366
+ }
531367
+ return schema2;
531368
+ }
531369
+ function variantMatchesSseSpec(schema2, context3) {
531370
+ const allProperties = collectAllProperties(schema2, context3);
531371
+ const propertyEntries = Object.entries(allProperties);
531372
+ if (propertyEntries.length === 0) {
531373
+ return false;
531374
+ }
531375
+ let hasEvent = false;
531376
+ for (const [propName, propSchema] of propertyEntries) {
531377
+ if (!SSE_SPEC_FIELDS.has(propName)) {
531378
+ return false;
531379
+ }
531380
+ const resolved = resolvePropertySchema(propSchema, context3);
531381
+ switch (propName) {
531382
+ case "event":
531383
+ hasEvent = true;
531384
+ if (resolved.type !== "string") {
531385
+ return false;
531386
+ }
531387
+ break;
531388
+ case "id":
531389
+ if (resolved.type !== "string") {
531390
+ return false;
531391
+ }
531392
+ break;
531393
+ case "retry":
531394
+ if (resolved.type !== "integer") {
531395
+ return false;
531396
+ }
531397
+ break;
531398
+ case "data":
531399
+ break;
531400
+ }
531401
+ }
531402
+ return hasEvent;
531403
+ }
531404
+ function resolveDiscriminatorContext({ discriminator, context: context3 }) {
531405
+ return getExtension(discriminator, FernOpenAPIExtension.DISCRIMINATOR_CONTEXT) ?? inferDiscriminatorContext({ discriminator, context: context3 });
531406
+ }
531407
+ function inferDiscriminatorContext({ discriminator, context: context3 }) {
531408
+ const mapping = discriminator.mapping;
531409
+ if (mapping == null || Object.keys(mapping).length === 0) {
531410
+ return "data";
531411
+ }
531412
+ for (const schema2 of Object.values(mapping)) {
531413
+ try {
531414
+ const resolved = context3.resolveSchemaReference({ $ref: schema2 });
531415
+ if (!variantMatchesSseSpec(resolved, context3)) {
531416
+ return "data";
531417
+ }
531418
+ } catch {
531419
+ return "data";
531420
+ }
531421
+ }
531422
+ return "protocol";
531423
+ }
531424
+ function inferDiscriminatorContextFromVariants({ variants, context: context3 }) {
531425
+ const variantEntries = Object.values(variants);
531426
+ if (variantEntries.length === 0) {
531427
+ return "data";
531428
+ }
531429
+ for (const variantSchema of variantEntries) {
531430
+ try {
531431
+ const resolved = isReferenceObject(variantSchema) ? context3.resolveSchemaReference(variantSchema) : variantSchema;
531432
+ if (!variantMatchesSseSpec(resolved, context3)) {
531433
+ return "data";
531434
+ }
531435
+ } catch {
531436
+ return "data";
531437
+ }
531438
+ }
531439
+ return "protocol";
531440
+ }
531441
+
531442
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertDiscriminatedOneOf.js
531443
+ function convertDiscriminatedOneOf({ nameOverride, generatedName, title: title2, breadcrumbs, properties: properties7, description, availability, required: required6, wrapAsOptional, wrapAsNullable, discriminator, context: context3, namespace, groupName, encoding, source: source2 }) {
531444
+ const discriminant21 = discriminator.propertyName;
531445
+ const discriminantNameOverride = getExtension(discriminator, FernOpenAPIExtension.FERN_PROPERTY_NAME);
531446
+ const discriminatorContext = resolveDiscriminatorContext({ discriminator, context: context3 });
531447
+ const unionSubTypes = Object.fromEntries(Object.entries(discriminator.mapping ?? {}).map(([discriminantValue, schema2]) => {
531448
+ const subtypeReference = convertReferenceObject({
531449
+ $ref: schema2
531450
+ }, false, false, context3, [schema2], encoding, source2, namespace);
531451
+ context3.markReferencedByDiscriminatedUnion({
531452
+ $ref: schema2
531453
+ }, discriminant21, 1);
531454
+ return [discriminantValue, subtypeReference];
531455
+ }));
531456
+ const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
531457
+ return propertyName !== discriminant21;
531458
+ }).map(([propertyName, propertySchema]) => {
531459
+ const isRequired = required6 != null && required6.includes(propertyName);
531460
+ const [isOptional, isNullable] = context3.options.coerceOptionalSchemasToNullable ? [false, !isRequired] : [!isRequired, false];
531461
+ const schema2 = convertSchema2(propertySchema, isOptional, isNullable, context3, [...breadcrumbs, propertyName], source2, namespace);
531462
+ return {
531463
+ key: propertyName,
531464
+ schema: schema2
531465
+ };
531466
+ });
531467
+ if (context3.options.shouldInferDiscriminatedUnionBaseProperties) {
531468
+ const variantSchemas = Object.values(discriminator.mapping ?? {}).map(($ref) => ({ $ref }));
531469
+ const inferredCommonProperties = inferCommonPropertiesFromVariants({
531470
+ variants: variantSchemas,
531471
+ discriminant: discriminant21,
531472
+ existingPropertyNames: new Set(convertedProperties.map((p14) => p14.key)),
531473
+ context: context3,
531474
+ breadcrumbs,
531475
+ source: source2,
531476
+ namespace
531477
+ });
531478
+ convertedProperties.push(...inferredCommonProperties);
531479
+ }
531480
+ return wrapDiscriminatedOneOf({
531481
+ nameOverride,
531482
+ generatedName,
531483
+ title: title2,
531484
+ wrapAsOptional,
531485
+ wrapAsNullable,
531486
+ properties: convertedProperties,
531487
+ description,
531488
+ availability,
531489
+ discriminant: discriminant21,
531490
+ discriminantNameOverride,
531491
+ discriminatorContext,
531492
+ subtypes: unionSubTypes,
531493
+ defaultDiscriminantValue: void 0,
531494
+ namespace,
531495
+ groupName,
531496
+ source: source2
531497
+ });
531498
+ }
531499
+ 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 }) {
531500
+ const unionSubTypes = Object.fromEntries(Object.entries(variants).map(([discriminantValue, schema2]) => {
531501
+ if (isReferenceObject(schema2)) {
531502
+ const subtypeReference = convertReferenceObject(schema2, false, false, context3, [schema2.$ref], encoding, source2, namespace);
531503
+ context3.markReferencedByDiscriminatedUnion(schema2, discriminant21, 1);
531504
+ return [discriminantValue, subtypeReference];
531505
+ } else {
531506
+ const variantSchema = convertSchemaObject(schema2, false, false, context3, [...breadcrumbs, discriminantValue], encoding, source2, namespace, /* @__PURE__ */ new Set([discriminant21]));
531507
+ return [discriminantValue, variantSchema];
531508
+ }
531509
+ }));
531510
+ const convertedProperties = Object.entries(properties7).filter(([propertyName]) => {
531511
+ return propertyName !== discriminant21;
531512
+ }).map(([propertyName, propertySchema]) => {
531513
+ const isRequired = required6 != null && required6.includes(propertyName);
531514
+ const [isOptional, isNullable] = context3.options.coerceOptionalSchemasToNullable ? [false, !isRequired] : [!isRequired, false];
531515
+ const schema2 = convertSchema2(propertySchema, isOptional, isNullable, context3, [...breadcrumbs, propertyName], source2, namespace);
531516
+ return {
531517
+ key: propertyName,
531518
+ schema: schema2
531519
+ };
531520
+ });
531521
+ if (context3.options.shouldInferDiscriminatedUnionBaseProperties) {
531522
+ const inferredCommonProperties = inferCommonPropertiesFromVariants({
531523
+ variants: Object.values(variants),
531524
+ discriminant: discriminant21,
531525
+ existingPropertyNames: new Set(convertedProperties.map((p14) => p14.key)),
531526
+ context: context3,
531527
+ breadcrumbs,
531528
+ source: source2,
531529
+ namespace
531530
+ });
531531
+ convertedProperties.push(...inferredCommonProperties);
531532
+ }
531533
+ return wrapDiscriminatedOneOf({
531534
+ nameOverride,
531535
+ generatedName,
531536
+ title: title2,
531537
+ wrapAsOptional,
531538
+ wrapAsNullable,
531539
+ properties: convertedProperties,
531540
+ description,
531541
+ availability,
531542
+ discriminant: discriminant21,
531543
+ discriminantNameOverride: void 0,
531544
+ discriminatorContext: inferDiscriminatorContextFromVariants({ variants, context: context3 }),
531545
+ subtypes: unionSubTypes,
531546
+ defaultDiscriminantValue,
531547
+ namespace,
531548
+ groupName,
531549
+ source: source2
531550
+ });
531551
+ }
531552
+ function wrapDiscriminatedOneOf({ nameOverride, generatedName, title: title2, wrapAsOptional, wrapAsNullable, properties: properties7, description, availability, discriminant: discriminant21, discriminantNameOverride, discriminatorContext, subtypes, defaultDiscriminantValue, namespace, groupName, source: source2 }) {
531553
+ let result = SchemaWithExample.oneOf(OneOfSchemaWithExample.discriminated({
531554
+ description,
531555
+ availability,
531556
+ discriminantProperty: discriminant21,
531557
+ discriminantPropertyNameOverride: discriminantNameOverride,
531558
+ discriminatorContext,
531559
+ defaultDiscriminantValue,
531560
+ nameOverride,
531561
+ generatedName,
531562
+ title: title2,
531563
+ schemas: subtypes,
531564
+ commonProperties: properties7,
531565
+ namespace,
531566
+ groupName,
531567
+ encoding: void 0,
531568
+ source: source2,
531569
+ inline: void 0
531570
+ }));
531571
+ if (wrapAsNullable) {
531572
+ result = SchemaWithExample.nullable({
531573
+ nameOverride,
531574
+ generatedName,
531575
+ title: title2,
531576
+ value: result,
531577
+ namespace,
531578
+ groupName,
531579
+ description,
531580
+ availability,
531581
+ inline: void 0
531582
+ });
531583
+ }
531584
+ if (wrapAsOptional) {
531585
+ result = SchemaWithExample.optional({
531586
+ nameOverride,
531587
+ generatedName,
531588
+ title: title2,
531589
+ value: result,
531590
+ namespace,
531591
+ groupName,
531592
+ description,
531593
+ availability,
531594
+ inline: void 0
531595
+ });
531596
+ }
531597
+ return result;
531598
+ }
531599
+ function inferCommonPropertiesFromVariants({ variants, discriminant: discriminant21, existingPropertyNames, context: context3, breadcrumbs, source: source2, namespace }) {
531600
+ if (variants.length === 0) {
531601
+ return [];
531602
+ }
531603
+ const variantPropertyMaps = variants.map((variant) => getAllProperties({ schema: variant, context: context3, breadcrumbs, source: source2, namespace }));
531604
+ const firstVariantProps = variantPropertyMaps[0];
531605
+ if (firstVariantProps == null) {
531606
+ return [];
531607
+ }
531608
+ const result = [];
531609
+ for (const [propertyName, firstSchema] of Object.entries(firstVariantProps)) {
531610
+ if (propertyName === discriminant21) {
531611
+ continue;
531612
+ }
531613
+ if (existingPropertyNames.has(propertyName)) {
531614
+ continue;
531615
+ }
531616
+ let presentInAll = true;
531617
+ for (let i9 = 1; i9 < variantPropertyMaps.length; i9++) {
531618
+ const map16 = variantPropertyMaps[i9];
531619
+ const otherSchema = map16?.[propertyName];
531620
+ if (otherSchema == null || !isSchemaWithExampleEqual(firstSchema, otherSchema)) {
531621
+ presentInAll = false;
531622
+ break;
531623
+ }
531624
+ }
531625
+ if (presentInAll) {
531626
+ result.push({ key: propertyName, schema: firstSchema });
531627
+ }
531628
+ }
531629
+ return result;
531630
+ }
531631
+
531632
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertEncoding.js
531633
+ function convertEncoding(encodingSchema) {
531634
+ if (encodingSchema.proto != null) {
531635
+ return Encoding2.protobuf({
531636
+ typeName: encodingSchema.proto.type
531637
+ });
531638
+ }
531639
+ return void 0;
531640
+ }
531641
+
531642
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertEnum.js
531643
+ function convertEnum({ nameOverride, generatedName, title: title2, fernEnum, enumVarNames, enumValues, _default: _default4, description, availability, wrapAsOptional, wrapAsNullable, namespace, groupName, context: context3, source: source2, inline }) {
531644
+ const strippedEnumVarNames = stripCommonPrefix(enumVarNames ?? []);
531645
+ const uniqueValues = new Set(enumValues);
531646
+ const values2 = Array.from(uniqueValues).map((value2, index3) => {
531647
+ const fernEnumValue = fernEnum?.[value2];
531648
+ const enumVarName = strippedEnumVarNames[index3];
531649
+ const valueIsValidName = VALID_ENUM_NAME_REGEX.test(value2);
531650
+ let nameOverride2 = fernEnumValue?.name ?? enumVarName;
531651
+ const generatedName2 = valueIsValidName ? value2 : generateEnumNameFromValue(value2);
531652
+ if (nameOverride2 != null && !VALID_ENUM_NAME_REGEX.test(nameOverride2)) {
531653
+ context3?.logger.warn(`Enum name override ${nameOverride2} is not a valid name. Falling back on ${generatedName2}.`);
531654
+ nameOverride2 = void 0;
531655
+ }
531656
+ return {
531657
+ nameOverride: nameOverride2,
531658
+ generatedName: generatedName2,
531659
+ value: value2,
531660
+ description: fernEnumValue?.description,
531661
+ availability,
531662
+ casing: {
531663
+ snake: fernEnumValue?.casing?.snake ?? void 0,
531664
+ pascal: fernEnumValue?.casing?.pascal ?? void 0,
531665
+ screamingSnake: fernEnumValue?.casing?.screamingSnake ?? void 0,
531666
+ camel: fernEnumValue?.casing?.camel ?? void 0
531667
+ }
531668
+ };
531669
+ });
531670
+ const _defaultEnumValue = _default4 != null ? values2.find((value2) => value2.value === _default4) : void 0;
531671
+ return wrapEnum({
531672
+ wrapAsOptional,
531673
+ wrapAsNullable,
531674
+ nameOverride,
531675
+ generatedName,
531676
+ title: title2,
531677
+ values: values2,
531678
+ _default: _defaultEnumValue,
531679
+ description,
531680
+ availability,
531681
+ namespace,
531682
+ groupName,
531683
+ source: source2,
531684
+ inline
531685
+ });
531686
+ }
531687
+ function wrapEnum({ wrapAsOptional, wrapAsNullable, nameOverride, generatedName, title: title2, values: values2, _default: _default4, description, availability, namespace, groupName, source: source2, inline }) {
531688
+ let result = SchemaWithExample.enum({
531689
+ nameOverride,
531690
+ generatedName,
531691
+ title: title2,
531692
+ values: values2,
531693
+ description,
531694
+ availability,
531695
+ default: _default4,
531696
+ example: void 0,
531697
+ namespace,
531698
+ groupName,
531699
+ source: source2,
531700
+ inline
531701
+ });
531702
+ if (wrapAsNullable) {
531703
+ result = SchemaWithExample.nullable({
531704
+ nameOverride,
531705
+ generatedName,
531706
+ title: title2,
531707
+ value: result,
531708
+ description,
531709
+ availability,
531710
+ namespace,
531711
+ groupName,
531712
+ inline
531713
+ });
531714
+ }
531715
+ if (wrapAsOptional) {
531716
+ result = SchemaWithExample.optional({
531717
+ nameOverride,
531718
+ generatedName,
531719
+ title: title2,
531720
+ value: result,
531721
+ description,
531722
+ availability,
531723
+ namespace,
531724
+ groupName,
531725
+ inline
531726
+ });
531727
+ }
531728
+ return result;
531729
+ }
531730
+ function stripCommonPrefix(names2) {
531731
+ if (names2.length <= 1 || names2[0] == null) {
531732
+ return names2;
531733
+ }
531734
+ const nameZero = names2[0];
531735
+ let i9 = 0;
531736
+ while (nameZero[i9] != null && names2.every((name2) => name2[i9] === nameZero[i9])) {
531737
+ i9++;
531738
+ }
531739
+ return names2.map((name2) => name2.substring(i9));
531740
+ }
531741
+
531742
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertInteger.js
531743
+ 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 }) {
531744
+ const effectiveFormat = format3 ?? defaultIntegerFormat;
531745
+ const primitive = (() => {
531746
+ switch (effectiveFormat) {
531747
+ case generators_yml_exports.DefaultIntegerFormat.Int64:
531748
+ return PrimitiveSchemaValueWithExample.int64({ default: _default4, example });
531749
+ case generators_yml_exports.DefaultIntegerFormat.Uint32:
531750
+ return PrimitiveSchemaValueWithExample.uint({ default: _default4, example });
531751
+ case generators_yml_exports.DefaultIntegerFormat.Uint64:
531752
+ return PrimitiveSchemaValueWithExample.uint64({ default: _default4, example });
531753
+ default:
531754
+ return PrimitiveSchemaValueWithExample.int({
531755
+ default: _default4,
531756
+ minimum,
531757
+ maximum,
531758
+ exclusiveMinimum,
531759
+ exclusiveMaximum,
531760
+ multipleOf,
531761
+ example
531762
+ });
531763
+ }
531764
+ })();
531765
+ return wrapPrimitive({
531766
+ nameOverride,
531767
+ generatedName,
531768
+ title: title2,
531769
+ primitive,
531770
+ wrapAsOptional,
531771
+ wrapAsNullable,
531772
+ description,
531773
+ availability,
531774
+ namespace,
531775
+ groupName
531776
+ });
531777
+ }
531778
+
531779
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertLiteral.js
531780
+ function createLiteralSchemaValue(value2) {
531781
+ if (typeof value2 === "string") {
531782
+ return LiteralSchemaValue.string(value2);
531783
+ } else if (typeof value2 === "boolean") {
531784
+ return LiteralSchemaValue.boolean(value2);
531785
+ } else {
531786
+ return LiteralSchemaValue.string(`${value2}`);
531787
+ }
531788
+ }
531789
+ function convertLiteral({ nameOverride, generatedName, title: title2, wrapAsOptional, wrapAsNullable, value: value2, description, availability, namespace, groupName }) {
531790
+ let result = SchemaWithExample.literal({
531791
+ nameOverride,
531792
+ generatedName,
531793
+ title: title2,
531794
+ value: createLiteralSchemaValue(value2),
531795
+ description,
531796
+ availability,
531797
+ namespace,
531798
+ groupName
531799
+ });
531800
+ if (wrapAsNullable) {
531801
+ result = SchemaWithExample.nullable({
531802
+ nameOverride,
531803
+ generatedName,
531804
+ title: title2,
531805
+ value: result,
531806
+ description,
531807
+ availability,
531808
+ namespace,
531809
+ groupName,
531810
+ inline: void 0
531811
+ });
531812
+ }
531813
+ if (wrapAsOptional) {
531814
+ result = SchemaWithExample.optional({
531815
+ nameOverride,
531816
+ generatedName,
531817
+ title: title2,
531818
+ value: result,
531819
+ description,
531820
+ availability,
531821
+ namespace,
531822
+ groupName,
531823
+ inline: void 0
531824
+ });
531825
+ }
531826
+ return result;
531827
+ }
531828
+
531829
+ // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertNumber.js
531830
+ function convertNumber({ nameOverride, generatedName, title: title2, format: format3, _default: _default4, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, description, availability, wrapAsOptional, wrapAsNullable, example, namespace, groupName }) {
531831
+ if (format3 == null || format3 === "double") {
531832
+ return wrapPrimitive({
531833
+ nameOverride,
531834
+ generatedName,
531835
+ title: title2,
531836
+ primitive: PrimitiveSchemaValueWithExample.double({
531837
+ default: _default4,
531838
+ minimum,
531839
+ maximum,
531840
+ exclusiveMinimum,
531841
+ exclusiveMaximum,
531842
+ multipleOf,
531843
+ example
531844
+ }),
531845
+ wrapAsOptional,
531846
+ wrapAsNullable,
531847
+ description,
531848
+ availability,
531849
+ namespace,
531850
+ groupName
531851
+ });
531852
+ } else if (format3 === "float") {
531853
+ return wrapPrimitive({
531854
+ nameOverride,
531855
+ generatedName,
531856
+ title: title2,
531857
+ primitive: PrimitiveSchemaValueWithExample.float({
531858
+ example
531859
+ }),
531860
+ wrapAsOptional,
531861
+ wrapAsNullable,
531862
+ description,
531863
+ availability,
531864
+ namespace,
531865
+ groupName
531866
+ });
531867
+ } else if (format3 === "int32") {
531868
+ return wrapPrimitive({
531869
+ nameOverride,
531870
+ generatedName,
531871
+ title: title2,
531872
+ primitive: PrimitiveSchemaValueWithExample.int({
531873
+ default: _default4,
531874
+ minimum,
531875
+ maximum,
531876
+ exclusiveMinimum,
531877
+ exclusiveMaximum,
531878
+ multipleOf,
531879
+ example
531880
+ }),
531881
+ wrapAsOptional,
531882
+ wrapAsNullable,
531883
+ description,
531884
+ availability,
531885
+ namespace,
531886
+ groupName
531887
+ });
531888
+ } else if (format3 === "int64") {
531889
+ return wrapPrimitive({
531890
+ nameOverride,
531891
+ generatedName,
531892
+ title: title2,
531893
+ primitive: PrimitiveSchemaValueWithExample.int64({
531894
+ default: _default4,
531895
+ example
531896
+ }),
531897
+ wrapAsOptional,
531898
+ wrapAsNullable,
531899
+ description,
531900
+ availability,
531901
+ namespace,
531902
+ groupName
531903
+ });
531904
+ } else if (format3 === "uint32") {
531905
+ return wrapPrimitive({
531906
+ nameOverride,
531907
+ generatedName,
531908
+ title: title2,
531909
+ primitive: PrimitiveSchemaValueWithExample.uint({
531910
+ default: _default4,
531911
+ example
531912
+ }),
531913
+ wrapAsOptional,
531914
+ wrapAsNullable,
531915
+ description,
531916
+ availability,
531917
+ namespace,
531918
+ groupName
531919
+ });
531920
+ } else if (format3 === "uint64") {
531921
+ return wrapPrimitive({
531922
+ nameOverride,
531923
+ generatedName,
531924
+ title: title2,
531925
+ primitive: PrimitiveSchemaValueWithExample.uint64({
531926
+ default: _default4,
531927
+ example
531928
+ }),
531929
+ wrapAsOptional,
531930
+ wrapAsNullable,
531931
+ description,
531932
+ availability,
531933
+ namespace,
531934
+ groupName
531935
+ });
531936
+ } else if (format3 === "time-delta") {
531937
+ return wrapPrimitive({
531938
+ nameOverride,
531939
+ generatedName,
531940
+ title: title2,
531941
+ primitive: PrimitiveSchemaValueWithExample.float({
531942
+ example
531943
+ }),
531944
+ wrapAsOptional,
531945
+ wrapAsNullable,
531946
+ description,
531947
+ availability,
531948
+ namespace,
531949
+ groupName
531950
+ });
531865
531951
  }
531866
- return properties7;
531952
+ return wrapPrimitive({
531953
+ nameOverride,
531954
+ generatedName,
531955
+ title: title2,
531956
+ primitive: PrimitiveSchemaValueWithExample.float({
531957
+ example
531958
+ }),
531959
+ wrapAsOptional,
531960
+ wrapAsNullable,
531961
+ description,
531962
+ availability,
531963
+ namespace,
531964
+ groupName
531965
+ });
531867
531966
  }
531868
531967
 
531869
531968
  // ../api-importers/openapi/openapi-ir-parser/lib/schema/convertUndiscriminatedOneOf.js
@@ -541303,7 +541402,8 @@ var FIELD_MAPPINGS = {
541303
541402
  pathParameterOrder: "pathParameterOrder",
541304
541403
  resolveSchemaCollisions: "resolveSchemaCollisions",
541305
541404
  inferForwardCompatible: "inferForwardCompatible",
541306
- coerceConstsTo: "coerceConstsTo"
541405
+ coerceConstsTo: "coerceConstsTo",
541406
+ shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties"
541307
541407
  };
541308
541408
  function setIfDefined2(target, key2, value2) {
541309
541409
  if (value2 !== void 0) {
@@ -550402,7 +550502,8 @@ var UNDEFINED_API_DEFINITION_SETTINGS = {
550402
550502
  defaultIntegerFormat: void 0,
550403
550503
  resolveSchemaCollisions: void 0,
550404
550504
  inferForwardCompatible: void 0,
550405
- coerceConstsTo: void 0
550505
+ coerceConstsTo: void 0,
550506
+ shouldInferDiscriminatedUnionBaseProperties: void 0
550406
550507
  };
550407
550508
  async function convertGeneratorsConfiguration({ absolutePathToGeneratorsConfiguration, rawGeneratorsConfiguration, context: context3 }) {
550408
550509
  const maybeTopLevelMetadata = getOutputMetadata(rawGeneratorsConfiguration.metadata);
@@ -550471,7 +550572,8 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
550471
550572
  groupEnvironmentsByHost: settings?.["group-environments-by-host"],
550472
550573
  multiServerStrategy: settings?.["multi-server-strategy"],
550473
550574
  defaultIntegerFormat: settings?.["default-integer-format"],
550474
- pathParameterOrder: settings?.["path-parameter-order"]
550575
+ pathParameterOrder: settings?.["path-parameter-order"],
550576
+ shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"]
550475
550577
  };
550476
550578
  }
550477
550579
  function parseAsyncApiDefinitionSettingsSchema(settings) {
@@ -614311,7 +614413,14 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
614311
614413
  * The default format to use for integer types when no format is specified in the OpenAPI schema.
614312
614414
  * Defaults to int32.
614313
614415
  */
614314
- defaultIntegerFormat: DefaultIntegerFormatSchema.optional()
614416
+ defaultIntegerFormat: DefaultIntegerFormatSchema.optional(),
614417
+ /**
614418
+ * If true, properties shared by every variant of a discriminated `oneOf`
614419
+ * (including via `allOf`/`$ref`) are lifted into the union's base properties
614420
+ * so SDKs can expose them directly on the union type without casting.
614421
+ * Defaults to false.
614422
+ */
614423
+ inferDiscriminatedUnionBaseProperties: external_exports.boolean().optional()
614315
614424
  });
614316
614425
 
614317
614426
  // ../config/lib/schemas/specs/OpenApiSpecSchema.js
@@ -621196,7 +621305,7 @@ var AccessTokenPosthogManager = class {
621196
621305
  properties: {
621197
621306
  ...event,
621198
621307
  ...event.properties,
621199
- version: "4.106.3",
621308
+ version: "4.107.0-11-g58f57e9e0ec",
621200
621309
  usingAccessToken: true
621201
621310
  }
621202
621311
  });
@@ -621250,7 +621359,7 @@ var UserPosthogManager = class {
621250
621359
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
621251
621360
  event: "CLI",
621252
621361
  properties: {
621253
- version: "4.106.3",
621362
+ version: "4.107.0-11-g58f57e9e0ec",
621254
621363
  ...event,
621255
621364
  ...event.properties,
621256
621365
  usingAccessToken: false,
@@ -626585,7 +626694,8 @@ var LegacyApiSpecAdapter = class {
626585
626694
  resolveAliases: settings.resolveAliases,
626586
626695
  groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
626587
626696
  defaultIntegerFormat: this.adaptDefaultIntegerFormat(settings.defaultIntegerFormat),
626588
- coerceConstsTo: settings.coerceConstsTo
626697
+ coerceConstsTo: settings.coerceConstsTo,
626698
+ shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties
626589
626699
  };
626590
626700
  const hasSettings = Object.values(result).some((v9) => v9 != null);
626591
626701
  return hasSettings ? result : void 0;
@@ -829478,6 +829588,7 @@ var SETTINGS_KEY_MAP = {
829478
829588
  "resolve-aliases": "resolveAliases",
829479
829589
  "group-multi-api-environments": "groupMultiApiEnvironments",
829480
829590
  "default-integer-format": "defaultIntegerFormat",
829591
+ "infer-discriminated-union-base-properties": "inferDiscriminatedUnionBaseProperties",
829481
829592
  // AsyncAPI-specific settings
829482
829593
  "message-naming": "messageNaming"
829483
829594
  };
@@ -832891,7 +833002,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
832891
833002
  var LOGS_FOLDER_NAME = "logs";
832892
833003
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
832893
833004
  function getCliSource() {
832894
- const version7 = "4.106.3";
833005
+ const version7 = "4.107.0-11-g58f57e9e0ec";
832895
833006
  return `cli@${version7}`;
832896
833007
  }
832897
833008
  var DebugLogger = class {
@@ -845300,7 +845411,7 @@ var LegacyDocsPublisher = class {
845300
845411
  previewId,
845301
845412
  disableTemplates: void 0,
845302
845413
  skipUpload,
845303
- cliVersion: "4.106.3",
845414
+ cliVersion: "4.107.0-11-g58f57e9e0ec",
845304
845415
  loginCommand: "fern auth login"
845305
845416
  });
845306
845417
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -881373,52 +881484,6 @@ var Begin = class extends AstNode6 {
881373
881484
  }
881374
881485
  };
881375
881486
 
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
881487
  // ../../../generators/ruby-v2/ast/lib/ast/Comment.js
881423
881488
  var MAX_LINE_LENGTH2 = 120;
881424
881489
  var COMMENT_PREFIX_LENGTH = 2;
@@ -882065,19 +882130,20 @@ var Class_ = class extends Module_ {
882065
882130
  writer2.writeLine("; end");
882066
882131
  return;
882067
882132
  }
882068
- if (this.statements.length) {
882133
+ if (this.statements.length || this.methods.length) {
882069
882134
  writer2.newLine();
882070
882135
  writer2.indent();
882071
882136
  this.statements.forEach((statement, index3) => {
882072
882137
  statement.write(writer2);
882073
- writer2.newLine();
882138
+ writer2.writeNewLineIfLastLineNot();
882139
+ if (index3 < this.statements.length - 1) {
882140
+ writer2.newLine();
882141
+ }
882074
882142
  });
882075
- writer2.dedent();
882076
- }
882077
- if (this.methods.length) {
882078
- writer2.newLine();
882079
- writer2.indent();
882080
- this.methods.forEach((method8) => {
882143
+ this.methods.forEach((method8, index3) => {
882144
+ if (index3 > 0 || this.statements.length > 0) {
882145
+ writer2.newLine();
882146
+ }
882081
882147
  method8.write(writer2);
882082
882148
  });
882083
882149
  writer2.dedent();
@@ -882115,6 +882181,112 @@ var Class_ = class extends Module_ {
882115
882181
  }
882116
882182
  };
882117
882183
 
882184
+ // ../../../generators/ruby-v2/ast/lib/ast/IfElse.js
882185
+ var IfElse = class extends AstNode6 {
882186
+ ifBranch;
882187
+ elseIfs;
882188
+ elseBody;
882189
+ constructor({ if: ifBranch, elseIf, elseBody }) {
882190
+ super();
882191
+ this.ifBranch = ifBranch;
882192
+ this.elseIfs = elseIf ?? [];
882193
+ this.elseBody = elseBody ? Array.isArray(elseBody) ? elseBody : [elseBody] : void 0;
882194
+ }
882195
+ write(writer2) {
882196
+ const modifier = this.renderAsModifier(writer2);
882197
+ if (modifier != null) {
882198
+ writer2.write(modifier);
882199
+ writer2.writeNewLineIfLastLineNot();
882200
+ return;
882201
+ }
882202
+ writer2.write("if ");
882203
+ this.ifBranch.condition.write(writer2);
882204
+ writer2.writeLine();
882205
+ writer2.indent();
882206
+ for (const stmt of this.ifBranch.thenBody) {
882207
+ stmt.write(writer2);
882208
+ writer2.writeNewLineIfLastLineNot();
882209
+ }
882210
+ writer2.dedent();
882211
+ for (const elseIf of this.elseIfs) {
882212
+ writer2.write("elsif ");
882213
+ elseIf.condition.write(writer2);
882214
+ writer2.writeLine();
882215
+ writer2.indent();
882216
+ for (const stmt of elseIf.thenBody) {
882217
+ stmt.write(writer2);
882218
+ writer2.writeNewLineIfLastLineNot();
882219
+ }
882220
+ writer2.dedent();
882221
+ }
882222
+ if (this.elseBody && this.elseBody.length > 0) {
882223
+ writer2.writeLine("else");
882224
+ writer2.indent();
882225
+ for (const stmt of this.elseBody) {
882226
+ stmt.write(writer2);
882227
+ writer2.writeNewLineIfLastLineNot();
882228
+ }
882229
+ writer2.dedent();
882230
+ }
882231
+ writer2.write("end");
882232
+ writer2.writeNewLineIfLastLineNot();
882233
+ }
882234
+ /**
882235
+ * Returns the modifier-form rendering (`stmt if cond`) when this if is
882236
+ * eligible:
882237
+ * - exactly one statement in the then-body
882238
+ * - no elsif and no else
882239
+ * - the single statement is not an intrinsically multi-line AST node
882240
+ * (Class, Module, Method, Begin, IfElse)
882241
+ * - the rendered statement and condition each fit on a single line
882242
+ *
882243
+ * Returns undefined when the shape isn't eligible, in which case the caller
882244
+ * falls back to explicit if/end form.
882245
+ *
882246
+ * The generator's .rubocop.yml disables Layout/LineLength, so rubocop's
882247
+ * Style/IfUnlessModifier accepts modifier form at any line length. Shape
882248
+ * eligibility is therefore sufficient; we don't gate on a max-line-length
882249
+ * budget here.
882250
+ */
882251
+ renderAsModifier(writer2) {
882252
+ if (this.ifBranch.thenBody.length !== 1) {
882253
+ return void 0;
882254
+ }
882255
+ if (this.elseIfs.length > 0) {
882256
+ return void 0;
882257
+ }
882258
+ if (this.elseBody != null && this.elseBody.length > 0) {
882259
+ return void 0;
882260
+ }
882261
+ const stmt = this.ifBranch.thenBody[0];
882262
+ if (stmt == null) {
882263
+ return void 0;
882264
+ }
882265
+ if (isKnownMultiLineNode(stmt) || isKnownMultiLineNode(this.ifBranch.condition)) {
882266
+ return void 0;
882267
+ }
882268
+ const stmtRendered = renderNode(stmt, writer2);
882269
+ const conditionRendered = renderNode(this.ifBranch.condition, writer2);
882270
+ if (stmtRendered.length === 0 || conditionRendered.length === 0) {
882271
+ return void 0;
882272
+ }
882273
+ if (stmtRendered.includes("\n") || conditionRendered.includes("\n")) {
882274
+ return void 0;
882275
+ }
882276
+ return `${stmtRendered} if ${conditionRendered}`;
882277
+ }
882278
+ };
882279
+ function isKnownMultiLineNode(node4) {
882280
+ return node4 instanceof Class_ || node4 instanceof Module_ || node4 instanceof Method6 || node4 instanceof Begin || node4 instanceof IfElse;
882281
+ }
882282
+ function renderNode(node4, parentWriter) {
882283
+ const rendered = node4.toString({
882284
+ customConfig: parentWriter.customConfig,
882285
+ formatter: parentWriter.formatter
882286
+ });
882287
+ return rendered.replace(/\n+$/, "");
882288
+ }
882289
+
882118
882290
  // ../../../generators/ruby-v2/ast/lib/ast/ClassInstantiation.js
882119
882291
  var ClassInstantiation5 = class extends AstNode6 {
882120
882292
  classReference;
@@ -882375,9 +882547,36 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
882375
882547
  super();
882376
882548
  this.internalType = internalType;
882377
882549
  }
882550
+ /**
882551
+ * Returns a stable string representation of this literal suitable for
882552
+ * deduplicating hash keys (see Lint/DuplicateHashKey). Returns undefined
882553
+ * for compound/dynamic shapes where value equality isn't decidable at
882554
+ * emit time.
882555
+ */
882556
+ getDedupKey() {
882557
+ switch (this.internalType.type) {
882558
+ case "str":
882559
+ return `str:${this.internalType.value}`;
882560
+ case "interpolatedStr":
882561
+ return `istr:${this.internalType.value}`;
882562
+ case "int":
882563
+ return `int:${this.internalType.value}`;
882564
+ case "float":
882565
+ return `float:${this.internalType.value}`;
882566
+ case "bool":
882567
+ return `bool:${this.internalType.value}`;
882568
+ case "nil":
882569
+ return "nil";
882570
+ default:
882571
+ return void 0;
882572
+ }
882573
+ }
882378
882574
  static string(value2) {
882379
882575
  return new this({ type: "str", value: value2 });
882380
882576
  }
882577
+ static interpolatedString(value2) {
882578
+ return new this({ type: "interpolatedStr", value: value2 });
882579
+ }
882381
882580
  static integer(value2) {
882382
882581
  return new this({ type: "int", value: value2 });
882383
882582
  }
@@ -882414,6 +882613,11 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
882414
882613
  write(writer2) {
882415
882614
  switch (this.internalType.type) {
882416
882615
  case "str": {
882616
+ const value2 = this.internalType.value.replaceAll("\r\n", "\n");
882617
+ writer2.write(`"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replace(/#(?=[{$@])/g, "\\#")}"`);
882618
+ break;
882619
+ }
882620
+ case "interpolatedStr": {
882417
882621
  const value2 = this.internalType.value.replaceAll("\r\n", "\n");
882418
882622
  writer2.write(`"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`);
882419
882623
  break;
@@ -882431,7 +882635,21 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
882431
882635
  break;
882432
882636
  }
882433
882637
  case "hash": {
882434
- const entries23 = this.internalType.entries.filter((entry) => !_TypeLiteral.isNop(entry.key) && !_TypeLiteral.isNop(entry.value));
882638
+ const filteredEntries = this.internalType.entries.filter((entry) => !_TypeLiteral.isNop(entry.key) && !_TypeLiteral.isNop(entry.value));
882639
+ const seenKeys = /* @__PURE__ */ new Map();
882640
+ filteredEntries.forEach((entry, index3) => {
882641
+ const rendered = renderKeyForDedup(entry.key);
882642
+ if (rendered != null) {
882643
+ seenKeys.set(rendered, index3);
882644
+ }
882645
+ });
882646
+ const entries23 = filteredEntries.filter((entry, index3) => {
882647
+ const rendered = renderKeyForDedup(entry.key);
882648
+ if (rendered == null) {
882649
+ return true;
882650
+ }
882651
+ return seenKeys.get(rendered) === index3;
882652
+ });
882435
882653
  if (entries23.length === 0) {
882436
882654
  writer2.write("{}");
882437
882655
  break;
@@ -882511,6 +882729,12 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
882511
882729
  }
882512
882730
  }
882513
882731
  };
882732
+ function renderKeyForDedup(key2) {
882733
+ if (!(key2 instanceof TypeLiteral3)) {
882734
+ return void 0;
882735
+ }
882736
+ return key2.getDedupKey();
882737
+ }
882514
882738
 
882515
882739
  // ../../../generators/ruby-v2/ast/lib/ast/TypeParameter.js
882516
882740
  var Variance;
@@ -883473,6 +883697,7 @@ var EndpointSnippetGenerator7 = class {
883473
883697
  invokeMethodArgs.keywordArguments = invokeMethodArgs.keywordArguments ?? [];
883474
883698
  invokeMethodArgs.keywordArguments.push(requestOptions);
883475
883699
  }
883700
+ invokeMethodArgs.keywordArguments = dedupeKeywordArguments(invokeMethodArgs.keywordArguments);
883476
883701
  return ruby_exports.invokeMethod(invokeMethodArgs);
883477
883702
  }
883478
883703
  /**
@@ -883506,6 +883731,7 @@ var EndpointSnippetGenerator7 = class {
883506
883731
  invokeMethodArgs.keywordArguments = invokeMethodArgs.keywordArguments ?? [];
883507
883732
  invokeMethodArgs.keywordArguments.push(requestOptions);
883508
883733
  }
883734
+ invokeMethodArgs.keywordArguments = dedupeKeywordArguments(invokeMethodArgs.keywordArguments);
883509
883735
  return ruby_exports.invokeMethod(invokeMethodArgs);
883510
883736
  }
883511
883737
  /**
@@ -883842,6 +884068,21 @@ var EndpointSnippetGenerator7 = class {
883842
884068
  return this.context.getMethodName(endpoint3.declaration.name);
883843
884069
  }
883844
884070
  };
884071
+ function dedupeKeywordArguments(kwargs) {
884072
+ if (kwargs == null || kwargs.length <= 1) {
884073
+ return kwargs;
884074
+ }
884075
+ const lastIndexByName = /* @__PURE__ */ new Map();
884076
+ kwargs.forEach((arg, index3) => {
884077
+ lastIndexByName.set(arg.name, index3);
884078
+ });
884079
+ const deduped = kwargs.filter((arg, index3) => lastIndexByName.get(arg.name) === index3);
884080
+ if (deduped.length !== kwargs.length) {
884081
+ const droppedNames = Array.from(new Set(kwargs.map((arg) => arg.name).filter((name2, index3) => lastIndexByName.get(name2) !== index3)));
884082
+ 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.`);
884083
+ }
884084
+ return deduped;
884085
+ }
883845
884086
 
883846
884087
  // ../../../generators/ruby-v2/dynamic-snippets/lib/DynamicSnippetsGenerator.js
883847
884088
  var DynamicSnippetsGenerator6 = class extends AbstractDynamicSnippetsGenerator {
@@ -919401,7 +919642,7 @@ var CliContext = class _CliContext {
919401
919642
  if (false) {
919402
919643
  this.logger.error("CLI_VERSION is not defined");
919403
919644
  }
919404
- return "4.106.3";
919645
+ return "4.107.0-11-g58f57e9e0ec";
919405
919646
  }
919406
919647
  getCliName() {
919407
919648
  if (false) {