@appland/appmap 3.20.0 → 3.21.0
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 +9 -0
- package/built/appmap.html +1 -1
- package/built/main.js.map +1 -1
- package/built/package.json +2 -1
- package/built/src/cmds/record/action/cancelRecording.js +14 -0
- package/built/src/cmds/record/action/cancelRecording.js.map +1 -0
- package/built/src/cmds/record/action/configureHostAndPort.js +35 -0
- package/built/src/cmds/record/action/configureHostAndPort.js.map +1 -0
- package/built/src/cmds/record/action/configureRemainingRequestOptions.js +36 -0
- package/built/src/cmds/record/action/configureRemainingRequestOptions.js.map +1 -0
- package/built/src/cmds/record/action/detectProcessCharacteristics.js +60 -0
- package/built/src/cmds/record/action/detectProcessCharacteristics.js.map +1 -0
- package/built/src/cmds/record/{createRecording.js → action/saveRecording.js} +9 -24
- package/built/src/cmds/record/action/saveRecording.js.map +1 -0
- package/built/src/cmds/record/action/startRecording.js +20 -0
- package/built/src/cmds/record/action/startRecording.js.map +1 -0
- package/built/src/cmds/record/action/stopRecording.js +11 -0
- package/built/src/cmds/record/action/stopRecording.js.map +1 -0
- package/built/src/cmds/record/configuration.js +126 -0
- package/built/src/cmds/record/configuration.js.map +1 -0
- package/built/src/cmds/record/prompt/recordingInProgress.js +29 -0
- package/built/src/cmds/record/prompt/recordingInProgress.js.map +1 -0
- package/built/src/cmds/record/record.js +16 -11
- package/built/src/cmds/record/record.js.map +1 -1
- package/built/src/cmds/record/state/abort.js +8 -0
- package/built/src/cmds/record/state/abort.js.map +1 -0
- package/built/src/cmds/record/state/agentAvailableAndReady.js +14 -0
- package/built/src/cmds/record/state/agentAvailableAndReady.js.map +1 -0
- package/built/src/cmds/record/state/agentIsRecording.js +45 -0
- package/built/src/cmds/record/state/agentIsRecording.js.map +1 -0
- package/built/src/cmds/record/state/agentNotAvailable.js +41 -0
- package/built/src/cmds/record/state/agentNotAvailable.js.map +1 -0
- package/built/src/cmds/record/state/agentProcessNotRunning.js +30 -0
- package/built/src/cmds/record/state/agentProcessNotRunning.js.map +1 -0
- package/built/src/cmds/record/state/initial.js +27 -0
- package/built/src/cmds/record/state/initial.js.map +1 -0
- package/built/src/cmds/record/state/recordingInProgress.js +14 -0
- package/built/src/cmds/record/state/recordingInProgress.js.map +1 -0
- package/built/src/cmds/record/state/recordingStopped.js +12 -0
- package/built/src/cmds/record/state/recordingStopped.js.map +1 -0
- package/built/src/cmds/record/test/isAgentAvailable.js +23 -0
- package/built/src/cmds/record/test/isAgentAvailable.js.map +1 -0
- package/built/src/cmds/record/test/isRecordingInProgress.js +13 -0
- package/built/src/cmds/record/test/isRecordingInProgress.js.map +1 -0
- package/built/src/cmds/record/types/exitCode.js +10 -0
- package/built/src/cmds/record/types/exitCode.js.map +1 -0
- package/built/src/cmds/record/types/fileName.js +3 -0
- package/built/src/cmds/record/types/fileName.js.map +1 -0
- package/built/src/cmds/record/types/remoteRecordingStatus.js +3 -0
- package/built/src/cmds/record/types/remoteRecordingStatus.js.map +1 -0
- package/built/src/cmds/record/types/state.js +3 -0
- package/built/src/cmds/record/types/state.js.map +1 -0
- package/built/src/cmds/userInteraction.js +11 -6
- package/built/src/cmds/userInteraction.js.map +1 -1
- package/package.json +4 -3
- package/built/src/cmds/record/configureConnection.js +0 -16
- package/built/src/cmds/record/configureConnection.js.map +0 -1
- package/built/src/cmds/record/configureHostAndPort.js +0 -38
- package/built/src/cmds/record/configureHostAndPort.js.map +0 -1
- package/built/src/cmds/record/configureRemainingRequestOptions.js +0 -28
- package/built/src/cmds/record/configureRemainingRequestOptions.js.map +0 -1
- package/built/src/cmds/record/confirmProcessCharacteristics.js +0 -75
- package/built/src/cmds/record/confirmProcessCharacteristics.js.map +0 -1
- package/built/src/cmds/record/createRecording.js.map +0 -1
- package/built/src/cmds/record/intro.js +0 -22
- package/built/src/cmds/record/intro.js.map +0 -1
- package/built/src/cmds/record/ready.js +0 -19
- package/built/src/cmds/record/ready.js.map +0 -1
- package/built/src/cmds/record/testConnection.js +0 -35
- package/built/src/cmds/record/testConnection.js.map +0 -1
package/built/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appland/appmap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": "built/src/cli.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@types/jsdom": "^16.2.13",
|
|
33
33
|
"@types/node": "^16.6.2",
|
|
34
34
|
"@types/sinon": "^10.0.2",
|
|
35
|
+
"@types/tmp": "^0.2.3",
|
|
35
36
|
"@types/w3c-xmlserializer": "^2.0.2",
|
|
36
37
|
"babel-loader": "^8.2.2",
|
|
37
38
|
"copy-webpack-plugin": "^9.0.1",
|
|
@@ -0,0 +1,14 @@
|
|
|
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 configuration_1 = require("../configuration");
|
|
8
|
+
const remoteRecording_1 = __importDefault(require("../remoteRecording"));
|
|
9
|
+
async function cancelRecording() {
|
|
10
|
+
await new remoteRecording_1.default(await (0, configuration_1.requestOptions)()).stop();
|
|
11
|
+
userInteraction_1.default.success('The recording has been cancelled.');
|
|
12
|
+
}
|
|
13
|
+
exports.default = cancelRecording;
|
|
14
|
+
//# sourceMappingURL=cancelRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancelRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/cancelRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,oDAAkD;AAClD,yEAAiD;AAElC,KAAK,UAAU,eAAe;IAC3C,MAAM,IAAI,yBAAe,CAAC,MAAM,IAAA,8BAAc,GAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzD,yBAAE,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAClD,CAAC;AAHD,kCAGC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 configuration_1 = require("../configuration");
|
|
8
|
+
async function configureHostAndPort() {
|
|
9
|
+
const defaultHostname = await (0, configuration_1.readSetting)('remote_recording.host', 'localhost');
|
|
10
|
+
const { hostname } = await userInteraction_1.default.prompt({
|
|
11
|
+
type: 'input',
|
|
12
|
+
name: 'hostname',
|
|
13
|
+
message: 'Enter the hostname that your server is running on:',
|
|
14
|
+
default: defaultHostname,
|
|
15
|
+
});
|
|
16
|
+
if (hostname !== defaultHostname) {
|
|
17
|
+
await (0, configuration_1.writeSetting)('remote_recording.host', hostname);
|
|
18
|
+
}
|
|
19
|
+
let port;
|
|
20
|
+
const defaultPort = await (0, configuration_1.readSetting)('remote_recording.port', 3000);
|
|
21
|
+
while (!port) {
|
|
22
|
+
const { portNumber: answer } = await userInteraction_1.default.prompt({
|
|
23
|
+
type: 'input',
|
|
24
|
+
name: 'portNumber',
|
|
25
|
+
message: 'Enter the port number on which your server is listening:',
|
|
26
|
+
default: defaultPort,
|
|
27
|
+
});
|
|
28
|
+
port = parseInt(answer);
|
|
29
|
+
if (port !== NaN && port !== defaultPort) {
|
|
30
|
+
await (0, configuration_1.writeSetting)('remote_recording.port', port);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = configureHostAndPort;
|
|
35
|
+
//# sourceMappingURL=configureHostAndPort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureHostAndPort.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/configureHostAndPort.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,oDAA6D;AAE9C,KAAK,UAAU,oBAAoB;IAChD,MAAM,eAAe,GAAG,MAAM,IAAA,2BAAW,EACvC,uBAAuB,EACvB,WAAW,CACZ,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QACnC,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,oDAAoD;QAC7D,OAAO,EAAE,eAAe;KACzB,CAAC,CAAC;IAEH,IAAI,QAAQ,KAAK,eAAe,EAAE;QAChC,MAAM,IAAA,4BAAY,EAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;KACvD;IAED,IAAI,IAAwB,CAAC;IAC7B,MAAM,WAAW,GAAG,MAAM,IAAA,2BAAW,EAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IACrE,OAAO,CAAC,IAAI,EAAE;QACZ,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;YAC7C,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,0DAA0D;YACnE,OAAO,EAAE,WAAW;SACrB,CAAC,CAAC;QACH,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,WAAW,EAAE;YACxC,MAAM,IAAA,4BAAY,EAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;SACnD;KACF;AACH,CAAC;AA9BD,uCA8BC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 configuration_1 = require("../configuration");
|
|
8
|
+
async function configureRemainingRequestOptions() {
|
|
9
|
+
const defaultPath = await (0, configuration_1.readConfigOption)('remote_recording.path', '/');
|
|
10
|
+
const { baseURL: path } = await userInteraction_1.default.prompt({
|
|
11
|
+
type: 'input',
|
|
12
|
+
name: 'baseURL',
|
|
13
|
+
message: `Enter the base URL of your application:`,
|
|
14
|
+
default: defaultPath,
|
|
15
|
+
});
|
|
16
|
+
if (path !== defaultPath) {
|
|
17
|
+
await (0, configuration_1.writeConfigOption)('remote_recording.path', path);
|
|
18
|
+
}
|
|
19
|
+
const defaultProtocol = await (0, configuration_1.readConfigOption)('remote_recording.protocol', 'http:');
|
|
20
|
+
const { useSSL } = await userInteraction_1.default.prompt({
|
|
21
|
+
type: 'confirm',
|
|
22
|
+
name: 'useSSL',
|
|
23
|
+
message: 'Does your application require SSL / HTTPS?',
|
|
24
|
+
default: defaultProtocol === 'https:',
|
|
25
|
+
});
|
|
26
|
+
const protocol = useSSL ? 'https:' : 'http:';
|
|
27
|
+
if (protocol !== defaultProtocol) {
|
|
28
|
+
await (0, configuration_1.writeConfigOption)('remote_recording.protocol', protocol);
|
|
29
|
+
}
|
|
30
|
+
const ro = await (0, configuration_1.requestOptions)();
|
|
31
|
+
userInteraction_1.default.progress(`Here's the URL I will use to try and connect to the AppMap agent:\n`);
|
|
32
|
+
userInteraction_1.default.progress(`${ro.protocol}//${ro.hostname}:${ro.port}${ro.path}_appmap/record`);
|
|
33
|
+
userInteraction_1.default.progress('');
|
|
34
|
+
}
|
|
35
|
+
exports.default = configureRemainingRequestOptions;
|
|
36
|
+
//# sourceMappingURL=configureRemainingRequestOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureRemainingRequestOptions.js","sourceR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,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAtCD,mDAsCC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 configuration_1 = require("../configuration");
|
|
10
|
+
async function detectProcessCharacteristics() {
|
|
11
|
+
const ro = await (0, configuration_1.requestOptions)();
|
|
12
|
+
if (ro.hostname !== 'localhost') {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
userInteraction_1.default.status = `Looking for your application process on port ${ro.port}...`;
|
|
16
|
+
const printPid = async (pid) => {
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
ps_node_1.default.lookup({ pid }, function (err, resultList) {
|
|
19
|
+
if (err) {
|
|
20
|
+
userInteraction_1.default.error(`Process ${pid} not found: ${err}`);
|
|
21
|
+
resolve();
|
|
22
|
+
}
|
|
23
|
+
const process = resultList[0];
|
|
24
|
+
if (process) {
|
|
25
|
+
userInteraction_1.default.success(process.arguments.join(' '));
|
|
26
|
+
resolve();
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
userInteraction_1.default.error(`Process ${pid} not found`);
|
|
30
|
+
resolve();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const start = new Date().getTime();
|
|
36
|
+
const pids = await (0, port_pid_1.default)(ro.port).then(async (pids) => {
|
|
37
|
+
if (pids && pids.tcp.length > 0) {
|
|
38
|
+
await Promise.all(pids.tcp.map(printPid));
|
|
39
|
+
return pids;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
if (!pids) {
|
|
43
|
+
userInteraction_1.default.error();
|
|
44
|
+
userInteraction_1.default.progress('');
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
async function confirm() {
|
|
48
|
+
const { looksGood } = await userInteraction_1.default.prompt({
|
|
49
|
+
type: 'confirm',
|
|
50
|
+
name: 'looksGood',
|
|
51
|
+
message: `Does this look like your application?`,
|
|
52
|
+
default: 'y',
|
|
53
|
+
});
|
|
54
|
+
return looksGood;
|
|
55
|
+
}
|
|
56
|
+
userInteraction_1.default.progress('');
|
|
57
|
+
return !!pids && (await confirm());
|
|
58
|
+
}
|
|
59
|
+
exports.default = detectProcessCharacteristics;
|
|
60
|
+
//# sourceMappingURL=detectProcessCharacteristics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectProcessCharacteristics.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/detectProcessCharacteristics.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,wDAA+B;AAC/B,sDAAyB;AACzB,oDAAkD;AAEnC,KAAK,UAAU,4BAA4B;IACxD,MAAM,EAAE,GAAG,MAAM,IAAA,8BAAc,GAAE,CAAC;IAClC,IAAI,EAAE,CAAC,QAAQ,KAAK,WAAW,EAAE;QAC/B,OAAO,KAAK,CAAC;KACd;IAED,yBAAE,CAAC,MAAM,GAAG,gDAAgD,EAAE,CAAC,IAAI,KAAK,CAAC;IAEzE,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,UAAU,GAAQ,EAAE,UAAiB;gBACtD,IAAI,GAAG,EAAE;oBACP,yBAAE,CAAC,KAAK,CAAC,WAAW,GAAG,eAAe,GAAG,EAAE,CAAC,CAAC;oBAC7C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AAC;IAChB,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;AACrC,CAAC;AA7DD,+CA6DC"}
|
|
@@ -3,27 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
});
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
8
|
+
const configuration_1 = require("../configuration");
|
|
9
|
+
const remoteRecording_1 = __importDefault(require("../remoteRecording"));
|
|
10
|
+
async function saveRecording() {
|
|
11
|
+
const rr = new remoteRecording_1.default(await (0, configuration_1.requestOptions)());
|
|
27
12
|
let data = await rr.stop();
|
|
28
13
|
if (data) {
|
|
29
14
|
userInteraction_1.default.success(`Recording has finished, with ${data.length} bytes of data.`);
|
|
@@ -44,9 +29,9 @@ async function createRecording(requestOptions) {
|
|
|
44
29
|
data = JSON.stringify(jsonData);
|
|
45
30
|
const fileName = `${appMapName}.appmap.json`;
|
|
46
31
|
userInteraction_1.default.status = `Saving recording to ${fileName}`;
|
|
47
|
-
|
|
32
|
+
await (0, promises_1.writeFile)(fileName, data);
|
|
48
33
|
userInteraction_1.default.success('AppMap saved');
|
|
49
34
|
return fileName;
|
|
50
35
|
}
|
|
51
|
-
exports.default =
|
|
52
|
-
//# sourceMappingURL=
|
|
36
|
+
exports.default = saveRecording;
|
|
37
|
+
//# sourceMappingURL=saveRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saveRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/saveRecording.ts"],"names":[],"mappings":";;;;;AAAA,0CAAwC;AACxC,4EAAuC;AACvC,oDAAkD;AAClD,yEAAiD;AAElC,KAAK,UAAU,aAAa;IACzC,MAAM,EAAE,GAAG,IAAI,yBAAe,CAAC,MAAM,IAAA,8BAAc,GAAE,CAAC,CAAC;IACvD,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;IAE3B,IAAI,IAAI,EAAE;QACR,yBAAE,CAAC,OAAO,CAAC,gCAAgC,IAAI,CAAC,MAAM,iBAAiB,CAAC,CAAC;KAC1E;SAAM;QACL,yBAAE,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;QAC5D,OAAO;KACR;IAED,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,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;IAC1C,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEhC,MAAM,QAAQ,GAAG,GAAG,UAAU,cAAc,CAAC;IAC7C,yBAAE,CAAC,MAAM,GAAG,uBAAuB,QAAQ,EAAE,CAAC;IAC9C,MAAM,IAAA,oBAAS,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAEhC,yBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC;AA9BD,gCA8BC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 configuration_1 = require("../configuration");
|
|
8
|
+
const remoteRecording_1 = __importDefault(require("../remoteRecording"));
|
|
9
|
+
async function startRecording() {
|
|
10
|
+
const ro = await (0, configuration_1.requestOptions)();
|
|
11
|
+
userInteraction_1.default.progress('');
|
|
12
|
+
await userInteraction_1.default.confirm('Press enter to start recording');
|
|
13
|
+
const rr = new remoteRecording_1.default(ro);
|
|
14
|
+
await rr.start();
|
|
15
|
+
userInteraction_1.default.progress(`
|
|
16
|
+
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, etc.
|
|
17
|
+
`);
|
|
18
|
+
}
|
|
19
|
+
exports.default = startRecording;
|
|
20
|
+
//# sourceMappingURL=startRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/startRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,oDAAkD;AAClD,yEAAiD;AAElC,KAAK,UAAU,cAAc;IAC1C,MAAM,EAAE,GAAG,MAAM,IAAA,8BAAc,GAAE,CAAC;IAElC,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChB,MAAM,yBAAE,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAEnD,MAAM,EAAE,GAAG,IAAI,yBAAe,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;IAEjB,yBAAE,CAAC,QAAQ,CAAC;;CAEb,CAAC,CAAC;AACH,CAAC;AAZD,iCAYC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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 stopRecording() {
|
|
8
|
+
await userInteraction_1.default.confirm('Press enter to stop recording');
|
|
9
|
+
}
|
|
10
|
+
exports.default = stopRecording;
|
|
11
|
+
//# sourceMappingURL=stopRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/stopRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AAExB,KAAK,UAAU,aAAa;IACzC,MAAM,yBAAE,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;AACpD,CAAC;AAFD,gCAEC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeConfigOption = exports.writeSetting = exports.readConfigOption = exports.readSetting = exports.requestOptions = exports.setAppMapSettingsFilePath = exports.setAppMapConfigFilePath = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const js_yaml_1 = require("js-yaml");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
let AppMapConfigFilePath = (0, path_1.join)(process.cwd(), 'appmap.yml');
|
|
9
|
+
let AppMapSettingsFilePath = (0, path_1.join)(process.env.HOME || '', '.appmaprc');
|
|
10
|
+
// Returns the previous config file path.
|
|
11
|
+
function setAppMapConfigFilePath(appMapFile) {
|
|
12
|
+
const oldPath = AppMapConfigFilePath;
|
|
13
|
+
AppMapConfigFilePath = appMapFile;
|
|
14
|
+
if (!(0, fs_1.existsSync)(appMapFile)) {
|
|
15
|
+
console.log(`Warning: AppMap config file ${appMapFile} does not exist.`);
|
|
16
|
+
}
|
|
17
|
+
return oldPath;
|
|
18
|
+
}
|
|
19
|
+
exports.setAppMapConfigFilePath = setAppMapConfigFilePath;
|
|
20
|
+
// Returns the previous settings file path.
|
|
21
|
+
function setAppMapSettingsFilePath(appMapFile) {
|
|
22
|
+
const oldPath = AppMapSettingsFilePath;
|
|
23
|
+
AppMapSettingsFilePath = appMapFile;
|
|
24
|
+
return oldPath;
|
|
25
|
+
}
|
|
26
|
+
exports.setAppMapSettingsFilePath = setAppMapSettingsFilePath;
|
|
27
|
+
async function readConfig() {
|
|
28
|
+
let fileContents;
|
|
29
|
+
try {
|
|
30
|
+
fileContents = await (0, promises_1.readFile)(AppMapConfigFilePath);
|
|
31
|
+
}
|
|
32
|
+
catch (_a) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
return (0, js_yaml_1.load)(fileContents.toString());
|
|
36
|
+
}
|
|
37
|
+
async function readAllSettings() {
|
|
38
|
+
let settings;
|
|
39
|
+
try {
|
|
40
|
+
const fileContents = await (0, promises_1.readFile)(AppMapSettingsFilePath);
|
|
41
|
+
settings = (0, js_yaml_1.load)(fileContents.toString());
|
|
42
|
+
// Make sure settings is an object.
|
|
43
|
+
settings[AppMapConfigFilePath];
|
|
44
|
+
}
|
|
45
|
+
catch (_a) {
|
|
46
|
+
settings = {};
|
|
47
|
+
}
|
|
48
|
+
if (!settings[AppMapConfigFilePath]) {
|
|
49
|
+
settings[AppMapConfigFilePath] = {};
|
|
50
|
+
}
|
|
51
|
+
return settings;
|
|
52
|
+
}
|
|
53
|
+
async function readSettings() {
|
|
54
|
+
return (await readAllSettings())[AppMapConfigFilePath];
|
|
55
|
+
}
|
|
56
|
+
async function writeConfig(config) {
|
|
57
|
+
await (0, promises_1.writeFile)(AppMapConfigFilePath, (0, js_yaml_1.dump)(config));
|
|
58
|
+
}
|
|
59
|
+
async function writeSettings(settings) {
|
|
60
|
+
await (0, promises_1.writeFile)(AppMapSettingsFilePath, (0, js_yaml_1.dump)(settings));
|
|
61
|
+
}
|
|
62
|
+
async function requestOptions() {
|
|
63
|
+
const requestOptions = {};
|
|
64
|
+
requestOptions.hostname = (await readSetting('remote_recording.host', 'localhost')).toString();
|
|
65
|
+
requestOptions.port = await readSetting('remote_recording.port', 3000);
|
|
66
|
+
requestOptions.path = (await readConfigOption('remote_recording.path', '/')).toString();
|
|
67
|
+
requestOptions.protocol = (await readConfigOption('remote_recording.protocol', 'http:')).toString();
|
|
68
|
+
return requestOptions;
|
|
69
|
+
}
|
|
70
|
+
exports.requestOptions = requestOptions;
|
|
71
|
+
async function readSetting(path, defaultValue) {
|
|
72
|
+
const settings = await readSettings();
|
|
73
|
+
return findOption(settings, path, defaultValue);
|
|
74
|
+
}
|
|
75
|
+
exports.readSetting = readSetting;
|
|
76
|
+
async function readConfigOption(path, defaultValue) {
|
|
77
|
+
const config = await readConfig();
|
|
78
|
+
return findOption(config, path, defaultValue);
|
|
79
|
+
}
|
|
80
|
+
exports.readConfigOption = readConfigOption;
|
|
81
|
+
function findOption(data, path, defaultValue) {
|
|
82
|
+
if (!data)
|
|
83
|
+
return defaultValue;
|
|
84
|
+
const tokens = path.split('.');
|
|
85
|
+
let entry = data;
|
|
86
|
+
for (const token of tokens) {
|
|
87
|
+
if (!entry)
|
|
88
|
+
return defaultValue;
|
|
89
|
+
entry = entry[token];
|
|
90
|
+
}
|
|
91
|
+
if (typeof entry === 'object')
|
|
92
|
+
return defaultValue;
|
|
93
|
+
return entry || defaultValue;
|
|
94
|
+
}
|
|
95
|
+
async function writeSetting(path, value) {
|
|
96
|
+
const allSettings = await readAllSettings();
|
|
97
|
+
const settings = allSettings[AppMapConfigFilePath];
|
|
98
|
+
mergeConfigData(settings, path, value);
|
|
99
|
+
await writeSettings(allSettings);
|
|
100
|
+
}
|
|
101
|
+
exports.writeSetting = writeSetting;
|
|
102
|
+
async function writeConfigOption(path, value) {
|
|
103
|
+
const config = await readConfig();
|
|
104
|
+
if (!config)
|
|
105
|
+
return;
|
|
106
|
+
mergeConfigData(config, path, value);
|
|
107
|
+
await writeConfig(config);
|
|
108
|
+
}
|
|
109
|
+
exports.writeConfigOption = writeConfigOption;
|
|
110
|
+
function mergeConfigData(data, path, value) {
|
|
111
|
+
const tokens = path.split('.');
|
|
112
|
+
const lastToken = tokens.pop();
|
|
113
|
+
let entry = data;
|
|
114
|
+
for (const token of tokens) {
|
|
115
|
+
if (!entry[token]) {
|
|
116
|
+
entry[token] = {};
|
|
117
|
+
}
|
|
118
|
+
entry = entry[token];
|
|
119
|
+
}
|
|
120
|
+
if (typeof entry === 'object') {
|
|
121
|
+
if (entry[lastToken] !== value) {
|
|
122
|
+
entry[lastToken] = value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../src/cmds/record/configuration.ts"],"names":[],"mappings":";;;AAAA,2BAA0D;AAC1D,0CAAkD;AAElD,qCAAqC;AACrC,+BAA4B;AAE5B,IAAI,oBAAoB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC;AAC7D,IAAI,sBAAsB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,W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;IACjB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACjB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;SACnB;QACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;KACtB;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YAC9B,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;SAC1B;KACF;AACH,CAAC"}
|
|
@@ -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
|
+
exports.RecordingAction = void 0;
|
|
7
|
+
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
8
|
+
var RecordingAction;
|
|
9
|
+
(function (RecordingAction) {
|
|
10
|
+
RecordingAction["Cancel"] = "cancel recording";
|
|
11
|
+
RecordingAction["Save"] = "save recording";
|
|
12
|
+
RecordingAction["Abort"] = "continue recording";
|
|
13
|
+
})(RecordingAction = exports.RecordingAction || (exports.RecordingAction = {}));
|
|
14
|
+
async function recordingInProgress() {
|
|
15
|
+
userInteraction_1.default.progress('The AppMap agent is already recording an AppMap.?');
|
|
16
|
+
const { recordingAction } = await userInteraction_1.default.prompt({
|
|
17
|
+
type: 'list',
|
|
18
|
+
choices: [
|
|
19
|
+
RecordingAction.Cancel,
|
|
20
|
+
RecordingAction.Save,
|
|
21
|
+
RecordingAction.Abort,
|
|
22
|
+
],
|
|
23
|
+
name: 'recordingAction',
|
|
24
|
+
message: "What would you like to do with the recording that's in progress?",
|
|
25
|
+
});
|
|
26
|
+
return recordingAction;
|
|
27
|
+
}
|
|
28
|
+
exports.default = recordingInProgress;
|
|
29
|
+
//# sourceMappingURL=recordingInProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordingInProgress.js","sourceRoot":"","sources":["../../../../../src/cmds/record/prompt/recordingInProgress.ts"],"names":[],"mappings":";;;;;;AAAA,4EAAuC;AAEvC,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,0CAAuB,CAAA;IACvB,+CAA4B,CAAA;AAC9B,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AAEc,KAAK,UAAU,mBAAmB;IAC/C,yBAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC,CAAC;IACjE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QAC1C,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACP,eAAe,CAAC,MAAM;YACtB,eAAe,CAAC,IAAI;YACpB,eAAe,CAAC,KAAK;SACtB;QACD,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,kEAAkE;KAC5E,CAAC,CAAC;IACH,OAAO,eAAe,CAAC;AACzB,CAAC;AAbD,sCAaC"}
|
|
@@ -6,27 +6,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
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
9
|
const showAppMap_1 = __importDefault(require("../open/showAppMap"));
|
|
10
|
+
const configuration_1 = require("./configuration");
|
|
11
|
+
const initial_1 = __importDefault(require("./state/initial"));
|
|
14
12
|
exports.command = 'record';
|
|
15
13
|
exports.describe = 'Create an AppMap via interactive recording, aka remote recording.';
|
|
16
14
|
const builder = (args) => {
|
|
15
|
+
args.option('appmap-config', {
|
|
16
|
+
describe: 'AppMap config file to check for default options.',
|
|
17
|
+
type: 'string',
|
|
18
|
+
alias: 'c',
|
|
19
|
+
});
|
|
17
20
|
return args.strict();
|
|
18
21
|
};
|
|
19
22
|
exports.builder = builder;
|
|
20
23
|
const handler = async (argv) => {
|
|
21
24
|
(0, utils_1.verbose)(argv.verbose);
|
|
25
|
+
if (argv.appmapConfig)
|
|
26
|
+
(0, configuration_1.setAppMapConfigFilePath)(argv.appmapConfig);
|
|
22
27
|
const commandFn = async () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
await (0, showAppMap_1.default)(
|
|
28
|
+
let state = initial_1.default;
|
|
29
|
+
while (state && typeof state === 'function') {
|
|
30
|
+
const newState = await state();
|
|
31
|
+
state = newState;
|
|
32
|
+
}
|
|
33
|
+
if (typeof state === 'string') {
|
|
34
|
+
await (0, showAppMap_1.default)(state);
|
|
30
35
|
}
|
|
31
36
|
};
|
|
32
37
|
return (0, runCommand_1.default)(commandFn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/cmds/record/record.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAsC;AACtC,+DAAuC;
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/cmds/record/record.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAsC;AACtC,+DAAuC;AACvC,oEAA4C;AAE5C,mDAA0D;AAC1D,8DAAsC;AAIzB,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,QAAQ,GACnB,mEAAmE,CAAC;AAE/D,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAE,EAAE;IAC1C,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;QAC3B,QAAQ,EAAE,kDAAkD;QAC5D,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;KACX,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;AACvB,CAAC,CAAC;AARW,QAAA,OAAO,WAQlB;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,IAAS,EAAE,EAAE;IACzC,IAAA,eAAO,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,IAAI,IAAI,CAAC,YAAY;QAAE,IAAA,uCAAuB,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAElE,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC3B,IAAI,KAAK,GAAsB,iBAAO,CAAC;QAEvC,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC3C,MAAM,QAAQ,GAAG,MAAM,KAAK,EAAE,CAAC;YAC/B,KAAK,GAAG,QAAQ,CAAC;SAClB;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,IAAA,oBAAU,EAAC,KAAiB,CAAC,CAAC;SACrC;IACH,CAAC,CAAC;IAEF,OAAO,IAAA,oBAAU,EAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;AAlBW,QAAA,OAAO,WAkBlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/abort.ts"],"names":[],"mappings":";;AAAA,gDAA6C;AAG7C,SAAwB,KAAK;IAC3B,OAAO,CAAC,IAAI,CAAC,mBAAQ,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAFD,wBAEC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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 startRecording_1 = __importDefault(require("../action/startRecording"));
|
|
7
|
+
const recordingInProgress_1 = __importDefault(require("./recordingInProgress"));
|
|
8
|
+
// The AppMap agent has been confirmed
|
|
9
|
+
async function agentAvailableAndReady() {
|
|
10
|
+
await (0, startRecording_1.default)();
|
|
11
|
+
return recordingInProgress_1.default;
|
|
12
|
+
}
|
|
13
|
+
exports.default = agentAvailableAndReady;
|
|
14
|
+
//# sourceMappingURL=agentAvailableAndReady.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentAvailableAndReady.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentAvailableAndReady.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AACtD,gFAAwD;AAGxD,sCAAsC;AACvB,KAAK,UAAU,sBAAsB;IAClD,MAAM,IAAA,wBAAc,GAAE,CAAC;IACvB,OAAO,6BAAmB,CAAC;AAC7B,CAAC;AAHD,yCAGC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const recordingInProgress_1 = __importStar(require("../prompt/recordingInProgress"));
|
|
26
|
+
const cancelRecording_1 = __importDefault(require("../action/cancelRecording"));
|
|
27
|
+
const agentAvailableAndReady_1 = __importDefault(require("./agentAvailableAndReady"));
|
|
28
|
+
const saveRecording_1 = __importDefault(require("../action/saveRecording"));
|
|
29
|
+
const abort_1 = __importDefault(require("./abort"));
|
|
30
|
+
async function agentIsRecording() {
|
|
31
|
+
const recordingAction = await (0, recordingInProgress_1.default)();
|
|
32
|
+
if (recordingAction === recordingInProgress_1.RecordingAction.Cancel) {
|
|
33
|
+
await (0, cancelRecording_1.default)();
|
|
34
|
+
return agentAvailableAndReady_1.default;
|
|
35
|
+
}
|
|
36
|
+
else if (recordingAction === recordingInProgress_1.RecordingAction.Save) {
|
|
37
|
+
await (0, saveRecording_1.default)();
|
|
38
|
+
return agentAvailableAndReady_1.default;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return abort_1.default;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = agentIsRecording;
|
|
45
|
+
//# sourceMappingURL=agentIsRecording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentIsRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentIsRecording.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAEuC;AACvC,gFAAwD;AACxD,sFAA+D;AAC/D,4EAAoD;AAEpD,oDAA4B;AAEb,KAAK,UAAU,gBAAgB;IAC5C,MAAM,eAAe,GAAG,MAAM,IAAA,6BAAyB,GAAE,CAAC;IAE1D,IAAI,eAAe,KAAK,qCAAe,CAAC,MAAM,EAAE;QAC9C,MAAM,IAAA,yBAAe,GAAE,CAAC;QACxB,OAAO,gCAAuB,CAAC;KAChC;SAAM,IAAI,eAAe,KAAK,qCAAe,CAAC,IAAI,EAAE;QACnD,MAAM,IAAA,uBAAa,GAAE,CAAC;QACtB,OAAO,gCAAuB,CAAC;KAChC;SAAM;QACL,OAAO,eAAK,CAAC;KACd;AACH,CAAC;AAZD,mCAYC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 configureRemainingRequestOptions_1 = __importDefault(require("../action/configureRemainingRequestOptions"));
|
|
8
|
+
const detectProcessCharacteristics_1 = __importDefault(require("../action/detectProcessCharacteristics"));
|
|
9
|
+
const isAgentAvailable_1 = __importDefault(require("../test/isAgentAvailable"));
|
|
10
|
+
const agentProcessNotRunning_1 = __importDefault(require("./agentProcessNotRunning"));
|
|
11
|
+
const initial_1 = __importDefault(require("./initial"));
|
|
12
|
+
// The agent was not reachable using the configured settings. This may be because:
|
|
13
|
+
// * The agent process isn't running.
|
|
14
|
+
// * The agent process is running, but the agent isn't reachable (e.g. security filter?).
|
|
15
|
+
// * The host/port parameters are wrong.
|
|
16
|
+
// * The host/port parameters are right, but the agent URL is different than the default.
|
|
17
|
+
async function agentNotAvailable() {
|
|
18
|
+
if (!(await (0, detectProcessCharacteristics_1.default)())) {
|
|
19
|
+
return agentProcessNotRunning_1.default;
|
|
20
|
+
}
|
|
21
|
+
if (await (0, isAgentAvailable_1.default)()) {
|
|
22
|
+
return initial_1.default;
|
|
23
|
+
}
|
|
24
|
+
userInteraction_1.default.progress(`
|
|
25
|
+
You've confirmed that your application process is running, but I'm unable to connect to the AppMap agent over HTTP. There are three common reasons for this:
|
|
26
|
+
|
|
27
|
+
1) The agent isn't configured to accept connections in this process. For example, the app isn't running with APPMAP=true (Ruby, Python), or the app isn't running with the AppMap agent enabled (Java).
|
|
28
|
+
2) The agent is enabled, but HTTP requests to the agent are being blocked by some application or framework code; for example, a security filter.
|
|
29
|
+
3) The agent is enabled and reachable, but it's mounted to a non-root URL path (e.g. /myapp), or the application server is only requesting HTTPS connections.
|
|
30
|
+
|
|
31
|
+
For case (1), you'll need to re-launch the server with the agent enabled.
|
|
32
|
+
|
|
33
|
+
For case (2), you should contact AppMap support for help with troubleshooting.
|
|
34
|
+
|
|
35
|
+
For case (3), you can configure the application URL path and protocol.
|
|
36
|
+
`);
|
|
37
|
+
await (0, configureRemainingRequestOptions_1.default)();
|
|
38
|
+
return initial_1.default;
|
|
39
|
+
}
|
|
40
|
+
exports.default = agentNotAvailable;
|
|
41
|
+
//# sourceMappingURL=agentNotAvailable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentNotAvailable.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentNotAvailable.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AAEvC,kHAA0F;AAC1F,0GAAkF;AAClF,gFAAwD;AAExD,sFAA8D;AAC9D,wDAAgC;AAEhC,kFAAkF;AAClF,qCAAqC;AACrC,yFAAyF;AACzF,wCAAwC;AACxC,yFAAyF;AAC1E,KAAK,UAAU,iBAAiB;IAC7C,IAAI,CAAC,CAAC,MAAM,IAAA,sCAA4B,GAAE,CAAC,EAAE;QAC3C,OAAO,gCAAsB,CAAC;KAC/B;IAED,IAAI,MAAM,IAAA,0BAAgB,GAAE,EAAE;QAC5B,OAAO,iBAAO,CAAC;KAChB;IAED,yBAAE,CAAC,QAAQ,CACT;;;;;;;;;;;;CAYH,CACE,CAAC;IAEF,MAAM,IAAA,0CAAgC,GAAE,CAAC;IAEzC,OAAO,iBAAO,CAAC;AACjB,CAAC;AA5BD,oCA4BC"}
|