@appland/appmap 3.35.0 → 3.37.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 +14 -0
- package/built/appmap.html +1 -1
- package/built/cli.js +2 -2
- package/built/cli.js.map +1 -1
- package/built/cmds/agentInstaller/agentInstaller.js.map +1 -1
- package/built/cmds/agentInstaller/agentInstallerProcedure.js +1 -0
- package/built/cmds/agentInstaller/agentInstallerProcedure.js.map +1 -1
- package/built/cmds/agentInstaller/gradleInstaller.js +9 -3
- package/built/cmds/agentInstaller/gradleInstaller.js.map +1 -1
- package/built/cmds/agentInstaller/install-agent.js +23 -7
- package/built/cmds/agentInstaller/install-agent.js.map +1 -1
- package/built/cmds/agentInstaller/javaScriptAgentInstaller.js +24 -1
- package/built/cmds/agentInstaller/javaScriptAgentInstaller.js.map +1 -1
- package/built/cmds/agentInstaller/mavenInstaller.js +2 -0
- package/built/cmds/agentInstaller/mavenInstaller.js.map +1 -1
- package/built/cmds/agentInstaller/pythonAgentInstaller.js +19 -0
- package/built/cmds/agentInstaller/pythonAgentInstaller.js.map +1 -1
- package/built/cmds/agentInstaller/rubyAgentInstaller.js +10 -0
- package/built/cmds/agentInstaller/rubyAgentInstaller.js.map +1 -1
- package/built/cmds/errors.js +4 -1
- package/built/cmds/errors.js.map +1 -1
- package/built/cmds/record/action/cancelRecording.js +2 -3
- package/built/cmds/record/action/cancelRecording.js.map +1 -1
- package/built/cmds/record/action/configureHostAndPort.js +6 -6
- package/built/cmds/record/action/configureHostAndPort.js.map +1 -1
- package/built/cmds/record/action/configureRemainingRequestOptions.js +7 -7
- package/built/cmds/record/action/configureRemainingRequestOptions.js.map +1 -1
- package/built/cmds/record/action/detectProcessCharacteristics.js +2 -3
- package/built/cmds/record/action/detectProcessCharacteristics.js.map +1 -1
- package/built/cmds/record/action/saveAppMap.js +2 -3
- package/built/cmds/record/action/saveAppMap.js.map +1 -1
- package/built/cmds/record/action/saveRecording.js +2 -3
- package/built/cmds/record/action/saveRecording.js.map +1 -1
- package/built/cmds/record/action/startRecording.js +2 -3
- package/built/cmds/record/action/startRecording.js.map +1 -1
- package/built/cmds/record/action/startTestCases.js +6 -5
- package/built/cmds/record/action/startTestCases.js.map +1 -1
- package/built/cmds/record/configuration.js +66 -84
- package/built/cmds/record/configuration.js.map +1 -1
- package/built/cmds/record/makeRequest.js +50 -0
- package/built/cmds/record/makeRequest.js.map +1 -0
- package/built/cmds/record/prompt/continueWithRequestOptionConfiguration.js +2 -3
- package/built/cmds/record/prompt/continueWithRequestOptionConfiguration.js.map +1 -1
- package/built/cmds/record/prompt/obtainTestCommands.js +7 -3
- package/built/cmds/record/prompt/obtainTestCommands.js.map +1 -1
- package/built/cmds/record/record.js +110 -83
- package/built/cmds/record/record.js.map +1 -1
- package/built/cmds/record/recordContext.js +11 -7
- package/built/cmds/record/recordContext.js.map +1 -1
- package/built/cmds/record/remoteRecording.js +7 -35
- package/built/cmds/record/remoteRecording.js.map +1 -1
- package/built/cmds/record/state/agentAvailableAndReady.js +2 -2
- package/built/cmds/record/state/agentAvailableAndReady.js.map +1 -1
- package/built/cmds/record/state/agentIsRecording.js +1 -1
- package/built/cmds/record/state/agentIsRecording.js.map +1 -1
- package/built/cmds/record/state/agentNotAvailable.js +37 -10
- package/built/cmds/record/state/agentNotAvailable.js.map +1 -1
- package/built/cmds/record/state/agentProcessNotRunning.js +2 -2
- package/built/cmds/record/state/agentProcessNotRunning.js.map +1 -1
- package/built/cmds/record/state/initial.js +6 -1
- package/built/cmds/record/state/initial.js.map +1 -1
- package/built/cmds/record/state/record_remote.js +3 -3
- package/built/cmds/record/state/record_remote.js.map +1 -1
- package/built/cmds/record/state/record_test.js +2 -2
- package/built/cmds/record/state/record_test.js.map +1 -1
- package/built/cmds/record/state/testCasesComplete.js +9 -6
- package/built/cmds/record/state/testCasesComplete.js.map +1 -1
- package/built/cmds/record/state/testCommandsAvailable.js +1 -1
- package/built/cmds/record/state/testCommandsAvailable.js.map +1 -1
- package/built/cmds/record/state/testCommandsNeeded.js +2 -2
- package/built/cmds/record/state/testCommandsNeeded.js.map +1 -1
- package/built/cmds/record/test/areTestCommandsConfigured.js +4 -4
- package/built/cmds/record/test/areTestCommandsConfigured.js.map +1 -1
- package/built/cmds/record/test/isAgentAvailable.js +12 -5
- package/built/cmds/record/test/isAgentAvailable.js.map +1 -1
- package/built/cmds/record/test/isRecordingInProgress.js +2 -3
- package/built/cmds/record/test/isRecordingInProgress.js.map +1 -1
- package/built/cmds/record/testCaseRecording.js +3 -4
- package/built/cmds/record/testCaseRecording.js.map +1 -1
- package/built/cmds/runCommand.js +3 -1
- package/built/cmds/runCommand.js.map +1 -1
- package/built/lib/ticket/openTicket.js +30 -36
- package/built/lib/ticket/openTicket.js.map +1 -1
- package/built/lib/ticket/zendesk.js +3 -2
- package/built/lib/ticket/zendesk.js.map +1 -1
- package/built/main.js.map +1 -1
- package/package.json +4 -4
|
@@ -22,101 +22,128 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
26
25
|
const utils_1 = require("../../utils");
|
|
27
26
|
const runCommand_1 = __importDefault(require("../runCommand"));
|
|
28
27
|
const showAppMap_1 = __importDefault(require("../open/showAppMap"));
|
|
29
28
|
const process_1 = require("process");
|
|
30
|
-
const initial_1 =
|
|
29
|
+
const initial_1 = __importStar(require("./state/initial"));
|
|
31
30
|
const telemetry_1 = __importDefault(require("../../telemetry"));
|
|
32
31
|
const recordContext_1 = __importDefault(require("./recordContext"));
|
|
33
|
-
const configuration_1 = require("./configuration");
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
args
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const recordContext = new recordContext_1.default(appmapDir);
|
|
67
|
-
await recordContext.initialize();
|
|
68
|
-
const { mode } = argv;
|
|
69
|
-
async function initialState() {
|
|
70
|
-
if (mode) {
|
|
71
|
-
recordContext.recordMethod = mode;
|
|
72
|
-
return (await Promise.resolve().then(() => __importStar(require(`./state/record_${mode}`)))).default;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
return initial_1.default;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
let state = await initialState();
|
|
79
|
-
while (state && typeof state === 'function') {
|
|
80
|
-
if ((0, utils_1.verbose)())
|
|
81
|
-
console.warn(`Entering state: ${state.name}`);
|
|
82
|
-
let errorMessage;
|
|
83
|
-
let newState;
|
|
84
|
-
try {
|
|
85
|
-
newState = await state(recordContext);
|
|
32
|
+
const configuration_1 = __importDefault(require("./configuration"));
|
|
33
|
+
const openTicket_1 = __importDefault(require("../../lib/ticket/openTicket"));
|
|
34
|
+
const userInteraction_1 = __importDefault(require("../userInteraction"));
|
|
35
|
+
const makeRequest_1 = require("./makeRequest");
|
|
36
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
37
|
+
exports.default = {
|
|
38
|
+
command: 'record [mode]',
|
|
39
|
+
describe: 'Create an AppMap via interactive recording, aka remote recording.',
|
|
40
|
+
builder: (args) => {
|
|
41
|
+
args.positional('mode', {
|
|
42
|
+
type: 'string',
|
|
43
|
+
choices: ['test', 'remote'],
|
|
44
|
+
});
|
|
45
|
+
args.option('directory', {
|
|
46
|
+
describe: 'Working directory for the command.',
|
|
47
|
+
type: 'string',
|
|
48
|
+
alias: 'd',
|
|
49
|
+
});
|
|
50
|
+
args.option('appmap-config', {
|
|
51
|
+
describe: 'AppMap config file to check for default options.',
|
|
52
|
+
type: 'string',
|
|
53
|
+
alias: 'c',
|
|
54
|
+
});
|
|
55
|
+
return args.strict();
|
|
56
|
+
},
|
|
57
|
+
handler: async (argv) => {
|
|
58
|
+
(0, utils_1.verbose)(argv.verbose);
|
|
59
|
+
const commandFn = async () => {
|
|
60
|
+
const { directory, appmapConfig } = argv;
|
|
61
|
+
if (directory) {
|
|
62
|
+
if ((0, utils_1.verbose)())
|
|
63
|
+
console.log(`Using working directory ${directory}`);
|
|
64
|
+
(0, process_1.chdir)(directory);
|
|
86
65
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
66
|
+
const configuration = new configuration_1.default(appmapConfig);
|
|
67
|
+
const recordContext = new recordContext_1.default(configuration);
|
|
68
|
+
await recordContext.initialize();
|
|
69
|
+
const { mode } = argv;
|
|
70
|
+
async function initialState() {
|
|
71
|
+
if (mode) {
|
|
72
|
+
recordContext.recordMethod = mode;
|
|
73
|
+
return (0, initial_1.createState)(mode);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return initial_1.default;
|
|
77
|
+
}
|
|
90
78
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
|
|
79
|
+
let state = await initialState();
|
|
80
|
+
while (state && typeof state === 'function') {
|
|
81
|
+
if ((0, utils_1.verbose)())
|
|
82
|
+
console.warn(`Entering state: ${state.name}`);
|
|
83
|
+
let errorMessage;
|
|
84
|
+
let newState;
|
|
85
|
+
try {
|
|
86
|
+
newState = await state(recordContext);
|
|
95
87
|
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
errorMessage = err.toString();
|
|
90
|
+
// TODO: consider making this more general, to open a ticket when any Error occurs.
|
|
91
|
+
if (err instanceof makeRequest_1.RemoteRecordingError) {
|
|
92
|
+
// If a request to the remote-recording endpoint fails, an AppMap won't be created, i.e.
|
|
93
|
+
// the final AppMap count will match the initial count.
|
|
94
|
+
recordContext.appMapCount = recordContext.initialAppMapCount;
|
|
95
|
+
await handleRemoteError(err);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
const properties = recordContext.properties();
|
|
102
|
+
if (errorMessage) {
|
|
103
|
+
properties.errorMessage = errorMessage;
|
|
104
|
+
}
|
|
105
|
+
telemetry_1.default.sendEvent({
|
|
106
|
+
name: `record:${state.name}`,
|
|
107
|
+
properties,
|
|
108
|
+
metrics: Object.assign({
|
|
109
|
+
duration: (0, utils_1.endTime)(),
|
|
110
|
+
}, recordContext.metrics()),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
state = newState;
|
|
114
|
+
}
|
|
115
|
+
if (typeof state === 'string') {
|
|
96
116
|
telemetry_1.default.sendEvent({
|
|
97
|
-
name: `record
|
|
98
|
-
properties
|
|
99
|
-
|
|
117
|
+
name: `record:showAppMap`,
|
|
118
|
+
properties: {
|
|
119
|
+
fileName: state,
|
|
120
|
+
},
|
|
121
|
+
metrics: {
|
|
100
122
|
duration: (0, utils_1.endTime)(),
|
|
101
|
-
},
|
|
123
|
+
},
|
|
102
124
|
});
|
|
125
|
+
await (0, showAppMap_1.default)(state);
|
|
103
126
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
};
|
|
128
|
+
return (0, runCommand_1.default)('record', commandFn);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
async function handleRemoteError(err) {
|
|
132
|
+
userInteraction_1.default.error(`Something went wrong when ${err.description}:
|
|
133
|
+
HTTP status: ${err.statusCode}
|
|
134
|
+
HTTP request: ${err.method} ${err.path}
|
|
135
|
+
`);
|
|
136
|
+
const message = `Would you like to see the server's response?`;
|
|
137
|
+
const result = await userInteraction_1.default.prompt({
|
|
138
|
+
name: 'showResponse',
|
|
139
|
+
type: 'confirm',
|
|
140
|
+
message,
|
|
141
|
+
prefix: chalk_1.default.red('!'),
|
|
142
|
+
}, { supressSpinner: true });
|
|
143
|
+
const { showResponse } = result;
|
|
144
|
+
if (showResponse) {
|
|
145
|
+
userInteraction_1.default.error(err.message);
|
|
146
|
+
}
|
|
147
|
+
await (0, openTicket_1.default)(err.toString());
|
|
120
148
|
}
|
|
121
|
-
exports.handler = handler;
|
|
122
149
|
//# sourceMappingURL=record.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/cmds/record/record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/cmds/record/record.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA+C;AAC/C,+DAAuC;AACvC,oEAA4C;AAI5C,qCAAgC;AAEhC,2DAA6E;AAC7E,gEAAwC;AACxC,oEAA4C;AAC5C,oEAA4C;AAC5C,6EAAqD;AACrD,yEAAoC;AACpC,+CAAqD;AACrD,kDAA0B;AAE1B,kBAAe;IACb,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,mEAAmE;IAE7E,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE;QAC5B,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YACtB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;SAC5B,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;YACvB,QAAQ,EAAE,oCAAoC;YAC9C,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;SACX,CAAC,CAAC;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AK,UAAU,iBAAiB,CAAC,GAAyB;IACxD,yBAAE,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,WAAW;eACxC,GAAG,CAAC,UAAU;gBACb,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI;CACrC,CAAC,CAAC;IAED,MAAM,OAAO,GAAG,8CAA8C,CAAC;IAE/D,MAAM,MAAM,GAAG,MAAM,yBAAE,CAAC,MAAM,CAC5B;QACE,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,OAAO;QACP,MAAM,EAAE,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC;KACvB,EACD,EAAE,cAAc,EAAE,IAAI,EAAE,CACzB,CAAC;IACF,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAEhC,IAAI,YAAY,EAAE;QAChB,yBAAE,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;KACvB;IAED,MAAM,IAAA,oBAAU,EAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RecordProcessResult = void 0;
|
|
7
|
+
const assert_1 = __importDefault(require("assert"));
|
|
7
8
|
const countAppMaps_1 = __importDefault(require("./action/countAppMaps"));
|
|
8
9
|
const configuration_1 = require("./configuration");
|
|
9
10
|
class RecordProcessResult {
|
|
@@ -21,10 +22,12 @@ class RecordProcessResult {
|
|
|
21
22
|
}
|
|
22
23
|
exports.RecordProcessResult = RecordProcessResult;
|
|
23
24
|
class RecordContext {
|
|
24
|
-
constructor(
|
|
25
|
-
this.
|
|
25
|
+
constructor(configuration) {
|
|
26
|
+
this.configuration = configuration;
|
|
26
27
|
}
|
|
27
28
|
async initialize() {
|
|
29
|
+
await this.configuration.read();
|
|
30
|
+
this.appMapDir = this.configuration.configOption('appmap_dir', '.');
|
|
28
31
|
this.initialAppMapCount = await (0, countAppMaps_1.default)(this.appMapDir);
|
|
29
32
|
}
|
|
30
33
|
properties() {
|
|
@@ -58,16 +61,17 @@ class RecordContext {
|
|
|
58
61
|
}
|
|
59
62
|
return result;
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
this.url =
|
|
64
|
+
populateURL() {
|
|
65
|
+
this.url = this.configuration.locationString();
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
this.testCommands =
|
|
67
|
+
populateTestCommands() {
|
|
68
|
+
this.testCommands = this.configuration.configOption('test_recording.test_commands', []).map(configuration_1.TestCommand.toString);
|
|
66
69
|
}
|
|
67
70
|
async populateMaxTime() {
|
|
68
|
-
this.maxTime =
|
|
71
|
+
this.maxTime = this.configuration.setting('test_recording.max_time', 30);
|
|
69
72
|
}
|
|
70
73
|
async populateAppMapCount() {
|
|
74
|
+
(0, assert_1.default)(this.appMapDir);
|
|
71
75
|
const appMapCount = await (0, countAppMaps_1.default)(this.appMapDir);
|
|
72
76
|
this.appMapCount = appMapCount;
|
|
73
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordContext.js","sourceRoot":"","sources":["../../../src/cmds/record/recordContext.ts"],"names":[],"mappings":";;;;;;AAAA,yEAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"recordContext.js","sourceRoot":"","sources":["../../../src/cmds/record/recordContext.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,yEAAiD;AACjD,mDAA6D;AAE7D,MAAa,mBAAmB;IAC9B,YACU,IAA4B,EAC7B,OAAe,EACf,QAAgB,EAChB,MAAc;QAHb,SAAI,GAAJ,IAAI,CAAwB;QAC7B,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAQ;IACpB,CAAC;IAEJ,IAAI,GAAG;QACL,OAAO,MAAM,CAAC,WAAW,CACvB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AAC;IAED,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAErE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;CACF;AA9HD,gCA8HC"}
|
|
@@ -1,43 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
4
|
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const makeRequest_1 = __importDefault(require("./makeRequest"));
|
|
35
7
|
class RemoteRecording {
|
|
36
8
|
constructor(requestOptions) {
|
|
37
9
|
this.requestOptions = requestOptions;
|
|
38
10
|
}
|
|
39
11
|
async start() {
|
|
40
|
-
const statusCode = (await
|
|
12
|
+
const statusCode = (await (0, makeRequest_1.default)(this, `${this.requestOptions.path}_appmap/record`, 'POST', 'starting recording', [200, 201, 409])).statusCode;
|
|
41
13
|
if (statusCode < 300) {
|
|
42
14
|
return true;
|
|
43
15
|
}
|
|
@@ -46,10 +18,10 @@ class RemoteRecording {
|
|
|
46
18
|
}
|
|
47
19
|
}
|
|
48
20
|
async status() {
|
|
49
|
-
return JSON.parse((await
|
|
21
|
+
return JSON.parse((await (0, makeRequest_1.default)(this, `${this.requestOptions.path}_appmap/record`, 'GET', 'checking recording status')).data);
|
|
50
22
|
}
|
|
51
23
|
async stop() {
|
|
52
|
-
const { statusCode, data } = await
|
|
24
|
+
const { statusCode, data } = await (0, makeRequest_1.default)(this, `${this.requestOptions.path}_appmap/record`, 'DELETE', 'stopping recording', [200, 404]);
|
|
53
25
|
if (statusCode === 200) {
|
|
54
26
|
return data;
|
|
55
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteRecording.js","sourceRoot":"","sources":["../../../src/cmds/record/remoteRecording.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remoteRecording.js","sourceRoot":"","sources":["../../../src/cmds/record/remoteRecording.ts"],"names":[],"mappings":";;;;;AACA,gEAAwC;AAGxC,MAAqB,eAAe;IAClC,YAAmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAErD,KAAK,CAAC,KAAK;QACT,MAAM,UAAU,GAAG,CACjB,MAAM,IAAA,qBAAW,EACf,IAAI,EACJ,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gBAAgB,EAC3C,MAAM,EACN,oBAAoB,EACpB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAChB,CACF,CAAC,UAAU,CAAC;QAEb,IAAI,UAAU,GAAG,GAAG,EAAE;YACpB,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,KAAK,CACf,CACE,MAAM,IAAA,qBAAW,EACf,IAAI,EACJ,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gBAAgB,EAC3C,KAAK,EACL,2BAA2B,CAC5B,CACF,CAAC,IAAI,CACP,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,qBAAW,EAC5C,IAAI,EACJ,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gBAAgB,EAC3C,QAAQ,EACR,oBAAoB,EACpB,CAAC,GAAG,EAAE,GAAG,CAAC,CACX,CAAC;QAEF,IAAI,UAAU,KAAK,GAAG,EAAE;YACtB,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF;AAjDD,kCAiDC"}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const startRecording_1 = __importDefault(require("../action/startRecording"));
|
|
7
7
|
const recordingInProgress_1 = __importDefault(require("./recordingInProgress"));
|
|
8
8
|
// The AppMap agent has been confirmed
|
|
9
|
-
async function agentAvailableAndReady() {
|
|
10
|
-
await (0, startRecording_1.default)();
|
|
9
|
+
async function agentAvailableAndReady(recordContext) {
|
|
10
|
+
await (0, startRecording_1.default)(recordContext);
|
|
11
11
|
return recordingInProgress_1.default;
|
|
12
12
|
}
|
|
13
13
|
exports.default = agentAvailableAndReady;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentAvailableAndReady.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/agentAvailableAndReady.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AACtD,gFAAwD;
|
|
1
|
+
{"version":3,"file":"agentAvailableAndReady.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/agentAvailableAndReady.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AACtD,gFAAwD;AAIxD,sCAAsC;AACvB,KAAK,UAAU,sBAAsB,CAClD,aAA4B;IAE5B,MAAM,IAAA,wBAAc,EAAC,aAAa,CAAC,CAAC;IACpC,OAAO,6BAAmB,CAAC;AAC7B,CAAC;AALD,yCAKC"}
|
|
@@ -30,7 +30,7 @@ const abort_1 = __importDefault(require("./abort"));
|
|
|
30
30
|
async function agentIsRecording(recordContext) {
|
|
31
31
|
const recordingAction = await (0, recordingInProgress_1.default)();
|
|
32
32
|
if (recordingAction === recordingInProgress_1.RecordingAction.Cancel) {
|
|
33
|
-
await (0, cancelRecording_1.default)();
|
|
33
|
+
await (0, cancelRecording_1.default)(recordContext);
|
|
34
34
|
return agentAvailableAndReady_1.default;
|
|
35
35
|
}
|
|
36
36
|
else if (recordingAction === recordingInProgress_1.RecordingAction.Save) {
|
|
@@ -1 +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;AAGb,KAAK,UAAU,gBAAgB,CAC5C,aAA4B;IAE5B,MAAM,eAAe,GAAG,MAAM,IAAA,6BAAyB,GAAE,CAAC;IAE1D,IAAI,eAAe,KAAK,qCAAe,CAAC,MAAM,EAAE;QAC9C,MAAM,IAAA,yBAAe,
|
|
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;AAGb,KAAK,UAAU,gBAAgB,CAC5C,aAA4B;IAE5B,MAAM,eAAe,GAAG,MAAM,IAAA,6BAAyB,GAAE,CAAC;IAE1D,IAAI,eAAe,KAAK,qCAAe,CAAC,MAAM,EAAE;QAC9C,MAAM,IAAA,yBAAe,EAAC,aAAa,CAAC,CAAC;QACrC,OAAO,gCAAuB,CAAC;KAChC;SAAM,IAAI,eAAe,KAAK,qCAAe,CAAC,IAAI,EAAE;QACnD,MAAM,IAAA,uBAAa,EAAC,aAAa,CAAC,CAAC;QACnC,OAAO,gCAAuB,CAAC;KAChC;SAAM;QACL,OAAO,eAAK,CAAC;KACd;AACH,CAAC;AAdD,mCAcC"}
|
|
@@ -22,38 +22,65 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.NextStepChoices = void 0;
|
|
26
|
+
const openTicket_1 = __importDefault(require("../../../lib/ticket/openTicket"));
|
|
25
27
|
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
26
28
|
const configureRemainingRequestOptions_1 = __importDefault(require("../action/configureRemainingRequestOptions"));
|
|
27
29
|
const detectProcessCharacteristics_1 = __importDefault(require("../action/detectProcessCharacteristics"));
|
|
28
30
|
const continueWithRequestOptionConfiguration_1 = __importStar(require("../prompt/continueWithRequestOptionConfiguration"));
|
|
31
|
+
const abort_1 = __importDefault(require("./abort"));
|
|
29
32
|
const agentProcessNotRunning_1 = __importDefault(require("./agentProcessNotRunning"));
|
|
30
33
|
const record_remote_1 = __importDefault(require("./record_remote"));
|
|
34
|
+
exports.NextStepChoices = {
|
|
35
|
+
CONFIGURE: { name: 'Configure the path and protocol', value: 'configure' },
|
|
36
|
+
RELAUNCH: { name: 'Re-launch the server', value: 'relaunch' },
|
|
37
|
+
SUPPORT: { name: 'Contact support', value: 'support' },
|
|
38
|
+
};
|
|
31
39
|
// The agent was not reachable using the configured settings. This may be because:
|
|
32
40
|
// * The agent process isn't running.
|
|
33
41
|
// * The agent process is running, but the agent isn't reachable (e.g. security filter?).
|
|
34
42
|
// * The host/port parameters are wrong.
|
|
35
43
|
// * The host/port parameters are right, but the agent URL is different than the default.
|
|
36
44
|
async function agentNotAvailable(recordContext) {
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
var _a;
|
|
46
|
+
if (!(await (0, detectProcessCharacteristics_1.default)(recordContext))) {
|
|
47
|
+
if ((await (0, continueWithRequestOptionConfiguration_1.default)(recordContext)) ===
|
|
39
48
|
continueWithRequestOptionConfiguration_1.ConfigurationAction.HostAndPort)
|
|
40
49
|
return agentProcessNotRunning_1.default;
|
|
41
50
|
}
|
|
42
51
|
userInteraction_1.default.progress(`
|
|
43
52
|
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:
|
|
44
53
|
|
|
45
|
-
1) The agent
|
|
46
|
-
2) The agent
|
|
47
|
-
3) The agent is enabled
|
|
54
|
+
1) 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.
|
|
55
|
+
2) 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).
|
|
56
|
+
3) The agent is enabled, but HTTP requests to the agent are being blocked by some application or framework code; for example, a security filter.
|
|
48
57
|
|
|
49
|
-
For case (1), you
|
|
58
|
+
For case (1), you can configure the application URL path and protocol.
|
|
50
59
|
|
|
51
|
-
For case (2), you
|
|
60
|
+
For case (2), you'll need to re-launch the server with the agent enabled.
|
|
52
61
|
|
|
53
|
-
For case (3), you
|
|
62
|
+
For case (3), you should contact AppMap support for help with troubleshooting.
|
|
54
63
|
`);
|
|
55
|
-
await
|
|
56
|
-
|
|
64
|
+
const { option } = await userInteraction_1.default.prompt({
|
|
65
|
+
type: 'list',
|
|
66
|
+
name: 'option',
|
|
67
|
+
message: 'Which would you like to do?',
|
|
68
|
+
choices: Object.values(exports.NextStepChoices),
|
|
69
|
+
});
|
|
70
|
+
switch (option) {
|
|
71
|
+
case exports.NextStepChoices.CONFIGURE.value:
|
|
72
|
+
await (0, configureRemainingRequestOptions_1.default)(recordContext);
|
|
73
|
+
recordContext.populateURL();
|
|
74
|
+
break;
|
|
75
|
+
case exports.NextStepChoices.RELAUNCH.value:
|
|
76
|
+
await userInteraction_1.default.continue('Press enter when the server has been restarted');
|
|
77
|
+
break;
|
|
78
|
+
case exports.NextStepChoices.SUPPORT.value:
|
|
79
|
+
const details = ((_a = recordContext.remoteError) === null || _a === void 0 ? void 0 : _a.toString()) || '';
|
|
80
|
+
await (0, openTicket_1.default)(details);
|
|
81
|
+
return abort_1.default; // We're done
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
57
84
|
return record_remote_1.default;
|
|
58
85
|
}
|
|
59
86
|
exports.default = agentNotAvailable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentNotAvailable.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/agentNotAvailable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentNotAvailable.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/agentNotAvailable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAwD;AACxD,4EAAuC;AACvC,kHAA0F;AAC1F,0GAAkF;AAClF,2HAE0D;AAG1D,oDAA4B;AAC5B,sFAA8D;AAC9D,oEAAsC;AAEzB,QAAA,eAAe,GAAG;IAC7B,SAAS,EAAE,EAAE,IAAI,EAAE,iCAAiC,EAAE,KAAK,EAAE,WAAW,EAAE;IAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,UAAU,EAAE;IAC7D,OAAO,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,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("../action/configureHostA
|
|
|
8
8
|
const record_remote_1 = __importDefault(require("./record_remote"));
|
|
9
9
|
// No process could be contact on the configured host and port.
|
|
10
10
|
// Prompt the user to start the agent process, and then start over.
|
|
11
|
-
async function agentProcessNotRunning() {
|
|
11
|
+
async function agentProcessNotRunning(context) {
|
|
12
12
|
userInteraction_1.default.progress(`It looks like you need to start your app (make sure you have the AppMap agent enabled).`);
|
|
13
13
|
userInteraction_1.default.progress(`Or maybe your app is running, but it's on a different host and/or port.`);
|
|
14
14
|
userInteraction_1.default.progress(``);
|
|
@@ -23,7 +23,7 @@ async function agentProcessNotRunning() {
|
|
|
23
23
|
Java: https://appland.com/docs/reference/appmap-java.html#remote-recording
|
|
24
24
|
JavaScript: https://appland.com/docs/reference/appmap-agent-js.html#remote-recording
|
|
25
25
|
`);
|
|
26
|
-
await (0, configureHostAndPort_1.default)();
|
|
26
|
+
await (0, configureHostAndPort_1.default)(context);
|
|
27
27
|
return record_remote_1.default;
|
|
28
28
|
}
|
|
29
29
|
exports.default = agentProcessNotRunning;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentProcessNotRunning.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/agentProcessNotRunning.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,0FAAkE;
|
|
1
|
+
{"version":3,"file":"agentProcessNotRunning.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/agentProcessNotRunning.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,0FAAkE;AAGlE,oEAAsC;AAEtC,+DAA+D;AAC/D,mEAAmE;AACpD,KAAK,UAAU,sBAAsB,CAClD,OAAsB;IAEtB,yBAAE,CAAC,QAAQ,CACT,yFAAyF,CAC1F,CAAC;IACF,yBAAE,CAAC,QAAQ,CACT,yEAAyE,CAC1E,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEhB,yBAAE,CAAC,QAAQ,CACT,wDAAwD;QACtD,oFAAoF;QACpF,gGAAgG;QAChG,wBAAwB,CAC3B,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC;;;;;;GAMX,CAAC,CAAC;IAEH,MAAM,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC;IAEpC,OAAO,uBAAO,CAAC;AACjB,CAAC;AA5BD,yCA4BC"}
|
|
@@ -22,7 +22,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createState = void 0;
|
|
25
26
|
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
27
|
+
async function createState(method) {
|
|
28
|
+
return (await Promise.resolve().then(() => __importStar(require(`./record_${method}`)))).default;
|
|
29
|
+
}
|
|
30
|
+
exports.createState = createState;
|
|
26
31
|
async function initial(recordContext) {
|
|
27
32
|
const choices = {
|
|
28
33
|
'test cases': 'test',
|
|
@@ -36,7 +41,7 @@ async function initial(recordContext) {
|
|
|
36
41
|
});
|
|
37
42
|
const method = choices[methodName];
|
|
38
43
|
recordContext.recordMethod = method;
|
|
39
|
-
return
|
|
44
|
+
return createState.bind(null, method);
|
|
40
45
|
}
|
|
41
46
|
exports.default = initial;
|
|
42
47
|
//# sourceMappingURL=initial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/initial.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initial.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/initial.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4EAAuC;AAIhC,KAAK,UAAU,WAAW,CAAC,MAAc;IAC9C,OAAO,CAAC,wDAAa,YAAY,MAAM,EAAE,GAAC,CAAC,CAAC,OAAO,CAAC;AACtD,CAAC;AAFD,kCAEC;AAEc,KAAK,UAAU,OAAO,CACnC,aAA4B;IAE5B,MAAM,OAAO,GAAG;QACd,YAAY,EAAE,MAAM;QACpB,kBAAkB,EAAE,QAAQ;KAC7B,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEnC,aAAa,CAAC,YAAY,GAAG,MAAM,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAlBD,0BAkBC"}
|
|
@@ -11,9 +11,9 @@ const agentNotAvailable_1 = __importDefault(require("./agentNotAvailable"));
|
|
|
11
11
|
// This is the initial state of remote recording. From here, the connection to the AppMap
|
|
12
12
|
// agent must be configured and verified, and then the recording will be run.
|
|
13
13
|
async function remote(recordContext) {
|
|
14
|
-
|
|
15
|
-
if (await (0, isAgentAvailable_1.default)()) {
|
|
16
|
-
if (!(await (0, isRecordingInProgress_1.default)())) {
|
|
14
|
+
recordContext.populateURL();
|
|
15
|
+
if (await (0, isAgentAvailable_1.default)(recordContext)) {
|
|
16
|
+
if (!(await (0, isRecordingInProgress_1.default)(recordContext))) {
|
|
17
17
|
return agentAvailableAndReady_1.default;
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record_remote.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/record_remote.ts"],"names":[],"mappings":";;;;;AAAA,gFAAwD;AACxD,0FAAkE;AAClE,sFAA8D;AAC9D,0EAAkD;AAClD,4EAAoD;AAIpD,yFAAyF;AACzF,6EAA6E;AAC9D,KAAK,UAAU,MAAM,CAClC,aAA4B;IAE5B,
|
|
1
|
+
{"version":3,"file":"record_remote.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/record_remote.ts"],"names":[],"mappings":";;;;;AAAA,gFAAwD;AACxD,0FAAkE;AAClE,sFAA8D;AAC9D,0EAAkD;AAClD,4EAAoD;AAIpD,yFAAyF;AACzF,6EAA6E;AAC9D,KAAK,UAAU,MAAM,CAClC,aAA4B;IAE5B,aAAa,CAAC,WAAW,EAAE,CAAC;IAC5B,IAAI,MAAM,IAAA,0BAAgB,EAAC,aAAa,CAAC,EAAE;QACzC,IAAI,CAAC,CAAC,MAAM,IAAA,+BAAqB,EAAC,aAAa,CAAC,CAAC,EAAE;YACjD,OAAO,gCAAsB,CAAC;SAC/B;aAAM;YACL,OAAO,0BAAgB,CAAC;SACzB;KACF;SAAM;QACL,OAAO,2BAAiB,CAAC;KAC1B;AACH,CAAC;AAbD,yBAaC"}
|
|
@@ -9,8 +9,8 @@ const testCommandsAvailable_1 = __importDefault(require("./testCommandsAvailable
|
|
|
9
9
|
// This is the initial state of test case recording. From here, the record command is
|
|
10
10
|
// configured by the user and executed.
|
|
11
11
|
async function test(recordContext) {
|
|
12
|
-
if (await (0, areTestCommandsConfigured_1.default)()) {
|
|
13
|
-
|
|
12
|
+
if (await (0, areTestCommandsConfigured_1.default)(recordContext)) {
|
|
13
|
+
recordContext.populateTestCommands();
|
|
14
14
|
return testCommandsAvailable_1.default;
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record_test.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/record_test.ts"],"names":[],"mappings":";;;;;AAAA,kGAA0E;AAE1E,8EAAsD;AACtD,oFAA4D;AAG5D,qFAAqF;AACrF,uCAAuC;AACxB,KAAK,UAAU,IAAI,CAChC,aAA4B;IAE5B,IAAI,MAAM,IAAA,mCAAyB,
|
|
1
|
+
{"version":3,"file":"record_test.js","sourceRoot":"","sources":["../../../../src/cmds/record/state/record_test.ts"],"names":[],"mappings":";;;;;AAAA,kGAA0E;AAE1E,8EAAsD;AACtD,oFAA4D;AAG5D,qFAAqF;AACrF,uCAAuC;AACxB,KAAK,UAAU,IAAI,CAChC,aAA4B;IAE5B,IAAI,MAAM,IAAA,mCAAyB,EAAC,aAAa,CAAC,EAAE;QAClD,aAAa,CAAC,oBAAoB,EAAE,CAAC;QAErC,OAAO,+BAAqB,CAAC;KAC9B;SAAM;QACL,OAAO,4BAAkB,CAAC;KAC3B;AACH,CAAC;AAVD,uBAUC"}
|