UNPKG

@strato-automation/node-red-contrib-strato-automation

Version:
1 lines 4.06 kB
const a15_0x3a0874=a15_0xc344;(function(_0x191d0b,_0x2109ae){const _0x5ca259=a15_0xc344,_0x25e385=_0x191d0b();while(!![]){try{const _0xd7bfb0=parseInt(_0x5ca259(0xb8))/0x1+parseInt(_0x5ca259(0xd3))/0x2*(-parseInt(_0x5ca259(0xd1))/0x3)+parseInt(_0x5ca259(0xc7))/0x4+parseInt(_0x5ca259(0xb9))/0x5*(parseInt(_0x5ca259(0xcd))/0x6)+-parseInt(_0x5ca259(0xd5))/0x7+-parseInt(_0x5ca259(0xc2))/0x8*(-parseInt(_0x5ca259(0xc9))/0x9)+parseInt(_0x5ca259(0xc6))/0xa*(-parseInt(_0x5ca259(0xd0))/0xb);if(_0xd7bfb0===_0x2109ae)break;else _0x25e385['push'](_0x25e385['shift']());}catch(_0x57457b){_0x25e385['push'](_0x25e385['shift']());}}}(a15_0x384b,0x82862));function a15_0xc344(_0x3936f4,_0xe1f381){_0x3936f4=_0x3936f4-0xb6;const _0x384bd5=a15_0x384b();let _0xc34410=_0x384bd5[_0x3936f4];return _0xc34410;}const fetch=require(a15_0x3a0874(0xbd)),https=require(a15_0x3a0874(0xbc));class OCNAPIClient{constructor(_0x5aa115,_0x172df2){const _0x3d556a=a15_0x3a0874;this[_0x3d556a(0xc3)]=_0x5aa115,this[_0x3d556a(0xcf)]=_0x172df2;const _0x2d3b9e=new https['Agent']({'rejectUnauthorized':![]});this[_0x3d556a(0xd7)]=_0x2d3b9e;}[a15_0x3a0874(0xcc)](){const _0x4ef218=a15_0x3a0874,_0x174b4b=fetch(this[_0x4ef218(0xc3)]+_0x4ef218(0xd2),{'headers':{'Authorization':'Bearer\x20'+this['token']},'agent':this['httpsAgent']});return _0x174b4b;}[a15_0x3a0874(0xb7)](_0x4ade7d,_0x490df8,_0x2cba3d,_0x74d499){const _0x2a07fe=a15_0x3a0874,_0x36dc1c=this[_0x2a07fe(0xc3)]+_0x2a07fe(0xda)+_0x4ade7d+'/'+_0x490df8+'/'+_0x2cba3d,_0x12c686=fetch(_0x36dc1c,{'method':_0x2a07fe(0xc8),'body':JSON[_0x2a07fe(0xce)](_0x74d499),'headers':{'Authorization':'Bearer\x20'+this[_0x2a07fe(0xcf)],'Content-Type':_0x2a07fe(0xd9)},'agent':this[_0x2a07fe(0xd7)]});return _0x12c686;}[a15_0x3a0874(0xbf)](_0x5b51bd,_0x411a5d){const _0x3721e3=a15_0x3a0874,_0x441f9a=this[_0x3721e3(0xc3)]+_0x3721e3(0xda)+_0x5b51bd+_0x3721e3(0xba),_0x4466ca=fetch(_0x441f9a,{'method':_0x3721e3(0xc8),'body':JSON[_0x3721e3(0xce)](_0x411a5d),'headers':{'Authorization':_0x3721e3(0xbb)+this['token'],'Content-Type':_0x3721e3(0xd9)},'agent':this[_0x3721e3(0xd7)]});return _0x4466ca;}[a15_0x3a0874(0xcb)](_0x53aabb,_0x90e2f3,_0x15b5fb){const _0x41db1d=a15_0x3a0874,_0x29a0ac=this[_0x41db1d(0xc3)]+_0x41db1d(0xda)+_0x53aabb+'/'+_0x90e2f3+'/'+_0x15b5fb+_0x41db1d(0xb6),_0x149d60=fetch(_0x29a0ac,{'headers':{'Authorization':'Bearer\x20'+this[_0x41db1d(0xcf)]},'agent':this['httpsAgent']});return _0x149d60;}async['getConnectionId'](){const _0x112809=a15_0x3a0874,_0x1ef166=this[_0x112809(0xc3)]+'/bacnet/connections';return await fetch(_0x1ef166,{'headers':{'Authorization':_0x112809(0xbb)+this[_0x112809(0xcf)]},'agent':this[_0x112809(0xd7)]});}async['getTelemetry'](_0x26a727){const _0x40b9d6=a15_0x3a0874;_0x26a727[_0x40b9d6(0xc1)]=0x0,_0x26a727['useAggregationWindows']=_0x26a727[_0x40b9d6(0xc0)]||![];for(let _0x202b1d=0x0;_0x202b1d<_0x26a727[_0x40b9d6(0xc4)][_0x40b9d6(0xca)];_0x202b1d++){_0x26a727[_0x40b9d6(0xc4)][_0x202b1d][_0x40b9d6(0xd6)]=_0x40b9d6(0xd4);}const _0x356724=this['url']+_0x40b9d6(0xbe);return await fetch(_0x356724,{'method':'post','body':JSON[_0x40b9d6(0xce)](_0x26a727),'headers':{'Authorization':_0x40b9d6(0xbb)+this[_0x40b9d6(0xcf)],'Content-Type':_0x40b9d6(0xd9)},'agent':this[_0x40b9d6(0xd7)]});}}typeof module!==a15_0x3a0874(0xc5)&&typeof module[a15_0x3a0874(0xd8)]!==a15_0x3a0874(0xc5)&&(module[a15_0x3a0874(0xd8)]=OCNAPIClient);function a15_0x384b(){const _0x42aa1d=['2liaWVA','00000000-0000-0000-0000-000000000000','7230503oSpfXk','connectionId','httpsAgent','exports','application/json','/bacnet/connections/devices/','/shallow','writeObject','909275kXxJiv','5RtRHrR','/writeMultipleProperties','Bearer\x20','https','node-fetch','/bacnet/telemetry','writeMultiplePropery','useAggregationWindows','notwork','9712WDhynv','url','uniqueObjectIds','undefined','10pJvKKL','1960924cDHJxS','post','72FRQyeX','length','getShallowObject','getDevices','5292090LhbSdB','stringify','token','3424157mjsMzX','1237173BOESiw','/bacnet/connections/devices'];a15_0x384b=function(){return _0x42aa1d;};return a15_0x384b();}