@fern-api/fern-api-dev 5.23.3-826-ge7a7d3c7917 → 5.23.3-829-g64985efd096
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 +54 -11
- 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-829-g64985efd096",
|
|
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-829-g64985efd096",
|
|
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-829-g64985efd096";
|
|
866668
866668
|
return `cli@${version7}`;
|
|
866669
866669
|
}
|
|
866670
866670
|
var DebugLogger = class {
|
|
@@ -897500,10 +897500,35 @@ async function previewRegisterWithLocales({ fdrOrigin, token, headers: headers2,
|
|
|
897500
897500
|
return await response.json();
|
|
897501
897501
|
}
|
|
897502
897502
|
|
|
897503
|
+
// ../generation/remote-generation/remote-workspace-runner/lib/retryWithBackoff.js
|
|
897504
|
+
async function retryWithBackoff({ fn: fn2, maxRetries, baseDelayMs, jitterFactor = 0, isRetryable = () => true, logger: logger4, label, delayFn = (ms2) => new Promise((resolve15) => setTimeout(resolve15, ms2)) }) {
|
|
897505
|
+
let lastError;
|
|
897506
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
897507
|
+
try {
|
|
897508
|
+
return await fn2();
|
|
897509
|
+
} catch (error50) {
|
|
897510
|
+
lastError = error50;
|
|
897511
|
+
if (!isRetryable(error50) || attempt >= maxRetries) {
|
|
897512
|
+
throw error50;
|
|
897513
|
+
}
|
|
897514
|
+
const jitter = jitterFactor > 0 ? 1 + (Math.random() - 0.5) * jitterFactor : 1;
|
|
897515
|
+
const delayMs = Math.round(baseDelayMs * 2 ** attempt * jitter);
|
|
897516
|
+
if (label != null) {
|
|
897517
|
+
logger4.warn(`${label} (attempt ${attempt + 1}/${maxRetries + 1}), retrying in ${delayMs}ms...`);
|
|
897518
|
+
}
|
|
897519
|
+
await delayFn(delayMs);
|
|
897520
|
+
}
|
|
897521
|
+
}
|
|
897522
|
+
throw lastError;
|
|
897523
|
+
}
|
|
897524
|
+
|
|
897503
897525
|
// ../generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
897504
897526
|
var MEASURE_IMAGE_BATCH_SIZE = 10;
|
|
897505
897527
|
var UPLOAD_FILE_BATCH_SIZE = 10;
|
|
897506
897528
|
var HASH_CONCURRENCY = parseInt(process.env.FERN_DOCS_ASSET_HASH_CONCURRENCY ?? "32", 10);
|
|
897529
|
+
var REGISTER_MAX_RETRIES = 3;
|
|
897530
|
+
var REGISTER_BASE_DELAY_MS = 1e3;
|
|
897531
|
+
var REGISTER_JITTER_FACTOR = 0.5;
|
|
897507
897532
|
function sanitizePreviewId2(id) {
|
|
897508
897533
|
const sanitized = id.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
897509
897534
|
if (sanitized.length === 0) {
|
|
@@ -897678,13 +897703,22 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
897678
897703
|
};
|
|
897679
897704
|
}
|
|
897680
897705
|
}
|
|
897706
|
+
const effectiveApiName = apiName ?? getOriginalName(ir3.apiName);
|
|
897681
897707
|
let response;
|
|
897682
897708
|
try {
|
|
897683
|
-
response = await
|
|
897684
|
-
|
|
897685
|
-
|
|
897686
|
-
|
|
897687
|
-
|
|
897709
|
+
response = await retryWithBackoff({
|
|
897710
|
+
fn: () => fdr.api.register.registerApiDefinition({
|
|
897711
|
+
orgId: FdrAPI_exports.OrgId(organization),
|
|
897712
|
+
apiId: FdrAPI_exports.ApiId(effectiveApiName),
|
|
897713
|
+
definition: apiDefinition,
|
|
897714
|
+
dynamicIRs: dynamicIRsByLanguage
|
|
897715
|
+
}),
|
|
897716
|
+
maxRetries: REGISTER_MAX_RETRIES,
|
|
897717
|
+
baseDelayMs: REGISTER_BASE_DELAY_MS,
|
|
897718
|
+
jitterFactor: REGISTER_JITTER_FACTOR,
|
|
897719
|
+
isRetryable: isTransientError,
|
|
897720
|
+
logger: context3.logger,
|
|
897721
|
+
label: `registerApiDefinition failed for ${effectiveApiName}`
|
|
897688
897722
|
});
|
|
897689
897723
|
} catch (error50) {
|
|
897690
897724
|
const errorDetails = extractErrorDetails(error50);
|
|
@@ -898705,6 +898739,15 @@ function getAIEnhancerConfig(withAiExamples, styleInstructions) {
|
|
|
898705
898739
|
styleInstructions
|
|
898706
898740
|
};
|
|
898707
898741
|
}
|
|
898742
|
+
function isTransientError(error50) {
|
|
898743
|
+
const errorObj = error50;
|
|
898744
|
+
const content5 = errorObj?.content;
|
|
898745
|
+
const status = errorObj?.statusCode ?? content5?.statusCode;
|
|
898746
|
+
if (status == null) {
|
|
898747
|
+
return true;
|
|
898748
|
+
}
|
|
898749
|
+
return status === 429 || status >= 500;
|
|
898750
|
+
}
|
|
898708
898751
|
function extractErrorDetails(error50) {
|
|
898709
898752
|
const errorObj = error50;
|
|
898710
898753
|
const content5 = errorObj?.content;
|
|
@@ -898848,7 +898891,7 @@ var LegacyDocsPublisher = class {
|
|
|
898848
898891
|
previewId,
|
|
898849
898892
|
disableTemplates: void 0,
|
|
898850
898893
|
skipUpload,
|
|
898851
|
-
cliVersion: "5.23.3-
|
|
898894
|
+
cliVersion: "5.23.3-829-g64985efd096",
|
|
898852
898895
|
loginCommand: "fern auth login"
|
|
898853
898896
|
});
|
|
898854
898897
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -964533,7 +964576,7 @@ function getAutomationContextFromEnv() {
|
|
|
964533
964576
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
964534
964577
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
964535
964578
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
964536
|
-
cli_version: "5.23.3-
|
|
964579
|
+
cli_version: "5.23.3-829-g64985efd096"
|
|
964537
964580
|
};
|
|
964538
964581
|
}
|
|
964539
964582
|
function isAutomationMode() {
|
|
@@ -965365,7 +965408,7 @@ var CliContext = class _CliContext {
|
|
|
965365
965408
|
if (false) {
|
|
965366
965409
|
this.logger.error("CLI_VERSION is not defined");
|
|
965367
965410
|
}
|
|
965368
|
-
return "5.23.3-
|
|
965411
|
+
return "5.23.3-829-g64985efd096";
|
|
965369
965412
|
}
|
|
965370
965413
|
getCliName() {
|
|
965371
965414
|
if (false) {
|
package/package.json
CHANGED