2884a70fb051556b565919a76fd070029e7a446c
[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 _0xa962=['getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','then','error','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','email','getSquareProjectById','name'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xa962,0xd1));var _0x2a96=function(_0x549a84,_0x225007){_0x549a84=_0x549a84-0x0;var _0x121d5d=_0xa962[_0x549a84];return _0x121d5d;};'use strict';var BPromise=require(_0x2a96('0x0'));var moment=require(_0x2a96('0x1'));var _=require(_0x2a96('0x2'));var util=require('util');var jayson=require(_0x2a96('0x3'));var client=jayson[_0x2a96('0x4')][_0x2a96('0x5')]({'port':0x2329});function request(_0x26926c,_0x228711){return new BPromise(function(_0x551ed2,_0x464af6){return client['request'](_0x26926c,_0x228711)[_0x2a96('0x6')](function(_0x91cdfb){if(_0x91cdfb[_0x2a96('0x7')]){return _0x464af6(_0x91cdfb[_0x2a96('0x7')]['message']);}else{return _0x551ed2(_0x91cdfb['result']);}})['catch'](function(_0x254349){return _0x464af6(_0x254349);});});}exports[_0x2a96('0x8')]=function(_0x2b8ec2){return request(_0x2a96('0x9'),{'options':{'raw':![],'where':{'name':_0x2b8ec2},'attributes':['production']}});};exports[_0x2a96('0xa')]=function(_0x12ce02){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x12ce02},'include':[{'model':_0x2a96('0xb'),'as':'Smtp'}],'attributes':['id','name',_0x2a96('0xc')]}});};exports[_0x2a96('0xd')]=function(_0x241a29){return request(_0x2a96('0x9'),{'options':{'where':{'id':_0x241a29},'attributes':[_0x2a96('0xe')]}});};exports[_0x2a96('0xf')]=function(_0x494cd7){return request(_0x2a96('0x10'),{'options':{'where':{'id':_0x494cd7},'attributes':[_0x2a96('0xe')]}});};exports[_0x2a96('0x11')]=function(_0x22168d){return request(_0x2a96('0x12'),{'options':{'where':{'id':_0x22168d},'attributes':[_0x2a96('0xe')]}});};exports[_0x2a96('0x13')]=function(_0x54dd9a){return request(_0x2a96('0x14'),{'options':{'where':{'id':_0x54dd9a},'attributes':[_0x2a96('0x15')]}});};exports[_0x2a96('0x16')]=function(_0x750538){return request(_0x2a96('0x17'),{'options':{'where':{'id':_0x750538},'attributes':[_0x2a96('0xe')]}});};exports[_0x2a96('0x18')]=function(_0x39ebd8){return request(_0x2a96('0x19'),{'options':{'where':{'id':_0x39ebd8},'attributes':[_0x2a96('0xe')]}});};exports[_0x2a96('0x1a')]=function(_0x588eec){return request(_0x2a96('0x1b'),{'options':{'where':{'id':_0x588eec},'attributes':[_0x2a96('0x1c')]}});};exports['getIntervalById']=function(_0x9cee60){return request(_0x2a96('0x1d'),{'options':{'raw':![],'where':{'id':_0x9cee60},'include':[{'model':_0x2a96('0x1e'),'as':_0x2a96('0x1f')}]}});};exports[_0x2a96('0x20')]=function(_0x3d6d65){return request(_0x2a96('0x21'),{'options':{'where':{'id':_0x3d6d65},'attributes':['id',_0x2a96('0xe')]}});};exports['createSmsMessage']=function(_0x12127f){return request('CreateSmsMessage',{'body':_0x12127f});};exports[_0x2a96('0x22')]=function(_0x1aa09d){return request(_0x2a96('0x23'),{'body':_0x1aa09d});};exports[_0x2a96('0x24')]=function(_0x364b67){return request(_0x2a96('0x25'),{'body':_[_0x2a96('0x26')](_0x364b67,{'project_name':_0x364b67[_0x2a96('0x27')],'prev_project_name':_0x364b67[_0x2a96('0x28')]||'','is_subproject':_0x364b67[_0x2a96('0x28')]?!![]:![],'leaveAt':moment()[_0x2a96('0x29')](_0x2a96('0x2a'))})});};exports['createSquareRecording']=function(_0xcb6d0b){return request(_0x2a96('0x2b'),{'body':_0xcb6d0b});};exports[_0x2a96('0x2c')]=function(_0xb8b84f){return request(_0x2a96('0x2d'),{'body':_0xb8b84f});};exports[_0x2a96('0x2e')]=function(_0x30dabf){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x30dabf['phone'],'ListId':_0x30dabf['ListId']}}})['then'](function(_0x3654b8){if(_0x3654b8){return _0x3654b8;}return request('CreateCmContact',{'body':_0x30dabf});});};exports[_0x2a96('0x2f')]=function(_0x14ac21){return request('ShowPause',{'options':{'where':{'id':_0x14ac21},'attributes':[_0x2a96('0xe')]}});};exports[_0x2a96('0x30')]=function(_0xcd2a71,_0xbdf79f){return request(_0x2a96('0x31'),{'body':{'interface':_0xbdf79f},'options':{'where':_0xcd2a71}});};exports[_0x2a96('0x32')]=function(_0x16ded5,_0x441378,_0x33d483){return request(_0x2a96('0x33'),{'body':{'type':_0x441378,'uniqueid':_0x33d483},'options':{'where':_0x16ded5}});};exports[_0x2a96('0x34')]=function(_0x383b9d){return request(_0x2a96('0x35'),{'body':{},'options':{'where':_0x383b9d}});};exports[_0x2a96('0x36')]=function(_0x398c5f){return request(_0x2a96('0x37'),{'body':{},'options':{'where':_0x398c5f}});};