Skip to content

Commit 5377f78

Browse files
committed
fix: properties
1 parent cec3438 commit 5377f78

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

apps/api/src/query/builders/custom-events.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ export const CustomEventsBuilders: Record<string, SimpleQueryConfig> = {
1111
'MAX(time) as last_occurrence',
1212
'MIN(time) as first_occurrence',
1313
'COUNT(DISTINCT path) as unique_pages',
14-
"countIf(properties != '' AND isValidJSON(properties)) as events_with_properties",
14+
"countIf(properties != '{}' AND isValidJSON(properties)) as events_with_properties",
1515
'ROUND((COUNT(*) / SUM(COUNT(*)) OVER()) * 100, 2) as percentage',
16-
"arrayDistinct(groupArray(CASE WHEN isValidJSON(properties) AND properties != '' THEN properties ELSE NULL END)) as all_properties",
1716
],
1817
where: [
1918
"event_name NOT IN ('screen_view', 'page_exit', 'error', 'web_vitals', 'link_out')",
2019
"event_name != ''",
2120
],
2221
groupBy: ['event_name'],
2322
orderBy: 'total_events DESC',
24-
limit: 100,
23+
limit: 10_000,
2524
timeField: 'time',
2625
allowedFilters: ['event_name', 'path', 'device_type', 'browser_name'],
2726
customizable: true,

apps/api/src/query/builders/sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const SessionsBuilders: Record<string, SimpleQueryConfig> = {
215215
'path',
216216
'error_message',
217217
'error_type',
218-
'properties_json',
218+
'properties',
219219
'device_type',
220220
'browser_name',
221221
'country',

bun.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3135,6 +3135,12 @@
31353135

31363136
"admin/react-day-picker": ["[email protected]", "", { "peerDependencies": { "date-fns": "^2.28.0 || ^3.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, "sha512-TMx7fNbhLk15eqcMt+7Z7S2KF7mfTId/XJDjKE8f+IUcFn0l08/kI4FiYTL/0yuOLmEcbR4Fwe3GJf/NiiMnPA=="],
31373137

3138+
"basket/@databuddy/auth": ["@databuddy/auth@file:packages/auth", { "dependencies": { "@databuddy/db": "*", "@databuddy/email": "*", "better-auth": "^1.3.4", "resend": "^4.2.0" } }],
3139+
3140+
"basket/@databuddy/redis": ["@databuddy/redis@file:packages/redis", { "dependencies": { "ioredis": "^5.4.3", "superjson": "^2.0.2", "zod": "3.25.76" }, "devDependencies": { "@types/node": "^20.11.19", "typescript": "^5.3.3" } }],
3141+
3142+
"basket/@databuddy/validation": ["@databuddy/validation@file:packages/validation", { "dependencies": { "zod": "^4.0.10" }, "devDependencies": { "typescript": "^5.3.3" } }],
3143+
31383144
"basket/autumn-js": ["[email protected]", "", { "dependencies": { "axios": "^1.10.0", "chalk": "^5.4.1", "commander": "^14.0.0", "ink": "^6.0.1", "jiti": "^2.4.2", "open": "^10.1.2", "rou3": "^0.6.1", "swr": "^2.3.3", "zod": "^3.24.1" }, "peerDependencies": { "better-auth": "^1.2.12", "better-call": "^1.0.12" }, "optionalPeers": ["better-auth", "better-call"] }, "sha512-Xmb6jvrr6EgN0UbHZZ0Er0OiLW/IbPPf02lbTNbTCuHePoSEaMQ3cxkvADpNRFf5NBo3Oos2rG2QVaDzkzIejg=="],
31393145

31403146
"better-auth/zod": ["[email protected]", "", {}, "sha512-nGFJTnJN6cM2v9kXL+SOBq3AtjQby3Mv5ySGFof5UGRHrRioSJ5iG680cYNjE/yWk671nROcpPj4hAS8nyLhSw=="],
@@ -3441,6 +3447,10 @@
34413447

34423448
"admin/next/postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ=="],
34433449

3450+
"basket/@databuddy/redis/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw=="],
3451+
3452+
"basket/@databuddy/validation/zod": ["[email protected]", "", {}, "sha512-nGFJTnJN6cM2v9kXL+SOBq3AtjQby3Mv5ySGFof5UGRHrRioSJ5iG680cYNjE/yWk671nROcpPj4hAS8nyLhSw=="],
3453+
34443454
"bun-types/@types/node/undici-types": ["[email protected]", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="],
34453455

34463456
"cliui/string-width/emoji-regex": ["[email protected]", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],

packages/validation/src/schemas/analytics.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,8 @@ export const analyticsEventSchema = z.object({
212212
.max(VALIDATION_LIMITS.VALUE_MAX_LENGTH)
213213
.nullable()
214214
.optional(),
215+
properties: z
216+
.record(z.union([z.string(), z.number(), z.boolean(), z.null()]))
217+
.optional()
218+
.nullable(),
215219
});

0 commit comments

Comments
 (0)