Built motion from commit 20b39a97.|2.6.29
[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 _0x1a14=['request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x172692,_0x34dea2){var _0x4632f4=function(_0xd41a47){while(--_0xd41a47){_0x172692['push'](_0x172692['shift']());}};_0x4632f4(++_0x34dea2);}(_0x1a14,0x88));var _0x41a1=function(_0x5af293,_0x535fbb){_0x5af293=_0x5af293-0x0;var _0x482c50=_0x1a14[_0x5af293];return _0x482c50;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x41a1('0x0'));var BPromise=require(_0x41a1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41a1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x41a1('0x3'));var logger=require('../../config/logger')(_0x41a1('0x4'));var config=require(_0x41a1('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x41a1('0x6')][_0x41a1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c10bd,_0x2bfead,_0x3fd9ef){return new BPromise(function(_0x9a2c70,_0x3b0e85){return client[_0x41a1('0x8')](_0x2c10bd,_0x3fd9ef)['then'](function(_0x3f7ec1){logger['info'](_0x41a1('0x9'),_0x2bfead,_0x41a1('0xa'));logger[_0x41a1('0xb')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2bfead,_0x41a1('0xa'),JSON['stringify'](_0x3f7ec1));if(_0x3f7ec1[_0x41a1('0xc')]){if(_0x3f7ec1['error'][_0x41a1('0xd')]===0x1f4){logger[_0x41a1('0xc')](_0x41a1('0x9'),_0x2bfead,_0x3f7ec1[_0x41a1('0xc')][_0x41a1('0xe')]);return _0x3b0e85(_0x3f7ec1[_0x41a1('0xc')][_0x41a1('0xe')]);}logger[_0x41a1('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x2bfead,_0x3f7ec1[_0x41a1('0xc')][_0x41a1('0xe')]);return _0x9a2c70(_0x3f7ec1[_0x41a1('0xc')][_0x41a1('0xe')]);}else{logger[_0x41a1('0xf')](_0x41a1('0x9'),_0x2bfead,'request\x20sent');_0x9a2c70(_0x3f7ec1[_0x41a1('0x10')][_0x41a1('0xe')]);}})[_0x41a1('0x11')](function(_0x501f87){logger[_0x41a1('0xc')](_0x41a1('0x9'),_0x2bfead,_0x501f87);_0x3b0e85(_0x501f87);});});}