Built motion from commit 449495f6.|2.6.27
[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 _0x623e=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x623e,0x182));var _0xe623=function(_0x2ca82a,_0x1e2f7e){_0x2ca82a=_0x2ca82a-0x0;var _0x5435ad=_0x623e[_0x2ca82a];return _0x5435ad;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var moment=require(_0xe623('0x1'));var BPromise=require(_0xe623('0x2'));var rs=require(_0xe623('0x3'));var fs=require('fs');var Redis=require(_0xe623('0x4'));var db=require(_0xe623('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe623('0x6'));var jayson=require(_0xe623('0x7'));var client=jayson['client'][_0xe623('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54ca27,_0x5114e5,_0xc6fa45){return new BPromise(function(_0xeb9cf0,_0x4602cf){return client[_0xe623('0x9')](_0x54ca27,_0xc6fa45)[_0xe623('0xa')](function(_0x27bc25){logger[_0xe623('0xb')](_0xe623('0xc'),_0x5114e5,_0xe623('0xd'));logger['debug'](_0xe623('0xe'),_0x5114e5,_0xe623('0xd'),JSON[_0xe623('0xf')](_0x27bc25));if(_0x27bc25[_0xe623('0x10')]){if(_0x27bc25[_0xe623('0x10')][_0xe623('0x11')]===0x1f4){logger[_0xe623('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5114e5,_0x27bc25[_0xe623('0x10')]['message']);return _0x4602cf(_0x27bc25[_0xe623('0x10')]['message']);}logger[_0xe623('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5114e5,_0x27bc25[_0xe623('0x10')][_0xe623('0x12')]);return _0xeb9cf0(_0x27bc25[_0xe623('0x10')]['message']);}else{logger['info'](_0xe623('0xc'),_0x5114e5,_0xe623('0xd'));_0xeb9cf0(_0x27bc25['result']['message']);}})[_0xe623('0x13')](function(_0x31f27b){logger[_0xe623('0x10')](_0xe623('0xc'),_0x5114e5,_0x31f27b);_0x4602cf(_0x31f27b);});});}