fern-api 0.15.0-rc87 → 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.
- package/bundle.cjs +53 -4
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -707949,7 +707949,7 @@ var AccessTokenPosthogManager = class {
|
|
|
707949
707949
|
properties: {
|
|
707950
707950
|
...event,
|
|
707951
707951
|
...event.properties,
|
|
707952
|
-
version: "0.15.0-
|
|
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-
|
|
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-
|
|
732253
|
+
if ("0.15.0-rc88" == null) {
|
|
732254
732254
|
this.logger.error("CLI_VERSION is not defined");
|
|
732255
732255
|
}
|
|
732256
|
-
return "0.15.0-
|
|
732256
|
+
return "0.15.0-rc88";
|
|
732257
732257
|
}
|
|
732258
732258
|
getCliName() {
|
|
732259
732259
|
if ("fern" == null) {
|
|
@@ -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>",
|