Built motion from commit b5996064.|2.6.21
[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 _0xfcc3=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x19b96c,_0x56e30b){var _0x2625c3=function(_0x2dc7a5){while(--_0x2dc7a5){_0x19b96c['push'](_0x19b96c['shift']());}};_0x2625c3(++_0x56e30b);}(_0xfcc3,0x158));var _0x3fcc=function(_0x1545f2,_0x3342e6){_0x1545f2=_0x1545f2-0x0;var _0x29db16=_0xfcc3[_0x1545f2];return _0x29db16;};'use strict';var _=require(_0x3fcc('0x0'));var util=require(_0x3fcc('0x1'));var moment=require(_0x3fcc('0x2'));var BPromise=require('bluebird');var rs=require(_0x3fcc('0x3'));var fs=require('fs');var Redis=require(_0x3fcc('0x4'));var db=require(_0x3fcc('0x5'))['db'];var utils=require(_0x3fcc('0x6'));var logger=require(_0x3fcc('0x7'))(_0x3fcc('0x8'));var config=require(_0x3fcc('0x9'));var jayson=require(_0x3fcc('0xa'));var client=jayson[_0x3fcc('0xb')][_0x3fcc('0xc')]({'port':0x232a});config['redis']=_[_0x3fcc('0xd')](config[_0x3fcc('0xe')],{'host':_0x3fcc('0xf'),'port':0x18eb});var socket=require(_0x3fcc('0x10'))(new Redis(config[_0x3fcc('0xe')]));require(_0x3fcc('0x11'))['register'](socket);function respondWithRpcPromise(_0x3974c0,_0x115dc9,_0x4edbfb){return new BPromise(function(_0x14b43c,_0x463b90){return client[_0x3fcc('0x12')](_0x3974c0,_0x4edbfb)[_0x3fcc('0x13')](function(_0x1649e5){logger[_0x3fcc('0x14')](_0x3fcc('0x15'),_0x115dc9,_0x3fcc('0x16'));logger[_0x3fcc('0x17')](_0x3fcc('0x18'),_0x115dc9,_0x3fcc('0x16'),JSON[_0x3fcc('0x19')](_0x1649e5));if(_0x1649e5[_0x3fcc('0x1a')]){if(_0x1649e5[_0x3fcc('0x1a')][_0x3fcc('0x1b')]===0x1f4){logger['error'](_0x3fcc('0x15'),_0x115dc9,_0x1649e5[_0x3fcc('0x1a')][_0x3fcc('0x1c')]);return _0x463b90(_0x1649e5[_0x3fcc('0x1a')][_0x3fcc('0x1c')]);}logger[_0x3fcc('0x1a')](_0x3fcc('0x15'),_0x115dc9,_0x1649e5['error'][_0x3fcc('0x1c')]);return _0x14b43c(_0x1649e5[_0x3fcc('0x1a')][_0x3fcc('0x1c')]);}else{logger[_0x3fcc('0x14')](_0x3fcc('0x15'),_0x115dc9,_0x3fcc('0x16'));_0x14b43c(_0x1649e5[_0x3fcc('0x1d')][_0x3fcc('0x1c')]);}})[_0x3fcc('0x1e')](function(_0xe18e8a){logger[_0x3fcc('0x1a')](_0x3fcc('0x15'),_0x115dc9,_0xe18e8a);_0x463b90(_0xe18e8a);});});}