@hpcc-js/comms 2.82.1 → 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.
Files changed (123) hide show
  1. package/dist/index.es6.js +744 -100
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +745 -99
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist/index.node.js +745 -99
  8. package/dist/index.node.js.map +1 -1
  9. package/dist/index.node.min.js +1 -1
  10. package/dist/index.node.min.js.map +1 -1
  11. package/lib-es6/__package__.js +2 -2
  12. package/lib-es6/ecl/dfuWorkunit.js +528 -0
  13. package/lib-es6/ecl/dfuWorkunit.js.map +1 -0
  14. package/lib-es6/ecl/query.js +30 -2
  15. package/lib-es6/ecl/query.js.map +1 -1
  16. package/lib-es6/ecl/workunit.js +2 -2
  17. package/lib-es6/ecl/workunit.js.map +1 -1
  18. package/lib-es6/index-common.js +1 -0
  19. package/lib-es6/index-common.js.map +1 -1
  20. package/lib-es6/services/fileSpray.js +9 -0
  21. package/lib-es6/services/fileSpray.js.map +1 -1
  22. package/lib-es6/services/wsLogaccess.js +151 -81
  23. package/lib-es6/services/wsLogaccess.js.map +1 -1
  24. package/lib-es6/services/wsdl/ws_logaccess/v1.04/ws_logaccess.js +85 -0
  25. package/lib-es6/services/wsdl/ws_logaccess/v1.04/ws_logaccess.js.map +1 -0
  26. package/package.json +6 -6
  27. package/src/__package__.ts +2 -2
  28. package/src/ecl/dfuWorkunit.ts +306 -0
  29. package/src/ecl/query.ts +17 -1
  30. package/src/ecl/workunit.ts +2 -2
  31. package/src/index-common.ts +1 -0
  32. package/src/services/fileSpray.ts +108 -0
  33. package/src/services/wsLogaccess.ts +89 -31
  34. package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -0
  35. package/types/__package__.d.ts +2 -2
  36. package/types/connection.d.ts +5 -5
  37. package/types/connection.d.ts.map +1 -1
  38. package/types/ecl/activity.d.ts +3 -3
  39. package/types/ecl/activity.d.ts.map +1 -1
  40. package/types/ecl/dfuWorkunit.d.ts +95 -0
  41. package/types/ecl/dfuWorkunit.d.ts.map +1 -0
  42. package/types/ecl/query.d.ts +1 -0
  43. package/types/ecl/query.d.ts.map +1 -1
  44. package/types/ecl/result.d.ts +3 -3
  45. package/types/ecl/result.d.ts.map +1 -1
  46. package/types/ecl/targetCluster.d.ts +2 -2
  47. package/types/ecl/targetCluster.d.ts.map +1 -1
  48. package/types/ecl/workunit.d.ts +4 -4
  49. package/types/ecl/workunit.d.ts.map +1 -1
  50. package/types/espConnection.d.ts +1 -1
  51. package/types/espConnection.d.ts.map +1 -1
  52. package/types/index-common.d.ts +1 -0
  53. package/types/index-common.d.ts.map +1 -1
  54. package/types/services/fileSpray.d.ts +95 -0
  55. package/types/services/fileSpray.d.ts.map +1 -1
  56. package/types/services/wsDFU.d.ts +1 -1
  57. package/types/services/wsDFU.d.ts.map +1 -1
  58. package/types/services/wsEcl.d.ts +5 -5
  59. package/types/services/wsEcl.d.ts.map +1 -1
  60. package/types/services/wsLogaccess.d.ts +3 -3
  61. package/types/services/wsLogaccess.d.ts.map +1 -1
  62. package/types/services/wsdl/FileSpray/v1.23/FileSpray.d.ts +5 -5
  63. package/types/services/wsdl/FileSpray/v1.23/FileSpray.d.ts.map +1 -1
  64. package/types/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.d.ts +2 -2
  65. package/types/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.d.ts.map +1 -1
  66. package/types/services/wsdl/WsDfu/v1.62/WsDfu.d.ts +4 -4
  67. package/types/services/wsdl/WsDfu/v1.62/WsDfu.d.ts.map +1 -1
  68. package/types/services/wsdl/WsFileIO/v1.01/WsFileIO.d.ts +2 -2
  69. package/types/services/wsdl/WsFileIO/v1.01/WsFileIO.d.ts.map +1 -1
  70. package/types/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.d.ts +1 -1
  71. package/types/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.d.ts.map +1 -1
  72. package/types/services/wsdl/WsResources/v1.01/WsResources.d.ts +1 -1
  73. package/types/services/wsdl/WsResources/v1.01/WsResources.d.ts.map +1 -1
  74. package/types/services/wsdl/WsSMC/v1.24/WsSMC.d.ts +3 -3
  75. package/types/services/wsdl/WsSMC/v1.24/WsSMC.d.ts.map +1 -1
  76. package/types/services/wsdl/WsTopology/v1.31/WsTopology.d.ts +4 -4
  77. package/types/services/wsdl/WsTopology/v1.31/WsTopology.d.ts.map +1 -1
  78. package/types/services/wsdl/WsWorkunits/v1.88/WsWorkunits.d.ts +8 -8
  79. package/types/services/wsdl/WsWorkunits/v1.88/WsWorkunits.d.ts.map +1 -1
  80. package/types/services/wsdl/ws_access/v1.16/ws_access.d.ts +4 -4
  81. package/types/services/wsdl/ws_access/v1.16/ws_access.d.ts.map +1 -1
  82. package/types/services/wsdl/ws_account/v1.05/ws_account.d.ts +1 -1
  83. package/types/services/wsdl/ws_account/v1.05/ws_account.d.ts.map +1 -1
  84. package/types/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts +1 -1
  85. package/types/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts.map +1 -1
  86. package/types/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts +3 -3
  87. package/types/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts.map +1 -1
  88. package/types/services/wsdl/ws_logaccess/v1.04/ws_logaccess.d.ts +171 -0
  89. package/types/services/wsdl/ws_logaccess/v1.04/ws_logaccess.d.ts.map +1 -0
  90. package/types/services/wsdl/ws_machine/v1.17/ws_machine.d.ts +3 -3
  91. package/types/services/wsdl/ws_machine/v1.17/ws_machine.d.ts.map +1 -1
  92. package/types/services/wsdl/wsstore/v1.02/wsstore.d.ts +1 -1
  93. package/types/services/wsdl/wsstore/v1.02/wsstore.d.ts.map +1 -1
  94. package/types-3.4/__package__.d.ts +2 -2
  95. package/types-3.4/connection.d.ts +5 -5
  96. package/types-3.4/ecl/activity.d.ts +3 -3
  97. package/types-3.4/ecl/dfuWorkunit.d.ts +95 -0
  98. package/types-3.4/ecl/query.d.ts +1 -0
  99. package/types-3.4/ecl/result.d.ts +3 -3
  100. package/types-3.4/ecl/targetCluster.d.ts +2 -2
  101. package/types-3.4/ecl/workunit.d.ts +4 -4
  102. package/types-3.4/espConnection.d.ts +1 -1
  103. package/types-3.4/index-common.d.ts +1 -0
  104. package/types-3.4/services/fileSpray.d.ts +95 -0
  105. package/types-3.4/services/wsDFU.d.ts +1 -1
  106. package/types-3.4/services/wsEcl.d.ts +5 -5
  107. package/types-3.4/services/wsLogaccess.d.ts +3 -3
  108. package/types-3.4/services/wsdl/FileSpray/v1.23/FileSpray.d.ts +5 -5
  109. package/types-3.4/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.d.ts +2 -2
  110. package/types-3.4/services/wsdl/WsDfu/v1.62/WsDfu.d.ts +4 -4
  111. package/types-3.4/services/wsdl/WsFileIO/v1.01/WsFileIO.d.ts +2 -2
  112. package/types-3.4/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.d.ts +1 -1
  113. package/types-3.4/services/wsdl/WsResources/v1.01/WsResources.d.ts +1 -1
  114. package/types-3.4/services/wsdl/WsSMC/v1.24/WsSMC.d.ts +3 -3
  115. package/types-3.4/services/wsdl/WsTopology/v1.31/WsTopology.d.ts +4 -4
  116. package/types-3.4/services/wsdl/WsWorkunits/v1.88/WsWorkunits.d.ts +8 -8
  117. package/types-3.4/services/wsdl/ws_access/v1.16/ws_access.d.ts +4 -4
  118. package/types-3.4/services/wsdl/ws_account/v1.05/ws_account.d.ts +1 -1
  119. package/types-3.4/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts +1 -1
  120. package/types-3.4/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts +3 -3
  121. package/types-3.4/services/wsdl/ws_logaccess/v1.04/ws_logaccess.d.ts +171 -0
  122. package/types-3.4/services/wsdl/ws_machine/v1.17/ws_machine.d.ts +3 -3
  123. package/types-3.4/services/wsdl/wsstore/v1.02/wsstore.d.ts +1 -1
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.1";
615
- var BUILD_VERSION = "2.104.18";
614
+ var PKG_VERSION = "2.82.3";
615
+ var BUILD_VERSION = "2.104.21";
616
616
 
