@forge/cli 6.3.0-next.6 → 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,18 @@
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
+
3
16
  ## 6.3.0-next.6
4
17
 
5
18
  ### Minor Changes
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@forge/cli",
3
- "version": "6.3.0-next.6",
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.6",
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.5",
14
- "@forge/cli-shared": "3.4.0-next.3",
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.3",
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.5",
657
- "resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.1.0-next.5.tgz",
658
- "integrity": "sha512-UeVKEi2JJOkAgSznrrSA70k9ingKN45IogeKSTBdOHZ19NnN4K4zC4g6BZbeswRNnCX7m8EJzGldvvqROlukoQ==",
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.3",
669
- "@forge/lint": "3.2.11-next.3",
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.3",
715
- "resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.4.0-next.3.tgz",
716
- "integrity": "sha512-/OmyBPl7Fvdd+1yZ5jP2EYyFnzoUcPs7sheuHS6b/fsmr7Mgz/kTWTNMxhRDhO4OiZF/qKkaV2BRCzXPBl8awA==",
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.3",
760
- "resolved": "https://registry.npmjs.org/@forge/lint/-/lint-3.2.11-next.3.tgz",
761
- "integrity": "sha512-hwxOYgx5tdMds9o46Jb4/39c+7gLMdVV+DhQUHeOPwl20TVxq5t0PeK6eyDHjEwLRvPZHtZbb3Cf1XqDJhSmzg==",
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.3",
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.5",
7798
- "resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.1.0-next.5.tgz",
7799
- "integrity": "sha512-UeVKEi2JJOkAgSznrrSA70k9ingKN45IogeKSTBdOHZ19NnN4K4zC4g6BZbeswRNnCX7m8EJzGldvvqROlukoQ==",
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.3",
7810
- "@forge/lint": "3.2.11-next.3",
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.3",
7855
- "resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.4.0-next.3.tgz",
7856
- "integrity": "sha512-/OmyBPl7Fvdd+1yZ5jP2EYyFnzoUcPs7sheuHS6b/fsmr7Mgz/kTWTNMxhRDhO4OiZF/qKkaV2BRCzXPBl8awA==",
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.3",
7900
- "resolved": "https://registry.npmjs.org/@forge/lint/-/lint-3.2.11-next.3.tgz",
7901
- "integrity": "sha512-hwxOYgx5tdMds9o46Jb4/39c+7gLMdVV+DhQUHeOPwl20TVxq5t0PeK6eyDHjEwLRvPZHtZbb3Cf1XqDJhSmzg==",
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.3",
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
  };
@@ -7,6 +7,7 @@ import { SetEnvironmentVariableCommand } from '../environment-variables/set-envi
7
7
  import { ConfigureProviderCommand } from '../providers/configure-provider';
8
8
  import { AddContributorCommand } from '../contributors/add-contributor';
9
9
  import { ListContributorsCommand } from '../contributors/list-contributors';
10
+ import { RemoveContributorsCommand } from '../contributors/remove-contributors';
10
11
  import { InstallAppSiteCommand } from '../installations/install-app-site';
11
12
  import { UninstallAppCommand } from '../installations/uninstall-app';
12
13
  import { InstallationService } from '../service/installation-service';
@@ -46,6 +47,7 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
46
47
  configureProviderCommand: ConfigureProviderCommand;
47
48
  addContributorCommand: AddContributorCommand;
48
49
  listContributorCommand: ListContributorsCommand;
50
+ removeContributorsCommand: RemoveContributorsCommand;
49
51
  viewAppLogsCommand: ViewAppLogsCommand;
50
52
  getWebTriggerURLCommand: GetWebTriggerURLCommand;
51
53
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,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC3D,oBAAY,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
@@ -16,6 +16,7 @@ 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
18
  const list_contributors_1 = require("../contributors/list-contributors");
19
+ const remove_contributors_1 = require("../contributors/remove-contributors");
19
20
  const graphql_client_4 = require("../contributors/graphql-client");
20
21
  const graphql_client_5 = require("../installations/graphql-client");
21
22
  const site_translation_1 = require("../installations/site-translation");
