Built motion from commit a8c4dd89.|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 _0x047e=['../../mysqldb','../../config/logger','client','http','request','then','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x207db1,_0x19c38c){var _0x3744e1=function(_0x1cd678){while(--_0x1cd678){_0x207db1['push'](_0x207db1['shift']());}};_0x3744e1(++_0x19c38c);}(_0x047e,0x121));var _0xe047=function(_0x2fa99a,_0x5c2c61){_0x2fa99a=_0x2fa99a-0x0;var _0x3635ff=_0x047e[_0x2fa99a];return _0x3635ff;};'use strict';var _=require(_0xe047('0x0'));var util=require('util');var moment=require(_0xe047('0x1'));var BPromise=require(_0xe047('0x2'));var rs=require(_0xe047('0x3'));var fs=require('fs');var Redis=require(_0xe047('0x4'));var db=require(_0xe047('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe047('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe047('0x7')][_0xe047('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e18,_0x402fa8,_0x16e2e1){return new BPromise(function(_0x243e93,_0x182c95){return client[_0xe047('0x9')](_0x4a0e18,_0x16e2e1)[_0xe047('0xa')](function(_0x99e42a){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x402fa8,'request\x20sent');logger[_0xe047('0xb')](_0xe047('0xc'),_0x402fa8,_0xe047('0xd'),JSON[_0xe047('0xe')](_0x99e42a));if(_0x99e42a[_0xe047('0xf')]){if(_0x99e42a['error'][_0xe047('0x10')]===0x1f4){logger[_0xe047('0xf')](_0xe047('0x11'),_0x402fa8,_0x99e42a[_0xe047('0xf')]['message']);return _0x182c95(_0x99e42a[_0xe047('0xf')]['message']);}logger[_0xe047('0xf')](_0xe047('0x11'),_0x402fa8,_0x99e42a[_0xe047('0xf')][_0xe047('0x12')]);return _0x243e93(_0x99e42a['error'][_0xe047('0x12')]);}else{logger[_0xe047('0x13')](_0xe047('0x11'),_0x402fa8,_0xe047('0xd'));_0x243e93(_0x99e42a['result'][_0xe047('0x12')]);}})[_0xe047('0x14')](function(_0x310440){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x402fa8,_0x310440);_0x182c95(_0x310440);});});}