Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / analyticMetric / analyticMetric.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 _0xe49c=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe49c,0x91));var _0xce49=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0xe49c[_0x21233e];return _0x3752c9;};'use strict';var _=require(_0xce49('0x0'));var util=require(_0xce49('0x1'));var moment=require('moment');var BPromise=require(_0xce49('0x2'));var rs=require(_0xce49('0x3'));var fs=require('fs');var Redis=require(_0xce49('0x4'));var db=require(_0xce49('0x5'))['db'];var utils=require(_0xce49('0x6'));var logger=require(_0xce49('0x7'))(_0xce49('0x8'));var config=require(_0xce49('0x9'));var jayson=require(_0xce49('0xa'));var client=jayson[_0xce49('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b5f1,_0x4f457f,_0x3ac821){return new BPromise(function(_0x2a5bad,_0x3586ab){return client[_0xce49('0xc')](_0x59b5f1,_0x3ac821)['then'](function(_0xdaf557){logger[_0xce49('0xd')](_0xce49('0xe'),_0x4f457f,_0xce49('0xf'));logger[_0xce49('0x10')](_0xce49('0x11'),_0x4f457f,_0xce49('0xf'),JSON[_0xce49('0x12')](_0xdaf557));if(_0xdaf557[_0xce49('0x13')]){if(_0xdaf557[_0xce49('0x13')][_0xce49('0x14')]===0x1f4){logger[_0xce49('0x13')](_0xce49('0xe'),_0x4f457f,_0xdaf557[_0xce49('0x13')][_0xce49('0x15')]);return _0x3586ab(_0xdaf557['error'][_0xce49('0x15')]);}logger[_0xce49('0x13')](_0xce49('0xe'),_0x4f457f,_0xdaf557[_0xce49('0x13')]['message']);return _0x2a5bad(_0xdaf557['error']['message']);}else{logger[_0xce49('0xd')](_0xce49('0xe'),_0x4f457f,'request\x20sent');_0x2a5bad(_0xdaf557[_0xce49('0x16')]['message']);}})['catch'](function(_0x1b80c2){logger[_0xce49('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4f457f,_0x1b80c2);_0x3586ab(_0x1b80c2);});});}