Built motion from commit (unavailable).|2.5.10
[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 _0x844f=['register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./cmList.socket'];(function(_0x5ba84c,_0x46b466){var _0x119192=function(_0x4ec124){while(--_0x4ec124){_0x5ba84c['push'](_0x5ba84c['shift']());}};_0x119192(++_0x46b466);}(_0x844f,0x94));var _0xf844=function(_0x32514b,_0x3db395){_0x32514b=_0x32514b-0x0;var _0x432749=_0x844f[_0x32514b];return _0x432749;};'use strict';var _=require('lodash');var util=require(_0xf844('0x0'));var moment=require(_0xf844('0x1'));var BPromise=require(_0xf844('0x2'));var rs=require(_0xf844('0x3'));var fs=require('fs');var Redis=require(_0xf844('0x4'));var db=require(_0xf844('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf844('0x6'))(_0xf844('0x7'));var config=require(_0xf844('0x8'));var jayson=require(_0xf844('0x9'));var client=jayson[_0xf844('0xa')][_0xf844('0xb')]({'port':0x232a});config[_0xf844('0xc')]=_['defaults'](config[_0xf844('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf844('0xc')]));require(_0xf844('0xd'))[_0xf844('0xe')](socket);function respondWithRpcPromise(_0x57b696,_0x4e1049,_0x166bc7){return new BPromise(function(_0x16465d,_0xaf9f0a){return client[_0xf844('0xf')](_0x57b696,_0x166bc7)[_0xf844('0x10')](function(_0x9962ee){logger[_0xf844('0x11')](_0xf844('0x12'),_0x4e1049,_0xf844('0x13'));logger[_0xf844('0x14')](_0xf844('0x15'),_0x4e1049,_0xf844('0x13'),JSON[_0xf844('0x16')](_0x9962ee));if(_0x9962ee[_0xf844('0x17')]){if(_0x9962ee['error']['code']===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x4e1049,_0x9962ee[_0xf844('0x17')]['message']);return _0xaf9f0a(_0x9962ee[_0xf844('0x17')]['message']);}logger['error'](_0xf844('0x12'),_0x4e1049,_0x9962ee[_0xf844('0x17')]['message']);return _0x16465d(_0x9962ee[_0xf844('0x17')][_0xf844('0x18')]);}else{logger[_0xf844('0x11')](_0xf844('0x12'),_0x4e1049,_0xf844('0x13'));_0x16465d(_0x9962ee[_0xf844('0x19')]['message']);}})[_0xf844('0x1a')](function(_0x1f53ec){logger[_0xf844('0x17')]('CmList,\x20%s,\x20%s',_0x4e1049,_0x1f53ec);_0xaf9f0a(_0x1f53ec);});});}