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 _0x5e7f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x62b58e,_0x46fe1e){var _0x37fe84=function(_0x12a2ca){while(--_0x12a2ca){_0x62b58e['push'](_0x62b58e['shift']());}};_0x37fe84(++_0x46fe1e);}(_0x5e7f,0xb3));var _0xf5e7=function(_0x46387d,_0x492ba4){_0x46387d=_0x46387d-0x0;var _0x5c6f88=_0x5e7f[_0x46387d];return _0x5c6f88;};'use strict';var _=require(_0xf5e7('0x0'));var util=require(_0xf5e7('0x1'));var moment=require(_0xf5e7('0x2'));var BPromise=require(_0xf5e7('0x3'));var rs=require(_0xf5e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5e7('0x5'))['db'];var utils=require(_0xf5e7('0x6'));var logger=require(_0xf5e7('0x7'))(_0xf5e7('0x8'));var config=require(_0xf5e7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf5e7('0xa')][_0xf5e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6dd9,_0x2f2536,_0x96e6e3){return new BPromise(function(_0x324802,_0x4a4abf){return client['request'](_0x4c6dd9,_0x96e6e3)[_0xf5e7('0xc')](function(_0x456514){logger['info'](_0xf5e7('0xd'),_0x2f2536,'request\x20sent');logger[_0xf5e7('0xe')](_0xf5e7('0xf'),_0x2f2536,_0xf5e7('0x10'),JSON[_0xf5e7('0x11')](_0x456514));if(_0x456514[_0xf5e7('0x12')]){if(_0x456514[_0xf5e7('0x12')][_0xf5e7('0x13')]===0x1f4){logger[_0xf5e7('0x12')](_0xf5e7('0xd'),_0x2f2536,_0x456514[_0xf5e7('0x12')][_0xf5e7('0x14')]);return _0x4a4abf(_0x456514['error'][_0xf5e7('0x14')]);}logger[_0xf5e7('0x12')](_0xf5e7('0xd'),_0x2f2536,_0x456514[_0xf5e7('0x12')][_0xf5e7('0x14')]);return _0x324802(_0x456514['error'][_0xf5e7('0x14')]);}else{logger[_0xf5e7('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x2f2536,_0xf5e7('0x10'));_0x324802(_0x456514[_0xf5e7('0x16')][_0xf5e7('0x14')]);}})['catch'](function(_0xc327c8){logger['error'](_0xf5e7('0xd'),_0x2f2536,_0xc327c8);_0x4a4abf(_0xc327c8);});});}