@fern-api/fern-api-dev 5.23.3-829-g64985efd096 → 5.23.3-832-gfa15174fbb2
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 +123 -29
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -685536,7 +685536,7 @@ var AccessTokenPosthogManager = class {
|
|
|
685536
685536
|
properties: {
|
|
685537
685537
|
...event,
|
|
685538
685538
|
...event.properties,
|
|
685539
|
-
version: "5.23.3-
|
|
685539
|
+
version: "5.23.3-832-gfa15174fbb2",
|
|
685540
685540
|
usingAccessToken: true,
|
|
685541
685541
|
...getRunIdProperties()
|
|
685542
685542
|
}
|
|
@@ -685602,7 +685602,7 @@ var UserPosthogManager = class {
|
|
|
685602
685602
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
685603
685603
|
event: "CLI",
|
|
685604
685604
|
properties: {
|
|
685605
|
-
version: "5.23.3-
|
|
685605
|
+
version: "5.23.3-832-gfa15174fbb2",
|
|
685606
685606
|
...event,
|
|
685607
685607
|
...event.properties,
|
|
685608
685608
|
usingAccessToken: false,
|
|
@@ -866664,7 +866664,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
866664
866664
|
var LOGS_FOLDER_NAME = "logs";
|
|
866665
866665
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
866666
866666
|
function getCliSource() {
|
|
866667
|
-
const version7 = "5.23.3-
|
|
866667
|
+
const version7 = "5.23.3-832-gfa15174fbb2";
|
|
866668
866668
|
return `cli@${version7}`;
|
|
866669
866669
|
}
|
|
866670
866670
|
var DebugLogger = class {
|
|
@@ -898891,7 +898891,7 @@ var LegacyDocsPublisher = class {
|
|
|
898891
898891
|
previewId,
|
|
898892
898892
|
disableTemplates: void 0,
|
|
898893
898893
|
skipUpload,
|
|
898894
|
-
cliVersion: "5.23.3-
|
|
898894
|
+
cliVersion: "5.23.3-832-gfa15174fbb2",
|
|
898895
898895
|
loginCommand: "fern auth login"
|
|
898896
898896
|
});
|
|
898897
898897
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -924876,6 +924876,7 @@ var BaseJavaCustomConfigSchema = external_exports2.object({
|
|
|
924876
924876
|
"use-default-request-parameter-values": external_exports2.boolean().optional(),
|
|
924877
924877
|
"enable-wire-tests": external_exports2.boolean().default(false),
|
|
924878
924878
|
"collapse-optional-nullable": external_exports2.boolean().optional(),
|
|
924879
|
+
"use-nullable-annotation": external_exports2.boolean().optional(),
|
|
924879
924880
|
"custom-readme-sections": external_exports2.array(CustomReadmeSectionSchema).optional(),
|
|
924880
924881
|
"custom-pager-name": external_exports2.string().optional(),
|
|
924881
924882
|
"offset-semantics": external_exports2.enum(["item-index", "page-index"]).optional(),
|
|
@@ -925619,7 +925620,7 @@ var TypeLiteral = class _TypeLiteral extends AstNode3 {
|
|
|
925619
925620
|
writer2.write(".build()");
|
|
925620
925621
|
}
|
|
925621
925622
|
orderBuilderParameters(parameters2) {
|
|
925622
|
-
const hasRequiredFields = parameters2.some((p6) =>
|
|
925623
|
+
const hasRequiredFields = parameters2.some((p6) => this.isRequiredBuilderParameter(p6));
|
|
925623
925624
|
if (!hasRequiredFields) {
|
|
925624
925625
|
return parameters2.sort((a3, b5) => {
|
|
925625
925626
|
const aIsOptional = a3.value.isOptional();
|
|
@@ -925634,8 +925635,8 @@ var TypeLiteral = class _TypeLiteral extends AstNode3 {
|
|
|
925634
925635
|
});
|
|
925635
925636
|
}
|
|
925636
925637
|
return parameters2.sort((a3, b5) => {
|
|
925637
|
-
const aIsNonRequired = this.
|
|
925638
|
-
const bIsNonRequired = this.
|
|
925638
|
+
const aIsNonRequired = !this.isRequiredBuilderParameter(a3);
|
|
925639
|
+
const bIsNonRequired = !this.isRequiredBuilderParameter(b5);
|
|
925639
925640
|
if (aIsNonRequired && !bIsNonRequired) {
|
|
925640
925641
|
return 1;
|
|
925641
925642
|
}
|
|
@@ -925649,6 +925650,12 @@ var TypeLiteral = class _TypeLiteral extends AstNode3 {
|
|
|
925649
925650
|
const internalType = value2.internalType.type;
|
|
925650
925651
|
return internalType === "list" || internalType === "set" || internalType === "map";
|
|
925651
925652
|
}
|
|
925653
|
+
isRequiredBuilderParameter(parameter6) {
|
|
925654
|
+
if (parameter6.isRequired != null) {
|
|
925655
|
+
return parameter6.isRequired;
|
|
925656
|
+
}
|
|
925657
|
+
return !this.isNonRequired(parameter6.value);
|
|
925658
|
+
}
|
|
925652
925659
|
isNonRequired(value2) {
|
|
925653
925660
|
return value2.isOptional() || this.isCollection(value2);
|
|
925654
925661
|
}
|
|
@@ -926159,7 +926166,10 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926159
926166
|
this.context = context3;
|
|
926160
926167
|
}
|
|
926161
926168
|
usesOptionalNullable() {
|
|
926162
|
-
return this.context.
|
|
926169
|
+
return this.context.usesOptionalNullable();
|
|
926170
|
+
}
|
|
926171
|
+
usesNullableAnnotation() {
|
|
926172
|
+
return this.context.usesNullableAnnotation();
|
|
926163
926173
|
}
|
|
926164
926174
|
wrapInOptionalIfNotNop(value2, useOf = false, isCollapsedOptionalNullable = false) {
|
|
926165
926175
|
if (java_exports.TypeLiteral.isNop(value2)) {
|
|
@@ -926170,6 +926180,22 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926170
926180
|
}
|
|
926171
926181
|
return java_exports.TypeLiteral.optional({ value: value2, useOf });
|
|
926172
926182
|
}
|
|
926183
|
+
// Wraps an already-converted inner value for an `optional`/`nullable` wrapper type, honoring
|
|
926184
|
+
// the `use-nullable-annotation` (raw, no wrapper) and `collapse-optional-nullable`
|
|
926185
|
+
// (OptionalNullable<T>) configs. `propagatedCollapse` is set when an outer optional+nullable
|
|
926186
|
+
// collapsed into this node.
|
|
926187
|
+
wrapNullableOrOptionalValue({ value: value2, wrapperType, useOf, propagatedCollapse }) {
|
|
926188
|
+
if (java_exports.TypeLiteral.isNop(value2)) {
|
|
926189
|
+
return value2;
|
|
926190
|
+
}
|
|
926191
|
+
if (wrapperType === "nullable" && this.usesNullableAnnotation()) {
|
|
926192
|
+
return value2;
|
|
926193
|
+
}
|
|
926194
|
+
if (propagatedCollapse || this.usesOptionalNullable() && wrapperType === "nullable") {
|
|
926195
|
+
return this.context.getOptionalNullableOf(value2);
|
|
926196
|
+
}
|
|
926197
|
+
return java_exports.TypeLiteral.optional({ value: value2, useOf });
|
|
926198
|
+
}
|
|
926173
926199
|
convert(args) {
|
|
926174
926200
|
if (args.value === null) {
|
|
926175
926201
|
if (this.context.isNullable(args.typeReference)) {
|
|
@@ -926205,11 +926231,14 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926205
926231
|
}
|
|
926206
926232
|
case "nullable":
|
|
926207
926233
|
case "optional": {
|
|
926208
|
-
|
|
926209
|
-
|
|
926210
|
-
|
|
926211
|
-
|
|
926212
|
-
|
|
926234
|
+
const wrapperType = args.typeReference.type;
|
|
926235
|
+
const inner2 = args.typeReference.value;
|
|
926236
|
+
if (args.value === void 0 || typeof args.value === "object" && args.value !== null && Object.keys(args.value).length === 0 && inner2.type === "named") {
|
|
926237
|
+
if (!(wrapperType === "nullable" && this.usesNullableAnnotation())) {
|
|
926238
|
+
const isCollapsed = args.isCollapsedOptionalNullable || this.usesOptionalNullable() && (wrapperType === "nullable" || inner2.type === "optional" || inner2.type === "nullable");
|
|
926239
|
+
if (isCollapsed) {
|
|
926240
|
+
return this.context.getOptionalNullableAbsent();
|
|
926241
|
+
}
|
|
926213
926242
|
return java_exports.TypeLiteral.reference(java_exports.invokeMethod({
|
|
926214
926243
|
on: java_exports.classReference({
|
|
926215
926244
|
name: "Optional",
|
|
@@ -926220,27 +926249,37 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926220
926249
|
}));
|
|
926221
926250
|
}
|
|
926222
926251
|
}
|
|
926223
|
-
if (
|
|
926224
|
-
const listLiteral = this.convertList({ list: args.typeReference.value.value, value: args.value });
|
|
926225
|
-
return this.wrapInOptionalIfNotNop(listLiteral, true, args.isCollapsedOptionalNullable === true);
|
|
926226
|
-
}
|
|
926227
|
-
if (this.usesOptionalNullable() && (args.typeReference.value.type === "optional" || args.typeReference.value.type === "nullable")) {
|
|
926252
|
+
if (this.usesOptionalNullable() && (inner2.type === "optional" || inner2.type === "nullable")) {
|
|
926228
926253
|
return this.convert({
|
|
926229
|
-
typeReference:
|
|
926254
|
+
typeReference: inner2,
|
|
926230
926255
|
value: args.value,
|
|
926231
926256
|
as: args.as,
|
|
926232
926257
|
inUndiscriminatedUnion: args.inUndiscriminatedUnion,
|
|
926233
926258
|
isCollapsedOptionalNullable: true
|
|
926234
926259
|
});
|
|
926235
926260
|
}
|
|
926261
|
+
if (inner2.type === "list") {
|
|
926262
|
+
const listLiteral = this.convertList({ list: inner2.value, value: args.value });
|
|
926263
|
+
return this.wrapNullableOrOptionalValue({
|
|
926264
|
+
value: listLiteral,
|
|
926265
|
+
wrapperType,
|
|
926266
|
+
useOf: true,
|
|
926267
|
+
propagatedCollapse: args.isCollapsedOptionalNullable === true
|
|
926268
|
+
});
|
|
926269
|
+
}
|
|
926236
926270
|
const convertedValue = this.convert({
|
|
926237
|
-
typeReference:
|
|
926271
|
+
typeReference: inner2,
|
|
926238
926272
|
value: args.value,
|
|
926239
926273
|
as: args.as,
|
|
926240
926274
|
inUndiscriminatedUnion: args.inUndiscriminatedUnion
|
|
926241
926275
|
});
|
|
926242
926276
|
const useOf = args.as === "mapValue" || args.inUndiscriminatedUnion === true;
|
|
926243
|
-
return this.
|
|
926277
|
+
return this.wrapNullableOrOptionalValue({
|
|
926278
|
+
value: convertedValue,
|
|
926279
|
+
wrapperType,
|
|
926280
|
+
useOf,
|
|
926281
|
+
propagatedCollapse: args.isCollapsedOptionalNullable === true
|
|
926282
|
+
});
|
|
926244
926283
|
}
|
|
926245
926284
|
case "primitive":
|
|
926246
926285
|
return this.convertPrimitive({ primitive: args.typeReference.value, value: args.value, as: args.as });
|
|
@@ -926266,9 +926305,14 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926266
926305
|
values: value2.map((v3, index3) => {
|
|
926267
926306
|
this.context.errors.scope({ index: index3 });
|
|
926268
926307
|
try {
|
|
926269
|
-
if (isItemOptional) {
|
|
926308
|
+
if (isItemOptional && (list29.type === "optional" || list29.type === "nullable")) {
|
|
926270
926309
|
const itemValue = this.convert({ typeReference: list29.value, value: v3, as: as2 });
|
|
926271
|
-
return this.
|
|
926310
|
+
return this.wrapNullableOrOptionalValue({
|
|
926311
|
+
value: itemValue,
|
|
926312
|
+
wrapperType: list29.type,
|
|
926313
|
+
useOf: true,
|
|
926314
|
+
propagatedCollapse: false
|
|
926315
|
+
});
|
|
926272
926316
|
}
|
|
926273
926317
|
return this.convert({ typeReference: list29, value: v3, as: as2 });
|
|
926274
926318
|
} finally {
|
|
@@ -926489,7 +926533,8 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926489
926533
|
}
|
|
926490
926534
|
builderParameters.push({
|
|
926491
926535
|
name: this.context.getMethodName(property24.name.name),
|
|
926492
|
-
value: convertedValue
|
|
926536
|
+
value: convertedValue,
|
|
926537
|
+
isRequired: this.isStagedBuilderProperty(property24.typeReference)
|
|
926493
926538
|
});
|
|
926494
926539
|
} finally {
|
|
926495
926540
|
this.context.errors.unscope();
|
|
@@ -926501,7 +926546,8 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926501
926546
|
if (rawValue != null) {
|
|
926502
926547
|
builderParameters.push({
|
|
926503
926548
|
name: "additionalProperty",
|
|
926504
|
-
value: java_exports.TypeLiteral.raw(`"${this.escapeJavaString(key2)}", ${rawValue}`)
|
|
926549
|
+
value: java_exports.TypeLiteral.raw(`"${this.escapeJavaString(key2)}", ${rawValue}`),
|
|
926550
|
+
isRequired: false
|
|
926505
926551
|
});
|
|
926506
926552
|
}
|
|
926507
926553
|
}
|
|
@@ -926513,6 +926559,31 @@ var DynamicTypeLiteralMapper = class {
|
|
|
926513
926559
|
parameters: builderParameters
|
|
926514
926560
|
});
|
|
926515
926561
|
}
|
|
926562
|
+
/**
|
|
926563
|
+
* Returns true when a property becomes a required stage in v1's staged builder. v1 stages
|
|
926564
|
+
* fields that are neither optional, nullable, nor collections (list/set/map); those are all
|
|
926565
|
+
* exposed on the final stage instead. This intentionally resolves aliases itself because the
|
|
926566
|
+
* shared `isOptional` helper does not treat an alias to an optional type as optional.
|
|
926567
|
+
*/
|
|
926568
|
+
isStagedBuilderProperty(typeReference2) {
|
|
926569
|
+
switch (typeReference2.type) {
|
|
926570
|
+
case "optional":
|
|
926571
|
+
case "nullable":
|
|
926572
|
+
case "list":
|
|
926573
|
+
case "set":
|
|
926574
|
+
case "map":
|
|
926575
|
+
return false;
|
|
926576
|
+
case "named": {
|
|
926577
|
+
const resolvedType = this.context.resolveNamedType({ typeId: typeReference2.value });
|
|
926578
|
+
if (resolvedType != null && resolvedType.type === "alias") {
|
|
926579
|
+
return this.isStagedBuilderProperty(resolvedType.typeReference);
|
|
926580
|
+
}
|
|
926581
|
+
return true;
|
|
926582
|
+
}
|
|
926583
|
+
default:
|
|
926584
|
+
return true;
|
|
926585
|
+
}
|
|
926586
|
+
}
|
|
926516
926587
|
convertToRawJavaLiteral(value2) {
|
|
926517
926588
|
if (typeof value2 === "string") {
|
|
926518
926589
|
return `"${this.escapeJavaString(value2)}"`;
|
|
@@ -926991,9 +927062,26 @@ var DynamicTypeMapper3 = class {
|
|
|
926991
927062
|
}
|
|
926992
927063
|
return this.convertNamed({ named });
|
|
926993
927064
|
}
|
|
926994
|
-
case "optional":
|
|
927065
|
+
case "optional": {
|
|
927066
|
+
const inner2 = args.typeReference.value;
|
|
927067
|
+
if (this.context.usesOptionalNullable() && inner2.type === "nullable") {
|
|
927068
|
+
return java_exports.Type.generic(this.context.getOptionalNullableClassReference(), [
|
|
927069
|
+
this.convert({ typeReference: inner2.value })
|
|
927070
|
+
]);
|
|
927071
|
+
}
|
|
927072
|
+
return java_exports.Type.optional(this.convert({ typeReference: inner2 }));
|
|
927073
|
+
}
|
|
926995
927074
|
case "nullable": {
|
|
926996
|
-
|
|
927075
|
+
const inner2 = args.typeReference.value;
|
|
927076
|
+
if (this.context.usesNullableAnnotation()) {
|
|
927077
|
+
return this.convert({ typeReference: inner2 });
|
|
927078
|
+
}
|
|
927079
|
+
if (this.context.usesOptionalNullable()) {
|
|
927080
|
+
return java_exports.Type.generic(this.context.getOptionalNullableClassReference(), [
|
|
927081
|
+
this.convert({ typeReference: inner2 })
|
|
927082
|
+
]);
|
|
927083
|
+
}
|
|
927084
|
+
return java_exports.Type.optional(this.convert({ typeReference: inner2 }));
|
|
926997
927085
|
}
|
|
926998
927086
|
case "primitive":
|
|
926999
927087
|
return this.convertPrimitive({ primitive: args.typeReference.value });
|
|
@@ -927459,6 +927547,12 @@ var DynamicSnippetsGeneratorContext3 = class _DynamicSnippetsGeneratorContext ex
|
|
|
927459
927547
|
shouldInlineFileProperties() {
|
|
927460
927548
|
return this.customConfig?.["inline-file-properties"] ?? false;
|
|
927461
927549
|
}
|
|
927550
|
+
usesNullableAnnotation() {
|
|
927551
|
+
return this.customConfig?.["use-nullable-annotation"] === true;
|
|
927552
|
+
}
|
|
927553
|
+
usesOptionalNullable() {
|
|
927554
|
+
return this.customConfig?.["collapse-optional-nullable"] === true;
|
|
927555
|
+
}
|
|
927462
927556
|
getPackageNameSegments(fernFilepath) {
|
|
927463
927557
|
return fernFilepath.packagePath.map((segment) => this.getPackageNameSegment(segment));
|
|
927464
927558
|
}
|
|
@@ -964576,7 +964670,7 @@ function getAutomationContextFromEnv() {
|
|
|
964576
964670
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
964577
964671
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
964578
964672
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
964579
|
-
cli_version: "5.23.3-
|
|
964673
|
+
cli_version: "5.23.3-832-gfa15174fbb2"
|
|
964580
964674
|
};
|
|
964581
964675
|
}
|
|
964582
964676
|
function isAutomationMode() {
|
|
@@ -965408,7 +965502,7 @@ var CliContext = class _CliContext {
|
|
|
965408
965502
|
if (false) {
|
|
965409
965503
|
this.logger.error("CLI_VERSION is not defined");
|
|
965410
965504
|
}
|
|
965411
|
-
return "5.23.3-
|
|
965505
|
+
return "5.23.3-832-gfa15174fbb2";
|
|
965412
965506
|
}
|
|
965413
965507
|
getCliName() {
|
|
965414
965508
|
if (false) {
|
package/package.json
CHANGED