Built motion from commit (unavailable).|2.4.2
[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 _0xf79b=['LogoutUser','moment','lodash','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xf79b,0xa0));var _0xbf79=function(_0x1e221a,_0x14fa0c){_0x1e221a=_0x1e221a-0x0;var _0x2acee4=_0xf79b[_0x1e221a];return _0x2acee4;};'use strict';var BPromise=require('bluebird');var moment=require(_0xbf79('0x0'));var _=require(_0xbf79('0x1'));var util=require('util');var jayson=require(_0xbf79('0x2'));var client=jayson[_0xbf79('0x3')][_0xbf79('0x4')]({'port':0x2329});function request(_0x5397bb,_0x469763){return new BPromise(function(_0x3ef1bb,_0x238ca0){return client[_0xbf79('0x5')](_0x5397bb,_0x469763)[_0xbf79('0x6')](function(_0x2731ea){if(_0x2731ea[_0xbf79('0x7')]){return _0x238ca0(_0x2731ea[_0xbf79('0x7')]['message']);}else{return _0x3ef1bb(_0x2731ea[_0xbf79('0x8')]);}})[_0xbf79('0x9')](function(_0x5291b3){return _0x238ca0(_0x5291b3);});});}exports[_0xbf79('0xa')]=function(_0x4e84b3){return request(_0xbf79('0xb'),{'options':{'raw':![],'where':{'name':_0x4e84b3},'attributes':['production']}});};exports[_0xbf79('0xc')]=function(_0x53ca23){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x53ca23},'include':[{'model':_0xbf79('0xd'),'as':_0xbf79('0xe')}],'attributes':['id',_0xbf79('0xf'),_0xbf79('0x10')]}});};exports[_0xbf79('0x11')]=function(_0x343ddc){return request(_0xbf79('0xb'),{'options':{'where':{'id':_0x343ddc},'attributes':[_0xbf79('0xf')]}});};exports[_0xbf79('0x12')]=function(_0xa36c06){return request(_0xbf79('0x13'),{'options':{'where':{'id':_0xa36c06},'attributes':[_0xbf79('0xf')]}});};exports[_0xbf79('0x14')]=function(_0x26ea5f){return request('ShowVariable',{'options':{'where':{'id':_0x26ea5f},'attributes':[_0xbf79('0xf')]}});};exports[_0xbf79('0x15')]=function(_0x2f4e55){return request(_0xbf79('0x16'),{'options':{'where':{'id':_0x2f4e55},'attributes':['dsn']}});};exports['getUserById']=function(_0x27c409){return request('ShowUser',{'options':{'where':{'id':_0x27c409},'attributes':[_0xbf79('0xf')]}});};exports[_0xbf79('0x17')]=function(_0x37e28b){return request('ShowTrunk',{'options':{'where':{'id':_0x37e28b},'attributes':[_0xbf79('0xf')]}});};exports[_0xbf79('0x18')]=function(_0x2bcd3a){return request('ShowSound',{'options':{'where':{'id':_0x2bcd3a},'attributes':[_0xbf79('0x19')]}});};exports[_0xbf79('0x1a')]=function(_0x169a2d){return request(_0xbf79('0x1b'),{'options':{'raw':![],'where':{'id':_0x169a2d},'include':[{'model':_0xbf79('0x1c'),'as':_0xbf79('0x1d')}]}});};exports[_0xbf79('0x1e')]=function(_0xf36665){return request(_0xbf79('0x1f'),{'options':{'where':{'id':_0xf36665},'attributes':['id',_0xbf79('0xf')]}});};exports[_0xbf79('0x20')]=function(_0x5a122a){return request(_0xbf79('0x21'),{'body':_0x5a122a});};exports[_0xbf79('0x22')]=function(_0x10e8e9){return request('CreateSquareDetailsReport',{'body':_0x10e8e9});};exports['createSquareReport']=function(_0x205955){return request(_0xbf79('0x23'),{'body':_['merge'](_0x205955,{'project_name':_0x205955['arg_1'],'prev_project_name':_0x205955[_0xbf79('0x24')]||'','is_subproject':_0x205955['arg_2']?!![]:![],'leaveAt':moment()[_0xbf79('0x25')](_0xbf79('0x26'))})});};exports[_0xbf79('0x27')]=function(_0x143e96){return request(_0xbf79('0x28'),{'body':_0x143e96});};exports['createSquareMessage']=function(_0x3c3213){return request('CreateSquareMessage',{'body':_0x3c3213});};exports['createCmContact']=function(_0x36f889){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x36f889[_0xbf79('0x29')],'ListId':_0x36f889[_0xbf79('0x2a')]}}})['then'](function(_0x2f40ba){if(_0x2f40ba){return _0x2f40ba;}return request('CreateCmContact',{'body':_0x36f889});});};exports[_0xbf79('0x2b')]=function(_0x320f6e){return request(_0xbf79('0x2c'),{'options':{'where':{'id':_0x320f6e},'attributes':[_0xbf79('0xf')]}});};exports[_0xbf79('0x2d')]=function(_0x5dba78,_0x5e11ad){return request(_0xbf79('0x2e'),{'body':{'interface':_0x5e11ad},'options':{'where':_0x5dba78}});};exports[_0xbf79('0x2f')]=function(_0x2bbf5c,_0x5d26eb,_0x5aab24){return request(_0xbf79('0x30'),{'body':{'type':_0x5d26eb,'uniqueid':_0x5aab24},'options':{'where':_0x2bbf5c}});};exports[_0xbf79('0x31')]=function(_0x34b4a4){return request(_0xbf79('0x32'),{'body':{},'options':{'where':_0x34b4a4}});};exports[_0xbf79('0x33')]=function(_0x2d0575){return request(_0xbf79('0x34'),{'body':{},'options':{'where':_0x2d0575}});};