Built motion from commit (unavailable).|2.5.2
[motion2.git] / server / api / mailServerOut / mailServerOut.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 _0x79c0=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x484fb6,_0x25860c){var _0x2033be=function(_0x2aa2fb){while(--_0x2aa2fb){_0x484fb6['push'](_0x484fb6['shift']());}};_0x2033be(++_0x25860c);}(_0x79c0,0x123));var _0x079c=function(_0x175eed,_0x21a65b){_0x175eed=_0x175eed-0x0;var _0x100892=_0x79c0[_0x175eed];return _0x100892;};'use strict';var _=require(_0x079c('0x0'));var util=require('util');var moment=require(_0x079c('0x1'));var BPromise=require('bluebird');var rs=require(_0x079c('0x2'));var fs=require('fs');var Redis=require(_0x079c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x079c('0x4'));var logger=require(_0x079c('0x5'))(_0x079c('0x6'));var config=require(_0x079c('0x7'));var jayson=require(_0x079c('0x8'));var client=jayson[_0x079c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4bbc,_0x242a15,_0x1c910d){return new BPromise(function(_0x2f11fa,_0x2b4deb){return client[_0x079c('0xa')](_0x5d4bbc,_0x1c910d)['then'](function(_0x5d04c4){logger[_0x079c('0xb')](_0x079c('0xc'),_0x242a15,_0x079c('0xd'));logger[_0x079c('0xe')](_0x079c('0xf'),_0x242a15,'request\x20sent',JSON['stringify'](_0x5d04c4));if(_0x5d04c4[_0x079c('0x10')]){if(_0x5d04c4[_0x079c('0x10')][_0x079c('0x11')]===0x1f4){logger[_0x079c('0x10')](_0x079c('0xc'),_0x242a15,_0x5d04c4[_0x079c('0x10')][_0x079c('0x12')]);return _0x2b4deb(_0x5d04c4[_0x079c('0x10')]['message']);}logger[_0x079c('0x10')](_0x079c('0xc'),_0x242a15,_0x5d04c4[_0x079c('0x10')]['message']);return _0x2f11fa(_0x5d04c4['error'][_0x079c('0x12')]);}else{logger[_0x079c('0xb')](_0x079c('0xc'),_0x242a15,'request\x20sent');_0x2f11fa(_0x5d04c4[_0x079c('0x13')][_0x079c('0x12')]);}})[_0x079c('0x14')](function(_0x223b83){logger[_0x079c('0x10')]('MailServerOut,\x20%s,\x20%s',_0x242a15,_0x223b83);_0x2b4deb(_0x223b83);});});}