Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / team / team.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 _0x52c5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x52c5,0x72));var _0x552c=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x52c5[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0x552c('0x0'));var util=require(_0x552c('0x1'));var moment=require('moment');var BPromise=require(_0x552c('0x2'));var rs=require(_0x552c('0x3'));var fs=require('fs');var Redis=require(_0x552c('0x4'));var db=require(_0x552c('0x5'))['db'];var utils=require(_0x552c('0x6'));var logger=require(_0x552c('0x7'))(_0x552c('0x8'));var config=require(_0x552c('0x9'));var jayson=require(_0x552c('0xa'));var client=jayson[_0x552c('0xb')][_0x552c('0xc')]({'port':0x232a});config[_0x552c('0xd')]=_[_0x552c('0xe')](config['redis'],{'host':_0x552c('0xf'),'port':0x18eb});var socket=require(_0x552c('0x10'))(new Redis(config['redis']));require(_0x552c('0x11'))[_0x552c('0x12')](socket);function respondWithRpcPromise(_0x5a70b1,_0x8d6ea4,_0x5671bb){return new BPromise(function(_0x55b31d,_0x275cba){return client['request'](_0x5a70b1,_0x5671bb)[_0x552c('0x13')](function(_0x6dbbe3){logger[_0x552c('0x14')](_0x552c('0x15'),_0x8d6ea4,'request\x20sent');logger[_0x552c('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x8d6ea4,'request\x20sent',JSON[_0x552c('0x17')](_0x6dbbe3));if(_0x6dbbe3[_0x552c('0x18')]){if(_0x6dbbe3['error'][_0x552c('0x19')]===0x1f4){logger[_0x552c('0x18')]('Team,\x20%s,\x20%s',_0x8d6ea4,_0x6dbbe3[_0x552c('0x18')][_0x552c('0x1a')]);return _0x275cba(_0x6dbbe3['error'][_0x552c('0x1a')]);}logger[_0x552c('0x18')](_0x552c('0x15'),_0x8d6ea4,_0x6dbbe3['error']['message']);return _0x55b31d(_0x6dbbe3[_0x552c('0x18')]['message']);}else{logger['info'](_0x552c('0x15'),_0x8d6ea4,_0x552c('0x1b'));_0x55b31d(_0x6dbbe3['result'][_0x552c('0x1a')]);}})[_0x552c('0x1c')](function(_0x40e1d8){logger[_0x552c('0x18')](_0x552c('0x15'),_0x8d6ea4,_0x40e1d8);_0x275cba(_0x40e1d8);});});}