617
617
  /******************************************************************************
618
618
  Copyright (c) Microsoft Corporation.
@@ -704,7 +704,7 @@
704
704
  return to.concat(ar || Array.prototype.slice.call(from));
705
705
  }
706
706
 
707
- var logger$2 = util.scopedLogger("comms/connection.ts");
707
+ var logger$3 = util.scopedLogger("comms/connection.ts");
708
708
  function instanceOfIOptions(object) {
709
709
  return "baseUrl" in object;
710
710
  }
@@ -806,12 +806,12 @@
806
806
  respondedTimeout -= respondedTick;
807
807
  if (respondedTimeout <= 0) {
808
808
  clearInterval(progress);
809
- logger$2.error("Request timeout: " + script.src);
809
+ logger$3.error("Request timeout: " + script.src);
810
810
  doCallback();
811
811
  reject(Error("Request timeout: " + script.src));
812
812
  }
813
813
  else {
814
- logger$2.debug("Request pending (" + respondedTimeout / 1000 + " sec): " + script.src);
814
+ logger$3.debug("Request pending (" + respondedTimeout / 1000 + " sec): " + script.src);
815
815
  }
816
816
  }
817
817
  }, respondedTick);
@@ -1201,6 +1201,15 @@
1201
1201
  function FileSprayService() {
1202
1202
  return _super !== null && _super.apply(this, arguments) || this;
1203
1203
  }
1204
+ FileSprayService.prototype.SprayFixedEx = function (request) {
1205
+ return this._connection.send("SprayFixed", request);
1206
+ };
1207
+ FileSprayService.prototype.SprayVariableEx = function (request) {
1208
+ return this._connection.send("SprayVariable", request, "json", false, null, "SprayResponse");
1209
+ };
1210
+ FileSprayService.prototype.DesprayEx = function (request) {
1211
+ return this._connection.send("Despray", request);
1212
+ };
1204
1213
  return FileSprayService;
1205
1214
  }(FileSprayServiceBase));
1206
1215
 
@@ -1901,6 +1910,26 @@
1901
1910
 
1902
1911
  exports.WsLogaccess = void 0;
1903
1912
  (function (WsLogaccess) {
1913
+ (function (LogColumnType) {
1914
+ LogColumnType["global"] = "global";
1915
+ LogColumnType["workunits"] = "workunits";
1916
+ LogColumnType["components"] = "components";
1917
+ LogColumnType["audience"] = "audience";
1918
+ LogColumnType["class"] = "class";
1919
+ LogColumnType["instance"] = "instance";
1920
+ LogColumnType["node"] = "node";
1921
+ LogColumnType["message"] = "message";
1922
+ LogColumnType["logid"] = "logid";
1923
+ LogColumnType["processid"] = "processid";
1924
+ LogColumnType["threadid"] = "threadid";
1925
+ LogColumnType["timestamp"] = "timestamp";
1926
+ })(WsLogaccess.LogColumnType || (WsLogaccess.LogColumnType = {}));
1927
+ (function (LogColumnValueType) {
1928
+ LogColumnValueType["string"] = "string";
1929
+ LogColumnValueType["numeric"] = "numeric";
1930
+ LogColumnValueType["datetime"] = "datetime";
1931
+ LogColumnValueType["enum"] = "enum";
1932
+ })(WsLogaccess.LogColumnValueType || (WsLogaccess.LogColumnValueType = {}));
1904
1933
  (function (LogAccessType) {
1905
1934
  LogAccessType[LogAccessType["All"] = 0] = "All";
1906
1935
  LogAccessType[LogAccessType["ByJobID"] = 1] = "ByJobID";
@@ -1940,7 +1969,7 @@
1940
1969
  var LogaccessServiceBase = /** @class */ (function (_super) {
1941
1970
  __extends(LogaccessServiceBase, _super);
1942
1971
  function LogaccessServiceBase(optsConnection) {
1943
- return _super.call(this, optsConnection, "ws_logaccess", "1.03") || this;
1972
+ return _super.call(this, optsConnection, "ws_logaccess", "1.04") || this;
1944
1973
  }
1945
1974
  LogaccessServiceBase.prototype.GetLogAccessInfo = function (request) {
1946
1975
  return this._connection.send("GetLogAccessInfo", request, "json", false, undefined, "GetLogAccessInfoResponse");
@@ -1954,7 +1983,7 @@
1954
1983
  return LogaccessServiceBase;
1955
1984
  }(Service));
1956
1985
 
1957
- var logger$1 = util.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");
1986
+ var logger$2 = util.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");
1958
1987
  var ElasticKnownColumns;
1959
1988
  (function (ElasticKnownColumns) {
1960
1989
  ElasticKnownColumns["audience"] = "hpcc.log.audience";
@@ -2023,87 +2052,157 @@
2023
2052
  return _super.prototype.GetLogs.call(this, request);
2024
2053
  };
2025
2054
  LogaccessService.prototype.GetLogsEx = function (request) {
2026
- var _a, _b;
2027
- var getLogsRequest = {
2028
- Filter: {
2029
- leftBinaryFilter: {
2030
- BinaryLogFilter: [{
2031
- leftFilter: {
2032
- LogCategory: exports.WsLogaccess.LogAccessType.All,
2055
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
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
+ }
2033
2072
  },
2034
- }]
2035
- }
2036
- },
2037
- Range: {
2038
- StartDate: new Date(0).toISOString(),
2039
- },
2040
- LogLineStartFrom: (_a = request.LogLineStartFrom) !== null && _a !== void 0 ? _a : 0,
2041
- LogLineLimit: (_b = request.LogLineLimit) !== null && _b !== void 0 ? _b : 100,
2042
- SelectColumnMode: exports.WsLogaccess.LogSelectColumnMode.DEFAULT,
2043
- Format: "JSON"
2044
- };
2045
- var filters = [];
2046
- for (var key in request) {
2047
- if (key in ElasticKnownColumns) {
2048
- filters.push({
2049
- LogCategory: exports.WsLogaccess.LogAccessType.ByFieldName,
2050
- SearchField: ElasticKnownColumns[key],
2051
- SearchByValue: request[key]
2052
- });
2053
- }
2054
- }
2055
- var binaryLogFilter = getLogsRequest.Filter.leftBinaryFilter.BinaryLogFilter[0];
2056
- filters.forEach(function (filter, i) {
2057
- if (i === 0) {
2058
- binaryLogFilter.leftFilter = filter;
2059
- }
2060
- else if (i === filters.length - 1) {
2061
- binaryLogFilter.Operator = exports.WsLogaccess.LogAccessFilterOperator.AND;
2062
- binaryLogFilter.rightFilter = filter;
2063
- }
2064
- else {
2065
- binaryLogFilter.Operator = exports.WsLogaccess.LogAccessFilterOperator.AND;
2066
- binaryLogFilter.rightBinaryFilter = {
2067
- BinaryLogFilter: [{
2068
- leftFilter: filter
2069
- }]
2070
- };
2071
- binaryLogFilter = binaryLogFilter.rightBinaryFilter.BinaryLogFilter[0];
2072
- }
2073
- });
2074
- if (request.StartDate && request.EndDate) {
2075
- getLogsRequest.Range.StartDate = request.StartDate.toISOString();
2076
- getLogsRequest.Range.EndDate = request.EndDate.toISOString();
2077
- }
2078
- return Promise.all([this.GetLogAccessInfo(), this.GetLogs(getLogsRequest)]).then(function (_a) {
2079
- var _b, _c, _d, _e;
2080
- var info = _a[0], response = _a[1];
2081
- try {
2082
- var logLines = JSON.parse(response.LogLines);
2083
- var lines = [];
2084
- switch (info.RemoteLogManagerType) {
2085
- case "azureloganalyticscurl":
2086
- lines = (_c = (_b = logLines.lines) === null || _b === void 0 ? void 0 : _b.map(azureToLogLine)) !== null && _c !== void 0 ? _c : [];
2087
- break;
2088
- case "elasticstack":
2089
- lines = (_e = (_d = logLines.lines) === null || _d === void 0 ? void 0 : _d.map(elasticToLogLine)) !== null && _e !== void 0 ? _e : [];
2090
- break;
2091
- default:
2092
- logger$1.warning("Unknown RemoteLogManagerType: ".concat(info.RemoteLogManagerType));
2093
- lines = [];
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"
2080
+ };
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
+ })];
2094
2204
  }
2095
- return {
2096
- lines: lines,
2097
- total: response.TotalLogLinesAvailable || 10000
2098
- };
2099
- }
2100
- catch (e) {
2101
- logger$1.error(e);
2102
- }
2103
- return {
2104
- lines: [],
2105
- total: 0
2106
- };
2205
+ });
2107
2206
  });
