UNPKG

@hpcc-js/comms

Version:
130 lines 6.24 kB
import { __assign, __extends } from "tslib"; import { deepMixin, xml2json } from "@hpcc-js/util"; import { WsWorkunits, WorkunitsServiceBase } from "./wsdl/WsWorkunits/v2/WsWorkunits"; /* Response structures generated via: * http://localhost:8010/WsWorkunits/WUInfo?reqjson_ * http://localhost:8010/WsWorkunits/WUInfo?respjson_ * http://json2ts.com/ */ export { WsWorkunits }; export var WUStateID; (function (WUStateID) { WUStateID[WUStateID["Unknown"] = 0] = "Unknown"; WUStateID[WUStateID["Compiled"] = 1] = "Compiled"; WUStateID[WUStateID["Running"] = 2] = "Running"; WUStateID[WUStateID["Completed"] = 3] = "Completed"; WUStateID[WUStateID["Failed"] = 4] = "Failed"; WUStateID[WUStateID["Archived"] = 5] = "Archived"; WUStateID[WUStateID["Aborting"] = 6] = "Aborting"; WUStateID[WUStateID["Aborted"] = 7] = "Aborted"; WUStateID[WUStateID["Blocked"] = 8] = "Blocked"; WUStateID[WUStateID["Submitted"] = 9] = "Submitted"; WUStateID[WUStateID["Scheduled"] = 10] = "Scheduled"; WUStateID[WUStateID["Compiling"] = 11] = "Compiling"; WUStateID[WUStateID["Wait"] = 12] = "Wait"; WUStateID[WUStateID["UploadingFiled"] = 13] = "UploadingFiled"; WUStateID[WUStateID["DebugPaused"] = 14] = "DebugPaused"; WUStateID[WUStateID["DebugRunning"] = 15] = "DebugRunning"; WUStateID[WUStateID["Paused"] = 16] = "Paused"; WUStateID[WUStateID["LAST"] = 17] = "LAST"; WUStateID[WUStateID["NotFound"] = 999] = "NotFound"; })(WUStateID || (WUStateID = {})); export var WUUpdate; (function (WUUpdate) { var Action; (function (Action) { Action[Action["Unknown"] = 0] = "Unknown"; Action[Action["Compile"] = 1] = "Compile"; Action[Action["Check"] = 2] = "Check"; Action[Action["Run"] = 3] = "Run"; Action[Action["ExecuteExisting"] = 4] = "ExecuteExisting"; Action[Action["Pause"] = 5] = "Pause"; Action[Action["PauseNow"] = 6] = "PauseNow"; Action[Action["Resume"] = 7] = "Resume"; Action[Action["Debug"] = 8] = "Debug"; Action[Action["__size"] = 9] = "__size"; })(Action = WUUpdate.Action || (WUUpdate.Action = {})); })(WUUpdate || (WUUpdate = {})); export function isECLResult(_) { return typeof _.Name === "string"; } export function isWUQueryECLWorkunit(_) { return _.TotalClusterTime !== undefined; } export function isWUInfoWorkunit(_) { return _.StateEx !== undefined; } var WorkunitsService = /** @class */ (function (_super) { __extends(WorkunitsService, _super); function WorkunitsService(optsConnection) { return _super.call(this, optsConnection) || this; } WorkunitsService.prototype.Ping = function () { return this._connection.send("Ping", {}, "json", false, undefined, "WsWorkunitsPingResponse").then(function (response) { return { result: true }; }).catch(function (e) { return { result: false, error: e }; }); }; WorkunitsService.prototype.WUQuery = function (request, abortSignal) { if (request === void 0) { request = {}; } return this._connection.send("WUQuery", request, "json", false, abortSignal).then(function (response) { return deepMixin({ Workunits: { ECLWorkunit: [] } }, response); }); }; WorkunitsService.prototype.WUInfo = function (_request) { var request = __assign({ Wuid: "", TruncateEclTo64k: true, IncludeExceptions: false, IncludeGraphs: false, IncludeSourceFiles: false, IncludeResults: false, IncludeResultsViewNames: false, IncludeVariables: false, IncludeTimers: false, IncludeDebugValues: false, IncludeApplicationValues: false, IncludeWorkflows: false, IncludeXmlSchemas: false, IncludeResourceURLs: false, IncludeECL: false, IncludeHelpers: false, IncludeAllowedClusters: false, IncludeTotalClusterTime: false, IncludeServiceNames: false, SuppressResultSchemas: true }, _request); return _super.prototype.WUInfo.call(this, request); }; WorkunitsService.prototype.WUCreate = function () { return _super.prototype.WUCreate.call(this, {}); }; WorkunitsService.prototype.WUUpdate = function (request) { return this._connection.send("WUUpdate", request, "json", true); }; WorkunitsService.prototype.WUResubmit = function (request) { this._connection.toESPStringArray(request, "Wuids"); return _super.prototype.WUResubmit.call(this, request); }; WorkunitsService.prototype.WUAction = function (request) { request.ActionType = request.WUActionType; // v5.x compatibility return _super.prototype.WUAction.call(this, request); }; WorkunitsService.prototype.WUResult = function (request, abortSignal) { return this._connection.send("WUResult", request, "json", false, abortSignal); }; WorkunitsService.prototype.WUFileEx = function (request) { return this._connection.send("WUFile", request, "text"); }; WorkunitsService.prototype.WUDetailsMeta = function (request) { if (!this._WUDetailsMetaPromise) { this._WUDetailsMetaPromise = _super.prototype.WUDetailsMeta.call(this, request); } return this._WUDetailsMetaPromise; }; WorkunitsService.prototype.WUCDebugEx = function (request) { return this._connection.send("WUCDebug", request, undefined, undefined, undefined, "WUDebug").then(function (response) { var retVal = xml2json(response.Result); var children = retVal.children(); if (children.length) { return children[0]; } return null; }); }; return WorkunitsService; }(WorkunitsServiceBase)); export { WorkunitsService }; var WorkunitsServiceEx = /** @class */ (function (_super) { __extends(WorkunitsServiceEx, _super); function WorkunitsServiceEx() { return _super !== null && _super.apply(this, arguments) || this; } WorkunitsServiceEx.prototype.WUPublishWorkunitEx = function (request) { return this._connection.send("WUPublishWorkunit", request); }; return WorkunitsServiceEx; }(WorkunitsServiceBase)); export { WorkunitsServiceEx }; //# sourceMappingURL=wsWorkunits.js.map