Built motion from commit (unavailable).|2.5.14
[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 _0x3195=['info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./team.socket','register','request','then'];(function(_0x1a9204,_0x1e4d83){var _0x234691=function(_0x4751e3){while(--_0x4751e3){_0x1a9204['push'](_0x1a9204['shift']());}};_0x234691(++_0x1e4d83);}(_0x3195,0x191));var _0x5319=function(_0x3018e6,_0x2824a6){_0x3018e6=_0x3018e6-0x0;var _0x3cb4c9=_0x3195[_0x3018e6];return _0x3cb4c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5319('0x0'));var fs=require('fs');var Redis=require(_0x5319('0x1'));var db=require(_0x5319('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5319('0x3'))(_0x5319('0x4'));var config=require('../../config/environment');var jayson=require(_0x5319('0x5'));var client=jayson[_0x5319('0x6')]['http']({'port':0x232a});config['redis']=_[_0x5319('0x7')](config['redis'],{'host':_0x5319('0x8'),'port':0x18eb});var socket=require(_0x5319('0x9'))(new Redis(config[_0x5319('0xa')]));require(_0x5319('0xb'))[_0x5319('0xc')](socket);function respondWithRpcPromise(_0x153557,_0x470b2d,_0x36e51d){return new BPromise(function(_0x590a44,_0x71b968){return client[_0x5319('0xd')](_0x153557,_0x36e51d)[_0x5319('0xe')](function(_0x308e9c){logger[_0x5319('0xf')](_0x5319('0x10'),_0x470b2d,_0x5319('0x11'));logger[_0x5319('0x12')](_0x5319('0x13'),_0x470b2d,_0x5319('0x11'),JSON[_0x5319('0x14')](_0x308e9c));if(_0x308e9c[_0x5319('0x15')]){if(_0x308e9c[_0x5319('0x15')][_0x5319('0x16')]===0x1f4){logger[_0x5319('0x15')]('Team,\x20%s,\x20%s',_0x470b2d,_0x308e9c[_0x5319('0x15')][_0x5319('0x17')]);return _0x71b968(_0x308e9c['error'][_0x5319('0x17')]);}logger[_0x5319('0x15')](_0x5319('0x10'),_0x470b2d,_0x308e9c[_0x5319('0x15')][_0x5319('0x17')]);return _0x590a44(_0x308e9c['error'][_0x5319('0x17')]);}else{logger[_0x5319('0xf')](_0x5319('0x10'),_0x470b2d,_0x5319('0x11'));_0x590a44(_0x308e9c[_0x5319('0x18')][_0x5319('0x17')]);}})[_0x5319('0x19')](function(_0x529f13){logger[_0x5319('0x15')]('Team,\x20%s,\x20%s',_0x470b2d,_0x529f13);_0x71b968(_0x529f13);});});}