Built motion from commit cf5ff673.|2.5.41
[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 _0x7bcb=['request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','DashboardItem,\x20%s,\x20%s'];(function(_0x1df18e,_0x4ea423){var _0x529a0f=function(_0x1b5671){while(--_0x1b5671){_0x1df18e['push'](_0x1df18e['shift']());}};_0x529a0f(++_0x4ea423);}(_0x7bcb,0xb8));var _0xb7bc=function(_0x1b5a3a,_0x2a706b){_0x1b5a3a=_0x1b5a3a-0x0;var _0x3b6a4e=_0x7bcb[_0x1b5a3a];return _0x3b6a4e;};'use strict';var _=require('lodash');var util=require(_0xb7bc('0x0'));var moment=require(_0xb7bc('0x1'));var BPromise=require(_0xb7bc('0x2'));var rs=require(_0xb7bc('0x3'));var fs=require('fs');var Redis=require(_0xb7bc('0x4'));var db=require(_0xb7bc('0x5'))['db'];var utils=require(_0xb7bc('0x6'));var logger=require('../../config/logger')(_0xb7bc('0x7'));var config=require(_0xb7bc('0x8'));var jayson=require(_0xb7bc('0x9'));var client=jayson[_0xb7bc('0xa')][_0xb7bc('0xb')]({'port':0x232a});config[_0xb7bc('0xc')]=_[_0xb7bc('0xd')](config[_0xb7bc('0xc')],{'host':_0xb7bc('0xe'),'port':0x18eb});var socket=require(_0xb7bc('0xf'))(new Redis(config[_0xb7bc('0xc')]));require('./dashboardItem.socket')[_0xb7bc('0x10')](socket);function respondWithRpcPromise(_0x539039,_0x4149d5,_0x1dc053){return new BPromise(function(_0x40d903,_0x2c90dc){return client['request'](_0x539039,_0x1dc053)[_0xb7bc('0x11')](function(_0x342f85){logger['info'](_0xb7bc('0x12'),_0x4149d5,_0xb7bc('0x13'));logger[_0xb7bc('0x14')](_0xb7bc('0x15'),_0x4149d5,_0xb7bc('0x13'),JSON[_0xb7bc('0x16')](_0x342f85));if(_0x342f85[_0xb7bc('0x17')]){if(_0x342f85[_0xb7bc('0x17')][_0xb7bc('0x18')]===0x1f4){logger[_0xb7bc('0x17')](_0xb7bc('0x12'),_0x4149d5,_0x342f85[_0xb7bc('0x17')][_0xb7bc('0x19')]);return _0x2c90dc(_0x342f85[_0xb7bc('0x17')][_0xb7bc('0x19')]);}logger[_0xb7bc('0x17')](_0xb7bc('0x12'),_0x4149d5,_0x342f85[_0xb7bc('0x17')][_0xb7bc('0x19')]);return _0x40d903(_0x342f85[_0xb7bc('0x17')]['message']);}else{logger[_0xb7bc('0x1a')](_0xb7bc('0x12'),_0x4149d5,'request\x20sent');_0x40d903(_0x342f85[_0xb7bc('0x1b')][_0xb7bc('0x19')]);}})[_0xb7bc('0x1c')](function(_0x4d4b46){logger[_0xb7bc('0x17')](_0xb7bc('0x12'),_0x4149d5,_0x4d4b46);_0x2c90dc(_0x4d4b46);});});}