47502c6bc4a88e18442a3b2a37d53c43779c0034
[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 _0x07f3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2f10e4,_0x2424ee){var _0x16ae69=function(_0xe8b3d3){while(--_0xe8b3d3){_0x2f10e4['push'](_0x2f10e4['shift']());}};_0x16ae69(++_0x2424ee);}(_0x07f3,0xbd));var _0x307f=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x07f3[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x307f('0x0'));var util=require(_0x307f('0x1'));var moment=require(_0x307f('0x2'));var BPromise=require(_0x307f('0x3'));var rs=require(_0x307f('0x4'));var fs=require('fs');var Redis=require(_0x307f('0x5'));var db=require(_0x307f('0x6'))['db'];var utils=require(_0x307f('0x7'));var logger=require('../../config/logger')(_0x307f('0x8'));var config=require(_0x307f('0x9'));var jayson=require(_0x307f('0xa'));var client=jayson[_0x307f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b08ad,_0x44766a,_0x48c80a){return new BPromise(function(_0x5becdd,_0x2e07b0){return client[_0x307f('0xc')](_0x3b08ad,_0x48c80a)[_0x307f('0xd')](function(_0x4514aa){logger[_0x307f('0xe')](_0x307f('0xf'),_0x44766a,_0x307f('0x10'));logger[_0x307f('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x44766a,_0x307f('0x10'),JSON[_0x307f('0x12')](_0x4514aa));if(_0x4514aa[_0x307f('0x13')]){if(_0x4514aa[_0x307f('0x13')][_0x307f('0x14')]===0x1f4){logger[_0x307f('0x13')](_0x307f('0xf'),_0x44766a,_0x4514aa[_0x307f('0x13')]['message']);return _0x2e07b0(_0x4514aa[_0x307f('0x13')][_0x307f('0x15')]);}logger['error'](_0x307f('0xf'),_0x44766a,_0x4514aa[_0x307f('0x13')][_0x307f('0x15')]);return _0x5becdd(_0x4514aa[_0x307f('0x13')][_0x307f('0x15')]);}else{logger[_0x307f('0xe')](_0x307f('0xf'),_0x44766a,_0x307f('0x10'));_0x5becdd(_0x4514aa[_0x307f('0x16')][_0x307f('0x15')]);}})[_0x307f('0x17')](function(_0x1470a3){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x44766a,_0x1470a3);_0x2e07b0(_0x1470a3);});});}