Built motion from commit 753c950e.|2.5.42
[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 _0xce1d=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xce1d,0xe2));var _0xdce1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xce1d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdce1('0x0'));var util=require('util');var moment=require(_0xdce1('0x1'));var BPromise=require(_0xdce1('0x2'));var rs=require(_0xdce1('0x3'));var fs=require('fs');var Redis=require(_0xdce1('0x4'));var db=require(_0xdce1('0x5'))['db'];var utils=require(_0xdce1('0x6'));var logger=require(_0xdce1('0x7'))(_0xdce1('0x8'));var config=require(_0xdce1('0x9'));var jayson=require(_0xdce1('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xdce1('0xb')](config[_0xdce1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdce1('0xd'))(new Redis(config[_0xdce1('0xc')]));require(_0xdce1('0xe'))[_0xdce1('0xf')](socket);function respondWithRpcPromise(_0x1f2cc2,_0x3dcef4,_0x117b83){return new BPromise(function(_0x2ef9e0,_0x45db20){return client[_0xdce1('0x10')](_0x1f2cc2,_0x117b83)[_0xdce1('0x11')](function(_0x2d3ab6){logger[_0xdce1('0x12')](_0xdce1('0x13'),_0x3dcef4,_0xdce1('0x14'));logger[_0xdce1('0x15')](_0xdce1('0x16'),_0x3dcef4,_0xdce1('0x14'),JSON[_0xdce1('0x17')](_0x2d3ab6));if(_0x2d3ab6[_0xdce1('0x18')]){if(_0x2d3ab6['error'][_0xdce1('0x19')]===0x1f4){logger['error'](_0xdce1('0x13'),_0x3dcef4,_0x2d3ab6[_0xdce1('0x18')][_0xdce1('0x1a')]);return _0x45db20(_0x2d3ab6[_0xdce1('0x18')][_0xdce1('0x1a')]);}logger['error'](_0xdce1('0x13'),_0x3dcef4,_0x2d3ab6[_0xdce1('0x18')][_0xdce1('0x1a')]);return _0x2ef9e0(_0x2d3ab6['error'][_0xdce1('0x1a')]);}else{logger[_0xdce1('0x12')]('CmList,\x20%s,\x20%s',_0x3dcef4,_0xdce1('0x14'));_0x2ef9e0(_0x2d3ab6[_0xdce1('0x1b')][_0xdce1('0x1a')]);}})['catch'](function(_0x2203fd){logger[_0xdce1('0x18')](_0xdce1('0x13'),_0x3dcef4,_0x2203fd);_0x45db20(_0x2203fd);});});}