344c26ccd7a333271b2228ed06fc8995aab067ff
[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 _0x1a54=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x9f157b,_0x52ee4b){var _0x550469=function(_0x3e202a){while(--_0x3e202a){_0x9f157b['push'](_0x9f157b['shift']());}};_0x550469(++_0x52ee4b);}(_0x1a54,0x12e));var _0x41a5=function(_0x5d8bd4,_0x3784b2){_0x5d8bd4=_0x5d8bd4-0x0;var _0x2518e8=_0x1a54[_0x5d8bd4];return _0x2518e8;};'use strict';var _=require(_0x41a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41a5('0x1'));var rs=require(_0x41a5('0x2'));var fs=require('fs');var Redis=require(_0x41a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x41a5('0x4'));var logger=require(_0x41a5('0x5'))(_0x41a5('0x6'));var config=require(_0x41a5('0x7'));var jayson=require(_0x41a5('0x8'));var client=jayson['client'][_0x41a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa884,_0x419fb0,_0x1b3ca8){return new BPromise(function(_0x13e186,_0x45c3d6){return client[_0x41a5('0xa')](_0x2fa884,_0x1b3ca8)[_0x41a5('0xb')](function(_0x3958ee){logger[_0x41a5('0xc')](_0x41a5('0xd'),_0x419fb0,_0x41a5('0xe'));logger[_0x41a5('0xf')](_0x41a5('0x10'),_0x419fb0,_0x41a5('0xe'),JSON[_0x41a5('0x11')](_0x3958ee));if(_0x3958ee['error']){if(_0x3958ee['error'][_0x41a5('0x12')]===0x1f4){logger[_0x41a5('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x419fb0,_0x3958ee[_0x41a5('0x13')][_0x41a5('0x14')]);return _0x45c3d6(_0x3958ee[_0x41a5('0x13')][_0x41a5('0x14')]);}logger[_0x41a5('0x13')](_0x41a5('0xd'),_0x419fb0,_0x3958ee[_0x41a5('0x13')]['message']);return _0x13e186(_0x3958ee['error']['message']);}else{logger[_0x41a5('0xc')](_0x41a5('0xd'),_0x419fb0,_0x41a5('0xe'));_0x13e186(_0x3958ee[_0x41a5('0x15')][_0x41a5('0x14')]);}})[_0x41a5('0x16')](function(_0x47557b){logger[_0x41a5('0x13')](_0x41a5('0xd'),_0x419fb0,_0x47557b);_0x45c3d6(_0x47557b);});});}