@entrolytics/shared 2.4.0 → 2.4.2
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/index.cjs +772 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +906 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +732 -563
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +631 -656
- package/dist/index.js.map +1 -0
- package/package.json +6 -5
- package/dist/analytics-types.d.ts +0 -104
- package/dist/analytics-types.d.ts.map +0 -1
- package/dist/analytics-types.js +0 -2
- package/dist/event-protocol.d.ts +0 -82
- package/dist/event-protocol.d.ts.map +0 -1
- package/dist/event-protocol.js +0 -17
- package/dist/sdk-validation.test.d.ts +0 -8
- package/dist/sdk-validation.test.d.ts.map +0 -1
- package/dist/sdk-validation.test.js +0 -96
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,195 @@
|
|
|
1
|
+
//#region src/analytics-types.d.ts
|
|
2
|
+
interface DateRangeFilter {
|
|
3
|
+
websiteId: string;
|
|
4
|
+
startDate: Date;
|
|
5
|
+
endDate: Date;
|
|
6
|
+
filters?: {
|
|
7
|
+
country?: string;
|
|
8
|
+
device?: "desktop" | "mobile" | "tablet";
|
|
9
|
+
browser?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface OverviewStats {
|
|
14
|
+
pageviews: number;
|
|
15
|
+
visitors: number;
|
|
16
|
+
sessions: number;
|
|
17
|
+
pagesPerVisitor: number;
|
|
18
|
+
avgLoadTime: number;
|
|
19
|
+
}
|
|
20
|
+
interface TimeseriesData {
|
|
21
|
+
date: Date;
|
|
22
|
+
pageviews: number;
|
|
23
|
+
visitors: number;
|
|
24
|
+
sessions: number;
|
|
25
|
+
}
|
|
26
|
+
interface TopPage {
|
|
27
|
+
path: string;
|
|
28
|
+
views: number;
|
|
29
|
+
uniqueVisitors: number;
|
|
30
|
+
avgLoadTime: number;
|
|
31
|
+
p95LoadTime: number;
|
|
32
|
+
}
|
|
33
|
+
interface Referrer {
|
|
34
|
+
referrerDomain: string;
|
|
35
|
+
visits: number;
|
|
36
|
+
uniqueVisitors: number;
|
|
37
|
+
}
|
|
38
|
+
interface DeviceStats {
|
|
39
|
+
deviceType: string;
|
|
40
|
+
browser: string;
|
|
41
|
+
os: string;
|
|
42
|
+
pageviews: number;
|
|
43
|
+
uniqueVisitors: number;
|
|
44
|
+
}
|
|
45
|
+
interface GeoStats {
|
|
46
|
+
country: string;
|
|
47
|
+
city: string;
|
|
48
|
+
pageviews: number;
|
|
49
|
+
uniqueVisitors: number;
|
|
50
|
+
}
|
|
51
|
+
interface RealtimeStats {
|
|
52
|
+
visitors: number;
|
|
53
|
+
sessions: number;
|
|
54
|
+
pageviews: number;
|
|
55
|
+
}
|
|
56
|
+
interface RealtimeEvent {
|
|
57
|
+
timestamp: Date;
|
|
58
|
+
eventType: string;
|
|
59
|
+
eventName?: string;
|
|
60
|
+
path: string;
|
|
61
|
+
visitorId: string;
|
|
62
|
+
country?: string;
|
|
63
|
+
deviceType: string;
|
|
64
|
+
browser: string;
|
|
65
|
+
}
|
|
66
|
+
interface ActivePage {
|
|
67
|
+
path: string;
|
|
68
|
+
viewers: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Core event interface
|
|
72
|
+
*/
|
|
73
|
+
interface EntrolyticsEvent {
|
|
74
|
+
id: string;
|
|
75
|
+
websiteId: string;
|
|
76
|
+
sessionId: string;
|
|
77
|
+
visitorId: string;
|
|
78
|
+
timestamp: Date;
|
|
79
|
+
eventType: string;
|
|
80
|
+
eventName?: string;
|
|
81
|
+
url: string;
|
|
82
|
+
path: string;
|
|
83
|
+
referrer?: string;
|
|
84
|
+
referrerDomain?: string;
|
|
85
|
+
browser: string;
|
|
86
|
+
browserVersion?: string;
|
|
87
|
+
os: string;
|
|
88
|
+
osVersion?: string;
|
|
89
|
+
deviceType: "desktop" | "mobile" | "tablet" | "server" | "unknown";
|
|
90
|
+
screenWidth?: number;
|
|
91
|
+
screenHeight?: number;
|
|
92
|
+
country?: string;
|
|
93
|
+
city?: string;
|
|
94
|
+
region?: string;
|
|
95
|
+
loadTime?: number;
|
|
96
|
+
domInteractive?: number;
|
|
97
|
+
domComplete?: number;
|
|
98
|
+
utmSource?: string;
|
|
99
|
+
utmMedium?: string;
|
|
100
|
+
utmCampaign?: string;
|
|
101
|
+
utmTerm?: string;
|
|
102
|
+
utmContent?: string;
|
|
103
|
+
properties?: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/event-protocol.d.ts
|
|
107
|
+
/**
|
|
108
|
+
* Event Protocol Types
|
|
109
|
+
*
|
|
110
|
+
* These types define the canonical event structures used across the Entrolytics ecosystem.
|
|
111
|
+
* Used by: API Server, SDKs, CLI, worker processes.
|
|
112
|
+
*
|
|
113
|
+
* This file was extracted from the internal @entrolytics/protocol package to enable
|
|
114
|
+
* sharing with external packages.
|
|
115
|
+
*/
|
|
116
|
+
/**
|
|
117
|
+
* Core event types supported by the analytics platform
|
|
118
|
+
*/
|
|
119
|
+
declare const EventType$1: {
|
|
120
|
+
readonly PageView: "pageview";
|
|
121
|
+
readonly Custom: "custom_event";
|
|
122
|
+
readonly Click: "click";
|
|
123
|
+
};
|
|
124
|
+
type EventType$1 = (typeof EventType$1)[keyof typeof EventType$1];
|
|
125
|
+
/**
|
|
126
|
+
* Event payload as sent from client SDKs
|
|
127
|
+
*/
|
|
128
|
+
interface EventPayload {
|
|
129
|
+
websiteId: string;
|
|
130
|
+
eventId: string;
|
|
131
|
+
timestamp: string;
|
|
132
|
+
sessionId: string;
|
|
133
|
+
visitorId: string;
|
|
134
|
+
url: string;
|
|
135
|
+
referrer?: string;
|
|
136
|
+
eventType: EventType$1;
|
|
137
|
+
eventName?: string;
|
|
138
|
+
consent?: boolean;
|
|
139
|
+
properties?: Record<string, unknown>;
|
|
140
|
+
screenWidth?: number;
|
|
141
|
+
screenHeight?: number;
|
|
142
|
+
loadTime?: number;
|
|
143
|
+
domInteractive?: number;
|
|
144
|
+
domComplete?: number;
|
|
145
|
+
utmSource?: string;
|
|
146
|
+
utmMedium?: string;
|
|
147
|
+
utmCampaign?: string;
|
|
148
|
+
utmTerm?: string;
|
|
149
|
+
utmContent?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Event DB row structure as stored in ClickHouse
|
|
153
|
+
* Uses snake_case to match database column naming convention
|
|
154
|
+
*/
|
|
155
|
+
interface EventDBRow {
|
|
156
|
+
id: string;
|
|
157
|
+
website_id: string;
|
|
158
|
+
session_id: string;
|
|
159
|
+
visitor_id: string;
|
|
160
|
+
timestamp: string;
|
|
161
|
+
event_type: EventType$1;
|
|
162
|
+
event_name: string | null;
|
|
163
|
+
url: string;
|
|
164
|
+
path: string;
|
|
165
|
+
referrer: string | null;
|
|
166
|
+
referrer_domain: string | null;
|
|
167
|
+
browser: string;
|
|
168
|
+
browser_version: string | null;
|
|
169
|
+
os: string;
|
|
170
|
+
os_version: string | null;
|
|
171
|
+
device_type: "desktop" | "mobile" | "tablet" | "server" | "unknown";
|
|
172
|
+
screen_width: number | null;
|
|
173
|
+
screen_height: number | null;
|
|
174
|
+
country: string | null;
|
|
175
|
+
city: string | null;
|
|
176
|
+
region: string | null;
|
|
177
|
+
load_time: number | null;
|
|
178
|
+
dom_interactive: number | null;
|
|
179
|
+
dom_complete: number | null;
|
|
180
|
+
utm_source: string | null;
|
|
181
|
+
utm_medium: string | null;
|
|
182
|
+
utm_campaign: string | null;
|
|
183
|
+
utm_term: string | null;
|
|
184
|
+
utm_content: string | null;
|
|
185
|
+
properties: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Device types for analytics segmentation
|
|
189
|
+
*/
|
|
190
|
+
type DeviceType = "desktop" | "mobile" | "tablet" | "server" | "unknown";
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/index.d.ts
|
|
1
193
|
/**
|
|
2
194
|
* Shared constants across Entrolytics ecosystem
|
|
3
195
|
* Used by: CLI, SDKs, Dashboard, Integrations
|
|
@@ -5,733 +197,710 @@
|
|
|
5
197
|
/**
|
|
6
198
|
* Plan definitions and limits
|
|
7
199
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
200
|
+
declare const PLANS: {
|
|
201
|
+
readonly starter: {
|
|
202
|
+
readonly id: "starter";
|
|
203
|
+
readonly name: "Starter";
|
|
204
|
+
readonly price: 0;
|
|
205
|
+
readonly limits: {
|
|
206
|
+
readonly pageviewsPerMonth: 25000;
|
|
207
|
+
readonly websites: 2;
|
|
208
|
+
readonly retentionDays: 30;
|
|
209
|
+
readonly seats: 1;
|
|
210
|
+
};
|
|
211
|
+
readonly features: {
|
|
212
|
+
readonly funnels: false;
|
|
213
|
+
readonly attribution: false;
|
|
214
|
+
readonly revenue: false;
|
|
215
|
+
readonly customDashboards: false;
|
|
216
|
+
readonly apiAccess: false;
|
|
217
|
+
readonly weeklyReports: true;
|
|
218
|
+
readonly support: "community";
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
readonly pro: {
|
|
222
|
+
readonly id: "pro";
|
|
223
|
+
readonly name: "Pro";
|
|
224
|
+
readonly price: 29;
|
|
225
|
+
readonly limits: {
|
|
226
|
+
readonly pageviewsPerMonth: 250000;
|
|
227
|
+
readonly websites: 10;
|
|
228
|
+
readonly retentionDays: 365;
|
|
229
|
+
readonly seats: 5;
|
|
230
|
+
};
|
|
231
|
+
readonly features: {
|
|
232
|
+
readonly funnels: true;
|
|
233
|
+
readonly attribution: true;
|
|
234
|
+
readonly revenue: true;
|
|
235
|
+
readonly customDashboards: false;
|
|
236
|
+
readonly apiAccess: true;
|
|
237
|
+
readonly weeklyReports: true;
|
|
238
|
+
readonly support: "email";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
readonly business: {
|
|
242
|
+
readonly id: "business";
|
|
243
|
+
readonly name: "Business";
|
|
244
|
+
readonly price: 99;
|
|
245
|
+
readonly limits: {
|
|
246
|
+
readonly pageviewsPerMonth: 1000000;
|
|
247
|
+
readonly websites: -1;
|
|
248
|
+
readonly retentionDays: 730;
|
|
249
|
+
readonly seats: -1;
|
|
250
|
+
};
|
|
251
|
+
readonly features: {
|
|
252
|
+
readonly funnels: true;
|
|
253
|
+
readonly attribution: true;
|
|
254
|
+
readonly revenue: true;
|
|
255
|
+
readonly customDashboards: true;
|
|
256
|
+
readonly apiAccess: true;
|
|
257
|
+
readonly weeklyReports: true;
|
|
258
|
+
readonly support: "priority";
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
readonly enterprise: {
|
|
262
|
+
readonly id: "enterprise";
|
|
263
|
+
readonly name: "Enterprise";
|
|
264
|
+
readonly price: -1;
|
|
265
|
+
readonly limits: {
|
|
266
|
+
readonly pageviewsPerMonth: -1;
|
|
267
|
+
readonly websites: -1;
|
|
268
|
+
readonly retentionDays: -1;
|
|
269
|
+
readonly seats: -1;
|
|
270
|
+
};
|
|
271
|
+
readonly features: {
|
|
272
|
+
readonly funnels: true;
|
|
273
|
+
readonly attribution: true;
|
|
274
|
+
readonly revenue: true;
|
|
275
|
+
readonly customDashboards: true;
|
|
276
|
+
readonly apiAccess: true;
|
|
277
|
+
readonly weeklyReports: true;
|
|
278
|
+
readonly support: "dedicated";
|
|
279
|
+
readonly sso: true;
|
|
280
|
+
readonly auditLogs: true;
|
|
281
|
+
readonly customRetention: true;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
92
284
|
};
|
|
93
285
|
/**
|
|
94
286
|
* Plan feature names for display
|
|
95
287
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
288
|
+
declare const PLAN_FEATURES: {
|
|
289
|
+
readonly funnels: "Funnel Analytics";
|
|
290
|
+
readonly attribution: "Attribution Reports";
|
|
291
|
+
readonly revenue: "Revenue Tracking";
|
|
292
|
+
readonly customDashboards: "Custom Dashboards";
|
|
293
|
+
readonly apiAccess: "API Access";
|
|
294
|
+
readonly weeklyReports: "Weekly Email Reports";
|
|
295
|
+
readonly sso: "SSO/SAML";
|
|
296
|
+
readonly auditLogs: "Audit Logs";
|
|
297
|
+
readonly customRetention: "Custom Data Retention";
|
|
106
298
|
};
|
|
107
299
|
/**
|
|
108
300
|
* Usage warning thresholds (percentages)
|
|
109
301
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
302
|
+
declare const USAGE_THRESHOLDS: {
|
|
303
|
+
readonly warning: 90;
|
|
304
|
+
readonly critical: 95;
|
|
113
305
|
};
|
|
114
306
|
/**
|
|
115
307
|
* Billing-related error codes
|
|
116
308
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
309
|
+
declare const BILLING_ERRORS: {
|
|
310
|
+
readonly quotaExceeded: "QUOTA_EXCEEDED";
|
|
311
|
+
readonly planRequired: "PLAN_REQUIRED";
|
|
312
|
+
readonly featureNotAvailable: "FEATURE_NOT_AVAILABLE";
|
|
313
|
+
readonly subscriptionInactive: "SUBSCRIPTION_INACTIVE";
|
|
314
|
+
readonly paymentFailed: "PAYMENT_FAILED";
|
|
123
315
|
};
|
|
124
316
|
/**
|
|
125
317
|
* API endpoint configuration
|
|
126
318
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
319
|
+
declare const API_ENDPOINTS: {
|
|
320
|
+
readonly production: "https://api.entrolytics.click";
|
|
321
|
+
readonly development: "http://localhost:3001";
|
|
130
322
|
};
|
|
131
323
|
/**
|
|
132
324
|
* Default API host
|
|
133
325
|
*/
|
|
134
|
-
|
|
326
|
+
declare const DEFAULT_API_HOST: "http://localhost:3001" | "https://api.entrolytics.click";
|
|
135
327
|
/**
|
|
136
328
|
* Environment variable naming conventions by framework
|
|
137
329
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
190
|
-
readonly host: "ENTROLYTICS_HOST";
|
|
191
|
-
readonly envFile: ".env";
|
|
192
|
-
};
|
|
330
|
+
declare const ENV_VAR_NAMES: {
|
|
331
|
+
readonly nextjs: {
|
|
332
|
+
readonly websiteId: "NEXT_PUBLIC_ENTROLYTICS_WEBSITE_ID";
|
|
333
|
+
readonly host: "NEXT_PUBLIC_ENTROLYTICS_HOST";
|
|
334
|
+
readonly envFile: ".env.local";
|
|
335
|
+
};
|
|
336
|
+
readonly react: {
|
|
337
|
+
readonly websiteId: "VITE_ENTROLYTICS_WEBSITE_ID";
|
|
338
|
+
readonly host: "VITE_ENTROLYTICS_HOST";
|
|
339
|
+
readonly envFile: ".env";
|
|
340
|
+
};
|
|
341
|
+
readonly vue: {
|
|
342
|
+
readonly websiteId: "VITE_ENTROLYTICS_WEBSITE_ID";
|
|
343
|
+
readonly host: "VITE_ENTROLYTICS_HOST";
|
|
344
|
+
readonly envFile: ".env";
|
|
345
|
+
};
|
|
346
|
+
readonly svelte: {
|
|
347
|
+
readonly websiteId: "PUBLIC_ENTROLYTICS_WEBSITE_ID";
|
|
348
|
+
readonly host: "PUBLIC_ENTROLYTICS_HOST";
|
|
349
|
+
readonly envFile: ".env";
|
|
350
|
+
};
|
|
351
|
+
readonly astro: {
|
|
352
|
+
readonly websiteId: "PUBLIC_ENTROLYTICS_WEBSITE_ID";
|
|
353
|
+
readonly host: "PUBLIC_ENTROLYTICS_HOST";
|
|
354
|
+
readonly envFile: ".env";
|
|
355
|
+
};
|
|
356
|
+
readonly html: {
|
|
357
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
358
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
359
|
+
readonly envFile: ".env";
|
|
360
|
+
};
|
|
361
|
+
readonly node: {
|
|
362
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
363
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
364
|
+
readonly envFile: ".env";
|
|
365
|
+
};
|
|
366
|
+
readonly php: {
|
|
367
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
368
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
369
|
+
readonly envFile: ".env";
|
|
370
|
+
};
|
|
371
|
+
readonly python: {
|
|
372
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
373
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
374
|
+
readonly envFile: ".env";
|
|
375
|
+
};
|
|
376
|
+
readonly go: {
|
|
377
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
378
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
379
|
+
readonly envFile: ".env";
|
|
380
|
+
};
|
|
193
381
|
};
|
|
194
382
|
/**
|
|
195
383
|
* CLI configuration constants
|
|
196
384
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
385
|
+
declare const CLI_CONFIG: {
|
|
386
|
+
readonly tokenExpiryMinutes: 15;
|
|
387
|
+
readonly maxTokensPerUser: 10;
|
|
388
|
+
readonly pollIntervalMs: 2000;
|
|
389
|
+
readonly setupTimeoutMs: 300000;
|
|
390
|
+
readonly minCliVersion: "1.0.0";
|
|
203
391
|
};
|
|
204
392
|
/**
|
|
205
393
|
* Core event types - matches backend protocol values exactly
|
|
206
394
|
* Used by: API Server, SDKs, CLI, worker processes
|
|
207
395
|
* See: entrolytics/packages/protocol/src/events.ts
|
|
208
396
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
397
|
+
declare const EVENT_TYPES: {
|
|
398
|
+
readonly pageView: "pageview";
|
|
399
|
+
readonly custom: "custom_event";
|
|
400
|
+
readonly click: "click";
|
|
213
401
|
};
|
|
214
402
|
/**
|
|
215
403
|
* Extended event types for SDK-level semantics
|
|
216
404
|
* These are higher-level event categories used by SDKs
|
|
217
405
|
* They map to the core EVENT_TYPES when sent to the backend
|
|
218
406
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
407
|
+
declare const SDK_EVENT_TYPES: {
|
|
408
|
+
readonly pageView: "pageview";
|
|
409
|
+
readonly click: "click";
|
|
410
|
+
readonly formSubmit: "form_submit";
|
|
411
|
+
readonly custom: "custom_event";
|
|
412
|
+
readonly error: "error";
|
|
413
|
+
readonly performance: "performance";
|
|
226
414
|
};
|
|
227
415
|
/**
|
|
228
416
|
* Web Vitals metric types (Phase 2)
|
|
229
417
|
* Core Web Vitals: LCP, INP, CLS
|
|
230
418
|
* Additional: TTFB, FCP
|
|
231
419
|
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
420
|
+
declare const VITAL_TYPES: {
|
|
421
|
+
readonly LCP: "LCP";
|
|
422
|
+
readonly INP: "INP";
|
|
423
|
+
readonly CLS: "CLS";
|
|
424
|
+
readonly TTFB: "TTFB";
|
|
425
|
+
readonly FCP: "FCP";
|
|
238
426
|
};
|
|
239
427
|
/**
|
|
240
428
|
* Web Vitals rating thresholds
|
|
241
429
|
*/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
430
|
+
declare const VITAL_RATINGS: {
|
|
431
|
+
readonly good: "good";
|
|
432
|
+
readonly needsImprovement: "needs-improvement";
|
|
433
|
+
readonly poor: "poor";
|
|
246
434
|
};
|
|
247
435
|
/**
|
|
248
436
|
* Web Vitals thresholds by metric (in milliseconds, except CLS which is unitless)
|
|
249
437
|
*/
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
438
|
+
declare const VITAL_THRESHOLDS: {
|
|
439
|
+
readonly LCP: {
|
|
440
|
+
readonly good: 2500;
|
|
441
|
+
readonly poor: 4000;
|
|
442
|
+
};
|
|
443
|
+
readonly INP: {
|
|
444
|
+
readonly good: 200;
|
|
445
|
+
readonly poor: 500;
|
|
446
|
+
};
|
|
447
|
+
readonly CLS: {
|
|
448
|
+
readonly good: 0.1;
|
|
449
|
+
readonly poor: 0.25;
|
|
450
|
+
};
|
|
451
|
+
readonly TTFB: {
|
|
452
|
+
readonly good: 800;
|
|
453
|
+
readonly poor: 1800;
|
|
454
|
+
};
|
|
455
|
+
readonly FCP: {
|
|
456
|
+
readonly good: 1800;
|
|
457
|
+
readonly poor: 3000;
|
|
458
|
+
};
|
|
271
459
|
};
|
|
272
460
|
/**
|
|
273
461
|
* Navigation types for Web Vitals context
|
|
274
462
|
*/
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
463
|
+
declare const NAVIGATION_TYPES: {
|
|
464
|
+
readonly navigate: "navigate";
|
|
465
|
+
readonly reload: "reload";
|
|
466
|
+
readonly backForward: "back-forward";
|
|
467
|
+
readonly backForwardCache: "back-forward-cache";
|
|
468
|
+
readonly prerender: "prerender";
|
|
469
|
+
readonly restore: "restore";
|
|
282
470
|
};
|
|
283
471
|
/**
|
|
284
472
|
* Form event types (Phase 2)
|
|
285
473
|
*/
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
474
|
+
declare const FORM_EVENT_TYPES: {
|
|
475
|
+
readonly start: "start";
|
|
476
|
+
readonly fieldFocus: "field_focus";
|
|
477
|
+
readonly fieldBlur: "field_blur";
|
|
478
|
+
readonly fieldError: "field_error";
|
|
479
|
+
readonly submit: "submit";
|
|
480
|
+
readonly abandon: "abandon";
|
|
293
481
|
};
|
|
294
482
|
/**
|
|
295
483
|
* Form field types
|
|
296
484
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
485
|
+
declare const FORM_FIELD_TYPES: {
|
|
486
|
+
readonly text: "text";
|
|
487
|
+
readonly email: "email";
|
|
488
|
+
readonly password: "password";
|
|
489
|
+
readonly tel: "tel";
|
|
490
|
+
readonly number: "number";
|
|
491
|
+
readonly url: "url";
|
|
492
|
+
readonly textarea: "textarea";
|
|
493
|
+
readonly select: "select";
|
|
494
|
+
readonly checkbox: "checkbox";
|
|
495
|
+
readonly radio: "radio";
|
|
496
|
+
readonly date: "date";
|
|
497
|
+
readonly file: "file";
|
|
498
|
+
readonly hidden: "hidden";
|
|
499
|
+
readonly submit: "submit";
|
|
500
|
+
readonly other: "other";
|
|
313
501
|
};
|
|
314
502
|
/**
|
|
315
503
|
* Deployment platform sources (Phase 2)
|
|
316
504
|
*/
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
505
|
+
declare const DEPLOYMENT_SOURCES: {
|
|
506
|
+
readonly vercel: "vercel";
|
|
507
|
+
readonly netlify: "netlify";
|
|
508
|
+
readonly cloudflare: "cloudflare";
|
|
509
|
+
readonly railway: "railway";
|
|
510
|
+
readonly render: "render";
|
|
511
|
+
readonly fly: "fly";
|
|
512
|
+
readonly heroku: "heroku";
|
|
513
|
+
readonly aws: "aws";
|
|
514
|
+
readonly gcp: "gcp";
|
|
515
|
+
readonly azure: "azure";
|
|
516
|
+
readonly custom: "custom";
|
|
329
517
|
};
|
|
330
518
|
/**
|
|
331
519
|
* Deployment environment variables by platform
|
|
332
520
|
*/
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
521
|
+
declare const DEPLOYMENT_ENV_VARS: {
|
|
522
|
+
readonly vercel: {
|
|
523
|
+
readonly deployId: "VERCEL_DEPLOYMENT_ID";
|
|
524
|
+
readonly gitSha: "VERCEL_GIT_COMMIT_SHA";
|
|
525
|
+
readonly gitBranch: "VERCEL_GIT_COMMIT_REF";
|
|
526
|
+
readonly url: "VERCEL_URL";
|
|
527
|
+
};
|
|
528
|
+
readonly netlify: {
|
|
529
|
+
readonly deployId: "DEPLOY_ID";
|
|
530
|
+
readonly gitSha: "COMMIT_REF";
|
|
531
|
+
readonly gitBranch: "BRANCH";
|
|
532
|
+
readonly url: "DEPLOY_URL";
|
|
533
|
+
};
|
|
534
|
+
readonly cloudflare: {
|
|
535
|
+
readonly deployId: "CF_PAGES_COMMIT_SHA";
|
|
536
|
+
readonly gitSha: "CF_PAGES_COMMIT_SHA";
|
|
537
|
+
readonly gitBranch: "CF_PAGES_BRANCH";
|
|
538
|
+
readonly url: "CF_PAGES_URL";
|
|
539
|
+
};
|
|
352
540
|
};
|
|
353
541
|
/**
|
|
354
542
|
* HTTP status codes
|
|
355
543
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
544
|
+
declare const HTTP_STATUS: {
|
|
545
|
+
readonly ok: 200;
|
|
546
|
+
readonly created: 201;
|
|
547
|
+
readonly accepted: 202;
|
|
548
|
+
readonly noContent: 204;
|
|
549
|
+
readonly badRequest: 400;
|
|
550
|
+
readonly unauthorized: 401;
|
|
551
|
+
readonly forbidden: 403;
|
|
552
|
+
readonly notFound: 404;
|
|
553
|
+
readonly conflict: 409;
|
|
554
|
+
readonly tooManyRequests: 429;
|
|
555
|
+
readonly internalServerError: 500;
|
|
556
|
+
readonly serviceUnavailable: 503;
|
|
369
557
|
};
|
|
370
558
|
/**
|
|
371
559
|
* API route paths
|
|
372
560
|
*/
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
readonly websiteDeployments: (id: string) => string;
|
|
420
|
-
readonly health: "/api/health";
|
|
421
|
-
readonly healthIntegrations: "/api/health/integrations";
|
|
561
|
+
declare const API_ROUTES: {
|
|
562
|
+
readonly cliAuthToken: "/api/auth/cli/token";
|
|
563
|
+
readonly cliAuthTokens: "/api/auth/cli/tokens";
|
|
564
|
+
readonly cliValidate: "/api/auth/cli/validate";
|
|
565
|
+
readonly shareToken: (shareId: string) => string;
|
|
566
|
+
readonly links: "/api/links";
|
|
567
|
+
readonly linkRedirect: (slug: string) => string;
|
|
568
|
+
readonly websites: "/api/websites";
|
|
569
|
+
readonly websiteById: (id: string) => string;
|
|
570
|
+
readonly websiteEvents: (id: string) => string;
|
|
571
|
+
readonly websiteRecentEvents: (id: string) => string;
|
|
572
|
+
readonly userOnboarding: "/api/user/onboarding";
|
|
573
|
+
readonly userProfile: "/api/user/profile";
|
|
574
|
+
readonly userEmailPreferences: "/api/me/email-preferences";
|
|
575
|
+
readonly billingUsage: "/api/billing/usage";
|
|
576
|
+
readonly billingCheckout: "/api/billing/checkout";
|
|
577
|
+
readonly billingPortal: "/api/billing/portal";
|
|
578
|
+
readonly billingWebhook: "/api/billing/webhook";
|
|
579
|
+
readonly analyticsOverview: (websiteId: string) => string;
|
|
580
|
+
readonly analyticsTimeseries: (websiteId: string) => string;
|
|
581
|
+
readonly analyticsTopPages: (websiteId: string) => string;
|
|
582
|
+
readonly analyticsTopReferrers: (websiteId: string) => string;
|
|
583
|
+
readonly analyticsGeography: (websiteId: string) => string;
|
|
584
|
+
readonly analyticsDevices: (websiteId: string) => string;
|
|
585
|
+
readonly collect: "/collect";
|
|
586
|
+
readonly collectBatch: "/collect/batch";
|
|
587
|
+
readonly send: "/collect";
|
|
588
|
+
readonly collectVitals: "/api/collect/vitals";
|
|
589
|
+
readonly collectVitalsBatch: "/api/collect/vitals/batch";
|
|
590
|
+
readonly collectForms: "/api/collect/forms";
|
|
591
|
+
readonly collectFormsBatch: "/api/collect/forms/batch";
|
|
592
|
+
readonly vitalsOverview: "/api/vitals/overview";
|
|
593
|
+
readonly vitalsByPage: "/api/vitals/by-page";
|
|
594
|
+
readonly vitalsTrend: "/api/vitals/trend";
|
|
595
|
+
readonly vitalsRecent: "/api/vitals/recent";
|
|
596
|
+
readonly vitalsPageBreakdown: "/api/vitals/page-breakdown";
|
|
597
|
+
readonly formsConversions: "/api/forms/conversions";
|
|
598
|
+
readonly formsFieldMetrics: "/api/forms/field-metrics";
|
|
599
|
+
readonly formsFunnel: "/api/forms/funnel";
|
|
600
|
+
readonly formsRecent: "/api/forms/recent";
|
|
601
|
+
readonly deployments: "/api/deployments";
|
|
602
|
+
readonly deploymentByWebsite: (id: string) => string;
|
|
603
|
+
readonly deploymentCompare: (id: string) => string;
|
|
604
|
+
readonly deploymentLatest: (id: string) => string;
|
|
605
|
+
readonly health: "/api/health";
|
|
606
|
+
readonly healthIntegrations: "/api/health/integrations";
|
|
422
607
|
};
|
|
423
608
|
/**
|
|
424
609
|
* Onboarding step identifiers
|
|
425
610
|
*/
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
611
|
+
declare const ONBOARDING_STEPS: {
|
|
612
|
+
readonly welcome: "welcome";
|
|
613
|
+
readonly createWebsite: "create-website";
|
|
614
|
+
readonly installTracking: "install-tracking";
|
|
615
|
+
readonly verify: "verify";
|
|
616
|
+
readonly complete: "complete";
|
|
617
|
+
readonly skipped: "skipped";
|
|
433
618
|
};
|
|
434
619
|
/**
|
|
435
620
|
* CLI token statuses
|
|
436
621
|
*/
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
622
|
+
declare const CLI_TOKEN_STATUS: {
|
|
623
|
+
readonly pending: "pending";
|
|
624
|
+
readonly used: "used";
|
|
625
|
+
readonly expired: "expired";
|
|
626
|
+
readonly revoked: "revoked";
|
|
442
627
|
};
|
|
443
628
|
/**
|
|
444
629
|
* User roles
|
|
445
630
|
*/
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
631
|
+
declare const USER_ROLES: {
|
|
632
|
+
readonly admin: "admin";
|
|
633
|
+
readonly user: "user";
|
|
634
|
+
readonly viewer: "viewer";
|
|
450
635
|
};
|
|
451
636
|
/**
|
|
452
637
|
* Framework package names
|
|
453
638
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
639
|
+
declare const FRAMEWORK_PACKAGES: {
|
|
640
|
+
readonly nextjs: "@entrolytics/nextjs-sdk";
|
|
641
|
+
readonly react: "@entrolytics/react-sdk";
|
|
642
|
+
readonly vue: "@entrolytics/vue-sdk";
|
|
643
|
+
readonly svelte: "@entrolytics/svelte-sdk";
|
|
644
|
+
readonly astro: "@entrolytics/astro-sdk";
|
|
645
|
+
readonly node: "@entrolytics/node-sdk";
|
|
461
646
|
};
|
|
462
647
|
/**
|
|
463
648
|
* Framework detection patterns
|
|
464
649
|
*/
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
650
|
+
declare const FRAMEWORK_PATTERNS: {
|
|
651
|
+
readonly nextjs: {
|
|
652
|
+
readonly files: readonly ["next.config.js", "next.config.mjs", "next.config.ts"];
|
|
653
|
+
readonly dependencies: readonly ["next"];
|
|
654
|
+
};
|
|
655
|
+
readonly react: {
|
|
656
|
+
readonly files: readonly ["vite.config.js", "vite.config.ts"];
|
|
657
|
+
readonly dependencies: readonly ["react", "vite"];
|
|
658
|
+
};
|
|
659
|
+
readonly vue: {
|
|
660
|
+
readonly files: readonly ["vite.config.js", "vite.config.ts"];
|
|
661
|
+
readonly dependencies: readonly ["vue", "vite"];
|
|
662
|
+
};
|
|
663
|
+
readonly svelte: {
|
|
664
|
+
readonly files: readonly ["svelte.config.js", "svelte.config.ts"];
|
|
665
|
+
readonly dependencies: readonly ["svelte"];
|
|
666
|
+
};
|
|
667
|
+
readonly astro: {
|
|
668
|
+
readonly files: readonly ["astro.config.mjs", "astro.config.ts"];
|
|
669
|
+
readonly dependencies: readonly ["astro"];
|
|
670
|
+
};
|
|
486
671
|
};
|
|
487
672
|
/**
|
|
488
673
|
* Rate limiting configuration
|
|
489
674
|
* Updated to match server-side implementation
|
|
490
675
|
*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
readonly cliTokenGeneration: {
|
|
513
|
-
readonly windowMs: 3600000;
|
|
514
|
-
readonly maxRequests: 10;
|
|
515
|
-
};
|
|
516
|
-
readonly cliValidation: {
|
|
517
|
-
readonly windowMs: 3600000;
|
|
518
|
-
readonly maxRequests: 100;
|
|
519
|
-
};
|
|
520
|
-
readonly eventCollection: {
|
|
521
|
-
readonly windowMs: 60000;
|
|
522
|
-
readonly maxRequests: 1000;
|
|
523
|
-
};
|
|
676
|
+
declare const RATE_LIMITS: {
|
|
677
|
+
readonly cliTokenExchange: {
|
|
678
|
+
readonly windowSeconds: 60;
|
|
679
|
+
readonly maxRequests: 5;
|
|
680
|
+
};
|
|
681
|
+
readonly shareTokenGeneration: {
|
|
682
|
+
readonly windowSeconds: 60;
|
|
683
|
+
readonly maxRequests: 10;
|
|
684
|
+
};
|
|
685
|
+
readonly linkCreation: {
|
|
686
|
+
readonly windowSeconds: 60;
|
|
687
|
+
readonly maxRequests: 20;
|
|
688
|
+
};
|
|
689
|
+
readonly linkRedirect: {
|
|
690
|
+
readonly windowSeconds: 60;
|
|
691
|
+
readonly maxRequests: 100;
|
|
692
|
+
};
|
|
693
|
+
readonly apiGeneral: {
|
|
694
|
+
readonly windowSeconds: 60;
|
|
695
|
+
readonly maxRequests: 100;
|
|
696
|
+
};
|
|
524
697
|
};
|
|
525
698
|
/**
|
|
526
699
|
* Error messages
|
|
527
700
|
*/
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
701
|
+
declare const ERROR_MESSAGES: {
|
|
702
|
+
readonly unauthorized: "Unauthorized access";
|
|
703
|
+
readonly forbidden: "Access forbidden";
|
|
704
|
+
readonly tokenExpired: "Token has expired";
|
|
705
|
+
readonly tokenInvalid: "Invalid token";
|
|
706
|
+
readonly tokenNotFound: "Token not found";
|
|
707
|
+
readonly tokenAlreadyUsed: "Token has already been used";
|
|
708
|
+
readonly tokenRevoked: "Token has been revoked";
|
|
709
|
+
readonly tokenMissingJti: "Token missing JTI - please re-authenticate";
|
|
710
|
+
readonly userBanned: "User account has been banned";
|
|
711
|
+
readonly userDeleted: "User account has been deleted";
|
|
712
|
+
readonly shareTokenExpired: "Share token has expired";
|
|
713
|
+
readonly shareTokenRevoked: "Share has been revoked";
|
|
714
|
+
readonly shareTokenInvalid: "Invalid share token";
|
|
715
|
+
readonly invalidUrl: "Invalid URL provided";
|
|
716
|
+
readonly invalidUrlProtocol: "URL must use http or https protocol";
|
|
717
|
+
readonly openRedirectBlocked: "Open redirect attempt blocked";
|
|
718
|
+
readonly invalidInput: "Invalid input provided";
|
|
719
|
+
readonly missingRequired: "Missing required fields";
|
|
720
|
+
readonly invalidFormat: "Invalid format";
|
|
721
|
+
readonly notFound: "Resource not found";
|
|
722
|
+
readonly websiteNotFound: "Website not found";
|
|
723
|
+
readonly userNotFound: "User not found";
|
|
724
|
+
readonly linkNotFound: "Link not found";
|
|
725
|
+
readonly tooManyRequests: "Too many requests. Please try again later.";
|
|
726
|
+
readonly rateLimitExceeded: "Rate limit exceeded";
|
|
727
|
+
readonly internalError: "Internal server error";
|
|
728
|
+
readonly serviceUnavailable: "Service temporarily unavailable";
|
|
556
729
|
};
|
|
557
730
|
/**
|
|
558
731
|
* Success messages
|
|
559
732
|
*/
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
733
|
+
declare const SUCCESS_MESSAGES: {
|
|
734
|
+
readonly tokenGenerated: "Setup token generated successfully";
|
|
735
|
+
readonly tokenValidated: "Token validated successfully";
|
|
736
|
+
readonly tokenRevoked: "Token revoked successfully";
|
|
737
|
+
readonly allTokensRevoked: "All tokens revoked successfully";
|
|
738
|
+
readonly websiteCreated: "Website created successfully";
|
|
739
|
+
readonly linkCreated: "Link created successfully";
|
|
740
|
+
readonly shareCreated: "Share created successfully";
|
|
741
|
+
readonly onboardingComplete: "Onboarding completed successfully";
|
|
742
|
+
readonly setupComplete: "Setup completed successfully";
|
|
570
743
|
};
|
|
571
744
|
/**
|
|
572
745
|
* CLI Access Token metadata
|
|
573
746
|
*/
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
747
|
+
interface CliAccessTokenMetadata {
|
|
748
|
+
jti: string;
|
|
749
|
+
createdAt: string;
|
|
750
|
+
expiresAt: string;
|
|
751
|
+
lastUsedAt: string | null;
|
|
752
|
+
ipAddress: string | null;
|
|
753
|
+
userAgent: string | null;
|
|
581
754
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
755
|
+
type Framework = keyof typeof ENV_VAR_NAMES;
|
|
756
|
+
type EventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
|
|
757
|
+
type SdkEventType = (typeof SDK_EVENT_TYPES)[keyof typeof SDK_EVENT_TYPES];
|
|
758
|
+
type OnboardingStep = (typeof ONBOARDING_STEPS)[keyof typeof ONBOARDING_STEPS];
|
|
759
|
+
type CliTokenStatus = (typeof CLI_TOKEN_STATUS)[keyof typeof CLI_TOKEN_STATUS];
|
|
760
|
+
type UserRole = (typeof USER_ROLES)[keyof typeof USER_ROLES];
|
|
761
|
+
type PlanId = keyof typeof PLANS;
|
|
762
|
+
type Plan = (typeof PLANS)[PlanId];
|
|
763
|
+
type PlanFeature = keyof typeof PLAN_FEATURES;
|
|
764
|
+
type BillingError = (typeof BILLING_ERRORS)[keyof typeof BILLING_ERRORS];
|
|
765
|
+
type VitalType = (typeof VITAL_TYPES)[keyof typeof VITAL_TYPES];
|
|
766
|
+
type VitalRating = (typeof VITAL_RATINGS)[keyof typeof VITAL_RATINGS];
|
|
767
|
+
type NavigationType = (typeof NAVIGATION_TYPES)[keyof typeof NAVIGATION_TYPES];
|
|
768
|
+
type FormEventType = (typeof FORM_EVENT_TYPES)[keyof typeof FORM_EVENT_TYPES];
|
|
769
|
+
type FormFieldType = (typeof FORM_FIELD_TYPES)[keyof typeof FORM_FIELD_TYPES];
|
|
770
|
+
type DeploymentSource = (typeof DEPLOYMENT_SOURCES)[keyof typeof DEPLOYMENT_SOURCES];
|
|
771
|
+
declare const EVENT_TYPE_VALUES: [EventType, ...EventType[]];
|
|
772
|
+
declare const SDK_EVENT_TYPE_VALUES: [SdkEventType, ...SdkEventType[]];
|
|
773
|
+
declare const VITAL_TYPE_VALUES: [VitalType, ...VitalType[]];
|
|
774
|
+
declare const VITAL_RATING_VALUES: [VitalRating, ...VitalRating[]];
|
|
775
|
+
declare const NAVIGATION_TYPE_VALUES: [NavigationType, ...NavigationType[]];
|
|
776
|
+
declare const FORM_EVENT_TYPE_VALUES: [FormEventType, ...FormEventType[]];
|
|
777
|
+
declare const FORM_FIELD_TYPE_VALUES: [FormFieldType, ...FormFieldType[]];
|
|
778
|
+
declare const DEPLOYMENT_SOURCE_VALUES: [DeploymentSource, ...DeploymentSource[]];
|
|
779
|
+
declare function isEventType(value: string): value is EventType;
|
|
780
|
+
declare function isSdkEventType(value: string): value is SdkEventType;
|
|
781
|
+
declare function isVitalType(value: string): value is VitalType;
|
|
782
|
+
declare function isVitalRating(value: string): value is VitalRating;
|
|
783
|
+
declare function isNavigationType(value: string): value is NavigationType;
|
|
784
|
+
declare function isFormEventType(value: string): value is FormEventType;
|
|
785
|
+
declare function isFormFieldType(value: string): value is FormFieldType;
|
|
786
|
+
declare function isDeploymentSource(value: string): value is DeploymentSource;
|
|
787
|
+
declare function normalizeDeploymentSource(value: string | null | undefined): DeploymentSource;
|
|
615
788
|
/**
|
|
616
789
|
* Web Vital data structure for SDK tracking
|
|
617
790
|
*/
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
791
|
+
interface WebVitalData {
|
|
792
|
+
metric: VitalType;
|
|
793
|
+
value: number;
|
|
794
|
+
rating: VitalRating;
|
|
795
|
+
delta?: number;
|
|
796
|
+
id?: string;
|
|
797
|
+
navigationType?: NavigationType;
|
|
798
|
+
attribution?: Record<string, unknown>;
|
|
799
|
+
url?: string;
|
|
800
|
+
path?: string;
|
|
628
801
|
}
|
|
629
802
|
/**
|
|
630
803
|
* Form event data structure for SDK tracking
|
|
631
804
|
*/
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
805
|
+
interface FormEventData {
|
|
806
|
+
eventType: FormEventType;
|
|
807
|
+
formId: string;
|
|
808
|
+
formName?: string;
|
|
809
|
+
urlPath: string;
|
|
810
|
+
fieldName?: string;
|
|
811
|
+
fieldType?: FormFieldType;
|
|
812
|
+
fieldIndex?: number;
|
|
813
|
+
timeOnField?: number;
|
|
814
|
+
timeSinceStart?: number;
|
|
815
|
+
errorMessage?: string;
|
|
816
|
+
success?: boolean;
|
|
644
817
|
}
|
|
645
818
|
/**
|
|
646
819
|
* Deployment context for SDK tracking
|
|
647
820
|
*/
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
821
|
+
interface DeploymentContext {
|
|
822
|
+
deployId: string;
|
|
823
|
+
gitSha?: string;
|
|
824
|
+
gitBranch?: string;
|
|
825
|
+
deployUrl?: string;
|
|
826
|
+
source?: DeploymentSource;
|
|
654
827
|
}
|
|
655
828
|
/**
|
|
656
829
|
* Utility functions
|
|
657
830
|
*/
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
831
|
+
declare function getEnvVarNames(framework: Framework): {
|
|
832
|
+
readonly websiteId: "NEXT_PUBLIC_ENTROLYTICS_WEBSITE_ID";
|
|
833
|
+
readonly host: "NEXT_PUBLIC_ENTROLYTICS_HOST";
|
|
834
|
+
readonly envFile: ".env.local";
|
|
662
835
|
} | {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
readonly fallback: {
|
|
667
|
-
readonly websiteId: "REACT_APP_ENTROLYTICS_WEBSITE_ID";
|
|
668
|
-
readonly host: "REACT_APP_ENTROLYTICS_HOST";
|
|
669
|
-
};
|
|
836
|
+
readonly websiteId: "VITE_ENTROLYTICS_WEBSITE_ID";
|
|
837
|
+
readonly host: "VITE_ENTROLYTICS_HOST";
|
|
838
|
+
readonly envFile: ".env";
|
|
670
839
|
} | {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
840
|
+
readonly websiteId: "VITE_ENTROLYTICS_WEBSITE_ID";
|
|
841
|
+
readonly host: "VITE_ENTROLYTICS_HOST";
|
|
842
|
+
readonly envFile: ".env";
|
|
674
843
|
} | {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
844
|
+
readonly websiteId: "PUBLIC_ENTROLYTICS_WEBSITE_ID";
|
|
845
|
+
readonly host: "PUBLIC_ENTROLYTICS_HOST";
|
|
846
|
+
readonly envFile: ".env";
|
|
678
847
|
} | {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
848
|
+
readonly websiteId: "PUBLIC_ENTROLYTICS_WEBSITE_ID";
|
|
849
|
+
readonly host: "PUBLIC_ENTROLYTICS_HOST";
|
|
850
|
+
readonly envFile: ".env";
|
|
682
851
|
} | {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
852
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
853
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
854
|
+
readonly envFile: ".env";
|
|
686
855
|
} | {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
856
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
857
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
858
|
+
readonly envFile: ".env";
|
|
690
859
|
} | {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
860
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
861
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
862
|
+
readonly envFile: ".env";
|
|
694
863
|
} | {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
864
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
865
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
866
|
+
readonly envFile: ".env";
|
|
698
867
|
} | {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
868
|
+
readonly websiteId: "ENTROLYTICS_WEBSITE_ID";
|
|
869
|
+
readonly host: "ENTROLYTICS_HOST";
|
|
870
|
+
readonly envFile: ".env";
|
|
702
871
|
};
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
872
|
+
declare function getFrameworkPackage(framework: Framework): "@entrolytics/astro-sdk" | "@entrolytics/nextjs-sdk" | "@entrolytics/node-sdk" | "@entrolytics/react-sdk" | "@entrolytics/svelte-sdk" | "@entrolytics/vue-sdk";
|
|
873
|
+
declare function isValidFramework(framework: string): framework is Framework;
|
|
874
|
+
declare function getApiRoute(route: keyof typeof API_ROUTES, ...args: string[]): string;
|
|
706
875
|
/**
|
|
707
876
|
* Get plan by ID
|
|
708
877
|
*/
|
|
709
|
-
|
|
878
|
+
declare function getPlan(planId: PlanId): Plan;
|
|
710
879
|
/**
|
|
711
880
|
* Check if a feature is available for a plan
|
|
712
881
|
*/
|
|
713
|
-
|
|
882
|
+
declare function isPlanFeatureEnabled(planId: PlanId, feature: PlanFeature): boolean;
|
|
714
883
|
/**
|
|
715
884
|
* Get plan limit value (-1 means unlimited)
|
|
716
885
|
*/
|
|
717
|
-
|
|
886
|
+
declare function getPlanLimit(planId: PlanId, limit: keyof Plan["limits"]): number;
|
|
718
887
|
/**
|
|
719
888
|
* Check if usage is at warning threshold
|
|
720
889
|
*/
|
|
721
|
-
|
|
890
|
+
declare function isUsageWarning(current: number, limit: number): boolean;
|
|
722
891
|
/**
|
|
723
892
|
* Check if usage is at critical threshold
|
|
724
893
|
*/
|
|
725
|
-
|
|
894
|
+
declare function isUsageCritical(current: number, limit: number): boolean;
|
|
726
895
|
/**
|
|
727
896
|
* Calculate Web Vital rating from value (Phase 2)
|
|
728
897
|
*/
|
|
729
|
-
|
|
898
|
+
declare function getVitalRating(metric: VitalType, value: number): VitalRating;
|
|
730
899
|
/**
|
|
731
900
|
* Detect deployment context from environment variables (Phase 2)
|
|
732
901
|
* Works in Node.js environments only - returns null in browser
|
|
733
902
|
*/
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
export
|
|
903
|
+
declare function detectDeploymentContext(): DeploymentContext | null;
|
|
904
|
+
//#endregion
|
|
905
|
+
export { API_ENDPOINTS, API_ROUTES, ActivePage, BILLING_ERRORS, BillingError, CLI_CONFIG, CLI_TOKEN_STATUS, CliAccessTokenMetadata, CliTokenStatus, DEFAULT_API_HOST, DEPLOYMENT_ENV_VARS, DEPLOYMENT_SOURCES, DEPLOYMENT_SOURCE_VALUES, DateRangeFilter, DeploymentContext, DeploymentSource, DeviceStats, DeviceType, ENV_VAR_NAMES, ERROR_MESSAGES, EVENT_TYPES, EVENT_TYPE_VALUES, EntrolyticsEvent, EventDBRow, EventPayload, EventType, FORM_EVENT_TYPES, FORM_EVENT_TYPE_VALUES, FORM_FIELD_TYPES, FORM_FIELD_TYPE_VALUES, FRAMEWORK_PACKAGES, FRAMEWORK_PATTERNS, FormEventData, FormEventType, FormFieldType, Framework, GeoStats, HTTP_STATUS, NAVIGATION_TYPES, NAVIGATION_TYPE_VALUES, NavigationType, ONBOARDING_STEPS, OnboardingStep, OverviewStats, PLANS, PLAN_FEATURES, Plan, PlanFeature, PlanId, RATE_LIMITS, RealtimeEvent, RealtimeStats, Referrer, SDK_EVENT_TYPES, SDK_EVENT_TYPE_VALUES, SUCCESS_MESSAGES, SdkEventType, TimeseriesData, TopPage, USAGE_THRESHOLDS, USER_ROLES, UserRole, VITAL_RATINGS, VITAL_RATING_VALUES, VITAL_THRESHOLDS, VITAL_TYPES, VITAL_TYPE_VALUES, VitalRating, VitalType, WebVitalData, detectDeploymentContext, getApiRoute, getEnvVarNames, getFrameworkPackage, getPlan, getPlanLimit, getVitalRating, isDeploymentSource, isEventType, isFormEventType, isFormFieldType, isNavigationType, isPlanFeatureEnabled, isSdkEventType, isUsageCritical, isUsageWarning, isValidFramework, isVitalRating, isVitalType, normalizeDeploymentSource };
|
|
737
906
|
//# sourceMappingURL=index.d.ts.map
|