@appland/appmap 3.18.3 → 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 +27 -0
- package/built/appmap.html +1 -1
- package/built/main.js.LICENSE.txt +1 -1
- package/built/main.js.map +1 -1
- package/built/package.json +3 -1
- package/built/src/cmds/agentInstaller/gradleInstaller.js +24 -3
- package/built/src/cmds/agentInstaller/gradleInstaller.js.map +1 -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/built/src/openapi/command.js +33 -17
- package/built/src/openapi/command.js.map +1 -1
- package/built/src/openapi/index.js +28 -0
- package/built/src/openapi/index.js.map +1 -0
- package/built/src/openapi/method.js +54 -49
- package/built/src/openapi/method.js.map +1 -1
- package/built/src/openapi/model.js +19 -22
- package/built/src/openapi/model.js.map +1 -1
- package/built/src/openapi/objectSchema.js +47 -0
- package/built/src/openapi/objectSchema.js.map +1 -0
- package/built/src/openapi/parseHTTPServerRequests.js +11 -0
- package/built/src/openapi/parseHTTPServerRequests.js.map +1 -0
- package/built/src/openapi/path.js +13 -14
- package/built/src/openapi/path.js.map +1 -1
- package/built/src/openapi/provider.js +73 -0
- package/built/src/openapi/provider.js.map +1 -0
- package/built/src/openapi/response.js +37 -13
- package/built/src/openapi/response.js.map +1 -1
- package/built/src/openapi/rpcRequest.js +87 -0
- package/built/src/openapi/rpcRequest.js.map +1 -0
- package/built/src/openapi/schemaInferrer.js +59 -0
- package/built/src/openapi/schemaInferrer.js.map +1 -0
- package/built/src/openapi/securitySchemes.js +14 -39
- package/built/src/openapi/securitySchemes.js.map +1 -1
- package/built/src/openapi/statusCodes.js +68 -0
- package/built/src/openapi/statusCodes.js.map +1 -0
- package/built/src/openapi/util.js +67 -47
- package/built/src/openapi/util.js.map +1 -1
- package/package.json +5 -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/src/openapi/schema.js +0 -34
- package/built/src/openapi/schema.js.map +0 -1
- package/built/src/openapi/settings.js +0 -10
- package/built/src/openapi/settings.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcRequest.js","sourceRoot":"","sources":["../../../src/openapi/rpcRequest.ts"],"names":[],"mappings":";;;AAEA,6BAA0B;AAC1B,iCAAsC;AActC,MAAM,gBAAgB;IACpB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AI,EAAE,CAAC;IACrC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;IAChC,CAAC;IAED,IAAI,cAAc;;QAChB,OAAO,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,iBAAiB,0CAAE,OAAO,KAAI,EAAE,CAAC;IACrD,CAAC;IAED,IAAI,eAAe;;QACjB,OAAO,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,0CAAE,OAAO,KAAI,EAAE,CAAC;IACtD,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAmB,CAAC;IACxC,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAoB,CAAC;IACzC,CAAC;IAED,IAAI,aAAa;;QACf,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,aAAa,0CAAE,WAAW,EAA2B,CAAC;IAC1E,CAAC;IAED,IAAI,WAAW;QACb,uDAAuD;QACvD,OAAO,IAAI,SAAG,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;IAC7D,CAAC;CACF;AAED,SAAgB,kBAAkB,CAAC,KAAY;IAC7C,IAAI,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,kBAAkB,EAAE;QACvD,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;KACpC;SAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,kBAAkB,EAAE;QAC9D,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;KACpC;AACH,CAAC;AAND,gDAMC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("./util");
|
|
4
|
+
function mergeProperties(a, b) {
|
|
5
|
+
a || (a = {});
|
|
6
|
+
b || (b = {});
|
|
7
|
+
return Object.keys(a)
|
|
8
|
+
.concat(Object.keys(b))
|
|
9
|
+
.reduce((memo, key) => {
|
|
10
|
+
memo[key] = mergeType(a[key] || {}, b[key] || {});
|
|
11
|
+
return memo;
|
|
12
|
+
}, {});
|
|
13
|
+
}
|
|
14
|
+
// Merge type, items and properties of schema objects.
|
|
15
|
+
function mergeType(a, b) {
|
|
16
|
+
var _a, _b, _c, _d;
|
|
17
|
+
if (b === null || b === undefined)
|
|
18
|
+
return a;
|
|
19
|
+
const result = Object.assign({}, a);
|
|
20
|
+
if (!a.type) {
|
|
21
|
+
result.type = b.type;
|
|
22
|
+
}
|
|
23
|
+
else if (b.type === 'array') {
|
|
24
|
+
result.type = 'array';
|
|
25
|
+
}
|
|
26
|
+
else if (b.type === 'object') {
|
|
27
|
+
result.type = 'object';
|
|
28
|
+
}
|
|
29
|
+
if (a.items || b.items) {
|
|
30
|
+
result.items = mergeType(a.items || {}, b.items);
|
|
31
|
+
if (((_a = a.items) === null || _a === void 0 ? void 0 : _a.properties) || ((_b = b.items) === null || _b === void 0 ? void 0 : _b.properties)) {
|
|
32
|
+
result.items.properties = mergeProperties((_c = a.items) === null || _c === void 0 ? void 0 : _c.properties, (_d = b.items) === null || _d === void 0 ? void 0 : _d.properties);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (a.properties || b.properties) {
|
|
37
|
+
result.properties = mergeProperties(a.properties, b.properties);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
class SchemaInferrer {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.examples = [];
|
|
45
|
+
}
|
|
46
|
+
openapi() {
|
|
47
|
+
if (this.examples.length === 0)
|
|
48
|
+
return;
|
|
49
|
+
return this.examples.reduce((memo, example) => {
|
|
50
|
+
const schema = (0, util_1.messageToOpenAPISchema)(example);
|
|
51
|
+
return mergeType(memo, schema);
|
|
52
|
+
}, {});
|
|
53
|
+
}
|
|
54
|
+
addExample(value) {
|
|
55
|
+
this.examples.push(value);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = SchemaInferrer;
|
|
59
|
+
//# sourceMappingURL=schemaInferrer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaInferrer.js","sourceRoot":"","sources":["../../../src/openapi/schemaInferrer.ts"],"names":[],"mappings":";;AAEA,iCAAgD;AAEhD,SAAS,eAAe,CAAC,CAAM,EAAE,CAAM;IACrC,CAAC,KAAD,CAAC,GAAK,EAAE,EAAC;IACT,CAAC,KAAD,CAAC,GAAK,EAAE,EAAC;IAET,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SAClB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACtB,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACpB,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AAED,sDAAsD;AACtD,SAAS,SAAS,CAChB,CAAM,EACN,CAAO;;IAEP,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;QACX,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;KACtB;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE;QAC7B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;KACvB;SAAM,IAAI,CAAC,CAAC,IAA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BD,iCAmBC"}
|
|
@@ -1,56 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (tokens.length === 1) {
|
|
5
|
-
return {
|
|
6
|
-
schemeId: 'api_key',
|
|
7
|
-
scheme: {
|
|
8
|
-
type: 'apiKey',
|
|
9
|
-
name: 'authorization',
|
|
10
|
-
in: 'header',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const schemeId = tokens[0].toLowerCase();
|
|
15
|
-
return {
|
|
16
|
-
schemeId,
|
|
17
|
-
scheme: {
|
|
18
|
-
type: 'http',
|
|
19
|
-
scheme: schemeId,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("./util");
|
|
23
4
|
class SecuritySchemes {
|
|
24
5
|
constructor() {
|
|
25
|
-
this.
|
|
6
|
+
this.rpcRequests = [];
|
|
26
7
|
}
|
|
27
8
|
/**
|
|
28
9
|
* Adds an event to the security schemes, and assigns a security scheme id.
|
|
29
10
|
* If the event has no detectable security scheme, this function returns null.
|
|
30
11
|
*
|
|
31
|
-
* @param {Event} event
|
|
32
12
|
* @returns the security scheme id for the event, or null.
|
|
33
13
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (!authorization) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
const { schemeId, scheme } = parseScheme(authorization);
|
|
40
|
-
if (!this.schemes[schemeId]) {
|
|
41
|
-
this.schemes[schemeId] = scheme;
|
|
42
|
-
}
|
|
43
|
-
return schemeId;
|
|
14
|
+
addRpcRequest(rpcRequest) {
|
|
15
|
+
this.rpcRequests.push(rpcRequest);
|
|
44
16
|
}
|
|
45
17
|
openapi() {
|
|
46
|
-
return
|
|
47
|
-
.
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
return this.rpcRequests
|
|
19
|
+
.map((rpcRequest) => rpcRequest.requestHeaders['Authorization'])
|
|
20
|
+
.filter((authorization) => authorization)
|
|
21
|
+
.reduce((memo, authorization) => {
|
|
22
|
+
const scheme = (0, util_1.parseScheme)(authorization);
|
|
23
|
+
if (!memo[scheme.schemeId]) {
|
|
24
|
+
memo[scheme.schemeId] = scheme.scheme;
|
|
25
|
+
}
|
|
51
26
|
return memo;
|
|
52
27
|
}, {});
|
|
53
28
|
}
|
|
54
29
|
}
|
|
55
|
-
|
|
30
|
+
exports.default = SecuritySchemes;
|
|
56
31
|
//# sourceMappingURL=securitySchemes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securitySchemes.js","sourceRoot":"","sources":["../../../src/openapi/securitySchemes.
|
|
1
|
+
{"version":3,"file":"securitySchemes.js","sourceRoot":"","sources":["../../../src/openapi/securitySchemes.ts"],"names":[],"mappings":";;AAEA,iCAAqC;AAErC,MAAqB,eAAe;IAApC;QACE,gBAAW,GAAiB,EAAE,CAAC;IAwBjC,CAAC;IAtBC;;;;;OAKG;IACH,aAAa,CAAC,UAAsB;QAClC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,WAAW;aACpB,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;aAC/D,MAAM,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC;aACxC,MAAM,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE;YAC9B,MAAM,MAAM,GAAG,IAAA,kBAAW,EAAC,aAAa,CAAC,CAAC;YAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;gBAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;aACvC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,EAAE,EAAoD,CAAC,CAAC;IAC7D,CAAC;CACF;AAzBD,kCAyBC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// https://github.com/nodejs/node/blob/f1653cc9b80b521ef5b129537ce1df9098bbdc1b/lib/_http_server.js#L18-L81
|
|
4
|
+
exports.default = {
|
|
5
|
+
100: 'Continue',
|
|
6
|
+
101: 'Switching Protocols',
|
|
7
|
+
102: 'Processing',
|
|
8
|
+
200: 'OK',
|
|
9
|
+
201: 'Created',
|
|
10
|
+
202: 'Accepted',
|
|
11
|
+
203: 'Non-Authoritative Information',
|
|
12
|
+
204: 'No Content',
|
|
13
|
+
205: 'Reset Content',
|
|
14
|
+
206: 'Partial Content',
|
|
15
|
+
207: 'Multi-Status',
|
|
16
|
+
208: 'Already Reported',
|
|
17
|
+
226: 'IM Used',
|
|
18
|
+
300: 'Multiple Choices',
|
|
19
|
+
301: 'Moved Permanently',
|
|
20
|
+
302: 'Found',
|
|
21
|
+
303: 'See Other',
|
|
22
|
+
304: 'Not Modified',
|
|
23
|
+
305: 'Use Proxy',
|
|
24
|
+
307: 'Temporary Redirect',
|
|
25
|
+
308: 'Permanent Redirect',
|
|
26
|
+
400: 'Bad Request',
|
|
27
|
+
401: 'Unauthorized',
|
|
28
|
+
402: 'Payment Required',
|
|
29
|
+
403: 'Forbidden',
|
|
30
|
+
404: 'Not Found',
|
|
31
|
+
405: 'Method Not Allowed',
|
|
32
|
+
406: 'Not Acceptable',
|
|
33
|
+
407: 'Proxy Authentication Required',
|
|
34
|
+
408: 'Request Timeout',
|
|
35
|
+
409: 'Conflict',
|
|
36
|
+
410: 'Gone',
|
|
37
|
+
411: 'Length Required',
|
|
38
|
+
412: 'Precondition Failed',
|
|
39
|
+
413: 'Payload Too Large',
|
|
40
|
+
414: 'URI Too Long',
|
|
41
|
+
415: 'Unsupported Media Type',
|
|
42
|
+
416: 'Range Not Satisfiable',
|
|
43
|
+
417: 'Expectation Failed',
|
|
44
|
+
418: "I'm a teapot",
|
|
45
|
+
421: 'Misdirected Request',
|
|
46
|
+
422: 'Unprocessable Entity',
|
|
47
|
+
423: 'Locked',
|
|
48
|
+
424: 'Failed Dependency',
|
|
49
|
+
425: 'Unordered Collection',
|
|
50
|
+
426: 'Upgrade Required',
|
|
51
|
+
428: 'Precondition Required',
|
|
52
|
+
429: 'Too Many Requests',
|
|
53
|
+
431: 'Request Header Fields Too Large',
|
|
54
|
+
451: 'Unavailable For Legal Reasons',
|
|
55
|
+
500: 'Internal Server Error',
|
|
56
|
+
501: 'Not Implemented',
|
|
57
|
+
502: 'Bad Gateway',
|
|
58
|
+
503: 'Service Unavailable',
|
|
59
|
+
504: 'Gateway Timeout',
|
|
60
|
+
505: 'HTTP Version Not Supported',
|
|
61
|
+
506: 'Variant Also Negotiates',
|
|
62
|
+
507: 'Insufficient Storage',
|
|
63
|
+
508: 'Loop Detected',
|
|
64
|
+
509: 'Bandwidth Limit Exceeded',
|
|
65
|
+
510: 'Not Extended',
|
|
66
|
+
511: 'Network Authentication Required',
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=statusCodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusCodes.js","sourceRoot":"","sources":["../../../src/openapi/statusCodes.ts"],"names":[],"mappings":";;AAAA,2GAA2G;AAC3G,kBAAe;IACb,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,kB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AG,EAAE,iCAAiC;CACb,CAAC"}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseScheme = exports.messageToOpenAPISchema = exports.ensureString = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
3
5
|
const unrecognizedTypes = new Set();
|
|
6
|
+
function parseScheme(authorization) {
|
|
7
|
+
const tokens = authorization.split(/\s/);
|
|
8
|
+
if (tokens.length === 1) {
|
|
9
|
+
return {
|
|
10
|
+
schemeId: 'api_key',
|
|
11
|
+
scheme: {
|
|
12
|
+
type: 'apiKey',
|
|
13
|
+
name: 'authorization',
|
|
14
|
+
in: 'header',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const schemeId = tokens[0].toLowerCase();
|
|
19
|
+
return {
|
|
20
|
+
schemeId,
|
|
21
|
+
scheme: {
|
|
22
|
+
type: 'http',
|
|
23
|
+
scheme: schemeId,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.parseScheme = parseScheme;
|
|
4
28
|
function classNameToOpenAPIType(className) {
|
|
5
29
|
if (!className || className === '') {
|
|
6
30
|
return 'unknown';
|
|
@@ -8,24 +32,29 @@ function classNameToOpenAPIType(className) {
|
|
|
8
32
|
const mapRubyType = (t) => {
|
|
9
33
|
switch (t) {
|
|
10
34
|
case 'array':
|
|
35
|
+
case 'sequel::postgres::pgarray':
|
|
11
36
|
return 'array';
|
|
12
37
|
case 'hash':
|
|
38
|
+
case 'sequel::postgres::jsonbhash':
|
|
13
39
|
case 'activesupport::hashwithindifferentaccess':
|
|
14
40
|
return 'object';
|
|
15
|
-
case '
|
|
16
|
-
return '
|
|
41
|
+
case 'integer':
|
|
42
|
+
return 'integer';
|
|
43
|
+
case 'float':
|
|
44
|
+
case 'numeric':
|
|
45
|
+
return 'number';
|
|
17
46
|
case 'trueclass':
|
|
18
47
|
case 'falseclass':
|
|
19
48
|
return 'boolean';
|
|
49
|
+
case 'nilclass':
|
|
50
|
+
return 'unknown';
|
|
20
51
|
case 'string':
|
|
21
52
|
return 'string';
|
|
22
|
-
default:
|
|
23
|
-
return undefined;
|
|
24
53
|
}
|
|
25
54
|
};
|
|
26
55
|
const mapPythonType = (t) => {
|
|
27
56
|
if (!t.startsWith('builtins.')) {
|
|
28
|
-
return
|
|
57
|
+
return;
|
|
29
58
|
}
|
|
30
59
|
switch (t.substr(9)) {
|
|
31
60
|
case 'bool':
|
|
@@ -38,74 +67,65 @@ function classNameToOpenAPIType(className) {
|
|
|
38
67
|
return 'array';
|
|
39
68
|
case 'str':
|
|
40
69
|
return 'string';
|
|
41
|
-
default:
|
|
42
|
-
return undefined;
|
|
43
70
|
}
|
|
44
71
|
};
|
|
45
72
|
const mapJavaType = (t) => {
|
|
46
73
|
switch (t) {
|
|
47
74
|
case 'java.lang.string':
|
|
48
75
|
return 'string';
|
|
49
|
-
default:
|
|
50
|
-
return undefined;
|
|
51
76
|
}
|
|
52
77
|
};
|
|
53
78
|
const mapper = (t) => mapRubyType(t) || mapPythonType(t) || mapJavaType(t);
|
|
54
79
|
const mapped = mapper(className.toLowerCase());
|
|
55
80
|
if (!mapped && !unrecognizedTypes.has(className)) {
|
|
56
|
-
|
|
81
|
+
if ((0, utils_1.verbose)()) {
|
|
82
|
+
console.warn(`Warning: Don't know how to map "${className}" to an OpenAPI type. You'll need to update the generated file.`);
|
|
83
|
+
}
|
|
57
84
|
unrecognizedTypes.add(className);
|
|
58
|
-
return
|
|
85
|
+
return 'object';
|
|
59
86
|
}
|
|
60
87
|
return mapped;
|
|
61
88
|
}
|
|
62
89
|
function messageToOpenAPISchema(message) {
|
|
63
90
|
const type = classNameToOpenAPIType(message.class);
|
|
91
|
+
if (type === 'unknown')
|
|
92
|
+
return;
|
|
64
93
|
const result = { type };
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (type === 'array') {
|
|
79
|
-
// This is our best guess right now.
|
|
80
|
-
result.items = { type: 'string' };
|
|
81
|
-
}
|
|
82
|
-
else if (type === 'object' && message.properties) {
|
|
83
|
-
result.properties = message.properties.reduce((memo, msgProperty) => {
|
|
84
|
-
// eslint-disable-next-line no-param-reassign
|
|
85
|
-
memo[msgProperty.name] = {
|
|
86
|
-
type: classNameToOpenAPIType(msgProperty.class),
|
|
87
|
-
};
|
|
94
|
+
if (message.properties) {
|
|
95
|
+
const properties = message.properties.reduce((memo, msgProperty) => {
|
|
96
|
+
const type = classNameToOpenAPIType(msgProperty.class);
|
|
97
|
+
if (type === 'array') {
|
|
98
|
+
// eslint-disable-next-line no-param-reassign
|
|
99
|
+
memo[msgProperty.name] = { type };
|
|
100
|
+
}
|
|
101
|
+
else if (type !== 'unknown') {
|
|
102
|
+
// eslint-disable-next-line no-param-reassign
|
|
103
|
+
memo[msgProperty.name] = {
|
|
104
|
+
type,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
88
107
|
return memo;
|
|
89
108
|
}, {});
|
|
109
|
+
if (type === 'array') {
|
|
110
|
+
result.items = { type: 'object', properties };
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
result.properties = properties;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
if (type === 'array') {
|
|
118
|
+
result.items = { type: 'string' };
|
|
119
|
+
}
|
|
90
120
|
}
|
|
91
121
|
return result;
|
|
92
122
|
}
|
|
93
|
-
|
|
94
|
-
const appmap = buildAppMap().source(source).normalize().build();
|
|
95
|
-
appmap.events.filter((e) => e.httpServerRequest).forEach(collector);
|
|
96
|
-
}
|
|
123
|
+
exports.messageToOpenAPISchema = messageToOpenAPISchema;
|
|
97
124
|
function ensureString(value) {
|
|
98
125
|
if (Array.isArray(value)) {
|
|
99
126
|
return value.join('');
|
|
100
127
|
}
|
|
101
128
|
return value.toString();
|
|
102
129
|
}
|
|
103
|
-
|
|
104
|
-
return ensureString(httpServerRequest.normalized_path_info || httpServerRequest.path_info || '');
|
|
105
|
-
}
|
|
106
|
-
module.exports = {
|
|
107
|
-
bestPathInfo,
|
|
108
|
-
messageToOpenAPISchema,
|
|
109
|
-
parseHTTPServerRequests,
|
|
110
|
-
};
|
|
130
|
+
exports.ensureString = ensureString;
|
|
111
131
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/openapi/util.
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/openapi/util.ts"],"names":[],"mappings":";;;AAEA,oCAAmC;AAEnC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;AAOpC,SAAS,WAAW,CAAC,aAAqB;IACxC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,OAAO;YACL,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,eAAe;gBACrB,EAAE,EAAE,QAAQ;aACqB;SACpC,CAAC;KACH;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO;QACL,QAAQ;QACR,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,QAAQ;SACe;KAClC,CAAC;AACJ,CAAC;AAsH8C,kCAAW;AApH1D,SAAS,sBAAsB,CAAC,SAAS;IACvC,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,EAAE,EAAE;QAClC,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,WAAW,GAAG,CAAC,CAAS,EAAsB,E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KACF;SAAM;QACL,IAAI,IAAI,KAAK,OAAO,EAAE;YACpB,MAAM,CAAC,KAAK,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;SACnC;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AASsB,wDAAsB;AAP7C,SAAS,YAAY,CAAC,KAAU;IAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACvB;IACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AAEQ,oCAAY"}
|
package/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",
|
|
@@ -66,8 +67,8 @@
|
|
|
66
67
|
"vuex"
|
|
67
68
|
],
|
|
68
69
|
"dependencies": {
|
|
69
|
-
"@appland/components": "
|
|
70
|
-
"@appland/diagrams": "1.5.
|
|
70
|
+
"@appland/components": "2.0.3",
|
|
71
|
+
"@appland/diagrams": "1.5.2",
|
|
71
72
|
"@appland/models": "^1.14.1",
|
|
72
73
|
"@sidvind/better-ajv-errors": "^0.9.1",
|
|
73
74
|
"@types/moo": "^0.5.5",
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
"jsdom": "^16.6.0",
|
|
92
93
|
"moo": "^0.5.1",
|
|
93
94
|
"open": "^8.2.1",
|
|
95
|
+
"openapi-types": "^10.0.0",
|
|
94
96
|
"ora": "^5.4.1",
|
|
95
97
|
"port-pid": "^0.0.7",
|
|
96
98
|
"ps-node": "^0.1.6",
|
|
@@ -1,16 +0,0 @@
|
|
|
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 (0, configureHostAndPort_1.default)(requestOptions);
|
|
12
|
-
await (0, confirmProcessCharacteristics_1.default)(requestOptions);
|
|
13
|
-
await (0, configureRemainingRequestOptions_1.default)(requestOptions);
|
|
14
|
-
}
|
|
15
|
-
exports.default = configureConnection;
|
|
16
|
-
//# sourceMappingURL=configureConnection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAA,8BAAoB,EAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,IAAA,uCAA6B,EAAC,cAAc,CAAC,CAAC;IACpD,MAAM,IAAA,0CAAgC,EAAC,cAAc,CAAC,CAAC;AACzD,CAAC;AARD,sCAQC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,28 +0,0 @@
|
|
|
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(`Here's the URL I will use to try and connect to the AppMap agent:\n`);
|
|
23
|
-
userInteraction_1.default.progress(`${requestOptions.protocol}//${requestOptions.hostname}:${requestOptions.port}${requestOptions.path}_appmap/record`);
|
|
24
|
-
userInteraction_1.default.progress('');
|
|
25
|
-
await (0, ready_1.default)();
|
|
26
|
-
}
|
|
27
|
-
exports.default = configureRemainingRequestOptions;
|
|
28
|
-
//# sourceMappingURL=configureRemainingRequestOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CACT,qEAAqE,CACtE,CAAC;IACF,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,IAAA,eAAK,GAAE,CAAC;AAChB,CAAC;AA7BD,mDA6BC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
const pids = await (0, port_pid_1.default)(requestOptions.port).then(async (pids) => {
|
|
39
|
-
if (pids && pids.tcp.length > 0) {
|
|
40
|
-
await Promise.all(pids.tcp.map(printPid));
|
|
41
|
-
return pids;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
userInteraction_1.default.error(`No process found on port ${requestOptions.port}`);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
async function confirm() {
|
|
48
|
-
const { looksGood } = await userInteraction_1.default.prompt({
|
|
49
|
-
type: 'confirm',
|
|
50
|
-
name: 'looksGood',
|
|
51
|
-
message: `Is this your server running at localhost:${requestOptions.port}?`,
|
|
52
|
-
default: 'y',
|
|
53
|
-
});
|
|
54
|
-
return looksGood;
|
|
55
|
-
}
|
|
56
|
-
userInteraction_1.default.progress('');
|
|
57
|
-
const looksGood = pids && (await confirm());
|
|
58
|
-
if (!looksGood) {
|
|
59
|
-
const { reconfigureOrRetry } = await userInteraction_1.default.prompt({
|
|
60
|
-
type: 'list',
|
|
61
|
-
choices: ['reconfigure', 'retry'],
|
|
62
|
-
name: 'reconfigureOrRetry',
|
|
63
|
-
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?',
|
|
64
|
-
});
|
|
65
|
-
if (reconfigureOrRetry === 'reconfigure') {
|
|
66
|
-
await (0, configureHostAndPort_1.default)(requestOptions);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
await (0, ready_1.default)();
|
|
70
|
-
}
|
|
71
|
-
await confirmProcessCharacteristics(requestOptions);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.default = confirmProcessCharacteristics;
|
|
75
|
-
//# sourceMappingURL=confirmProcessCharacteristics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,UAAU,GAAQ,EAAE,UAAiB;gBACtD,IAAI,GAAG,EAAE;oBACP,yBAAE,CAAC,KAAK,CAAC,WAAW,GAAG,eAAe,GAAG,EAAE,CAAC,CAAC;oBAC7C,OAAO;iBACR;gBAED,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC9B,IAAI,OAAO,EAAE;oBACX,yBAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;oBACxC,OAAO,EAAE,CAAC;iBACX;qBAAM;oBACL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AkB,KAAK,aAAa,EAAE;YACxC,MAAM,IAAA,8BAAoB,EAAC,cAAc,CAAC,CAAC;SAC5C;aAAM;YACL,MAAM,IAAA,eAAK,GAAE,CAAC;SACf;QAED,MAAM,6BAA6B,CAAC,cAAc,CAAC,CAAC;KACrD;AACH,CAAC;AA5ED,gDA4EC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,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,GA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