Built motion from commit ddca4d0d.|2.5.47
[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 _0x20f7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring'];(function(_0x416342,_0x5a057a){var _0x110b5e=function(_0x5834b0){while(--_0x5834b0){_0x416342['push'](_0x416342['shift']());}};_0x110b5e(++_0x5a057a);}(_0x20f7,0x18d));var _0x720f=function(_0x418980,_0x397796){_0x418980=_0x418980-0x0;var _0x510a02=_0x20f7[_0x418980];return _0x510a02;};'use strict';var _=require(_0x720f('0x0'));var util=require(_0x720f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x720f('0x2'));var fs=require('fs');var Redis=require(_0x720f('0x3'));var db=require(_0x720f('0x4'))['db'];var utils=require(_0x720f('0x5'));var logger=require(_0x720f('0x6'))(_0x720f('0x7'));var config=require(_0x720f('0x8'));var jayson=require(_0x720f('0x9'));var client=jayson['client'][_0x720f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44e269,_0x5842f7,_0x40467a){return new BPromise(function(_0x361dec,_0x15997d){return client['request'](_0x44e269,_0x40467a)['then'](function(_0x167648){logger['info'](_0x720f('0xb'),_0x5842f7,_0x720f('0xc'));logger['debug'](_0x720f('0xd'),_0x5842f7,_0x720f('0xc'),JSON[_0x720f('0xe')](_0x167648));if(_0x167648[_0x720f('0xf')]){if(_0x167648[_0x720f('0xf')][_0x720f('0x10')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x5842f7,_0x167648['error']['message']);return _0x15997d(_0x167648[_0x720f('0xf')][_0x720f('0x11')]);}logger[_0x720f('0xf')](_0x720f('0xb'),_0x5842f7,_0x167648[_0x720f('0xf')]['message']);return _0x361dec(_0x167648['error'][_0x720f('0x11')]);}else{logger[_0x720f('0x12')](_0x720f('0xb'),_0x5842f7,_0x720f('0xc'));_0x361dec(_0x167648['result'][_0x720f('0x11')]);}})[_0x720f('0x13')](function(_0x50873d){logger[_0x720f('0xf')](_0x720f('0xb'),_0x5842f7,_0x50873d);_0x15997d(_0x50873d);});});}