Built motion from commit (unavailable).|2.2.2
[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 _0x24a0=['defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x24a0,0x11e));var _0x024a=function(_0xc22fdf,_0x9c9bf5){_0xc22fdf=_0xc22fdf-0x0;var _0xad7929=_0x24a0[_0xc22fdf];return _0xad7929;};'use strict';var _=require(_0x024a('0x0'));var util=require(_0x024a('0x1'));var moment=require('moment');var BPromise=require(_0x024a('0x2'));var rs=require(_0x024a('0x3'));var fs=require('fs');var Redis=require(_0x024a('0x4'));var db=require(_0x024a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x024a('0x6'));var jayson=require(_0x024a('0x7'));var client=jayson[_0x024a('0x8')][_0x024a('0x9')]({'port':0x232a});config[_0x024a('0xa')]=_[_0x024a('0xb')](config[_0x024a('0xa')],{'host':_0x024a('0xc'),'port':0x18eb});var socket=require(_0x024a('0xd'))(new Redis(config[_0x024a('0xa')]));require(_0x024a('0xe'))['register'](socket);function respondWithRpcPromise(_0x3a9113,_0x243632,_0x4763d8){return new BPromise(function(_0x292d1,_0x48d9da){return client[_0x024a('0xf')](_0x3a9113,_0x4763d8)[_0x024a('0x10')](function(_0x35477b){logger[_0x024a('0x11')](_0x024a('0x12'),_0x243632,_0x024a('0x13'));logger[_0x024a('0x14')](_0x024a('0x15'),_0x243632,'request\x20sent',JSON[_0x024a('0x16')](_0x35477b));if(_0x35477b['error']){if(_0x35477b['error'][_0x024a('0x17')]===0x1f4){logger['error'](_0x024a('0x12'),_0x243632,_0x35477b[_0x024a('0x18')][_0x024a('0x19')]);return _0x48d9da(_0x35477b[_0x024a('0x18')][_0x024a('0x19')]);}logger[_0x024a('0x18')](_0x024a('0x12'),_0x243632,_0x35477b[_0x024a('0x18')][_0x024a('0x19')]);return _0x292d1(_0x35477b[_0x024a('0x18')][_0x024a('0x19')]);}else{logger[_0x024a('0x11')](_0x024a('0x12'),_0x243632,_0x024a('0x13'));_0x292d1(_0x35477b['result'][_0x024a('0x19')]);}})[_0x024a('0x1a')](function(_0x545a84){logger[_0x024a('0x18')]('DashboardItem,\x20%s,\x20%s',_0x243632,_0x545a84);_0x48d9da(_0x545a84);});});}