@vllnt/convex-analytics 0.2.0-canary.1ef1b2b → 0.2.0-canary.5b8d0d7
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/CHANGELOG.md +99 -49
- package/README.md +17 -9
- package/dist/component/internal_mutations.d.ts.map +1 -1
- package/dist/component/internal_mutations.js +15 -5
- package/dist/component/internal_mutations.js.map +1 -1
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +8 -11
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts.map +1 -1
- package/dist/component/queries.js +67 -17
- package/dist/component/queries.js.map +1 -1
- package/dist/component/validators.d.ts +7 -0
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +19 -0
- package/dist/component/validators.js.map +1 -1
- package/docs/api-reference.md +3 -3
- package/docs/architecture.md +18 -9
- package/docs/client-sdk.md +19 -10
- package/docs/schema.md +4 -3
- package/package.json +4 -4
- package/src/component/internal_mutations.ts +15 -5
- package/src/component/mutations.ts +10 -11
- package/src/component/queries.ts +68 -16
- package/src/component/validators.ts +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,29 +5,28 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.2.0] -
|
|
8
|
+
## [0.2.0] - 2026-11-28
|
|
9
9
|
|
|
10
10
|
This release changes behaviour for invalid input: calls that `0.1.0` accepted with `NaN` or
|
|
11
|
-
infinite numbers, empty strings
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
infinite numbers, empty strings (on writes, reads and `backfill`), non-positive or non-integer
|
|
12
|
+
limits, blank or malformed `list` cursors, or `configSet` values that `configure` would refuse
|
|
13
|
+
now throw typed `ConvexError` codes (see **Changed**), and the REST routes answer them with
|
|
14
|
+
`400`; non-scalar REST `props` return `400` instead of failing unhandled. Hosts that passed such
|
|
15
|
+
input must handle these errors before upgrading from `^0.1.0`. Node 20 or later is required.
|
|
16
|
+
The next `convex deploy` also builds the new indexes (see **Changed**) over existing rows, which
|
|
17
|
+
takes longer on large `rollups` and `subjects` tables.
|
|
16
18
|
|
|
17
19
|
### Added
|
|
18
20
|
|
|
19
21
|
- The npm package now ships the user docs (`docs/*.md`), `llms.txt` and `CHANGELOG.md`, so
|
|
20
22
|
`node_modules/@vllnt/convex-analytics/` holds docs that match the installed version.
|
|
21
|
-
`llms.txt` links to them with relative paths.
|
|
22
|
-
packed tarball and fails when a required file is missing, an internal file ships, or a
|
|
23
|
-
relative link does not resolve.
|
|
23
|
+
`llms.txt` links to them with relative paths.
|
|
24
24
|
- Export `./convex.config.js` (same target as `./convex.config`), which the Convex Components
|
|
25
25
|
Directory preflight requires alongside `./_generated/component.js`.
|
|
26
26
|
- Rewritten README for coding agents: when to use, a complete quick start, a table of every
|
|
27
27
|
export of every entry point, common tasks, every error code and message with its fix, limits
|
|
28
28
|
and caps, and compatibility. New `docs/react.md`; every export has a TSDoc summary and a
|
|
29
|
-
reference heading.
|
|
30
|
-
type-checks every README and docs example against the packed package and `convex` 1.45.0.
|
|
29
|
+
reference heading.
|
|
31
30
|
|
|
32
31
|
### Fixed
|
|
33
32
|
|
|
@@ -35,56 +34,107 @@ and **Fixed**) over existing rows, which takes longer on large `rollups` and `su
|
|
|
35
34
|
`INVALID_TIMESTAMP`, `INVALID_SAMPLE_RATE`, `INVALID_PROP_VALUE`, `INVALID_PROP_KEY`,
|
|
36
35
|
`INVALID_COUNT`, `INVALID_CURSOR`, `INVALID_BUCKETS`, `INVALID_CONFIG`): `NaN` or infinite
|
|
37
36
|
`ts`, range bounds, `sampleRate` and number props; empty `scope`, `name`, `subjectRef`,
|
|
38
|
-
`sessionRef`, `dedupeKey`, dimensions and config keys;
|
|
39
|
-
non-
|
|
40
|
-
`
|
|
41
|
-
|
|
37
|
+
`sessionRef`, `dedupeKey`, dimensions and config keys; prop keys Convex cannot store;
|
|
38
|
+
non-scalar REST `props` values; non-positive or non-integer `limit`, `periods` and
|
|
39
|
+
`numItems`; non-finite `distribution` buckets; and empty, blank or malformed `list` cursors.
|
|
40
|
+
A negative `top` limit used to return all but the last rows; a `NaN` or infinite `ts` used to
|
|
41
|
+
create a `NaN` or infinite rollup bucket.
|
|
42
42
|
- `configure` rejects non-positive `retentionDays` and `sessionIdleMs`, which would otherwise
|
|
43
|
-
make `prune` delete every event.
|
|
43
|
+
make `prune` delete every event or `closeSessions` close every session.
|
|
44
44
|
- Inherited keys such as `constructor` are no longer rolled up as dimensions.
|
|
45
|
+
- A dimension or granularity listed twice in `dimensions` / `granularities` (in `track`, the
|
|
46
|
+
client config, `POST /track` or `backfill`) no longer counts one event several times; each
|
|
47
|
+
distinct entry is used once.
|
|
48
|
+
- `configSet` no longer stores a `retentionDays`, `sessionIdleMs` or `sampleRate` value that
|
|
49
|
+
`configure` would reject (for example `retentionDays: "0"`, after which the next `prune`
|
|
50
|
+
deleted every raw event in the scope). The `prune` and `closeSessions` crons also ignore a
|
|
51
|
+
stored value that is not a positive finite number and use the default, so a row written by an
|
|
52
|
+
earlier version cannot wipe data.
|
|
53
|
+
- `metric`, `top`, `timeseries`, `uniques`, `funnel`, `retention`, `distribution`, `list` and
|
|
54
|
+
`backfill` reject empty strings with `EMPTY_STRING`, as the writes do; they used to return
|
|
55
|
+
`0` or empty results, and `backfill` with `dimensions: [""]` dropped every dimension rollup.
|
|
56
|
+
- `list` no longer skips events that share a `ts` at a page edge: the cursor now carries the
|
|
57
|
+
event's `_creationTime` as a tie-break, so paging returns every event exactly once. A
|
|
58
|
+
`cursor: ""` no longer restarts from the newest page.
|
|
45
59
|
- The REST routes return `400 { error, code }` for typed input errors, including nested `props`
|
|
46
|
-
values and non-numeric `from`, `to` or `limit` (
|
|
47
|
-
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
- `metric`, `top` and `timeseries` read only the rollup buckets in the requested range, and
|
|
51
|
-
`uniques` reads only subjects active in range through a new `by_scope_lastSeen` index.
|
|
60
|
+
values and blank or non-numeric `from`, `to` or `limit` (which used to be misread silently),
|
|
61
|
+
and `400 { error }` for non-object bodies and malformed `dimensions` / `granularities` /
|
|
62
|
+
`props`; a malformed stored `apiKeys` value returns `500` with a clear message instead of an
|
|
63
|
+
unhandled exception.
|
|
52
64
|
- Add `.js` extensions to every relative import in `src/` so `@vllnt/convex-analytics/test`
|
|
53
65
|
type-checks under `moduleResolution: nodenext`.
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
- The package build's turbo cache now covers the docs it copies from the repo root, so a build
|
|
57
|
-
can no longer ship stale or missing `README.md`, `LICENSE`, `llms.txt` or `docs/` after a root
|
|
58
|
-
doc change or a cache hit. `pnpm lint` checks this with a turbo dry run.
|
|
66
|
+
- The package build can no longer ship stale or missing `README.md`, `LICENSE`, `llms.txt` or
|
|
67
|
+
`docs/` after a root doc change.
|
|
59
68
|
|
|
60
69
|
### Changed
|
|
61
70
|
|
|
71
|
+
- Calls that now throw for input they accepted before; handle `data.code` or fix the input:
|
|
72
|
+
- `track` with an empty `scope`, `name`, `subjectRef`, `sessionRef`, `dedupeKey` or
|
|
73
|
+
`dimensions` entry (`EMPTY_STRING`), a `NaN` or infinite `ts` (`INVALID_TIMESTAMP`), a
|
|
74
|
+
`sampleRate` outside `0..1` (`INVALID_SAMPLE_RATE`) or a `NaN` or infinite number prop
|
|
75
|
+
(`INVALID_PROP_VALUE`): omit the field or pass a valid value;
|
|
76
|
+
- `configure` with an empty `scope` (`EMPTY_STRING`), a `retentionDays` or `sessionIdleMs`
|
|
77
|
+
that is not a positive finite number (`INVALID_CONFIG`), or a `sampleRate` outside `0..1`
|
|
78
|
+
(`INVALID_SAMPLE_RATE`): pass a valid value or omit it;
|
|
79
|
+
- `configSet` with an empty `scope` or `key` (`EMPTY_STRING`), or an invalid `retentionDays`,
|
|
80
|
+
`sessionIdleMs` or `sampleRate` value (`INVALID_CONFIG`): store what `configure` accepts,
|
|
81
|
+
or call `configure`;
|
|
82
|
+
- reads with an empty `scope`, `name`, `dimension`, `where.dim`, `funnel` step or
|
|
83
|
+
`distribution` `measure`, and `backfill` with an empty `scope`, `name` or `dimensions` entry
|
|
84
|
+
(`EMPTY_STRING`): pass a non-empty value;
|
|
85
|
+
- reads with `NaN` or infinite `range` / `cohortRange` bounds (`INVALID_TIMESTAMP`), a `top`
|
|
86
|
+
`limit`, `retention` `periods` or `list` `numItems` that is not a positive integer
|
|
87
|
+
(`INVALID_COUNT`), or non-finite `distribution` `buckets` (`INVALID_BUCKETS`): pass finite
|
|
88
|
+
values and positive integers;
|
|
89
|
+
- `list` with a `cursor` that is `""`, blank or malformed (`INVALID_CURSOR`): pass `null` for
|
|
90
|
+
the first page, then the previous `continueCursor`. A bare-timestamp cursor from an earlier
|
|
91
|
+
version still works;
|
|
92
|
+
- REST: blank or non-numeric `from`, `to` or `limit`, and a non-null `granularities` that is
|
|
93
|
+
not an array of `minute` / `hour` / `day`, now return `400` (they used to be misread
|
|
94
|
+
silently or, for an unknown granularity, fail with `500`): send valid values.
|
|
95
|
+
- `list` `continueCursor` is now `<ts>:<_creationTime>` (was `<ts>`); treat it as opaque and
|
|
96
|
+
pass it back unchanged.
|
|
97
|
+
- Node: `engines.node` is now `>=20` (was `>=18`), because `convex` 1.45.0, the lowest version
|
|
98
|
+
of the `convex` peer range, requires Node 20 or later.
|
|
99
|
+
- `convex` is now a required peer dependency (range still `^1.45.0`) and no longer also a
|
|
100
|
+
runtime dependency, so a host on an older `convex` 1.x no longer gets a second, nested copy.
|
|
101
|
+
The test suite runs on `convex` 1.51.0, and the README and docs examples are type-checked
|
|
102
|
+
against 1.45.0.
|
|
103
|
+
- Dependencies since `0.1.0`: `@convex-dev/rate-limiter` `^0.3.2` → `^0.4.3` (its component adds a
|
|
104
|
+
`pendingUpdates` table, created on deploy), `@convex-dev/aggregate` `^0.3.0` → `^0.3.4` and
|
|
105
|
+
`@convex-dev/sharded-counter` `^0.2.1` → `^0.2.4`.
|
|
106
|
+
- Reads touch less data: `metric`, `top` and `timeseries` read only the requested series in the
|
|
107
|
+
requested range (`rollups.by_scope_name_dim_val` is replaced by
|
|
108
|
+
`by_scope_name_gran_dim_val_bucket`), and `uniques` reads only subjects active in range
|
|
109
|
+
through a new `subjects.by_scope_lastSeen` index.
|
|
62
110
|
- `track` no longer writes to the `@convex-dev/aggregate` child: no query read it. One fewer
|
|
63
111
|
component call and B-tree write per tracked event. The child stays mounted.
|
|
64
112
|
- Drop the unused `events.by_scope_subject_ts`, `events.by_scope_session_ts` and
|
|
65
113
|
`sessions.by_scope_lastTs` indexes (2 fewer index writes per event, 1 fewer per session write).
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
114
|
+
- Docs: Limits and gotchas now state that write throughput per `(scope, name)` is limited by
|
|
115
|
+
shared rollup rows (parallel bursts can fail with an optimistic concurrency error, and the
|
|
116
|
+
event is not stored), and that Convex's per-function read and time limits can end `funnel`,
|
|
117
|
+
`retention`, `distribution` and `backfill` before their caps. The docs name the crons
|
|
118
|
+
(`analytics:prune-events`, `analytics:close-sessions`), say the rate limit is per
|
|
119
|
+
`(scope, sessionRef)`, list each method's errors, document the `scopes` table (six tables,
|
|
120
|
+
not five) and the `(scope, name)` key of the sharded counter, and add an input-error table,
|
|
121
|
+
PII guidance and a statement that the component never logs event data. Web-preset examples
|
|
122
|
+
spread the readonly `webDimensions` tuple (`dimensions: [...webDimensions]`) so they
|
|
123
|
+
type-check.
|
|
124
|
+
- Package metadata: `homepage` is https://oss.vllnt.com/packages/convex-analytics.
|
|
125
|
+
- Stable versions are published only from a `vX.Y.Z` tag on `main` with npm provenance; canary
|
|
126
|
+
builds publish from `main` under the `canary` dist-tag.
|
|
127
|
+
- Internal: CI, tests, release workflow (SHA-pinned actions) and tooling (pnpm 10, 7-day
|
|
128
|
+
release-age gate, dependency overrides); the changelog now lives in `packages/convex-analytics/`.
|
|
129
|
+
|
|
130
|
+
### Removed
|
|
131
|
+
|
|
132
|
+
- The repository's `llms-full.txt` bundle; use `llms.txt`.
|
|
133
|
+
|
|
134
|
+
### Security
|
|
135
|
+
|
|
136
|
+
- Docs no longer claim the React hooks are scope-gated: access control and `scope` belong to the
|
|
137
|
+
host query each hook is given.
|
|
88
138
|
|
|
89
139
|
## [0.1.0] - 2026-09-01
|
|
90
140
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ TypeScript Convex component for event analytics: track events, roll up counts on
|
|
|
5
5
|
## For coding agents
|
|
6
6
|
|
|
7
7
|
Docs for the installed version are in `node_modules/@vllnt/convex-analytics/`: `docs/`, `llms.txt`, `CHANGELOG.md` and the TypeScript `src/`.
|
|
8
|
-
Every signature is in [docs/client-sdk.md](docs/client-sdk.md); every error is in [Errors and fixes](#errors-and-fixes).
|
|
8
|
+
Every signature is in [docs/client-sdk.md](docs/client-sdk.md), [docs/web-preset.md](docs/web-preset.md) (`./web`) and [docs/react.md](docs/react.md) (`./react`); every error is in [Errors and fixes](#errors-and-fixes).
|
|
9
9
|
|
|
10
10
|
## When to use
|
|
11
11
|
|
|
@@ -363,15 +363,15 @@ them as `400 { "error", "code" }`. Branch on `data.code`.
|
|
|
363
363
|
|
|
364
364
|
| Error | Cause | Fix |
|
|
365
365
|
| --- | --- | --- |
|
|
366
|
-
| `EMPTY_STRING` | `scope`, `name`, `subjectRef`, `sessionRef`, `dedupeKey`, a `dimensions` entry,
|
|
366
|
+
| `EMPTY_STRING` | `scope`, `name`, `subjectRef`, `sessionRef`, `dedupeKey`, a `dimensions` entry, a `configSet` `key`, or a read's `dimension`, `where.dim`, `funnel` step or `distribution` `measure` is `""` (writes, reads and `backfill`) | Omit the optional field instead of passing `""`; pass a non-empty value otherwise |
|
|
367
367
|
| `INVALID_TIMESTAMP` | `ts`, `range.from` or `range.to` is `NaN` or infinite (REST: a blank or non-numeric `from` / `to`) | Pass epoch milliseconds as finite numbers |
|
|
368
368
|
| `INVALID_SAMPLE_RATE` | `sampleRate` is not a number from 0 to 1 | Use a value in `[0, 1]` |
|
|
369
369
|
| `INVALID_PROP_KEY` | A `props` key is not printable ASCII, is over 1024 characters, or starts with `$` (checked by `POST /track`; Convex rejects such keys first on function calls) | Rename the key |
|
|
370
370
|
| `INVALID_PROP_VALUE` | A `props` value is `NaN`, infinite, an object or an array | Send flat scalar values only |
|
|
371
371
|
| `INVALID_COUNT` | `limit`, `periods` or `numItems` is not a positive integer | Pass an integer of 1 or more |
|
|
372
|
-
| `INVALID_CURSOR` | A `list` cursor
|
|
372
|
+
| `INVALID_CURSOR` | A `list` cursor is `""`, blank, or not in the form `list` returns | Pass `null` or the previous `continueCursor` |
|
|
373
373
|
| `INVALID_BUCKETS` | A `distribution` bucket bound is `NaN` or infinite | Pass finite numbers |
|
|
374
|
-
| `INVALID_CONFIG` | `retentionDays` or `sessionIdleMs` passed to `configure` is not a positive finite number | Pass a number above 0 |
|
|
374
|
+
| `INVALID_CONFIG` | `retentionDays` or `sessionIdleMs` passed to `configure` or `configSet` is not a positive finite number, or a `configSet` `sampleRate` is not a number from 0 to 1 | Pass a number above 0 (`sampleRate`: from 0 to 1) |
|
|
375
375
|
| `Funnel requires at least 2 steps` | `funnel` got fewer than 2 steps (a plain `Error`, not a `ConvexError`) | Pass 2 or more event names |
|
|
376
376
|
| `backfill requires at most 50000 retained events; existing rollups were preserved` | `backfill` found more than 50,000 raw events for the name (plain `Error`) | Wait for `prune` to remove old events or lower `retentionDays`, then retry |
|
|
377
377
|
| Convex argument validation error | An argument does not match the function validator, for example a nested `props` value or an unknown granularity | Match the types in [docs/client-sdk.md](docs/client-sdk.md) |
|
|
@@ -395,6 +395,9 @@ them as `400 { "error", "code" }`. Branch on `data.code`.
|
|
|
395
395
|
does not replace one. Questions on props not listed in `dimensions` (unless you `backfill`
|
|
396
396
|
while the raw events are retained), or on raw events older than `retentionDays`, need an
|
|
397
397
|
export of the raw events (for example by paging `list`) to your own store.
|
|
398
|
+
- Write throughput per `(scope, name)` is limited by the shared rollup rows every `track` of that
|
|
399
|
+
name updates. Under a burst of parallel calls, some fail with an optimistic concurrency error
|
|
400
|
+
and the event is not stored: retry failed calls or queue ingest.
|
|
398
401
|
- `track` returns `"dropped"` (no error) when sampled out, or when a `sessionRef` exceeds its
|
|
399
402
|
rate limit: a token bucket per `(scope, sessionRef)` refilling 100 events per minute with
|
|
400
403
|
capacity 10. The limit is fixed. Events without `sessionRef` skip the limiter.
|
|
@@ -428,16 +431,21 @@ them as `400 { "error", "code" }`. Branch on `data.code`.
|
|
|
428
431
|
`range.to` is not counted. Default range: the 30 days before `range.to`.
|
|
429
432
|
- `distribution` reads at most 50,000 events, oldest first, then applies `where`; non-numeric
|
|
430
433
|
measure values are ignored. Default `range.from` is 0.
|
|
431
|
-
- `list` has no page-size cap (`numItems` is read as given)
|
|
432
|
-
at a page boundary can be skipped.
|
|
434
|
+
- `list` has no page-size cap (`numItems` is read as given).
|
|
433
435
|
- `retentionDays` (default 90) and `sessionIdleMs` (default 30 minutes) take effect only after
|
|
434
436
|
`configure`; until then the crons use the defaults. `configure` also stores `sampleRate`,
|
|
435
|
-
but nothing reads it: `track` uses the client's `sampleRate`.
|
|
437
|
+
but nothing reads it: `track` uses the client's `sampleRate`. `configSet` accepts only values
|
|
438
|
+
`configure` accepts for these three keys, and the crons ignore a stored value that is not a
|
|
439
|
+
positive finite number.
|
|
436
440
|
- `dedupeKey` matches only retained raw events: after `prune` deletes the first event, the same
|
|
437
441
|
key tracks again.
|
|
438
|
-
- `prune` runs every 24 hours and `closeSessions`
|
|
442
|
+
- `prune` (cron `analytics:prune-events`) runs every 24 hours and `closeSessions` (cron
|
|
443
|
+
`analytics:close-sessions`) every 30 minutes; each deletes or closes at
|
|
439
444
|
most 500 rows per run and reschedules itself, and they page through scopes 100 at a time.
|
|
440
445
|
- `backfill` reads at most 50,001 events and throws if there are more than 50,000.
|
|
446
|
+
- The `funnel`, `retention`, `distribution` and `backfill` caps are upper bounds: Convex's own
|
|
447
|
+
per-function limits on documents read and execution time can end the call earlier, so narrow
|
|
448
|
+
the range (or, for `backfill`, the retained events) when a call fails.
|
|
441
449
|
- REST routes exist only when the component is mounted with `httpPrefix` (it must start with
|
|
442
450
|
`/`). `GET /metric` ignores `dim` without `val` (and the reverse). `POST /track` ignores a
|
|
443
451
|
`ts`, `subjectRef`, `sessionRef`, `dedupeKey` or `sampleRate` of the wrong type instead of
|
|
@@ -462,7 +470,7 @@ them as `400 { "error", "code" }`. Branch on `data.code`.
|
|
|
462
470
|
- `react`: peer `>=18.0.0`, optional; only `@vllnt/convex-analytics/react` imports React. A
|
|
463
471
|
transitive dependency (`@convex-dev/batch-worker` 0.3.3, via `@convex-dev/aggregate`) declares
|
|
464
472
|
`react` as a required peer, so package managers may install it in a backend-only app.
|
|
465
|
-
- Node: `engines` is `>=
|
|
473
|
+
- Node: `engines` is `>=20`, because `convex` 1.45.0 (the lowest supported peer) requires it.
|
|
466
474
|
- ESM only; there is no CommonJS build.
|
|
467
475
|
- The component's functions run in Convex's default runtime. `./web` helpers are plain
|
|
468
476
|
host-side functions with no dependencies. `./react` hooks need a `ConvexProvider`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal_mutations.d.ts","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAcA,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAI1D;
|
|
1
|
+
{"version":3,"file":"internal_mutations.d.ts","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAcA,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAI1D;AAwBD,oHAAoH;AACpH,eAAO,MAAM,KAAK;;;;;GA6ChB,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,aAAa;;;;;GAmDxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;GAyEnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { internal } from "./_generated/api.js";
|
|
2
2
|
import { internalMutation } from "./_generated/server.js";
|
|
3
3
|
import { v } from "convex/values";
|
|
4
|
-
import { granularitiesValidator } from "./validators.js";
|
|
4
|
+
import { assertNonEmpty, granularitiesValidator } from "./validators.js";
|
|
5
5
|
import { bucketStart, valKey } from "../shared.js";
|
|
6
6
|
const MAINTENANCE_CAP = 500;
|
|
7
7
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -13,7 +13,11 @@ export function guardBackfillSize(eventCount) {
|
|
|
13
13
|
throw new Error("backfill requires at most 50000 retained events; existing rollups were preserved");
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Read a positive numeric config value for a scope, falling back to the default. A stored value
|
|
18
|
+
* that is not a finite positive number (for example `"0"` written before `configSet` checked it)
|
|
19
|
+
* is ignored, so it can never move the prune cutoff to now or later.
|
|
20
|
+
*/
|
|
17
21
|
async function readNumber(ctx, scope, key, fallback) {
|
|
18
22
|
const entry = await ctx.db
|
|
19
23
|
.query("config")
|
|
@@ -22,7 +26,7 @@ async function readNumber(ctx, scope, key, fallback) {
|
|
|
22
26
|
if (!entry)
|
|
23
27
|
return fallback;
|
|
24
28
|
const n = Number(entry.value);
|
|
25
|
-
return Number.isFinite(n) ? n : fallback;
|
|
29
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
26
30
|
}
|
|
27
31
|
const SCOPE_BATCH = 100;
|
|
28
32
|
/** Delete raw events past `retentionDays` for a scope. Never deletes rollups (only `backfill` does). Idempotent. */
|
|
@@ -108,7 +112,13 @@ export const backfill = internalMutation({
|
|
|
108
112
|
},
|
|
109
113
|
returns: v.object({ events: v.number(), rows: v.number() }),
|
|
110
114
|
handler: async (ctx, args) => {
|
|
111
|
-
|
|
115
|
+
assertNonEmpty("scope", args.scope);
|
|
116
|
+
assertNonEmpty("name", args.name);
|
|
117
|
+
for (const dim of args.dimensions)
|
|
118
|
+
assertNonEmpty("dimensions[]", dim);
|
|
119
|
+
// Each distinct dimension / granularity counts once, however often it is listed.
|
|
120
|
+
const dimensions = [...new Set(args.dimensions)];
|
|
121
|
+
const grans = args.granularities.length > 0 ? [...new Set(args.granularities)] : ["day"];
|
|
112
122
|
const events = await ctx.db
|
|
113
123
|
.query("events")
|
|
114
124
|
.withIndex("by_scope_name_ts", (q) => q.eq("scope", args.scope).eq("name", args.name))
|
|
@@ -131,7 +141,7 @@ export const backfill = internalMutation({
|
|
|
131
141
|
for (const gran of grans) {
|
|
132
142
|
const bucket = bucketStart(e.ts, gran);
|
|
133
143
|
bump(gran, bucket, TOTAL, TOTAL);
|
|
134
|
-
for (const dim of
|
|
144
|
+
for (const dim of dimensions) {
|
|
135
145
|
if (Object.hasOwn(e.props, dim)) {
|
|
136
146
|
bump(gran, bucket, dim, valKey(e.props[dim]));
|
|
137
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal_mutations.js","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal_mutations.js","sourceRoot":"","sources":["../../src/component/internal_mutations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C,CAAC;gBACjC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;oBAC7B,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;wBAChC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC;oBACjD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE;YAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC;YACvB,OAAO,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;gBAC9B,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAgFA,eAAO,MAAM,KAAK;;;;;;;;;;;gDAsJhB,CAAC;AAoBH,eAAO,MAAM,SAAS;;;;iBAWpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;iBA6BpB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { components } from "./_generated/api.js";
|
|
|
3
3
|
import { v } from "convex/values";
|
|
4
4
|
import { ShardedCounter } from "@convex-dev/sharded-counter";
|
|
5
5
|
import { RateLimiter, MINUTE } from "@convex-dev/rate-limiter";
|
|
6
|
-
import { propsValidator, granularitiesValidator, assertProps, assertFiniteTs, assertNonEmpty, assertSampleRate,
|
|
6
|
+
import { propsValidator, granularitiesValidator, assertProps, assertFiniteTs, assertNonEmpty, assertSampleRate, assertPositiveConfig, assertConfigValue, } from "./validators.js";
|
|
7
7
|
import { bucketStart, tupleKey, valKey } from "../shared.js";
|
|
8
8
|
const counter = new ShardedCounter(components.shardedCounter, {
|
|
9
9
|
defaultShards: 16,
|
|
@@ -82,7 +82,9 @@ export const track = mutation({
|
|
|
82
82
|
const now = Date.now();
|
|
83
83
|
const scope = args.scope;
|
|
84
84
|
const ts = args.ts ?? now;
|
|
85
|
-
|
|
85
|
+
// Each distinct dimension / granularity counts once, however often it is listed.
|
|
86
|
+
const dimensions = [...new Set(args.dimensions)];
|
|
87
|
+
const grans = args.granularities.length > 0 ? [...new Set(args.granularities)] : ["day"];
|
|
86
88
|
if (args.sessionRef !== undefined) {
|
|
87
89
|
const rl = await rateLimiter.limit(ctx, "trackEvent", {
|
|
88
90
|
key: tupleKey(scope, args.sessionRef),
|
|
@@ -168,7 +170,7 @@ export const track = mutation({
|
|
|
168
170
|
for (const granularity of grans) {
|
|
169
171
|
const bucket = bucketStart(ts, granularity);
|
|
170
172
|
await bumpRollup(ctx, scope, args.name, granularity, bucket, TOTAL, TOTAL);
|
|
171
|
-
for (const dim of
|
|
173
|
+
for (const dim of dimensions) {
|
|
172
174
|
if (Object.hasOwn(props, dim)) {
|
|
173
175
|
await bumpRollup(ctx, scope, args.name, granularity, bucket, dim, valKey(props[dim]));
|
|
174
176
|
}
|
|
@@ -197,6 +199,7 @@ export const configSet = mutation({
|
|
|
197
199
|
handler: async (ctx, args) => {
|
|
198
200
|
assertNonEmpty("scope", args.scope);
|
|
199
201
|
assertNonEmpty("key", args.key);
|
|
202
|
+
assertConfigValue(args.key, args.value);
|
|
200
203
|
await ensureScope(ctx, args.scope);
|
|
201
204
|
await upsertConfig(ctx, args.scope, args.key, args.value);
|
|
202
205
|
return null;
|
|
@@ -213,14 +216,8 @@ export const configure = mutation({
|
|
|
213
216
|
handler: async (ctx, args) => {
|
|
214
217
|
assertNonEmpty("scope", args.scope);
|
|
215
218
|
assertSampleRate(args.sampleRate);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
["sessionIdleMs", args.sessionIdleMs],
|
|
219
|
-
]) {
|
|
220
|
-
if (value !== undefined && !(Number.isFinite(value) && value > 0)) {
|
|
221
|
-
throw invalidInput("INVALID_CONFIG", `${field} must be a positive finite number`);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
219
|
+
assertPositiveConfig("retentionDays", args.retentionDays);
|
|
220
|
+
assertPositiveConfig("sessionIdleMs", args.sessionIdleMs);
|
|
224
221
|
await ensureScope(ctx, args.scope);
|
|
225
222
|
const entries = [];
|
|
226
223
|
if (args.retentionDays !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"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AAE,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/component/queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/component/queries.ts"],"names":[],"mappings":"AAmFA,kFAAkF;AAClF,eAAO,MAAM,MAAM;;;;;;;;;;;mBAuBjB,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,GAAG;;;;;;;;;;;;KA6Bd,CAAC;AAEH,gFAAgF;AAChF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;KAqBrB,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;GAiDlB,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,MAAM;;;;;;;;UAqCc,MAAM;WAAS,MAAM;UAAQ,MAAM;KA6BlE,CAAC;AAEH,gDAAgD;AAChD,eAAO,MAAM,SAAS;;;;;;;;;;;;KAqDpB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;GAwDvB,CAAC;AAkBH,4DAA4D;AAC5D,eAAO,MAAM,IAAI;;;;;;;;;aAqDK,MAAM;;;;;;;;;;;;;GAe1B,CAAC;AAEH,8CAA8C;AAC9C,eAAO,MAAM,SAAS;;;0BAYpB,CAAC"}
|