Built motion from commit (unavailable).|2.5.30
[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 _0xb7ae=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x23e734,_0x135d92){var _0x1e5f06=function(_0x2e83a2){while(--_0x2e83a2){_0x23e734['push'](_0x23e734['shift']());}};_0x1e5f06(++_0x135d92);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x169c05,_0x3fb662){_0x169c05=_0x169c05-0x0;var _0x5efbee=_0xb7ae[_0x169c05];return _0x5efbee;};'use strict';var _=require(_0xeb7a('0x0'));var util=require(_0xeb7a('0x1'));var moment=require(_0xeb7a('0x2'));var BPromise=require(_0xeb7a('0x3'));var rs=require(_0xeb7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb7a('0x5'))['db'];var utils=require(_0xeb7a('0x6'));var logger=require(_0xeb7a('0x7'))('rpc');var config=require(_0xeb7a('0x8'));var jayson=require(_0xeb7a('0x9'));var client=jayson[_0xeb7a('0xa')][_0xeb7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x365bc0,_0x5eeb35,_0x1d872f){return new BPromise(function(_0x19f415,_0x37b060){return client['request'](_0x365bc0,_0x1d872f)[_0xeb7a('0xc')](function(_0x4243b5){logger[_0xeb7a('0xd')](_0xeb7a('0xe'),_0x5eeb35,_0xeb7a('0xf'));logger[_0xeb7a('0x10')](_0xeb7a('0x11'),_0x5eeb35,'request\x20sent',JSON['stringify'](_0x4243b5));if(_0x4243b5[_0xeb7a('0x12')]){if(_0x4243b5[_0xeb7a('0x12')][_0xeb7a('0x13')]===0x1f4){logger[_0xeb7a('0x12')](_0xeb7a('0xe'),_0x5eeb35,_0x4243b5[_0xeb7a('0x12')][_0xeb7a('0x14')]);return _0x37b060(_0x4243b5['error'][_0xeb7a('0x14')]);}logger[_0xeb7a('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x5eeb35,_0x4243b5[_0xeb7a('0x12')][_0xeb7a('0x14')]);return _0x19f415(_0x4243b5['error'][_0xeb7a('0x14')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x5eeb35,_0xeb7a('0xf'));_0x19f415(_0x4243b5['result']['message']);}})[_0xeb7a('0x15')](function(_0x38f5cc){logger[_0xeb7a('0x12')](_0xeb7a('0xe'),_0x5eeb35,_0x38f5cc);_0x37b060(_0x38f5cc);});});}