Built motion from commit (unavailable).|2.2.0
[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 _0x402b=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x5ca8fc,_0x2e6658){var _0x7c947e=function(_0x38a66d){while(--_0x38a66d){_0x5ca8fc['push'](_0x5ca8fc['shift']());}};_0x7c947e(++_0x2e6658);}(_0x402b,0x177));var _0xb402=function(_0x241f64,_0x21a5b1){_0x241f64=_0x241f64-0x0;var _0x27dba0=_0x402b[_0x241f64];return _0x27dba0;};'use strict';var _=require(_0xb402('0x0'));var util=require('util');var moment=require(_0xb402('0x1'));var BPromise=require(_0xb402('0x2'));var rs=require(_0xb402('0x3'));var fs=require('fs');var Redis=require(_0xb402('0x4'));var db=require(_0xb402('0x5'))['db'];var utils=require(_0xb402('0x6'));var logger=require(_0xb402('0x7'))(_0xb402('0x8'));var config=require(_0xb402('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb402('0xa')][_0xb402('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a42e4,_0x2c202d,_0x3670f2){return new BPromise(function(_0x21adc4,_0x480d76){return client[_0xb402('0xc')](_0x4a42e4,_0x3670f2)[_0xb402('0xd')](function(_0x409cfb){logger[_0xb402('0xe')](_0xb402('0xf'),_0x2c202d,'request\x20sent');logger[_0xb402('0x10')](_0xb402('0x11'),_0x2c202d,_0xb402('0x12'),JSON['stringify'](_0x409cfb));if(_0x409cfb[_0xb402('0x13')]){if(_0x409cfb['error']['code']===0x1f4){logger[_0xb402('0x13')]('MailServerOut,\x20%s,\x20%s',_0x2c202d,_0x409cfb[_0xb402('0x13')]['message']);return _0x480d76(_0x409cfb[_0xb402('0x13')][_0xb402('0x14')]);}logger[_0xb402('0x13')]('MailServerOut,\x20%s,\x20%s',_0x2c202d,_0x409cfb['error'][_0xb402('0x14')]);return _0x21adc4(_0x409cfb['error'][_0xb402('0x14')]);}else{logger[_0xb402('0xe')](_0xb402('0xf'),_0x2c202d,_0xb402('0x12'));_0x21adc4(_0x409cfb['result']['message']);}})[_0xb402('0x15')](function(_0x549f5d){logger[_0xb402('0x13')](_0xb402('0xf'),_0x2c202d,_0x549f5d);_0x480d76(_0x549f5d);});});}