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