Built motion from commit da617fac.|2.6.6
[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 _0xc83a=['jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b03a5,_0x812ea1){var _0x12d60d=function(_0x336667){while(--_0x336667){_0x1b03a5['push'](_0x1b03a5['shift']());}};_0x12d60d(++_0x812ea1);}(_0xc83a,0x10a));var _0xac83=function(_0x44757b,_0x1133d4){_0x44757b=_0x44757b-0x0;var _0x2e53d6=_0xc83a[_0x44757b];return _0x2e53d6;};'use strict';var _=require(_0xac83('0x0'));var util=require('util');var moment=require(_0xac83('0x1'));var BPromise=require(_0xac83('0x2'));var rs=require(_0xac83('0x3'));var fs=require('fs');var Redis=require(_0xac83('0x4'));var db=require(_0xac83('0x5'))['db'];var utils=require(_0xac83('0x6'));var logger=require(_0xac83('0x7'))(_0xac83('0x8'));var config=require(_0xac83('0x9'));var jayson=require(_0xac83('0xa'));var client=jayson['client'][_0xac83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1351a2,_0x43a764,_0x442ffb){return new BPromise(function(_0x5c7679,_0x27ec9a){return client[_0xac83('0xc')](_0x1351a2,_0x442ffb)[_0xac83('0xd')](function(_0xc1e695){logger[_0xac83('0xe')](_0xac83('0xf'),_0x43a764,_0xac83('0x10'));logger[_0xac83('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'),JSON['stringify'](_0xc1e695));if(_0xc1e695['error']){if(_0xc1e695[_0xac83('0x12')][_0xac83('0x13')]===0x1f4){logger[_0xac83('0x12')](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')]['message']);return _0x27ec9a(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}logger['error'](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);return _0x5c7679(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}else{logger[_0xac83('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'));_0x5c7679(_0xc1e695[_0xac83('0x15')][_0xac83('0x14')]);}})[_0xac83('0x16')](function(_0x14ebeb){logger[_0xac83('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0x14ebeb);_0x27ec9a(_0x14ebeb);});});}