Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / chatGroup / chatGroup.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 _0x6e91=['http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a6ced,_0x361985){var _0x488be5=function(_0x27857c){while(--_0x27857c){_0x3a6ced['push'](_0x3a6ced['shift']());}};_0x488be5(++_0x361985);}(_0x6e91,0x80));var _0x16e9=function(_0x3cbb6,_0x276033){_0x3cbb6=_0x3cbb6-0x0;var _0x166d5f=_0x6e91[_0x3cbb6];return _0x166d5f;};'use strict';var _=require(_0x16e9('0x0'));var util=require(_0x16e9('0x1'));var moment=require(_0x16e9('0x2'));var BPromise=require(_0x16e9('0x3'));var rs=require(_0x16e9('0x4'));var fs=require('fs');var Redis=require(_0x16e9('0x5'));var db=require(_0x16e9('0x6'))['db'];var utils=require(_0x16e9('0x7'));var logger=require('../../config/logger')(_0x16e9('0x8'));var config=require(_0x16e9('0x9'));var jayson=require(_0x16e9('0xa'));var client=jayson[_0x16e9('0xb')][_0x16e9('0xc')]({'port':0x232a});config[_0x16e9('0xd')]=_[_0x16e9('0xe')](config[_0x16e9('0xd')],{'host':_0x16e9('0xf'),'port':0x18eb});var socket=require(_0x16e9('0x10'))(new Redis(config[_0x16e9('0xd')]));require(_0x16e9('0x11'))['register'](socket);function respondWithRpcPromise(_0x14b3cb,_0x2d3561,_0x1a5e5a){return new BPromise(function(_0x769ca9,_0x502179){return client[_0x16e9('0x12')](_0x14b3cb,_0x1a5e5a)[_0x16e9('0x13')](function(_0x34676a){logger[_0x16e9('0x14')](_0x16e9('0x15'),_0x2d3561,_0x16e9('0x16'));logger['debug'](_0x16e9('0x17'),_0x2d3561,_0x16e9('0x16'),JSON[_0x16e9('0x18')](_0x34676a));if(_0x34676a[_0x16e9('0x19')]){if(_0x34676a[_0x16e9('0x19')][_0x16e9('0x1a')]===0x1f4){logger[_0x16e9('0x19')](_0x16e9('0x15'),_0x2d3561,_0x34676a[_0x16e9('0x19')][_0x16e9('0x1b')]);return _0x502179(_0x34676a[_0x16e9('0x19')][_0x16e9('0x1b')]);}logger[_0x16e9('0x19')](_0x16e9('0x15'),_0x2d3561,_0x34676a[_0x16e9('0x19')]['message']);return _0x769ca9(_0x34676a[_0x16e9('0x19')][_0x16e9('0x1b')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x2d3561,_0x16e9('0x16'));_0x769ca9(_0x34676a['result'][_0x16e9('0x1b')]);}})['catch'](function(_0xc19a1f){logger[_0x16e9('0x19')]('ChatGroup,\x20%s,\x20%s',_0x2d3561,_0xc19a1f);_0x502179(_0xc19a1f);});});}