Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / mailTransferReport / mailTransferReport.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 _0xc0f8=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','ioredis'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xc0f8,0xd8));var _0x8c0f=function(_0x111b1f,_0x474bc9){_0x111b1f=_0x111b1f-0x0;var _0x3a86c2=_0xc0f8[_0x111b1f];return _0x3a86c2;};'use strict';var _=require(_0x8c0f('0x0'));var util=require(_0x8c0f('0x1'));var moment=require(_0x8c0f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c0f('0x3'));var db=require(_0x8c0f('0x4'))['db'];var utils=require(_0x8c0f('0x5'));var logger=require(_0x8c0f('0x6'))('rpc');var config=require(_0x8c0f('0x7'));var jayson=require(_0x8c0f('0x8'));var client=jayson['client'][_0x8c0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10333d,_0x489883,_0x3feec2){return new BPromise(function(_0x5f2ea5,_0x562f69){return client[_0x8c0f('0xa')](_0x10333d,_0x3feec2)['then'](function(_0x22501a){logger[_0x8c0f('0xb')](_0x8c0f('0xc'),_0x489883,'request\x20sent');logger[_0x8c0f('0xd')](_0x8c0f('0xe'),_0x489883,_0x8c0f('0xf'),JSON[_0x8c0f('0x10')](_0x22501a));if(_0x22501a[_0x8c0f('0x11')]){if(_0x22501a['error']['code']===0x1f4){logger[_0x8c0f('0x11')](_0x8c0f('0xc'),_0x489883,_0x22501a[_0x8c0f('0x11')][_0x8c0f('0x12')]);return _0x562f69(_0x22501a['error']['message']);}logger[_0x8c0f('0x11')](_0x8c0f('0xc'),_0x489883,_0x22501a['error'][_0x8c0f('0x12')]);return _0x5f2ea5(_0x22501a[_0x8c0f('0x11')][_0x8c0f('0x12')]);}else{logger[_0x8c0f('0xb')](_0x8c0f('0xc'),_0x489883,'request\x20sent');_0x5f2ea5(_0x22501a[_0x8c0f('0x13')][_0x8c0f('0x12')]);}})['catch'](function(_0x24f55d){logger['error'](_0x8c0f('0xc'),_0x489883,_0x24f55d);_0x562f69(_0x24f55d);});});}