Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / dashboardItem / dashboardItem.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 _0xd83f=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x238f08,_0x17b2d6){var _0x306697=function(_0x28a705){while(--_0x28a705){_0x238f08['push'](_0x238f08['shift']());}};_0x306697(++_0x17b2d6);}(_0xd83f,0x13a));var _0xfd83=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xd83f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xfd83('0x0'));var util=require(_0xfd83('0x1'));var moment=require(_0xfd83('0x2'));var BPromise=require(_0xfd83('0x3'));var rs=require(_0xfd83('0x4'));var fs=require('fs');var Redis=require(_0xfd83('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd83('0x6'));var logger=require('../../config/logger')(_0xfd83('0x7'));var config=require('../../config/environment');var jayson=require(_0xfd83('0x8'));var client=jayson[_0xfd83('0x9')][_0xfd83('0xa')]({'port':0x232a});config['redis']=_[_0xfd83('0xb')](config[_0xfd83('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfd83('0xd'))[_0xfd83('0xe')](socket);function respondWithRpcPromise(_0x309449,_0x1846dc,_0x27b628){return new BPromise(function(_0x5342e0,_0xa5729b){return client[_0xfd83('0xf')](_0x309449,_0x27b628)['then'](function(_0x432538){logger[_0xfd83('0x10')](_0xfd83('0x11'),_0x1846dc,_0xfd83('0x12'));logger[_0xfd83('0x13')](_0xfd83('0x14'),_0x1846dc,_0xfd83('0x12'),JSON[_0xfd83('0x15')](_0x432538));if(_0x432538[_0xfd83('0x16')]){if(_0x432538['error'][_0xfd83('0x17')]===0x1f4){logger['error'](_0xfd83('0x11'),_0x1846dc,_0x432538[_0xfd83('0x16')]['message']);return _0xa5729b(_0x432538[_0xfd83('0x16')][_0xfd83('0x18')]);}logger['error'](_0xfd83('0x11'),_0x1846dc,_0x432538['error'][_0xfd83('0x18')]);return _0x5342e0(_0x432538[_0xfd83('0x16')][_0xfd83('0x18')]);}else{logger[_0xfd83('0x10')](_0xfd83('0x11'),_0x1846dc,_0xfd83('0x12'));_0x5342e0(_0x432538['result'][_0xfd83('0x18')]);}})[_0xfd83('0x19')](function(_0x5a1f76){logger[_0xfd83('0x16')](_0xfd83('0x11'),_0x1846dc,_0x5a1f76);_0xa5729b(_0x5a1f76);});});}