Built motion from commit 1fa89557.|2.6.10
[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 _0xd9c7=['../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis'];(function(_0x16d354,_0x7ae7d3){var _0x4f3ed8=function(_0x6f7bc7){while(--_0x6f7bc7){_0x16d354['push'](_0x16d354['shift']());}};_0x4f3ed8(++_0x7ae7d3);}(_0xd9c7,0x8d));var _0x7d9c=function(_0x1286ec,_0xc9e369){_0x1286ec=_0x1286ec-0x0;var _0x447293=_0xd9c7[_0x1286ec];return _0x447293;};'use strict';var _=require(_0x7d9c('0x0'));var util=require('util');var moment=require(_0x7d9c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d9c('0x2'));var db=require(_0x7d9c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d9c('0x4'));var config=require('../../config/environment');var jayson=require(_0x7d9c('0x5'));var client=jayson[_0x7d9c('0x6')]['http']({'port':0x232a});config[_0x7d9c('0x7')]=_[_0x7d9c('0x8')](config['redis'],{'host':_0x7d9c('0x9'),'port':0x18eb});var socket=require(_0x7d9c('0xa'))(new Redis(config[_0x7d9c('0x7')]));require(_0x7d9c('0xb'))[_0x7d9c('0xc')](socket);function respondWithRpcPromise(_0x4f8e89,_0x52879c,_0x181b73){return new BPromise(function(_0x10ec44,_0x1f0ca9){return client['request'](_0x4f8e89,_0x181b73)[_0x7d9c('0xd')](function(_0x40dae2){logger[_0x7d9c('0xe')]('DashboardItem,\x20%s,\x20%s',_0x52879c,_0x7d9c('0xf'));logger[_0x7d9c('0x10')](_0x7d9c('0x11'),_0x52879c,'request\x20sent',JSON['stringify'](_0x40dae2));if(_0x40dae2[_0x7d9c('0x12')]){if(_0x40dae2[_0x7d9c('0x12')][_0x7d9c('0x13')]===0x1f4){logger[_0x7d9c('0x12')](_0x7d9c('0x14'),_0x52879c,_0x40dae2['error']['message']);return _0x1f0ca9(_0x40dae2[_0x7d9c('0x12')][_0x7d9c('0x15')]);}logger[_0x7d9c('0x12')](_0x7d9c('0x14'),_0x52879c,_0x40dae2['error'][_0x7d9c('0x15')]);return _0x10ec44(_0x40dae2[_0x7d9c('0x12')][_0x7d9c('0x15')]);}else{logger[_0x7d9c('0xe')](_0x7d9c('0x14'),_0x52879c,_0x7d9c('0xf'));_0x10ec44(_0x40dae2[_0x7d9c('0x16')][_0x7d9c('0x15')]);}})[_0x7d9c('0x17')](function(_0x380379){logger[_0x7d9c('0x12')](_0x7d9c('0x14'),_0x52879c,_0x380379);_0x1f0ca9(_0x380379);});});}