Built motion from commit f25620e4.|2.6.30
[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 _0x9a5e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x9a5e,0x1e2));var _0xe9a5=function(_0x3cc7ba,_0x2fc1ae){_0x3cc7ba=_0x3cc7ba-0x0;var _0xb25b9b=_0x9a5e[_0x3cc7ba];return _0xb25b9b;};'use strict';var _=require(_0xe9a5('0x0'));var util=require(_0xe9a5('0x1'));var moment=require('moment');var BPromise=require(_0xe9a5('0x2'));var rs=require(_0xe9a5('0x3'));var fs=require('fs');var Redis=require(_0xe9a5('0x4'));var db=require(_0xe9a5('0x5'))['db'];var utils=require(_0xe9a5('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe9a5('0x7'));var client=jayson[_0xe9a5('0x8')][_0xe9a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b887d,_0x2d11ac,_0x469874){return new BPromise(function(_0x1bbf24,_0x1f37c7){return client['request'](_0x2b887d,_0x469874)[_0xe9a5('0xa')](function(_0x342af9){logger[_0xe9a5('0xb')](_0xe9a5('0xc'),_0x2d11ac,_0xe9a5('0xd'));logger['debug'](_0xe9a5('0xe'),_0x2d11ac,_0xe9a5('0xd'),JSON[_0xe9a5('0xf')](_0x342af9));if(_0x342af9[_0xe9a5('0x10')]){if(_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x11')]===0x1f4){logger[_0xe9a5('0x10')](_0xe9a5('0xc'),_0x2d11ac,_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x12')]);return _0x1f37c7(_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x12')]);}logger['error'](_0xe9a5('0xc'),_0x2d11ac,_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x12')]);return _0x1bbf24(_0x342af9[_0xe9a5('0x10')]['message']);}else{logger[_0xe9a5('0xb')](_0xe9a5('0xc'),_0x2d11ac,'request\x20sent');_0x1bbf24(_0x342af9[_0xe9a5('0x13')][_0xe9a5('0x12')]);}})[_0xe9a5('0x14')](function(_0x1b7c6e){logger[_0xe9a5('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x2d11ac,_0x1b7c6e);_0x1f37c7(_0x1b7c6e);});});}