Built motion from commit d1eab355.|2.6.28
[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 _0x6b50=['../../config/logger','rpc','jayson/promise','client','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2bdecb,_0x50a3ec){var _0xa4bf5f=function(_0x5473d5){while(--_0x5473d5){_0x2bdecb['push'](_0x2bdecb['shift']());}};_0xa4bf5f(++_0x50a3ec);}(_0x6b50,0x6d));var _0x06b5=function(_0xd49203,_0x3e9107){_0xd49203=_0xd49203-0x0;var _0x5e2db6=_0x6b50[_0xd49203];return _0x5e2db6;};'use strict';var _=require('lodash');var util=require(_0x06b5('0x0'));var moment=require('moment');var BPromise=require(_0x06b5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b5('0x2'));var db=require(_0x06b5('0x3'))['db'];var utils=require(_0x06b5('0x4'));var logger=require(_0x06b5('0x5'))(_0x06b5('0x6'));var config=require('../../config/environment');var jayson=require(_0x06b5('0x7'));var client=jayson[_0x06b5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15ae45,_0x285b12,_0x240f66){return new BPromise(function(_0x2e77dc,_0x42fb9f){return client['request'](_0x15ae45,_0x240f66)['then'](function(_0x581670){logger['info'](_0x06b5('0x9'),_0x285b12,_0x06b5('0xa'));logger[_0x06b5('0xb')](_0x06b5('0xc'),_0x285b12,_0x06b5('0xa'),JSON['stringify'](_0x581670));if(_0x581670[_0x06b5('0xd')]){if(_0x581670[_0x06b5('0xd')][_0x06b5('0xe')]===0x1f4){logger[_0x06b5('0xd')](_0x06b5('0x9'),_0x285b12,_0x581670[_0x06b5('0xd')][_0x06b5('0xf')]);return _0x42fb9f(_0x581670['error'][_0x06b5('0xf')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x285b12,_0x581670[_0x06b5('0xd')][_0x06b5('0xf')]);return _0x2e77dc(_0x581670[_0x06b5('0xd')]['message']);}else{logger[_0x06b5('0x10')](_0x06b5('0x9'),_0x285b12,_0x06b5('0xa'));_0x2e77dc(_0x581670[_0x06b5('0x11')][_0x06b5('0xf')]);}})[_0x06b5('0x12')](function(_0x8fa3db){logger[_0x06b5('0xd')](_0x06b5('0x9'),_0x285b12,_0x8fa3db);_0x42fb9f(_0x8fa3db);});});}