Built motion from commit (unavailable).|2.4.18
[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 _0x8b1f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x8b1f,0x1b5));var _0xf8b1=function(_0x5a5199,_0x262edd){_0x5a5199=_0x5a5199-0x0;var _0x2a06e0=_0x8b1f[_0x5a5199];return _0x2a06e0;};'use strict';var _=require(_0xf8b1('0x0'));var util=require(_0xf8b1('0x1'));var moment=require(_0xf8b1('0x2'));var BPromise=require(_0xf8b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8b1('0x4'));var db=require(_0xf8b1('0x5'))['db'];var utils=require(_0xf8b1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf8b1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf8b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13c714,_0x21b339,_0x1caf48){return new BPromise(function(_0x57bf99,_0x4f0cb6){return client[_0xf8b1('0x9')](_0x13c714,_0x1caf48)[_0xf8b1('0xa')](function(_0x21ff39){logger[_0xf8b1('0xb')](_0xf8b1('0xc'),_0x21b339,'request\x20sent');logger[_0xf8b1('0xd')](_0xf8b1('0xe'),_0x21b339,_0xf8b1('0xf'),JSON[_0xf8b1('0x10')](_0x21ff39));if(_0x21ff39[_0xf8b1('0x11')]){if(_0x21ff39[_0xf8b1('0x11')]['code']===0x1f4){logger[_0xf8b1('0x11')](_0xf8b1('0xc'),_0x21b339,_0x21ff39[_0xf8b1('0x11')][_0xf8b1('0x12')]);return _0x4f0cb6(_0x21ff39['error'][_0xf8b1('0x12')]);}logger[_0xf8b1('0x11')](_0xf8b1('0xc'),_0x21b339,_0x21ff39[_0xf8b1('0x11')][_0xf8b1('0x12')]);return _0x57bf99(_0x21ff39[_0xf8b1('0x11')][_0xf8b1('0x12')]);}else{logger['info'](_0xf8b1('0xc'),_0x21b339,_0xf8b1('0xf'));_0x57bf99(_0x21ff39[_0xf8b1('0x13')]['message']);}})[_0xf8b1('0x14')](function(_0x13ade9){logger[_0xf8b1('0x11')](_0xf8b1('0xc'),_0x21b339,_0x13ade9);_0x4f0cb6(_0x13ade9);});});}