@appland/appmap 3.5.1 → 3.6.3
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 +36 -0
- package/built/appmap.html +3 -0
- package/built/main.js.LICENSE.txt +28 -0
- package/built/main.js.map +1 -0
- package/built/package.json +22 -3
- package/built/src/cli.js +4 -0
- package/built/src/cli.js.map +1 -1
- package/built/src/cmds/agentInstaller/agentInstallerProcedure.js +3 -4
- package/built/src/cmds/agentInstaller/agentInstallerProcedure.js.map +1 -1
- package/built/src/cmds/agentInstaller/commandRunner.js +2 -2
- package/built/src/cmds/agentInstaller/commandRunner.js.map +1 -1
- package/built/src/cmds/agentInstaller/install-agent.js +4 -3
- package/built/src/cmds/agentInstaller/install-agent.js.map +1 -1
- package/built/src/cmds/agentInstaller/javaAgentInstaller.js +3 -2
- package/built/src/cmds/agentInstaller/javaAgentInstaller.js.map +1 -1
- package/built/src/cmds/agentInstaller/pythonAgentInstaller.js +1 -1
- package/built/src/cmds/agentInstaller/pythonAgentInstaller.js.map +1 -1
- package/built/src/cmds/{agentInstaller/errors.js → errors.js} +0 -0
- package/built/src/cmds/errors.js.map +1 -0
- package/built/src/cmds/open/open.js +40 -0
- package/built/src/cmds/open/open.js.map +1 -0
- package/built/src/cmds/open/openers.js +47 -0
- package/built/src/cmds/open/openers.js.map +1 -0
- package/built/src/cmds/open/serveAndOpenAppMap.js +82 -0
- package/built/src/cmds/open/serveAndOpenAppMap.js.map +1 -0
- package/built/src/cmds/open/showAppMap.js +30 -0
- package/built/src/cmds/open/showAppMap.js.map +1 -0
- package/built/src/cmds/record/configureConnection.js +16 -0
- package/built/src/cmds/record/configureConnection.js.map +1 -0
- package/built/src/cmds/record/configureHostAndPort.js +38 -0
- package/built/src/cmds/record/configureHostAndPort.js.map +1 -0
- package/built/src/cmds/record/configureRemainingRequestOptions.js +29 -0
- package/built/src/cmds/record/configureRemainingRequestOptions.js.map +1 -0
- package/built/src/cmds/record/confirmProcessCharacteristics.js +70 -0
- package/built/src/cmds/record/confirmProcessCharacteristics.js.map +1 -0
- package/built/src/cmds/record/createRecording.js +42 -0
- package/built/src/cmds/record/createRecording.js.map +1 -0
- package/built/src/cmds/record/intro.js +22 -0
- package/built/src/cmds/record/intro.js.map +1 -0
- package/built/src/cmds/record/ready.js +19 -0
- package/built/src/cmds/record/ready.js.map +1 -0
- package/built/src/cmds/record/record.js +33 -0
- package/built/src/cmds/record/record.js.map +1 -0
- package/built/src/cmds/record/remoteRecording.js +62 -0
- package/built/src/cmds/record/remoteRecording.js.map +1 -0
- package/built/src/cmds/record/testConnection.js +35 -0
- package/built/src/cmds/record/testConnection.js.map +1 -0
- package/built/src/cmds/record/validate.js +2 -0
- package/built/src/cmds/record/validate.js.map +1 -0
- package/built/src/cmds/runCommand.js +31 -0
- package/built/src/cmds/runCommand.js.map +1 -0
- package/built/src/cmds/{agentInstaller/userInteraction.js → userInteraction.js} +7 -1
- package/built/src/cmds/userInteraction.js.map +1 -0
- package/built/src/html/page.js +27 -0
- package/built/src/html/page.js.map +1 -0
- package/package.json +22 -3
- package/built/src/cmds/agentInstaller/errors.js.map +0 -1
- package/built/src/cmds/agentInstaller/userInteraction.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
const openers_1 = require("./openers");
|
|
8
|
+
const Openers = [
|
|
9
|
+
{ name: 'Browser tab', fn: openers_1.openInBrowser },
|
|
10
|
+
{ name: 'VS Code', fn: openers_1.openInVSCode },
|
|
11
|
+
{ name: 'IntelliJ', toolId: 'idea', fn: openers_1.openInTool },
|
|
12
|
+
{ name: 'PyCharm', toolId: 'pycharm', fn: openers_1.openInTool },
|
|
13
|
+
{ name: 'RubyMine', toolId: 'x-mine', fn: openers_1.openInTool },
|
|
14
|
+
];
|
|
15
|
+
async function showAppMap(appMapFile) {
|
|
16
|
+
userInteraction_1.default.progress(`There are three options for viewing the AppMap. Please choose one (you can do this as many times as you'd like).`);
|
|
17
|
+
const { outputTool } = await userInteraction_1.default.prompt({
|
|
18
|
+
type: 'list',
|
|
19
|
+
name: 'outputTool',
|
|
20
|
+
message: 'How would you like to view your AppMap:',
|
|
21
|
+
choices: Openers.map((o) => o.name).concat(['Exit']),
|
|
22
|
+
});
|
|
23
|
+
const opener = Openers.find((o) => o.name === outputTool);
|
|
24
|
+
if (opener) {
|
|
25
|
+
await opener.fn(appMapFile, opener.toolId);
|
|
26
|
+
await showAppMap(appMapFile);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = showAppMap;
|
|
30
|
+
//# sourceMappingURL=showAppMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showAppMap.js","sourceRoot":"","sources":["../../../../src/cmds/open/showAppMap.ts"],"names":[],"mappings":";;;;;AAAA,yEAAoC;AACpC,uCAAoE;AAQpE,MAAM,OAAO,GAAa;IACxB,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,uBAAa,EAAE;IAC1C,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,sBAAY,EAAE;IACrC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,oBAAU,EAAE;IACpD,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,oBAAU,EAAE;IACtD,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,oBAAU,EAAE;CACvD,CAAC;AAEa,KAAK,UAAU,UAAU,CAAC,UAAkB;IACzD,yBAAE,CAAC,QAAQ,CACT,kHAAkH,CACnH,CAAC;IACF,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QACrC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,yCAAyC;QAClD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;KACrD,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IAC1D,IAAI,MAAM,EAAE;QACV,MAAM,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;KAC9B;AACH,CAAC;AAhBD,6BAgBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const configureHostAndPort_1 = __importDefault(require("./configureHostAndPort"));
|
|
7
|
+
const configureRemainingRequestOptions_1 = __importDefault(require("./configureRemainingRequestOptions"));
|
|
8
|
+
const confirmProcessCharacteristics_1 = __importDefault(require("./confirmProcessCharacteristics"));
|
|
9
|
+
async function configureConnection(requestOptions) {
|
|
10
|
+
Object.keys(requestOptions).forEach((k) => (requestOptions[k] = null));
|
|
11
|
+
await configureHostAndPort_1.default(requestOptions);
|
|
12
|
+
await confirmProcessCharacteristics_1.default(requestOptions);
|
|
13
|
+
await configureRemainingRequestOptions_1.default(requestOptions);
|
|
14
|
+
}
|
|
15
|
+
exports.default = configureConnection;
|
|
16
|
+
//# sourceMappingURL=configureConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureConnection.js","sourceRoot":"","sources":["../../../../src/cmds/record/configureConnection.ts"],"names":[],"mappings":";;;;;AACA,kFAA0D;AAC1D,0GAAkF;AAClF,oGAA4E;AAE7D,KAAK,UAAU,mBAAmB,CAC/C,cAA8B;IAE9B,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAEvE,MAAM,8BAAoB,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,uCAA6B,CAAC,cAAc,CAAC,CAAC;IACpD,MAAM,0CAAgC,CAAC,cAAc,CAAC,CAAC;AACzD,CAAC;AARD,sCAQC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
async function default_1(options) {
|
|
8
|
+
options.hostname = null;
|
|
9
|
+
options.port = null;
|
|
10
|
+
const { useLocalhost } = await userInteraction_1.default.prompt({
|
|
11
|
+
type: 'confirm',
|
|
12
|
+
name: 'useLocalhost',
|
|
13
|
+
message: 'Is your app running on localhost (your machine)?',
|
|
14
|
+
default: 'y',
|
|
15
|
+
});
|
|
16
|
+
if (!useLocalhost) {
|
|
17
|
+
options.hostname = await userInteraction_1.default.prompt({
|
|
18
|
+
type: 'input',
|
|
19
|
+
name: 'hostname',
|
|
20
|
+
message: 'Enter the hostname that your server is running on:',
|
|
21
|
+
})['hostname'];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
options.hostname = 'localhost';
|
|
25
|
+
}
|
|
26
|
+
while (!options.port) {
|
|
27
|
+
const { portNumber: answer } = await userInteraction_1.default.prompt({
|
|
28
|
+
type: 'number',
|
|
29
|
+
name: 'portNumber',
|
|
30
|
+
message: 'Enter the port number on which your server is listening:',
|
|
31
|
+
});
|
|
32
|
+
if (answer) {
|
|
33
|
+
options.port = answer;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = default_1;
|
|
38
|
+
//# sourceMappingURL=configureHostAndPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureHostAndPort.js","sourceRoot":"","sources":["../../../../src/cmds/record/configureHostAndPort.ts"],"names":[],"mappings":";;;;;AACA,yEAAoC;AAErB,KAAK,oBAAW,OAAuB;IACpD,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAEpB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QACvC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,kDAAkD;QAC3D,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IACH,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,CAAC,QAAQ,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;YACjC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,oDAAoD;SAC9D,CAAC,CAAC,UAAU,CAAC,CAAC;KAChB;SAAM;QACL,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC;KAChC;IAED,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE;QACpB,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;YAC7C,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,0DAA0D;SACpE,CAAC,CAAC;QACH,IAAI,MAAM,EAAE;YACV,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;SACvB;KACF;AACH,CAAC;AA9BD,4BA8BC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
const ready_1 = __importDefault(require("./ready"));
|
|
8
|
+
async function configureRemainingRequestOptions(requestOptions) {
|
|
9
|
+
requestOptions.path = (await userInteraction_1.default.prompt({
|
|
10
|
+
type: 'input',
|
|
11
|
+
name: 'baseURL',
|
|
12
|
+
message: `Enter the base URL of your application. Use this default unless you've mounted your app somewhere other than the root context:`,
|
|
13
|
+
default: '/',
|
|
14
|
+
}))['baseURL'];
|
|
15
|
+
const { useSSL } = await userInteraction_1.default.prompt({
|
|
16
|
+
type: 'confirm',
|
|
17
|
+
name: 'useSSL',
|
|
18
|
+
message: 'Does your application require SSL?',
|
|
19
|
+
default: false,
|
|
20
|
+
});
|
|
21
|
+
requestOptions.protocol = useSSL ? 'https:' : 'http:';
|
|
22
|
+
userInteraction_1.default.progress(`OK. Now I will try and connect to the AppMap recording agent.`);
|
|
23
|
+
userInteraction_1.default.progress(`Here's the URL I will use:\n`);
|
|
24
|
+
userInteraction_1.default.progress(`${requestOptions.protocol}//${requestOptions.hostname}:${requestOptions.port}${requestOptions.path}_appmap/record`);
|
|
25
|
+
userInteraction_1.default.progress('');
|
|
26
|
+
await ready_1.default();
|
|
27
|
+
}
|
|
28
|
+
exports.default = configureRemainingRequestOptions;
|
|
29
|
+
//# sourceMappingURL=configureRemainingRequestOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureRemainingRequestOptions.js","sourceRoot":"","sources":["../../../../src/cmds/record/configureRemainingRequestOptions.ts"],"names":[],"mappings":";;;;;AACA,yEAAoC;AACpC,oDAA4B;AAEb,KAAK,UAAU,gCAAgC,CAC5D,cAA8B;IAE9B,cAAc,CAAC,IAAI,GAAG,CACpB,MAAM,yBAAE,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,gIAAgI;QACzI,OAAO,EAAE,GAAG;KACb,CAAC,CACH,CAAC,SAAS,CAAC,CAAC;IAEb,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QACjC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,oCAAoC;QAC7C,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IACH,cAAc,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAEtD,yBAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC,CAAC;IAC7E,yBAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC;IAC5C,yBAAE,CAAC,QAAQ,CACT,GAAG,cAAc,CAAC,QAAQ,KAAK,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,gBAAgB,CACpH,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEhB,MAAM,eAAK,EAAE,CAAC;AAChB,CAAC;AA5BD,mDA4BC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
const port_pid_1 = __importDefault(require("port-pid"));
|
|
8
|
+
const ps_node_1 = __importDefault(require("ps-node"));
|
|
9
|
+
const configureHostAndPort_1 = __importDefault(require("./configureHostAndPort"));
|
|
10
|
+
const ready_1 = __importDefault(require("./ready"));
|
|
11
|
+
async function confirmProcessCharacteristics(requestOptions) {
|
|
12
|
+
if (requestOptions.hostname !== 'localhost') {
|
|
13
|
+
userInteraction_1.default.progress(`Since your app isn't running on localhost, I can't look up its info by port number. So let's continue with the process.`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
userInteraction_1.default.progress(`OK, since your app is running on localhost, I'm going to try and get more info about it
|
|
17
|
+
using a reverse-lookup by port number.`);
|
|
18
|
+
userInteraction_1.default.status = `Looking up the application process info`;
|
|
19
|
+
const printPid = async (pid) => {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
ps_node_1.default.lookup({ pid }, function (err, resultList) {
|
|
22
|
+
if (err) {
|
|
23
|
+
userInteraction_1.default.error(`Process ${pid} not found: ${err}`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const process = resultList[0];
|
|
27
|
+
if (process) {
|
|
28
|
+
userInteraction_1.default.success(process.arguments.join(' '));
|
|
29
|
+
resolve();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
userInteraction_1.default.error(`Process ${pid} not found`);
|
|
33
|
+
resolve();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
await port_pid_1.default(requestOptions.port).then(async (pids) => {
|
|
39
|
+
if (pids && pids.tcp.length > 0) {
|
|
40
|
+
return Promise.all(pids.tcp.map(printPid));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
userInteraction_1.default.error(`No process found on port ${requestOptions.port}`);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
userInteraction_1.default.progress('');
|
|
47
|
+
const { looksGood } = await userInteraction_1.default.prompt({
|
|
48
|
+
type: 'confirm',
|
|
49
|
+
name: 'looksGood',
|
|
50
|
+
message: 'Does this look right?',
|
|
51
|
+
default: 'y',
|
|
52
|
+
});
|
|
53
|
+
if (!looksGood) {
|
|
54
|
+
const { reconfigureOrRetry } = await userInteraction_1.default.prompt({
|
|
55
|
+
type: 'list',
|
|
56
|
+
choices: ['reconfigure', 'retry'],
|
|
57
|
+
name: 'reconfigureOrRetry',
|
|
58
|
+
message: 'Do you want to change the hostname and port number? Or do you want to adjust your app process parameters, restart it, and then I will retry?',
|
|
59
|
+
});
|
|
60
|
+
if (reconfigureOrRetry === 'reconfigure') {
|
|
61
|
+
await configureHostAndPort_1.default(requestOptions);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
await ready_1.default();
|
|
65
|
+
}
|
|
66
|
+
await confirmProcessCharacteristics(requestOptions);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = confirmProcessCharacteristics;
|
|
70
|
+
//# sourceMappingURL=confirmProcessCharacteristics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmProcessCharacteristics.js","sourceRoot":"","sources":["../../../../src/cmds/record/confirmProcessCharacteristics.ts"],"names":[],"mappings":";;;;;AAAA,yEAAoC;AACpC,wDAA+B;AAC/B,sDAAyB;AAEzB,kFAA0D;AAC1D,oDAA4B;AAEb,KAAK,UAAU,6BAA6B,CACzD,cAA8B;IAE9B,IAAI,cAAc,CAAC,QAAQ,KAAK,WAAW,EAAE;QAC3C,yBAAE,CAAC,QAAQ,CACT,yHAAyH,CAC1H,CAAC;QACF,OAAO;KACR;IAED,yBAAE,CAAC,QAAQ,CAAC;uCACyB,CAAC,CAAC;IACvC,yBAAE,CAAC,MAAM,GAAG,yCAAyC,CAAC;IAEtD,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAW,EAAiB,EAAE;QACpD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,iBAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,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7C,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC;YACjC,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EACL,8IAA8I;SACjJ,CAAC,CAAC;QAEH,IAAI,kBAAkB,KAAK,aAAa,EAAE;YACxC,MAAM,8BAAoB,CAAC,cAAc,CAAC,CAAC;SAC5C;aAAM;YACL,MAAM,eAAK,EAAE,CAAC;SACf;QAED,MAAM,6BAA6B,CAAC,cAAc,CAAC,CAAC;KACrD;AACH,CAAC;AAtED,gDAsEC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
const remoteRecording_1 = __importDefault(require("./remoteRecording"));
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
async function createRecording(requestOptions) {
|
|
10
|
+
await userInteraction_1.default.prompt({
|
|
11
|
+
type: 'confirm',
|
|
12
|
+
name: 'startRecording',
|
|
13
|
+
message: 'Start recording?',
|
|
14
|
+
default: 'y',
|
|
15
|
+
});
|
|
16
|
+
const rr = new remoteRecording_1.default(requestOptions);
|
|
17
|
+
rr.start();
|
|
18
|
+
userInteraction_1.default.progress('\nRecording started.\n');
|
|
19
|
+
userInteraction_1.default.progress(`Now, interact with your app in any way you'd like. Click through the UI, run Selenium tests that interact with it, make web service calls, whatever you like.`);
|
|
20
|
+
userInteraction_1.default.status = 'Recording is active';
|
|
21
|
+
await userInteraction_1.default.prompt({
|
|
22
|
+
type: 'confirm',
|
|
23
|
+
name: 'stopRecording',
|
|
24
|
+
message: 'Stop recording?',
|
|
25
|
+
default: 'y',
|
|
26
|
+
});
|
|
27
|
+
const data = await rr.stop();
|
|
28
|
+
userInteraction_1.default.success(`Recording has finished, with ${data.length} bytes of data.`);
|
|
29
|
+
const { appMapName } = await userInteraction_1.default.prompt({
|
|
30
|
+
type: 'input',
|
|
31
|
+
name: 'appMapName',
|
|
32
|
+
message: 'Choose a name for your AppMap:',
|
|
33
|
+
default: 'My recording',
|
|
34
|
+
});
|
|
35
|
+
const fileName = `${appMapName}.appmap.json`;
|
|
36
|
+
userInteraction_1.default.status = `Saving recording to ${fileName}`;
|
|
37
|
+
fs_1.promises.writeFile(fileName, data);
|
|
38
|
+
userInteraction_1.default.success('AppMap saved');
|
|
39
|
+
return fileName;
|
|
40
|
+
}
|
|
41
|
+
exports.default = createRecording;
|
|
42
|
+
//# sourceMappingURL=createRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRecording.js","sourceRoot":"","sources":["../../../../src/cmds/record/createRecording.ts"],"names":[],"mappings":";;;;;AACA,yEAAoC;AACpC,wEAAgD;AAChD,2BAAoC;AAErB,KAAK,UAAU,eAAe,CAC3C,cAA8B;IAE9B,MAAM,yBAAE,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,IAAI,yBAAe,CAAC,cAAc,CAAC,CAAC;IAC/C,EAAE,CAAC,KAAK,EAAE,CAAC;IAEX,yBAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;IACtC,yBAAE,CAAC,QAAQ,CACT,+JAA+J,CAChK,CAAC;IAEF,yBAAE,CAAC,MAAM,GAAG,qBAAqB,CAAC;IAElC,MAAM,yBAAE,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;IAE7B,yBAAE,CAAC,OAAO,CAAC,gCAAgC,IAAK,CAAC,MAAM,iBAAiB,CAAC,CAAC;IAE1E,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QACrC,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,gCAAgC;QACzC,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,GAAG,UAAU,cAAc,CAAC;IAC7C,yBAAE,CAAC,MAAM,GAAG,uBAAuB,QAAQ,EAAE,CAAC;IAC9C,aAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAK,CAAC,CAAC;IAE9B,yBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC;AA7CD,kCA6CC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
const ready_1 = __importDefault(require("./ready"));
|
|
8
|
+
async function default_1() {
|
|
9
|
+
userInteraction_1.default.progress(`To create a recording, the first thing you need to do is run your app using
|
|
10
|
+
the instructions in the AppMap documentation. Choose the most suitable link here,
|
|
11
|
+
then configure and launch your app process. Press enter wen you're ready to continue.`);
|
|
12
|
+
userInteraction_1.default.progress(`
|
|
13
|
+
Rails: https://appland.com/docs/reference/appmap-ruby.html#remote-recording
|
|
14
|
+
Django: https://appland.com/docs/reference/appmap-python.html#django
|
|
15
|
+
Flask: https://appland.com/docs/reference/appmap-python.html#flask
|
|
16
|
+
Java - IntelliJ: (TBD)
|
|
17
|
+
Java - Raw JDK: (TBD)
|
|
18
|
+
`);
|
|
19
|
+
return ready_1.default();
|
|
20
|
+
}
|
|
21
|
+
exports.default = default_1;
|
|
22
|
+
//# sourceMappingURL=intro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro.js","sourceRoot":"","sources":["../../../../src/cmds/record/intro.ts"],"names":[],"mappings":";;;;;AAAA,yEAAoC;AACpC,oDAA4B;AAEb,KAAK;IAClB,yBAAE,CAAC,QAAQ,CAAC;;wFAE0E,CAAC,CAAC;IACxF,yBAAE,CAAC,QAAQ,CAAC;;;;;;OAMP,CAAC,CAAC;IAEP,OAAO,eAAK,EAAE,CAAC;AACjB,CAAC;AAbD,4BAaC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
async function ready() {
|
|
8
|
+
const { ready } = await userInteraction_1.default.prompt({
|
|
9
|
+
type: 'confirm',
|
|
10
|
+
name: 'ready',
|
|
11
|
+
message: 'Ready?',
|
|
12
|
+
default: 'y',
|
|
13
|
+
});
|
|
14
|
+
if (!ready) {
|
|
15
|
+
return ready();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = ready;
|
|
19
|
+
//# sourceMappingURL=ready.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ready.js","sourceRoot":"","sources":["../../../../src/cmds/record/ready.ts"],"names":[],"mappings":";;;;;AAAA,yEAAoC;AAErB,KAAK,UAAU,KAAK;IACjC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QAChC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IACH,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,KAAK,EAAE,CAAC;KAChB;AACH,CAAC;AAVD,wBAUC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const runCommand_1 = __importDefault(require("../runCommand"));
|
|
9
|
+
const intro_1 = __importDefault(require("./intro"));
|
|
10
|
+
const configureConnection_1 = __importDefault(require("./configureConnection"));
|
|
11
|
+
const testConnection_1 = __importDefault(require("./testConnection"));
|
|
12
|
+
const createRecording_1 = __importDefault(require("./createRecording"));
|
|
13
|
+
const showAppMap_1 = __importDefault(require("../open/showAppMap"));
|
|
14
|
+
exports.command = 'record';
|
|
15
|
+
exports.describe = 'Create an AppMap via interactive recording, aka remote recording.';
|
|
16
|
+
const builder = (args) => {
|
|
17
|
+
return args.strict();
|
|
18
|
+
};
|
|
19
|
+
exports.builder = builder;
|
|
20
|
+
const handler = async (argv) => {
|
|
21
|
+
utils_1.verbose(argv.verbose);
|
|
22
|
+
const commandFn = async () => {
|
|
23
|
+
await intro_1.default();
|
|
24
|
+
let requestOptions = {};
|
|
25
|
+
await configureConnection_1.default(requestOptions);
|
|
26
|
+
await testConnection_1.default(requestOptions);
|
|
27
|
+
const appMapFile = await createRecording_1.default(requestOptions);
|
|
28
|
+
await showAppMap_1.default(appMapFile);
|
|
29
|
+
};
|
|
30
|
+
return runCommand_1.default(commandFn);
|
|
31
|
+
};
|
|
32
|
+
exports.handler = handler;
|
|
33
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/cmds/record/record.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAsC;AACtC,+DAAuC;AAEvC,oDAA4B;AAC5B,gFAAwD;AACxD,sEAA8C;AAC9C,wEAAgD;AAChD,oEAA4C;AAE/B,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,QAAQ,GACnB,mEAAmE,CAAC;AAE/D,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE;IAC9B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;AACvB,CAAC,CAAC;AAFW,QAAA,OAAO,WAElB;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IACpC,eAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEtB,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC3B,MAAM,eAAK,EAAE,CAAC;QAEd,IAAI,cAAc,GAAmB,EAAE,CAAC;QAExC,MAAM,6BAAmB,CAAC,cAAc,CAAC,CAAC;QAC1C,MAAM,wBAAc,CAAC,cAAc,CAAC,CAAC;QACrC,MAAM,UAAU,GAAG,MAAM,yBAAe,CAAC,cAAc,CAAC,CAAC;QACzD,MAAM,oBAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,OAAO,oBAAU,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;AAfW,QAAA,OAAO,WAelB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const https_1 = require("https");
|
|
4
|
+
const http_1 = require("http");
|
|
5
|
+
const HTTP = {
|
|
6
|
+
'http:': http_1.request,
|
|
7
|
+
'https:': https_1.request,
|
|
8
|
+
};
|
|
9
|
+
const makeRequest = async (rr, path, method, statusCodes = [200, 201, 204]) => {
|
|
10
|
+
const options = Object.assign({}, rr.requestOptions, {
|
|
11
|
+
path,
|
|
12
|
+
method,
|
|
13
|
+
});
|
|
14
|
+
const requestFn = HTTP[rr.requestOptions.protocol];
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const req = requestFn(options, (res) => {
|
|
17
|
+
if (!statusCodes.includes(res.statusCode)) {
|
|
18
|
+
return reject(`HTTP status code ${res.statusCode}`);
|
|
19
|
+
}
|
|
20
|
+
let data = '';
|
|
21
|
+
res.setEncoding('utf8');
|
|
22
|
+
res.on('data', (chunk) => {
|
|
23
|
+
data += chunk;
|
|
24
|
+
});
|
|
25
|
+
res.on('end', () => {
|
|
26
|
+
resolve({ statusCode: res.statusCode, data });
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
req.on('error', (e) => {
|
|
30
|
+
reject(e.message);
|
|
31
|
+
});
|
|
32
|
+
req.end();
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
class RemoteRecording {
|
|
36
|
+
constructor(requestOptions) {
|
|
37
|
+
this.requestOptions = requestOptions;
|
|
38
|
+
}
|
|
39
|
+
async start() {
|
|
40
|
+
const statusCode = (await makeRequest(this, `${this.requestOptions.path}_appmap/record`, 'POST', [200, 201, 409])).statusCode;
|
|
41
|
+
if (statusCode < 300) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async status() {
|
|
49
|
+
return JSON.parse((await makeRequest(this, `${this.requestOptions.path}_appmap/record`, 'GET')).data);
|
|
50
|
+
}
|
|
51
|
+
async stop() {
|
|
52
|
+
const { statusCode, data } = await makeRequest(this, `${this.requestOptions.path}_appmap/record`, 'DELETE', [200, 404]);
|
|
53
|
+
if (statusCode === 200) {
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = RemoteRecording;
|
|
62
|
+
//# sourceMappingURL=remoteRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteRecording.js","sourceRoot":"","sources":["../../../../src/cmds/record/remoteRecording.ts"],"names":[],"mappings":";;AAAA,iCAAgD;AAChD,+BAA+E;AAI/E,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,cAAW;IACpB,QAAQ,EAAE,eAAY;CACvB,CAAC;AAEF,MAAM,WAAW,GAAG,KAAK,EACvB,EAAmB,EACnB,IAAY,EACZ,MAAc,EACd,cAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzB,EAAE;IAChB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,EAAE;QACnD,IAAI;QACJ,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,QAAS,CAAC,CAAC;IACpD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,GAAoB,EAAE,EAAE;YACtD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAW,CAAC,EAAE;gBAC1C,OAAO,MAAM,CAAC,oBAAoB,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;aACrD;YAED,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACxB,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC/B,IAAI,IAAI,KAAK,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,OAAO,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;Y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
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
7
|
+
const configureConnection_1 = __importDefault(require("./configureConnection"));
|
|
8
|
+
const remoteRecording_1 = __importDefault(require("./remoteRecording"));
|
|
9
|
+
async function testConnection(requestOptions) {
|
|
10
|
+
const retryConnection = async () => {
|
|
11
|
+
const { reconfigure } = await userInteraction_1.default.prompt({
|
|
12
|
+
type: 'confirm',
|
|
13
|
+
name: 'reconfigure',
|
|
14
|
+
message: 'Do you want to change any of the server connection parameters?',
|
|
15
|
+
});
|
|
16
|
+
if (reconfigure) {
|
|
17
|
+
await configureConnection_1.default(requestOptions);
|
|
18
|
+
}
|
|
19
|
+
await testConnection(requestOptions);
|
|
20
|
+
};
|
|
21
|
+
userInteraction_1.default.status = `Performing a test connection to the app`;
|
|
22
|
+
let status = null;
|
|
23
|
+
while (!status) {
|
|
24
|
+
try {
|
|
25
|
+
status = await new remoteRecording_1.default(requestOptions).status();
|
|
26
|
+
userInteraction_1.default.success(`Great! I am able to connect to the AppMap agent.`);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
userInteraction_1.default.error(`Uh-oh. I can't connect to the AppMap agent there. The error I got is:\n\n${e}\n`);
|
|
30
|
+
await retryConnection();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = testConnection;
|
|
35
|
+
//# sourceMappingURL=testConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testConnection.js","sourceRoot":"","sources":["../../../../src/cmds/record/testConnection.ts"],"names":[],"mappings":";;;;;AACA,yEAAoC;AACpC,gFAAwD;AACxD,wEAAgD;AAGjC,KAAK,UAAU,cAAc,CAAC,cAA8B;IACzE,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;QACjC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;YACtC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,gEAAgE;SAC1E,CAAC,CAAC;QACH,IAAI,WAAW,EAAE;YACf,MAAM,6BAAmB,CAAC,cAAc,CAAC,CAAC;SAC3C;QACD,MAAM,cAAc,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,yBAAE,CAAC,MAAM,GAAG,yCAAyC,CAAC;IAEtD,IAAI,MAAM,GAAiC,IAAI,CAAC;IAChD,OAAO,CAAC,MAAM,EAAE;QACd,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,yBAAe,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC;YAC5D,yBAAE,CAAC,OAAO,CAAC,kDAAkD,CAAC,CAAC;SAChE;QAAC,OAAO,CAAC,EAAE;YACV,yBAAE,CAAC,KAAK,CACN,4EAA4E,CAAC,IAAI,CAClF,CAAC;YACF,MAAM,eAAe,EAAE,CAAC;SACzB;KACF;AACH,CAAC;AA3BD,iCA2BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../src/cmds/record/validate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const userInteraction_1 = __importDefault(require("./userInteraction"));
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
11
|
+
async function runCommand(fn) {
|
|
12
|
+
return fn().catch((err) => {
|
|
13
|
+
if (err instanceof errors_1.ValidationError) {
|
|
14
|
+
console.warn(err.message);
|
|
15
|
+
return yargs_1.default.exit(1, err);
|
|
16
|
+
}
|
|
17
|
+
if (err instanceof errors_1.AbortError) {
|
|
18
|
+
return yargs_1.default.exit(2, err);
|
|
19
|
+
}
|
|
20
|
+
if (utils_1.verbose()) {
|
|
21
|
+
userInteraction_1.default.error(err);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
userInteraction_1.default.error(`An error occurred: ${err.toString().split('\n')[0]}`);
|
|
25
|
+
userInteraction_1.default.error(`Try re-running the command with the ${chalk_1.default.red('verbose')} flag (${chalk_1.default.red('-v')}).`);
|
|
26
|
+
}
|
|
27
|
+
yargs_1.default.exit(3, err);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.default = runCommand;
|
|
31
|
+
//# sourceMappingURL=runCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCommand.js","sourceRoot":"","sources":["../../../src/cmds/runCommand.ts"],"names":[],"mappings":";;;;;AAAA,qCAAuD;AACvD,oCAAmC;AACnC,wEAAmC;AACnC,kDAA0B;AAC1B,kDAA0B;AAEX,KAAK,UAAU,UAAU,CAAC,EAAsB;IAC7D,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACxB,IAAI,GAAG,YAAY,wBAAe,EAAE;YAClC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC1B,OAAO,eAAK,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3B;QACD,IAAI,GAAG,YAAY,mBAAU,EAAE;YAC7B,OAAO,eAAK,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3B;QAED,IAAI,eAAO,EAAE,EAAE;YACb,yBAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACf;aAAM;YACL,yBAAE,CAAC,KAAK,CAAC,sBAAsB,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAChE,yBAAE,CAAC,KAAK,CACN,uCAAuC,eAAK,CAAC,GAAG,CAC9C,SAAS,CACV,UAAU,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAC/B,CAAC;SACH;QACD,eAAK,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAtBD,6BAsBC"}
|
|
@@ -7,7 +7,7 @@ exports.UserInteraction = void 0;
|
|
|
7
7
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
8
|
const ora_1 = __importDefault(require("ora"));
|
|
9
9
|
const boxen_1 = __importDefault(require("boxen"));
|
|
10
|
-
const utils_1 = require("
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
11
|
class UserInteraction {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.spinner = ora_1.default();
|
|
@@ -24,6 +24,9 @@ class UserInteraction {
|
|
|
24
24
|
}
|
|
25
25
|
return result;
|
|
26
26
|
}
|
|
27
|
+
progress(msg) {
|
|
28
|
+
console.log(msg);
|
|
29
|
+
}
|
|
27
30
|
success(msg) {
|
|
28
31
|
if (this.spinner.isSpinning) {
|
|
29
32
|
this.spinner.succeed();
|
|
@@ -43,6 +46,9 @@ class UserInteraction {
|
|
|
43
46
|
console.error('\n', msg);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
49
|
+
warn(msg) {
|
|
50
|
+
console.error(msg);
|
|
51
|
+
}
|
|
46
52
|
get status() {
|
|
47
53
|
return this.spinner.text;
|
|
48
54
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userInteraction.js","sourceRoot":"","sources":["../../../src/cmds/userInteraction.ts"],"names":[],"mapp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CAAC,CAAC;IACrB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM,CAAC,KAAa;QACtB,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;SACxB;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,eAAO,EAAE,EAAE;YAC1C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACtB;IACH,CAAC;CACF;AAlED,0CAkEC;AAED,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAC;AACjC,kBAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { default: Vue } = require('vue');
|
|
3
|
+
const { default: Vuex } = require('vuex');
|
|
4
|
+
const { default: plugin, VVsCodeExtension } = require('@appland/components');
|
|
5
|
+
require('@appland/diagrams/dist/style.css');
|
|
6
|
+
Vue.use(Vuex);
|
|
7
|
+
Vue.use(plugin);
|
|
8
|
+
async function initializeApp() {
|
|
9
|
+
return new Vue({
|
|
10
|
+
el: '#app',
|
|
11
|
+
render: (h) => h(VVsCodeExtension, {
|
|
12
|
+
ref: 'ui',
|
|
13
|
+
props: {
|
|
14
|
+
appMapUploadable: true,
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
async mounted() {
|
|
18
|
+
const params = new URL(document.location).searchParams;
|
|
19
|
+
const appmap = params.get('appmap');
|
|
20
|
+
const res = await fetch(`/appmap?file=${encodeURIComponent(appmap)}`);
|
|
21
|
+
const { ui } = this.$refs;
|
|
22
|
+
ui.loadData((await res.json()) || {});
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
initializeApp();
|
|
27
|
+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