@fern-api/fern-api-dev 4.81.0-14-gacd656850ac → 4.81.0-15-gf31c7899b46
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 +87 -52
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -614668,7 +614668,7 @@ var AccessTokenPosthogManager = class {
|
|
|
614668
614668
|
properties: {
|
|
614669
614669
|
...event,
|
|
614670
614670
|
...event.properties,
|
|
614671
|
-
version: "4.81.0-
|
|
614671
|
+
version: "4.81.0-15-gf31c7899b46",
|
|
614672
614672
|
usingAccessToken: true
|
|
614673
614673
|
}
|
|
614674
614674
|
});
|
|
@@ -614722,7 +614722,7 @@ var UserPosthogManager = class {
|
|
|
614722
614722
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
614723
614723
|
event: "CLI",
|
|
614724
614724
|
properties: {
|
|
614725
|
-
version: "4.81.0-
|
|
614725
|
+
version: "4.81.0-15-gf31c7899b46",
|
|
614726
614726
|
...event,
|
|
614727
614727
|
...event.properties,
|
|
614728
614728
|
usingAccessToken: false,
|
|
@@ -832138,7 +832138,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
832138
832138
|
var LOGS_FOLDER_NAME = "logs";
|
|
832139
832139
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
832140
832140
|
function getCliSource() {
|
|
832141
|
-
const version7 = "4.81.0-
|
|
832141
|
+
const version7 = "4.81.0-15-gf31c7899b46";
|
|
832142
832142
|
return `cli@${version7}`;
|
|
832143
832143
|
}
|
|
832144
832144
|
var DebugLogger = class {
|
|
@@ -841536,7 +841536,10 @@ async function retryWithRateLimit({ fn: fn10, retryRateLimited, logger: logger4,
|
|
|
841536
841536
|
}
|
|
841537
841537
|
}
|
|
841538
841538
|
}
|
|
841539
|
-
throw new
|
|
841539
|
+
throw new CliError({
|
|
841540
|
+
message: "Exceeded maximum retries for 429 Too Many Requests.",
|
|
841541
|
+
code: CliError.Code.InternalError
|
|
841542
|
+
});
|
|
841540
841543
|
}
|
|
841541
841544
|
|
|
841542
841545
|
// ../generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
@@ -841549,7 +841552,9 @@ async function createAndStartJob({ projectConfig, workspace, organization, inter
|
|
|
841549
841552
|
try {
|
|
841550
841553
|
fernignoreContents = await (0, import_promises86.readFile)(fernignorePath, "utf-8");
|
|
841551
841554
|
} catch (error50) {
|
|
841552
|
-
context3.failAndThrow(`Failed to read fernignore file at ${fernignorePath}: ${error50}
|
|
841555
|
+
context3.failAndThrow(`Failed to read fernignore file at ${fernignorePath}: ${error50}`, void 0, {
|
|
841556
|
+
code: CliError.Code.ConfigError
|
|
841557
|
+
});
|
|
841553
841558
|
}
|
|
841554
841559
|
}
|
|
841555
841560
|
const job = await retryWithRateLimit({
|
|
@@ -841572,7 +841577,7 @@ async function createAndStartJob({ projectConfig, workspace, organization, inter
|
|
|
841572
841577
|
}),
|
|
841573
841578
|
retryRateLimited,
|
|
841574
841579
|
logger: context3.logger,
|
|
841575
|
-
onRateLimitedWithoutRetry: () => context3.failAndThrow("Received 429 Too Many Requests. Re-run with --retry-rate-limited to automatically retry.")
|
|
841580
|
+
onRateLimitedWithoutRetry: () => context3.failAndThrow("Received 429 Too Many Requests. Re-run with --retry-rate-limited to automatically retry.", void 0, { code: CliError.Code.NetworkError })
|
|
841576
841581
|
});
|
|
841577
841582
|
await startJob({ intermediateRepresentation, job, context: context3, generatorInvocation, irVersionOverride });
|
|
841578
841583
|
return job;
|
|
@@ -841622,33 +841627,35 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
841622
841627
|
}
|
|
841623
841628
|
return convertCreateJobError(rawError)._visit({
|
|
841624
841629
|
illegalApiNameError: () => {
|
|
841625
|
-
return context3.failAndThrow("API name is invalid: " + workspace.definition.rootApiFile.contents.name);
|
|
841630
|
+
return context3.failAndThrow("API name is invalid: " + workspace.definition.rootApiFile.contents.name, void 0, { code: CliError.Code.ConfigError });
|
|
841626
841631
|
},
|
|
841627
841632
|
illegalApiVersionError: () => {
|
|
841628
|
-
return context3.failAndThrow("API version is invalid: " + version7
|
|
841633
|
+
return context3.failAndThrow("API version is invalid: " + version7, void 0, {
|
|
841634
|
+
code: CliError.Code.ConfigError
|
|
841635
|
+
});
|
|
841629
841636
|
},
|
|
841630
841637
|
cannotPublishToNpmScope: ({ validScope, invalidScope }) => {
|
|
841631
|
-
return context3.failAndThrow(`You do not have permission to publish to ${invalidScope} (expected ${validScope})
|
|
841638
|
+
return context3.failAndThrow(`You do not have permission to publish to ${invalidScope} (expected ${validScope})`, void 0, { code: CliError.Code.AuthError });
|
|
841632
841639
|
},
|
|
841633
841640
|
cannotPublishToMavenGroup: ({ validGroup, invalidGroup }) => {
|
|
841634
|
-
return context3.failAndThrow(`You do not have permission to publish to ${invalidGroup} (expected ${validGroup})
|
|
841641
|
+
return context3.failAndThrow(`You do not have permission to publish to ${invalidGroup} (expected ${validGroup})`, void 0, { code: CliError.Code.AuthError });
|
|
841635
841642
|
},
|
|
841636
841643
|
cannotPublishPypiPackage: ({ validPrefix, invalidPackageName }) => {
|
|
841637
|
-
return context3.failAndThrow(`You do not have permission to publish to ${invalidPackageName} (expected ${validPrefix})
|
|
841644
|
+
return context3.failAndThrow(`You do not have permission to publish to ${invalidPackageName} (expected ${validPrefix})`, void 0, { code: CliError.Code.AuthError });
|
|
841638
841645
|
},
|
|
841639
841646
|
generatorsDoNotExistError: (value2) => {
|
|
841640
|
-
return context3.failAndThrow("Generators do not exist: " + value2.nonExistentGenerators.map((generator) => `${generator.id}@${generator.version}`).join(", "));
|
|
841647
|
+
return context3.failAndThrow("Generators do not exist: " + value2.nonExistentGenerators.map((generator) => `${generator.id}@${generator.version}`).join(", "), void 0, { code: CliError.Code.ConfigError });
|
|
841641
841648
|
},
|
|
841642
841649
|
insufficientPermissions: () => {
|
|
841643
841650
|
return context3.failAndThrow(`You do not have permission to run this generator for organization '${organization}'. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
841644
841651
|
|
|
841645
|
-
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not
|
|
841652
|
+
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`, void 0, { code: CliError.Code.AuthError });
|
|
841646
841653
|
},
|
|
841647
841654
|
orgNotConfiguredForWhitelabel: () => {
|
|
841648
|
-
return context3.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com.");
|
|
841655
|
+
return context3.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com.", void 0, { code: CliError.Code.AuthError });
|
|
841649
841656
|
},
|
|
841650
841657
|
branchDoesNotExist: (value2) => {
|
|
841651
|
-
return context3.failAndThrow(`Branch ${value2.branch} does not exist in repository ${value2.repositoryOwner}/${value2.repositoryName}
|
|
841658
|
+
return context3.failAndThrow(`Branch ${value2.branch} does not exist in repository ${value2.repositoryOwner}/${value2.repositoryName}`, void 0, { code: CliError.Code.ConfigError });
|
|
841652
841659
|
},
|
|
841653
841660
|
rateLimitExceeded: () => {
|
|
841654
841661
|
throw new TooManyRequestsError();
|
|
@@ -841657,9 +841664,9 @@ Please ensure you have membership at https://dashboard.buildwithfern.com, and as
|
|
|
841657
841664
|
context3.logger.debug(`Failed to create job: ${JSON.stringify(content5)}`);
|
|
841658
841665
|
const errorMessage = extractErrorMessage2(content5);
|
|
841659
841666
|
if (errorMessage != null) {
|
|
841660
|
-
return context3.failAndThrow(errorMessage);
|
|
841667
|
+
return context3.failAndThrow(errorMessage, void 0, { code: CliError.Code.NetworkError });
|
|
841661
841668
|
}
|
|
841662
|
-
return context3.failAndThrow("Failed to create job. Please try again or contact support@buildwithfern.com for assistance.");
|
|
841669
|
+
return context3.failAndThrow("Failed to create job. Please try again or contact support@buildwithfern.com for assistance.", void 0, { code: CliError.Code.NetworkError });
|
|
841663
841670
|
}
|
|
841664
841671
|
});
|
|
841665
841672
|
}
|
|
@@ -841704,7 +841711,7 @@ async function startJob({ intermediateRepresentation, generatorInvocation, job,
|
|
|
841704
841711
|
} catch (error50) {
|
|
841705
841712
|
const errorBody = error50 instanceof AxiosError2 ? error50.response?.data : error50;
|
|
841706
841713
|
context3.logger.debug(`POST ${url3} failed with ${JSON.stringify(error50)}`);
|
|
841707
|
-
context3.failAndThrow("Failed to start job", errorBody);
|
|
841714
|
+
context3.failAndThrow("Failed to start job", errorBody, { code: CliError.Code.NetworkError });
|
|
841708
841715
|
}
|
|
841709
841716
|
}
|
|
841710
841717
|
function extractErrorMessage2(error50) {
|
|
@@ -841771,7 +841778,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context: context3 })
|
|
|
841771
841778
|
if (taskStatus == null) {
|
|
841772
841779
|
numConsecutiveFailed++;
|
|
841773
841780
|
if (numConsecutiveFailed === MAX_UNSUCCESSFUL_ATTEMPTS) {
|
|
841774
|
-
context3.failAndThrow(`Failed to get job status after ${numConsecutiveFailed} attempts
|
|
841781
|
+
context3.failAndThrow(`Failed to get job status after ${numConsecutiveFailed} attempts.`, void 0, {
|
|
841782
|
+
code: CliError.Code.NetworkError
|
|
841783
|
+
});
|
|
841775
841784
|
}
|
|
841776
841785
|
setTimeout(pollForStatus, 2e3 + 1e3 * numConsecutiveFailed);
|
|
841777
841786
|
} else {
|
|
@@ -841828,7 +841837,9 @@ var RemoteTaskHandler = class {
|
|
|
841828
841837
|
}
|
|
841829
841838
|
async processUpdate(remoteTask2) {
|
|
841830
841839
|
if (remoteTask2 == null) {
|
|
841831
|
-
this.context.failAndThrow("Task is missing on job status"
|
|
841840
|
+
this.context.failAndThrow("Task is missing on job status", void 0, {
|
|
841841
|
+
code: CliError.Code.InternalError
|
|
841842
|
+
});
|
|
841832
841843
|
}
|
|
841833
841844
|
const coordinates = remoteTask2.packages.map((p9) => {
|
|
841834
841845
|
return p9.coordinate._visit({
|
|
@@ -841879,7 +841890,7 @@ var RemoteTaskHandler = class {
|
|
|
841879
841890
|
if (s3PreSignedReadUrl != null) {
|
|
841880
841891
|
logS3Url(s3PreSignedReadUrl);
|
|
841881
841892
|
}
|
|
841882
|
-
this.context.failAndThrow(message);
|
|
841893
|
+
this.context.failAndThrow(message, void 0, { code: CliError.Code.ContainerError });
|
|
841883
841894
|
},
|
|
841884
841895
|
finished: async (finishedStatus) => {
|
|
841885
841896
|
if (finishedStatus.s3PreSignedReadUrlV2 != null) {
|
|
@@ -841956,7 +841967,7 @@ async function downloadFilesForTask({ s3PreSignedReadUrl, absolutePathToLocalOut
|
|
|
841956
841967
|
}
|
|
841957
841968
|
context3.logger.info(source_default.green(`Downloaded to ${absolutePathToLocalOutput}`));
|
|
841958
841969
|
} catch (e5) {
|
|
841959
|
-
context3.failAndThrow("Failed to download files", e5);
|
|
841970
|
+
context3.failAndThrow("Failed to download files", e5, { code: CliError.Code.NetworkError });
|
|
841960
841971
|
}
|
|
841961
841972
|
}
|
|
841962
841973
|
async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutput }) {
|
|
@@ -842133,7 +842144,7 @@ var SourceUploader = class {
|
|
|
842133
842144
|
});
|
|
842134
842145
|
await uploadCommand.cleanup();
|
|
842135
842146
|
if (!response.ok) {
|
|
842136
|
-
this.context.failAndThrow(`Failed to upload source file: ${source2.absoluteFilePath}. Status: ${response.status}, ${response.statusText}
|
|
842147
|
+
this.context.failAndThrow(`Failed to upload source file: ${source2.absoluteFilePath}. Status: ${response.status}, ${response.statusText}`, void 0, { code: CliError.Code.NetworkError });
|
|
842137
842148
|
}
|
|
842138
842149
|
}
|
|
842139
842150
|
async getUploadCommand(source2) {
|
|
@@ -842188,7 +842199,7 @@ var SourceUploader = class {
|
|
|
842188
842199
|
getSourceOrThrow(id) {
|
|
842189
842200
|
const source2 = this.sources[id];
|
|
842190
842201
|
if (source2 == null) {
|
|
842191
|
-
this.context.failAndThrow(`Internal error; server responded with source id "${id}" which does not exist in the workspace
|
|
842202
|
+
this.context.failAndThrow(`Internal error; server responded with source id "${id}" which does not exist in the workspace.`, void 0, { code: CliError.Code.InternalError });
|
|
842192
842203
|
}
|
|
842193
842204
|
return source2;
|
|
842194
842205
|
}
|
|
@@ -842204,7 +842215,9 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
842204
842215
|
const substituteEnvVars = (stringOrObject) => replaceEnvVariables(stringOrObject, {
|
|
842205
842216
|
onError: (e5) => {
|
|
842206
842217
|
if (!isPreview && requireEnvVars) {
|
|
842207
|
-
interactiveTaskContext.failAndThrow(e5
|
|
842218
|
+
interactiveTaskContext.failAndThrow(void 0, e5, {
|
|
842219
|
+
code: CliError.Code.EnvironmentError
|
|
842220
|
+
});
|
|
842208
842221
|
}
|
|
842209
842222
|
}
|
|
842210
842223
|
}, { substituteAsEmpty: isPreview });
|
|
@@ -842304,7 +842317,9 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
842304
842317
|
}
|
|
842305
842318
|
const sourceUploader = new SourceUploader(interactiveTaskContext, sources);
|
|
842306
842319
|
if (sourceUploads == null && sourceUploader.sourceTypes.has("protobuf")) {
|
|
842307
|
-
interactiveTaskContext.failAndThrow("Did not successfully upload Protobuf source files."
|
|
842320
|
+
interactiveTaskContext.failAndThrow("Did not successfully upload Protobuf source files.", void 0, {
|
|
842321
|
+
code: CliError.Code.NetworkError
|
|
842322
|
+
});
|
|
842308
842323
|
}
|
|
842309
842324
|
if (sourceUploads != null) {
|
|
842310
842325
|
interactiveTaskContext.logger.debug("Uploading source files ...");
|
|
@@ -842315,15 +842330,21 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
842315
842330
|
if (dynamicIrOnly) {
|
|
842316
842331
|
interactiveTaskContext.logger.info("Dynamic IR only mode: skipping SDK generation and uploading dynamic IR only");
|
|
842317
842332
|
if (version7 == null) {
|
|
842318
|
-
interactiveTaskContext.failAndThrow("Version is required for dynamic IR only mode"
|
|
842333
|
+
interactiveTaskContext.failAndThrow("Version is required for dynamic IR only mode", void 0, {
|
|
842334
|
+
code: CliError.Code.ConfigError
|
|
842335
|
+
});
|
|
842319
842336
|
return void 0;
|
|
842320
842337
|
}
|
|
842321
842338
|
if (generatorInvocation.language == null) {
|
|
842322
|
-
interactiveTaskContext.failAndThrow("Language is required for dynamic IR only mode"
|
|
842339
|
+
interactiveTaskContext.failAndThrow("Language is required for dynamic IR only mode", void 0, {
|
|
842340
|
+
code: CliError.Code.ConfigError
|
|
842341
|
+
});
|
|
842323
842342
|
return void 0;
|
|
842324
842343
|
}
|
|
842325
842344
|
if (packageName == null) {
|
|
842326
|
-
interactiveTaskContext.failAndThrow("Package name is required for dynamic IR only mode"
|
|
842345
|
+
interactiveTaskContext.failAndThrow("Package name is required for dynamic IR only mode", void 0, {
|
|
842346
|
+
code: CliError.Code.ConfigError
|
|
842347
|
+
});
|
|
842327
842348
|
return void 0;
|
|
842328
842349
|
}
|
|
842329
842350
|
try {
|
|
@@ -842339,7 +842360,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
842339
842360
|
context: interactiveTaskContext
|
|
842340
842361
|
});
|
|
842341
842362
|
} catch (error50) {
|
|
842342
|
-
interactiveTaskContext.failAndThrow(`Failed to upload dynamic IR: ${extractErrorMessage(error50)}
|
|
842363
|
+
interactiveTaskContext.failAndThrow(`Failed to upload dynamic IR: ${extractErrorMessage(error50)}`, void 0, { code: CliError.Code.NetworkError });
|
|
842343
842364
|
}
|
|
842344
842365
|
return {
|
|
842345
842366
|
createdSnippets: false,
|
|
@@ -842375,7 +842396,9 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
842375
842396
|
interactiveTaskContext.logger.debug(`Job ID: ${job.jobId}`);
|
|
842376
842397
|
const taskId = job.taskIds[0];
|
|
842377
842398
|
if (taskId == null) {
|
|
842378
|
-
interactiveTaskContext.failAndThrow("Did not receive a task ID."
|
|
842399
|
+
interactiveTaskContext.failAndThrow("Did not receive a task ID.", void 0, {
|
|
842400
|
+
code: CliError.Code.NetworkError
|
|
842401
|
+
});
|
|
842379
842402
|
return void 0;
|
|
842380
842403
|
}
|
|
842381
842404
|
interactiveTaskContext.logger.debug(`Task ID: ${taskId}`);
|
|
@@ -842541,7 +842564,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
842541
842564
|
onSnippetsProduced: (invocation) => snippetsProducedBy.push(invocation)
|
|
842542
842565
|
}))));
|
|
842543
842566
|
if (automation == null && results.some((didSucceed) => !didSucceed)) {
|
|
842544
|
-
|
|
842567
|
+
throw new TaskAbortSignal();
|
|
842545
842568
|
}
|
|
842546
842569
|
return {
|
|
842547
842570
|
snippetsProducedBy
|
|
@@ -842980,9 +843003,9 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
842980
843003
|
context3.logger.error(`FDR registerApiDefinition failed. Error details:
|
|
842981
843004
|
${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
842982
843005
|
if (apiName != null) {
|
|
842983
|
-
return context3.failAndThrow(`Failed to publish docs because API definition (${apiName}) could not be uploaded. Please contact support@buildwithfern.com`, errorDetails);
|
|
843006
|
+
return context3.failAndThrow(`Failed to publish docs because API definition (${apiName}) could not be uploaded. Please contact support@buildwithfern.com`, errorDetails, { code: CliError.Code.NetworkError });
|
|
842984
843007
|
} else {
|
|
842985
|
-
return context3.failAndThrow(`Failed to publish docs because API definition could not be uploaded. Please contact support@buildwithfern.com`, errorDetails);
|
|
843008
|
+
return context3.failAndThrow(`Failed to publish docs because API definition could not be uploaded. Please contact support@buildwithfern.com`, errorDetails, { code: CliError.Code.NetworkError });
|
|
842986
843009
|
}
|
|
842987
843010
|
}
|
|
842988
843011
|
context3.logger.debug(`Registered API Definition ${apiName}: ${response.apiDefinitionId}`);
|
|
@@ -843009,7 +843032,7 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
843009
843032
|
if (docsWorkspace.config.settings?.substituteEnvVars) {
|
|
843010
843033
|
context3.logger.debug("Applying environment variable substitution to docs definition...");
|
|
843011
843034
|
const { jsFiles, ...docsWithoutJsFiles } = docsDefinition;
|
|
843012
|
-
const substitutedDocs = replaceEnvVariables(docsWithoutJsFiles, { onError: (e5) => context3.failAndThrow(e5) }, { substituteAsEmpty: false });
|
|
843035
|
+
const substitutedDocs = replaceEnvVariables(docsWithoutJsFiles, { onError: (e5) => context3.failAndThrow(void 0, e5, { code: CliError.Code.EnvironmentError }) }, { substituteAsEmpty: false });
|
|
843013
843036
|
docsDefinition = { ...substitutedDocs, jsFiles };
|
|
843014
843037
|
}
|
|
843015
843038
|
const pageCount = Object.keys(docsDefinition.pages).length;
|
|
@@ -843019,7 +843042,9 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
843019
843042
|
context3.logger.debug(`Memory after resolve: RSS=${(resolveMemory.rss / 1024 / 1024).toFixed(2)}MB, Heap=${(resolveMemory.heapUsed / 1024 / 1024).toFixed(2)}MB`);
|
|
843020
843043
|
if (docsRegistrationId == null) {
|
|
843021
843044
|
doUnlock();
|
|
843022
|
-
return context3.failAndThrow("Failed to publish docs.", "Docs registration ID is missing."
|
|
843045
|
+
return context3.failAndThrow("Failed to publish docs.", "Docs registration ID is missing.", {
|
|
843046
|
+
code: CliError.Code.InternalError
|
|
843047
|
+
});
|
|
843023
843048
|
}
|
|
843024
843049
|
context3.logger.info("Publishing docs to FDR...");
|
|
843025
843050
|
const publishStart = performance.now();
|
|
@@ -843031,7 +843056,9 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
843031
843056
|
...isBasepathAware && !preview && { basepathAware: true }
|
|
843032
843057
|
});
|
|
843033
843058
|
} catch (error50) {
|
|
843034
|
-
return context3.failAndThrow("Failed to publish docs to " + domain3, error50
|
|
843059
|
+
return context3.failAndThrow("Failed to publish docs to " + domain3, error50, {
|
|
843060
|
+
code: CliError.Code.NetworkError
|
|
843061
|
+
});
|
|
843035
843062
|
}
|
|
843036
843063
|
const publishTime = performance.now() - publishStart;
|
|
843037
843064
|
context3.logger.debug(`Docs published to FDR in ${publishTime.toFixed(0)}ms`);
|
|
@@ -843091,7 +843118,9 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context3, batchSize
|
|
|
843091
843118
|
}
|
|
843092
843119
|
});
|
|
843093
843120
|
} catch (e5) {
|
|
843094
|
-
context3.failAndThrow(`Failed to upload ${absoluteFilePath}`, e5
|
|
843121
|
+
context3.failAndThrow(`Failed to upload ${absoluteFilePath}`, e5, {
|
|
843122
|
+
code: CliError.Code.NetworkError
|
|
843123
|
+
});
|
|
843095
843124
|
}
|
|
843096
843125
|
}));
|
|
843097
843126
|
const endTime2 = Date.now();
|
|
@@ -843131,24 +843160,26 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
843131
843160
|
}
|
|
843132
843161
|
const authErrorMessage = getAuthenticationErrorMessage(error50, organization, domain3);
|
|
843133
843162
|
if (authErrorMessage != null) {
|
|
843134
|
-
return context3.failAndThrow(authErrorMessage);
|
|
843163
|
+
return context3.failAndThrow(authErrorMessage, void 0, { code: CliError.Code.AuthError });
|
|
843135
843164
|
}
|
|
843136
843165
|
const errorType = errorObj?.error;
|
|
843137
843166
|
switch (errorType) {
|
|
843138
843167
|
case "InvalidCustomDomainError":
|
|
843139
|
-
return context3.failAndThrow(`Your docs domain should end with ${"docs.dev.buildwithfern.com"}
|
|
843168
|
+
return context3.failAndThrow(`Your docs domain should end with ${"docs.dev.buildwithfern.com"}`, void 0, { code: CliError.Code.ConfigError });
|
|
843140
843169
|
case "InvalidDomainError":
|
|
843141
|
-
return context3.failAndThrow("Please make sure that none of your custom domains are not overlapping (i.e. one is a substring of another)");
|
|
843170
|
+
return context3.failAndThrow("Please make sure that none of your custom domains are not overlapping (i.e. one is a substring of another)", void 0, { code: CliError.Code.ConfigError });
|
|
843142
843171
|
case "UnauthorizedError":
|
|
843143
|
-
return context3.failAndThrow(buildAuthFailureMessage(domain3, organization, errorContent)
|
|
843172
|
+
return context3.failAndThrow(buildAuthFailureMessage(domain3, organization, errorContent), void 0, {
|
|
843173
|
+
code: CliError.Code.AuthError
|
|
843174
|
+
});
|
|
843144
843175
|
case "UserNotInOrgError":
|
|
843145
843176
|
return context3.failAndThrow(`You do not belong to organization '${organization}'. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
843146
843177
|
|
|
843147
|
-
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not
|
|
843178
|
+
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`, void 0, { code: CliError.Code.AuthError });
|
|
843148
843179
|
case "UnavailableError":
|
|
843149
|
-
return context3.failAndThrow("Failed to publish docs. Please try again later or reach out to Fern support at support@buildwithfern.com.");
|
|
843180
|
+
return context3.failAndThrow("Failed to publish docs. Please try again later or reach out to Fern support at support@buildwithfern.com.", void 0, { code: CliError.Code.NetworkError });
|
|
843150
843181
|
default:
|
|
843151
|
-
return context3.failAndThrow("Failed to publish docs.", error50);
|
|
843182
|
+
return context3.failAndThrow("Failed to publish docs.", error50, { code: CliError.Code.NetworkError });
|
|
843152
843183
|
}
|
|
843153
843184
|
}
|
|
843154
843185
|
function getAuthenticationErrorMessage(error50, organization, domain3) {
|
|
@@ -843596,21 +843627,25 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
|
|
|
843596
843627
|
docsWorkspace.config = replaceEnvVariables(
|
|
843597
843628
|
docsWorkspace.config,
|
|
843598
843629
|
// Wrap in a closure for correct binding of `this` downstream
|
|
843599
|
-
{ onError: (e5) => context3.failAndThrow(e5) },
|
|
843630
|
+
{ onError: (e5) => context3.failAndThrow(void 0, e5, { code: CliError.Code.EnvironmentError }) },
|
|
843600
843631
|
{ substituteAsEmpty: shouldSubstituteAsEmpty }
|
|
843601
843632
|
);
|
|
843602
843633
|
const instances2 = docsWorkspace.config.instances;
|
|
843603
843634
|
if (instances2.length === 0) {
|
|
843604
|
-
context3.failAndThrow("No instances specified in docs.yml! Cannot register docs."
|
|
843635
|
+
context3.failAndThrow("No instances specified in docs.yml! Cannot register docs.", void 0, {
|
|
843636
|
+
code: CliError.Code.ConfigError
|
|
843637
|
+
});
|
|
843605
843638
|
return;
|
|
843606
843639
|
}
|
|
843607
843640
|
if (instances2.length > 1 && instanceUrl == null) {
|
|
843608
|
-
context3.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${instances2[0]?.url})
|
|
843641
|
+
context3.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${instances2[0]?.url})`, void 0, { code: CliError.Code.ConfigError });
|
|
843609
843642
|
return;
|
|
843610
843643
|
}
|
|
843611
843644
|
const maybeInstance = instances2.find((instance) => instance.url === instanceUrl) ?? instances2[0];
|
|
843612
843645
|
if (maybeInstance == null) {
|
|
843613
|
-
context3.failAndThrow(`No docs instance with url ${instanceUrl}. Failed to register
|
|
843646
|
+
context3.failAndThrow(`No docs instance with url ${instanceUrl}. Failed to register.`, void 0, {
|
|
843647
|
+
code: CliError.Code.ConfigError
|
|
843648
|
+
});
|
|
843614
843649
|
return;
|
|
843615
843650
|
}
|
|
843616
843651
|
const customDomains = [];
|
|
@@ -843655,7 +843690,7 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
|
|
|
843655
843690
|
} catch (error50) {
|
|
843656
843691
|
if (!(error50 instanceof DocsPublishConflictError) || attempt >= PUBLISH_CONFLICT_RETRY_DELAYS_MS.length) {
|
|
843657
843692
|
if (error50 instanceof DocsPublishConflictError) {
|
|
843658
|
-
return context3.failAndThrow("Another docs publish is currently in progress. Please try again once the other publish is complete.");
|
|
843693
|
+
return context3.failAndThrow("Another docs publish is currently in progress. Please try again once the other publish is complete.", void 0, { code: CliError.Code.NetworkError });
|
|
843659
843694
|
}
|
|
843660
843695
|
throw error50;
|
|
843661
843696
|
}
|
|
@@ -843705,7 +843740,7 @@ var LegacyDocsPublisher = class {
|
|
|
843705
843740
|
previewId,
|
|
843706
843741
|
disableTemplates: void 0,
|
|
843707
843742
|
skipUpload,
|
|
843708
|
-
cliVersion: "4.81.0-
|
|
843743
|
+
cliVersion: "4.81.0-15-gf31c7899b46"
|
|
843709
843744
|
});
|
|
843710
843745
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
843711
843746
|
return { success: false };
|
|
@@ -918936,7 +918971,7 @@ var CliContext = class _CliContext {
|
|
|
918936
918971
|
if (false) {
|
|
918937
918972
|
this.logger.error("CLI_VERSION is not defined");
|
|
918938
918973
|
}
|
|
918939
|
-
return "4.81.0-
|
|
918974
|
+
return "4.81.0-15-gf31c7899b46";
|
|
918940
918975
|
}
|
|
918941
918976
|
getCliName() {
|
|
918942
918977
|
if (false) {
|
package/package.json
CHANGED