Built motion from commit (unavailable).|2.5.5
[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 _0x371f=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0x371f,0x189));var _0xf371=function(_0x2436d5,_0x23cdb8){_0x2436d5=_0x2436d5-0x0;var _0x2db37c=_0x371f[_0x2436d5];return _0x2db37c;};'use strict';var _=require(_0xf371('0x0'));var util=require(_0xf371('0x1'));var moment=require(_0xf371('0x2'));var BPromise=require(_0xf371('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf371('0x4'));var db=require(_0xf371('0x5'))['db'];var utils=require(_0xf371('0x6'));var logger=require(_0xf371('0x7'))(_0xf371('0x8'));var config=require(_0xf371('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf371('0xa')][_0xf371('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cf566,_0x1e24b1,_0x4793e7){return new BPromise(function(_0x5c91d9,_0x55439a){return client[_0xf371('0xc')](_0x5cf566,_0x4793e7)[_0xf371('0xd')](function(_0x14b14e){logger[_0xf371('0xe')](_0xf371('0xf'),_0x1e24b1,'request\x20sent');logger[_0xf371('0x10')](_0xf371('0x11'),_0x1e24b1,'request\x20sent',JSON[_0xf371('0x12')](_0x14b14e));if(_0x14b14e[_0xf371('0x13')]){if(_0x14b14e['error'][_0xf371('0x14')]===0x1f4){logger[_0xf371('0x13')](_0xf371('0xf'),_0x1e24b1,_0x14b14e['error'][_0xf371('0x15')]);return _0x55439a(_0x14b14e['error'][_0xf371('0x15')]);}logger[_0xf371('0x13')](_0xf371('0xf'),_0x1e24b1,_0x14b14e[_0xf371('0x13')][_0xf371('0x15')]);return _0x5c91d9(_0x14b14e[_0xf371('0x13')]['message']);}else{logger[_0xf371('0xe')](_0xf371('0xf'),_0x1e24b1,_0xf371('0x16'));_0x5c91d9(_0x14b14e[_0xf371('0x17')][_0xf371('0x15')]);}})[_0xf371('0x18')](function(_0x2034f7){logger['error'](_0xf371('0xf'),_0x1e24b1,_0x2034f7);_0x55439a(_0x2034f7);});});}