@forge/cli 6.17.1-next.8 → 6.18.0-next.34

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 (31) hide show
  1. package/CHANGELOG.md +328 -0
  2. package/npm-shrinkwrap.json +178 -196
  3. package/out/autocomplete/autocomplete-config.json +3 -8
  4. package/out/command-line/dependency-injection.d.ts +0 -6
  5. package/out/command-line/dependency-injection.d.ts.map +1 -1
  6. package/out/command-line/dependency-injection.js +8 -19
  7. package/out/command-line/index.d.ts.map +1 -1
  8. package/out/command-line/index.js +0 -2
  9. package/out/command-line/register-tunnel-commands.d.ts.map +1 -1
  10. package/out/command-line/register-tunnel-commands.js +1 -0
  11. package/out/service/lint-service.d.ts +1 -1
  12. package/out/service/lint-service.d.ts.map +1 -1
  13. package/out/service/tunnel-service.d.ts +3 -1
  14. package/out/service/tunnel-service.d.ts.map +1 -1
  15. package/out/service/tunnel-service.js +16 -5
  16. package/package.json +23 -23
  17. package/out/command-line/register-contributors-commands.d.ts +0 -3
  18. package/out/command-line/register-contributors-commands.d.ts.map +0 -1
  19. package/out/command-line/register-contributors-commands.js +0 -137
  20. package/out/contributors/add-contributor.d.ts +0 -17
  21. package/out/contributors/add-contributor.d.ts.map +0 -1
  22. package/out/contributors/add-contributor.js +0 -14
  23. package/out/contributors/graphql-client.d.ts +0 -12
  24. package/out/contributors/graphql-client.d.ts.map +0 -1
  25. package/out/contributors/graphql-client.js +0 -121
  26. package/out/contributors/list-contributors.d.ts +0 -18
  27. package/out/contributors/list-contributors.d.ts.map +0 -1
  28. package/out/contributors/list-contributors.js +0 -14
  29. package/out/contributors/remove-contributors.d.ts +0 -18
  30. package/out/contributors/remove-contributors.d.ts.map +0 -1
  31. package/out/contributors/remove-contributors.js +0 -14
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GraphqlClient = void 0;
4
- const cli_shared_1 = require("@forge/cli-shared");
5
- class GraphqlClient {
6
- constructor(graphqlClient) {
7
- this.graphqlClient = graphqlClient;
8
- }
9
- async addContributor(details) {
10
- const mutation = `
11
- mutation forge_cli_addContributor($input: AddAppContributorInput!) {
12
- ecosystem {
13
- addAppContributor(input: $input) {
14
- success
15
- errors {
16
- message
17
- extensions {
18
- errorType
19
- statusCode
20
- }
21
- }
22
- }
23
- }
24
- }
25
- `;
26
- const { response: { ecosystem: { addAppContributor } }, requestId } = await this.graphqlClient.mutate(mutation, {
27
- input: {
28
- appId: details.appId,
29
- newContributorEmail: details.email,
30
- role: cli_shared_1.AppContributorRole.Admin
31
- }
32
- });
33
- if (!addAppContributor) {
34
- throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
35
- }
36
- const { success, errors } = addAppContributor;
37
- const error = (0, cli_shared_1.getError)(errors);
38
- if (!success) {
39
- if (error.code === cli_shared_1.APP_NOT_IN_EAP) {
40
- throw new cli_shared_1.AppNotInMUAOEAPError(requestId);
41
- }
42
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
43
- requestId,
44
- code: error.code,
45
- statusCode: error.statusCode
46
- });
47
- }
48
- }
49
- async listContributors(appId) {
50
- const query = `
51
- query forge_cli_listContributors($id: ID!) {
52
- appContributors(id: $id) {
53
- accountId
54
- email
55
- status
56
- isOwner
57
- publicName
58
- }
59
- }
60
- `;
61
- try {
62
- const { appContributors } = await this.graphqlClient.query(query, {
63
- id: appId
64
- });
65
- return appContributors.map((contributor) => ({
66
- accountId: contributor.accountId,
67
- email: contributor.email,
68
- isOwner: contributor.isOwner,
69
- publicName: contributor.publicName,
70
- accountStatus: contributor.status
71
- }));
72
- }
73
- catch (e) {
74
- if (e instanceof cli_shared_1.GraphQLProviderServiceError && e.getCode() === cli_shared_1.APP_NOT_IN_EAP) {
75
- throw new cli_shared_1.AppNotInMUAOEAPError(e.requestId);
76
- }
77
- throw e;
78
- }
79
- }
80
- async removeContributors(details) {
81
- const mutation = `
82
- mutation forge_cli_removeContributors($input: RemoveAppContributorsInput!) {
83
- ecosystem {
84
- removeAppContributors(input: $input) {
85
- success
86
- errors {
87
- message
88
- extensions {
89
- errorType
90
- statusCode
91
- }
92
- }
93
- }
94
- }
95
- }
96
- `;
97
- const { response: { ecosystem: { removeAppContributors } }, requestId } = await this.graphqlClient.mutate(mutation, {
98
- input: {
99
- appId: details.appId,
100
- emails: details.emails,
101
- accountIds: details.accountIds
102
- }
103
- });
104
- if (!removeAppContributors) {
105
- throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
106
- }
107
- const { success, errors } = removeAppContributors;
108
- const error = (0, cli_shared_1.getError)(errors);
109
- if (!success) {
110
- if (error.code === cli_shared_1.APP_NOT_IN_EAP) {
111
- throw new cli_shared_1.AppNotInMUAOEAPError(requestId);
112
- }
113
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
114
- requestId,
115
- code: error.code,
116
- statusCode: error.statusCode
117
- });
118
- }
119
- }
120
- }
121
- exports.GraphqlClient = GraphqlClient;
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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;IAEhC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,sBAAsB,EAC9B,YAAY,EAAE,iBAAiB;IAGrC,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAI/C"}
@@ -1,14 +0,0 @@
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;
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,wBAAwB,EAChC,YAAY,EAAE,iBAAiB;IAGrC,OAAO,CAAC,OAAO,EAAE,kBAAkB;CAOjD"}
@@ -1,14 +0,0 @@
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;