Built motion from commit (unavailable).|2.5.15
[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 _0xaa65=['info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','then'];(function(_0x800ae1,_0x186d64){var _0xc6d9ce=function(_0x36ebc6){while(--_0x36ebc6){_0x800ae1['push'](_0x800ae1['shift']());}};_0xc6d9ce(++_0x186d64);}(_0xaa65,0x189));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5aa6('0x0'));var util=require('util');var moment=require(_0x5aa6('0x1'));var BPromise=require(_0x5aa6('0x2'));var rs=require(_0x5aa6('0x3'));var fs=require('fs');var Redis=require(_0x5aa6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5aa6('0x5'));var config=require(_0x5aa6('0x6'));var jayson=require(_0x5aa6('0x7'));var client=jayson[_0x5aa6('0x8')][_0x5aa6('0x9')]({'port':0x232a});config[_0x5aa6('0xa')]=_[_0x5aa6('0xb')](config[_0x5aa6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5aa6('0xc'))(new Redis(config['redis']));require(_0x5aa6('0xd'))['register'](socket);function respondWithRpcPromise(_0x49d160,_0x5e739c,_0x5a9e96){return new BPromise(function(_0xa3760a,_0x18b4c3){return client['request'](_0x49d160,_0x5a9e96)[_0x5aa6('0xe')](function(_0x16e179){logger[_0x5aa6('0xf')](_0x5aa6('0x10'),_0x5e739c,_0x5aa6('0x11'));logger[_0x5aa6('0x12')](_0x5aa6('0x13'),_0x5e739c,'request\x20sent',JSON['stringify'](_0x16e179));if(_0x16e179['error']){if(_0x16e179[_0x5aa6('0x14')]['code']===0x1f4){logger[_0x5aa6('0x14')](_0x5aa6('0x10'),_0x5e739c,_0x16e179['error']['message']);return _0x18b4c3(_0x16e179[_0x5aa6('0x14')][_0x5aa6('0x15')]);}logger[_0x5aa6('0x14')](_0x5aa6('0x10'),_0x5e739c,_0x16e179[_0x5aa6('0x14')][_0x5aa6('0x15')]);return _0xa3760a(_0x16e179[_0x5aa6('0x14')][_0x5aa6('0x15')]);}else{logger[_0x5aa6('0xf')](_0x5aa6('0x10'),_0x5e739c,_0x5aa6('0x11'));_0xa3760a(_0x16e179[_0x5aa6('0x16')][_0x5aa6('0x15')]);}})[_0x5aa6('0x17')](function(_0x16e630){logger[_0x5aa6('0x14')]('Team,\x20%s,\x20%s',_0x5e739c,_0x16e630);_0x18b4c3(_0x16e630);});});}