@fern-api/fern-api-dev 5.33.1 → 5.33.2
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 +47 -33
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -668443,7 +668443,7 @@ var AccessTokenPosthogManager = class {
|
|
|
668443
668443
|
properties: {
|
|
668444
668444
|
...event,
|
|
668445
668445
|
...event.properties,
|
|
668446
|
-
version: "5.33.
|
|
668446
|
+
version: "5.33.2",
|
|
668447
668447
|
usingAccessToken: true,
|
|
668448
668448
|
...getRunIdProperties()
|
|
668449
668449
|
}
|
|
@@ -668507,7 +668507,7 @@ var UserPosthogManager = class {
|
|
|
668507
668507
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
668508
668508
|
event: "CLI",
|
|
668509
668509
|
properties: {
|
|
668510
|
-
version: "5.33.
|
|
668510
|
+
version: "5.33.2",
|
|
668511
668511
|
...event,
|
|
668512
668512
|
...event.properties,
|
|
668513
668513
|
usingAccessToken: false,
|
|
@@ -860283,7 +860283,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
860283
860283
|
var LOGS_FOLDER_NAME = "logs";
|
|
860284
860284
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
860285
860285
|
function getCliSource() {
|
|
860286
|
-
const version7 = "5.33.
|
|
860286
|
+
const version7 = "5.33.2";
|
|
860287
860287
|
return `cli@${version7}`;
|
|
860288
860288
|
}
|
|
860289
860289
|
var DebugLogger = class {
|
|
@@ -877858,6 +877858,43 @@ async function generateOne({ generatorInvocation, interactiveTaskContext, projec
|
|
|
877858
877858
|
init_lib4();
|
|
877859
877859
|
init_lib6();
|
|
877860
877860
|
|
|
877861
|
+
// ../generation/remote-generation/remote-workspace-runner/lib/customDomainValidation.js
|
|
877862
|
+
init_lib6();
|
|
877863
|
+
var HTTPS_PREFIX = "https://";
|
|
877864
|
+
var HTTP_PREFIX = "http://";
|
|
877865
|
+
function stripCustomDomainProtocol(customDomain) {
|
|
877866
|
+
if (customDomain.startsWith(HTTPS_PREFIX)) {
|
|
877867
|
+
return customDomain.slice(HTTPS_PREFIX.length);
|
|
877868
|
+
}
|
|
877869
|
+
if (customDomain.startsWith(HTTP_PREFIX)) {
|
|
877870
|
+
return customDomain.slice(HTTP_PREFIX.length);
|
|
877871
|
+
}
|
|
877872
|
+
return customDomain;
|
|
877873
|
+
}
|
|
877874
|
+
function getBasepath(domain3) {
|
|
877875
|
+
try {
|
|
877876
|
+
const url3 = domain3.startsWith(HTTPS_PREFIX) || domain3.startsWith(HTTP_PREFIX) ? domain3 : `${HTTPS_PREFIX}${domain3}`;
|
|
877877
|
+
return normalizeBasepath(new URL(url3).pathname);
|
|
877878
|
+
} catch {
|
|
877879
|
+
return "/";
|
|
877880
|
+
}
|
|
877881
|
+
}
|
|
877882
|
+
function normalizeBasepath(pathname) {
|
|
877883
|
+
if (pathname === "" || pathname === "/") {
|
|
877884
|
+
return "/";
|
|
877885
|
+
}
|
|
877886
|
+
return pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
877887
|
+
}
|
|
877888
|
+
function validateBasepathAlignment(instanceUrl, customDomains, context3) {
|
|
877889
|
+
const urlBasepath = getBasepath(instanceUrl);
|
|
877890
|
+
for (const customDomain of customDomains) {
|
|
877891
|
+
const customDomainBasepath = getBasepath(customDomain);
|
|
877892
|
+
if (urlBasepath !== customDomainBasepath) {
|
|
877893
|
+
context3.failAndThrow(`Basepath mismatch between Fern url and custom-domain. When basepath-aware mode is enabled (via 'multi-source: true' or the deprecated 'experimental.basepath-aware: true'), the instance 'url' and 'custom-domain' must share the same basepath, otherwise docs will fail to resolve after DNS cutover. Instance url '${instanceUrl}' has basepath '${urlBasepath}' but custom-domain '${customDomain}' has basepath '${customDomainBasepath}'.`, void 0, { code: CliError.Code.ConfigError });
|
|
877894
|
+
}
|
|
877895
|
+
}
|
|
877896
|
+
}
|
|
877897
|
+
|
|
877861
877898
|
// ../generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
877862
877899
|
init_lib4();
|
|
877863
877900
|
init_js();
|
|
@@ -879000,16 +879037,10 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
|
|
|
879000
879037
|
});
|
|
879001
879038
|
return;
|
|
879002
879039
|
}
|
|
879003
|
-
const customDomains = [];
|
|
879004
|
-
|
|
879005
|
-
|
|
879006
|
-
|
|
879007
|
-
} else if (Array.isArray(maybeInstance.customDomain)) {
|
|
879008
|
-
customDomains.push(...maybeInstance.customDomain);
|
|
879009
|
-
}
|
|
879010
|
-
}
|
|
879011
|
-
if (maybeInstance.multiSource === true) {
|
|
879012
|
-
validateMultiSourceBasepaths(maybeInstance.url, customDomains, context3);
|
|
879040
|
+
const customDomains = (typeof maybeInstance.customDomain === "string" ? [maybeInstance.customDomain] : maybeInstance.customDomain ?? []).map(stripCustomDomainProtocol);
|
|
879041
|
+
const isBasepathAware = maybeInstance.multiSource === true || docsWorkspace.config.experimental?.basepathAware === true;
|
|
879042
|
+
if (isBasepathAware) {
|
|
879043
|
+
validateBasepathAlignment(maybeInstance.url, customDomains, context3);
|
|
879013
879044
|
}
|
|
879014
879045
|
context3.logger.info(`Starting docs publishing for ${preview ? "preview" : "production"}: ${maybeInstance.url}`);
|
|
879015
879046
|
context3.logger.debug(`Organization: ${organization}, Preview: ${preview}, APIs: ${apiWorkspaces.length}, OSS: ${ossWorkspaces.length}`);
|
|
@@ -879062,23 +879093,6 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
|
|
|
879062
879093
|
});
|
|
879063
879094
|
return publishedUrl;
|
|
879064
879095
|
}
|
|
879065
|
-
function getBasepath(domain3) {
|
|
879066
|
-
try {
|
|
879067
|
-
const url3 = domain3.startsWith("https://") || domain3.startsWith("http://") ? domain3 : `https://${domain3}`;
|
|
879068
|
-
return new URL(url3).pathname;
|
|
879069
|
-
} catch {
|
|
879070
|
-
return "/";
|
|
879071
|
-
}
|
|
879072
|
-
}
|
|
879073
|
-
function validateMultiSourceBasepaths(instanceUrl, customDomains, context3) {
|
|
879074
|
-
const urlBasepath = getBasepath(instanceUrl);
|
|
879075
|
-
for (const customDomain of customDomains) {
|
|
879076
|
-
const customDomainBasepath = getBasepath(customDomain);
|
|
879077
|
-
if (customDomainBasepath !== "/" && urlBasepath !== customDomainBasepath) {
|
|
879078
|
-
context3.failAndThrow(`When multi-source is enabled, the url and custom-domain must share the same basepath. Instance url '${instanceUrl}' has basepath '${urlBasepath}' but custom-domain '${customDomain}' has basepath '${customDomainBasepath}'.`, void 0, { code: CliError.Code.ConfigError });
|
|
879079
|
-
}
|
|
879080
|
-
}
|
|
879081
|
-
}
|
|
879082
879096
|
|
|
879083
879097
|
// ../cli-v2/lib/docs/publisher/LegacyDocsPublisher.js
|
|
879084
879098
|
init_lib6();
|
|
@@ -879115,7 +879129,7 @@ var LegacyDocsPublisher = class {
|
|
|
879115
879129
|
previewId,
|
|
879116
879130
|
disableTemplates: void 0,
|
|
879117
879131
|
skipUpload,
|
|
879118
|
-
cliVersion: "5.33.
|
|
879132
|
+
cliVersion: "5.33.2",
|
|
879119
879133
|
loginCommand: "fern auth login"
|
|
879120
879134
|
});
|
|
879121
879135
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -953815,7 +953829,7 @@ function getAutomationContextFromEnv() {
|
|
|
953815
953829
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
953816
953830
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
953817
953831
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
953818
|
-
cli_version: "5.33.
|
|
953832
|
+
cli_version: "5.33.2"
|
|
953819
953833
|
};
|
|
953820
953834
|
}
|
|
953821
953835
|
function isAutomationMode() {
|
|
@@ -954641,7 +954655,7 @@ var CliContext = class _CliContext {
|
|
|
954641
954655
|
if (false) {
|
|
954642
954656
|
this.logger.error("CLI_VERSION is not defined");
|
|
954643
954657
|
}
|
|
954644
|
-
return "5.33.
|
|
954658
|
+
return "5.33.2";
|
|
954645
954659
|
}
|
|
954646
954660
|
getCliName() {
|
|
954647
954661
|
if (false) {
|
package/package.json
CHANGED