Built motion from commit (unavailable).|2.5.7
[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 _0x286e=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','then','info','request\x20sent','debug','stringify','error','Team,\x20%s,\x20%s','message','result'];(function(_0x5106c1,_0x13233a){var _0x5bcaac=function(_0x18c12e){while(--_0x18c12e){_0x5106c1['push'](_0x5106c1['shift']());}};_0x5bcaac(++_0x13233a);}(_0x286e,0x82));var _0xe286=function(_0x499e1a,_0x4f14a4){_0x499e1a=_0x499e1a-0x0;var _0x536343=_0x286e[_0x499e1a];return _0x536343;};'use strict';var _=require(_0xe286('0x0'));var util=require(_0xe286('0x1'));var moment=require(_0xe286('0x2'));var BPromise=require(_0xe286('0x3'));var rs=require(_0xe286('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe286('0x5'))['db'];var utils=require(_0xe286('0x6'));var logger=require('../../config/logger')(_0xe286('0x7'));var config=require(_0xe286('0x8'));var jayson=require(_0xe286('0x9'));var client=jayson[_0xe286('0xa')][_0xe286('0xb')]({'port':0x232a});config[_0xe286('0xc')]=_[_0xe286('0xd')](config[_0xe286('0xc')],{'host':_0xe286('0xe'),'port':0x18eb});var socket=require(_0xe286('0xf'))(new Redis(config[_0xe286('0xc')]));require(_0xe286('0x10'))['register'](socket);function respondWithRpcPromise(_0x12175d,_0x23e864,_0x449061){return new BPromise(function(_0x2715f7,_0x311487){return client['request'](_0x12175d,_0x449061)[_0xe286('0x11')](function(_0x39d29b){logger[_0xe286('0x12')]('Team,\x20%s,\x20%s',_0x23e864,_0xe286('0x13'));logger[_0xe286('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x23e864,_0xe286('0x13'),JSON[_0xe286('0x15')](_0x39d29b));if(_0x39d29b[_0xe286('0x16')]){if(_0x39d29b[_0xe286('0x16')]['code']===0x1f4){logger[_0xe286('0x16')](_0xe286('0x17'),_0x23e864,_0x39d29b[_0xe286('0x16')][_0xe286('0x18')]);return _0x311487(_0x39d29b[_0xe286('0x16')][_0xe286('0x18')]);}logger[_0xe286('0x16')]('Team,\x20%s,\x20%s',_0x23e864,_0x39d29b['error']['message']);return _0x2715f7(_0x39d29b[_0xe286('0x16')][_0xe286('0x18')]);}else{logger[_0xe286('0x12')](_0xe286('0x17'),_0x23e864,_0xe286('0x13'));_0x2715f7(_0x39d29b[_0xe286('0x19')][_0xe286('0x18')]);}})['catch'](function(_0x270b25){logger[_0xe286('0x16')]('Team,\x20%s,\x20%s',_0x23e864,_0x270b25);_0x311487(_0x270b25);});});}