@hpcc-js/comms
Version:
hpcc-js - Communications
1 lines • 213 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,(function(e,t){"use strict";var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},r="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,o,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=y(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=r?r[1]:"utf-8",t.readAsText(e,o),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(U)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=p(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},h.prototype.delete=function(e){delete this.map[p(e)]},h.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},h.prototype.set=function(e,t){this.map[p(e)]=l(t)},h.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),f(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),f(e)},o&&(h.prototype[Symbol.iterator]=h.prototype.entries);var v=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,o,i=(t=t||{}).body;if(e instanceof S){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=t.method||this.method||"GET",o=r.toUpperCase(),v.indexOf(o)>-1?o:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function U(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function _(e,t){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},m.call(S.prototype),m.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var P=[301,302,303,307,308];_.redirect=function(e,t){if(-1===P.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})};var D=n.DOMException;try{new D}catch(e){(D=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),D.prototype.constructor=D}function C(e,t){return new Promise((function(r,o){var s=new S(e,t);if(s.signal&&s.signal.aborted)return o(new D("Aborted","AbortError"));var c=new XMLHttpRequest;function a(){c.abort()}if(c.onload=function(){var e,t,n={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();try{t.append(r,o)}catch(e){console.warn("Response "+e.message)}}})),t)};0===s.url.indexOf("file://")&&(c.status<200||c.status>599)?n.status=200:n.status=c.status,n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var o="response"in c?c.response:c.responseText;setTimeout((function(){r(new _(o,n))}),0)},c.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},c.onabort=function(){setTimeout((function(){o(new D("Aborted","AbortError"))}),0)},c.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?c.withCredentials=!0:"omit"===s.credentials&&(c.withCredentials=!1),"responseType"in c&&(i?c.responseType="blob":u&&(c.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof h||n.Headers&&t.headers instanceof n.Headers)){var f=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){f.push(p(e)),c.setRequestHeader(e,l(t.headers[e]))})),s.headers.forEach((function(e,t){-1===f.indexOf(t)&&c.setRequestHeader(t,e)}))}else s.headers.forEach((function(e,t){c.setRequestHeader(t,e)}));s.signal&&(s.signal.addEventListener("abort",a),c.onreadystatechange=function(){4===c.readyState&&s.signal.removeEventListener("abort",a)}),c.send(void 0===s._bodyInit?null:s._bodyInit)}))}C.polyfill=!0,n.fetch||(n.fetch=C,n.Headers=h,n.Request=S,n.Response=_);var R=function(e,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},R(e,t)};function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},W.apply(this,arguments)};function F(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}c((r=r.apply(e,t||[])).next())}))}function w(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function A(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var T=t.scopedLogger("comms/connection.ts");var O={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function L(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function E(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=""),n&&(n+="."),"object"!=typeof e)return L(e,t);var r=[],o=function(o){if(e.hasOwnProperty(o))if(e[o]instanceof Array){var i=!1;e[o].forEach((function(e,s){"object"==typeof e?(i=!0,r.push(E(e,t,n+L("".concat(o,".").concat(s),t)))):r.push(n+L("".concat(o,"_i").concat(s),t)+"="+E(e,t))})),i&&r.push(n+L("".concat(o,".itemcount"),t)+"="+e[o].length)}else"object"==typeof e[o]?e[o]&&e[o].Item instanceof Array?(r.push(E(e[o].Item,t,n+L(o,t))),r.push(n+L("".concat(o,".itemcount"),t)+"="+e[o].Item.length)):r.push(E(e[o],t,n+L(o,t))):void 0!==e[o]?r.push(n+L(o,t)+"="+L(e[o],t)):r.push(n+L(o,t))};for(var i in e)o(i);return r.join("&")}function x(e){return JSON.parse(e)}function I(e,n,r,o,i){return void 0===r&&(r={}),void 0===o&&(o="json"),i&&console.warn("Header attributes ignored for JSONP connections"),new Promise((function(i,s){var u=1e3*e.timeoutSecs,c="jsonp_callback_"+Math.round(999999*Math.random());window[c]=function(e){u=0,f(),i("json"===o&&"string"==typeof e?x(e):e)};var a=document.createElement("script"),p=t.join(e.baseUrl,n);p+=p.indexOf("?")>=0?"&":"?",a.src=p+"jsonp="+c+"&"+E(r,e.encodeRequest),document.body.appendChild(a);var l=setInterval((function(){u<=0?clearInterval(l):(u-=5e3)<=0?(clearInterval(l),T.error("Request timeout: "+a.src),f(),s(Error("Request timeout: "+a.src))):T.debug("Request pending ("+u/1e3+" sec): "+a.src)}),5e3);function f(){delete window[c],document.body.removeChild(a)}}))}var N={};function M(e,n,r,o,i){function s(e){if(e.ok)return"json"===i?e.json():e.text();throw new Error(e.statusText)}return o=W(W({},function(e){return e.userID?{Authorization:"Basic ".concat(btoa("".concat(e.userID,":").concat(e.password)))}:{}}(e)),o),r=W(W({credentials:N[e.baseUrl]?"omit":"include"},r),{headers:o}),fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):r.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(r.agent=fetch.__trustwaveAgent)),t.promiseTimeout(1e3*e.timeoutSecs,fetch(t.join(e.baseUrl,n),r).then(s).catch((function(o){return r.credentials=N[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,n),r).then(s).then((function(t){return N[e.baseUrl]=!N[e.baseUrl],t}))})))}function k(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,t,{method:"post",body:E(n,e.encodeRequest),signal:i},W({"Content-Type":"application/x-www-form-urlencoded"},o),r)}function G(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,"".concat(t,"?").concat(E(n,e.encodeRequest)),{method:"get",signal:i},W({},o),r)}function V(e,t,n,r,o){var i;switch(void 0===r&&(r="json"),e.type){case"jsonp":i=I(e,t,n,r,o);break;case"get":i=G(e,t,n,r,o);break;default:i=k(e,t,n,r,o)}return i}var Q=V;var B=function(){function e(e){this.opts(e)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._opts.baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(e){return 0===arguments.length?this._opts:(this._opts=W(W({},O),e),this)},e.prototype.send=function(e,t,n,r){return void 0===n&&(n="json"),this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,Q,r):Q(this._opts,e,t,n,r)},e.prototype.clone=function(){return new e(this.opts())},e}();function X(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new B(e)};var H=function(e){function t(t,n,r){var o=e.call(this,"ESPException: "+r.Source)||this;return o.isESPExceptions=!0,o.action=t,o.request=n,o.Source=r.Source,o.Exception=r.Exception,r.Exception.length?o.message="".concat(r.Exception[0].Code,": ").concat(r.Exception[0].Message):o.message="",o}return j(t,e),t}(Error);var J,q,z=function(){function n(t,n,r){this._connection=function(e){return void 0!==e.send}(t)?t:e.createConnection(t),this._service=n,this._version=r}return Object.defineProperty(n.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),n.prototype.service=function(e){return void 0===e?this._service:(this._service=e,this)},n.prototype.version=function(e){return void 0===e?this._version:(this._version=e,this)},n.prototype.toESPStringArray=function(e,t){if(X(e[t])){for(var n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e},n.prototype.opts=function(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)},n.prototype.send=function(e,n,r,o,i,s){void 0===n&&(n={}),void 0===r&&(r="json"),void 0===o&&(o=!1);var u,c=W(W({},n),{ver_:this._version});o&&(c.upload_=!0),i&&(c.abortSignal_=i);var a="json";switch(r){case"text":u=t.join(this._service,e),a="text";break;case"xsd":u=t.join(this._service,e+".xsd"),a="text";break;case"json2":u=t.join(this._service,e+"/json"),r="json";var p=e.split("/");e=p.pop();break;default:u=t.join(this._service,e+".json")}return this._connection.send(u,c,a).then((function(t){if("json"===r){var n=void 0;if(t&&t.Exceptions)throw new H(e,c,t.Exceptions);if(t&&(n=t[s||e+"Response"]),!n)throw new H(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t})).catch((function(t){if(t.isESPExceptions)throw t;throw new H(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:t.message}]})}))},n.prototype.clone=function(){return new n(this._connection.clone(),this._service,this._version)},n}(),K=function(){function e(e,t,n){this._connection=new z(e,t,n)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(){return this._connection.opts()},e.prototype.connection=function(){return this._connection.clone()},e}();e.FileSpray=void 0,J=e.FileSpray||(e.FileSpray={}),(q=J.DFUWUActions||(J.DFUWUActions={})).Delete="Delete",q.Protect="Protect",q.Unprotect="Unprotect",q.Restore="Restore",q.SetToFailed="SetToFailed",q.Archive="Archive";var Y,Z=function(e){function t(t){return e.call(this,t,"FileSpray","1.26")||this}return j(t,e),t.prototype.AbortDFUWorkunit=function(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")},t.prototype.Copy=function(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")},t.prototype.CreateDFUPublisherWorkunit=function(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")},t.prototype.CreateDFUWorkunit=function(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")},t.prototype.DFUWUFile=function(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")},t.prototype.DFUWUSearch=function(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")},t.prototype.DFUWorkunitsAction=function(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")},t.prototype.DeleteDFUWorkunit=function(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")},t.prototype.DeleteDFUWorkunits=function(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")},t.prototype.DeleteDropZoneFiles=function(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")},t.prototype.Despray=function(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")},t.prototype.DfuMonitor=function(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")},t.prototype.DropZoneFileSearch=function(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")},t.prototype.DropZoneFiles=function(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")},t.prototype.EchoDateTime=function(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")},t.prototype.FileList=function(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")},t.prototype.GetDFUExceptions=function(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")},t.prototype.GetDFUProgress=function(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")},t.prototype.GetDFUServerQueues=function(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")},t.prototype.GetDFUWorkunit=function(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")},t.prototype.GetDFUWorkunits=function(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")},t.prototype.GetRemoteTargets=function(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")},t.prototype.GetSprayTargets=function(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")},t.prototype.OpenSave=function(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")},t.prototype.Rename=function(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")},t.prototype.Replicate=function(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")},t.prototype.ShowResult=function(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")},t.prototype.SprayFixed=function(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")},t.prototype.SprayVariable=function(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")},t.prototype.SubmitDFUWorkunit=function(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")},t.prototype.UpdateDFUWorkunit=function(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")},t}(K);e.FileSprayStates=void 0,(Y=e.FileSprayStates||(e.FileSprayStates={}))[Y.unknown=0]="unknown",Y[Y.scheduled=1]="scheduled",Y[Y.queued=2]="queued",Y[Y.started=3]="started",Y[Y.aborted=4]="aborted",Y[Y.failed=5]="failed",Y[Y.finished=6]="finished",Y[Y.monitoring=7]="monitoring",Y[Y.aborting=8]="aborting",Y[Y.notfound=999]="notfound";var $,ee,te,ne,re,oe,ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.DFUWUFileEx=function(e){return this._connection.send("DFUWUFile",e,"text")},t.prototype.SprayFixedEx=function(e){return this._connection.send("SprayFixed",e)},t.prototype.SprayVariableEx=function(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")},t.prototype.DesprayEx=function(e){return this._connection.send("Despray",e)},t.prototype.UpdateDFUWorkunitEx=function(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")},t}(Z);e.WsAccess=void 0,$=e.WsAccess||(e.WsAccess={}),(ee=$.ViewMemberType||($.ViewMemberType={})).User="User",ee.Group="Group",(te=$.UserSortBy||($.UserSortBy={})).username="username",te.fullname="fullname",te.passwordexpiration="passwordexpiration",te.employeeID="employeeID",te.employeeNumber="employeeNumber",(ne=$.GroupSortBy||($.GroupSortBy={})).Name="Name",ne.ManagedBy="ManagedBy",(re=$.AccountTypeReq||($.AccountTypeReq={})).Any="Any",re.User="User",re.Group="Group",(oe=$.ResourcePermissionSortBy||($.ResourcePermissionSortBy={})).Name="Name",oe.Type="Type",($.ResourceSortBy||($.ResourceSortBy={})).Name="Name";var se,ue,ce,ae,pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_access","1.17")||this}return j(t,e),t.prototype.AccountPermissions=function(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")},t.prototype.AccountPermissionsV2=function(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")},t.prototype.AddUser=function(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")},t.prototype.AddView=function(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")},t.prototype.AddViewColumn=function(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")},t.prototype.AddViewMember=function(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")},t.prototype.ClearPermissionsCache=function(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")},t.prototype.DeleteView=function(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")},t.prototype.DeleteViewColumn=function(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")},t.prototype.DeleteViewMember=function(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")},t.prototype.DisableScopeScans=function(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")},t.prototype.EnableScopeScans=function(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")},t.prototype.FilePermission=function(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")},t.prototype.GroupAction=function(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")},t.prototype.GroupAdd=function(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")},t.prototype.GroupEdit=function(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")},t.prototype.GroupMemberEdit=function(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")},t.prototype.GroupMemberEditInput=function(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")},t.prototype.GroupMemberQuery=function(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")},t.prototype.GroupQuery=function(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")},t.prototype.Groups=function(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")},t.prototype.PermissionAction=function(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")},t.prototype.Permissions=function(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")},t.prototype.PermissionsReset=function(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")},t.prototype.QueryScopeScansEnabled=function(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")},t.prototype.QueryUserViewColumns=function(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")},t.prototype.QueryViewColumns=function(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")},t.prototype.QueryViewMembers=function(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")},t.prototype.QueryViews=function(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")},t.prototype.ResourceAdd=function(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")},t.prototype.ResourceDelete=function(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")},t.prototype.ResourcePermissionQuery=function(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")},t.prototype.ResourcePermissions=function(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")},t.prototype.ResourceQuery=function(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")},t.prototype.Resources=function(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")},t.prototype.UserAccountExport=function(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")},t.prototype.UserAction=function(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")},t.prototype.UserEdit=function(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")},t.prototype.UserGroupEdit=function(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")},t.prototype.UserGroupEditInput=function(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")},t.prototype.UserInfoEdit=function(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")},t.prototype.UserInfoEditInput=function(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")},t.prototype.UserPosix=function(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")},t.prototype.UserPosixInput=function(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")},t.prototype.UserQuery=function(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")},t.prototype.UserResetPass=function(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")},t.prototype.UserResetPassInput=function(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")},t.prototype.UserSudoers=function(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")},t.prototype.UserSudoersInput=function(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")},t.prototype.Users=function(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")},t}(K)),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e).catch((function(e){if(e.isESPExceptions&&e.Exception.some((function(e){return 20043===e.Code})))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e}))},t}(function(e){function t(t){return e.call(this,t,"ws_account","1.06")||this}return j(t,e),t.prototype.MyAccount=function(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")},t.prototype.UpdateUser=function(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")},t.prototype.UpdateUserInput=function(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")},t.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")},t}(K)),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.getPODs=function(){return e.prototype.GetPODs.call(this,{}).then((function(e){var t;try{var n="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return null!==(t=null==n?void 0:n.items)&&void 0!==t?t:[]}catch(e){return[]}}))},t}(function(e){function t(t){return e.call(this,t,"WsCloud","1")||this}return j(t,e),t.prototype.GetPODs=function(e){return this._connection.send("GetPODs",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t}(K)),he=function(){function e(e){this._connection=new z(e,"ws_codesign","1.1")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.ListUserIDs=function(e){return this._connection.send("ListUserIDs",e).then((function(e){return e.UserIDs.Item})).catch((function(e){return[]}))},e.prototype.Sign=function(e){return this._connection.send("Sign",W({SigningMethod:"gpg"},e))},e.prototype.Verify=function(e){return this._connection.send("Verify",e)},e}(),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WSDali","1.07")||this}return j(t,e),t.prototype.Add=function(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")},t.prototype.ClearTraceTransactions=function(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.Count=function(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")},t.prototype.DFSCheck=function(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")},t.prototype.DFSExists=function(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")},t.prototype.DFSLS=function(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")},t.prototype.Delete=function(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")},t.prototype.DisconnectClientConnection=function(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetClients=function(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetConnections=function(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSCSV=function(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSMap=function(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSParents=function(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetLogicalFile=function(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetLogicalFilePart=function(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetProtectedList=function(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetSDSStats=function(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetSDSSubscribers=function(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetValue=function(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")},t.prototype.Import=function(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")},t.prototype.ListSDSLocks=function(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")},t.prototype.SaveSDSStore=function(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetLogicalFilePartAttr=function(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetProtected=function(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetTraceSlowTransactions=function(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetTraceTransactions=function(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetUnprotected=function(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetValue=function(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")},t.prototype.UnlockSDSLock=function(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")},t}(K));e.WsDfu=void 0,function(e){e.Delete="Delete",e.AddToSuperfile="Add To Superfile",e.ChangeProtection="Change Protection",e.ChangeRestriction="Change Restriction"}((se=e.WsDfu||(e.WsDfu={})).DFUArrayActions||(se.DFUArrayActions={})),function(e){e[e.NoChange=0]="NoChange",e[e.Protect=1]="Protect",e[e.Unprotect=2]="Unprotect",e[e.UnprotectAll=3]="UnprotectAll"}(se.DFUChangeProtection||(se.DFUChangeProtection={})),function(e){e[e.NoChange=0]="NoChange",e[e.Restrict=1]="Restrict",e[e.Unrestricted=2]="Unrestricted"}(se.DFUChangeRestriction||(se.DFUChangeRestriction={})),function(e){e.xml="xml",e.def="def"}(se.DFUDefFileFormat||(se.DFUDefFileFormat={})),(ue=se.FileAccessRole||(se.FileAccessRole={})).Token="Token",ue.Engine="Engine",ue.External="External",(ce=se.SecAccessType||(se.SecAccessType={})).None="None",ce.Access="Access",ce.Read="Read",ce.Write="Write",ce.Full="Full",(ae=se.DFUFileType||(se.DFUFileType={})).Flat="Flat",ae.Index="Index",ae.Xml="Xml",ae.Csv="Csv",ae.Json="Json",ae.IndexLocal="IndexLocal",ae.IndexPartitioned="IndexPartitioned",ae.Unset="Unset";var ye=function(e){function t(t){return e.call(this,t,"WsDfu","1.65")||this}return j(t,e),t.prototype.Add=function(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")},t.prototype.AddRemote=function(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")},t.prototype.AddtoSuperfile=function(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")},t.prototype.DFUArrayAction=function(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")},t.prototype.DFUBrowseData=function(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")},t.prototype.DFUDefFile=function(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")},t.prototype.DFUFileAccess=function(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")},t.prototype.DFUFileAccessV2=function(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")},t.prototype.DFUFileCreate=function(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")},t.prototype.DFUFileCreateV2=function(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")},t.prototype.DFUFilePublish=function(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")},t.prototype.DFUFileView=function(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")},t.prototype.DFUGetDataColumns=function(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")},t.prototype.DFUGetFileMetaData=function(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")},t.prototype.DFUInfo=function(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")},t.prototype.DFUQuery=function(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")},t.prototype.DFURecordTypeInfo=function(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")},t.prototype.DFUSearch=function(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")},t.prototype.DFUSearchData=function(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")},t.prototype.DFUSpace=function(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")},t.prototype.EclRecordTypeInfo=function(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")},t.prototype.EraseHistory=function(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")},t.prototype.ListHistory=function(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")},t.prototype.Savexml=function(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")},t.prototype.SuperfileAction=function(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")},t.prototype.SuperfileList=function(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")},t}(K),ge=e.WsDfu.DFUArrayActions,be=e.WsDfu.DFUDefFileFormat,me=e.WsDfu.DFUChangeProtection,ve=e.WsDfu.DFUChangeRestriction,Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.DFUFile=function(e){return this._connection.send("DFUDefFile",e,"text")},t}(ye),Ue=function(e){function t(t){return e.call(this,t,"WsDFUXRef","1.01")||this}return j(t,e),t.prototype.DFUXRefArrayAction=function(e){return this._connection.send("DFUXRefArrayAction",e)},t.prototype.DFUXRefBuild=function(e){return this._connection.send("DFUXRefBuild",e)},t.prototype.DFUXRefBuildCancel=function(e){return this._connection.send("DFUXRefBuildCancel",e)},t.prototype.DFUXRefCleanDirectories=function(e){return this._connection.send("DFUXRefCleanDirectories",e)},t.prototype.DFUXRefDirectories=function(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")},t.prototype.DFUXRefFoundFiles=function(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")},t.prototype.DFUXRefList=function(e){return void 0===e&&(e={}),this._connection.send("DFUXRefList",e)},t.prototype.DFUXRefLostFiles=function(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")},t.prototype.DFUXRefMessages=function(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")},t.prototype.DFUXRefOrphanFiles=function(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")},t.prototype.DFUXRefUnusedFiles=function(e){return this._connection.send("DFUXRefUnusedFiles",e)},t}(K);function _e(e,t){var n=typeof t;switch(n){case"boolean":case"number":case"string":return{id:e,type:n};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:Pe(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){var r=typeof t.Item[0];if("string"===r||"number"===r)return{id:e,type:"set",fieldType:r};throw new Error("Unknown field type")}return{id:e,type:"object",fields:De(t)}}default:throw new Error("Unknown field type")}}function Pe(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);var t=[];for(var n in e)t.push(_e(n,e[n]));return t}function De(e){var t={};for(var n in e)t[n]=_e(n,e[n]);return t}var Ce,Re,je,We,Fe,we,Ae,Te,Oe=function(e){function t(t){return e.call(this,t,"WsEcl","0")||this}return j(t,e),t.prototype.opts=function(){return this._connection.opts()},t.prototype.requestJson=function(e,t){return this._connection.send("example/request/query/".concat(e,"/").concat(t,"/json"),{},"text").then((function(e){var t=JSON.parse(e);for(var n in t)return t[n];return{}})).then(Pe)},t.prototype.responseJson=function(e,t){return this._connection.send("example/response/query/".concat(e,"/").concat(t,"/json"),{},"text").then((function(e){var t=JSON.parse(e);for(var n in t)return t[n].Results;return{}})).then((function(e){var t={};for(var n in e)t[n]=Pe(e[n]);return t}))},t.prototype.submit=function(e,t,n){var r="submit/query/".concat(e,"/").concat(t);return this._connection.send(r,n,"json2").then((function(e){if(e.Results&&e.Results.Exception)throw new H(r,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results}))},t}(K),Le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_elk","1")||this}return j(t,e),t.prototype.GetConfigDetails=function(e){return this._connection.send("GetConfigDetails",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t}(K));e.WsLogaccess=void 0,Ce=e.WsLogaccess||(e.WsLogaccess={}),(Re=Ce.LogColumnType||(Ce.LogColumnType={})).global="global",Re.workunits="workunits",Re.components="components",Re.audience="audience",Re.class="class",Re.instance="instance",Re.node="node",Re.message="message",Re.logid="logid",Re.processid="processid",Re.threadid="threadid",Re.timestamp="timestamp",Re.pod="pod",(je=Ce.LogColumnValueType||(Ce.LogColumnValueType={})).string="string",je.numeric="numeric",je.datetime="datetime",je.enum="enum",(We=Ce.LogAccessType||(Ce.LogAccessType={}))[We.All=0]="All",We[We.ByJobID=1]="ByJobID",We[We.ByComponent=2]="ByComponent",We[We.ByLogType=3]="ByLogType",We[We.ByTargetAudience=4]="ByTargetAudience",We[We.BySourceInstance=5]="BySourceInstance",We[We.BySourceNode=6]="BySourceNode",We[We.ByFieldName=7]="ByFieldName",We[We.ByPod=8]="ByPod",(Fe=Ce.LogAccessFilterOperator||(Ce.LogAccessFilterOperator={}))[Fe.NONE=0]="NONE",Fe[Fe.AND=1]="AND",Fe[Fe.OR=2]="OR",(we=Ce.LogSelectColumnMode||(Ce.LogSelectColumnMode={}))[we.MIN=0]="MIN",we[we.DEFAULT=1]="DEFAULT",we[we.ALL=2]="ALL",we[we.CUSTOM=3]="CUSTOM",(Ae=Ce.SortColumType||(Ce.SortColumType={}))[Ae.ByDate=0]="ByDate",Ae[Ae.ByJobID=1]="ByJobID",Ae[Ae.ByComponent=2]="ByComponent",Ae[Ae.ByLogType=3]="ByLogType",Ae[Ae.ByTargetAudience=4]="ByTargetAudience",Ae[Ae.BySourceInstance=5]="BySourceInstance",Ae[Ae.BySourceNode=6]="BySourceNode",Ae[Ae.ByFieldName=7]="ByFieldName",Ae[Ae.ByPod=8]="ByPod",(Te=Ce.SortDirection||(Ce.SortDirection={}))[Te.ASC=0]="ASC",Te[Te.DSC=1]="DSC";var Ee,xe,Ie=function(e){function t(t){return e.call(this,t,"ws_logaccess","1.05")||this}return j(t,e),t.prototype.GetLogAccessInfo=function(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")},t.prototype.GetLogs=function(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")},t}(K),Ne=t.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts"),Me=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return j(n,t),n.prototype.GetLogAccessInfo=function(e){return void 0===e&&(e={}),this._logAccessInfo||(this._logAccessInfo=t.prototype.GetLogAccessInfo.call(this,e)),this._logAccessInfo},n.prototype.GetLogs=function(e){return t.prototype.GetLogs.call(this,e)},n.prototype.GetLogsEx=function(t){return F(this,void 0,void 0,(function(){var n,r,o,i,s,u,c,a,p,l,f,h,d,y,g,b,m,v;return w(this,(function(S){switch(S.label){case 0:return[4,this.GetLogAccessInfo()];case 1:for(c in n=S.sent(),r={},n.Columns.Column.forEach((function(e){return r[e.LogType]=e.Name})),o=function(e){var t,n={};for(var o in r)(null==e?void 0:e.fields)?n[o]=null!==(t=Object.assign.apply(Object,A([{}],e.fields,!1))[r[o]])&&void 0!==t?t:"":n[o]="";return n},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:e.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:null!==(p=t.LogLineStartFrom)&&void 0!==p?p:0,LogLineLimit:null!==(l=t.LogLineLimit)&&void 0!==l?l:100,SelectColumnMode:e.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:e.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},s=[],u=function(n){var o,i;if(n in r&&(o=Object.values(e.WsLogaccess.LogColumnType).includes(n)?n:r[n]),o){switch(o){case e.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":i=e.WsLogaccess.LogAccessType.ByJobID;break;case e.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":i=e.WsLogaccess.LogAccessType.ByTargetAudience;break;case e.WsLogaccess.LogColumnType.class:case"hpcc.log.class":i=e.WsLogaccess.LogAccessType.ByLogType;break;case e.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":i=e.WsLogaccess.LogAccessType.ByComponent;break;default:i=e.WsLogaccess.LogAccessType.ByFieldName,o=r[n]}if(Array.isArray(t[n]))t[n].forEach((function(t){i===e.WsLogaccess.LogAccessType.ByComponent&&(t+="*"),s.push({LogCategory:i,SearchField:o,SearchByValue:t})}));else{var u=t[n];i===e.WsLogaccess.LogAccessType.ByComponent&&(u+="*"),s.push({LogCategory:i,SearchField:o,SearchByValue:u})}}},t)u(c);return s.length>2?(a=i.Filter.leftBinaryFilter.BinaryLogFilter[0],s.forEach((function(t,n){var r=e.WsLogaccess.LogAccessFilterOperator.AND;n>0?(s[n-1].SearchField===t.SearchField&&(r=e.WsLogaccess.LogAccessFilterOperator.OR),n===s.length-1?(a.Operator=r,a.