Built motion from commit (unavailable).|2.5.20
[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 _0x13c9=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','info'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x13c9,0xa4));var _0x913c=function(_0x191b6c,_0x5d6988){_0x191b6c=_0x191b6c-0x0;var _0x4c51fd=_0x13c9[_0x191b6c];return _0x4c51fd;};'use strict';var _=require(_0x913c('0x0'));var util=require(_0x913c('0x1'));var moment=require(_0x913c('0x2'));var BPromise=require('bluebird');var rs=require(_0x913c('0x3'));var fs=require('fs');var Redis=require(_0x913c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x913c('0x5'));var logger=require(_0x913c('0x6'))(_0x913c('0x7'));var config=require('../../config/environment');var jayson=require(_0x913c('0x8'));var client=jayson['client'][_0x913c('0x9')]({'port':0x232a});config[_0x913c('0xa')]=_[_0x913c('0xb')](config[_0x913c('0xa')],{'host':_0x913c('0xc'),'port':0x18eb});var socket=require(_0x913c('0xd'))(new Redis(config['redis']));require(_0x913c('0xe'))[_0x913c('0xf')](socket);function respondWithRpcPromise(_0x578752,_0x54546e,_0x2dc5b0){return new BPromise(function(_0x6d2b20,_0x138075){return client[_0x913c('0x10')](_0x578752,_0x2dc5b0)['then'](function(_0x46fc82){logger['info']('DashboardItem,\x20%s,\x20%s',_0x54546e,_0x913c('0x11'));logger[_0x913c('0x12')](_0x913c('0x13'),_0x54546e,_0x913c('0x11'),JSON[_0x913c('0x14')](_0x46fc82));if(_0x46fc82['error']){if(_0x46fc82[_0x913c('0x15')]['code']===0x1f4){logger[_0x913c('0x15')](_0x913c('0x16'),_0x54546e,_0x46fc82['error'][_0x913c('0x17')]);return _0x138075(_0x46fc82[_0x913c('0x15')]['message']);}logger[_0x913c('0x15')](_0x913c('0x16'),_0x54546e,_0x46fc82[_0x913c('0x15')][_0x913c('0x17')]);return _0x6d2b20(_0x46fc82['error'][_0x913c('0x17')]);}else{logger[_0x913c('0x18')](_0x913c('0x16'),_0x54546e,_0x913c('0x11'));_0x6d2b20(_0x46fc82[_0x913c('0x19')][_0x913c('0x17')]);}})[_0x913c('0x1a')](function(_0x44b413){logger['error'](_0x913c('0x16'),_0x54546e,_0x44b413);_0x138075(_0x44b413);});});}