b15239005f169407587e86f62429fc5f5cbf688d
[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 _0x8e28=['code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4c6e75,_0x5761f2){var _0x50fd31=function(_0x241124){while(--_0x241124){_0x4c6e75['push'](_0x4c6e75['shift']());}};_0x50fd31(++_0x5761f2);}(_0x8e28,0xf4));var _0x88e2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8e28[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x88e2('0x0'));var moment=require(_0x88e2('0x1'));var BPromise=require(_0x88e2('0x2'));var rs=require(_0x88e2('0x3'));var fs=require('fs');var Redis=require(_0x88e2('0x4'));var db=require(_0x88e2('0x5'))['db'];var utils=require(_0x88e2('0x6'));var logger=require('../../config/logger')(_0x88e2('0x7'));var config=require(_0x88e2('0x8'));var jayson=require(_0x88e2('0x9'));var client=jayson[_0x88e2('0xa')][_0x88e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x332f5c,_0x27e3d2,_0x36feb1){return new BPromise(function(_0x1f6106,_0x35436d){return client[_0x88e2('0xc')](_0x332f5c,_0x36feb1)['then'](function(_0x1b596f){logger[_0x88e2('0xd')](_0x88e2('0xe'),_0x27e3d2,'request\x20sent');logger[_0x88e2('0xf')](_0x88e2('0x10'),_0x27e3d2,_0x88e2('0x11'),JSON[_0x88e2('0x12')](_0x1b596f));if(_0x1b596f[_0x88e2('0x13')]){if(_0x1b596f[_0x88e2('0x13')][_0x88e2('0x14')]===0x1f4){logger[_0x88e2('0x13')](_0x88e2('0xe'),_0x27e3d2,_0x1b596f[_0x88e2('0x13')][_0x88e2('0x15')]);return _0x35436d(_0x1b596f[_0x88e2('0x13')][_0x88e2('0x15')]);}logger[_0x88e2('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x27e3d2,_0x1b596f[_0x88e2('0x13')]['message']);return _0x1f6106(_0x1b596f[_0x88e2('0x13')][_0x88e2('0x15')]);}else{logger[_0x88e2('0xd')](_0x88e2('0xe'),_0x27e3d2,_0x88e2('0x11'));_0x1f6106(_0x1b596f['result'][_0x88e2('0x15')]);}})['catch'](function(_0x48ab2d){logger[_0x88e2('0x13')](_0x88e2('0xe'),_0x27e3d2,_0x48ab2d);_0x35436d(_0x48ab2d);});});}