@hpcc-js/comms 2.84.3 → 2.84.4
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/index.es6.js +123 -163
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +203 -207
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.node.js +137 -177
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.min.js +1 -1
- package/dist/index.node.min.js.map +1 -1
- package/lib-es6/__package__.js +2 -2
- package/lib-es6/ecl/dfuWorkunit.js +2 -2
- package/lib-es6/ecl/dfuWorkunit.js.map +1 -1
- package/lib-es6/ecl/workunit.js +6 -1
- package/lib-es6/ecl/workunit.js.map +1 -1
- package/lib-es6/services/fileSpray.js +3 -0
- package/lib-es6/services/fileSpray.js.map +1 -1
- package/lib-es6/services/wsLogaccess.js +16 -69
- package/lib-es6/services/wsLogaccess.js.map +1 -1
- package/package.json +11 -11
- package/src/__package__.ts +2 -2
- package/src/ecl/dfuWorkunit.ts +4 -4
- package/src/ecl/workunit.ts +4 -0
- package/src/services/fileSpray.ts +4 -0
- package/src/services/wsLogaccess.ts +24 -79
- package/types/__package__.d.ts +2 -2
- package/types/ecl/dfuWorkunit.d.ts +2 -2
- package/types/ecl/dfuWorkunit.d.ts.map +1 -1
- package/types/ecl/workunit.d.ts.map +1 -1
- package/types/services/fileSpray.d.ts +1 -0
- package/types/services/fileSpray.d.ts.map +1 -1
- package/types/services/wsLogaccess.d.ts +10 -10
- package/types/services/wsLogaccess.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/ecl/dfuWorkunit.d.ts +2 -2
- package/types-3.4/services/fileSpray.d.ts +1 -0
- package/types-3.4/services/wsLogaccess.d.ts +10 -10
package/dist/index.js
CHANGED
|
@@ -4,17 +4,20 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/comms"] = {}, global["@hpcc-js/util"]));
|
|
5
5
|
})(this, (function (exports, util) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/* eslint-disable no-prototype-builtins */
|
|
8
|
+
var g =
|
|
8
9
|
(typeof globalThis !== 'undefined' && globalThis) ||
|
|
9
10
|
(typeof self !== 'undefined' && self) ||
|
|
10
|
-
|
|
11
|
+
// eslint-disable-next-line no-undef
|
|
12
|
+
(typeof global !== 'undefined' && global) ||
|
|
13
|
+
{};
|
|
11
14
|
|
|
12
15
|
var support = {
|
|
13
|
-
searchParams: 'URLSearchParams' in
|
|
14
|
-
iterable: 'Symbol' in
|
|
16
|
+
searchParams: 'URLSearchParams' in g,
|
|
17
|
+
iterable: 'Symbol' in g && 'iterator' in Symbol,
|
|
15
18
|
blob:
|
|
16
|
-
'FileReader' in
|
|
17
|
-
'Blob' in
|
|
19
|
+
'FileReader' in g &&
|
|
20
|
+
'Blob' in g &&
|
|
18
21
|
(function() {
|
|
19
22
|
try {
|
|
20
23
|
new Blob();
|
|
@@ -23,8 +26,8 @@
|
|
|
23
26
|
return false
|
|
24
27
|
}
|
|
25
28
|
})(),
|
|
26
|
-
formData: 'FormData' in
|
|
27
|
-
arrayBuffer: 'ArrayBuffer' in
|
|
29
|
+
formData: 'FormData' in g,
|
|
30
|
+
arrayBuffer: 'ArrayBuffer' in g
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
function isDataView(obj) {
|
|
@@ -95,6 +98,9 @@
|
|
|
95
98
|
}, this);
|
|
96
99
|
} else if (Array.isArray(headers)) {
|
|
97
100
|
headers.forEach(function(header) {
|
|
101
|
+
if (header.length != 2) {
|
|
102
|
+
throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
|
|
103
|
+
}
|
|
98
104
|
this.append(header[0], header[1]);
|
|
99
105
|
}, this);
|
|
100
106
|
} else if (headers) {
|
|
@@ -165,6 +171,7 @@
|
|
|
165
171
|
}
|
|
166
172
|
|
|
167
173
|
function consumed(body) {
|
|
174
|
+
if (body._noBody) return
|
|
168
175
|
if (body.bodyUsed) {
|
|
169
176
|
return Promise.reject(new TypeError('Already read'))
|
|
170
177
|
}
|
|
@@ -192,7 +199,9 @@
|
|
|
192
199
|
function readBlobAsText(blob) {
|
|
193
200
|
var reader = new FileReader();
|
|
194
201
|
var promise = fileReaderReady(reader);
|
|
195
|
-
|
|
202
|
+
var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
|
|
203
|
+
var encoding = match ? match[1] : 'utf-8';
|
|
204
|
+
reader.readAsText(blob, encoding);
|
|
196
205
|
return promise
|
|
197
206
|
}
|
|
198
207
|
|
|
@@ -230,9 +239,11 @@
|
|
|
230
239
|
semantic of setting Request.bodyUsed in the constructor before
|
|
231
240
|
_initBody is called.
|
|
232
241
|
*/
|
|
242
|
+
// eslint-disable-next-line no-self-assign
|
|
233
243
|
this.bodyUsed = this.bodyUsed;
|
|
234
244
|
this._bodyInit = body;
|
|
235
245
|
if (!body) {
|
|
246
|
+
this._noBody = true;
|
|
236
247
|
this._bodyText = '';
|
|
237
248
|
} else if (typeof body === 'string') {
|
|
238
249
|
this._bodyText = body;
|
|
@@ -280,28 +291,29 @@
|
|
|
280
291
|
return Promise.resolve(new Blob([this._bodyText]))
|
|
281
292
|
}
|
|
282
293
|
};
|
|
294
|
+
}
|
|
283
295
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
this._bodyArrayBuffer.
|
|
293
|
-
|
|
294
|
-
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
|
295
|
-
)
|
|
296
|
+
this.arrayBuffer = function() {
|
|
297
|
+
if (this._bodyArrayBuffer) {
|
|
298
|
+
var isConsumed = consumed(this);
|
|
299
|
+
if (isConsumed) {
|
|
300
|
+
return isConsumed
|
|
301
|
+
} else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
|
|
302
|
+
return Promise.resolve(
|
|
303
|
+
this._bodyArrayBuffer.buffer.slice(
|
|
304
|
+
this._bodyArrayBuffer.byteOffset,
|
|
305
|
+
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
|
296
306
|
)
|
|
297
|
-
|
|
298
|
-
return Promise.resolve(this._bodyArrayBuffer)
|
|
299
|
-
}
|
|
307
|
+
)
|
|
300
308
|
} else {
|
|
301
|
-
return
|
|
309
|
+
return Promise.resolve(this._bodyArrayBuffer)
|
|
302
310
|
}
|
|
303
|
-
}
|
|
304
|
-
|
|
311
|
+
} else if (support.blob) {
|
|
312
|
+
return this.blob().then(readBlobAsArrayBuffer)
|
|
313
|
+
} else {
|
|
314
|
+
throw new Error('could not read as ArrayBuffer')
|
|
315
|
+
}
|
|
316
|
+
};
|
|
305
317
|
|
|
306
318
|
this.text = function() {
|
|
307
319
|
var rejected = consumed(this);
|
|
@@ -334,7 +346,7 @@
|
|
|
334
346
|
}
|
|
335
347
|
|
|
336
348
|
// HTTP methods whose capitalization should be normalized
|
|
337
|
-
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
|
349
|
+
var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
|
|
338
350
|
|
|
339
351
|
function normalizeMethod(method) {
|
|
340
352
|
var upcased = method.toUpperCase();
|
|
@@ -375,7 +387,12 @@
|
|
|
375
387
|
}
|
|
376
388
|
this.method = normalizeMethod(options.method || this.method || 'GET');
|
|
377
389
|
this.mode = options.mode || this.mode || null;
|
|
378
|
-
this.signal = options.signal || this.signal
|
|
390
|
+
this.signal = options.signal || this.signal || (function () {
|
|
391
|
+
if ('AbortController' in g) {
|
|
392
|
+
var ctrl = new AbortController();
|
|
393
|
+
return ctrl.signal;
|
|
394
|
+
}
|
|
395
|
+
}());
|
|
379
396
|
this.referrer = null;
|
|
380
397
|
|
|
381
398
|
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
|
@@ -437,7 +454,11 @@
|
|
|
437
454
|
var key = parts.shift().trim();
|
|
438
455
|
if (key) {
|
|
439
456
|
var value = parts.join(':').trim();
|
|
440
|
-
|
|
457
|
+
try {
|
|
458
|
+
headers.append(key, value);
|
|
459
|
+
} catch (error) {
|
|
460
|
+
console.warn('Response ' + error.message);
|
|
461
|
+
}
|
|
441
462
|
}
|
|
442
463
|
});
|
|
443
464
|
return headers
|
|
@@ -455,6 +476,9 @@
|
|
|
455
476
|
|
|
456
477
|
this.type = 'default';
|
|
457
478
|
this.status = options.status === undefined ? 200 : options.status;
|
|
479
|
+
if (this.status < 200 || this.status > 599) {
|
|
480
|
+
throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
|
|
481
|
+
}
|
|
458
482
|
this.ok = this.status >= 200 && this.status < 300;
|
|
459
483
|
this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
|
|
460
484
|
this.headers = new Headers(options.headers);
|
|
@@ -474,7 +498,8 @@
|
|
|
474
498
|
};
|
|
475
499
|
|
|
476
500
|
Response.error = function() {
|
|
477
|
-
var response = new Response(null, {status:
|
|
501
|
+
var response = new Response(null, {status: 200, statusText: ''});
|
|
502
|
+
response.status = 0;
|
|
478
503
|
response.type = 'error';
|
|
479
504
|
return response
|
|
480
505
|
};
|
|
@@ -489,7 +514,7 @@
|
|
|
489
514
|
return new Response(null, {status: status, headers: {location: url}})
|
|
490
515
|
};
|
|
491
516
|
|
|
492
|
-
var DOMException =
|
|
517
|
+
var DOMException = g.DOMException;
|
|
493
518
|
try {
|
|
494
519
|
new DOMException();
|
|
495
520
|
} catch (err) {
|
|
@@ -519,10 +544,16 @@
|
|
|
519
544
|
|
|
520
545
|
xhr.onload = function() {
|
|
521
546
|
var options = {
|
|
522
|
-
status: xhr.status,
|
|
523
547
|
statusText: xhr.statusText,
|
|
524
548
|
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
|
525
549
|
};
|
|
550
|
+
// This check if specifically for when a user fetches a file locally from the file system
|
|
551
|
+
// Only if the status is out of a normal range
|
|
552
|
+
if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
|
|
553
|
+
options.status = 200;
|
|
554
|
+
} else {
|
|
555
|
+
options.status = xhr.status;
|
|
556
|
+
}
|
|
526
557
|
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
|
527
558
|
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
|
528
559
|
setTimeout(function() {
|
|
@@ -538,7 +569,7 @@
|
|
|
538
569
|
|
|
539
570
|
xhr.ontimeout = function() {
|
|
540
571
|
setTimeout(function() {
|
|
541
|
-
reject(new TypeError('Network request
|
|
572
|
+
reject(new TypeError('Network request timed out'));
|
|
542
573
|
}, 0);
|
|
543
574
|
};
|
|
544
575
|
|
|
@@ -550,7 +581,7 @@
|
|
|
550
581
|
|
|
551
582
|
function fixUrl(url) {
|
|
552
583
|
try {
|
|
553
|
-
return url === '' &&
|
|
584
|
+
return url === '' && g.location.href ? g.location.href : url
|
|
554
585
|
} catch (e) {
|
|
555
586
|
return url
|
|
556
587
|
}
|
|
@@ -568,18 +599,23 @@
|
|
|
568
599
|
if (support.blob) {
|
|
569
600
|
xhr.responseType = 'blob';
|
|
570
601
|
} else if (
|
|
571
|
-
support.arrayBuffer
|
|
572
|
-
request.headers.get('Content-Type') &&
|
|
573
|
-
request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1
|
|
602
|
+
support.arrayBuffer
|
|
574
603
|
) {
|
|
575
604
|
xhr.responseType = 'arraybuffer';
|
|
576
605
|
}
|
|
577
606
|
}
|
|
578
607
|
|
|
579
|
-
if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {
|
|
608
|
+
if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
|
|
609
|
+
var names = [];
|
|
580
610
|
Object.getOwnPropertyNames(init.headers).forEach(function(name) {
|
|
611
|
+
names.push(normalizeName(name));
|
|
581
612
|
xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
|
|
582
613
|
});
|
|
614
|
+
request.headers.forEach(function(value, name) {
|
|
615
|
+
if (names.indexOf(name) === -1) {
|
|
616
|
+
xhr.setRequestHeader(name, value);
|
|
617
|
+
}
|
|
618
|
+
});
|
|
583
619
|
} else {
|
|
584
620
|
request.headers.forEach(function(value, name) {
|
|
585
621
|
xhr.setRequestHeader(name, value);
|
|
@@ -603,107 +639,112 @@
|
|
|
603
639
|
|
|
604
640
|
fetch$1.polyfill = true;
|
|
605
641
|
|
|
606
|
-
if (!
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
642
|
+
if (!g.fetch) {
|
|
643
|
+
g.fetch = fetch$1;
|
|
644
|
+
g.Headers = Headers;
|
|
645
|
+
g.Request = Request;
|
|
646
|
+
g.Response = Response;
|
|
611
647
|
}
|
|
612
648
|
|
|
613
649
|
var PKG_NAME = "@hpcc-js/comms";
|
|
614
|
-
var PKG_VERSION = "2.84.
|
|
615
|
-
var BUILD_VERSION = "2.104.
|
|
616
|
-
|
|
617
|
-
/******************************************************************************
|
|
618
|
-
Copyright (c) Microsoft Corporation.
|
|
619
|
-
|
|
620
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
621
|
-
purpose with or without fee is hereby granted.
|
|
622
|
-
|
|
623
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
624
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
625
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
626
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
627
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
628
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
629
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
630
|
-
***************************************************************************** */
|
|
631
|
-
/* global Reflect, Promise */
|
|
632
|
-
|
|
633
|
-
var extendStatics = function(d, b) {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
function __extends(d, b) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
var __assign = function() {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
function __generator(thisArg, body) {
|
|
670
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
671
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
672
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
673
|
-
function step(op) {
|
|
674
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
675
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
676
|
-
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;
|
|
677
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
678
|
-
switch (op[0]) {
|
|
679
|
-
case 0: case 1: t = op; break;
|
|
680
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
681
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
682
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
683
|
-
default:
|
|
684
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
685
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
686
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
687
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
688
|
-
if (t[2]) _.ops.pop();
|
|
689
|
-
_.trys.pop(); continue;
|
|
690
|
-
}
|
|
691
|
-
op = body.call(thisArg, _);
|
|
692
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
693
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
function __spreadArray(to, from, pack) {
|
|
698
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
699
|
-
if (ar || !(i in from)) {
|
|
700
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
701
|
-
ar[i] = from[i];
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
650
|
+
var PKG_VERSION = "2.84.4";
|
|
651
|
+
var BUILD_VERSION = "2.104.30";
|
|
652
|
+
|
|
653
|
+
/******************************************************************************
|
|
654
|
+
Copyright (c) Microsoft Corporation.
|
|
655
|
+
|
|
656
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
657
|
+
purpose with or without fee is hereby granted.
|
|
658
|
+
|
|
659
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
660
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
661
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
662
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
663
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
664
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
665
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
666
|
+
***************************************************************************** */
|
|
667
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
668
|
+
|
|
669
|
+
var extendStatics = function(d, b) {
|
|
670
|
+
extendStatics = Object.setPrototypeOf ||
|
|
671
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
672
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
673
|
+
return extendStatics(d, b);
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
function __extends(d, b) {
|
|
677
|
+
if (typeof b !== "function" && b !== null)
|
|
678
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
679
|
+
extendStatics(d, b);
|
|
680
|
+
function __() { this.constructor = d; }
|
|
681
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
var __assign = function() {
|
|
685
|
+
__assign = Object.assign || function __assign(t) {
|
|
686
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
687
|
+
s = arguments[i];
|
|
688
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
689
|
+
}
|
|
690
|
+
return t;
|
|
691
|
+
};
|
|
692
|
+
return __assign.apply(this, arguments);
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
696
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
697
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
698
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
699
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
700
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
701
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
702
|
+
});
|
|
705
703
|
}
|
|
706
704
|
|
|
705
|
+
function __generator(thisArg, body) {
|
|
706
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
707
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
708
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
709
|
+
function step(op) {
|
|
710
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
711
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
712
|
+
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;
|
|
713
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
714
|
+
switch (op[0]) {
|
|
715
|
+
case 0: case 1: t = op; break;
|
|
716
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
717
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
718
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
719
|
+
default:
|
|
720
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
721
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
722
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
723
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
724
|
+
if (t[2]) _.ops.pop();
|
|
725
|
+
_.trys.pop(); continue;
|
|
726
|
+
}
|
|
727
|
+
op = body.call(thisArg, _);
|
|
728
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
729
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function __spreadArray(to, from, pack) {
|
|
734
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
735
|
+
if (ar || !(i in from)) {
|
|
736
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
737
|
+
ar[i] = from[i];
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
744
|
+
var e = new Error(message);
|
|
745
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
746
|
+
};
|
|
747
|
+
|
|
707
748
|
var logger$4 = util.scopedLogger("comms/connection.ts");
|
|
708
749
|
function instanceOfIOptions(object) {
|
|
709
750
|
return "baseUrl" in object;
|
|
@@ -1214,6 +1255,9 @@
|
|
|
1214
1255
|
function FileSprayService() {
|
|
1215
1256
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1216
1257
|
}
|
|
1258
|
+
FileSprayService.prototype.DFUWUFileEx = function (request) {
|
|
1259
|
+
return this._connection.send("DFUWUFile", request, "text");
|
|
1260
|
+
};
|
|
1217
1261
|
FileSprayService.prototype.SprayFixedEx = function (request) {
|
|
1218
1262
|
return this._connection.send("SprayFixed", request);
|
|
1219
1263
|
};
|
|
@@ -2000,58 +2044,6 @@
|
|
|
2000
2044
|
}(Service));
|
|
2001
2045
|
|
|
2002
2046
|
var logger$3 = util.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");
|
|
2003
|
-
var ElasticKnownColumns;
|
|
2004
|
-
(function (ElasticKnownColumns) {
|
|
2005
|
-
ElasticKnownColumns["audience"] = "hpcc.log.audience";
|
|
2006
|
-
ElasticKnownColumns["class"] = "hpcc.log.class";
|
|
2007
|
-
ElasticKnownColumns["containerName"] = "kubernetes.container.name";
|
|
2008
|
-
ElasticKnownColumns["jobId"] = "hpcc.log.jobid";
|
|
2009
|
-
ElasticKnownColumns["message"] = "hpcc.log.message";
|
|
2010
|
-
ElasticKnownColumns["procId"] = "hpcc.log.procid";
|
|
2011
|
-
ElasticKnownColumns["sequence"] = "hpcc.log.sequence";
|
|
2012
|
-
ElasticKnownColumns["threadId"] = "hpcc.log.threadid";
|
|
2013
|
-
ElasticKnownColumns["timestamp"] = "hpcc.log.timestamp";
|
|
2014
|
-
})(ElasticKnownColumns || (ElasticKnownColumns = {}));
|
|
2015
|
-
var RElasticKnownColumns = {};
|
|
2016
|
-
for (var key in ElasticKnownColumns) {
|
|
2017
|
-
if (ElasticKnownColumns.hasOwnProperty(key)) {
|
|
2018
|
-
RElasticKnownColumns[ElasticKnownColumns[key]] = key;
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
var elasticToLogLine = function (line) {
|
|
2022
|
-
var retVal = {};
|
|
2023
|
-
for (var key in RElasticKnownColumns) {
|
|
2024
|
-
retVal[RElasticKnownColumns[key]] = line === null || line === void 0 ? void 0 : line.fields[0][key];
|
|
2025
|
-
}
|
|
2026
|
-
return retVal;
|
|
2027
|
-
};
|
|
2028
|
-
var AzureKnownColumns;
|
|
2029
|
-
(function (AzureKnownColumns) {
|
|
2030
|
-
AzureKnownColumns["audience"] = "hpcc_log_audience";
|
|
2031
|
-
AzureKnownColumns["class"] = "hpcc_log_class";
|
|
2032
|
-
AzureKnownColumns["containerID"] = "ContainerID";
|
|
2033
|
-
AzureKnownColumns["containerName"] = "ContainerID";
|
|
2034
|
-
AzureKnownColumns["jobId"] = "hpcc_log_jobid";
|
|
2035
|
-
AzureKnownColumns["message"] = "hpcc_log_message";
|
|
2036
|
-
AzureKnownColumns["procId"] = "";
|
|
2037
|
-
AzureKnownColumns["sequence"] = "hpcc_log_sequence";
|
|
2038
|
-
AzureKnownColumns["threadId"] = "hpcc_log_threadid";
|
|
2039
|
-
AzureKnownColumns["timestamp"] = "hpcc_log_timestamp";
|
|
2040
|
-
})(AzureKnownColumns || (AzureKnownColumns = {}));
|
|
2041
|
-
var RAzureKnownColumns = {};
|
|
2042
|
-
for (var key in AzureKnownColumns) {
|
|
2043
|
-
if (AzureKnownColumns.hasOwnProperty(key)) {
|
|
2044
|
-
RAzureKnownColumns[AzureKnownColumns[key]] = key;
|
|
2045
|
-
}
|
|
2046
|
-
}
|
|
2047
|
-
var azureToLogLine = function (line) {
|
|
2048
|
-
var _a;
|
|
2049
|
-
var retVal = {};
|
|
2050
|
-
for (var key in RAzureKnownColumns) {
|
|
2051
|
-
retVal[RAzureKnownColumns[key]] = (_a = line === null || line === void 0 ? void 0 : line.fields[0][key]) !== null && _a !== void 0 ? _a : "";
|
|
2052
|
-
}
|
|
2053
|
-
return retVal;
|
|
2054
|
-
};
|
|
2055
2047
|
var LogaccessService = /** @class */ (function (_super) {
|
|
2056
2048
|
__extends(LogaccessService, _super);
|
|
2057
2049
|
function LogaccessService() {
|
|
@@ -2070,12 +2062,22 @@
|
|
|
2070
2062
|
LogaccessService.prototype.GetLogsEx = function (request) {
|
|
2071
2063
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2072
2064
|
return __awaiter(this, void 0, void 0, function () {
|
|
2073
|
-
var logInfo, getLogsRequest, filters, _loop_1, key, binaryLogFilter_1;
|
|
2065
|
+
var logInfo, columnMap, convertLogLine, getLogsRequest, filters, _loop_1, key, binaryLogFilter_1;
|
|
2074
2066
|
return __generator(this, function (_l) {
|
|
2075
2067
|
switch (_l.label) {
|
|
2076
2068
|
case 0: return [4 /*yield*/, this.GetLogAccessInfo()];
|
|
2077
2069
|
case 1:
|
|
2078
2070
|
logInfo = _l.sent();
|
|
2071
|
+
columnMap = {};
|
|
2072
|
+
logInfo.Columns.Column.forEach(function (column) { return columnMap[column.LogType] = column.Name; });
|
|
2073
|
+
convertLogLine = function (line) {
|
|
2074
|
+
var _a;
|
|
2075
|
+
var retVal = {};
|
|
2076
|
+
for (var key in columnMap) {
|
|
2077
|
+
retVal[key] = (_a = line === null || line === void 0 ? void 0 : line.fields[0][columnMap[key]]) !== null && _a !== void 0 ? _a : "";
|
|
2078
|
+
}
|
|
2079
|
+
return retVal;
|
|
2080
|
+
};
|
|
2079
2081
|
getLogsRequest = {
|
|
2080
2082
|
Filter: {
|
|
2081
2083
|
leftBinaryFilter: {
|
|
@@ -2097,17 +2099,8 @@
|
|
|
2097
2099
|
filters = [];
|
|
2098
2100
|
_loop_1 = function (key) {
|
|
2099
2101
|
var searchField;
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
if (key in AzureKnownColumns) {
|
|
2103
|
-
searchField = AzureKnownColumns[key];
|
|
2104
|
-
}
|
|
2105
|
-
break;
|
|
2106
|
-
case "elasticstack":
|
|
2107
|
-
if (key in ElasticKnownColumns) {
|
|
2108
|
-
searchField = ElasticKnownColumns[key];
|
|
2109
|
-
}
|
|
2110
|
-
break;
|
|
2102
|
+
if (key in columnMap) {
|
|
2103
|
+
searchField = columnMap[key];
|
|
2111
2104
|
}
|
|
2112
2105
|
if (searchField) {
|
|
2113
2106
|
if (Array.isArray(request[key])) {
|
|
@@ -2189,16 +2182,14 @@
|
|
|
2189
2182
|
getLogsRequest.Range.EndDate = request.EndDate.toISOString();
|
|
2190
2183
|
}
|
|
2191
2184
|
return [2 /*return*/, this.GetLogs(getLogsRequest).then(function (response) {
|
|
2192
|
-
var _a, _b, _c
|
|
2185
|
+
var _a, _b, _c;
|
|
2193
2186
|
try {
|
|
2194
2187
|
var logLines = JSON.parse(response.LogLines);
|
|
2195
2188
|
var lines = [];
|
|
2196
2189
|
switch (logInfo.RemoteLogManagerType) {
|
|
2197
2190
|
case "azureloganalyticscurl":
|
|
2198
|
-
lines = (_b = (_a = logLines.lines) === null || _a === void 0 ? void 0 : _a.map(azureToLogLine)) !== null && _b !== void 0 ? _b : [];
|
|
2199
|
-
break;
|
|
2200
2191
|
case "elasticstack":
|
|
2201
|
-
lines = (
|
|
2192
|
+
lines = (_b = (_a = logLines.lines) === null || _a === void 0 ? void 0 : _a.map(convertLogLine)) !== null && _b !== void 0 ? _b : [];
|
|
2202
2193
|
break;
|
|
2203
2194
|
default:
|
|
2204
2195
|
logger$3.warning("Unknown RemoteLogManagerType: ".concat(logInfo.RemoteLogManagerType));
|
|
@@ -2206,7 +2197,7 @@
|
|
|
2206
2197
|
}
|
|
2207
2198
|
return {
|
|
2208
2199
|
lines: lines,
|
|
2209
|
-
total: (
|
|
2200
|
+
total: (_c = response.TotalLogLinesAvailable) !== null && _c !== void 0 ? _c : 10000
|
|
2210
2201
|
};
|
|
2211
2202
|
}
|
|
2212
2203
|
catch (e) {
|
|
@@ -6343,7 +6334,12 @@
|
|
|
6343
6334
|
case 0: return [4 /*yield*/, this.WUQuery()];
|
|
6344
6335
|
case 1:
|
|
6345
6336
|
_a.sent();
|
|
6346
|
-
return [
|
|
6337
|
+
if (!(this.StateID === WUStateID.Compiled && !this.ActionEx && !this._submitAction)) return [3 /*break*/, 3];
|
|
6338
|
+
return [4 /*yield*/, this.refreshInfo()];
|
|
6339
|
+
case 2:
|
|
6340
|
+
_a.sent();
|
|
6341
|
+
_a.label = 3;
|
|
6342
|
+
case 3: return [2 /*return*/, this];
|
|
6347
6343
|
}
|
|
6348
6344
|
});
|
|
6349
6345
|
});
|
|
@@ -9015,11 +9011,11 @@
|
|
|
9015
9011
|
};
|
|
9016
9012
|
DFUWorkunit.prototype.DFUWUFile = function (_request) {
|
|
9017
9013
|
if (_request === void 0) { _request = {}; }
|
|
9018
|
-
return this.connection.
|
|
9014
|
+
return this.connection.DFUWUFileEx(__assign(__assign({}, _request), { Wuid: this.ID })).then(function (response) {
|
|
9019
9015
|
//TODO: additional processing?
|
|
9020
9016
|
return response;
|
|
9021
9017
|
}).catch(function (e) {
|
|
9022
|
-
return
|
|
9018
|
+
return "";
|
|
9023
9019
|
});
|
|
9024
9020
|
};
|
|
9025
9021
|
DFUWorkunit.prototype.DFUWUAction = function (actionType) {
|