@fern-api/fern-api-dev 5.33.3 → 5.33.4
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 +34 -23
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -658834,25 +658834,36 @@ async function detectAirGappedMode(url3, logger4, timeoutMs = 5e3) {
|
|
|
658834
658834
|
}
|
|
658835
658835
|
async function performAirGapDetection(url3, logger4, timeoutMs) {
|
|
658836
658836
|
logger4.debug(`Detecting air-gapped mode by checking connectivity to ${url3}`);
|
|
658837
|
-
|
|
658838
|
-
|
|
658839
|
-
|
|
658840
|
-
|
|
658841
|
-
|
|
658842
|
-
|
|
658843
|
-
|
|
658844
|
-
|
|
658845
|
-
|
|
658846
|
-
|
|
658847
|
-
|
|
658848
|
-
|
|
658849
|
-
|
|
658850
|
-
|
|
658851
|
-
|
|
658837
|
+
const maxAttempts = 3;
|
|
658838
|
+
let lastErrorMessage;
|
|
658839
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
658840
|
+
try {
|
|
658841
|
+
const res = await fetch(url3, {
|
|
658842
|
+
method: "GET",
|
|
658843
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
658844
|
+
});
|
|
658845
|
+
await res.body?.cancel().catch(() => void 0);
|
|
658846
|
+
airGapDetectionResult = false;
|
|
658847
|
+
logger4.debug("Network check succeeded - not in air-gapped mode");
|
|
658848
|
+
return false;
|
|
658849
|
+
} catch (error50) {
|
|
658850
|
+
const errorMessage = extractErrorMessage(error50);
|
|
658851
|
+
const causeMessage = error50 instanceof Error && error50.cause ? ` (cause: ${extractErrorMessage(error50.cause)})` : "";
|
|
658852
|
+
lastErrorMessage = `${errorMessage}${causeMessage}`;
|
|
658853
|
+
if (!isNetworkError(errorMessage)) {
|
|
658854
|
+
airGapDetectionResult = false;
|
|
658855
|
+
return false;
|
|
658856
|
+
}
|
|
658857
|
+
if (attempt < maxAttempts) {
|
|
658858
|
+
const delayMs = attempt * 500;
|
|
658859
|
+
logger4.debug(`Network check attempt ${attempt}/${maxAttempts} failed: ${lastErrorMessage} \u2014 retrying in ${delayMs}ms`);
|
|
658860
|
+
await new Promise((resolve15) => setTimeout(resolve15, delayMs));
|
|
658861
|
+
}
|
|
658852
658862
|
}
|
|
658853
|
-
airGapDetectionResult = false;
|
|
658854
|
-
return false;
|
|
658855
658863
|
}
|
|
658864
|
+
airGapDetectionResult = true;
|
|
658865
|
+
logger4.debug(`Network check failed after ${maxAttempts} attempts - entering air-gapped mode: ${lastErrorMessage}`);
|
|
658866
|
+
return true;
|
|
658856
658867
|
}
|
|
658857
658868
|
async function detectAirGappedModeForProtobuf(absoluteFilepathToProtobufRoot, logger4, bufCommand = "buf") {
|
|
658858
658869
|
const bufLockPath = join8(absoluteFilepathToProtobufRoot, RelativeFilePath2.of("buf.lock"));
|
|
@@ -668443,7 +668454,7 @@ var AccessTokenPosthogManager = class {
|
|
|
668443
668454
|
properties: {
|
|
668444
668455
|
...event,
|
|
668445
668456
|
...event.properties,
|
|
668446
|
-
version: "5.33.
|
|
668457
|
+
version: "5.33.4",
|
|
668447
668458
|
usingAccessToken: true,
|
|
668448
668459
|
...getRunIdProperties()
|
|
668449
668460
|
}
|
|
@@ -668507,7 +668518,7 @@ var UserPosthogManager = class {
|
|
|
668507
668518
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
668508
668519
|
event: "CLI",
|
|
668509
668520
|
properties: {
|
|
668510
|
-
version: "5.33.
|
|
668521
|
+
version: "5.33.4",
|
|
668511
668522
|
...event,
|
|
668512
668523
|
...event.properties,
|
|
668513
668524
|
usingAccessToken: false,
|
|
@@ -860304,7 +860315,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
860304
860315
|
var LOGS_FOLDER_NAME = "logs";
|
|
860305
860316
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
860306
860317
|
function getCliSource() {
|
|
860307
|
-
const version7 = "5.33.
|
|
860318
|
+
const version7 = "5.33.4";
|
|
860308
860319
|
return `cli@${version7}`;
|
|
860309
860320
|
}
|
|
860310
860321
|
var DebugLogger = class {
|
|
@@ -879150,7 +879161,7 @@ var LegacyDocsPublisher = class {
|
|
|
879150
879161
|
previewId,
|
|
879151
879162
|
disableTemplates: void 0,
|
|
879152
879163
|
skipUpload,
|
|
879153
|
-
cliVersion: "5.33.
|
|
879164
|
+
cliVersion: "5.33.4",
|
|
879154
879165
|
loginCommand: "fern auth login"
|
|
879155
879166
|
});
|
|
879156
879167
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -953850,7 +953861,7 @@ function getAutomationContextFromEnv() {
|
|
|
953850
953861
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
953851
953862
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
953852
953863
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
953853
|
-
cli_version: "5.33.
|
|
953864
|
+
cli_version: "5.33.4"
|
|
953854
953865
|
};
|
|
953855
953866
|
}
|
|
953856
953867
|
function isAutomationMode() {
|
|
@@ -954676,7 +954687,7 @@ var CliContext = class _CliContext {
|
|
|
954676
954687
|
if (false) {
|
|
954677
954688
|
this.logger.error("CLI_VERSION is not defined");
|
|
954678
954689
|
}
|
|
954679
|
-
return "5.33.
|
|
954690
|
+
return "5.33.4";
|
|
954680
954691
|
}
|
|
954681
954692
|
getCliName() {
|
|
954682
954693
|
if (false) {
|
package/package.json
CHANGED