ed998c4672d492ee57fd0023d2817e10e8ebd853
[motion2.git] / server / api / mailSubstatus / mailSubstatus.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 _0x619e=['http','request','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x58b754,_0x464e39){var _0x20cc09=function(_0x323424){while(--_0x323424){_0x58b754['push'](_0x58b754['shift']());}};_0x20cc09(++_0x464e39);}(_0x619e,0x19b));var _0xe619=function(_0x486e6f,_0x395450){_0x486e6f=_0x486e6f-0x0;var _0x104212=_0x619e[_0x486e6f];return _0x104212;};'use strict';var _=require(_0xe619('0x0'));var util=require(_0xe619('0x1'));var moment=require(_0xe619('0x2'));var BPromise=require(_0xe619('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe619('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe619('0x5'));var config=require(_0xe619('0x6'));var jayson=require(_0xe619('0x7'));var client=jayson[_0xe619('0x8')][_0xe619('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x543165,_0x26d81c,_0x2c9ce2){return new BPromise(function(_0x8607ab,_0x541caf){return client[_0xe619('0xa')](_0x543165,_0x2c9ce2)['then'](function(_0xa0d0e2){logger['info'](_0xe619('0xb'),_0x26d81c,'request\x20sent');logger['debug'](_0xe619('0xc'),_0x26d81c,_0xe619('0xd'),JSON[_0xe619('0xe')](_0xa0d0e2));if(_0xa0d0e2[_0xe619('0xf')]){if(_0xa0d0e2[_0xe619('0xf')][_0xe619('0x10')]===0x1f4){logger[_0xe619('0xf')](_0xe619('0xb'),_0x26d81c,_0xa0d0e2[_0xe619('0xf')][_0xe619('0x11')]);return _0x541caf(_0xa0d0e2[_0xe619('0xf')][_0xe619('0x11')]);}logger['error'](_0xe619('0xb'),_0x26d81c,_0xa0d0e2[_0xe619('0xf')][_0xe619('0x11')]);return _0x8607ab(_0xa0d0e2['error'][_0xe619('0x11')]);}else{logger[_0xe619('0x12')](_0xe619('0xb'),_0x26d81c,'request\x20sent');_0x8607ab(_0xa0d0e2[_0xe619('0x13')][_0xe619('0x11')]);}})[_0xe619('0x14')](function(_0x4fb704){logger[_0xe619('0xf')](_0xe619('0xb'),_0x26d81c,_0x4fb704);_0x541caf(_0x4fb704);});});}