@hpcc-js/comms 2.82.2 → 2.82.3

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
@@ -611,8 +611,8 @@
611
611
  }
612
612
 
613
613
  var PKG_NAME = "@hpcc-js/comms";
614
- var PKG_VERSION = "2.82.2";
615
- var BUILD_VERSION = "2.104.20";
614
+ var PKG_VERSION = "2.82.3";
615
+ var BUILD_VERSION = "2.104.21";
616
616
 
617
617
  /******************************************************************************
618
618
  Copyright (c) Microsoft Corporation.
@@ -2053,134 +2053,156 @@
2053
2053
  };
2054
2054
  LogaccessService.prototype.GetLogsEx = function (request) {
2055
2055
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2056
- var getLogsRequest = {
2057
- Filter: {
2058
- leftBinaryFilter: {
2059
- BinaryLogFilter: [{
2060
- leftFilter: {
2061
- LogCategory: exports.WsLogaccess.LogAccessType.All,
2056
+ return __awaiter(this, void 0, void 0, function () {
2057
+ var logInfo, getLogsRequest, filters, _loop_1, key, binaryLogFilter_1;
2058
+ return __generator(this, function (_l) {
2059
+ switch (_l.label) {
2060
+ case 0: return [4 /*yield*/, this.GetLogAccessInfo()];
2061
+ case 1:
2062
+ logInfo = _l.sent();
2063
+ getLogsRequest = {
2064
+ Filter: {
2065
+ leftBinaryFilter: {
2066
+ BinaryLogFilter: [{
2067
+ leftFilter: {
2068
+ LogCategory: exports.WsLogaccess.LogAccessType.All,
2069
+ },
2070
+ }]
2071
+ }
2062
2072
  },
2063
- }]
2064
- }
2065
- },
2066
- Range: {
2067
- StartDate: new Date(0).toISOString(),
2068
- },
2069
- LogLineStartFrom: (_a = request.LogLineStartFrom) !== null && _a !== void 0 ? _a : 0,
2070
- LogLineLimit: (_b = request.LogLineLimit) !== null && _b !== void 0 ? _b : 100,
2071
- SelectColumnMode: exports.WsLogaccess.LogSelectColumnMode.DEFAULT,
2072
- Format: "JSON"
2073
- };
2074
- var filters = [];
2075
- var _loop_1 = function (key) {
2076
- if (key in ElasticKnownColumns) {
2077
- if (Array.isArray(request[key])) {
2078
- request[key].forEach(function (value) {
2079
- filters.push({
2080
- LogCategory: exports.WsLogaccess.LogAccessType.ByFieldName,
2081
- SearchField: ElasticKnownColumns[key],
2082
- SearchByValue: value
2083
- });
2084
- });
2085
- }
2086
- else {
2087
- filters.push({
2088
- LogCategory: exports.WsLogaccess.LogAccessType.ByFieldName,
2089
- SearchField: ElasticKnownColumns[key],
2090
- SearchByValue: request[key]
2091
- });
2092
- }
2093
- }
2094
- };
2095
- for (var key in request) {
2096
- _loop_1(key);
2097
- }
2098
- if (filters.length > 2) {
2099
- var binaryLogFilter_1 = getLogsRequest.Filter.leftBinaryFilter.BinaryLogFilter[0];
2100
- filters.forEach(function (filter, i) {
2101
- var operator = exports.WsLogaccess.LogAccessFilterOperator.AND;
2102
- if (i > 0) {
2103
- if (filters[i - 1].SearchField === filter.SearchField) {
2104
- operator = exports.WsLogaccess.LogAccessFilterOperator.OR;
2105
- }
2106
- if (i === filters.length - 1) {
2107
- binaryLogFilter_1.Operator = operator;
2108
- binaryLogFilter_1.rightFilter = filter;
2109
- }
2110
- else {
2111
- binaryLogFilter_1.Operator = operator;
2112
- binaryLogFilter_1.rightBinaryFilter = {
2113
- BinaryLogFilter: [{
2114
- leftFilter: filter
2115
- }]
2073
+ Range: {
2074
+ StartDate: new Date(0).toISOString(),
2075
+ },
2076
+ LogLineStartFrom: (_a = request.LogLineStartFrom) !== null && _a !== void 0 ? _a : 0,
2077
+ LogLineLimit: (_b = request.LogLineLimit) !== null && _b !== void 0 ? _b : 100,
2078
+ SelectColumnMode: exports.WsLogaccess.LogSelectColumnMode.DEFAULT,
2079
+ Format: "JSON"
2116
2080
  };
2117
- binaryLogFilter_1 = binaryLogFilter_1.rightBinaryFilter.BinaryLogFilter[0];
2118
- }
2119
- }
2120
- else {
2121
- binaryLogFilter_1.leftFilter = filter;
2081
+ filters = [];
2082
+ _loop_1 = function (key) {
2083
+ var searchField;
2084
+ switch (logInfo.RemoteLogManagerType) {
2085
+ case "azureloganalyticscurl":
2086
+ if (key in AzureKnownColumns) {
2087
+ searchField = AzureKnownColumns[key];
2088
+ }
2089
+ break;
2090
+ case "elasticstack":
2091
+ if (key in ElasticKnownColumns) {
2092
+ searchField = ElasticKnownColumns[key];
2093
+ }
2094
+ break;
2095
+ }
2096
+ if (searchField) {
2097
+ if (Array.isArray(request[key])) {
2098
+ request[key].forEach(function (value) {
2099
+ filters.push({
2100
+ LogCategory: exports.WsLogaccess.LogAccessType.ByFieldName,
2101
+ SearchField: searchField,
2102
+ SearchByValue: value
2103
+ });
2104
+ });
2105
+ }
2106
+ else {
2107
+ filters.push({
2108
+ LogCategory: exports.WsLogaccess.LogAccessType.ByFieldName,
2109
+ SearchField: searchField,
2110
+ SearchByValue: request[key]
2111
+ });
2112
+ }
2113
+ }
2114
+ };
2115
+ for (key in request) {
2116
+ _loop_1(key);
2117
+ }
2118
+ if (filters.length > 2) {
2119
+ binaryLogFilter_1 = getLogsRequest.Filter.leftBinaryFilter.BinaryLogFilter[0];
2120
+ filters.forEach(function (filter, i) {
2121
+ var operator = exports.WsLogaccess.LogAccessFilterOperator.AND;
2122
+ if (i > 0) {
2123
+ if (filters[i - 1].SearchField === filter.SearchField) {
2124
+ operator = exports.WsLogaccess.LogAccessFilterOperator.OR;
2125
+ }
2126
+ if (i === filters.length - 1) {
2127
+ binaryLogFilter_1.Operator = operator;
2128
+ binaryLogFilter_1.rightFilter = filter;
2129
+ }
2130
+ else {
2131
+ binaryLogFilter_1.Operator = operator;
2132
+ binaryLogFilter_1.rightBinaryFilter = {
2133
+ BinaryLogFilter: [{
2134
+ leftFilter: filter
2135
+ }]
2136
+ };
2137
+ binaryLogFilter_1 = binaryLogFilter_1.rightBinaryFilter.BinaryLogFilter[0];
2138
+ }
2139
+ }
2140
+ else {
2141
+ binaryLogFilter_1.leftFilter = filter;
2142
+ }
2143
+ });
2144
+ }
2145
+ else {
2146
+ delete getLogsRequest.Filter.leftBinaryFilter;
2147
+ getLogsRequest.Filter.leftFilter = {
2148
+ LogCategory: exports.WsLogaccess.LogAccessType.All
2149
+ };
2150
+ if ((_c = filters[0]) === null || _c === void 0 ? void 0 : _c.SearchField) {
2151
+ getLogsRequest.Filter.leftFilter = {
2152
+ LogCategory: (_d = filters[0]) === null || _d === void 0 ? void 0 : _d.LogCategory,
2153
+ SearchField: (_e = filters[0]) === null || _e === void 0 ? void 0 : _e.SearchField,
2154
+ SearchByValue: (_f = filters[0]) === null || _f === void 0 ? void 0 : _f.SearchByValue
2155
+ };
2156
+ }
2157
+ if ((_g = filters[1]) === null || _g === void 0 ? void 0 : _g.SearchField) {
2158
+ getLogsRequest.Filter.Operator = exports.WsLogaccess.LogAccessFilterOperator.AND;
2159
+ if (filters[0].SearchField === filters[1].SearchField) {
2160
+ getLogsRequest.Filter.Operator = exports.WsLogaccess.LogAccessFilterOperator.OR;
2161
+ }
2162
+ getLogsRequest.Filter.rightFilter = {
2163
+ LogCategory: (_h = filters[0]) === null || _h === void 0 ? void 0 : _h.LogCategory,
2164
+ SearchField: (_j = filters[1]) === null || _j === void 0 ? void 0 : _j.SearchField,
2165
+ SearchByValue: (_k = filters[1]) === null || _k === void 0 ? void 0 : _k.SearchByValue
2166
+ };
2167
+ }
2168
+ }
2169
+ if (request.StartDate) {
2170
+ getLogsRequest.Range.StartDate = request.StartDate.toISOString();
2171
+ }
2172
+ if (request.EndDate) {
2173
+ getLogsRequest.Range.EndDate = request.EndDate.toISOString();
2174
+ }
2175
+ return [2 /*return*/, this.GetLogs(getLogsRequest).then(function (response) {
2176
+ var _a, _b, _c, _d, _e;
2177
+ try {
2178
+ var logLines = JSON.parse(response.LogLines);
2179
+ var lines = [];
2180
+ switch (logInfo.RemoteLogManagerType) {
2181
+ case "azureloganalyticscurl":
2182
+ lines = (_b = (_a = logLines.lines) === null || _a === void 0 ? void 0 : _a.map(azureToLogLine)) !== null && _b !== void 0 ? _b : [];
2183
+ break;
2184
+ case "elasticstack":
2185
+ lines = (_d = (_c = logLines.lines) === null || _c === void 0 ? void 0 : _c.map(elasticToLogLine)) !== null && _d !== void 0 ? _d : [];
2186
+ break;
2187
+ default:
2188
+ logger$2.warning("Unknown RemoteLogManagerType: ".concat(logInfo.RemoteLogManagerType));
2189
+ lines = [];
2190
+ }
2191
+ return {
2192
+ lines: lines,
2193
+ total: (_e = response.TotalLogLinesAvailable) !== null && _e !== void 0 ? _e : 10000
2194
+ };
2195
+ }
2196
+ catch (e) {
2197
+ logger$2.error(e);
2198
+ }
2199
+ return {
2200
+ lines: [],
2201
+ total: 0
2202
+ };
2203
+ })];
2122
2204
  }
2123
2205
  });
2124
- }
2125
- else {
2126
- delete getLogsRequest.Filter.leftBinaryFilter;
2127
- getLogsRequest.Filter.leftFilter = {
2128
- LogCategory: exports.WsLogaccess.LogAccessType.All
2129
- };
2130
- if ((_c = filters[0]) === null || _c === void 0 ? void 0 : _c.SearchField) {
2131
- getLogsRequest.Filter.leftFilter = {
2132
- LogCategory: (_d = filters[0]) === null || _d === void 0 ? void 0 : _d.LogCategory,
2133
- SearchField: (_e = filters[0]) === null || _e === void 0 ? void 0 : _e.SearchField,
2134
- SearchByValue: (_f = filters[0]) === null || _f === void 0 ? void 0 : _f.SearchByValue
2135
- };
2136
- }
2137
- if ((_g = filters[1]) === null || _g === void 0 ? void 0 : _g.SearchField) {
2138
- getLogsRequest.Filter.Operator = exports.WsLogaccess.LogAccessFilterOperator.AND;
2139
- if (filters[0].SearchField === filters[1].SearchField) {
2140
- getLogsRequest.Filter.Operator = exports.WsLogaccess.LogAccessFilterOperator.OR;
2141
- }
2142
- getLogsRequest.Filter.rightFilter = {
2143
- LogCategory: (_h = filters[0]) === null || _h === void 0 ? void 0 : _h.LogCategory,
2144
- SearchField: (_j = filters[1]) === null || _j === void 0 ? void 0 : _j.SearchField,
2145
- SearchByValue: (_k = filters[1]) === null || _k === void 0 ? void 0 : _k.SearchByValue
2146
- };
2147
- }
2148
- }
2149
- if (request.StartDate) {
2150
- getLogsRequest.Range.StartDate = request.StartDate.toISOString();
2151
- }
2152
- if (request.EndDate) {
2153
- getLogsRequest.Range.EndDate = request.EndDate.toISOString();
2154
- }
2155
- return Promise.all([this.GetLogAccessInfo(), this.GetLogs(getLogsRequest)]).then(function (_a) {
2156
- var _b, _c, _d, _e, _f;
2157
- var info = _a[0], response = _a[1];
2158
- try {
2159
- var logLines = JSON.parse(response.LogLines);
2160
- var lines = [];
2161
- switch (info.RemoteLogManagerType) {
2162
- case "azureloganalyticscurl":
2163
- lines = (_c = (_b = logLines.lines) === null || _b === void 0 ? void 0 : _b.map(azureToLogLine)) !== null && _c !== void 0 ? _c : [];
2164
- break;
2165
- case "elasticstack":
2166
- lines = (_e = (_d = logLines.lines) === null || _d === void 0 ? void 0 : _d.map(elasticToLogLine)) !== null && _e !== void 0 ? _e : [];
2167
- break;
2168
- default:
2169
- logger$2.warning("Unknown RemoteLogManagerType: ".concat(info.RemoteLogManagerType));
2170
- lines = [];
2171
- }
2172
- return {
2173
- lines: lines,
2174
- total: (_f = response.TotalLogLinesAvailable) !== null && _f !== void 0 ? _f : 10000
2175
- };
2176
- }
2177
- catch (e) {
2178
- logger$2.error(e);
2179
- }
2180
- return {
2181
- lines: [],
2182
- total: 0
2183
- };
2184
2206
  });
