Built motion from commit 87cd5f02.|2.5.48
[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 _0x21cd=['stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','rpc','jayson/promise','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x4fcb48,_0x2bce5a){var _0x3316a2=function(_0x489eda){while(--_0x489eda){_0x4fcb48['push'](_0x4fcb48['shift']());}};_0x3316a2(++_0x2bce5a);}(_0x21cd,0x14b));var _0xd21c=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x21cd[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var moment=require('moment');var BPromise=require(_0xd21c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd21c('0x3'));var config=require('../../config/environment');var jayson=require(_0xd21c('0x4'));var client=jayson['client'][_0xd21c('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x101694,_0x68ed7b,_0x40bf9a){return new BPromise(function(_0x2874a3,_0xa99d0c){return client['request'](_0x101694,_0x40bf9a)[_0xd21c('0x6')](function(_0x4d68a4){logger[_0xd21c('0x7')]('MailSubstatus,\x20%s,\x20%s',_0x68ed7b,_0xd21c('0x8'));logger[_0xd21c('0x9')](_0xd21c('0xa'),_0x68ed7b,_0xd21c('0x8'),JSON[_0xd21c('0xb')](_0x4d68a4));if(_0x4d68a4[_0xd21c('0xc')]){if(_0x4d68a4[_0xd21c('0xc')][_0xd21c('0xd')]===0x1f4){logger[_0xd21c('0xc')](_0xd21c('0xe'),_0x68ed7b,_0x4d68a4['error']['message']);return _0xa99d0c(_0x4d68a4[_0xd21c('0xc')]['message']);}logger[_0xd21c('0xc')](_0xd21c('0xe'),_0x68ed7b,_0x4d68a4[_0xd21c('0xc')][_0xd21c('0xf')]);return _0x2874a3(_0x4d68a4[_0xd21c('0xc')]['message']);}else{logger['info'](_0xd21c('0xe'),_0x68ed7b,_0xd21c('0x8'));_0x2874a3(_0x4d68a4[_0xd21c('0x10')][_0xd21c('0xf')]);}})[_0xd21c('0x11')](function(_0x25d768){logger['error'](_0xd21c('0xe'),_0x68ed7b,_0x25d768);_0xa99d0c(_0x25d768);});});}