2843bcafc795a1643d9854d20490a7f3bbc0abb3
[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 _0xaa4c=['ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','lodash','util','client','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById'];(function(_0x36afd7,_0x1181dc){var _0x2e0da0=function(_0x2254e1){while(--_0x2254e1){_0x36afd7['push'](_0x36afd7['shift']());}};_0x2e0da0(++_0x1181dc);}(_0xaa4c,0x112));var _0xcaa4=function(_0x3450c7,_0x2aa751){_0x3450c7=_0x3450c7-0x0;var _0x23363c=_0xaa4c[_0x3450c7];return _0x23363c;};'use strict';var BPromise=require('bluebird');var moment=require(_0xcaa4('0x0'));var _=require(_0xcaa4('0x1'));var util=require(_0xcaa4('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xcaa4('0x3')][_0xcaa4('0x4')]({'port':0x2329});function request(_0x25db27,_0x244563){return new BPromise(function(_0x58ceec,_0x4091e7){return client[_0xcaa4('0x5')](_0x25db27,_0x244563)[_0xcaa4('0x6')](function(_0x56854c){if(_0x56854c[_0xcaa4('0x7')]){return _0x4091e7(_0x56854c[_0xcaa4('0x7')][_0xcaa4('0x8')]);}else{return _0x58ceec(_0x56854c[_0xcaa4('0x9')]);}})[_0xcaa4('0xa')](function(_0x3813c2){return _0x4091e7(_0x3813c2);});});}exports[_0xcaa4('0xb')]=function(_0x25b442){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x25b442},'attributes':[_0xcaa4('0xc')]}});};exports[_0xcaa4('0xd')]=function(_0x32b5c1){return request(_0xcaa4('0xe'),{'options':{'raw':![],'where':{'id':_0x32b5c1},'include':[{'model':_0xcaa4('0xf'),'as':_0xcaa4('0x10')}],'attributes':['id',_0xcaa4('0x11'),_0xcaa4('0x12')]}});};exports[_0xcaa4('0x13')]=function(_0x205714){return request(_0xcaa4('0x14'),{'options':{'where':{'id':_0x205714},'attributes':[_0xcaa4('0x11')]}});};exports[_0xcaa4('0x15')]=function(_0xf781b9){return request(_0xcaa4('0x16'),{'options':{'where':{'id':_0xf781b9},'attributes':['name']}});};exports[_0xcaa4('0x17')]=function(_0x21849c){return request('ShowVariable',{'options':{'where':{'id':_0x21849c},'attributes':[_0xcaa4('0x11')]}});};exports[_0xcaa4('0x18')]=function(_0x1884da){return request(_0xcaa4('0x19'),{'options':{'where':{'id':_0x1884da},'attributes':[_0xcaa4('0x1a')]}});};exports[_0xcaa4('0x1b')]=function(_0x3ac25f){return request(_0xcaa4('0x1c'),{'options':{'where':{'id':_0x3ac25f},'attributes':[_0xcaa4('0x11')]}});};exports[_0xcaa4('0x1d')]=function(_0x259954){return request('ShowTrunk',{'options':{'where':{'id':_0x259954},'attributes':[_0xcaa4('0x11')]}});};exports[_0xcaa4('0x1e')]=function(_0xfd7d9c){return request(_0xcaa4('0x1f'),{'options':{'where':{'id':_0xfd7d9c},'attributes':['save_name']}});};exports[_0xcaa4('0x20')]=function(_0x1a0abd){return request(_0xcaa4('0x21'),{'options':{'raw':![],'where':{'id':_0x1a0abd},'include':[{'model':_0xcaa4('0x22'),'as':_0xcaa4('0x23')}]}});};exports[_0xcaa4('0x24')]=function(_0x21c23d){return request(_0xcaa4('0x25'),{'options':{'where':{'id':_0x21c23d},'attributes':['id',_0xcaa4('0x11')]}});};exports['createSmsMessage']=function(_0x470f78){return request(_0xcaa4('0x26'),{'body':_0x470f78});};exports[_0xcaa4('0x27')]=function(_0x3c0055){return request('CreateSquareDetailsReport',{'body':_0x3c0055});};exports['createSquareReport']=function(_0xe03c8d){return request(_0xcaa4('0x28'),{'body':_['merge'](_0xe03c8d,{'project_name':_0xe03c8d[_0xcaa4('0x29')],'prev_project_name':_0xe03c8d[_0xcaa4('0x2a')]||'','is_subproject':_0xe03c8d[_0xcaa4('0x2a')]?!![]:![],'leaveAt':moment()[_0xcaa4('0x2b')](_0xcaa4('0x2c'))})});};exports['createSquareRecording']=function(_0x36fee5){return request(_0xcaa4('0x2d'),{'body':_0x36fee5});};exports[_0xcaa4('0x2e')]=function(_0x199754){return request(_0xcaa4('0x2f'),{'body':_0x199754});};exports[_0xcaa4('0x30')]=function(_0x23f1b4){return request(_0xcaa4('0x31'),{'options':{'raw':![],'where':{'phone':_0x23f1b4[_0xcaa4('0x32')],'ListId':_0x23f1b4[_0xcaa4('0x33')]}}})[_0xcaa4('0x6')](function(_0x15e37f){if(_0x15e37f){return _0x15e37f;}return request(_0xcaa4('0x34'),{'body':_0x23f1b4});});};exports[_0xcaa4('0x35')]=function(_0x50a3e3){return request(_0xcaa4('0x36'),{'options':{'where':{'id':_0x50a3e3},'attributes':[_0xcaa4('0x11')]}});};exports[_0xcaa4('0x37')]=function(_0x198eba,_0xa28cab){return request('LoginUser',{'body':{'interface':_0xa28cab},'options':{'where':_0x198eba}});};exports[_0xcaa4('0x38')]=function(_0x492698,_0x2ea03e,_0x2af0a0){return request(_0xcaa4('0x39'),{'body':{'type':_0x2ea03e,'uniqueid':_0x2af0a0},'options':{'where':_0x492698}});};exports[_0xcaa4('0x3a')]=function(_0x5b6f1f){return request('UnpauseUser',{'body':{},'options':{'where':_0x5b6f1f}});};exports[_0xcaa4('0x3b')]=function(_0x3f4fe9){return request(_0xcaa4('0x3c'),{'body':{},'options':{'where':_0x3f4fe9}});};