Built motion from commit (unavailable).|2.5.23
[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 _0x6fc4=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x37473e,_0x4a1aa8){_0x37473e=_0x37473e-0x0;var _0x2635f7=_0x6fc4[_0x37473e];return _0x2635f7;};'use strict';var _=require(_0x46fc('0x0'));var util=require(_0x46fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x46fc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46fc('0x3'))(_0x46fc('0x4'));var config=require(_0x46fc('0x5'));var jayson=require(_0x46fc('0x6'));var client=jayson[_0x46fc('0x7')][_0x46fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4f75,_0x3951e9,_0x5ca981){return new BPromise(function(_0x4a7762,_0x149bf8){return client[_0x46fc('0x9')](_0x3c4f75,_0x5ca981)[_0x46fc('0xa')](function(_0x4594c1){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x3951e9,_0x46fc('0xb'));logger[_0x46fc('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x3951e9,_0x46fc('0xb'),JSON['stringify'](_0x4594c1));if(_0x4594c1[_0x46fc('0xd')]){if(_0x4594c1[_0x46fc('0xd')][_0x46fc('0xe')]===0x1f4){logger[_0x46fc('0xd')](_0x46fc('0xf'),_0x3951e9,_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);return _0x149bf8(_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);}logger[_0x46fc('0xd')](_0x46fc('0xf'),_0x3951e9,_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);return _0x4a7762(_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);}else{logger[_0x46fc('0x11')](_0x46fc('0xf'),_0x3951e9,_0x46fc('0xb'));_0x4a7762(_0x4594c1['result'][_0x46fc('0x10')]);}})[_0x46fc('0x12')](function(_0x1df938){logger[_0x46fc('0xd')](_0x46fc('0xf'),_0x3951e9,_0x1df938);_0x149bf8(_0x1df938);});});}