534445ebf2603485b36a467a9008b11fce4f9d03
[motion2.git] / server / api / userChatQueue / userChatQueue.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 _0x4690=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x37d1dd,_0x328b44){var _0x49539d=function(_0x381aa5){while(--_0x381aa5){_0x37d1dd['push'](_0x37d1dd['shift']());}};_0x49539d(++_0x328b44);}(_0x4690,0x19b));var _0x0469=function(_0x3d7793,_0x13f42a){_0x3d7793=_0x3d7793-0x0;var _0x16dc27=_0x4690[_0x3d7793];return _0x16dc27;};'use strict';var _=require(_0x0469('0x0'));var util=require(_0x0469('0x1'));var moment=require(_0x0469('0x2'));var BPromise=require(_0x0469('0x3'));var rs=require(_0x0469('0x4'));var fs=require('fs');var Redis=require(_0x0469('0x5'));var db=require(_0x0469('0x6'))['db'];var utils=require(_0x0469('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0469('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3df7c8,_0x312590,_0x1fed05){return new BPromise(function(_0x4e19b7,_0x222965){return client['request'](_0x3df7c8,_0x1fed05)[_0x0469('0x9')](function(_0x143836){logger[_0x0469('0xa')](_0x0469('0xb'),_0x312590,_0x0469('0xc'));logger['debug'](_0x0469('0xd'),_0x312590,_0x0469('0xc'),JSON[_0x0469('0xe')](_0x143836));if(_0x143836['error']){if(_0x143836[_0x0469('0xf')][_0x0469('0x10')]===0x1f4){logger[_0x0469('0xf')](_0x0469('0xb'),_0x312590,_0x143836['error'][_0x0469('0x11')]);return _0x222965(_0x143836[_0x0469('0xf')][_0x0469('0x11')]);}logger[_0x0469('0xf')](_0x0469('0xb'),_0x312590,_0x143836[_0x0469('0xf')][_0x0469('0x11')]);return _0x4e19b7(_0x143836[_0x0469('0xf')][_0x0469('0x11')]);}else{logger[_0x0469('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x312590,_0x0469('0xc'));_0x4e19b7(_0x143836[_0x0469('0x12')][_0x0469('0x11')]);}})[_0x0469('0x13')](function(_0x5aca74){logger[_0x0469('0xf')](_0x0469('0xb'),_0x312590,_0x5aca74);_0x222965(_0x5aca74);});});}