Built motion from commit (unavailable).|2.4.4
[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 _0xa880=['getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','result','catch','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x3a72f6,_0x31e008){var _0x4e9064=function(_0x4c3040){while(--_0x4c3040){_0x3a72f6['push'](_0x3a72f6['shift']());}};_0x4e9064(++_0x31e008);}(_0xa880,0x106));var _0x0a88=function(_0x5b142f,_0x10815a){_0x5b142f=_0x5b142f-0x0;var _0x327bbd=_0xa880[_0x5b142f];return _0x327bbd;};'use strict';var BPromise=require(_0x0a88('0x0'));var moment=require(_0x0a88('0x1'));var _=require(_0x0a88('0x2'));var util=require(_0x0a88('0x3'));var jayson=require(_0x0a88('0x4'));var client=jayson[_0x0a88('0x5')][_0x0a88('0x6')]({'port':0x2329});function request(_0x321ae4,_0x552e9d){return new BPromise(function(_0x4091c4,_0x54b485){return client['request'](_0x321ae4,_0x552e9d)[_0x0a88('0x7')](function(_0x2aac39){if(_0x2aac39[_0x0a88('0x8')]){return _0x54b485(_0x2aac39[_0x0a88('0x8')]['message']);}else{return _0x4091c4(_0x2aac39[_0x0a88('0x9')]);}})[_0x0a88('0xa')](function(_0x1d3e57){return _0x54b485(_0x1d3e57);});});}exports['getSquareProject']=function(_0x512810){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x512810},'attributes':[_0x0a88('0xb')]}});};exports[_0x0a88('0xc')]=function(_0xaed45e){return request(_0x0a88('0xd'),{'options':{'raw':![],'where':{'id':_0xaed45e},'include':[{'model':_0x0a88('0xe'),'as':_0x0a88('0xf')}],'attributes':['id',_0x0a88('0x10'),_0x0a88('0x11')]}});};exports[_0x0a88('0x12')]=function(_0x218b8d){return request('ShowSquareProject',{'options':{'where':{'id':_0x218b8d},'attributes':[_0x0a88('0x10')]}});};exports[_0x0a88('0x13')]=function(_0x367245){return request(_0x0a88('0x14'),{'options':{'where':{'id':_0x367245},'attributes':['name']}});};exports[_0x0a88('0x15')]=function(_0x2f4e7f){return request(_0x0a88('0x16'),{'options':{'where':{'id':_0x2f4e7f},'attributes':['name']}});};exports[_0x0a88('0x17')]=function(_0x3bce0a){return request(_0x0a88('0x18'),{'options':{'where':{'id':_0x3bce0a},'attributes':[_0x0a88('0x19')]}});};exports[_0x0a88('0x1a')]=function(_0x5bbe54){return request(_0x0a88('0x1b'),{'options':{'where':{'id':_0x5bbe54},'attributes':[_0x0a88('0x10')]}});};exports[_0x0a88('0x1c')]=function(_0x4ce28d){return request(_0x0a88('0x1d'),{'options':{'where':{'id':_0x4ce28d},'attributes':[_0x0a88('0x10')]}});};exports[_0x0a88('0x1e')]=function(_0x5ce88e){return request(_0x0a88('0x1f'),{'options':{'where':{'id':_0x5ce88e},'attributes':[_0x0a88('0x20')]}});};exports[_0x0a88('0x21')]=function(_0x3bb6b9){return request(_0x0a88('0x22'),{'options':{'raw':![],'where':{'id':_0x3bb6b9},'include':[{'model':'Interval','as':_0x0a88('0x23')}]}});};exports[_0x0a88('0x24')]=function(_0x2aa1e1){return request(_0x0a88('0x25'),{'options':{'where':{'id':_0x2aa1e1},'attributes':['id',_0x0a88('0x10')]}});};exports[_0x0a88('0x26')]=function(_0x46e64e){return request(_0x0a88('0x27'),{'body':_0x46e64e});};exports[_0x0a88('0x28')]=function(_0x3f7ec0){return request(_0x0a88('0x29'),{'body':_0x3f7ec0});};exports[_0x0a88('0x2a')]=function(_0xe59c31){return request('CreateSquareReport',{'body':_[_0x0a88('0x2b')](_0xe59c31,{'project_name':_0xe59c31[_0x0a88('0x2c')],'prev_project_name':_0xe59c31['arg_2']||'','is_subproject':_0xe59c31[_0x0a88('0x2d')]?!![]:![],'leaveAt':moment()[_0x0a88('0x2e')](_0x0a88('0x2f'))})});};exports[_0x0a88('0x30')]=function(_0x2cd66d){return request('CreateSquareRecording',{'body':_0x2cd66d});};exports['createSquareMessage']=function(_0x177b73){return request('CreateSquareMessage',{'body':_0x177b73});};exports['createCmContact']=function(_0x51e8ff){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x51e8ff['phone'],'ListId':_0x51e8ff[_0x0a88('0x31')]}}})[_0x0a88('0x7')](function(_0x5cee64){if(_0x5cee64){return _0x5cee64;}return request(_0x0a88('0x32'),{'body':_0x51e8ff});});};exports[_0x0a88('0x33')]=function(_0x5e40e7){return request(_0x0a88('0x34'),{'options':{'where':{'id':_0x5e40e7},'attributes':['name']}});};exports['agentLogin']=function(_0x1d0d66,_0x5656b0){return request(_0x0a88('0x35'),{'body':{'interface':_0x5656b0},'options':{'where':_0x1d0d66}});};exports['agentPause']=function(_0x59a17d,_0x4248c5,_0x28a8f3){return request(_0x0a88('0x36'),{'body':{'type':_0x4248c5,'uniqueid':_0x28a8f3},'options':{'where':_0x59a17d}});};exports[_0x0a88('0x37')]=function(_0x310844){return request(_0x0a88('0x38'),{'body':{},'options':{'where':_0x310844}});};exports['agentLogout']=function(_0x59bfd2){return request(_0x0a88('0x39'),{'body':{},'options':{'where':_0x59bfd2}});};