Built motion from commit 192134f6.|2.6.25
[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 _0x1629=['catch','production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','phone','ListId','then','CreateCmContact','agentLogin','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request','error','message','result'];(function(_0xca6c14,_0xff6f6c){var _0x5d1096=function(_0x5276e6){while(--_0x5276e6){_0xca6c14['push'](_0xca6c14['shift']());}};_0x5d1096(++_0xff6f6c);}(_0x1629,0x1d8));var _0x9162=function(_0x21b798,_0x45a4bd){_0x21b798=_0x21b798-0x0;var _0xcdae9f=_0x1629[_0x21b798];return _0xcdae9f;};'use strict';var _=require(_0x9162('0x0'));var moment=require(_0x9162('0x1'));var jayson=require(_0x9162('0x2'));var client=jayson[_0x9162('0x3')]['http']({'port':0x2329});function request(_0x31e5fc,_0x567431){return new Promise(function(_0x5380c8,_0x16bc88){return client[_0x9162('0x4')](_0x31e5fc,_0x567431)['then'](function(_0x5c6863){if(_0x5c6863[_0x9162('0x5')]){return _0x16bc88(_0x5c6863[_0x9162('0x5')][_0x9162('0x6')]);}else{return _0x5380c8(_0x5c6863[_0x9162('0x7')]);}})[_0x9162('0x8')](function(_0x168267){return _0x16bc88(_0x168267);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x9162('0x9')]}});};exports[_0x9162('0xa')]=function(_0x5900c2){return request(_0x9162('0xb'),{'options':{'raw':![],'where':{'name':_0x5900c2},'attributes':['production']}});};exports[_0x9162('0xc')]=function(_0x35e7bd){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x35e7bd},'include':[{'model':_0x9162('0xd'),'as':_0x9162('0xe'),'include':[{'model':'CloudProvider','as':_0x9162('0xf')}]}],'attributes':['id',_0x9162('0x10'),_0x9162('0x11')],'smtp':!![]}});};exports[_0x9162('0x12')]=function(_0x1a1fcf){return request(_0x9162('0xb'),{'options':{'where':{'id':_0x1a1fcf},'attributes':[_0x9162('0x10')]}});};exports[_0x9162('0x13')]=function(_0x2c2fd1){return request(_0x9162('0x14'),{'options':{'where':{'id':_0x2c2fd1},'attributes':[_0x9162('0x10')]}});};exports['getVariableById']=function(_0x1bc9aa){return request(_0x9162('0x15'),{'options':{'where':{'id':_0x1bc9aa},'attributes':['name']}});};exports[_0x9162('0x16')]=function(_0x2585d0){return request(_0x9162('0x17'),{'options':{'where':{'id':_0x2585d0},'attributes':[_0x9162('0x18')]}});};exports[_0x9162('0x19')]=function(_0xa259c2){return request(_0x9162('0x1a'),{'options':{'where':{'id':_0xa259c2},'attributes':[_0x9162('0x10')]}});};exports[_0x9162('0x1b')]=function(_0x26afe3){return request('GetContactByPhone',{'options':{'where':{'phone':_0x26afe3['phone']},'attributes':['id']}});};exports[_0x9162('0x1c')]=function(_0x3c2cae){return request(_0x9162('0x1d'),{'options':{'where':{'id':_0x3c2cae},'attributes':['name']}});};exports[_0x9162('0x1e')]=function(_0x4fbd09){return request('ShowSound',{'options':{'where':{'id':_0x4fbd09},'attributes':[_0x9162('0x1f')]}});};exports[_0x9162('0x20')]=function(_0x403ee1){return request(_0x9162('0x21'),{'options':{'raw':![],'where':{'id':_0x403ee1},'include':[{'model':_0x9162('0x22'),'as':_0x9162('0x23')}]}});};exports[_0x9162('0x24')]=function(_0x2bfc85){return request(_0x9162('0x25'),{'options':{'where':{'id':_0x2bfc85},'attributes':['id',_0x9162('0x10')]}});};exports[_0x9162('0x26')]=function(_0xb8adf5){return request(_0x9162('0x27'),{'body':_0xb8adf5});};exports[_0x9162('0x28')]=function(_0x37973e){return request(_0x9162('0x29'),{'body':_0x37973e});};exports[_0x9162('0x2a')]=function(_0x19fd2b){return request(_0x9162('0x2b'),{'body':_[_0x9162('0x2c')](_0x19fd2b,{'project_name':_0x19fd2b[_0x9162('0x2d')],'prev_project_name':_0x19fd2b[_0x9162('0x2e')]||'','is_subproject':_0x19fd2b[_0x9162('0x2e')]?!![]:![],'leaveAt':moment()[_0x9162('0x2f')](_0x9162('0x30'))})});};exports['createSquareRecording']=function(_0x25599d){return request(_0x9162('0x31'),{'body':_0x25599d});};exports[_0x9162('0x32')]=function(_0x39d2af){return request('CreateSquareMessage',{'body':_0x39d2af});};exports['createCmContact']=function(_0x1511ff){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1511ff[_0x9162('0x33')],'ListId':_0x1511ff[_0x9162('0x34')]}}})[_0x9162('0x35')](function(_0x19bfa3){if(_0x19bfa3){return _0x19bfa3;}return request(_0x9162('0x36'),{'body':_0x1511ff});});};exports['getPauseById']=function(_0x208235){return request('ShowPause',{'options':{'where':{'id':_0x208235},'attributes':[_0x9162('0x10')]}});};exports[_0x9162('0x37')]=function(_0x1a2d17,_0x54abdc){return request('LoginUser',{'body':{'interface':_0x54abdc},'options':{'where':_0x1a2d17}});};exports['agentPause']=function(_0x192c3b,_0xfb9d60,_0xee7764){return request(_0x9162('0x38'),{'body':{'type':_0xfb9d60,'uniqueid':_0xee7764},'options':{'where':_0x192c3b}});};exports['agentUnpause']=function(_0x2faf71){return request(_0x9162('0x39'),{'body':{},'options':{'where':_0x2faf71}});};exports[_0x9162('0x3a')]=function(_0x2aafdb){return request(_0x9162('0x3b'),{'body':{},'options':{'where':_0x2aafdb}});};