@forge/cli 6.3.0-next.4 → 6.3.0-next.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @forge/cli
2
2
 
3
+ ## 6.3.0-next.7
4
+
5
+ ### Minor Changes
6
+
7
+ - cfded19: Added "forge contributors remove" command
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [cfded19]
12
+ - @forge/cli-shared@3.4.0-next.4
13
+ - @forge/bundler@4.1.0-next.6
14
+ - @forge/lint@3.2.11-next.4
15
+
16
+ ## 6.3.0-next.6
17
+
18
+ ### Minor Changes
19
+
20
+ - 814c1f16: Add 'contributors list' command to forge-cli for MUAO EAP Participants
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [814c1f16]
25
+ - @forge/cli-shared@3.4.0-next.3
26
+ - @forge/bundler@4.1.0-next.5
27
+ - @forge/lint@3.2.11-next.3
28
+
29
+ ## 6.3.0-next.5
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [05fb30c1]
34
+ - @forge/bundler@4.1.0-next.4
35
+
3
36
  ## 6.3.0-next.4
4
37
 
5
38
  ### Patch Changes
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@forge/cli",
3
- "version": "6.3.0-next.4",
3
+ "version": "6.3.0-next.7",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@forge/cli",
9
- "version": "6.3.0-next.4",
9
+ "version": "6.3.0-next.7",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "dependencies": {
13
- "@forge/bundler": "4.1.0-next.3",
14
- "@forge/cli-shared": "3.4.0-next.2",
13
+ "@forge/bundler": "4.1.0-next.6",
14
+ "@forge/cli-shared": "3.4.0-next.4",
15
15
  "@forge/egress": "^1.1.1",
16
- "@forge/lint": "3.2.11-next.2",
16
+ "@forge/lint": "3.2.11-next.4",
17
17
  "@forge/manifest": "4.5.2-next.0",
18
18
  "@forge/util": "1.2.0",
19
19
  "ajv": "^6.12.5",
@@ -653,9 +653,9 @@
653
653
  "integrity": "sha512-+GFtFqBhFzwKaKmeEfw1jWQgZJNX4q11CCx1fSPFJB49Fdjb7k3lx74jAyzHlX0UWnm6DMK+/cYT7j5t6G9LfA=="
654
654
  },
655
655
  "node_modules/@forge/bundler": {
656
- "version": "4.1.0-next.3",
657
- "resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.1.0-next.3.tgz",
658
- "integrity": "sha512-OhnIZTmkRWU+agMJz8D3XT1rDpZt64iWs6nq063mDjPk0t52T8fHal9ZjM2H0lnALvE5I+xSKGPKo0f9KRSznw==",
656
+ "version": "4.1.0-next.6",
657
+ "resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.1.0-next.6.tgz",
658
+ "integrity": "sha512-m1imhBBAYGe6/z5wYp7WWmv+xKTxJbCRIRBq/C7I2iDpdgExRn1T7cIZWQpIFodthztd1XnglHrW6cZl+fV7LQ==",
659
659
  "dependencies": {
660
660
  "@babel/core": "^7.16.7",
661
661
  "@babel/plugin-proposal-class-properties": "^7.16.7",
@@ -665,8 +665,8 @@
665
665
  "@babel/preset-typescript": "^7.16.7",
666
666
  "@forge/api": "2.9.0-next.0",
667
667
  "@forge/babel-plugin-transform-ui": "1.1.0",
668
- "@forge/cli-shared": "3.4.0-next.2",
669
- "@forge/lint": "3.2.11-next.2",
668
+ "@forge/cli-shared": "3.4.0-next.4",
669
+ "@forge/lint": "3.2.11-next.4",
670
670
  "assert": "^1.1.1",
671
671
  "babel-loader": "^8.2.3",
672
672
  "browserify-zlib": "^0.2.0",
@@ -711,9 +711,9 @@
711
711
  }
712
712
  },
