Built motion from commit eddce310.|2.6.12
[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 _0x83dc=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0x83dc,0x182));var _0xc83d=function(_0x2a741e,_0x3e398e){_0x2a741e=_0x2a741e-0x0;var _0x5180af=_0x83dc[_0x2a741e];return _0x5180af;};'use strict';var _=require(_0xc83d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc83d('0x1'));var rs=require(_0xc83d('0x2'));var fs=require('fs');var Redis=require(_0xc83d('0x3'));var db=require(_0xc83d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc83d('0x5'))(_0xc83d('0x6'));var config=require(_0xc83d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc83d('0x8')]['http']({'port':0x232a});config[_0xc83d('0x9')]=_[_0xc83d('0xa')](config[_0xc83d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc83d('0xb'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xc83d('0xc')](socket);function respondWithRpcPromise(_0xbd35a7,_0x4b01a8,_0x29c8f8){return new BPromise(function(_0x5b5871,_0x55de82){return client[_0xc83d('0xd')](_0xbd35a7,_0x29c8f8)[_0xc83d('0xe')](function(_0x2fbdc0){logger['info'](_0xc83d('0xf'),_0x4b01a8,_0xc83d('0x10'));logger[_0xc83d('0x11')](_0xc83d('0x12'),_0x4b01a8,_0xc83d('0x10'),JSON[_0xc83d('0x13')](_0x2fbdc0));if(_0x2fbdc0['error']){if(_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x15')]===0x1f4){logger[_0xc83d('0x14')](_0xc83d('0xf'),_0x4b01a8,_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x16')]);return _0x55de82(_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x16')]);}logger[_0xc83d('0x14')](_0xc83d('0xf'),_0x4b01a8,_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x16')]);return _0x5b5871(_0x2fbdc0['error'][_0xc83d('0x16')]);}else{logger[_0xc83d('0x17')](_0xc83d('0xf'),_0x4b01a8,'request\x20sent');_0x5b5871(_0x2fbdc0[_0xc83d('0x18')]['message']);}})[_0xc83d('0x19')](function(_0x3e7053){logger['error']('DashboardItem,\x20%s,\x20%s',_0x4b01a8,_0x3e7053);_0x55de82(_0x3e7053);});});}