@@ -111,6 +112,7 @@ const getDependencies = async (cliDetails) => {
111
112
  const contributorClient = new graphql_client_4.GraphqlClient(graphQLClient);
112
113
  const addContributorCommand = new add_contributor_1.AddContributorCommand(contributorClient, assertiveAppConfigReader);
113
114
  const listContributorCommand = new list_contributors_1.ListContributorsCommand(contributorClient, assertiveAppConfigReader);
115
+ const removeContributorsCommand = new remove_contributors_1.RemoveContributorsCommand(contributorClient, assertiveAppConfigReader);
114
116
  const migrationKeysClient = new graphql_client_2.GraphqlClient(graphQLClient);
115
117
  const migrationKeysService = new migration_keys_service_1.MigrationKeysService(migrationKeysClient, assertiveAppConfigReader);
116
118
  const appEnvironmentClient = new cli_shared_1.AppEnvironmentsGraphqlClient(graphQLClient);
@@ -180,6 +182,7 @@ const getDependencies = async (cliDetails) => {
180
182
  configureProviderCommand,
181
183
  addContributorCommand,
182
184
  listContributorCommand,
185
+ removeContributorsCommand,
183
186
  viewAppLogsCommand,
184
187
  getWebTriggerURLCommand
185
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;AAqFtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAMrD,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,7 +1,9 @@
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");
6
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
5
7
  const COMMAND_NAME = 'contributors';
6
8
  const registerAddContributorCommand = (parent, { ui, commands: { addContributorCommand } }) => {
7
9
  parent
@@ -65,10 +67,68 @@ const registerListContributorsCommand = (parent, { ui, commands: { listContribut
65
67
  });
66
68
  });
67
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
+ };
68
127
  const registerCommands = (deps) => {
69
128
  const { cmd } = deps;
70
129
  const contributors = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.contributors.desc);
71
130
  registerAddContributorCommand(contributors, deps);
72
131
  registerListContributorsCommand(contributors, deps);
132
+ registerRemoveContributorsCommand(contributors, deps);
73
133
  };
74
134
  exports.registerCommands = registerCommands;
@@ -1,12 +1,14 @@
1
1
  import { GraphQLClient } from '@forge/cli-shared';
2
2
  import { AppContributorDetails, AddContributorClient } from './add-contributor';
3
3
  import { Contributor, ListContributorsClient } from './list-contributors';
4
+ import { RemoveContributorsDetails, RemoveContributorsClient } from './remove-contributors';
4
5
  export declare class MissingAppContributors extends Error {
5
6
  }
6
- export declare class GraphqlClient implements AddContributorClient, ListContributorsClient {
7
+ export declare class GraphqlClient implements AddContributorClient, ListContributorsClient, RemoveContributorsClient {
7
8
  private readonly graphqlClient;
8
9
  constructor(graphqlClient: GraphQLClient);
9
10
  addContributor(details: AppContributorDetails): Promise<void>;
10
11
  listContributors(appId: string): Promise<Contributor[]>;
12
+ removeContributors(details: RemoveContributorsDetails): Promise<void>;
11
13
  }
12
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,EAA8B,MAAM,mBAAmB,CAAC;AAE5G,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE1E,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AACpD,qBAAa,aAAc,YAAW,oBAAoB,EAAE,sBAAsB;IACpE,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,cAAc,CAAC,OAAO,EAAE,qBAAqB;IA4C7C,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CA6BrE"}
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"}
@@ -39,7 +39,7 @@ class GraphqlClient {
39
39
  const { success, errors } = addAppContributor;
40
40
  const error = (0, cli_shared_1.getError)(errors);
41
41
  if (!success) {
42
- 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
43
  }
44
44
  }
45
45
  async listContributors(appId) {
@@ -68,5 +68,38 @@ class GraphqlClient {
68
68
  accountStatus: contributor.status
69
69
  }));
70
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);
102
+ }
103
+ }
71
104
  }
72
105
  exports.GraphqlClient = GraphqlClient;
@@ -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.6",
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.5",
22
- "@forge/cli-shared": "3.4.0-next.3",
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.3",
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",