713
713
  "node_modules/@forge/cli-shared": {
714
- "version": "3.4.0-next.2",
715
- "resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.4.0-next.2.tgz",
716
- "integrity": "sha512-n1y+NafT2mKZVaclPcbkPA2+r2DqEtOO4P8jI5g3qykDVYy4plDR48UwIEtRr/o1Buz7c3jPIWEW/WEtuKclxg==",
714
+ "version": "3.4.0-next.4",
715
+ "resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.4.0-next.4.tgz",
716
+ "integrity": "sha512-MX5eiBIluPeyQnfx2dAfxNtGPv13QeVaGd4NkxrLM7pVZGaEBNijzP9r//Ikp8Tt8jAoXqz616vCGs+YBPBfGA==",
717
717
  "dependencies": {
718
718
  "@forge/manifest": "4.5.2-next.0",
719
719
  "@forge/util": "1.2.0",
@@ -756,11 +756,11 @@
756
756
  }
757
757
  },
758
758
  "node_modules/@forge/lint": {
759
- "version": "3.2.11-next.2",
760
- "resolved": "https://registry.npmjs.org/@forge/lint/-/lint-3.2.11-next.2.tgz",
761
- "integrity": "sha512-ghLUd2lSdXgPFI0LIF/QZhDYR/bzi+bo8GXUW30OTuqtfdMs94+mmPOeCw44Y7FwlPNGpPqh/CEALzKj9ILqQg==",
759
+ "version": "3.2.11-next.4",
760
+ "resolved": "https://registry.npmjs.org/@forge/lint/-/lint-3.2.11-next.4.tgz",
761
+ "integrity": "sha512-V8Jy9vLVEzw1oWSWmbwA1HXKYyZn5m8YLXGO9NL567jONm/t5CdDPRhqQu+6N13FgJMdz03b/n1IITDRBLM4EQ==",
762
762
  "dependencies": {
763
- "@forge/cli-shared": "3.4.0-next.2",
763
+ "@forge/cli-shared": "3.4.0-next.4",
764
764
  "@forge/egress": "^1.1.1",
765
765
  "@forge/manifest": "4.5.2-next.0",
766
766
  "@typescript-eslint/typescript-estree": "^5.40.0",
@@ -7794,9 +7794,9 @@
7794
7794
  "integrity": "sha512-+GFtFqBhFzwKaKmeEfw1jWQgZJNX4q11CCx1fSPFJB49Fdjb7k3lx74jAyzHlX0UWnm6DMK+/cYT7j5t6G9LfA=="
7795
7795
  },
7796
7796
  "@forge/bundler": {
7797
- "version": "4.1.0-next.3",
7798
- "resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.1.0-next.3.tgz",
7799
- "integrity": "sha512-OhnIZTmkRWU+agMJz8D3XT1rDpZt64iWs6nq063mDjPk0t52T8fHal9ZjM2H0lnALvE5I+xSKGPKo0f9KRSznw==",
7797
+ "version": "4.1.0-next.6",
7798
+ "resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.1.0-next.6.tgz",
7799
+ "integrity": "sha512-m1imhBBAYGe6/z5wYp7WWmv+xKTxJbCRIRBq/C7I2iDpdgExRn1T7cIZWQpIFodthztd1XnglHrW6cZl+fV7LQ==",
7800
7800
  "requires": {
7801
7801
  "@babel/core": "^7.16.7",
7802
7802
  "@babel/plugin-proposal-class-properties": "^7.16.7",
@@ -7806,8 +7806,8 @@
7806
7806
  "@babel/preset-typescript": "^7.16.7",
7807
7807
  "@forge/api": "2.9.0-next.0",
7808
7808
  "@forge/babel-plugin-transform-ui": "1.1.0",
7809
- "@forge/cli-shared": "3.4.0-next.2",
7810
- "@forge/lint": "3.2.11-next.2",
7809
+ "@forge/cli-shared": "3.4.0-next.4",
7810
+ "@forge/lint": "3.2.11-next.4",
7811
7811
  "assert": "^1.1.1",
7812
7812
  "babel-loader": "^8.2.3",
7813
7813
  "browserify-zlib": "^0.2.0",
@@ -7851,9 +7851,9 @@
7851
7851
  }
7852
7852
  },
7853
7853
  "@forge/cli-shared": {
7854
- "version": "3.4.0-next.2",
7855
- "resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.4.0-next.2.tgz",
7856
- "integrity": "sha512-n1y+NafT2mKZVaclPcbkPA2+r2DqEtOO4P8jI5g3qykDVYy4plDR48UwIEtRr/o1Buz7c3jPIWEW/WEtuKclxg==",
7854
+ "version": "3.4.0-next.4",
7855
+ "resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.4.0-next.4.tgz",
7856
+ "integrity": "sha512-MX5eiBIluPeyQnfx2dAfxNtGPv13QeVaGd4NkxrLM7pVZGaEBNijzP9r//Ikp8Tt8jAoXqz616vCGs+YBPBfGA==",
7857
7857
  "requires": {
7858
7858
  "@forge/manifest": "4.5.2-next.0",
7859
7859
  "@forge/util": "1.2.0",
@@ -7896,11 +7896,11 @@
7896
7896
  }
7897
7897
  },
7898
7898
  "@forge/lint": {
7899
- "version": "3.2.11-next.2",
7900
- "resolved": "https://registry.npmjs.org/@forge/lint/-/lint-3.2.11-next.2.tgz",
7901
- "integrity": "sha512-ghLUd2lSdXgPFI0LIF/QZhDYR/bzi+bo8GXUW30OTuqtfdMs94+mmPOeCw44Y7FwlPNGpPqh/CEALzKj9ILqQg==",
7899
+ "version": "3.2.11-next.4",
7900
+ "resolved": "https://registry.npmjs.org/@forge/lint/-/lint-3.2.11-next.4.tgz",
7901
+ "integrity": "sha512-V8Jy9vLVEzw1oWSWmbwA1HXKYyZn5m8YLXGO9NL567jONm/t5CdDPRhqQu+6N13FgJMdz03b/n1IITDRBLM4EQ==",
7902
7902
  "requires": {
7903
- "@forge/cli-shared": "3.4.0-next.2",
7903
+ "@forge/cli-shared": "3.4.0-next.4",
7904
7904
  "@forge/egress": "^1.1.1",
7905
7905
  "@forge/manifest": "4.5.2-next.0",
7906
7906
  "@typescript-eslint/typescript-estree": "^5.40.0",
@@ -14,7 +14,7 @@ class PrerequisitesController {
14
14
  async check() {
15
15
  this.checkNodeVersion();
16
16
  await this.checkCustomWarning();
17
- const muaoEnabled = await this.checkMUAOEnabled();
17
+ const muaoEnabled = (await this.checkMUAOEnabled()) || process.env.ENABLE_MUAO === 'true';
18
18
  return {
19
19
  muaoEnabled
20
20
  };
@@ -6,6 +6,8 @@ import { ListEnvironmentVariablesCommand } from '../environment-variables/list-e
6
6
  import { SetEnvironmentVariableCommand } from '../environment-variables/set-environment-variable';
7
7
  import { ConfigureProviderCommand } from '../providers/configure-provider';
8
8
  import { AddContributorCommand } from '../contributors/add-contributor';
9
+ import { ListContributorsCommand } from '../contributors/list-contributors';
10
+ import { RemoveContributorsCommand } from '../contributors/remove-contributors';
9
11
  import { InstallAppSiteCommand } from '../installations/install-app-site';
10
12
  import { UninstallAppCommand } from '../installations/uninstall-app';
11
13
  import { InstallationService } from '../service/installation-service';
@@ -44,6 +46,8 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
44
46
  listEnvironmentVariablesCommand: ListEnvironmentVariablesCommand;
45
47
  configureProviderCommand: ConfigureProviderCommand;
46
48
  addContributorCommand: AddContributorCommand;
49
+ listContributorCommand: ListContributorsCommand;
50
+ removeContributorsCommand: RemoveContributorsCommand;
47
51
  viewAppLogsCommand: ViewAppLogsCommand;
48
52
  getWebTriggerURLCommand: GetWebTriggerURLCommand;
49
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAEA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,EAUlB,YAAY,EACZ,aAAa,EAOb,kBAAkB,EAIlB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAML,0BAA0B,EAG3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AAExG,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAIlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAQtE,OAAO,EAAE,oBAAoB,E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MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAWlE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAIhF,eAAO,MAAM,eAAe,eAAsB,UAAU,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0QvE,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC3D,oBAAY,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
@@ -15,6 +15,8 @@ const graphql_client_2 = require("../migration-keys/graphql-client");
15
15
  const configure_provider_1 = require("../providers/configure-provider");
16
16
  const graphql_client_3 = require("../providers/graphql-client");
17
17
  const add_contributor_1 = require("../contributors/add-contributor");
18
+ const list_contributors_1 = require("../contributors/list-contributors");
19
+ const remove_contributors_1 = require("../contributors/remove-contributors");
18
20
  const graphql_client_4 = require("../contributors/graphql-client");
19
21
  const graphql_client_5 = require("../installations/graphql-client");
20
22
  const site_translation_1 = require("../installations/site-translation");
@@ -109,6 +111,8 @@ const getDependencies = async (cliDetails) => {
109
111
  const configureProviderCommand = new configure_provider_1.ConfigureProviderCommand(providerClient, assertiveAppConfigReader);
110
112
  const contributorClient = new graphql_client_4.GraphqlClient(graphQLClient);
111
113
  const addContributorCommand = new add_contributor_1.AddContributorCommand(contributorClient, assertiveAppConfigReader);
114
+ const listContributorCommand = new list_contributors_1.ListContributorsCommand(contributorClient, assertiveAppConfigReader);
115
+ const removeContributorsCommand = new remove_contributors_1.RemoveContributorsCommand(contributorClient, assertiveAppConfigReader);
112
116
  const migrationKeysClient = new graphql_client_2.GraphqlClient(graphQLClient);
113
117
  const migrationKeysService = new migration_keys_service_1.MigrationKeysService(migrationKeysClient, assertiveAppConfigReader);
114
118
  const appEnvironmentClient = new cli_shared_1.AppEnvironmentsGraphqlClient(graphQLClient);
@@ -177,6 +181,8 @@ const getDependencies = async (cliDetails) => {
177
181
  listEnvironmentVariablesCommand,
178
182
  configureProviderCommand,
179
183
  addContributorCommand,
184
+ listContributorCommand,
185
+ removeContributorsCommand,
180
186
  viewAppLogsCommand,
181
187
  getWebTriggerURLCommand
182
188
  },
@@ -64,7 +64,7 @@ const main = async () => {
64
64
  (0, exports.registerCommands)(deps, cliDetails);
65
65
  registerEvents(deps);
66
66
  const checkResult = await deps.controllers.prerequisitesController.check();
67
- if (checkResult.muaoEnabled || process.env.ENABLE_MUAO === 'true') {
67
+ if (checkResult.muaoEnabled) {
68
68
  (0, register_contributors_commands_1.registerCommands)(deps);
69
69
  sortCommands(deps.cmd);
70
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"register-contributors-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-contributors-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA6CtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAErD,CAAC"}
1
+ {"version":3,"file":"register-contributors-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-contributors-commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA6KtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAOrD,CAAC"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerCommands = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const cli_shared_1 = require("@forge/cli-shared");
5
- const registerAddContributorCommand = ({ cmd, ui, commands: { addContributorCommand } }) => {
6
- cmd
7
- .command('contributors')
8
- .description(cli_shared_1.Text.contributors.desc)
6
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const COMMAND_NAME = 'contributors';
8
+ const registerAddContributorCommand = (parent, { ui, commands: { addContributorCommand } }) => {
9
+ parent
9
10
  .command('add')
10
11
  .requireAppId()
11
12
  .description(cli_shared_1.Text.addContributor.cmd.desc)
@@ -37,7 +38,97 @@ const registerAddContributorCommand = ({ cmd, ui, commands: { addContributorComm
37
38
  }
38
39
  });
39
40
  };
41
+ const registerListContributorsCommand = (parent, { ui, commands: { listContributorCommand } }) => {
42
+ parent
43
+ .command('list')
44
+ .requireAppId()
45
+ .description(cli_shared_1.Text.listContributors.cmd.desc)
46
+ .action(async () => {
47
+ const contributors = await listContributorCommand.execute();
48
+ ui.table([
49
+ ['name', 'Name'],
50
+ ['email', 'Email']
51
+ ], contributors.map((contributor) => {
52
+ var _a;
53
+ const name = [contributor.publicName];
54
+ if (contributor.isOwner) {
55
+ name.push(cli_shared_1.Text.listContributors.appOwner);
56
+ }
57
+ if (contributor.accountStatus !== 'active') {
58
+ name.push(cli_shared_1.Text.listContributors.userInactive);
59
+ }
60
+ return {
61
+ name: name.join(' '),
62
+ email: (_a = contributor.email) !== null && _a !== void 0 ? _a : 'Email Not Visible'
63
+ };
64
+ }), {
65
+ emptyMessage: cli_shared_1.Text.listContributors.noContributors,
66
+ preMessage: cli_shared_1.Text.listContributors.banner
67
+ });
68
+ });
69
+ };
70
+ const registerRemoveContributorsCommand = (parent, { ui, commands: { listContributorCommand, removeContributorsCommand } }) => {
71
+ parent
72
+ .command('remove')
73
+ .requireAppId()
74
+ .description(cli_shared_1.Text.removeContributors.cmd.desc)
75
+ .option('-u, --email [emails...]', cli_shared_1.Text.removeContributors.optionContributorEmail)
76
+ .option('--confirm-remove-contributors', cli_shared_1.Text.removeContributors.optionSkipConfirmation)
77
+ .nonInteractiveOption('--email')
78
+ .action(async ({ email, confirmRemoveContributors, nonInteractive }) => {
79
+ let accountIds;
80
+ let accountReferences = email;
81
+ if (!email) {
82
+ const contributors = await listContributorCommand.execute();
83
+ const nonOwners = contributors.filter((contributor) => !contributor.isOwner);
84
+ if (nonOwners.length === 0) {
85
+ ui.info(cli_shared_1.Text.removeContributors.addContributorMessage);
86
+ ui.emptyLine();
87
+ return;
88
+ }
89
+ const selectedContributorsIndexes = await ui.promptForTable(cli_shared_1.Text.removeContributors.promptContributorEmail, cli_shared_1.Text.removeContributors.overview, ['Name', 'Email'], nonOwners.map((contributor) => {
90
+ var _a;
91
+ const name = [contributor.publicName];
92
+ if (contributor.accountStatus !== 'active') {
93
+ name.push(cli_shared_1.Text.listContributors.userInactive);
94
+ }
95
+ return {
96
+ names: [name.join(' '), (_a = contributor.email) !== null && _a !== void 0 ? _a : 'Email Not Visible'],
97
+ value: contributor.accountId
98
+ };
99
+ }));
100
+ accountIds = selectedContributorsIndexes.map((index) => nonOwners[index].accountId);
101
+ accountReferences = selectedContributorsIndexes.map((index) => nonOwners[index].publicName);
102
+ }
103
+ if (!accountReferences) {
104
+ return;
105
+ }
106
+ if (nonInteractive) {
107
+ confirmRemoveContributors = true;
108
+ }
109
+ if (!confirmRemoveContributors) {
110
+ ui.info(cli_shared_1.Text.removeContributors.confirmationInfo);
111
+ ui.emptyLine();
112
+ accountReferences.forEach((name) => {
113
+ ui.info(chalk_1.default.grey(name));
114
+ });
115
+ ui.emptyLine();
116
+ confirmRemoveContributors = await ui.confirm(cli_shared_1.Text.removeContributors.promptConfirmation);
117
+ if (confirmRemoveContributors)
118
+ ui.emptyLine();
119
+ }
120
+ if (confirmRemoveContributors) {
121
+ await ui.displayProgress(() => removeContributorsCommand.execute({ emails: email, accountIds }), cli_shared_1.Text.removeContributors.cmd.start, cli_shared_1.Text.removeContributors.cmd.success);
122
+ ui.emptyLine();
123
+ ui.info(cli_shared_1.Text.removeContributors.commandSuccessMessage(accountReferences));
124
+ }
125
+ });
126
+ };
40
127
  const registerCommands = (deps) => {
41
- registerAddContributorCommand(deps);
128
+ const { cmd } = deps;
129
+ const contributors = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.contributors.desc);
130
+ registerAddContributorCommand(contributors, deps);
131
+ registerListContributorsCommand(contributors, deps);
132
+ registerRemoveContributorsCommand(contributors, deps);
42
133
  };
43
134
  exports.registerCommands = registerCommands;
@@ -1,8 +1,14 @@
1
1
  import { GraphQLClient } from '@forge/cli-shared';
2
2
  import { AppContributorDetails, AddContributorClient } from './add-contributor';
3
- export declare class GraphqlClient implements AddContributorClient {
3
+ import { Contributor, ListContributorsClient } from './list-contributors';
4
+ import { RemoveContributorsDetails, RemoveContributorsClient } from './remove-contributors';
5
+ export declare class MissingAppContributors extends Error {
6
+ }
7
+ export declare class GraphqlClient implements AddContributorClient, ListContributorsClient, RemoveContributorsClient {
4
8
  private readonly graphqlClient;
5
9
  constructor(graphqlClient: GraphQLClient);
6
10
  addContributor(details: AppContributorDetails): Promise<void>;
11
+ listContributors(appId: string): Promise<Contributor[]>;
12
+ removeContributors(details: RemoveContributorsDetails): Promise<void>;
7
13
  }
8
14
  //# sourceMappingURL=graphql-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/contributors/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,aAAa,EAAwB,MAAM,mBAAmB,CAAC;AAEtG,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,qBAAa,aAAc,YAAW,oBAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,cAAc,CAAC,OAAO,EAAE,qBAAqB;CA2C3D"}
1
+ {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/contributors/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EAGd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AACpD,qBAAa,aAAc,YAAW,oBAAoB,EAAE,sBAAsB,EAAE,wBAAwB;IAC9F,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,cAAc,CAAC,OAAO,EAAE,qBAAqB;IAgD7C,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA8BvD,kBAAkB,CAAC,OAAO,EAAE,yBAAyB;CA+CnE"}
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GraphqlClient = void 0;
3
+ exports.GraphqlClient = exports.MissingAppContributors = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
+ class MissingAppContributors extends Error {
6
+ }
7
+ exports.MissingAppContributors = MissingAppContributors;
5
8
  class GraphqlClient {
6
9
  constructor(graphqlClient) {
7
10
  this.graphqlClient = graphqlClient;
@@ -36,7 +39,66 @@ class GraphqlClient {
36
39
  const { success, errors } = addAppContributor;
37
40
  const error = (0, cli_shared_1.getError)(errors);
38
41
  if (!success) {
39
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code);
42
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
43
+ }
44
+ }
45
+ async listContributors(appId) {
46
+ const query = `
47
+ query forge_cli_listContributors($id: ID!) {
48
+ appContributors(id: $id) {
49
+ accountId
50
+ email
51
+ status
52
+ isOwner
53
+ publicName
54
+ }
55
+ }
56
+ `;
57
+ const { appContributors } = await this.graphqlClient.query(query, {
58
+ id: appId
59
+ });
60
+ if (!appContributors) {
61
+ throw new MissingAppContributors(cli_shared_1.Text.listContributors.missingAppContributors);
62
+ }
63
+ return appContributors.map((contributor) => ({
64
+ accountId: contributor.accountId,
65
+ email: contributor.email,
66
+ isOwner: contributor.isOwner,
67
+ publicName: contributor.publicName,
68
+ accountStatus: contributor.status
69
+ }));
70
+ }
71
+ async removeContributors(details) {
72
+ const mutation = `
73
+ mutation forge_cli_removeContributors($input: RemoveAppContributorsInput!) {
74
+ ecosystem {
75
+ removeAppContributors(input: $input) {
76
+ success
77
+ errors {
78
+ message
79
+ extensions {
80
+ errorType
81
+ statusCode
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ `;
88
+ const { response: { ecosystem: { removeAppContributors } }, requestId } = await this.graphqlClient.mutate(mutation, {
89
+ input: {
90
+ appId: details.appId,
91
+ emails: details.emails,
92
+ accountIds: details.accountIds
93
+ }
94
+ });
95
+ if (!removeAppContributors) {
96
+ throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`);
97
+ }
98
+ const { success, errors } = removeAppContributors;
99
+ const error = (0, cli_shared_1.getError)(errors);
100
+ if (!success) {
101
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
40
102
  }
41
103
  }
42
104
  }
@@ -0,0 +1,18 @@
1
+ import { AppConfigProvider } from '@forge/cli-shared';
2
+ export interface Contributor {
3
+ accountId: string;
4
+ email?: string | null;
5
+ accountStatus: string;
6
+ publicName: string;
7
+ isOwner?: boolean | null;
8
+ }
9
+ export interface ListContributorsClient {
10
+ listContributors(appId: string): Promise<Contributor[]>;
11
+ }
12
+ export declare class ListContributorsCommand {
13
+ private readonly client;
14
+ private readonly getAppConfig;
15
+ constructor(client: ListContributorsClient, getAppConfig: AppConfigProvider);
16
+ execute(): Promise<Contributor[]>;
17
+ }
18
+ //# sourceMappingURL=list-contributors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-contributors.d.ts","sourceRoot":"","sources":["../../src/contributors/list-contributors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CACzD;AAED,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAA0B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAA7D,MAAM,EAAE,sBAAsB,EAAmB,YAAY,EAAE,iBAAiB;IAEhG,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAI/C"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListContributorsCommand = void 0;
4
+ class ListContributorsCommand {
5
+ constructor(client, getAppConfig) {
6
+ this.client = client;
7
+ this.getAppConfig = getAppConfig;
8
+ }
9
+ async execute() {
10
+ const { id: appId } = await this.getAppConfig();
11
+ return await this.client.listContributors(appId);
12
+ }
13
+ }
14
+ exports.ListContributorsCommand = ListContributorsCommand;
@@ -0,0 +1,18 @@
1
+ import { AppConfigProvider } from '@forge/cli-shared';
2
+ export interface ContributorDetails {
3
+ emails?: string[];
4
+ accountIds?: string[];
5
+ }
6
+ export interface RemoveContributorsDetails extends ContributorDetails {
7
+ appId: string;
8
+ }
9
+ export interface RemoveContributorsClient {
10
+ removeContributors(details: RemoveContributorsDetails): Promise<void>;
11
+ }
12
+ export declare class RemoveContributorsCommand {
13
+ private readonly client;
14
+ private readonly getAppConfig;
15
+ constructor(client: RemoveContributorsClient, getAppConfig: AppConfigProvider);
16
+ execute(details: ContributorDetails): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=remove-contributors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-contributors.d.ts","sourceRoot":"","sources":["../../src/contributors/remove-contributors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,qBAAa,yBAAyB;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAA4B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAA/D,MAAM,EAAE,wBAAwB,EAAmB,YAAY,EAAE,iBAAiB;IAElG,OAAO,CAAC,OAAO,EAAE,kBAAkB;CAOjD"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RemoveContributorsCommand = void 0;
4
+ class RemoveContributorsCommand {
5
+ constructor(client, getAppConfig) {
6
+ this.client = client;
7
+ this.getAppConfig = getAppConfig;
8
+ }
9
+ async execute(details) {
10
+ const { id: appId } = await this.getAppConfig();
11
+ await this.client.removeContributors(Object.assign(Object.assign({}, details), { appId }));
12
+ }
13
+ }
14
+ exports.RemoveContributorsCommand = RemoveContributorsCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/cli",
3
- "version": "6.3.0-next.4",
3
+ "version": "6.3.0-next.7",
4
4
  "description": "A command line interface for managing Atlassian-hosted apps",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -18,10 +18,10 @@
18
18
  "postinstall": "node -e \"process.exitCode = fs.existsSync('./out/bin/postinstall.js')\" || node ./out/bin/postinstall.js"
19
19
  },
20
20
  "dependencies": {
21
- "@forge/bundler": "4.1.0-next.3",
22
- "@forge/cli-shared": "3.4.0-next.2",
21
+ "@forge/bundler": "4.1.0-next.6",
22
+ "@forge/cli-shared": "3.4.0-next.4",
23
23
  "@forge/egress": "^1.1.1",
24
- "@forge/lint": "3.2.11-next.2",
24
+ "@forge/lint": "3.2.11-next.4",
25
25
  "@forge/manifest": "4.5.2-next.0",
26
26
  "@forge/util": "1.2.0",
27
27
  "ajv": "^6.12.5",