9cfaec9c1578b4db71c7cbcbdd8d7f768be9e3ef
[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 _0xc22d=['../../config/logger','rpc','../../config/environment','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x28c638,_0x14847a){var _0x59f094=function(_0x590342){while(--_0x590342){_0x28c638['push'](_0x28c638['shift']());}};_0x59f094(++_0x14847a);}(_0xc22d,0x88));var _0xdc22=function(_0x2f5131,_0x309841){_0x2f5131=_0x2f5131-0x0;var _0x5f1550=_0xc22d[_0x2f5131];return _0x5f1550;};'use strict';var _=require(_0xdc22('0x0'));var util=require(_0xdc22('0x1'));var moment=require(_0xdc22('0x2'));var BPromise=require(_0xdc22('0x3'));var rs=require(_0xdc22('0x4'));var fs=require('fs');var Redis=require(_0xdc22('0x5'));var db=require(_0xdc22('0x6'))['db'];var utils=require(_0xdc22('0x7'));var logger=require(_0xdc22('0x8'))(_0xdc22('0x9'));var config=require(_0xdc22('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xdc22('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b9b12,_0x258d41,_0x31181){return new BPromise(function(_0x116343,_0x548be9){return client[_0xdc22('0xc')](_0x5b9b12,_0x31181)[_0xdc22('0xd')](function(_0x250500){logger[_0xdc22('0xe')](_0xdc22('0xf'),_0x258d41,_0xdc22('0x10'));logger[_0xdc22('0x11')](_0xdc22('0x12'),_0x258d41,_0xdc22('0x10'),JSON[_0xdc22('0x13')](_0x250500));if(_0x250500[_0xdc22('0x14')]){if(_0x250500['error'][_0xdc22('0x15')]===0x1f4){logger[_0xdc22('0x14')](_0xdc22('0xf'),_0x258d41,_0x250500['error'][_0xdc22('0x16')]);return _0x548be9(_0x250500[_0xdc22('0x14')][_0xdc22('0x16')]);}logger[_0xdc22('0x14')](_0xdc22('0xf'),_0x258d41,_0x250500[_0xdc22('0x14')][_0xdc22('0x16')]);return _0x116343(_0x250500['error'][_0xdc22('0x16')]);}else{logger[_0xdc22('0xe')](_0xdc22('0xf'),_0x258d41,_0xdc22('0x10'));_0x116343(_0x250500['result'][_0xdc22('0x16')]);}})[_0xdc22('0x17')](function(_0x421fe9){logger[_0xdc22('0x14')](_0xdc22('0xf'),_0x258d41,_0x421fe9);_0x548be9(_0x421fe9);});});}