roku-debug 0.20.5 → 0.20.7

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.
Files changed (214) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/CompileErrorProcessor.d.ts +7 -2
  3. package/dist/CompileErrorProcessor.js +64 -69
  4. package/dist/CompileErrorProcessor.js.map +1 -1
  5. package/dist/DeviceInfo.d.ts +1 -0
  6. package/dist/adapters/DebugProtocolAdapter.d.ts +64 -17
  7. package/dist/adapters/DebugProtocolAdapter.js +264 -157
  8. package/dist/adapters/DebugProtocolAdapter.js.map +1 -1
  9. package/dist/adapters/TelnetAdapter.d.ts +8 -3
  10. package/dist/adapters/TelnetAdapter.js +14 -6
  11. package/dist/adapters/TelnetAdapter.js.map +1 -1
  12. package/dist/adapters/TelnetRequestPipeline.d.ts +34 -0
  13. package/dist/adapters/TelnetRequestPipeline.js +35 -22
  14. package/dist/adapters/TelnetRequestPipeline.js.map +1 -1
  15. package/dist/debugProtocol/Constants.d.ts +171 -81
  16. package/dist/debugProtocol/Constants.js +206 -126
  17. package/dist/debugProtocol/Constants.js.map +1 -1
  18. package/dist/debugProtocol/DebugProtocolClientReplaySession.d.ts +46 -0
  19. package/dist/debugProtocol/DebugProtocolClientReplaySession.js +278 -0
  20. package/dist/debugProtocol/DebugProtocolClientReplaySession.js.map +1 -0
  21. package/dist/debugProtocol/PluginInterface.d.ts +38 -0
  22. package/dist/debugProtocol/PluginInterface.js +86 -0
  23. package/dist/debugProtocol/PluginInterface.js.map +1 -0
  24. package/dist/debugProtocol/ProtocolUtil.d.ts +56 -0
  25. package/dist/debugProtocol/ProtocolUtil.js +164 -0
  26. package/dist/debugProtocol/ProtocolUtil.js.map +1 -0
  27. package/dist/debugProtocol/client/DebugProtocolClient.d.ts +310 -0
  28. package/dist/debugProtocol/client/DebugProtocolClient.js +1079 -0
  29. package/dist/debugProtocol/client/DebugProtocolClient.js.map +1 -0
  30. package/dist/debugProtocol/client/DebugProtocolClientPlugin.d.ts +44 -0
  31. package/dist/debugProtocol/client/DebugProtocolClientPlugin.js +3 -0
  32. package/dist/debugProtocol/client/DebugProtocolClientPlugin.js.map +1 -0
  33. package/dist/debugProtocol/events/ProtocolEvent.d.ts +66 -0
  34. package/dist/debugProtocol/events/ProtocolEvent.js +3 -0
  35. package/dist/debugProtocol/events/ProtocolEvent.js.map +1 -0
  36. package/dist/debugProtocol/events/requests/AddBreakpointsRequest.d.ts +30 -0
  37. package/dist/debugProtocol/events/requests/AddBreakpointsRequest.js +63 -0
  38. package/dist/debugProtocol/events/requests/AddBreakpointsRequest.js.map +1 -0
  39. package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.d.ts +48 -0
  40. package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.js +69 -0
  41. package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.js.map +1 -0
  42. package/dist/debugProtocol/events/requests/ContinueRequest.d.ts +20 -0
  43. package/dist/debugProtocol/events/requests/ContinueRequest.js +40 -0
  44. package/dist/debugProtocol/events/requests/ContinueRequest.js.map +1 -0
  45. package/dist/debugProtocol/events/requests/ExecuteRequest.d.ts +26 -0
  46. package/dist/debugProtocol/events/requests/ExecuteRequest.js +49 -0
  47. package/dist/debugProtocol/events/requests/ExecuteRequest.js.map +1 -0
  48. package/dist/debugProtocol/events/requests/ExitChannelRequest.d.ts +20 -0
  49. package/dist/debugProtocol/events/requests/ExitChannelRequest.js +40 -0
  50. package/dist/debugProtocol/events/requests/ExitChannelRequest.js.map +1 -0
  51. package/dist/debugProtocol/events/requests/HandshakeRequest.d.ts +26 -0
  52. package/dist/debugProtocol/events/requests/HandshakeRequest.js +47 -0
  53. package/dist/debugProtocol/events/requests/HandshakeRequest.js.map +1 -0
  54. package/dist/debugProtocol/events/requests/ListBreakpointsRequest.d.ts +20 -0
  55. package/dist/debugProtocol/events/requests/ListBreakpointsRequest.js +40 -0
  56. package/dist/debugProtocol/events/requests/ListBreakpointsRequest.js.map +1 -0
  57. package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.d.ts +29 -0
  58. package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.js +60 -0
  59. package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.js.map +1 -0
  60. package/dist/debugProtocol/events/requests/StackTraceRequest.d.ts +22 -0
  61. package/dist/debugProtocol/events/requests/StackTraceRequest.js +43 -0
  62. package/dist/debugProtocol/events/requests/StackTraceRequest.js.map +1 -0
  63. package/dist/debugProtocol/events/requests/StepRequest.d.ts +25 -0
  64. package/dist/debugProtocol/events/requests/StepRequest.js +46 -0
  65. package/dist/debugProtocol/events/requests/StepRequest.js.map +1 -0
  66. package/dist/debugProtocol/events/requests/StopRequest.d.ts +20 -0
  67. package/dist/debugProtocol/events/requests/StopRequest.js +39 -0
  68. package/dist/debugProtocol/events/requests/StopRequest.js.map +1 -0
  69. package/dist/debugProtocol/events/requests/ThreadsRequest.d.ts +20 -0
  70. package/dist/debugProtocol/events/requests/ThreadsRequest.js +40 -0
  71. package/dist/debugProtocol/events/requests/ThreadsRequest.js.map +1 -0
  72. package/dist/debugProtocol/events/requests/VariablesRequest.d.ts +59 -0
  73. package/dist/debugProtocol/events/requests/VariablesRequest.js +123 -0
  74. package/dist/debugProtocol/events/requests/VariablesRequest.js.map +1 -0
  75. package/dist/debugProtocol/events/responses/AddBreakpointsResponse.js.map +1 -0
  76. package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.d.ts +3 -0
  77. package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.js +9 -0
  78. package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.js.map +1 -0
  79. package/dist/debugProtocol/events/responses/ExecuteV3Response.d.ts +42 -0
  80. package/dist/debugProtocol/events/responses/ExecuteV3Response.js +94 -0
  81. package/dist/debugProtocol/events/responses/ExecuteV3Response.js.map +1 -0
  82. package/dist/debugProtocol/events/responses/GenericResponse.d.ts +17 -0
  83. package/dist/debugProtocol/events/responses/GenericResponse.js +40 -0
  84. package/dist/debugProtocol/events/responses/GenericResponse.js.map +1 -0
  85. package/dist/debugProtocol/events/responses/GenericV3Response.d.ts +15 -0
  86. package/dist/debugProtocol/events/responses/GenericV3Response.js +38 -0
  87. package/dist/debugProtocol/events/responses/GenericV3Response.js.map +1 -0
  88. package/dist/debugProtocol/events/responses/HandshakeResponse.d.ts +28 -0
  89. package/dist/debugProtocol/events/responses/HandshakeResponse.js +69 -0
  90. package/dist/debugProtocol/events/responses/HandshakeResponse.js.map +1 -0
  91. package/dist/debugProtocol/events/responses/HandshakeV3Response.d.ts +42 -0
  92. package/dist/debugProtocol/events/responses/HandshakeV3Response.js +98 -0
  93. package/dist/debugProtocol/events/responses/HandshakeV3Response.js.map +1 -0
  94. package/dist/debugProtocol/events/responses/ListBreakpointsResponse.d.ts +35 -0
  95. package/dist/debugProtocol/events/responses/ListBreakpointsResponse.js +68 -0
  96. package/dist/debugProtocol/events/responses/ListBreakpointsResponse.js.map +1 -0
  97. package/dist/debugProtocol/events/responses/RemoveBreakpointsResponse.js.map +1 -0
  98. package/dist/debugProtocol/events/responses/StackTraceResponse.d.ts +24 -0
  99. package/dist/debugProtocol/events/responses/StackTraceResponse.js +72 -0
  100. package/dist/debugProtocol/events/responses/StackTraceResponse.js.map +1 -0
  101. package/dist/debugProtocol/events/responses/StackTraceV3Response.d.ts +37 -0
  102. package/dist/debugProtocol/events/responses/StackTraceV3Response.js +67 -0
  103. package/dist/debugProtocol/events/responses/StackTraceV3Response.js.map +1 -0
  104. package/dist/debugProtocol/events/responses/ThreadsResponse.d.ts +54 -0
  105. package/dist/debugProtocol/events/responses/ThreadsResponse.js +80 -0
  106. package/dist/debugProtocol/events/responses/ThreadsResponse.js.map +1 -0
  107. package/dist/debugProtocol/events/responses/VariablesResponse.d.ts +117 -0
  108. package/dist/debugProtocol/events/responses/VariablesResponse.js +335 -0
  109. package/dist/debugProtocol/events/responses/VariablesResponse.js.map +1 -0
  110. package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.d.ts +35 -0
  111. package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.js +58 -0
  112. package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.js.map +1 -0
  113. package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.d.ts +42 -0
  114. package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.js +97 -0
  115. package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.js.map +1 -0
  116. package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.d.ts +41 -0
  117. package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.js +74 -0
  118. package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.js.map +1 -0
  119. package/dist/debugProtocol/events/updates/CompileErrorUpdate.d.ts +60 -0
  120. package/dist/debugProtocol/events/updates/CompileErrorUpdate.js +89 -0
  121. package/dist/debugProtocol/events/updates/CompileErrorUpdate.js.map +1 -0
  122. package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.d.ts +23 -0
  123. package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.js +49 -0
  124. package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.js.map +1 -0
  125. package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.d.ts +26 -0
  126. package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.js +50 -0
  127. package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.js.map +1 -0
  128. package/dist/debugProtocol/server/DebugProtocolServer.d.ts +110 -0
  129. package/dist/debugProtocol/server/DebugProtocolServer.js +306 -0
  130. package/dist/debugProtocol/server/DebugProtocolServer.js.map +1 -0
  131. package/dist/debugProtocol/server/DebugProtocolServerPlugin.d.ts +41 -0
  132. package/dist/debugProtocol/server/DebugProtocolServerPlugin.js +3 -0
  133. package/dist/debugProtocol/server/DebugProtocolServerPlugin.js.map +1 -0
  134. package/dist/debugSession/BrightScriptDebugSession.d.ts +9 -1
  135. package/dist/debugSession/BrightScriptDebugSession.js +178 -89
  136. package/dist/debugSession/BrightScriptDebugSession.js.map +1 -1
  137. package/dist/index.d.ts +2 -3
  138. package/dist/index.js +2 -3
  139. package/dist/index.js.map +1 -1
  140. package/dist/logging.d.ts +1 -0
  141. package/dist/logging.js +4 -2
  142. package/dist/logging.js.map +1 -1
  143. package/dist/managers/ActionQueue.d.ts +7 -1
  144. package/dist/managers/ActionQueue.js +27 -5
  145. package/dist/managers/ActionQueue.js.map +1 -1
  146. package/dist/managers/BreakpointManager.d.ts +82 -27
  147. package/dist/managers/BreakpointManager.js +168 -63
  148. package/dist/managers/BreakpointManager.js.map +1 -1
  149. package/dist/managers/ProjectManager.d.ts +3 -0
  150. package/dist/managers/ProjectManager.js +42 -36
  151. package/dist/managers/ProjectManager.js.map +1 -1
  152. package/dist/util.d.ts +8 -6
  153. package/dist/util.js +36 -19
  154. package/dist/util.js.map +1 -1
  155. package/package.json +15 -6
  156. package/roku-debug-0.20.7.tgz +0 -0
  157. package/dist/debugProtocol/Debugger.d.ts +0 -161
  158. package/dist/debugProtocol/Debugger.js +0 -635
  159. package/dist/debugProtocol/Debugger.js.map +0 -1
  160. package/dist/debugProtocol/responses/AddBreakpointsResponse.js.map +0 -1
  161. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.d.ts +0 -32
  162. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js +0 -67
  163. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js.map +0 -1
  164. package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.d.ts +0 -32
  165. package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.js +0 -56
  166. package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.js.map +0 -1
  167. package/dist/debugProtocol/responses/ConnectIOPortResponse.d.ts +0 -10
  168. package/dist/debugProtocol/responses/ConnectIOPortResponse.js +0 -39
  169. package/dist/debugProtocol/responses/ConnectIOPortResponse.js.map +0 -1
  170. package/dist/debugProtocol/responses/ExecuteResponseV3.d.ts +0 -23
  171. package/dist/debugProtocol/responses/ExecuteResponseV3.js +0 -54
  172. package/dist/debugProtocol/responses/ExecuteResponseV3.js.map +0 -1
  173. package/dist/debugProtocol/responses/HandshakeResponse.d.ts +0 -12
  174. package/dist/debugProtocol/responses/HandshakeResponse.js +0 -39
  175. package/dist/debugProtocol/responses/HandshakeResponse.js.map +0 -1
  176. package/dist/debugProtocol/responses/HandshakeResponseV3.d.ts +0 -14
  177. package/dist/debugProtocol/responses/HandshakeResponseV3.js +0 -47
  178. package/dist/debugProtocol/responses/HandshakeResponseV3.js.map +0 -1
  179. package/dist/debugProtocol/responses/ListBreakpointsResponse.d.ts +0 -25
  180. package/dist/debugProtocol/responses/ListBreakpointsResponse.js +0 -65
  181. package/dist/debugProtocol/responses/ListBreakpointsResponse.js.map +0 -1
  182. package/dist/debugProtocol/responses/ProtocolEvent.d.ts +0 -11
  183. package/dist/debugProtocol/responses/ProtocolEvent.js +0 -38
  184. package/dist/debugProtocol/responses/ProtocolEvent.js.map +0 -1
  185. package/dist/debugProtocol/responses/ProtocolEventV3.d.ts +0 -11
  186. package/dist/debugProtocol/responses/ProtocolEventV3.js +0 -42
  187. package/dist/debugProtocol/responses/ProtocolEventV3.js.map +0 -1
  188. package/dist/debugProtocol/responses/RemoveBreakpointsResponse.js.map +0 -1
  189. package/dist/debugProtocol/responses/StackTraceResponse.d.ts +0 -18
  190. package/dist/debugProtocol/responses/StackTraceResponse.js +0 -58
  191. package/dist/debugProtocol/responses/StackTraceResponse.js.map +0 -1
  192. package/dist/debugProtocol/responses/StackTraceResponseV3.d.ts +0 -18
  193. package/dist/debugProtocol/responses/StackTraceResponseV3.js +0 -58
  194. package/dist/debugProtocol/responses/StackTraceResponseV3.js.map +0 -1
  195. package/dist/debugProtocol/responses/ThreadsResponse.d.ts +0 -22
  196. package/dist/debugProtocol/responses/ThreadsResponse.js +0 -63
  197. package/dist/debugProtocol/responses/ThreadsResponse.js.map +0 -1
  198. package/dist/debugProtocol/responses/UndefinedResponse.d.ts +0 -10
  199. package/dist/debugProtocol/responses/UndefinedResponse.js +0 -39
  200. package/dist/debugProtocol/responses/UndefinedResponse.js.map +0 -1
  201. package/dist/debugProtocol/responses/UpdateThreadsResponse.d.ts +0 -25
  202. package/dist/debugProtocol/responses/UpdateThreadsResponse.js +0 -91
  203. package/dist/debugProtocol/responses/UpdateThreadsResponse.js.map +0 -1
  204. package/dist/debugProtocol/responses/VariableResponse.d.ts +0 -27
  205. package/dist/debugProtocol/responses/VariableResponse.js +0 -141
  206. package/dist/debugProtocol/responses/VariableResponse.js.map +0 -1
  207. package/dist/debugProtocol/responses/index.d.ts +0 -11
  208. package/dist/debugProtocol/responses/index.js +0 -24
  209. package/dist/debugProtocol/responses/index.js.map +0 -1
  210. package/roku-debug-0.20.5.tgz +0 -0
  211. /package/dist/debugProtocol/{responses → events/responses}/AddBreakpointsResponse.d.ts +0 -0
  212. /package/dist/debugProtocol/{responses → events/responses}/AddBreakpointsResponse.js +0 -0
  213. /package/dist/debugProtocol/{responses → events/responses}/RemoveBreakpointsResponse.d.ts +0 -0
  214. /package/dist/debugProtocol/{responses → events/responses}/RemoveBreakpointsResponse.js +0 -0
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VariableRequestFlag = exports.VariablesRequest = void 0;
4
+ /* eslint-disable no-bitwise */
5
+ const smart_buffer_1 = require("smart-buffer");
6
+ const Constants_1 = require("../../Constants");
7
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
8
+ class VariablesRequest {
9
+ constructor() {
10
+ this.success = false;
11
+ /**
12
+ * How many bytes were read by the `fromBuffer` method. Only populated when constructed by `fromBuffer`
13
+ */
14
+ this.readOffset = undefined;
15
+ this.data = {
16
+ /**
17
+ * Indicates whether the VARIABLES response includes the child keys for container types like lists and associative arrays. If this is set to true (0x01), the VARIABLES response include the child keys.
18
+ */
19
+ getChildKeys: undefined,
20
+ /**
21
+ * Enables the client application to send path_force_case_insensitive data for each variable
22
+ */
23
+ enableForceCaseInsensitivity: undefined,
24
+ /**
25
+ * The index of the thread containing the variable.
26
+ */
27
+ threadIndex: undefined,
28
+ /**
29
+ * The index of the frame returned from the STACKTRACE command.
30
+ * The 0 index contains the first function called; nframes-1 contains the last.
31
+ * This indexing does not match the order of the frames returned from the STACKTRACE command
32
+ */
33
+ stackFrameIndex: undefined,
34
+ /**
35
+ * A set of one or more path entries to the variable to be inspected. For example, `m.top.myarray[6]` can be accessed with `["m","top","myarray","6"]`.
36
+ *
37
+ * If no path is specified, the variables accessible from the specified stack frame are returned.
38
+ */
39
+ variablePathEntries: undefined,
40
+ //common props
41
+ packetLength: undefined,
42
+ requestId: undefined,
43
+ command: Constants_1.Command.Variables
44
+ };
45
+ }
46
+ static fromJson(data) {
47
+ var _a, _b;
48
+ var _c;
49
+ const request = new VariablesRequest();
50
+ ProtocolUtil_1.protocolUtil.loadJson(request, data);
51
+ (_a = (_c = request.data).variablePathEntries) !== null && _a !== void 0 ? _a : (_c.variablePathEntries = []);
52
+ // all variables will be case sensitive if the flag is disabled
53
+ for (const entry of request.data.variablePathEntries) {
54
+ if (request.data.enableForceCaseInsensitivity !== true) {
55
+ entry.forceCaseInsensitive = false;
56
+ }
57
+ else {
58
+ //default any missing values to false
59
+ (_b = entry.forceCaseInsensitive) !== null && _b !== void 0 ? _b : (entry.forceCaseInsensitive = false);
60
+ }
61
+ }
62
+ return request;
63
+ }
64
+ static fromBuffer(buffer) {
65
+ const request = new VariablesRequest();
66
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(request, buffer, 12, (smartBuffer) => {
67
+ ProtocolUtil_1.protocolUtil.loadCommonRequestFields(request, smartBuffer);
68
+ const variableRequestFlags = smartBuffer.readUInt8(); // variable_request_flags
69
+ request.data.getChildKeys = !!(variableRequestFlags & VariableRequestFlag.GetChildKeys);
70
+ request.data.enableForceCaseInsensitivity = !!(variableRequestFlags & VariableRequestFlag.CaseSensitivityOptions);
71
+ request.data.threadIndex = smartBuffer.readUInt32LE(); // thread_index
72
+ request.data.stackFrameIndex = smartBuffer.readUInt32LE(); // stack_frame_index
73
+ const variablePathLength = smartBuffer.readUInt32LE(); // variable_path_len
74
+ request.data.variablePathEntries = [];
75
+ if (variablePathLength > 0) {
76
+ for (let i = 0; i < variablePathLength; i++) {
77
+ request.data.variablePathEntries.push({
78
+ name: ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer),
79
+ //by default, all variable lookups are case SENSITIVE
80
+ forceCaseInsensitive: false
81
+ });
82
+ }
83
+ //get the case sensitive settings for each part of the path
84
+ if (request.data.enableForceCaseInsensitivity) {
85
+ for (let i = 0; i < variablePathLength; i++) {
86
+ //0 means case SENSITIVE lookup, 1 means forced case INsensitive lookup
87
+ request.data.variablePathEntries[i].forceCaseInsensitive = smartBuffer.readUInt8() === 0 ? false : true;
88
+ }
89
+ }
90
+ }
91
+ });
92
+ return request;
93
+ }
94
+ toBuffer() {
95
+ const smartBuffer = new smart_buffer_1.SmartBuffer();
96
+ //build the flags var
97
+ let variableRequestFlags = 0;
98
+ variableRequestFlags |= this.data.getChildKeys ? VariableRequestFlag.GetChildKeys : 0;
99
+ variableRequestFlags |= this.data.enableForceCaseInsensitivity ? VariableRequestFlag.CaseSensitivityOptions : 0;
100
+ smartBuffer.writeUInt8(variableRequestFlags); // variable_request_flags
101
+ smartBuffer.writeUInt32LE(this.data.threadIndex); // thread_index
102
+ smartBuffer.writeUInt32LE(this.data.stackFrameIndex); // stack_frame_index
103
+ smartBuffer.writeUInt32LE(this.data.variablePathEntries.length); // variable_path_len
104
+ for (const entry of this.data.variablePathEntries) {
105
+ smartBuffer.writeStringNT(entry.name); // variable_path_entries - optional
106
+ }
107
+ if (this.data.enableForceCaseInsensitivity) {
108
+ for (const entry of this.data.variablePathEntries) {
109
+ //0 means case SENSITIVE lookup, 1 means force case INsensitive lookup
110
+ smartBuffer.writeUInt8(entry.forceCaseInsensitive !== true ? 0 : 1);
111
+ }
112
+ }
113
+ ProtocolUtil_1.protocolUtil.insertCommonRequestFields(this, smartBuffer);
114
+ return smartBuffer.toBuffer();
115
+ }
116
+ }
117
+ exports.VariablesRequest = VariablesRequest;
118
+ var VariableRequestFlag;
119
+ (function (VariableRequestFlag) {
120
+ VariableRequestFlag[VariableRequestFlag["GetChildKeys"] = 1] = "GetChildKeys";
121
+ VariableRequestFlag[VariableRequestFlag["CaseSensitivityOptions"] = 2] = "CaseSensitivityOptions";
122
+ })(VariableRequestFlag = exports.VariableRequestFlag || (exports.VariableRequestFlag = {}));
123
+ //# sourceMappingURL=VariablesRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VariablesRequest.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/requests/VariablesRequest.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+CAA2C;AAC3C,+CAA0C;AAC1C,qDAAkD;AAGlD,MAAa,gBAAgB;IAA7B;QAwFW,YAAO,GAAG,KAAK,CAAC;QACvB;;WAEG;QACI,eAAU,GAAW,SAAS,CAAC;QAE/B,SAAI,GAAG;YACV;;eAEG;YACH,YAAY,EAAE,SAAoB;YAElC;;eAEG;YACH,4BAA4B,EAAE,SAAoB;YAElD;;eAEG;YACH,WAAW,EAAE,SAAmB;YAChC;;;;eAIG;YACH,eAAe,EAAE,SAAmB;YAEpC;;;;eAIG;YACH,mBAAmB,EAAE,SAGnB;YAEF,cAAc;YACd,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,SAAmB;YAC9B,OAAO,EAAE,mBAAO,CAAC,SAAS;SAC7B,CAAC;IACN,CAAC;IAjIU,MAAM,CAAC,QAAQ,CAAC,IAUtB;;;QACG,MAAM,OAAO,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACvC,2BAAY,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrC,YAAA,OAAO,CAAC,IAAI,EAAC,mBAAmB,uCAAnB,mBAAmB,GAAK,EAAE,EA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I,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,oBAAoB;QAC1E,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB;QACrF,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC/C,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,mCAAmC;SAC7E;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACxC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC/C,sEAAsE;gBACtE,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,oBAAoB,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACvE;SACJ;QAED,2BAAY,CAAC,yBAAyB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC1D,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CA6CJ;AAnID,4CAmIC;AAED,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,6EAAgB,CAAA;IAChB,iGAA0B,CAAA;AAC9B,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddBreakpointsResponse.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/responses/AddBreakpointsResponse.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AAEpE,wFAAwF;AACxF,MAAa,sBAAuB,SAAQ,iDAAuB;CAAI;AAAvE,wDAAuE"}
@@ -0,0 +1,3 @@
1
+ import { ListBreakpointsResponse } from './ListBreakpointsResponse';
2
+ export declare class AddConditionalBreakpointsResponse extends ListBreakpointsResponse {
3
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddConditionalBreakpointsResponse = void 0;
4
+ const ListBreakpointsResponse_1 = require("./ListBreakpointsResponse");
5
+ //There's currently no difference between this response and the ListBreakpoints response
6
+ class AddConditionalBreakpointsResponse extends ListBreakpointsResponse_1.ListBreakpointsResponse {
7
+ }
8
+ exports.AddConditionalBreakpointsResponse = AddConditionalBreakpointsResponse;
9
+ //# sourceMappingURL=AddConditionalBreakpointsResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddConditionalBreakpointsResponse.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/responses/AddConditionalBreakpointsResponse.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AAEpE,wFAAwF;AACxF,MAAa,iCAAkC,SAAQ,iDAAuB;CAAI;AAAlF,8EAAkF"}
@@ -0,0 +1,42 @@
1
+ /// <reference types="node" />
2
+ import type { StopReasonCode } from '../../Constants';
3
+ import { ErrorCode } from '../../Constants';
4
+ export declare class ExecuteV3Response {
5
+ static fromJson(data: {
6
+ requestId: number;
7
+ executeSuccess: boolean;
8
+ runtimeStopCode: StopReasonCode;
9
+ compileErrors: string[];
10
+ runtimeErrors: string[];
11
+ otherErrors: string[];
12
+ }): ExecuteV3Response;
13
+ static fromBuffer(buffer: Buffer): ExecuteV3Response;
14
+ toBuffer(): Buffer;
15
+ success: boolean;
16
+ readOffset: number;
17
+ data: {
18
+ /**
19
+ * Indicates whether the code ran and completed without errors (true)
20
+ */
21
+ executeSuccess: boolean;
22
+ /**
23
+ * A StopReason enum.
24
+ */
25
+ runtimeStopCode: StopReasonCode;
26
+ /**
27
+ * The list of compile-time errors.
28
+ */
29
+ compileErrors: string[];
30
+ /**
31
+ * The list of runtime errors.
32
+ */
33
+ runtimeErrors: string[];
34
+ /**
35
+ * The list of other errors.
36
+ */
37
+ otherErrors: string[];
38
+ packetLength: number;
39
+ requestId: number;
40
+ errorCode: ErrorCode;
41
+ };
42
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExecuteV3Response = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const Constants_1 = require("../../Constants");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ class ExecuteV3Response {
8
+ constructor() {
9
+ this.success = false;
10
+ this.readOffset = 0;
11
+ this.data = {
12
+ /**
13
+ * Indicates whether the code ran and completed without errors (true)
14
+ */
15
+ executeSuccess: undefined,
16
+ /**
17
+ * A StopReason enum.
18
+ */
19
+ runtimeStopCode: undefined,
20
+ /**
21
+ * The list of compile-time errors.
22
+ */
23
+ compileErrors: undefined,
24
+ /**
25
+ * The list of runtime errors.
26
+ */
27
+ runtimeErrors: undefined,
28
+ /**
29
+ * The list of other errors.
30
+ */
31
+ otherErrors: undefined,
32
+ //common props
33
+ packetLength: undefined,
34
+ requestId: undefined,
35
+ errorCode: Constants_1.ErrorCode.OK
36
+ };
37
+ }
38
+ static fromJson(data) {
39
+ var _a, _b, _c;
40
+ var _d, _e, _f;
41
+ const response = new ExecuteV3Response();
42
+ ProtocolUtil_1.protocolUtil.loadJson(response, data);
43
+ (_a = (_d = response.data).compileErrors) !== null && _a !== void 0 ? _a : (_d.compileErrors = []);
44
+ (_b = (_e = response.data).runtimeErrors) !== null && _b !== void 0 ? _b : (_e.runtimeErrors = []);
45
+ (_c = (_f = response.data).otherErrors) !== null && _c !== void 0 ? _c : (_f.otherErrors = []);
46
+ return response;
47
+ }
48
+ static fromBuffer(buffer) {
49
+ const response = new ExecuteV3Response();
50
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(response, buffer, 8, (smartBuffer) => {
51
+ ProtocolUtil_1.protocolUtil.loadCommonResponseFields(response, smartBuffer);
52
+ response.data.executeSuccess = smartBuffer.readUInt8() !== 0; //execute_success
53
+ response.data.runtimeStopCode = smartBuffer.readUInt8(); //runtime_stop_code
54
+ const compileErrorCount = smartBuffer.readUInt32LE(); // num_compile_errors
55
+ response.data.compileErrors = [];
56
+ for (let i = 0; i < compileErrorCount; i++) {
57
+ response.data.compileErrors.push(ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer));
58
+ }
59
+ const runtimeErrorCount = smartBuffer.readUInt32LE(); // num_runtime_errors
60
+ response.data.runtimeErrors = [];
61
+ for (let i = 0; i < runtimeErrorCount; i++) {
62
+ response.data.runtimeErrors.push(ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer));
63
+ }
64
+ const otherErrorCount = smartBuffer.readUInt32LE(); // num_other_errors
65
+ response.data.otherErrors = [];
66
+ for (let i = 0; i < otherErrorCount; i++) {
67
+ response.data.otherErrors.push(ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer));
68
+ }
69
+ });
70
+ return response;
71
+ }
72
+ toBuffer() {
73
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
74
+ const smartBuffer = new smart_buffer_1.SmartBuffer();
75
+ smartBuffer.writeUInt8(this.data.executeSuccess ? 1 : 0); //execute_success
76
+ smartBuffer.writeUInt8(this.data.runtimeStopCode); //runtime_stop_code
77
+ smartBuffer.writeUInt32LE((_b = (_a = this.data.compileErrors) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); // num_compile_errors
78
+ for (let error of (_c = this.data.compileErrors) !== null && _c !== void 0 ? _c : []) {
79
+ smartBuffer.writeStringNT(error);
80
+ }
81
+ smartBuffer.writeUInt32LE((_e = (_d = this.data.runtimeErrors) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0); // num_runtime_errors
82
+ for (let error of (_f = this.data.runtimeErrors) !== null && _f !== void 0 ? _f : []) {
83
+ smartBuffer.writeStringNT(error);
84
+ }
85
+ smartBuffer.writeUInt32LE((_h = (_g = this.data.otherErrors) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0); // num_other_errors
86
+ for (let error of (_j = this.data.otherErrors) !== null && _j !== void 0 ? _j : []) {
87
+ smartBuffer.writeStringNT(error);
88
+ }
89
+ ProtocolUtil_1.protocolUtil.insertCommonResponseFields(this, smartBuffer);
90
+ return smartBuffer.toBuffer();
91
+ }
92
+ }
93
+ exports.ExecuteV3Response = ExecuteV3Response;
94
+ //# sourceMappingURL=ExecuteV3Response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteV3Response.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/responses/ExecuteV3Response.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,+CAA4C;AAC5C,qDAAkD;AAElD,MAAa,iBAAiB;IAA9B;QA8EW,YAAO,GAAG,KAAK,CAAC;QAEhB,eAAU,GAAG,CAAC,CAAC;QAEf,SAAI,GAAG;YACV;;eAEG;YACH,cAAc,EAAE,SAAoB;YACpC;;eAEG;YACH,eAAe,EAAE,SAA2B;YAC5C;;eAEG;YACH,aAAa,EAAE,SAAqB;YACpC;;eAEG;YACH,aAAa,EAAE,SAAqB;YACpC;;eAEG;YACH,WAAW,EAAE,SAAqB;YAElC,cAAc;YACd,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,SAAmB;YAC9B,SAAS,EAAE,qBAAS,CAAC,EAAE;SAC1B,CAAC;IACN,CAAC;IA5GU,MAAM,CAAC,QAAQ,CAAC,IAOtB;;;QACG,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,2BAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtC,YAAA,QAAQ,CAAC,IAAI,EAAC,aAAa,uCAAb,aAAa,GAAK,EAAE,EAAC;QACnC,YAAA,QAAQ,CAAC,IAAI,EAAC,aAAa,uCAAb,aAAa,GAAK,EAAE,EAAC;QACnC,YAAA,QAAQ,CAAC,IAAI,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;QACjC,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,QAAQ,GAA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,CAAC,KAAK,CAAC,CAAC;SACpC;QAED,2BAAY,CAAC,0BAA0B,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAE3D,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAiCJ;AA7GD,8CA6GC"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ import type { ErrorCode } from '../../Constants';
3
+ export declare class GenericResponse {
4
+ static fromJson(data: {
5
+ requestId: number;
6
+ errorCode: ErrorCode;
7
+ }): GenericResponse;
8
+ static fromBuffer(buffer: Buffer): GenericResponse;
9
+ toBuffer(): Buffer;
10
+ success: boolean;
11
+ readOffset: number;
12
+ data: {
13
+ packetLength: number;
14
+ requestId: number;
15
+ errorCode: ErrorCode;
16
+ };
17
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenericResponse = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
6
+ class GenericResponse {
7
+ constructor() {
8
+ this.success = false;
9
+ this.readOffset = 0;
10
+ this.data = {
11
+ //this response doesn't actually contain packetLength, but we need to add it here just to make this response look like a regular response
12
+ packetLength: undefined,
13
+ requestId: Number.MAX_SAFE_INTEGER,
14
+ errorCode: undefined
15
+ };
16
+ }
17
+ static fromJson(data) {
18
+ const response = new GenericResponse();
19
+ ProtocolUtil_1.protocolUtil.loadJson(response, data);
20
+ return response;
21
+ }
22
+ static fromBuffer(buffer) {
23
+ const response = new GenericResponse();
24
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(response, buffer, 8, (smartBuffer) => {
25
+ response.data.packetLength = 8;
26
+ response.data.requestId = smartBuffer.readUInt32LE(); // request_id
27
+ response.data.errorCode = smartBuffer.readUInt32LE(); // error_code
28
+ });
29
+ return response;
30
+ }
31
+ toBuffer() {
32
+ const smartBuffer = new smart_buffer_1.SmartBuffer();
33
+ smartBuffer.writeUInt32LE(this.data.requestId); // request_id
34
+ smartBuffer.writeUInt32LE(this.data.errorCode); // error_code
35
+ this.data.packetLength = smartBuffer.writeOffset;
36
+ return smartBuffer.toBuffer();
37
+ }
38
+ }
39
+ exports.GenericResponse = GenericResponse;
40
+ //# sourceMappingURL=GenericResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericResponse.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/responses/GenericResponse.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,qDAAkD;AAElD,MAAa,eAAe;IAA5B;QA4BW,YAAO,GAAG,KAAK,CAAC;QAEhB,eAAU,GAAG,CAAC,CAAC;QAEf,SAAI,GAAG;YACV,yIAAyI;YACzI,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,MAAM,CAAC,gBAAgB;YAClC,SAAS,EAAE,SAAsB;SACpC,CAAC;IACN,CAAC;IArCU,MAAM,CAAC,QAAQ,CAAC,IAGtB;QACG,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;QACvC,2BAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;QACvC,2BAAY,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,WAAwB,EAAE,EAAE;YAC9E,QAAQ,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC,aAAa;YACnE,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC,aAAa;QACvE,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,QAAQ;QACX,MAAM,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;QACtC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa;QAC7D,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa;QAC7D,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,WAAW,CAAC;QACjD,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAYJ;AAtCD,0CAsCC"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ import type { ErrorCode } from '../../Constants';
3
+ import type { ProtocolResponse, ProtocolResponseData, ProtocolResponseErrorData } from '../ProtocolEvent';
4
+ export declare class GenericV3Response implements ProtocolResponse {
5
+ static fromJson(data: {
6
+ requestId: number;
7
+ errorCode: ErrorCode;
8
+ errorData?: ProtocolResponseErrorData;
9
+ }): GenericV3Response;
10
+ static fromBuffer(buffer: Buffer): GenericV3Response;
11
+ toBuffer(): Buffer;
12
+ success: boolean;
13
+ readOffset: number;
14
+ data: ProtocolResponseData;
15
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenericV3Response = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
6
+ class GenericV3Response {
7
+ constructor() {
8
+ this.success = false;
9
+ this.readOffset = 0;
10
+ this.data = {
11
+ packetLength: undefined,
12
+ requestId: Number.MAX_SAFE_INTEGER,
13
+ errorCode: undefined
14
+ };
15
+ }
16
+ static fromJson(data) {
17
+ const response = new GenericV3Response();
18
+ ProtocolUtil_1.protocolUtil.loadJson(response, data);
19
+ return response;
20
+ }
21
+ static fromBuffer(buffer) {
22
+ const response = new GenericV3Response();
23
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(response, buffer, 12, (smartBuffer) => {
24
+ ProtocolUtil_1.protocolUtil.loadCommonResponseFields(response, smartBuffer);
25
+ //this is a generic response, so we don't actually know what the rest of the payload is.
26
+ //so just consume the rest of the payload as throwaway data
27
+ response.readOffset = response.data.packetLength;
28
+ });
29
+ return response;
30
+ }
31
+ toBuffer() {
32
+ const smartBuffer = new smart_buffer_1.SmartBuffer();
33
+ ProtocolUtil_1.protocolUtil.insertCommonResponseFields(this, smartBuffer);
34
+ return smartBuffer.toBuffer();
35
+ }
36
+ }
37
+ exports.GenericV3Response = GenericV3Response;
38
+ //# sourceMappingURL=GenericV3Response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericV3Response.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/responses/GenericV3Response.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,qDAAkD;AAGlD,MAAa,iBAAiB;IAA9B;QA6BW,YAAO,GAAG,KAAK,CAAC;QAEhB,eAAU,GAAG,CAAC,CAAC;QAEf,SAAI,GAAG;YACV,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,MAAM,CAAC,gBAAgB;YAClC,SAAS,EAAE,SAAsB;SACZ,CAAC;IAC9B,CAAC;IArCU,MAAM,CAAC,QAAQ,CAAC,IAItB;QACG,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,2BAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,2BAAY,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAwB,EAAE,EAAE;YAC/E,2BAAY,CAAC,wBAAwB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAE7D,wFAAwF;YACxF,2DAA2D;YAC3D,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,QAAQ;QACX,MAAM,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;QACtC,2BAAY,CAAC,0BAA0B,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC3D,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAWJ;AAtCD,8CAsCC"}
@@ -0,0 +1,28 @@
1
+ /// <reference types="node" />
2
+ import type { ProtocolResponse } from '../ProtocolEvent';
3
+ import { ErrorCode } from '../../Constants';
4
+ export declare class HandshakeResponse implements ProtocolResponse {
5
+ static fromJson(data: {
6
+ magic: string;
7
+ protocolVersion: string;
8
+ }): HandshakeResponse;
9
+ static fromBuffer(buffer: Buffer): HandshakeResponse;
10
+ toBuffer(): Buffer;
11
+ success: boolean;
12
+ readOffset: number;
13
+ data: {
14
+ /**
15
+ * The Roku Brightscript debug protocol identifier, which is the following 64-bit value :0x0067756265647362LU.
16
+ *
17
+ * This is equal to 29120988069524322LU or the following little-endian value: b'bsdebug\0.
18
+ */
19
+ magic: string;
20
+ /**
21
+ * A semantic version string (i.e. `2.0.0`)
22
+ */
23
+ protocolVersion: string;
24
+ packetLength: number;
25
+ requestId: number;
26
+ errorCode: ErrorCode;
27
+ };
28
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HandshakeResponse = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const semver = require("semver");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ const Constants_1 = require("../../Constants");
8
+ const HandshakeRequest_1 = require("../requests/HandshakeRequest");
9
+ class HandshakeResponse {
10
+ constructor() {
11
+ this.success = false;
12
+ this.readOffset = 0;
13
+ this.data = {
14
+ /**
15
+ * The Roku Brightscript debug protocol identifier, which is the following 64-bit value :0x0067756265647362LU.
16
+ *
17
+ * This is equal to 29120988069524322LU or the following little-endian value: b'bsdebug\0.
18
+ */
19
+ magic: undefined,
20
+ /**
21
+ * A semantic version string (i.e. `2.0.0`)
22
+ */
23
+ protocolVersion: undefined,
24
+ //The handshake response isn't actually structured like like normal responses, but since they're the only unique response, just add dummy data for those fields
25
+ packetLength: undefined,
26
+ //hardcode the max uint32 value. This must be the same value as the HandshakeRequest class
27
+ requestId: HandshakeRequest_1.HandshakeRequest.REQUEST_ID,
28
+ errorCode: Constants_1.ErrorCode.OK
29
+ };
30
+ }
31
+ static fromJson(data) {
32
+ const response = new HandshakeResponse();
33
+ ProtocolUtil_1.protocolUtil.loadJson(response, data);
34
+ // We only support version prior to v3 with this handshake
35
+ if (!semver.satisfies(response.data.protocolVersion, '<3.0.0')) {
36
+ response.success = false;
37
+ }
38
+ return response;
39
+ }
40
+ static fromBuffer(buffer) {
41
+ const response = new HandshakeResponse();
42
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(response, buffer, 20, (smartBuffer) => {
43
+ response.data.magic = ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer); // magic_number
44
+ response.data.protocolVersion = [
45
+ smartBuffer.readInt32LE(),
46
+ smartBuffer.readInt32LE(),
47
+ smartBuffer.readInt32LE() // protocol_patch_version
48
+ ].join('.');
49
+ // We only support version prior to v3 with this handshake
50
+ if (!semver.satisfies(response.data.protocolVersion, '<3.0.0')) {
51
+ throw new Error(`unsupported version ${response.data.protocolVersion}`);
52
+ }
53
+ return true;
54
+ });
55
+ return response;
56
+ }
57
+ toBuffer() {
58
+ var _a, _b;
59
+ let buffer = new smart_buffer_1.SmartBuffer();
60
+ buffer.writeStringNT(this.data.magic); // magic_number
61
+ const [major, minor, patch] = ((_b = (_a = this.data.protocolVersion) === null || _a === void 0 ? void 0 : _a.split('.')) !== null && _b !== void 0 ? _b : ['0', '0', '0']).map(x => parseInt(x));
62
+ buffer.writeUInt32LE(major); // protocol_major_version
63
+ buffer.writeUInt32LE(minor); // protocol_minor_version
64
+ buffer.writeUInt32LE(patch); // protocol_patch_version
65
+ return buffer.toBuffer();
66
+ }
67
+ }
68
+ exports.HandshakeResponse = HandshakeResponse;
69
+ //# sourceMappingURL=HandshakeResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HandshakeResponse.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/responses/HandshakeResponse.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,iCAAiC;AAGjC,qDAAkD;AAClD,+CAA4C;AAC5C,mEAAgE;AAEhE,MAAa,iBAAiB;IAA9B;QA6CW,YAAO,GAAG,KAAK,CAAC;QAEhB,eAAU,GAAG,CAAC,CAAC;QAEf,SAAI,GAAG;YACV;;;;eAIG;YACH,KAAK,EAAE,SAAmB;YAC1B;;eAEG;YACH,eAAe,EAAE,SAAmB;YAGpC,+JAA+J;YAC/J,YAAY,EAAE,SAAmB;YACjC,0FAA0F;YAC1F,SAAS,EAAE,mCAAgB,CAAC,UAAU;YACtC,SAAS,EAAE,qBAAS,CAAC,EAAE;SAC1B,CAAC;IACN,CAAC;IAnEU,MAAM,CAAC,QAAQ,CAAC,IAGtB;QACG,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,2BAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtC,0DAA0D;QAC1D,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE;YAC5D,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;SAC5B;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,2BAAY,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAwB,EAAE,EAAE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AQ,EAAE,CAAC;IAC7B,CAAC;CAyBJ;AApED,8CAoEC"}
@@ -0,0 +1,42 @@
1
+ /// <reference types="node" />
2
+ import type { ProtocolResponse } from '../ProtocolEvent';
3
+ import { ErrorCode } from '../../Constants';
4
+ export declare class HandshakeV3Response implements ProtocolResponse {
5
+ static fromJson(data: {
6
+ magic: string;
7
+ protocolVersion: string;
8
+ revisionTimestamp: Date;
9
+ }): HandshakeV3Response;
10
+ static fromBuffer(buffer: Buffer): HandshakeV3Response;
11
+ /**
12
+ * Convert the data into a buffer
13
+ */
14
+ toBuffer(): Buffer;
15
+ success: boolean;
16
+ readOffset: number;
17
+ data: {
18
+ /**
19
+ * The Roku Brightscript debug protocol identifier, which is the following 64-bit value :0x0067756265647362LU.
20
+ *
21
+ * This is equal to 29120988069524322LU or the following little-endian value: b'bsdebug\0.
22
+ */
23
+ magic: string;
24
+ /**
25
+ * A semantic version string (i.e. `2.0.0`)
26
+ */
27
+ protocolVersion: string;
28
+ /**
29
+ * A platform-specific implementation timestamp (in milliseconds since epoch [1970-01-01T00:00:00.000Z]).
30
+ *
31
+ * As of BrightScript debug protocol 3.0.0 (Roku OS 11.0), a timestamp is sent to the debugger client in the initial handshake.
32
+ * This timestamp is platform-specific data that is included in the system software of the platform being debugged.
33
+ * It is changed by the platform's vendor when there is any change that affects the behavior of the debugger.
34
+ *
35
+ * The value can be used in manners similar to a build number, and is primarily used to differentiate between pre-release builds of the platform being debugged.
36
+ */
37
+ revisionTimestamp: Date;
38
+ packetLength: number;
39
+ requestId: number;
40
+ errorCode: ErrorCode;
41
+ };
42
+ }