Built motion from commit 9d0783e6.|2.6.13
[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 _0x62e3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','util','moment'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0x62e3,0x174));var _0x362e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x362e('0x0'));var moment=require(_0x362e('0x1'));var BPromise=require(_0x362e('0x2'));var rs=require(_0x362e('0x3'));var fs=require('fs');var Redis=require(_0x362e('0x4'));var db=require(_0x362e('0x5'))['db'];var utils=require(_0x362e('0x6'));var logger=require('../../config/logger')(_0x362e('0x7'));var config=require(_0x362e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x362e('0x9')][_0x362e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c984,_0x28d705,_0x3e5843){return new BPromise(function(_0x47745f,_0x3be5e0){return client['request'](_0x16c984,_0x3e5843)[_0x362e('0xb')](function(_0x3b5485){logger['info'](_0x362e('0xc'),_0x28d705,_0x362e('0xd'));logger[_0x362e('0xe')](_0x362e('0xf'),_0x28d705,_0x362e('0xd'),JSON[_0x362e('0x10')](_0x3b5485));if(_0x3b5485['error']){if(_0x3b5485['error'][_0x362e('0x11')]===0x1f4){logger[_0x362e('0x12')](_0x362e('0xc'),_0x28d705,_0x3b5485[_0x362e('0x12')]['message']);return _0x3be5e0(_0x3b5485[_0x362e('0x12')]['message']);}logger[_0x362e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x28d705,_0x3b5485[_0x362e('0x12')][_0x362e('0x13')]);return _0x47745f(_0x3b5485[_0x362e('0x12')][_0x362e('0x13')]);}else{logger[_0x362e('0x14')](_0x362e('0xc'),_0x28d705,_0x362e('0xd'));_0x47745f(_0x3b5485['result'][_0x362e('0x13')]);}})[_0x362e('0x15')](function(_0x47a7f8){logger[_0x362e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x28d705,_0x47a7f8);_0x3be5e0(_0x47a7f8);});});}