Built motion from commit (unavailable).|2.3.91
[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 _0xeef9=['redis','defaults','socket.io-emitter','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0xeef9,0x8c));var _0x9eef=function(_0x119a07,_0x2289f6){_0x119a07=_0x119a07-0x0;var _0x36025c=_0xeef9[_0x119a07];return _0x36025c;};'use strict';var _=require(_0x9eef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9eef('0x1'));var rs=require(_0x9eef('0x2'));var fs=require('fs');var Redis=require(_0x9eef('0x3'));var db=require(_0x9eef('0x4'))['db'];var utils=require(_0x9eef('0x5'));var logger=require(_0x9eef('0x6'))('rpc');var config=require(_0x9eef('0x7'));var jayson=require(_0x9eef('0x8'));var client=jayson[_0x9eef('0x9')]['http']({'port':0x232a});config[_0x9eef('0xa')]=_[_0x9eef('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9eef('0xc'))(new Redis(config[_0x9eef('0xa')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x4072dc,_0x567360,_0xbe3b40){return new BPromise(function(_0x31c772,_0x5dd413){return client[_0x9eef('0xd')](_0x4072dc,_0xbe3b40)[_0x9eef('0xe')](function(_0x2371e8){logger[_0x9eef('0xf')](_0x9eef('0x10'),_0x567360,'request\x20sent');logger[_0x9eef('0x11')](_0x9eef('0x12'),_0x567360,_0x9eef('0x13'),JSON[_0x9eef('0x14')](_0x2371e8));if(_0x2371e8[_0x9eef('0x15')]){if(_0x2371e8['error'][_0x9eef('0x16')]===0x1f4){logger[_0x9eef('0x15')](_0x9eef('0x10'),_0x567360,_0x2371e8[_0x9eef('0x15')][_0x9eef('0x17')]);return _0x5dd413(_0x2371e8['error']['message']);}logger['error'](_0x9eef('0x10'),_0x567360,_0x2371e8[_0x9eef('0x15')][_0x9eef('0x17')]);return _0x31c772(_0x2371e8['error'][_0x9eef('0x17')]);}else{logger[_0x9eef('0xf')](_0x9eef('0x10'),_0x567360,'request\x20sent');_0x31c772(_0x2371e8['result'][_0x9eef('0x17')]);}})[_0x9eef('0x18')](function(_0x21013d){logger[_0x9eef('0x15')]('DashboardItem,\x20%s,\x20%s',_0x567360,_0x21013d);_0x5dd413(_0x21013d);});});}