fbf4a3b3c1239045bee47cb6520210fec97c51bf
[motion2.git] / server / services / ami / rpc / interval.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x65c4=['map','interval','concat','Request','IntervalIftime','intervalIftime','../../../config/logger','dialer','stack','replace','silly','intervalIftime\x20called\x20with','isArray','length','resolve','every','number','string'];(function(_0x9c8e3f,_0x2d78f1){var _0x34e2b6=function(_0x4203b6){while(--_0x4203b6){_0x9c8e3f['push'](_0x9c8e3f['shift']());}};_0x34e2b6(++_0x2d78f1);}(_0x65c4,0xa8));var _0x465c=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x65c4[_0x32d457];return _0x338386;};var logger=require(_0x465c('0x0'))(_0x465c('0x1'));var client=require('../client');function intervalIftime(_0x40275a,_0x541421){const _0x1ae1da=new Error()[_0x465c('0x2')][_0x465c('0x3')](/^Error/,'')['trim']();logger[_0x465c('0x4')](_0x465c('0x5'),_0x40275a,_0x541421,_0x1ae1da);const _0x32bdb5=Array[_0x465c('0x6')](_0x40275a);if(!_0x40275a||_0x32bdb5&&_0x40275a[_0x465c('0x7')]===0x0){return Promise[_0x465c('0x8')](![]);}else{var _0x1494d5=[];var _0x24e6e5=[];var _0x17fd52=_0x32bdb5?_0x40275a:[_0x40275a];var _0x3217d9=_0x17fd52[_0x465c('0x9')](function(_0x1fd61b){return typeof _0x1fd61b===_0x465c('0xa');});var _0x4a3bd3=_0x17fd52[_0x465c('0x9')](function(_0x33b8d0){return typeof _0x33b8d0===_0x465c('0xb');});if(!_0x3217d9&&!_0x4a3bd3){_0x1494d5=_0x17fd52[_0x465c('0xc')](function(_0x2e84cf){return _0x2e84cf['id'];});if(_0x1494d5[_0x465c('0x7')]===0x0){_0x24e6e5=_0x17fd52[_0x465c('0xc')](function(_0x5a5db5){return _0x5a5db5[_0x465c('0xd')];});}}else{if(_0x3217d9){_0x1494d5=_0x1494d5[_0x465c('0xe')](_0x17fd52);}if(_0x4a3bd3){_0x24e6e5=_0x24e6e5[_0x465c('0xe')](_0x17fd52);}}return client[_0x465c('0xf')](_0x465c('0x10'),{'intervalIds':_0x1494d5,'intervals':_0x24e6e5,'timezone':_0x541421,'log':'IntervalIftime'});}}exports[_0x465c('0x11')]=intervalIftime;