Built motion from commit (unavailable).|2.4.3
[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 _0x6fc3=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x2ea4b9,_0x38cdcd){var _0x456d08=function(_0x1e3a62){while(--_0x1e3a62){_0x2ea4b9['push'](_0x2ea4b9['shift']());}};_0x456d08(++_0x38cdcd);}(_0x6fc3,0x130));var _0x36fc=function(_0x450e20,_0x14069d){_0x450e20=_0x450e20-0x0;var _0x350ea5=_0x6fc3[_0x450e20];return _0x350ea5;};'use strict';var _=require('lodash');var util=require(_0x36fc('0x0'));var moment=require(_0x36fc('0x1'));var BPromise=require(_0x36fc('0x2'));var rs=require(_0x36fc('0x3'));var fs=require('fs');var Redis=require(_0x36fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x36fc('0x5'));var logger=require(_0x36fc('0x6'))(_0x36fc('0x7'));var config=require(_0x36fc('0x8'));var jayson=require(_0x36fc('0x9'));var client=jayson[_0x36fc('0xa')][_0x36fc('0xb')]({'port':0x232a});config['redis']=_[_0x36fc('0xc')](config[_0x36fc('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x36fc('0xe'))(new Redis(config[_0x36fc('0xd')]));require(_0x36fc('0xf'))[_0x36fc('0x10')](socket);function respondWithRpcPromise(_0x3accb8,_0x561d0d,_0x258ce9){return new BPromise(function(_0x163c81,_0x22f6aa){return client[_0x36fc('0x11')](_0x3accb8,_0x258ce9)[_0x36fc('0x12')](function(_0x235d90){logger[_0x36fc('0x13')](_0x36fc('0x14'),_0x561d0d,'request\x20sent');logger[_0x36fc('0x15')]('Team,\x20%s,\x20%s,\x20%s',_0x561d0d,_0x36fc('0x16'),JSON[_0x36fc('0x17')](_0x235d90));if(_0x235d90[_0x36fc('0x18')]){if(_0x235d90[_0x36fc('0x18')]['code']===0x1f4){logger[_0x36fc('0x18')](_0x36fc('0x14'),_0x561d0d,_0x235d90['error'][_0x36fc('0x19')]);return _0x22f6aa(_0x235d90[_0x36fc('0x18')][_0x36fc('0x19')]);}logger[_0x36fc('0x18')](_0x36fc('0x14'),_0x561d0d,_0x235d90[_0x36fc('0x18')][_0x36fc('0x19')]);return _0x163c81(_0x235d90[_0x36fc('0x18')][_0x36fc('0x19')]);}else{logger[_0x36fc('0x13')](_0x36fc('0x14'),_0x561d0d,_0x36fc('0x16'));_0x163c81(_0x235d90[_0x36fc('0x1a')][_0x36fc('0x19')]);}})[_0x36fc('0x1b')](function(_0x3dfa10){logger[_0x36fc('0x18')](_0x36fc('0x14'),_0x561d0d,_0x3dfa10);_0x22f6aa(_0x3dfa10);});});}