Built motion from commit 3c2ce842.|2.6.31
[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 _0x828f=['message','request\x20sent','result','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x828f,0xc1));var _0xf828=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x828f[_0x5eb22e];return _0x27fed5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf828('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf828('0x1'));var db=require(_0xf828('0x2'))['db'];var utils=require(_0xf828('0x3'));var logger=require(_0xf828('0x4'))(_0xf828('0x5'));var config=require(_0xf828('0x6'));var jayson=require(_0xf828('0x7'));var client=jayson[_0xf828('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfeb32a,_0x1a393c,_0x43a369){return new BPromise(function(_0x353b54,_0x5d937e){return client['request'](_0xfeb32a,_0x43a369)[_0xf828('0x9')](function(_0x29120d){logger[_0xf828('0xa')](_0xf828('0xb'),_0x1a393c,'request\x20sent');logger[_0xf828('0xc')](_0xf828('0xd'),_0x1a393c,'request\x20sent',JSON['stringify'](_0x29120d));if(_0x29120d[_0xf828('0xe')]){if(_0x29120d[_0xf828('0xe')][_0xf828('0xf')]===0x1f4){logger[_0xf828('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x1a393c,_0x29120d[_0xf828('0xe')]['message']);return _0x5d937e(_0x29120d[_0xf828('0xe')]['message']);}logger[_0xf828('0xe')](_0xf828('0xb'),_0x1a393c,_0x29120d[_0xf828('0xe')][_0xf828('0x10')]);return _0x353b54(_0x29120d[_0xf828('0xe')][_0xf828('0x10')]);}else{logger[_0xf828('0xa')](_0xf828('0xb'),_0x1a393c,_0xf828('0x11'));_0x353b54(_0x29120d[_0xf828('0x12')][_0xf828('0x10')]);}})['catch'](function(_0xf4b944){logger[_0xf828('0xe')](_0xf828('0xb'),_0x1a393c,_0xf4b944);_0x5d937e(_0xf4b944);});});}