@fern-api/fern-api-dev 5.13.1-1-gbbdc59fd134 → 5.13.1
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 +13 -23
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -623368,7 +623368,7 @@ var AccessTokenPosthogManager = class {
|
|
|
623368
623368
|
properties: {
|
|
623369
623369
|
...event,
|
|
623370
623370
|
...event.properties,
|
|
623371
|
-
version: "5.13.1
|
|
623371
|
+
version: "5.13.1",
|
|
623372
623372
|
usingAccessToken: true
|
|
623373
623373
|
}
|
|
623374
623374
|
});
|
|
@@ -623422,7 +623422,7 @@ var UserPosthogManager = class {
|
|
|
623422
623422
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
623423
623423
|
event: "CLI",
|
|
623424
623424
|
properties: {
|
|
623425
|
-
version: "5.13.1
|
|
623425
|
+
version: "5.13.1",
|
|
623426
623426
|
...event,
|
|
623427
623427
|
...event.properties,
|
|
623428
623428
|
usingAccessToken: false,
|
|
@@ -848373,7 +848373,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
848373
848373
|
var LOGS_FOLDER_NAME = "logs";
|
|
848374
848374
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
848375
848375
|
function getCliSource() {
|
|
848376
|
-
const version7 = "5.13.1
|
|
848376
|
+
const version7 = "5.13.1";
|
|
848377
848377
|
return `cli@${version7}`;
|
|
848378
848378
|
}
|
|
848379
848379
|
var DebugLogger = class {
|
|
@@ -858504,14 +858504,12 @@ var import_zlib5 = require("zlib");
|
|
|
858504
858504
|
// ../generation/remote-generation/remote-workspace-runner/lib/retryWithRateLimit.js
|
|
858505
858505
|
var RATE_LIMIT_INITIAL_RETRY_DELAY_MS = 2e3;
|
|
858506
858506
|
var RATE_LIMIT_MAX_RETRY_DELAY_MS = 12e4;
|
|
858507
|
-
var RATE_LIMIT_MAX_RETRIES =
|
|
858508
|
-
var RATE_LIMIT_JITTER_FACTOR = 0.
|
|
858507
|
+
var RATE_LIMIT_MAX_RETRIES = 3;
|
|
858508
|
+
var RATE_LIMIT_JITTER_FACTOR = 0.2;
|
|
858509
858509
|
var TooManyRequestsError = class _TooManyRequestsError extends Error {
|
|
858510
|
-
|
|
858511
|
-
constructor(retryAfterSeconds) {
|
|
858510
|
+
constructor() {
|
|
858512
858511
|
super("Received 429 Too Many Requests");
|
|
858513
858512
|
Object.setPrototypeOf(this, _TooManyRequestsError.prototype);
|
|
858514
|
-
this.retryAfterSeconds = retryAfterSeconds;
|
|
858515
858513
|
}
|
|
858516
858514
|
};
|
|
858517
858515
|
async function retryWithRateLimit({ fn: fn10, retryRateLimited, logger: logger4, onRateLimitedWithoutRetry, delayFn = (ms6) => new Promise((resolve15) => setTimeout(resolve15, ms6)) }) {
|
|
@@ -858531,10 +858529,8 @@ async function retryWithRateLimit({ fn: fn10, retryRateLimited, logger: logger4,
|
|
|
858531
858529
|
} catch (error50) {
|
|
858532
858530
|
if (error50 instanceof TooManyRequestsError && attempt < RATE_LIMIT_MAX_RETRIES) {
|
|
858533
858531
|
const baseDelay = Math.min(RATE_LIMIT_INITIAL_RETRY_DELAY_MS * 2 ** attempt, RATE_LIMIT_MAX_RETRY_DELAY_MS);
|
|
858534
|
-
const serverHintMs = error50.retryAfterSeconds != null ? error50.retryAfterSeconds * 1e3 : void 0;
|
|
858535
|
-
const effectiveBase = serverHintMs != null ? Math.max(baseDelay, serverHintMs) : baseDelay;
|
|
858536
858532
|
const jitter = 1 + (Math.random() - 0.5) * RATE_LIMIT_JITTER_FACTOR;
|
|
858537
|
-
const delay4 = Math.round(
|
|
858533
|
+
const delay4 = Math.round(baseDelay * jitter);
|
|
858538
858534
|
logger4.warn(`Received 429 Too Many Requests. Retrying in ${(delay4 / 1e3).toFixed(1)}s (attempt ${attempt + 1}/${RATE_LIMIT_MAX_RETRIES})...`);
|
|
858539
858535
|
await delayFn(delay4);
|
|
858540
858536
|
} else {
|
|
@@ -858635,8 +858631,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
858635
858631
|
if (!createResponse.ok) {
|
|
858636
858632
|
const rawError = createResponse.error;
|
|
858637
858633
|
if (rawError?.content?.reason === "status-code" && rawError.content.statusCode === 429) {
|
|
858638
|
-
|
|
858639
|
-
throw new TooManyRequestsError(retryAfter);
|
|
858634
|
+
throw new TooManyRequestsError();
|
|
858640
858635
|
}
|
|
858641
858636
|
const githubAppNotInstalledMessage = extractGithubAppNotInstalledMessage(rawError);
|
|
858642
858637
|
if (githubAppNotInstalledMessage != null) {
|
|
@@ -858759,10 +858754,6 @@ function extractGithubAppNotInstalledMessage(error50) {
|
|
|
858759
858754
|
const repo = typeof body?.content?.repositoryName === "string" ? body.content.repositoryName : "the target repository";
|
|
858760
858755
|
return `The Fern GitHub App is not installed on ${repo}. Please install it (https://github.com/apps/fern-api) and try again.`;
|
|
858761
858756
|
}
|
|
858762
|
-
function extractRetryAfterSeconds(rawError) {
|
|
858763
|
-
const retryAfter = rawError?.content?.body?.content?.retryAfter;
|
|
858764
|
-
return typeof retryAfter === "number" && retryAfter > 0 ? retryAfter : void 0;
|
|
858765
|
-
}
|
|
858766
858757
|
function convertCreateJobError(error50) {
|
|
858767
858758
|
if (error50?.content?.reason === "status-code") {
|
|
858768
858759
|
const body = error50.content.body;
|
|
@@ -861046,7 +861037,7 @@ var LegacyDocsPublisher = class {
|
|
|
861046
861037
|
previewId,
|
|
861047
861038
|
disableTemplates: void 0,
|
|
861048
861039
|
skipUpload,
|
|
861049
|
-
cliVersion: "5.13.1
|
|
861040
|
+
cliVersion: "5.13.1",
|
|
861050
861041
|
loginCommand: "fern auth login"
|
|
861051
861042
|
});
|
|
861052
861043
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -935647,7 +935638,7 @@ var CliContext = class _CliContext {
|
|
|
935647
935638
|
if (false) {
|
|
935648
935639
|
this.logger.error("CLI_VERSION is not defined");
|
|
935649
935640
|
}
|
|
935650
|
-
return "5.13.1
|
|
935641
|
+
return "5.13.1";
|
|
935651
935642
|
}
|
|
935652
935643
|
getCliName() {
|
|
935653
935644
|
if (false) {
|
|
@@ -938581,10 +938572,9 @@ async function executeAutomationsGenerate({
|
|
|
938581
938572
|
noReplay: false,
|
|
938582
938573
|
// Automation runs are unattended; transient 429s should be retried
|
|
938583
938574
|
// automatically rather than failing the run and asking a human to
|
|
938584
|
-
// re-trigger with a flag. The retry policy is bounded (
|
|
938585
|
-
// 2s→120s exponential backoff with jitter
|
|
938586
|
-
//
|
|
938587
|
-
// rather than a hang.
|
|
938575
|
+
// re-trigger with a flag. The retry policy is bounded (3 attempts,
|
|
938576
|
+
// 2s→120s exponential backoff with jitter) so a real outage still
|
|
938577
|
+
// surfaces as a failure rather than a hang.
|
|
938588
938578
|
retryRateLimited: true,
|
|
938589
938579
|
requireEnvVars: false,
|
|
938590
938580
|
automationMode: true,
|
package/package.json
CHANGED