@hpcc-js/comms 2.99.5 → 2.101.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.es6.js +94 -11
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +94 -11
- 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 +94 -11
- 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/__package__.js.map +1 -1
- package/lib-es6/services/wsCloud.js +55 -3
- package/lib-es6/services/wsCloud.js.map +1 -1
- package/lib-es6/services/wsDali.js +30 -1
- package/lib-es6/services/wsDali.js.map +1 -1
- package/lib-es6/services/wsWorkunits.js +1 -1
- package/lib-es6/services/wsWorkunits.js.map +1 -1
- package/lib-es6/services/wsdl/WsCloud/v1.02/WsCloud.js +20 -0
- package/lib-es6/services/wsdl/WsCloud/v1.02/WsCloud.js.map +1 -0
- package/lib-es6/services/wsdl/WsWorkunits/v2.02/WsWorkunits.js +376 -0
- package/lib-es6/services/wsdl/WsWorkunits/v2.02/WsWorkunits.js.map +1 -0
- package/package.json +3 -2
- package/src/__package__.ts +2 -2
- package/src/services/wsCloud.ts +59 -6
- package/src/services/wsDali.ts +32 -0
- package/src/services/wsWorkunits.ts +1 -1
- package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -0
- package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3157 -0
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types/services/wsCloud.d.ts +3 -3
- package/types/services/wsCloud.d.ts.map +1 -1
- package/types/services/wsDali.d.ts +9 -0
- package/types/services/wsDali.d.ts.map +1 -1
- package/types/services/wsWorkunits.d.ts +1 -1
- package/types/services/wsWorkunits.d.ts.map +1 -1
- package/types/services/wsdl/WsCloud/v1.02/WsCloud.d.ts +47 -0
- package/types/services/wsdl/WsCloud/v1.02/WsCloud.d.ts.map +1 -0
- package/types/services/wsdl/WsWorkunits/v2.02/WsWorkunits.d.ts +2553 -0
- package/types/services/wsdl/WsWorkunits/v2.02/WsWorkunits.d.ts.map +1 -0
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/services/wsCloud.d.ts +2 -2
- package/types-3.4/services/wsDali.d.ts +9 -0
- package/types-3.4/services/wsWorkunits.d.ts +1 -1
- package/types-3.4/services/wsdl/WsCloud/v1.02/WsCloud.d.ts +47 -0
- package/types-3.4/services/wsdl/WsWorkunits/v2.02/WsWorkunits.d.ts +2553 -0
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.
|
|
652
|
-
var BUILD_VERSION = "2.
|
|
651
|
+
var PKG_VERSION = "2.101.0";
|
|
652
|
+
var BUILD_VERSION = "2.108.0";
|
|
653
653
|
|
|
654
654
|
/******************************************************************************
|
|
655
655
|
Copyright (c) Microsoft Corporation.
|
|
@@ -746,7 +746,7 @@
|
|
|
746
746
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
747
747
|
};
|
|
748
748
|
|
|
749
|
-
var logger$
|
|
749
|
+
var logger$6 = util.scopedLogger("comms/connection.ts");
|
|
750
750
|
function instanceOfIOptions(object) {
|
|
751
751
|
return "baseUrl" in object;
|
|
752
752
|
}
|
|
@@ -848,12 +848,12 @@
|
|
|
848
848
|
respondedTimeout -= respondedTick;
|
|
849
849
|
if (respondedTimeout <= 0) {
|
|
850
850
|
clearInterval(progress);
|
|
851
|
-
logger$
|
|
851
|
+
logger$6.error("Request timeout: " + script.src);
|
|
852
852
|
doCallback();
|
|
853
853
|
reject(Error("Request timeout: " + script.src));
|
|
854
854
|
}
|
|
855
855
|
else {
|
|
856
|
-
logger$
|
|
856
|
+
logger$6.debug("Request pending (" + respondedTimeout / 1000 + " sec): " + script.src);
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
}, respondedTick);
|
|
@@ -1545,17 +1545,67 @@
|
|
|
1545
1545
|
var CloudServiceBase = /** @class */ (function (_super) {
|
|
1546
1546
|
__extends(CloudServiceBase, _super);
|
|
1547
1547
|
function CloudServiceBase(optsConnection) {
|
|
1548
|
-
return _super.call(this, optsConnection, "WsCloud", "1") || this;
|
|
1548
|
+
return _super.call(this, optsConnection, "WsCloud", "1.02") || this;
|
|
1549
1549
|
}
|
|
1550
1550
|
CloudServiceBase.prototype.GetPODs = function (request) {
|
|
1551
|
-
return this._connection.send("GetPODs", request);
|
|
1551
|
+
return this._connection.send("GetPODs", request, "json", false, undefined, "GetPODsResponse");
|
|
1552
|
+
};
|
|
1553
|
+
CloudServiceBase.prototype.GetServices = function (request) {
|
|
1554
|
+
return this._connection.send("GetServices", request, "json", false, undefined, "GetServicesResponse");
|
|
1552
1555
|
};
|
|
1553
1556
|
CloudServiceBase.prototype.Ping = function (request) {
|
|
1554
|
-
return this._connection.send("Ping", request);
|
|
1557
|
+
return this._connection.send("Ping", request, "json", false, undefined, "WsCloudPingResponse");
|
|
1555
1558
|
};
|
|
1556
1559
|
return CloudServiceBase;
|
|
1557
1560
|
}(Service));
|
|
1558
1561
|
|
|
1562
|
+
var logger$5 = util.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");
|
|
1563
|
+
function isGetPODsResponse_v1_02(response) {
|
|
1564
|
+
return (response === null || response === void 0 ? void 0 : response.Pods) !== undefined;
|
|
1565
|
+
}
|
|
1566
|
+
function mapPorts(pod) {
|
|
1567
|
+
var _a, _b, _c;
|
|
1568
|
+
return (_c = (_b = (_a = pod.spec) === null || _a === void 0 ? void 0 : _a.containers) === null || _b === void 0 ? void 0 : _b.reduce(function (prev, curr) {
|
|
1569
|
+
var _a;
|
|
1570
|
+
(_a = curr.ports) === null || _a === void 0 ? void 0 : _a.forEach(function (p) {
|
|
1571
|
+
prev.push({
|
|
1572
|
+
ContainerPort: p.containerPort,
|
|
1573
|
+
Name: p.name,
|
|
1574
|
+
Protocol: p.protocol
|
|
1575
|
+
});
|
|
1576
|
+
});
|
|
1577
|
+
return prev;
|
|
1578
|
+
}, [])) !== null && _c !== void 0 ? _c : [];
|
|
1579
|
+
}
|
|
1580
|
+
function mapPods(pods) {
|
|
1581
|
+
return pods
|
|
1582
|
+
.filter(function (pod) {
|
|
1583
|
+
var _a, _b;
|
|
1584
|
+
var labels = (_b = (_a = pod === null || pod === void 0 ? void 0 : pod.metadata) === null || _a === void 0 ? void 0 : _a.labels) !== null && _b !== void 0 ? _b : {};
|
|
1585
|
+
return labels.hasOwnProperty("app.kubernetes.io/part-of") && labels["app.kubernetes.io/part-of"] === "HPCC-Platform";
|
|
1586
|
+
})
|
|
1587
|
+
.map(function (pod) {
|
|
1588
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1589
|
+
var started = new Date((_a = pod.metadata) === null || _a === void 0 ? void 0 : _a.creationTimestamp);
|
|
1590
|
+
return {
|
|
1591
|
+
Name: pod.metadata.name,
|
|
1592
|
+
Status: (_b = pod.status) === null || _b === void 0 ? void 0 : _b.phase,
|
|
1593
|
+
CreationTimestamp: started.toISOString(),
|
|
1594
|
+
ContainerName: (_e = (_d = (_c = pod.status) === null || _c === void 0 ? void 0 : _c.containerStatuses) === null || _d === void 0 ? void 0 : _d.reduce(function (prev, curr) {
|
|
1595
|
+
if (curr.name) {
|
|
1596
|
+
prev.push(curr.name);
|
|
1597
|
+
}
|
|
1598
|
+
return prev;
|
|
1599
|
+
}, []).join(", ")) !== null && _e !== void 0 ? _e : "",
|
|
1600
|
+
ContainerCount: (_h = (_g = (_f = pod.spec) === null || _f === void 0 ? void 0 : _f.containers) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0,
|
|
1601
|
+
ContainerReadyCount: (_k = (_j = pod.status) === null || _j === void 0 ? void 0 : _j.containerStatuses) === null || _k === void 0 ? void 0 : _k.reduce(function (prev, curr) { return prev + (curr.ready ? 1 : 0); }, 0),
|
|
1602
|
+
ContainerRestartCount: (_m = (_l = pod.status) === null || _l === void 0 ? void 0 : _l.containerStatuses) === null || _m === void 0 ? void 0 : _m.reduce(function (prev, curr) { return prev + curr.restartCount; }, 0),
|
|
1603
|
+
Ports: {
|
|
1604
|
+
Port: mapPorts(pod)
|
|
1605
|
+
},
|
|
1606
|
+
};
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1559
1609
|
var CloudService = /** @class */ (function (_super) {
|
|
1560
1610
|
__extends(CloudService, _super);
|
|
1561
1611
|
function CloudService() {
|
|
@@ -1563,12 +1613,16 @@
|
|
|
1563
1613
|
}
|
|
1564
1614
|
CloudService.prototype.getPODs = function () {
|
|
1565
1615
|
return _super.prototype.GetPODs.call(this, {}).then(function (response) {
|
|
1566
|
-
var _a;
|
|
1616
|
+
var _a, _b, _c;
|
|
1617
|
+
if (isGetPODsResponse_v1_02(response)) {
|
|
1618
|
+
return (_b = (_a = response.Pods) === null || _a === void 0 ? void 0 : _a.Pod) !== null && _b !== void 0 ? _b : [];
|
|
1619
|
+
}
|
|
1567
1620
|
try {
|
|
1568
1621
|
var obj = typeof response.Result === "string" ? JSON.parse(response.Result) : response.Result;
|
|
1569
|
-
return (
|
|
1622
|
+
return mapPods((_c = obj === null || obj === void 0 ? void 0 : obj.items) !== null && _c !== void 0 ? _c : []);
|
|
1570
1623
|
}
|
|
1571
1624
|
catch (error) {
|
|
1625
|
+
logger$5.error("Error parsing V1Pods json '".concat(error.message, "'"));
|
|
1572
1626
|
return [];
|
|
1573
1627
|
}
|
|
1574
1628
|
});
|
|
@@ -1702,6 +1756,35 @@
|
|
|
1702
1756
|
function DaliService() {
|
|
1703
1757
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1704
1758
|
}
|
|
1759
|
+
DaliService.prototype.Export = function (request) {
|
|
1760
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1761
|
+
var exportUrl, reqParams, response, filename, content;
|
|
1762
|
+
return __generator(this, function (_a) {
|
|
1763
|
+
switch (_a.label) {
|
|
1764
|
+
case 0:
|
|
1765
|
+
exportUrl = "/WsDali/Export";
|
|
1766
|
+
reqParams = new URLSearchParams();
|
|
1767
|
+
if (request.Path) {
|
|
1768
|
+
reqParams.append("Path", request.Path);
|
|
1769
|
+
}
|
|
1770
|
+
if (request.Safe !== undefined) {
|
|
1771
|
+
reqParams.append("Safe", String(request.Safe));
|
|
1772
|
+
}
|
|
1773
|
+
return [4 /*yield*/, fetch("".concat(exportUrl, "?").concat(reqParams.toString()))];
|
|
1774
|
+
case 1:
|
|
1775
|
+
response = _a.sent();
|
|
1776
|
+
filename = response.headers.get("Content-Disposition");
|
|
1777
|
+
return [4 /*yield*/, response.blob()];
|
|
1778
|
+
case 2:
|
|
1779
|
+
content = _a.sent();
|
|
1780
|
+
return [2 /*return*/, {
|
|
1781
|
+
filename: filename ? filename.split("filename=")[1] : "WsDali_Export",
|
|
1782
|
+
content: content
|
|
1783
|
+
}];
|
|
1784
|
+
}
|
|
1785
|
+
});
|
|
1786
|
+
});
|
|
1787
|
+
};
|
|
1705
1788
|
return DaliService;
|
|
1706
1789
|
}(DaliServiceBase));
|
|
1707
1790
|
|
|
@@ -3041,7 +3124,7 @@
|
|
|
3041
3124
|
var WorkunitsServiceBase = /** @class */ (function (_super) {
|
|
3042
3125
|
__extends(WorkunitsServiceBase, _super);
|
|
3043
3126
|
function WorkunitsServiceBase(optsConnection) {
|
|
3044
|
-
return _super.call(this, optsConnection, "WsWorkunits", "2") || this;
|
|
3127
|
+
return _super.call(this, optsConnection, "WsWorkunits", "2.02") || this;
|
|
3045
3128
|
}
|
|
3046
3129
|
WorkunitsServiceBase.prototype.GVCAjaxGraph = function (request) {
|
|
3047
3130
|
return this._connection.send("GVCAjaxGraph", request, "json", false, undefined, "GVCAjaxGraphResponse");
|