From 99eda04a22a5a2a009bc3a6617ea04e608005965 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 28 Apr 2019 19:08:15 -0700 Subject: [PATCH] Fixed MeshCMD scripting bug. --- agents/MeshCmd-signed.exe | Bin 5163872 -> 5163960 bytes agents/MeshCmd64-signed.exe | Bin 5140320 -> 5140408 bytes agents/modules_meshcmd/amt-wsman.js | 2 +- agents/modules_meshcmd_min/amt-wsman.min.js | 2 +- agents/modules_meshcore/amt-wsman.js | 2 +- agents/modules_meshcore_min/amt-wsman.min.js | 2 +- package.json | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 4856ae35af0d0217993501c9327983dbc6f0b5ec..7e29833157686399beb24c626fe4687e65ad8e5d 100644 GIT binary patch delta 1279 zcmY+@drXs86aet=`}q2zylHvKOF(%E`zYhpf-Q&?5Xx}k08wO66DKdna0so%0wszX zMW7TWwk$l{L?j3Wu?T}uSwLkh9b<;Lz(!^n8*Z!`#@HcQ7X9OwbMHxRa?ZW?JZ~7n z2INE7-4Yb@Z@*rO?j^nI6CfiM8njx2Zo_~PzyS%60R>P24HyGDFaf5(444B8U+p5Rq@64McE4HM(9IYdzDJte>vX)s80;%=(qg(=~Io zMa}Cs?)7{xz|_woS7v2V49ZOBTGj)#uwUS9VY)_0@n4}F;`}v2Bu`cgBII9;3b=Ax zt$<dWSotBt&4%qNdDeW`UJ+_O%XHAxHI zp2<-nSYr>o!YS@@1Fitg@z^PZy_2KFZ=M zie7g(ibWr$%q*)cR#sd#NvGHjIc7G7XSlte!`dW!^!SM-S>q zD(Xq>VLbHDAG%aU(^zrq2mO6h9tF5=95!U^Mwa#Q5@lYU3j;PH2g|3|6^auP54n4f__573jE^;PDuYA%&S?LRw&|ht8jN<=L zs@mFHK6bgqaqW9rc9HO~N;?|==a-6lJ)^rv!kRE-FVI7@l&5_6$@!HXx=WwO%qbqn zc{m$~@%sb%oD8}+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3O-(!DCdhVgbw7=RY$T zqi?`g;b-^0xMMQ7`^3B^hb`nQwJl=7c6;gsF30Y}R=m1FbunL1sY;Ow81#P+sH+XC zV^Tr1zu!M?C>YlnV{9}>A>67K_v@F{?B7cX2j(U?MXGtJKv7joJ6GL4I+I-fiEHlD z72?{*8$+GYwtQtq?{JWc5jEweefoxqp-uHZUJR@vk z3(faVI{KbQdF_c3t#Danm&!h`lPsp&ex<8xvRr@0$kbq6p{m-LjI&I|IBvD|^SW4~ zm@DjY-JPPU(v8IiGgFlxfVWnHbUxI)+yW2Okc9+n3vtBlvz`TJMAx*W?maj$^H5#zbuNE$rd62$nn|c{pFlM9qHFGm~Rdf4LqmbApu9#+J$8|75gcBP<#Pr8L0dp?z d=9O^lxTLSwd" + selectorSet['InstanceID'] + ""; var result = ''; diff --git a/agents/modules_meshcmd_min/amt-wsman.min.js b/agents/modules_meshcmd_min/amt-wsman.min.js index 5508d86f..e8afb796 100644 --- a/agents/modules_meshcmd_min/amt-wsman.min.js +++ b/agents/modules_meshcmd_min/amt-wsman.min.js @@ -1 +1 @@ -function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('
"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+'
'+C+""+w+""+v+"";p.PerformAjax(s+"
",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if(!v){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="
";return t}return p}module.exports=WsmanStackCreateService; \ No newline at end of file +function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('
"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+'
'+C+""+w+""+v+"";p.PerformAjax(s+"
",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService; \ No newline at end of file diff --git a/agents/modules_meshcore/amt-wsman.js b/agents/modules_meshcore/amt-wsman.js index 6561bd44..16bb3c02 100644 --- a/agents/modules_meshcore/amt-wsman.js +++ b/agents/modules_meshcore/amt-wsman.js @@ -177,7 +177,7 @@ function WsmanStackCreateService(/*CreateWsmanComm, host, port, user, pass, tls, } function _PutObjToSelectorsXml(selectorSet) { - if (!selectorSet) return ''; + if ((selectorSet == null) || (selectorSet == 'null')) return ''; if (typeof selectorSet == 'string') return selectorSet; if (selectorSet['InstanceID']) return "" + selectorSet['InstanceID'] + ""; var result = ''; diff --git a/agents/modules_meshcore_min/amt-wsman.min.js b/agents/modules_meshcore_min/amt-wsman.min.js index 5508d86f..e8afb796 100644 --- a/agents/modules_meshcore_min/amt-wsman.min.js +++ b/agents/modules_meshcore_min/amt-wsman.min.js @@ -1 +1 @@ -function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('
"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+'
'+C+""+w+""+v+"";p.PerformAjax(s+"
",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if(!v){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="
";return t}return p}module.exports=WsmanStackCreateService; \ No newline at end of file +function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('
"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+'
'+C+""+w+""+v+"";p.PerformAjax(s+"
",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService; \ No newline at end of file diff --git a/package.json b/package.json index 707d43c3..db28ce6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.3-f", + "version": "0.3.3-g", "keywords": [ "Remote Management", "Intel AMT",