14c85742c8d1fcaac24b686c8a28ae6e7128b906
[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 _0x6b45=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x39dc09,_0x4ded5e){var _0x4f482b=function(_0x5712d3){while(--_0x5712d3){_0x39dc09['push'](_0x39dc09['shift']());}};_0x4f482b(++_0x4ded5e);}(_0x6b45,0xb0));var _0x56b4=function(_0x5b621b,_0x3df21e){_0x5b621b=_0x5b621b-0x0;var _0x8eda75=_0x6b45[_0x5b621b];return _0x8eda75;};'use strict';var _=require(_0x56b4('0x0'));var util=require(_0x56b4('0x1'));var moment=require(_0x56b4('0x2'));var BPromise=require(_0x56b4('0x3'));var rs=require(_0x56b4('0x4'));var fs=require('fs');var Redis=require(_0x56b4('0x5'));var db=require(_0x56b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56b4('0x7'))(_0x56b4('0x8'));var config=require(_0x56b4('0x9'));var jayson=require(_0x56b4('0xa'));var client=jayson[_0x56b4('0xb')][_0x56b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12284d,_0x55d209,_0x1789b6){return new BPromise(function(_0x3583d9,_0x601666){return client[_0x56b4('0xd')](_0x12284d,_0x1789b6)[_0x56b4('0xe')](function(_0x542311){logger[_0x56b4('0xf')](_0x56b4('0x10'),_0x55d209,'request\x20sent');logger[_0x56b4('0x11')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x55d209,_0x56b4('0x12'),JSON['stringify'](_0x542311));if(_0x542311[_0x56b4('0x13')]){if(_0x542311['error'][_0x56b4('0x14')]===0x1f4){logger['error'](_0x56b4('0x10'),_0x55d209,_0x542311['error']['message']);return _0x601666(_0x542311[_0x56b4('0x13')][_0x56b4('0x15')]);}logger[_0x56b4('0x13')](_0x56b4('0x10'),_0x55d209,_0x542311['error'][_0x56b4('0x15')]);return _0x3583d9(_0x542311[_0x56b4('0x13')][_0x56b4('0x15')]);}else{logger[_0x56b4('0xf')](_0x56b4('0x10'),_0x55d209,_0x56b4('0x12'));_0x3583d9(_0x542311[_0x56b4('0x16')]['message']);}})['catch'](function(_0x561584){logger[_0x56b4('0x13')](_0x56b4('0x10'),_0x55d209,_0x561584);_0x601666(_0x561584);});});}