2108
2207
  };
2109
2208
  return LogaccessService;
@@ -5161,7 +5260,7 @@
5161
5260
 
5162
5261
  var formatter = utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");
5163
5262
  var parser = utcParse("%Y-%m-%dT%H:%M:%S.%LZ");
5164
- var logger = util.scopedLogger("workunit.ts");
5263
+ var logger$1 = util.scopedLogger("workunit.ts");
5165
5264
  var WUStateID = exports.WUStateID;
5166
5265
  var WorkunitCache = /** @class */ (function (_super) {
5167
5266
  __extends(WorkunitCache, _super);
@@ -5172,7 +5271,7 @@
5172
5271
  }
5173
5272
  return WorkunitCache;
5174
5273
  }(util.Cache));
5175
- var _workunits = new WorkunitCache();
5274
+ var _workunits$1 = new WorkunitCache();
5176
5275
  var Workunit = /** @class */ (function (_super) {
5177
5276
  __extends(Workunit, _super);
5178
5277
  // --- --- ---
@@ -5654,13 +5753,13 @@
5654
5753
  Workunit.create = function (optsConnection) {
5655
5754
  var retVal = new Workunit(optsConnection);
5656
5755
  return retVal.connection.WUCreate().then(function (response) {
5657
- _workunits.set(retVal);
5756
+ _workunits$1.set(retVal);
5658
5757
  retVal.set(response.Workunit);
5659
5758
  return retVal;
5660
5759
  });
5661
5760
  };
5662
5761
  Workunit.attach = function (optsConnection, wuid, state) {
5663
- var retVal = _workunits.get({ BaseUrl: optsConnection.baseUrl, Wuid: wuid }, function () {
5762
+ var retVal = _workunits$1.get({ BaseUrl: optsConnection.baseUrl, Wuid: wuid }, function () {
5664
5763
  return new Workunit(optsConnection, wuid);
5665
5764
  });
5666
5765
  if (state) {
@@ -5669,7 +5768,7 @@
5669
5768
  return retVal;
5670
5769
  };
5671
5770
  Workunit.existsLocal = function (baseUrl, wuid) {
5672
- return _workunits.has({ BaseUrl: baseUrl, Wuid: wuid });
5771
+ return _workunits$1.has({ BaseUrl: baseUrl, Wuid: wuid });
5673
5772
  };
5674
5773
  Workunit.submit = function (server, target, ecl, compileOnly) {
5675
5774
  if (compileOnly === void 0) { compileOnly = false; }
@@ -6188,8 +6287,8 @@
6188
6287
  }
6189
6288
  _super.prototype._monitor.call(this);
6190
6289
  };
6191
- Workunit.prototype._monitorTimeoutDuraction = function () {
6192
- var retVal = _super.prototype._monitorTimeoutDuraction.call(this);
6290
+ Workunit.prototype._monitorTimeoutDuration = function () {
6291
+ var retVal = _super.prototype._monitorTimeoutDuration.call(this);
6193
6292
  if (this._monitorTickCount <= 1) { // Once
6194
6293
  return 1000;
6195
6294
  }
@@ -6277,7 +6376,7 @@
6277
6376
  return false;
6278
6377
  });
6279
6378
  if (!wuMissing) {
6280
- logger.warning("Unexpected exception: ");
6379
+ logger$1.warning("Unexpected exception: ");
6281
6380
  throw e;
6282
6381
  }
6283
6382
  return {};
@@ -6287,7 +6386,7 @@
6287
6386
  var _this = this;
6288
6387
  return this.connection.WUCreate().then(function (response) {
6289
6388
  _this.set(response.Workunit);
6290
- _workunits.set(_this);
6389
+ _workunits$1.set(_this);
6291
6390
  return response;
6292
6391
  });
6293
6392
  };
@@ -6314,7 +6413,7 @@
6314
6413
  return false;
6315
6414
  });
6316
6415
  if (!wuMissing) {
6317
- logger.warning("Unexpected exception: ");
6416
+ logger$1.warning("Unexpected exception: ");
6318
6417
  throw e;
6319
6418
  }
6320
6419
  return {};
@@ -6403,7 +6502,7 @@
6403
6502
  }
