Built motion from commit (unavailable).|2.4.4
[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 _0x4a32=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','error','code','MailSubstatus,\x20%s,\x20%s','message','info'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x4a32,0xf4));var _0x24a3=function(_0x5987a2,_0x3e049a){_0x5987a2=_0x5987a2-0x0;var _0x3b8a1d=_0x4a32[_0x5987a2];return _0x3b8a1d;};'use strict';var _=require(_0x24a3('0x0'));var util=require('util');var moment=require(_0x24a3('0x1'));var BPromise=require(_0x24a3('0x2'));var rs=require(_0x24a3('0x3'));var fs=require('fs');var Redis=require(_0x24a3('0x4'));var db=require(_0x24a3('0x5'))['db'];var utils=require(_0x24a3('0x6'));var logger=require(_0x24a3('0x7'))('rpc');var config=require(_0x24a3('0x8'));var jayson=require(_0x24a3('0x9'));var client=jayson[_0x24a3('0xa')][_0x24a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19affa,_0x28d0b6,_0x8ca392){return new BPromise(function(_0x3d65c7,_0x4e5af3){return client[_0x24a3('0xc')](_0x19affa,_0x8ca392)[_0x24a3('0xd')](function(_0x2f3d0c){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x28d0b6,'request\x20sent');logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x28d0b6,_0x24a3('0xe'),JSON['stringify'](_0x2f3d0c));if(_0x2f3d0c['error']){if(_0x2f3d0c[_0x24a3('0xf')][_0x24a3('0x10')]===0x1f4){logger['error'](_0x24a3('0x11'),_0x28d0b6,_0x2f3d0c[_0x24a3('0xf')][_0x24a3('0x12')]);return _0x4e5af3(_0x2f3d0c[_0x24a3('0xf')][_0x24a3('0x12')]);}logger[_0x24a3('0xf')](_0x24a3('0x11'),_0x28d0b6,_0x2f3d0c[_0x24a3('0xf')][_0x24a3('0x12')]);return _0x3d65c7(_0x2f3d0c[_0x24a3('0xf')]['message']);}else{logger[_0x24a3('0x13')](_0x24a3('0x11'),_0x28d0b6,'request\x20sent');_0x3d65c7(_0x2f3d0c[_0x24a3('0x14')]['message']);}})[_0x24a3('0x15')](function(_0x2e5804){logger['error'](_0x24a3('0x11'),_0x28d0b6,_0x2e5804);_0x4e5af3(_0x2e5804);});});}