@fern-api/fern-api-dev 5.18.0 → 5.18.1-1-g864405e75a7

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 +42 -14
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -66496,6 +66496,22 @@ var init_getFileContent = __esm({
66496
66496
  }
66497
66497
  });
66498
66498
 
66499
+ // ../../commons/github/lib/getGithubApiBaseUrl.js
66500
+ function getGithubApiBaseUrl(repositoryUri) {
66501
+ const { remote } = parseRepository(repositoryUri);
66502
+ if (remote === DEFAULT_REMOTE) {
66503
+ return void 0;
66504
+ }
66505
+ return `https://${remote}/api/v3`;
66506
+ }
66507
+ var init_getGithubApiBaseUrl = __esm({
66508
+ "../../commons/github/lib/getGithubApiBaseUrl.js"() {
66509
+ "use strict";
66510
+ init_constants2();
66511
+ init_parseRepository();
66512
+ }
66513
+ });
66514
+
66499
66515
  // ../../commons/github/lib/getLatestRelease.js
66500
66516
  function isSemverPrerelease(tag2) {
66501
66517
  return import_semver6.default.prerelease(tag2) != null;
@@ -66571,6 +66587,7 @@ __export(lib_exports3, {
66571
66587
  createOrUpdatePullRequest: () => createOrUpdatePullRequest,
66572
66588
  deleteBranch: () => deleteBranch,
66573
66589
  getFileContent: () => getFileContent,
66590
+ getGithubApiBaseUrl: () => getGithubApiBaseUrl,
66574
66591
  getLatestRelease: () => getLatestRelease,
66575
66592
  getOrUpdateBranch: () => getOrUpdateBranch,
66576
66593
  parseRepository: () => parseRepository
@@ -66583,6 +66600,7 @@ var init_lib7 = __esm({
66583
66600
  init_createOrUpdatePullRequest();
66584
66601
  init_deleteBranch();
66585
66602
  init_getFileContent();
66603
+ init_getGithubApiBaseUrl();
66586
66604
  init_getLatestRelease();
66587
66605
  init_getOrUpdateBranch();
66588
66606
  init_parseRepository();
@@ -364114,8 +364132,8 @@ var require_GithubStep = __commonJS({
364114
364132
  }
364115
364133
  async executePullRequestMode(repository, newPrBranch, skipCommit, replayConflictInfo, replayResult, resolved) {
364116
364134
  const baseBranch = this.config.branch ?? await repository.getDefaultBranch();
364117
- const octokit = new rest_1.Octokit({ auth: this.config.token });
364118
- const { owner, repo } = (0, github_1.parseRepository)(this.config.uri);
364135
+ const octokit = this.createOctokit();
364136
+ const { owner, repo, remote } = (0, github_1.parseRepository)(this.config.uri);
364119
364137
  let prBranch;
364120
364138
  let isUpdatingExistingPR = false;
364121
364139
  let generationBaseSha;
@@ -364184,7 +364202,7 @@ var require_GithubStep = __commonJS({
364184
364202
  logger: this.logger
364185
364203
  });
364186
364204
  const pushedBranch = await repository.getCurrentBranch();
364187
- result.branchUrl = `https://github.com/${this.config.uri}/tree/${pushedBranch}`;
364205
+ result.branchUrl = `https://${remote}/${owner}/${repo}/tree/${pushedBranch}`;
364188
364206
  this.logger.info(`Pushed branch: ${result.branchUrl}`);
364189
364207
  if (generationBaseSha != null) {
364190
364208
  try {
@@ -364199,7 +364217,7 @@ var require_GithubStep = __commonJS({
364199
364217
  }
364200
364218
  }
364201
364219
  const headSha = await repository.getHeadSha();
364202
- const changelogUrl = resolved.changelogEntry ? `https://github.com/${this.config.uri}/blob/${headSha}/changelog.md` : void 0;
364220
+ const changelogUrl = resolved.changelogEntry ? `https://${remote}/${owner}/${repo}/blob/${headSha}/changelog.md` : void 0;
364203
364221
  const { prTitle, prBody } = (0, parseCommitMessage_1.parseCommitMessageForPR)(resolved.commitMessage, resolved.changelogEntry, resolved.prDescription, resolved.versionBumpReason, resolved.previousVersion, resolved.newVersion, resolved.versionBump, changelogUrl);
364204
364222
  const replaySection = (0, replay_summary_1.formatReplayPrBody)(replayResult, { branchName: prBranch, repoUri: this.config.uri });
364205
364223
  let enrichedBody = replaySection != null ? prBody + "\n\n---\n\n" + replaySection : prBody;
@@ -364281,8 +364299,8 @@ var require_GithubStep = __commonJS({
364281
364299
  success: true
364282
364300
  };
364283
364301
  if (!this.config.previewMode) {
364284
- const octokit = new rest_1.Octokit({ auth: this.config.token });
364285
- const { owner, repo } = (0, github_1.parseRepository)(this.config.uri);
364302
+ const octokit = this.createOctokit();
364303
+ const { owner, repo, remote } = (0, github_1.parseRepository)(this.config.uri);
364286
364304
  await (0, pushSignedCommit_1.pushSignedCommit)({
364287
364305
  repository,
364288
364306
  octokit,
@@ -364294,11 +364312,18 @@ var require_GithubStep = __commonJS({
364294
364312
  logger: this.logger
364295
364313
  });
364296
364314
  const pushedBranch = await repository.getCurrentBranch();
364297
- result.branchUrl = `https://github.com/${this.config.uri}/tree/${pushedBranch}`;
364315
+ result.branchUrl = `https://${remote}/${owner}/${repo}/tree/${pushedBranch}`;
364298
364316
  this.logger.info(`Pushed branch: ${result.branchUrl}`);
364299
364317
  }
364300
364318
  return result;
364301
364319
  }
364320
+ createOctokit() {
364321
+ const opts = { auth: this.config.token };
364322
+ if (this.config.apiBaseUrl != null) {
364323
+ opts.baseUrl = this.config.apiBaseUrl;
364324
+ }
364325
+ return new rest_1.Octokit(opts);
364326
+ }
364302
364327
  async ensureFernignore() {
364303
364328
  this.logger.debug("Checking for .fernignore file...");
364304
364329
  const fernignorePath = (0, path_1.join)(this.outputDir, ".fernignore");
@@ -385948,8 +385973,10 @@ var require_GitHub = __commonJS({
385948
385973
  await this.restoreFiles(repository, fernIgnoreFiles);
385949
385974
  await repository.commit("SDK Generation");
385950
385975
  await repository.push();
385976
+ const apiBaseUrl = (0, github_1.getGithubApiBaseUrl)(this.githubConfig.uri);
385951
385977
  const octokit = new rest_1.Octokit({
385952
- auth: this.githubConfig.token
385978
+ auth: this.githubConfig.token,
385979
+ ...apiBaseUrl != null ? { baseUrl: apiBaseUrl } : {}
385953
385980
  });
385954
385981
  const parsedRepo = (0, github_1.parseRepository)(this.githubConfig.uri);
385955
385982
  const { owner, repo } = parsedRepo;
@@ -661064,7 +661091,7 @@ var AccessTokenPosthogManager = class {
661064
661091
  properties: {
661065
661092
  ...event,
661066
661093
  ...event.properties,
661067
- version: "5.18.0",
661094
+ version: "5.18.1-1-g864405e75a7",
661068
661095
  usingAccessToken: true,
661069
661096
  ...getRunIdProperties()
661070
661097
  }
@@ -661119,7 +661146,7 @@ var UserPosthogManager = class {
661119
661146
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
661120
661147
  event: "CLI",
661121
661148
  properties: {
661122
- version: "5.18.0",
661149
+ version: "5.18.1-1-g864405e75a7",
661123
661150
  ...event,
661124
661151
  ...event.properties,
661125
661152
  usingAccessToken: false,
@@ -852102,7 +852129,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
852102
852129
  var LOGS_FOLDER_NAME = "logs";
852103
852130
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
852104
852131
  function getCliSource() {
852105
- const version7 = "5.18.0";
852132
+ const version7 = "5.18.1-1-g864405e75a7";
852106
852133
  return `cli@${version7}`;
852107
852134
  }
852108
852135
  var DebugLogger = class {
@@ -864911,7 +864938,7 @@ var LegacyDocsPublisher = class {
864911
864938
  previewId,
864912
864939
  disableTemplates: void 0,
864913
864940
  skipUpload,
864914
- cliVersion: "5.18.0",
864941
+ cliVersion: "5.18.1-1-g864405e75a7",
864915
864942
  loginCommand: "fern auth login"
864916
864943
  });
864917
864944
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -917741,7 +917768,8 @@ generators:
917741
917768
  skipIfNoDiff,
917742
917769
  hasBreakingChanges,
917743
917770
  breakingChangesSummary: hasBreakingChanges ? autoVersioningPrDescription : void 0,
917744
- runId: process.env.FERN_RUN_ID
917771
+ runId: process.env.FERN_RUN_ID,
917772
+ apiBaseUrl: getGithubApiBaseUrl(selfhostedGithubConfig.uri)
917745
917773
  },
917746
917774
  cliVersion: workspace.cliVersion ?? "unknown",
917747
917775
  generatorVersions: {
@@ -939524,7 +939552,7 @@ var CliContext = class _CliContext {
939524
939552
  if (false) {
939525
939553
  this.logger.error("CLI_VERSION is not defined");
939526
939554
  }
939527
- return "5.18.0";
939555
+ return "5.18.1-1-g864405e75a7";
939528
939556
  }
939529
939557
  getCliName() {
939530
939558
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.18.0",
2
+ "version": "5.18.1-1-g864405e75a7",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",