Built motion from commit (unavailable).|2.5.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 _0xb7e2=['error','message','result','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','CreateSmsMessage','createSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','jayson/promise','http','request','then'];(function(_0x137280,_0x484783){var _0x39b8e8=function(_0x1c5a9e){while(--_0x1c5a9e){_0x137280['push'](_0x137280['shift']());}};_0x39b8e8(++_0x484783);}(_0xb7e2,0x103));var _0x2b7e=function(_0x253650,_0x3b3f7f){_0x253650=_0x253650-0x0;var _0xdcfcfa=_0xb7e2[_0x253650];return _0xdcfcfa;};'use strict';var BPromise=require(_0x2b7e('0x0'));var moment=require('moment');var _=require(_0x2b7e('0x1'));var util=require('util');var jayson=require(_0x2b7e('0x2'));var client=jayson['client'][_0x2b7e('0x3')]({'port':0x2329});function request(_0x5b800e,_0x1c4c9d){return new BPromise(function(_0x3921a8,_0x21ccc4){return client[_0x2b7e('0x4')](_0x5b800e,_0x1c4c9d)[_0x2b7e('0x5')](function(_0x93733a){if(_0x93733a['error']){return _0x21ccc4(_0x93733a[_0x2b7e('0x6')][_0x2b7e('0x7')]);}else{return _0x3921a8(_0x93733a[_0x2b7e('0x8')]);}})['catch'](function(_0x2cbe5e){return _0x21ccc4(_0x2cbe5e);});});}exports[_0x2b7e('0x9')]=function(_0x2f5991){return request(_0x2b7e('0xa'),{'options':{'raw':![],'where':{'name':_0x2f5991},'attributes':[_0x2b7e('0xb')]}});};exports['getMailAccountById']=function(_0x48ed94){return request(_0x2b7e('0xc'),{'options':{'raw':![],'where':{'id':_0x48ed94},'include':[{'model':_0x2b7e('0xd'),'as':_0x2b7e('0xe')}],'attributes':['id',_0x2b7e('0xf'),_0x2b7e('0x10')]}});};exports[_0x2b7e('0x11')]=function(_0x1792c7){return request('ShowSquareProject',{'options':{'where':{'id':_0x1792c7},'attributes':[_0x2b7e('0xf')]}});};exports[_0x2b7e('0x12')]=function(_0x16a550){return request(_0x2b7e('0x13'),{'options':{'where':{'id':_0x16a550},'attributes':['name']}});};exports['getVariableById']=function(_0x4aaa1a){return request(_0x2b7e('0x14'),{'options':{'where':{'id':_0x4aaa1a},'attributes':['name']}});};exports[_0x2b7e('0x15')]=function(_0x49a2f0){return request(_0x2b7e('0x16'),{'options':{'where':{'id':_0x49a2f0},'attributes':['dsn']}});};exports[_0x2b7e('0x17')]=function(_0x2bd651){return request(_0x2b7e('0x18'),{'options':{'where':{'id':_0x2bd651},'attributes':['name']}});};exports[_0x2b7e('0x19')]=function(_0x27a30a){return request('ShowTrunk',{'options':{'where':{'id':_0x27a30a},'attributes':[_0x2b7e('0xf')]}});};exports[_0x2b7e('0x1a')]=function(_0x726509){return request('ShowSound',{'options':{'where':{'id':_0x726509},'attributes':[_0x2b7e('0x1b')]}});};exports[_0x2b7e('0x1c')]=function(_0x627ca1){return request(_0x2b7e('0x1d'),{'options':{'raw':![],'where':{'id':_0x627ca1},'include':[{'model':_0x2b7e('0x1e'),'as':'Intervals'}]}});};exports[_0x2b7e('0x1f')]=function(_0x4922b3){return request('ShowSmsAccount',{'options':{'where':{'id':_0x4922b3},'attributes':['id',_0x2b7e('0xf')]}});};exports['createSmsMessage']=function(_0x3ebfd6){return request(_0x2b7e('0x20'),{'body':_0x3ebfd6});};exports['createSquareDetailsReport']=function(_0x416aba){return request('CreateSquareDetailsReport',{'body':_0x416aba});};exports[_0x2b7e('0x21')]=function(_0x22b174){return request('CreateSquareReport',{'body':_['merge'](_0x22b174,{'project_name':_0x22b174[_0x2b7e('0x22')],'prev_project_name':_0x22b174[_0x2b7e('0x23')]||'','is_subproject':_0x22b174[_0x2b7e('0x23')]?!![]:![],'leaveAt':moment()[_0x2b7e('0x24')](_0x2b7e('0x25'))})});};exports[_0x2b7e('0x26')]=function(_0x41b68b){return request(_0x2b7e('0x27'),{'body':_0x41b68b});};exports[_0x2b7e('0x28')]=function(_0x2cb021){return request(_0x2b7e('0x29'),{'body':_0x2cb021});};exports[_0x2b7e('0x2a')]=function(_0x19824e){return request(_0x2b7e('0x2b'),{'options':{'raw':![],'where':{'phone':_0x19824e['phone'],'ListId':_0x19824e[_0x2b7e('0x2c')]}}})[_0x2b7e('0x5')](function(_0x71bd57){if(_0x71bd57){return _0x71bd57;}return request(_0x2b7e('0x2d'),{'body':_0x19824e});});};exports[_0x2b7e('0x2e')]=function(_0x5d568b){return request(_0x2b7e('0x2f'),{'options':{'where':{'id':_0x5d568b},'attributes':[_0x2b7e('0xf')]}});};exports['agentLogin']=function(_0x190438,_0x5e3315){return request(_0x2b7e('0x30'),{'body':{'interface':_0x5e3315},'options':{'where':_0x190438}});};exports['agentPause']=function(_0x958f43,_0x23b9cf,_0x1f6c89){return request(_0x2b7e('0x31'),{'body':{'type':_0x23b9cf,'uniqueid':_0x1f6c89},'options':{'where':_0x958f43}});};exports['agentUnpause']=function(_0xa78818){return request(_0x2b7e('0x32'),{'body':{},'options':{'where':_0xa78818}});};exports[_0x2b7e('0x33')]=function(_0x1c9ba5){return request(_0x2b7e('0x34'),{'body':{},'options':{'where':_0x1c9ba5}});};