@fern-api/fern-api-dev 5.26.2 → 5.26.4
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 +83 -36
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -667717,7 +667717,7 @@ var AccessTokenPosthogManager = class {
|
|
|
667717
667717
|
properties: {
|
|
667718
667718
|
...event,
|
|
667719
667719
|
...event.properties,
|
|
667720
|
-
version: "5.26.
|
|
667720
|
+
version: "5.26.4",
|
|
667721
667721
|
usingAccessToken: true,
|
|
667722
667722
|
...getRunIdProperties()
|
|
667723
667723
|
}
|
|
@@ -667772,7 +667772,7 @@ var UserPosthogManager = class {
|
|
|
667772
667772
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
667773
667773
|
event: "CLI",
|
|
667774
667774
|
properties: {
|
|
667775
|
-
version: "5.26.
|
|
667775
|
+
version: "5.26.4",
|
|
667776
667776
|
...event,
|
|
667777
667777
|
...event.properties,
|
|
667778
667778
|
usingAccessToken: false,
|
|
@@ -830172,10 +830172,27 @@ var FilepathsExistRule = {
|
|
|
830172
830172
|
};
|
|
830173
830173
|
|
|
830174
830174
|
// ../yaml/docs-validator/lib/rules/missing-redirects/missing-redirects.js
|
|
830175
|
-
init_lib4();
|
|
830176
830175
|
init_js();
|
|
830177
830176
|
init_lib5();
|
|
830178
830177
|
|
|
830178
|
+
// ../yaml/docs-validator/lib/formatInitError.js
|
|
830179
|
+
function formatInitError(error50) {
|
|
830180
|
+
if (error50 instanceof Error) {
|
|
830181
|
+
return error50.message;
|
|
830182
|
+
}
|
|
830183
|
+
if (typeof error50 === "string") {
|
|
830184
|
+
return error50;
|
|
830185
|
+
}
|
|
830186
|
+
try {
|
|
830187
|
+
const serialized = JSON.stringify(error50);
|
|
830188
|
+
if (serialized != null && serialized !== "{}") {
|
|
830189
|
+
return serialized;
|
|
830190
|
+
}
|
|
830191
|
+
} catch {
|
|
830192
|
+
}
|
|
830193
|
+
return Object.prototype.toString.call(error50);
|
|
830194
|
+
}
|
|
830195
|
+
|
|
830179
830196
|
// ../yaml/docs-validator/lib/rules/valid-markdown-link/url-utils.js
|
|
830180
830197
|
function stripAnchorsAndSearchParams(pathnameWithAnchorsOrSearchParams) {
|
|
830181
830198
|
return pathnameWithAnchorsOrSearchParams.split(/[?#]/)[0] ?? "";
|
|
@@ -830707,7 +830724,17 @@ function checkMissingRedirects(removedSlugs, redirects, basePath) {
|
|
|
830707
830724
|
}
|
|
830708
830725
|
|
|
830709
830726
|
// ../yaml/docs-validator/lib/rules/missing-redirects/missing-redirects.js
|
|
830710
|
-
|
|
830727
|
+
function createResolverContext() {
|
|
830728
|
+
let lastErrorMessage;
|
|
830729
|
+
const context3 = createMockTaskContext({
|
|
830730
|
+
logger: createLogger((level, ...args) => {
|
|
830731
|
+
if (level === "error") {
|
|
830732
|
+
lastErrorMessage = args.join(" ");
|
|
830733
|
+
}
|
|
830734
|
+
})
|
|
830735
|
+
});
|
|
830736
|
+
return { context: context3, getLastErrorMessage: () => lastErrorMessage };
|
|
830737
|
+
}
|
|
830711
830738
|
function isV1RootNode(value2) {
|
|
830712
830739
|
return "type" in value2 && value2.type === "root";
|
|
830713
830740
|
}
|
|
@@ -830759,26 +830786,34 @@ var MissingRedirectsRule = {
|
|
|
830759
830786
|
logger4.debug("[missing-redirects] No markdown entries found (first publish or empty slug table)");
|
|
830760
830787
|
return makeSkipVisitor({ type: "first-publish" });
|
|
830761
830788
|
}
|
|
830762
|
-
|
|
830763
|
-
|
|
830764
|
-
|
|
830765
|
-
|
|
830766
|
-
|
|
830767
|
-
|
|
830768
|
-
|
|
830769
|
-
|
|
830770
|
-
|
|
830771
|
-
|
|
830772
|
-
|
|
830773
|
-
|
|
830774
|
-
|
|
830775
|
-
|
|
830776
|
-
|
|
830789
|
+
let removedSlugs;
|
|
830790
|
+
const { context: resolverContext, getLastErrorMessage } = createResolverContext();
|
|
830791
|
+
try {
|
|
830792
|
+
const docsDefinitionResolver = new DocsDefinitionResolver({
|
|
830793
|
+
domain: url3,
|
|
830794
|
+
docsWorkspace: workspace,
|
|
830795
|
+
ossWorkspaces,
|
|
830796
|
+
apiWorkspaces,
|
|
830797
|
+
taskContext: resolverContext,
|
|
830798
|
+
editThisPage: void 0,
|
|
830799
|
+
uploadFiles: void 0,
|
|
830800
|
+
registerApi: void 0,
|
|
830801
|
+
targetAudiences: void 0
|
|
830802
|
+
});
|
|
830803
|
+
const resolvedDocsDefinition = await docsDefinitionResolver.resolve();
|
|
830804
|
+
const configRoot = resolvedDocsDefinition.config.root;
|
|
830805
|
+
if (!configRoot || !isV1RootNode(configRoot)) {
|
|
830806
|
+
return {};
|
|
830807
|
+
}
|
|
830808
|
+
const root6 = navigation_exports.migrate.FernNavigationV1ToLatest.create().root(configRoot);
|
|
830809
|
+
const localPageIdToSlug = buildPageIdToSlugMap2(root6);
|
|
830810
|
+
const latestEntries = keepLatestEntryPerPageId(result.entries);
|
|
830811
|
+
removedSlugs = findRemovedSlugs(latestEntries, localPageIdToSlug);
|
|
830812
|
+
} catch (error50) {
|
|
830813
|
+
const reason = getLastErrorMessage() ?? formatInitError(error50);
|
|
830814
|
+
logger4.debug(`[missing-redirects] Failed to resolve local docs navigation: ${reason}`);
|
|
830815
|
+
return makeSkipVisitor({ type: "resolve-failed", reason });
|
|
830777
830816
|
}
|
|
830778
|
-
const root6 = navigation_exports.migrate.FernNavigationV1ToLatest.create().root(configRoot);
|
|
830779
|
-
const localPageIdToSlug = buildPageIdToSlugMap2(root6);
|
|
830780
|
-
const latestEntries = keepLatestEntryPerPageId(result.entries);
|
|
830781
|
-
const removedSlugs = findRemovedSlugs(latestEntries, localPageIdToSlug);
|
|
830782
830817
|
if (removedSlugs.length === 0) {
|
|
830783
830818
|
return {};
|
|
830784
830819
|
}
|
|
@@ -830816,6 +830851,15 @@ function makeSkipVisitor(fetchResult) {
|
|
|
830816
830851
|
}
|
|
830817
830852
|
]
|
|
830818
830853
|
};
|
|
830854
|
+
case "resolve-failed":
|
|
830855
|
+
return {
|
|
830856
|
+
file: () => [
|
|
830857
|
+
{
|
|
830858
|
+
severity: "warning",
|
|
830859
|
+
message: `Missing redirects check skipped: failed to resolve local docs navigation (${fetchResult.reason}). Run \`fern check --log-level=debug\` for more detail.`
|
|
830860
|
+
}
|
|
830861
|
+
]
|
|
830862
|
+
};
|
|
830819
830863
|
}
|
|
830820
830864
|
}
|
|
830821
830865
|
|
|
@@ -852599,7 +852643,7 @@ function collectPathnamesToCheck(content5, { absoluteFilepath, instanceUrls }) {
|
|
|
852599
852643
|
}
|
|
852600
852644
|
|
|
852601
852645
|
// ../yaml/docs-validator/lib/rules/valid-markdown-link/valid-markdown-link.js
|
|
852602
|
-
var
|
|
852646
|
+
var NOOP_CONTEXT = createMockTaskContext({ logger: createLogger(noop2) });
|
|
852603
852647
|
function createDocsResolverValidationContext() {
|
|
852604
852648
|
const base4 = createMockTaskContext({ logger: createLogger(noop2) });
|
|
852605
852649
|
return {
|
|
@@ -852698,7 +852742,7 @@ var ValidMarkdownLinks = {
|
|
|
852698
852742
|
markdown: content5,
|
|
852699
852743
|
absolutePathToFernFolder: workspace.absoluteFilePath,
|
|
852700
852744
|
absolutePathToMarkdownFile: absoluteFilepath,
|
|
852701
|
-
context:
|
|
852745
|
+
context: NOOP_CONTEXT
|
|
852702
852746
|
});
|
|
852703
852747
|
const { pathnamesToCheck, violations } = collectPathnamesToCheck(resolvedContent, {
|
|
852704
852748
|
absoluteFilepath,
|
|
@@ -852737,7 +852781,7 @@ var ValidMarkdownLinks = {
|
|
|
852737
852781
|
return [...violations, ...pathToCheckViolations.flat()];
|
|
852738
852782
|
},
|
|
852739
852783
|
apiSection: async ({ workspace: apiWorkspace, config: config5 }) => {
|
|
852740
|
-
const fernWorkspace = await apiWorkspace.toFernWorkspace({ context:
|
|
852784
|
+
const fernWorkspace = await apiWorkspace.toFernWorkspace({ context: NOOP_CONTEXT }, { enableUniqueErrorsPerEndpoint: true, detectGlobalHeaders: false });
|
|
852741
852785
|
const ir11 = generateIntermediateRepresentation({
|
|
852742
852786
|
workspace: fernWorkspace,
|
|
852743
852787
|
audiences: config5.audiences ? {
|
|
@@ -852751,10 +852795,10 @@ var ValidMarkdownLinks = {
|
|
|
852751
852795
|
readme: void 0,
|
|
852752
852796
|
version: void 0,
|
|
852753
852797
|
packageName: void 0,
|
|
852754
|
-
context:
|
|
852755
|
-
sourceResolver: new SourceResolverImpl(
|
|
852798
|
+
context: NOOP_CONTEXT,
|
|
852799
|
+
sourceResolver: new SourceResolverImpl(NOOP_CONTEXT, fernWorkspace)
|
|
852756
852800
|
});
|
|
852757
|
-
const api2 = toLatest(convertIrToApiDefinition({ ir: ir11, apiDefinitionId: (0, import_crypto7.randomUUID)(), context:
|
|
852801
|
+
const api2 = toLatest(convertIrToApiDefinition({ ir: ir11, apiDefinitionId: (0, import_crypto7.randomUUID)(), context: NOOP_CONTEXT }));
|
|
852758
852802
|
const uniqueDescriptions = collectUniqueDescriptions(api2);
|
|
852759
852803
|
const violations = [];
|
|
852760
852804
|
const uniquePathnames = /* @__PURE__ */ new Map();
|
|
@@ -853889,15 +853933,17 @@ async function runRulesOnDocsWorkspace({ workspace, rules: selectedRules, contex
|
|
|
853889
853933
|
const allRulesWithVisitors = [];
|
|
853890
853934
|
for (const result of ruleCreationResults) {
|
|
853891
853935
|
if ("error" in result) {
|
|
853892
|
-
const message =
|
|
853936
|
+
const message = formatInitError(result.error);
|
|
853937
|
+
const severityOverride = severityOverrides.get(result.ruleName);
|
|
853938
|
+
const severity = severityOverride === "warning" ? "warning" : severityOverride === "error" ? "error" : "fatal";
|
|
853893
853939
|
violations.push({
|
|
853894
853940
|
name: result.ruleName,
|
|
853895
|
-
severity
|
|
853941
|
+
severity,
|
|
853896
853942
|
relativeFilepath: RelativeFilePath2.of(DOCS_CONFIGURATION_FILENAME),
|
|
853897
853943
|
nodePath: [],
|
|
853898
853944
|
message: `Rule "${result.ruleName}" failed to initialize: ${message}`
|
|
853899
853945
|
});
|
|
853900
|
-
context3.logger.debug(`Rule "${result.ruleName}" failed to initialize: ${result.error instanceof Error ? result.error.stack ?? result.error.message :
|
|
853946
|
+
context3.logger.debug(`Rule "${result.ruleName}" failed to initialize: ${result.error instanceof Error ? result.error.stack ?? result.error.message : message}`);
|
|
853901
853947
|
} else {
|
|
853902
853948
|
allRulesWithVisitors.push(result);
|
|
853903
853949
|
}
|
|
@@ -859210,7 +859256,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
859210
859256
|
var LOGS_FOLDER_NAME = "logs";
|
|
859211
859257
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
859212
859258
|
function getCliSource() {
|
|
859213
|
-
const version7 = "5.26.
|
|
859259
|
+
const version7 = "5.26.4";
|
|
859214
859260
|
return `cli@${version7}`;
|
|
859215
859261
|
}
|
|
859216
859262
|
var DebugLogger = class {
|
|
@@ -860409,7 +860455,8 @@ async function applyGlobalThemeIfNeeded(docsWorkspace, organization, context3) {
|
|
|
860409
860455
|
if (themeName == null) {
|
|
860410
860456
|
return docsWorkspace;
|
|
860411
860457
|
}
|
|
860412
|
-
const
|
|
860458
|
+
const storedToken = await getUserToken();
|
|
860459
|
+
const token = storedToken?.value ?? process.env.FERN_TOKEN;
|
|
860413
860460
|
if (token == null) {
|
|
860414
860461
|
context3.logger.warn(`docs.yml declares global-theme "${themeName}" but FERN_TOKEN is not set \u2014 theme will not be applied in dev mode. Set FERN_TOKEN or run 'fern login' to enable it.`);
|
|
860415
860462
|
return docsWorkspace;
|
|
@@ -873148,7 +873195,7 @@ var LegacyDocsPublisher = class {
|
|
|
873148
873195
|
previewId,
|
|
873149
873196
|
disableTemplates: void 0,
|
|
873150
873197
|
skipUpload,
|
|
873151
|
-
cliVersion: "5.26.
|
|
873198
|
+
cliVersion: "5.26.4",
|
|
873152
873199
|
loginCommand: "fern auth login"
|
|
873153
873200
|
});
|
|
873154
873201
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -947946,7 +947993,7 @@ var CliContext = class _CliContext {
|
|
|
947946
947993
|
if (false) {
|
|
947947
947994
|
this.logger.error("CLI_VERSION is not defined");
|
|
947948
947995
|
}
|
|
947949
|
-
return "5.26.
|
|
947996
|
+
return "5.26.4";
|
|
947950
947997
|
}
|
|
947951
947998
|
getCliName() {
|
|
947952
947999
|
if (false) {
|
package/package.json
CHANGED