Built motion from commit 43538d75.|2.5.35
[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 _0xfb9a=['request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x217ce7,_0x592574){var _0x4d3f53=function(_0x26d25c){while(--_0x26d25c){_0x217ce7['push'](_0x217ce7['shift']());}};_0x4d3f53(++_0x592574);}(_0xfb9a,0x19c));var _0xafb9=function(_0x3afce0,_0x1d1ce1){_0x3afce0=_0x3afce0-0x0;var _0x5bb193=_0xfb9a[_0x3afce0];return _0x5bb193;};'use strict';var _=require(_0xafb9('0x0'));var util=require(_0xafb9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafb9('0x2'))['db'];var utils=require(_0xafb9('0x3'));var logger=require(_0xafb9('0x4'))(_0xafb9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xafb9('0x6')][_0xafb9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e5b0c,_0x5e62c9,_0x2ced1f){return new BPromise(function(_0x346474,_0x2468e1){return client[_0xafb9('0x8')](_0x2e5b0c,_0x2ced1f)[_0xafb9('0x9')](function(_0x17552d){logger[_0xafb9('0xa')](_0xafb9('0xb'),_0x5e62c9,'request\x20sent');logger[_0xafb9('0xc')](_0xafb9('0xd'),_0x5e62c9,_0xafb9('0xe'),JSON[_0xafb9('0xf')](_0x17552d));if(_0x17552d[_0xafb9('0x10')]){if(_0x17552d['error'][_0xafb9('0x11')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x5e62c9,_0x17552d[_0xafb9('0x10')][_0xafb9('0x12')]);return _0x2468e1(_0x17552d[_0xafb9('0x10')]['message']);}logger[_0xafb9('0x10')](_0xafb9('0xb'),_0x5e62c9,_0x17552d[_0xafb9('0x10')]['message']);return _0x346474(_0x17552d[_0xafb9('0x10')][_0xafb9('0x12')]);}else{logger[_0xafb9('0xa')](_0xafb9('0xb'),_0x5e62c9,_0xafb9('0xe'));_0x346474(_0x17552d[_0xafb9('0x13')][_0xafb9('0x12')]);}})['catch'](function(_0x4569fc){logger[_0xafb9('0x10')](_0xafb9('0xb'),_0x5e62c9,_0x4569fc);_0x2468e1(_0x4569fc);});});}