Built motion from commit (unavailable).|2.6.0
[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 _0x89b5=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x89b5,0x1a6));var _0x589b=function(_0x441b9d,_0x408c6a){_0x441b9d=_0x441b9d-0x0;var _0x501f1f=_0x89b5[_0x441b9d];return _0x501f1f;};'use strict';var _=require(_0x589b('0x0'));var util=require(_0x589b('0x1'));var moment=require(_0x589b('0x2'));var BPromise=require(_0x589b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x589b('0x4'));var db=require(_0x589b('0x5'))['db'];var utils=require(_0x589b('0x6'));var logger=require(_0x589b('0x7'))('rpc');var config=require(_0x589b('0x8'));var jayson=require(_0x589b('0x9'));var client=jayson[_0x589b('0xa')]['http']({'port':0x232a});config[_0x589b('0xb')]=_['defaults'](config[_0x589b('0xb')],{'host':_0x589b('0xc'),'port':0x18eb});var socket=require(_0x589b('0xd'))(new Redis(config['redis']));require(_0x589b('0xe'))[_0x589b('0xf')](socket);function respondWithRpcPromise(_0x48d377,_0x483079,_0x49e8a2){return new BPromise(function(_0x776049,_0x379d0e){return client['request'](_0x48d377,_0x49e8a2)['then'](function(_0x15802e){logger[_0x589b('0x10')](_0x589b('0x11'),_0x483079,_0x589b('0x12'));logger['debug'](_0x589b('0x13'),_0x483079,_0x589b('0x12'),JSON[_0x589b('0x14')](_0x15802e));if(_0x15802e[_0x589b('0x15')]){if(_0x15802e[_0x589b('0x15')][_0x589b('0x16')]===0x1f4){logger[_0x589b('0x15')](_0x589b('0x11'),_0x483079,_0x15802e[_0x589b('0x15')][_0x589b('0x17')]);return _0x379d0e(_0x15802e['error'][_0x589b('0x17')]);}logger[_0x589b('0x15')](_0x589b('0x11'),_0x483079,_0x15802e[_0x589b('0x15')][_0x589b('0x17')]);return _0x776049(_0x15802e[_0x589b('0x15')][_0x589b('0x17')]);}else{logger[_0x589b('0x10')](_0x589b('0x11'),_0x483079,_0x589b('0x12'));_0x776049(_0x15802e[_0x589b('0x18')][_0x589b('0x17')]);}})[_0x589b('0x19')](function(_0x3bcee3){logger[_0x589b('0x15')]('Team,\x20%s,\x20%s',_0x483079,_0x3bcee3);_0x379d0e(_0x3bcee3);});});}