Built motion from commit 4a17b4ed.|2.6.17
[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 _0xac24=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5cc556,_0x158710){var _0x12103b=function(_0x13ff4a){while(--_0x13ff4a){_0x5cc556['push'](_0x5cc556['shift']());}};_0x12103b(++_0x158710);}(_0xac24,0x109));var _0x4ac2=function(_0x52d329,_0x2463d8){_0x52d329=_0x52d329-0x0;var _0x3b9680=_0xac24[_0x52d329];return _0x3b9680;};'use strict';var _=require(_0x4ac2('0x0'));var util=require(_0x4ac2('0x1'));var moment=require(_0x4ac2('0x2'));var BPromise=require(_0x4ac2('0x3'));var rs=require(_0x4ac2('0x4'));var fs=require('fs');var Redis=require(_0x4ac2('0x5'));var db=require(_0x4ac2('0x6'))['db'];var utils=require(_0x4ac2('0x7'));var logger=require(_0x4ac2('0x8'))(_0x4ac2('0x9'));var config=require(_0x4ac2('0xa'));var jayson=require(_0x4ac2('0xb'));var client=jayson[_0x4ac2('0xc')][_0x4ac2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x413342,_0xfcd9fb,_0x636462){return new BPromise(function(_0x838df,_0x31fade){return client[_0x4ac2('0xe')](_0x413342,_0x636462)[_0x4ac2('0xf')](function(_0x3de632){logger[_0x4ac2('0x10')](_0x4ac2('0x11'),_0xfcd9fb,_0x4ac2('0x12'));logger[_0x4ac2('0x13')](_0x4ac2('0x14'),_0xfcd9fb,_0x4ac2('0x12'),JSON[_0x4ac2('0x15')](_0x3de632));if(_0x3de632[_0x4ac2('0x16')]){if(_0x3de632[_0x4ac2('0x16')][_0x4ac2('0x17')]===0x1f4){logger[_0x4ac2('0x16')](_0x4ac2('0x11'),_0xfcd9fb,_0x3de632[_0x4ac2('0x16')][_0x4ac2('0x18')]);return _0x31fade(_0x3de632[_0x4ac2('0x16')][_0x4ac2('0x18')]);}logger[_0x4ac2('0x16')](_0x4ac2('0x11'),_0xfcd9fb,_0x3de632['error'][_0x4ac2('0x18')]);return _0x838df(_0x3de632[_0x4ac2('0x16')][_0x4ac2('0x18')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0xfcd9fb,_0x4ac2('0x12'));_0x838df(_0x3de632[_0x4ac2('0x19')]['message']);}})[_0x4ac2('0x1a')](function(_0x1279bf){logger[_0x4ac2('0x16')](_0x4ac2('0x11'),_0xfcd9fb,_0x1279bf);_0x31fade(_0x1279bf);});});}