Built motion from commit dbf3a7e2.|2.6.30
[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 _0xc5dd=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then'];(function(_0x231457,_0x260e72){var _0x337849=function(_0xff131e){while(--_0xff131e){_0x231457['push'](_0x231457['shift']());}};_0x337849(++_0x260e72);}(_0xc5dd,0x170));var _0xdc5d=function(_0x160140,_0x5113fa){_0x160140=_0x160140-0x0;var _0x455417=_0xc5dd[_0x160140];return _0x455417;};'use strict';var _=require(_0xdc5d('0x0'));var util=require(_0xdc5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc5d('0x2'));var db=require(_0xdc5d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdc5d('0x4'));var config=require('../../config/environment');var jayson=require(_0xdc5d('0x5'));var client=jayson[_0xdc5d('0x6')][_0xdc5d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19f841,_0x2033a6,_0x21f318){return new BPromise(function(_0x2e4776,_0x17839a){return client[_0xdc5d('0x8')](_0x19f841,_0x21f318)[_0xdc5d('0x9')](function(_0x9f14f4){logger[_0xdc5d('0xa')](_0xdc5d('0xb'),_0x2033a6,_0xdc5d('0xc'));logger[_0xdc5d('0xd')](_0xdc5d('0xe'),_0x2033a6,_0xdc5d('0xc'),JSON[_0xdc5d('0xf')](_0x9f14f4));if(_0x9f14f4['error']){if(_0x9f14f4[_0xdc5d('0x10')][_0xdc5d('0x11')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2033a6,_0x9f14f4[_0xdc5d('0x10')][_0xdc5d('0x12')]);return _0x17839a(_0x9f14f4[_0xdc5d('0x10')][_0xdc5d('0x12')]);}logger[_0xdc5d('0x10')](_0xdc5d('0xb'),_0x2033a6,_0x9f14f4[_0xdc5d('0x10')][_0xdc5d('0x12')]);return _0x2e4776(_0x9f14f4['error'][_0xdc5d('0x12')]);}else{logger[_0xdc5d('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x2033a6,_0xdc5d('0xc'));_0x2e4776(_0x9f14f4[_0xdc5d('0x13')][_0xdc5d('0x12')]);}})[_0xdc5d('0x14')](function(_0x5953f0){logger[_0xdc5d('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x2033a6,_0x5953f0);_0x17839a(_0x5953f0);});});}