a65a4915e8832486699a2e5ee68f27d7fc7fb4a2
[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 _0x9f13=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x18c743,_0x206e0d){var _0x2a4351=function(_0x399eb7){while(--_0x399eb7){_0x18c743['push'](_0x18c743['shift']());}};_0x2a4351(++_0x206e0d);}(_0x9f13,0x15f));var _0x39f1=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x9f13[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x39f1('0x0'));var util=require(_0x39f1('0x1'));var moment=require(_0x39f1('0x2'));var BPromise=require(_0x39f1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39f1('0x4'))['db'];var utils=require(_0x39f1('0x5'));var logger=require(_0x39f1('0x6'))(_0x39f1('0x7'));var config=require(_0x39f1('0x8'));var jayson=require(_0x39f1('0x9'));var client=jayson['client'][_0x39f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x495993,_0xbbde8f,_0x52d3fa){return new BPromise(function(_0x55db4b,_0x4c0fa5){return client[_0x39f1('0xb')](_0x495993,_0x52d3fa)[_0x39f1('0xc')](function(_0x5391da){logger[_0x39f1('0xd')](_0x39f1('0xe'),_0xbbde8f,'request\x20sent');logger[_0x39f1('0xf')](_0x39f1('0x10'),_0xbbde8f,_0x39f1('0x11'),JSON['stringify'](_0x5391da));if(_0x5391da[_0x39f1('0x12')]){if(_0x5391da[_0x39f1('0x12')][_0x39f1('0x13')]===0x1f4){logger[_0x39f1('0x12')](_0x39f1('0xe'),_0xbbde8f,_0x5391da['error'][_0x39f1('0x14')]);return _0x4c0fa5(_0x5391da['error'][_0x39f1('0x14')]);}logger[_0x39f1('0x12')](_0x39f1('0xe'),_0xbbde8f,_0x5391da['error']['message']);return _0x55db4b(_0x5391da['error'][_0x39f1('0x14')]);}else{logger[_0x39f1('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0xbbde8f,_0x39f1('0x11'));_0x55db4b(_0x5391da[_0x39f1('0x15')][_0x39f1('0x14')]);}})[_0x39f1('0x16')](function(_0x37bd6e){logger[_0x39f1('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0xbbde8f,_0x37bd6e);_0x4c0fa5(_0x37bd6e);});});}