Built motion from commit (unavailable).|2.5.9
[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 _0xe041=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xe041,0x18f));var _0x1e04=function(_0x5e2407,_0x375bc6){_0x5e2407=_0x5e2407-0x0;var _0x285838=_0xe041[_0x5e2407];return _0x285838;};'use strict';var _=require(_0x1e04('0x0'));var util=require(_0x1e04('0x1'));var moment=require(_0x1e04('0x2'));var BPromise=require(_0x1e04('0x3'));var rs=require(_0x1e04('0x4'));var fs=require('fs');var Redis=require(_0x1e04('0x5'));var db=require(_0x1e04('0x6'))['db'];var utils=require(_0x1e04('0x7'));var logger=require(_0x1e04('0x8'))(_0x1e04('0x9'));var config=require(_0x1e04('0xa'));var jayson=require(_0x1e04('0xb'));var client=jayson[_0x1e04('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20dcfc,_0x6f879,_0x12d770){return new BPromise(function(_0x3af5a4,_0x258b8a){return client['request'](_0x20dcfc,_0x12d770)['then'](function(_0x2f13c3){logger[_0x1e04('0xd')](_0x1e04('0xe'),_0x6f879,_0x1e04('0xf'));logger[_0x1e04('0x10')](_0x1e04('0x11'),_0x6f879,_0x1e04('0xf'),JSON['stringify'](_0x2f13c3));if(_0x2f13c3[_0x1e04('0x12')]){if(_0x2f13c3[_0x1e04('0x12')][_0x1e04('0x13')]===0x1f4){logger['error'](_0x1e04('0xe'),_0x6f879,_0x2f13c3[_0x1e04('0x12')][_0x1e04('0x14')]);return _0x258b8a(_0x2f13c3[_0x1e04('0x12')][_0x1e04('0x14')]);}logger[_0x1e04('0x12')](_0x1e04('0xe'),_0x6f879,_0x2f13c3[_0x1e04('0x12')][_0x1e04('0x14')]);return _0x3af5a4(_0x2f13c3[_0x1e04('0x12')]['message']);}else{logger['info'](_0x1e04('0xe'),_0x6f879,_0x1e04('0xf'));_0x3af5a4(_0x2f13c3['result'][_0x1e04('0x14')]);}})[_0x1e04('0x15')](function(_0x2d313b){logger[_0x1e04('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x6f879,_0x2d313b);_0x258b8a(_0x2d313b);});});}