@hpcc-js/comms 2.86.1 → 2.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -648,8 +648,8 @@
648
648
  }
649
649
 
650
650
  var PKG_NAME = "@hpcc-js/comms";
651
- var PKG_VERSION = "2.86.1";
652
- var BUILD_VERSION = "2.104.35";
651
+ var PKG_VERSION = "2.87.0";
652
+ var BUILD_VERSION = "2.104.36";
653
653
 
654
654
  /******************************************************************************
655
655
  Copyright (c) Microsoft Corporation.
@@ -2502,49 +2502,117 @@
2502
2502
  return ResourcesService;
2503
2503
  }(ResourcesServiceBase));
2504
2504
 
2505
- var SMCService = /** @class */ (function () {
2506
- function SMCService(optsConnection) {
2507
- this._connection = new ESPConnection(optsConnection, "WsSMC", "1.24");
2505
+ exports.WsSMC = void 0;
2506
+ (function (WsSMC) {
2507
+ (function (LockModes) {
2508
+ LockModes["ALL"] = "ALL";
2509
+ LockModes["READ"] = "READ";
2510
+ LockModes["WRITE"] = "WRITE";
2511
+ LockModes["HOLD"] = "HOLD";
2512
+ LockModes["SUB"] = "SUB";
2513
+ })(WsSMC.LockModes || (WsSMC.LockModes = {}));
2514
+ (function (RoxieControlCmdType) {
2515
+ RoxieControlCmdType["Attach"] = "Attach";
2516
+ RoxieControlCmdType["Detach"] = "Detach";
2517
+ RoxieControlCmdType["State"] = "State";
2518
+ RoxieControlCmdType["Reload"] = "Reload";
2519
+ RoxieControlCmdType["ReloadRetry"] = "ReloadRetry";
2520
+ RoxieControlCmdType["MemLock"] = "MemLock";
2521
+ RoxieControlCmdType["MemUnlock"] = "MemUnlock";
2522
+ RoxieControlCmdType["GetMemLocked"] = "GetMemLocked";
2523
+ })(WsSMC.RoxieControlCmdType || (WsSMC.RoxieControlCmdType = {}));
2524
+ })(exports.WsSMC || (exports.WsSMC = {}));
2525
+ var SMCServiceBase = /** @class */ (function (_super) {
2526
+ __extends(SMCServiceBase, _super);
2527
+ function SMCServiceBase(optsConnection) {
2528
+ return _super.call(this, optsConnection, "WsSMC", "1.27") || this;
2508
2529
  }
2509
- SMCService.prototype.connectionOptions = function () {
2510
- return this._connection.opts();
2530
+ SMCServiceBase.prototype.Activity = function (request) {
2531
+ return this._connection.send("Activity", request, "json", false, undefined, "ActivityResponse");
2511
2532
  };
2512
- SMCService.prototype.Activity = function (request) {
2513
- return this._connection.send("Activity", request).then(function (response) {
2514
- return __assign({ Running: {
2515
- ActiveWorkunit: []
2516
- } }, response);
2517
- });
2533
+ SMCServiceBase.prototype.BrowseResources = function (request) {
2534
+ return this._connection.send("BrowseResources", request, "json", false, undefined, "BrowseResourcesResponse");
2535
+ };
2536
+ SMCServiceBase.prototype.ClearQueue = function (request) {
2537
+ return this._connection.send("ClearQueue", request, "json", false, undefined, "SMCQueueResponse");
2538
+ };
2539
+ SMCServiceBase.prototype.GetBuildInfo = function (request) {
2540
+ return this._connection.send("GetBuildInfo", request, "json", false, undefined, "GetBuildInfoResponse");
2541
+ };
2542
+ SMCServiceBase.prototype.GetStatusServerInfo = function (request) {
2543
+ return this._connection.send("GetStatusServerInfo", request, "json", false, undefined, "GetStatusServerInfoResponse");
2544
+ };
2545
+ SMCServiceBase.prototype.GetThorQueueAvailability = function (request) {
2546
+ return this._connection.send("GetThorQueueAvailability", request, "json", false, undefined, "GetThorQueueAvailabilityResponse");
2547
+ };
2548
+ SMCServiceBase.prototype.Index = function (request) {
2549
+ return this._connection.send("Index", request, "json", false, undefined, "SMCIndexResponse");
2550
+ };
2551
+ SMCServiceBase.prototype.LockQuery = function (request) {
2552
+ return this._connection.send("LockQuery", request, "json", false, undefined, "LockQueryResponse");
2553
+ };
2554
+ SMCServiceBase.prototype.MoveJobBack = function (request) {
2555
+ return this._connection.send("MoveJobBack", request, "json", false, undefined, "SMCJobResponse");
2556
+ };
2557
+ SMCServiceBase.prototype.MoveJobDown = function (request) {
2558
+ return this._connection.send("MoveJobDown", request, "json", false, undefined, "SMCJobResponse");
2518
2559
  };
2519
- SMCService.prototype.BrowseResources = function (request) {
2520
- return this._connection.send("BrowseResources", request);
2560
+ SMCServiceBase.prototype.MoveJobFront = function (request) {
2561
+ return this._connection.send("MoveJobFront", request, "json", false, undefined, "SMCJobResponse");
2521
2562
  };
2522
- SMCService.prototype.GetBuildInfo = function (request) {
2523
- return this._connection.send("GetBuildInfo", request);
2563
+ SMCServiceBase.prototype.MoveJobUp = function (request) {
2564
+ return this._connection.send("MoveJobUp", request, "json", false, undefined, "SMCJobResponse");
2524
2565
  };
2525
- SMCService.prototype.GetStatusServerInfo = function (request) {
2526
- return this._connection.send("GetStatusServerInfo", request);
2566
+ SMCServiceBase.prototype.NotInCommunityEdition = function (request) {
2567
+ return this._connection.send("NotInCommunityEdition", request, "json", false, undefined, "NotInCommunityEditionResponse");
2527
2568
  };
2528
- SMCService.prototype.GetThorQueueAvailability = function (request) {
2529
- return this._connection.send("GetThorQueueAvailability", request);
2569
+ SMCServiceBase.prototype.PauseQueue = function (request) {
2570
+ return this._connection.send("PauseQueue", request, "json", false, undefined, "SMCQueueResponse");
2530
2571
  };
2531
- SMCService.prototype.LockQuery = function (request) {
2532
- return this._connection.send("LockQuery", request);
2572
+ SMCServiceBase.prototype.Ping = function (request) {
2573
+ return this._connection.send("Ping", request, "json", false, undefined, "WsSMCPingResponse");
2533
2574
  };
2534
- SMCService.prototype.NotInCommunityEdition = function (request) {
2535
- return this._connection.send("NotInCommunityEdition", request);
2575
+ SMCServiceBase.prototype.RemoveJob = function (request) {
2576
+ return this._connection.send("RemoveJob", request, "json", false, undefined, "SMCJobResponse");
2536
2577
  };
2537
- SMCService.prototype.RoxieControlCmd = function (request) {
2538
- return this._connection.send("RoxieControlCmd", request);
2578
+ SMCServiceBase.prototype.ResumeQueue = function (request) {
2579
+ return this._connection.send("ResumeQueue", request, "json", false, undefined, "SMCQueueResponse");
2539
2580
  };
2540
- SMCService.prototype.SetBanner = function (request) {
2541
- return this._connection.send("SetBanner", request);
2581
+ SMCServiceBase.prototype.RoxieControlCmd = function (request) {
2582
+ return this._connection.send("RoxieControlCmd", request, "json", false, undefined, "RoxieControlCmdResponse");
2542
2583
  };
2543
- SMCService.prototype.SMCJob = function (request) {
2544
- return this._connection.send("SMCJob", request);
2584
+ SMCServiceBase.prototype.RoxieXrefCmd = function (request) {
2585
+ return this._connection.send("RoxieXrefCmd", request, "json", false, undefined, "RoxieXrefCmdResponse");
2586
+ };
2587
+ SMCServiceBase.prototype.SetBanner = function (request) {
2588
+ return this._connection.send("SetBanner", request, "json", false, undefined, "SetBannerResponse");
2589
+ };
2590
+ SMCServiceBase.prototype.SetJobPriority = function (request) {
2591
+ return this._connection.send("SetJobPriority", request, "json", false, undefined, "SMCPriorityResponse");
2592
+ };
2593
+ SMCServiceBase.prototype.StopQueue = function (request) {
2594
+ return this._connection.send("StopQueue", request, "json", false, undefined, "SMCQueueResponse");
2595
+ };
2596
+ return SMCServiceBase;
2597
+ }(Service));
2598
+
2599
+ var SMCService = /** @class */ (function (_super) {
2600
+ __extends(SMCService, _super);
2601
+ function SMCService() {
2602
+ return _super !== null && _super.apply(this, arguments) || this;
2603
+ }
2604
+ SMCService.prototype.connectionOptions = function () {
2605
+ return this._connection.opts();
2606
+ };
2607
+ SMCService.prototype.Activity = function (request) {
2608
+ return _super.prototype.Activity.call(this, request).then(function (response) {
2609
+ return __assign({ Running: {
2610
+ ActiveWorkunit: []
2611
+ } }, response);
2612
+ });
2545
2613
  };
2546
2614
  return SMCService;
2547
- }());
2615
+ }(SMCServiceBase));
2548
2616
 
2549
2617
  var StoreService = /** @class */ (function (_super) {
2550
2618
  __extends(StoreService, _super);
@@ -5646,6 +5714,76 @@
5646
5714
  }
5647
5715
  return num;
5648
5716
  }
5717
+ var DEFINITION_LIST = "DefinitionList";
5718
+ var definitionRegex = /([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/;
5719
+ var extendedProps = ["Avg", "Min", "Max", "Delta", "StdDev"];
5720
+ var relatedProps = ["SkewMin", "SkewMax", "NodeMin", "NodeMax"];
5721
+ var metricKeyRegex = /[A-Z][a-z]*/g;
5722
+ function _splitLabel(fullLabel) {
5723
+ // Related properties ---
5724
+ for (var _i = 0, relatedProps_1 = relatedProps; _i < relatedProps_1.length; _i++) {
5725
+ var relProp = relatedProps_1[_i];
5726
+ var index = fullLabel.indexOf(relProp);
5727
+ if (index === 0) {
5728
+ var measure = "";
5729
+ var label = fullLabel.slice(index + relProp.length);
5730
+ return { measure: measure, ext: relProp, label: label };
5731
+ }
5732
+ }
5733
+ // Primary properties ---
5734
+ var labelParts = fullLabel.match(metricKeyRegex);
5735
+ if (labelParts === null || labelParts === void 0 ? void 0 : labelParts.length) {
5736
+ var measure = labelParts.shift();
5737
+ var label = labelParts.join("");
5738
+ for (var _a = 0, extendedProps_1 = extendedProps; _a < extendedProps_1.length; _a++) {
5739
+ var ext = extendedProps_1[_a];
5740
+ var index = label.indexOf(ext);
5741
+ if (index === 0) {
5742
+ label = label.slice(index + ext.length);
5743
+ return { measure: measure, ext: ext, label: label };
5744
+ }
5745
+ }
5746
+ // Not an aggregate property ---
5747
+ return { measure: measure, ext: "", label: label };
5748
+ }
5749
+ // No match found ---
5750
+ return { measure: "", ext: "", label: fullLabel };
5751
+ }
5752
+ var splitLabelCache = {};
5753
+ function splitLabel(key) {
5754
+ var retVal = splitLabelCache[key];
5755
+ if (!retVal) {
5756
+ retVal = _splitLabel(key);
5757
+ splitLabelCache[key] = retVal;
5758
+ }
5759
+ return retVal;
5760
+ }
5761
+ function formatValue(item, key) {
5762
+ var _a, _b, _c;
5763
+ return (_c = (_b = (_a = item.__formattedProps) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : item[key]) !== null && _c !== void 0 ? _c : "";
5764
+ }
5765
+ function formatValues(item, key, dedup) {
5766
+ var keyParts = splitLabel(key);
5767
+ if (!dedup[keyParts.measure]) {
5768
+ dedup[keyParts.label] = true;
5769
+ return {
5770
+ Key: "".concat(keyParts.measure).concat(keyParts.label),
5771
+ Value: formatValue(item, "".concat(keyParts.measure).concat(keyParts.label)),
5772
+ // Extended properties ---
5773
+ Avg: formatValue(item, "".concat(keyParts.measure, "Avg").concat(keyParts.label)),
5774
+ Min: formatValue(item, "".concat(keyParts.measure, "Min").concat(keyParts.label)),
5775
+ Max: formatValue(item, "".concat(keyParts.measure, "Max").concat(keyParts.label)),
5776
+ Delta: formatValue(item, "".concat(keyParts.measure, "Delta").concat(keyParts.label)),
5777
+ StdDev: formatValue(item, "".concat(keyParts.measure, "StdDev").concat(keyParts.label)),
5778
+ // Related properties ---
5779
+ SkewMin: formatValue(item, "SkewMin".concat(keyParts.label)),
5780
+ SkewMax: formatValue(item, "SkewMax".concat(keyParts.label)),
5781
+ NodeMin: formatValue(item, "NodeMin".concat(keyParts.label)),
5782
+ NodeMax: formatValue(item, "NodeMax".concat(keyParts.label))
5783
+ };
5784
+ }
5785
+ return null;
5786
+ }
5649
5787
  var logger$2 = util.scopedLogger("workunit.ts");
5650
5788
  var WUStateID = exports.WUStateID;
5651
5789
  var WorkunitCache = /** @class */ (function (_super) {
@@ -6484,8 +6622,7 @@
6484
6622
  }
6485
6623
  };
6486
6624
  var data = [];
6487
- for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) {
6488
- var scope = scopes_1[_i];
6625
+ var _loop_1 = function (scope) {
6489
6626
  var props = {};
6490
6627
  var formattedProps = {};
6491
6628
  if (scope && scope.Id && scope.Properties && scope.Properties.Property) {
@@ -6534,8 +6671,42 @@
6534
6671
  }
6535
6672
  formattedProps[scopeProperty.Name] = formatNum((_a = scopeProperty.Formatted) !== null && _a !== void 0 ? _a : props[scopeProperty.Name]);
6536
6673
  }
6674
+ // Other properties ---
6675
+ }
6676
+ var normalizedScope = __assign({ id: scope.Id, name: scope.ScopeName, type: scope.ScopeType, Kind: scope["Kind"], Label: scope["Label"], __formattedProps: formattedProps, __groupedProps: {} }, props);
6677
+ if (normalizedScope[DEFINITION_LIST]) {
6678
+ try {
6679
+ var definitionList = JSON.parse(normalizedScope[DEFINITION_LIST].split("\\").join("\\\\"));
6680
+ normalizedScope[DEFINITION_LIST] = [];
6681
+ definitionList.forEach(function (definition, idx) {
6682
+ var _a;
6683
+ var matches = definition.match(definitionRegex);
6684
+ if (matches) {
6685
+ var filePath = ((_a = matches[1]) !== null && _a !== void 0 ? _a : "") + matches[2] + matches[3];
6686
+ var line = parseInt(matches[5]);
6687
+ var col = parseInt(matches[6]);
6688
+ normalizedScope[DEFINITION_LIST].push({ filePath: filePath, line: line, col: col });
6689
+ }
6690
+ });
6691
+ }
6692
+ catch (e) {
6693
+ logger$2.error("Unexpected \"DefinitionList\": ".concat(normalizedScope[DEFINITION_LIST]));
6694
+ }
6695
+ }
6696
+ var dedup = {};
6697
+ for (var key in normalizedScope) {
6698
+ if (key.indexOf("__") !== 0) {
6699
+ var row = formatValues(normalizedScope, key, dedup);
6700
+ if (row) {
6701
+ normalizedScope.__groupedProps[row.Key] = row;
6702
+ }
6703
+ }
6537
6704
  }
6538
- data.push(__assign({ id: scope.Id, name: scope.ScopeName, type: scope.ScopeType, __formattedProps: formattedProps }, props));
6705
+ data.push(normalizedScope);
6706
+ };
6707
+ for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) {
6708
+ var scope = scopes_1[_i];
6709
+ _loop_1(scope);
6539
6710
  }
6540
6711
  return {
6541
6712
  meta: meta,