Built motion from commit 3c2ce842.|2.6.31
[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 _0x6222=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x5c6545,_0x474b5e){var _0x30365a=function(_0xcaf07){while(--_0xcaf07){_0x5c6545['push'](_0x5c6545['shift']());}};_0x30365a(++_0x474b5e);}(_0x6222,0x7d));var _0x2622=function(_0x4b37f8,_0x52f0be){_0x4b37f8=_0x4b37f8-0x0;var _0x584319=_0x6222[_0x4b37f8];return _0x584319;};'use strict';var _=require(_0x2622('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2622('0x1'));var rs=require(_0x2622('0x2'));var fs=require('fs');var Redis=require(_0x2622('0x3'));var db=require(_0x2622('0x4'))['db'];var utils=require(_0x2622('0x5'));var logger=require(_0x2622('0x6'))(_0x2622('0x7'));var config=require(_0x2622('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2622('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38c07d,_0x5d293b,_0x3e1a50){return new BPromise(function(_0x2bf6f5,_0x5ef694){return client[_0x2622('0xa')](_0x38c07d,_0x3e1a50)[_0x2622('0xb')](function(_0x264e67){logger[_0x2622('0xc')](_0x2622('0xd'),_0x5d293b,'request\x20sent');logger['debug'](_0x2622('0xe'),_0x5d293b,_0x2622('0xf'),JSON[_0x2622('0x10')](_0x264e67));if(_0x264e67[_0x2622('0x11')]){if(_0x264e67[_0x2622('0x11')]['code']===0x1f4){logger[_0x2622('0x11')](_0x2622('0xd'),_0x5d293b,_0x264e67[_0x2622('0x11')][_0x2622('0x12')]);return _0x5ef694(_0x264e67['error'][_0x2622('0x12')]);}logger[_0x2622('0x11')](_0x2622('0xd'),_0x5d293b,_0x264e67['error'][_0x2622('0x12')]);return _0x2bf6f5(_0x264e67[_0x2622('0x11')][_0x2622('0x12')]);}else{logger[_0x2622('0xc')](_0x2622('0xd'),_0x5d293b,_0x2622('0xf'));_0x2bf6f5(_0x264e67[_0x2622('0x13')][_0x2622('0x12')]);}})[_0x2622('0x14')](function(_0x5896c7){logger[_0x2622('0x11')](_0x2622('0xd'),_0x5d293b,_0x5896c7);_0x5ef694(_0x5896c7);});});}