Built motion from commit e02f907f.|2.6.14
[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 _0xabfe=['../client','stack','replace','trim','silly','intervalIftime\x20called\x20with','isArray','length','resolve','every','string','map','interval','concat','Request','IntervalIftime','intervalIftime','../../../config/logger','dialer'];(function(_0x425755,_0x16e311){var _0x38c60b=function(_0x22a7fa){while(--_0x22a7fa){_0x425755['push'](_0x425755['shift']());}};_0x38c60b(++_0x16e311);}(_0xabfe,0x1a0));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};var logger=require(_0xeabf('0x0'))(_0xeabf('0x1'));var client=require(_0xeabf('0x2'));function intervalIftime(_0x181326,_0xd62eac){const _0x30ccb2=new Error()[_0xeabf('0x3')][_0xeabf('0x4')](/^Error/,'')[_0xeabf('0x5')]();logger[_0xeabf('0x6')](_0xeabf('0x7'),_0x181326,_0xd62eac,_0x30ccb2);const _0x51debc=Array[_0xeabf('0x8')](_0x181326);if(!_0x181326||_0x51debc&&_0x181326[_0xeabf('0x9')]===0x0){return Promise[_0xeabf('0xa')](![]);}else{var _0x2bed5a=[];var _0x242797=[];var _0x38e45d=_0x51debc?_0x181326:[_0x181326];var _0x1548ce=_0x38e45d[_0xeabf('0xb')](function(_0x2872be){return typeof _0x2872be==='number';});var _0x1b6a1f=_0x38e45d['every'](function(_0x21e851){return typeof _0x21e851===_0xeabf('0xc');});if(!_0x1548ce&&!_0x1b6a1f){_0x2bed5a=_0x38e45d[_0xeabf('0xd')](function(_0xfa1051){return _0xfa1051['id'];});if(_0x2bed5a[_0xeabf('0x9')]===0x0){_0x242797=_0x38e45d[_0xeabf('0xd')](function(_0x47590d){return _0x47590d[_0xeabf('0xe')];});}}else{if(_0x1548ce){_0x2bed5a=_0x2bed5a[_0xeabf('0xf')](_0x38e45d);}if(_0x1b6a1f){_0x242797=_0x242797[_0xeabf('0xf')](_0x38e45d);}}return client[_0xeabf('0x10')](_0xeabf('0x11'),{'intervalIds':_0x2bed5a,'intervals':_0x242797,'timezone':_0xd62eac,'log':_0xeabf('0x11')});}}exports[_0xeabf('0x12')]=intervalIftime;