Built motion from commit (unavailable).|2.3.1
[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 _0xc625=['jayson/promise','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xc625,0xc0));var _0x5c62=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xc625[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0x5c62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5c62('0x1'));var fs=require('fs');var Redis=require(_0x5c62('0x2'));var db=require(_0x5c62('0x3'))['db'];var utils=require(_0x5c62('0x4'));var logger=require(_0x5c62('0x5'))(_0x5c62('0x6'));var config=require(_0x5c62('0x7'));var jayson=require(_0x5c62('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5c62('0x9')]=_['defaults'](config['redis'],{'host':_0x5c62('0xa'),'port':0x18eb});var socket=require(_0x5c62('0xb'))(new Redis(config[_0x5c62('0x9')]));require(_0x5c62('0xc'))[_0x5c62('0xd')](socket);function respondWithRpcPromise(_0x163172,_0x58fac9,_0x574ebc){return new BPromise(function(_0x536fc4,_0x4a2fce){return client[_0x5c62('0xe')](_0x163172,_0x574ebc)[_0x5c62('0xf')](function(_0x38231c){logger['info'](_0x5c62('0x10'),_0x58fac9,_0x5c62('0x11'));logger[_0x5c62('0x12')](_0x5c62('0x13'),_0x58fac9,_0x5c62('0x11'),JSON[_0x5c62('0x14')](_0x38231c));if(_0x38231c[_0x5c62('0x15')]){if(_0x38231c[_0x5c62('0x15')]['code']===0x1f4){logger[_0x5c62('0x15')]('DashboardItem,\x20%s,\x20%s',_0x58fac9,_0x38231c[_0x5c62('0x15')][_0x5c62('0x16')]);return _0x4a2fce(_0x38231c[_0x5c62('0x15')][_0x5c62('0x16')]);}logger[_0x5c62('0x15')](_0x5c62('0x10'),_0x58fac9,_0x38231c[_0x5c62('0x15')]['message']);return _0x536fc4(_0x38231c[_0x5c62('0x15')][_0x5c62('0x16')]);}else{logger[_0x5c62('0x17')](_0x5c62('0x10'),_0x58fac9,'request\x20sent');_0x536fc4(_0x38231c[_0x5c62('0x18')]['message']);}})['catch'](function(_0x46588a){logger[_0x5c62('0x15')]('DashboardItem,\x20%s,\x20%s',_0x58fac9,_0x46588a);_0x4a2fce(_0x46588a);});});}