2185
2207
  };
2186
2208
  return LogaccessService;
@@ -7461,6 +7483,27 @@
7461
7483
  });
7462
7484
  return retVal;
7463
7485
  };
7486
+ Query.prototype.fetchDetails = function () {
7487
+ return __awaiter(this, void 0, void 0, function () {
7488
+ var queryDetails;
7489
+ return __generator(this, function (_a) {
7490
+ switch (_a.label) {
7491
+ case 0: return [4 /*yield*/, this._wsWorkunits.WUQueryDetails({
7492
+ QuerySet: this.QuerySet,
7493
+ QueryId: this.QueryId,
7494
+ IncludeStateOnClusters: false,
7495
+ IncludeSuperFiles: false,
7496
+ IncludeWsEclAddresses: false,
7497
+ CheckAllNodes: false
7498
+ })];
7499
+ case 1:
7500
+ queryDetails = _a.sent();
7501
+ this.set(__assign({}, queryDetails));
7502
+ return [2 /*return*/];
7503
+ }
7504
+ });
7505
+ });
7506
+ };
7464
7507
  Query.prototype.fetchRequestSchema = function () {
7465
7508
  return __awaiter(this, void 0, void 0, function () {
7466
7509
  var _a;
@@ -7516,9 +7559,16 @@
7516
7559
  };
7517
7560
  Query.prototype.refresh = function () {
7518
7561
  return __awaiter(this, void 0, void 0, function () {
7519
- var _this = this;
7520
7562
  return __generator(this, function (_a) {
7521
- return [2 /*return*/, this.fetchSchema().then(function (schema) { return _this; })];
7563
+ switch (_a.label) {
7564
+ case 0: return [4 /*yield*/, Promise.all([
7565
+ this.fetchDetails(),
7566
+ this.fetchSchema()
7567
+ ])];
7568
+ case 1:
7569
+ _a.sent();
7570
+ return [2 /*return*/, this];
7571
+ }
7522
7572
  });
7523
7573
  });
7524
7574
  };