Built motion from commit (unavailable).|2.5.21
[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 _0x7f86=['rpc','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3675c5,_0x35e977){var _0x2d370f=function(_0x588633){while(--_0x588633){_0x3675c5['push'](_0x3675c5['shift']());}};_0x2d370f(++_0x35e977);}(_0x7f86,0xea));var _0x67f8=function(_0x444462,_0x2bf6e){_0x444462=_0x444462-0x0;var _0x3060fa=_0x7f86[_0x444462];return _0x3060fa;};'use strict';var _=require(_0x67f8('0x0'));var util=require(_0x67f8('0x1'));var moment=require(_0x67f8('0x2'));var BPromise=require(_0x67f8('0x3'));var rs=require(_0x67f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67f8('0x5'))['db'];var utils=require(_0x67f8('0x6'));var logger=require(_0x67f8('0x7'))(_0x67f8('0x8'));var config=require('../../config/environment');var jayson=require(_0x67f8('0x9'));var client=jayson[_0x67f8('0xa')][_0x67f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d8d1a,_0x4eb036,_0x8bf433){return new BPromise(function(_0xe4b2f1,_0xfc0abf){return client[_0x67f8('0xc')](_0x5d8d1a,_0x8bf433)['then'](function(_0x3601c0){logger[_0x67f8('0xd')](_0x67f8('0xe'),_0x4eb036,_0x67f8('0xf'));logger[_0x67f8('0x10')](_0x67f8('0x11'),_0x4eb036,'request\x20sent',JSON[_0x67f8('0x12')](_0x3601c0));if(_0x3601c0['error']){if(_0x3601c0['error']['code']===0x1f4){logger[_0x67f8('0x13')](_0x67f8('0xe'),_0x4eb036,_0x3601c0[_0x67f8('0x13')]['message']);return _0xfc0abf(_0x3601c0[_0x67f8('0x13')][_0x67f8('0x14')]);}logger[_0x67f8('0x13')](_0x67f8('0xe'),_0x4eb036,_0x3601c0[_0x67f8('0x13')][_0x67f8('0x14')]);return _0xe4b2f1(_0x3601c0[_0x67f8('0x13')]['message']);}else{logger['info'](_0x67f8('0xe'),_0x4eb036,_0x67f8('0xf'));_0xe4b2f1(_0x3601c0[_0x67f8('0x15')][_0x67f8('0x14')]);}})['catch'](function(_0x33ed8f){logger[_0x67f8('0x13')](_0x67f8('0xe'),_0x4eb036,_0x33ed8f);_0xfc0abf(_0x33ed8f);});});}