Built motion from commit d6d69adf.|2.6.33
[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 _0xe103=['../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x44fe6d,_0x4e97c6){var _0x14563a=function(_0x2c5850){while(--_0x2c5850){_0x44fe6d['push'](_0x44fe6d['shift']());}};_0x14563a(++_0x4e97c6);}(_0xe103,0x12f));var _0x3e10=function(_0x52a592,_0x2926b4){_0x52a592=_0x52a592-0x0;var _0x511e55=_0xe103[_0x52a592];return _0x511e55;};'use strict';var _=require(_0x3e10('0x0'));var util=require(_0x3e10('0x1'));var moment=require('moment');var BPromise=require(_0x3e10('0x2'));var rs=require(_0x3e10('0x3'));var fs=require('fs');var Redis=require(_0x3e10('0x4'));var db=require(_0x3e10('0x5'))['db'];var utils=require(_0x3e10('0x6'));var logger=require(_0x3e10('0x7'))(_0x3e10('0x8'));var config=require(_0x3e10('0x9'));var jayson=require(_0x3e10('0xa'));var client=jayson['client'][_0x3e10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1c10,_0x32884d,_0x5a1011){return new BPromise(function(_0x270afe,_0x37f3fb){return client[_0x3e10('0xc')](_0x3a1c10,_0x5a1011)[_0x3e10('0xd')](function(_0x1a1572){logger[_0x3e10('0xe')](_0x3e10('0xf'),_0x32884d,_0x3e10('0x10'));logger['debug'](_0x3e10('0x11'),_0x32884d,'request\x20sent',JSON[_0x3e10('0x12')](_0x1a1572));if(_0x1a1572['error']){if(_0x1a1572[_0x3e10('0x13')][_0x3e10('0x14')]===0x1f4){logger['error'](_0x3e10('0xf'),_0x32884d,_0x1a1572['error'][_0x3e10('0x15')]);return _0x37f3fb(_0x1a1572['error'][_0x3e10('0x15')]);}logger['error'](_0x3e10('0xf'),_0x32884d,_0x1a1572[_0x3e10('0x13')][_0x3e10('0x15')]);return _0x270afe(_0x1a1572[_0x3e10('0x13')][_0x3e10('0x15')]);}else{logger['info'](_0x3e10('0xf'),_0x32884d,_0x3e10('0x10'));_0x270afe(_0x1a1572[_0x3e10('0x16')][_0x3e10('0x15')]);}})[_0x3e10('0x17')](function(_0xf21ebf){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x32884d,_0xf21ebf);_0x37f3fb(_0xf21ebf);});});}