Built motion from commit (unavailable).|2.5.14
[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 _0xf693=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xf693,0x181));var _0x3f69=function(_0x247cb2,_0x3c912e){_0x247cb2=_0x247cb2-0x0;var _0x51f2b2=_0xf693[_0x247cb2];return _0x51f2b2;};'use strict';var _=require('lodash');var util=require(_0x3f69('0x0'));var moment=require(_0x3f69('0x1'));var BPromise=require(_0x3f69('0x2'));var rs=require(_0x3f69('0x3'));var fs=require('fs');var Redis=require(_0x3f69('0x4'));var db=require(_0x3f69('0x5'))['db'];var utils=require(_0x3f69('0x6'));var logger=require('../../config/logger')(_0x3f69('0x7'));var config=require(_0x3f69('0x8'));var jayson=require(_0x3f69('0x9'));var client=jayson[_0x3f69('0xa')][_0x3f69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45461a,_0x7ecb76,_0x32544e){return new BPromise(function(_0x1ac268,_0xad860e){return client[_0x3f69('0xc')](_0x45461a,_0x32544e)[_0x3f69('0xd')](function(_0x134f69){logger[_0x3f69('0xe')](_0x3f69('0xf'),_0x7ecb76,_0x3f69('0x10'));logger[_0x3f69('0x11')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x7ecb76,_0x3f69('0x10'),JSON[_0x3f69('0x12')](_0x134f69));if(_0x134f69[_0x3f69('0x13')]){if(_0x134f69[_0x3f69('0x13')][_0x3f69('0x14')]===0x1f4){logger['error'](_0x3f69('0xf'),_0x7ecb76,_0x134f69[_0x3f69('0x13')]['message']);return _0xad860e(_0x134f69[_0x3f69('0x13')]['message']);}logger['error'](_0x3f69('0xf'),_0x7ecb76,_0x134f69[_0x3f69('0x13')][_0x3f69('0x15')]);return _0x1ac268(_0x134f69['error'][_0x3f69('0x15')]);}else{logger[_0x3f69('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x7ecb76,_0x3f69('0x10'));_0x1ac268(_0x134f69[_0x3f69('0x16')][_0x3f69('0x15')]);}})[_0x3f69('0x17')](function(_0x18f60a){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x7ecb76,_0x18f60a);_0xad860e(_0x18f60a);});});}