@loadmill/executer 0.1.36 → 0.1.40
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/dist/errors.d.ts +5 -0
- package/dist/errors.js +38 -0
- package/dist/errors.js.map +1 -0
- package/dist/extraction-combiner.d.ts +4 -2
- package/dist/extraction-combiner.js +96 -46
- package/dist/extraction-combiner.js.map +1 -1
- package/dist/mill-version.js +1 -1
- package/dist/post-script/ast-walker/index.js.map +1 -1
- package/dist/request-sequence-result.d.ts +2 -1
- package/dist/request-sequence-result.js.map +1 -1
- package/dist/sequence.js +288 -115
- package/dist/sequence.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +29 -0
- package/dist/utils.js.map +1 -0
- package/dist/ws.d.ts +69 -0
- package/dist/ws.js +468 -0
- package/dist/ws.js.map +1 -0
- package/package.json +5 -5
- package/src/errors.ts +10 -0
- package/src/extraction-combiner.ts +15 -4
- package/src/mill-version.ts +1 -1
- package/src/post-script/ast-walker/index.ts +1 -1
- package/src/request-sequence-result.ts +2 -0
- package/src/sequence.ts +138 -38
- package/src/utils.ts +8 -0
- package/src/ws.ts +273 -0
- package/test/post-script-executor.spec.ts +24 -24
- package/yarn-error.log +18845 -0
package/dist/ws.js
ADDED
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.WSSequenceHandler = exports.WSRequest = void 0;
|
|
43
|
+
var ws_1 = __importDefault(require("ws")); // todo should be picked with other option (socketio or non in browser)
|
|
44
|
+
var promise_utils_1 = require("@loadmill/universal/dist/promise-utils");
|
|
45
|
+
var log_1 = __importDefault(require("@loadmill/universal/dist/log"));
|
|
46
|
+
var errors_1 = require("./errors");
|
|
47
|
+
var http_1 = require("http");
|
|
48
|
+
var WSState;
|
|
49
|
+
(function (WSState) {
|
|
50
|
+
WSState[WSState["CONNECTING"] = 0] = "CONNECTING";
|
|
51
|
+
WSState[WSState["OPEN"] = 1] = "OPEN";
|
|
52
|
+
WSState[WSState["CLOSING"] = 2] = "CLOSING";
|
|
53
|
+
WSState[WSState["CLOSED"] = 3] = "CLOSED";
|
|
54
|
+
})(WSState || (WSState = {}));
|
|
55
|
+
var SWITCHING_PROTOCOLS = 'Switching Protocols';
|
|
56
|
+
var WS_CONNECTION_TIMEOUT_MS = 10000;
|
|
57
|
+
var WSRequest = /** @class */ (function () {
|
|
58
|
+
function WSRequest(wsRequestArgs, wsHandler, onError) {
|
|
59
|
+
var _this = this;
|
|
60
|
+
Object.defineProperty(this, "wsRequestArgs", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: wsRequestArgs
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(this, "wsHandler", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: wsHandler
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(this, "onError", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: onError
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(this, "hasErrorOccured", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
value: void 0
|
|
83
|
+
}); // need this otherwise we have race condition between verifyConnectedAndOpen and onError
|
|
84
|
+
Object.defineProperty(this, "ws", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: void 0
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(this, "url", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
configurable: true,
|
|
93
|
+
writable: true,
|
|
94
|
+
value: void 0
|
|
95
|
+
}); // need this for isExpectedStatus function
|
|
96
|
+
Object.defineProperty(this, "expectedStatus", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true,
|
|
99
|
+
writable: true,
|
|
100
|
+
value: void 0
|
|
101
|
+
}); // need this for isExpectedStatus function
|
|
102
|
+
/**
|
|
103
|
+
* Waiting for WS connection to go out of CONNECTING state
|
|
104
|
+
* @param socket The ws connection object
|
|
105
|
+
* @param timeout The timeout in milliseconds for the waiting procedure
|
|
106
|
+
* @returns WSState
|
|
107
|
+
*/
|
|
108
|
+
Object.defineProperty(this, "waitForConnectedState", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
value: function (timeout) {
|
|
113
|
+
if (timeout === void 0) { timeout = WS_CONNECTION_TIMEOUT_MS; }
|
|
114
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
115
|
+
var WS_CONNECTION_INTERVAL_MS, maxIterations, i;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
WS_CONNECTION_INTERVAL_MS = 100;
|
|
120
|
+
if (!(this.ws.readyState != null && this.ws.readyState !== ws_1.default.CONNECTING)) return [3 /*break*/, 1];
|
|
121
|
+
return [2 /*return*/, this.ws.readyState];
|
|
122
|
+
case 1:
|
|
123
|
+
maxIterations = timeout / WS_CONNECTION_INTERVAL_MS;
|
|
124
|
+
i = 0;
|
|
125
|
+
_a.label = 2;
|
|
126
|
+
case 2:
|
|
127
|
+
if (!(this.ws.readyState === ws_1.default.CONNECTING && i < maxIterations)) return [3 /*break*/, 4];
|
|
128
|
+
return [4 /*yield*/, promise_utils_1.delay(WS_CONNECTION_INTERVAL_MS)];
|
|
129
|
+
case 3:
|
|
130
|
+
_a.sent();
|
|
131
|
+
i++;
|
|
132
|
+
return [3 /*break*/, 2];
|
|
133
|
+
case 4: return [2 /*return*/, this.ws.readyState];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
this.url = wsRequestArgs.url;
|
|
140
|
+
this.expectedStatus = wsRequestArgs.expectedStatus;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* This function is executed when we are ready to send the ws request
|
|
144
|
+
* @param cb This callback is being executed after we successfully connected to ws and sent a ws message if there was any
|
|
145
|
+
*/
|
|
146
|
+
Object.defineProperty(WSRequest.prototype, "ok", {
|
|
147
|
+
enumerable: false,
|
|
148
|
+
configurable: true,
|
|
149
|
+
writable: true,
|
|
150
|
+
value: function (cb) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
var response, existingWS;
|
|
153
|
+
return __generator(this, function (_a) {
|
|
154
|
+
switch (_a.label) {
|
|
155
|
+
case 0:
|
|
156
|
+
response = {
|
|
157
|
+
status: undefined,
|
|
158
|
+
res: {
|
|
159
|
+
statusMessage: undefined,
|
|
160
|
+
},
|
|
161
|
+
header: {},
|
|
162
|
+
req: {},
|
|
163
|
+
};
|
|
164
|
+
existingWS = this.wsHandler.getConnection(this.wsRequestArgs.url);
|
|
165
|
+
existingWS && log_1.default.debug("Existing Connection state " + getConnectionState(existingWS));
|
|
166
|
+
if (!(!existingWS || (existingWS && existingWS.readyState !== WSState.OPEN))) return [3 /*break*/, 2];
|
|
167
|
+
return [4 /*yield*/, this.addConnection(response)];
|
|
168
|
+
case 1:
|
|
169
|
+
_a.sent();
|
|
170
|
+
return [3 /*break*/, 3];
|
|
171
|
+
case 2:
|
|
172
|
+
this.ws = existingWS;
|
|
173
|
+
log_1.default.debug('Reusing existing ws connection', this.ws.url);
|
|
174
|
+
_a.label = 3;
|
|
175
|
+
case 3:
|
|
176
|
+
try {
|
|
177
|
+
this.sendMessage();
|
|
178
|
+
}
|
|
179
|
+
catch (e) {
|
|
180
|
+
log_1.default.error('Failed to send a ws message', e);
|
|
181
|
+
}
|
|
182
|
+
cb(response);
|
|
183
|
+
return [2 /*return*/, {}];
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(WSRequest.prototype, "addConnection", {
|
|
190
|
+
enumerable: false,
|
|
191
|
+
configurable: true,
|
|
192
|
+
writable: true,
|
|
193
|
+
value: function (response) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
195
|
+
var _a;
|
|
196
|
+
return __generator(this, function (_b) {
|
|
197
|
+
switch (_b.label) {
|
|
198
|
+
case 0:
|
|
199
|
+
this.ws = new ws_1.default(this.wsRequestArgs.url, undefined, { headers: this.wsRequestArgs.headers });
|
|
200
|
+
this.addEventListeners(response);
|
|
201
|
+
_a = !this.hasErrorOccured;
|
|
202
|
+
if (!_a) return [3 /*break*/, 2];
|
|
203
|
+
return [4 /*yield*/, this.verifyOpen()];
|
|
204
|
+
case 1:
|
|
205
|
+
_a = (_b.sent());
|
|
206
|
+
_b.label = 2;
|
|
207
|
+
case 2:
|
|
208
|
+
_a;
|
|
209
|
+
this.wsHandler.storeConnection(this.wsRequestArgs.url, this.ws);
|
|
210
|
+
return [2 /*return*/];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(WSRequest.prototype, "addEventListeners", {
|
|
217
|
+
enumerable: false,
|
|
218
|
+
configurable: true,
|
|
219
|
+
writable: true,
|
|
220
|
+
value: function (response) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
this.addOnErrorListener(response);
|
|
224
|
+
this.addOnUpgradeListener(response);
|
|
225
|
+
this.addOnOpenListener();
|
|
226
|
+
this.addOnMessageListener();
|
|
227
|
+
return [2 /*return*/];
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
Object.defineProperty(WSRequest.prototype, "addOnErrorListener", {
|
|
233
|
+
enumerable: false,
|
|
234
|
+
configurable: true,
|
|
235
|
+
writable: true,
|
|
236
|
+
value: function (response) {
|
|
237
|
+
var _this = this;
|
|
238
|
+
this.ws.addEventListener('error', function (event) {
|
|
239
|
+
log_1.default.debug('inside addEventListener error');
|
|
240
|
+
try {
|
|
241
|
+
var target = event.target;
|
|
242
|
+
_this.updateResponseOnError(target, response);
|
|
243
|
+
}
|
|
244
|
+
catch (e) {
|
|
245
|
+
log_1.default.error('Got an error inside addEventListener error', e);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
this.ws.on('error', function (e) {
|
|
249
|
+
try {
|
|
250
|
+
log_1.default.debug('inside on error', e);
|
|
251
|
+
_this.onError(e);
|
|
252
|
+
_this.hasErrorOccured = true;
|
|
253
|
+
}
|
|
254
|
+
catch (e) {
|
|
255
|
+
log_1.default.warn('Failed to handle a ws error', e);
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
log_1.default.debug('closing ws');
|
|
259
|
+
_this.ws.close();
|
|
260
|
+
}
|
|
261
|
+
catch (e) {
|
|
262
|
+
log_1.default.warn('Failed to close a ws connection', e);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
Object.defineProperty(WSRequest.prototype, "updateResponseOnError", {
|
|
268
|
+
enumerable: false,
|
|
269
|
+
configurable: true,
|
|
270
|
+
writable: true,
|
|
271
|
+
value: function (ws, response) {
|
|
272
|
+
if (ws._req) {
|
|
273
|
+
var _a = ws._req.socket.parser.incoming, statusCode = _a.statusCode, statusMessage = _a.statusMessage, headers = _a.headers;
|
|
274
|
+
log_1.default.debug('Got incoming incoming request', { statusCode: statusCode, statusMessage: statusMessage, headers: headers });
|
|
275
|
+
response.status = statusCode;
|
|
276
|
+
response.res.statusMessage = statusMessage;
|
|
277
|
+
response.header = headers;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
Object.defineProperty(WSRequest.prototype, "addOnUpgradeListener", {
|
|
282
|
+
enumerable: false,
|
|
283
|
+
configurable: true,
|
|
284
|
+
writable: true,
|
|
285
|
+
value: function (response) {
|
|
286
|
+
this.ws.on('upgrade', function (event) {
|
|
287
|
+
try {
|
|
288
|
+
var statusCode = event.statusCode, statusMessage = event.statusMessage, headers = event.headers;
|
|
289
|
+
log_1.default.debug('inside upgrade event', { statusCode: statusCode, statusMessage: statusMessage, headers: headers });
|
|
290
|
+
response.status = statusCode || 101;
|
|
291
|
+
response.res.statusMessage = statusMessage || SWITCHING_PROTOCOLS;
|
|
292
|
+
response.header = headers;
|
|
293
|
+
}
|
|
294
|
+
catch (e) {
|
|
295
|
+
log_1.default.debug('upgrade event err', e);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(WSRequest.prototype, "addOnOpenListener", {
|
|
301
|
+
enumerable: false,
|
|
302
|
+
configurable: true,
|
|
303
|
+
writable: true,
|
|
304
|
+
value: function () {
|
|
305
|
+
this.ws.on('open', function () {
|
|
306
|
+
log_1.default.debug('inside on open, currently doing nothing here.');
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
Object.defineProperty(WSRequest.prototype, "addOnMessageListener", {
|
|
311
|
+
enumerable: false,
|
|
312
|
+
configurable: true,
|
|
313
|
+
writable: true,
|
|
314
|
+
value: function () {
|
|
315
|
+
var _this = this;
|
|
316
|
+
this.ws.on('message', function (message) {
|
|
317
|
+
try {
|
|
318
|
+
log_1.default.debug('got incoming message', message);
|
|
319
|
+
_this.wsHandler.addMessage(message);
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
log_1.default.debug('error getting message', e);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
Object.defineProperty(WSRequest.prototype, "verifyOpen", {
|
|
328
|
+
enumerable: false,
|
|
329
|
+
configurable: true,
|
|
330
|
+
writable: true,
|
|
331
|
+
value: function () {
|
|
332
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
333
|
+
var readyState, connectionDebugMsg, msg;
|
|
334
|
+
return __generator(this, function (_a) {
|
|
335
|
+
switch (_a.label) {
|
|
336
|
+
case 0: return [4 /*yield*/, this.waitForConnectedState(this.wsRequestArgs.timeout)];
|
|
337
|
+
case 1:
|
|
338
|
+
readyState = _a.sent();
|
|
339
|
+
connectionDebugMsg = "Connection " + WSState[readyState];
|
|
340
|
+
log_1.default.debug(connectionDebugMsg);
|
|
341
|
+
if (readyState !== ws_1.default.OPEN && !this.hasErrorOccured) {
|
|
342
|
+
msg = 'Could not connect to WebSocket address: ';
|
|
343
|
+
log_1.default.debug(msg, { connectionState: WSState[readyState], url: this.ws.url });
|
|
344
|
+
if (readyState === WSState.CONNECTING) {
|
|
345
|
+
msg += 'request timeout';
|
|
346
|
+
}
|
|
347
|
+
else { // CLOSING or CLOSED state
|
|
348
|
+
msg += connectionDebugMsg;
|
|
349
|
+
}
|
|
350
|
+
throw new errors_1.RequestFailuresError(msg);
|
|
351
|
+
}
|
|
352
|
+
return [2 /*return*/];
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(WSRequest.prototype, "sendMessage", {
|
|
359
|
+
enumerable: false,
|
|
360
|
+
configurable: true,
|
|
361
|
+
writable: true,
|
|
362
|
+
value: function () {
|
|
363
|
+
log_1.default.debug('about to send message', { readyState: WSState[this.ws.readyState] });
|
|
364
|
+
if (this.ws.readyState === WSState.OPEN && this.wsRequestArgs.message) {
|
|
365
|
+
log_1.default.debug('sending message', this.wsRequestArgs.message);
|
|
366
|
+
this.ws.send(this.wsRequestArgs.message);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
// need this because the SequenceExecutor expectes a request obj with on func prop
|
|
371
|
+
Object.defineProperty(WSRequest.prototype, "on", {
|
|
372
|
+
enumerable: false,
|
|
373
|
+
configurable: true,
|
|
374
|
+
writable: true,
|
|
375
|
+
value: function (_eventName, _cb) {
|
|
376
|
+
//do nothing
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
return WSRequest;
|
|
380
|
+
}());
|
|
381
|
+
exports.WSRequest = WSRequest;
|
|
382
|
+
var WSSequenceHandler = /** @class */ (function () {
|
|
383
|
+
function WSSequenceHandler() {
|
|
384
|
+
Object.defineProperty(this, "_connections", {
|
|
385
|
+
enumerable: true,
|
|
386
|
+
configurable: true,
|
|
387
|
+
writable: true,
|
|
388
|
+
value: void 0
|
|
389
|
+
});
|
|
390
|
+
Object.defineProperty(this, "messages", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
configurable: true,
|
|
393
|
+
writable: true,
|
|
394
|
+
value: void 0
|
|
395
|
+
});
|
|
396
|
+
this._connections = {};
|
|
397
|
+
this.clearMessages();
|
|
398
|
+
}
|
|
399
|
+
Object.defineProperty(WSSequenceHandler.prototype, "getConnection", {
|
|
400
|
+
enumerable: false,
|
|
401
|
+
configurable: true,
|
|
402
|
+
writable: true,
|
|
403
|
+
value: function (url) {
|
|
404
|
+
return this._connections[url];
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
Object.defineProperty(WSSequenceHandler.prototype, "storeConnection", {
|
|
408
|
+
enumerable: false,
|
|
409
|
+
configurable: true,
|
|
410
|
+
writable: true,
|
|
411
|
+
value: function (url, wsConnection) {
|
|
412
|
+
this._connections[url] = wsConnection;
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
Object.defineProperty(WSSequenceHandler.prototype, "closeAllConnections", {
|
|
416
|
+
enumerable: false,
|
|
417
|
+
configurable: true,
|
|
418
|
+
writable: true,
|
|
419
|
+
value: function () {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
421
|
+
var _i, _a, connection;
|
|
422
|
+
return __generator(this, function (_b) {
|
|
423
|
+
try {
|
|
424
|
+
log_1.default.debug('Closing all ws connections');
|
|
425
|
+
for (_i = 0, _a = Object.values(this._connections); _i < _a.length; _i++) {
|
|
426
|
+
connection = _a[_i];
|
|
427
|
+
connection.close();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
catch (e) {
|
|
431
|
+
log_1.default.warn('Failed to close all connections', e, { connections: this._connections });
|
|
432
|
+
}
|
|
433
|
+
return [2 /*return*/];
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
Object.defineProperty(WSSequenceHandler.prototype, "getMessages", {
|
|
439
|
+
enumerable: false,
|
|
440
|
+
configurable: true,
|
|
441
|
+
writable: true,
|
|
442
|
+
value: function () {
|
|
443
|
+
return this.messages;
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
Object.defineProperty(WSSequenceHandler.prototype, "addMessage", {
|
|
447
|
+
enumerable: false,
|
|
448
|
+
configurable: true,
|
|
449
|
+
writable: true,
|
|
450
|
+
value: function (message) {
|
|
451
|
+
this.messages.push(message);
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
Object.defineProperty(WSSequenceHandler.prototype, "clearMessages", {
|
|
455
|
+
enumerable: false,
|
|
456
|
+
configurable: true,
|
|
457
|
+
writable: true,
|
|
458
|
+
value: function () {
|
|
459
|
+
this.messages = [];
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
return WSSequenceHandler;
|
|
463
|
+
}());
|
|
464
|
+
exports.WSSequenceHandler = WSSequenceHandler;
|
|
465
|
+
function getConnectionState(existingWS) {
|
|
466
|
+
return existingWS ? WSState[existingWS.readyState] : null;
|
|
467
|
+
}
|
|
468
|
+
//# sourceMappingURL=ws.js.map
|
package/dist/ws.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws.js","sourceRoot":"","sources":["../src/ws.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B,CAAC,uEAAuE;AACnG,wEAA+D;AAC/D,qEAA+C;AAE/C,mCAAgD;AAChD,6BAA2E;AAc3E,IAAK,OAKJ;AALD,WAAK,OAAO;IACV,iDAAU,CAAA;IACV,qCAAI,CAAA;IACJ,2CAAO,CAAA;IACP,yCAAM,CAAA;AACR,CAAC,EALI,OAAO,KAAP,OAAO,QAKX;AAED,IAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,IAAM,wBAAwB,GAAG,KAAK,CAAC;AAEvC;IAME,mBACmB,aAAiC,EACjC,SAA4B,EAC5B,OAA2B;QAH9C,iBAOC;;;;;mBANkB;;;;;;mBACA;;;;;;mBACA;;QARnB;;;;;WAAkC,CAAC,wFAAwF;QAC3H;;;;;WAAsB;QACtB;;;;;WAAmB,CAAC,0CAA0C;QAC9D;;;;;WAA0C,CAAC,0CAA0C;QAgJrF;;;;;WAKG;QACH;;;;mBAAwB,UAAO,OAA0C;gBAA1C,wBAAA,EAAA,kCAA0C;;;;;;gCACjE,yBAAyB,GAAG,GAAG,CAAC;qCAClC,CAAA,IAAI,CAAC,EAAE,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,UAAU,KAAK,YAAS,CAAC,UAAU,CAAA,EAAzE,wBAAyE;gCAC3E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loadmill/executer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"description": "Loadmill executer library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ts-watch": "rimraf dist && tsc -w -p tsconfig.json",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "Apache-2.0",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@loadmill/core": "0.3.
|
|
18
|
-
"@loadmill/universal": "0.3.
|
|
17
|
+
"@loadmill/core": "0.3.39",
|
|
18
|
+
"@loadmill/universal": "0.3.32",
|
|
19
19
|
"@types/estree": "^0.0.50",
|
|
20
20
|
"acorn": "^8.4.1",
|
|
21
21
|
"agentkeepalive": "^4.1.3",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"jsedn": "^0.4.1",
|
|
24
24
|
"lodash": "^4.17.21",
|
|
25
25
|
"randomstring": "^1.1.5",
|
|
26
|
-
"superagent": "^
|
|
26
|
+
"superagent": "^6.1.0",
|
|
27
27
|
"urijs": "^1.18.1",
|
|
28
|
-
"vm2": "^3.9.
|
|
28
|
+
"vm2": "^3.9.4"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/errors.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Histogram } from './failures';
|
|
2
|
+
|
|
3
|
+
export class RequestFailuresError extends Error {
|
|
4
|
+
constructor(message: string, public histogram: Histogram = { [message]: 1 }) {
|
|
5
|
+
super(message);
|
|
6
|
+
|
|
7
|
+
// Workaround suggested in: https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
8
|
+
Object.setPrototypeOf(this, RequestFailuresError.prototype);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
CheerioExtractor,
|
|
6
6
|
JsonPathExtractor,
|
|
7
7
|
ExpressionExtractor,
|
|
8
|
-
ParametrizedExtractor
|
|
8
|
+
ParametrizedExtractor,
|
|
9
|
+
WsExtractor,
|
|
9
10
|
} from '@loadmill/core/dist/parameters/extractors';
|
|
10
11
|
import { Parameters } from '@loadmill/core/dist/parameters';
|
|
11
12
|
import { Extraction } from '@loadmill/core/dist/request';
|
|
12
13
|
import log from '@loadmill/universal/dist/log';
|
|
13
14
|
import ednParser from 'jsedn';
|
|
15
|
+
import { WSExtractionData } from '@loadmill/core/dist/parameters/extractors/ws-extractor';
|
|
14
16
|
|
|
15
17
|
export class ExtractionCombiner {
|
|
16
18
|
headerExtractor: HeaderExtractor;
|
|
@@ -19,19 +21,19 @@ export class ExtractionCombiner {
|
|
|
19
21
|
ednPathExtractor: JsonPathExtractor;
|
|
20
22
|
expressionExtractor: ExpressionExtractor;
|
|
21
23
|
|
|
22
|
-
constructor(private contextParameters: Parameters, private res: any) {
|
|
24
|
+
constructor(private contextParameters: Parameters, private res: any, private wsExtractionData: WSExtractionData) {
|
|
23
25
|
this.headerExtractor = new HeaderExtractor(res, this.contextParameters);
|
|
24
26
|
this.expressionExtractor = new ExpressionExtractor(this.contextParameters);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
combine(extraction: Extraction) {
|
|
29
|
+
async combine(extraction: Extraction) {
|
|
28
30
|
let query: string | string[], extractor!: ParametrizedExtractor;
|
|
29
31
|
|
|
30
32
|
if (typeof extraction === 'string') {
|
|
31
33
|
query = extraction;
|
|
32
34
|
extractor = this.expressionExtractor;
|
|
33
35
|
} else {
|
|
34
|
-
const { header, jQuery, jsonPath, edn, regex } = extraction;
|
|
36
|
+
const { header, jQuery, jsonPath, edn, regex, ws } = extraction;
|
|
35
37
|
|
|
36
38
|
if (header != null) {
|
|
37
39
|
query = header;
|
|
@@ -88,6 +90,15 @@ export class ExtractionCombiner {
|
|
|
88
90
|
|
|
89
91
|
query = regex;
|
|
90
92
|
}
|
|
93
|
+
|
|
94
|
+
if (ws != null) {
|
|
95
|
+
extractor = new WsExtractor(
|
|
96
|
+
this.wsExtractionData,
|
|
97
|
+
this.contextParameters
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
query = ws;
|
|
101
|
+
}
|
|
91
102
|
}
|
|
92
103
|
|
|
93
104
|
return () => extractor.extract(query);
|
package/src/mill-version.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Parameters } from '@loadmill/core/dist/parameters';
|
|
|
4
4
|
import {
|
|
5
5
|
LoadmillHeaders,
|
|
6
6
|
LoadmillRequest,
|
|
7
|
+
PostFormData,
|
|
7
8
|
RequestPostData,
|
|
8
9
|
} from '@loadmill/core/dist/request';
|
|
9
10
|
|
|
@@ -40,6 +41,7 @@ export interface ResolvedRequest {
|
|
|
40
41
|
url?: string;
|
|
41
42
|
headers?: LoadmillHeaders[];
|
|
42
43
|
postData?: RequestPostData;
|
|
44
|
+
postFormData?: PostFormData;
|
|
43
45
|
|
|
44
46
|
response?: {
|
|
45
47
|
type: string;
|