Built motion from commit (unavailable).|2.4.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 _0x1dde=['register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./dashboardItem.socket'];(function(_0x339d74,_0xee4f19){var _0x5d09ca=function(_0x3769ac){while(--_0x3769ac){_0x339d74['push'](_0x339d74['shift']());}};_0x5d09ca(++_0xee4f19);}(_0x1dde,0xdd));var _0xe1dd=function(_0x1f02a4,_0x545d58){_0x1f02a4=_0x1f02a4-0x0;var _0xdfce93=_0x1dde[_0x1f02a4];return _0xdfce93;};'use strict';var _=require('lodash');var util=require(_0xe1dd('0x0'));var moment=require(_0xe1dd('0x1'));var BPromise=require(_0xe1dd('0x2'));var rs=require(_0xe1dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1dd('0x4'))['db'];var utils=require(_0xe1dd('0x5'));var logger=require(_0xe1dd('0x6'))(_0xe1dd('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1dd('0x8'));var client=jayson[_0xe1dd('0x9')]['http']({'port':0x232a});config[_0xe1dd('0xa')]=_['defaults'](config[_0xe1dd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1dd('0xb'))(new Redis(config[_0xe1dd('0xa')]));require(_0xe1dd('0xc'))[_0xe1dd('0xd')](socket);function respondWithRpcPromise(_0x181a67,_0x129548,_0x1e9aaa){return new BPromise(function(_0x483e9a,_0x338fdd){return client[_0xe1dd('0xe')](_0x181a67,_0x1e9aaa)[_0xe1dd('0xf')](function(_0xafe17c){logger[_0xe1dd('0x10')](_0xe1dd('0x11'),_0x129548,_0xe1dd('0x12'));logger[_0xe1dd('0x13')](_0xe1dd('0x14'),_0x129548,'request\x20sent',JSON[_0xe1dd('0x15')](_0xafe17c));if(_0xafe17c[_0xe1dd('0x16')]){if(_0xafe17c[_0xe1dd('0x16')][_0xe1dd('0x17')]===0x1f4){logger[_0xe1dd('0x16')](_0xe1dd('0x11'),_0x129548,_0xafe17c[_0xe1dd('0x16')]['message']);return _0x338fdd(_0xafe17c[_0xe1dd('0x16')]['message']);}logger['error'](_0xe1dd('0x11'),_0x129548,_0xafe17c['error'][_0xe1dd('0x18')]);return _0x483e9a(_0xafe17c['error']['message']);}else{logger[_0xe1dd('0x10')](_0xe1dd('0x11'),_0x129548,_0xe1dd('0x12'));_0x483e9a(_0xafe17c[_0xe1dd('0x19')][_0xe1dd('0x18')]);}})['catch'](function(_0x1d4758){logger[_0xe1dd('0x16')](_0xe1dd('0x11'),_0x129548,_0x1d4758);_0x338fdd(_0x1d4758);});});}