ed7c763180598337f7558cfb6059dd353f5dd768
[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 _0xf14f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xf14f,0x8a));var _0xff14=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xf14f[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xff14('0x0'));var util=require(_0xff14('0x1'));var moment=require(_0xff14('0x2'));var BPromise=require(_0xff14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff14('0x4'));var db=require(_0xff14('0x5'))['db'];var utils=require(_0xff14('0x6'));var logger=require(_0xff14('0x7'))(_0xff14('0x8'));var config=require(_0xff14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff14('0xa')][_0xff14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b228d,_0x3d9047,_0x18e19a){return new BPromise(function(_0x323ee5,_0xa7090e){return client[_0xff14('0xc')](_0x5b228d,_0x18e19a)[_0xff14('0xd')](function(_0x1115e3){logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,_0xff14('0x10'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3d9047,_0xff14('0x10'),JSON[_0xff14('0x11')](_0x1115e3));if(_0x1115e3[_0xff14('0x12')]){if(_0x1115e3[_0xff14('0x12')][_0xff14('0x13')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0xa7090e(_0x1115e3['error'][_0xff14('0x14')]);}logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0x323ee5(_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);}else{logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,'request\x20sent');_0x323ee5(_0x1115e3[_0xff14('0x15')]['message']);}})[_0xff14('0x16')](function(_0x5a5845){logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x5a5845);_0xa7090e(_0x5a5845);});});}