Built motion from commit e6806ed6.|2.6.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 _0x9f54=['code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23f597,_0x3f0541){var _0x419165=function(_0x5b7672){while(--_0x5b7672){_0x23f597['push'](_0x23f597['shift']());}};_0x419165(++_0x3f0541);}(_0x9f54,0x174));var _0x49f5=function(_0x43c17b,_0x3607af){_0x43c17b=_0x43c17b-0x0;var _0x47b720=_0x9f54[_0x43c17b];return _0x47b720;};'use strict';var _=require(_0x49f5('0x0'));var util=require(_0x49f5('0x1'));var moment=require('moment');var BPromise=require(_0x49f5('0x2'));var rs=require(_0x49f5('0x3'));var fs=require('fs');var Redis=require(_0x49f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x49f5('0x5'));var logger=require(_0x49f5('0x6'))(_0x49f5('0x7'));var config=require(_0x49f5('0x8'));var jayson=require(_0x49f5('0x9'));var client=jayson[_0x49f5('0xa')][_0x49f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb16897,_0x189a70,_0xf20cc2){return new BPromise(function(_0x4a1064,_0xab0caa){return client[_0x49f5('0xc')](_0xb16897,_0xf20cc2)[_0x49f5('0xd')](function(_0x3ca8d7){logger['info'](_0x49f5('0xe'),_0x189a70,_0x49f5('0xf'));logger['debug'](_0x49f5('0x10'),_0x189a70,'request\x20sent',JSON[_0x49f5('0x11')](_0x3ca8d7));if(_0x3ca8d7['error']){if(_0x3ca8d7[_0x49f5('0x12')][_0x49f5('0x13')]===0x1f4){logger['error'](_0x49f5('0xe'),_0x189a70,_0x3ca8d7['error'][_0x49f5('0x14')]);return _0xab0caa(_0x3ca8d7[_0x49f5('0x12')][_0x49f5('0x14')]);}logger[_0x49f5('0x12')](_0x49f5('0xe'),_0x189a70,_0x3ca8d7[_0x49f5('0x12')][_0x49f5('0x14')]);return _0x4a1064(_0x3ca8d7['error'][_0x49f5('0x14')]);}else{logger[_0x49f5('0x15')](_0x49f5('0xe'),_0x189a70,'request\x20sent');_0x4a1064(_0x3ca8d7[_0x49f5('0x16')][_0x49f5('0x14')]);}})['catch'](function(_0x5c8747){logger['error'](_0x49f5('0xe'),_0x189a70,_0x5c8747);_0xab0caa(_0x5c8747);});});}