Built motion from commit 775e2a94.|2.6.3
[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 _0x351f=['request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x474035,_0x41e639){var _0x1b58e0=function(_0x91b15c){while(--_0x91b15c){_0x474035['push'](_0x474035['shift']());}};_0x1b58e0(++_0x41e639);}(_0x351f,0xd6));var _0xf351=function(_0x483747,_0x23878e){_0x483747=_0x483747-0x0;var _0x2ce763=_0x351f[_0x483747];return _0x2ce763;};'use strict';var _=require(_0xf351('0x0'));var util=require(_0xf351('0x1'));var moment=require(_0xf351('0x2'));var BPromise=require(_0xf351('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf351('0x4'));var db=require(_0xf351('0x5'))['db'];var utils=require(_0xf351('0x6'));var logger=require(_0xf351('0x7'))(_0xf351('0x8'));var config=require(_0xf351('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf351('0xa')][_0xf351('0xb')]({'port':0x232a});config[_0xf351('0xc')]=_[_0xf351('0xd')](config[_0xf351('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf351('0xe'))(new Redis(config[_0xf351('0xc')]));require('./dashboardItem.socket')[_0xf351('0xf')](socket);function respondWithRpcPromise(_0x2178d6,_0xd26a15,_0x186222){return new BPromise(function(_0x11a2a9,_0x225906){return client[_0xf351('0x10')](_0x2178d6,_0x186222)[_0xf351('0x11')](function(_0x16d071){logger[_0xf351('0x12')](_0xf351('0x13'),_0xd26a15,_0xf351('0x14'));logger['debug'](_0xf351('0x15'),_0xd26a15,_0xf351('0x14'),JSON['stringify'](_0x16d071));if(_0x16d071[_0xf351('0x16')]){if(_0x16d071[_0xf351('0x16')][_0xf351('0x17')]===0x1f4){logger[_0xf351('0x16')](_0xf351('0x13'),_0xd26a15,_0x16d071['error']['message']);return _0x225906(_0x16d071[_0xf351('0x16')][_0xf351('0x18')]);}logger[_0xf351('0x16')](_0xf351('0x13'),_0xd26a15,_0x16d071[_0xf351('0x16')][_0xf351('0x18')]);return _0x11a2a9(_0x16d071[_0xf351('0x16')][_0xf351('0x18')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0xd26a15,_0xf351('0x14'));_0x11a2a9(_0x16d071['result'][_0xf351('0x18')]);}})[_0xf351('0x19')](function(_0x543813){logger['error']('DashboardItem,\x20%s,\x20%s',_0xd26a15,_0x543813);_0x225906(_0x543813);});});}