Built motion from commit (unavailable).|2.5.8
[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 _0x2f38=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x384b64,_0x4f0784){var _0x3a8f2c=function(_0xc28196){while(--_0xc28196){_0x384b64['push'](_0x384b64['shift']());}};_0x3a8f2c(++_0x4f0784);}(_0x2f38,0x95));var _0x82f3=function(_0x11358e,_0x412e69){_0x11358e=_0x11358e-0x0;var _0x189f05=_0x2f38[_0x11358e];return _0x189f05;};'use strict';var _=require(_0x82f3('0x0'));var util=require('util');var moment=require(_0x82f3('0x1'));var BPromise=require(_0x82f3('0x2'));var rs=require(_0x82f3('0x3'));var fs=require('fs');var Redis=require(_0x82f3('0x4'));var db=require(_0x82f3('0x5'))['db'];var utils=require(_0x82f3('0x6'));var logger=require(_0x82f3('0x7'))(_0x82f3('0x8'));var config=require(_0x82f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x82f3('0xa')][_0x82f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31cec1,_0xe73c6,_0x4b4b1b){return new BPromise(function(_0x4d238e,_0x5794a0){return client[_0x82f3('0xc')](_0x31cec1,_0x4b4b1b)[_0x82f3('0xd')](function(_0x252666){logger['info'](_0x82f3('0xe'),_0xe73c6,_0x82f3('0xf'));logger[_0x82f3('0x10')](_0x82f3('0x11'),_0xe73c6,_0x82f3('0xf'),JSON[_0x82f3('0x12')](_0x252666));if(_0x252666[_0x82f3('0x13')]){if(_0x252666[_0x82f3('0x13')][_0x82f3('0x14')]===0x1f4){logger['error'](_0x82f3('0xe'),_0xe73c6,_0x252666['error'][_0x82f3('0x15')]);return _0x5794a0(_0x252666[_0x82f3('0x13')][_0x82f3('0x15')]);}logger[_0x82f3('0x13')]('UserMailQueue,\x20%s,\x20%s',_0xe73c6,_0x252666[_0x82f3('0x13')][_0x82f3('0x15')]);return _0x4d238e(_0x252666[_0x82f3('0x13')][_0x82f3('0x15')]);}else{logger[_0x82f3('0x16')](_0x82f3('0xe'),_0xe73c6,_0x82f3('0xf'));_0x4d238e(_0x252666[_0x82f3('0x17')][_0x82f3('0x15')]);}})[_0x82f3('0x18')](function(_0x62af69){logger[_0x82f3('0x13')](_0x82f3('0xe'),_0xe73c6,_0x62af69);_0x5794a0(_0x62af69);});});}