fef8672cf09832effbc86104688eeddc0b182ec2
[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 _0x7a5a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x144029,_0x424299){var _0xbc52fb=function(_0x39484b){while(--_0x39484b){_0x144029['push'](_0x144029['shift']());}};_0xbc52fb(++_0x424299);}(_0x7a5a,0x1ac));var _0xa7a5=function(_0x10055c,_0x233704){_0x10055c=_0x10055c-0x0;var _0x8854d5=_0x7a5a[_0x10055c];return _0x8854d5;};'use strict';var _=require(_0xa7a5('0x0'));var util=require(_0xa7a5('0x1'));var moment=require(_0xa7a5('0x2'));var BPromise=require(_0xa7a5('0x3'));var rs=require(_0xa7a5('0x4'));var fs=require('fs');var Redis=require(_0xa7a5('0x5'));var db=require(_0xa7a5('0x6'))['db'];var utils=require(_0xa7a5('0x7'));var logger=require(_0xa7a5('0x8'))('rpc');var config=require(_0xa7a5('0x9'));var jayson=require(_0xa7a5('0xa'));var client=jayson['client'][_0xa7a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39dcfa,_0x53dbb3,_0x3bdb4d){return new BPromise(function(_0x11a6e0,_0x18e687){return client['request'](_0x39dcfa,_0x3bdb4d)[_0xa7a5('0xc')](function(_0x1f1d7e){logger[_0xa7a5('0xd')](_0xa7a5('0xe'),_0x53dbb3,'request\x20sent');logger[_0xa7a5('0xf')](_0xa7a5('0x10'),_0x53dbb3,_0xa7a5('0x11'),JSON[_0xa7a5('0x12')](_0x1f1d7e));if(_0x1f1d7e[_0xa7a5('0x13')]){if(_0x1f1d7e[_0xa7a5('0x13')][_0xa7a5('0x14')]===0x1f4){logger['error'](_0xa7a5('0xe'),_0x53dbb3,_0x1f1d7e[_0xa7a5('0x13')][_0xa7a5('0x15')]);return _0x18e687(_0x1f1d7e[_0xa7a5('0x13')][_0xa7a5('0x15')]);}logger[_0xa7a5('0x13')](_0xa7a5('0xe'),_0x53dbb3,_0x1f1d7e['error'][_0xa7a5('0x15')]);return _0x11a6e0(_0x1f1d7e['error'][_0xa7a5('0x15')]);}else{logger[_0xa7a5('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x53dbb3,'request\x20sent');_0x11a6e0(_0x1f1d7e[_0xa7a5('0x16')]['message']);}})[_0xa7a5('0x17')](function(_0xb5dc2a){logger[_0xa7a5('0x13')](_0xa7a5('0xe'),_0x53dbb3,_0xb5dc2a);_0x18e687(_0xb5dc2a);});});}