56bbfaf8c334b8aa98b630be398571a66e057e10
[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 _0xa07f=['request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa07f,0x14e));var _0xfa07=function(_0x33d099,_0x2e1385){_0x33d099=_0x33d099-0x0;var _0xaaaf55=_0xa07f[_0x33d099];return _0xaaaf55;};'use strict';var _=require(_0xfa07('0x0'));var util=require(_0xfa07('0x1'));var moment=require('moment');var BPromise=require(_0xfa07('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfa07('0x3'));var logger=require(_0xfa07('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfa07('0x5'));var client=jayson[_0xfa07('0x6')][_0xfa07('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x432d19,_0x4858f7,_0x3d9424){return new BPromise(function(_0x3ed1a3,_0x5bcece){return client[_0xfa07('0x8')](_0x432d19,_0x3d9424)[_0xfa07('0x9')](function(_0xd60690){logger[_0xfa07('0xa')](_0xfa07('0xb'),_0x4858f7,_0xfa07('0xc'));logger[_0xfa07('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4858f7,_0xfa07('0xc'),JSON[_0xfa07('0xe')](_0xd60690));if(_0xd60690['error']){if(_0xd60690['error']['code']===0x1f4){logger[_0xfa07('0xf')](_0xfa07('0xb'),_0x4858f7,_0xd60690[_0xfa07('0xf')][_0xfa07('0x10')]);return _0x5bcece(_0xd60690[_0xfa07('0xf')][_0xfa07('0x10')]);}logger[_0xfa07('0xf')](_0xfa07('0xb'),_0x4858f7,_0xd60690[_0xfa07('0xf')][_0xfa07('0x10')]);return _0x3ed1a3(_0xd60690[_0xfa07('0xf')][_0xfa07('0x10')]);}else{logger[_0xfa07('0xa')](_0xfa07('0xb'),_0x4858f7,'request\x20sent');_0x3ed1a3(_0xd60690[_0xfa07('0x11')][_0xfa07('0x10')]);}})[_0xfa07('0x12')](function(_0x59126d){logger[_0xfa07('0xf')](_0xfa07('0xb'),_0x4858f7,_0x59126d);_0x5bcece(_0x59126d);});});}