430aeb81dbe26b861fd5f7d1b927893b1da193e4
[motion2.git] / server / api / userMailQueue / userMailQueue.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 _0x3f27=['../../config/utils','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3f27,0x1f4));var _0x73f2=function(_0x46aa9e,_0x368c3e){_0x46aa9e=_0x46aa9e-0x0;var _0x4c535e=_0x3f27[_0x46aa9e];return _0x4c535e;};'use strict';var _=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var moment=require(_0x73f2('0x2'));var BPromise=require(_0x73f2('0x3'));var rs=require(_0x73f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73f2('0x5'))['db'];var utils=require(_0x73f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x73f2('0x7'));var client=jayson[_0x73f2('0x8')][_0x73f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa8ec,_0x10af7a,_0x5efe60){return new BPromise(function(_0x521fc9,_0xa2ea48){return client[_0x73f2('0xa')](_0x4aa8ec,_0x5efe60)[_0x73f2('0xb')](function(_0x3bf117){logger[_0x73f2('0xc')](_0x73f2('0xd'),_0x10af7a,'request\x20sent');logger[_0x73f2('0xe')](_0x73f2('0xf'),_0x10af7a,_0x73f2('0x10'),JSON['stringify'](_0x3bf117));if(_0x3bf117['error']){if(_0x3bf117['error'][_0x73f2('0x11')]===0x1f4){logger[_0x73f2('0x12')](_0x73f2('0xd'),_0x10af7a,_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);return _0xa2ea48(_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x10af7a,_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);return _0x521fc9(_0x3bf117['error']['message']);}else{logger[_0x73f2('0xc')](_0x73f2('0xd'),_0x10af7a,_0x73f2('0x10'));_0x521fc9(_0x3bf117[_0x73f2('0x14')][_0x73f2('0x13')]);}})[_0x73f2('0x15')](function(_0x32e9c6){logger[_0x73f2('0x12')](_0x73f2('0xd'),_0x10af7a,_0x32e9c6);_0xa2ea48(_0x32e9c6);});});}