@junobuild/analytics 0.0.16 → 0.0.17-next-2024-01-30
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/declarations/orbiter/orbiter.did.d.ts +42 -0
- package/declarations/orbiter/orbiter.factory.did.js +48 -0
- package/dist/declarations/orbiter/orbiter.did.d.ts +42 -0
- package/dist/declarations/orbiter/orbiter.factory.did.js +48 -0
- package/dist/types/types/env.d.ts +1 -1
- package/dist/workers/analytics.worker.js +14 -14
- package/dist/workers/analytics.worker.js.map +3 -3
- package/package.json +2 -2
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
+
import type {IDL} from '@dfinity/candid';
|
|
2
3
|
import type {Principal} from '@dfinity/principal';
|
|
3
4
|
|
|
4
5
|
export interface AnalyticKey {
|
|
5
6
|
key: string;
|
|
6
7
|
collected_at: bigint;
|
|
7
8
|
}
|
|
9
|
+
export interface AnalyticsBrowsersPageViews {
|
|
10
|
+
safari: number;
|
|
11
|
+
opera: number;
|
|
12
|
+
others: number;
|
|
13
|
+
firefox: number;
|
|
14
|
+
chrome: number;
|
|
15
|
+
}
|
|
16
|
+
export interface AnalyticsClientsPageViews {
|
|
17
|
+
browsers: AnalyticsBrowsersPageViews;
|
|
18
|
+
devices: AnalyticsDevicesPageViews;
|
|
19
|
+
}
|
|
20
|
+
export interface AnalyticsDevicesPageViews {
|
|
21
|
+
desktop: number;
|
|
22
|
+
others: number;
|
|
23
|
+
mobile: number;
|
|
24
|
+
}
|
|
25
|
+
export interface AnalyticsMetricsPageViews {
|
|
26
|
+
bounce_rate: number;
|
|
27
|
+
average_page_views_per_session: number;
|
|
28
|
+
daily_total_page_views: Array<[CalendarDate, number]>;
|
|
29
|
+
total_page_views: number;
|
|
30
|
+
unique_page_views: bigint;
|
|
31
|
+
unique_sessions: bigint;
|
|
32
|
+
}
|
|
33
|
+
export interface AnalyticsTop10PageViews {
|
|
34
|
+
referrers: Array<[string, number]>;
|
|
35
|
+
pages: Array<[string, number]>;
|
|
36
|
+
}
|
|
37
|
+
export interface AnalyticsTrackEvents {
|
|
38
|
+
total: Array<[string, number]>;
|
|
39
|
+
}
|
|
40
|
+
export interface CalendarDate {
|
|
41
|
+
day: number;
|
|
42
|
+
month: number;
|
|
43
|
+
year: number;
|
|
44
|
+
}
|
|
8
45
|
export interface Controller {
|
|
9
46
|
updated_at: bigint;
|
|
10
47
|
metadata: Array<[string, string]>;
|
|
@@ -101,7 +138,11 @@ export interface _SERVICE {
|
|
|
101
138
|
del_satellite_config: ActorMethod<[Principal, DelSatelliteConfig], undefined>;
|
|
102
139
|
deposit_cycles: ActorMethod<[DepositCyclesArgs], undefined>;
|
|
103
140
|
get_page_views: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PageView]>>;
|
|
141
|
+
get_page_views_analytics_clients: ActorMethod<[GetAnalytics], AnalyticsClientsPageViews>;
|
|
142
|
+
get_page_views_analytics_metrics: ActorMethod<[GetAnalytics], AnalyticsMetricsPageViews>;
|
|
143
|
+
get_page_views_analytics_top_10: ActorMethod<[GetAnalytics], AnalyticsTop10PageViews>;
|
|
104
144
|
get_track_events: ActorMethod<[GetAnalytics], Array<[AnalyticKey, TrackEvent]>>;
|
|
145
|
+
get_track_events_analytics: ActorMethod<[GetAnalytics], AnalyticsTrackEvents>;
|
|
105
146
|
list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
|
|
106
147
|
list_satellite_configs: ActorMethod<[], Array<[Principal, OrbiterSatelliteConfig]>>;
|
|
107
148
|
memory_size: ActorMethod<[], MemorySize>;
|
|
@@ -116,3 +157,4 @@ export interface _SERVICE {
|
|
|
116
157
|
set_track_events: ActorMethod<[Array<[AnalyticKey, SetTrackEvent]>], Result_1>;
|
|
117
158
|
version: ActorMethod<[], string>;
|
|
118
159
|
}
|
|
160
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
@@ -44,6 +44,39 @@ export const idlFactory = ({IDL}) => {
|
|
|
44
44
|
device: PageViewDevice,
|
|
45
45
|
user_agent: IDL.Opt(IDL.Text)
|
|
46
46
|
});
|
|
47
|
+
const AnalyticsBrowsersPageViews = IDL.Record({
|
|
48
|
+
safari: IDL.Float64,
|
|
49
|
+
opera: IDL.Float64,
|
|
50
|
+
others: IDL.Float64,
|
|
51
|
+
firefox: IDL.Float64,
|
|
52
|
+
chrome: IDL.Float64
|
|
53
|
+
});
|
|
54
|
+
const AnalyticsDevicesPageViews = IDL.Record({
|
|
55
|
+
desktop: IDL.Float64,
|
|
56
|
+
others: IDL.Float64,
|
|
57
|
+
mobile: IDL.Float64
|
|
58
|
+
});
|
|
59
|
+
const AnalyticsClientsPageViews = IDL.Record({
|
|
60
|
+
browsers: AnalyticsBrowsersPageViews,
|
|
61
|
+
devices: AnalyticsDevicesPageViews
|
|
62
|
+
});
|
|
63
|
+
const CalendarDate = IDL.Record({
|
|
64
|
+
day: IDL.Nat8,
|
|
65
|
+
month: IDL.Nat8,
|
|
66
|
+
year: IDL.Int32
|
|
67
|
+
});
|
|
68
|
+
const AnalyticsMetricsPageViews = IDL.Record({
|
|
69
|
+
bounce_rate: IDL.Float64,
|
|
70
|
+
average_page_views_per_session: IDL.Float64,
|
|
71
|
+
daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),
|
|
72
|
+
total_page_views: IDL.Nat32,
|
|
73
|
+
unique_page_views: IDL.Nat64,
|
|
74
|
+
unique_sessions: IDL.Nat64
|
|
75
|
+
});
|
|
76
|
+
const AnalyticsTop10PageViews = IDL.Record({
|
|
77
|
+
referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),
|
|
78
|
+
pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))
|
|
79
|
+
});
|
|
47
80
|
const TrackEvent = IDL.Record({
|
|
48
81
|
updated_at: IDL.Nat64,
|
|
49
82
|
session_id: IDL.Text,
|
|
@@ -52,6 +85,9 @@ export const idlFactory = ({IDL}) => {
|
|
|
52
85
|
created_at: IDL.Nat64,
|
|
53
86
|
satellite_id: IDL.Principal
|
|
54
87
|
});
|
|
88
|
+
const AnalyticsTrackEvents = IDL.Record({
|
|
89
|
+
total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))
|
|
90
|
+
});
|
|
55
91
|
const OrbiterSatelliteConfig = IDL.Record({
|
|
56
92
|
updated_at: IDL.Nat64,
|
|
57
93
|
created_at: IDL.Nat64,
|
|
@@ -109,11 +145,23 @@ export const idlFactory = ({IDL}) => {
|
|
|
109
145
|
[IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],
|
|
110
146
|
['query']
|
|
111
147
|
),
|
|
148
|
+
get_page_views_analytics_clients: IDL.Func(
|
|
149
|
+
[GetAnalytics],
|
|
150
|
+
[AnalyticsClientsPageViews],
|
|
151
|
+
['query']
|
|
152
|
+
),
|
|
153
|
+
get_page_views_analytics_metrics: IDL.Func(
|
|
154
|
+
[GetAnalytics],
|
|
155
|
+
[AnalyticsMetricsPageViews],
|
|
156
|
+
['query']
|
|
157
|
+
),
|
|
158
|
+
get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], ['query']),
|
|
112
159
|
get_track_events: IDL.Func(
|
|
113
160
|
[GetAnalytics],
|
|
114
161
|
[IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],
|
|
115
162
|
['query']
|
|
116
163
|
),
|
|
164
|
+
get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], ['query']),
|
|
117
165
|
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
|
|
118
166
|
list_satellite_configs: IDL.Func(
|
|
119
167
|
[],
|
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
+
import type {IDL} from '@dfinity/candid';
|
|
2
3
|
import type {Principal} from '@dfinity/principal';
|
|
3
4
|
|
|
4
5
|
export interface AnalyticKey {
|
|
5
6
|
key: string;
|
|
6
7
|
collected_at: bigint;
|
|
7
8
|
}
|
|
9
|
+
export interface AnalyticsBrowsersPageViews {
|
|
10
|
+
safari: number;
|
|
11
|
+
opera: number;
|
|
12
|
+
others: number;
|
|
13
|
+
firefox: number;
|
|
14
|
+
chrome: number;
|
|
15
|
+
}
|
|
16
|
+
export interface AnalyticsClientsPageViews {
|
|
17
|
+
browsers: AnalyticsBrowsersPageViews;
|
|
18
|
+
devices: AnalyticsDevicesPageViews;
|
|
19
|
+
}
|
|
20
|
+
export interface AnalyticsDevicesPageViews {
|
|
21
|
+
desktop: number;
|
|
22
|
+
others: number;
|
|
23
|
+
mobile: number;
|
|
24
|
+
}
|
|
25
|
+
export interface AnalyticsMetricsPageViews {
|
|
26
|
+
bounce_rate: number;
|
|
27
|
+
average_page_views_per_session: number;
|
|
28
|
+
daily_total_page_views: Array<[CalendarDate, number]>;
|
|
29
|
+
total_page_views: number;
|
|
30
|
+
unique_page_views: bigint;
|
|
31
|
+
unique_sessions: bigint;
|
|
32
|
+
}
|
|
33
|
+
export interface AnalyticsTop10PageViews {
|
|
34
|
+
referrers: Array<[string, number]>;
|
|
35
|
+
pages: Array<[string, number]>;
|
|
36
|
+
}
|
|
37
|
+
export interface AnalyticsTrackEvents {
|
|
38
|
+
total: Array<[string, number]>;
|
|
39
|
+
}
|
|
40
|
+
export interface CalendarDate {
|
|
41
|
+
day: number;
|
|
42
|
+
month: number;
|
|
43
|
+
year: number;
|
|
44
|
+
}
|
|
8
45
|
export interface Controller {
|
|
9
46
|
updated_at: bigint;
|
|
10
47
|
metadata: Array<[string, string]>;
|
|
@@ -101,7 +138,11 @@ export interface _SERVICE {
|
|
|
101
138
|
del_satellite_config: ActorMethod<[Principal, DelSatelliteConfig], undefined>;
|
|
102
139
|
deposit_cycles: ActorMethod<[DepositCyclesArgs], undefined>;
|
|
103
140
|
get_page_views: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PageView]>>;
|
|
141
|
+
get_page_views_analytics_clients: ActorMethod<[GetAnalytics], AnalyticsClientsPageViews>;
|
|
142
|
+
get_page_views_analytics_metrics: ActorMethod<[GetAnalytics], AnalyticsMetricsPageViews>;
|
|
143
|
+
get_page_views_analytics_top_10: ActorMethod<[GetAnalytics], AnalyticsTop10PageViews>;
|
|
104
144
|
get_track_events: ActorMethod<[GetAnalytics], Array<[AnalyticKey, TrackEvent]>>;
|
|
145
|
+
get_track_events_analytics: ActorMethod<[GetAnalytics], AnalyticsTrackEvents>;
|
|
105
146
|
list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
|
|
106
147
|
list_satellite_configs: ActorMethod<[], Array<[Principal, OrbiterSatelliteConfig]>>;
|
|
107
148
|
memory_size: ActorMethod<[], MemorySize>;
|
|
@@ -116,3 +157,4 @@ export interface _SERVICE {
|
|
|
116
157
|
set_track_events: ActorMethod<[Array<[AnalyticKey, SetTrackEvent]>], Result_1>;
|
|
117
158
|
version: ActorMethod<[], string>;
|
|
118
159
|
}
|
|
160
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
@@ -44,6 +44,39 @@ export const idlFactory = ({IDL}) => {
|
|
|
44
44
|
device: PageViewDevice,
|
|
45
45
|
user_agent: IDL.Opt(IDL.Text)
|
|
46
46
|
});
|
|
47
|
+
const AnalyticsBrowsersPageViews = IDL.Record({
|
|
48
|
+
safari: IDL.Float64,
|
|
49
|
+
opera: IDL.Float64,
|
|
50
|
+
others: IDL.Float64,
|
|
51
|
+
firefox: IDL.Float64,
|
|
52
|
+
chrome: IDL.Float64
|
|
53
|
+
});
|
|
54
|
+
const AnalyticsDevicesPageViews = IDL.Record({
|
|
55
|
+
desktop: IDL.Float64,
|
|
56
|
+
others: IDL.Float64,
|
|
57
|
+
mobile: IDL.Float64
|
|
58
|
+
});
|
|
59
|
+
const AnalyticsClientsPageViews = IDL.Record({
|
|
60
|
+
browsers: AnalyticsBrowsersPageViews,
|
|
61
|
+
devices: AnalyticsDevicesPageViews
|
|
62
|
+
});
|
|
63
|
+
const CalendarDate = IDL.Record({
|
|
64
|
+
day: IDL.Nat8,
|
|
65
|
+
month: IDL.Nat8,
|
|
66
|
+
year: IDL.Int32
|
|
67
|
+
});
|
|
68
|
+
const AnalyticsMetricsPageViews = IDL.Record({
|
|
69
|
+
bounce_rate: IDL.Float64,
|
|
70
|
+
average_page_views_per_session: IDL.Float64,
|
|
71
|
+
daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),
|
|
72
|
+
total_page_views: IDL.Nat32,
|
|
73
|
+
unique_page_views: IDL.Nat64,
|
|
74
|
+
unique_sessions: IDL.Nat64
|
|
75
|
+
});
|
|
76
|
+
const AnalyticsTop10PageViews = IDL.Record({
|
|
77
|
+
referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),
|
|
78
|
+
pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))
|
|
79
|
+
});
|
|
47
80
|
const TrackEvent = IDL.Record({
|
|
48
81
|
updated_at: IDL.Nat64,
|
|
49
82
|
session_id: IDL.Text,
|
|
@@ -52,6 +85,9 @@ export const idlFactory = ({IDL}) => {
|
|
|
52
85
|
created_at: IDL.Nat64,
|
|
53
86
|
satellite_id: IDL.Principal
|
|
54
87
|
});
|
|
88
|
+
const AnalyticsTrackEvents = IDL.Record({
|
|
89
|
+
total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))
|
|
90
|
+
});
|
|
55
91
|
const OrbiterSatelliteConfig = IDL.Record({
|
|
56
92
|
updated_at: IDL.Nat64,
|
|
57
93
|
created_at: IDL.Nat64,
|
|
@@ -109,11 +145,23 @@ export const idlFactory = ({IDL}) => {
|
|
|
109
145
|
[IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],
|
|
110
146
|
['query']
|
|
111
147
|
),
|
|
148
|
+
get_page_views_analytics_clients: IDL.Func(
|
|
149
|
+
[GetAnalytics],
|
|
150
|
+
[AnalyticsClientsPageViews],
|
|
151
|
+
['query']
|
|
152
|
+
),
|
|
153
|
+
get_page_views_analytics_metrics: IDL.Func(
|
|
154
|
+
[GetAnalytics],
|
|
155
|
+
[AnalyticsMetricsPageViews],
|
|
156
|
+
['query']
|
|
157
|
+
),
|
|
158
|
+
get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], ['query']),
|
|
112
159
|
get_track_events: IDL.Func(
|
|
113
160
|
[GetAnalytics],
|
|
114
161
|
[IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],
|
|
115
162
|
['query']
|
|
116
163
|
),
|
|
164
|
+
get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], ['query']),
|
|
117
165
|
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
|
|
118
166
|
list_satellite_configs: IDL.Func(
|
|
119
167
|
[],
|
|
@@ -6,7 +6,7 @@ export interface EnvironmentWorker {
|
|
|
6
6
|
export type EnvironmentActor = {
|
|
7
7
|
orbiterId: string;
|
|
8
8
|
satelliteId: string;
|
|
9
|
-
container?: boolean |
|
|
9
|
+
container?: boolean | string;
|
|
10
10
|
};
|
|
11
11
|
export type Environment = EnvironmentActor & {
|
|
12
12
|
worker?: EnvironmentWorker;
|