Built motion from commit b0a9a629.|2.6.33
[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 _0xc84a=['jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xc84a,0xd4));var _0xac84=function(_0x13e337,_0x5276b6){_0x13e337=_0x13e337-0x0;var _0x19db03=_0xc84a[_0x13e337];return _0x19db03;};'use strict';var _=require(_0xac84('0x0'));var util=require(_0xac84('0x1'));var moment=require(_0xac84('0x2'));var BPromise=require('bluebird');var rs=require(_0xac84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac84('0x4'))['db'];var utils=require(_0xac84('0x5'));var logger=require(_0xac84('0x6'))('rpc');var config=require(_0xac84('0x7'));var jayson=require(_0xac84('0x8'));var client=jayson[_0xac84('0x9')][_0xac84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x787a5f,_0x222f07,_0x11bc1e){return new BPromise(function(_0x25e952,_0x4eb3dc){return client[_0xac84('0xb')](_0x787a5f,_0x11bc1e)[_0xac84('0xc')](function(_0x388499){logger[_0xac84('0xd')](_0xac84('0xe'),_0x222f07,'request\x20sent');logger[_0xac84('0xf')](_0xac84('0x10'),_0x222f07,_0xac84('0x11'),JSON['stringify'](_0x388499));if(_0x388499[_0xac84('0x12')]){if(_0x388499[_0xac84('0x12')][_0xac84('0x13')]===0x1f4){logger[_0xac84('0x12')](_0xac84('0xe'),_0x222f07,_0x388499[_0xac84('0x12')][_0xac84('0x14')]);return _0x4eb3dc(_0x388499[_0xac84('0x12')][_0xac84('0x14')]);}logger[_0xac84('0x12')](_0xac84('0xe'),_0x222f07,_0x388499[_0xac84('0x12')]['message']);return _0x25e952(_0x388499[_0xac84('0x12')][_0xac84('0x14')]);}else{logger['info'](_0xac84('0xe'),_0x222f07,_0xac84('0x11'));_0x25e952(_0x388499[_0xac84('0x15')][_0xac84('0x14')]);}})['catch'](function(_0x2b13a0){logger[_0xac84('0x12')](_0xac84('0xe'),_0x222f07,_0x2b13a0);_0x4eb3dc(_0x2b13a0);});});}