feat: add analytics metric granularity query
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-05-04 16:29:11 +08:00
parent 44d9bd55de
commit 1d9d8c2e41
19 changed files with 787 additions and 7 deletions

View File

@@ -189,6 +189,7 @@ export type RedeemProfileRewardCodeResponse = {
export type ProfileTaskCycle = 'daily';
export type TrackingScopeKind = 'site' | 'work' | 'module' | 'user';
export type AnalyticsGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year';
export type ProfileTaskStatus =
| 'incomplete'
| 'claimable'
@@ -247,6 +248,24 @@ export type ProfileTaskConfigAdminListResponse = {
entries: ProfileTaskConfigAdminResponse[];
};
export type AnalyticsMetricQueryRequest = {
eventKey: string;
scopeKind: TrackingScopeKind;
scopeId: string;
granularity: AnalyticsGranularity;
};
export type AnalyticsBucketMetric = {
bucketKey: string;
bucketStartDateKey: number;
bucketEndDateKey: number;
value: number;
};
export type AnalyticsMetricQueryResponse = {
buckets: AnalyticsBucketMetric[];
};
export type AdminUpsertProfileTaskConfigRequest = {
taskId: string;
title: string;