Built motion from commit 42801a18.|2.6.28
[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 _0xc8af=['../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc8af,0x149));var _0xfc8a=function(_0x2a6691,_0x4730aa){_0x2a6691=_0x2a6691-0x0;var _0x41e9ec=_0xc8af[_0x2a6691];return _0x41e9ec;};'use strict';var _=require(_0xfc8a('0x0'));var util=require(_0xfc8a('0x1'));var moment=require(_0xfc8a('0x2'));var BPromise=require(_0xfc8a('0x3'));var rs=require(_0xfc8a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc8a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc8a('0x6'));var config=require(_0xfc8a('0x7'));var jayson=require(_0xfc8a('0x8'));var client=jayson[_0xfc8a('0x9')][_0xfc8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ee83c,_0x3ae56f,_0x3ea13f){return new BPromise(function(_0x49daff,_0x328d3b){return client[_0xfc8a('0xb')](_0x3ee83c,_0x3ea13f)[_0xfc8a('0xc')](function(_0x11f201){logger['info'](_0xfc8a('0xd'),_0x3ae56f,_0xfc8a('0xe'));logger[_0xfc8a('0xf')](_0xfc8a('0x10'),_0x3ae56f,_0xfc8a('0xe'),JSON[_0xfc8a('0x11')](_0x11f201));if(_0x11f201[_0xfc8a('0x12')]){if(_0x11f201[_0xfc8a('0x12')][_0xfc8a('0x13')]===0x1f4){logger[_0xfc8a('0x12')](_0xfc8a('0xd'),_0x3ae56f,_0x11f201[_0xfc8a('0x12')][_0xfc8a('0x14')]);return _0x328d3b(_0x11f201[_0xfc8a('0x12')][_0xfc8a('0x14')]);}logger[_0xfc8a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x3ae56f,_0x11f201[_0xfc8a('0x12')][_0xfc8a('0x14')]);return _0x49daff(_0x11f201['error'][_0xfc8a('0x14')]);}else{logger[_0xfc8a('0x15')](_0xfc8a('0xd'),_0x3ae56f,_0xfc8a('0xe'));_0x49daff(_0x11f201[_0xfc8a('0x16')][_0xfc8a('0x14')]);}})[_0xfc8a('0x17')](function(_0x1bfcfc){logger[_0xfc8a('0x12')](_0xfc8a('0xd'),_0x3ae56f,_0x1bfcfc);_0x328d3b(_0x1bfcfc);});});}