@fern-api/fern-api-dev 5.23.3-1008-g29939b6a08a → 5.23.3-1013-g60e2acea243
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 +255 -91
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -279185,16 +279185,16 @@ var init_ConjureImporter = __esm({
|
|
|
279185
279185
|
});
|
|
279186
279186
|
}
|
|
279187
279187
|
for (const [endpointName, endpointDeclaration] of Object.entries(serviceDeclaration.endpoints ?? {})) {
|
|
279188
|
-
const
|
|
279189
|
-
if (
|
|
279188
|
+
const endpointLocator2 = parseEndpointLocator(endpointDeclaration.http);
|
|
279189
|
+
if (endpointLocator2.type === "failure") {
|
|
279190
279190
|
this.context?.logger.error(`Failed to parse ${endpointDeclaration.http}. Skipping.`);
|
|
279191
279191
|
continue;
|
|
279192
279192
|
}
|
|
279193
279193
|
const auth8 = endpointDeclaration.auth ?? serviceDeclaration.defaultAuth;
|
|
279194
279194
|
const endpoint3 = {
|
|
279195
279195
|
auth: auth8 === ConjureAuthDefinitionType.None ? false : true,
|
|
279196
|
-
path:
|
|
279197
|
-
method:
|
|
279196
|
+
path: endpointLocator2.path,
|
|
279197
|
+
method: endpointLocator2.method,
|
|
279198
279198
|
response: endpointDeclaration.returns === "binary" ? "file" : endpointDeclaration.returns
|
|
279199
279199
|
};
|
|
279200
279200
|
if (endpointDeclaration.docs != null) {
|
|
@@ -279202,7 +279202,7 @@ var init_ConjureImporter = __esm({
|
|
|
279202
279202
|
}
|
|
279203
279203
|
const pathParameters = {};
|
|
279204
279204
|
if (endpointDeclaration.args != null) {
|
|
279205
|
-
for (const pathParameter of
|
|
279205
|
+
for (const pathParameter of endpointLocator2.pathParameters) {
|
|
279206
279206
|
const pathParameterType = endpointDeclaration.args[pathParameter];
|
|
279207
279207
|
if (pathParameterType == null) {
|
|
279208
279208
|
throw new CliError({
|
|
@@ -449603,100 +449603,229 @@ var init_lib64 = __esm({
|
|
|
449603
449603
|
});
|
|
449604
449604
|
|
|
449605
449605
|
// ../docs-resolver/lib/applyTranslatedApiTitlesToNavTree.js
|
|
449606
|
-
function
|
|
449607
|
-
|
|
449608
|
-
|
|
449609
|
-
|
|
449610
|
-
|
|
449611
|
-
|
|
449612
|
-
|
|
449613
|
-
|
|
449614
|
-
|
|
449606
|
+
function stringifyPathPartsForLocator(path119) {
|
|
449607
|
+
return path119.map((part) => part.type === "literal" ? part.value : "{}").join("");
|
|
449608
|
+
}
|
|
449609
|
+
function endpointLocator(endpoint3) {
|
|
449610
|
+
return `${endpoint3.method} ${stringifyPathPartsForLocator(endpoint3.path.parts)}`;
|
|
449611
|
+
}
|
|
449612
|
+
function webhookLocator(webhook) {
|
|
449613
|
+
return `${webhook.method} ${webhook.path.join("/")}`;
|
|
449614
|
+
}
|
|
449615
|
+
function webSocketLocator(webSocket) {
|
|
449616
|
+
return `WSS ${stringifyPathPartsForLocator(webSocket.path.parts)}`;
|
|
449617
|
+
}
|
|
449618
|
+
function nonEmptyTitle(name2) {
|
|
449619
|
+
return name2 != null && name2.length > 0 ? name2 : void 0;
|
|
449620
|
+
}
|
|
449621
|
+
function subpackageTitle(pkg2) {
|
|
449622
|
+
return pkg2.displayName ?? titleCase(pkg2.name);
|
|
449623
|
+
}
|
|
449624
|
+
function subpackageLocators(pkg2) {
|
|
449625
|
+
return [
|
|
449626
|
+
...pkg2.endpoints.map(endpointLocator),
|
|
449627
|
+
...pkg2.webhooks.map(webhookLocator),
|
|
449628
|
+
...pkg2.websockets.map(webSocketLocator)
|
|
449629
|
+
];
|
|
449630
|
+
}
|
|
449631
|
+
function buildResolverForKind(baseEntries, translatedEntries, locatorOf, titleOf) {
|
|
449632
|
+
const translatedIdByLocator = /* @__PURE__ */ new Map();
|
|
449633
|
+
for (const [navId, def] of translatedEntries) {
|
|
449634
|
+
if (!translatedIdByLocator.has(locatorOf(def))) {
|
|
449635
|
+
translatedIdByLocator.set(locatorOf(def), navId);
|
|
449615
449636
|
}
|
|
449616
|
-
|
|
449617
|
-
|
|
449618
|
-
|
|
449619
|
-
|
|
449620
|
-
}
|
|
449637
|
+
}
|
|
449638
|
+
return (baseNavId) => {
|
|
449639
|
+
const exact = translatedEntries.get(baseNavId);
|
|
449640
|
+
if (exact != null) {
|
|
449641
|
+
return { translatedId: baseNavId, title: titleOf(exact) };
|
|
449642
|
+
}
|
|
449643
|
+
const baseDef = baseEntries.get(baseNavId);
|
|
449644
|
+
if (baseDef == null) {
|
|
449645
|
+
return void 0;
|
|
449646
|
+
}
|
|
449647
|
+
const translatedId = translatedIdByLocator.get(locatorOf(baseDef));
|
|
449648
|
+
if (translatedId == null) {
|
|
449649
|
+
return void 0;
|
|
449650
|
+
}
|
|
449651
|
+
const translatedDef = translatedEntries.get(translatedId);
|
|
449652
|
+
return { translatedId, title: translatedDef != null ? titleOf(translatedDef) : void 0 };
|
|
449653
|
+
};
|
|
449654
|
+
}
|
|
449655
|
+
function buildPackagesByBaseTitle(baseApi, translatedApi) {
|
|
449656
|
+
const packagesByBaseTitle = /* @__PURE__ */ new Map();
|
|
449657
|
+
for (const [subpackageId, translatedSubpackage] of Object.entries(translatedApi.subpackages)) {
|
|
449658
|
+
const baseSubpackage = baseApi.subpackages[subpackageId];
|
|
449659
|
+
if (baseSubpackage == null) {
|
|
449660
|
+
continue;
|
|
449621
449661
|
}
|
|
449622
|
-
const
|
|
449623
|
-
|
|
449624
|
-
|
|
449625
|
-
|
|
449662
|
+
const baseTitle = subpackageTitle(baseSubpackage);
|
|
449663
|
+
const translatedTitle = subpackageTitle(translatedSubpackage);
|
|
449664
|
+
if (baseTitle !== translatedTitle) {
|
|
449665
|
+
packagesByBaseTitle.set(baseTitle, translatedTitle);
|
|
449666
|
+
}
|
|
449667
|
+
}
|
|
449668
|
+
const baseTitleByLocator = /* @__PURE__ */ new Map();
|
|
449669
|
+
for (const baseSubpackage of Object.values(baseApi.subpackages)) {
|
|
449670
|
+
const baseTitle = subpackageTitle(baseSubpackage);
|
|
449671
|
+
for (const locator of subpackageLocators(baseSubpackage)) {
|
|
449672
|
+
if (!baseTitleByLocator.has(locator)) {
|
|
449673
|
+
baseTitleByLocator.set(locator, baseTitle);
|
|
449626
449674
|
}
|
|
449627
449675
|
}
|
|
449628
|
-
|
|
449629
|
-
|
|
449630
|
-
|
|
449631
|
-
|
|
449632
|
-
|
|
449676
|
+
}
|
|
449677
|
+
for (const translatedSubpackage of Object.values(translatedApi.subpackages)) {
|
|
449678
|
+
const translatedTitle = subpackageTitle(translatedSubpackage);
|
|
449679
|
+
for (const locator of subpackageLocators(translatedSubpackage)) {
|
|
449680
|
+
const baseTitle = baseTitleByLocator.get(locator);
|
|
449681
|
+
if (baseTitle != null && baseTitle !== translatedTitle && !packagesByBaseTitle.has(baseTitle)) {
|
|
449682
|
+
packagesByBaseTitle.set(baseTitle, translatedTitle);
|
|
449633
449683
|
}
|
|
449634
449684
|
}
|
|
449635
|
-
|
|
449685
|
+
}
|
|
449686
|
+
return packagesByBaseTitle;
|
|
449687
|
+
}
|
|
449688
|
+
function buildApiTranslationResolvers(baseApis, translatedApis) {
|
|
449689
|
+
const resolvers = /* @__PURE__ */ new Map();
|
|
449690
|
+
for (const [apiId, translatedApi] of Object.entries(translatedApis)) {
|
|
449636
449691
|
const baseApi = baseApis[apiId];
|
|
449637
|
-
if (baseApi
|
|
449638
|
-
|
|
449639
|
-
|
|
449640
|
-
|
|
449641
|
-
|
|
449642
|
-
|
|
449643
|
-
|
|
449644
|
-
|
|
449645
|
-
|
|
449646
|
-
|
|
449647
|
-
|
|
449692
|
+
if (baseApi == null) {
|
|
449693
|
+
continue;
|
|
449694
|
+
}
|
|
449695
|
+
const baseHolder = navigation_exports.ApiDefinitionHolder.create(baseApi);
|
|
449696
|
+
const translatedHolder = navigation_exports.ApiDefinitionHolder.create(translatedApi);
|
|
449697
|
+
const resolveEndpoint = buildResolverForKind(baseHolder.endpoints, translatedHolder.endpoints, endpointLocator, (endpoint3) => nonEmptyTitle(endpoint3.name));
|
|
449698
|
+
const resolveWebhook = buildResolverForKind(baseHolder.webhooks, translatedHolder.webhooks, webhookLocator, (webhook) => nonEmptyTitle(webhook.name));
|
|
449699
|
+
const resolveWebSocket = buildResolverForKind(baseHolder.webSockets, translatedHolder.webSockets, webSocketLocator, (webSocket) => nonEmptyTitle(webSocket.name));
|
|
449700
|
+
const graphqlTitlesById = /* @__PURE__ */ new Map();
|
|
449701
|
+
for (const [id, operation] of translatedHolder.graphqlOperations) {
|
|
449702
|
+
const name2 = operation.displayName ?? operation.name;
|
|
449703
|
+
const title2 = nonEmptyTitle(name2);
|
|
449704
|
+
if (title2 != null) {
|
|
449705
|
+
graphqlTitlesById.set(id, title2);
|
|
449648
449706
|
}
|
|
449649
449707
|
}
|
|
449650
|
-
|
|
449708
|
+
resolvers.set(apiId, {
|
|
449709
|
+
resolveEndpoint,
|
|
449710
|
+
resolveWebhook,
|
|
449711
|
+
resolveWebSocket,
|
|
449712
|
+
graphqlTitlesById,
|
|
449713
|
+
packagesByBaseTitle: buildPackagesByBaseTitle(baseApi, translatedApi)
|
|
449714
|
+
});
|
|
449651
449715
|
}
|
|
449652
|
-
|
|
449653
|
-
|
|
449654
|
-
|
|
449716
|
+
return resolvers;
|
|
449717
|
+
}
|
|
449718
|
+
function getApiDefinitionId(node4) {
|
|
449719
|
+
return typeof node4.apiDefinitionId === "string" ? node4.apiDefinitionId : void 0;
|
|
449720
|
+
}
|
|
449721
|
+
function visitNavigationNodes(node4, callback) {
|
|
449722
|
+
if (node4 == null || typeof node4 !== "object") {
|
|
449723
|
+
return;
|
|
449724
|
+
}
|
|
449725
|
+
if (Array.isArray(node4)) {
|
|
449726
|
+
for (const item of node4) {
|
|
449727
|
+
visitNavigationNodes(item, callback);
|
|
449728
|
+
}
|
|
449729
|
+
return;
|
|
449730
|
+
}
|
|
449731
|
+
const obj = node4;
|
|
449732
|
+
callback(obj);
|
|
449733
|
+
for (const value2 of Object.values(obj)) {
|
|
449734
|
+
visitNavigationNodes(value2, callback);
|
|
449735
|
+
}
|
|
449736
|
+
}
|
|
449737
|
+
function findIncompatibleTranslatedApiIds(root6, baseApis, translatedApis) {
|
|
449738
|
+
const incompatible = /* @__PURE__ */ new Set();
|
|
449739
|
+
for (const apiId of Object.keys(translatedApis)) {
|
|
449740
|
+
if (baseApis[apiId] == null) {
|
|
449741
|
+
incompatible.add(apiId);
|
|
449742
|
+
}
|
|
449743
|
+
}
|
|
449744
|
+
if (root6 == null) {
|
|
449745
|
+
return incompatible;
|
|
449746
|
+
}
|
|
449747
|
+
const resolvers = buildApiTranslationResolvers(baseApis, translatedApis);
|
|
449748
|
+
visitNavigationNodes(root6, (obj) => {
|
|
449749
|
+
const apiDefinitionId = getApiDefinitionId(obj);
|
|
449750
|
+
if (apiDefinitionId == null || incompatible.has(apiDefinitionId)) {
|
|
449751
|
+
return;
|
|
449752
|
+
}
|
|
449753
|
+
const resolver2 = resolvers.get(apiDefinitionId);
|
|
449754
|
+
if (resolver2 == null) {
|
|
449655
449755
|
return;
|
|
449656
449756
|
}
|
|
449657
|
-
|
|
449658
|
-
|
|
449659
|
-
|
|
449757
|
+
const type7 = obj.type;
|
|
449758
|
+
if (type7 === "endpoint" && typeof obj.endpointId === "string") {
|
|
449759
|
+
if (resolver2.resolveEndpoint(obj.endpointId) == null) {
|
|
449760
|
+
incompatible.add(apiDefinitionId);
|
|
449761
|
+
}
|
|
449762
|
+
} else if (type7 === "webhook" && typeof obj.webhookId === "string") {
|
|
449763
|
+
if (resolver2.resolveWebhook(obj.webhookId) == null) {
|
|
449764
|
+
incompatible.add(apiDefinitionId);
|
|
449765
|
+
}
|
|
449766
|
+
} else if (type7 === "webSocket" && typeof obj.webSocketId === "string") {
|
|
449767
|
+
if (resolver2.resolveWebSocket(obj.webSocketId) == null) {
|
|
449768
|
+
incompatible.add(apiDefinitionId);
|
|
449660
449769
|
}
|
|
449770
|
+
}
|
|
449771
|
+
});
|
|
449772
|
+
return incompatible;
|
|
449773
|
+
}
|
|
449774
|
+
function applyTranslatedApiTitlesToNavTree(root6, baseApis, translatedApis, options2) {
|
|
449775
|
+
const resolvers = buildApiTranslationResolvers(baseApis, translatedApis);
|
|
449776
|
+
const rewritableApiIds = options2?.rewritableApiIds;
|
|
449777
|
+
const canRewriteIds = (apiDefinitionId) => rewritableApiIds == null || rewritableApiIds.has(apiDefinitionId);
|
|
449778
|
+
const clone5 = structuredClone(root6);
|
|
449779
|
+
visitNavigationNodes(clone5, (obj) => {
|
|
449780
|
+
const apiDefinitionId = getApiDefinitionId(obj);
|
|
449781
|
+
const resolver2 = apiDefinitionId != null ? resolvers.get(apiDefinitionId) : void 0;
|
|
449782
|
+
if (resolver2 == null || apiDefinitionId == null) {
|
|
449661
449783
|
return;
|
|
449662
449784
|
}
|
|
449663
|
-
const
|
|
449664
|
-
const
|
|
449665
|
-
|
|
449666
|
-
|
|
449667
|
-
|
|
449668
|
-
|
|
449669
|
-
|
|
449670
|
-
if (translated != null) {
|
|
449671
|
-
obj.title = translated;
|
|
449785
|
+
const rewriteIds = canRewriteIds(apiDefinitionId);
|
|
449786
|
+
const type7 = obj.type;
|
|
449787
|
+
if (type7 === "endpoint" && typeof obj.endpointId === "string") {
|
|
449788
|
+
const match3 = resolver2.resolveEndpoint(obj.endpointId);
|
|
449789
|
+
if (match3 != null) {
|
|
449790
|
+
if (rewriteIds) {
|
|
449791
|
+
obj.endpointId = match3.translatedId;
|
|
449672
449792
|
}
|
|
449673
|
-
|
|
449674
|
-
|
|
449675
|
-
if (translated != null) {
|
|
449676
|
-
obj.title = translated;
|
|
449793
|
+
if (match3.title != null) {
|
|
449794
|
+
obj.title = match3.title;
|
|
449677
449795
|
}
|
|
449678
|
-
}
|
|
449679
|
-
|
|
449680
|
-
|
|
449681
|
-
|
|
449796
|
+
}
|
|
449797
|
+
} else if (type7 === "webhook" && typeof obj.webhookId === "string") {
|
|
449798
|
+
const match3 = resolver2.resolveWebhook(obj.webhookId);
|
|
449799
|
+
if (match3 != null) {
|
|
449800
|
+
if (rewriteIds) {
|
|
449801
|
+
obj.webhookId = match3.translatedId;
|
|
449682
449802
|
}
|
|
449683
|
-
|
|
449684
|
-
|
|
449685
|
-
if (translated != null) {
|
|
449686
|
-
obj.title = translated;
|
|
449803
|
+
if (match3.title != null) {
|
|
449804
|
+
obj.title = match3.title;
|
|
449687
449805
|
}
|
|
449688
|
-
}
|
|
449689
|
-
|
|
449690
|
-
|
|
449691
|
-
|
|
449806
|
+
}
|
|
449807
|
+
} else if (type7 === "webSocket" && typeof obj.webSocketId === "string") {
|
|
449808
|
+
const match3 = resolver2.resolveWebSocket(obj.webSocketId);
|
|
449809
|
+
if (match3 != null) {
|
|
449810
|
+
if (rewriteIds) {
|
|
449811
|
+
obj.webSocketId = match3.translatedId;
|
|
449812
|
+
}
|
|
449813
|
+
if (match3.title != null) {
|
|
449814
|
+
obj.title = match3.title;
|
|
449692
449815
|
}
|
|
449693
449816
|
}
|
|
449817
|
+
} else if (type7 === "graphql" && typeof obj.graphqlOperationId === "string") {
|
|
449818
|
+
const translated = resolver2.graphqlTitlesById.get(obj.graphqlOperationId);
|
|
449819
|
+
if (translated != null) {
|
|
449820
|
+
obj.title = translated;
|
|
449821
|
+
}
|
|
449822
|
+
} else if (type7 === "apiPackage" && typeof obj.title === "string") {
|
|
449823
|
+
const translated = resolver2.packagesByBaseTitle.get(obj.title);
|
|
449824
|
+
if (translated != null) {
|
|
449825
|
+
obj.title = translated;
|
|
449826
|
+
}
|
|
449694
449827
|
}
|
|
449695
|
-
|
|
449696
|
-
visit5(value2);
|
|
449697
|
-
}
|
|
449698
|
-
};
|
|
449699
|
-
visit5(clone5);
|
|
449828
|
+
});
|
|
449700
449829
|
return clone5;
|
|
449701
449830
|
}
|
|
449702
449831
|
var init_applyTranslatedApiTitlesToNavTree = __esm({
|
|
@@ -686827,7 +686956,7 @@ var AccessTokenPosthogManager = class {
|
|
|
686827
686956
|
properties: {
|
|
686828
686957
|
...event,
|
|
686829
686958
|
...event.properties,
|
|
686830
|
-
version: "5.23.3-
|
|
686959
|
+
version: "5.23.3-1013-g60e2acea243",
|
|
686831
686960
|
usingAccessToken: true,
|
|
686832
686961
|
...getRunIdProperties()
|
|
686833
686962
|
}
|
|
@@ -686893,7 +687022,7 @@ var UserPosthogManager = class {
|
|
|
686893
687022
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
686894
687023
|
event: "CLI",
|
|
686895
687024
|
properties: {
|
|
686896
|
-
version: "5.23.3-
|
|
687025
|
+
version: "5.23.3-1013-g60e2acea243",
|
|
686897
687026
|
...event,
|
|
686898
687027
|
...event.properties,
|
|
686899
687028
|
usingAccessToken: false,
|
|
@@ -867987,7 +868116,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
867987
868116
|
var LOGS_FOLDER_NAME = "logs";
|
|
867988
868117
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
867989
868118
|
function getCliSource() {
|
|
867990
|
-
const version7 = "5.23.3-
|
|
868119
|
+
const version7 = "5.23.3-1013-g60e2acea243";
|
|
867991
868120
|
return `cli@${version7}`;
|
|
867992
868121
|
}
|
|
867993
868122
|
var DebugLogger = class {
|
|
@@ -871636,10 +871765,24 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
871636
871765
|
translatedNavbarLinks = localeNavOverlay.navbarLinks;
|
|
871637
871766
|
}
|
|
871638
871767
|
}
|
|
871768
|
+
const baseApis = docsDefinition.apis;
|
|
871639
871769
|
const localeApis = translatedApiDefinitions?.[locale];
|
|
871640
|
-
|
|
871770
|
+
let servedLocaleApis = localeApis;
|
|
871771
|
+
let rewritableApiIds;
|
|
871641
871772
|
if (localeApis != null && updatedRoot != null) {
|
|
871642
|
-
|
|
871773
|
+
const incompatibleApiIds = findIncompatibleTranslatedApiIds(updatedRoot, baseApis, localeApis);
|
|
871774
|
+
if (incompatibleApiIds.size > 0) {
|
|
871775
|
+
context3.logger.warn(`Translated API definition(s) [${Array.from(incompatibleApiIds).join(", ")}] for locale "${locale}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`);
|
|
871776
|
+
servedLocaleApis = Object.fromEntries(Object.entries(localeApis).filter(([apiId]) => !incompatibleApiIds.has(apiId)));
|
|
871777
|
+
}
|
|
871778
|
+
rewritableApiIds = new Set(Object.keys(localeApis).filter((apiId) => !incompatibleApiIds.has(apiId)));
|
|
871779
|
+
}
|
|
871780
|
+
const hasServedLocaleApis = servedLocaleApis != null && Object.keys(servedLocaleApis).length > 0;
|
|
871781
|
+
const translatedApis = hasServedLocaleApis ? { ...docsDefinition.apis, ...servedLocaleApis } : docsDefinition.apis;
|
|
871782
|
+
if (localeApis != null && Object.keys(localeApis).length > 0 && updatedRoot != null) {
|
|
871783
|
+
updatedRoot = applyTranslatedApiTitlesToNavTree(updatedRoot, baseApis, localeApis, {
|
|
871784
|
+
rewritableApiIds
|
|
871785
|
+
});
|
|
871643
871786
|
}
|
|
871644
871787
|
const translatedDefinition = {
|
|
871645
871788
|
...docsDefinition,
|
|
@@ -898817,8 +898960,19 @@ async function buildAllTranslationInputs({ docsDefinition, git, apiDefinitions,
|
|
|
898817
898960
|
}
|
|
898818
898961
|
}
|
|
898819
898962
|
}
|
|
898963
|
+
const incompatibleApiIds = findIncompatibleTranslatedApiIds(translatedDefinition.config.root, baseReadApis, translatedApisForTitles);
|
|
898964
|
+
if (incompatibleApiIds.size > 0) {
|
|
898965
|
+
context3.logger.warn(`Translated API definition(s) [${Array.from(incompatibleApiIds).join(", ")}] for locale "${locale}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`);
|
|
898966
|
+
for (const apiId of incompatibleApiIds) {
|
|
898967
|
+
const baseDef = apiDefinitions.get(apiId);
|
|
898968
|
+
if (baseDef != null) {
|
|
898969
|
+
localeApiDefinitions.set(apiId, baseDef);
|
|
898970
|
+
}
|
|
898971
|
+
}
|
|
898972
|
+
}
|
|
898973
|
+
const rewritableApiIds = new Set(Object.keys(translatedApisForTitles).filter((apiId) => !incompatibleApiIds.has(apiId)));
|
|
898820
898974
|
if (Object.keys(translatedApisForTitles).length > 0) {
|
|
898821
|
-
translatedDefinition.config.root = applyTranslatedApiTitlesToNavTree(translatedDefinition.config.root, baseReadApis, translatedApisForTitles);
|
|
898975
|
+
translatedDefinition.config.root = applyTranslatedApiTitlesToNavTree(translatedDefinition.config.root, baseReadApis, translatedApisForTitles, { rewritableApiIds });
|
|
898822
898976
|
}
|
|
898823
898977
|
}
|
|
898824
898978
|
}
|
|
@@ -899562,8 +899716,16 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
899562
899716
|
translatedApisForTitles[baseApiId] = translatedRead;
|
|
899563
899717
|
}
|
|
899564
899718
|
}
|
|
899565
|
-
|
|
899719
|
+
const incompatibleApiIds = findIncompatibleTranslatedApiIds(updatedRoot, baseApisForTitles, translatedApisForTitles);
|
|
899720
|
+
if (incompatibleApiIds.size > 0) {
|
|
899721
|
+
context3.logger.warn(`Translated API definition(s) [${Array.from(incompatibleApiIds).join(", ")}] for locale "${locale}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`);
|
|
899722
|
+
}
|
|
899723
|
+
const rewritableApiIds = new Set(Object.keys(translatedApisForTitles).filter((apiId) => !incompatibleApiIds.has(apiId)));
|
|
899724
|
+
updatedRoot = Object.keys(translatedApisForTitles).length > 0 ? applyTranslatedApiTitlesToNavTree(updatedRoot, baseApisForTitles, translatedApisForTitles, { rewritableApiIds }) : structuredClone(updatedRoot);
|
|
899566
899725
|
for (const [baseApiId, translatedApiId] of localeApiIdMap) {
|
|
899726
|
+
if (incompatibleApiIds.has(baseApiId)) {
|
|
899727
|
+
continue;
|
|
899728
|
+
}
|
|
899567
899729
|
updateApiDefinitionIdInTree(updatedRoot, baseApiId, translatedApiId);
|
|
899568
899730
|
}
|
|
899569
899731
|
}
|
|
@@ -900207,11 +900369,13 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
|
|
|
900207
900369
|
context3.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${instances2[0]?.url})`, void 0, { code: CliError.Code.ConfigError });
|
|
900208
900370
|
return;
|
|
900209
900371
|
}
|
|
900210
|
-
const maybeInstance = instances2.find((instance) => instance.url === instanceUrl)
|
|
900372
|
+
const maybeInstance = instanceUrl != null ? instances2.find((instance) => instance.url === instanceUrl) : instances2[0];
|
|
900211
900373
|
if (maybeInstance == null) {
|
|
900212
|
-
|
|
900213
|
-
|
|
900214
|
-
|
|
900374
|
+
const available = instances2.map((inst) => ` - ${inst.url}`).join("\n");
|
|
900375
|
+
context3.failAndThrow(instanceUrl != null ? `No docs instance found matching '${instanceUrl}'.
|
|
900376
|
+
|
|
900377
|
+
Available instances:
|
|
900378
|
+
${available}` : `No docs instance found. Failed to register.`, void 0, { code: CliError.Code.ConfigError });
|
|
900215
900379
|
return;
|
|
900216
900380
|
}
|
|
900217
900381
|
const customDomains = (typeof maybeInstance.customDomain === "string" ? [maybeInstance.customDomain] : maybeInstance.customDomain ?? []).map(stripCustomDomainProtocol);
|
|
@@ -900306,7 +900470,7 @@ var LegacyDocsPublisher = class {
|
|
|
900306
900470
|
previewId,
|
|
900307
900471
|
disableTemplates: void 0,
|
|
900308
900472
|
skipUpload,
|
|
900309
|
-
cliVersion: "5.23.3-
|
|
900473
|
+
cliVersion: "5.23.3-1013-g60e2acea243",
|
|
900310
900474
|
loginCommand: "fern auth login"
|
|
900311
900475
|
});
|
|
900312
900476
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -966575,7 +966739,7 @@ function getAutomationContextFromEnv() {
|
|
|
966575
966739
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
966576
966740
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
966577
966741
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
966578
|
-
cli_version: "5.23.3-
|
|
966742
|
+
cli_version: "5.23.3-1013-g60e2acea243"
|
|
966579
966743
|
};
|
|
966580
966744
|
}
|
|
966581
966745
|
function isAutomationMode() {
|
|
@@ -967407,7 +967571,7 @@ var CliContext = class _CliContext {
|
|
|
967407
967571
|
if (false) {
|
|
967408
967572
|
this.logger.error("CLI_VERSION is not defined");
|
|
967409
967573
|
}
|
|
967410
|
-
return "5.23.3-
|
|
967574
|
+
return "5.23.3-1013-g60e2acea243";
|
|
967411
967575
|
}
|
|
967412
967576
|
getCliName() {
|
|
967413
967577
|
if (false) {
|
package/package.json
CHANGED