Built motion from commit (unavailable).|2.5.28
[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 _0x5b54=['request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0x504c82,_0x1ee9d7){var _0x7a412e=function(_0x301e5f){while(--_0x301e5f){_0x504c82['push'](_0x504c82['shift']());}};_0x7a412e(++_0x1ee9d7);}(_0x5b54,0x19e));var _0x45b5=function(_0x24500f,_0x5f4887){_0x24500f=_0x24500f-0x0;var _0xcd086f=_0x5b54[_0x24500f];return _0xcd086f;};'use strict';var _=require(_0x45b5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x45b5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45b5('0x2'));var db=require(_0x45b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x45b5('0x4'))(_0x45b5('0x5'));var config=require(_0x45b5('0x6'));var jayson=require(_0x45b5('0x7'));var client=jayson[_0x45b5('0x8')][_0x45b5('0x9')]({'port':0x232a});config[_0x45b5('0xa')]=_[_0x45b5('0xb')](config[_0x45b5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x45b5('0xc'))(new Redis(config[_0x45b5('0xa')]));require(_0x45b5('0xd'))[_0x45b5('0xe')](socket);function respondWithRpcPromise(_0x2c4428,_0xd7f585,_0x3dcf99){return new BPromise(function(_0x45e62f,_0x5e5905){return client[_0x45b5('0xf')](_0x2c4428,_0x3dcf99)['then'](function(_0xcabfe7){logger[_0x45b5('0x10')](_0x45b5('0x11'),_0xd7f585,_0x45b5('0x12'));logger[_0x45b5('0x13')](_0x45b5('0x14'),_0xd7f585,'request\x20sent',JSON[_0x45b5('0x15')](_0xcabfe7));if(_0xcabfe7[_0x45b5('0x16')]){if(_0xcabfe7[_0x45b5('0x16')][_0x45b5('0x17')]===0x1f4){logger[_0x45b5('0x16')]('DashboardItem,\x20%s,\x20%s',_0xd7f585,_0xcabfe7[_0x45b5('0x16')][_0x45b5('0x18')]);return _0x5e5905(_0xcabfe7[_0x45b5('0x16')][_0x45b5('0x18')]);}logger['error'](_0x45b5('0x11'),_0xd7f585,_0xcabfe7[_0x45b5('0x16')][_0x45b5('0x18')]);return _0x45e62f(_0xcabfe7[_0x45b5('0x16')][_0x45b5('0x18')]);}else{logger[_0x45b5('0x10')](_0x45b5('0x11'),_0xd7f585,_0x45b5('0x12'));_0x45e62f(_0xcabfe7[_0x45b5('0x19')]['message']);}})[_0x45b5('0x1a')](function(_0x532691){logger[_0x45b5('0x16')]('DashboardItem,\x20%s,\x20%s',_0xd7f585,_0x532691);_0x5e5905(_0x532691);});});}