Built motion from commit (unavailable).|2.4.12
[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 _0xdf65=['getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','util','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','Smtp','email'];(function(_0x4e180e,_0x46099d){var _0x2df150=function(_0x5583c7){while(--_0x5583c7){_0x4e180e['push'](_0x4e180e['shift']());}};_0x2df150(++_0x46099d);}(_0xdf65,0x6e));var _0x5df6=function(_0x23168d,_0x1b67f2){_0x23168d=_0x23168d-0x0;var _0x2701c2=_0xdf65[_0x23168d];return _0x2701c2;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x5df6('0x0'));var util=require(_0x5df6('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x5df6('0x2')][_0x5df6('0x3')]({'port':0x2329});function request(_0x4199dc,_0x4f85c3){return new BPromise(function(_0x809cc8,_0x36a403){return client[_0x5df6('0x4')](_0x4199dc,_0x4f85c3)[_0x5df6('0x5')](function(_0x31667e){if(_0x31667e[_0x5df6('0x6')]){return _0x36a403(_0x31667e[_0x5df6('0x6')][_0x5df6('0x7')]);}else{return _0x809cc8(_0x31667e[_0x5df6('0x8')]);}})['catch'](function(_0x564a15){return _0x36a403(_0x564a15);});});}exports[_0x5df6('0x9')]=function(_0x199fd0){return request(_0x5df6('0xa'),{'options':{'raw':![],'where':{'name':_0x199fd0},'attributes':[_0x5df6('0xb')]}});};exports['getMailAccountById']=function(_0x1cc3c7){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1cc3c7},'include':[{'model':'MailServerOut','as':_0x5df6('0xc')}],'attributes':['id','name',_0x5df6('0xd')]}});};exports[_0x5df6('0xe')]=function(_0x574a1f){return request(_0x5df6('0xa'),{'options':{'where':{'id':_0x574a1f},'attributes':[_0x5df6('0xf')]}});};exports[_0x5df6('0x10')]=function(_0x46dd7e){return request(_0x5df6('0x11'),{'options':{'where':{'id':_0x46dd7e},'attributes':[_0x5df6('0xf')]}});};exports[_0x5df6('0x12')]=function(_0xbfa96b){return request(_0x5df6('0x13'),{'options':{'where':{'id':_0xbfa96b},'attributes':[_0x5df6('0xf')]}});};exports[_0x5df6('0x14')]=function(_0x357028){return request(_0x5df6('0x15'),{'options':{'where':{'id':_0x357028},'attributes':[_0x5df6('0x16')]}});};exports[_0x5df6('0x17')]=function(_0x52fc11){return request(_0x5df6('0x18'),{'options':{'where':{'id':_0x52fc11},'attributes':[_0x5df6('0xf')]}});};exports[_0x5df6('0x19')]=function(_0x3a816b){return request(_0x5df6('0x1a'),{'options':{'where':{'id':_0x3a816b},'attributes':[_0x5df6('0xf')]}});};exports[_0x5df6('0x1b')]=function(_0x40e946){return request(_0x5df6('0x1c'),{'options':{'where':{'id':_0x40e946},'attributes':[_0x5df6('0x1d')]}});};exports[_0x5df6('0x1e')]=function(_0x33c171){return request(_0x5df6('0x1f'),{'options':{'raw':![],'where':{'id':_0x33c171},'include':[{'model':'Interval','as':_0x5df6('0x20')}]}});};exports[_0x5df6('0x21')]=function(_0x26b9f0){return request(_0x5df6('0x22'),{'options':{'where':{'id':_0x26b9f0},'attributes':['id',_0x5df6('0xf')]}});};exports['createSmsMessage']=function(_0x37cdc7){return request('CreateSmsMessage',{'body':_0x37cdc7});};exports[_0x5df6('0x23')]=function(_0x238051){return request(_0x5df6('0x24'),{'body':_0x238051});};exports[_0x5df6('0x25')]=function(_0x25e685){return request(_0x5df6('0x26'),{'body':_[_0x5df6('0x27')](_0x25e685,{'project_name':_0x25e685[_0x5df6('0x28')],'prev_project_name':_0x25e685[_0x5df6('0x29')]||'','is_subproject':_0x25e685[_0x5df6('0x29')]?!![]:![],'leaveAt':moment()[_0x5df6('0x2a')](_0x5df6('0x2b'))})});};exports[_0x5df6('0x2c')]=function(_0x5f28c2){return request(_0x5df6('0x2d'),{'body':_0x5f28c2});};exports[_0x5df6('0x2e')]=function(_0x1cc801){return request(_0x5df6('0x2f'),{'body':_0x1cc801});};exports['createCmContact']=function(_0x24f8f0){return request(_0x5df6('0x30'),{'options':{'raw':![],'where':{'phone':_0x24f8f0[_0x5df6('0x31')],'ListId':_0x24f8f0[_0x5df6('0x32')]}}})[_0x5df6('0x5')](function(_0x17390d){if(_0x17390d){return _0x17390d;}return request(_0x5df6('0x33'),{'body':_0x24f8f0});});};exports[_0x5df6('0x34')]=function(_0x366212){return request(_0x5df6('0x35'),{'options':{'where':{'id':_0x366212},'attributes':[_0x5df6('0xf')]}});};exports[_0x5df6('0x36')]=function(_0x5021ee,_0x43e214){return request(_0x5df6('0x37'),{'body':{'interface':_0x43e214},'options':{'where':_0x5021ee}});};exports[_0x5df6('0x38')]=function(_0x193b7e,_0x412239,_0x33d24a){return request(_0x5df6('0x39'),{'body':{'type':_0x412239,'uniqueid':_0x33d24a},'options':{'where':_0x193b7e}});};exports[_0x5df6('0x3a')]=function(_0x369711){return request(_0x5df6('0x3b'),{'body':{},'options':{'where':_0x369711}});};exports[_0x5df6('0x3c')]=function(_0x4b75f6){return request(_0x5df6('0x3d'),{'body':{},'options':{'where':_0x4b75f6}});};