Built motion from commit 753c950e.|2.5.42
[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 _0x8258=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x844866,_0x57ee1e){var _0x26343c=function(_0x61601d){while(--_0x61601d){_0x844866['push'](_0x844866['shift']());}};_0x26343c(++_0x57ee1e);}(_0x8258,0x1f2));var _0x8825=function(_0x2594b5,_0x1f0ec9){_0x2594b5=_0x2594b5-0x0;var _0x989874=_0x8258[_0x2594b5];return _0x989874;};'use strict';var _=require(_0x8825('0x0'));var util=require(_0x8825('0x1'));var moment=require(_0x8825('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8825('0x3'));var db=require(_0x8825('0x4'))['db'];var utils=require(_0x8825('0x5'));var logger=require(_0x8825('0x6'))(_0x8825('0x7'));var config=require(_0x8825('0x8'));var jayson=require(_0x8825('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e4e5d,_0x2bd1a2,_0x32e764){return new BPromise(function(_0x42c43a,_0x4b47cb){return client[_0x8825('0xa')](_0x4e4e5d,_0x32e764)[_0x8825('0xb')](function(_0x32a991){logger[_0x8825('0xc')](_0x8825('0xd'),_0x2bd1a2,_0x8825('0xe'));logger[_0x8825('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2bd1a2,_0x8825('0xe'),JSON['stringify'](_0x32a991));if(_0x32a991[_0x8825('0x10')]){if(_0x32a991['error'][_0x8825('0x11')]===0x1f4){logger[_0x8825('0x10')](_0x8825('0xd'),_0x2bd1a2,_0x32a991[_0x8825('0x10')]['message']);return _0x4b47cb(_0x32a991['error'][_0x8825('0x12')]);}logger[_0x8825('0x10')](_0x8825('0xd'),_0x2bd1a2,_0x32a991[_0x8825('0x10')]['message']);return _0x42c43a(_0x32a991['error'][_0x8825('0x12')]);}else{logger[_0x8825('0xc')](_0x8825('0xd'),_0x2bd1a2,_0x8825('0xe'));_0x42c43a(_0x32a991[_0x8825('0x13')][_0x8825('0x12')]);}})[_0x8825('0x14')](function(_0x3d0f22){logger[_0x8825('0x10')](_0x8825('0xd'),_0x2bd1a2,_0x3d0f22);_0x4b47cb(_0x3d0f22);});});}