Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / UserChatInteraction / UserChatInteraction.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 _0xa7ca=['UserChatInteraction,\x20%s,\x20%s,\x20%s','error','code','UserChatInteraction,\x20%s,\x20%s','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xa7ca,0xfe));var _0xaa7c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa7ca[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa7c('0x0'));var BPromise=require('bluebird');var rs=require(_0xaa7c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa7c('0x2'))['db'];var utils=require(_0xaa7c('0x3'));var logger=require(_0xaa7c('0x4'))(_0xaa7c('0x5'));var config=require(_0xaa7c('0x6'));var jayson=require(_0xaa7c('0x7'));var client=jayson['client'][_0xaa7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eafa6,_0x1e6407,_0x3d9c42){return new BPromise(function(_0x454eba,_0x34b2e3){return client[_0xaa7c('0x9')](_0x1eafa6,_0x3d9c42)['then'](function(_0x1b49ac){logger[_0xaa7c('0xa')]('UserChatInteraction,\x20%s,\x20%s',_0x1e6407,'request\x20sent');logger[_0xaa7c('0xb')](_0xaa7c('0xc'),_0x1e6407,'request\x20sent',JSON['stringify'](_0x1b49ac));if(_0x1b49ac[_0xaa7c('0xd')]){if(_0x1b49ac['error'][_0xaa7c('0xe')]===0x1f4){logger['error'](_0xaa7c('0xf'),_0x1e6407,_0x1b49ac[_0xaa7c('0xd')]['message']);return _0x34b2e3(_0x1b49ac[_0xaa7c('0xd')][_0xaa7c('0x10')]);}logger[_0xaa7c('0xd')](_0xaa7c('0xf'),_0x1e6407,_0x1b49ac[_0xaa7c('0xd')][_0xaa7c('0x10')]);return _0x454eba(_0x1b49ac[_0xaa7c('0xd')]['message']);}else{logger[_0xaa7c('0xa')](_0xaa7c('0xf'),_0x1e6407,'request\x20sent');_0x454eba(_0x1b49ac[_0xaa7c('0x11')][_0xaa7c('0x10')]);}})[_0xaa7c('0x12')](function(_0xc6827c){logger[_0xaa7c('0xd')](_0xaa7c('0xf'),_0x1e6407,_0xc6827c);_0x34b2e3(_0xc6827c);});});}