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 _0x1ccf=['./team.socket','register','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x53f28e,_0x4d290f){var _0x26d65a=function(_0x57de83){while(--_0x57de83){_0x53f28e['push'](_0x53f28e['shift']());}};_0x26d65a(++_0x4d290f);}(_0x1ccf,0x187));var _0xf1cc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1ccf[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf1cc('0x0'));var moment=require(_0xf1cc('0x1'));var BPromise=require(_0xf1cc('0x2'));var rs=require(_0xf1cc('0x3'));var fs=require('fs');var Redis=require(_0xf1cc('0x4'));var db=require(_0xf1cc('0x5'))['db'];var utils=require(_0xf1cc('0x6'));var logger=require(_0xf1cc('0x7'))('rpc');var config=require(_0xf1cc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf1cc('0x9')][_0xf1cc('0xa')]({'port':0x232a});config[_0xf1cc('0xb')]=_[_0xf1cc('0xc')](config['redis'],{'host':_0xf1cc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf1cc('0xe'))[_0xf1cc('0xf')](socket);function respondWithRpcPromise(_0x2a1f72,_0x3b28b7,_0x4eee50){return new BPromise(function(_0x1baae5,_0x376d05){return client['request'](_0x2a1f72,_0x4eee50)[_0xf1cc('0x10')](function(_0x1f7925){logger['info'](_0xf1cc('0x11'),_0x3b28b7,_0xf1cc('0x12'));logger['debug'](_0xf1cc('0x13'),_0x3b28b7,_0xf1cc('0x12'),JSON[_0xf1cc('0x14')](_0x1f7925));if(_0x1f7925['error']){if(_0x1f7925['error'][_0xf1cc('0x15')]===0x1f4){logger['error'](_0xf1cc('0x11'),_0x3b28b7,_0x1f7925['error'][_0xf1cc('0x16')]);return _0x376d05(_0x1f7925[_0xf1cc('0x17')]['message']);}logger[_0xf1cc('0x17')](_0xf1cc('0x11'),_0x3b28b7,_0x1f7925['error'][_0xf1cc('0x16')]);return _0x1baae5(_0x1f7925[_0xf1cc('0x17')][_0xf1cc('0x16')]);}else{logger[_0xf1cc('0x18')](_0xf1cc('0x11'),_0x3b28b7,_0xf1cc('0x12'));_0x1baae5(_0x1f7925[_0xf1cc('0x19')][_0xf1cc('0x16')]);}})[_0xf1cc('0x1a')](function(_0xcde376){logger[_0xf1cc('0x17')](_0xf1cc('0x11'),_0x3b28b7,_0xcde376);_0x376d05(_0xcde376);});});}