Built motion from commit 67e5df37.|2.0.66
[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 _0xa9e0=['client','socket.io-emitter','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x0a9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var jayson=require(_0x0a9e('0x7'));var client=jayson[_0x0a9e('0x8')]['http']({'port':0x232a});var socket=require(_0x0a9e('0x9'))({'host':_0x0a9e('0xa'),'port':0x18eb});require(_0x0a9e('0xb'))['register'](socket);function respondWithRpcPromise(_0x503809,_0xe42b77,_0x56465b){return new BPromise(function(_0x52cace,_0x39753a){return client[_0x0a9e('0xc')](_0x503809,_0x56465b)[_0x0a9e('0xd')](function(_0x3ab53f){logger[_0x0a9e('0xe')](_0x0a9e('0xf'),_0xe42b77,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0xe42b77,'request\x20sent',JSON[_0x0a9e('0x10')](_0x3ab53f));if(_0x3ab53f[_0x0a9e('0x11')]){if(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x12')]===0x1f4){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f['error'][_0x0a9e('0x13')]);return _0x39753a(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x13')]);}logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f[_0x0a9e('0x11')]['message']);return _0x52cace(_0x3ab53f[_0x0a9e('0x11')]['message']);}else{logger[_0x0a9e('0xe')]('DashboardItem,\x20%s,\x20%s',_0xe42b77,_0x0a9e('0x14'));_0x52cace(_0x3ab53f[_0x0a9e('0x15')]['message']);}})[_0x0a9e('0x16')](function(_0x5a0a06){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x5a0a06);_0x39753a(_0x5a0a06);});});}