Built motion from commit 497d3d92.|2.5.43
[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 _0x595a=['http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x42ad52,_0x5240c5){var _0x451d89=function(_0x5ec225){while(--_0x5ec225){_0x42ad52['push'](_0x42ad52['shift']());}};_0x451d89(++_0x5240c5);}(_0x595a,0x164));var _0xa595=function(_0x454bd3,_0x3e4d94){_0x454bd3=_0x454bd3-0x0;var _0x4eb066=_0x595a[_0x454bd3];return _0x4eb066;};'use strict';var _=require(_0xa595('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa595('0x1'));var fs=require('fs');var Redis=require(_0xa595('0x2'));var db=require(_0xa595('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa595('0x4'))(_0xa595('0x5'));var config=require(_0xa595('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa595('0x7')][_0xa595('0x8')]({'port':0x232a});config[_0xa595('0x9')]=_[_0xa595('0xa')](config[_0xa595('0x9')],{'host':_0xa595('0xb'),'port':0x18eb});var socket=require(_0xa595('0xc'))(new Redis(config[_0xa595('0x9')]));require(_0xa595('0xd'))['register'](socket);function respondWithRpcPromise(_0x4216b4,_0xfa9d75,_0x4309a8){return new BPromise(function(_0x4475c6,_0x25cf6e){return client['request'](_0x4216b4,_0x4309a8)[_0xa595('0xe')](function(_0x4ef0d8){logger[_0xa595('0xf')](_0xa595('0x10'),_0xfa9d75,'request\x20sent');logger[_0xa595('0x11')](_0xa595('0x12'),_0xfa9d75,_0xa595('0x13'),JSON[_0xa595('0x14')](_0x4ef0d8));if(_0x4ef0d8[_0xa595('0x15')]){if(_0x4ef0d8[_0xa595('0x15')][_0xa595('0x16')]===0x1f4){logger[_0xa595('0x15')](_0xa595('0x10'),_0xfa9d75,_0x4ef0d8[_0xa595('0x15')][_0xa595('0x17')]);return _0x25cf6e(_0x4ef0d8[_0xa595('0x15')][_0xa595('0x17')]);}logger[_0xa595('0x15')]('DashboardItem,\x20%s,\x20%s',_0xfa9d75,_0x4ef0d8[_0xa595('0x15')]['message']);return _0x4475c6(_0x4ef0d8[_0xa595('0x15')][_0xa595('0x17')]);}else{logger[_0xa595('0xf')]('DashboardItem,\x20%s,\x20%s',_0xfa9d75,_0xa595('0x13'));_0x4475c6(_0x4ef0d8[_0xa595('0x18')][_0xa595('0x17')]);}})[_0xa595('0x19')](function(_0x5e4d12){logger[_0xa595('0x15')](_0xa595('0x10'),_0xfa9d75,_0x5e4d12);_0x25cf6e(_0x5e4d12);});});}