Built motion from commit (unavailable).|2.5.29
[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 _0x4c9c=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c9c,0x1ac));var _0xc4c9=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x4c9c[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0xc4c9('0x0'));var util=require(_0xc4c9('0x1'));var moment=require('moment');var BPromise=require(_0xc4c9('0x2'));var rs=require(_0xc4c9('0x3'));var fs=require('fs');var Redis=require(_0xc4c9('0x4'));var db=require(_0xc4c9('0x5'))['db'];var utils=require(_0xc4c9('0x6'));var logger=require(_0xc4c9('0x7'))(_0xc4c9('0x8'));var config=require(_0xc4c9('0x9'));var jayson=require(_0xc4c9('0xa'));var client=jayson[_0xc4c9('0xb')][_0xc4c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x310a87,_0x230520,_0x255b5d){return new BPromise(function(_0x2e4047,_0xd72253){return client[_0xc4c9('0xd')](_0x310a87,_0x255b5d)[_0xc4c9('0xe')](function(_0x2ba796){logger['info'](_0xc4c9('0xf'),_0x230520,_0xc4c9('0x10'));logger['debug'](_0xc4c9('0x11'),_0x230520,'request\x20sent',JSON[_0xc4c9('0x12')](_0x2ba796));if(_0x2ba796[_0xc4c9('0x13')]){if(_0x2ba796[_0xc4c9('0x13')][_0xc4c9('0x14')]===0x1f4){logger[_0xc4c9('0x13')](_0xc4c9('0xf'),_0x230520,_0x2ba796[_0xc4c9('0x13')]['message']);return _0xd72253(_0x2ba796['error'][_0xc4c9('0x15')]);}logger[_0xc4c9('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x230520,_0x2ba796['error']['message']);return _0x2e4047(_0x2ba796[_0xc4c9('0x13')][_0xc4c9('0x15')]);}else{logger[_0xc4c9('0x16')](_0xc4c9('0xf'),_0x230520,_0xc4c9('0x10'));_0x2e4047(_0x2ba796[_0xc4c9('0x17')][_0xc4c9('0x15')]);}})[_0xc4c9('0x18')](function(_0x1203ff){logger[_0xc4c9('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x230520,_0x1203ff);_0xd72253(_0x1203ff);});});}