@fern-api/fern-api-dev 5.57.0 → 5.58.0
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 +142 -141
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -454802,20 +454802,129 @@ var init_lib65 = __esm({
|
|
|
454802
454802
|
}
|
|
454803
454803
|
});
|
|
454804
454804
|
|
|
454805
|
-
// ../register/lib/ai-example-enhancer/
|
|
454806
|
-
|
|
454807
|
-
|
|
454808
|
-
|
|
454805
|
+
// ../register/lib/ai-example-enhancer/filterHelpers.js
|
|
454806
|
+
function isFdrTypedValueWrapper(value2) {
|
|
454807
|
+
if (value2 === null || value2 === void 0 || typeof value2 !== "object" || Array.isArray(value2)) {
|
|
454808
|
+
return false;
|
|
454809
|
+
}
|
|
454810
|
+
const obj = value2;
|
|
454811
|
+
const keys25 = Object.keys(obj);
|
|
454812
|
+
if (keys25.length === 0 || keys25.length > 2) {
|
|
454813
|
+
return false;
|
|
454814
|
+
}
|
|
454815
|
+
const hasType = "type" in obj && typeof obj.type === "string";
|
|
454816
|
+
const hasValue = "value" in obj;
|
|
454817
|
+
return hasType && keys25.length === 1 || hasType && hasValue && keys25.length === 2 || hasValue && keys25.length === 1;
|
|
454818
|
+
}
|
|
454819
|
+
function unwrapExampleValue(value2) {
|
|
454820
|
+
if (value2 === null || value2 === void 0) {
|
|
454821
|
+
return value2;
|
|
454822
|
+
}
|
|
454823
|
+
if (Array.isArray(value2)) {
|
|
454824
|
+
return value2.map(unwrapExampleValue);
|
|
454825
|
+
}
|
|
454826
|
+
if (typeof value2 !== "object") {
|
|
454827
|
+
return value2;
|
|
454828
|
+
}
|
|
454829
|
+
const obj = value2;
|
|
454830
|
+
if (isFdrTypedValueWrapper(obj)) {
|
|
454831
|
+
if ("value" in obj) {
|
|
454832
|
+
return unwrapExampleValue(obj.value);
|
|
454833
|
+
}
|
|
454834
|
+
return void 0;
|
|
454835
|
+
}
|
|
454836
|
+
const result = {};
|
|
454837
|
+
for (const [key2, val] of Object.entries(obj)) {
|
|
454838
|
+
const unwrapped = unwrapExampleValue(val);
|
|
454839
|
+
if (unwrapped !== void 0) {
|
|
454840
|
+
result[key2] = unwrapped;
|
|
454841
|
+
}
|
|
454842
|
+
}
|
|
454843
|
+
return result;
|
|
454844
|
+
}
|
|
454845
|
+
function isEmptyObject3(value2) {
|
|
454846
|
+
if (value2 === null || value2 === void 0) {
|
|
454847
|
+
return true;
|
|
454848
|
+
}
|
|
454849
|
+
if (typeof value2 !== "object") {
|
|
454850
|
+
return false;
|
|
454851
|
+
}
|
|
454852
|
+
if (Array.isArray(value2)) {
|
|
454853
|
+
return value2.length === 0;
|
|
454854
|
+
}
|
|
454855
|
+
return Object.keys(value2).length === 0;
|
|
454856
|
+
}
|
|
454857
|
+
function filterRequestBody(requestBody, pathParameters, queryParameters, headers2) {
|
|
454858
|
+
const extractedPathParams = {};
|
|
454859
|
+
const extractedQueryParams = {};
|
|
454860
|
+
const extractedHeaders = {};
|
|
454861
|
+
if (requestBody === null || requestBody === void 0 || typeof requestBody !== "object" || Array.isArray(requestBody)) {
|
|
454862
|
+
return { filteredBody: requestBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
454863
|
+
}
|
|
454864
|
+
const bodyRecord = requestBody;
|
|
454865
|
+
const filteredBody = {};
|
|
454866
|
+
const pathParamKeys = new Set(Object.keys(pathParameters ?? {}));
|
|
454867
|
+
const queryParamKeys = new Set(Object.keys(queryParameters ?? {}));
|
|
454868
|
+
const headerKeys = new Set(Object.keys(headers2 ?? {}));
|
|
454869
|
+
for (const [key2, value2] of Object.entries(bodyRecord)) {
|
|
454870
|
+
const normalizedKey = key2.toLowerCase().replace(/[-_]/g, "");
|
|
454871
|
+
let isPathParam = false;
|
|
454872
|
+
let isQueryParam = false;
|
|
454873
|
+
let isHeader = false;
|
|
454874
|
+
for (const pathKey of pathParamKeys) {
|
|
454875
|
+
const normalizedPathKey = pathKey.toLowerCase().replace(/[-_]/g, "");
|
|
454876
|
+
if (normalizedKey === normalizedPathKey) {
|
|
454877
|
+
isPathParam = true;
|
|
454878
|
+
extractedPathParams[pathKey] = value2;
|
|
454879
|
+
break;
|
|
454880
|
+
}
|
|
454881
|
+
}
|
|
454882
|
+
if (!isPathParam) {
|
|
454883
|
+
for (const queryKey of queryParamKeys) {
|
|
454884
|
+
const normalizedQueryKey = queryKey.toLowerCase().replace(/[-_]/g, "");
|
|
454885
|
+
if (normalizedKey === normalizedQueryKey) {
|
|
454886
|
+
isQueryParam = true;
|
|
454887
|
+
extractedQueryParams[queryKey] = value2;
|
|
454888
|
+
break;
|
|
454889
|
+
}
|
|
454890
|
+
}
|
|
454891
|
+
}
|
|
454892
|
+
if (!isPathParam && !isQueryParam) {
|
|
454893
|
+
for (const headerKey of headerKeys) {
|
|
454894
|
+
const normalizedHeaderKey = headerKey.toLowerCase().replace(/[-_]/g, "");
|
|
454895
|
+
if (normalizedKey === normalizedHeaderKey) {
|
|
454896
|
+
isHeader = true;
|
|
454897
|
+
extractedHeaders[headerKey] = value2;
|
|
454898
|
+
break;
|
|
454899
|
+
}
|
|
454900
|
+
}
|
|
454901
|
+
}
|
|
454902
|
+
if (!isPathParam && !isQueryParam && !isHeader) {
|
|
454903
|
+
filteredBody[key2] = value2;
|
|
454904
|
+
}
|
|
454905
|
+
}
|
|
454906
|
+
return { filteredBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
454907
|
+
}
|
|
454908
|
+
var init_filterHelpers = __esm({
|
|
454909
|
+
"../register/lib/ai-example-enhancer/filterHelpers.js"() {
|
|
454910
|
+
"use strict";
|
|
454911
|
+
}
|
|
454912
|
+
});
|
|
454913
|
+
|
|
454914
|
+
// ../register/lib/ai-example-enhancer/lambdaClient.js
|
|
454915
|
+
var DEFAULT_AI_ENHANCEMENT_MAX_RETRIES, DEFAULT_AI_ENHANCEMENT_TIMEOUT_MS, LambdaExampleEnhancer;
|
|
454916
|
+
var init_lambdaClient = __esm({
|
|
454917
|
+
"../register/lib/ai-example-enhancer/lambdaClient.js"() {
|
|
454809
454918
|
"use strict";
|
|
454810
454919
|
init_lib4();
|
|
454811
454920
|
init_lib35();
|
|
454812
454921
|
init_lib6();
|
|
454813
454922
|
DEFAULT_AI_ENHANCEMENT_MAX_RETRIES = 0;
|
|
454814
454923
|
DEFAULT_AI_ENHANCEMENT_TIMEOUT_MS = 15e3;
|
|
454815
|
-
|
|
454924
|
+
LambdaExampleEnhancer = class {
|
|
454816
454925
|
config;
|
|
454817
454926
|
context;
|
|
454818
|
-
|
|
454927
|
+
lambdaOrigin;
|
|
454819
454928
|
venusOrigin;
|
|
454820
454929
|
token;
|
|
454821
454930
|
jwtPromise;
|
|
@@ -454831,14 +454940,14 @@ var init_faiClient = __esm({
|
|
|
454831
454940
|
styleInstructions: config5.styleInstructions
|
|
454832
454941
|
};
|
|
454833
454942
|
this.context = context3;
|
|
454834
|
-
const
|
|
454835
|
-
if (!
|
|
454943
|
+
const lambdaOrigin = "https://ykq45y6fvnszd35iv5yuuatkze0rpwuz.lambda-url.us-east-1.on.aws";
|
|
454944
|
+
if (!lambdaOrigin) {
|
|
454836
454945
|
throw new CliError({
|
|
454837
|
-
message: "
|
|
454946
|
+
message: "DEFAULT_FDR_LAMBDA_DOCS_ORIGIN environment variable is not set. AI example enhancement requires this to be configured.",
|
|
454838
454947
|
code: CliError.Code.EnvironmentError
|
|
454839
454948
|
});
|
|
454840
454949
|
}
|
|
454841
|
-
this.
|
|
454950
|
+
this.lambdaOrigin = lambdaOrigin;
|
|
454842
454951
|
this.venusOrigin = "https://venus-dev2.buildwithfern.com";
|
|
454843
454952
|
this.token = token;
|
|
454844
454953
|
this.organizationId = organizationId;
|
|
@@ -454943,7 +455052,7 @@ var init_faiClient = __esm({
|
|
|
454943
455052
|
const maxAttempts = this.config.maxRetries + 1;
|
|
454944
455053
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
454945
455054
|
try {
|
|
454946
|
-
this.context.logger.debug(`Enhancing example for ${request7.method} ${request7.endpointPath} via
|
|
455055
|
+
this.context.logger.debug(`Enhancing example for ${request7.method} ${request7.endpointPath} via lambda (attempt ${attempt}/${maxAttempts})`);
|
|
454947
455056
|
const requestBody = {
|
|
454948
455057
|
method: request7.method,
|
|
454949
455058
|
endpointPath: request7.endpointPath,
|
|
@@ -454959,7 +455068,7 @@ var init_faiClient = __esm({
|
|
|
454959
455068
|
...requestBody,
|
|
454960
455069
|
openApiSpec: request7.openApiSpec ? `[OpenAPI spec present: ${request7.openApiSpec.length} chars]` : "[No OpenAPI spec]"
|
|
454961
455070
|
}, null, 2)}`);
|
|
454962
|
-
const response = await fetch(`${this.
|
|
455071
|
+
const response = await fetch(`${this.lambdaOrigin}/v2/registry/ai/enhance-example`, {
|
|
454963
455072
|
method: "POST",
|
|
454964
455073
|
headers: {
|
|
454965
455074
|
"Content-Type": "application/json",
|
|
@@ -454971,7 +455080,7 @@ var init_faiClient = __esm({
|
|
|
454971
455080
|
if (!response.ok) {
|
|
454972
455081
|
const errorText = await response.text();
|
|
454973
455082
|
throw new CliError({
|
|
454974
|
-
message: `
|
|
455083
|
+
message: `Lambda returned ${response.status}: ${errorText || response.statusText}`,
|
|
454975
455084
|
code: CliError.Code.NetworkError
|
|
454976
455085
|
});
|
|
454977
455086
|
}
|
|
@@ -454999,115 +455108,6 @@ var init_faiClient = __esm({
|
|
|
454999
455108
|
}
|
|
455000
455109
|
});
|
|
455001
455110
|
|
|
455002
|
-
// ../register/lib/ai-example-enhancer/filterHelpers.js
|
|
455003
|
-
function isFdrTypedValueWrapper(value2) {
|
|
455004
|
-
if (value2 === null || value2 === void 0 || typeof value2 !== "object" || Array.isArray(value2)) {
|
|
455005
|
-
return false;
|
|
455006
|
-
}
|
|
455007
|
-
const obj = value2;
|
|
455008
|
-
const keys25 = Object.keys(obj);
|
|
455009
|
-
if (keys25.length === 0 || keys25.length > 2) {
|
|
455010
|
-
return false;
|
|
455011
|
-
}
|
|
455012
|
-
const hasType = "type" in obj && typeof obj.type === "string";
|
|
455013
|
-
const hasValue = "value" in obj;
|
|
455014
|
-
return hasType && keys25.length === 1 || hasType && hasValue && keys25.length === 2 || hasValue && keys25.length === 1;
|
|
455015
|
-
}
|
|
455016
|
-
function unwrapExampleValue(value2) {
|
|
455017
|
-
if (value2 === null || value2 === void 0) {
|
|
455018
|
-
return value2;
|
|
455019
|
-
}
|
|
455020
|
-
if (Array.isArray(value2)) {
|
|
455021
|
-
return value2.map(unwrapExampleValue);
|
|
455022
|
-
}
|
|
455023
|
-
if (typeof value2 !== "object") {
|
|
455024
|
-
return value2;
|
|
455025
|
-
}
|
|
455026
|
-
const obj = value2;
|
|
455027
|
-
if (isFdrTypedValueWrapper(obj)) {
|
|
455028
|
-
if ("value" in obj) {
|
|
455029
|
-
return unwrapExampleValue(obj.value);
|
|
455030
|
-
}
|
|
455031
|
-
return void 0;
|
|
455032
|
-
}
|
|
455033
|
-
const result = {};
|
|
455034
|
-
for (const [key2, val] of Object.entries(obj)) {
|
|
455035
|
-
const unwrapped = unwrapExampleValue(val);
|
|
455036
|
-
if (unwrapped !== void 0) {
|
|
455037
|
-
result[key2] = unwrapped;
|
|
455038
|
-
}
|
|
455039
|
-
}
|
|
455040
|
-
return result;
|
|
455041
|
-
}
|
|
455042
|
-
function isEmptyObject3(value2) {
|
|
455043
|
-
if (value2 === null || value2 === void 0) {
|
|
455044
|
-
return true;
|
|
455045
|
-
}
|
|
455046
|
-
if (typeof value2 !== "object") {
|
|
455047
|
-
return false;
|
|
455048
|
-
}
|
|
455049
|
-
if (Array.isArray(value2)) {
|
|
455050
|
-
return value2.length === 0;
|
|
455051
|
-
}
|
|
455052
|
-
return Object.keys(value2).length === 0;
|
|
455053
|
-
}
|
|
455054
|
-
function filterRequestBody(requestBody, pathParameters, queryParameters, headers2) {
|
|
455055
|
-
const extractedPathParams = {};
|
|
455056
|
-
const extractedQueryParams = {};
|
|
455057
|
-
const extractedHeaders = {};
|
|
455058
|
-
if (requestBody === null || requestBody === void 0 || typeof requestBody !== "object" || Array.isArray(requestBody)) {
|
|
455059
|
-
return { filteredBody: requestBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
455060
|
-
}
|
|
455061
|
-
const bodyRecord = requestBody;
|
|
455062
|
-
const filteredBody = {};
|
|
455063
|
-
const pathParamKeys = new Set(Object.keys(pathParameters ?? {}));
|
|
455064
|
-
const queryParamKeys = new Set(Object.keys(queryParameters ?? {}));
|
|
455065
|
-
const headerKeys = new Set(Object.keys(headers2 ?? {}));
|
|
455066
|
-
for (const [key2, value2] of Object.entries(bodyRecord)) {
|
|
455067
|
-
const normalizedKey = key2.toLowerCase().replace(/[-_]/g, "");
|
|
455068
|
-
let isPathParam = false;
|
|
455069
|
-
let isQueryParam = false;
|
|
455070
|
-
let isHeader = false;
|
|
455071
|
-
for (const pathKey of pathParamKeys) {
|
|
455072
|
-
const normalizedPathKey = pathKey.toLowerCase().replace(/[-_]/g, "");
|
|
455073
|
-
if (normalizedKey === normalizedPathKey) {
|
|
455074
|
-
isPathParam = true;
|
|
455075
|
-
extractedPathParams[pathKey] = value2;
|
|
455076
|
-
break;
|
|
455077
|
-
}
|
|
455078
|
-
}
|
|
455079
|
-
if (!isPathParam) {
|
|
455080
|
-
for (const queryKey of queryParamKeys) {
|
|
455081
|
-
const normalizedQueryKey = queryKey.toLowerCase().replace(/[-_]/g, "");
|
|
455082
|
-
if (normalizedKey === normalizedQueryKey) {
|
|
455083
|
-
isQueryParam = true;
|
|
455084
|
-
extractedQueryParams[queryKey] = value2;
|
|
455085
|
-
break;
|
|
455086
|
-
}
|
|
455087
|
-
}
|
|
455088
|
-
}
|
|
455089
|
-
if (!isPathParam && !isQueryParam) {
|
|
455090
|
-
for (const headerKey of headerKeys) {
|
|
455091
|
-
const normalizedHeaderKey = headerKey.toLowerCase().replace(/[-_]/g, "");
|
|
455092
|
-
if (normalizedKey === normalizedHeaderKey) {
|
|
455093
|
-
isHeader = true;
|
|
455094
|
-
extractedHeaders[headerKey] = value2;
|
|
455095
|
-
break;
|
|
455096
|
-
}
|
|
455097
|
-
}
|
|
455098
|
-
}
|
|
455099
|
-
if (!isPathParam && !isQueryParam && !isHeader) {
|
|
455100
|
-
filteredBody[key2] = value2;
|
|
455101
|
-
}
|
|
455102
|
-
}
|
|
455103
|
-
return { filteredBody, extractedPathParams, extractedQueryParams, extractedHeaders };
|
|
455104
|
-
}
|
|
455105
|
-
var init_filterHelpers = __esm({
|
|
455106
|
-
"../register/lib/ai-example-enhancer/filterHelpers.js"() {
|
|
455107
|
-
"use strict";
|
|
455108
|
-
}
|
|
455109
|
-
});
|
|
455110
|
-
|
|
455111
455111
|
// ../register/lib/ai-example-enhancer/spinnerStatusCoordinator.js
|
|
455112
455112
|
var SpinnerStatusCoordinator;
|
|
455113
455113
|
var init_spinnerStatusCoordinator = __esm({
|
|
@@ -455713,7 +455713,7 @@ async function enhanceExamplesWithAI(apiDefinition, config5, context3, token, or
|
|
|
455713
455713
|
}
|
|
455714
455714
|
}
|
|
455715
455715
|
async function performAIEnhancement(apiDefinition, config5, context3, token, organizationId, sourceSpecs, apiName) {
|
|
455716
|
-
const enhancer = new
|
|
455716
|
+
const enhancer = new LambdaExampleEnhancer(config5, context3, token, organizationId);
|
|
455717
455717
|
const circuitBreaker = new CircuitBreaker();
|
|
455718
455718
|
let openApiSpec;
|
|
455719
455719
|
let endpointsNeedingRegeneration = /* @__PURE__ */ new Set();
|
|
@@ -455926,7 +455926,7 @@ function collectWorkItems(pkg2, coveredEndpoints, endpointsNeedingRegeneration,
|
|
|
455926
455926
|
}
|
|
455927
455927
|
async function processEndpointsConcurrently(allWorkItems, enhancer, context3, organizationId, stats, enhancedExampleRecords, openApiSpec, sourceFilePath, statusId, apiStats, circuitBreaker) {
|
|
455928
455928
|
const maxConcurrentRequests = parseInt(process.env.FERN_AI_MAX_CONCURRENT || "25", 10);
|
|
455929
|
-
context3.logger.debug(`Processing ${allWorkItems.length} endpoints with max ${maxConcurrentRequests} concurrent
|
|
455929
|
+
context3.logger.debug(`Processing ${allWorkItems.length} endpoints with max ${maxConcurrentRequests} concurrent Lambda calls using rolling window queue`);
|
|
455930
455930
|
if (circuitBreaker?.shouldSkip()) {
|
|
455931
455931
|
context3.logger.debug(`Circuit breaker is open after ${circuitBreaker.getFailureCount()} failures (threshold: ${circuitBreaker.getThreshold()}). Skipping AI enhancement for remaining endpoints.`);
|
|
455932
455932
|
return /* @__PURE__ */ new Map();
|
|
@@ -456043,7 +456043,7 @@ async function processEndpoint(workItem, enhancer, context3, organizationId, sta
|
|
|
456043
456043
|
const result = await enhancer.enhanceExample(request7);
|
|
456044
456044
|
circuitBreaker?.recordSuccess();
|
|
456045
456045
|
if (result.enhancedRequestExample != null && request7.originalRequestExample != null) {
|
|
456046
|
-
const unwrapped =
|
|
456046
|
+
const unwrapped = unwrapLambdaBodyEnvelope(result.enhancedRequestExample);
|
|
456047
456047
|
const originalHasBody = isObjectWithKey(request7.originalRequestExample, "body");
|
|
456048
456048
|
if (unwrapped.wasWrapped && !originalHasBody) {
|
|
456049
456049
|
result.enhancedRequestExample = backfillMissingFields(unwrapped.inner, request7.originalRequestExample);
|
|
@@ -456327,7 +456327,7 @@ function extractExampleValue(bodyV3) {
|
|
|
456327
456327
|
function isObjectWithKey(value2, key2) {
|
|
456328
456328
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2) && key2 in value2;
|
|
456329
456329
|
}
|
|
456330
|
-
function
|
|
456330
|
+
function unwrapLambdaBodyEnvelope(value2) {
|
|
456331
456331
|
if (typeof value2 === "object" && value2 !== null && !Array.isArray(value2) && "body" in value2) {
|
|
456332
456332
|
return { wasWrapped: true, inner: value2.body };
|
|
456333
456333
|
}
|
|
@@ -456365,8 +456365,8 @@ var init_enhanceExamplesWithAI = __esm({
|
|
|
456365
456365
|
init_lib65();
|
|
456366
456366
|
import_promises72 = require("fs/promises");
|
|
456367
456367
|
init_js_yaml();
|
|
456368
|
-
init_faiClient();
|
|
456369
456368
|
init_filterHelpers();
|
|
456369
|
+
init_lambdaClient();
|
|
456370
456370
|
init_spinnerStatusCoordinator();
|
|
456371
456371
|
init_validateAiExamples();
|
|
456372
456372
|
init_writeAiExamplesOverride();
|
|
@@ -459852,7 +459852,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
459852
459852
|
navigationConfig: tabbed,
|
|
459853
459853
|
parentSlug: slug
|
|
459854
459854
|
}),
|
|
459855
|
-
versioned: (versioned) => this.toVersionedNode(versioned, slug),
|
|
459855
|
+
versioned: (versioned) => this.toVersionedNode(versioned, slug, this.parsedDocsConfig.landingPage),
|
|
459856
459856
|
productgroup: (productGroup) => this.toProductGroupNode({
|
|
459857
459857
|
landingPageConfig: this.parsedDocsConfig.landingPage,
|
|
459858
459858
|
productGroup,
|
|
@@ -459888,7 +459888,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
459888
459888
|
const child = navigationConfig.type === "tabbed" ? await this.convertTabbedNavigation(id, navigationConfig.items, parentSlug) : await this.toSidebarRootNode(id, navigationConfig.items, parentSlug);
|
|
459889
459889
|
return { type: "unversioned", id, collapsed: void 0, landingPage, child };
|
|
459890
459890
|
}
|
|
459891
|
-
async toVersionedNode(versioned, parentSlug) {
|
|
459891
|
+
async toVersionedNode(versioned, parentSlug, landingPage) {
|
|
459892
459892
|
const id = this.#idgen.get("versioned");
|
|
459893
459893
|
const defaultVersion = versioned.versions[0];
|
|
459894
459894
|
if (defaultVersion?.hidden === true) {
|
|
@@ -459901,7 +459901,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
459901
459901
|
const children2 = [];
|
|
459902
459902
|
for (let i5 = 0; i5 < versioned.versions.length; i5 += BATCH_SIZE2) {
|
|
459903
459903
|
const batch = versioned.versions.slice(i5, i5 + BATCH_SIZE2);
|
|
459904
|
-
const batchResults = await Promise.all(batch.map((item, batchIdx) => this.toVersionNode(item, parentSlug, i5 + batchIdx === 0)));
|
|
459904
|
+
const batchResults = await Promise.all(batch.map((item, batchIdx) => this.toVersionNode(item, parentSlug, i5 + batchIdx === 0, landingPage)));
|
|
459905
459905
|
children2.push(...batchResults);
|
|
459906
459906
|
}
|
|
459907
459907
|
return {
|
|
@@ -459932,7 +459932,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
459932
459932
|
type: "unversioned",
|
|
459933
459933
|
id: this.#idgen.get(product.product),
|
|
459934
459934
|
collapsed: void 0,
|
|
459935
|
-
landingPage: void 0,
|
|
459935
|
+
landingPage: product.landingPage != null ? this.toLandingPageNode(product.landingPage, slug) : void 0,
|
|
459936
459936
|
child: await this.convertTabbedNavigation(this.#idgen.get(product.product), product.navigation.items, slug)
|
|
459937
459937
|
};
|
|
459938
459938
|
break;
|
|
@@ -459941,12 +459941,12 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
459941
459941
|
type: "unversioned",
|
|
459942
459942
|
id: this.#idgen.get(product.product),
|
|
459943
459943
|
collapsed: void 0,
|
|
459944
|
-
landingPage: void 0,
|
|
459944
|
+
landingPage: product.landingPage != null ? this.toLandingPageNode(product.landingPage, slug) : void 0,
|
|
459945
459945
|
child: await this.toSidebarRootNode(this.#idgen.get(product.product), product.navigation.items, slug)
|
|
459946
459946
|
};
|
|
459947
459947
|
break;
|
|
459948
459948
|
case "versioned":
|
|
459949
|
-
child = await this.toVersionedNode(product.navigation, slug);
|
|
459949
|
+
child = await this.toVersionedNode(product.navigation, slug, product.landingPage ?? this.parsedDocsConfig.landingPage);
|
|
459950
459950
|
break;
|
|
459951
459951
|
default:
|
|
459952
459952
|
assertNever(product.navigation);
|
|
@@ -459991,10 +459991,11 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
459991
459991
|
};
|
|
459992
459992
|
}
|
|
459993
459993
|
}
|
|
459994
|
-
async toVersionNode(version7, parentSlug, isDefault) {
|
|
459994
|
+
async toVersionNode(version7, parentSlug, isDefault, landingPage) {
|
|
459995
459995
|
const id = this.#idgen.get(version7.version);
|
|
459996
459996
|
const slug = parentSlug.setVersionSlug(version7.slug ?? kebabCase_default(version7.version));
|
|
459997
459997
|
const child = version7.navigation.type === "tabbed" ? await this.convertTabbedNavigation(id, version7.navigation.items, slug) : await this.toSidebarRootNode(id, version7.navigation.items, slug);
|
|
459998
|
+
const resolvedLandingPage = version7.landingPage ?? landingPage;
|
|
459998
459999
|
return {
|
|
459999
460000
|
type: "version",
|
|
460000
460001
|
id,
|
|
@@ -460006,7 +460007,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
460006
460007
|
// TODO: the `default` property should be deprecated, and moved to the parent `versioned` node
|
|
460007
460008
|
default: isDefault,
|
|
460008
460009
|
availability: version7.availability != null ? convertAvailability5(version7.availability) : void 0,
|
|
460009
|
-
landingPage:
|
|
460010
|
+
landingPage: resolvedLandingPage != null ? this.toLandingPageNode(resolvedLandingPage, slug) : void 0,
|
|
460010
460011
|
hidden: version7.hidden,
|
|
460011
460012
|
authed: void 0,
|
|
460012
460013
|
viewers: version7.viewers,
|
|
@@ -686971,7 +686972,7 @@ var AccessTokenPosthogManager = class {
|
|
|
686971
686972
|
properties: {
|
|
686972
686973
|
...event,
|
|
686973
686974
|
...event.properties,
|
|
686974
|
-
version: "5.
|
|
686975
|
+
version: "5.58.0",
|
|
686975
686976
|
usingAccessToken: true,
|
|
686976
686977
|
...getRunIdProperties()
|
|
686977
686978
|
}
|
|
@@ -687037,7 +687038,7 @@ var UserPosthogManager = class {
|
|
|
687037
687038
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
687038
687039
|
event: "CLI",
|
|
687039
687040
|
properties: {
|
|
687040
|
-
version: "5.
|
|
687041
|
+
version: "5.58.0",
|
|
687041
687042
|
...event,
|
|
687042
687043
|
...event.properties,
|
|
687043
687044
|
usingAccessToken: false,
|
|
@@ -868132,7 +868133,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
868132
868133
|
var LOGS_FOLDER_NAME = "logs";
|
|
868133
868134
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
868134
868135
|
function getCliSource() {
|
|
868135
|
-
const version7 = "5.
|
|
868136
|
+
const version7 = "5.58.0";
|
|
868136
868137
|
return `cli@${version7}`;
|
|
868137
868138
|
}
|
|
868138
868139
|
var DebugLogger = class {
|
|
@@ -900613,7 +900614,7 @@ var LegacyDocsPublisher = class {
|
|
|
900613
900614
|
previewId,
|
|
900614
900615
|
disableTemplates: void 0,
|
|
900615
900616
|
skipUpload,
|
|
900616
|
-
cliVersion: "5.
|
|
900617
|
+
cliVersion: "5.58.0",
|
|
900617
900618
|
loginCommand: "fern auth login"
|
|
900618
900619
|
});
|
|
900619
900620
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -966882,7 +966883,7 @@ function getAutomationContextFromEnv() {
|
|
|
966882
966883
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
966883
966884
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
966884
966885
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
966885
|
-
cli_version: "5.
|
|
966886
|
+
cli_version: "5.58.0"
|
|
966886
966887
|
};
|
|
966887
966888
|
}
|
|
966888
966889
|
function isAutomationMode() {
|
|
@@ -967714,7 +967715,7 @@ var CliContext = class _CliContext {
|
|
|
967714
967715
|
if (false) {
|
|
967715
967716
|
this.logger.error("CLI_VERSION is not defined");
|
|
967716
967717
|
}
|
|
967717
|
-
return "5.
|
|
967718
|
+
return "5.58.0";
|
|
967718
967719
|
}
|
|
967719
967720
|
getCliName() {
|
|
967720
967721
|
if (false) {
|
package/package.json
CHANGED