@forge/cli 0.0.0-experimental-034f51a → 0.0.0-experimental-c8e9749
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 +1110 -2
- package/npm-shrinkwrap.json +13389 -0
- package/out/analytics-client/analytics-client.d.ts +36 -0
- package/out/analytics-client/analytics-client.d.ts.map +1 -0
- package/out/analytics-client/analytics-client.js +140 -0
- package/out/analytics-client/analytics-message-handler.d.ts +21 -0
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -0
- package/out/analytics-client/analytics-message-handler.js +43 -0
- package/out/autocomplete/autocomplete-config.json +243 -0
- package/out/autocomplete/index.d.ts +5 -0
- package/out/autocomplete/index.d.ts.map +1 -0
- package/out/autocomplete/index.js +41 -0
- package/out/autocomplete/isSupportedShell.d.ts +2 -0
- package/out/autocomplete/isSupportedShell.d.ts.map +1 -0
- package/out/autocomplete/isSupportedShell.js +11 -0
- package/out/autocomplete/types.d.ts +14 -0
- package/out/autocomplete/types.d.ts.map +1 -0
- package/out/autocomplete/types.js +2 -0
- package/out/autocomplete/util.d.ts +6 -0
- package/out/autocomplete/util.d.ts.map +1 -0
- package/out/autocomplete/util.js +15 -0
- package/out/bin/cli.d.ts +1 -0
- package/out/bin/cli.d.ts.map +1 -1
- package/out/bin/cli.js +4 -1
- package/out/bin/postinstall.d.ts +2 -0
- package/out/bin/postinstall.d.ts.map +1 -0
- package/out/bin/postinstall.js +23 -0
- package/out/command-line/anon-user-id.d.ts +3 -0
- package/out/command-line/anon-user-id.d.ts.map +1 -0
- package/out/command-line/anon-user-id.js +17 -0
- package/out/command-line/command.d.ts +80 -0
- package/out/command-line/command.d.ts.map +1 -0
- package/out/command-line/command.js +408 -0
- package/out/command-line/controller/assertUnreachable.d.ts +2 -0
- package/out/command-line/controller/assertUnreachable.d.ts.map +1 -0
- package/out/command-line/controller/assertUnreachable.js +7 -0
- package/out/command-line/controller/autocomplete-controller.d.ts +12 -0
- package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -0
- package/out/command-line/controller/autocomplete-controller.js +54 -0
- package/out/command-line/controller/deploy-controller.d.ts +42 -0
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -0
- package/out/command-line/controller/deploy-controller.js +139 -0
- package/out/command-line/controller/feedback-controller.d.ts +9 -0
- package/out/command-line/controller/feedback-controller.d.ts.map +1 -0
- package/out/command-line/controller/feedback-controller.js +19 -0
- package/out/command-line/controller/getNodeVersion.d.ts +2 -0
- package/out/command-line/controller/getNodeVersion.d.ts.map +1 -0
- package/out/command-line/controller/getNodeVersion.js +7 -0
- package/out/command-line/controller/install-controller.d.ts +35 -0
- package/out/command-line/controller/install-controller.d.ts.map +1 -0
- package/out/command-line/controller/install-controller.js +157 -0
- package/out/command-line/controller/lint-controller.d.ts +9 -0
- package/out/command-line/controller/lint-controller.d.ts.map +1 -0
- package/out/command-line/controller/lint-controller.js +20 -0
- package/out/command-line/controller/pre-command-controller.d.ts +25 -0
- package/out/command-line/controller/pre-command-controller.d.ts.map +1 -0
- package/out/command-line/controller/pre-command-controller.js +57 -0
- package/out/command-line/controller/prerequisites-controller.d.ts +15 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +41 -0
- package/out/command-line/controller/settings-controller.d.ts +19 -0
- package/out/command-line/controller/settings-controller.d.ts.map +1 -0
- package/out/command-line/controller/settings-controller.js +48 -0
- package/out/command-line/controller/stubController.d.ts +9 -0
- package/out/command-line/controller/stubController.d.ts.map +1 -0
- package/out/command-line/controller/stubController.js +15 -0
- package/out/command-line/controller/tunnel-controller.d.ts +14 -0
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -0
- package/out/command-line/controller/tunnel-controller.js +43 -0
- package/out/command-line/dependency-injection.d.ts +76 -0
- package/out/command-line/dependency-injection.d.ts.map +1 -0
- package/out/command-line/dependency-injection.js +211 -0
- package/out/command-line/environment.d.ts +2 -0
- package/out/command-line/environment.d.ts.map +1 -0
- package/out/command-line/environment.js +16 -0
- package/out/command-line/errors.d.ts +6 -0
- package/out/command-line/errors.d.ts.map +1 -0
- package/out/command-line/errors.js +12 -0
- package/out/command-line/index.d.ts +5 -0
- package/out/command-line/index.d.ts.map +1 -0
- package/out/command-line/index.js +73 -0
- package/out/command-line/register-app-commands.d.ts +10 -0
- package/out/command-line/register-app-commands.d.ts.map +1 -0
- package/out/command-line/register-app-commands.js +128 -0
- package/out/command-line/register-authentication-command.d.ts +16 -0
- package/out/command-line/register-authentication-command.d.ts.map +1 -0
- package/out/command-line/register-authentication-command.js +94 -0
- package/out/command-line/register-autocomplete-commands.d.ts +3 -0
- package/out/command-line/register-autocomplete-commands.d.ts.map +1 -0
- package/out/command-line/register-autocomplete-commands.js +14 -0
- package/out/command-line/register-contributors-commands.d.ts +3 -0
- package/out/command-line/register-contributors-commands.d.ts.map +1 -0
- package/out/command-line/register-contributors-commands.js +134 -0
- package/out/command-line/register-deployment-commands.d.ts +22 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -0
- package/out/command-line/register-deployment-commands.js +16 -0
- package/out/command-line/register-environment-variables-commands.d.ts +3 -0
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -0
- package/out/command-line/register-environment-variables-commands.js +103 -0
- package/out/command-line/register-feedback-commands.d.ts +3 -0
- package/out/command-line/register-feedback-commands.d.ts.map +1 -0
- package/out/command-line/register-feedback-commands.js +32 -0
- package/out/command-line/register-installation-commands.d.ts +6 -0
- package/out/command-line/register-installation-commands.d.ts.map +1 -0
- package/out/command-line/register-installation-commands.js +143 -0
- package/out/command-line/register-lint-command.d.ts +8 -0
- package/out/command-line/register-lint-command.d.ts.map +1 -0
- package/out/command-line/register-lint-command.js +16 -0
- package/out/command-line/register-log-commands.d.ts +4 -0
- package/out/command-line/register-log-commands.d.ts.map +1 -0
- package/out/command-line/register-log-commands.js +139 -0
- package/out/command-line/register-providers-commands.d.ts +3 -0
- package/out/command-line/register-providers-commands.d.ts.map +1 -0
- package/out/command-line/register-providers-commands.js +44 -0
- package/out/command-line/register-settings-commands.d.ts +3 -0
- package/out/command-line/register-settings-commands.d.ts.map +1 -0
- package/out/command-line/register-settings-commands.js +39 -0
- package/out/command-line/register-tunnel-commands.d.ts +3 -0
- package/out/command-line/register-tunnel-commands.d.ts.map +1 -0
- package/out/command-line/register-tunnel-commands.js +15 -0
- package/out/command-line/register-webtrigger-commands.d.ts +3 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -0
- package/out/command-line/register-webtrigger-commands.js +56 -0
- package/out/command-line/sentry.d.ts +4 -0
- package/out/command-line/sentry.d.ts.map +1 -0
- package/out/command-line/sentry.js +16 -0
- package/out/command-line/unique-machine-id.d.ts +3 -0
- package/out/command-line/unique-machine-id.d.ts.map +1 -0
- package/out/command-line/unique-machine-id.js +19 -0
- package/out/command-line/version-info.d.ts +9 -0
- package/out/command-line/version-info.d.ts.map +1 -0
- package/out/command-line/version-info.js +42 -0
- package/out/command-line/view/analytics-settings-view.d.ts +7 -0
- package/out/command-line/view/analytics-settings-view.d.ts.map +1 -0
- package/out/command-line/view/analytics-settings-view.js +18 -0
- package/out/command-line/view/deploy-view.d.ts +21 -0
- package/out/command-line/view/deploy-view.d.ts.map +1 -0
- package/out/command-line/view/deploy-view.js +58 -0
- package/out/command-line/view/install-view.d.ts +18 -0
- package/out/command-line/view/install-view.d.ts.map +1 -0
- package/out/command-line/view/install-view.js +56 -0
- package/out/command-line/view/lint-view.d.ts +12 -0
- package/out/command-line/view/lint-view.d.ts.map +1 -0
- package/out/command-line/view/lint-view.js +31 -0
- package/out/command-line/view/lite-lint-view.d.ts +10 -0
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -0
- package/out/command-line/view/lite-lint-view.js +18 -0
- package/out/command-line/view/settings-view.d.ts +10 -0
- package/out/command-line/view/settings-view.d.ts.map +1 -0
- package/out/command-line/view/settings-view.js +26 -0
- package/out/command-line/view/tunnel-view.d.ts +20 -0
- package/out/command-line/view/tunnel-view.d.ts.map +1 -0
- package/out/command-line/view/tunnel-view.js +92 -0
- package/out/contributors/add-contributor.d.ts +17 -0
- package/out/contributors/add-contributor.d.ts.map +1 -0
- package/out/contributors/add-contributor.js +14 -0
- package/out/contributors/graphql-client.d.ts +14 -0
- package/out/contributors/graphql-client.d.ts.map +1 -0
- package/out/contributors/graphql-client.js +113 -0
- package/out/contributors/list-contributors.d.ts +18 -0
- package/out/contributors/list-contributors.d.ts.map +1 -0
- package/out/contributors/list-contributors.js +14 -0
- package/out/contributors/remove-contributors.d.ts +18 -0
- package/out/contributors/remove-contributors.d.ts.map +1 -0
- package/out/contributors/remove-contributors.js +14 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts +24 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts.map +1 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +57 -0
- package/out/deploy/deployer/deployer.d.ts +40 -0
- package/out/deploy/deployer/deployer.d.ts.map +1 -0
- package/out/deploy/deployer/deployer.js +187 -0
- package/out/deploy/deployer/index.d.ts +4 -0
- package/out/deploy/deployer/index.d.ts.map +1 -0
- package/out/deploy/deployer/index.js +6 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts +19 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +49 -0
- package/out/deploy/index.d.ts +5 -0
- package/out/deploy/index.d.ts.map +1 -0
- package/out/deploy/index.js +7 -0
- package/out/deploy/package-upload-deploy.d.ts +20 -0
- package/out/deploy/package-upload-deploy.d.ts.map +1 -0
- package/out/deploy/package-upload-deploy.js +37 -0
- package/out/deploy/packager/archiver.d.ts +27 -0
- package/out/deploy/packager/archiver.d.ts.map +1 -0
- package/out/deploy/packager/archiver.js +76 -0
- package/out/deploy/packager/index.d.ts +3 -0
- package/out/deploy/packager/index.d.ts.map +1 -0
- package/out/deploy/packager/index.js +5 -0
- package/out/deploy/packager/nativeui-bundler.d.ts +12 -0
- package/out/deploy/packager/nativeui-bundler.d.ts.map +1 -0
- package/out/deploy/packager/nativeui-bundler.js +34 -0
- package/out/deploy/packager/packager.d.ts +32 -0
- package/out/deploy/packager/packager.d.ts.map +1 -0
- package/out/deploy/packager/packager.js +21 -0
- package/out/deploy/packager/runtime-bundler.d.ts +15 -0
- package/out/deploy/packager/runtime-bundler.d.ts.map +1 -0
- package/out/deploy/packager/runtime-bundler.js +53 -0
- package/out/deploy/uploader/artifact-graphql-client.d.ts +26 -0
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -0
- package/out/deploy/uploader/artifact-graphql-client.js +100 -0
- package/out/deploy/uploader/index.d.ts +3 -0
- package/out/deploy/uploader/index.d.ts.map +1 -0
- package/out/deploy/uploader/index.js +5 -0
- package/out/deploy/uploader/uploader.d.ts +19 -0
- package/out/deploy/uploader/uploader.d.ts.map +1 -0
- package/out/deploy/uploader/uploader.js +43 -0
- package/out/environment-variables/delete-environment-variable.d.ts +18 -0
- package/out/environment-variables/delete-environment-variable.d.ts.map +1 -0
- package/out/environment-variables/delete-environment-variable.js +14 -0
- package/out/environment-variables/graphql-client.d.ts +16 -0
- package/out/environment-variables/graphql-client.d.ts.map +1 -0
- package/out/environment-variables/graphql-client.js +113 -0
- package/out/environment-variables/list-environment-variables.d.ts +22 -0
- package/out/environment-variables/list-environment-variables.d.ts.map +1 -0
- package/out/environment-variables/list-environment-variables.js +14 -0
- package/out/environment-variables/set-environment-variable.d.ts +20 -0
- package/out/environment-variables/set-environment-variable.d.ts.map +1 -0
- package/out/environment-variables/set-environment-variable.js +14 -0
- package/out/installations/graphql-client.d.ts +75 -0
- package/out/installations/graphql-client.d.ts.map +1 -0
- package/out/installations/graphql-client.js +423 -0
- package/out/installations/install-app-site.d.ts +21 -0
- package/out/installations/install-app-site.d.ts.map +1 -0
- package/out/installations/install-app-site.js +19 -0
- package/out/installations/shared.d.ts +5 -0
- package/out/installations/shared.d.ts.map +1 -0
- package/out/installations/shared.js +20 -0
- package/out/installations/site-translation/bitbucket.d.ts +24 -0
- package/out/installations/site-translation/bitbucket.d.ts.map +1 -0
- package/out/installations/site-translation/bitbucket.js +113 -0
- package/out/installations/site-translation/cloudid-products.d.ts +17 -0
- package/out/installations/site-translation/cloudid-products.d.ts.map +1 -0
- package/out/installations/site-translation/cloudid-products.js +89 -0
- package/out/installations/site-translation/index.d.ts +4 -0
- package/out/installations/site-translation/index.d.ts.map +1 -0
- package/out/installations/site-translation/index.js +6 -0
- package/out/installations/site-translation/site-translation.d.ts +12 -0
- package/out/installations/site-translation/site-translation.d.ts.map +1 -0
- package/out/installations/site-translation/site-translation.js +2 -0
- package/out/installations/uninstall-app.d.ts +25 -0
- package/out/installations/uninstall-app.d.ts.map +1 -0
- package/out/installations/uninstall-app.js +43 -0
- package/out/migration-keys/graphql-client.d.ts +8 -0
- package/out/migration-keys/graphql-client.d.ts.map +1 -0
- package/out/migration-keys/graphql-client.js +55 -0
- package/out/providers/configure-provider.d.ts +19 -0
- package/out/providers/configure-provider.d.ts.map +1 -0
- package/out/providers/configure-provider.js +14 -0
- package/out/providers/graphql-client.d.ts +8 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +45 -0
- package/out/service/cached-config-service.d.ts +8 -0
- package/out/service/cached-config-service.d.ts.map +1 -0
- package/out/service/cached-config-service.js +16 -0
- package/out/service/command-suggestion-service.d.ts +4 -0
- package/out/service/command-suggestion-service.d.ts.map +1 -0
- package/out/service/command-suggestion-service.js +17 -0
- package/out/service/docker-service.d.ts +24 -0
- package/out/service/docker-service.d.ts.map +1 -0
- package/out/service/docker-service.js +71 -0
- package/out/service/installation-service.d.ts +51 -0
- package/out/service/installation-service.d.ts.map +1 -0
- package/out/service/installation-service.js +91 -0
- package/out/service/lint-service.d.ts +23 -0
- package/out/service/lint-service.d.ts.map +1 -0
- package/out/service/lint-service.js +39 -0
- package/out/service/lite-lint-service.d.ts +10 -0
- package/out/service/lite-lint-service.d.ts.map +1 -0
- package/out/service/lite-lint-service.js +27 -0
- package/out/service/migration-keys-service.d.ts +19 -0
- package/out/service/migration-keys-service.d.ts.map +1 -0
- package/out/service/migration-keys-service.js +14 -0
- package/out/service/port-finding-service.d.ts +12 -0
- package/out/service/port-finding-service.d.ts.map +1 -0
- package/out/service/port-finding-service.js +34 -0
- package/out/service/resource-packaging-service.d.ts +46 -0
- package/out/service/resource-packaging-service.d.ts.map +1 -0
- package/out/service/resource-packaging-service.js +132 -0
- package/out/service/resources-uploader-service.d.ts +16 -0
- package/out/service/resources-uploader-service.d.ts.map +1 -0
- package/out/service/resources-uploader-service.js +39 -0
- package/out/service/tunnel-analytics-service.d.ts +11 -0
- package/out/service/tunnel-analytics-service.d.ts.map +1 -0
- package/out/service/tunnel-analytics-service.js +24 -0
- package/out/service/tunnel-service.d.ts +41 -0
- package/out/service/tunnel-service.d.ts.map +1 -0
- package/out/service/tunnel-service.js +196 -0
- package/out/storage/local-file-storage.d.ts +17 -0
- package/out/storage/local-file-storage.d.ts.map +1 -0
- package/out/storage/local-file-storage.js +53 -0
- package/out/webtrigger/get-webtrigger-url.d.ts +27 -0
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -0
- package/out/webtrigger/get-webtrigger-url.js +26 -0
- package/out/webtrigger/graphql-client.d.ts +14 -0
- package/out/webtrigger/graphql-client.d.ts.map +1 -0
- package/out/webtrigger/graphql-client.js +52 -0
- package/out/workers/analytics-message-worker.d.ts +12 -0
- package/out/workers/analytics-message-worker.d.ts.map +1 -0
- package/out/workers/analytics-message-worker.js +29 -0
- package/out/workers/forge-cli-workers.d.ts +2 -0
- package/out/workers/forge-cli-workers.d.ts.map +1 -0
- package/out/workers/forge-cli-workers.js +21 -0
- package/out/workers/tunnel-clean-up-worker.d.ts +8 -0
- package/out/workers/tunnel-clean-up-worker.d.ts.map +1 -0
- package/out/workers/tunnel-clean-up-worker.js +31 -0
- package/out/workers/version-check-worker.d.ts +8 -0
- package/out/workers/version-check-worker.d.ts.map +1 -0
- package/out/workers/version-check-worker.js +20 -0
- package/out/workers/worker-info.d.ts +8 -0
- package/out/workers/worker-info.d.ts.map +1 -0
- package/out/workers/worker-info.js +15 -0
- package/out/workers/worker.d.ts +6 -0
- package/out/workers/worker.d.ts.map +1 -0
- package/out/workers/worker.js +9 -0
- package/out/workers/workers-starter.d.ts +5 -0
- package/out/workers/workers-starter.d.ts.map +1 -0
- package/out/workers/workers-starter.js +22 -0
- package/package.json +60 -5
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PersonalApiCredentialsValidated, Logger } from '@forge/cli-shared';
|
|
2
|
+
import { Storage } from '../storage/local-file-storage';
|
|
3
|
+
import { CachedConfigService } from '../service/cached-config-service';
|
|
4
|
+
import { DeferredErrors } from '../command-line/errors';
|
|
5
|
+
export declare type AttributeMapper<T> = (val: T) => T | undefined;
|
|
6
|
+
export declare class AnalyticsClientReporter {
|
|
7
|
+
private readonly storage;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly configService;
|
|
10
|
+
constructor(storage: Storage, logger: Logger, configService: CachedConfigService);
|
|
11
|
+
private readonly source;
|
|
12
|
+
reportSuccess(cmdName: string, cred: PersonalApiCredentialsValidated | string, attributes: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}): void;
|
|
15
|
+
reportFailure(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}, e: Error): void;
|
|
18
|
+
reportCommandInvoke(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}): void;
|
|
21
|
+
reportInvokeFailure(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}, e: Error | DeferredErrors): void;
|
|
24
|
+
private reportOperationalEvent;
|
|
25
|
+
private processAnalyticsEvent;
|
|
26
|
+
private _getUserId;
|
|
27
|
+
private _getErrorDetails;
|
|
28
|
+
private _getErrorListDetails;
|
|
29
|
+
private _asContainer;
|
|
30
|
+
private _nodeVersion;
|
|
31
|
+
private _machineId;
|
|
32
|
+
private _asAttribute;
|
|
33
|
+
private _getAttributes;
|
|
34
|
+
private _getContainer;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=analytics-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI5E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,oBAAY,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AAW3D,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFb,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,mBAAmB;IAGrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAEvC,aAAa,CAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,+BAA+B,GAAG,MAAM,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GACjC,IAAI;IAsBA,aAAa,CAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,+BAA+B,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAClC,CAAC,EAAE,KAAK,GACP,IAAI;IAQA,mBAAmB,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,+BAA+B,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GACjC,IAAI;IAIA,mBAAmB,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,+BAA+B,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAClC,CAAC,EAAE,KAAK,GAAG,cAAc,GACxB,IAAI;IAQP,OAAO,CAAC,sBAAsB;IA6B9B,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,aAAa;CAOtB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyticsClientReporter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const analytics_node_client_1 = require("@forge/util/packages/analytics-node-client");
|
|
6
|
+
const os = tslib_1.__importStar(require("os"));
|
|
7
|
+
const cs_ari_1 = require("@forge/util/packages/cs-ari");
|
|
8
|
+
const analytics_message_handler_1 = require("./analytics-message-handler");
|
|
9
|
+
const uuid = require("uuid");
|
|
10
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
11
|
+
const unique_machine_id_1 = require("../command-line/unique-machine-id");
|
|
12
|
+
const errors_1 = require("../command-line/errors");
|
|
13
|
+
const Identity = (value) => value;
|
|
14
|
+
function appAidOrUndefined(appAri) {
|
|
15
|
+
try {
|
|
16
|
+
return (0, cs_ari_1.parseAppAri)((0, cs_ari_1.parse)(appAri)).appId;
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class AnalyticsClientReporter {
|
|
23
|
+
constructor(storage, logger, configService) {
|
|
24
|
+
this.storage = storage;
|
|
25
|
+
this.logger = logger;
|
|
26
|
+
this.configService = configService;
|
|
27
|
+
this.source = 'forge/cli';
|
|
28
|
+
}
|
|
29
|
+
reportSuccess(cmdName, cred, attributes) {
|
|
30
|
+
this.processAnalyticsEvent({
|
|
31
|
+
id: uuid(),
|
|
32
|
+
eventType: analytics_message_handler_1.EventType.TRACK,
|
|
33
|
+
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
34
|
+
name: os.platform(),
|
|
35
|
+
version: os.release()
|
|
36
|
+
} }, this._getUserId(cred)), { trackEvent: {
|
|
37
|
+
source: this.source,
|
|
38
|
+
action: 'invoked',
|
|
39
|
+
actionSubject: cmdName,
|
|
40
|
+
attributes: this._getAttributes(attributes),
|
|
41
|
+
containers: this._getContainer(attributes)
|
|
42
|
+
} })
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
reportFailure(cmdName, cred, attributes, e) {
|
|
46
|
+
attributes = Object.assign(Object.assign({}, attributes), this._getErrorDetails(e));
|
|
47
|
+
this.reportOperationalEvent('invoked', cmdName, cred, attributes);
|
|
48
|
+
}
|
|
49
|
+
reportCommandInvoke(cmdName, cred, attributes) {
|
|
50
|
+
this.reportOperationalEvent('cmdInvoked', cmdName, cred, attributes);
|
|
51
|
+
}
|
|
52
|
+
reportInvokeFailure(cmdName, cred, attributes, e) {
|
|
53
|
+
attributes = Object.assign(Object.assign({}, attributes), this._getErrorListDetails(e));
|
|
54
|
+
this.reportOperationalEvent('cmdInvokeFailed', cmdName, cred, attributes);
|
|
55
|
+
}
|
|
56
|
+
reportOperationalEvent(action, actionSubject, cred, attributes) {
|
|
57
|
+
this.processAnalyticsEvent({
|
|
58
|
+
id: uuid(),
|
|
59
|
+
eventType: analytics_message_handler_1.EventType.OPERATIONAL,
|
|
60
|
+
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
61
|
+
name: os.platform(),
|
|
62
|
+
version: os.release()
|
|
63
|
+
} }, this._getUserId(cred)), { operationalEvent: {
|
|
64
|
+
source: this.source,
|
|
65
|
+
action,
|
|
66
|
+
actionSubject,
|
|
67
|
+
attributes: Object.assign({}, this._getAttributes(attributes)),
|
|
68
|
+
containers: this._getContainer(attributes)
|
|
69
|
+
} })
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
processAnalyticsEvent(analyticsEvent) {
|
|
73
|
+
if (this.configService.getAnalyticsPreferences() === false) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (process.env.FORGE_DEV_DOCKER_TUNNEL || process.env.FORGE_DEV_TUNNEL) {
|
|
77
|
+
this.logger.trace(`\nAnalytics event: ${JSON.stringify(analyticsEvent, null, 2)}`);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.storage.addAnalyticsEvent(analyticsEvent);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
_getUserId(cred) {
|
|
84
|
+
return typeof cred === 'string'
|
|
85
|
+
? {
|
|
86
|
+
anonymousId: cred
|
|
87
|
+
}
|
|
88
|
+
: {
|
|
89
|
+
userIdType: analytics_node_client_1.userTypes.ATLASSIAN_ACCOUNT,
|
|
90
|
+
userId: cred.accountId
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
_getErrorDetails(e) {
|
|
94
|
+
if (e instanceof cli_shared_1.GraphQlMutationError) {
|
|
95
|
+
return { error: e.getCode() };
|
|
96
|
+
}
|
|
97
|
+
return { error: e.constructor.name };
|
|
98
|
+
}
|
|
99
|
+
_getErrorListDetails(e) {
|
|
100
|
+
const errorList = [];
|
|
101
|
+
const errors = e instanceof errors_1.DeferredErrors ? e.getErrors() : [e];
|
|
102
|
+
errors.forEach((error) => {
|
|
103
|
+
if (error instanceof cli_shared_1.GraphQlMutationError) {
|
|
104
|
+
errorList.push(error.getCode());
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
errorList.push(error.constructor.name);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return { error: errorList.join(',') };
|
|
111
|
+
}
|
|
112
|
+
_asContainer(attrValue, containerType, type, mapper = Identity) {
|
|
113
|
+
const mappedValue = mapper(attrValue);
|
|
114
|
+
return mappedValue
|
|
115
|
+
? {
|
|
116
|
+
[containerType]: {
|
|
117
|
+
id: mappedValue,
|
|
118
|
+
type
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
: undefined;
|
|
122
|
+
}
|
|
123
|
+
_nodeVersion() {
|
|
124
|
+
return { node: process.version };
|
|
125
|
+
}
|
|
126
|
+
_machineId() {
|
|
127
|
+
return { machineId: (0, unique_machine_id_1.getMachineId)() };
|
|
128
|
+
}
|
|
129
|
+
_asAttribute(attrValue, name, mapper = Identity) {
|
|
130
|
+
const mappedValue = mapper(attrValue);
|
|
131
|
+
return mappedValue ? { [name]: mappedValue } : {};
|
|
132
|
+
}
|
|
133
|
+
_getAttributes(attributes) {
|
|
134
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, attributes), this._asAttribute(attributes.appId, 'appId', appAidOrUndefined)), this._nodeVersion()), this._machineId());
|
|
135
|
+
}
|
|
136
|
+
_getContainer(attributes) {
|
|
137
|
+
return Object.assign(Object.assign(Object.assign({}, this._asContainer(attributes.appId, 'app', 'appId', appAidOrUndefined)), this._asContainer(attributes.appEnv, 'appEnv', 'environment')), this._asContainer(attributes.product, 'product', 'product'));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.AnalyticsClientReporter = AnalyticsClientReporter;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OperationalEvent, TrackEvent, UIEvent } from '@forge/util/packages/analytics-node-client';
|
|
2
|
+
export declare enum EventType {
|
|
3
|
+
TRACK = "track",
|
|
4
|
+
OPERATIONAL = "operational",
|
|
5
|
+
UI = "ui"
|
|
6
|
+
}
|
|
7
|
+
export interface AnalyticsMessage {
|
|
8
|
+
id: string;
|
|
9
|
+
eventType: EventType;
|
|
10
|
+
event: UIEvent | TrackEvent | OperationalEvent;
|
|
11
|
+
}
|
|
12
|
+
export interface MessageHandler<T> {
|
|
13
|
+
handleMessage(message: T): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare class AnalyticsMessageHandler implements MessageHandler<AnalyticsMessage> {
|
|
16
|
+
private readonly environment?;
|
|
17
|
+
constructor(environment?: string | undefined);
|
|
18
|
+
private readonly aClient;
|
|
19
|
+
handleMessage: (message: AnalyticsMessage | undefined) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=analytics-message-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,UAAU,EACV,OAAO,EACR,MAAM,4CAA4C,CAAC;AAEpD,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,EAAE,OAAO;CACV;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,gBAAgB,CAAC;CAChD;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,qBAAa,uBAAwB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAClE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAAZ,WAAW,CAAC,oBAAQ;IAEjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAMrB;IAOI,aAAa,YAAmB,gBAAgB,GAAG,SAAS,KAAG,QAAQ,IAAI,CAAC,CAmBjF;CACH"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyticsMessageHandler = exports.EventType = void 0;
|
|
4
|
+
const analytics_node_client_1 = require("@forge/util/packages/analytics-node-client");
|
|
5
|
+
var EventType;
|
|
6
|
+
(function (EventType) {
|
|
7
|
+
EventType["TRACK"] = "track";
|
|
8
|
+
EventType["OPERATIONAL"] = "operational";
|
|
9
|
+
EventType["UI"] = "ui";
|
|
10
|
+
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
11
|
+
class AnalyticsMessageHandler {
|
|
12
|
+
constructor(environment) {
|
|
13
|
+
this.environment = environment;
|
|
14
|
+
this.aClient = (0, analytics_node_client_1.analyticsClient)({
|
|
15
|
+
env: this.environment || 'prod',
|
|
16
|
+
product: 'forge',
|
|
17
|
+
subproduct: 'cli',
|
|
18
|
+
flushAt: 1,
|
|
19
|
+
flushInterval: 1
|
|
20
|
+
});
|
|
21
|
+
this.handleMessage = async (message) => {
|
|
22
|
+
if (!message) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
switch (message.eventType) {
|
|
27
|
+
case EventType.TRACK:
|
|
28
|
+
await this.aClient.sendTrackEvent(message.event);
|
|
29
|
+
break;
|
|
30
|
+
case EventType.OPERATIONAL:
|
|
31
|
+
await this.aClient.sendOperationalEvent(message.event);
|
|
32
|
+
break;
|
|
33
|
+
case EventType.UI:
|
|
34
|
+
await this.aClient.sendUIEvent(message.event);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.AnalyticsMessageHandler = AnalyticsMessageHandler;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"autocomplete": {
|
|
4
|
+
"--verbose": {
|
|
5
|
+
"requireUserArg": false
|
|
6
|
+
},
|
|
7
|
+
"--help": {
|
|
8
|
+
"requireUserArg": false
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"create": {
|
|
12
|
+
"--verbose": {
|
|
13
|
+
"requireUserArg": false
|
|
14
|
+
},
|
|
15
|
+
"--template": {
|
|
16
|
+
"requireUserArg": true
|
|
17
|
+
},
|
|
18
|
+
"--directory": {
|
|
19
|
+
"requireUserArg": true
|
|
20
|
+
},
|
|
21
|
+
"--help": {
|
|
22
|
+
"requireUserArg": false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"deploy": {
|
|
26
|
+
"--verbose": {
|
|
27
|
+
"requireUserArg": false
|
|
28
|
+
},
|
|
29
|
+
"--no-verify": {
|
|
30
|
+
"requireUserArg": false
|
|
31
|
+
},
|
|
32
|
+
"--environment": {
|
|
33
|
+
"requireUserArg": true
|
|
34
|
+
},
|
|
35
|
+
"--help": {
|
|
36
|
+
"requireUserArg": false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"feedback": {
|
|
40
|
+
"--verbose": {
|
|
41
|
+
"requireUserArg": false
|
|
42
|
+
},
|
|
43
|
+
"--help": {
|
|
44
|
+
"requireUserArg": false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"install": {
|
|
48
|
+
"--verbose": {
|
|
49
|
+
"requireUserArg": false
|
|
50
|
+
},
|
|
51
|
+
"--environment": {
|
|
52
|
+
"requireUserArg": true
|
|
53
|
+
},
|
|
54
|
+
"--site": {
|
|
55
|
+
"requireUserArg": true
|
|
56
|
+
},
|
|
57
|
+
"--product": {
|
|
58
|
+
"requireUserArg": true
|
|
59
|
+
},
|
|
60
|
+
"--upgrade": {
|
|
61
|
+
"requireUserArg": false
|
|
62
|
+
},
|
|
63
|
+
"--confirm-scopes": {
|
|
64
|
+
"requireUserArg": false
|
|
65
|
+
},
|
|
66
|
+
"--help": {
|
|
67
|
+
"requireUserArg": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"install:list": {
|
|
71
|
+
"--verbose": {
|
|
72
|
+
"requireUserArg": false
|
|
73
|
+
},
|
|
74
|
+
"--help": {
|
|
75
|
+
"requireUserArg": false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"lint": {
|
|
79
|
+
"--verbose": {
|
|
80
|
+
"requireUserArg": false
|
|
81
|
+
},
|
|
82
|
+
"--fix": {
|
|
83
|
+
"requireUserArg": false
|
|
84
|
+
},
|
|
85
|
+
"--environment": {
|
|
86
|
+
"requireUserArg": true
|
|
87
|
+
},
|
|
88
|
+
"--help": {
|
|
89
|
+
"requireUserArg": false
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"login": {
|
|
93
|
+
"--verbose": {
|
|
94
|
+
"requireUserArg": false
|
|
95
|
+
},
|
|
96
|
+
"--email": {
|
|
97
|
+
"requireUserArg": true
|
|
98
|
+
},
|
|
99
|
+
"--token": {
|
|
100
|
+
"requireUserArg": true
|
|
101
|
+
},
|
|
102
|
+
"--help": {
|
|
103
|
+
"requireUserArg": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"logout": {
|
|
107
|
+
"--verbose": {
|
|
108
|
+
"requireUserArg": false
|
|
109
|
+
},
|
|
110
|
+
"--help": {
|
|
111
|
+
"requireUserArg": false
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"logs": {
|
|
115
|
+
"--verbose": {
|
|
116
|
+
"requireUserArg": false
|
|
117
|
+
},
|
|
118
|
+
"--environment": {
|
|
119
|
+
"requireUserArg": true
|
|
120
|
+
},
|
|
121
|
+
"--invocation": {
|
|
122
|
+
"requireUserArg": true
|
|
123
|
+
},
|
|
124
|
+
"--limit": {
|
|
125
|
+
"requireUserArg": true
|
|
126
|
+
},
|
|
127
|
+
"--since": {
|
|
128
|
+
"requireUserArg": true
|
|
129
|
+
},
|
|
130
|
+
"--grouped": {
|
|
131
|
+
"requireUserArg": false
|
|
132
|
+
},
|
|
133
|
+
"--help": {
|
|
134
|
+
"requireUserArg": false
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"providers": {
|
|
138
|
+
"--verbose": {
|
|
139
|
+
"requireUserArg": false
|
|
140
|
+
},
|
|
141
|
+
"--help": {
|
|
142
|
+
"requireUserArg": false
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"register": {
|
|
146
|
+
"--verbose": {
|
|
147
|
+
"requireUserArg": false
|
|
148
|
+
},
|
|
149
|
+
"--help": {
|
|
150
|
+
"requireUserArg": false
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"settings": {
|
|
154
|
+
"--verbose": {
|
|
155
|
+
"requireUserArg": false
|
|
156
|
+
},
|
|
157
|
+
"--help": {
|
|
158
|
+
"requireUserArg": false
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"tunnel": {
|
|
162
|
+
"--verbose": {
|
|
163
|
+
"requireUserArg": false
|
|
164
|
+
},
|
|
165
|
+
"--debug": {
|
|
166
|
+
"requireUserArg": false
|
|
167
|
+
},
|
|
168
|
+
"--help": {
|
|
169
|
+
"requireUserArg": false
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"uninstall": {
|
|
173
|
+
"--verbose": {
|
|
174
|
+
"requireUserArg": false
|
|
175
|
+
},
|
|
176
|
+
"--help": {
|
|
177
|
+
"requireUserArg": false
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"variables": {
|
|
181
|
+
"--verbose": {
|
|
182
|
+
"requireUserArg": false
|
|
183
|
+
},
|
|
184
|
+
"--help": {
|
|
185
|
+
"requireUserArg": false
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"variables:list": {
|
|
189
|
+
"--verbose": {
|
|
190
|
+
"requireUserArg": false
|
|
191
|
+
},
|
|
192
|
+
"--help": {
|
|
193
|
+
"requireUserArg": false
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"variables:set": {
|
|
197
|
+
"--verbose": {
|
|
198
|
+
"requireUserArg": false
|
|
199
|
+
},
|
|
200
|
+
"--help": {
|
|
201
|
+
"requireUserArg": false
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"variables:unset": {
|
|
205
|
+
"--verbose": {
|
|
206
|
+
"requireUserArg": false
|
|
207
|
+
},
|
|
208
|
+
"--help": {
|
|
209
|
+
"requireUserArg": false
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"webtrigger": {
|
|
213
|
+
"--verbose": {
|
|
214
|
+
"requireUserArg": false
|
|
215
|
+
},
|
|
216
|
+
"--functionKey": {
|
|
217
|
+
"requireUserArg": true
|
|
218
|
+
},
|
|
219
|
+
"--help": {
|
|
220
|
+
"requireUserArg": false
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"whoami": {
|
|
224
|
+
"--verbose": {
|
|
225
|
+
"requireUserArg": false
|
|
226
|
+
},
|
|
227
|
+
"--help": {
|
|
228
|
+
"requireUserArg": false
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"options": {
|
|
233
|
+
"--version": {
|
|
234
|
+
"requireUserArg": false
|
|
235
|
+
},
|
|
236
|
+
"--verbose": {
|
|
237
|
+
"requireUserArg": false
|
|
238
|
+
},
|
|
239
|
+
"--help": {
|
|
240
|
+
"requireUserArg": false
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import omelette from 'omelette';
|
|
2
|
+
import { AutocompleteConfig } from './types';
|
|
3
|
+
export declare const processAutocompleteFactory: (autocompleteConfig: AutocompleteConfig) => (_: any, { line, reply }: any) => void;
|
|
4
|
+
export declare const autocomplete: omelette.Instance;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,0BAA0B,uBAAwB,kBAAkB,SAC/C,GAAG,mBAAmB,GAAG,SAuC1D,CAAC;AAEF,eAAO,MAAM,YAAY,mBAAsD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.autocomplete = exports.processAutocompleteFactory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const omelette_1 = tslib_1.__importDefault(require("omelette"));
|
|
6
|
+
const autocomplete_config_json_1 = tslib_1.__importDefault(require("./autocomplete-config.json"));
|
|
7
|
+
const util_1 = require("./util");
|
|
8
|
+
const autocompleteConfig = autocomplete_config_json_1.default;
|
|
9
|
+
const processAutocompleteFactory = (autocompleteConfig) => {
|
|
10
|
+
const processAutocomplete = (_, { line, reply }) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const splitLine = line.split(' ');
|
|
13
|
+
const numArgs = splitLine.length;
|
|
14
|
+
if (numArgs === 2) {
|
|
15
|
+
if (splitLine.slice(-1)[0].startsWith('-')) {
|
|
16
|
+
reply(Object.keys(autocompleteConfig.options));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
reply(Object.keys(autocompleteConfig.commands));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const command = splitLine[1];
|
|
23
|
+
if (!autocompleteConfig.commands.hasOwnProperty(command)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const commandOptions = autocompleteConfig.commands[command];
|
|
27
|
+
const lastArg = splitLine.slice(-2, -1)[0];
|
|
28
|
+
if ((_a = commandOptions[lastArg]) === null || _a === void 0 ? void 0 : _a.requireUserArg) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const userOptionsSelected = (0, util_1.getUserOptionsSelectedFromSplitLine)(splitLine);
|
|
32
|
+
const remainingOptions = (0, util_1.getRemainingOptions)(commandOptions, userOptionsSelected);
|
|
33
|
+
reply(Object.keys(remainingOptions));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return processAutocomplete;
|
|
37
|
+
};
|
|
38
|
+
exports.processAutocompleteFactory = processAutocompleteFactory;
|
|
39
|
+
exports.autocomplete = (0, omelette_1.default)(process.env.AUTOCOMPLETE_ALIAS || 'forge');
|
|
40
|
+
exports.autocomplete.on('complete', (0, exports.processAutocompleteFactory)(autocompleteConfig));
|
|
41
|
+
exports.autocomplete.init();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSupportedShell.d.ts","sourceRoot":"","sources":["../../src/autocomplete/isSupportedShell.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,OAAO,CAQ1C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSupportedShell = void 0;
|
|
4
|
+
function isSupportedShell() {
|
|
5
|
+
const shell = process.env.SHELL;
|
|
6
|
+
if (!shell) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return /bash/.test(shell) || /zsh/.test(shell) || /fish/.test(shell);
|
|
10
|
+
}
|
|
11
|
+
exports.isSupportedShell = isSupportedShell;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Option {
|
|
2
|
+
requireUserArg: boolean;
|
|
3
|
+
}
|
|
4
|
+
export interface CommandOptions {
|
|
5
|
+
[key: string]: Option;
|
|
6
|
+
}
|
|
7
|
+
export interface CommandConfig {
|
|
8
|
+
[key: string]: CommandOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface AutocompleteConfig {
|
|
11
|
+
commands: CommandConfig;
|
|
12
|
+
options: CommandOptions;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/autocomplete/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommandOptions } from './types';
|
|
2
|
+
export declare const getUserOptionsSelectedFromSplitLine: (splitLine: string[]) => string[];
|
|
3
|
+
export declare const getRemainingOptions: (commandOptions: CommandOptions, userSelectedOptions: string[]) => {
|
|
4
|
+
[x: string]: import("./types").Option;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/autocomplete/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,mCAAmC,cAAe,MAAM,EAAE,aAEtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBAAoB,cAAc,uBAAuB,MAAM,EAAE;;CAQhG,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRemainingOptions = exports.getUserOptionsSelectedFromSplitLine = void 0;
|
|
4
|
+
const getUserOptionsSelectedFromSplitLine = (splitLine) => {
|
|
5
|
+
return splitLine.slice(2).filter((o) => o.startsWith('--'));
|
|
6
|
+
};
|
|
7
|
+
exports.getUserOptionsSelectedFromSplitLine = getUserOptionsSelectedFromSplitLine;
|
|
8
|
+
const getRemainingOptions = (commandOptions, userSelectedOptions) => {
|
|
9
|
+
const commandOptionsClone = Object.assign({}, commandOptions);
|
|
10
|
+
for (const option of userSelectedOptions) {
|
|
11
|
+
delete commandOptionsClone[option];
|
|
12
|
+
}
|
|
13
|
+
return commandOptionsClone;
|
|
14
|
+
};
|
|
15
|
+
exports.getRemainingOptions = getRemainingOptions;
|
package/out/bin/cli.d.ts
CHANGED
package/out/bin/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";AAEA,OAAO,iBAAiB,CAAC"}
|
package/out/bin/cli.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const analytics_client_1 = require("../analytics-client/analytics-client");
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
const local_file_storage_1 = require("../storage/local-file-storage");
|
|
6
|
+
const workers_starter_1 = require("../workers/workers-starter");
|
|
7
|
+
const version_info_1 = require("../command-line/version-info");
|
|
8
|
+
const anon_user_id_1 = require("../command-line/anon-user-id");
|
|
9
|
+
const isSupportedShell_1 = require("../autocomplete/isSupportedShell");
|
|
10
|
+
const unique_machine_id_1 = require("../command-line/unique-machine-id");
|
|
11
|
+
const cached_config_service_1 = require("../service/cached-config-service");
|
|
12
|
+
const ui = new cli_shared_1.CommandLineUI(() => true);
|
|
13
|
+
const cachedConf = cli_shared_1.CachedConf.getCache(unique_machine_id_1.FORGE_CLI_PACKAGE);
|
|
14
|
+
const configService = new cached_config_service_1.CachedConfigService(cachedConf);
|
|
15
|
+
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter(new local_file_storage_1.LocalFileStorage(), ui, configService);
|
|
16
|
+
const cliDetails = (0, version_info_1.getCLIDetails)();
|
|
17
|
+
const attributes = { version: cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version };
|
|
18
|
+
const anonId = (0, anon_user_id_1.getAnonId)(true);
|
|
19
|
+
analyticsClientReporter.reportSuccess('postinstall', anonId, attributes);
|
|
20
|
+
if ((0, isSupportedShell_1.isSupportedShell)()) {
|
|
21
|
+
ui.info(cli_shared_1.Text.autocomplete.postinstall);
|
|
22
|
+
}
|
|
23
|
+
new workers_starter_1.WorkersStarter(undefined);
|