Built motion from commit (unavailable).|2.5.13
[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 _0xac8d=['../../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','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0xac8d,0x1d8));var _0xdac8=function(_0x7adb20,_0x25c831){_0x7adb20=_0x7adb20-0x0;var _0x234959=_0xac8d[_0x7adb20];return _0x234959;};'use strict';var _=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var moment=require(_0xdac8('0x2'));var BPromise=require(_0xdac8('0x3'));var rs=require(_0xdac8('0x4'));var fs=require('fs');var Redis=require(_0xdac8('0x5'));var db=require(_0xdac8('0x6'))['db'];var utils=require(_0xdac8('0x7'));var logger=require(_0xdac8('0x8'))('rpc');var config=require(_0xdac8('0x9'));var jayson=require(_0xdac8('0xa'));var client=jayson[_0xdac8('0xb')][_0xdac8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e1cc7,_0x3677da,_0x8f90bd){return new BPromise(function(_0x96c908,_0x116c0a){return client['request'](_0x1e1cc7,_0x8f90bd)[_0xdac8('0xd')](function(_0x55e8ec){logger[_0xdac8('0xe')](_0xdac8('0xf'),_0x3677da,_0xdac8('0x10'));logger[_0xdac8('0x11')](_0xdac8('0x12'),_0x3677da,'request\x20sent',JSON[_0xdac8('0x13')](_0x55e8ec));if(_0x55e8ec['error']){if(_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x15')]===0x1f4){logger[_0xdac8('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3677da,_0x55e8ec[_0xdac8('0x14')]['message']);return _0x116c0a(_0x55e8ec['error'][_0xdac8('0x16')]);}logger['error'](_0xdac8('0xf'),_0x3677da,_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x16')]);return _0x96c908(_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x16')]);}else{logger['info'](_0xdac8('0xf'),_0x3677da,_0xdac8('0x10'));_0x96c908(_0x55e8ec[_0xdac8('0x17')][_0xdac8('0x16')]);}})['catch'](function(_0x9d075f){logger[_0xdac8('0x14')](_0xdac8('0xf'),_0x3677da,_0x9d075f);_0x116c0a(_0x9d075f);});});}