Built motion from commit ab870f9e.|2.5.44
[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 _0x22dc=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22dc,0xd8));var _0xc22d=function(_0x1cb42c,_0x422597){_0x1cb42c=_0x1cb42c-0x0;var _0x5148f7=_0x22dc[_0x1cb42c];return _0x5148f7;};'use strict';var _=require(_0xc22d('0x0'));var util=require('util');var moment=require(_0xc22d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc22d('0x2'));var fs=require('fs');var Redis=require(_0xc22d('0x3'));var db=require(_0xc22d('0x4'))['db'];var utils=require(_0xc22d('0x5'));var logger=require(_0xc22d('0x6'))(_0xc22d('0x7'));var config=require(_0xc22d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc22d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40c51e,_0x1622bc,_0x5a2b9e){return new BPromise(function(_0x5f2304,_0x409b66){return client[_0xc22d('0xa')](_0x40c51e,_0x5a2b9e)[_0xc22d('0xb')](function(_0x197597){logger[_0xc22d('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1622bc,_0xc22d('0xd'));logger[_0xc22d('0xe')](_0xc22d('0xf'),_0x1622bc,_0xc22d('0xd'),JSON['stringify'](_0x197597));if(_0x197597[_0xc22d('0x10')]){if(_0x197597[_0xc22d('0x10')][_0xc22d('0x11')]===0x1f4){logger[_0xc22d('0x10')](_0xc22d('0x12'),_0x1622bc,_0x197597[_0xc22d('0x10')]['message']);return _0x409b66(_0x197597[_0xc22d('0x10')][_0xc22d('0x13')]);}logger[_0xc22d('0x10')](_0xc22d('0x12'),_0x1622bc,_0x197597[_0xc22d('0x10')][_0xc22d('0x13')]);return _0x5f2304(_0x197597[_0xc22d('0x10')][_0xc22d('0x13')]);}else{logger[_0xc22d('0xc')](_0xc22d('0x12'),_0x1622bc,_0xc22d('0xd'));_0x5f2304(_0x197597[_0xc22d('0x14')][_0xc22d('0x13')]);}})['catch'](function(_0x1a351b){logger['error'](_0xc22d('0x12'),_0x1622bc,_0x1a351b);_0x409b66(_0x1a351b);});});}