3105a342ffade581447f2fd0eb9f0dc7e612c495
[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 _0x885f=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x286475,_0x28e2d8){var _0x2d439f=function(_0x396e9d){while(--_0x396e9d){_0x286475['push'](_0x286475['shift']());}};_0x2d439f(++_0x28e2d8);}(_0x885f,0xa5));var _0xf885=function(_0x216edc,_0x57df05){_0x216edc=_0x216edc-0x0;var _0x745d3e=_0x885f[_0x216edc];return _0x745d3e;};'use strict';var _=require(_0xf885('0x0'));var util=require(_0xf885('0x1'));var moment=require(_0xf885('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf885('0x3'));var db=require(_0xf885('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf885('0x5'))(_0xf885('0x6'));var config=require(_0xf885('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf885('0x8')][_0xf885('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa04e61,_0x3900ce,_0x590415){return new BPromise(function(_0x3b66a7,_0x59fb6a){return client[_0xf885('0xa')](_0xa04e61,_0x590415)[_0xf885('0xb')](function(_0x25585c){logger['info'](_0xf885('0xc'),_0x3900ce,_0xf885('0xd'));logger[_0xf885('0xe')](_0xf885('0xf'),_0x3900ce,_0xf885('0xd'),JSON['stringify'](_0x25585c));if(_0x25585c['error']){if(_0x25585c[_0xf885('0x10')]['code']===0x1f4){logger[_0xf885('0x10')](_0xf885('0xc'),_0x3900ce,_0x25585c[_0xf885('0x10')][_0xf885('0x11')]);return _0x59fb6a(_0x25585c[_0xf885('0x10')][_0xf885('0x11')]);}logger[_0xf885('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x3900ce,_0x25585c[_0xf885('0x10')]['message']);return _0x3b66a7(_0x25585c[_0xf885('0x10')][_0xf885('0x11')]);}else{logger['info'](_0xf885('0xc'),_0x3900ce,_0xf885('0xd'));_0x3b66a7(_0x25585c[_0xf885('0x12')][_0xf885('0x11')]);}})[_0xf885('0x13')](function(_0x5cf219){logger[_0xf885('0x10')](_0xf885('0xc'),_0x3900ce,_0x5cf219);_0x59fb6a(_0x5cf219);});});}