@vllnt/convex-analytics 0.1.0-canary.e99d8e6 → 0.1.1-canary.46dc78e
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 +76 -45
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +30 -6
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js +21 -2
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +181 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +33 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -1
- package/dist/component/_generated/dataModel.js +3 -0
- package/dist/component/_generated/dataModel.js.map +1 -1
- package/dist/component/_generated/server.d.ts +113 -0
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js +65 -0
- package/dist/component/_generated/server.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/crons.d.ts +3 -0
- package/dist/component/crons.d.ts.map +1 -0
- package/dist/component/crons.js +7 -0
- package/dist/component/crons.js.map +1 -0
- package/dist/component/http.d.ts +5 -0
- package/dist/component/http.d.ts.map +1 -1
- package/dist/component/http.js +76 -21
- package/dist/component/http.js.map +1 -1
- package/dist/component/internal_mutations.d.ts +5 -2
- package/dist/component/internal_mutations.d.ts.map +1 -1
- package/dist/component/internal_mutations.js +74 -44
- package/dist/component/internal_mutations.js.map +1 -1
- package/dist/component/mutations.d.ts +11 -11
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +51 -14
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts +21 -21
- package/dist/component/queries.d.ts.map +1 -1
- package/dist/component/queries.js +60 -62
- package/dist/component/queries.js.map +1 -1
- package/dist/component/schema.d.ts +36 -26
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +8 -2
- package/dist/component/schema.js.map +1 -1
- package/dist/component/validators.d.ts +67 -40
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +54 -1
- package/dist/component/validators.js.map +1 -1
- package/dist/shared.d.ts +2 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -0
- package/dist/shared.js.map +1 -1
- package/dist/test.d.ts +36 -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 +27 -26
- package/src/component/_generated/api.ts +36 -9
- package/src/component/_generated/component.ts +196 -0
- package/src/component/_generated/dataModel.ts +36 -0
- package/src/component/_generated/server.ts +130 -3
- package/src/component/crons.ts +19 -0
- package/src/component/http.ts +78 -21
- package/src/component/internal_mutations.ts +105 -58
- package/src/component/mutations.ts +62 -15
- package/src/component/queries.ts +77 -67
- package/src/component/schema.ts +9 -2
- package/src/component/validators.ts +80 -1
- package/src/shared.ts +5 -0
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<!-- Badges -->
|
|
2
|
+
|
|
2
3
|
[](https://www.convex.dev/components)
|
|
3
4
|
[](https://www.npmjs.com/package/@vllnt/convex-analytics)
|
|
4
5
|
[](https://github.com/vllnt/convex-analytics/actions/workflows/ci.yml)
|
|
@@ -7,7 +8,7 @@
|
|
|
7
8
|
# @vllnt/convex-analytics
|
|
8
9
|
|
|
9
10
|
A generic, configurable, embedded analytics component for Convex — any event,
|
|
10
|
-
any dimension, any domain — with rollup-on-write
|
|
11
|
+
any dimension, any domain — with rollup-on-write for reactive aggregate reads.
|
|
11
12
|
|
|
12
13
|
```ts
|
|
13
14
|
import { AnalyticsClient } from "@vllnt/convex-analytics";
|
|
@@ -17,7 +18,10 @@ const analytics = new AnalyticsClient(components.analytics, {
|
|
|
17
18
|
dimensions: ["plan", "country"], // prop keys to roll up on
|
|
18
19
|
});
|
|
19
20
|
|
|
20
|
-
await analytics.track(ctx, "signup", {
|
|
21
|
+
await analytics.track(ctx, "signup", {
|
|
22
|
+
subjectRef: userId,
|
|
23
|
+
props: { plan: "pro", country: "FR" },
|
|
24
|
+
});
|
|
21
25
|
const byPlan = await analytics.top(ctx, "signup", "plan"); // [{ value: "pro", count: 1 }]
|
|
22
26
|
```
|
|
23
27
|
|
|
@@ -25,9 +29,9 @@ const byPlan = await analytics.top(ctx, "signup", "plan"); // [{ value: "pro", c
|
|
|
25
29
|
|
|
26
30
|
- **Generic events** — free-string event name, opaque `subjectRef` / `sessionRef`, host-typed `props`.
|
|
27
31
|
- **Host-declared dimensions** — you pass the prop keys to roll up on; nothing is hardcoded.
|
|
28
|
-
- **Rollup-on-write** — counts are incremented as events land
|
|
32
|
+
- **Rollup-on-write** — counts are incremented as events land. Unfiltered lifetime `metric` reads a fixed-shard counter; ranged/filtered metrics, breakdowns, and time series scan matching rollup rows, not constant-time results.
|
|
29
33
|
- **Rich verb set** — `metric`, `top`, `timeseries`, `uniques`, `funnel`, `retention`, `distribution`, plus paginated raw `list`.
|
|
30
|
-
- **Configurable** — `scope`, `dimensions`, `granularities`, `retentionDays`, `sampleRate
|
|
34
|
+
- **Configurable** — `scope`, `dimensions`, `granularities`, `retentionDays`, `sampleRate`; sensible defaults, zero config required.
|
|
31
35
|
- **Per-session rate limiting + dedupe + sampling** built into `track`.
|
|
32
36
|
- **Opt-in web preset** — `@vllnt/convex-analytics/web` adds web dimensions + UA/geo helpers when you want them.
|
|
33
37
|
- **Optional React hooks** — `@vllnt/convex-analytics/react` for reactive aggregate reads.
|
|
@@ -48,6 +52,9 @@ fields. See [docs/web-preset.md](docs/web-preset.md).
|
|
|
48
52
|
npm install @vllnt/convex-analytics
|
|
49
53
|
```
|
|
50
54
|
|
|
55
|
+
Requires `convex@^1.45.0` as a peer dependency; React is optional. The command installs
|
|
56
|
+
the latest stable release; `@canary` follows `main`.
|
|
57
|
+
|
|
51
58
|
## Usage
|
|
52
59
|
|
|
53
60
|
```ts
|
|
@@ -72,7 +79,10 @@ const analytics = new AnalyticsClient<MyProps>(components.analytics, {
|
|
|
72
79
|
granularities: ["day"],
|
|
73
80
|
});
|
|
74
81
|
|
|
75
|
-
await analytics.track(ctx, "signup", {
|
|
82
|
+
await analytics.track(ctx, "signup", {
|
|
83
|
+
subjectRef: userId,
|
|
84
|
+
props: { plan: "pro" },
|
|
85
|
+
});
|
|
76
86
|
const total = await analytics.metric(ctx, "signup");
|
|
77
87
|
```
|
|
78
88
|
|
|
@@ -80,42 +90,70 @@ const total = await analytics.metric(ctx, "signup");
|
|
|
80
90
|
|
|
81
91
|
Passed to the `AnalyticsClient` constructor. All optional — the defaults work with zero config.
|
|
82
92
|
|
|
83
|
-
| Option
|
|
84
|
-
|
|
85
|
-
| `scope`
|
|
86
|
-
| `dimensions`
|
|
87
|
-
| `granularities` | `("minute" \| "hour" \| "day")[]` | `["day"]`
|
|
88
|
-
| `retentionDays` | `number`
|
|
89
|
-
| `sampleRate`
|
|
90
|
-
| `sessionIdleMs` | `number`
|
|
91
|
-
| `propsValidator` | Convex validator | typed scalar record | Optional host validator narrowing `props` at the boundary. |
|
|
93
|
+
| Option | Type | Default | Purpose |
|
|
94
|
+
| --------------- | --------------------------------- | ----------- | ----------------------------------------------------------------------------------- |
|
|
95
|
+
| `scope` | `string` | `"default"` | Multi-tenant partition; isolates one tenant's data. |
|
|
96
|
+
| `dimensions` | `string[]` | `[]` | Prop keys to roll up on (drives rollup-on-write). Empty = count by event name only. |
|
|
97
|
+
| `granularities` | `("minute" \| "hour" \| "day")[]` | `["day"]` | Rollup bucket sizes (`minute` for short live windows). |
|
|
98
|
+
| `retentionDays` | `number` | `90` | Raw-event TTL in days (rollups are kept forever). Applied via `configure`. |
|
|
99
|
+
| `sampleRate` | `number` | `1` | Fraction `0..1` of events to keep at ingest. |
|
|
100
|
+
| `sessionIdleMs` | `number` | `1800000` | Idle timeout before a session is closed. Applied via `configure`. |
|
|
92
101
|
|
|
93
102
|
`scope`, `dimensions`, `granularities`, and `sampleRate` apply per call from the client.
|
|
94
103
|
`retentionDays`, `sampleRate`, and `sessionIdleMs` are persisted for the prune/close-sessions
|
|
95
104
|
crons by calling `analytics.configure(ctx, { ... })` once.
|
|
105
|
+
`TProps` is compile-time typing only; validate untrusted props in host wrappers. There is no
|
|
106
|
+
`propsValidator` constructor option.
|
|
107
|
+
|
|
108
|
+
When `sessionRef` is supplied, ingest uses a token bucket per `(scope, sessionRef)`:
|
|
109
|
+
100 events/minute refill, capacity 10. These limits are currently fixed, not client config.
|
|
110
|
+
Exhaustion and sampling both return `"dropped"`; without `sessionRef`, this limiter is skipped.
|
|
96
111
|
|
|
97
112
|
## API
|
|
98
113
|
|
|
99
|
-
| Verb
|
|
100
|
-
|
|
101
|
-
| `track(ctx, name, opts)`
|
|
102
|
-
| `metric(ctx, name, opts)`
|
|
103
|
-
| `top(ctx, name, dimension, opts)`
|
|
104
|
-
| `timeseries(ctx, name, opts)`
|
|
105
|
-
| `uniques(ctx, opts)`
|
|
106
|
-
| `funnel(ctx, steps, opts)`
|
|
107
|
-
| `retention(ctx, opts)`
|
|
108
|
-
| `distribution(ctx, name, measure, opts)` | query
|
|
109
|
-
| `list(ctx, name, paginationOpts, opts)`
|
|
110
|
-
| `configure(ctx, opts)`
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
| Verb | Kind | Purpose |
|
|
115
|
+
| ---------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| `track(ctx, name, opts)` | mutation | Ingest an event; rollup-on-write + raw event + counter. Returns `"tracked" \| "dropped" \| "duplicate"`. |
|
|
117
|
+
| `metric(ctx, name, opts)` | query | Total count over a range, optionally filtered by a dimension value. |
|
|
118
|
+
| `top(ctx, name, dimension, opts)` | query | Top values of a dimension (breakdown). |
|
|
119
|
+
| `timeseries(ctx, name, opts)` | query | Bucketed counts over a range. |
|
|
120
|
+
| `uniques(ctx, opts)` | query | DAU / WAU / MAU from subjects. |
|
|
121
|
+
| `funnel(ctx, steps, opts)` | query | Ordered step conversion, keyed by `subjectRef`. |
|
|
122
|
+
| `retention(ctx, opts)` | query | Cohort return rates by first-seen period. |
|
|
123
|
+
| `distribution(ctx, name, measure, opts)` | query | Histogram of a numeric measure over declared buckets + overflow (with `count` / `sum`). |
|
|
124
|
+
| `list(ctx, name, paginationOpts, opts)` | query | Paginated raw events, newest first. |
|
|
125
|
+
| `configure(ctx, opts)` | mutation | Persist cron-relevant config (retention / sampling / idle). |
|
|
126
|
+
|
|
127
|
+
`timeseries` and `uniques` require `range` and `granularity`; `funnel` requires `range`;
|
|
128
|
+
`retention` requires `cohortRange` and `periods`; `distribution` requires `buckets`.
|
|
129
|
+
`list` requires pagination options. See [docs/client-sdk.md](docs/client-sdk.md) for exact types.
|
|
130
|
+
|
|
131
|
+
### Optional REST access
|
|
132
|
+
|
|
133
|
+
Expose the routes by mounting with `app.use(analytics, { httpPrefix: "/analytics" })`.
|
|
134
|
+
Then configure keys from a trusted host mutation (not a public unauthenticated endpoint):
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
await ctx.runMutation(components.analytics.mutations.configSet, {
|
|
138
|
+
scope: "default",
|
|
139
|
+
key: "apiKeys",
|
|
140
|
+
value: JSON.stringify([apiKey]), // host-provided secret; never ship it to the browser
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
curl -H "x-api-key: $ANALYTICS_API_KEY" \
|
|
146
|
+
"https://your-deployment.convex.site/analytics/metric?name=signup"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
There is no client `configSet` method. Keys are stored per scope; missing/unconfigured/invalid
|
|
150
|
+
keys return HTTP 401. See [docs/api-reference.md](docs/api-reference.md).
|
|
113
151
|
|
|
114
152
|
## What it serves
|
|
115
153
|
|
|
116
154
|
The Convex-native, authoritative in-app aggregate layer — predefined-dimension rollups served
|
|
117
|
-
**reactively**
|
|
118
|
-
Declare the dimensions
|
|
155
|
+
**reactively** from pre-aggregated rows. It complements a product-analytics warehouse; it doesn't replace one.
|
|
156
|
+
Declare the dimensions you'll query; read cost still grows with matching buckets and values; ad-hoc or
|
|
119
157
|
retroactive questions over **non-declared** dimensions, or beyond the raw-event retention window,
|
|
120
158
|
are an export concern. `metric` / `top` / `timeseries` read pre-aggregated rollups (kept forever);
|
|
121
159
|
`funnel` / `retention` / `distribution` read raw events in range (index-backed, bounded, TTL-pruned).
|
|
@@ -126,7 +164,9 @@ are an export concern. `metric` / `top` / `timeseries` read pre-aggregated rollu
|
|
|
126
164
|
import { AnalyticsClient } from "@vllnt/convex-analytics";
|
|
127
165
|
import { webDimensions, trackPageview } from "@vllnt/convex-analytics/web";
|
|
128
166
|
|
|
129
|
-
const analytics = new AnalyticsClient(components.analytics, {
|
|
167
|
+
const analytics = new AnalyticsClient(components.analytics, {
|
|
168
|
+
dimensions: webDimensions,
|
|
169
|
+
});
|
|
130
170
|
|
|
131
171
|
await trackPageview(analytics, ctx, {
|
|
132
172
|
path: "/pricing",
|
|
@@ -150,24 +190,15 @@ const byPlan = useTop(api.analytics.top, { name: "signup", dimension: "plan" });
|
|
|
150
190
|
```
|
|
151
191
|
|
|
152
192
|
Thin reactive wrappers over the host's re-exported query refs (`metric`, `top`, `timeseries`,
|
|
153
|
-
`uniques`). `react`
|
|
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).
|
|
193
|
+
`uniques`). `react` is an optional peer dep; backend-only consumers pull no React.
|
|
165
194
|
|
|
166
195
|
## Security
|
|
167
196
|
|
|
168
197
|
- Auth-agnostic mount — the host gates access and passes opaque `subjectRef` / `sessionRef` in.
|
|
169
198
|
- Tables are sandboxed; the host reaches them only through the exported functions.
|
|
170
199
|
- REST endpoints require an `x-api-key` header, compared timing-safe.
|
|
200
|
+
- Invalid input (empty strings, `NaN` / infinite timestamps, non-scalar props) is rejected with a typed `ConvexError`; see [docs/api-reference.md](docs/api-reference.md#input-errors).
|
|
201
|
+
- The component never logs event data. Props and refs are stored as given, so keep personal data out of them (the web preset stores `path`, `referrer`, and geo as received).
|
|
171
202
|
|
|
172
203
|
See [docs/architecture.md](docs/architecture.md).
|
|
173
204
|
|
|
@@ -189,8 +220,8 @@ analyticsTest.register(t);
|
|
|
189
220
|
|
|
190
221
|
[Schema](docs/schema.md) · [Client SDK](docs/client-sdk.md) · [REST API](docs/api-reference.md) ·
|
|
191
222
|
[Web Preset](docs/web-preset.md) · [Multi-Product](docs/multi-product.md) ·
|
|
192
|
-
[Architecture](docs/architecture.md)
|
|
193
|
-
[`llms.txt`](llms.txt)
|
|
223
|
+
[Architecture](docs/architecture.md). For AI agents:
|
|
224
|
+
[`llms.txt`](llms.txt), the maintained documentation index.
|
|
194
225
|
|
|
195
226
|
## Contributing
|
|
196
227
|
|
|
@@ -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,EAC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AED,6EAA6E;IACvE,YAAY,CAChB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GACxE,OAAO,CAAC,gBAAgB,CAAC,CAS3B;IAED,4DAA4D;IACtD,IAAI,CACR,GAAG,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;;;;;;;;;;;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SACT,CAAC,CAAqB,CAAC;IACnC,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,IAAI,CACR,GAAa,EACb,IAAY,EACZ,cAA8B,EAC9B,IAAI,GAAuB,EAAE;QAE7B,OAAO,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAa,EAAE;YAC/D,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;YAC/B,IAAI;YACJ,cAAc;SACN,CAAC,CAAc,CAAC;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,22 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated `api` utility.
|
|
3
|
+
*
|
|
3
4
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
4
7
|
* @module
|
|
5
8
|
*/
|
|
9
|
+
import type * as http from "../http.js";
|
|
10
|
+
import type * as internal_mutations from "../internal_mutations.js";
|
|
6
11
|
import type * as mutations from "../mutations.js";
|
|
7
12
|
import type * as queries from "../queries.js";
|
|
8
|
-
import type * as
|
|
9
|
-
import type * as http from "../http.js";
|
|
13
|
+
import type * as validators from "../validators.js";
|
|
10
14
|
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
11
|
-
import { componentsGeneric } from "convex/server";
|
|
12
15
|
declare const fullApi: ApiFromModules<{
|
|
16
|
+
http: typeof http;
|
|
17
|
+
internal_mutations: typeof internal_mutations;
|
|
13
18
|
mutations: typeof mutations;
|
|
14
19
|
queries: typeof queries;
|
|
15
|
-
|
|
16
|
-
http: typeof http;
|
|
20
|
+
validators: typeof validators;
|
|
17
21
|
}>;
|
|
22
|
+
/**
|
|
23
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* ```js
|
|
27
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
18
30
|
export declare const api: FilterApi<typeof fullApi, FunctionReference<any, "public">>;
|
|
31
|
+
/**
|
|
32
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
* ```js
|
|
36
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
19
39
|
export declare const internal: FilterApi<typeof fullApi, FunctionReference<any, "internal">>;
|
|
20
|
-
export declare const components:
|
|
40
|
+
export declare const components: {
|
|
41
|
+
aggregate: import("@convex-dev/aggregate/_generated/component.js").ComponentApi<"aggregate">;
|
|
42
|
+
shardedCounter: import("@convex-dev/sharded-counter/_generated/component.js").ComponentApi<"shardedCounter">;
|
|
43
|
+
rateLimiter: import("@convex-dev/rate-limiter/_generated/component.js").ComponentApi<"rateLimiter">;
|
|
44
|
+
};
|
|
21
45
|
export {};
|
|
22
46
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceR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
3
3
|
* Generated `api` utility.
|
|
4
|
+
*
|
|
4
5
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
5
8
|
* @module
|
|
6
9
|
*/
|
|
7
10
|
import { anyApi, componentsGeneric } from "convex/server";
|
|
8
11
|
const fullApi = anyApi;
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
* ```js
|
|
17
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const api = anyApi;
|
|
21
|
+
/**
|
|
22
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
23
|
+
*
|
|
24
|
+
* Usage:
|
|
25
|
+
* ```js
|
|
26
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const internal = anyApi;
|
|
11
30
|
export const components = componentsGeneric();
|
|
12
31
|
//# sourceMappingURL=api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAMR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAI1C,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated `ComponentApi` utility.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { FunctionReference } from "convex/server";
|
|
10
|
+
/**
|
|
11
|
+
* A utility for referencing a Convex component's exposed API.
|
|
12
|
+
*
|
|
13
|
+
* Useful when expecting a parameter like `components.myComponent`.
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```ts
|
|
16
|
+
* async function myFunction(ctx: QueryCtx, component: ComponentApi) {
|
|
17
|
+
* return ctx.runQuery(component.someFile.someQuery, { ...args });
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
22
|
+
mutations: {
|
|
23
|
+
configSet: FunctionReference<"mutation", "internal", {
|
|
24
|
+
key: string;
|
|
25
|
+
scope: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}, null, Name>;
|
|
28
|
+
configure: FunctionReference<"mutation", "internal", {
|
|
29
|
+
retentionDays?: number;
|
|
30
|
+
sampleRate?: number;
|
|
31
|
+
scope: string;
|
|
32
|
+
sessionIdleMs?: number;
|
|
33
|
+
}, null, Name>;
|
|
34
|
+
track: FunctionReference<"mutation", "internal", {
|
|
35
|
+
dedupeKey?: string;
|
|
36
|
+
dimensions: Array<string>;
|
|
37
|
+
granularities: Array<"minute" | "hour" | "day">;
|
|
38
|
+
name: string;
|
|
39
|
+
props?: Record<string, string | number | boolean | null>;
|
|
40
|
+
sampleRate?: number;
|
|
41
|
+
scope: string;
|
|
42
|
+
sessionRef?: string;
|
|
43
|
+
subjectRef?: string;
|
|
44
|
+
ts?: number;
|
|
45
|
+
}, "tracked" | "dropped" | "duplicate", Name>;
|
|
46
|
+
};
|
|
47
|
+
queries: {
|
|
48
|
+
configGet: FunctionReference<"query", "internal", {
|
|
49
|
+
key: string;
|
|
50
|
+
scope: string;
|
|
51
|
+
}, string | null, Name>;
|
|
52
|
+
distribution: FunctionReference<"query", "internal", {
|
|
53
|
+
buckets: Array<number>;
|
|
54
|
+
measure: string;
|
|
55
|
+
name: string;
|
|
56
|
+
range?: {
|
|
57
|
+
from?: number;
|
|
58
|
+
to?: number;
|
|
59
|
+
};
|
|
60
|
+
scope: string;
|
|
61
|
+
where?: {
|
|
62
|
+
dim: string;
|
|
63
|
+
val: string | number | boolean | null;
|
|
64
|
+
};
|
|
65
|
+
}, {
|
|
66
|
+
bins: Array<{
|
|
67
|
+
count: number;
|
|
68
|
+
upper: number;
|
|
69
|
+
}>;
|
|
70
|
+
count: number;
|
|
71
|
+
overflow: number;
|
|
72
|
+
sum: number;
|
|
73
|
+
}, Name>;
|
|
74
|
+
funnel: FunctionReference<"query", "internal", {
|
|
75
|
+
range: {
|
|
76
|
+
from?: number;
|
|
77
|
+
to?: number;
|
|
78
|
+
};
|
|
79
|
+
scope: string;
|
|
80
|
+
steps: Array<string>;
|
|
81
|
+
}, Array<{
|
|
82
|
+
count: number;
|
|
83
|
+
name: string;
|
|
84
|
+
rate: number;
|
|
85
|
+
}>, Name>;
|
|
86
|
+
list: FunctionReference<"query", "internal", {
|
|
87
|
+
name: string;
|
|
88
|
+
paginationOpts: {
|
|
89
|
+
cursor: string | null;
|
|
90
|
+
numItems: number;
|
|
91
|
+
};
|
|
92
|
+
scope: string;
|
|
93
|
+
}, {
|
|
94
|
+
continueCursor: string;
|
|
95
|
+
isDone: boolean;
|
|
96
|
+
page: Array<{
|
|
97
|
+
_creationTime: number;
|
|
98
|
+
_id: string;
|
|
99
|
+
dedupeKey?: string;
|
|
100
|
+
name: string;
|
|
101
|
+
props: Record<string, string | number | boolean | null>;
|
|
102
|
+
scope: string;
|
|
103
|
+
seq: number;
|
|
104
|
+
sessionRef?: string;
|
|
105
|
+
subjectRef?: string;
|
|
106
|
+
ts: number;
|
|
107
|
+
}>;
|
|
108
|
+
}, Name>;
|
|
109
|
+
metric: FunctionReference<"query", "internal", {
|
|
110
|
+
name: string;
|
|
111
|
+
range?: {
|
|
112
|
+
from?: number;
|
|
113
|
+
to?: number;
|
|
114
|
+
};
|
|
115
|
+
scope: string;
|
|
116
|
+
where?: {
|
|
117
|
+
dim: string;
|
|
118
|
+
val: string | number | boolean | null;
|
|
119
|
+
};
|
|
120
|
+
}, number, Name>;
|
|
121
|
+
retention: FunctionReference<"query", "internal", {
|
|
122
|
+
cohortRange: {
|
|
123
|
+
from?: number;
|
|
124
|
+
to?: number;
|
|
125
|
+
};
|
|
126
|
+
granularity?: "minute" | "hour" | "day";
|
|
127
|
+
periods: number;
|
|
128
|
+
scope: string;
|
|
129
|
+
}, Array<{
|
|
130
|
+
cohort: number;
|
|
131
|
+
retained: Array<number>;
|
|
132
|
+
size: number;
|
|
133
|
+
}>, Name>;
|
|
134
|
+
timeseries: FunctionReference<"query", "internal", {
|
|
135
|
+
granularity: "minute" | "hour" | "day";
|
|
136
|
+
name: string;
|
|
137
|
+
range: {
|
|
138
|
+
from?: number;
|
|
139
|
+
to?: number;
|
|
140
|
+
};
|
|
141
|
+
scope: string;
|
|
142
|
+
where?: {
|
|
143
|
+
dim: string;
|
|
144
|
+
val: string | number | boolean | null;
|
|
145
|
+
};
|
|
146
|
+
}, Array<{
|
|
147
|
+
bucket: number;
|
|
148
|
+
count: number;
|
|
149
|
+
}>, Name>;
|
|
150
|
+
top: FunctionReference<"query", "internal", {
|
|
151
|
+
dimension: string;
|
|
152
|
+
limit?: number;
|
|
153
|
+
name: string;
|
|
154
|
+
range?: {
|
|
155
|
+
from?: number;
|
|
156
|
+
to?: number;
|
|
157
|
+
};
|
|
158
|
+
scope: string;
|
|
159
|
+
}, Array<{
|
|
160
|
+
count: number;
|
|
161
|
+
value: string;
|
|
162
|
+
}>, Name>;
|
|
163
|
+
uniques: FunctionReference<"query", "internal", {
|
|
164
|
+
granularity: "minute" | "hour" | "day";
|
|
165
|
+
range: {
|
|
166
|
+
from?: number;
|
|
167
|
+
to?: number;
|
|
168
|
+
};
|
|
169
|
+
scope: string;
|
|
170
|
+
}, {
|
|
171
|
+
dau: number;
|
|
172
|
+
mau: number;
|
|
173
|
+
trend: Array<{
|
|
174
|
+
bucket: number;
|
|
175
|
+
uniques: number;
|
|
176
|
+
}>;
|
|
177
|
+
wau: number;
|
|
178
|
+
}, Name>;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3E;IACE,SAAS,EAAE;QACT,SAAS,EAAE,iBAAiB,CAC1B,UAAU,EACV,UAAU,EACV;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAC7C,IAAI,EACJ,IAAI,CACL,CAAC;QACF,SAAS,EAAE,iBAAiB,CAC1B,UAAU,EACV,UAAU,EACV;YACE,aAAa,CAAC,EAAE,MAAM,CAAC;YACvB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,KAAK,EAAE,MAAM,CAAC;YACd,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,EACD,IAAI,EACJ,IAAI,CACL,CAAC;QACF,KAAK,EAAE,iBAAiB,CACtB,UAAU,EACV,UAAU,EACV;YACE,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAC1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,KAAK,CAAC;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,EACxC,IAAI,CACL,CAAC;QACF,GAAG,EAAE,iBAAiB,CACpB,OAAO,EACP,UAAU,EACV;YACE,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,CAAC,EAAE;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAC;gBAAC,EAAE,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YACvC,KAAK,EAAE,MAAM,CAAC;SACf,EACD,KAAK,CAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,EACvC,IAAI,CACL,CAAC;QACF,OAAO,EAAE,iBAAiB,CACxB,OAAO,EACP,UAAU,EACV;YACE,WAAW,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;YACvC,KAAK,EAAE;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAC;gBAAC,EAAE,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YACtC,KAAK,EAAE,MAAM,CAAC;SACf,EACD;YACE,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;YACZ,KAAK,EAAE,KAAK,CAAC;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,OAAO,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;YAClD,GAAG,EAAE,MAAM,CAAC;SACb,EACD,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -1,13 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated data model types.
|
|
3
|
+
*
|
|
3
4
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
4
7
|
* @module
|
|
5
8
|
*/
|
|
6
9
|
import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
|
|
7
10
|
import type { GenericId } from "convex/values";
|
|
8
11
|
import schema from "../schema.js";
|
|
12
|
+
/**
|
|
13
|
+
* The names of all of your Convex tables.
|
|
14
|
+
*/
|
|
9
15
|
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
16
|
+
/**
|
|
17
|
+
* The type of a document stored in Convex.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
20
|
+
*/
|
|
10
21
|
export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
|
|
22
|
+
/**
|
|
23
|
+
* An identifier for a document in Convex.
|
|
24
|
+
*
|
|
25
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
26
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
27
|
+
*
|
|
28
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
29
|
+
*
|
|
30
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
31
|
+
* strings when type checking.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
34
|
+
*/
|
|
11
35
|
export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
|
|
36
|
+
/**
|
|
37
|
+
* A type describing your Convex data model.
|
|
38
|
+
*
|
|
39
|
+
* This type includes information about what tables you have, the type of
|
|
40
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
41
|
+
*
|
|
42
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
43
|
+
* `mutationGeneric` to make them type-safe.
|
|
44
|
+
*/
|
|
12
45
|
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|
|
13
46
|
//# sourceMappingURL=dataModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,SAAS,SAAS,UAAU,IAAI,cAAc,CAC5D,SAAS,EACT,SAAS,CACV,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,UAAU,GAAG,gBAAgB,IAC5D,SAAS,CAAC,SAAS,CAAC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,6BAA6B,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB
|
|
1
|
+
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|