Built motion from commit 85328c08.|2.5.50
[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 _0xee49=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee49,0xe1));var _0x9ee4=function(_0x1393ff,_0x23ffbc){_0x1393ff=_0x1393ff-0x0;var _0x35baf3=_0xee49[_0x1393ff];return _0x35baf3;};'use strict';var _=require(_0x9ee4('0x0'));var util=require(_0x9ee4('0x1'));var moment=require('moment');var BPromise=require(_0x9ee4('0x2'));var rs=require(_0x9ee4('0x3'));var fs=require('fs');var Redis=require(_0x9ee4('0x4'));var db=require(_0x9ee4('0x5'))['db'];var utils=require(_0x9ee4('0x6'));var logger=require(_0x9ee4('0x7'))('rpc');var config=require(_0x9ee4('0x8'));var jayson=require(_0x9ee4('0x9'));var client=jayson[_0x9ee4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43fbaa,_0x3aa8fc,_0x105f25){return new BPromise(function(_0x549dc3,_0x940c36){return client['request'](_0x43fbaa,_0x105f25)[_0x9ee4('0xb')](function(_0x43114e){logger[_0x9ee4('0xc')](_0x9ee4('0xd'),_0x3aa8fc,_0x9ee4('0xe'));logger['debug'](_0x9ee4('0xf'),_0x3aa8fc,_0x9ee4('0xe'),JSON['stringify'](_0x43114e));if(_0x43114e[_0x9ee4('0x10')]){if(_0x43114e[_0x9ee4('0x10')][_0x9ee4('0x11')]===0x1f4){logger['error'](_0x9ee4('0xd'),_0x3aa8fc,_0x43114e['error'][_0x9ee4('0x12')]);return _0x940c36(_0x43114e[_0x9ee4('0x10')]['message']);}logger[_0x9ee4('0x10')](_0x9ee4('0xd'),_0x3aa8fc,_0x43114e[_0x9ee4('0x10')][_0x9ee4('0x12')]);return _0x549dc3(_0x43114e[_0x9ee4('0x10')]['message']);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x3aa8fc,'request\x20sent');_0x549dc3(_0x43114e[_0x9ee4('0x13')][_0x9ee4('0x12')]);}})['catch'](function(_0x3f67ea){logger[_0x9ee4('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x3aa8fc,_0x3f67ea);_0x940c36(_0x3f67ea);});});}