@fern-api/fern-api-dev 5.1.0 → 5.2.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.
Files changed (2) hide show
  1. package/cli.cjs +49 -11
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -511106,7 +511106,8 @@ var DocsInstance = external_exports.object({
511106
511106
  url: external_exports.string(),
511107
511107
  "custom-domain": CustomDomain.optional(),
511108
511108
  "edit-this-page": EditThisPageConfig.optional(),
511109
- audiences: Audience.optional()
511109
+ audiences: Audience.optional(),
511110
+ "multi-source": external_exports.boolean().optional()
511110
511111
  });
511111
511112
  var LogoConfiguration = external_exports.object({
511112
511113
  dark: external_exports.string().optional(),
@@ -514301,7 +514302,8 @@ var DocsInstance2 = schemas_exports6.object({
514301
514302
  url: schemas_exports6.string(),
514302
514303
  customDomain: schemas_exports6.property("custom-domain", CustomDomain2.optional()),
514303
514304
  editThisPage: schemas_exports6.property("edit-this-page", EditThisPageConfig2.optional()),
514304
- audiences: Audience2.optional()
514305
+ audiences: Audience2.optional(),
514306
+ multiSource: schemas_exports6.property("multi-source", schemas_exports6.boolean().optional())
514305
514307
  });
514306
514308
 
514307
514309
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/HttpSnippetLanguage.js
@@ -621990,7 +621992,7 @@ var AccessTokenPosthogManager = class {
621990
621992
  properties: {
621991
621993
  ...event,
621992
621994
  ...event.properties,
621993
- version: "5.1.0",
621995
+ version: "5.2.0",
621994
621996
  usingAccessToken: true
621995
621997
  }
621996
621998
  });
@@ -622044,7 +622046,7 @@ var UserPosthogManager = class {
622044
622046
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622045
622047
  event: "CLI",
622046
622048
  properties: {
622047
- version: "5.1.0",
622049
+ version: "5.2.0",
622048
622050
  ...event,
622049
622051
  ...event.properties,
622050
622052
  usingAccessToken: false,
@@ -833919,7 +833921,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
833919
833921
  var LOGS_FOLDER_NAME = "logs";
833920
833922
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
833921
833923
  function getCliSource() {
833922
- const version7 = "5.1.0";
833924
+ const version7 = "5.2.0";
833923
833925
  return `cli@${version7}`;
833924
833926
  }
833925
833927
  var DebugLogger = class {
@@ -838237,6 +838239,16 @@ var definitions6 = {
838237
838239
  type: "null"
838238
838240
  }
838239
838241
  ]
838242
+ },
838243
+ "multi-source": {
838244
+ oneOf: [
838245
+ {
838246
+ type: "boolean"
838247
+ },
838248
+ {
838249
+ type: "null"
838250
+ }
838251
+ ]
838240
838252
  }
838241
838253
  },
838242
838254
  required: [
@@ -845248,7 +845260,7 @@ async function calculateFileHash(absoluteFilePath) {
845248
845260
  function sanitizeRelativePathForS3(relativeFilePath) {
845249
845261
  return relativeFilePath.replace(/\.\.\//g, "_dot_dot_/");
845250
845262
  }
845251
- async function publishDocs({ token, organization, docsWorkspace, domain: domain3, customDomains, apiWorkspaces, ossWorkspaces, context: context3, preview, previewId, editThisPage, disableTemplates = false, skipUpload = false, withAiExamples = true, excludeApis = false, targetAudiences, docsUrl, cliVersion, ciSource, deployerAuthor, loginCommand = "fern login" }) {
845263
+ async function publishDocs({ token, organization, docsWorkspace, domain: domain3, customDomains, apiWorkspaces, ossWorkspaces, context: context3, preview, previewId, editThisPage, disableTemplates = false, skipUpload = false, withAiExamples = true, excludeApis = false, targetAudiences, docsUrl, cliVersion, ciSource, deployerAuthor, loginCommand = "fern login", multiSource = false }) {
845252
845264
  const fdrOrigin = "https://registry-dev2.buildwithfern.com";
845253
845265
  const isAirGapped = await detectAirGappedMode(`${fdrOrigin}/health`, context3.logger);
845254
845266
  if (isAirGapped) {
@@ -845280,9 +845292,12 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
845280
845292
  let urlToOutput = customDomains[0] ?? domain3;
845281
845293
  const basePath = parseBasePath(domain3);
845282
845294
  const disableDynamicSnippets = docsWorkspace.config.experimental && docsWorkspace.config.experimental.dynamicSnippets === false;
845283
- const isBasepathAware = docsWorkspace.config.experimental?.basepathAware === true;
845295
+ if (docsWorkspace.config.experimental?.basepathAware === true) {
845296
+ context3.logger.warn("experimental.basepath-aware is deprecated. Use 'multi-source: true' on the instance instead.");
845297
+ }
845298
+ const isBasepathAware = multiSource || docsWorkspace.config.experimental?.basepathAware === true;
845284
845299
  if (isBasepathAware) {
845285
- context3.logger.debug("Experimental flag 'basepath-aware' is enabled - using basepath-aware S3 key format");
845300
+ context3.logger.debug("Basepath-aware mode is enabled - using basepath-aware S3 key format");
845286
845301
  }
845287
845302
  let deployLocked = false;
845288
845303
  const doUnlock = () => {
@@ -846252,6 +846267,9 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
846252
846267
  customDomains.push(...maybeInstance.customDomain);
846253
846268
  }
846254
846269
  }
846270
+ if (maybeInstance.multiSource === true) {
846271
+ validateMultiSourceBasepaths(maybeInstance.url, customDomains, context3);
846272
+ }
846255
846273
  context3.logger.info(`Starting docs publishing for ${preview ? "preview" : "production"}: ${maybeInstance.url}`);
846256
846274
  context3.logger.debug(`Organization: ${organization}, Preview: ${preview}, APIs: ${apiWorkspaces.length}, OSS: ${ossWorkspaces.length}`);
846257
846275
  let publishedUrl;
@@ -846278,7 +846296,8 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
846278
846296
  cliVersion,
846279
846297
  ciSource,
846280
846298
  deployerAuthor,
846281
- loginCommand
846299
+ loginCommand,
846300
+ multiSource: maybeInstance.multiSource ?? false
846282
846301
  });
846283
846302
  for (let attempt = 0; ; attempt++) {
846284
846303
  try {
@@ -846302,6 +846321,23 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
846302
846321
  });
846303
846322
  return publishedUrl;
846304
846323
  }
846324
+ function getBasepath(domain3) {
846325
+ try {
846326
+ const url3 = domain3.startsWith("https://") || domain3.startsWith("http://") ? domain3 : `https://${domain3}`;
846327
+ return new URL(url3).pathname;
846328
+ } catch {
846329
+ return "/";
846330
+ }
846331
+ }
846332
+ function validateMultiSourceBasepaths(instanceUrl, customDomains, context3) {
846333
+ const urlBasepath = getBasepath(instanceUrl);
846334
+ for (const customDomain of customDomains) {
846335
+ const customDomainBasepath = getBasepath(customDomain);
846336
+ if (customDomainBasepath !== "/" && urlBasepath !== customDomainBasepath) {
846337
+ 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 });
846338
+ }
846339
+ }
846340
+ }
846305
846341
 
846306
846342
  // ../cli-v2/lib/docs/publisher/LegacyDocsPublisher.js
846307
846343
  var LegacyDocsPublisher = class {
@@ -846337,7 +846373,7 @@ var LegacyDocsPublisher = class {
846337
846373
  previewId,
846338
846374
  disableTemplates: void 0,
846339
846375
  skipUpload,
846340
- cliVersion: "5.1.0",
846376
+ cliVersion: "5.2.0",
846341
846377
  loginCommand: "fern auth login"
846342
846378
  });
846343
846379
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -865752,6 +865788,8 @@ var Generation = class {
865752
865788
  explicitNamespaces: () => this.customConfig["explicit-namespaces"] === true,
865753
865789
  /** Override the default max retries for the SDK client. Default: 2. */
865754
865790
  maxRetries: () => this.customConfig.maxRetries,
865791
+ /** Controls which HTTP status codes trigger automatic retries. Default: "legacy". */
865792
+ retryStatusCodes: () => this.customConfig.retryStatusCodes ?? "legacy",
865755
865793
  /**
865756
865794
  * Output path configuration for generated files.
865757
865795
  * Returns normalized paths for library, test, solution, and other files.
@@ -920664,7 +920702,7 @@ var CliContext = class _CliContext {
920664
920702
  if (false) {
920665
920703
  this.logger.error("CLI_VERSION is not defined");
920666
920704
  }
920667
- return "5.1.0";
920705
+ return "5.2.0";
920668
920706
  }
920669
920707
  getCliName() {
920670
920708
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.1.0",
2
+ "version": "5.2.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",