Built motion from commit (unavailable).|2.5.0
[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 _0x31ed=['bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x31ed,0x1c5));var _0xd31e=function(_0x10ac8c,_0x21fa56){_0x10ac8c=_0x10ac8c-0x0;var _0x3208d4=_0x31ed[_0x10ac8c];return _0x3208d4;};'use strict';var _=require(_0xd31e('0x0'));var util=require(_0xd31e('0x1'));var moment=require(_0xd31e('0x2'));var BPromise=require(_0xd31e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd31e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd31e('0x5'));var logger=require('../../config/logger')(_0xd31e('0x6'));var config=require('../../config/environment');var jayson=require(_0xd31e('0x7'));var client=jayson['client'][_0xd31e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24fc0e,_0x1fd846,_0x1fe9f9){return new BPromise(function(_0x437bb2,_0x6998c4){return client['request'](_0x24fc0e,_0x1fe9f9)['then'](function(_0x413d72){logger[_0xd31e('0x9')](_0xd31e('0xa'),_0x1fd846,_0xd31e('0xb'));logger[_0xd31e('0xc')](_0xd31e('0xd'),_0x1fd846,_0xd31e('0xb'),JSON[_0xd31e('0xe')](_0x413d72));if(_0x413d72[_0xd31e('0xf')]){if(_0x413d72['error'][_0xd31e('0x10')]===0x1f4){logger[_0xd31e('0xf')](_0xd31e('0xa'),_0x1fd846,_0x413d72[_0xd31e('0xf')][_0xd31e('0x11')]);return _0x6998c4(_0x413d72[_0xd31e('0xf')][_0xd31e('0x11')]);}logger[_0xd31e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x1fd846,_0x413d72['error'][_0xd31e('0x11')]);return _0x437bb2(_0x413d72[_0xd31e('0xf')][_0xd31e('0x11')]);}else{logger[_0xd31e('0x9')](_0xd31e('0xa'),_0x1fd846,_0xd31e('0xb'));_0x437bb2(_0x413d72['result'][_0xd31e('0x11')]);}})[_0xd31e('0x12')](function(_0x1b68c4){logger['error'](_0xd31e('0xa'),_0x1fd846,_0x1b68c4);_0x6998c4(_0x1b68c4);});});}