Built motion from commit (unavailable).|2.0.74
[motion2.git] / server / services / agi / rpc / index.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 _0x9db7=['getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','lodash','jayson/promise','client','http','request','then','error','message','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals'];(function(_0x264c3d,_0x304ebc){var _0x23647c=function(_0x3ede24){while(--_0x3ede24){_0x264c3d['push'](_0x264c3d['shift']());}};_0x23647c(++_0x304ebc);}(_0x9db7,0x176));var _0x79db=function(_0x1908d8,_0x5e8448){_0x1908d8=_0x1908d8-0x0;var _0x10f91c=_0x9db7[_0x1908d8];return _0x10f91c;};'use strict';var BPromise=require('bluebird');var moment=require(_0x79db('0x0'));var _=require(_0x79db('0x1'));var util=require('util');var jayson=require(_0x79db('0x2'));var client=jayson[_0x79db('0x3')][_0x79db('0x4')]({'port':0x2329});function request(_0x4827eb,_0x56e234){return new BPromise(function(_0x2c670c,_0x3f4c03){return client[_0x79db('0x5')](_0x4827eb,_0x56e234)[_0x79db('0x6')](function(_0x5ece38){if(_0x5ece38[_0x79db('0x7')]){return _0x3f4c03(_0x5ece38[_0x79db('0x7')][_0x79db('0x8')]);}else{return _0x2c670c(_0x5ece38['result']);}})['catch'](function(_0x175888){return _0x3f4c03(_0x175888);});});}exports['getSquareProject']=function(_0x29557c){return request(_0x79db('0x9'),{'options':{'raw':![],'where':{'name':_0x29557c},'attributes':[_0x79db('0xa')]}});};exports['getMailAccountById']=function(_0x16b62d){return request(_0x79db('0xb'),{'options':{'raw':![],'where':{'id':_0x16b62d},'include':[{'model':_0x79db('0xc'),'as':_0x79db('0xd')}],'attributes':['id',_0x79db('0xe'),_0x79db('0xf')]}});};exports[_0x79db('0x10')]=function(_0x36b763){return request('ShowSquareProject',{'options':{'where':{'id':_0x36b763},'attributes':[_0x79db('0xe')]}});};exports['getVoiceQueueById']=function(_0x1fc304){return request(_0x79db('0x11'),{'options':{'where':{'id':_0x1fc304},'attributes':[_0x79db('0xe')]}});};exports['getVariableById']=function(_0x429fa2){return request(_0x79db('0x12'),{'options':{'where':{'id':_0x429fa2},'attributes':[_0x79db('0xe')]}});};exports[_0x79db('0x13')]=function(_0x44dc19){return request(_0x79db('0x14'),{'options':{'where':{'id':_0x44dc19},'attributes':[_0x79db('0x15')]}});};exports[_0x79db('0x16')]=function(_0x5ec3e0){return request('ShowUser',{'options':{'where':{'id':_0x5ec3e0},'attributes':[_0x79db('0xe')]}});};exports[_0x79db('0x17')]=function(_0x297fe7){return request(_0x79db('0x18'),{'options':{'where':{'id':_0x297fe7},'attributes':[_0x79db('0xe')]}});};exports[_0x79db('0x19')]=function(_0x319fad){return request(_0x79db('0x1a'),{'options':{'where':{'id':_0x319fad},'attributes':[_0x79db('0x1b')]}});};exports[_0x79db('0x1c')]=function(_0x40ab5f){return request(_0x79db('0x1d'),{'options':{'raw':![],'where':{'id':_0x40ab5f},'include':[{'model':_0x79db('0x1e'),'as':_0x79db('0x1f')}]}});};exports[_0x79db('0x20')]=function(_0x2881be){return request(_0x79db('0x21'),{'options':{'where':{'id':_0x2881be},'attributes':['id',_0x79db('0xe')]}});};exports[_0x79db('0x22')]=function(_0x304dd0){return request(_0x79db('0x23'),{'body':_0x304dd0});};exports[_0x79db('0x24')]=function(_0x2ff1b4){return request(_0x79db('0x25'),{'body':_0x2ff1b4});};exports[_0x79db('0x26')]=function(_0x32e6ae){return request(_0x79db('0x27'),{'body':_[_0x79db('0x28')](_0x32e6ae,{'project_name':_0x32e6ae[_0x79db('0x29')],'prev_project_name':_0x32e6ae[_0x79db('0x2a')]||'','is_subproject':_0x32e6ae[_0x79db('0x2a')]?!![]:![],'leaveAt':moment()[_0x79db('0x2b')](_0x79db('0x2c'))})});};exports['createSquareRecording']=function(_0xaecd42){return request('CreateSquareRecording',{'body':_0xaecd42});};exports[_0x79db('0x2d')]=function(_0x106b15){return request(_0x79db('0x2e'),{'options':{'raw':![],'where':{'phone':_0x106b15[_0x79db('0x2f')],'ListId':_0x106b15[_0x79db('0x30')]}}})[_0x79db('0x6')](function(_0x1a2d93){if(_0x1a2d93){return _0x1a2d93;}return request(_0x79db('0x31'),{'body':_0x106b15});});};exports[_0x79db('0x32')]=function(_0x6e4a95){return request(_0x79db('0x33'),{'options':{'where':{'id':_0x6e4a95},'attributes':['name']}});};exports[_0x79db('0x34')]=function(_0xa66ae1,_0x393782){return request('LoginUser',{'body':{'interface':_0x393782},'options':{'where':_0xa66ae1}});};exports[_0x79db('0x35')]=function(_0x1ce692,_0x353c05,_0x27bd54){return request(_0x79db('0x36'),{'body':{'type':_0x353c05,'uniqueid':_0x27bd54},'options':{'where':_0x1ce692}});};exports['agentUnpause']=function(_0xde9898){return request(_0x79db('0x37'),{'body':{},'options':{'where':_0xde9898}});};exports[_0x79db('0x38')]=function(_0x763f4a){return request(_0x79db('0x39'),{'body':{},'options':{'where':_0x763f4a}});};