Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / chatGroup / chatGroup.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 _0x7f15=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3bc578,_0x55e52b){var _0x2fec3e=function(_0x309d4f){while(--_0x309d4f){_0x3bc578['push'](_0x3bc578['shift']());}};_0x2fec3e(++_0x55e52b);}(_0x7f15,0x1f3));var _0x57f1=function(_0x40297a,_0x48ae5b){_0x40297a=_0x40297a-0x0;var _0x110c20=_0x7f15[_0x40297a];return _0x110c20;};'use strict';var _=require(_0x57f1('0x0'));var util=require('util');var moment=require(_0x57f1('0x1'));var BPromise=require(_0x57f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57f1('0x3'));var db=require(_0x57f1('0x4'))['db'];var utils=require(_0x57f1('0x5'));var logger=require(_0x57f1('0x6'))(_0x57f1('0x7'));var config=require('../../config/environment');var jayson=require(_0x57f1('0x8'));var client=jayson[_0x57f1('0x9')][_0x57f1('0xa')]({'port':0x232a});config[_0x57f1('0xb')]=_[_0x57f1('0xc')](config[_0x57f1('0xb')],{'host':_0x57f1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57f1('0xb')]));require(_0x57f1('0xe'))[_0x57f1('0xf')](socket);function respondWithRpcPromise(_0x1a53ec,_0x3cf9c2,_0x334140){return new BPromise(function(_0x4f4ca7,_0x432187){return client['request'](_0x1a53ec,_0x334140)[_0x57f1('0x10')](function(_0x5c87b2){logger[_0x57f1('0x11')](_0x57f1('0x12'),_0x3cf9c2,_0x57f1('0x13'));logger[_0x57f1('0x14')](_0x57f1('0x15'),_0x3cf9c2,_0x57f1('0x13'),JSON[_0x57f1('0x16')](_0x5c87b2));if(_0x5c87b2['error']){if(_0x5c87b2[_0x57f1('0x17')][_0x57f1('0x18')]===0x1f4){logger[_0x57f1('0x17')](_0x57f1('0x12'),_0x3cf9c2,_0x5c87b2[_0x57f1('0x17')]['message']);return _0x432187(_0x5c87b2[_0x57f1('0x17')][_0x57f1('0x19')]);}logger[_0x57f1('0x17')](_0x57f1('0x12'),_0x3cf9c2,_0x5c87b2[_0x57f1('0x17')][_0x57f1('0x19')]);return _0x4f4ca7(_0x5c87b2[_0x57f1('0x17')][_0x57f1('0x19')]);}else{logger[_0x57f1('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3cf9c2,'request\x20sent');_0x4f4ca7(_0x5c87b2[_0x57f1('0x1a')][_0x57f1('0x19')]);}})[_0x57f1('0x1b')](function(_0x1fee3e){logger[_0x57f1('0x17')]('ChatGroup,\x20%s,\x20%s',_0x3cf9c2,_0x1fee3e);_0x432187(_0x1fee3e);});});}