Built motion from commit 3c2ce842.|2.6.31
[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 _0xff3c=['DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug'];(function(_0x313ed3,_0x4ea2da){var _0x595a64=function(_0x300adf){while(--_0x300adf){_0x313ed3['push'](_0x313ed3['shift']());}};_0x595a64(++_0x4ea2da);}(_0xff3c,0x10b));var _0xcff3=function(_0x39ed20,_0x3b8d39){_0x39ed20=_0x39ed20-0x0;var _0x57bddf=_0xff3c[_0x39ed20];return _0x57bddf;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var moment=require(_0xcff3('0x2'));var BPromise=require(_0xcff3('0x3'));var rs=require(_0xcff3('0x4'));var fs=require('fs');var Redis=require(_0xcff3('0x5'));var db=require(_0xcff3('0x6'))['db'];var utils=require(_0xcff3('0x7'));var logger=require(_0xcff3('0x8'))(_0xcff3('0x9'));var config=require(_0xcff3('0xa'));var jayson=require(_0xcff3('0xb'));var client=jayson[_0xcff3('0xc')][_0xcff3('0xd')]({'port':0x232a});config[_0xcff3('0xe')]=_[_0xcff3('0xf')](config[_0xcff3('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xcff3('0x10'))(new Redis(config[_0xcff3('0xe')]));require('./dashboardItem.socket')[_0xcff3('0x11')](socket);function respondWithRpcPromise(_0x39b257,_0x388b27,_0x46a7dc){return new BPromise(function(_0x54c66b,_0x4ff867){return client[_0xcff3('0x12')](_0x39b257,_0x46a7dc)[_0xcff3('0x13')](function(_0x5e64c2){logger[_0xcff3('0x14')](_0xcff3('0x15'),_0x388b27,'request\x20sent');logger[_0xcff3('0x16')](_0xcff3('0x17'),_0x388b27,_0xcff3('0x18'),JSON['stringify'](_0x5e64c2));if(_0x5e64c2[_0xcff3('0x19')]){if(_0x5e64c2['error'][_0xcff3('0x1a')]===0x1f4){logger[_0xcff3('0x19')](_0xcff3('0x15'),_0x388b27,_0x5e64c2['error'][_0xcff3('0x1b')]);return _0x4ff867(_0x5e64c2[_0xcff3('0x19')][_0xcff3('0x1b')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x388b27,_0x5e64c2[_0xcff3('0x19')][_0xcff3('0x1b')]);return _0x54c66b(_0x5e64c2['error'][_0xcff3('0x1b')]);}else{logger[_0xcff3('0x14')](_0xcff3('0x15'),_0x388b27,_0xcff3('0x18'));_0x54c66b(_0x5e64c2[_0xcff3('0x1c')][_0xcff3('0x1b')]);}})['catch'](function(_0x2de7ea){logger['error'](_0xcff3('0x15'),_0x388b27,_0x2de7ea);_0x4ff867(_0x2de7ea);});});}