6404
6503
  return new util.XMLNode(command);
6405
6504
  }).catch(function (_) {
6406
- logger.error(_);
6505
+ logger$1.error(_);
6407
6506
  return Promise.resolve(new util.XMLNode(command));
6408
6507
  });
6409
6508
  };
@@ -7384,6 +7483,27 @@
7384
7483
  });
7385
7484
  return retVal;
7386
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
+ };
7387
7507
  Query.prototype.fetchRequestSchema = function () {
7388
7508
  return __awaiter(this, void 0, void 0, function () {
7389
7509
  var _a;
@@ -7439,9 +7559,16 @@
7439
7559
  };
7440
7560
  Query.prototype.refresh = function () {
7441
7561
  return __awaiter(this, void 0, void 0, function () {
7442
- var _this = this;
7443
7562
  return __generator(this, function (_a) {
7444
- 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
+ }
7445
7572
  });
7446
7573
  });
7447
7574
  };
@@ -7965,6 +8092,523 @@
7965
8092
  return Topology;
7966
8093
  }(util.StateObject));
7967
8094
 
8095
+ var logger = util.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts");
8096
+ var States;
8097
+ (function (States) {
8098
+ States[States["Unknown"] = 0] = "Unknown";
8099
+ States[States["Scheduled"] = 1] = "Scheduled";
8100
+ States[States["Queued"] = 2] = "Queued";
8101
+ States[States["Started"] = 3] = "Started";
8102
+ States[States["Aborted"] = 4] = "Aborted";
8103
+ States[States["Failed"] = 5] = "Failed";
8104
+ States[States["Finished"] = 6] = "Finished";
8105
+ States[States["Monitoring"] = 7] = "Monitoring";
8106
+ States[States["Aborting"] = 8] = "Aborting";
8107
+ States[States["NotFound"] = 999] = "NotFound";
8108
+ })(States || (States = {}));
8109
+ var DFUWorkunitCache = /** @class */ (function (_super) {
8110
+ __extends(DFUWorkunitCache, _super);
8111
+ function DFUWorkunitCache() {
8112
+ return _super.call(this, function (obj) {
8113
+ return "".concat(obj.BaseUrl, "-").concat(obj.ID);
8114
+ }) || this;
8115
+ }
8116
+ return DFUWorkunitCache;
8117
+ }(util.Cache));
8118
+ var _workunits = new DFUWorkunitCache();
8119
+ var DFUWorkunit = /** @class */ (function (_super) {
8120
+ __extends(DFUWorkunit, _super);
8121
+ // --- --- ---
8122
+ function DFUWorkunit(optsConnection, wuid) {
8123
+ var _this = _super.call(this) || this;
8124
+ _this.connection = new FileSprayService(optsConnection);
8125
+ _this.topologyConnection = new TopologyService(optsConnection);
8126
+ _this.clearState(wuid);
8127
+ return _this;
8128
+ }
8129
+ Object.defineProperty(DFUWorkunit.prototype, "BaseUrl", {
8130
+ get: function () { return this.connection.baseUrl; },
8131
+ enumerable: false,
8132
+ configurable: true
8133
+ });
8134
+ Object.defineProperty(DFUWorkunit.prototype, "properties", {
8135
+ // Accessors ---
8136
+ get: function () { return this.get(); },
8137
+ enumerable: false,
8138
+ configurable: true
8139
+ });
8140
+ Object.defineProperty(DFUWorkunit.prototype, "ID", {
8141
+ get: function () { return this.get("ID"); },
8142
+ enumerable: false,
8143
+ configurable: true
8144
+ });
8145
+ Object.defineProperty(DFUWorkunit.prototype, "DFUServerName", {
8146
+ get: function () { return this.get("DFUServerName"); },
8147
+ enumerable: false,
8148
+ configurable: true
8149
+ });
8150
+ Object.defineProperty(DFUWorkunit.prototype, "ClusterName", {
8151
+ get: function () { return this.get("ClusterName"); },
8152
+ enumerable: false,
8153
+ configurable: true
8154
+ });
8155
+ Object.defineProperty(DFUWorkunit.prototype, "JobName", {
8156
+ get: function () { return this.get("JobName"); },
8157
+ enumerable: false,
8158
+ configurable: true
8159
+ });
8160
+ Object.defineProperty(DFUWorkunit.prototype, "Queue", {
8161
+ get: function () { return this.get("Queue"); },
8162
+ enumerable: false,
8163
+ configurable: true
8164
+ });
8165
+ Object.defineProperty(DFUWorkunit.prototype, "User", {
8166
+ get: function () { return this.get("User"); },
8167
+ enumerable: false,
8168
+ configurable: true
8169
+ });
8170
+ Object.defineProperty(DFUWorkunit.prototype, "isProtected", {
8171
+ get: function () { return this.get("isProtected"); },
8172
+ enumerable: false,
8173
+ configurable: true
8174
+ });
8175
+ Object.defineProperty(DFUWorkunit.prototype, "Command", {
8176
+ get: function () { return this.get("Command"); },
8177
+ enumerable: false,
8178
+ configurable: true
8179
+ });
8180
+ Object.defineProperty(DFUWorkunit.prototype, "CommandMessage", {
8181
+ get: function () { return this.get("CommandMessage"); },
8182
+ enumerable: false,
8183
+ configurable: true
8184
+ });
8185
+ Object.defineProperty(DFUWorkunit.prototype, "PercentDone", {
8186
+ get: function () { return this.get("PercentDone"); },
8187
+ enumerable: false,
8188
+ configurable: true
8189
+ });
8190
+ Object.defineProperty(DFUWorkunit.prototype, "SecsLeft", {
8191
+ get: function () { return this.get("SecsLeft"); },
8192
+ enumerable: false,
8193
+ configurable: true
8194
+ });
8195
+ Object.defineProperty(DFUWorkunit.prototype, "ProgressMessage", {
8196
+ get: function () { return this.get("ProgressMessage"); },
8197
+ enumerable: false,
8198
+ configurable: true
8199
+ });
8200
+ Object.defineProperty(DFUWorkunit.prototype, "SummaryMessage", {
8201
+ get: function () { return this.get("SummaryMessage"); },
8202
+ enumerable: false,
8203
+ configurable: true
8204
+ });
8205
+ Object.defineProperty(DFUWorkunit.prototype, "State", {
8206
+ get: function () { return this.get("State", States.Unknown); },
8207
+ enumerable: false,
8208
+ configurable: true
8209
+ });
8210
+ Object.defineProperty(DFUWorkunit.prototype, "SourceLogicalName", {
8211
+ get: function () { return this.get("SourceLogicalName"); },
8212
+ enumerable: false,
8213
+ configurable: true
8214
+ });
8215
+ Object.defineProperty(DFUWorkunit.prototype, "SourceIP", {
8216
+ get: function () { return this.get("SourceIP"); },
8217
+ enumerable: false,
8218
+ configurable: true
8219
+ });
8220
+ Object.defineProperty(DFUWorkunit.prototype, "SourceFilePath", {
8221
+ get: function () { return this.get("SourceFilePath"); },
8222
+ enumerable: false,
8223
+ configurable: true
8224
+ });
8225
+ Object.defineProperty(DFUWorkunit.prototype, "SourceDali", {
8226
+ get: function () { return this.get("SourceDali"); },
8227
+ enumerable: false,
8228
+ configurable: true
8229
+ });
8230
+ Object.defineProperty(DFUWorkunit.prototype, "SourceRecordSize", {
8231
+ get: function () { return this.get("SourceRecordSize"); },
8232
+ enumerable: false,
8233
+ configurable: true
8234
+ });
8235
+ Object.defineProperty(DFUWorkunit.prototype, "SourceFormat", {
8236
+ get: function () { return this.get("SourceFormat"); },
8237
+ enumerable: false,
8238
+ configurable: true
8239
+ });
8240
+ Object.defineProperty(DFUWorkunit.prototype, "RowTag", {
8241
+ get: function () { return this.get("RowTag"); },
8242
+ enumerable: false,
8243
+ configurable: true
8244
+ });
8245
+ Object.defineProperty(DFUWorkunit.prototype, "SourceNumParts", {
8246
+ get: function () { return this.get("SourceNumParts"); },
8247
+ enumerable: false,
8248
+ configurable: true
8249
+ });
8250
+ Object.defineProperty(DFUWorkunit.prototype, "SourceDirectory", {
8251
+ get: function () { return this.get("SourceDirectory"); },
8252
+ enumerable: false,
8253
+ configurable: true
8254
+ });
8255
+ Object.defineProperty(DFUWorkunit.prototype, "DestLogicalName", {
8256
+ get: function () { return this.get("DestLogicalName"); },
8257
+ enumerable: false,
8258
+ configurable: true
8259
+ });
8260
+ Object.defineProperty(DFUWorkunit.prototype, "DestGroupName", {
8261
+ get: function () { return this.get("DestGroupName"); },
8262
+ enumerable: false,
8263
+ configurable: true
8264
+ });
8265
+ Object.defineProperty(DFUWorkunit.prototype, "DestDirectory", {
8266
+ get: function () { return this.get("DestDirectory"); },
8267
+ enumerable: false,
8268
+ configurable: true
8269
+ });
8270
+ Object.defineProperty(DFUWorkunit.prototype, "DestIP", {
8271
+ get: function () { return this.get("DestIP"); },
8272
+ enumerable: false,
8273
+ configurable: true
8274
+ });
8275
+ Object.defineProperty(DFUWorkunit.prototype, "DestFilePath", {
8276
+ get: function () { return this.get("DestFilePath"); },
8277
+ enumerable: false,
8278
+ configurable: true
8279
+ });
8280
+ Object.defineProperty(DFUWorkunit.prototype, "DestFormat", {
8281
+ get: function () { return this.get("DestFormat"); },
8282
+ enumerable: false,
8283
+ configurable: true
8284
+ });
8285
+ Object.defineProperty(DFUWorkunit.prototype, "DestNumParts", {
8286
+ get: function () { return this.get("DestNumParts"); },
8287
+ enumerable: false,
8288
+ configurable: true
8289
+ });
8290
+ Object.defineProperty(DFUWorkunit.prototype, "DestRecordSize", {
8291
+ get: function () { return this.get("DestRecordSize"); },
8292
+ enumerable: false,
8293
+ configurable: true
8294
+ });
8295
+ Object.defineProperty(DFUWorkunit.prototype, "Replicate", {
8296
+ get: function () { return this.get("Replicate"); },
8297
+ enumerable: false,
8298
+ configurable: true
8299
+ });
8300
+ Object.defineProperty(DFUWorkunit.prototype, "Overwrite", {
8301
+ get: function () { return this.get("Overwrite"); },
8302
+ enumerable: false,
8303
+ configurable: true
8304
+ });
8305
+ Object.defineProperty(DFUWorkunit.prototype, "Compress", {
8306
+ get: function () { return this.get("Compress"); },
8307
+ enumerable: false,
8308
+ configurable: true
8309
+ });
8310
+ Object.defineProperty(DFUWorkunit.prototype, "SourceCsvSeparate", {
8311
+ get: function () { return this.get("SourceCsvSeparate"); },
8312
+ enumerable: false,
8313
+ configurable: true
8314
+ });
8315
+ Object.defineProperty(DFUWorkunit.prototype, "SourceCsvQuote", {
8316
+ get: function () { return this.get("SourceCsvQuote"); },
8317
+ enumerable: false,
8318
+ configurable: true
8319
+ });
8320
+ Object.defineProperty(DFUWorkunit.prototype, "SourceCsvTerminate", {
8321
+ get: function () { return this.get("SourceCsvTerminate"); },
8322
+ enumerable: false,
8323
+ configurable: true
8324
+ });
8325
+ Object.defineProperty(DFUWorkunit.prototype, "SourceCsvEscape", {
8326
+ get: function () { return this.get("SourceCsvEscape"); },
8327
+ enumerable: false,
8328
+ configurable: true
8329
+ });
8330
+ Object.defineProperty(DFUWorkunit.prototype, "TimeStarted", {
8331
+ get: function () { return this.get("TimeStarted"); },
8332
+ enumerable: false,
8333
+ configurable: true
8334
+ });
8335
+ Object.defineProperty(DFUWorkunit.prototype, "TimeStopped", {
8336
+ get: function () { return this.get("TimeStopped"); },
8337
+ enumerable: false,
8338
+ configurable: true
8339
+ });
8340
+ Object.defineProperty(DFUWorkunit.prototype, "StateMessage", {
8341
+ get: function () { return this.get("StateMessage"); },
8342
+ enumerable: false,
8343
+ configurable: true
8344
+ });
8345
+ Object.defineProperty(DFUWorkunit.prototype, "MonitorEventName", {
8346
+ get: function () { return this.get("MonitorEventName"); },
8347
+ enumerable: false,
8348
+ configurable: true
8349
+ });
8350
+ Object.defineProperty(DFUWorkunit.prototype, "MonitorSub", {
8351
+ get: function () { return this.get("MonitorSub"); },
8352
+ enumerable: false,
8353
+ configurable: true
8354
+ });
8355
+ Object.defineProperty(DFUWorkunit.prototype, "MonitorShotLimit", {
8356
+ get: function () { return this.get("MonitorShotLimit"); },
8357
+ enumerable: false,
8358
+ configurable: true
8359
+ });
8360
+ Object.defineProperty(DFUWorkunit.prototype, "SourceDiffKeyName", {
8361
+ get: function () { return this.get("SourceDiffKeyName"); },
8362
+ enumerable: false,
8363
+ configurable: true
8364
+ });
8365
+ Object.defineProperty(DFUWorkunit.prototype, "DestDiffKeyName", {
8366
+ get: function () { return this.get("DestDiffKeyName"); },
8367
+ enumerable: false,
8368
+ configurable: true
8369
+ });
8370
+ Object.defineProperty(DFUWorkunit.prototype, "Archived", {
8371
+ get: function () { return this.get("Archived"); },
8372
+ enumerable: false,
8373
+ configurable: true
8374
+ });
8375
+ Object.defineProperty(DFUWorkunit.prototype, "encrypt", {
8376
+ get: function () { return this.get("encrypt"); },
8377
+ enumerable: false,
8378
+ configurable: true
8379
+ });
8380
+ Object.defineProperty(DFUWorkunit.prototype, "decrypt", {
8381
+ get: function () { return this.get("decrypt"); },
8382
+ enumerable: false,
8383
+ configurable: true
8384
+ });
8385
+ Object.defineProperty(DFUWorkunit.prototype, "failIfNoSourceFile", {
8386
+ get: function () { return this.get("failIfNoSourceFile"); },
8387
+ enumerable: false,
8388
+ configurable: true
8389
+ });
8390
+ Object.defineProperty(DFUWorkunit.prototype, "recordStructurePresent", {
8391
+ get: function () { return this.get("recordStructurePresent"); },
8392
+ enumerable: false,
8393
+ configurable: true
8394
+ });
8395
+ Object.defineProperty(DFUWorkunit.prototype, "quotedTerminator", {
8396
+ get: function () { return this.get("quotedTerminator"); },
8397
+ enumerable: false,
8398
+ configurable: true
8399
+ });
8400
+ Object.defineProperty(DFUWorkunit.prototype, "preserveCompression", {
8401
+ get: function () { return this.get("preserveCompression"); },
8402
+ enumerable: false,
8403
+ configurable: true
8404
+ });
8405
+ Object.defineProperty(DFUWorkunit.prototype, "expireDays", {
8406
+ get: function () { return this.get("expireDays"); },
8407
+ enumerable: false,
8408
+ configurable: true
8409
+ });
8410
+ Object.defineProperty(DFUWorkunit.prototype, "PreserveFileParts", {
8411
+ get: function () { return this.get("PreserveFileParts"); },
8412
+ enumerable: false,
8413
+ configurable: true
8414
+ });
8415
+ Object.defineProperty(DFUWorkunit.prototype, "FileAccessCost", {
8416
+ get: function () { return this.get("FileAccessCost"); },
8417
+ enumerable: false,
8418
+ configurable: true
8419
+ });
8420
+ // Factories ---
8421
+ DFUWorkunit.create = function (optsConnection, dfuServerQueue) {
8422
+ var retVal = new DFUWorkunit(optsConnection);
8423
+ return retVal.connection.CreateDFUWorkunit({ DFUServerQueue: dfuServerQueue }).then(function (response) {
8424
+ _workunits.set(retVal);
8425
+ retVal.set(response.result);
8426
+ return retVal;
8427
+ });
8428
+ };
8429
+ DFUWorkunit.attach = function (optsConnection, wuid, state) {
8430
+ var retVal = _workunits.get({ BaseUrl: optsConnection.baseUrl, ID: wuid }, function () {
8431
+ return new DFUWorkunit(optsConnection, wuid);
8432
+ });
8433
+ if (state) {
8434
+ retVal.set(state);
8435
+ }
8436
+ return retVal;
8437
+ };
8438
+ DFUWorkunit.sprayFixed = function (server, request) {
8439
+ var service = new FileSprayService(server);
8440
+ return service.SprayFixedEx(__assign({}, request)).then(function (response) {
8441
+ var wuid = response.wuid;
8442
+ return service.GetDFUWorkunit({ wuid: wuid }).then(function (response) {
8443
+ return DFUWorkunit.attach(server, wuid, response.result);
8444
+ });
8445
+ });
8446
+ };
8447
+ DFUWorkunit.sprayVariable = function (server, request) {
8448
+ var service = new FileSprayService(server);
8449
+ return service.SprayVariableEx(__assign({}, request)).then(function (response) {
8450
+ var wuid = response.wuid;
8451
+ return service.GetDFUWorkunit({ wuid: wuid }).then(function (response) {
8452
+ return DFUWorkunit.attach(server, wuid, response.result);
8453
+ });
8454
+ });
8455
+ };
8456
+ DFUWorkunit.despray = function (server, request) {
8457
+ var service = new FileSprayService(server);
8458
+ return service.DesprayEx(__assign({}, request)).then(function (response) {
8459
+ var wuid = response.wuid;
8460
+ return service.GetDFUWorkunit({ wuid: wuid }).then(function (response) {
8461
+ return DFUWorkunit.attach(server, wuid, response.result);
8462
+ });
8463
+ });
8464
+ };
8465
+ DFUWorkunit.prototype.isComplete = function () {
8466
+ switch (this.State) {
8467
+ case States.Finished:
8468
+ case States.Failed:
8469
+ case States.Aborted:
8470
+ case States.NotFound:
8471
+ return true;
8472
+ }
8473
+ return false;
8474
+ };
8475
+ DFUWorkunit.prototype.isFailed = function () {
8476
+ if (this.isComplete() && this.State !== States.Finished) {
8477
+ return true;
8478
+ }
8479
+ return false;
8480
+ };
8481
+ DFUWorkunit.prototype.isDeleted = function () {
8482
+ switch (this.State) {
8483
+ case States.NotFound:
8484
+ return true;
8485
+ }
8486
+ return false;
8487
+ };
8488
+ DFUWorkunit.prototype.isRunning = function () {
8489
+ return !this.isComplete();
8490
+ };
8491
+ DFUWorkunit.prototype.refresh = function (full) {
8492
+ return __awaiter(this, void 0, void 0, function () {
8493
+ return __generator(this, function (_a) {
8494
+ switch (_a.label) {
8495
+ case 0: return [4 /*yield*/, this.GetDFUWorkunit()];
8496
+ case 1:
8497
+ _a.sent();
8498
+ return [2 /*return*/, this];
8499
+ }
8500
+ });
8501
+ });
8502
+ };
8503
+ // Monitoring ---
8504
+ DFUWorkunit.prototype._monitor = function () {
8505
+ if (this.isComplete()) {
8506
+ this._monitorTickCount = 0;
8507
+ return;
8508
+ }
8509
+ _super.prototype._monitor.call(this);
8510
+ };
8511
+ DFUWorkunit.prototype._monitorTimeoutDuration = function () {
8512
+ var retVal = _super.prototype._monitorTimeoutDuration.call(this);
8513
+ if (this._monitorTickCount <= 1) { // Once
8514
+ return 3000;
8515
+ }
8516
+ else if (this._monitorTickCount <= 5) { // Twice
8517
+ return 6000;
8518
+ }
8519
+ else if (this._monitorTickCount <= 7) { // Twice
8520
+ return 12000;
8521
+ }
8522
+ return retVal;
8523
+ };
8524
+ // Events ---
8525
+ DFUWorkunit.prototype.on = function (eventID, propIDorCallback, callback) {
8526
+ var _this = this;
8527
+ if (this.isCallback(propIDorCallback)) {
8528
+ switch (eventID) {
8529
+ case "finished":
8530
+ _super.prototype.on.call(this, "propChanged", "State", function (changeInfo) {
8531
+ if (_this.isComplete()) {
8532
+ propIDorCallback([changeInfo]);
8533
+ }
8534
+ });
8535
+ break;
8536
+ case "changed":
8537
+ _super.prototype.on.call(this, eventID, propIDorCallback);
8538
+ break;
8539
+ }
8540
+ }
8541
+ else {
8542
+ switch (eventID) {
8543
+ case "changed":
8544
+ _super.prototype.on.call(this, eventID, propIDorCallback, callback);
8545
+ break;
8546
+ }
8547
+ }
8548
+ this._monitor();
8549
+ return this;
8550
+ };
8551
+ DFUWorkunit.prototype.watchUntilComplete = function (callback) {
8552
+ var _this = this;
8553
+ return new Promise(function (resolve, _) {
8554
+ var watchHandle = _this.watch(function (changes) {
8555
+ if (callback) {
8556
+ callback(changes);
8557
+ }
8558
+ if (_this.isComplete()) {
8559
+ watchHandle.release();
8560
+ resolve(_this);
8561
+ }
8562
+ });
8563
+ });
8564
+ };
8565
+ DFUWorkunit.prototype.watchUntilRunning = function (callback) {
8566
+ var _this = this;
8567
+ return new Promise(function (resolve, _) {
8568
+ var watchHandle = _this.watch(function (changes) {
8569
+ if (callback) {
8570
+ callback(changes);
8571
+ }
8572
+ if (_this.isComplete() || _this.isRunning()) {
8573
+ watchHandle.release();
8574
+ resolve(_this);
8575
+ }
8576
+ });
8577
+ });
8578
+ };
8579
+ DFUWorkunit.prototype.clearState = function (wuid) {
8580
+ this.clear({
8581
+ ID: wuid,
8582
+ State: States.Unknown
8583
+ });
8584
+ };
8585
+ // FileSpray passthroughs ---
8586
+ DFUWorkunit.prototype.GetDFUWorkunit = function (_request) {
8587
+ var _this = this;
8588
+ if (_request === void 0) { _request = {}; }
8589
+ return this.connection.GetDFUWorkunit(__assign(__assign({}, _request), { wuid: this.ID })).then(function (response) {
8590
+ _this.set(response.result);
8591
+ return response;
8592
+ }).catch(function (e) {
8593
+ // deleted ---
8594
+ var wuMissing = e.Exception.some(function (exception) {
8595
+ if (exception.Code === 20081) {
8596
+ _this.clearState(_this.ID);
8597
+ _this.set("State", States.NotFound);
8598
+ return true;
8599
+ }
8600
+ return false;
8601
+ });
8602
+ if (!wuMissing) {
8603
+ logger.warning("Unexpected exception: ");
8604
+ throw e;
8605
+ }
8606
+ return {};
8607
+ });
8608
+ };
8609
+ return DFUWorkunit;
8610
+ }(util.StateObject));
8611
+
7968
8612
  exports.AccessService = AccessService;
7969
8613
  exports.AccountService = AccountService;
7970
8614
  exports.Activity = Activity;
@@ -7979,6 +8623,8 @@
7979
8623
  exports.DFUChangeRestriction = DFUChangeRestriction;
7980
8624
  exports.DFUDefFileFormat = DFUDefFileFormat;
7981
8625
  exports.DFUService = DFUService;
8626
+ exports.DFUWorkunit = DFUWorkunit;
8627
+ exports.DFUWorkunitCache = DFUWorkunitCache;
7982
8628
  exports.DFUXRefService = DFUXRefService;
7983
8629
  exports.DaliService = DaliService;
7984
8630
  exports.ECLGraph = ECLGraph;