Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / services / xdr / utils.js
index 43fbaf5..eeb3e1a 100644 (file)
@@ -1 +1 @@
-const a1230_0x4eda=['stringify','seconds','debug','moment','stack','YYYY-MM-DD\x20HH:mm:ss','add','name','client','diff','xdr','sumTime','FOUND','acw','getUserByName','isBefore','info','addTime','getVoiceQueueByName','GetUser','GetVoiceQueue','error','request','type','subtractTime','result','GETVOICEQUEUEBYNAME|','then','getUserByInterface','../../config/logger','catch','NOTFOUND','format','subtract','interface','GETUSER|','isAfter','http','length'];(function(_0x4c0e4f,_0x4eda34){const _0x1c660c=function(_0x369b7b){while(--_0x369b7b){_0x4c0e4f['push'](_0x4c0e4f['shift']());}};_0x1c660c(++_0x4eda34);}(a1230_0x4eda,0xb4));const a1230_0x1c66=function(_0x4c0e4f,_0x4eda34){_0x4c0e4f=_0x4c0e4f-0x0;let _0x1c660c=a1230_0x4eda[_0x4c0e4f];return _0x1c660c;};const _0x5a27ae=a1230_0x1c66;'use strict';const jayson=require('jayson/promise'),moment=require(_0x5a27ae('0x12')),client=jayson[_0x5a27ae('0x17')][_0x5a27ae('0xd')]({'port':0x2329}),logger=require(_0x5a27ae('0x5'))(_0x5a27ae('0x19'));exports[_0x5a27ae('0x1f')]=function(_0x369b7b){const _0x59e286=_0x5a27ae;logger[_0x59e286('0x1f')](_0x369b7b);},exports[_0x5a27ae('0x11')]=function(_0x51ac87){const _0x435fba=_0x5a27ae;logger[_0x435fba('0x11')](JSON[_0x435fba('0xf')](_0x51ac87));},exports['error']=function(_0x3d1274){const _0x99a490=_0x5a27ae;logger[_0x99a490('0x24')](_0x3d1274[_0x99a490('0x13')]);},exports[_0x5a27ae('0x25')]=function(_0x3b4579,_0x6aefaa){const _0x1a1246=_0x5a27ae;return client[_0x1a1246('0x25')](_0x3b4579,{'body':_0x6aefaa})['then'](function(_0x48728a){const _0x4215d0=_0x1a1246;logger[_0x4215d0('0x11')](JSON[_0x4215d0('0xf')](_0x48728a));})['catch'](function(_0x16319a){const _0xe830b2=_0x1a1246;logger[_0xe830b2('0x24')](_0x16319a[_0xe830b2('0x13')]);});};function getUser(_0x1981e5){const _0x41f57a=_0x5a27ae;return client['request'](_0x41f57a('0x22'),{'options':{'raw':!![],'attributes':['id','internal',_0x41f57a('0x16'),_0x41f57a('0xa')],'where':_0x1981e5,'limit':0x1}})[_0x41f57a('0x3')](function(_0x265f4e){const _0x4f3b74=_0x41f57a;return logger['info'](_0x4f3b74('0xb')+JSON[_0x4f3b74('0xf')](_0x1981e5)+'|'+(_0x265f4e['result']['length']?_0x4f3b74('0x1b'):_0x4f3b74('0x7'))),_0x265f4e[_0x4f3b74('0x1')][_0x4f3b74('0xe')]?_0x265f4e['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x429bd8){return new Promise(function(_0x7f06a4){const _0x4f985d=a1230_0x1c66;return _0x429bd8?getUser({'internal':_0x429bd8})[_0x4f985d('0x3')](function(_0x7be28d){return _0x7f06a4(_0x7be28d);})[_0x4f985d('0x6')](function(_0x2a748e){const _0x44e0de=_0x4f985d;return logger[_0x44e0de('0x24')](_0x2a748e['stack']),_0x7f06a4(null);}):_0x7f06a4(null);});},exports[_0x5a27ae('0x4')]=function(_0x224f76){return new Promise(function(_0x27c2a0){const _0x59cd4a=a1230_0x1c66;return _0x224f76?getUser({'interface':_0x224f76})['then'](function(_0x2eb10a){return _0x27c2a0(_0x2eb10a);})[_0x59cd4a('0x6')](function(_0xbc13bd){const _0x15952b=_0x59cd4a;return logger[_0x15952b('0x24')](_0xbc13bd[_0x15952b('0x13')]),_0x27c2a0(null);}):_0x27c2a0(null);});},exports[_0x5a27ae('0x1d')]=function(_0x3d8d30){return new Promise(function(_0x47547c){const _0x32693a=a1230_0x1c66;return _0x3d8d30?getUser({'name':_0x3d8d30})[_0x32693a('0x3')](function(_0x45cdb5){return _0x47547c(_0x45cdb5);})[_0x32693a('0x6')](function(_0x440bea){const _0xd4932b=_0x32693a;return logger[_0xd4932b('0x24')](_0x440bea['stack']),_0x47547c(null);}):_0x47547c(null);});},exports[_0x5a27ae('0x21')]=function(_0x42ffd3){return new Promise(function(_0x2bdcb3){const _0x455c6f=a1230_0x1c66;return _0x42ffd3?client[_0x455c6f('0x25')](_0x455c6f('0x23'),{'options':{'raw':!![],'attributes':['id',_0x455c6f('0x16'),_0x455c6f('0x26'),_0x455c6f('0x1c'),'acwTimeout'],'where':{'name':_0x42ffd3},'limit':0x1}})[_0x455c6f('0x3')](function(_0x15f902){const _0x4026c3=_0x455c6f;return logger[_0x4026c3('0x1f')](_0x4026c3('0x2')+_0x42ffd3+'|'+(_0x15f902[_0x4026c3('0x1')][_0x4026c3('0xe')]?_0x4026c3('0x1b'):'NOTFOUND')),_0x2bdcb3(_0x15f902['result'][_0x4026c3('0xe')]?_0x15f902[_0x4026c3('0x1')][0x0]:null);})['catch'](function(_0x3514df){const _0x402bf8=_0x455c6f;return logger[_0x402bf8('0x24')](_0x3514df[_0x402bf8('0x13')]),_0x2bdcb3(null);}):_0x2bdcb3(null);});},exports[_0x5a27ae('0x20')]=function(_0x5db36e,_0x4806d3){const _0x3282a3=_0x5a27ae;return moment(_0x5db36e)[_0x3282a3('0x15')](_0x4806d3,_0x3282a3('0x10'))[_0x3282a3('0x8')](_0x3282a3('0x14'));},exports[_0x5a27ae('0x0')]=function(_0x3b7ebb,_0x643fc3){const _0x1aa752=_0x5a27ae;return moment(_0x3b7ebb)[_0x1aa752('0x9')](_0x643fc3,_0x1aa752('0x10'))[_0x1aa752('0x8')](_0x1aa752('0x14'));},exports['diffTime']=function(_0x4de8f0,_0x57fca5){const _0x3be68c=_0x5a27ae;return moment(_0x4de8f0)[_0x3be68c('0x18')](moment(_0x57fca5),_0x3be68c('0x10'));},exports[_0x5a27ae('0x1a')]=function(_0x37030b,_0x10ddc2){return parseInt(_0x37030b,0xa)+parseInt(_0x10ddc2,0xa);},exports['now']=function(){const _0x2ed889=_0x5a27ae;return moment()[_0x2ed889('0x8')](_0x2ed889('0x14'));},exports['isAfter']=function(_0x1c698d,_0x2f5a59){const _0x618988=_0x5a27ae;return _0x2f5a59?moment(_0x1c698d)[_0x618988('0xc')](_0x2f5a59):!![];},exports[_0x5a27ae('0x1e')]=function(_0x4d8234,_0x3fdf6c){const _0x2d5289=_0x5a27ae;if(_0x3fdf6c)return moment(_0x4d8234)[_0x2d5289('0x1e')](_0x3fdf6c);else return _0x4d8234?!![]:![];};
\ No newline at end of file
+const a1230_0x4490=['http','error','subtract','xdr','getUserByName','isAfter','GetUser','then','diff','getUserByInterface','GetVoiceQueue','name','GETVOICEQUEUEBYNAME|','result','interface','seconds','addTime','NOTFOUND','YYYY-MM-DD\x20HH:mm:ss','acw','format','type','FOUND','isBefore','getVoiceQueueByName','stringify','add','stack','length','diffTime','../../config/logger','debug','request','moment','now','getUserByInternal','jayson/promise','info','acwTimeout','catch','sumTime'];(function(_0x50442c,_0x449097){const _0x4cf776=function(_0x1c09ef){while(--_0x1c09ef){_0x50442c['push'](_0x50442c['shift']());}};_0x4cf776(++_0x449097);}(a1230_0x4490,0x193));const a1230_0x4cf7=function(_0x50442c,_0x449097){_0x50442c=_0x50442c-0x0;let _0x4cf776=a1230_0x4490[_0x50442c];return _0x4cf776;};const _0x29e46d=a1230_0x4cf7;'use strict';const jayson=require(_0x29e46d('0x2')),moment=require(_0x29e46d('0x28')),client=jayson['client'][_0x29e46d('0x7')]({'port':0x2329}),logger=require(_0x29e46d('0x25'))(_0x29e46d('0xa'));exports[_0x29e46d('0x3')]=function(_0x1c09ef){const _0x1f435f=_0x29e46d;logger[_0x1f435f('0x3')](_0x1c09ef);},exports[_0x29e46d('0x26')]=function(_0x449103){const _0x30a0d4=_0x29e46d;logger[_0x30a0d4('0x26')](JSON['stringify'](_0x449103));},exports[_0x29e46d('0x8')]=function(_0x22cc24){logger['error'](_0x22cc24['stack']);},exports[_0x29e46d('0x27')]=function(_0x31a41a,_0x3c3ee7){const _0x463ee9=_0x29e46d;return client[_0x463ee9('0x27')](_0x31a41a,{'body':_0x3c3ee7})['then'](function(_0x38d831){const _0x480ae8=_0x463ee9;logger[_0x480ae8('0x26')](JSON[_0x480ae8('0x20')](_0x38d831));})['catch'](function(_0x59d552){const _0x31cdba=_0x463ee9;logger[_0x31cdba('0x8')](_0x59d552['stack']);});};function getUser(_0x4ab8be){const _0x2b7ee4=_0x29e46d;return client[_0x2b7ee4('0x27')](_0x2b7ee4('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x2b7ee4('0x12'),_0x2b7ee4('0x15')],'where':_0x4ab8be,'limit':0x1}})[_0x2b7ee4('0xe')](function(_0x25b1bc){const _0x2d81fe=_0x2b7ee4;return logger['info']('GETUSER|'+JSON[_0x2d81fe('0x20')](_0x4ab8be)+'|'+(_0x25b1bc[_0x2d81fe('0x14')][_0x2d81fe('0x23')]?_0x2d81fe('0x1d'):'NOTFOUND')),_0x25b1bc[_0x2d81fe('0x14')][_0x2d81fe('0x23')]?_0x25b1bc[_0x2d81fe('0x14')][0x0]:null;});}exports[_0x29e46d('0x1')]=function(_0x4d2f99){return new Promise(function(_0xde4ed8){const _0x44e913=a1230_0x4cf7;return _0x4d2f99?getUser({'internal':_0x4d2f99})[_0x44e913('0xe')](function(_0x5b0133){return _0xde4ed8(_0x5b0133);})[_0x44e913('0x5')](function(_0x2caf73){const _0x4ff5b7=_0x44e913;return logger[_0x4ff5b7('0x8')](_0x2caf73['stack']),_0xde4ed8(null);}):_0xde4ed8(null);});},exports[_0x29e46d('0x10')]=function(_0x398a94){return new Promise(function(_0x331d73){const _0x58956e=a1230_0x4cf7;return _0x398a94?getUser({'interface':_0x398a94})[_0x58956e('0xe')](function(_0x33e1c7){return _0x331d73(_0x33e1c7);})[_0x58956e('0x5')](function(_0x1ec8ee){const _0x1b4ac5=_0x58956e;return logger[_0x1b4ac5('0x8')](_0x1ec8ee[_0x1b4ac5('0x22')]),_0x331d73(null);}):_0x331d73(null);});},exports[_0x29e46d('0xb')]=function(_0x10124d){return new Promise(function(_0x3e01e7){const _0xb829c0=a1230_0x4cf7;return _0x10124d?getUser({'name':_0x10124d})[_0xb829c0('0xe')](function(_0x42bbf9){return _0x3e01e7(_0x42bbf9);})['catch'](function(_0xd8385){const _0x23c044=_0xb829c0;return logger[_0x23c044('0x8')](_0xd8385['stack']),_0x3e01e7(null);}):_0x3e01e7(null);});},exports[_0x29e46d('0x1f')]=function(_0xfc9e9d){return new Promise(function(_0x3bb43b){const _0x56164=a1230_0x4cf7;return _0xfc9e9d?client[_0x56164('0x27')](_0x56164('0x11'),{'options':{'raw':!![],'attributes':['id',_0x56164('0x12'),_0x56164('0x1c'),_0x56164('0x1a'),_0x56164('0x4')],'where':{'name':_0xfc9e9d},'limit':0x1}})[_0x56164('0xe')](function(_0x90d5ed){const _0xe47f77=_0x56164;return logger[_0xe47f77('0x3')](_0xe47f77('0x13')+_0xfc9e9d+'|'+(_0x90d5ed[_0xe47f77('0x14')]['length']?_0xe47f77('0x1d'):_0xe47f77('0x18'))),_0x3bb43b(_0x90d5ed[_0xe47f77('0x14')][_0xe47f77('0x23')]?_0x90d5ed['result'][0x0]:null);})[_0x56164('0x5')](function(_0xa23cce){const _0x17fd24=_0x56164;return logger[_0x17fd24('0x8')](_0xa23cce[_0x17fd24('0x22')]),_0x3bb43b(null);}):_0x3bb43b(null);});},exports[_0x29e46d('0x17')]=function(_0xa2f004,_0x2b32d7){const _0x2026af=_0x29e46d;return moment(_0xa2f004)[_0x2026af('0x21')](_0x2b32d7,_0x2026af('0x16'))[_0x2026af('0x1b')](_0x2026af('0x19'));},exports['subtractTime']=function(_0x5aa45b,_0x5865aa){const _0x59101e=_0x29e46d;return moment(_0x5aa45b)[_0x59101e('0x9')](_0x5865aa,'seconds')[_0x59101e('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');},exports[_0x29e46d('0x24')]=function(_0x3b9b74,_0x33fd11){const _0x936a2f=_0x29e46d;return moment(_0x3b9b74)[_0x936a2f('0xf')](moment(_0x33fd11),_0x936a2f('0x16'));},exports[_0x29e46d('0x6')]=function(_0x7d3e4a,_0x2468e0){return parseInt(_0x7d3e4a,0xa)+parseInt(_0x2468e0,0xa);},exports[_0x29e46d('0x0')]=function(){const _0x56a5b2=_0x29e46d;return moment()['format'](_0x56a5b2('0x19'));},exports[_0x29e46d('0xc')]=function(_0x3611e1,_0x3fd7f8){const _0x587fc5=_0x29e46d;return _0x3fd7f8?moment(_0x3611e1)[_0x587fc5('0xc')](_0x3fd7f8):!![];},exports[_0x29e46d('0x1e')]=function(_0x4a8039,_0x15af1e){if(_0x15af1e)return moment(_0x4a8039)['isBefore'](_0x15af1e);else return _0x4a8039?!![]:![];};
\ No newline at end of file