3a62753e4b4ba257d01ce13d09b6b613807b490c
[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 _0xbf40=['../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39d908,_0x47677b){var _0x4376c4=function(_0x381271){while(--_0x381271){_0x39d908['push'](_0x39d908['shift']());}};_0x4376c4(++_0x47677b);}(_0xbf40,0x1f4));var _0x0bf4=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xbf40[_0x3207aa];return _0x51758f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0bf4('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bf4('0x1'));var db=require(_0x0bf4('0x2'))['db'];var utils=require(_0x0bf4('0x3'));var logger=require(_0x0bf4('0x4'))(_0x0bf4('0x5'));var config=require(_0x0bf4('0x6'));var jayson=require(_0x0bf4('0x7'));var client=jayson[_0x0bf4('0x8')][_0x0bf4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39afb9,_0x24deaf,_0x4bdcbc){return new BPromise(function(_0x87be65,_0x4b4e92){return client[_0x0bf4('0xa')](_0x39afb9,_0x4bdcbc)[_0x0bf4('0xb')](function(_0x44ea7b){logger[_0x0bf4('0xc')](_0x0bf4('0xd'),_0x24deaf,'request\x20sent');logger[_0x0bf4('0xe')](_0x0bf4('0xf'),_0x24deaf,_0x0bf4('0x10'),JSON[_0x0bf4('0x11')](_0x44ea7b));if(_0x44ea7b[_0x0bf4('0x12')]){if(_0x44ea7b['error'][_0x0bf4('0x13')]===0x1f4){logger[_0x0bf4('0x12')](_0x0bf4('0xd'),_0x24deaf,_0x44ea7b[_0x0bf4('0x12')][_0x0bf4('0x14')]);return _0x4b4e92(_0x44ea7b['error'][_0x0bf4('0x14')]);}logger[_0x0bf4('0x12')](_0x0bf4('0xd'),_0x24deaf,_0x44ea7b[_0x0bf4('0x12')][_0x0bf4('0x14')]);return _0x87be65(_0x44ea7b['error'][_0x0bf4('0x14')]);}else{logger['info'](_0x0bf4('0xd'),_0x24deaf,_0x0bf4('0x10'));_0x87be65(_0x44ea7b['result'][_0x0bf4('0x14')]);}})[_0x0bf4('0x15')](function(_0x44fb53){logger[_0x0bf4('0x12')](_0x0bf4('0xd'),_0x24deaf,_0x44fb53);_0x4b4e92(_0x44fb53);});});}