Built motion from commit 26159a51.|2.5.44
[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 _0x95f4=['LogoutUser','bluebird','moment','lodash','client','http','request','error','result','catch','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','then','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout'];(function(_0x12ad2b,_0x11ef50){var _0x15f472=function(_0x4e27e0){while(--_0x4e27e0){_0x12ad2b['push'](_0x12ad2b['shift']());}};_0x15f472(++_0x11ef50);}(_0x95f4,0xf1));var _0x495f=function(_0x246b1a,_0xaf7c){_0x246b1a=_0x246b1a-0x0;var _0x38fb56=_0x95f4[_0x246b1a];return _0x38fb56;};'use strict';var BPromise=require(_0x495f('0x0'));var moment=require(_0x495f('0x1'));var _=require(_0x495f('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x495f('0x3')][_0x495f('0x4')]({'port':0x2329});function request(_0x5edb36,_0x501377){return new BPromise(function(_0x87cc22,_0x22465d){return client[_0x495f('0x5')](_0x5edb36,_0x501377)['then'](function(_0x704a46){if(_0x704a46[_0x495f('0x6')]){return _0x22465d(_0x704a46[_0x495f('0x6')]['message']);}else{return _0x87cc22(_0x704a46[_0x495f('0x7')]);}})[_0x495f('0x8')](function(_0x380828){return _0x22465d(_0x380828);});});}exports['getSquareProject']=function(_0x55dc23){return request(_0x495f('0x9'),{'options':{'raw':![],'where':{'name':_0x55dc23},'attributes':['production']}});};exports[_0x495f('0xa')]=function(_0x508c3d){return request(_0x495f('0xb'),{'options':{'raw':![],'where':{'id':_0x508c3d},'include':[{'model':_0x495f('0xc'),'as':_0x495f('0xd')}],'attributes':['id',_0x495f('0xe'),'email']}});};exports[_0x495f('0xf')]=function(_0x2a3fbe){return request(_0x495f('0x9'),{'options':{'where':{'id':_0x2a3fbe},'attributes':[_0x495f('0xe')]}});};exports[_0x495f('0x10')]=function(_0x4d71bb){return request(_0x495f('0x11'),{'options':{'where':{'id':_0x4d71bb},'attributes':[_0x495f('0xe')]}});};exports[_0x495f('0x12')]=function(_0x3ce068){return request(_0x495f('0x13'),{'options':{'where':{'id':_0x3ce068},'attributes':[_0x495f('0xe')]}});};exports[_0x495f('0x14')]=function(_0x5ad821){return request(_0x495f('0x15'),{'options':{'where':{'id':_0x5ad821},'attributes':[_0x495f('0x16')]}});};exports[_0x495f('0x17')]=function(_0x135ebd){return request('ShowUser',{'options':{'where':{'id':_0x135ebd},'attributes':[_0x495f('0xe')]}});};exports[_0x495f('0x18')]=function(_0x4a0f0f){return request(_0x495f('0x19'),{'options':{'where':{'phone':_0x4a0f0f[_0x495f('0x1a')]},'attributes':['id']}});};exports[_0x495f('0x1b')]=function(_0x58bcc9){return request(_0x495f('0x1c'),{'options':{'where':{'id':_0x58bcc9},'attributes':[_0x495f('0xe')]}});};exports[_0x495f('0x1d')]=function(_0x427c0f){return request('ShowSound',{'options':{'where':{'id':_0x427c0f},'attributes':[_0x495f('0x1e')]}});};exports[_0x495f('0x1f')]=function(_0x5f2530){return request(_0x495f('0x20'),{'options':{'raw':![],'where':{'id':_0x5f2530},'include':[{'model':'Interval','as':_0x495f('0x21')}]}});};exports[_0x495f('0x22')]=function(_0x224860){return request(_0x495f('0x23'),{'options':{'where':{'id':_0x224860},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x75d4de){return request('CreateSmsMessage',{'body':_0x75d4de});};exports[_0x495f('0x24')]=function(_0x1bb86c){return request('CreateSquareDetailsReport',{'body':_0x1bb86c});};exports[_0x495f('0x25')]=function(_0x68ceb2){return request(_0x495f('0x26'),{'body':_[_0x495f('0x27')](_0x68ceb2,{'project_name':_0x68ceb2[_0x495f('0x28')],'prev_project_name':_0x68ceb2[_0x495f('0x29')]||'','is_subproject':_0x68ceb2['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x495f('0x2a'))})});};exports[_0x495f('0x2b')]=function(_0x436fbd){return request(_0x495f('0x2c'),{'body':_0x436fbd});};exports[_0x495f('0x2d')]=function(_0x3850c3){return request('CreateSquareMessage',{'body':_0x3850c3});};exports[_0x495f('0x2e')]=function(_0x26acf9){return request(_0x495f('0x2f'),{'options':{'raw':![],'where':{'phone':_0x26acf9[_0x495f('0x1a')],'ListId':_0x26acf9[_0x495f('0x30')]}}})[_0x495f('0x31')](function(_0x161b4a){if(_0x161b4a){return _0x161b4a;}return request('CreateCmContact',{'body':_0x26acf9});});};exports[_0x495f('0x32')]=function(_0x19711e){return request(_0x495f('0x33'),{'options':{'where':{'id':_0x19711e},'attributes':[_0x495f('0xe')]}});};exports[_0x495f('0x34')]=function(_0x3b8f0f,_0x193224){return request(_0x495f('0x35'),{'body':{'interface':_0x193224},'options':{'where':_0x3b8f0f}});};exports[_0x495f('0x36')]=function(_0x1933cf,_0x1e88ea,_0x56fa74){return request(_0x495f('0x37'),{'body':{'type':_0x1e88ea,'uniqueid':_0x56fa74},'options':{'where':_0x1933cf}});};exports[_0x495f('0x38')]=function(_0x2be0ab){return request(_0x495f('0x39'),{'body':{},'options':{'where':_0x2be0ab}});};exports[_0x495f('0x3a')]=function(_0x4facbf){return request(_0x495f('0x3b'),{'body':{},'options':{'where':_0x4facbf}});};