37358c84c9fbebfda270d0a80e471c30eb1e36de
[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 _0x7f39=['error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c32ae,_0x2321a0){var _0x233e0a=function(_0x72eb40){while(--_0x72eb40){_0x1c32ae['push'](_0x1c32ae['shift']());}};_0x233e0a(++_0x2321a0);}(_0x7f39,0x131));var _0x97f3=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x7f39[_0x44946b];return _0x249bc4;};'use strict';var _=require('lodash');var util=require(_0x97f3('0x0'));var moment=require(_0x97f3('0x1'));var BPromise=require(_0x97f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97f3('0x3'))['db'];var utils=require(_0x97f3('0x4'));var logger=require(_0x97f3('0x5'))(_0x97f3('0x6'));var config=require(_0x97f3('0x7'));var jayson=require(_0x97f3('0x8'));var client=jayson['client'][_0x97f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf85,_0x25a63b,_0x90366e){return new BPromise(function(_0x2a44f2,_0x31866f){return client[_0x97f3('0xa')](_0x1bf85,_0x90366e)['then'](function(_0x5c9711){logger[_0x97f3('0xb')](_0x97f3('0xc'),_0x25a63b,_0x97f3('0xd'));logger[_0x97f3('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x25a63b,'request\x20sent',JSON['stringify'](_0x5c9711));if(_0x5c9711[_0x97f3('0xf')]){if(_0x5c9711[_0x97f3('0xf')][_0x97f3('0x10')]===0x1f4){logger[_0x97f3('0xf')](_0x97f3('0xc'),_0x25a63b,_0x5c9711[_0x97f3('0xf')][_0x97f3('0x11')]);return _0x31866f(_0x5c9711['error'][_0x97f3('0x11')]);}logger[_0x97f3('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x25a63b,_0x5c9711[_0x97f3('0xf')][_0x97f3('0x11')]);return _0x2a44f2(_0x5c9711['error'][_0x97f3('0x11')]);}else{logger[_0x97f3('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x25a63b,_0x97f3('0xd'));_0x2a44f2(_0x5c9711[_0x97f3('0x12')][_0x97f3('0x11')]);}})[_0x97f3('0x13')](function(_0x509439){logger[_0x97f3('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x25a63b,_0x509439);_0x31866f(_0x509439);});});}