Built motion from commit 0900f080.|2.5.45
[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 _0xdad9=['rpc','../../config/environment','jayson/promise','client','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x874a49,_0x5b07bc){var _0x343d2f=function(_0x351928){while(--_0x351928){_0x874a49['push'](_0x874a49['shift']());}};_0x343d2f(++_0x5b07bc);}(_0xdad9,0xad));var _0x9dad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdad9[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9dad('0x0'));var moment=require(_0x9dad('0x1'));var BPromise=require(_0x9dad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dad('0x3'));var db=require(_0x9dad('0x4'))['db'];var utils=require(_0x9dad('0x5'));var logger=require(_0x9dad('0x6'))(_0x9dad('0x7'));var config=require(_0x9dad('0x8'));var jayson=require(_0x9dad('0x9'));var client=jayson[_0x9dad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x597ac1,_0x300965,_0x5d2bbc){return new BPromise(function(_0x2b9ac6,_0x416586){return client['request'](_0x597ac1,_0x5d2bbc)[_0x9dad('0xb')](function(_0x4e520c){logger[_0x9dad('0xc')](_0x9dad('0xd'),_0x300965,_0x9dad('0xe'));logger[_0x9dad('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x300965,_0x9dad('0xe'),JSON['stringify'](_0x4e520c));if(_0x4e520c[_0x9dad('0x10')]){if(_0x4e520c[_0x9dad('0x10')][_0x9dad('0x11')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x300965,_0x4e520c[_0x9dad('0x10')]['message']);return _0x416586(_0x4e520c['error'][_0x9dad('0x12')]);}logger[_0x9dad('0x10')](_0x9dad('0xd'),_0x300965,_0x4e520c['error'][_0x9dad('0x12')]);return _0x2b9ac6(_0x4e520c['error'][_0x9dad('0x12')]);}else{logger[_0x9dad('0xc')](_0x9dad('0xd'),_0x300965,'request\x20sent');_0x2b9ac6(_0x4e520c[_0x9dad('0x13')][_0x9dad('0x12')]);}})['catch'](function(_0x503367){logger[_0x9dad('0x10')](_0x9dad('0xd'),_0x300965,_0x503367);_0x416586(_0x503367);});});}