Built motion from commit (unavailable).|2.4.19
[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 _0x90b6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x90b6,0x104));var _0x690b=function(_0x5e7c94,_0xe3d3d4){_0x5e7c94=_0x5e7c94-0x0;var _0x5cda14=_0x90b6[_0x5e7c94];return _0x5cda14;};'use strict';var _=require(_0x690b('0x0'));var util=require(_0x690b('0x1'));var moment=require(_0x690b('0x2'));var BPromise=require(_0x690b('0x3'));var rs=require(_0x690b('0x4'));var fs=require('fs');var Redis=require(_0x690b('0x5'));var db=require(_0x690b('0x6'))['db'];var utils=require(_0x690b('0x7'));var logger=require(_0x690b('0x8'))(_0x690b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x690b('0xa')][_0x690b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52d658,_0x4028d1,_0x41a74d){return new BPromise(function(_0x16e755,_0x2e7bb5){return client[_0x690b('0xc')](_0x52d658,_0x41a74d)[_0x690b('0xd')](function(_0x255f0b){logger['info'](_0x690b('0xe'),_0x4028d1,_0x690b('0xf'));logger[_0x690b('0x10')](_0x690b('0x11'),_0x4028d1,_0x690b('0xf'),JSON[_0x690b('0x12')](_0x255f0b));if(_0x255f0b[_0x690b('0x13')]){if(_0x255f0b[_0x690b('0x13')]['code']===0x1f4){logger[_0x690b('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x4028d1,_0x255f0b['error']['message']);return _0x2e7bb5(_0x255f0b['error']['message']);}logger[_0x690b('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x4028d1,_0x255f0b[_0x690b('0x13')][_0x690b('0x14')]);return _0x16e755(_0x255f0b[_0x690b('0x13')][_0x690b('0x14')]);}else{logger[_0x690b('0x15')](_0x690b('0xe'),_0x4028d1,_0x690b('0xf'));_0x16e755(_0x255f0b[_0x690b('0x16')]['message']);}})[_0x690b('0x17')](function(_0x1563cb){logger[_0x690b('0x13')](_0x690b('0xe'),_0x4028d1,_0x1563cb);_0x2e7bb5(_0x1563cb);});});}