Built motion from commit (unavailable).|2.5.4
[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 _0x6d4f=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x279a4d,_0x345707){var _0x1a0cc5=function(_0x1be731){while(--_0x1be731){_0x279a4d['push'](_0x279a4d['shift']());}};_0x1a0cc5(++_0x345707);}(_0x6d4f,0x121));var _0xf6d4=function(_0x66f455,_0x43978d){_0x66f455=_0x66f455-0x0;var _0x2f4d67=_0x6d4f[_0x66f455];return _0x2f4d67;};'use strict';var _=require(_0xf6d4('0x0'));var util=require(_0xf6d4('0x1'));var moment=require(_0xf6d4('0x2'));var BPromise=require(_0xf6d4('0x3'));var rs=require(_0xf6d4('0x4'));var fs=require('fs');var Redis=require(_0xf6d4('0x5'));var db=require(_0xf6d4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6d4('0x7'))(_0xf6d4('0x8'));var config=require(_0xf6d4('0x9'));var jayson=require(_0xf6d4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x79f756,_0x2c0a3b,_0x507bba){return new BPromise(function(_0xc170c2,_0x4c533a){return client['request'](_0x79f756,_0x507bba)[_0xf6d4('0xb')](function(_0x424121){logger[_0xf6d4('0xc')](_0xf6d4('0xd'),_0x2c0a3b,_0xf6d4('0xe'));logger['debug'](_0xf6d4('0xf'),_0x2c0a3b,'request\x20sent',JSON[_0xf6d4('0x10')](_0x424121));if(_0x424121[_0xf6d4('0x11')]){if(_0x424121['error'][_0xf6d4('0x12')]===0x1f4){logger[_0xf6d4('0x11')](_0xf6d4('0xd'),_0x2c0a3b,_0x424121[_0xf6d4('0x11')][_0xf6d4('0x13')]);return _0x4c533a(_0x424121[_0xf6d4('0x11')][_0xf6d4('0x13')]);}logger[_0xf6d4('0x11')](_0xf6d4('0xd'),_0x2c0a3b,_0x424121[_0xf6d4('0x11')][_0xf6d4('0x13')]);return _0xc170c2(_0x424121[_0xf6d4('0x11')][_0xf6d4('0x13')]);}else{logger[_0xf6d4('0xc')](_0xf6d4('0xd'),_0x2c0a3b,_0xf6d4('0xe'));_0xc170c2(_0x424121[_0xf6d4('0x14')][_0xf6d4('0x13')]);}})[_0xf6d4('0x15')](function(_0x20c93d){logger['error'](_0xf6d4('0xd'),_0x2c0a3b,_0x20c93d);_0x4c533a(_0x20c93d);});});}