@forge/cli 0.0.0-experimental-819498d → 0.0.0-experimental-a9f00a0
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 +2901 -7
- package/README.md +18 -19
- package/npm-shrinkwrap.json +1957 -4159
- package/out/analytics-client/analytics-client.d.ts +0 -24
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +0 -115
- package/out/analytics-client/analytics-message-handler.d.ts +1 -5
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -1
- package/out/analytics-client/analytics-message-handler.js +2 -30
- package/out/autocomplete/autocomplete-config.json +16 -26
- package/out/bin/cli.js +0 -2
- package/out/bin/postinstall.js +0 -13
- package/out/command-line/anon-user-id.js +6 -10
- package/out/command-line/command.d.ts +7 -3
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +56 -60
- package/out/command-line/controller/deploy-controller.d.ts +13 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +67 -5
- package/out/command-line/controller/install-controller.d.ts +2 -1
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +28 -32
- package/out/command-line/controller/lint-controller.js +1 -1
- package/out/command-line/controller/pre-command-controller.js +1 -1
- package/out/command-line/controller/prerequisites-controller.d.ts +11 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +34 -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.map +1 -1
- package/out/command-line/controller/tunnel-controller.js +0 -1
- package/out/command-line/dependency-injection.d.ts +11 -3
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +38 -23
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +4 -0
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +1 -9
- package/out/command-line/register-authentication-command.d.ts.map +1 -1
- package/out/command-line/register-authentication-command.js +0 -16
- package/out/command-line/register-deployment-commands.d.ts +8 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.js +22 -7
- package/out/command-line/register-installation-commands.d.ts +1 -1
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +19 -13
- 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 +43 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
- package/out/command-line/register-webtrigger-commands.js +9 -11
- package/out/command-line/unique-machine-id.d.ts.map +1 -1
- package/out/command-line/unique-machine-id.js +1 -10
- package/out/command-line/version-info.d.ts +1 -0
- package/out/command-line/version-info.d.ts.map +1 -1
- package/out/command-line/version-info.js +3 -2
- package/out/command-line/view/deploy-view.d.ts +7 -1
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +22 -5
- package/out/command-line/view/install-view.d.ts +5 -5
- package/out/command-line/view/install-view.d.ts.map +1 -1
- package/out/command-line/view/install-view.js +20 -15
- package/out/command-line/view/lint-view.d.ts +3 -2
- package/out/command-line/view/lint-view.d.ts.map +1 -1
- package/out/command-line/view/lint-view.js +3 -0
- package/out/command-line/view/lite-lint-view.d.ts +3 -2
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
- package/out/command-line/view/lite-lint-view.js +3 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +1 -1
- package/out/deploy/packager/archiver.d.ts +3 -2
- package/out/deploy/packager/archiver.d.ts.map +1 -1
- package/out/deploy/packager/archiver.js +10 -2
- package/out/deploy/packager/packager.d.ts +1 -3
- package/out/deploy/packager/packager.d.ts.map +1 -1
- package/out/deploy/packager/packager.js +2 -25
- package/out/deploy/uploader/artifact-graphql-client.js +2 -2
- package/out/environment-variables/graphql-client.d.ts +1 -1
- package/out/environment-variables/graphql-client.js +3 -3
- package/out/installations/graphql-client.d.ts +7 -9
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +61 -85
- package/out/installations/install-app-site.d.ts +2 -8
- package/out/installations/install-app-site.d.ts.map +1 -1
- package/out/installations/install-app-site.js +2 -3
- package/out/installations/uninstall-app.d.ts +0 -1
- package/out/installations/uninstall-app.d.ts.map +1 -1
- package/out/installations/uninstall-app.js +2 -4
- 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 +12 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +47 -0
- package/out/service/installation-service.d.ts +13 -11
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +38 -13
- package/out/service/lint-service.d.ts +2 -2
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/lint-service.js +2 -2
- package/out/service/lite-lint-service.d.ts +3 -3
- package/out/service/lite-lint-service.d.ts.map +1 -1
- package/out/service/lite-lint-service.js +2 -2
- 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/resource-packaging-service.d.ts +3 -2
- package/out/service/resource-packaging-service.d.ts.map +1 -1
- package/out/service/resource-packaging-service.js +6 -2
- package/out/service/tunnel-analytics-service.d.ts +0 -5
- package/out/service/tunnel-analytics-service.d.ts.map +1 -1
- package/out/service/tunnel-analytics-service.js +3 -14
- package/out/service/tunnel-service.d.ts +1 -3
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +8 -9
- package/out/webtrigger/get-webtrigger-url.d.ts +10 -4
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
- package/out/webtrigger/get-webtrigger-url.js +11 -21
- 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/forge-cli-workers.js +2 -2
- package/package.json +12 -13
- package/out/bin/preinstall.d.ts +0 -3
- package/out/bin/preinstall.d.ts.map +0 -1
- package/out/bin/preinstall.js +0 -9
- package/out/command-line/cli-prerequisites.d.ts +0 -3
- package/out/command-line/cli-prerequisites.d.ts.map +0 -1
- package/out/command-line/cli-prerequisites.js +0 -37
|
@@ -1,28 +1,4 @@
|
|
|
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
1
|
export declare type AttributeMapper<T> = (val: T) => T | undefined;
|
|
5
2
|
export declare class AnalyticsClientReporter {
|
|
6
|
-
private readonly storage;
|
|
7
|
-
private readonly logger;
|
|
8
|
-
private readonly configService;
|
|
9
|
-
constructor(storage: Storage, logger: Logger, configService: CachedConfigService);
|
|
10
|
-
private eventSource;
|
|
11
|
-
reportInvoke(cmdName: string, anonymousId: string): void;
|
|
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
|
-
private processAnalyticsEvent;
|
|
19
|
-
private _getUserId;
|
|
20
|
-
private _getErrorDetails;
|
|
21
|
-
private _asContainer;
|
|
22
|
-
private _nodeVersion;
|
|
23
|
-
private _machineId;
|
|
24
|
-
private _asAttribute;
|
|
25
|
-
private _getAttributes;
|
|
26
|
-
private _getContainer;
|
|
27
3
|
}
|
|
28
4
|
//# sourceMappingURL=analytics-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AAE3D,qBAAa,uBAAuB;CAAG"}
|
|
@@ -1,121 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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 Identity = (value) => value;
|
|
13
|
-
function appAidOrUndefined(appAri) {
|
|
14
|
-
try {
|
|
15
|
-
return cs_ari_1.parseAppAri(cs_ari_1.parse(appAri)).appId;
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
4
|
class AnalyticsClientReporter {
|
|
22
|
-
constructor(storage, logger, configService) {
|
|
23
|
-
this.storage = storage;
|
|
24
|
-
this.logger = logger;
|
|
25
|
-
this.configService = configService;
|
|
26
|
-
this.eventSource = {
|
|
27
|
-
source: 'forge/cli',
|
|
28
|
-
action: 'invoked'
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
reportInvoke(cmdName, anonymousId) {
|
|
32
|
-
this.processAnalyticsEvent({
|
|
33
|
-
id: uuid(),
|
|
34
|
-
eventType: analytics_message_handler_1.EventType.UI,
|
|
35
|
-
event: {
|
|
36
|
-
anonymousId,
|
|
37
|
-
timestamp: new Date(),
|
|
38
|
-
os: {
|
|
39
|
-
name: os.platform(),
|
|
40
|
-
version: os.release()
|
|
41
|
-
},
|
|
42
|
-
uiEvent: Object.assign(Object.assign({}, this.eventSource), { actionSubject: cmdName, attributes: this._getAttributes({}) })
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
reportSuccess(cmdName, cred, attributes) {
|
|
47
|
-
this.processAnalyticsEvent({
|
|
48
|
-
id: uuid(),
|
|
49
|
-
eventType: analytics_message_handler_1.EventType.TRACK,
|
|
50
|
-
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
51
|
-
name: os.platform(),
|
|
52
|
-
version: os.release()
|
|
53
|
-
} }, this._getUserId(cred)), { trackEvent: Object.assign(Object.assign({}, this.eventSource), { actionSubject: cmdName, attributes: this._getAttributes(attributes), containers: this._getContainer(attributes) }) })
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
reportFailure(cmdName, cred, attributes, e) {
|
|
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: Object.assign(Object.assign({}, this.eventSource), { actionSubject: cmdName, attributes: Object.assign(Object.assign({}, this._getAttributes(attributes)), this._getErrorDetails(e)), containers: this._getContainer(attributes) }) })
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
processAnalyticsEvent(analyticsEvent) {
|
|
67
|
-
if (this.configService.getAnalyticsPreferences() === false) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (process.env.FORGE_DEV_DOCKER_TUNNEL || process.env.FORGE_DEV_TUNNEL) {
|
|
71
|
-
this.logger.trace(`\nAnalytics event: ${JSON.stringify(analyticsEvent, null, 2)}`);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.storage.addAnalyticsEvent(analyticsEvent);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
_getUserId(cred) {
|
|
78
|
-
return typeof cred === 'string'
|
|
79
|
-
? {
|
|
80
|
-
anonymousId: cred
|
|
81
|
-
}
|
|
82
|
-
: {
|
|
83
|
-
userIdType: analytics_node_client_1.userTypes.ATLASSIAN_ACCOUNT,
|
|
84
|
-
userId: cred.accountId
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
_getErrorDetails(e) {
|
|
88
|
-
if (e instanceof cli_shared_1.GraphQlMutationError) {
|
|
89
|
-
return { error: e.getCode() };
|
|
90
|
-
}
|
|
91
|
-
return { error: e.constructor.name };
|
|
92
|
-
}
|
|
93
|
-
_asContainer(attrValue, containerType, type, mapper = Identity) {
|
|
94
|
-
const mappedValue = mapper(attrValue);
|
|
95
|
-
return mappedValue
|
|
96
|
-
? {
|
|
97
|
-
[containerType]: {
|
|
98
|
-
id: mappedValue,
|
|
99
|
-
type
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
: undefined;
|
|
103
|
-
}
|
|
104
|
-
_nodeVersion() {
|
|
105
|
-
return { node: process.version };
|
|
106
|
-
}
|
|
107
|
-
_machineId() {
|
|
108
|
-
return { machineId: unique_machine_id_1.getMachineId() };
|
|
109
|
-
}
|
|
110
|
-
_asAttribute(attrValue, name, mapper = Identity) {
|
|
111
|
-
const mappedValue = mapper(attrValue);
|
|
112
|
-
return mappedValue ? { [name]: mappedValue } : {};
|
|
113
|
-
}
|
|
114
|
-
_getAttributes(attributes) {
|
|
115
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, attributes), this._asAttribute(attributes.appId, 'appId', appAidOrUndefined)), this._nodeVersion()), this._machineId());
|
|
116
|
-
}
|
|
117
|
-
_getContainer(attributes) {
|
|
118
|
-
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'));
|
|
119
|
-
}
|
|
120
5
|
}
|
|
121
6
|
exports.AnalyticsClientReporter = AnalyticsClientReporter;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OperationalEvent, TrackEvent, UIEvent } from '@forge/util/packages/analytics-node-client';
|
|
2
1
|
export declare enum EventType {
|
|
3
2
|
TRACK = "track",
|
|
4
3
|
OPERATIONAL = "operational",
|
|
@@ -7,15 +6,12 @@ export declare enum EventType {
|
|
|
7
6
|
export interface AnalyticsMessage {
|
|
8
7
|
id: string;
|
|
9
8
|
eventType: EventType;
|
|
10
|
-
event:
|
|
9
|
+
event: unknown;
|
|
11
10
|
}
|
|
12
11
|
export interface MessageHandler<T> {
|
|
13
12
|
handleMessage(message: T): Promise<void>;
|
|
14
13
|
}
|
|
15
14
|
export declare class AnalyticsMessageHandler implements MessageHandler<AnalyticsMessage> {
|
|
16
|
-
private readonly environment?;
|
|
17
|
-
constructor(environment?: string | undefined);
|
|
18
|
-
private readonly aClient;
|
|
19
15
|
handleMessage: (message: AnalyticsMessage | undefined) => Promise<void>;
|
|
20
16
|
}
|
|
21
17
|
//# sourceMappingURL=analytics-message-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,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,CAAC;CAChB;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;IAMvE,aAAa,YAAmB,gBAAgB,GAAG,SAAS,KAAG,OAAO,CAAC,IAAI,CAAC,CAAW;CAC/F"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnalyticsMessageHandler = exports.EventType = void 0;
|
|
4
|
-
const analytics_node_client_1 = require("@forge/util/packages/analytics-node-client");
|
|
5
4
|
var EventType;
|
|
6
5
|
(function (EventType) {
|
|
7
6
|
EventType["TRACK"] = "track";
|
|
@@ -9,35 +8,8 @@ var EventType;
|
|
|
9
8
|
EventType["UI"] = "ui";
|
|
10
9
|
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
11
10
|
class AnalyticsMessageHandler {
|
|
12
|
-
constructor(
|
|
13
|
-
this.
|
|
14
|
-
this.aClient = 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
|
-
};
|
|
11
|
+
constructor() {
|
|
12
|
+
this.handleMessage = async (message) => void 0;
|
|
41
13
|
}
|
|
42
14
|
}
|
|
43
15
|
exports.AnalyticsMessageHandler = AnalyticsMessageHandler;
|
|
@@ -32,9 +32,6 @@
|
|
|
32
32
|
"--environment": {
|
|
33
33
|
"requireUserArg": true
|
|
34
34
|
},
|
|
35
|
-
"--non-interactive": {
|
|
36
|
-
"requireUserArg": false
|
|
37
|
-
},
|
|
38
35
|
"--help": {
|
|
39
36
|
"requireUserArg": false
|
|
40
37
|
}
|
|
@@ -102,17 +99,6 @@
|
|
|
102
99
|
"--token": {
|
|
103
100
|
"requireUserArg": true
|
|
104
101
|
},
|
|
105
|
-
"--non-interactive": {
|
|
106
|
-
"requireUserArg": false
|
|
107
|
-
},
|
|
108
|
-
"--help": {
|
|
109
|
-
"requireUserArg": false
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"login:ci": {
|
|
113
|
-
"--verbose": {
|
|
114
|
-
"requireUserArg": false
|
|
115
|
-
},
|
|
116
102
|
"--help": {
|
|
117
103
|
"requireUserArg": false
|
|
118
104
|
}
|
|
@@ -148,6 +134,14 @@
|
|
|
148
134
|
"requireUserArg": false
|
|
149
135
|
}
|
|
150
136
|
},
|
|
137
|
+
"providers": {
|
|
138
|
+
"--verbose": {
|
|
139
|
+
"requireUserArg": false
|
|
140
|
+
},
|
|
141
|
+
"--help": {
|
|
142
|
+
"requireUserArg": false
|
|
143
|
+
}
|
|
144
|
+
},
|
|
151
145
|
"register": {
|
|
152
146
|
"--verbose": {
|
|
153
147
|
"requireUserArg": false
|
|
@@ -183,26 +177,25 @@
|
|
|
183
177
|
"requireUserArg": false
|
|
184
178
|
}
|
|
185
179
|
},
|
|
186
|
-
"variables
|
|
180
|
+
"variables": {
|
|
187
181
|
"--verbose": {
|
|
188
182
|
"requireUserArg": false
|
|
189
183
|
},
|
|
190
|
-
"--environment": {
|
|
191
|
-
"requireUserArg": true
|
|
192
|
-
},
|
|
193
184
|
"--help": {
|
|
194
185
|
"requireUserArg": false
|
|
195
186
|
}
|
|
196
187
|
},
|
|
197
|
-
"variables:
|
|
188
|
+
"variables:list": {
|
|
198
189
|
"--verbose": {
|
|
199
190
|
"requireUserArg": false
|
|
200
191
|
},
|
|
201
|
-
"--
|
|
192
|
+
"--help": {
|
|
193
|
+
"requireUserArg": false
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"variables:set": {
|
|
197
|
+
"--verbose": {
|
|
202
198
|
"requireUserArg": false
|
|
203
|
-
},
|
|
204
|
-
"--environment": {
|
|
205
|
-
"requireUserArg": true
|
|
206
199
|
},
|
|
207
200
|
"--help": {
|
|
208
201
|
"requireUserArg": false
|
|
@@ -212,9 +205,6 @@
|
|
|
212
205
|
"--verbose": {
|
|
213
206
|
"requireUserArg": false
|
|
214
207
|
},
|
|
215
|
-
"--environment": {
|
|
216
|
-
"requireUserArg": true
|
|
217
|
-
},
|
|
218
208
|
"--help": {
|
|
219
209
|
"requireUserArg": false
|
|
220
210
|
}
|
package/out/bin/cli.js
CHANGED
|
@@ -3,6 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
require("../autocomplete");
|
|
5
5
|
const command_line_1 = require("../command-line");
|
|
6
|
-
const cli_prerequisites_1 = require("../command-line/cli-prerequisites");
|
|
7
|
-
cli_prerequisites_1.checkNodeVersion();
|
|
8
6
|
command_line_1.main();
|
package/out/bin/postinstall.js
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const analytics_client_1 = require("../analytics-client/analytics-client");
|
|
4
3
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
const local_file_storage_1 = require("../storage/local-file-storage");
|
|
6
4
|
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
5
|
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
6
|
const ui = new cli_shared_1.CommandLineUI(() => true);
|
|
13
|
-
const cachedConf = new cli_shared_1.CachedConf(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 = version_info_1.getCLIDetails();
|
|
17
|
-
const attributes = { version: cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version };
|
|
18
|
-
const anonId = anon_user_id_1.getAnonId(true);
|
|
19
|
-
analyticsClientReporter.reportSuccess('postinstall', anonId, attributes);
|
|
20
7
|
if (isSupportedShell_1.isSupportedShell()) {
|
|
21
8
|
ui.info(cli_shared_1.Text.autocomplete.postinstall);
|
|
22
9
|
}
|
|
@@ -7,15 +7,11 @@ const cli_shared_1 = require("@forge/cli-shared");
|
|
|
7
7
|
const ANON_ID_CACHE_KEY = 'anonId';
|
|
8
8
|
function getAnonId(createNew = false) {
|
|
9
9
|
const cachedConf = cli_shared_1.CachedConf.getCache('@forge/cli');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const generatedAnonId = uuid_1.default();
|
|
18
|
-
cachedConf.set(ANON_ID_CACHE_KEY, generatedAnonId);
|
|
19
|
-
return generatedAnonId;
|
|
10
|
+
return cachedConf.cached(ANON_ID_CACHE_KEY, () => {
|
|
11
|
+
if (!createNew) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return uuid_1.default();
|
|
15
|
+
});
|
|
20
16
|
}
|
|
21
17
|
exports.getAnonId = getAnonId;
|
|
@@ -4,6 +4,7 @@ import { PersonalApiCredentialsValidated } from '@forge/cli-shared';
|
|
|
4
4
|
import { UI } from '@forge/cli-shared';
|
|
5
5
|
import { CLIDetails } from '@forge/cli-shared';
|
|
6
6
|
import { PreCommandController } from './controller/pre-command-controller';
|
|
7
|
+
import { StubController } from './controller/stubController';
|
|
7
8
|
declare type PreconditionCallback = (...args: any[]) => any;
|
|
8
9
|
declare type ActionResult = Promise<{
|
|
9
10
|
creds?: PersonalApiCredentialsValidated;
|
|
@@ -34,13 +35,15 @@ export declare class Command {
|
|
|
34
35
|
private static concatenateNames;
|
|
35
36
|
private readonly cmd;
|
|
36
37
|
private newCommand;
|
|
37
|
-
private requiresAuthentication;
|
|
38
38
|
private requiresAnalyticsConsent;
|
|
39
39
|
private requiredOptionFlags;
|
|
40
40
|
private preconditionFn;
|
|
41
|
+
private options;
|
|
42
|
+
private commands;
|
|
41
43
|
constructor(ui: UI, analyticsClient: AnalyticsClientReporter, preCommandController: PreCommandController, cliDetails: CLIDetails | undefined, cmd?: commander.Command, expectsArguments?: boolean, analyticsName?: string | undefined);
|
|
42
44
|
version(str: string, flags?: string): this;
|
|
43
|
-
command(name: string): Command;
|
|
45
|
+
command(name: string, opts?: commander.CommandOptions): Command;
|
|
46
|
+
deprecatedCommand(oldName: string, newName: string, stubController: StubController): void;
|
|
44
47
|
getAnalyticsName(): string | undefined;
|
|
45
48
|
deprecate(newCommand: string): this;
|
|
46
49
|
description(desc: string): this;
|
|
@@ -55,6 +58,8 @@ export declare class Command {
|
|
|
55
58
|
exitOverride: (listener: (err: any) => void) => this;
|
|
56
59
|
getDefinedCommands(): commander.Command[];
|
|
57
60
|
getDefinedOptions(): commander.Option[];
|
|
61
|
+
getCmdName(): string;
|
|
62
|
+
getCommands(): Command[];
|
|
58
63
|
environmentOption(): this;
|
|
59
64
|
siteAndProductOption(): this;
|
|
60
65
|
requireNoAuthentication(): this;
|
|
@@ -63,7 +68,6 @@ export declare class Command {
|
|
|
63
68
|
actionProcessor: (cb: (...cbArgs: any[]) => ActionResult, ...args: any[]) => Promise<void>;
|
|
64
69
|
configureOutput(obj: OutputConfiguration): this;
|
|
65
70
|
private checkPreconditions;
|
|
66
|
-
private checkAuthentication;
|
|
67
71
|
private checkVersion;
|
|
68
72
|
private validateContext;
|
|
69
73
|
private findLastValidCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command-line/command.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,cAAc,EAAU,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command-line/command.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,cAAc,EAAU,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AASpE,OAAO,EAAQ,EAAE,EAAmB,MAAM,mBAAmB,CAAC;AAI9D,OAAO,EAAE,UAAU,EAA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