fern-api 0.15.0-rc84 → 0.15.0-rc88

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/bundle.cjs +61 -12
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -2544,15 +2544,15 @@ var require_rimraf = __commonJS({
2544
2544
  if (er && er.code === "EPERM" && isWindows)
2545
2545
  fixWinEPERM(p2, options, er, cb);
2546
2546
  if (st && st.isDirectory())
2547
- return rmdir(p2, options, er, cb);
2547
+ return rmdir2(p2, options, er, cb);
2548
2548
  options.unlink(p2, (er2) => {
2549
2549
  if (er2) {
2550
2550
  if (er2.code === "ENOENT")
2551
2551
  return cb(null);
2552
2552
  if (er2.code === "EPERM")
2553
- return isWindows ? fixWinEPERM(p2, options, er2, cb) : rmdir(p2, options, er2, cb);
2553
+ return isWindows ? fixWinEPERM(p2, options, er2, cb) : rmdir2(p2, options, er2, cb);
2554
2554
  if (er2.code === "EISDIR")
2555
- return rmdir(p2, options, er2, cb);
2555
+ return rmdir2(p2, options, er2, cb);
2556
2556
  }
2557
2557
  return cb(er2);
2558
2558
  });
@@ -2570,7 +2570,7 @@ var require_rimraf = __commonJS({
2570
2570
  if (er3)
2571
2571
  cb(er3.code === "ENOENT" ? null : er);
2572
2572
  else if (stats.isDirectory())
2573
- rmdir(p2, options, er, cb);
2573
+ rmdir2(p2, options, er, cb);
2574
2574
  else
2575
2575
  options.unlink(p2, cb);
2576
2576
  });
@@ -2601,7 +2601,7 @@ var require_rimraf = __commonJS({
2601
2601
  else
2602
2602
  options.unlinkSync(p2);
2603
2603
  };
2604
- var rmdir = (p2, options, originalEr, cb) => {
2604
+ var rmdir2 = (p2, options, originalEr, cb) => {
2605
2605
  assert3(p2);
2606
2606
  assert3(options);
2607
2607
  assert3(typeof cb === "function");
@@ -707949,7 +707949,7 @@ var AccessTokenPosthogManager = class {
707949
707949
  properties: {
707950
707950
  ...event,
707951
707951
  ...event.properties,
707952
- version: "0.15.0-rc84",
707952
+ version: "0.15.0-rc88",
707953
707953
  usingAccessToken: true
707954
707954
  }
707955
707955
  });
@@ -708011,7 +708011,7 @@ var UserPosthogManager = class {
708011
708011
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
708012
708012
  event: "CLI",
708013
708013
  properties: {
708014
- version: "0.15.0-rc84",
708014
+ version: "0.15.0-rc88",
708015
708015
  ...event,
708016
708016
  ...event.properties
708017
708017
  }
@@ -732250,10 +732250,10 @@ var CliContext = class {
732250
732250
  return "fern-api";
732251
732251
  }
732252
732252
  getPackageVersion() {
732253
- if ("0.15.0-rc84" == null) {
732253
+ if ("0.15.0-rc88" == null) {
732254
732254
  this.logger.error("CLI_VERSION is not defined");
732255
732255
  }
732256
- return "0.15.0-rc84";
732256
+ return "0.15.0-rc88";
732257
732257
  }
732258
732258
  getCliName() {
732259
732259
  if ("fern" == null) {
@@ -745125,7 +745125,7 @@ var LocalTaskHandler = class {
745125
745125
  await this.copyGeneratedFilesToDirectory(tmpOutputResolutionDir);
745126
745126
  await this.runGitCommand(["reset", "--", ...fernIngnorePaths], tmpOutputResolutionDir);
745127
745127
  await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
745128
- this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
745128
+ await (0, import_promises28.rmdir)(this.absolutePathToLocalOutput, { recursive: true });
745129
745129
  await (0, import_promises28.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
745130
745130
  }
745131
745131
  async copyGeneratedFilesNoFernIgnore() {
@@ -745140,9 +745140,9 @@ var LocalTaskHandler = class {
745140
745140
  }
745141
745141
  this.context.logger.debug(`Copying generated files to ${outputPath}`);
745142
745142
  if (firstLocalOutputItem.endsWith(".zip") && remaininglocalOutputItems.length === 0) {
745143
- await (0, import_decompress.default)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(firstLocalOutputItem)), this.absolutePathToLocalOutput);
745143
+ await (0, import_decompress.default)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(firstLocalOutputItem)), outputPath);
745144
745144
  } else {
745145
- await (0, import_promises28.cp)(this.absolutePathToTmpOutputDirectory, this.absolutePathToLocalOutput, { recursive: true });
745145
+ await (0, import_promises28.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
745146
745146
  }
745147
745147
  }
745148
745148
  async copySnippetJSON(absolutePathToTmpSnippetJSON) {
@@ -772674,6 +772674,32 @@ async function registerWorkspacesV2({
772674
772674
  );
772675
772675
  }
772676
772676
 
772677
+ // pnp:/home/circleci/project/packages/cli/cli/src/commands/token/token.ts
772678
+ var import_venus_api_sdk3 = __toESM(require_venus_api_sdk());
772679
+ async function generateToken({
772680
+ orgId,
772681
+ taskContext
772682
+ }) {
772683
+ const token = await askToLogin(taskContext);
772684
+ const venus = createVenusService({ token: token.value });
772685
+ const response = await venus.registry.generateRegistryTokens({
772686
+ organizationId: import_venus_api_sdk3.FernVenusApi.OrganizationId(orgId)
772687
+ });
772688
+ if (response.ok) {
772689
+ taskContext.logger.info(source_default.green(`Generated a FERN_TOKEN for ${orgId}: ${response.body.npm.token}`));
772690
+ return;
772691
+ }
772692
+ response.error._visit({
772693
+ organizationNotFoundError: () => taskContext.failAndThrow(
772694
+ `Failed to create token because the organization ${orgId} was not found. Please reach out to support@buildwithfern.com`
772695
+ ),
772696
+ unauthorizedError: () => taskContext.failAndThrow(
772697
+ `Failed to create token because you are not in the ${orgId} organization. Please reach out to support@buildwithfern.com`
772698
+ ),
772699
+ _other: () => taskContext.failAndThrow("Failed to create token. Please reach out to support@buildwithfern.com")
772700
+ });
772701
+ }
772702
+
772677
772703
  // pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
772678
772704
  var import_promises38 = require("fs/promises");
772679
772705
 
@@ -774387,6 +774413,7 @@ async function tryRunCli(cliContext) {
774387
774413
  choices: LOG_LEVELS
774388
774414
  }).demandCommand().recommendCommands();
774389
774415
  addInitCommand(cli, cliContext);
774416
+ addTokenCommand(cli, cliContext);
774390
774417
  addAddCommand(cli, cliContext);
774391
774418
  addGenerateCommand(cli, cliContext);
774392
774419
  addIrCommand(cli, cliContext);
@@ -774486,6 +774513,28 @@ function addInitCommand(cli, cliContext) {
774486
774513
  }
774487
774514
  );
774488
774515
  }
774516
+ function addTokenCommand(cli, cliContext) {
774517
+ cli.command(
774518
+ "token",
774519
+ "Generate a Fern Token",
774520
+ (yargs) => yargs.option("organization", {
774521
+ alias: "org",
774522
+ type: "string",
774523
+ description: "The organization to create a token for. Defaults to the one in `fern.config.json`"
774524
+ }),
774525
+ async (argv) => {
774526
+ await cliContext.runTask(async (context) => {
774527
+ await generateToken({
774528
+ orgId: argv.organization ?? (await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
774529
+ commandLineApiWorkspace: void 0,
774530
+ defaultToAllApiWorkspaces: true
774531
+ })).config.organization,
774532
+ taskContext: context
774533
+ });
774534
+ });
774535
+ }
774536
+ );
774537
+ }
774489
774538
  function addAddCommand(cli, cliContext) {
774490
774539
  cli.command(
774491
774540
  "add <generator>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.15.0-rc84",
3
+ "version": "0.15.0-rc88",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",