Built motion from commit da617fac.|2.6.6
[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 _0x186c=['DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x186c,0xa3));var _0xc186=function(_0x434ab9,_0x2c3eef){_0x434ab9=_0x434ab9-0x0;var _0x2ca0d9=_0x186c[_0x434ab9];return _0x2ca0d9;};'use strict';var _=require(_0xc186('0x0'));var util=require(_0xc186('0x1'));var moment=require(_0xc186('0x2'));var BPromise=require(_0xc186('0x3'));var rs=require(_0xc186('0x4'));var fs=require('fs');var Redis=require(_0xc186('0x5'));var db=require(_0xc186('0x6'))['db'];var utils=require(_0xc186('0x7'));var logger=require(_0xc186('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc186('0x9'));var client=jayson[_0xc186('0xa')][_0xc186('0xb')]({'port':0x232a});config[_0xc186('0xc')]=_[_0xc186('0xd')](config[_0xc186('0xc')],{'host':_0xc186('0xe'),'port':0x18eb});var socket=require(_0xc186('0xf'))(new Redis(config[_0xc186('0xc')]));require(_0xc186('0x10'))[_0xc186('0x11')](socket);function respondWithRpcPromise(_0x3ec90f,_0x55ba62,_0x17088f){return new BPromise(function(_0x52c08c,_0x3a1fbc){return client[_0xc186('0x12')](_0x3ec90f,_0x17088f)[_0xc186('0x13')](function(_0x2340f1){logger[_0xc186('0x14')](_0xc186('0x15'),_0x55ba62,'request\x20sent');logger[_0xc186('0x16')](_0xc186('0x17'),_0x55ba62,_0xc186('0x18'),JSON[_0xc186('0x19')](_0x2340f1));if(_0x2340f1[_0xc186('0x1a')]){if(_0x2340f1[_0xc186('0x1a')][_0xc186('0x1b')]===0x1f4){logger['error'](_0xc186('0x15'),_0x55ba62,_0x2340f1['error'][_0xc186('0x1c')]);return _0x3a1fbc(_0x2340f1[_0xc186('0x1a')][_0xc186('0x1c')]);}logger[_0xc186('0x1a')](_0xc186('0x15'),_0x55ba62,_0x2340f1[_0xc186('0x1a')][_0xc186('0x1c')]);return _0x52c08c(_0x2340f1['error'][_0xc186('0x1c')]);}else{logger[_0xc186('0x14')](_0xc186('0x15'),_0x55ba62,_0xc186('0x18'));_0x52c08c(_0x2340f1[_0xc186('0x1d')][_0xc186('0x1c')]);}})[_0xc186('0x1e')](function(_0x565527){logger[_0xc186('0x1a')](_0xc186('0x15'),_0x55ba62,_0x565527);_0x3a1fbc(_0x565527);});});}