79d38c45686f4b253fa66de78fba4514b904f460
[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 _0x92ba=['../../config/logger','rpc','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x92371c,_0x113062){var _0x2e71db=function(_0x5bedc0){while(--_0x5bedc0){_0x92371c['push'](_0x92371c['shift']());}};_0x2e71db(++_0x113062);}(_0x92ba,0x1ad));var _0xa92b=function(_0x3652c2,_0x10dddc){_0x3652c2=_0x3652c2-0x0;var _0x574ffc=_0x92ba[_0x3652c2];return _0x574ffc;};'use strict';var _=require(_0xa92b('0x0'));var util=require(_0xa92b('0x1'));var moment=require(_0xa92b('0x2'));var BPromise=require(_0xa92b('0x3'));var rs=require(_0xa92b('0x4'));var fs=require('fs');var Redis=require(_0xa92b('0x5'));var db=require(_0xa92b('0x6'))['db'];var utils=require(_0xa92b('0x7'));var logger=require(_0xa92b('0x8'))(_0xa92b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa92b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d523,_0x326343,_0x481d0b){return new BPromise(function(_0x38fb8b,_0x3674dd){return client[_0xa92b('0xb')](_0x56d523,_0x481d0b)[_0xa92b('0xc')](function(_0x1e4986){logger[_0xa92b('0xd')](_0xa92b('0xe'),_0x326343,_0xa92b('0xf'));logger[_0xa92b('0x10')](_0xa92b('0x11'),_0x326343,_0xa92b('0xf'),JSON[_0xa92b('0x12')](_0x1e4986));if(_0x1e4986[_0xa92b('0x13')]){if(_0x1e4986[_0xa92b('0x13')][_0xa92b('0x14')]===0x1f4){logger[_0xa92b('0x13')](_0xa92b('0xe'),_0x326343,_0x1e4986['error'][_0xa92b('0x15')]);return _0x3674dd(_0x1e4986[_0xa92b('0x13')]['message']);}logger['error'](_0xa92b('0xe'),_0x326343,_0x1e4986[_0xa92b('0x13')][_0xa92b('0x15')]);return _0x38fb8b(_0x1e4986[_0xa92b('0x13')][_0xa92b('0x15')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x326343,_0xa92b('0xf'));_0x38fb8b(_0x1e4986[_0xa92b('0x16')][_0xa92b('0x15')]);}})['catch'](function(_0x237821){logger[_0xa92b('0x13')](_0xa92b('0xe'),_0x326343,_0x237821);_0x3674dd(_0x237821);});});}