Built motion from commit ab870f9e.|2.5.44
[motion2.git] / server / api / cmList / cmList.rpc.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 _0x54db=['then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./cmList.socket','request'];(function(_0x127bb2,_0x849c5f){var _0x596034=function(_0x307a4c){while(--_0x307a4c){_0x127bb2['push'](_0x127bb2['shift']());}};_0x596034(++_0x849c5f);}(_0x54db,0x1f1));var _0xb54d=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x54db[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xb54d('0x0'));var util=require('util');var moment=require(_0xb54d('0x1'));var BPromise=require(_0xb54d('0x2'));var rs=require(_0xb54d('0x3'));var fs=require('fs');var Redis=require(_0xb54d('0x4'));var db=require(_0xb54d('0x5'))['db'];var utils=require(_0xb54d('0x6'));var logger=require(_0xb54d('0x7'))(_0xb54d('0x8'));var config=require('../../config/environment');var jayson=require(_0xb54d('0x9'));var client=jayson[_0xb54d('0xa')][_0xb54d('0xb')]({'port':0x232a});config[_0xb54d('0xc')]=_[_0xb54d('0xd')](config[_0xb54d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb54d('0xc')]));require(_0xb54d('0xe'))['register'](socket);function respondWithRpcPromise(_0x5ff6d9,_0x4840ba,_0x5d3dfa){return new BPromise(function(_0x2d907b,_0x549ec7){return client[_0xb54d('0xf')](_0x5ff6d9,_0x5d3dfa)[_0xb54d('0x10')](function(_0x3dbb3d){logger[_0xb54d('0x11')](_0xb54d('0x12'),_0x4840ba,_0xb54d('0x13'));logger['debug'](_0xb54d('0x14'),_0x4840ba,_0xb54d('0x13'),JSON[_0xb54d('0x15')](_0x3dbb3d));if(_0x3dbb3d[_0xb54d('0x16')]){if(_0x3dbb3d[_0xb54d('0x16')][_0xb54d('0x17')]===0x1f4){logger[_0xb54d('0x16')](_0xb54d('0x12'),_0x4840ba,_0x3dbb3d[_0xb54d('0x16')][_0xb54d('0x18')]);return _0x549ec7(_0x3dbb3d[_0xb54d('0x16')][_0xb54d('0x18')]);}logger[_0xb54d('0x16')](_0xb54d('0x12'),_0x4840ba,_0x3dbb3d['error'][_0xb54d('0x18')]);return _0x2d907b(_0x3dbb3d[_0xb54d('0x16')]['message']);}else{logger[_0xb54d('0x11')](_0xb54d('0x12'),_0x4840ba,'request\x20sent');_0x2d907b(_0x3dbb3d[_0xb54d('0x19')][_0xb54d('0x18')]);}})[_0xb54d('0x1a')](function(_0x538895){logger[_0xb54d('0x16')](_0xb54d('0x12'),_0x4840ba,_0x538895);_0x549ec7(_0x538895);});});}