Built motion from commit (unavailable).|2.5.4
[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 _0x7544=['rpc','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7544,0x19c));var _0x4754=function(_0x325e4c,_0x470fda){_0x325e4c=_0x325e4c-0x0;var _0x3a8d08=_0x7544[_0x325e4c];return _0x3a8d08;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4754('0x0'));var rs=require(_0x4754('0x1'));var fs=require('fs');var Redis=require(_0x4754('0x2'));var db=require(_0x4754('0x3'))['db'];var utils=require(_0x4754('0x4'));var logger=require(_0x4754('0x5'))(_0x4754('0x6'));var config=require('../../config/environment');var jayson=require(_0x4754('0x7'));var client=jayson[_0x4754('0x8')][_0x4754('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed0be,_0x390c03,_0x267abd){return new BPromise(function(_0x88cf4d,_0x2a03ce){return client[_0x4754('0xa')](_0x2ed0be,_0x267abd)['then'](function(_0x38a9e6){logger[_0x4754('0xb')](_0x4754('0xc'),_0x390c03,'request\x20sent');logger[_0x4754('0xd')](_0x4754('0xe'),_0x390c03,_0x4754('0xf'),JSON['stringify'](_0x38a9e6));if(_0x38a9e6[_0x4754('0x10')]){if(_0x38a9e6[_0x4754('0x10')][_0x4754('0x11')]===0x1f4){logger[_0x4754('0x10')](_0x4754('0xc'),_0x390c03,_0x38a9e6[_0x4754('0x10')][_0x4754('0x12')]);return _0x2a03ce(_0x38a9e6[_0x4754('0x10')]['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x390c03,_0x38a9e6[_0x4754('0x10')][_0x4754('0x12')]);return _0x88cf4d(_0x38a9e6[_0x4754('0x10')][_0x4754('0x12')]);}else{logger[_0x4754('0xb')](_0x4754('0xc'),_0x390c03,'request\x20sent');_0x88cf4d(_0x38a9e6['result'][_0x4754('0x12')]);}})['catch'](function(_0x2e74af){logger[_0x4754('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x390c03,_0x2e74af);_0x2a03ce(_0x2e74af);});});}