* feat(DB): rearranged queries feat(DB): ready for v1.15.0 * refactor(chalice): upgraded dependencies refactor(crons): upgraded dependencies refactor(alerts): upgraded dependencies * fix(chalice): return error when updating inexistant webhook * feat(chalice): fixed delete webhook response * feat(chalice): limit webhooks name length * feat(chalice): upgraded dependencies feat(alerts): upgraded dependencies feat(crons): upgraded dependencies * fix(chalice): remove urllib3 dependency * feat(chalice): remove FOSS to pydantic v2 * fix(chalice): freeze urllib3 to not have conflicts between boto3 and requests * feat(chalice): refactoring schema in progress * feat(chalice): refactoring schema in progress * feat(chalice): refactoring schema in progress * feat(chalice): refactoring schema in progress feat(chalice): upgraded dependencies * feat(chalice): refactored schema * fix(chalice): pull rebase dev * feat(DB): transfer size support * feat(chalice): support service account * feat(chalice): support service account * fix(chalice): fixed refactored PayloadSchema-name * feat(chalice): path analysis * feat(chalice): support service account 1/2 * feat(DB): timezone support * feat(chalice): upgraded dependencies feat(alerts): upgraded dependencies feat(crons): upgraded dependencies feat(assist): upgraded dependencies feat(sourcemaps): upgraded dependencies * feat(chalice): path analysis schema changes * feat(chalice): path analysis query change * feat(chalice): path analysis query change * feat(chalice): ios replay support * feat(chalice): ios replay support * feat(chalice): path analysis changes * feat(chalice): upgraded dependencies * feat(chalice): simple hide minor paths * feat(chalice): path analysis density * feat(chalice): session's replay ios events * feat(chalice): fixed typo * feat(chalice): support project's platform * feat(DB): support project's platform * feat(chalice): path analysis EE in progress * feat(chalice): project's platform API * feat(chalice): fixed create project * feat(chalice): EE path analysis in progress * feat(chalice): EE path analysis refactor(chalice): support specific database name for clickhouse-client * feat(chalice): upgraded dependencies feat(chalice): path analysis specific event type for startPoint feat(chalice): path analysis specific event type for endPoint feat(chalice): path analysis specific event type for exclude * refactoring(chalice): changed IOS click event type
109 lines
6 KiB
Python
109 lines
6 KiB
Python
from fastapi import Body
|
|
|
|
import schemas
|
|
from chalicelib.core import product_analytics
|
|
from or_dependencies import OR_scope
|
|
from routers.base import get_routers
|
|
|
|
public_app, app, app_apikey = get_routers([OR_scope(schemas.Permissions.metrics)])
|
|
|
|
|
|
@app.post('/{projectId}/insights/journey', tags=["insights"])
|
|
@app.get('/{projectId}/insights/journey', tags=["insights"])
|
|
async def get_insights_journey(projectId: int, data: schemas.PathAnalysisSchema = Body(...)):
|
|
return {"data": product_analytics.path_analysis(project_id=projectId, **data.dict())}
|
|
|
|
# @app.post('/{projectId}/insights/users_acquisition', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/users_acquisition', tags=["insights"])
|
|
# async def get_users_acquisition(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.users_acquisition(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/users_retention', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/users_retention', tags=["insights"])
|
|
# async def get_users_retention(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.users_retention(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/feature_retention', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/feature_retention', tags=["insights"])
|
|
# async def get_feature_rentention(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.feature_retention(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/feature_acquisition', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/feature_acquisition', tags=["insights"])
|
|
# async def get_feature_acquisition(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.feature_acquisition(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/feature_popularity_frequency', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/feature_popularity_frequency', tags=["insights"])
|
|
# async def get_feature_popularity_frequency(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.feature_popularity_frequency(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/feature_intensity', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/feature_intensity', tags=["insights"])
|
|
# async def get_feature_intensity(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.feature_intensity(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/feature_adoption', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/feature_adoption', tags=["insights"])
|
|
# async def get_feature_adoption(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.feature_adoption(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/feature_adoption_top_users', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/feature_adoption_top_users', tags=["insights"])
|
|
# async def get_feature_adoption(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.feature_adoption_top_users(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/users_active', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/users_active', tags=["insights"])
|
|
# async def get_users_active(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.users_active(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/users_power', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/users_power', tags=["insights"])
|
|
# async def get_users_power(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.users_power(project_id=projectId, **data.dict())}
|
|
#
|
|
#
|
|
# @app.post('/{projectId}/insights/users_slipping', tags=["insights"])
|
|
# @app.get('/{projectId}/insights/users_slipping', tags=["insights"])
|
|
# async def get_users_slipping(projectId: int, data: schemas.MetricPayloadSchema = Body(...)):
|
|
# return {"data": product_analytics.users_slipping(project_id=projectId, **data.dict())}
|
|
|
|
|
|
#
|
|
#
|
|
# @app.route('/{projectId}/dashboard/{widget}/search', methods=['GET'])
|
|
# async def get_dashboard_autocomplete(projectId:int, widget):
|
|
# params = app.current_request.query_params
|
|
# if params is None or params.get('q') is None or len(params.get('q')) == 0:
|
|
# return {"data": []}
|
|
# params['q'] = '^' + params['q']
|
|
#
|
|
# if widget in ['performance']:
|
|
# data = dashboard.search(params.get('q', ''), params.get('type', ''), project_id=projectId,
|
|
# platform=params.get('platform', None), performance=True)
|
|
# elif widget in ['pages', 'pages_dom_buildtime', 'top_metrics', 'time_to_render',
|
|
# 'impacted_sessions_by_slow_pages', 'pages_response_time']:
|
|
# data = dashboard.search(params.get('q', ''), params.get('type', ''), project_id=projectId,
|
|
# platform=params.get('platform', None), pages_only=True)
|
|
# elif widget in ['resources_loading_time']:
|
|
# data = dashboard.search(params.get('q', ''), params.get('type', ''), project_id=projectId,
|
|
# platform=params.get('platform', None), performance=False)
|
|
# elif widget in ['time_between_events', 'events']:
|
|
# data = dashboard.search(params.get('q', ''), params.get('type', ''), project_id=projectId,
|
|
# platform=params.get('platform', None), performance=False, events_only=True)
|
|
# elif widget in ['metadata']:
|
|
# data = dashboard.search(params.get('q', ''), None, project_id=projectId,
|
|
# platform=params.get('platform', None), metadata=True, key=params.get("key"))
|
|
# else:
|
|
# return {"errors": [f"unsupported widget: {widget}"]}
|
|
# return {'data': data}
|