@vllnt/convex-analytics 0.1.0-canary.531be7c → 0.1.0-canary.67f5cc1
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 +1 -12
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/component/convex.config.d.ts +1 -1
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/http.d.ts.map +1 -1
- package/dist/component/internal_mutations.d.ts +2 -2
- package/dist/component/internal_mutations.d.ts.map +1 -1
- package/dist/component/internal_mutations.js +3 -3
- package/dist/component/internal_mutations.js.map +1 -1
- package/dist/component/mutations.d.ts +11 -11
- package/dist/component/mutations.js +4 -4
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts +21 -21
- package/dist/component/schema.d.ts +26 -26
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/validators.d.ts +40 -40
- package/dist/test.d.ts +26 -26
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js.map +1 -1
- package/dist/web/index.d.ts.map +1 -1
- package/package.json +19 -16
- package/src/component/internal_mutations.ts +5 -3
- package/src/component/mutations.ts +4 -4
package/README.md
CHANGED
|
@@ -152,17 +152,6 @@ const byPlan = useTop(api.analytics.top, { name: "signup", dimension: "plan" });
|
|
|
152
152
|
Thin reactive wrappers over the host's re-exported query refs (`metric`, `top`, `timeseries`,
|
|
153
153
|
`uniques`). `react` + `convex` are optional peer deps; backend-only consumers pull no React.
|
|
154
154
|
|
|
155
|
-
## MCP (Claude Code)
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
claude mcp add convex-analytics-mcp \
|
|
159
|
-
--env CONVEX_URL=https://your-deployment.convex.cloud \
|
|
160
|
-
--env ANALYTICS_API_KEY=your-key
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
7 tools: `track`, `get_metric`, `get_top`, `get_timeseries`, `get_uniques`, `detect_anomalies`,
|
|
164
|
-
`query_analytics` (NL router). See [docs/mcp-tools.md](docs/mcp-tools.md).
|
|
165
|
-
|
|
166
155
|
## Security
|
|
167
156
|
|
|
168
157
|
- Auth-agnostic mount — the host gates access and passes opaque `subjectRef` / `sessionRef` in.
|
|
@@ -189,7 +178,7 @@ analyticsTest.register(t);
|
|
|
189
178
|
|
|
190
179
|
[Schema](docs/schema.md) · [Client SDK](docs/client-sdk.md) · [REST API](docs/api-reference.md) ·
|
|
191
180
|
[Web Preset](docs/web-preset.md) · [Multi-Product](docs/multi-product.md) ·
|
|
192
|
-
[Architecture](docs/architecture.md)
|
|
181
|
+
[Architecture](docs/architecture.md). For AI agents:
|
|
193
182
|
[`llms.txt`](llms.txt) · [`llms-full.txt`](llms-full.txt).
|
|
194
183
|
|
|
195
184
|
## Contributing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,eAAe,EACf,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,MAAM,EACN,eAAe,EACf,WAAW,EACX,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,SAAS,EACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,eAAe,EACf,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,MAAM,EACN,eAAe,EACf,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE/D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,C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EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,cAAc,EAC9B,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAC5B,OAAO,CAAC,SAAS,CAAC,CAMpB;IAED,4EAA4E;IACtE,SAAS,CACb,GAAG,EAAE,WAAW,EAChB,IAAI,GAAE;QACJ,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GACL,OAAO,CAAC,IAAI,CAAC,CAOf;CACF"}
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAkEA,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,eAAe;IACT,SAAS,CAAe;IACxB,KAAK,CAAS;IACd,UAAU,CAAW;IACrB,aAAa,CAAgB;IAC7B,UAAU,CAAS;IACnB,MAAM,CAAkB;IAEzC,YAAY,SAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAkEA,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,eAAe;IACT,SAAS,CAAe;IACxB,KAAK,CAAS;IACd,UAAU,CAAW;IACrB,aAAa,CAAgB;IAC7B,UAAU,CAAS;IACnB,MAAM,CAAkB;IAEzC,YAAY,SAAkB,EAAE,MAAM,GAAoB,EAAE;QAC1D,IAAI,CAAC,SAAS,GAAG,SAAyB,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,aAAa,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AAC;IAC5B,CAAC;IAED,4EAA4E;IAC5E,KAAK,CAAC,SAAS,CACb,GAAgB,EAChB,IAAI,GAKA,EAAE;QAEN,MAAM,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAkB,EAAE;YACjE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;YAC/B,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa;YAC9D,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU;YACrD,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa;SACtD,CAAC,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,SAAS,sDAA+B,CAAC;eAMhC,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/component/http.ts"],"names":[],"mappings":"AAyEA,eAAO,MAAM,aAAa,0CA8BxB,CAAC;AAEH,eAAO,MAAM,cAAc,0CAmBzB,CAAC;AAEH,eAAO,MAAM,WAAW,0CAoBtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,0CAqB7B,CAAC;AAEH,eAAO,MAAM,eAAe,0CAkB1B,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,IAAI,oCAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/component/http.ts"],"names":[],"mappings":"AAyEA,eAAO,MAAM,aAAa,0CA8BxB,CAAC;AAEH,eAAO,MAAM,cAAc,0CAmBzB,CAAC;AAEH,eAAO,MAAM,WAAW,0CAoBtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,0CAqB7B,CAAC;AAEH,eAAO,MAAM,eAAe,0CAkB1B,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,IAAI,oCAAe,CAAC;eAOX,IAAI"}
|
|
@@ -15,10 +15,10 @@ export declare const closeSessions: import("convex/server").RegisteredMutation<"
|
|
|
15
15
|
* existing rollup rows for the name, then recomputes from the retained raw events.
|
|
16
16
|
*/
|
|
17
17
|
export declare const backfill: import("convex/server").RegisteredMutation<"internal", {
|
|
18
|
+
dimensions: string[];
|
|
19
|
+
granularities: ("day" | "hour" | "minute")[];
|
|
18
20
|
name: string;
|
|
19
21
|
scope: string;
|
|
20
|
-
granularities: ("minute" | "hour" | "day")[];
|
|
21
|
-
dimensions: string[];
|
|
22
22
|
}, Promise<{
|
|
23
23
|
events: number;
|
|
24
24
|
rows: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal_mutations.d.ts","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAmCA,gGAAgG;AAChG,eAAO,MAAM,KAAK;;;;GA2BhB,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,aAAa;;;;
|
|
1
|
+
{"version":3,"file":"internal_mutations.d.ts","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAmCA,gGAAgG;AAChG,eAAO,MAAM,KAAK;;;;GA2BhB,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,aAAa;;;;GA4BxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;GAkEnB,CAAC"}
|
|
@@ -38,7 +38,7 @@ export const prune = internalMutation({
|
|
|
38
38
|
.order("asc")
|
|
39
39
|
.take(PRUNE_CAP);
|
|
40
40
|
const toDelete = oldest.filter((e) => e.ts < cutoff);
|
|
41
|
-
await Promise.all(toDelete.map((e) => ctx.db.delete(e._id)));
|
|
41
|
+
await Promise.all(toDelete.map((e) => ctx.db.delete("events", e._id)));
|
|
42
42
|
return toDelete.length;
|
|
43
43
|
};
|
|
44
44
|
const counts = await Promise.all(scopes.map(pruneScope));
|
|
@@ -59,7 +59,7 @@ export const closeSessions = internalMutation({
|
|
|
59
59
|
.withIndex("by_scope_lastTs", (q) => q.eq("scope", scope).lt("lastTs", cutoff))
|
|
60
60
|
.take(1000);
|
|
61
61
|
const stale = open.filter((s) => s.endTs === undefined);
|
|
62
|
-
await Promise.all(stale.map((s) => ctx.db.patch(s._id, { endTs: s.lastTs })));
|
|
62
|
+
await Promise.all(stale.map((s) => ctx.db.patch("sessions", s._id, { endTs: s.lastTs })));
|
|
63
63
|
return stale.length;
|
|
64
64
|
};
|
|
65
65
|
const counts = await Promise.all(scopes.map(closeScope));
|
|
@@ -84,7 +84,7 @@ export const backfill = internalMutation({
|
|
|
84
84
|
.query("rollups")
|
|
85
85
|
.withIndex("by_scope_name_dim_val", (q) => q.eq("scope", args.scope).eq("name", args.name))
|
|
86
86
|
.collect();
|
|
87
|
-
await Promise.all(existing.map((r) => ctx.db.delete(r._id)));
|
|
87
|
+
await Promise.all(existing.map((r) => ctx.db.delete("rollups", r._id)));
|
|
88
88
|
const events = await ctx.db
|
|
89
89
|
.query("events")
|
|
90
90
|
.withIndex("by_scope_name_ts", (q) => q.eq("scope", args.scope).eq("name", args.name))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal_mutations.js","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGnD,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C9B,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,CAAC,CAAC,IAAI;gBACnB,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,KAAK;aACN,CAAC,CAAC;QACL,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
export declare const track: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
-
ts?: number | undefined;
|
|
3
|
-
subjectRef?: string | undefined;
|
|
4
|
-
sessionRef?: string | undefined;
|
|
5
|
-
props?: Record<string, string | number | boolean | null> | undefined;
|
|
6
2
|
dedupeKey?: string | undefined;
|
|
7
|
-
|
|
3
|
+
dimensions: string[];
|
|
4
|
+
granularities: ("day" | "hour" | "minute")[];
|
|
8
5
|
name: string;
|
|
6
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
7
|
+
sampleRate?: number | undefined;
|
|
9
8
|
scope: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
sessionRef?: string | undefined;
|
|
10
|
+
subjectRef?: string | undefined;
|
|
11
|
+
ts?: number | undefined;
|
|
12
|
+
}, Promise<"dropped" | "duplicate" | "tracked">>;
|
|
13
13
|
export declare const configSet: import("convex/server").RegisteredMutation<"public", {
|
|
14
|
-
value: string;
|
|
15
14
|
key: string;
|
|
16
15
|
scope: string;
|
|
16
|
+
value: string;
|
|
17
17
|
}, Promise<null>>;
|
|
18
18
|
export declare const configure: import("convex/server").RegisteredMutation<"public", {
|
|
19
|
-
sampleRate?: number | undefined;
|
|
20
19
|
retentionDays?: number | undefined;
|
|
21
|
-
|
|
20
|
+
sampleRate?: number | undefined;
|
|
22
21
|
scope: string;
|
|
22
|
+
sessionIdleMs?: number | undefined;
|
|
23
23
|
}, Promise<null>>;
|
|
24
24
|
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -32,7 +32,7 @@ async function bumpRollup(ctx, scope, name, granularity, bucket, dim, val) {
|
|
|
32
32
|
.eq("val", val))
|
|
33
33
|
.unique();
|
|
34
34
|
if (existing) {
|
|
35
|
-
await ctx.db.patch(existing._id, { count: existing.count + 1 });
|
|
35
|
+
await ctx.db.patch("rollups", existing._id, { count: existing.count + 1 });
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
38
|
await ctx.db.insert("rollups", {
|
|
@@ -105,7 +105,7 @@ export const track = mutation({
|
|
|
105
105
|
});
|
|
106
106
|
if (args.sessionRef !== undefined) {
|
|
107
107
|
if (sessionDoc) {
|
|
108
|
-
await ctx.db.patch(sessionDoc._id, {
|
|
108
|
+
await ctx.db.patch("sessions", sessionDoc._id, {
|
|
109
109
|
lastTs: ts,
|
|
110
110
|
eventCount: sessionDoc.eventCount + 1,
|
|
111
111
|
subjectRef: args.subjectRef ?? sessionDoc.subjectRef,
|
|
@@ -128,7 +128,7 @@ export const track = mutation({
|
|
|
128
128
|
.withIndex("by_scope_subject", (q) => q.eq("scope", scope).eq("subjectRef", args.subjectRef))
|
|
129
129
|
.unique();
|
|
130
130
|
if (subject) {
|
|
131
|
-
await ctx.db.patch(subject._id, {
|
|
131
|
+
await ctx.db.patch("subjects", subject._id, {
|
|
132
132
|
lastSeen: ts > subject.lastSeen ? ts : subject.lastSeen,
|
|
133
133
|
firstSeen: ts < subject.firstSeen ? ts : subject.firstSeen,
|
|
134
134
|
eventCount: subject.eventCount + 1,
|
|
@@ -169,7 +169,7 @@ async function upsertConfig(ctx, scope, key, value) {
|
|
|
169
169
|
.withIndex("by_scope_key", (q) => q.eq("scope", scope).eq("key", key))
|
|
170
170
|
.unique();
|
|
171
171
|
if (existing) {
|
|
172
|
-
await ctx.db.patch(existing._id, { value });
|
|
172
|
+
await ctx.db.patch("config", existing._id, { value });
|
|
173
173
|
}
|
|
174
174
|
else {
|
|
175
175
|
await ctx.db.insert("config", { scope, key, value });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAInD,MAAM,SAAS,GAAG,IAAI,eAAe,CAAgB,UAAU,CAAC,SAAkB,CAAC,CAAC;AACpF,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC,UAAU,CAAC,cAAuB,EAAE;IACrE,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC;AACH,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,WAAoB,EAAE;IACnE,UAAU,EAAE;QACV,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,EAAE,CAAC;AAEjB,6FAA6F;AAC7F,KAAK,UAAU,UAAU,CACvB,GAAgB,EAChB,KAAa,EACb,IAAY,EACZ,WAAwB,EACxB,MAAc,EACd,GAAW,EACX,GAAW;IAEX,MAAM,QAAQ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I,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CACzE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
/** Total event count over a range, optionally filtered by one dimension value. */
|
|
2
2
|
export declare const metric: import("convex/server").RegisteredQuery<"public", {
|
|
3
|
+
name: string;
|
|
3
4
|
range?: {
|
|
4
5
|
from?: number | undefined;
|
|
5
6
|
to?: number | undefined;
|
|
6
7
|
} | undefined;
|
|
8
|
+
scope: string;
|
|
7
9
|
where?: {
|
|
8
10
|
dim: string;
|
|
9
11
|
val: string | number | boolean | null;
|
|
10
12
|
} | undefined;
|
|
11
|
-
name: string;
|
|
12
|
-
scope: string;
|
|
13
13
|
}, Promise<number>>;
|
|
14
14
|
/** Top values of a dimension (breakdown), ranked by count. */
|
|
15
15
|
export declare const top: import("convex/server").RegisteredQuery<"public", {
|
|
16
|
+
dimension: string;
|
|
16
17
|
limit?: number | undefined;
|
|
18
|
+
name: string;
|
|
17
19
|
range?: {
|
|
18
20
|
from?: number | undefined;
|
|
19
21
|
to?: number | undefined;
|
|
20
22
|
} | undefined;
|
|
21
|
-
name: string;
|
|
22
23
|
scope: string;
|
|
23
|
-
dimension: string;
|
|
24
24
|
}, Promise<{
|
|
25
25
|
value: string;
|
|
26
26
|
count: number;
|
|
27
27
|
}[]>>;
|
|
28
28
|
/** Bucketed counts over a range, optionally filtered by one dimension value. */
|
|
29
29
|
export declare const timeseries: import("convex/server").RegisteredQuery<"public", {
|
|
30
|
-
|
|
31
|
-
dim: string;
|
|
32
|
-
val: string | number | boolean | null;
|
|
33
|
-
} | undefined;
|
|
30
|
+
granularity: "day" | "hour" | "minute";
|
|
34
31
|
name: string;
|
|
35
|
-
scope: string;
|
|
36
|
-
granularity: "minute" | "hour" | "day";
|
|
37
32
|
range: {
|
|
38
33
|
from?: number | undefined;
|
|
39
34
|
to?: number | undefined;
|
|
40
35
|
};
|
|
36
|
+
scope: string;
|
|
37
|
+
where?: {
|
|
38
|
+
dim: string;
|
|
39
|
+
val: string | number | boolean | null;
|
|
40
|
+
} | undefined;
|
|
41
41
|
}, Promise<{
|
|
42
42
|
bucket: number;
|
|
43
43
|
count: number;
|
|
44
44
|
}[]>>;
|
|
45
45
|
/** DAU/WAU/MAU distinct-subject counts from the subjects table. */
|
|
46
46
|
export declare const uniques: import("convex/server").RegisteredQuery<"public", {
|
|
47
|
-
|
|
48
|
-
granularity: "minute" | "hour" | "day";
|
|
47
|
+
granularity: "day" | "hour" | "minute";
|
|
49
48
|
range: {
|
|
50
49
|
from?: number | undefined;
|
|
51
50
|
to?: number | undefined;
|
|
52
51
|
};
|
|
52
|
+
scope: string;
|
|
53
53
|
}, Promise<{
|
|
54
54
|
dau: number;
|
|
55
55
|
wau: number;
|
|
@@ -61,11 +61,11 @@ export declare const uniques: import("convex/server").RegisteredQuery<"public",
|
|
|
61
61
|
}>>;
|
|
62
62
|
/** Ordered step conversion over raw events, keyed by subjectRef. */
|
|
63
63
|
export declare const funnel: import("convex/server").RegisteredQuery<"public", {
|
|
64
|
-
scope: string;
|
|
65
64
|
range: {
|
|
66
65
|
from?: number | undefined;
|
|
67
66
|
to?: number | undefined;
|
|
68
67
|
};
|
|
68
|
+
scope: string;
|
|
69
69
|
steps: string[];
|
|
70
70
|
}, Promise<{
|
|
71
71
|
name: string;
|
|
@@ -74,13 +74,13 @@ export declare const funnel: import("convex/server").RegisteredQuery<"public", {
|
|
|
74
74
|
}[]>>;
|
|
75
75
|
/** Cohort return rates by first-seen period. */
|
|
76
76
|
export declare const retention: import("convex/server").RegisteredQuery<"public", {
|
|
77
|
-
granularity?: "minute" | "hour" | "day" | undefined;
|
|
78
|
-
scope: string;
|
|
79
77
|
cohortRange: {
|
|
80
78
|
from?: number | undefined;
|
|
81
79
|
to?: number | undefined;
|
|
82
80
|
};
|
|
81
|
+
granularity?: "day" | "hour" | "minute" | undefined;
|
|
83
82
|
periods: number;
|
|
83
|
+
scope: string;
|
|
84
84
|
}, Promise<{
|
|
85
85
|
cohort: number;
|
|
86
86
|
size: number;
|
|
@@ -95,18 +95,18 @@ export declare const retention: import("convex/server").RegisteredQuery<"public"
|
|
|
95
95
|
* `funnel`/`retention`.
|
|
96
96
|
*/
|
|
97
97
|
export declare const distribution: import("convex/server").RegisteredQuery<"public", {
|
|
98
|
+
buckets: number[];
|
|
99
|
+
measure: string;
|
|
100
|
+
name: string;
|
|
98
101
|
range?: {
|
|
99
102
|
from?: number | undefined;
|
|
100
103
|
to?: number | undefined;
|
|
101
104
|
} | undefined;
|
|
105
|
+
scope: string;
|
|
102
106
|
where?: {
|
|
103
107
|
dim: string;
|
|
104
108
|
val: string | number | boolean | null;
|
|
105
109
|
} | undefined;
|
|
106
|
-
name: string;
|
|
107
|
-
scope: string;
|
|
108
|
-
measure: string;
|
|
109
|
-
buckets: number[];
|
|
110
110
|
}, Promise<{
|
|
111
111
|
bins: {
|
|
112
112
|
upper: number;
|
|
@@ -119,11 +119,11 @@ export declare const distribution: import("convex/server").RegisteredQuery<"publ
|
|
|
119
119
|
/** Paginated raw events for an event name, newest first. */
|
|
120
120
|
export declare const list: import("convex/server").RegisteredQuery<"public", {
|
|
121
121
|
name: string;
|
|
122
|
-
scope: string;
|
|
123
122
|
paginationOpts: {
|
|
124
|
-
numItems: number;
|
|
125
123
|
cursor: string | null;
|
|
124
|
+
numItems: number;
|
|
126
125
|
};
|
|
126
|
+
scope: string;
|
|
127
127
|
}, Promise<{
|
|
128
128
|
page: {
|
|
129
129
|
_id: string;
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
*/
|
|
10
10
|
declare const _default: import("convex/server").SchemaDefinition<{
|
|
11
11
|
events: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
12
|
-
subjectRef?: string | undefined;
|
|
13
|
-
sessionRef?: string | undefined;
|
|
14
12
|
dedupeKey?: string | undefined;
|
|
15
13
|
name: string;
|
|
16
|
-
ts: number;
|
|
17
|
-
scope: string;
|
|
18
14
|
props: Record<string, string | number | boolean | null>;
|
|
15
|
+
scope: string;
|
|
19
16
|
seq: number;
|
|
17
|
+
sessionRef?: string | undefined;
|
|
18
|
+
subjectRef?: string | undefined;
|
|
19
|
+
ts: number;
|
|
20
20
|
}, {
|
|
21
21
|
scope: import("convex/values").VString<string, "required">;
|
|
22
22
|
name: import("convex/values").VString<string, "required">;
|
|
@@ -26,56 +26,56 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
26
26
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
27
27
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
28
28
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
29
|
-
}, "required", "
|
|
29
|
+
}, "required", "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>, {
|
|
30
|
+
by_dedupe: ["scope", "dedupeKey", "_creationTime"];
|
|
30
31
|
by_scope_name_ts: ["scope", "name", "ts", "_creationTime"];
|
|
31
|
-
by_scope_subject_ts: ["scope", "subjectRef", "ts", "_creationTime"];
|
|
32
32
|
by_scope_session_ts: ["scope", "sessionRef", "ts", "_creationTime"];
|
|
33
|
-
|
|
33
|
+
by_scope_subject_ts: ["scope", "subjectRef", "ts", "_creationTime"];
|
|
34
34
|
}, {}, {}>;
|
|
35
35
|
rollups: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
36
|
+
bucket: number;
|
|
36
37
|
count: number;
|
|
37
|
-
name: string;
|
|
38
38
|
dim: string;
|
|
39
|
-
|
|
39
|
+
granularity: "day" | "hour" | "minute";
|
|
40
|
+
name: string;
|
|
40
41
|
scope: string;
|
|
41
|
-
|
|
42
|
-
granularity: "minute" | "hour" | "day";
|
|
42
|
+
val: string;
|
|
43
43
|
}, {
|
|
44
44
|
scope: import("convex/values").VString<string, "required">;
|
|
45
45
|
name: import("convex/values").VString<string, "required">;
|
|
46
|
-
granularity: import("convex/values").VUnion<"
|
|
46
|
+
granularity: import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>;
|
|
47
47
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
48
48
|
dim: import("convex/values").VString<string, "required">;
|
|
49
49
|
val: import("convex/values").VString<string, "required">;
|
|
50
50
|
count: import("convex/values").VFloat64<number, "required">;
|
|
51
|
-
}, "required", "
|
|
52
|
-
by_scope_name_gran_bucket_dim: ["scope", "name", "granularity", "bucket", "dim", "val", "_creationTime"];
|
|
51
|
+
}, "required", "bucket" | "count" | "dim" | "granularity" | "name" | "scope" | "val">, {
|
|
53
52
|
by_scope_name_dim_val: ["scope", "name", "dim", "val", "_creationTime"];
|
|
53
|
+
by_scope_name_gran_bucket_dim: ["scope", "name", "granularity", "bucket", "dim", "val", "_creationTime"];
|
|
54
54
|
}, {}, {}>;
|
|
55
55
|
subjects: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
56
|
-
|
|
57
|
-
subjectRef: string;
|
|
56
|
+
eventCount: number;
|
|
58
57
|
firstSeen: number;
|
|
59
58
|
lastSeen: number;
|
|
60
|
-
|
|
59
|
+
scope: string;
|
|
60
|
+
subjectRef: string;
|
|
61
61
|
}, {
|
|
62
62
|
scope: import("convex/values").VString<string, "required">;
|
|
63
63
|
subjectRef: import("convex/values").VString<string, "required">;
|
|
64
64
|
firstSeen: import("convex/values").VFloat64<number, "required">;
|
|
65
65
|
lastSeen: import("convex/values").VFloat64<number, "required">;
|
|
66
66
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
67
|
-
}, "required", "
|
|
68
|
-
by_scope_subject: ["scope", "subjectRef", "_creationTime"];
|
|
67
|
+
}, "required", "eventCount" | "firstSeen" | "lastSeen" | "scope" | "subjectRef">, {
|
|
69
68
|
by_scope_firstSeen: ["scope", "firstSeen", "_creationTime"];
|
|
69
|
+
by_scope_subject: ["scope", "subjectRef", "_creationTime"];
|
|
70
70
|
}, {}, {}>;
|
|
71
71
|
sessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
72
|
-
subjectRef?: string | undefined;
|
|
73
72
|
endTs?: number | undefined;
|
|
73
|
+
eventCount: number;
|
|
74
|
+
lastTs: number;
|
|
74
75
|
scope: string;
|
|
75
76
|
sessionRef: string;
|
|
76
|
-
eventCount: number;
|
|
77
77
|
startTs: number;
|
|
78
|
-
|
|
78
|
+
subjectRef?: string | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
scope: import("convex/values").VString<string, "required">;
|
|
81
81
|
sessionRef: import("convex/values").VString<string, "required">;
|
|
@@ -84,19 +84,19 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
84
84
|
endTs: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
85
85
|
lastTs: import("convex/values").VFloat64<number, "required">;
|
|
86
86
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
87
|
-
}, "required", "
|
|
88
|
-
by_scope_session: ["scope", "sessionRef", "_creationTime"];
|
|
87
|
+
}, "required", "endTs" | "eventCount" | "lastTs" | "scope" | "sessionRef" | "startTs" | "subjectRef">, {
|
|
89
88
|
by_scope_lastTs: ["scope", "lastTs", "_creationTime"];
|
|
89
|
+
by_scope_session: ["scope", "sessionRef", "_creationTime"];
|
|
90
90
|
}, {}, {}>;
|
|
91
91
|
config: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
92
|
-
value: string;
|
|
93
92
|
key: string;
|
|
94
93
|
scope: string;
|
|
94
|
+
value: string;
|
|
95
95
|
}, {
|
|
96
96
|
scope: import("convex/values").VString<string, "required">;
|
|
97
97
|
key: import("convex/values").VString<string, "required">;
|
|
98
98
|
value: import("convex/values").VString<string, "required">;
|
|
99
|
-
}, "required", "
|
|
99
|
+
}, "required", "key" | "scope" | "value">, {
|
|
100
100
|
by_scope_key: ["scope", "key", "_creationTime"];
|
|
101
101
|
}, {}, {}>;
|
|
102
102
|
}, true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG"}
|
|
@@ -19,21 +19,21 @@ export declare const whereValidator: import("convex/values").VObject<{
|
|
|
19
19
|
val: import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
20
20
|
}, "required", "dim" | "val">;
|
|
21
21
|
/** Rollup bucket granularity. `minute` is opt-in for short live windows. */
|
|
22
|
-
export declare const granularityValidator: import("convex/values").VUnion<"
|
|
22
|
+
export declare const granularityValidator: import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>;
|
|
23
23
|
/** Array of granularities (the `granularities` config, shared by `track` + `backfill`). */
|
|
24
|
-
export declare const granularitiesValidator: import("convex/values").VArray<("
|
|
24
|
+
export declare const granularitiesValidator: import("convex/values").VArray<("day" | "hour" | "minute")[], import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>, "required">;
|
|
25
25
|
/** A raw event as returned by reads. */
|
|
26
26
|
export declare const eventView: import("convex/values").VObject<{
|
|
27
|
-
subjectRef?: string | undefined;
|
|
28
|
-
sessionRef?: string | undefined;
|
|
29
|
-
dedupeKey?: string | undefined;
|
|
30
27
|
_creationTime: number;
|
|
31
|
-
name: string;
|
|
32
|
-
ts: number;
|
|
33
28
|
_id: string;
|
|
34
|
-
|
|
29
|
+
dedupeKey?: string | undefined;
|
|
30
|
+
name: string;
|
|
35
31
|
props: Record<string, string | number | boolean | null>;
|
|
32
|
+
scope: string;
|
|
36
33
|
seq: number;
|
|
34
|
+
sessionRef?: string | undefined;
|
|
35
|
+
subjectRef?: string | undefined;
|
|
36
|
+
ts: number;
|
|
37
37
|
}, {
|
|
38
38
|
_id: import("convex/values").VString<string, "required">;
|
|
39
39
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
@@ -45,7 +45,7 @@ export declare const eventView: import("convex/values").VObject<{
|
|
|
45
45
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
46
46
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
47
47
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
48
|
-
}, "required", "_creationTime" | "
|
|
48
|
+
}, "required", "_creationTime" | "_id" | "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>;
|
|
49
49
|
/** A `(value, count)` pair for `top` breakdowns. */
|
|
50
50
|
export declare const topRow: import("convex/values").VObject<{
|
|
51
51
|
count: number;
|
|
@@ -56,21 +56,21 @@ export declare const topRow: import("convex/values").VObject<{
|
|
|
56
56
|
}, "required", "count" | "value">;
|
|
57
57
|
/** A `(bucket, count)` pair for `timeseries`. */
|
|
58
58
|
export declare const timeseriesPoint: import("convex/values").VObject<{
|
|
59
|
-
count: number;
|
|
60
59
|
bucket: number;
|
|
60
|
+
count: number;
|
|
61
61
|
}, {
|
|
62
62
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
63
63
|
count: import("convex/values").VFloat64<number, "required">;
|
|
64
|
-
}, "required", "
|
|
64
|
+
}, "required", "bucket" | "count">;
|
|
65
65
|
/** DAU/WAU/MAU rollup of distinct subjects. */
|
|
66
66
|
export declare const uniquesView: import("convex/values").VObject<{
|
|
67
67
|
dau: number;
|
|
68
|
-
wau: number;
|
|
69
68
|
mau: number;
|
|
70
69
|
trend: {
|
|
71
70
|
bucket: number;
|
|
72
71
|
uniques: number;
|
|
73
72
|
}[];
|
|
73
|
+
wau: number;
|
|
74
74
|
}, {
|
|
75
75
|
dau: import("convex/values").VFloat64<number, "required">;
|
|
76
76
|
wau: import("convex/values").VFloat64<number, "required">;
|
|
@@ -85,7 +85,7 @@ export declare const uniquesView: import("convex/values").VObject<{
|
|
|
85
85
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
86
86
|
uniques: import("convex/values").VFloat64<number, "required">;
|
|
87
87
|
}, "required", "bucket" | "uniques">, "required">;
|
|
88
|
-
}, "required", "dau" | "
|
|
88
|
+
}, "required", "dau" | "mau" | "trend" | "wau">;
|
|
89
89
|
/** A single funnel step result. */
|
|
90
90
|
export declare const funnelStep: import("convex/values").VObject<{
|
|
91
91
|
count: number;
|
|
@@ -99,52 +99,52 @@ export declare const funnelStep: import("convex/values").VObject<{
|
|
|
99
99
|
/** A single retention cohort row. */
|
|
100
100
|
export declare const retentionCohort: import("convex/values").VObject<{
|
|
101
101
|
cohort: number;
|
|
102
|
-
size: number;
|
|
103
102
|
retained: number[];
|
|
103
|
+
size: number;
|
|
104
104
|
}, {
|
|
105
105
|
cohort: import("convex/values").VFloat64<number, "required">;
|
|
106
106
|
size: import("convex/values").VFloat64<number, "required">;
|
|
107
107
|
retained: import("convex/values").VArray<number[], import("convex/values").VFloat64<number, "required">, "required">;
|
|
108
|
-
}, "required", "cohort" | "
|
|
108
|
+
}, "required", "cohort" | "retained" | "size">;
|
|
109
109
|
/** Paginated raw-event page (Convex pagination result shape). */
|
|
110
110
|
export declare const eventPage: import("convex/values").VObject<{
|
|
111
|
+
continueCursor: string;
|
|
112
|
+
isDone: boolean;
|
|
111
113
|
page: {
|
|
112
|
-
subjectRef?: string | undefined;
|
|
113
|
-
sessionRef?: string | undefined;
|
|
114
|
-
dedupeKey?: string | undefined;
|
|
115
114
|
_creationTime: number;
|
|
116
|
-
name: string;
|
|
117
|
-
ts: number;
|
|
118
115
|
_id: string;
|
|
119
|
-
|
|
116
|
+
dedupeKey?: string | undefined;
|
|
117
|
+
name: string;
|
|
120
118
|
props: Record<string, string | number | boolean | null>;
|
|
119
|
+
scope: string;
|
|
121
120
|
seq: number;
|
|
121
|
+
sessionRef?: string | undefined;
|
|
122
|
+
subjectRef?: string | undefined;
|
|
123
|
+
ts: number;
|
|
122
124
|
}[];
|
|
123
|
-
isDone: boolean;
|
|
124
|
-
continueCursor: string;
|
|
125
125
|
}, {
|
|
126
126
|
page: import("convex/values").VArray<{
|
|
127
|
-
subjectRef?: string | undefined;
|
|
128
|
-
sessionRef?: string | undefined;
|
|
129
|
-
dedupeKey?: string | undefined;
|
|
130
127
|
_creationTime: number;
|
|
131
|
-
name: string;
|
|
132
|
-
ts: number;
|
|
133
128
|
_id: string;
|
|
134
|
-
|
|
129
|
+
dedupeKey?: string | undefined;
|
|
130
|
+
name: string;
|
|
135
131
|
props: Record<string, string | number | boolean | null>;
|
|
132
|
+
scope: string;
|
|
136
133
|
seq: number;
|
|
137
|
-
}[], import("convex/values").VObject<{
|
|
138
|
-
subjectRef?: string | undefined;
|
|
139
134
|
sessionRef?: string | undefined;
|
|
140
|
-
|
|
141
|
-
_creationTime: number;
|
|
142
|
-
name: string;
|
|
135
|
+
subjectRef?: string | undefined;
|
|
143
136
|
ts: number;
|
|
137
|
+
}[], import("convex/values").VObject<{
|
|
138
|
+
_creationTime: number;
|
|
144
139
|
_id: string;
|
|
145
|
-
|
|
140
|
+
dedupeKey?: string | undefined;
|
|
141
|
+
name: string;
|
|
146
142
|
props: Record<string, string | number | boolean | null>;
|
|
143
|
+
scope: string;
|
|
147
144
|
seq: number;
|
|
145
|
+
sessionRef?: string | undefined;
|
|
146
|
+
subjectRef?: string | undefined;
|
|
147
|
+
ts: number;
|
|
148
148
|
}, {
|
|
149
149
|
_id: import("convex/values").VString<string, "required">;
|
|
150
150
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
@@ -156,10 +156,10 @@ export declare const eventPage: import("convex/values").VObject<{
|
|
|
156
156
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
157
157
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
158
158
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
159
|
-
}, "required", "_creationTime" | "
|
|
159
|
+
}, "required", "_creationTime" | "_id" | "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>, "required">;
|
|
160
160
|
isDone: import("convex/values").VBoolean<boolean, "required">;
|
|
161
161
|
continueCursor: import("convex/values").VString<string, "required">;
|
|
162
|
-
}, "required", "
|
|
162
|
+
}, "required", "continueCursor" | "isDone" | "page">;
|
|
163
163
|
/** A single histogram bin: events whose measure falls at or below `upper`. */
|
|
164
164
|
export declare const distributionBin: import("convex/values").VObject<{
|
|
165
165
|
count: number;
|
|
@@ -170,13 +170,13 @@ export declare const distributionBin: import("convex/values").VObject<{
|
|
|
170
170
|
}, "required", "count" | "upper">;
|
|
171
171
|
/** Histogram of a numeric measure: ascending upper-bound bins + an overflow bucket. */
|
|
172
172
|
export declare const distributionView: import("convex/values").VObject<{
|
|
173
|
-
count: number;
|
|
174
|
-
sum: number;
|
|
175
173
|
bins: {
|
|
176
174
|
count: number;
|
|
177
175
|
upper: number;
|
|
178
176
|
}[];
|
|
177
|
+
count: number;
|
|
179
178
|
overflow: number;
|
|
179
|
+
sum: number;
|
|
180
180
|
}, {
|
|
181
181
|
bins: import("convex/values").VArray<{
|
|
182
182
|
count: number;
|
|
@@ -191,5 +191,5 @@ export declare const distributionView: import("convex/values").VObject<{
|
|
|
191
191
|
overflow: import("convex/values").VFloat64<number, "required">;
|
|
192
192
|
count: import("convex/values").VFloat64<number, "required">;
|
|
193
193
|
sum: import("convex/values").VFloat64<number, "required">;
|
|
194
|
-
}, "required", "
|
|
194
|
+
}, "required", "bins" | "count" | "overflow" | "sum">;
|
|
195
195
|
//# sourceMappingURL=validators.d.ts.map
|
package/dist/test.d.ts
CHANGED
|
@@ -20,14 +20,14 @@ declare const _default: {
|
|
|
20
20
|
register: typeof register;
|
|
21
21
|
schema: SchemaDefinition<{
|
|
22
22
|
events: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
23
|
-
subjectRef?: string | undefined;
|
|
24
|
-
sessionRef?: string | undefined;
|
|
25
23
|
dedupeKey?: string | undefined;
|
|
26
24
|
name: string;
|
|
27
|
-
ts: number;
|
|
28
|
-
scope: string;
|
|
29
25
|
props: Record<string, string | number | boolean | null>;
|
|
26
|
+
scope: string;
|
|
30
27
|
seq: number;
|
|
28
|
+
sessionRef?: string | undefined;
|
|
29
|
+
subjectRef?: string | undefined;
|
|
30
|
+
ts: number;
|
|
31
31
|
}, {
|
|
32
32
|
scope: import("convex/values").VString<string, "required">;
|
|
33
33
|
name: import("convex/values").VString<string, "required">;
|
|
@@ -37,56 +37,56 @@ declare const _default: {
|
|
|
37
37
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
38
38
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
39
39
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
40
|
-
}, "required", "
|
|
40
|
+
}, "required", "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>, {
|
|
41
|
+
by_dedupe: ["scope", "dedupeKey", "_creationTime"];
|
|
41
42
|
by_scope_name_ts: ["scope", "name", "ts", "_creationTime"];
|
|
42
|
-
by_scope_subject_ts: ["scope", "subjectRef", "ts", "_creationTime"];
|
|
43
43
|
by_scope_session_ts: ["scope", "sessionRef", "ts", "_creationTime"];
|
|
44
|
-
|
|
44
|
+
by_scope_subject_ts: ["scope", "subjectRef", "ts", "_creationTime"];
|
|
45
45
|
}, {}, {}>;
|
|
46
46
|
rollups: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
47
|
+
bucket: number;
|
|
47
48
|
count: number;
|
|
48
|
-
name: string;
|
|
49
49
|
dim: string;
|
|
50
|
-
|
|
50
|
+
granularity: "day" | "hour" | "minute";
|
|
51
|
+
name: string;
|
|
51
52
|
scope: string;
|
|
52
|
-
|
|
53
|
-
granularity: "minute" | "hour" | "day";
|
|
53
|
+
val: string;
|
|
54
54
|
}, {
|
|
55
55
|
scope: import("convex/values").VString<string, "required">;
|
|
56
56
|
name: import("convex/values").VString<string, "required">;
|
|
57
|
-
granularity: import("convex/values").VUnion<"
|
|
57
|
+
granularity: import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>;
|
|
58
58
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
59
59
|
dim: import("convex/values").VString<string, "required">;
|
|
60
60
|
val: import("convex/values").VString<string, "required">;
|
|
61
61
|
count: import("convex/values").VFloat64<number, "required">;
|
|
62
|
-
}, "required", "
|
|
63
|
-
by_scope_name_gran_bucket_dim: ["scope", "name", "granularity", "bucket", "dim", "val", "_creationTime"];
|
|
62
|
+
}, "required", "bucket" | "count" | "dim" | "granularity" | "name" | "scope" | "val">, {
|
|
64
63
|
by_scope_name_dim_val: ["scope", "name", "dim", "val", "_creationTime"];
|
|
64
|
+
by_scope_name_gran_bucket_dim: ["scope", "name", "granularity", "bucket", "dim", "val", "_creationTime"];
|
|
65
65
|
}, {}, {}>;
|
|
66
66
|
subjects: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
67
|
-
|
|
68
|
-
subjectRef: string;
|
|
67
|
+
eventCount: number;
|
|
69
68
|
firstSeen: number;
|
|
70
69
|
lastSeen: number;
|
|
71
|
-
|
|
70
|
+
scope: string;
|
|
71
|
+
subjectRef: string;
|
|
72
72
|
}, {
|
|
73
73
|
scope: import("convex/values").VString<string, "required">;
|
|
74
74
|
subjectRef: import("convex/values").VString<string, "required">;
|
|
75
75
|
firstSeen: import("convex/values").VFloat64<number, "required">;
|
|
76
76
|
lastSeen: import("convex/values").VFloat64<number, "required">;
|
|
77
77
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
78
|
-
}, "required", "
|
|
79
|
-
by_scope_subject: ["scope", "subjectRef", "_creationTime"];
|
|
78
|
+
}, "required", "eventCount" | "firstSeen" | "lastSeen" | "scope" | "subjectRef">, {
|
|
80
79
|
by_scope_firstSeen: ["scope", "firstSeen", "_creationTime"];
|
|
80
|
+
by_scope_subject: ["scope", "subjectRef", "_creationTime"];
|
|
81
81
|
}, {}, {}>;
|
|
82
82
|
sessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
83
|
-
subjectRef?: string | undefined;
|
|
84
83
|
endTs?: number | undefined;
|
|
84
|
+
eventCount: number;
|
|
85
|
+
lastTs: number;
|
|
85
86
|
scope: string;
|
|
86
87
|
sessionRef: string;
|
|
87
|
-
eventCount: number;
|
|
88
88
|
startTs: number;
|
|
89
|
-
|
|
89
|
+
subjectRef?: string | undefined;
|
|
90
90
|
}, {
|
|
91
91
|
scope: import("convex/values").VString<string, "required">;
|
|
92
92
|
sessionRef: import("convex/values").VString<string, "required">;
|
|
@@ -95,19 +95,19 @@ declare const _default: {
|
|
|
95
95
|
endTs: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
96
96
|
lastTs: import("convex/values").VFloat64<number, "required">;
|
|
97
97
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
98
|
-
}, "required", "
|
|
99
|
-
by_scope_session: ["scope", "sessionRef", "_creationTime"];
|
|
98
|
+
}, "required", "endTs" | "eventCount" | "lastTs" | "scope" | "sessionRef" | "startTs" | "subjectRef">, {
|
|
100
99
|
by_scope_lastTs: ["scope", "lastTs", "_creationTime"];
|
|
100
|
+
by_scope_session: ["scope", "sessionRef", "_creationTime"];
|
|
101
101
|
}, {}, {}>;
|
|
102
102
|
config: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
103
|
-
value: string;
|
|
104
103
|
key: string;
|
|
105
104
|
scope: string;
|
|
105
|
+
value: string;
|
|
106
106
|
}, {
|
|
107
107
|
scope: import("convex/values").VString<string, "required">;
|
|
108
108
|
key: import("convex/values").VString<string, "required">;
|
|
109
109
|
value: import("convex/values").VString<string, "required">;
|
|
110
|
-
}, "required", "
|
|
110
|
+
}, "required", "key" | "scope" | "value">, {
|
|
111
111
|
by_scope_key: ["scope", "key", "_creationTime"];
|
|
112
112
|
}, {}, {}>;
|
|
113
113
|
}, true>;
|
package/dist/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQrE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,EACvD,IAAI,GAAE,MAAoB,GACzB,IAAI,CAaN
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQrE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,EACvD,IAAI,GAAE,MAAoB,GACzB,IAAI,CAaN"}
|
package/dist/test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAGA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAGA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CACtB,CAAuD,EACvD,IAAI,GAAW,WAAW;IAE1B,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC,iBAAiB,CAAC,GAAG,IAAI,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC,CAAC,iBAAiB,CACjB,GAAG,IAAI,iBAAiB,EACxB,kBAAkB,CAAC,MAAM,EACzB,kBAAkB,CAAC,OAAO,CAC3B,CAAC;IACF,CAAC,CAAC,iBAAiB,CACjB,GAAG,IAAI,cAAc,EACrB,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,OAAO,CACxB,CAAC;AACJ,CAAC;AAED,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/web/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,aAAa,YACxB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,CACL,CAAC;AAEX,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,yDAAyD;AACzD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAyB;AACzB,MAAM,WAAW,GAAG;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA0BD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,CAExD;AAeD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAUjF;AAED,+EAA+E;AAC/E,UAAU,cAAc;IACtB,KAAK,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.
|
|
3
|
+
"version": "0.1.0-canary.67f5cc1",
|
|
4
4
|
"description": "Generic, configurable analytics component for Convex — any event, any dimension, any domain; rollup-on-write with funnels, retention, uniques",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -50,26 +50,29 @@
|
|
|
50
50
|
"preversion": "pnpm install --frozen-lockfile && pnpm build && pnpm test:coverage && pnpm typecheck && pnpm generate:llms"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@convex-dev/aggregate": "^0.
|
|
53
|
+
"@convex-dev/aggregate": "^0.3.0",
|
|
54
54
|
"@convex-dev/rate-limiter": "^0.3.2",
|
|
55
|
-
"@convex-dev/sharded-counter": "^0.2.
|
|
56
|
-
"convex": "^1.
|
|
55
|
+
"@convex-dev/sharded-counter": "^0.2.1",
|
|
56
|
+
"convex": "^1.45.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@edge-runtime/vm": "^
|
|
60
|
-
"@testing-library/react": "^16.
|
|
61
|
-
"@types/react": "^19.
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
59
|
+
"@edge-runtime/vm": "^5.0.0",
|
|
60
|
+
"@testing-library/react": "^16.3.3",
|
|
61
|
+
"@types/react": "^19.2.18",
|
|
62
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
63
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
64
|
+
"@vllnt/eslint-config": "2.0.0",
|
|
65
|
+
"@vllnt/typescript": "2.0.0",
|
|
66
|
+
"convex-test": "^0.0.56",
|
|
67
|
+
"jsdom": "^29.1.1",
|
|
68
|
+
"react": "^19.2.8",
|
|
69
|
+
"react-dom": "^19.2.8",
|
|
70
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
71
|
+
"vite": "^8.2.2",
|
|
72
|
+
"vitest": "^4.1.11"
|
|
70
73
|
},
|
|
71
74
|
"peerDependencies": {
|
|
72
|
-
"convex": "
|
|
75
|
+
"convex": "^1.45.0",
|
|
73
76
|
"react": ">=18.0.0"
|
|
74
77
|
},
|
|
75
78
|
"peerDependenciesMeta": {
|
|
@@ -54,7 +54,7 @@ export const prune = internalMutation({
|
|
|
54
54
|
.order("asc")
|
|
55
55
|
.take(PRUNE_CAP);
|
|
56
56
|
const toDelete = oldest.filter((e) => e.ts < cutoff);
|
|
57
|
-
await Promise.all(toDelete.map((e) => ctx.db.delete(e._id)));
|
|
57
|
+
await Promise.all(toDelete.map((e) => ctx.db.delete("events", e._id)));
|
|
58
58
|
return toDelete.length;
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -83,7 +83,9 @@ export const closeSessions = internalMutation({
|
|
|
83
83
|
.withIndex("by_scope_lastTs", (q) => q.eq("scope", scope).lt("lastTs", cutoff))
|
|
84
84
|
.take(1000);
|
|
85
85
|
const stale = open.filter((s) => s.endTs === undefined);
|
|
86
|
-
await Promise.all(
|
|
86
|
+
await Promise.all(
|
|
87
|
+
stale.map((s) => ctx.db.patch("sessions", s._id, { endTs: s.lastTs })),
|
|
88
|
+
);
|
|
87
89
|
return stale.length;
|
|
88
90
|
};
|
|
89
91
|
|
|
@@ -113,7 +115,7 @@ export const backfill = internalMutation({
|
|
|
113
115
|
q.eq("scope", args.scope).eq("name", args.name),
|
|
114
116
|
)
|
|
115
117
|
.collect();
|
|
116
|
-
await Promise.all(existing.map((r) => ctx.db.delete(r._id)));
|
|
118
|
+
await Promise.all(existing.map((r) => ctx.db.delete("rollups", r._id)));
|
|
117
119
|
|
|
118
120
|
const events = await ctx.db
|
|
119
121
|
.query("events")
|
|
@@ -48,7 +48,7 @@ async function bumpRollup(
|
|
|
48
48
|
)
|
|
49
49
|
.unique();
|
|
50
50
|
if (existing) {
|
|
51
|
-
await ctx.db.patch(existing._id, { count: existing.count + 1 });
|
|
51
|
+
await ctx.db.patch("rollups", existing._id, { count: existing.count + 1 });
|
|
52
52
|
} else {
|
|
53
53
|
await ctx.db.insert("rollups", {
|
|
54
54
|
scope,
|
|
@@ -131,7 +131,7 @@ export const track = mutation({
|
|
|
131
131
|
|
|
132
132
|
if (args.sessionRef !== undefined) {
|
|
133
133
|
if (sessionDoc) {
|
|
134
|
-
await ctx.db.patch(sessionDoc._id, {
|
|
134
|
+
await ctx.db.patch("sessions", sessionDoc._id, {
|
|
135
135
|
lastTs: ts,
|
|
136
136
|
eventCount: sessionDoc.eventCount + 1,
|
|
137
137
|
subjectRef: args.subjectRef ?? sessionDoc.subjectRef,
|
|
@@ -156,7 +156,7 @@ export const track = mutation({
|
|
|
156
156
|
)
|
|
157
157
|
.unique();
|
|
158
158
|
if (subject) {
|
|
159
|
-
await ctx.db.patch(subject._id, {
|
|
159
|
+
await ctx.db.patch("subjects", subject._id, {
|
|
160
160
|
lastSeen: ts > subject.lastSeen ? ts : subject.lastSeen,
|
|
161
161
|
firstSeen: ts < subject.firstSeen ? ts : subject.firstSeen,
|
|
162
162
|
eventCount: subject.eventCount + 1,
|
|
@@ -213,7 +213,7 @@ async function upsertConfig(
|
|
|
213
213
|
.withIndex("by_scope_key", (q) => q.eq("scope", scope).eq("key", key))
|
|
214
214
|
.unique();
|
|
215
215
|
if (existing) {
|
|
216
|
-
await ctx.db.patch(existing._id, { value });
|
|
216
|
+
await ctx.db.patch("config", existing._id, { value });
|
|
217
217
|
} else {
|
|
218
218
|
await ctx.db.insert("config", { scope, key, value });
|
|
219
219
|
}
|