Built motion from commit 44b1f254.|2.6.26
[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 _0x903b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x5d411e,_0x4d68fa){var _0x5674d1=function(_0xb73f3e){while(--_0xb73f3e){_0x5d411e['push'](_0x5d411e['shift']());}};_0x5674d1(++_0x4d68fa);}(_0x903b,0x1ca));var _0xb903=function(_0x3768f3,_0x4a40f1){_0x3768f3=_0x3768f3-0x0;var _0x526a13=_0x903b[_0x3768f3];return _0x526a13;};'use strict';var _=require('lodash');var util=require(_0xb903('0x0'));var moment=require(_0xb903('0x1'));var BPromise=require(_0xb903('0x2'));var rs=require(_0xb903('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb903('0x4'))['db'];var utils=require(_0xb903('0x5'));var logger=require(_0xb903('0x6'))(_0xb903('0x7'));var config=require('../../config/environment');var jayson=require(_0xb903('0x8'));var client=jayson[_0xb903('0x9')][_0xb903('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50f52a,_0x2d2978,_0x6c526f){return new BPromise(function(_0x8d855d,_0x4f78ec){return client[_0xb903('0xb')](_0x50f52a,_0x6c526f)[_0xb903('0xc')](function(_0x9b90a4){logger[_0xb903('0xd')](_0xb903('0xe'),_0x2d2978,'request\x20sent');logger[_0xb903('0xf')](_0xb903('0x10'),_0x2d2978,_0xb903('0x11'),JSON['stringify'](_0x9b90a4));if(_0x9b90a4[_0xb903('0x12')]){if(_0x9b90a4[_0xb903('0x12')]['code']===0x1f4){logger[_0xb903('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x2d2978,_0x9b90a4[_0xb903('0x12')][_0xb903('0x13')]);return _0x4f78ec(_0x9b90a4[_0xb903('0x12')][_0xb903('0x13')]);}logger[_0xb903('0x12')](_0xb903('0xe'),_0x2d2978,_0x9b90a4[_0xb903('0x12')]['message']);return _0x8d855d(_0x9b90a4[_0xb903('0x12')][_0xb903('0x13')]);}else{logger[_0xb903('0xd')](_0xb903('0xe'),_0x2d2978,'request\x20sent');_0x8d855d(_0x9b90a4[_0xb903('0x14')]['message']);}})[_0xb903('0x15')](function(_0xda5867){logger[_0xb903('0x12')](_0xb903('0xe'),_0x2d2978,_0xda5867);_0x4f78ec(_0xda5867);});});}