@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.
- package/CHANGELOG.md +328 -0
- package/npm-shrinkwrap.json +178 -196
- package/out/autocomplete/autocomplete-config.json +3 -8
- package/out/command-line/dependency-injection.d.ts +0 -6
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +8 -19
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +0 -2
- package/out/command-line/register-tunnel-commands.d.ts.map +1 -1
- package/out/command-line/register-tunnel-commands.js +1 -0
- package/out/service/lint-service.d.ts +1 -1
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/tunnel-service.d.ts +3 -1
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +16 -5
- package/package.json +23 -23
- package/out/command-line/register-contributors-commands.d.ts +0 -3
- package/out/command-line/register-contributors-commands.d.ts.map +0 -1
- package/out/command-line/register-contributors-commands.js +0 -137
- package/out/contributors/add-contributor.d.ts +0 -17
- package/out/contributors/add-contributor.d.ts.map +0 -1
- package/out/contributors/add-contributor.js +0 -14
- package/out/contributors/graphql-client.d.ts +0 -12
- package/out/contributors/graphql-client.d.ts.map +0 -1
- package/out/contributors/graphql-client.js +0 -121
- package/out/contributors/list-contributors.d.ts +0 -18
- package/out/contributors/list-contributors.d.ts.map +0 -1
- package/out/contributors/list-contributors.js +0 -14
- package/out/contributors/remove-contributors.d.ts +0 -18
- package/out/contributors/remove-contributors.d.ts.map +0 -1
- package/out/contributors/remove-contributors.js +0 -14
|
@@ -63,14 +63,6 @@
|
|
|
63
63
|
"requireUserArg": false
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"contributors": {
|
|
67
|
-
"--verbose": {
|
|
68
|
-
"requireUserArg": false
|
|
69
|
-
},
|
|
70
|
-
"--help": {
|
|
71
|
-
"requireUserArg": false
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
66
|
"deploy": {
|
|
75
67
|
"--verbose": {
|
|
76
68
|
"requireUserArg": false
|
|
@@ -185,6 +177,9 @@
|
|
|
185
177
|
"--debug": {
|
|
186
178
|
"requireUserArg": false
|
|
187
179
|
},
|
|
180
|
+
"--ngrok-config": {
|
|
181
|
+
"requireUserArg": true
|
|
182
|
+
},
|
|
188
183
|
"--help": {
|
|
189
184
|
"requireUserArg": false
|
|
190
185
|
}
|
|
@@ -5,9 +5,6 @@ import { DeleteEnvironmentVariableCommand } from '../environment-variables/delet
|
|
|
5
5
|
import { ListEnvironmentVariablesCommand } from '../environment-variables/list-environment-variables';
|
|
6
6
|
import { SetEnvironmentVariableCommand } from '../environment-variables/set-environment-variable';
|
|
7
7
|
import { ConfigureProviderCommand } from '../providers/configure-provider';
|
|
8
|
-
import { AddContributorCommand } from '../contributors/add-contributor';
|
|
9
|
-
import { ListContributorsCommand } from '../contributors/list-contributors';
|
|
10
|
-
import { RemoveContributorsCommand } from '../contributors/remove-contributors';
|
|
11
8
|
import { ListEntitiesIndexesCommand } from '../entities/list-indexes';
|
|
12
9
|
import { CreateEnvironmentCommand } from '../environment/create-environment';
|
|
13
10
|
import { ListEnvironmentCommand } from '../environment/list-environment';
|
|
@@ -53,9 +50,6 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
|
|
|
53
50
|
deleteEnvironmentVariableCommand: DeleteEnvironmentVariableCommand;
|
|
54
51
|
listEnvironmentVariablesCommand: ListEnvironmentVariablesCommand;
|
|
55
52
|
configureProviderCommand: ConfigureProviderCommand;
|
|
56
|
-
addContributorCommand: AddContributorCommand;
|
|
57
|
-
listContributorCommand: ListContributorsCommand;
|
|
58
|
-
removeContributorsCommand: RemoveContributorsCommand;
|
|
59
53
|
createEnvironmentCommand: CreateEnvironmentCommand;
|
|
60
54
|
listEnvironmentCommand: ListEnvironmentCommand;
|
|
61
55
|
deleteEnvironmentCommand: DeleteEnvironmentCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,EAGlB,gBAAgB,EAQhB,YAAY,EACZ,aAAa,EAOb,kBAAkB,EAIlB,kBAAkB,EAGnB,MAAM,mBAAmB,CAAC;AAc3B,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,
|
|
1
|
+
{"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,EAGlB,gBAAgB,EAQhB,YAAY,EACZ,aAAa,EAOb,kBAAkB,EAIlB,kBAAkB,EAGnB,MAAM,mBAAmB,CAAC;AAc3B,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,0BAA0B,E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AU,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuVvE,CAAC;AAGF,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -17,17 +17,13 @@ const set_environment_variable_1 = require("../environment-variables/set-environ
|
|
|
17
17
|
const graphql_client_2 = require("../migration-keys/graphql-client");
|
|
18
18
|
const configure_provider_1 = require("../providers/configure-provider");
|
|
19
19
|
const graphql_client_3 = require("../providers/graphql-client");
|
|
20
|
-
const add_contributor_1 = require("../contributors/add-contributor");
|
|
21
|
-
const list_contributors_1 = require("../contributors/list-contributors");
|
|
22
|
-
const remove_contributors_1 = require("../contributors/remove-contributors");
|
|
23
|
-
const graphql_client_4 = require("../contributors/graphql-client");
|
|
24
20
|
const list_indexes_1 = require("../entities/list-indexes");
|
|
25
|
-
const
|
|
21
|
+
const graphql_client_4 = require("../entities/graphql-client");
|
|
26
22
|
const create_environment_1 = require("../environment/create-environment");
|
|
27
23
|
const list_environment_1 = require("../environment/list-environment");
|
|
28
24
|
const delete_environment_1 = require("../environment/delete-environment");
|
|
29
|
-
const
|
|
30
|
-
const
|
|
25
|
+
const graphql_client_5 = require("../environment/graphql-client");
|
|
26
|
+
const graphql_client_6 = require("../installations/graphql-client");
|
|
31
27
|
const site_translation_1 = require("../installations/site-translation");
|
|
32
28
|
const install_app_site_1 = require("../installations/install-app-site");
|
|
33
29
|
const uninstall_app_1 = require("../installations/uninstall-app");
|
|
@@ -63,7 +59,7 @@ const lint_view_1 = require("./view/lint-view");
|
|
|
63
59
|
const lite_lint_view_1 = require("./view/lite-lint-view");
|
|
64
60
|
const settings_view_1 = require("./view/settings-view");
|
|
65
61
|
const tunnel_view_1 = require("./view/tunnel-view");
|
|
66
|
-
const
|
|
62
|
+
const graphql_client_7 = require("../webtrigger/graphql-client");
|
|
67
63
|
const stubController_1 = require("./controller/stubController");
|
|
68
64
|
const prerequisites_controller_1 = require("./controller/prerequisites-controller");
|
|
69
65
|
const runtime_bundler_1 = require("../deploy/packager/runtime-bundler");
|
|
@@ -121,11 +117,7 @@ const getDependencies = async (cliDetails) => {
|
|
|
121
117
|
const listEnvironmentVariablesCommand = new list_environment_variables_1.ListEnvironmentVariablesCommand(environmentVariablesClient, assertiveAppConfigReader);
|
|
122
118
|
const providerClient = new graphql_client_3.GraphqlClient(graphQLClient);
|
|
123
119
|
const configureProviderCommand = new configure_provider_1.ConfigureProviderCommand(providerClient, assertiveAppConfigReader);
|
|
124
|
-
const
|
|
125
|
-
const addContributorCommand = new add_contributor_1.AddContributorCommand(contributorClient, assertiveAppConfigReader);
|
|
126
|
-
const listContributorCommand = new list_contributors_1.ListContributorsCommand(contributorClient, assertiveAppConfigReader);
|
|
127
|
-
const removeContributorsCommand = new remove_contributors_1.RemoveContributorsCommand(contributorClient, assertiveAppConfigReader);
|
|
128
|
-
const environmentClient = new graphql_client_6.GraphqlClient(graphQLClient);
|
|
120
|
+
const environmentClient = new graphql_client_5.GraphqlClient(graphQLClient);
|
|
129
121
|
const createEnvironmentCommand = new create_environment_1.CreateEnvironmentCommand(environmentClient, assertiveAppConfigReader);
|
|
130
122
|
const listEnvironmentCommand = new list_environment_1.ListEnvironmentCommand(environmentClient, assertiveAppConfigReader);
|
|
131
123
|
const deleteEnvironmentCommand = new delete_environment_1.DeleteEnvironmentCommand(environmentClient, assertiveAppConfigReader);
|
|
@@ -137,16 +129,16 @@ const getDependencies = async (cliDetails) => {
|
|
|
137
129
|
const logsClient = new cli_shared_1.LogsGraphQLClient(graphQLClient);
|
|
138
130
|
const viewAppLogsCommand = new cli_shared_1.ViewAppLogsCommand(assertiveAppConfigReader, appEnvironmentClient, globalEdgeClient, logsClient);
|
|
139
131
|
const appOauthClientGraphql = new cli_shared_1.AppOauthClientGraphqlClient(graphQLClient);
|
|
140
|
-
const entitiesClient = new
|
|
132
|
+
const entitiesClient = new graphql_client_4.EntitiesGraphqlClient(graphQLClient);
|
|
141
133
|
const customEntitiesService = new custom_entities_service_1.CustomEntitiesService(assertiveAppConfigReader, appOauthClientGraphql, entitiesClient);
|
|
142
134
|
const listEntitiesIndexesCommand = new list_indexes_1.ListEntitiesIndexesCommand(customEntitiesService);
|
|
143
135
|
const bitbucketTranslation = new site_translation_1.BitbucketTranslator();
|
|
144
136
|
const cloudProductTranslation = new site_translation_1.CloudIdTranslator(graphQLClient);
|
|
145
|
-
const installationsClient = new
|
|
137
|
+
const installationsClient = new graphql_client_6.InstallationsGraphqlClient(graphQLClient, cloudProductTranslation, bitbucketTranslation, cli_shared_1.pause);
|
|
146
138
|
const installAppSiteCommand = new install_app_site_1.InstallAppSiteCommand(assertiveAppConfigReader, installationsClient);
|
|
147
139
|
const uninstallAppCommand = new uninstall_app_1.UninstallAppCommand(assertiveAppConfigReader, installationsClient);
|
|
148
140
|
const deployMonitorClient = new deploy_1.DeployMonitorGraphqlClient(graphQLClient);
|
|
149
|
-
const webTriggerGraphqlClient = new
|
|
141
|
+
const webTriggerGraphqlClient = new graphql_client_7.WebTriggerGraphQLClient(graphQLClient);
|
|
150
142
|
const archiverFactory = () => new deploy_1.ZipArchiver(ui);
|
|
151
143
|
const uploaderArtifactClient = new deploy_1.ArtifactGraphQLClient(graphQLClient);
|
|
152
144
|
const triggerDeployClient = new deploy_1.TriggerDeployGraphQLClient(graphQLClient);
|
|
@@ -214,9 +206,6 @@ const getDependencies = async (cliDetails) => {
|
|
|
214
206
|
deleteEnvironmentVariableCommand,
|
|
215
207
|
listEnvironmentVariablesCommand,
|
|
216
208
|
configureProviderCommand,
|
|
217
|
-
addContributorCommand,
|
|
218
|
-
listContributorCommand,
|
|
219
|
-
removeContributorsCommand,
|
|
220
209
|
createEnvironmentCommand,
|
|
221
210
|
listEnvironmentCommand,
|
|
222
211
|
deleteEnvironmentCommand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-line/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-line/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAmBvE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,QAgBlD;AAQD,eAAO,MAAM,IAAI,QAAa,QAAQ,IAAI,CAUzC,CAAC"}
|
|
@@ -17,14 +17,12 @@ const register_webtrigger_commands_1 = require("./register-webtrigger-commands")
|
|
|
17
17
|
const register_feedback_commands_1 = require("./register-feedback-commands");
|
|
18
18
|
const register_settings_commands_1 = require("./register-settings-commands");
|
|
19
19
|
const register_providers_commands_1 = require("./register-providers-commands");
|
|
20
|
-
const register_contributors_commands_1 = require("./register-contributors-commands");
|
|
21
20
|
const register_environments_commands_1 = require("./register-environments-commands");
|
|
22
21
|
const register_storage_commands_1 = require("./register-storage-commands");
|
|
23
22
|
function registerCommands(deps) {
|
|
24
23
|
(0, register_autocomplete_commands_1.registerCommands)(deps);
|
|
25
24
|
(0, register_authentication_command_1.registerCommands)(deps);
|
|
26
25
|
(0, register_app_commands_1.registerCommands)(deps);
|
|
27
|
-
(0, register_contributors_commands_1.registerCommands)(deps);
|
|
28
26
|
(0, register_deployment_commands_1.registerCommands)(deps);
|
|
29
27
|
(0, register_installation_commands_1.registerCommands)(deps);
|
|
30
28
|
(0, register_environments_commands_1.registerCommands)(deps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,mDAAoD,YAAY,KAAG,
|
|
1
|
+
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,mDAAoD,YAAY,KAAG,IAW/F,CAAC"}
|
|
@@ -9,6 +9,7 @@ const registerCommands = ({ cmd, ui, controllers: { tunnelController } }) => {
|
|
|
9
9
|
.description(cli_shared_1.Text.tunnel.cmd)
|
|
10
10
|
.environmentOption()
|
|
11
11
|
.option('-d, --debug', cli_shared_1.Text.tunnel.optionDebugger)
|
|
12
|
+
.option('-c, --ngrok-config <path>', cli_shared_1.Text.tunnel.optionNgrokConfig)
|
|
12
13
|
.action(async (options) => {
|
|
13
14
|
await tunnelController.run(options, ui);
|
|
14
15
|
});
|
|
@@ -13,7 +13,7 @@ export declare class LintService {
|
|
|
13
13
|
private readonly configFile;
|
|
14
14
|
private readonly fileSystemReader;
|
|
15
15
|
constructor(configFile: ConfigFile, fileSystemReader: FileSystemReader);
|
|
16
|
-
run(environment: string, { fix }: LintOptions, logger: LintLogger, directory?: string, lintFunction?: (filesToLint: string[], manifest: import("@forge/manifest").ManifestSchema, environment: string, logger: LintLogger, parseFunction?: ((filepath: string, parser: (code: string, filepath: string, parseOptions?: Partial<import("@forge/lint").ParseOptions> | undefined) => Promise<import("@forge/lint").ASTParseResult>, readFilePromise?: typeof import("fs").readFile.__promisify__ | undefined) => Promise<import("@forge/lint").LintInput>) | undefined, linters?: import("@forge/lint").LinterInterface[] | undefined) => Promise<LintResult[]>): Promise<RunResult>;
|
|
16
|
+
run(environment: string, { fix }: LintOptions, logger: LintLogger, directory?: string, lintFunction?: (filesToLint: string[], manifest: import("@forge/manifest").ManifestSchema, environment: string, logger: LintLogger, parseFunction?: ((filepath: string, parser: (code: string, filepath: string, parseOptions?: Partial<import("@forge/lint").ParseOptions> | undefined) => Promise<import("@forge/lint").ASTParseResult>, readFilePromise?: typeof import("node:fs").readFile.__promisify__ | undefined) => Promise<import("@forge/lint").LintInput>) | undefined, linters?: import("@forge/lint").LinterInterface[] | undefined) => Promise<LintResult[]>): Promise<RunResult>;
|
|
17
17
|
private fix;
|
|
18
18
|
problemCount(lintResults: LintResult[]): ProblemCount;
|
|
19
19
|
private failedScopesFromLintResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint-service.d.ts","sourceRoot":"","sources":["../../src/service/lint-service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAEL,YAAY,EACZ,UAAU,EAGV,UAAU,EACV,YAAY,EACb,MAAM,aAAa,CAAC;AAGrB,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,UAAU,SAAS;IACjB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,qBAAa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB;IAGxC,GAAG,CACd,WAAW,EAAE,MAAM,EACnB,EAAE,GAAG,EAAE,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,SAAS,SAAoB,EAC7B,YAAY,
|
|
1
|
+
{"version":3,"file":"lint-service.d.ts","sourceRoot":"","sources":["../../src/service/lint-service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAEL,YAAY,EACZ,UAAU,EAGV,UAAU,EACV,YAAY,EACb,MAAM,aAAa,CAAC;AAGrB,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,UAAU,SAAS;IACjB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,qBAAa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB;IAGxC,GAAG,CACd,WAAW,EAAE,MAAM,EACnB,EAAE,GAAG,EAAE,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,SAAS,SAAoB,EAC7B,YAAY,+hBAAO,GAClB,OAAO,CAAC,SAAS,CAAC;YA4BP,GAAG;IASV,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,YAAY;IAI5D,OAAO,CAAC,0BAA0B;IAI3B,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE;CAOzD"}
|
|
@@ -7,8 +7,9 @@ import { TunnelAnalyticsService } from './tunnel-analytics-service';
|
|
|
7
7
|
export interface TunnelOptions {
|
|
8
8
|
debug?: boolean;
|
|
9
9
|
environment?: string;
|
|
10
|
+
ngrokConfig?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare const CONTAINER_NAME
|
|
12
|
+
export declare const CONTAINER_NAME: string;
|
|
12
13
|
export declare const IMAGE_NAME: string;
|
|
13
14
|
export declare class HiddenDockerTunnelError extends HiddenError {
|
|
14
15
|
private readonly userError;
|
|
@@ -40,6 +41,7 @@ declare abstract class TunnelServiceBase implements TunnelService {
|
|
|
40
41
|
abstract run(tunnelOptions: TunnelOptions, creds: PersonalApiCredentialsValidated, debugEnabled: boolean, onError?: (err: Error) => Promise<void>): Promise<void>;
|
|
41
42
|
getTunnelProcessEnvironment(tunnelOptions: TunnelOptions, debugEnabled: boolean, { email, token }: PersonalApiCredentials, port: number, cspReporterPort: number | undefined, resourcePorts: Record<string, number>): Promise<EnvironmentVariable[]>;
|
|
42
43
|
private getInspectorPortEnvironment;
|
|
44
|
+
protected getNgrokConfigEnvironment(ngrokConfigPath: string | undefined): EnvironmentVariable[];
|
|
43
45
|
private getCspReporterPortEnvironment;
|
|
44
46
|
private getResourcePortEnvironment;
|
|
45
47
|
private getUserEnvironmentVariables;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-service.d.ts","sourceRoot":"","sources":["../../src/service/tunnel-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMpC,OAAO,EAIL,WAAW,EAEX,sBAAsB,EACtB,+BAA+B,EAG/B,EAAE,EACF,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"tunnel-service.d.ts","sourceRoot":"","sources":["../../src/service/tunnel-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMpC,OAAO,EAIL,WAAW,EAEX,sBAAsB,EACtB,+BAA+B,EAG/B,EAAE,EACF,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,E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CAUhC;AAED,qBAAa,mBAAoB,SAAQ,iBAAiB;IAGtD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAFjC,4BAA4B,EAAE,4BAA4B,EACzC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,sBAAsB;IAK9C,GAAG,CACd,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,+BAA+B,EACtC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,IAAI,CAAC;IAqDH,eAAe,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;YAKnD,qBAAqB;IAUnC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,gBAAgB;YAwBV,gBAAgB;CAO/B"}
|
|
@@ -10,7 +10,7 @@ const semver_1 = require("semver");
|
|
|
10
10
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
11
11
|
const version_info_1 = require("../command-line/version-info");
|
|
12
12
|
const DISABLE_TTY = process.env.DISABLE_TTY === 'true';
|
|
13
|
-
exports.CONTAINER_NAME =
|
|
13
|
+
exports.CONTAINER_NAME = `forge-tunnel-docker-${process.pid}`;
|
|
14
14
|
const cliDetails = (0, version_info_1.getCLIDetails)();
|
|
15
15
|
let versionTags;
|
|
16
16
|
if ((cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version) !== undefined) {
|
|
@@ -60,7 +60,8 @@ class InProcessTunnelService {
|
|
|
60
60
|
const tunnel = await this.startTunnelCommand.execute({
|
|
61
61
|
environmentKey: tunnelOptions.environment || process.env.ENVIRONMENT_KEY || 'default',
|
|
62
62
|
resourcePortMap,
|
|
63
|
-
host: 'localhost'
|
|
63
|
+
host: 'localhost',
|
|
64
|
+
ngrokConfig: tunnelOptions.ngrokConfig
|
|
64
65
|
});
|
|
65
66
|
const monitor = await this.tunnelInteractor.watchApp(tunnel);
|
|
66
67
|
await this.tunnelInteractor.handleUserExitEvent(tunnel.stopFunction, monitor);
|
|
@@ -97,7 +98,8 @@ class TunnelServiceBase {
|
|
|
97
98
|
...this.getInspectorPortEnvironment(port),
|
|
98
99
|
...this.getCspReporterPortEnvironment(cspReporterPort),
|
|
99
100
|
...this.getResourcePortEnvironment(resourcePorts),
|
|
100
|
-
...this.getUserEnvironmentVariables()
|
|
101
|
+
...this.getUserEnvironmentVariables(),
|
|
102
|
+
...this.getNgrokConfigEnvironment(tunnelOptions.ngrokConfig)
|
|
101
103
|
];
|
|
102
104
|
}
|
|
103
105
|
catch (e) {
|
|
@@ -107,6 +109,12 @@ class TunnelServiceBase {
|
|
|
107
109
|
getInspectorPortEnvironment(port) {
|
|
108
110
|
return [{ key: 'TUNNEL_INSPECTOR_PORT', value: port.toString() }];
|
|
109
111
|
}
|
|
112
|
+
getNgrokConfigEnvironment(ngrokConfigPath) {
|
|
113
|
+
if (ngrokConfigPath) {
|
|
114
|
+
return [{ key: 'NGROK_CONFIG', value: ngrokConfigPath }];
|
|
115
|
+
}
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
110
118
|
getCspReporterPortEnvironment(cspReporterPort) {
|
|
111
119
|
if (cspReporterPort) {
|
|
112
120
|
return [{ key: 'CSP_REPORTER_PORT', value: cspReporterPort.toString() }];
|
|
@@ -166,7 +174,7 @@ class DockerTunnelService extends TunnelServiceBase {
|
|
|
166
174
|
const environment = await this.getTunnelProcessEnvironment(tunnelOptions, debugEnabled, creds, port, cspReporterPort, resourcePorts);
|
|
167
175
|
const portOptions = this.getDockerPortOptions(port, resourcePorts, cspReporterPort);
|
|
168
176
|
const interactiveOptions = this.getInteractiveOptions();
|
|
169
|
-
const volumeOptions = this.getVolumeOptions();
|
|
177
|
+
const volumeOptions = this.getVolumeOptions(tunnelOptions);
|
|
170
178
|
const env = this.formatEnvForDocker(environment);
|
|
171
179
|
const docker = this.dockerService.runContainer([
|
|
172
180
|
...interactiveOptions,
|
|
@@ -228,7 +236,7 @@ class DockerTunnelService extends TunnelServiceBase {
|
|
|
228
236
|
}
|
|
229
237
|
return [`-it`];
|
|
230
238
|
}
|
|
231
|
-
getVolumeOptions() {
|
|
239
|
+
getVolumeOptions({ ngrokConfig }) {
|
|
232
240
|
const options = [`-v=${process.cwd()}:/app:cached`];
|
|
233
241
|
if (process.env.FORGE_DEV_DOCKER_TUNNEL) {
|
|
234
242
|
const monorepoRoot = (0, path_1.join)(__dirname, '../../../..');
|
|
@@ -241,6 +249,9 @@ class DockerTunnelService extends TunnelServiceBase {
|
|
|
241
249
|
options.push(`-v=${mount}:cached`);
|
|
242
250
|
});
|
|
243
251
|
}
|
|
252
|
+
if (ngrokConfig) {
|
|
253
|
+
options.push(`-v=${ngrokConfig}`);
|
|
254
|
+
}
|
|
244
255
|
return options;
|
|
245
256
|
}
|
|
246
257
|
async getDockerOptions() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0-next.34",
|
|
4
4
|
"description": "A command line interface for managing Atlassian-hosted apps",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"dev": "NODE_ENV=development ts-node src/bin/cli.ts",
|
|
16
16
|
"inspect": "node -r ts-node/register --inspect-brk src/bin/cli.ts",
|
|
17
17
|
"postbuild": "chmod +x out/bin/*.js && ts-node scripts/configureAutocomplete.ts",
|
|
18
|
-
"postinstall": "node -e \"
|
|
18
|
+
"postinstall": "node -e \"fs.existsSync('./out/bin/postinstall.js') && require('./out/bin/postinstall.js')\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@forge/bundler": "4.12.1-next.
|
|
22
|
-
"@forge/cli-shared": "3.
|
|
23
|
-
"@forge/egress": "1.2.5-next.
|
|
24
|
-
"@forge/lint": "3.6.7-next.
|
|
25
|
-
"@forge/manifest": "4.20.1-next.
|
|
26
|
-
"@forge/node-runtime": "0.
|
|
27
|
-
"@forge/runtime": "5.0
|
|
28
|
-
"@forge/tunnel": "3.
|
|
21
|
+
"@forge/bundler": "4.12.1-next.28",
|
|
22
|
+
"@forge/cli-shared": "3.19.0-next.22",
|
|
23
|
+
"@forge/egress": "1.2.5-next.2",
|
|
24
|
+
"@forge/lint": "3.6.7-next.22",
|
|
25
|
+
"@forge/manifest": "4.20.1-next.10",
|
|
26
|
+
"@forge/node-runtime": "0.2.0-next.8",
|
|
27
|
+
"@forge/runtime": "5.1.0-next.7",
|
|
28
|
+
"@forge/tunnel": "3.8.0-next.29",
|
|
29
29
|
"@forge/util": "1.3.1",
|
|
30
|
-
"@sentry/node": "^7.
|
|
30
|
+
"@sentry/node": "^7.70.0",
|
|
31
31
|
"ajv": "^8.12.0",
|
|
32
32
|
"archiver": "^6.0.1",
|
|
33
33
|
"case": "^1.6.3",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"command-exists": "^1.2.9",
|
|
38
38
|
"commander": "^11.0.0",
|
|
39
39
|
"cross-spawn": "^7.0.3",
|
|
40
|
-
"dayjs": "^1.11.
|
|
40
|
+
"dayjs": "^1.11.10",
|
|
41
41
|
"didyoumean": "^1.2.2",
|
|
42
42
|
"env-paths": "^2.2.1",
|
|
43
43
|
"form-data": "^4.0.0",
|
|
44
|
-
"fs-extra": "^
|
|
44
|
+
"fs-extra": "^11.1.1",
|
|
45
45
|
"hidefile": "^3.0.0",
|
|
46
46
|
"latest-version": "^6.0.0",
|
|
47
47
|
"lodash": "^4.17.21",
|
|
@@ -58,25 +58,25 @@
|
|
|
58
58
|
"uuid": "^3.4.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/archiver": "^5.3.
|
|
61
|
+
"@types/archiver": "^5.3.3",
|
|
62
62
|
"@types/cheerio": "^0.22.32",
|
|
63
63
|
"@types/command-exists": "^1.2.1",
|
|
64
64
|
"@types/cross-spawn": "^6.0.3",
|
|
65
65
|
"@types/didyoumean": "^1.2.0",
|
|
66
|
-
"@types/fs-extra": "^
|
|
67
|
-
"@types/hidefile": "^3.0.
|
|
66
|
+
"@types/fs-extra": "^11.0.2",
|
|
67
|
+
"@types/hidefile": "^3.0.1",
|
|
68
68
|
"@types/inquirer": "^8.2.6",
|
|
69
|
-
"@types/jest": "^29.5.
|
|
70
|
-
"@types/js-yaml": "^3.12.
|
|
69
|
+
"@types/jest": "^29.5.5",
|
|
70
|
+
"@types/js-yaml": "^3.12.8",
|
|
71
71
|
"@types/minimatch": "^3.0.5",
|
|
72
72
|
"@types/mkdirp": "^1.0.2",
|
|
73
|
-
"@types/node": "14.18.
|
|
74
|
-
"@types/node-fetch": "^2.6.
|
|
73
|
+
"@types/node": "14.18.61",
|
|
74
|
+
"@types/node-fetch": "^2.6.5",
|
|
75
75
|
"@types/omelette": "^0.4.2",
|
|
76
|
-
"@types/semver": "^7.5.
|
|
77
|
-
"@types/tmp": "^0.2.
|
|
76
|
+
"@types/semver": "^7.5.2",
|
|
77
|
+
"@types/tmp": "^0.2.4",
|
|
78
78
|
"@types/uuid": "^3.4.11",
|
|
79
|
-
"jest": "^29.
|
|
79
|
+
"jest": "^29.7.0",
|
|
80
80
|
"jest-fixtures": "^0.6.0",
|
|
81
81
|
"jest-matcher-specific-error": "^1.0.0",
|
|
82
82
|
"jest-when": "^3.6.0",
|
|
@@ -1 +0,0 @@
|
|
|
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;AAgLtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAOrD,CAAC"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const COMMAND_NAME = 'contributors';
|
|
8
|
-
const registerAddContributorCommand = (parent, { ui, commands: { addContributorCommand } }) => {
|
|
9
|
-
parent
|
|
10
|
-
.command('add')
|
|
11
|
-
.requireAppId()
|
|
12
|
-
.description(cli_shared_1.Text.addContributor.cmd.desc)
|
|
13
|
-
.option('-u, --email [email]', cli_shared_1.Text.addContributor.optionContributorEmail)
|
|
14
|
-
.option('--confirm-add-contributor', cli_shared_1.Text.addContributor.optionSkipConfirmation)
|
|
15
|
-
.nonInteractiveOption('--email')
|
|
16
|
-
.action(async ({ email, confirmAddContributor, nonInteractive }) => {
|
|
17
|
-
ui.info(cli_shared_1.Text.addContributor.overview);
|
|
18
|
-
ui.info(cli_shared_1.Text.ctrlC);
|
|
19
|
-
ui.emptyLine();
|
|
20
|
-
if (!email) {
|
|
21
|
-
ui.info(cli_shared_1.Text.addContributor.contributorEmailInfo);
|
|
22
|
-
ui.emptyLine();
|
|
23
|
-
email = await ui.promptForText(cli_shared_1.Text.addContributor.promptContributorEmail);
|
|
24
|
-
ui.emptyLine();
|
|
25
|
-
}
|
|
26
|
-
if (nonInteractive) {
|
|
27
|
-
confirmAddContributor = true;
|
|
28
|
-
}
|
|
29
|
-
if (!confirmAddContributor) {
|
|
30
|
-
ui.info(cli_shared_1.Text.addContributor.confirmationInfo);
|
|
31
|
-
ui.emptyLine();
|
|
32
|
-
ui.info(cli_shared_1.Text.addContributor.learnMore);
|
|
33
|
-
ui.emptyLine();
|
|
34
|
-
confirmAddContributor = await ui.confirm(cli_shared_1.Text.addContributor.promptConfirmation);
|
|
35
|
-
if (confirmAddContributor)
|
|
36
|
-
ui.emptyLine();
|
|
37
|
-
}
|
|
38
|
-
const args = { email };
|
|
39
|
-
if (confirmAddContributor) {
|
|
40
|
-
await ui.displayProgress(() => addContributorCommand.execute(args), cli_shared_1.Text.addContributor.cmd.start, cli_shared_1.Text.addContributor.cmd.success);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const registerListContributorsCommand = (parent, { ui, commands: { listContributorCommand } }) => {
|
|
45
|
-
parent
|
|
46
|
-
.command('list')
|
|
47
|
-
.requireAppId()
|
|
48
|
-
.description(cli_shared_1.Text.listContributors.cmd.desc)
|
|
49
|
-
.action(async () => {
|
|
50
|
-
const contributors = await listContributorCommand.execute();
|
|
51
|
-
ui.table([
|
|
52
|
-
['name', 'Name'],
|
|
53
|
-
['email', 'Email']
|
|
54
|
-
], contributors.map((contributor) => {
|
|
55
|
-
var _a;
|
|
56
|
-
const name = [contributor.publicName];
|
|
57
|
-
if (contributor.isOwner) {
|
|
58
|
-
name.push(cli_shared_1.Text.listContributors.appOwner);
|
|
59
|
-
}
|
|
60
|
-
if (contributor.accountStatus !== 'active') {
|
|
61
|
-
name.push(cli_shared_1.Text.listContributors.userInactive);
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
name: name.join(' '),
|
|
65
|
-
email: (_a = contributor.email) !== null && _a !== void 0 ? _a : 'Email Not Visible'
|
|
66
|
-
};
|
|
67
|
-
}), {
|
|
68
|
-
emptyMessage: cli_shared_1.Text.listContributors.noContributors,
|
|
69
|
-
preMessage: cli_shared_1.Text.listContributors.banner
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
const registerRemoveContributorsCommand = (parent, { ui, commands: { listContributorCommand, removeContributorsCommand } }) => {
|
|
74
|
-
parent
|
|
75
|
-
.command('remove')
|
|
76
|
-
.requireAppId()
|
|
77
|
-
.description(cli_shared_1.Text.removeContributors.cmd.desc)
|
|
78
|
-
.option('-u, --email [emails...]', cli_shared_1.Text.removeContributors.optionContributorEmail)
|
|
79
|
-
.option('--confirm-remove-contributors', cli_shared_1.Text.removeContributors.optionSkipConfirmation)
|
|
80
|
-
.nonInteractiveOption('--email')
|
|
81
|
-
.action(async ({ email, confirmRemoveContributors, nonInteractive }) => {
|
|
82
|
-
let accountIds;
|
|
83
|
-
let accountReferences = email;
|
|
84
|
-
if (!email) {
|
|
85
|
-
const contributors = await listContributorCommand.execute();
|
|
86
|
-
const nonOwners = contributors.filter((contributor) => !contributor.isOwner);
|
|
87
|
-
if (nonOwners.length === 0) {
|
|
88
|
-
ui.info(cli_shared_1.Text.removeContributors.addContributorMessage);
|
|
89
|
-
ui.emptyLine();
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const selectedContributorsIndexes = await ui.promptForTable(cli_shared_1.Text.removeContributors.promptContributorEmail, cli_shared_1.Text.removeContributors.overview, ['Name', 'Email'], nonOwners.map((contributor) => {
|
|
93
|
-
var _a;
|
|
94
|
-
const name = [contributor.publicName];
|
|
95
|
-
if (contributor.accountStatus !== 'active') {
|
|
96
|
-
name.push(cli_shared_1.Text.listContributors.userInactive);
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
names: [name.join(' '), (_a = contributor.email) !== null && _a !== void 0 ? _a : 'Email Not Visible'],
|
|
100
|
-
value: contributor.accountId
|
|
101
|
-
};
|
|
102
|
-
}));
|
|
103
|
-
accountIds = selectedContributorsIndexes.map((index) => nonOwners[index].accountId);
|
|
104
|
-
accountReferences = selectedContributorsIndexes.map((index) => nonOwners[index].publicName);
|
|
105
|
-
}
|
|
106
|
-
if (!accountReferences) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
if (nonInteractive) {
|
|
110
|
-
confirmRemoveContributors = true;
|
|
111
|
-
}
|
|
112
|
-
if (!confirmRemoveContributors) {
|
|
113
|
-
ui.info(cli_shared_1.Text.removeContributors.confirmationInfo);
|
|
114
|
-
ui.emptyLine();
|
|
115
|
-
accountReferences.forEach((name) => {
|
|
116
|
-
ui.info(chalk_1.default.grey(name));
|
|
117
|
-
});
|
|
118
|
-
ui.emptyLine();
|
|
119
|
-
confirmRemoveContributors = await ui.confirm(cli_shared_1.Text.removeContributors.promptConfirmation);
|
|
120
|
-
if (confirmRemoveContributors)
|
|
121
|
-
ui.emptyLine();
|
|
122
|
-
}
|
|
123
|
-
if (confirmRemoveContributors) {
|
|
124
|
-
await ui.displayProgress(() => removeContributorsCommand.execute({ emails: email, accountIds }), cli_shared_1.Text.removeContributors.cmd.start, cli_shared_1.Text.removeContributors.cmd.success);
|
|
125
|
-
ui.emptyLine();
|
|
126
|
-
ui.info(cli_shared_1.Text.removeContributors.commandSuccessMessage(accountReferences));
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
const registerCommands = (deps) => {
|
|
131
|
-
const { cmd } = deps;
|
|
132
|
-
const contributors = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.contributors.desc);
|
|
133
|
-
registerAddContributorCommand(contributors, deps);
|
|
134
|
-
registerListContributorsCommand(contributors, deps);
|
|
135
|
-
registerRemoveContributorsCommand(contributors, deps);
|
|
136
|
-
};
|
|
137
|
-
exports.registerCommands = registerCommands;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AppConfigProvider } from '@forge/cli-shared';
|
|
2
|
-
export interface ContributorDetails {
|
|
3
|
-
email: string;
|
|
4
|
-
}
|
|
5
|
-
export interface AppContributorDetails extends ContributorDetails {
|
|
6
|
-
appId: string;
|
|
7
|
-
}
|
|
8
|
-
export interface AddContributorClient {
|
|
9
|
-
addContributor(details: AppContributorDetails): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export declare class AddContributorCommand {
|
|
12
|
-
private readonly client;
|
|
13
|
-
private readonly getAppConfig;
|
|
14
|
-
constructor(client: AddContributorClient, getAppConfig: AppConfigProvider);
|
|
15
|
-
execute(details: ContributorDetails): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=add-contributor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-contributor.d.ts","sourceRoot":"","sources":["../../src/contributors/add-contributor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,qBAAa,qBAAqB;IAE9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,oBAAoB,EAC5B,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.AddContributorCommand = void 0;
|
|
4
|
-
class AddContributorCommand {
|
|
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.addContributor(Object.assign(Object.assign({}, details), { appId }));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.AddContributorCommand = AddContributorCommand;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GraphQLClient } from '@forge/cli-shared';
|
|
2
|
-
import { AppContributorDetails, AddContributorClient } from './add-contributor';
|
|
3
|
-
import { Contributor, ListContributorsClient } from './list-contributors';
|
|
4
|
-
import { RemoveContributorsDetails, RemoveContributorsClient } from './remove-contributors';
|
|
5
|
-
export declare class GraphqlClient implements AddContributorClient, ListContributorsClient, RemoveContributorsClient {
|
|
6
|
-
private readonly graphqlClient;
|
|
7
|
-
constructor(graphqlClient: GraphQLClient);
|
|
8
|
-
addContributor(details: AppContributorDetails): Promise<void>;
|
|
9
|
-
listContributors(appId: string): Promise<Contributor[]>;
|
|
10
|
-
removeContributors(details: RemoveContributorsDetails): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=graphql-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/contributors/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,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,aAAc,YAAW,oBAAoB,EAAE,sBAAsB,EAAE,wBAAwB;IAC9F,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,cAAc,CAAC,OAAO,EAAE,qBAAqB;IAoD7C,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAkCvD,kBAAkB,CAAC,OAAO,EAAE,yBAAyB;CAmDnE"}
|