lytx 0.3.0
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/.env.example +37 -0
- package/README.md +486 -0
- package/alchemy.run.ts +155 -0
- package/cli/bootstrap-admin.ts +284 -0
- package/cli/deploy-staging.ts +692 -0
- package/cli/import-events.ts +628 -0
- package/cli/import-sites.ts +518 -0
- package/cli/index.ts +609 -0
- package/cli/init-db.ts +269 -0
- package/cli/migrate-to-durable-objects.ts +564 -0
- package/cli/migration-worker.ts +300 -0
- package/cli/performance-test.ts +588 -0
- package/cli/pg/client.ts +4 -0
- package/cli/pg/new-site.ts +153 -0
- package/cli/rollback-durable-objects.ts +622 -0
- package/cli/seed-data.ts +459 -0
- package/cli/setup.js +18 -0
- package/cli/setup.ts +463 -0
- package/cli/validate-migration.ts +200 -0
- package/cli/wrangler-migration.jsonc +28 -0
- package/db/adapter.ts +166 -0
- package/db/analytics_engine/client.ts +0 -0
- package/db/analytics_engine/sites.ts +0 -0
- package/db/client.ts +16 -0
- package/db/d1/client.ts +8 -0
- package/db/d1/drizzle.config.ts +35 -0
- package/db/d1/migrations/0000_true_maelstrom.sql +165 -0
- package/db/d1/migrations/0001_wonderful_bloodaxe.sql +12 -0
- package/db/d1/migrations/0002_late_frightful_four.sql +1 -0
- package/db/d1/migrations/0003_cuddly_obadiah_stane.sql +16 -0
- package/db/d1/migrations/0004_mute_stardust.sql +1 -0
- package/db/d1/migrations/0005_awesome_silvermane.sql +3 -0
- package/db/d1/migrations/0006_volatile_shriek.sql +2 -0
- package/db/d1/migrations/0007_superb_lila_cheney.sql +1 -0
- package/db/d1/migrations/0008_bitter_longshot.sql +17 -0
- package/db/d1/migrations/0009_wonderful_madame_masque.sql +28 -0
- package/db/d1/migrations/meta/0000_snapshot.json +1112 -0
- package/db/d1/migrations/meta/0001_snapshot.json +1187 -0
- package/db/d1/migrations/meta/0002_snapshot.json +1194 -0
- package/db/d1/migrations/meta/0003_snapshot.json +1296 -0
- package/db/d1/migrations/meta/0004_snapshot.json +1303 -0
- package/db/d1/migrations/meta/0005_snapshot.json +1325 -0
- package/db/d1/migrations/meta/0006_snapshot.json +1339 -0
- package/db/d1/migrations/meta/0007_snapshot.json +1347 -0
- package/db/d1/migrations/meta/0008_snapshot.json +1464 -0
- package/db/d1/migrations/meta/0009_snapshot.json +1648 -0
- package/db/d1/migrations/meta/_journal.json +76 -0
- package/db/d1/schema.ts +407 -0
- package/db/d1/sites.ts +374 -0
- package/db/d1/teamAiUsage.ts +101 -0
- package/db/d1/teams.ts +127 -0
- package/db/durable/drizzle.config.ts +8 -0
- package/db/durable/durableObjectClient.ts +480 -0
- package/db/durable/events.ts +100 -0
- package/db/durable/migrations/0000_fair_bucky.sql +38 -0
- package/db/durable/migrations/meta/0000_snapshot.json +278 -0
- package/db/durable/migrations/meta/_journal.json +13 -0
- package/db/durable/migrations/migrations.js +10 -0
- package/db/durable/schema.ts +5 -0
- package/db/durable/siteDurableObject.ts +1352 -0
- package/db/durable/types.ts +53 -0
- package/db/postgres/client.ts +13 -0
- package/db/postgres/drizzle.config.ts +12 -0
- package/db/postgres/migrations/0000_brainy_sprite.sql +116 -0
- package/db/postgres/migrations/meta/0000_snapshot.json +681 -0
- package/db/postgres/migrations/meta/_journal.json +13 -0
- package/db/postgres/schema.ts +145 -0
- package/db/postgres/sites.ts +118 -0
- package/db/tranformReports.ts +595 -0
- package/db/types.ts +55 -0
- package/endpoints/api_worker.tsx +1854 -0
- package/endpoints/site_do_worker.ts +11 -0
- package/index.d.ts +63 -0
- package/index.ts +83 -0
- package/lib/auth.ts +279 -0
- package/lib/geojson/world_countries.json +45307 -0
- package/lib/random_name.ts +41 -0
- package/lib/sendMail.ts +252 -0
- package/package.json +142 -0
- package/public/favicon.ico +0 -0
- package/public/images/android-chrome-192x192.png +0 -0
- package/public/images/android-chrome-512x512.png +0 -0
- package/public/images/apple-touch-icon.png +0 -0
- package/public/images/favicon-16x16.png +0 -0
- package/public/images/favicon-32x32.png +0 -0
- package/public/images/lytx_dark_dashboard.png +0 -0
- package/public/images/lytx_light_dashboard.png +0 -0
- package/public/images/safari-pinned-tab.svg +4 -0
- package/public/logo.png +0 -0
- package/public/site.webmanifest +26 -0
- package/public/sw.js +107 -0
- package/src/Document.tsx +86 -0
- package/src/api/ai_api.ts +1156 -0
- package/src/api/authMiddleware.ts +45 -0
- package/src/api/auth_api.ts +465 -0
- package/src/api/event_labels_api.ts +193 -0
- package/src/api/events_api.ts +210 -0
- package/src/api/queueWorker.ts +303 -0
- package/src/api/reports_api.ts +278 -0
- package/src/api/seed_api.ts +288 -0
- package/src/api/sites_api.ts +904 -0
- package/src/api/tag_api.ts +458 -0
- package/src/api/tag_api_v2.ts +289 -0
- package/src/api/team_api.ts +456 -0
- package/src/app/Dashboard.tsx +1339 -0
- package/src/app/Events.tsx +974 -0
- package/src/app/Explore.tsx +312 -0
- package/src/app/Layout.tsx +58 -0
- package/src/app/Settings.tsx +1302 -0
- package/src/app/components/DashboardCard.tsx +118 -0
- package/src/app/components/EditableCell.tsx +123 -0
- package/src/app/components/EventForm.tsx +93 -0
- package/src/app/components/MarketingFooter.tsx +49 -0
- package/src/app/components/MarketingNav.tsx +150 -0
- package/src/app/components/Nav.tsx +755 -0
- package/src/app/components/NewSiteSetup.tsx +298 -0
- package/src/app/components/SQLEditor.tsx +740 -0
- package/src/app/components/SiteSelector.tsx +126 -0
- package/src/app/components/SiteTag.tsx +42 -0
- package/src/app/components/SiteTagInstallCard.tsx +241 -0
- package/src/app/components/WorldMapCard.tsx +337 -0
- package/src/app/components/charts/ChartComponents.tsx +1481 -0
- package/src/app/components/charts/EventFunnel.tsx +45 -0
- package/src/app/components/charts/EventSummary.tsx +194 -0
- package/src/app/components/charts/SankeyFlows.tsx +72 -0
- package/src/app/components/marketing/CheckIcon.tsx +16 -0
- package/src/app/components/marketing/MarketingLayout.tsx +23 -0
- package/src/app/components/marketing/SectionHeading.tsx +35 -0
- package/src/app/components/reports/AskAiWorkspace.tsx +371 -0
- package/src/app/components/reports/CreateReportStarter.tsx +74 -0
- package/src/app/components/reports/DashboardRouteFiltersContext.tsx +14 -0
- package/src/app/components/reports/DashboardToolbar.tsx +154 -0
- package/src/app/components/reports/DashboardWorkspaceLayout.tsx +63 -0
- package/src/app/components/reports/DashboardWorkspaceShell.tsx +118 -0
- package/src/app/components/reports/ReportBuilderWorkspace.tsx +76 -0
- package/src/app/components/reports/custom/CustomReportBuilderPage.tsx +1667 -0
- package/src/app/components/reports/custom/ReportWidgetChart.tsx +297 -0
- package/src/app/components/reports/custom/buildWidgetSql.ts +151 -0
- package/src/app/components/reports/custom/chartPalettes.ts +18 -0
- package/src/app/components/reports/custom/types.ts +50 -0
- package/src/app/components/reports/reportBuilderMenuItems.ts +17 -0
- package/src/app/components/reports/useDashboardToolbarControls.tsx +235 -0
- package/src/app/components/ui/AlertBanner.tsx +101 -0
- package/src/app/components/ui/Button.tsx +55 -0
- package/src/app/components/ui/Card.tsx +80 -0
- package/src/app/components/ui/Input.tsx +72 -0
- package/src/app/components/ui/Link.tsx +23 -0
- package/src/app/components/ui/ReportBuilderMenu.tsx +246 -0
- package/src/app/components/ui/ThemeToggle.tsx +54 -0
- package/src/app/constants.ts +6 -0
- package/src/app/headers.ts +33 -0
- package/src/app/providers/AuthProvider.tsx +189 -0
- package/src/app/providers/ClientProviders.tsx +18 -0
- package/src/app/providers/QueryProvider.tsx +23 -0
- package/src/app/providers/ThemeProvider.tsx +88 -0
- package/src/app/utils/chartThemes.ts +146 -0
- package/src/app/utils/keybinds.ts +96 -0
- package/src/app/utils/media.tsx +24 -0
- package/src/client.tsx +114 -0
- package/src/config/createLytxAppConfig.ts +252 -0
- package/src/config/resourceNames.ts +88 -0
- package/src/db/index.ts +67 -0
- package/src/index.css +285 -0
- package/src/lib/featureFlags.ts +69 -0
- package/src/pages/GetStarted.tsx +290 -0
- package/src/pages/Home.tsx +268 -0
- package/src/pages/Login.tsx +283 -0
- package/src/pages/PrivacyPolicy.tsx +120 -0
- package/src/pages/Signup.tsx +267 -0
- package/src/pages/TermsOfService.tsx +126 -0
- package/src/pages/VerifyEmail.tsx +56 -0
- package/src/session/durableObject.ts +7 -0
- package/src/session/siteSchema.ts +86 -0
- package/src/session/types.ts +36 -0
- package/src/templates/README.md +80 -0
- package/src/templates/cleanFunctions.js +44 -0
- package/src/templates/embedFunctions.js +52 -0
- package/src/templates/lytx-shared.ts +662 -0
- package/src/templates/lytxpixel-core.ts +144 -0
- package/src/templates/lytxpixel.ts +267 -0
- package/src/templates/lytxpixelBrowser.js +634 -0
- package/src/templates/lytxpixelBrowser.mjs +634 -0
- package/src/templates/parseData.js +12 -0
- package/src/templates/script.ts +31 -0
- package/src/templates/template.tsx +50 -0
- package/src/templates/test.js +3 -0
- package/src/templates/trackWebEvents.ts +177 -0
- package/src/templates/vendors/clickcease.ts +8 -0
- package/src/templates/vendors/google.ts +174 -0
- package/src/templates/vendors/linkedin.ts +23 -0
- package/src/templates/vendors/meta.ts +56 -0
- package/src/templates/vendors/quantcast.ts +22 -0
- package/src/templates/vendors/simplfi.ts +7 -0
- package/src/types/app-context.ts +16 -0
- package/src/utilities/dashboardParams.ts +188 -0
- package/src/utilities/dashboardQueries.ts +537 -0
- package/src/utilities/dashboardTransforms.ts +167 -0
- package/src/utilities/dataValidation.ts +414 -0
- package/src/utilities/detector.ts +73 -0
- package/src/utilities/encrypt.ts +103 -0
- package/src/utilities/index.ts +13 -0
- package/src/utilities/parser.ts +117 -0
- package/src/utilities/performanceMonitoring.ts +570 -0
- package/src/utilities/route_interuptors.ts +24 -0
- package/src/worker.tsx +675 -0
- package/tsconfig.json +78 -0
- package/types/env.d.ts +16 -0
- package/types/rw.d.ts +7 -0
- package/types/shims.d.ts +53 -0
- package/types/vite.d.ts +19 -0
- package/vite/vite-plugin-pixel-bundle.ts +126 -0
- package/vite.config.ts +53 -0
- package/worker-configuration.d.ts +8401 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "f3c5055e-ce55-455b-93fd-4929317a7fa7",
|
|
5
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
|
+
"tables": {
|
|
7
|
+
"site_events": {
|
|
8
|
+
"name": "site_events",
|
|
9
|
+
"columns": {
|
|
10
|
+
"id": {
|
|
11
|
+
"name": "id",
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": true
|
|
16
|
+
},
|
|
17
|
+
"team_id": {
|
|
18
|
+
"name": "team_id",
|
|
19
|
+
"type": "integer",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": false,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"bot_data": {
|
|
25
|
+
"name": "bot_data",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": false,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
},
|
|
31
|
+
"browser": {
|
|
32
|
+
"name": "browser",
|
|
33
|
+
"type": "text",
|
|
34
|
+
"primaryKey": false,
|
|
35
|
+
"notNull": false,
|
|
36
|
+
"autoincrement": false
|
|
37
|
+
},
|
|
38
|
+
"city": {
|
|
39
|
+
"name": "city",
|
|
40
|
+
"type": "text",
|
|
41
|
+
"primaryKey": false,
|
|
42
|
+
"notNull": false,
|
|
43
|
+
"autoincrement": false
|
|
44
|
+
},
|
|
45
|
+
"client_page_url": {
|
|
46
|
+
"name": "client_page_url",
|
|
47
|
+
"type": "text",
|
|
48
|
+
"primaryKey": false,
|
|
49
|
+
"notNull": false,
|
|
50
|
+
"autoincrement": false
|
|
51
|
+
},
|
|
52
|
+
"country": {
|
|
53
|
+
"name": "country",
|
|
54
|
+
"type": "text",
|
|
55
|
+
"primaryKey": false,
|
|
56
|
+
"notNull": false,
|
|
57
|
+
"autoincrement": false
|
|
58
|
+
},
|
|
59
|
+
"created_at": {
|
|
60
|
+
"name": "created_at",
|
|
61
|
+
"type": "integer",
|
|
62
|
+
"primaryKey": false,
|
|
63
|
+
"notNull": true,
|
|
64
|
+
"autoincrement": false
|
|
65
|
+
},
|
|
66
|
+
"updated_at": {
|
|
67
|
+
"name": "updated_at",
|
|
68
|
+
"type": "integer",
|
|
69
|
+
"primaryKey": false,
|
|
70
|
+
"notNull": true,
|
|
71
|
+
"autoincrement": false
|
|
72
|
+
},
|
|
73
|
+
"custom_data": {
|
|
74
|
+
"name": "custom_data",
|
|
75
|
+
"type": "text",
|
|
76
|
+
"primaryKey": false,
|
|
77
|
+
"notNull": false,
|
|
78
|
+
"autoincrement": false
|
|
79
|
+
},
|
|
80
|
+
"device_type": {
|
|
81
|
+
"name": "device_type",
|
|
82
|
+
"type": "text",
|
|
83
|
+
"primaryKey": false,
|
|
84
|
+
"notNull": false,
|
|
85
|
+
"autoincrement": false
|
|
86
|
+
},
|
|
87
|
+
"event": {
|
|
88
|
+
"name": "event",
|
|
89
|
+
"type": "text",
|
|
90
|
+
"primaryKey": false,
|
|
91
|
+
"notNull": true,
|
|
92
|
+
"autoincrement": false
|
|
93
|
+
},
|
|
94
|
+
"operating_system": {
|
|
95
|
+
"name": "operating_system",
|
|
96
|
+
"type": "text",
|
|
97
|
+
"primaryKey": false,
|
|
98
|
+
"notNull": false,
|
|
99
|
+
"autoincrement": false
|
|
100
|
+
},
|
|
101
|
+
"page_url": {
|
|
102
|
+
"name": "page_url",
|
|
103
|
+
"type": "text",
|
|
104
|
+
"primaryKey": false,
|
|
105
|
+
"notNull": false,
|
|
106
|
+
"autoincrement": false
|
|
107
|
+
},
|
|
108
|
+
"postal": {
|
|
109
|
+
"name": "postal",
|
|
110
|
+
"type": "text",
|
|
111
|
+
"primaryKey": false,
|
|
112
|
+
"notNull": false,
|
|
113
|
+
"autoincrement": false
|
|
114
|
+
},
|
|
115
|
+
"query_params": {
|
|
116
|
+
"name": "query_params",
|
|
117
|
+
"type": "text",
|
|
118
|
+
"primaryKey": false,
|
|
119
|
+
"notNull": false,
|
|
120
|
+
"autoincrement": false
|
|
121
|
+
},
|
|
122
|
+
"referer": {
|
|
123
|
+
"name": "referer",
|
|
124
|
+
"type": "text",
|
|
125
|
+
"primaryKey": false,
|
|
126
|
+
"notNull": false,
|
|
127
|
+
"autoincrement": false
|
|
128
|
+
},
|
|
129
|
+
"region": {
|
|
130
|
+
"name": "region",
|
|
131
|
+
"type": "text",
|
|
132
|
+
"primaryKey": false,
|
|
133
|
+
"notNull": false,
|
|
134
|
+
"autoincrement": false
|
|
135
|
+
},
|
|
136
|
+
"rid": {
|
|
137
|
+
"name": "rid",
|
|
138
|
+
"type": "text",
|
|
139
|
+
"primaryKey": false,
|
|
140
|
+
"notNull": false,
|
|
141
|
+
"autoincrement": false
|
|
142
|
+
},
|
|
143
|
+
"screen_height": {
|
|
144
|
+
"name": "screen_height",
|
|
145
|
+
"type": "integer",
|
|
146
|
+
"primaryKey": false,
|
|
147
|
+
"notNull": false,
|
|
148
|
+
"autoincrement": false
|
|
149
|
+
},
|
|
150
|
+
"screen_width": {
|
|
151
|
+
"name": "screen_width",
|
|
152
|
+
"type": "integer",
|
|
153
|
+
"primaryKey": false,
|
|
154
|
+
"notNull": false,
|
|
155
|
+
"autoincrement": false
|
|
156
|
+
},
|
|
157
|
+
"site_id": {
|
|
158
|
+
"name": "site_id",
|
|
159
|
+
"type": "integer",
|
|
160
|
+
"primaryKey": false,
|
|
161
|
+
"notNull": true,
|
|
162
|
+
"autoincrement": false
|
|
163
|
+
},
|
|
164
|
+
"tag_id": {
|
|
165
|
+
"name": "tag_id",
|
|
166
|
+
"type": "text",
|
|
167
|
+
"primaryKey": false,
|
|
168
|
+
"notNull": true,
|
|
169
|
+
"autoincrement": false
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"indexes": {
|
|
173
|
+
"site_events_team_id_idx": {
|
|
174
|
+
"name": "site_events_team_id_idx",
|
|
175
|
+
"columns": [
|
|
176
|
+
"team_id"
|
|
177
|
+
],
|
|
178
|
+
"isUnique": false
|
|
179
|
+
},
|
|
180
|
+
"site_events_site_id_idx": {
|
|
181
|
+
"name": "site_events_site_id_idx",
|
|
182
|
+
"columns": [
|
|
183
|
+
"site_id"
|
|
184
|
+
],
|
|
185
|
+
"isUnique": false
|
|
186
|
+
},
|
|
187
|
+
"site_events_tag_id_idx": {
|
|
188
|
+
"name": "site_events_tag_id_idx",
|
|
189
|
+
"columns": [
|
|
190
|
+
"tag_id"
|
|
191
|
+
],
|
|
192
|
+
"isUnique": false
|
|
193
|
+
},
|
|
194
|
+
"site_events_created_at_idx": {
|
|
195
|
+
"name": "site_events_created_at_idx",
|
|
196
|
+
"columns": [
|
|
197
|
+
"created_at"
|
|
198
|
+
],
|
|
199
|
+
"isUnique": false
|
|
200
|
+
},
|
|
201
|
+
"site_events_team_site_idx": {
|
|
202
|
+
"name": "site_events_team_site_idx",
|
|
203
|
+
"columns": [
|
|
204
|
+
"team_id",
|
|
205
|
+
"site_id"
|
|
206
|
+
],
|
|
207
|
+
"isUnique": false
|
|
208
|
+
},
|
|
209
|
+
"site_events_team_tag_idx": {
|
|
210
|
+
"name": "site_events_team_tag_idx",
|
|
211
|
+
"columns": [
|
|
212
|
+
"team_id",
|
|
213
|
+
"tag_id"
|
|
214
|
+
],
|
|
215
|
+
"isUnique": false
|
|
216
|
+
},
|
|
217
|
+
"site_events_site_created_idx": {
|
|
218
|
+
"name": "site_events_site_created_idx",
|
|
219
|
+
"columns": [
|
|
220
|
+
"site_id",
|
|
221
|
+
"created_at"
|
|
222
|
+
],
|
|
223
|
+
"isUnique": false
|
|
224
|
+
},
|
|
225
|
+
"site_events_team_created_idx": {
|
|
226
|
+
"name": "site_events_team_created_idx",
|
|
227
|
+
"columns": [
|
|
228
|
+
"team_id",
|
|
229
|
+
"created_at"
|
|
230
|
+
],
|
|
231
|
+
"isUnique": false
|
|
232
|
+
},
|
|
233
|
+
"site_events_country_idx": {
|
|
234
|
+
"name": "site_events_country_idx",
|
|
235
|
+
"columns": [
|
|
236
|
+
"country"
|
|
237
|
+
],
|
|
238
|
+
"isUnique": false
|
|
239
|
+
},
|
|
240
|
+
"site_events_device_type_idx": {
|
|
241
|
+
"name": "site_events_device_type_idx",
|
|
242
|
+
"columns": [
|
|
243
|
+
"device_type"
|
|
244
|
+
],
|
|
245
|
+
"isUnique": false
|
|
246
|
+
},
|
|
247
|
+
"site_events_event_idx": {
|
|
248
|
+
"name": "site_events_event_idx",
|
|
249
|
+
"columns": [
|
|
250
|
+
"event"
|
|
251
|
+
],
|
|
252
|
+
"isUnique": false
|
|
253
|
+
},
|
|
254
|
+
"site_events_referer_idx": {
|
|
255
|
+
"name": "site_events_referer_idx",
|
|
256
|
+
"columns": [
|
|
257
|
+
"referer"
|
|
258
|
+
],
|
|
259
|
+
"isUnique": false
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"foreignKeys": {},
|
|
263
|
+
"compositePrimaryKeys": {},
|
|
264
|
+
"uniqueConstraints": {},
|
|
265
|
+
"checkConstraints": {}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"views": {},
|
|
269
|
+
"enums": {},
|
|
270
|
+
"_meta": {
|
|
271
|
+
"schemas": {},
|
|
272
|
+
"tables": {},
|
|
273
|
+
"columns": {}
|
|
274
|
+
},
|
|
275
|
+
"internal": {
|
|
276
|
+
"indexes": {}
|
|
277
|
+
}
|
|
278
|
+
}
|