Built motion from commit fe909640.|2.6.8
[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 _0x1d2a=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d2a,0x64));var _0xa1d2=function(_0x5812b1,_0x13700a){_0x5812b1=_0x5812b1-0x0;var _0x2ff020=_0x1d2a[_0x5812b1];return _0x2ff020;};'use strict';var _=require(_0xa1d2('0x0'));var util=require(_0xa1d2('0x1'));var moment=require(_0xa1d2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1d2('0x4'));var logger=require(_0xa1d2('0x5'))(_0xa1d2('0x6'));var config=require(_0xa1d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa1d2('0x8')][_0xa1d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57dc97,_0x41cc04,_0x210047){return new BPromise(function(_0x167a42,_0x401638){return client[_0xa1d2('0xa')](_0x57dc97,_0x210047)[_0xa1d2('0xb')](function(_0x1de5fb){logger[_0xa1d2('0xc')](_0xa1d2('0xd'),_0x41cc04,_0xa1d2('0xe'));logger['debug'](_0xa1d2('0xf'),_0x41cc04,_0xa1d2('0xe'),JSON[_0xa1d2('0x10')](_0x1de5fb));if(_0x1de5fb['error']){if(_0x1de5fb[_0xa1d2('0x11')][_0xa1d2('0x12')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x41cc04,_0x1de5fb[_0xa1d2('0x11')]['message']);return _0x401638(_0x1de5fb[_0xa1d2('0x11')][_0xa1d2('0x13')]);}logger[_0xa1d2('0x11')](_0xa1d2('0xd'),_0x41cc04,_0x1de5fb[_0xa1d2('0x11')][_0xa1d2('0x13')]);return _0x167a42(_0x1de5fb[_0xa1d2('0x11')][_0xa1d2('0x13')]);}else{logger[_0xa1d2('0xc')](_0xa1d2('0xd'),_0x41cc04,_0xa1d2('0xe'));_0x167a42(_0x1de5fb[_0xa1d2('0x14')][_0xa1d2('0x13')]);}})[_0xa1d2('0x15')](function(_0x4b244a){logger[_0xa1d2('0x11')](_0xa1d2('0xd'),_0x41cc04,_0x4b244a);_0x401638(_0x4b244a);});});}