Built motion from commit (unavailable).|2.4.4
[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 _0x319f=['../../config/logger','rpc','../../config/environment','client','request','then','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x163610,_0x41b984){var _0x10d8e0=function(_0x3d7f7e){while(--_0x3d7f7e){_0x163610['push'](_0x163610['shift']());}};_0x10d8e0(++_0x41b984);}(_0x319f,0x100));var _0xf319=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x319f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf319('0x0'));var util=require(_0xf319('0x1'));var moment=require(_0xf319('0x2'));var BPromise=require(_0xf319('0x3'));var rs=require(_0xf319('0x4'));var fs=require('fs');var Redis=require(_0xf319('0x5'));var db=require(_0xf319('0x6'))['db'];var utils=require(_0xf319('0x7'));var logger=require(_0xf319('0x8'))(_0xf319('0x9'));var config=require(_0xf319('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf319('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x444156,_0x5a45a3,_0x58ac57){return new BPromise(function(_0x20a2d9,_0x28898e){return client[_0xf319('0xc')](_0x444156,_0x58ac57)[_0xf319('0xd')](function(_0x3f2d45){logger['info'](_0xf319('0xe'),_0x5a45a3,'request\x20sent');logger[_0xf319('0xf')](_0xf319('0x10'),_0x5a45a3,_0xf319('0x11'),JSON[_0xf319('0x12')](_0x3f2d45));if(_0x3f2d45['error']){if(_0x3f2d45['error'][_0xf319('0x13')]===0x1f4){logger['error'](_0xf319('0xe'),_0x5a45a3,_0x3f2d45[_0xf319('0x14')][_0xf319('0x15')]);return _0x28898e(_0x3f2d45[_0xf319('0x14')]['message']);}logger[_0xf319('0x14')](_0xf319('0xe'),_0x5a45a3,_0x3f2d45['error'][_0xf319('0x15')]);return _0x20a2d9(_0x3f2d45[_0xf319('0x14')]['message']);}else{logger[_0xf319('0x16')](_0xf319('0xe'),_0x5a45a3,_0xf319('0x11'));_0x20a2d9(_0x3f2d45['result']['message']);}})[_0xf319('0x17')](function(_0x492f6f){logger[_0xf319('0x14')](_0xf319('0xe'),_0x5a45a3,_0x492f6f);_0x28898e(_0x492f6f);});});}