Built motion from commit (unavailable).|2.4.20
[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 _0x6bd5=['request\x20sent','stringify','error','message','result','catch','lodash','util','../../config/utils','../../config/environment','client','http','then','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bd5,0xb6));var _0x56bd=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x6bd5[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x56bd('0x0'));var util=require(_0x56bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56bd('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x56bd('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x56bd('0x4')][_0x56bd('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x573e43,_0x1980b9,_0x252e5a){return new BPromise(function(_0x5d30cd,_0x243fe9){return client['request'](_0x573e43,_0x252e5a)[_0x56bd('0x6')](function(_0x47a687){logger['info'](_0x56bd('0x7'),_0x1980b9,'request\x20sent');logger[_0x56bd('0x8')](_0x56bd('0x9'),_0x1980b9,_0x56bd('0xa'),JSON[_0x56bd('0xb')](_0x47a687));if(_0x47a687[_0x56bd('0xc')]){if(_0x47a687[_0x56bd('0xc')]['code']===0x1f4){logger[_0x56bd('0xc')](_0x56bd('0x7'),_0x1980b9,_0x47a687[_0x56bd('0xc')][_0x56bd('0xd')]);return _0x243fe9(_0x47a687[_0x56bd('0xc')]['message']);}logger[_0x56bd('0xc')](_0x56bd('0x7'),_0x1980b9,_0x47a687[_0x56bd('0xc')]['message']);return _0x5d30cd(_0x47a687[_0x56bd('0xc')][_0x56bd('0xd')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1980b9,'request\x20sent');_0x5d30cd(_0x47a687[_0x56bd('0xe')]['message']);}})[_0x56bd('0xf')](function(_0x52d719){logger[_0x56bd('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x1980b9,_0x52d719);_0x243fe9(_0x52d719);});});}