3e3e0182bd3c1012f8a450b37676809002724d2c
[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 _0xf5f1=['code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x17093e,_0x2303bc){var _0x167c6e=function(_0x3b13b9){while(--_0x3b13b9){_0x17093e['push'](_0x17093e['shift']());}};_0x167c6e(++_0x2303bc);}(_0xf5f1,0x1e3));var _0x1f5f=function(_0x5a42e4,_0x351f64){_0x5a42e4=_0x5a42e4-0x0;var _0x4832eb=_0xf5f1[_0x5a42e4];return _0x4832eb;};'use strict';var _=require('lodash');var util=require(_0x1f5f('0x0'));var moment=require(_0x1f5f('0x1'));var BPromise=require(_0x1f5f('0x2'));var rs=require(_0x1f5f('0x3'));var fs=require('fs');var Redis=require(_0x1f5f('0x4'));var db=require(_0x1f5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f5f('0x6'))(_0x1f5f('0x7'));var config=require(_0x1f5f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c081b,_0x2d8f39,_0x5193e9){return new BPromise(function(_0x28c819,_0x29d4c5){return client[_0x1f5f('0xa')](_0x5c081b,_0x5193e9)['then'](function(_0x33fc54){logger['info'](_0x1f5f('0xb'),_0x2d8f39,_0x1f5f('0xc'));logger[_0x1f5f('0xd')](_0x1f5f('0xe'),_0x2d8f39,_0x1f5f('0xc'),JSON[_0x1f5f('0xf')](_0x33fc54));if(_0x33fc54[_0x1f5f('0x10')]){if(_0x33fc54['error'][_0x1f5f('0x11')]===0x1f4){logger[_0x1f5f('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x2d8f39,_0x33fc54['error']['message']);return _0x29d4c5(_0x33fc54[_0x1f5f('0x10')][_0x1f5f('0x12')]);}logger[_0x1f5f('0x10')](_0x1f5f('0xb'),_0x2d8f39,_0x33fc54[_0x1f5f('0x10')][_0x1f5f('0x12')]);return _0x28c819(_0x33fc54['error']['message']);}else{logger['info'](_0x1f5f('0xb'),_0x2d8f39,'request\x20sent');_0x28c819(_0x33fc54[_0x1f5f('0x13')][_0x1f5f('0x12')]);}})['catch'](function(_0x4fc4df){logger[_0x1f5f('0x10')](_0x1f5f('0xb'),_0x2d8f39,_0x4fc4df);_0x29d4c5(_0x4fc4df);});});}