Built motion from commit (unavailable).|2.3.91
[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 _0x9431=['getSoundById','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','ShowCmHopper','phone','ListId','then','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','bluebird','moment','lodash','client','http','request','message','catch','ShowSquareProject','production','MailServerOut','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','dsn','getUserById','getTrunkById','ShowTrunk'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x9431,0xa8));var _0x1943=function(_0x45ab2a,_0x2362fd){_0x45ab2a=_0x45ab2a-0x0;var _0x2a64ce=_0x9431[_0x45ab2a];return _0x2a64ce;};'use strict';var BPromise=require(_0x1943('0x0'));var moment=require(_0x1943('0x1'));var _=require(_0x1943('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x1943('0x3')][_0x1943('0x4')]({'port':0x2329});function request(_0x59d0f3,_0x5e74aa){return new BPromise(function(_0x40ec64,_0x3e2ad1){return client[_0x1943('0x5')](_0x59d0f3,_0x5e74aa)['then'](function(_0x276552){if(_0x276552['error']){return _0x3e2ad1(_0x276552['error'][_0x1943('0x6')]);}else{return _0x40ec64(_0x276552['result']);}})[_0x1943('0x7')](function(_0x2b7632){return _0x3e2ad1(_0x2b7632);});});}exports['getSquareProject']=function(_0x50488f){return request(_0x1943('0x8'),{'options':{'raw':![],'where':{'name':_0x50488f},'attributes':[_0x1943('0x9')]}});};exports['getMailAccountById']=function(_0x50bb54){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x50bb54},'include':[{'model':_0x1943('0xa'),'as':'Smtp'}],'attributes':['id',_0x1943('0xb'),'email']}});};exports[_0x1943('0xc')]=function(_0x7c0317){return request(_0x1943('0x8'),{'options':{'where':{'id':_0x7c0317},'attributes':[_0x1943('0xb')]}});};exports[_0x1943('0xd')]=function(_0x2c02eb){return request(_0x1943('0xe'),{'options':{'where':{'id':_0x2c02eb},'attributes':[_0x1943('0xb')]}});};exports['getVariableById']=function(_0x386918){return request('ShowVariable',{'options':{'where':{'id':_0x386918},'attributes':[_0x1943('0xb')]}});};exports[_0x1943('0xf')]=function(_0x387889){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x387889},'attributes':[_0x1943('0x10')]}});};exports[_0x1943('0x11')]=function(_0x69e98a){return request('ShowUser',{'options':{'where':{'id':_0x69e98a},'attributes':[_0x1943('0xb')]}});};exports[_0x1943('0x12')]=function(_0x3a2e1f){return request(_0x1943('0x13'),{'options':{'where':{'id':_0x3a2e1f},'attributes':['name']}});};exports[_0x1943('0x14')]=function(_0xea5bd){return request('ShowSound',{'options':{'where':{'id':_0xea5bd},'attributes':[_0x1943('0x15')]}});};exports[_0x1943('0x16')]=function(_0x4ce329){return request(_0x1943('0x17'),{'options':{'raw':![],'where':{'id':_0x4ce329},'include':[{'model':_0x1943('0x18'),'as':'Intervals'}]}});};exports[_0x1943('0x19')]=function(_0x5c0c37){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5c0c37},'attributes':['id',_0x1943('0xb')]}});};exports[_0x1943('0x1a')]=function(_0x53f066){return request(_0x1943('0x1b'),{'body':_0x53f066});};exports[_0x1943('0x1c')]=function(_0x3f9e9d){return request(_0x1943('0x1d'),{'body':_0x3f9e9d});};exports['createSquareReport']=function(_0x3bccea){return request(_0x1943('0x1e'),{'body':_[_0x1943('0x1f')](_0x3bccea,{'project_name':_0x3bccea[_0x1943('0x20')],'prev_project_name':_0x3bccea[_0x1943('0x21')]||'','is_subproject':_0x3bccea[_0x1943('0x21')]?!![]:![],'leaveAt':moment()[_0x1943('0x22')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x215c07){return request(_0x1943('0x23'),{'body':_0x215c07});};exports['createSquareMessage']=function(_0x104afd){return request('CreateSquareMessage',{'body':_0x104afd});};exports['createCmContact']=function(_0x49d663){return request(_0x1943('0x24'),{'options':{'raw':![],'where':{'phone':_0x49d663[_0x1943('0x25')],'ListId':_0x49d663[_0x1943('0x26')]}}})[_0x1943('0x27')](function(_0x406645){if(_0x406645){return _0x406645;}return request('CreateCmContact',{'body':_0x49d663});});};exports[_0x1943('0x28')]=function(_0x44f1b4){return request(_0x1943('0x29'),{'options':{'where':{'id':_0x44f1b4},'attributes':['name']}});};exports[_0x1943('0x2a')]=function(_0x11725d,_0x15ee88){return request(_0x1943('0x2b'),{'body':{'interface':_0x15ee88},'options':{'where':_0x11725d}});};exports['agentPause']=function(_0x22cf65,_0xc29689,_0x30a62f){return request(_0x1943('0x2c'),{'body':{'type':_0xc29689,'uniqueid':_0x30a62f},'options':{'where':_0x22cf65}});};exports[_0x1943('0x2d')]=function(_0x26fe19){return request(_0x1943('0x2e'),{'body':{},'options':{'where':_0x26fe19}});};exports['agentLogout']=function(_0x1cb637){return request('LogoutUser',{'body':{},'options':{'where':_0x1cb637}});};