3052c89c546664c6a24ab48e2ba2ed4882980528
[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 _0xe806=['PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','agentLogin','agentPause'];(function(_0x3fbbfe,_0x5876db){var _0x22e5b9=function(_0x19f3bd){while(--_0x19f3bd){_0x3fbbfe['push'](_0x3fbbfe['shift']());}};_0x22e5b9(++_0x5876db);}(_0xe806,0x1bd));var _0x6e80=function(_0x5005b4,_0x271fe0){_0x5005b4=_0x5005b4-0x0;var _0x1f9506=_0xe806[_0x5005b4];return _0x1f9506;};'use strict';var BPromise=require(_0x6e80('0x0'));var moment=require(_0x6e80('0x1'));var _=require(_0x6e80('0x2'));var util=require(_0x6e80('0x3'));var jayson=require(_0x6e80('0x4'));var client=jayson[_0x6e80('0x5')]['http']({'port':0x2329});function request(_0x348d6c,_0x108fe0){return new BPromise(function(_0x2b1e09,_0xd02876){return client[_0x6e80('0x6')](_0x348d6c,_0x108fe0)[_0x6e80('0x7')](function(_0x30c382){if(_0x30c382['error']){return _0xd02876(_0x30c382[_0x6e80('0x8')][_0x6e80('0x9')]);}else{return _0x2b1e09(_0x30c382[_0x6e80('0xa')]);}})[_0x6e80('0xb')](function(_0x567d1a){return _0xd02876(_0x567d1a);});});}exports[_0x6e80('0xc')]=function(_0x291350){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x291350},'attributes':[_0x6e80('0xd')]}});};exports[_0x6e80('0xe')]=function(_0x3259ea){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3259ea},'include':[{'model':_0x6e80('0xf'),'as':_0x6e80('0x10')}],'attributes':['id',_0x6e80('0x11'),'email']}});};exports[_0x6e80('0x12')]=function(_0x1c0ab9){return request(_0x6e80('0x13'),{'options':{'where':{'id':_0x1c0ab9},'attributes':['name']}});};exports[_0x6e80('0x14')]=function(_0x2331b2){return request(_0x6e80('0x15'),{'options':{'where':{'id':_0x2331b2},'attributes':[_0x6e80('0x11')]}});};exports[_0x6e80('0x16')]=function(_0x829aaa){return request('ShowVariable',{'options':{'where':{'id':_0x829aaa},'attributes':[_0x6e80('0x11')]}});};exports[_0x6e80('0x17')]=function(_0x35f4fe){return request(_0x6e80('0x18'),{'options':{'where':{'id':_0x35f4fe},'attributes':[_0x6e80('0x19')]}});};exports[_0x6e80('0x1a')]=function(_0x28b1cb){return request(_0x6e80('0x1b'),{'options':{'where':{'id':_0x28b1cb},'attributes':[_0x6e80('0x11')]}});};exports['getTrunkById']=function(_0x44324e){return request('ShowTrunk',{'options':{'where':{'id':_0x44324e},'attributes':[_0x6e80('0x11')]}});};exports['getSoundById']=function(_0x2a3391){return request('ShowSound',{'options':{'where':{'id':_0x2a3391},'attributes':['save_name']}});};exports[_0x6e80('0x1c')]=function(_0x50c167){return request(_0x6e80('0x1d'),{'options':{'raw':![],'where':{'id':_0x50c167},'include':[{'model':_0x6e80('0x1e'),'as':'Intervals'}]}});};exports[_0x6e80('0x1f')]=function(_0x276314){return request(_0x6e80('0x20'),{'options':{'where':{'id':_0x276314},'attributes':['id',_0x6e80('0x11')]}});};exports['createSmsMessage']=function(_0x50fffd){return request(_0x6e80('0x21'),{'body':_0x50fffd});};exports[_0x6e80('0x22')]=function(_0x10c29c){return request(_0x6e80('0x23'),{'body':_0x10c29c});};exports[_0x6e80('0x24')]=function(_0x40150c){return request(_0x6e80('0x25'),{'body':_[_0x6e80('0x26')](_0x40150c,{'project_name':_0x40150c['arg_1'],'prev_project_name':_0x40150c[_0x6e80('0x27')]||'','is_subproject':_0x40150c[_0x6e80('0x27')]?!![]:![],'leaveAt':moment()[_0x6e80('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x6e80('0x29')]=function(_0x40804d){return request(_0x6e80('0x2a'),{'body':_0x40804d});};exports['createSquareMessage']=function(_0x492571){return request(_0x6e80('0x2b'),{'body':_0x492571});};exports[_0x6e80('0x2c')]=function(_0x69ef80){return request(_0x6e80('0x2d'),{'options':{'raw':![],'where':{'phone':_0x69ef80[_0x6e80('0x2e')],'ListId':_0x69ef80[_0x6e80('0x2f')]}}})[_0x6e80('0x7')](function(_0x44618b){if(_0x44618b){return _0x44618b;}return request('CreateCmContact',{'body':_0x69ef80});});};exports['getPauseById']=function(_0x34c7aa){return request('ShowPause',{'options':{'where':{'id':_0x34c7aa},'attributes':[_0x6e80('0x11')]}});};exports[_0x6e80('0x30')]=function(_0x1946cc,_0x4eef8b){return request('LoginUser',{'body':{'interface':_0x4eef8b},'options':{'where':_0x1946cc}});};exports[_0x6e80('0x31')]=function(_0x4171d6,_0x3b18af,_0x24c19b){return request(_0x6e80('0x32'),{'body':{'type':_0x3b18af,'uniqueid':_0x24c19b},'options':{'where':_0x4171d6}});};exports[_0x6e80('0x33')]=function(_0x1d1945){return request(_0x6e80('0x34'),{'body':{},'options':{'where':_0x1d1945}});};exports[_0x6e80('0x35')]=function(_0x9fca54){return request(_0x6e80('0x36'),{'body':{},'options':{'where':_0x9fca54}});};