appium-remote-debugger 15.2.12 → 15.2.14
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 +12 -0
- package/build/lib/atoms.d.ts +16 -10
- package/build/lib/atoms.d.ts.map +1 -1
- package/build/lib/atoms.js +27 -16
- package/build/lib/atoms.js.map +1 -1
- package/build/lib/logger.d.ts +1 -2
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +2 -2
- package/build/lib/logger.js.map +1 -1
- package/build/lib/protocol/index.d.ts +13 -8
- package/build/lib/protocol/index.d.ts.map +1 -1
- package/build/lib/protocol/index.js +17 -12
- package/build/lib/protocol/index.js.map +1 -1
- package/build/lib/remote-debugger.js +2 -2
- package/build/lib/remote-debugger.js.map +1 -1
- package/build/lib/rpc/index.d.ts +2 -3
- package/build/lib/rpc/index.d.ts.map +1 -1
- package/build/lib/rpc/index.js +2 -2
- package/build/lib/rpc/index.js.map +1 -1
- package/build/lib/rpc/remote-messages.d.ts +62 -41
- package/build/lib/rpc/remote-messages.d.ts.map +1 -1
- package/build/lib/rpc/remote-messages.js +53 -38
- package/build/lib/rpc/remote-messages.js.map +1 -1
- package/build/lib/rpc/rpc-client-real-device.js +2 -5
- package/build/lib/rpc/rpc-client-real-device.js.map +1 -1
- package/build/lib/rpc/rpc-client-simulator.js +10 -10
- package/build/lib/rpc/rpc-client-simulator.js.map +1 -1
- package/build/lib/rpc/rpc-client.js +50 -50
- package/build/lib/rpc/rpc-client.js.map +1 -1
- package/build/lib/rpc/rpc-message-handler.d.ts +32 -39
- package/build/lib/rpc/rpc-message-handler.d.ts.map +1 -1
- package/build/lib/rpc/rpc-message-handler.js +45 -59
- package/build/lib/rpc/rpc-message-handler.js.map +1 -1
- package/build/lib/types.d.ts +3 -0
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/utils.d.ts +54 -34
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +58 -39
- package/build/lib/utils.js.map +1 -1
- package/build/test/functional/safari-e2e-specs.js +5 -1
- package/build/test/functional/safari-e2e-specs.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/atoms.ts +98 -0
- package/lib/logger.ts +3 -0
- package/lib/protocol/{index.js → index.ts} +29 -17
- package/lib/remote-debugger.ts +1 -1
- package/lib/rpc/index.ts +2 -0
- package/lib/rpc/{remote-messages.js → remote-messages.ts} +70 -56
- package/lib/rpc/rpc-client-real-device.js +1 -1
- package/lib/rpc/rpc-client-simulator.js +1 -1
- package/lib/rpc/rpc-client.js +1 -1
- package/lib/rpc/{rpc-message-handler.js → rpc-message-handler.ts} +74 -65
- package/lib/types.ts +4 -0
- package/lib/{utils.js → utils.ts} +72 -51
- package/package.json +1 -1
- package/lib/atoms.js +0 -84
- package/lib/logger.js +0 -6
- package/lib/rpc/index.js +0 -4
|
@@ -13,7 +13,7 @@ const FULL_COMMAND = 'getFullCommand';
|
|
|
13
13
|
const DIRECT_COMMAND = 'getDirectCommand';
|
|
14
14
|
// mapping of commands to the function for getting the command
|
|
15
15
|
// defaults to `getMinimalCommand`, so no need to have those listed here
|
|
16
|
-
const COMMANDS =
|
|
16
|
+
const COMMANDS = {
|
|
17
17
|
'Page.getCookies': FULL_COMMAND,
|
|
18
18
|
'Page.navigate': FULL_COMMAND,
|
|
19
19
|
'Runtime.awaitPromise': FULL_COMMAND,
|
|
@@ -24,13 +24,18 @@ const COMMANDS = /** @type {const} */ ({
|
|
|
24
24
|
'Target.resume': DIRECT_COMMAND,
|
|
25
25
|
'Timeline.start': FULL_COMMAND,
|
|
26
26
|
'Timeline.stop': FULL_COMMAND,
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Generates remote commands for communicating with the Web Inspector.
|
|
30
|
+
* Provides methods for creating various types of commands including connection
|
|
31
|
+
* setup, application management, and protocol commands.
|
|
32
|
+
*/
|
|
28
33
|
class RemoteMessages {
|
|
29
|
-
// #region Connection functions
|
|
30
34
|
/**
|
|
35
|
+
* Creates a command to set the connection key for the Web Inspector session.
|
|
31
36
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @returns
|
|
37
|
+
* @param connId - The connection identifier.
|
|
38
|
+
* @returns A RawRemoteCommand for setting the connection key.
|
|
34
39
|
*/
|
|
35
40
|
setConnectionKey(connId) {
|
|
36
41
|
return {
|
|
@@ -41,10 +46,11 @@ class RemoteMessages {
|
|
|
41
46
|
};
|
|
42
47
|
}
|
|
43
48
|
/**
|
|
49
|
+
* Creates a command to connect to a specific application.
|
|
44
50
|
*
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
51
|
+
* @param connId - The connection identifier.
|
|
52
|
+
* @param appIdKey - The application identifier key.
|
|
53
|
+
* @returns A RawRemoteCommand for connecting to the application.
|
|
48
54
|
*/
|
|
49
55
|
connectToApp(connId, appIdKey) {
|
|
50
56
|
return {
|
|
@@ -56,12 +62,13 @@ class RemoteMessages {
|
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
65
|
+
* Creates a command to set the sender key for message routing.
|
|
59
66
|
*
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @returns
|
|
67
|
+
* @param connId - The connection identifier.
|
|
68
|
+
* @param senderId - The sender identifier.
|
|
69
|
+
* @param appIdKey - The application identifier key.
|
|
70
|
+
* @param pageIdKey - Optional page identifier key.
|
|
71
|
+
* @returns A RawRemoteCommand for setting the sender key.
|
|
65
72
|
*/
|
|
66
73
|
setSenderKey(connId, senderId, appIdKey, pageIdKey) {
|
|
67
74
|
return {
|
|
@@ -76,12 +83,13 @@ class RemoteMessages {
|
|
|
76
83
|
};
|
|
77
84
|
}
|
|
78
85
|
/**
|
|
86
|
+
* Creates a command to indicate web view status.
|
|
79
87
|
*
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @returns
|
|
88
|
+
* @param connId - The connection identifier.
|
|
89
|
+
* @param appIdKey - The application identifier key.
|
|
90
|
+
* @param pageIdKey - Optional page identifier key.
|
|
91
|
+
* @param enabled - Whether the web view indication is enabled. Defaults to true if not provided.
|
|
92
|
+
* @returns A RawRemoteCommand for indicating web view status.
|
|
85
93
|
*/
|
|
86
94
|
indicateWebView(connId, appIdKey, pageIdKey, enabled) {
|
|
87
95
|
return {
|
|
@@ -95,9 +103,10 @@ class RemoteMessages {
|
|
|
95
103
|
};
|
|
96
104
|
}
|
|
97
105
|
/**
|
|
106
|
+
* Creates a command to launch an application.
|
|
98
107
|
*
|
|
99
|
-
* @param
|
|
100
|
-
* @returns
|
|
108
|
+
* @param bundleId - The bundle identifier of the application to launch.
|
|
109
|
+
* @returns A RawRemoteCommand for launching the application.
|
|
101
110
|
*/
|
|
102
111
|
launchApplication(bundleId) {
|
|
103
112
|
return {
|
|
@@ -108,9 +117,11 @@ class RemoteMessages {
|
|
|
108
117
|
};
|
|
109
118
|
}
|
|
110
119
|
/**
|
|
120
|
+
* Creates a full command with all default parameters included.
|
|
121
|
+
* This includes objectGroup, includeCommandLineAPI, and other runtime options.
|
|
111
122
|
*
|
|
112
|
-
* @param
|
|
113
|
-
* @returns
|
|
123
|
+
* @param opts - Options combining RemoteCommandOpts and ProtocolCommandOpts.
|
|
124
|
+
* @returns A RawRemoteCommand with full parameter set.
|
|
114
125
|
*/
|
|
115
126
|
getFullCommand(opts) {
|
|
116
127
|
const { method, params, connId, senderId, appIdKey, pageIdKey, targetId, id, } = opts;
|
|
@@ -150,13 +161,14 @@ class RemoteMessages {
|
|
|
150
161
|
},
|
|
151
162
|
__selector: '_rpc_forwardSocketData:',
|
|
152
163
|
};
|
|
153
|
-
// @ts-ignore This is ok
|
|
154
164
|
return lodash_1.default.omitBy(plist, lodash_1.default.isNil);
|
|
155
165
|
}
|
|
156
166
|
/**
|
|
167
|
+
* Creates a minimal command with only the essential parameters.
|
|
168
|
+
* This is the default command type for most operations.
|
|
157
169
|
*
|
|
158
|
-
* @param
|
|
159
|
-
* @returns
|
|
170
|
+
* @param opts - Options combining RemoteCommandOpts and ProtocolCommandOpts.
|
|
171
|
+
* @returns A RawRemoteCommand with minimal parameter set.
|
|
160
172
|
*/
|
|
161
173
|
getMinimalCommand(opts) {
|
|
162
174
|
const { method, params, connId, senderId, appIdKey, pageIdKey, targetId, id } = opts;
|
|
@@ -182,13 +194,14 @@ class RemoteMessages {
|
|
|
182
194
|
},
|
|
183
195
|
__selector: '_rpc_forwardSocketData:'
|
|
184
196
|
};
|
|
185
|
-
// @ts-ignore This is ok
|
|
186
197
|
return lodash_1.default.omitBy(plist, lodash_1.default.isNil);
|
|
187
198
|
}
|
|
188
199
|
/**
|
|
200
|
+
* Creates a direct command that bypasses the Target.sendMessageToTarget wrapper.
|
|
201
|
+
* Used for certain Target domain commands.
|
|
189
202
|
*
|
|
190
|
-
* @param
|
|
191
|
-
* @returns
|
|
203
|
+
* @param opts - Options combining RemoteCommandOpts and ProtocolCommandOpts.
|
|
204
|
+
* @returns A RawRemoteCommand for direct protocol communication.
|
|
192
205
|
*/
|
|
193
206
|
getDirectCommand(opts) {
|
|
194
207
|
const { method, params, connId, senderId, appIdKey, pageIdKey, id } = opts;
|
|
@@ -206,14 +219,16 @@ class RemoteMessages {
|
|
|
206
219
|
},
|
|
207
220
|
__selector: '_rpc_forwardSocketData:'
|
|
208
221
|
};
|
|
209
|
-
// @ts-ignore This is ok
|
|
210
222
|
return lodash_1.default.omitBy(plist, lodash_1.default.isNil);
|
|
211
223
|
}
|
|
212
224
|
/**
|
|
225
|
+
* Gets a remote command based on the command name and options.
|
|
226
|
+
* Handles both Safari Web Inspector commands and WebKit protocol commands.
|
|
213
227
|
*
|
|
214
|
-
* @param
|
|
215
|
-
* @param
|
|
216
|
-
* @returns
|
|
228
|
+
* @param command - The command name (e.g., 'setConnectionKey', 'Page.navigate').
|
|
229
|
+
* @param opts - Options for the command.
|
|
230
|
+
* @returns A RawRemoteCommand appropriate for the given command.
|
|
231
|
+
* @throws Error if required parameters are missing for specific commands.
|
|
217
232
|
*/
|
|
218
233
|
getRemoteCommand(command, opts) {
|
|
219
234
|
const { id, connId, appIdKey, senderId, pageIdKey, targetId, } = opts;
|
|
@@ -246,9 +261,8 @@ class RemoteMessages {
|
|
|
246
261
|
return this.launchApplication(opts.bundleId);
|
|
247
262
|
}
|
|
248
263
|
// deal with WebKit commands
|
|
249
|
-
const builderFunction = COMMANDS[command] || MINIMAL_COMMAND;
|
|
250
|
-
const commonOpts = (0, protocol_1.getProtocolCommand)(
|
|
251
|
-
/** @type {string} */ (id), command, opts, isDirectCommand(command));
|
|
264
|
+
const builderFunction = (COMMANDS[command] || MINIMAL_COMMAND);
|
|
265
|
+
const commonOpts = (0, protocol_1.getProtocolCommand)(id, command, opts, isDirectCommand(command));
|
|
252
266
|
return this[builderFunction]({
|
|
253
267
|
...commonOpts,
|
|
254
268
|
connId,
|
|
@@ -261,12 +275,13 @@ class RemoteMessages {
|
|
|
261
275
|
}
|
|
262
276
|
exports.RemoteMessages = RemoteMessages;
|
|
263
277
|
/**
|
|
278
|
+
* Checks if a command should use the direct command format.
|
|
279
|
+
* Direct commands bypass the Target.sendMessageToTarget wrapper.
|
|
264
280
|
*
|
|
265
|
-
* @param
|
|
266
|
-
* @returns
|
|
281
|
+
* @param command - The command name to check.
|
|
282
|
+
* @returns True if the command should use direct format, false otherwise.
|
|
267
283
|
*/
|
|
268
284
|
function isDirectCommand(command) {
|
|
269
285
|
return COMMANDS[command] === DIRECT_COMMAND;
|
|
270
286
|
}
|
|
271
|
-
exports.default = RemoteMessages;
|
|
272
287
|
//# sourceMappingURL=remote-messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-messages.js","sourceRoot":"","sources":["../../../lib/rpc/remote-messages.
|
|
1
|
+
{"version":3,"file":"remote-messages.js","sourceRoot":"","sources":["../../../lib/rpc/remote-messages.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AAC,CAAC;gBAC1F,CAAC;gBACD,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;YAClE,KAAK,mBAAmB;gBACtB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACnB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;gBACnE,CAAC;gBACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC;QAED,4BAA4B;QAC5B,MAAM,eAAe,GAAG,CAAC,QAAQ,CAAC,OAAgC,CAAC,IAAI,eAAe,CAA2B,CAAC;QAClH,MAAM,UAAU,GAAG,IAAA,6BAAkB,EACnC,EAAE,EACF,OAAO,EACP,IAAI,EACJ,eAAe,CAAC,OAAO,CAAC,CACzB,CAAC;QACF,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC;YAC3B,GAAG,UAAU;YACb,MAAM;YACN,QAAQ;YACR,QAAQ;YACR,SAAS;YACT,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;CACF;AAvRD,wCAuRC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,OAAe;IAC7C,OAAO,QAAQ,CAAC,OAAgC,CAAC,KAAK,cAAc,CAAC;AACvE,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.RpcClientRealDevice = void 0;
|
|
7
|
-
const logger_1 =
|
|
4
|
+
const logger_1 = require("../logger");
|
|
8
5
|
const rpc_client_1 = require("./rpc-client");
|
|
9
6
|
const appium_ios_device_1 = require("appium-ios-device");
|
|
10
7
|
class RpcClientRealDevice extends rpc_client_1.RpcClient {
|
|
@@ -36,7 +33,7 @@ class RpcClientRealDevice extends rpc_client_1.RpcClient {
|
|
|
36
33
|
if (!this.isConnected) {
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
|
-
logger_1.
|
|
36
|
+
logger_1.log.debug('Disconnecting from remote debugger');
|
|
40
37
|
await super.disconnect();
|
|
41
38
|
this.service.close();
|
|
42
39
|
this.isConnected = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client-real-device.js","sourceRoot":"","sources":["../../../lib/rpc/rpc-client-real-device.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rpc-client-real-device.js","sourceRoot":"","sources":["../../../lib/rpc/rpc-client-real-device.js"],"names":[],"mappings":";;;AAAA,sCAAgC;AAChC,6CAAyC;AACzC,yDAA6C;AAG7C,MAAa,mBAAoB,SAAQ,sBAAS;IAChD;;OAEG;IACH,YAAa,IAAI,GAAG,EAAE;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,OAAO,GAAG,MAAM,4BAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,EAAE;YAChE,SAAS,EAAE,IAAI,CAAC,eAAe;YAC/B,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,IAAI,CAAC,mBAAmB;YACjC,cAAc,EAAE,IAAI,CAAC,0BAA0B;YAC/C,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,cAAc,EAAE,IAAI,CAAC,0BAA0B;SAChD,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO;QACT,CAAC;QAED,YAAG,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAChD,MAAM,KAAK,CAAC,UAAU,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAE,GAAG;QACpB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAE,IAAI;QACjB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO;QACT,CAAC;QACD,iDAAiD;QACjD,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF;AAxDD,kDAwDC;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RpcClientSimulator = void 0;
|
|
7
|
-
const logger_1 =
|
|
7
|
+
const logger_1 = require("../logger");
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
10
10
|
const net_1 = __importDefault(require("net"));
|
|
@@ -42,11 +42,11 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
42
42
|
if (this.socketPath) {
|
|
43
43
|
if (this.messageProxy) {
|
|
44
44
|
// unix domain socket via proxy
|
|
45
|
-
logger_1.
|
|
45
|
+
logger_1.log.debug(`Connecting to remote debugger via proxy through unix domain socket: '${this.messageProxy}'`);
|
|
46
46
|
this.socket = net_1.default.connect(this.messageProxy);
|
|
47
47
|
// Forward the actual socketPath to the proxy
|
|
48
48
|
this.socket.once('connect', () => {
|
|
49
|
-
logger_1.
|
|
49
|
+
logger_1.log.debug(`Forwarding the actual web inspector socket to the proxy: '${this.socketPath}'`);
|
|
50
50
|
// @ts-ignore socket must be efined here
|
|
51
51
|
this.socket.write(JSON.stringify({
|
|
52
52
|
socketPath: this.socketPath
|
|
@@ -55,7 +55,7 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
57
|
// unix domain socket
|
|
58
|
-
logger_1.
|
|
58
|
+
logger_1.log.debug(`Connecting to remote debugger through unix domain socket: '${this.socketPath}'`);
|
|
59
59
|
this.socket = net_1.default.connect(this.socketPath);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -65,7 +65,7 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
65
65
|
this.port = this.messageProxy;
|
|
66
66
|
}
|
|
67
67
|
// tcp socket
|
|
68
|
-
logger_1.
|
|
68
|
+
logger_1.log.debug(`Connecting to remote debugger ${this.messageProxy ? 'via proxy ' : ''}through TCP: ${this.host}:${this.port}`);
|
|
69
69
|
this.socket = new net_1.default.Socket();
|
|
70
70
|
this.socket.connect(/** @type {number} */ (this.port), /** @type {String} */ (this.host));
|
|
71
71
|
}
|
|
@@ -73,7 +73,7 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
73
73
|
this.socket.setKeepAlive(true);
|
|
74
74
|
this.socket.on('close', () => {
|
|
75
75
|
if (this.isConnected) {
|
|
76
|
-
logger_1.
|
|
76
|
+
logger_1.log.debug('Debugger socket disconnected');
|
|
77
77
|
}
|
|
78
78
|
this.isConnected = false;
|
|
79
79
|
this.socket = null;
|
|
@@ -95,14 +95,14 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
95
95
|
// only resolve this function when we are actually connected
|
|
96
96
|
// @ts-ignore socket must be defined here
|
|
97
97
|
this.socket.on('connect', () => {
|
|
98
|
-
logger_1.
|
|
98
|
+
logger_1.log.debug(`Debugger socket connected`);
|
|
99
99
|
this.isConnected = true;
|
|
100
100
|
resolve();
|
|
101
101
|
});
|
|
102
102
|
// @ts-ignore socket must be defined here
|
|
103
103
|
this.socket.on('error', (err) => {
|
|
104
104
|
if (this.isConnected) {
|
|
105
|
-
logger_1.
|
|
105
|
+
logger_1.log.error(`Socket error: ${err.message}`);
|
|
106
106
|
this.isConnected = false;
|
|
107
107
|
}
|
|
108
108
|
// the connection was refused, so reject the connect promise
|
|
@@ -117,7 +117,7 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
117
117
|
if (!this.isConnected) {
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
logger_1.
|
|
120
|
+
logger_1.log.debug('Disconnecting from remote debugger');
|
|
121
121
|
await super.disconnect();
|
|
122
122
|
this.service.close();
|
|
123
123
|
this.isConnected = false;
|
|
@@ -130,7 +130,7 @@ class RpcClientSimulator extends rpc_client_1.RpcClient {
|
|
|
130
130
|
return await new bluebird_1.default((resolve, reject) => {
|
|
131
131
|
// handle socket problems
|
|
132
132
|
onSocketError = (err) => {
|
|
133
|
-
logger_1.
|
|
133
|
+
logger_1.log.error(`Socket error: ${err.message}`);
|
|
134
134
|
// the connection was refused, so reject the connect promise
|
|
135
135
|
reject(err);
|
|
136
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client-simulator.js","sourceRoot":"","sources":["../../../lib/rpc/rpc-client-simulator.js"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"rpc-client-simulator.js","sourceRoot":"","sources":["../../../lib/rpc/rpc-client-simulator.js"],"names":[],"mappings":";;;;;;AAAA,sCAAgC;AAChC,oDAAuB;AACvB,wDAAyB;AACzB,8CAAsB;AACtB,6CAAyC;AACzC,yDAA6C;AAE7C,MAAa,kBAAmB,SAAQ,sBAAS;IAC/C,+BAA+B;IAC/B,IAAI,CAAC;IAEL,+BAA+B;IAC/B,IAAI,CAAC;IAEL,kBAAkB;IAClB,YAAY,CAAC;I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