bb0e4fb8062779b911398b3eb24b2b628909daf3
[motion2.git] / server / api / chatProactiveAction / chatProactiveAction.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 _0x1b51=['info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1b51,0xef));var _0x11b5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b51[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x11b5('0x0'));var util=require(_0x11b5('0x1'));var moment=require(_0x11b5('0x2'));var BPromise=require(_0x11b5('0x3'));var rs=require(_0x11b5('0x4'));var fs=require('fs');var Redis=require(_0x11b5('0x5'));var db=require(_0x11b5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x11b5('0x7'))(_0x11b5('0x8'));var config=require(_0x11b5('0x9'));var jayson=require(_0x11b5('0xa'));var client=jayson[_0x11b5('0xb')][_0x11b5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x133fba,_0x264b23,_0x337f1b){return new BPromise(function(_0x62852e,_0x2cf38d){return client[_0x11b5('0xd')](_0x133fba,_0x337f1b)['then'](function(_0xee04c4){logger[_0x11b5('0xe')](_0x11b5('0xf'),_0x264b23,'request\x20sent');logger['debug'](_0x11b5('0x10'),_0x264b23,_0x11b5('0x11'),JSON['stringify'](_0xee04c4));if(_0xee04c4[_0x11b5('0x12')]){if(_0xee04c4[_0x11b5('0x12')][_0x11b5('0x13')]===0x1f4){logger[_0x11b5('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x264b23,_0xee04c4[_0x11b5('0x12')][_0x11b5('0x14')]);return _0x2cf38d(_0xee04c4[_0x11b5('0x12')][_0x11b5('0x14')]);}logger[_0x11b5('0x12')](_0x11b5('0xf'),_0x264b23,_0xee04c4[_0x11b5('0x12')][_0x11b5('0x14')]);return _0x62852e(_0xee04c4[_0x11b5('0x12')][_0x11b5('0x14')]);}else{logger[_0x11b5('0xe')](_0x11b5('0xf'),_0x264b23,_0x11b5('0x11'));_0x62852e(_0xee04c4[_0x11b5('0x15')][_0x11b5('0x14')]);}})[_0x11b5('0x16')](function(_0x5070b8){logger['error'](_0x11b5('0xf'),_0x264b23,_0x5070b8);_0x2cf38d(_0x5070b8);});});}