Built motion from commit a679711e.|2.6.15
[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 _0x76be=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3f263e,_0x399e91){var _0x1b7e07=function(_0x303ee3){while(--_0x303ee3){_0x3f263e['push'](_0x3f263e['shift']());}};_0x1b7e07(++_0x399e91);}(_0x76be,0xa0));var _0xe76b=function(_0x3c12d9,_0x137698){_0x3c12d9=_0x3c12d9-0x0;var _0x58e569=_0x76be[_0x3c12d9];return _0x58e569;};'use strict';var _=require(_0xe76b('0x0'));var util=require(_0xe76b('0x1'));var moment=require(_0xe76b('0x2'));var BPromise=require(_0xe76b('0x3'));var rs=require(_0xe76b('0x4'));var fs=require('fs');var Redis=require(_0xe76b('0x5'));var db=require(_0xe76b('0x6'))['db'];var utils=require(_0xe76b('0x7'));var logger=require(_0xe76b('0x8'))(_0xe76b('0x9'));var config=require(_0xe76b('0xa'));var jayson=require(_0xe76b('0xb'));var client=jayson[_0xe76b('0xc')][_0xe76b('0xd')]({'port':0x232a});config[_0xe76b('0xe')]=_[_0xe76b('0xf')](config[_0xe76b('0xe')],{'host':_0xe76b('0x10'),'port':0x18eb});var socket=require(_0xe76b('0x11'))(new Redis(config[_0xe76b('0xe')]));require(_0xe76b('0x12'))[_0xe76b('0x13')](socket);function respondWithRpcPromise(_0x301042,_0x4768f0,_0x147df8){return new BPromise(function(_0x325e22,_0x19740a){return client['request'](_0x301042,_0x147df8)[_0xe76b('0x14')](function(_0x9e4139){logger['info'](_0xe76b('0x15'),_0x4768f0,_0xe76b('0x16'));logger[_0xe76b('0x17')](_0xe76b('0x18'),_0x4768f0,_0xe76b('0x16'),JSON[_0xe76b('0x19')](_0x9e4139));if(_0x9e4139[_0xe76b('0x1a')]){if(_0x9e4139['error'][_0xe76b('0x1b')]===0x1f4){logger[_0xe76b('0x1a')](_0xe76b('0x15'),_0x4768f0,_0x9e4139['error'][_0xe76b('0x1c')]);return _0x19740a(_0x9e4139[_0xe76b('0x1a')][_0xe76b('0x1c')]);}logger['error'](_0xe76b('0x15'),_0x4768f0,_0x9e4139[_0xe76b('0x1a')][_0xe76b('0x1c')]);return _0x325e22(_0x9e4139[_0xe76b('0x1a')]['message']);}else{logger[_0xe76b('0x1d')](_0xe76b('0x15'),_0x4768f0,_0xe76b('0x16'));_0x325e22(_0x9e4139[_0xe76b('0x1e')][_0xe76b('0x1c')]);}})[_0xe76b('0x1f')](function(_0x1aa62e){logger[_0xe76b('0x1a')](_0xe76b('0x15'),_0x4768f0,_0x1aa62e);_0x19740a(_0x1aa62e);});});}