@fern-api/fern-api-dev 5.70.2 → 5.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +350 -18
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -75088,7 +75088,8 @@ var init_DiscriminatedUnionType2 = __esm({
|
|
|
75088
75088
|
DiscriminatedUnionType = schemas_exports3.objectWithoutOptionalProperties({
|
|
75089
75089
|
declaration: Declaration2,
|
|
75090
75090
|
discriminant: NameAndWireValue2,
|
|
75091
|
-
types: schemas_exports3.record(schemas_exports3.string(), SingleDiscriminatedUnionType2)
|
|
75091
|
+
types: schemas_exports3.record(schemas_exports3.string(), SingleDiscriminatedUnionType2),
|
|
75092
|
+
inheritedBaseProperties: schemas_exports3.list(NameAndWireValue2).optional()
|
|
75092
75093
|
});
|
|
75093
75094
|
}
|
|
75094
75095
|
});
|
|
@@ -75114,6 +75115,7 @@ var init_ObjectType2 = __esm({
|
|
|
75114
75115
|
"../../ir-sdk/lib/sdk/serialization/resources/dynamic/resources/types/types/ObjectType.js"() {
|
|
75115
75116
|
"use strict";
|
|
75116
75117
|
init_core2();
|
|
75118
|
+
init_NameAndWireValue4();
|
|
75117
75119
|
init_TypeId4();
|
|
75118
75120
|
init_Declaration4();
|
|
75119
75121
|
init_NamedParameter2();
|
|
@@ -75121,7 +75123,8 @@ var init_ObjectType2 = __esm({
|
|
|
75121
75123
|
declaration: Declaration2,
|
|
75122
75124
|
properties: schemas_exports3.list(NamedParameter),
|
|
75123
75125
|
extends: schemas_exports3.list(TypeId2).optional(),
|
|
75124
|
-
additionalProperties: schemas_exports3.boolean().optional()
|
|
75126
|
+
additionalProperties: schemas_exports3.boolean().optional(),
|
|
75127
|
+
deferredUnionBaseProperties: schemas_exports3.list(NameAndWireValue2).optional()
|
|
75125
75128
|
});
|
|
75126
75129
|
}
|
|
75127
75130
|
});
|
|
@@ -80451,13 +80454,15 @@ var init_ObjectTypeDeclaration2 = __esm({
|
|
|
80451
80454
|
"../../ir-sdk/lib/sdk/serialization/resources/types/types/ObjectTypeDeclaration.js"() {
|
|
80452
80455
|
"use strict";
|
|
80453
80456
|
init_core2();
|
|
80457
|
+
init_NameAndWireValue3();
|
|
80454
80458
|
init_DeclaredTypeName2();
|
|
80455
80459
|
init_ObjectProperty2();
|
|
80456
80460
|
ObjectTypeDeclaration = schemas_exports3.objectWithoutOptionalProperties({
|
|
80457
80461
|
extends: schemas_exports3.list(DeclaredTypeName),
|
|
80458
80462
|
properties: schemas_exports3.list(ObjectProperty),
|
|
80459
80463
|
extendedProperties: schemas_exports3.list(ObjectProperty).optional(),
|
|
80460
|
-
extraProperties: schemas_exports3.property("extra-properties", schemas_exports3.boolean())
|
|
80464
|
+
extraProperties: schemas_exports3.property("extra-properties", schemas_exports3.boolean()),
|
|
80465
|
+
deferredUnionBaseProperties: schemas_exports3.list(NameAndWireValue).optional()
|
|
80461
80466
|
});
|
|
80462
80467
|
}
|
|
80463
80468
|
});
|
|
@@ -80572,6 +80577,7 @@ var init_UnionTypeDeclaration2 = __esm({
|
|
|
80572
80577
|
"../../ir-sdk/lib/sdk/serialization/resources/types/types/UnionTypeDeclaration.js"() {
|
|
80573
80578
|
"use strict";
|
|
80574
80579
|
init_core2();
|
|
80580
|
+
init_NameAndWireValue3();
|
|
80575
80581
|
init_NameAndWireValueOrString3();
|
|
80576
80582
|
init_DeclaredTypeName2();
|
|
80577
80583
|
init_ObjectProperty2();
|
|
@@ -80582,6 +80588,7 @@ var init_UnionTypeDeclaration2 = __esm({
|
|
|
80582
80588
|
extends: schemas_exports3.list(DeclaredTypeName),
|
|
80583
80589
|
types: schemas_exports3.list(SingleUnionType),
|
|
80584
80590
|
baseProperties: schemas_exports3.list(ObjectProperty),
|
|
80591
|
+
inheritedBaseProperties: schemas_exports3.list(NameAndWireValue).optional(),
|
|
80585
80592
|
default: SingleUnionType.optional(),
|
|
80586
80593
|
discriminatorContext: UnionDiscriminatorContext4.optional()
|
|
80587
80594
|
});
|
|
@@ -262030,7 +262037,15 @@ function computeName(inputName, opts, config5) {
|
|
|
262030
262037
|
return word2;
|
|
262031
262038
|
}).join("") + nameTrailing);
|
|
262032
262039
|
}
|
|
262033
|
-
const smartSnakeFn = (n2) => n2.split(" ").map((part) =>
|
|
262040
|
+
const smartSnakeFn = (n2) => n2.split(" ").map((part) => {
|
|
262041
|
+
const segments = part.split(/(\d+)/);
|
|
262042
|
+
return segments.map((segment, index3) => {
|
|
262043
|
+
const casedSegment = snakeCase_default(segment);
|
|
262044
|
+
const previousSegment = segments[index3 - 1];
|
|
262045
|
+
const startsNewWord = casedSegment !== "" && previousSegment != null && /^\d+$/.test(previousSegment) && /^[^a-z0-9]/.test(segment);
|
|
262046
|
+
return startsNewWord ? `_${casedSegment}` : casedSegment;
|
|
262047
|
+
}).join("");
|
|
262048
|
+
}).join("_");
|
|
262034
262049
|
snakeCaseName = preserve ? withUnderscorePreservation(name2, smartSnakeFn) : smartSnakeFn(name2);
|
|
262035
262050
|
}
|
|
262036
262051
|
return {
|
|
@@ -267946,7 +267961,9 @@ function convertObjectTypeDeclaration({ object: object23, file: file4 }) {
|
|
|
267946
267961
|
extends: getExtensionsAsList(object23.extends).map((extended) => parseTypeName({ typeName: extended, file: file4 })),
|
|
267947
267962
|
properties: getObjectPropertiesFromRawObjectSchema(object23, file4),
|
|
267948
267963
|
extraProperties: object23["extra-properties"] ?? false,
|
|
267949
|
-
extendedProperties: void 0
|
|
267964
|
+
extendedProperties: void 0,
|
|
267965
|
+
// Populated by the computeUnionBasePropertyDedupe post-build pass; undefined here.
|
|
267966
|
+
deferredUnionBaseProperties: void 0
|
|
267950
267967
|
});
|
|
267951
267968
|
}
|
|
267952
267969
|
function getObjectPropertiesFromRawObjectSchema(object23, file4) {
|
|
@@ -268751,6 +268768,9 @@ function convertDiscriminatedUnionTypeDeclaration({ union: union23, file: file4,
|
|
|
268751
268768
|
autogeneratedExamples: {}
|
|
268752
268769
|
}
|
|
268753
268770
|
})) : [],
|
|
268771
|
+
// Populated by the computeUnionBasePropertyDedupe post-build pass once the full types map
|
|
268772
|
+
// is assembled; initialized empty here.
|
|
268773
|
+
inheritedBaseProperties: [],
|
|
268754
268774
|
types: unionTypes,
|
|
268755
268775
|
default: defaultUnionType,
|
|
268756
268776
|
discriminatorContext: getDiscriminatorContext({ union: union23 })
|
|
@@ -272470,15 +272490,18 @@ var init_DynamicSnippetsConverter = __esm({
|
|
|
272470
272490
|
declaration,
|
|
272471
272491
|
properties: properties7,
|
|
272472
272492
|
extends_: extendsTypeIds,
|
|
272473
|
-
additionalProperties: object23.extraProperties
|
|
272493
|
+
additionalProperties: object23.extraProperties,
|
|
272494
|
+
deferredUnionBaseProperties: object23.deferredUnionBaseProperties
|
|
272474
272495
|
});
|
|
272475
272496
|
}
|
|
272476
|
-
convertObjectProperties({ declaration, properties: properties7, extends_, additionalProperties: additionalProperties7 }) {
|
|
272497
|
+
convertObjectProperties({ declaration, properties: properties7, extends_, additionalProperties: additionalProperties7, deferredUnionBaseProperties }) {
|
|
272477
272498
|
return dynamic_exports.NamedType.object({
|
|
272478
272499
|
declaration,
|
|
272479
272500
|
properties: this.convertBodyPropertiesToParameters({ properties: properties7 }),
|
|
272480
272501
|
extends: extends_,
|
|
272481
|
-
additionalProperties: additionalProperties7
|
|
272502
|
+
additionalProperties: additionalProperties7,
|
|
272503
|
+
// Mirror the pre-computed regular-IR fact; computed once by the IR generator, never here.
|
|
272504
|
+
deferredUnionBaseProperties: deferredUnionBaseProperties?.map((property24) => this.inflateNameAndWireValue(property24))
|
|
272482
272505
|
});
|
|
272483
272506
|
}
|
|
272484
272507
|
convertDiscriminatedUnion({ declaration, union: union23 }) {
|
|
@@ -272486,6 +272509,8 @@ var init_DynamicSnippetsConverter = __esm({
|
|
|
272486
272509
|
return dynamic_exports.NamedType.discriminatedUnion({
|
|
272487
272510
|
declaration,
|
|
272488
272511
|
discriminant: this.inflateNameAndWireValue(union23.discriminant),
|
|
272512
|
+
// Mirror the pre-computed regular-IR fact; computed once by the IR generator, never here.
|
|
272513
|
+
inheritedBaseProperties: (union23.inheritedBaseProperties ?? []).map((property24) => this.inflateNameAndWireValue(property24)),
|
|
272489
272514
|
types: Object.fromEntries(union23.types.map((unionType2) => [
|
|
272490
272515
|
getWireValue(unionType2.discriminantValue),
|
|
272491
272516
|
this.convertDiscriminatedUnionType({
|
|
@@ -274883,7 +274908,9 @@ function convertGenericTypeDeclaration({ generic, file: file4, typeResolver }) {
|
|
|
274883
274908
|
extends: newExtends,
|
|
274884
274909
|
properties: getObjectPropertiesFromRawObjectSchema({ properties: Object.fromEntries(newProperties) }, file4),
|
|
274885
274910
|
extraProperties: resolvedBaseGeneric.declaration["extra-properties"] ?? false,
|
|
274886
|
-
extendedProperties: void 0
|
|
274911
|
+
extendedProperties: void 0,
|
|
274912
|
+
// Populated by the computeUnionBasePropertyDedupe post-build pass; undefined here.
|
|
274913
|
+
deferredUnionBaseProperties: void 0
|
|
274887
274914
|
});
|
|
274888
274915
|
}
|
|
274889
274916
|
throw new CliError({
|
|
@@ -276683,6 +276710,303 @@ var init_VariableResolver = __esm({
|
|
|
276683
276710
|
}
|
|
276684
276711
|
});
|
|
276685
276712
|
|
|
276713
|
+
// ../generation/ir-generator/lib/union-base-properties/computeUnionBasePropertyDedupe.js
|
|
276714
|
+
function collectApiSurfaceTypeReferences(value2, into) {
|
|
276715
|
+
if (Array.isArray(value2)) {
|
|
276716
|
+
for (const item of value2) {
|
|
276717
|
+
collectApiSurfaceTypeReferences(item, into);
|
|
276718
|
+
}
|
|
276719
|
+
return;
|
|
276720
|
+
}
|
|
276721
|
+
if (value2 == null || typeof value2 !== "object") {
|
|
276722
|
+
return;
|
|
276723
|
+
}
|
|
276724
|
+
for (const [key2, child] of Object.entries(value2)) {
|
|
276725
|
+
if (EXAMPLE_KEYS.has(key2)) {
|
|
276726
|
+
continue;
|
|
276727
|
+
}
|
|
276728
|
+
if (key2 === "typeId" && typeof child === "string") {
|
|
276729
|
+
into.add(child);
|
|
276730
|
+
continue;
|
|
276731
|
+
}
|
|
276732
|
+
collectApiSurfaceTypeReferences(child, into);
|
|
276733
|
+
}
|
|
276734
|
+
}
|
|
276735
|
+
function extractNamedTypeIds(typeReference2, types4, visited) {
|
|
276736
|
+
switch (typeReference2.type) {
|
|
276737
|
+
case "named": {
|
|
276738
|
+
const ids = [typeReference2.typeId];
|
|
276739
|
+
const declaration = types4[typeReference2.typeId];
|
|
276740
|
+
if (declaration?.shape.type === "alias" && !visited.has(typeReference2.typeId)) {
|
|
276741
|
+
visited.add(typeReference2.typeId);
|
|
276742
|
+
ids.push(...extractNamedTypeIds(declaration.shape.aliasOf, types4, visited));
|
|
276743
|
+
}
|
|
276744
|
+
return ids;
|
|
276745
|
+
}
|
|
276746
|
+
case "container":
|
|
276747
|
+
switch (typeReference2.container.type) {
|
|
276748
|
+
case "list":
|
|
276749
|
+
return extractNamedTypeIds(typeReference2.container.list, types4, visited);
|
|
276750
|
+
case "set":
|
|
276751
|
+
return extractNamedTypeIds(typeReference2.container.set, types4, visited);
|
|
276752
|
+
case "map":
|
|
276753
|
+
return [
|
|
276754
|
+
...extractNamedTypeIds(typeReference2.container.keyType, types4, visited),
|
|
276755
|
+
...extractNamedTypeIds(typeReference2.container.valueType, types4, visited)
|
|
276756
|
+
];
|
|
276757
|
+
case "optional":
|
|
276758
|
+
return extractNamedTypeIds(typeReference2.container.optional, types4, visited);
|
|
276759
|
+
case "nullable":
|
|
276760
|
+
return extractNamedTypeIds(typeReference2.container.nullable, types4, visited);
|
|
276761
|
+
case "literal":
|
|
276762
|
+
return [];
|
|
276763
|
+
default:
|
|
276764
|
+
return [];
|
|
276765
|
+
}
|
|
276766
|
+
case "primitive":
|
|
276767
|
+
case "unknown":
|
|
276768
|
+
return [];
|
|
276769
|
+
default:
|
|
276770
|
+
return [];
|
|
276771
|
+
}
|
|
276772
|
+
}
|
|
276773
|
+
function getOutgoingTypeReferences(typeDeclaration2, types4) {
|
|
276774
|
+
const variantEdges = [];
|
|
276775
|
+
const nonVariantEdges = [];
|
|
276776
|
+
const addNonVariant = (typeReference2) => {
|
|
276777
|
+
nonVariantEdges.push(...extractNamedTypeIds(typeReference2, types4, /* @__PURE__ */ new Set()));
|
|
276778
|
+
};
|
|
276779
|
+
typeDeclaration2.shape._visit({
|
|
276780
|
+
alias: (alias2) => {
|
|
276781
|
+
addNonVariant(alias2.aliasOf);
|
|
276782
|
+
},
|
|
276783
|
+
enum: () => void 0,
|
|
276784
|
+
object: (object23) => {
|
|
276785
|
+
for (const extended of object23.extends) {
|
|
276786
|
+
nonVariantEdges.push(extended.typeId);
|
|
276787
|
+
}
|
|
276788
|
+
for (const property24 of [...object23.properties, ...object23.extendedProperties ?? []]) {
|
|
276789
|
+
addNonVariant(property24.valueType);
|
|
276790
|
+
}
|
|
276791
|
+
},
|
|
276792
|
+
union: (union23) => {
|
|
276793
|
+
for (const extended of union23.extends) {
|
|
276794
|
+
nonVariantEdges.push(extended.typeId);
|
|
276795
|
+
}
|
|
276796
|
+
for (const baseProperty2 of union23.baseProperties) {
|
|
276797
|
+
addNonVariant(baseProperty2.valueType);
|
|
276798
|
+
}
|
|
276799
|
+
for (const unionType2 of union23.types) {
|
|
276800
|
+
unionType2.shape._visit({
|
|
276801
|
+
samePropertiesAsObject: (declaredTypeName) => {
|
|
276802
|
+
variantEdges.push(declaredTypeName.typeId);
|
|
276803
|
+
},
|
|
276804
|
+
singleProperty: (singleProperty) => {
|
|
276805
|
+
addNonVariant(singleProperty.type);
|
|
276806
|
+
},
|
|
276807
|
+
noProperties: () => void 0,
|
|
276808
|
+
_other: () => void 0
|
|
276809
|
+
});
|
|
276810
|
+
}
|
|
276811
|
+
},
|
|
276812
|
+
undiscriminatedUnion: (undiscriminatedUnion22) => {
|
|
276813
|
+
for (const member of undiscriminatedUnion22.members) {
|
|
276814
|
+
addNonVariant(member.type);
|
|
276815
|
+
}
|
|
276816
|
+
},
|
|
276817
|
+
_other: () => void 0
|
|
276818
|
+
});
|
|
276819
|
+
return { variantEdges, nonVariantEdges };
|
|
276820
|
+
}
|
|
276821
|
+
function buildTypeReferenceInfo(ir3) {
|
|
276822
|
+
const variantReferrers = /* @__PURE__ */ new Map();
|
|
276823
|
+
const nonVariantReferenced = /* @__PURE__ */ new Set();
|
|
276824
|
+
for (const [typeId, typeDeclaration2] of Object.entries(ir3.types)) {
|
|
276825
|
+
const { variantEdges, nonVariantEdges } = getOutgoingTypeReferences(typeDeclaration2, ir3.types);
|
|
276826
|
+
for (const variantTypeId of variantEdges) {
|
|
276827
|
+
const referrers = variantReferrers.get(variantTypeId) ?? /* @__PURE__ */ new Set();
|
|
276828
|
+
referrers.add(typeId);
|
|
276829
|
+
variantReferrers.set(variantTypeId, referrers);
|
|
276830
|
+
}
|
|
276831
|
+
for (const referencedTypeId of nonVariantEdges) {
|
|
276832
|
+
nonVariantReferenced.add(referencedTypeId);
|
|
276833
|
+
}
|
|
276834
|
+
}
|
|
276835
|
+
for (const apiSurface of [
|
|
276836
|
+
ir3.services,
|
|
276837
|
+
ir3.webhookGroups,
|
|
276838
|
+
ir3.websocketChannels,
|
|
276839
|
+
ir3.errors,
|
|
276840
|
+
ir3.headers,
|
|
276841
|
+
ir3.idempotencyHeaders,
|
|
276842
|
+
ir3.pathParameters,
|
|
276843
|
+
ir3.variables
|
|
276844
|
+
]) {
|
|
276845
|
+
collectApiSurfaceTypeReferences(apiSurface, nonVariantReferenced);
|
|
276846
|
+
}
|
|
276847
|
+
return { variantReferrers, nonVariantReferenced };
|
|
276848
|
+
}
|
|
276849
|
+
function resolveToObjectTypeId(typeId, types4) {
|
|
276850
|
+
const declaration = types4[typeId];
|
|
276851
|
+
if (declaration == null) {
|
|
276852
|
+
return void 0;
|
|
276853
|
+
}
|
|
276854
|
+
switch (declaration.shape.type) {
|
|
276855
|
+
case "object":
|
|
276856
|
+
return typeId;
|
|
276857
|
+
case "alias": {
|
|
276858
|
+
const resolved = declaration.shape.resolvedType;
|
|
276859
|
+
if (resolved.type === "named" && resolved.shape === "OBJECT") {
|
|
276860
|
+
return resolved.name.typeId;
|
|
276861
|
+
}
|
|
276862
|
+
return void 0;
|
|
276863
|
+
}
|
|
276864
|
+
default:
|
|
276865
|
+
return void 0;
|
|
276866
|
+
}
|
|
276867
|
+
}
|
|
276868
|
+
function getDeclaredProperties(typeId, types4) {
|
|
276869
|
+
const result = /* @__PURE__ */ new Map();
|
|
276870
|
+
const objectTypeId = resolveToObjectTypeId(typeId, types4);
|
|
276871
|
+
if (objectTypeId == null) {
|
|
276872
|
+
return result;
|
|
276873
|
+
}
|
|
276874
|
+
const declaration = types4[objectTypeId];
|
|
276875
|
+
if (declaration == null || declaration.shape.type !== "object") {
|
|
276876
|
+
return result;
|
|
276877
|
+
}
|
|
276878
|
+
for (const property24 of [...declaration.shape.properties, ...declaration.shape.extendedProperties ?? []]) {
|
|
276879
|
+
result.set(getWireValue(property24.name), {
|
|
276880
|
+
valueType: property24.valueType,
|
|
276881
|
+
name: toNameAndWireValue(property24.name)
|
|
276882
|
+
});
|
|
276883
|
+
}
|
|
276884
|
+
return result;
|
|
276885
|
+
}
|
|
276886
|
+
function typeReferencesEqual(a3, b5) {
|
|
276887
|
+
return JSON.stringify(a3) === JSON.stringify(b5);
|
|
276888
|
+
}
|
|
276889
|
+
function toNameAndWireValue(name2) {
|
|
276890
|
+
if (typeof name2 === "string") {
|
|
276891
|
+
return { wireValue: name2, name: name2 };
|
|
276892
|
+
}
|
|
276893
|
+
return name2;
|
|
276894
|
+
}
|
|
276895
|
+
function computeUnionBasePropertyDedupe(ir3) {
|
|
276896
|
+
const { types: types4 } = ir3;
|
|
276897
|
+
const inheritedBasePropertiesByUnion = /* @__PURE__ */ new Map();
|
|
276898
|
+
const deferredUnionBasePropertiesByObject = /* @__PURE__ */ new Map();
|
|
276899
|
+
const unionBaseProperties = /* @__PURE__ */ new Map();
|
|
276900
|
+
for (const [typeId, typeDeclaration2] of Object.entries(types4)) {
|
|
276901
|
+
if (typeDeclaration2.shape.type !== "union") {
|
|
276902
|
+
continue;
|
|
276903
|
+
}
|
|
276904
|
+
const union23 = typeDeclaration2.shape;
|
|
276905
|
+
if (union23.baseProperties.length === 0) {
|
|
276906
|
+
continue;
|
|
276907
|
+
}
|
|
276908
|
+
const baseByWireValue = /* @__PURE__ */ new Map();
|
|
276909
|
+
for (const baseProperty2 of union23.baseProperties) {
|
|
276910
|
+
baseByWireValue.set(getWireValue(baseProperty2.name), baseProperty2.valueType);
|
|
276911
|
+
}
|
|
276912
|
+
unionBaseProperties.set(typeId, baseByWireValue);
|
|
276913
|
+
const everyVariantIsObject = union23.types.every((variant) => variant.shape.propertiesType === "samePropertiesAsObject");
|
|
276914
|
+
if (!everyVariantIsObject) {
|
|
276915
|
+
inheritedBasePropertiesByUnion.set(typeId, []);
|
|
276916
|
+
continue;
|
|
276917
|
+
}
|
|
276918
|
+
const variantProperties = union23.types.map((variant) => variant.shape.propertiesType === "samePropertiesAsObject" ? getDeclaredProperties(variant.shape.typeId, types4) : /* @__PURE__ */ new Map());
|
|
276919
|
+
const inherited = [];
|
|
276920
|
+
for (const baseProperty2 of union23.baseProperties) {
|
|
276921
|
+
const wireValue = getWireValue(baseProperty2.name);
|
|
276922
|
+
const carriedByEveryVariant = variantProperties.every((declared) => {
|
|
276923
|
+
const match3 = declared.get(wireValue);
|
|
276924
|
+
return match3 != null && typeReferencesEqual(match3.valueType, baseProperty2.valueType);
|
|
276925
|
+
});
|
|
276926
|
+
if (carriedByEveryVariant) {
|
|
276927
|
+
inherited.push(toNameAndWireValue(baseProperty2.name));
|
|
276928
|
+
}
|
|
276929
|
+
}
|
|
276930
|
+
inheritedBasePropertiesByUnion.set(typeId, inherited);
|
|
276931
|
+
}
|
|
276932
|
+
const { variantReferrers, nonVariantReferenced } = buildTypeReferenceInfo(ir3);
|
|
276933
|
+
for (const [variantTypeId, owningUnionTypeIds] of variantReferrers) {
|
|
276934
|
+
const declaration = types4[variantTypeId];
|
|
276935
|
+
if (declaration == null || declaration.shape.type !== "object") {
|
|
276936
|
+
continue;
|
|
276937
|
+
}
|
|
276938
|
+
if (nonVariantReferenced.has(variantTypeId)) {
|
|
276939
|
+
continue;
|
|
276940
|
+
}
|
|
276941
|
+
const declaredProperties = getDeclaredProperties(variantTypeId, types4);
|
|
276942
|
+
if (declaredProperties.size === 0) {
|
|
276943
|
+
continue;
|
|
276944
|
+
}
|
|
276945
|
+
const deferred2 = [];
|
|
276946
|
+
for (const [wireValue, declared] of declaredProperties) {
|
|
276947
|
+
const deferredToEveryUnion = [...owningUnionTypeIds].every((unionTypeId) => {
|
|
276948
|
+
const baseType = unionBaseProperties.get(unionTypeId)?.get(wireValue);
|
|
276949
|
+
return baseType != null && typeReferencesEqual(baseType, declared.valueType);
|
|
276950
|
+
});
|
|
276951
|
+
if (deferredToEveryUnion) {
|
|
276952
|
+
deferred2.push(declared.name);
|
|
276953
|
+
}
|
|
276954
|
+
}
|
|
276955
|
+
if (deferred2.length > 0) {
|
|
276956
|
+
deferredUnionBasePropertiesByObject.set(variantTypeId, deferred2);
|
|
276957
|
+
}
|
|
276958
|
+
}
|
|
276959
|
+
return { inheritedBasePropertiesByUnion, deferredUnionBasePropertiesByObject };
|
|
276960
|
+
}
|
|
276961
|
+
function addUnionBasePropertyDedupeToIr(ir3) {
|
|
276962
|
+
const { inheritedBasePropertiesByUnion, deferredUnionBasePropertiesByObject } = computeUnionBasePropertyDedupe(ir3);
|
|
276963
|
+
ir3.types = Object.fromEntries(Object.entries(ir3.types).map(([typeId, typeDeclaration2]) => {
|
|
276964
|
+
switch (typeDeclaration2.shape.type) {
|
|
276965
|
+
case "union":
|
|
276966
|
+
return [
|
|
276967
|
+
typeId,
|
|
276968
|
+
{
|
|
276969
|
+
...typeDeclaration2,
|
|
276970
|
+
shape: {
|
|
276971
|
+
...typeDeclaration2.shape,
|
|
276972
|
+
inheritedBaseProperties: inheritedBasePropertiesByUnion.get(typeId) ?? []
|
|
276973
|
+
}
|
|
276974
|
+
}
|
|
276975
|
+
];
|
|
276976
|
+
case "object": {
|
|
276977
|
+
const deferred2 = deferredUnionBasePropertiesByObject.get(typeId);
|
|
276978
|
+
return [
|
|
276979
|
+
typeId,
|
|
276980
|
+
{
|
|
276981
|
+
...typeDeclaration2,
|
|
276982
|
+
shape: {
|
|
276983
|
+
...typeDeclaration2.shape,
|
|
276984
|
+
deferredUnionBaseProperties: deferred2
|
|
276985
|
+
}
|
|
276986
|
+
}
|
|
276987
|
+
];
|
|
276988
|
+
}
|
|
276989
|
+
default:
|
|
276990
|
+
return [typeId, typeDeclaration2];
|
|
276991
|
+
}
|
|
276992
|
+
}));
|
|
276993
|
+
}
|
|
276994
|
+
var EXAMPLE_KEYS;
|
|
276995
|
+
var init_computeUnionBasePropertyDedupe = __esm({
|
|
276996
|
+
"../generation/ir-generator/lib/union-base-properties/computeUnionBasePropertyDedupe.js"() {
|
|
276997
|
+
"use strict";
|
|
276998
|
+
init_lib21();
|
|
276999
|
+
EXAMPLE_KEYS = /* @__PURE__ */ new Set([
|
|
277000
|
+
"v2Examples",
|
|
277001
|
+
"autogeneratedExamples",
|
|
277002
|
+
"userSpecifiedExamples",
|
|
277003
|
+
"userProvidedExamples",
|
|
277004
|
+
"examples",
|
|
277005
|
+
"example"
|
|
277006
|
+
]);
|
|
277007
|
+
}
|
|
277008
|
+
});
|
|
277009
|
+
|
|
276686
277010
|
// ../generation/ir-generator/lib/utils/getEnvironmentsByAudience.js
|
|
276687
277011
|
function getAudienceForEnvironment(environmentId, rawEnvironments) {
|
|
276688
277012
|
if (rawEnvironments) {
|
|
@@ -277018,6 +277342,7 @@ function generateIntermediateRepresentation({ workspace, generationLanguage, key
|
|
|
277018
277342
|
});
|
|
277019
277343
|
intermediateRepresentation.serviceTypeReferenceInfo = computeServiceTypeReferenceInfo(irGraph);
|
|
277020
277344
|
addExtendedPropertiesToIr(intermediateRepresentation);
|
|
277345
|
+
addUnionBasePropertyDedupeToIr(intermediateRepresentation);
|
|
277021
277346
|
resolveGlobalParameterApplicability(intermediateRepresentation, {
|
|
277022
277347
|
onWarning: (message) => context3.logger.warn(message)
|
|
277023
277348
|
});
|
|
@@ -277187,6 +277512,7 @@ var init_generateIntermediateRepresentation = __esm({
|
|
|
277187
277512
|
init_PropertyResolver();
|
|
277188
277513
|
init_TypeResolver();
|
|
277189
277514
|
init_VariableResolver();
|
|
277515
|
+
init_computeUnionBasePropertyDedupe();
|
|
277190
277516
|
init_convertToFernFilepath();
|
|
277191
277517
|
init_getEnvironmentsByAudience();
|
|
277192
277518
|
init_getIrGenerationSettings();
|
|
@@ -344625,7 +344951,8 @@ var init_ObjectSchemaConverter = __esm({
|
|
|
344625
344951
|
properties: [],
|
|
344626
344952
|
extends: [],
|
|
344627
344953
|
extendedProperties: [],
|
|
344628
|
-
extraProperties: hasAdditionalProperties
|
|
344954
|
+
extraProperties: hasAdditionalProperties,
|
|
344955
|
+
deferredUnionBaseProperties: void 0
|
|
344629
344956
|
}),
|
|
344630
344957
|
propertiesByAudience: {},
|
|
344631
344958
|
inlinedTypes: {},
|
|
@@ -344779,7 +345106,8 @@ var init_ObjectSchemaConverter = __esm({
|
|
|
344779
345106
|
properties: properties7,
|
|
344780
345107
|
extends: extends_.map((ext2) => this.context.typeReferenceToDeclaredTypeName(ext2)).filter(isNonNullish),
|
|
344781
345108
|
extendedProperties: [],
|
|
344782
|
-
extraProperties: hasAdditionalProperties
|
|
345109
|
+
extraProperties: hasAdditionalProperties,
|
|
345110
|
+
deferredUnionBaseProperties: void 0
|
|
344783
345111
|
}),
|
|
344784
345112
|
propertiesByAudience,
|
|
344785
345113
|
referencedTypes,
|
|
@@ -345103,6 +345431,9 @@ var init_OneOfSchemaConverter = __esm({
|
|
|
345103
345431
|
return {
|
|
345104
345432
|
type: Type.union({
|
|
345105
345433
|
baseProperties,
|
|
345434
|
+
// Populated by the computeUnionBasePropertyDedupe post-build pass once the full
|
|
345435
|
+
// types map is assembled; initialized empty here.
|
|
345436
|
+
inheritedBaseProperties: [],
|
|
345106
345437
|
discriminant: this.context.casingsGenerator.generateNameAndWireValue({
|
|
345107
345438
|
name: this.schema.discriminator.propertyName,
|
|
345108
345439
|
wireValue: this.schema.discriminator.propertyName
|
|
@@ -689343,7 +689674,7 @@ var AccessTokenPosthogManager = class {
|
|
|
689343
689674
|
properties: {
|
|
689344
689675
|
...event,
|
|
689345
689676
|
...event.properties,
|
|
689346
|
-
version: "5.
|
|
689677
|
+
version: "5.71.0",
|
|
689347
689678
|
usingAccessToken: true,
|
|
689348
689679
|
...getRunIdProperties()
|
|
689349
689680
|
}
|
|
@@ -689409,7 +689740,7 @@ var UserPosthogManager = class {
|
|
|
689409
689740
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
689410
689741
|
event: "CLI",
|
|
689411
689742
|
properties: {
|
|
689412
|
-
version: "5.
|
|
689743
|
+
version: "5.71.0",
|
|
689413
689744
|
...event,
|
|
689414
689745
|
...event.properties,
|
|
689415
689746
|
usingAccessToken: false,
|
|
@@ -870510,7 +870841,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
870510
870841
|
var LOGS_FOLDER_NAME = "logs";
|
|
870511
870842
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
870512
870843
|
function getCliSource() {
|
|
870513
|
-
const version7 = "5.
|
|
870844
|
+
const version7 = "5.71.0";
|
|
870514
870845
|
return `cli@${version7}`;
|
|
870515
870846
|
}
|
|
870516
870847
|
var DebugLogger = class {
|
|
@@ -903082,7 +903413,7 @@ var LegacyDocsPublisher = class {
|
|
|
903082
903413
|
previewId,
|
|
903083
903414
|
disableTemplates: void 0,
|
|
903084
903415
|
skipUpload,
|
|
903085
|
-
cliVersion: "5.
|
|
903416
|
+
cliVersion: "5.71.0",
|
|
903086
903417
|
loginCommand: "fern auth login"
|
|
903087
903418
|
});
|
|
903088
903419
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -966257,7 +966588,8 @@ var MessageConverter = class extends AbstractConverter {
|
|
|
966257
966588
|
properties: convertedFields,
|
|
966258
966589
|
extends: [],
|
|
966259
966590
|
extendedProperties: [],
|
|
966260
|
-
extraProperties: false
|
|
966591
|
+
extraProperties: false,
|
|
966592
|
+
deferredUnionBaseProperties: void 0
|
|
966261
966593
|
}),
|
|
966262
966594
|
referencedTypes: allReferencedTypes,
|
|
966263
966595
|
typeName: this.message.name,
|
|
@@ -969508,7 +969840,7 @@ function getAutomationContextFromEnv() {
|
|
|
969508
969840
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
969509
969841
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
969510
969842
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
969511
|
-
cli_version: "5.
|
|
969843
|
+
cli_version: "5.71.0"
|
|
969512
969844
|
};
|
|
969513
969845
|
}
|
|
969514
969846
|
function isAutomationMode() {
|
|
@@ -970340,7 +970672,7 @@ var CliContext = class _CliContext {
|
|
|
970340
970672
|
if (false) {
|
|
970341
970673
|
this.logger.error("CLI_VERSION is not defined");
|
|
970342
970674
|
}
|
|
970343
|
-
return "5.
|
|
970675
|
+
return "5.71.0";
|
|
970344
970676
|
}
|
|
970345
970677
|
getCliName() {
|
|
970346
970678
|
if (false) {
|
package/package.json
CHANGED