Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / chatWebsite / chatWebsite.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 _0x8bfc=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x1617df,_0x50c299){var _0x4a3f43=function(_0x3c9959){while(--_0x3c9959){_0x1617df['push'](_0x1617df['shift']());}};_0x4a3f43(++_0x50c299);}(_0x8bfc,0x89));var _0xc8bf=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x8bfc[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xc8bf('0x0'));var util=require(_0xc8bf('0x1'));var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rs=require(_0xc8bf('0x4'));var fs=require('fs');var Redis=require(_0xc8bf('0x5'));var db=require(_0xc8bf('0x6'))['db'];var utils=require(_0xc8bf('0x7'));var logger=require(_0xc8bf('0x8'))(_0xc8bf('0x9'));var config=require(_0xc8bf('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc8bf('0xb')]['http']({'port':0x232a});config[_0xc8bf('0xc')]=_[_0xc8bf('0xd')](config[_0xc8bf('0xc')],{'host':_0xc8bf('0xe'),'port':0x18eb});var socket=require(_0xc8bf('0xf'))(new Redis(config['redis']));require(_0xc8bf('0x10'))[_0xc8bf('0x11')](socket);function respondWithRpcPromise(_0x58c65f,_0x88cedc,_0x3b8b90){return new BPromise(function(_0x272388,_0x4f75e2){return client[_0xc8bf('0x12')](_0x58c65f,_0x3b8b90)[_0xc8bf('0x13')](function(_0x2647f0){logger[_0xc8bf('0x14')](_0xc8bf('0x15'),_0x88cedc,_0xc8bf('0x16'));logger[_0xc8bf('0x17')](_0xc8bf('0x18'),_0x88cedc,_0xc8bf('0x16'),JSON[_0xc8bf('0x19')](_0x2647f0));if(_0x2647f0[_0xc8bf('0x1a')]){if(_0x2647f0[_0xc8bf('0x1a')]['code']===0x1f4){logger['error'](_0xc8bf('0x15'),_0x88cedc,_0x2647f0[_0xc8bf('0x1a')][_0xc8bf('0x1b')]);return _0x4f75e2(_0x2647f0[_0xc8bf('0x1a')]['message']);}logger[_0xc8bf('0x1a')](_0xc8bf('0x15'),_0x88cedc,_0x2647f0[_0xc8bf('0x1a')][_0xc8bf('0x1b')]);return _0x272388(_0x2647f0[_0xc8bf('0x1a')][_0xc8bf('0x1b')]);}else{logger[_0xc8bf('0x14')](_0xc8bf('0x15'),_0x88cedc,_0xc8bf('0x16'));_0x272388(_0x2647f0[_0xc8bf('0x1c')][_0xc8bf('0x1b')]);}})[_0xc8bf('0x1d')](function(_0x17048d){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x88cedc,_0x17048d);_0x4f75e2(_0x17048d);});});}