Built motion from commit (unavailable).|2.5.22
[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 _0xb282=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','debug','stringify','error','MailTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x5eebec,_0x54c64e){var _0x670c06=function(_0x48aef1){while(--_0x48aef1){_0x5eebec['push'](_0x5eebec['shift']());}};_0x670c06(++_0x54c64e);}(_0xb282,0x122));var _0x2b28=function(_0xe2a1aa,_0x525d7b){_0xe2a1aa=_0xe2a1aa-0x0;var _0x5a8362=_0xb282[_0xe2a1aa];return _0x5a8362;};'use strict';var _=require(_0x2b28('0x0'));var util=require(_0x2b28('0x1'));var moment=require(_0x2b28('0x2'));var BPromise=require(_0x2b28('0x3'));var rs=require(_0x2b28('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b28('0x5'))['db'];var utils=require(_0x2b28('0x6'));var logger=require(_0x2b28('0x7'))(_0x2b28('0x8'));var config=require(_0x2b28('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2b28('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x380810,_0xaf099,_0x5b0a23){return new BPromise(function(_0x17a89a,_0x57977a){return client['request'](_0x380810,_0x5b0a23)[_0x2b28('0xb')](function(_0x1849a7){logger[_0x2b28('0xc')]('MailTransferReport,\x20%s,\x20%s',_0xaf099,'request\x20sent');logger[_0x2b28('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xaf099,'request\x20sent',JSON[_0x2b28('0xe')](_0x1849a7));if(_0x1849a7['error']){if(_0x1849a7['error']['code']===0x1f4){logger[_0x2b28('0xf')](_0x2b28('0x10'),_0xaf099,_0x1849a7[_0x2b28('0xf')][_0x2b28('0x11')]);return _0x57977a(_0x1849a7[_0x2b28('0xf')][_0x2b28('0x11')]);}logger[_0x2b28('0xf')]('MailTransferReport,\x20%s,\x20%s',_0xaf099,_0x1849a7[_0x2b28('0xf')][_0x2b28('0x11')]);return _0x17a89a(_0x1849a7[_0x2b28('0xf')][_0x2b28('0x11')]);}else{logger[_0x2b28('0xc')](_0x2b28('0x10'),_0xaf099,_0x2b28('0x12'));_0x17a89a(_0x1849a7[_0x2b28('0x13')][_0x2b28('0x11')]);}})[_0x2b28('0x14')](function(_0x4ef352){logger[_0x2b28('0xf')](_0x2b28('0x10'),_0xaf099,_0x4ef352);_0x57977a(_0x4ef352);});});}