Built motion from commit (unavailable).|2.3.1
[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 _0x060a=['phone','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','http','request','then','error','message','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x060a,0x192));var _0xa060=function(_0x3afe1e,_0x1436b9){_0x3afe1e=_0x3afe1e-0x0;var _0x191f3e=_0x060a[_0x3afe1e];return _0x191f3e;};'use strict';var BPromise=require('bluebird');var moment=require(_0xa060('0x0'));var _=require(_0xa060('0x1'));var util=require(_0xa060('0x2'));var jayson=require(_0xa060('0x3'));var client=jayson['client'][_0xa060('0x4')]({'port':0x2329});function request(_0x562df1,_0x201517){return new BPromise(function(_0x15897e,_0x5146a7){return client[_0xa060('0x5')](_0x562df1,_0x201517)[_0xa060('0x6')](function(_0x13813c){if(_0x13813c[_0xa060('0x7')]){return _0x5146a7(_0x13813c['error'][_0xa060('0x8')]);}else{return _0x15897e(_0x13813c['result']);}})['catch'](function(_0x29aebf){return _0x5146a7(_0x29aebf);});});}exports['getSquareProject']=function(_0x1a604a){return request(_0xa060('0x9'),{'options':{'raw':![],'where':{'name':_0x1a604a},'attributes':[_0xa060('0xa')]}});};exports[_0xa060('0xb')]=function(_0x4c0b42){return request(_0xa060('0xc'),{'options':{'raw':![],'where':{'id':_0x4c0b42},'include':[{'model':'MailServerOut','as':_0xa060('0xd')}],'attributes':['id',_0xa060('0xe'),_0xa060('0xf')]}});};exports[_0xa060('0x10')]=function(_0x2567a6){return request('ShowSquareProject',{'options':{'where':{'id':_0x2567a6},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x11')]=function(_0x4850ae){return request(_0xa060('0x12'),{'options':{'where':{'id':_0x4850ae},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x13')]=function(_0x9599b7){return request(_0xa060('0x14'),{'options':{'where':{'id':_0x9599b7},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x15')]=function(_0x33d58b){return request(_0xa060('0x16'),{'options':{'where':{'id':_0x33d58b},'attributes':[_0xa060('0x17')]}});};exports[_0xa060('0x18')]=function(_0x246a4a){return request(_0xa060('0x19'),{'options':{'where':{'id':_0x246a4a},'attributes':[_0xa060('0xe')]}});};exports['getTrunkById']=function(_0x5c9f70){return request(_0xa060('0x1a'),{'options':{'where':{'id':_0x5c9f70},'attributes':[_0xa060('0xe')]}});};exports[_0xa060('0x1b')]=function(_0x19465a){return request('ShowSound',{'options':{'where':{'id':_0x19465a},'attributes':[_0xa060('0x1c')]}});};exports[_0xa060('0x1d')]=function(_0x1041da){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1041da},'include':[{'model':'Interval','as':_0xa060('0x1e')}]}});};exports[_0xa060('0x1f')]=function(_0x4e0b36){return request(_0xa060('0x20'),{'options':{'where':{'id':_0x4e0b36},'attributes':['id','name']}});};exports[_0xa060('0x21')]=function(_0x50bf7b){return request('CreateSmsMessage',{'body':_0x50bf7b});};exports[_0xa060('0x22')]=function(_0x58a2a0){return request('CreateSquareDetailsReport',{'body':_0x58a2a0});};exports[_0xa060('0x23')]=function(_0x23ee86){return request('CreateSquareReport',{'body':_[_0xa060('0x24')](_0x23ee86,{'project_name':_0x23ee86[_0xa060('0x25')],'prev_project_name':_0x23ee86[_0xa060('0x26')]||'','is_subproject':_0x23ee86[_0xa060('0x26')]?!![]:![],'leaveAt':moment()[_0xa060('0x27')](_0xa060('0x28'))})});};exports[_0xa060('0x29')]=function(_0x2b7249){return request(_0xa060('0x2a'),{'body':_0x2b7249});};exports[_0xa060('0x2b')]=function(_0x2ef293){return request('CreateSquareMessage',{'body':_0x2ef293});};exports[_0xa060('0x2c')]=function(_0xc2bdbd){return request(_0xa060('0x2d'),{'options':{'raw':![],'where':{'phone':_0xc2bdbd[_0xa060('0x2e')],'ListId':_0xc2bdbd['ListId']}}})['then'](function(_0x28f14b){if(_0x28f14b){return _0x28f14b;}return request(_0xa060('0x2f'),{'body':_0xc2bdbd});});};exports[_0xa060('0x30')]=function(_0x5a407b){return request('ShowPause',{'options':{'where':{'id':_0x5a407b},'attributes':[_0xa060('0xe')]}});};exports['agentLogin']=function(_0x5519df,_0x5e69cf){return request(_0xa060('0x31'),{'body':{'interface':_0x5e69cf},'options':{'where':_0x5519df}});};exports[_0xa060('0x32')]=function(_0x512407,_0x4a657d,_0x34cc8a){return request(_0xa060('0x33'),{'body':{'type':_0x4a657d,'uniqueid':_0x34cc8a},'options':{'where':_0x512407}});};exports[_0xa060('0x34')]=function(_0xddf18f){return request(_0xa060('0x35'),{'body':{},'options':{'where':_0xddf18f}});};exports[_0xa060('0x36')]=function(_0x4b12b1){return request(_0xa060('0x37'),{'body':{},'options':{'where':_0x4b12b1}});};