Built motion from commit (unavailable).|2.5.31
[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 _0x354c=['then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','register','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x354c,0x155));var _0xc354=function(_0x33a5af,_0x4afd3e){_0x33a5af=_0x33a5af-0x0;var _0x496386=_0x354c[_0x33a5af];return _0x496386;};'use strict';var _=require(_0xc354('0x0'));var util=require(_0xc354('0x1'));var moment=require(_0xc354('0x2'));var BPromise=require(_0xc354('0x3'));var rs=require(_0xc354('0x4'));var fs=require('fs');var Redis=require(_0xc354('0x5'));var db=require(_0xc354('0x6'))['db'];var utils=require(_0xc354('0x7'));var logger=require(_0xc354('0x8'))(_0xc354('0x9'));var config=require(_0xc354('0xa'));var jayson=require(_0xc354('0xb'));var client=jayson['client'][_0xc354('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc354('0xd')],{'host':_0xc354('0xe'),'port':0x18eb});var socket=require(_0xc354('0xf'))(new Redis(config[_0xc354('0xd')]));require(_0xc354('0x10'))[_0xc354('0x11')](socket);function respondWithRpcPromise(_0x36e1cc,_0x50ae9a,_0x3a0645){return new BPromise(function(_0x166376,_0x21391b){return client[_0xc354('0x12')](_0x36e1cc,_0x3a0645)[_0xc354('0x13')](function(_0x248e8f){logger[_0xc354('0x14')](_0xc354('0x15'),_0x50ae9a,_0xc354('0x16'));logger['debug'](_0xc354('0x17'),_0x50ae9a,_0xc354('0x16'),JSON[_0xc354('0x18')](_0x248e8f));if(_0x248e8f[_0xc354('0x19')]){if(_0x248e8f['error'][_0xc354('0x1a')]===0x1f4){logger[_0xc354('0x19')](_0xc354('0x15'),_0x50ae9a,_0x248e8f[_0xc354('0x19')]['message']);return _0x21391b(_0x248e8f[_0xc354('0x19')][_0xc354('0x1b')]);}logger['error']('Team,\x20%s,\x20%s',_0x50ae9a,_0x248e8f['error']['message']);return _0x166376(_0x248e8f[_0xc354('0x19')][_0xc354('0x1b')]);}else{logger[_0xc354('0x14')](_0xc354('0x15'),_0x50ae9a,_0xc354('0x16'));_0x166376(_0x248e8f[_0xc354('0x1c')][_0xc354('0x1b')]);}})[_0xc354('0x1d')](function(_0xb16a76){logger[_0xc354('0x19')]('Team,\x20%s,\x20%s',_0x50ae9a,_0xb16a76);_0x21391b(_0xb16a76);});});}