@fern-api/fern-api-dev 4.37.12 → 4.38.0-4-g99596b44b36

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 +61 -10
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -581652,7 +581652,7 @@ var AccessTokenPosthogManager = class {
581652
581652
  properties: {
581653
581653
  ...event,
581654
581654
  ...event.properties,
581655
- version: "4.37.12",
581655
+ version: "4.38.0-4-g99596b44b36",
581656
581656
  usingAccessToken: true
581657
581657
  }
581658
581658
  });
@@ -581703,7 +581703,7 @@ var UserPosthogManager = class {
581703
581703
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
581704
581704
  event: "CLI",
581705
581705
  properties: {
581706
- version: "4.37.12",
581706
+ version: "4.38.0-4-g99596b44b36",
581707
581707
  ...event,
581708
581708
  ...event.properties,
581709
581709
  usingAccessToken: false,
@@ -787806,7 +787806,7 @@ var import_path51 = __toESM(require("path"), 1);
787806
787806
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
787807
787807
  var LOGS_FOLDER_NAME = "logs";
787808
787808
  function getCliSource() {
787809
- const version8 = "4.37.12";
787809
+ const version8 = "4.38.0-4-g99596b44b36";
787810
787810
  return `cli@${version8}`;
787811
787811
  }
787812
787812
  var DebugLogger = class {
@@ -797720,15 +797720,23 @@ async function calculateFileHash(absoluteFilePath) {
797720
797720
  function sanitizeRelativePathForS3(relativeFilePath) {
797721
797721
  return relativeFilePath.replace(/\.\.\//g, "_dot_dot_/");
797722
797722
  }
797723
- async function publishDocs({ token, organization, docsWorkspace, domain: domain3, customDomains, apiWorkspaces, ossWorkspaces, context: context2, preview, previewId, editThisPage, isPrivate = false, disableTemplates = false, skipUpload = false, withAiExamples = true, excludeApis = false, targetAudiences, docsUrl, cliVersion }) {
797723
+ async function publishDocs({ token, organization, docsWorkspace, domain: domain3, customDomains, apiWorkspaces, ossWorkspaces, context: context2, preview, previewId, editThisPage, isPrivate = false, disableTemplates = false, skipUpload = false, withAiExamples = true, excludeApis = false, targetAudiences, docsUrl, cliVersion, ciSource }) {
797724
797724
  const fdrOrigin = "https://registry-dev2.buildwithfern.com";
797725
797725
  const isAirGapped = await detectAirGappedMode(`${fdrOrigin}/health`, context2.logger);
797726
797726
  if (isAirGapped) {
797727
797727
  context2.logger.debug("Detected air-gapped environment - skipping external FDR service calls");
797728
797728
  }
797729
+ const headers2 = {};
797730
+ if (cliVersion != null) {
797731
+ headers2["X-CLI-Version"] = cliVersion;
797732
+ }
797733
+ if (ciSource != null) {
797734
+ headers2["X-CI-Source"] = JSON.stringify(ciSource);
797735
+ context2.logger.debug(`CI source detected: ${ciSource.type} (${ciSource.repo ?? "unknown repo"})`);
797736
+ }
797729
797737
  const fdr = createFdrService({
797730
797738
  token: token.value,
797731
- ...cliVersion != null && { headers: { "X-CLI-Version": cliVersion } }
797739
+ ...Object.keys(headers2).length > 0 && { headers: headers2 }
797732
797740
  });
797733
797741
  const authConfig = isPrivate ? { type: "private", authType: "sso" } : { type: "public" };
797734
797742
  if (excludeApis) {
@@ -798488,7 +798496,7 @@ var PUBLISH_CONFLICT_RETRY_DELAYS_MS = [
798488
798496
  5 * 60 * 1e3
798489
798497
  // 5 minutes
798490
798498
  ];
798491
- async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces, ossWorkspaces, docsWorkspace, context: context2, token, instanceUrl, preview, previewId, disableTemplates, skipUpload, cliVersion }) {
798499
+ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces, ossWorkspaces, docsWorkspace, context: context2, token, instanceUrl, preview, previewId, disableTemplates, skipUpload, cliVersion, ciSource }) {
798492
798500
  const shouldSubstituteAsEmpty = preview && !docsWorkspace.config.settings?.substituteEnvVars;
798493
798501
  docsWorkspace.config = replaceEnvVariables(
798494
798502
  docsWorkspace.config,
@@ -798542,7 +798550,8 @@ async function runRemoteGenerationForDocsWorkspace({ organization, apiWorkspaces
798542
798550
  excludeApis: docsWorkspace.config.experimental?.excludeApis ?? false,
798543
798551
  targetAudiences: maybeInstance.audiences ? Array.isArray(maybeInstance.audiences) ? maybeInstance.audiences : [maybeInstance.audiences] : void 0,
798544
798552
  docsUrl: maybeInstance.url,
798545
- cliVersion
798553
+ cliVersion,
798554
+ ciSource
798546
798555
  });
798547
798556
  for (let attempt = 0; ; attempt++) {
798548
798557
  try {
@@ -798601,7 +798610,7 @@ var LegacyDocsPublisher = class {
798601
798610
  previewId: void 0,
798602
798611
  disableTemplates: void 0,
798603
798612
  skipUpload,
798604
- cliVersion: "4.37.12"
798613
+ cliVersion: "4.38.0-4-g99596b44b36"
798605
798614
  });
798606
798615
  if (taskContext.getResult() === TaskResult.Failure) {
798607
798616
  return { success: false };
@@ -871195,7 +871204,7 @@ var CliContext = class {
871195
871204
  if (false) {
871196
871205
  this.logger.error("CLI_VERSION is not defined");
871197
871206
  }
871198
- return "4.37.12";
871207
+ return "4.38.0-4-g99596b44b36";
871199
871208
  }
871200
871209
  getCliName() {
871201
871210
  if (false) {
@@ -880715,6 +880724,47 @@ function resolveGroupNamesForWorkspace(groupName, generatorsConfiguration) {
880715
880724
  init_js();
880716
880725
 
880717
880726
  // src/utils/environment.ts
880727
+ function detectCISource() {
880728
+ if (process.env.GITHUB_ACTIONS === "true") {
880729
+ const repo = process.env.GITHUB_REPOSITORY;
880730
+ const serverUrl = process.env.GITHUB_SERVER_URL ?? "https://github.com";
880731
+ const runId = process.env.GITHUB_RUN_ID;
880732
+ return {
880733
+ type: "github",
880734
+ repo,
880735
+ runId,
880736
+ runUrl: repo && runId ? `${serverUrl}/${repo}/actions/runs/${runId}` : void 0,
880737
+ commitSha: process.env.GITHUB_SHA,
880738
+ branch: process.env.GITHUB_REF_NAME,
880739
+ actor: process.env.GITHUB_ACTOR
880740
+ };
880741
+ }
880742
+ if (process.env.GITLAB_CI === "true") {
880743
+ return {
880744
+ type: "gitlab",
880745
+ repo: process.env.CI_PROJECT_PATH,
880746
+ runId: process.env.CI_PIPELINE_ID,
880747
+ runUrl: process.env.CI_PIPELINE_URL,
880748
+ commitSha: process.env.CI_COMMIT_SHA,
880749
+ branch: process.env.CI_COMMIT_REF_NAME,
880750
+ actor: process.env.GITLAB_USER_LOGIN
880751
+ };
880752
+ }
880753
+ if (process.env.BITBUCKET_BUILD_NUMBER != null) {
880754
+ const workspace = process.env.BITBUCKET_WORKSPACE;
880755
+ const repoSlug = process.env.BITBUCKET_REPO_SLUG;
880756
+ const buildNumber = process.env.BITBUCKET_BUILD_NUMBER;
880757
+ return {
880758
+ type: "bitbucket",
880759
+ repo: workspace && repoSlug ? `${workspace}/${repoSlug}` : void 0,
880760
+ runId: buildNumber,
880761
+ runUrl: workspace && repoSlug && buildNumber ? `https://bitbucket.org/${workspace}/${repoSlug}/pipelines/results/${buildNumber}` : void 0,
880762
+ commitSha: process.env.BITBUCKET_COMMIT,
880763
+ branch: process.env.BITBUCKET_BRANCH
880764
+ };
880765
+ }
880766
+ return void 0;
880767
+ }
880718
880768
  function isCI2() {
880719
880769
  return !!(process.env.CI || // Generic CI flag (used by many CI systems)
880720
880770
  process.env.CONTINUOUS_INTEGRATION || // Alternative generic flag
@@ -880868,7 +880918,8 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
880868
880918
  previewId,
880869
880919
  disableTemplates,
880870
880920
  skipUpload,
880871
- cliVersion: cliContext.environment.packageVersion
880921
+ cliVersion: cliContext.environment.packageVersion,
880922
+ ciSource: detectCISource()
880872
880923
  });
880873
880924
  const generationTime = performance.now() - generationStart;
880874
880925
  context2.logger.debug(`Remote docs generation completed in ${generationTime.toFixed(0)}ms`);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.37.12",
2
+ "version": "4.38.0-4-g99596b44b36",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",