Built motion from commit ddca4d0d.|2.5.47
[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 _0x3b71=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils'];(function(_0x38119b,_0x26b2ee){var _0x16ebe4=function(_0x40a955){while(--_0x40a955){_0x38119b['push'](_0x38119b['shift']());}};_0x16ebe4(++_0x26b2ee);}(_0x3b71,0xe1));var _0x13b7=function(_0x1f6c77,_0x55a4ff){_0x1f6c77=_0x1f6c77-0x0;var _0x2fcd39=_0x3b71[_0x1f6c77];return _0x2fcd39;};'use strict';var _=require(_0x13b7('0x0'));var util=require('util');var moment=require(_0x13b7('0x1'));var BPromise=require(_0x13b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x13b7('0x4'));var logger=require('../../config/logger')(_0x13b7('0x5'));var config=require(_0x13b7('0x6'));var jayson=require(_0x13b7('0x7'));var client=jayson[_0x13b7('0x8')][_0x13b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcd983a,_0x22768c,_0x582a02){return new BPromise(function(_0xcf44bf,_0x270339){return client[_0x13b7('0xa')](_0xcd983a,_0x582a02)[_0x13b7('0xb')](function(_0x5c09f2){logger[_0x13b7('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x22768c,_0x13b7('0xd'));logger[_0x13b7('0xe')](_0x13b7('0xf'),_0x22768c,_0x13b7('0xd'),JSON[_0x13b7('0x10')](_0x5c09f2));if(_0x5c09f2[_0x13b7('0x11')]){if(_0x5c09f2[_0x13b7('0x11')][_0x13b7('0x12')]===0x1f4){logger[_0x13b7('0x11')](_0x13b7('0x13'),_0x22768c,_0x5c09f2[_0x13b7('0x11')][_0x13b7('0x14')]);return _0x270339(_0x5c09f2[_0x13b7('0x11')][_0x13b7('0x14')]);}logger['error'](_0x13b7('0x13'),_0x22768c,_0x5c09f2[_0x13b7('0x11')][_0x13b7('0x14')]);return _0xcf44bf(_0x5c09f2[_0x13b7('0x11')][_0x13b7('0x14')]);}else{logger[_0x13b7('0xc')](_0x13b7('0x13'),_0x22768c,_0x13b7('0xd'));_0xcf44bf(_0x5c09f2[_0x13b7('0x15')]['message']);}})[_0x13b7('0x16')](function(_0x35b548){logger[_0x13b7('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x22768c,_0x35b548);_0x270339(_0x35b548);});});}