wedance-shared 1.0.172 → 1.0.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/analytics.d.ts +102 -0
- package/package.json +1 -1
|
@@ -31,3 +31,105 @@ export type DailyAnalyticsReport = {
|
|
|
31
31
|
startDate: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
/** Query params for GET /analytics/overview. */
|
|
35
|
+
export interface AnalyticsOverviewQuery {
|
|
36
|
+
/** UTC day to report on, `YYYY-MM-DD`. Defaults to today (UTC). */
|
|
37
|
+
date?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Per-day platform counts, computed over a UTC day. */
|
|
40
|
+
export interface AnalyticsDailyStats {
|
|
41
|
+
activeUsers: number;
|
|
42
|
+
newUsers: number;
|
|
43
|
+
purchasedTickets: number;
|
|
44
|
+
newEvents: number;
|
|
45
|
+
}
|
|
46
|
+
/** All-time platform counts. */
|
|
47
|
+
export interface AnalyticsTotals {
|
|
48
|
+
users: number;
|
|
49
|
+
tickets: number;
|
|
50
|
+
events: number;
|
|
51
|
+
}
|
|
52
|
+
export interface AnalyticsOverviewResponse {
|
|
53
|
+
/** The reported UTC day, `YYYY-MM-DD`. */
|
|
54
|
+
date: string;
|
|
55
|
+
daily: AnalyticsDailyStats;
|
|
56
|
+
totals: AnalyticsTotals;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Inclusive day range, `YYYY-MM-DD`. Both params are optional: omitting
|
|
60
|
+
* `endDate` uses today, omitting `startDate` goes back 28 days (today
|
|
61
|
+
* included). The range must not exceed 90 days.
|
|
62
|
+
*/
|
|
63
|
+
export interface AnalyticsDateRangeQuery {
|
|
64
|
+
startDate?: string;
|
|
65
|
+
endDate?: string;
|
|
66
|
+
}
|
|
67
|
+
export type AnalyticsDailyStatsQuery = AnalyticsDateRangeQuery;
|
|
68
|
+
/** One UTC day of platform counts. */
|
|
69
|
+
export interface AnalyticsDailyStatsPoint extends AnalyticsDailyStats {
|
|
70
|
+
/** `YYYY-MM-DD`. */
|
|
71
|
+
date: string;
|
|
72
|
+
}
|
|
73
|
+
export interface AnalyticsDailyStatsResponse {
|
|
74
|
+
startDate: string;
|
|
75
|
+
endDate: string;
|
|
76
|
+
/**
|
|
77
|
+
* Oldest snapshotted day, or null when nothing has been captured yet. Days in
|
|
78
|
+
* the requested range before it read as zeroes because no data was recorded,
|
|
79
|
+
* not because nobody connected.
|
|
80
|
+
*/
|
|
81
|
+
firstSnapshotDate: string | null;
|
|
82
|
+
/** Ascending, one entry per day in the range — missing days are zeroes. */
|
|
83
|
+
byDate: AnalyticsDailyStatsPoint[];
|
|
84
|
+
}
|
|
85
|
+
export interface TopEventViewsQuery extends AnalyticsDateRangeQuery {
|
|
86
|
+
/** Integer between 1 and 100. Defaults to 20. */
|
|
87
|
+
limit?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface TopEventViewsItem {
|
|
90
|
+
eventId: string;
|
|
91
|
+
/** Null when the id no longer resolves to an event (deleted, or a stale client build). */
|
|
92
|
+
title: string | null;
|
|
93
|
+
/** Counts presses of `press_event`, not unique viewers. */
|
|
94
|
+
views: number;
|
|
95
|
+
users: number;
|
|
96
|
+
}
|
|
97
|
+
export interface TopEventViewsResponse {
|
|
98
|
+
startDate: string;
|
|
99
|
+
endDate: string;
|
|
100
|
+
events: TopEventViewsItem[];
|
|
101
|
+
/** GA's `(other)` bucket, or null when it did not bucket anything. */
|
|
102
|
+
otherViews: number | null;
|
|
103
|
+
}
|
|
104
|
+
export type EventViewsQuery = AnalyticsDateRangeQuery;
|
|
105
|
+
export interface EventViewsTotals {
|
|
106
|
+
/** Counts presses of `press_event`, not unique viewers. */
|
|
107
|
+
views: number;
|
|
108
|
+
users: number;
|
|
109
|
+
}
|
|
110
|
+
export interface EventViewsByEntryPoint {
|
|
111
|
+
/** `"unknown"` when the client omitted `entry_point`. */
|
|
112
|
+
entryPoint: string;
|
|
113
|
+
views: number;
|
|
114
|
+
users: number;
|
|
115
|
+
}
|
|
116
|
+
export interface EventViewsByDate {
|
|
117
|
+
/** `YYYY-MM-DD`. */
|
|
118
|
+
date: string;
|
|
119
|
+
views: number;
|
|
120
|
+
users: number;
|
|
121
|
+
}
|
|
122
|
+
export interface EventViewsResponse {
|
|
123
|
+
eventId: string;
|
|
124
|
+
eventTitle: string;
|
|
125
|
+
startDate: string;
|
|
126
|
+
endDate: string;
|
|
127
|
+
totals: EventViewsTotals;
|
|
128
|
+
byEntryPoint: EventViewsByEntryPoint[];
|
|
129
|
+
/** Ascending, one entry per day in the range — days with no data are zeroes. */
|
|
130
|
+
byDate: EventViewsByDate[];
|
|
131
|
+
}
|
|
132
|
+
/** Error body shape returned by the analytics endpoints (400/403/404/5xx). */
|
|
133
|
+
export interface AnalyticsErrorResponse {
|
|
134
|
+
error: string;
|
|
135
|
+
}
|
package/package.json
CHANGED