@junobuild/ic-client 0.0.1
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/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/declarations/console/console.did.d.ts +311 -0
- package/dist/declarations/console/console.factory.certified.did.js +326 -0
- package/dist/declarations/console/console.factory.did.js +326 -0
- package/dist/declarations/console/console.factory.did.mjs +326 -0
- package/dist/declarations/deprecated/console-0-0-14.did.d.ts +267 -0
- package/dist/declarations/deprecated/console-0-0-14.factory.did.js +285 -0
- package/dist/declarations/deprecated/console-0-0-8-patch1.did.d.ts +75 -0
- package/dist/declarations/deprecated/console-0-0-8-patch1.factory.did.js +80 -0
- package/dist/declarations/deprecated/mission_control-0-0-13.did.d.ts +246 -0
- package/dist/declarations/deprecated/mission_control-0-0-13.factory.did.js +280 -0
- package/dist/declarations/deprecated/mission_control-0-0-14.did.d.ts +241 -0
- package/dist/declarations/deprecated/mission_control-0-0-14.factory.did.js +258 -0
- package/dist/declarations/deprecated/mission_control-0-0-4.did.d.ts +80 -0
- package/dist/declarations/deprecated/mission_control-0-0-4.factory.did.js +99 -0
- package/dist/declarations/deprecated/mission_control-deprecated-version.did.d.ts +231 -0
- package/dist/declarations/deprecated/mission_control-deprecated-version.factory.did.js +247 -0
- package/dist/declarations/deprecated/observatory-0-0-9.did.d.ts +70 -0
- package/dist/declarations/deprecated/observatory-0-0-9.factory.did.js +76 -0
- package/dist/declarations/deprecated/orbiter-0-0-6.did.d.ts +161 -0
- package/dist/declarations/deprecated/orbiter-0-0-6.factory.did.js +192 -0
- package/dist/declarations/deprecated/orbiter-0-0-7.did.d.ts +166 -0
- package/dist/declarations/deprecated/orbiter-0-0-7.factory.did.js +197 -0
- package/dist/declarations/deprecated/orbiter-0-0-8.did.d.ts +245 -0
- package/dist/declarations/deprecated/orbiter-0-0-8.factory.did.js +287 -0
- package/dist/declarations/deprecated/orbiter-0-2-0.did.d.ts +277 -0
- package/dist/declarations/deprecated/orbiter-0-2-0.factory.did.js +319 -0
- package/dist/declarations/deprecated/orbiter-deprecated-version.did.d.ts +229 -0
- package/dist/declarations/deprecated/orbiter-deprecated-version.factory.did.js +271 -0
- package/dist/declarations/deprecated/satellite-0-0-16.did.d.ts +240 -0
- package/dist/declarations/deprecated/satellite-0-0-16.factory.did.js +264 -0
- package/dist/declarations/deprecated/satellite-0-0-17.did.d.ts +254 -0
- package/dist/declarations/deprecated/satellite-0-0-17.factory.did.js +281 -0
- package/dist/declarations/deprecated/satellite-0-0-21.did.d.ts +299 -0
- package/dist/declarations/deprecated/satellite-0-0-21.factory.did.js +333 -0
- package/dist/declarations/deprecated/satellite-0-0-22.did.d.ts +290 -0
- package/dist/declarations/deprecated/satellite-0-0-22.factory.did.js +318 -0
- package/dist/declarations/deprecated/satellite-0-0-8.did.d.ts +183 -0
- package/dist/declarations/deprecated/satellite-0-0-8.factory.did.js +194 -0
- package/dist/declarations/deprecated/satellite-0-0-9.did.d.ts +199 -0
- package/dist/declarations/deprecated/satellite-0-0-9.factory.did.js +213 -0
- package/dist/declarations/deprecated/satellite-deprecated-no-scope.did.d.ts +183 -0
- package/dist/declarations/deprecated/satellite-deprecated-no-scope.factory.did.js +194 -0
- package/dist/declarations/deprecated/satellite-deprecated-no-scope.factory.did.mjs +192 -0
- package/dist/declarations/deprecated/satellite-deprecated-version.did.d.ts +291 -0
- package/dist/declarations/deprecated/satellite-deprecated-version.factory.did.js +319 -0
- package/dist/declarations/deprecated/satellite-deprecated.did.d.ts +182 -0
- package/dist/declarations/deprecated/satellite-deprecated.factory.did.js +191 -0
- package/dist/declarations/deprecated/satellite-deprecated.factory.did.mjs +191 -0
- package/dist/declarations/mission_control/mission_control.did.d.ts +241 -0
- package/dist/declarations/mission_control/mission_control.factory.certified.did.js +259 -0
- package/dist/declarations/mission_control/mission_control.factory.did.js +259 -0
- package/dist/declarations/observatory/observatory.did.d.ts +86 -0
- package/dist/declarations/observatory/observatory.factory.certified.did.js +93 -0
- package/dist/declarations/observatory/observatory.factory.did.js +93 -0
- package/dist/declarations/observatory/observatory.factory.did.mjs +93 -0
- package/dist/declarations/orbiter/orbiter.did.d.ts +277 -0
- package/dist/declarations/orbiter/orbiter.factory.certified.did.js +304 -0
- package/dist/declarations/orbiter/orbiter.factory.did.js +320 -0
- package/dist/declarations/orbiter/orbiter.factory.did.mjs +320 -0
- package/dist/declarations/satellite/satellite.did.d.ts +396 -0
- package/dist/declarations/satellite/satellite.factory.certified.did.js +419 -0
- package/dist/declarations/satellite/satellite.factory.did.js +419 -0
- package/dist/declarations/satellite/satellite.factory.did.mjs +419 -0
- package/dist/declarations/sputnik/sputnik.did.d.ts +396 -0
- package/dist/declarations/sputnik/sputnik.factory.certified.did.js +419 -0
- package/dist/declarations/sputnik/sputnik.factory.did.js +419 -0
- package/dist/index.js +1 -0
- package/dist/node/index.mjs +4 -0
- package/dist/node/index.mjs.map +7 -0
- package/dist/types/api/_agent.api.d.ts +3 -0
- package/dist/types/api/actor.api.d.ts +34 -0
- package/dist/types/api/actor.factory.d.ts +19 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types/actor.d.ts +74 -0
- package/dist/types/utils/agent.utils.d.ts +6 -0
- package/package.json +63 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
+
import type {IDL} from '@dfinity/candid';
|
|
3
|
+
import type {Principal} from '@dfinity/principal';
|
|
4
|
+
|
|
5
|
+
export interface AnalyticKey {
|
|
6
|
+
key: string;
|
|
7
|
+
collected_at: bigint;
|
|
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
|
+
operating_systems: [] | [AnalyticsOperatingSystemsPageViews];
|
|
19
|
+
devices: AnalyticsDevicesPageViews;
|
|
20
|
+
}
|
|
21
|
+
export interface AnalyticsDevicesPageViews {
|
|
22
|
+
desktop: number;
|
|
23
|
+
laptop: [] | [number];
|
|
24
|
+
others: number;
|
|
25
|
+
tablet: [] | [number];
|
|
26
|
+
mobile: number;
|
|
27
|
+
}
|
|
28
|
+
export interface AnalyticsMetricsPageViews {
|
|
29
|
+
bounce_rate: number;
|
|
30
|
+
average_page_views_per_session: number;
|
|
31
|
+
daily_total_page_views: Array<[CalendarDate, number]>;
|
|
32
|
+
total_page_views: number;
|
|
33
|
+
unique_page_views: bigint;
|
|
34
|
+
unique_sessions: bigint;
|
|
35
|
+
}
|
|
36
|
+
export interface AnalyticsOperatingSystemsPageViews {
|
|
37
|
+
ios: number;
|
|
38
|
+
macos: number;
|
|
39
|
+
others: number;
|
|
40
|
+
linux: number;
|
|
41
|
+
android: number;
|
|
42
|
+
windows: number;
|
|
43
|
+
}
|
|
44
|
+
export interface AnalyticsTop10PageViews {
|
|
45
|
+
referrers: Array<[string, number]>;
|
|
46
|
+
pages: Array<[string, number]>;
|
|
47
|
+
utm_campaigns: [] | [Array<[string, number]>];
|
|
48
|
+
utm_sources: [] | [Array<[string, number]>];
|
|
49
|
+
time_zones: [] | [Array<[string, number]>];
|
|
50
|
+
}
|
|
51
|
+
export interface AnalyticsTrackEvents {
|
|
52
|
+
total: Array<[string, number]>;
|
|
53
|
+
}
|
|
54
|
+
export interface AnalyticsWebVitalsPageMetrics {
|
|
55
|
+
cls: [] | [number];
|
|
56
|
+
fcp: [] | [number];
|
|
57
|
+
inp: [] | [number];
|
|
58
|
+
lcp: [] | [number];
|
|
59
|
+
ttfb: [] | [number];
|
|
60
|
+
}
|
|
61
|
+
export interface AnalyticsWebVitalsPerformanceMetrics {
|
|
62
|
+
overall: AnalyticsWebVitalsPageMetrics;
|
|
63
|
+
pages: Array<[string, AnalyticsWebVitalsPageMetrics]>;
|
|
64
|
+
}
|
|
65
|
+
export interface CalendarDate {
|
|
66
|
+
day: number;
|
|
67
|
+
month: number;
|
|
68
|
+
year: number;
|
|
69
|
+
}
|
|
70
|
+
export interface Controller {
|
|
71
|
+
updated_at: bigint;
|
|
72
|
+
metadata: Array<[string, string]>;
|
|
73
|
+
created_at: bigint;
|
|
74
|
+
scope: ControllerScope;
|
|
75
|
+
expires_at: [] | [bigint];
|
|
76
|
+
}
|
|
77
|
+
export type ControllerScope = {Write: null} | {Admin: null};
|
|
78
|
+
export interface DelSatelliteConfig {
|
|
79
|
+
version: [] | [bigint];
|
|
80
|
+
}
|
|
81
|
+
export interface DeleteControllersArgs {
|
|
82
|
+
controllers: Array<Principal>;
|
|
83
|
+
}
|
|
84
|
+
export interface DepositCyclesArgs {
|
|
85
|
+
cycles: bigint;
|
|
86
|
+
destination_id: Principal;
|
|
87
|
+
}
|
|
88
|
+
export interface GetAnalytics {
|
|
89
|
+
to: [] | [bigint];
|
|
90
|
+
from: [] | [bigint];
|
|
91
|
+
satellite_id: [] | [Principal];
|
|
92
|
+
}
|
|
93
|
+
export interface HttpRequest {
|
|
94
|
+
url: string;
|
|
95
|
+
method: string;
|
|
96
|
+
body: Uint8Array | number[];
|
|
97
|
+
headers: Array<[string, string]>;
|
|
98
|
+
certificate_version: [] | [number];
|
|
99
|
+
}
|
|
100
|
+
export interface HttpResponse {
|
|
101
|
+
body: Uint8Array | number[];
|
|
102
|
+
headers: Array<[string, string]>;
|
|
103
|
+
upgrade: [] | [boolean];
|
|
104
|
+
status_code: number;
|
|
105
|
+
}
|
|
106
|
+
export interface MemorySize {
|
|
107
|
+
stable: bigint;
|
|
108
|
+
heap: bigint;
|
|
109
|
+
}
|
|
110
|
+
export type NavigationType =
|
|
111
|
+
| {Navigate: null}
|
|
112
|
+
| {Restore: null}
|
|
113
|
+
| {Reload: null}
|
|
114
|
+
| {BackForward: null}
|
|
115
|
+
| {BackForwardCache: null}
|
|
116
|
+
| {Prerender: null};
|
|
117
|
+
export interface OrbiterSatelliteConfig {
|
|
118
|
+
updated_at: bigint;
|
|
119
|
+
features: [] | [OrbiterSatelliteFeatures];
|
|
120
|
+
restricted_origin: [] | [string];
|
|
121
|
+
created_at: bigint;
|
|
122
|
+
version: [] | [bigint];
|
|
123
|
+
}
|
|
124
|
+
export interface OrbiterSatelliteFeatures {
|
|
125
|
+
performance_metrics: boolean;
|
|
126
|
+
track_events: boolean;
|
|
127
|
+
page_views: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface PageView {
|
|
130
|
+
client: [] | [PageViewClient];
|
|
131
|
+
title: string;
|
|
132
|
+
updated_at: bigint;
|
|
133
|
+
referrer: [] | [string];
|
|
134
|
+
time_zone: string;
|
|
135
|
+
session_id: string;
|
|
136
|
+
campaign: [] | [PageViewCampaign];
|
|
137
|
+
href: string;
|
|
138
|
+
created_at: bigint;
|
|
139
|
+
satellite_id: Principal;
|
|
140
|
+
device: PageViewDevice;
|
|
141
|
+
version: [] | [bigint];
|
|
142
|
+
user_agent: [] | [string];
|
|
143
|
+
}
|
|
144
|
+
export interface PageViewCampaign {
|
|
145
|
+
utm_content: [] | [string];
|
|
146
|
+
utm_medium: [] | [string];
|
|
147
|
+
utm_source: string;
|
|
148
|
+
utm_term: [] | [string];
|
|
149
|
+
utm_campaign: [] | [string];
|
|
150
|
+
}
|
|
151
|
+
export interface PageViewClient {
|
|
152
|
+
os: string;
|
|
153
|
+
device: [] | [string];
|
|
154
|
+
browser: string;
|
|
155
|
+
}
|
|
156
|
+
export interface PageViewDevice {
|
|
157
|
+
inner_height: number;
|
|
158
|
+
screen_height: [] | [number];
|
|
159
|
+
screen_width: [] | [number];
|
|
160
|
+
inner_width: number;
|
|
161
|
+
}
|
|
162
|
+
export type PerformanceData = {WebVitalsMetric: WebVitalsMetric};
|
|
163
|
+
export interface PerformanceMetric {
|
|
164
|
+
updated_at: bigint;
|
|
165
|
+
session_id: string;
|
|
166
|
+
data: PerformanceData;
|
|
167
|
+
href: string;
|
|
168
|
+
metric_name: PerformanceMetricName;
|
|
169
|
+
created_at: bigint;
|
|
170
|
+
satellite_id: Principal;
|
|
171
|
+
version: [] | [bigint];
|
|
172
|
+
}
|
|
173
|
+
export type PerformanceMetricName =
|
|
174
|
+
| {CLS: null}
|
|
175
|
+
| {FCP: null}
|
|
176
|
+
| {INP: null}
|
|
177
|
+
| {LCP: null}
|
|
178
|
+
| {TTFB: null};
|
|
179
|
+
export type Result = {Ok: PageView} | {Err: string};
|
|
180
|
+
export type Result_1 = {Ok: null} | {Err: Array<[AnalyticKey, string]>};
|
|
181
|
+
export type Result_2 = {Ok: PerformanceMetric} | {Err: string};
|
|
182
|
+
export type Result_3 = {Ok: TrackEvent} | {Err: string};
|
|
183
|
+
export interface SetController {
|
|
184
|
+
metadata: Array<[string, string]>;
|
|
185
|
+
scope: ControllerScope;
|
|
186
|
+
expires_at: [] | [bigint];
|
|
187
|
+
}
|
|
188
|
+
export interface SetControllersArgs {
|
|
189
|
+
controller: SetController;
|
|
190
|
+
controllers: Array<Principal>;
|
|
191
|
+
}
|
|
192
|
+
export interface SetPageView {
|
|
193
|
+
client: [] | [PageViewClient];
|
|
194
|
+
title: string;
|
|
195
|
+
updated_at: [] | [bigint];
|
|
196
|
+
referrer: [] | [string];
|
|
197
|
+
time_zone: string;
|
|
198
|
+
session_id: string;
|
|
199
|
+
campaign: [] | [PageViewCampaign];
|
|
200
|
+
href: string;
|
|
201
|
+
satellite_id: Principal;
|
|
202
|
+
device: PageViewDevice;
|
|
203
|
+
version: [] | [bigint];
|
|
204
|
+
user_agent: [] | [string];
|
|
205
|
+
}
|
|
206
|
+
export interface SetPerformanceMetric {
|
|
207
|
+
session_id: string;
|
|
208
|
+
data: PerformanceData;
|
|
209
|
+
href: string;
|
|
210
|
+
metric_name: PerformanceMetricName;
|
|
211
|
+
satellite_id: Principal;
|
|
212
|
+
version: [] | [bigint];
|
|
213
|
+
user_agent: [] | [string];
|
|
214
|
+
}
|
|
215
|
+
export interface SetSatelliteConfig {
|
|
216
|
+
features: [] | [OrbiterSatelliteFeatures];
|
|
217
|
+
restricted_origin: [] | [string];
|
|
218
|
+
version: [] | [bigint];
|
|
219
|
+
}
|
|
220
|
+
export interface SetTrackEvent {
|
|
221
|
+
updated_at: [] | [bigint];
|
|
222
|
+
session_id: string;
|
|
223
|
+
metadata: [] | [Array<[string, string]>];
|
|
224
|
+
name: string;
|
|
225
|
+
satellite_id: Principal;
|
|
226
|
+
version: [] | [bigint];
|
|
227
|
+
user_agent: [] | [string];
|
|
228
|
+
}
|
|
229
|
+
export interface TrackEvent {
|
|
230
|
+
updated_at: bigint;
|
|
231
|
+
session_id: string;
|
|
232
|
+
metadata: [] | [Array<[string, string]>];
|
|
233
|
+
name: string;
|
|
234
|
+
created_at: bigint;
|
|
235
|
+
satellite_id: Principal;
|
|
236
|
+
version: [] | [bigint];
|
|
237
|
+
}
|
|
238
|
+
export interface WebVitalsMetric {
|
|
239
|
+
id: string;
|
|
240
|
+
value: number;
|
|
241
|
+
navigation_type: [] | [NavigationType];
|
|
242
|
+
delta: number;
|
|
243
|
+
}
|
|
244
|
+
export interface _SERVICE {
|
|
245
|
+
del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
|
|
246
|
+
del_satellite_config: ActorMethod<[Principal, DelSatelliteConfig], undefined>;
|
|
247
|
+
deposit_cycles: ActorMethod<[DepositCyclesArgs], undefined>;
|
|
248
|
+
get_page_views: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PageView]>>;
|
|
249
|
+
get_page_views_analytics_clients: ActorMethod<[GetAnalytics], AnalyticsClientsPageViews>;
|
|
250
|
+
get_page_views_analytics_metrics: ActorMethod<[GetAnalytics], AnalyticsMetricsPageViews>;
|
|
251
|
+
get_page_views_analytics_top_10: ActorMethod<[GetAnalytics], AnalyticsTop10PageViews>;
|
|
252
|
+
get_performance_metrics: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PerformanceMetric]>>;
|
|
253
|
+
get_performance_metrics_analytics_web_vitals: ActorMethod<
|
|
254
|
+
[GetAnalytics],
|
|
255
|
+
AnalyticsWebVitalsPerformanceMetrics
|
|
256
|
+
>;
|
|
257
|
+
get_track_events: ActorMethod<[GetAnalytics], Array<[AnalyticKey, TrackEvent]>>;
|
|
258
|
+
get_track_events_analytics: ActorMethod<[GetAnalytics], AnalyticsTrackEvents>;
|
|
259
|
+
http_request: ActorMethod<[HttpRequest], HttpResponse>;
|
|
260
|
+
http_request_update: ActorMethod<[HttpRequest], HttpResponse>;
|
|
261
|
+
list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
|
|
262
|
+
list_satellite_configs: ActorMethod<[], Array<[Principal, OrbiterSatelliteConfig]>>;
|
|
263
|
+
memory_size: ActorMethod<[], MemorySize>;
|
|
264
|
+
set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
|
|
265
|
+
set_page_view: ActorMethod<[AnalyticKey, SetPageView], Result>;
|
|
266
|
+
set_page_views: ActorMethod<[Array<[AnalyticKey, SetPageView]>], Result_1>;
|
|
267
|
+
set_performance_metric: ActorMethod<[AnalyticKey, SetPerformanceMetric], Result_2>;
|
|
268
|
+
set_performance_metrics: ActorMethod<[Array<[AnalyticKey, SetPerformanceMetric]>], Result_1>;
|
|
269
|
+
set_satellite_configs: ActorMethod<
|
|
270
|
+
[Array<[Principal, SetSatelliteConfig]>],
|
|
271
|
+
Array<[Principal, OrbiterSatelliteConfig]>
|
|
272
|
+
>;
|
|
273
|
+
set_track_event: ActorMethod<[AnalyticKey, SetTrackEvent], Result_3>;
|
|
274
|
+
set_track_events: ActorMethod<[Array<[AnalyticKey, SetTrackEvent]>], Result_1>;
|
|
275
|
+
}
|
|
276
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
277
|
+
export declare const init: (args: {IDL: typeof IDL}) => IDL.Type[];
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const DeleteControllersArgs = IDL.Record({
|
|
4
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
5
|
+
});
|
|
6
|
+
const ControllerScope = IDL.Variant({
|
|
7
|
+
Write: IDL.Null,
|
|
8
|
+
Admin: IDL.Null
|
|
9
|
+
});
|
|
10
|
+
const Controller = IDL.Record({
|
|
11
|
+
updated_at: IDL.Nat64,
|
|
12
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
13
|
+
created_at: IDL.Nat64,
|
|
14
|
+
scope: ControllerScope,
|
|
15
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
16
|
+
});
|
|
17
|
+
const DelSatelliteConfig = IDL.Record({version: IDL.Opt(IDL.Nat64)});
|
|
18
|
+
const DepositCyclesArgs = IDL.Record({
|
|
19
|
+
cycles: IDL.Nat,
|
|
20
|
+
destination_id: IDL.Principal
|
|
21
|
+
});
|
|
22
|
+
const GetAnalytics = IDL.Record({
|
|
23
|
+
to: IDL.Opt(IDL.Nat64),
|
|
24
|
+
from: IDL.Opt(IDL.Nat64),
|
|
25
|
+
satellite_id: IDL.Opt(IDL.Principal)
|
|
26
|
+
});
|
|
27
|
+
const AnalyticKey = IDL.Record({
|
|
28
|
+
key: IDL.Text,
|
|
29
|
+
collected_at: IDL.Nat64
|
|
30
|
+
});
|
|
31
|
+
const PageViewClient = IDL.Record({
|
|
32
|
+
os: IDL.Text,
|
|
33
|
+
device: IDL.Opt(IDL.Text),
|
|
34
|
+
browser: IDL.Text
|
|
35
|
+
});
|
|
36
|
+
const PageViewCampaign = IDL.Record({
|
|
37
|
+
utm_content: IDL.Opt(IDL.Text),
|
|
38
|
+
utm_medium: IDL.Opt(IDL.Text),
|
|
39
|
+
utm_source: IDL.Text,
|
|
40
|
+
utm_term: IDL.Opt(IDL.Text),
|
|
41
|
+
utm_campaign: IDL.Opt(IDL.Text)
|
|
42
|
+
});
|
|
43
|
+
const PageViewDevice = IDL.Record({
|
|
44
|
+
inner_height: IDL.Nat16,
|
|
45
|
+
screen_height: IDL.Opt(IDL.Nat16),
|
|
46
|
+
screen_width: IDL.Opt(IDL.Nat16),
|
|
47
|
+
inner_width: IDL.Nat16
|
|
48
|
+
});
|
|
49
|
+
const PageView = IDL.Record({
|
|
50
|
+
client: IDL.Opt(PageViewClient),
|
|
51
|
+
title: IDL.Text,
|
|
52
|
+
updated_at: IDL.Nat64,
|
|
53
|
+
referrer: IDL.Opt(IDL.Text),
|
|
54
|
+
time_zone: IDL.Text,
|
|
55
|
+
session_id: IDL.Text,
|
|
56
|
+
campaign: IDL.Opt(PageViewCampaign),
|
|
57
|
+
href: IDL.Text,
|
|
58
|
+
created_at: IDL.Nat64,
|
|
59
|
+
satellite_id: IDL.Principal,
|
|
60
|
+
device: PageViewDevice,
|
|
61
|
+
version: IDL.Opt(IDL.Nat64),
|
|
62
|
+
user_agent: IDL.Opt(IDL.Text)
|
|
63
|
+
});
|
|
64
|
+
const AnalyticsBrowsersPageViews = IDL.Record({
|
|
65
|
+
safari: IDL.Float64,
|
|
66
|
+
opera: IDL.Float64,
|
|
67
|
+
others: IDL.Float64,
|
|
68
|
+
firefox: IDL.Float64,
|
|
69
|
+
chrome: IDL.Float64
|
|
70
|
+
});
|
|
71
|
+
const AnalyticsOperatingSystemsPageViews = IDL.Record({
|
|
72
|
+
ios: IDL.Float64,
|
|
73
|
+
macos: IDL.Float64,
|
|
74
|
+
others: IDL.Float64,
|
|
75
|
+
linux: IDL.Float64,
|
|
76
|
+
android: IDL.Float64,
|
|
77
|
+
windows: IDL.Float64
|
|
78
|
+
});
|
|
79
|
+
const AnalyticsDevicesPageViews = IDL.Record({
|
|
80
|
+
desktop: IDL.Float64,
|
|
81
|
+
laptop: IDL.Opt(IDL.Float64),
|
|
82
|
+
others: IDL.Float64,
|
|
83
|
+
tablet: IDL.Opt(IDL.Float64),
|
|
84
|
+
mobile: IDL.Float64
|
|
85
|
+
});
|
|
86
|
+
const AnalyticsClientsPageViews = IDL.Record({
|
|
87
|
+
browsers: AnalyticsBrowsersPageViews,
|
|
88
|
+
operating_systems: IDL.Opt(AnalyticsOperatingSystemsPageViews),
|
|
89
|
+
devices: AnalyticsDevicesPageViews
|
|
90
|
+
});
|
|
91
|
+
const CalendarDate = IDL.Record({
|
|
92
|
+
day: IDL.Nat8,
|
|
93
|
+
month: IDL.Nat8,
|
|
94
|
+
year: IDL.Int32
|
|
95
|
+
});
|
|
96
|
+
const AnalyticsMetricsPageViews = IDL.Record({
|
|
97
|
+
bounce_rate: IDL.Float64,
|
|
98
|
+
average_page_views_per_session: IDL.Float64,
|
|
99
|
+
daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),
|
|
100
|
+
total_page_views: IDL.Nat32,
|
|
101
|
+
unique_page_views: IDL.Nat64,
|
|
102
|
+
unique_sessions: IDL.Nat64
|
|
103
|
+
});
|
|
104
|
+
const AnalyticsTop10PageViews = IDL.Record({
|
|
105
|
+
referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),
|
|
106
|
+
pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),
|
|
107
|
+
utm_campaigns: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),
|
|
108
|
+
utm_sources: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),
|
|
109
|
+
time_zones: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)))
|
|
110
|
+
});
|
|
111
|
+
const NavigationType = IDL.Variant({
|
|
112
|
+
Navigate: IDL.Null,
|
|
113
|
+
Restore: IDL.Null,
|
|
114
|
+
Reload: IDL.Null,
|
|
115
|
+
BackForward: IDL.Null,
|
|
116
|
+
BackForwardCache: IDL.Null,
|
|
117
|
+
Prerender: IDL.Null
|
|
118
|
+
});
|
|
119
|
+
const WebVitalsMetric = IDL.Record({
|
|
120
|
+
id: IDL.Text,
|
|
121
|
+
value: IDL.Float64,
|
|
122
|
+
navigation_type: IDL.Opt(NavigationType),
|
|
123
|
+
delta: IDL.Float64
|
|
124
|
+
});
|
|
125
|
+
const PerformanceData = IDL.Variant({WebVitalsMetric: WebVitalsMetric});
|
|
126
|
+
const PerformanceMetricName = IDL.Variant({
|
|
127
|
+
CLS: IDL.Null,
|
|
128
|
+
FCP: IDL.Null,
|
|
129
|
+
INP: IDL.Null,
|
|
130
|
+
LCP: IDL.Null,
|
|
131
|
+
TTFB: IDL.Null
|
|
132
|
+
});
|
|
133
|
+
const PerformanceMetric = IDL.Record({
|
|
134
|
+
updated_at: IDL.Nat64,
|
|
135
|
+
session_id: IDL.Text,
|
|
136
|
+
data: PerformanceData,
|
|
137
|
+
href: IDL.Text,
|
|
138
|
+
metric_name: PerformanceMetricName,
|
|
139
|
+
created_at: IDL.Nat64,
|
|
140
|
+
satellite_id: IDL.Principal,
|
|
141
|
+
version: IDL.Opt(IDL.Nat64)
|
|
142
|
+
});
|
|
143
|
+
const AnalyticsWebVitalsPageMetrics = IDL.Record({
|
|
144
|
+
cls: IDL.Opt(IDL.Float64),
|
|
145
|
+
fcp: IDL.Opt(IDL.Float64),
|
|
146
|
+
inp: IDL.Opt(IDL.Float64),
|
|
147
|
+
lcp: IDL.Opt(IDL.Float64),
|
|
148
|
+
ttfb: IDL.Opt(IDL.Float64)
|
|
149
|
+
});
|
|
150
|
+
const AnalyticsWebVitalsPerformanceMetrics = IDL.Record({
|
|
151
|
+
overall: AnalyticsWebVitalsPageMetrics,
|
|
152
|
+
pages: IDL.Vec(IDL.Tuple(IDL.Text, AnalyticsWebVitalsPageMetrics))
|
|
153
|
+
});
|
|
154
|
+
const TrackEvent = IDL.Record({
|
|
155
|
+
updated_at: IDL.Nat64,
|
|
156
|
+
session_id: IDL.Text,
|
|
157
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
158
|
+
name: IDL.Text,
|
|
159
|
+
created_at: IDL.Nat64,
|
|
160
|
+
satellite_id: IDL.Principal,
|
|
161
|
+
version: IDL.Opt(IDL.Nat64)
|
|
162
|
+
});
|
|
163
|
+
const AnalyticsTrackEvents = IDL.Record({
|
|
164
|
+
total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))
|
|
165
|
+
});
|
|
166
|
+
const HttpRequest = IDL.Record({
|
|
167
|
+
url: IDL.Text,
|
|
168
|
+
method: IDL.Text,
|
|
169
|
+
body: IDL.Vec(IDL.Nat8),
|
|
170
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
171
|
+
certificate_version: IDL.Opt(IDL.Nat16)
|
|
172
|
+
});
|
|
173
|
+
const HttpResponse = IDL.Record({
|
|
174
|
+
body: IDL.Vec(IDL.Nat8),
|
|
175
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
176
|
+
upgrade: IDL.Opt(IDL.Bool),
|
|
177
|
+
status_code: IDL.Nat16
|
|
178
|
+
});
|
|
179
|
+
const OrbiterSatelliteFeatures = IDL.Record({
|
|
180
|
+
performance_metrics: IDL.Bool,
|
|
181
|
+
track_events: IDL.Bool,
|
|
182
|
+
page_views: IDL.Bool
|
|
183
|
+
});
|
|
184
|
+
const OrbiterSatelliteConfig = IDL.Record({
|
|
185
|
+
updated_at: IDL.Nat64,
|
|
186
|
+
features: IDL.Opt(OrbiterSatelliteFeatures),
|
|
187
|
+
restricted_origin: IDL.Opt(IDL.Text),
|
|
188
|
+
created_at: IDL.Nat64,
|
|
189
|
+
version: IDL.Opt(IDL.Nat64)
|
|
190
|
+
});
|
|
191
|
+
const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
|
|
192
|
+
const SetController = IDL.Record({
|
|
193
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
194
|
+
scope: ControllerScope,
|
|
195
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
196
|
+
});
|
|
197
|
+
const SetControllersArgs = IDL.Record({
|
|
198
|
+
controller: SetController,
|
|
199
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
200
|
+
});
|
|
201
|
+
const SetPageView = IDL.Record({
|
|
202
|
+
client: IDL.Opt(PageViewClient),
|
|
203
|
+
title: IDL.Text,
|
|
204
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
205
|
+
referrer: IDL.Opt(IDL.Text),
|
|
206
|
+
time_zone: IDL.Text,
|
|
207
|
+
session_id: IDL.Text,
|
|
208
|
+
campaign: IDL.Opt(PageViewCampaign),
|
|
209
|
+
href: IDL.Text,
|
|
210
|
+
satellite_id: IDL.Principal,
|
|
211
|
+
device: PageViewDevice,
|
|
212
|
+
version: IDL.Opt(IDL.Nat64),
|
|
213
|
+
user_agent: IDL.Opt(IDL.Text)
|
|
214
|
+
});
|
|
215
|
+
const Result = IDL.Variant({Ok: PageView, Err: IDL.Text});
|
|
216
|
+
const Result_1 = IDL.Variant({
|
|
217
|
+
Ok: IDL.Null,
|
|
218
|
+
Err: IDL.Vec(IDL.Tuple(AnalyticKey, IDL.Text))
|
|
219
|
+
});
|
|
220
|
+
const SetPerformanceMetric = IDL.Record({
|
|
221
|
+
session_id: IDL.Text,
|
|
222
|
+
data: PerformanceData,
|
|
223
|
+
href: IDL.Text,
|
|
224
|
+
metric_name: PerformanceMetricName,
|
|
225
|
+
satellite_id: IDL.Principal,
|
|
226
|
+
version: IDL.Opt(IDL.Nat64),
|
|
227
|
+
user_agent: IDL.Opt(IDL.Text)
|
|
228
|
+
});
|
|
229
|
+
const Result_2 = IDL.Variant({Ok: PerformanceMetric, Err: IDL.Text});
|
|
230
|
+
const SetSatelliteConfig = IDL.Record({
|
|
231
|
+
features: IDL.Opt(OrbiterSatelliteFeatures),
|
|
232
|
+
restricted_origin: IDL.Opt(IDL.Text),
|
|
233
|
+
version: IDL.Opt(IDL.Nat64)
|
|
234
|
+
});
|
|
235
|
+
const SetTrackEvent = IDL.Record({
|
|
236
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
237
|
+
session_id: IDL.Text,
|
|
238
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
239
|
+
name: IDL.Text,
|
|
240
|
+
satellite_id: IDL.Principal,
|
|
241
|
+
version: IDL.Opt(IDL.Nat64),
|
|
242
|
+
user_agent: IDL.Opt(IDL.Text)
|
|
243
|
+
});
|
|
244
|
+
const Result_3 = IDL.Variant({Ok: TrackEvent, Err: IDL.Text});
|
|
245
|
+
return IDL.Service({
|
|
246
|
+
del_controllers: IDL.Func(
|
|
247
|
+
[DeleteControllersArgs],
|
|
248
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
249
|
+
[]
|
|
250
|
+
),
|
|
251
|
+
del_satellite_config: IDL.Func([IDL.Principal, DelSatelliteConfig], [], []),
|
|
252
|
+
deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
|
|
253
|
+
get_page_views: IDL.Func(
|
|
254
|
+
[GetAnalytics],
|
|
255
|
+
[IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],
|
|
256
|
+
['query']
|
|
257
|
+
),
|
|
258
|
+
get_page_views_analytics_clients: IDL.Func(
|
|
259
|
+
[GetAnalytics],
|
|
260
|
+
[AnalyticsClientsPageViews],
|
|
261
|
+
['query']
|
|
262
|
+
),
|
|
263
|
+
get_page_views_analytics_metrics: IDL.Func(
|
|
264
|
+
[GetAnalytics],
|
|
265
|
+
[AnalyticsMetricsPageViews],
|
|
266
|
+
['query']
|
|
267
|
+
),
|
|
268
|
+
get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], ['query']),
|
|
269
|
+
get_performance_metrics: IDL.Func(
|
|
270
|
+
[GetAnalytics],
|
|
271
|
+
[IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],
|
|
272
|
+
['query']
|
|
273
|
+
),
|
|
274
|
+
get_performance_metrics_analytics_web_vitals: IDL.Func(
|
|
275
|
+
[GetAnalytics],
|
|
276
|
+
[AnalyticsWebVitalsPerformanceMetrics],
|
|
277
|
+
['query']
|
|
278
|
+
),
|
|
279
|
+
get_track_events: IDL.Func(
|
|
280
|
+
[GetAnalytics],
|
|
281
|
+
[IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],
|
|
282
|
+
['query']
|
|
283
|
+
),
|
|
284
|
+
get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], ['query']),
|
|
285
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
286
|
+
http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),
|
|
287
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
|
|
288
|
+
list_satellite_configs: IDL.Func(
|
|
289
|
+
[],
|
|
290
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],
|
|
291
|
+
['query']
|
|
292
|
+
),
|
|
293
|
+
memory_size: IDL.Func([], [MemorySize], ['query']),
|
|
294
|
+
set_controllers: IDL.Func(
|
|
295
|
+
[SetControllersArgs],
|
|
296
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
297
|
+
[]
|
|
298
|
+
),
|
|
299
|
+
set_page_view: IDL.Func([AnalyticKey, SetPageView], [Result], []),
|
|
300
|
+
set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),
|
|
301
|
+
set_performance_metric: IDL.Func([AnalyticKey, SetPerformanceMetric], [Result_2], []),
|
|
302
|
+
set_performance_metrics: IDL.Func(
|
|
303
|
+
[IDL.Vec(IDL.Tuple(AnalyticKey, SetPerformanceMetric))],
|
|
304
|
+
[Result_1],
|
|
305
|
+
[]
|
|
306
|
+
),
|
|
307
|
+
set_satellite_configs: IDL.Func(
|
|
308
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, SetSatelliteConfig))],
|
|
309
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],
|
|
310
|
+
[]
|
|
311
|
+
),
|
|
312
|
+
set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_3], []),
|
|
313
|
+
set_track_events: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetTrackEvent))], [Result_1], [])
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
// @ts-ignore
|
|
317
|
+
export const init = ({IDL}) => {
|
|
318
|
+
return [];
|
|
319
|
+
};
|