Built motion from commit b5413ace.|2.6.9
[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 _0xc7dd=['then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x48064f,_0x347cca){var _0x65f4ef=function(_0x344202){while(--_0x344202){_0x48064f['push'](_0x48064f['shift']());}};_0x65f4ef(++_0x347cca);}(_0xc7dd,0x1e6));var _0xdc7d=function(_0x1d1f80,_0x2c87c0){_0x1d1f80=_0x1d1f80-0x0;var _0x380d8b=_0xc7dd[_0x1d1f80];return _0x380d8b;};'use strict';var _=require(_0xdc7d('0x0'));var util=require(_0xdc7d('0x1'));var moment=require(_0xdc7d('0x2'));var BPromise=require(_0xdc7d('0x3'));var rs=require(_0xdc7d('0x4'));var fs=require('fs');var Redis=require(_0xdc7d('0x5'));var db=require(_0xdc7d('0x6'))['db'];var utils=require(_0xdc7d('0x7'));var logger=require(_0xdc7d('0x8'))(_0xdc7d('0x9'));var config=require(_0xdc7d('0xa'));var jayson=require(_0xdc7d('0xb'));var client=jayson[_0xdc7d('0xc')][_0xdc7d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x18a053,_0x19379e,_0x5b8084){return new BPromise(function(_0x5d81c7,_0x1e90e0){return client['request'](_0x18a053,_0x5b8084)[_0xdc7d('0xe')](function(_0x443363){logger[_0xdc7d('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x19379e,_0xdc7d('0x10'));logger[_0xdc7d('0x11')](_0xdc7d('0x12'),_0x19379e,_0xdc7d('0x10'),JSON['stringify'](_0x443363));if(_0x443363[_0xdc7d('0x13')]){if(_0x443363['error'][_0xdc7d('0x14')]===0x1f4){logger[_0xdc7d('0x13')](_0xdc7d('0x15'),_0x19379e,_0x443363[_0xdc7d('0x13')][_0xdc7d('0x16')]);return _0x1e90e0(_0x443363[_0xdc7d('0x13')][_0xdc7d('0x16')]);}logger[_0xdc7d('0x13')](_0xdc7d('0x15'),_0x19379e,_0x443363[_0xdc7d('0x13')][_0xdc7d('0x16')]);return _0x5d81c7(_0x443363[_0xdc7d('0x13')][_0xdc7d('0x16')]);}else{logger[_0xdc7d('0xf')](_0xdc7d('0x15'),_0x19379e,'request\x20sent');_0x5d81c7(_0x443363[_0xdc7d('0x17')][_0xdc7d('0x16')]);}})[_0xdc7d('0x18')](function(_0x52f2a7){logger[_0xdc7d('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x19379e,_0x52f2a7);_0x1e90e0(_0x52f2a7);});});}