Built motion from commit (unavailable).|2.0.84
[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 _0x1fcd=['getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','moment','lodash','util','jayson/promise','client','http','request','then','error','result','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById'];(function(_0x1782b2,_0x3a63b8){var _0x182e34=function(_0x141f87){while(--_0x141f87){_0x1782b2['push'](_0x1782b2['shift']());}};_0x182e34(++_0x3a63b8);}(_0x1fcd,0x19e));var _0xd1fc=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x1fcd[_0x2e0443];return _0x52d450;};'use strict';var BPromise=require('bluebird');var moment=require(_0xd1fc('0x0'));var _=require(_0xd1fc('0x1'));var util=require(_0xd1fc('0x2'));var jayson=require(_0xd1fc('0x3'));var client=jayson[_0xd1fc('0x4')][_0xd1fc('0x5')]({'port':0x2329});function request(_0x51c83b,_0x5af116){return new BPromise(function(_0xdde06e,_0x1b3a97){return client[_0xd1fc('0x6')](_0x51c83b,_0x5af116)[_0xd1fc('0x7')](function(_0x2433b3){if(_0x2433b3[_0xd1fc('0x8')]){return _0x1b3a97(_0x2433b3[_0xd1fc('0x8')]['message']);}else{return _0xdde06e(_0x2433b3[_0xd1fc('0x9')]);}})['catch'](function(_0x58fc9d){return _0x1b3a97(_0x58fc9d);});});}exports[_0xd1fc('0xa')]=function(_0x20920a){return request(_0xd1fc('0xb'),{'options':{'raw':![],'where':{'name':_0x20920a},'attributes':[_0xd1fc('0xc')]}});};exports[_0xd1fc('0xd')]=function(_0xdf6500){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xdf6500},'include':[{'model':_0xd1fc('0xe'),'as':_0xd1fc('0xf')}],'attributes':['id','name','email']}});};exports[_0xd1fc('0x10')]=function(_0x2a225f){return request('ShowSquareProject',{'options':{'where':{'id':_0x2a225f},'attributes':[_0xd1fc('0x11')]}});};exports[_0xd1fc('0x12')]=function(_0x41d0e2){return request(_0xd1fc('0x13'),{'options':{'where':{'id':_0x41d0e2},'attributes':[_0xd1fc('0x11')]}});};exports[_0xd1fc('0x14')]=function(_0xd32135){return request('ShowVariable',{'options':{'where':{'id':_0xd32135},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x576280){return request(_0xd1fc('0x15'),{'options':{'where':{'id':_0x576280},'attributes':[_0xd1fc('0x16')]}});};exports[_0xd1fc('0x17')]=function(_0x16b17e){return request(_0xd1fc('0x18'),{'options':{'where':{'id':_0x16b17e},'attributes':['name']}});};exports[_0xd1fc('0x19')]=function(_0x2727c6){return request('ShowTrunk',{'options':{'where':{'id':_0x2727c6},'attributes':['name']}});};exports[_0xd1fc('0x1a')]=function(_0x21e321){return request('ShowSound',{'options':{'where':{'id':_0x21e321},'attributes':[_0xd1fc('0x1b')]}});};exports[_0xd1fc('0x1c')]=function(_0x7b29b6){return request(_0xd1fc('0x1d'),{'options':{'raw':![],'where':{'id':_0x7b29b6},'include':[{'model':_0xd1fc('0x1e'),'as':_0xd1fc('0x1f')}]}});};exports['getSmsAccountById']=function(_0x4d4cbc){return request(_0xd1fc('0x20'),{'options':{'where':{'id':_0x4d4cbc},'attributes':['id',_0xd1fc('0x11')]}});};exports[_0xd1fc('0x21')]=function(_0xf6faba){return request('CreateSmsMessage',{'body':_0xf6faba});};exports['createSquareDetailsReport']=function(_0x249d6d){return request(_0xd1fc('0x22'),{'body':_0x249d6d});};exports['createSquareReport']=function(_0x254265){return request(_0xd1fc('0x23'),{'body':_['merge'](_0x254265,{'project_name':_0x254265[_0xd1fc('0x24')],'prev_project_name':_0x254265[_0xd1fc('0x25')]||'','is_subproject':_0x254265[_0xd1fc('0x25')]?!![]:![],'leaveAt':moment()['format'](_0xd1fc('0x26'))})});};exports['createSquareRecording']=function(_0x5e1d90){return request(_0xd1fc('0x27'),{'body':_0x5e1d90});};exports[_0xd1fc('0x28')]=function(_0x3290c3){return request(_0xd1fc('0x29'),{'body':_0x3290c3});};exports[_0xd1fc('0x2a')]=function(_0x4307f7){return request(_0xd1fc('0x2b'),{'options':{'raw':![],'where':{'phone':_0x4307f7[_0xd1fc('0x2c')],'ListId':_0x4307f7[_0xd1fc('0x2d')]}}})[_0xd1fc('0x7')](function(_0x103c0a){if(_0x103c0a){return _0x103c0a;}return request('CreateCmContact',{'body':_0x4307f7});});};exports[_0xd1fc('0x2e')]=function(_0x22693e){return request(_0xd1fc('0x2f'),{'options':{'where':{'id':_0x22693e},'attributes':['name']}});};exports[_0xd1fc('0x30')]=function(_0x4d716d,_0xa8a3f7){return request(_0xd1fc('0x31'),{'body':{'interface':_0xa8a3f7},'options':{'where':_0x4d716d}});};exports[_0xd1fc('0x32')]=function(_0x1512e0,_0x6409cc,_0x127007){return request(_0xd1fc('0x33'),{'body':{'type':_0x6409cc,'uniqueid':_0x127007},'options':{'where':_0x1512e0}});};exports[_0xd1fc('0x34')]=function(_0x564f04){return request(_0xd1fc('0x35'),{'body':{},'options':{'where':_0x564f04}});};exports[_0xd1fc('0x36')]=function(_0x18a138){return request('LogoutUser',{'body':{},'options':{'where':_0x18a138}});};