4945f8e6d772302f8d99630df1732b5a485a90c7
[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 _0x18c8=['IntervalIftime','../../../config/logger','dialer','../client','stack','trim','silly','intervalIftime\x20called\x20with','length','resolve','every','number','string','map','interval','concat'];(function(_0x25df55,_0x57ea51){var _0x4863e7=function(_0x3f5780){while(--_0x3f5780){_0x25df55['push'](_0x25df55['shift']());}};_0x4863e7(++_0x57ea51);}(_0x18c8,0x1d1));var _0x818c=function(_0x654076,_0x1fceab){_0x654076=_0x654076-0x0;var _0x36892a=_0x18c8[_0x654076];return _0x36892a;};var logger=require(_0x818c('0x0'))(_0x818c('0x1'));var client=require(_0x818c('0x2'));function intervalIftime(_0x2a96cf,_0x285bf0){const _0xdfa4c8=new Error()[_0x818c('0x3')]['replace'](/^Error/,'')[_0x818c('0x4')]();logger[_0x818c('0x5')](_0x818c('0x6'),_0x2a96cf,_0x285bf0,_0xdfa4c8);const _0x1532ba=Array['isArray'](_0x2a96cf);if(!_0x2a96cf||_0x1532ba&&_0x2a96cf[_0x818c('0x7')]===0x0){return Promise[_0x818c('0x8')](![]);}else{var _0x46a768=[];var _0x56bd3b=[];var _0xe6d88b=_0x1532ba?_0x2a96cf:[_0x2a96cf];var _0xe1e14f=_0xe6d88b[_0x818c('0x9')](function(_0x2850aa){return typeof _0x2850aa===_0x818c('0xa');});var _0x59b23e=_0xe6d88b[_0x818c('0x9')](function(_0xc26d6c){return typeof _0xc26d6c===_0x818c('0xb');});if(!_0xe1e14f&&!_0x59b23e){_0x46a768=_0xe6d88b[_0x818c('0xc')](function(_0x24832d){return _0x24832d['id'];});if(_0x46a768[_0x818c('0x7')]===0x0){_0x56bd3b=_0xe6d88b[_0x818c('0xc')](function(_0x170813){return _0x170813[_0x818c('0xd')];});}}else{if(_0xe1e14f){_0x46a768=_0x46a768[_0x818c('0xe')](_0xe6d88b);}if(_0x59b23e){_0x56bd3b=_0x56bd3b[_0x818c('0xe')](_0xe6d88b);}}return client['Request']('IntervalIftime',{'intervalIds':_0x46a768,'intervals':_0x56bd3b,'timezone':_0x285bf0,'log':_0x818c('0xf')});}}exports['intervalIftime']=intervalIftime;