Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / api / userMailQueue / userMailQueue.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 _0x6f7f=['../../config/logger','../../config/environment','jayson/promise','client','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x6f7f,0x177));var _0xf6f7=function(_0x5e5d15,_0x2512bb){_0x5e5d15=_0x5e5d15-0x0;var _0x1621ff=_0x6f7f[_0x5e5d15];return _0x1621ff;};'use strict';var _=require('lodash');var util=require(_0xf6f7('0x0'));var moment=require(_0xf6f7('0x1'));var BPromise=require(_0xf6f7('0x2'));var rs=require(_0xf6f7('0x3'));var fs=require('fs');var db=require(_0xf6f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6f7('0x5'))('rpc');var config=require(_0xf6f7('0x6'));var jayson=require(_0xf6f7('0x7'));var client=jayson[_0xf6f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6df9,_0x543eb3,_0x33a2b2){return new BPromise(function(_0x3c641f,_0xe86f3a){return client[_0xf6f7('0x9')](_0x2f6df9,_0x33a2b2)[_0xf6f7('0xa')](function(_0x1cfa51){logger['info'](_0xf6f7('0xb'),_0x543eb3,'request\x20sent');logger['debug']('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x543eb3,_0xf6f7('0xc'),JSON[_0xf6f7('0xd')](_0x1cfa51));if(_0x1cfa51[_0xf6f7('0xe')]){if(_0x1cfa51[_0xf6f7('0xe')][_0xf6f7('0xf')]===0x1f4){logger[_0xf6f7('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x543eb3,_0x1cfa51['error'][_0xf6f7('0x10')]);return _0xe86f3a(_0x1cfa51[_0xf6f7('0xe')][_0xf6f7('0x10')]);}logger[_0xf6f7('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x543eb3,_0x1cfa51['error'][_0xf6f7('0x10')]);return _0x3c641f(_0x1cfa51['error'][_0xf6f7('0x10')]);}else{logger['info'](_0xf6f7('0xb'),_0x543eb3,_0xf6f7('0xc'));_0x3c641f(_0x1cfa51[_0xf6f7('0x11')][_0xf6f7('0x10')]);}})[_0xf6f7('0x12')](function(_0x4b8eb2){logger[_0xf6f7('0xe')](_0xf6f7('0xb'),_0x543eb3,_0x4b8eb2);_0xe86f3a(_0x4b8eb2);});});}