@fern-api/fern-api-dev 5.27.1 → 5.27.3
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 +90 -39
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -25319,7 +25319,17 @@ function errnoCode(error50) {
|
|
|
25319
25319
|
return void 0;
|
|
25320
25320
|
}
|
|
25321
25321
|
const code5 = error50.code;
|
|
25322
|
-
|
|
25322
|
+
if (typeof code5 === "string") {
|
|
25323
|
+
return code5;
|
|
25324
|
+
}
|
|
25325
|
+
const cause = error50.cause;
|
|
25326
|
+
if (cause instanceof Error) {
|
|
25327
|
+
const causeCode = cause.code;
|
|
25328
|
+
if (typeof causeCode === "string") {
|
|
25329
|
+
return causeCode;
|
|
25330
|
+
}
|
|
25331
|
+
}
|
|
25332
|
+
return void 0;
|
|
25323
25333
|
}
|
|
25324
25334
|
function resolveErrorCode(error50, explicitCode) {
|
|
25325
25335
|
if (explicitCode != null) {
|
|
@@ -25433,7 +25443,9 @@ var init_CliError = __esm({
|
|
|
25433
25443
|
"EMFILE",
|
|
25434
25444
|
"ENFILE",
|
|
25435
25445
|
"EBUSY",
|
|
25436
|
-
"EADDRINUSE"
|
|
25446
|
+
"EADDRINUSE",
|
|
25447
|
+
"ENOTEMPTY",
|
|
25448
|
+
"ENOMEM"
|
|
25437
25449
|
]);
|
|
25438
25450
|
NETWORK_ERRNOS = /* @__PURE__ */ new Set([
|
|
25439
25451
|
"ENOTFOUND",
|
|
@@ -587439,7 +587451,18 @@ async function getVersionedNavigationConfiguration({ versions, absolutePathToFer
|
|
|
587439
587451
|
const versionedNavbars = [];
|
|
587440
587452
|
for (const version7 of versions) {
|
|
587441
587453
|
const absoluteFilepathToVersionFile = resolve6(absolutePathToFernFolder, version7.path);
|
|
587442
|
-
|
|
587454
|
+
let versionContent;
|
|
587455
|
+
try {
|
|
587456
|
+
versionContent = jsYaml.load((await (0, import_promises14.readFile)(absoluteFilepathToVersionFile)).toString());
|
|
587457
|
+
} catch (error50) {
|
|
587458
|
+
if (error50 instanceof jsYaml.YAMLException) {
|
|
587459
|
+
throw new CliError({
|
|
587460
|
+
message: `Failed to parse version file ${version7.path}: ${error50.message}`,
|
|
587461
|
+
code: CliError.Code.ParseError
|
|
587462
|
+
});
|
|
587463
|
+
}
|
|
587464
|
+
throw error50;
|
|
587465
|
+
}
|
|
587443
587466
|
const removedPaths = [];
|
|
587444
587467
|
const sanitizedVersionContent = sanitizeNullValues(versionContent, [], removedPaths);
|
|
587445
587468
|
if (removedPaths.length > 0) {
|
|
@@ -587489,7 +587512,18 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
|
|
|
587489
587512
|
if ("path" in product) {
|
|
587490
587513
|
let navigation3;
|
|
587491
587514
|
const absoluteFilepathToProductFile = resolve6(absolutePathToFernFolder, product.path);
|
|
587492
|
-
|
|
587515
|
+
let content5;
|
|
587516
|
+
try {
|
|
587517
|
+
content5 = jsYaml.load((await (0, import_promises14.readFile)(absoluteFilepathToProductFile)).toString());
|
|
587518
|
+
} catch (error50) {
|
|
587519
|
+
if (error50 instanceof jsYaml.YAMLException) {
|
|
587520
|
+
throw new CliError({
|
|
587521
|
+
message: `Failed to parse product file ${product.path}: ${error50.message}`,
|
|
587522
|
+
code: CliError.Code.ParseError
|
|
587523
|
+
});
|
|
587524
|
+
}
|
|
587525
|
+
throw error50;
|
|
587526
|
+
}
|
|
587493
587527
|
const removedPaths = [];
|
|
587494
587528
|
const sanitizedContent = sanitizeNullValues(content5, [], removedPaths);
|
|
587495
587529
|
if (removedPaths.length > 0) {
|
|
@@ -667931,7 +667965,7 @@ var AccessTokenPosthogManager = class {
|
|
|
667931
667965
|
properties: {
|
|
667932
667966
|
...event,
|
|
667933
667967
|
...event.properties,
|
|
667934
|
-
version: "5.27.
|
|
667968
|
+
version: "5.27.3",
|
|
667935
667969
|
usingAccessToken: true,
|
|
667936
667970
|
...getRunIdProperties()
|
|
667937
667971
|
}
|
|
@@ -667995,7 +668029,7 @@ var UserPosthogManager = class {
|
|
|
667995
668029
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
667996
668030
|
event: "CLI",
|
|
667997
668031
|
properties: {
|
|
667998
|
-
version: "5.27.
|
|
668032
|
+
version: "5.27.3",
|
|
667999
668033
|
...event,
|
|
668000
668034
|
...event.properties,
|
|
668001
668035
|
usingAccessToken: false,
|
|
@@ -859567,7 +859601,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
859567
859601
|
var LOGS_FOLDER_NAME = "logs";
|
|
859568
859602
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
859569
859603
|
function getCliSource() {
|
|
859570
|
-
const version7 = "5.27.
|
|
859604
|
+
const version7 = "5.27.3";
|
|
859571
859605
|
return `cli@${version7}`;
|
|
859572
859606
|
}
|
|
859573
859607
|
var DebugLogger = class {
|
|
@@ -871673,13 +871707,22 @@ var SourceUploader = class {
|
|
|
871673
871707
|
async uploadSource(source2, uploadURL) {
|
|
871674
871708
|
const uploadCommand = await this.getUploadCommand(source2);
|
|
871675
871709
|
const fileData = await (0, import_promises100.readFile)(uploadCommand.absoluteFilePath);
|
|
871676
|
-
|
|
871677
|
-
|
|
871678
|
-
|
|
871679
|
-
|
|
871680
|
-
|
|
871681
|
-
|
|
871682
|
-
|
|
871710
|
+
let response;
|
|
871711
|
+
try {
|
|
871712
|
+
response = await fetch(uploadURL, {
|
|
871713
|
+
method: "PUT",
|
|
871714
|
+
body: fileData,
|
|
871715
|
+
headers: {
|
|
871716
|
+
"Content-Type": "application/octet-stream"
|
|
871717
|
+
}
|
|
871718
|
+
});
|
|
871719
|
+
} catch (error50) {
|
|
871720
|
+
await uploadCommand.cleanup();
|
|
871721
|
+
this.context.failAndThrow(`Network error uploading source file: ${source2.absoluteFilePath}`, error50, {
|
|
871722
|
+
code: CliError.Code.NetworkError
|
|
871723
|
+
});
|
|
871724
|
+
return;
|
|
871725
|
+
}
|
|
871683
871726
|
await uploadCommand.cleanup();
|
|
871684
871727
|
if (!response.ok) {
|
|
871685
871728
|
this.context.failAndThrow(`Failed to upload source file: ${source2.absoluteFilePath}. Status: ${response.status}, ${response.statusText}`, void 0, { code: CliError.Code.NetworkError });
|
|
@@ -872075,18 +872118,22 @@ async function uploadDynamicIRForSdkGeneration({ fdr, organization, version: ver
|
|
|
872075
872118
|
generatorConfig: dynamicGeneratorConfig
|
|
872076
872119
|
});
|
|
872077
872120
|
const dynamicIRJson = JSON.stringify(dynamicIR);
|
|
872078
|
-
|
|
872079
|
-
|
|
872080
|
-
|
|
872081
|
-
|
|
872082
|
-
|
|
872083
|
-
|
|
872121
|
+
try {
|
|
872122
|
+
const uploadResponse = await fetch(uploadUrl, {
|
|
872123
|
+
method: "PUT",
|
|
872124
|
+
body: dynamicIRJson,
|
|
872125
|
+
headers: {
|
|
872126
|
+
"Content-Type": "application/octet-stream",
|
|
872127
|
+
"Content-Length": dynamicIRJson.length.toString()
|
|
872128
|
+
}
|
|
872129
|
+
});
|
|
872130
|
+
if (uploadResponse.ok) {
|
|
872131
|
+
context3.logger.debug(`Uploaded dynamic IR for ${language}:${packageName} (${version7})`);
|
|
872132
|
+
} else {
|
|
872133
|
+
context3.logger.warn(`Failed to upload dynamic IR for ${language}: ${uploadResponse.status}`);
|
|
872084
872134
|
}
|
|
872085
|
-
})
|
|
872086
|
-
|
|
872087
|
-
context3.logger.debug(`Uploaded dynamic IR for ${language}:${packageName} (${version7})`);
|
|
872088
|
-
} else {
|
|
872089
|
-
context3.logger.warn(`Failed to upload dynamic IR for ${language}: ${uploadResponse.status}`);
|
|
872135
|
+
} catch (error50) {
|
|
872136
|
+
context3.logger.warn(`Network error uploading dynamic IR for ${language}: ${error50}`);
|
|
872090
872137
|
}
|
|
872091
872138
|
}
|
|
872092
872139
|
function resolveVersionFallback(resolvedVersion) {
|
|
@@ -873337,18 +873384,22 @@ async function uploadDynamicIRs({ dynamicIRs, dynamicIRUploadUrls, context: cont
|
|
|
873337
873384
|
const dynamicIR = dynamicIRs[language]?.dynamicIR;
|
|
873338
873385
|
if (dynamicIR) {
|
|
873339
873386
|
const jsonBody = JSON.stringify(dynamicIR);
|
|
873340
|
-
|
|
873341
|
-
|
|
873342
|
-
|
|
873343
|
-
|
|
873344
|
-
|
|
873345
|
-
|
|
873387
|
+
try {
|
|
873388
|
+
const response = await fetch(source2.uploadUrl, {
|
|
873389
|
+
method: "PUT",
|
|
873390
|
+
body: jsonBody,
|
|
873391
|
+
headers: {
|
|
873392
|
+
"Content-Type": "application/octet-stream",
|
|
873393
|
+
"Content-Length": Buffer.byteLength(jsonBody, "utf8").toString()
|
|
873394
|
+
}
|
|
873395
|
+
});
|
|
873396
|
+
if (response.ok) {
|
|
873397
|
+
context3.logger.debug(`Uploaded dynamic IR for ${apiId}:${language}`);
|
|
873398
|
+
} else {
|
|
873399
|
+
context3.logger.warn(`Failed to upload dynamic IR for ${apiId}:${language}`);
|
|
873346
873400
|
}
|
|
873347
|
-
})
|
|
873348
|
-
|
|
873349
|
-
context3.logger.debug(`Uploaded dynamic IR for ${apiId}:${language}`);
|
|
873350
|
-
} else {
|
|
873351
|
-
context3.logger.warn(`Failed to upload dynamic IR for ${apiId}:${language}`);
|
|
873401
|
+
} catch (error50) {
|
|
873402
|
+
context3.logger.warn(`Network error uploading dynamic IR for ${apiId}:${language}: ${error50}`);
|
|
873352
873403
|
}
|
|
873353
873404
|
} else {
|
|
873354
873405
|
context3.logger.warn(`Could not find matching dynamic IR to upload for ${apiId}:${language}`);
|
|
@@ -873540,7 +873591,7 @@ var LegacyDocsPublisher = class {
|
|
|
873540
873591
|
previewId,
|
|
873541
873592
|
disableTemplates: void 0,
|
|
873542
873593
|
skipUpload,
|
|
873543
|
-
cliVersion: "5.27.
|
|
873594
|
+
cliVersion: "5.27.3",
|
|
873544
873595
|
loginCommand: "fern auth login"
|
|
873545
873596
|
});
|
|
873546
873597
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -947945,7 +947996,7 @@ function getAutomationContextFromEnv() {
|
|
|
947945
947996
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
947946
947997
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
947947
947998
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
947948
|
-
cli_version: "5.27.
|
|
947999
|
+
cli_version: "5.27.3"
|
|
947949
948000
|
};
|
|
947950
948001
|
}
|
|
947951
948002
|
function isAutomationMode() {
|
|
@@ -948771,7 +948822,7 @@ var CliContext = class _CliContext {
|
|
|
948771
948822
|
if (false) {
|
|
948772
948823
|
this.logger.error("CLI_VERSION is not defined");
|
|
948773
948824
|
}
|
|
948774
|
-
return "5.27.
|
|
948825
|
+
return "5.27.3";
|
|
948775
948826
|
}
|
|
948776
948827
|
getCliName() {
|
|
948777
948828
|
if (false) {
|
package/package.json
CHANGED