@vllnt/convex-suppression 0.1.1-canary.dc30a0f → 0.2.0-canary.ebc935d
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 +63 -31
- package/README.md +421 -162
- package/dist/client/index.d.ts +36 -10
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +37 -11
- package/dist/client/index.js.map +1 -1
- package/dist/component/convex.config.d.ts +1 -0
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/convex.config.js +1 -0
- package/dist/component/convex.config.js.map +1 -1
- package/dist/component/mutations.d.ts +18 -4
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +25 -10
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/validators.d.ts +14 -5
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +29 -7
- package/dist/component/validators.js.map +1 -1
- package/dist/shared.d.ts +1 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +1 -0
- package/dist/shared.js.map +1 -1
- package/docs/API.md +255 -108
- package/llms.txt +71 -14
- package/package.json +22 -19
- package/src/client/index.ts +37 -11
- package/src/component/convex.config.ts +1 -0
- package/src/component/mutations.ts +25 -10
- package/src/component/validators.ts +35 -7
- package/src/shared.ts +1 -0
- package/src/test.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,47 +4,79 @@ All notable changes to this project are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
|
|
5
5
|
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
## [
|
|
7
|
+
## [0.2.0] - 2026-11-28
|
|
8
8
|
|
|
9
9
|
### Added
|
|
10
10
|
|
|
11
|
-
- The npm package now ships `docs
|
|
11
|
+
- The npm package now ships `docs/API.md`, `CHANGELOG.md` and `llms.txt`, so
|
|
12
12
|
coding agents can read docs that match the installed version from
|
|
13
|
-
`node_modules/@vllnt/convex-suppression/`. `llms.txt` links to
|
|
14
|
-
|
|
15
|
-
tarball.
|
|
13
|
+
`node_modules/@vllnt/convex-suppression/`. `llms.txt` links to them with `./`
|
|
14
|
+
paths.
|
|
16
15
|
|
|
17
16
|
### Changed
|
|
18
17
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
- **Breaking:** `suppress` and `recordOptIn` now throw
|
|
19
|
+
`ConvexError({ code: "INVALID_ARGUMENT", field })` for a key over 256 UTF-8
|
|
20
|
+
bytes (`contactHash` or `channel` in `suppress`; `contactHash`, `listKey` or
|
|
21
|
+
`source` in `recordOptIn`), and for an opt-in `proof` over 16384 UTF-8 bytes
|
|
22
|
+
of its JSON form (`field: "proof"`). Sizes count UTF-8 bytes, not characters:
|
|
23
|
+
`"é"` is 2 bytes. Hash and normalize each contact to a short fixed-length key
|
|
24
|
+
such as a hex SHA-256 (64 bytes). Keep `source` a short tag such as
|
|
25
|
+
`"double-opt-in"` and move long text such as a URL into `proof`. Keep `proof`
|
|
26
|
+
small: store large evidence in the host and pass a reference. Rows stored
|
|
27
|
+
earlier with a longer key, or with a `proof` over 16384 bytes, stay readable
|
|
28
|
+
through `isSuppressed`, `isEligible` and `getOptInProof`. `suppress` or
|
|
29
|
+
`recordOptIn` on such a key now throws and leaves the row unchanged;
|
|
30
|
+
`unsuppress` is not size-checked and still removes it. Recording that large
|
|
31
|
+
`proof` again throws; recording a smaller one replaces it.
|
|
32
|
+
- **Breaking:** `suppress` and `recordOptIn` now throw
|
|
30
33
|
`ConvexError({ code: "INVALID_ARGUMENT", field })` for an empty `contactHash`,
|
|
31
|
-
`channel`, `listKey` or `source
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
`channel`, `listKey` or `source`; 0.1.0 stored it. Check for empty values
|
|
35
|
+
before calling, and omit `channel` or `listKey` for the global entry instead
|
|
36
|
+
of passing `""`. Rows that 0.1.0 stored with an empty key are kept:
|
|
37
|
+
`isSuppressed` and `getOptInProof` still return them, and `unsuppress` removes
|
|
38
|
+
them.
|
|
39
|
+
- `isEligible` now returns `false` for an empty `contactHash` or `channel`
|
|
40
|
+
(0.1.0 could return `true`), so the send gate fails closed. Pass the real hash
|
|
41
|
+
and the channel you send on.
|
|
42
|
+
- **Breaking:** A `proofValidator` error from `recordOptIn` now rejects the
|
|
43
|
+
returned promise instead of throwing synchronously, as `getOptInProof` already
|
|
44
|
+
did; nothing is written. `await` in a try/catch and `.catch()` on the promise
|
|
45
|
+
both catch it. If you called `recordOptIn` inside a try/catch without `await`,
|
|
46
|
+
add `await` or a `.catch()`.
|
|
47
|
+
- `engines.node` is now `>=20` (was `>=18`), because the lowest supported peer,
|
|
48
|
+
`convex@1.45.0`, needs Node.js 20. Run Node.js 20 or later (22 or later with
|
|
49
|
+
convex 1.49 and newer). The peer `convex` range is unchanged (`^1.45.0`).
|
|
50
|
+
- Every push to `main` now publishes a `@canary` build of that commit; `@latest`
|
|
51
|
+
is published only from a `vX.Y.Z` tag on `main`, with npm provenance.
|
|
52
|
+
- README, `docs/API.md` and `llms.txt` rewritten and checked against the code,
|
|
53
|
+
including behavior that was not documented before: keys match exactly (no
|
|
54
|
+
case, whitespace or plus-address folding), `"*"` as a `channel` or `listKey`
|
|
55
|
+
targets the global entry, `reason: "global"` does not make an entry global,
|
|
56
|
+
and recording an opt-in again without `proof` removes the stored proof. TSDoc
|
|
57
|
+
on every public export. New package description, keywords and homepage
|
|
58
|
+
(`https://oss.vllnt.com/packages/convex-suppression`).
|
|
59
|
+
- Internal: CI, release, test and docs-check tooling; no runtime effect.
|
|
60
|
+
|
|
61
|
+
### Removed
|
|
62
|
+
|
|
63
|
+
- The unused `by_hash` index on `suppressions`, a prefix of `by_hash_channel`:
|
|
64
|
+
one less index entry written per suppression. No migration is needed; the next
|
|
65
|
+
deploy drops the index.
|
|
39
66
|
|
|
40
|
-
###
|
|
67
|
+
### Fixed
|
|
41
68
|
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
`
|
|
45
|
-
-
|
|
46
|
-
`
|
|
47
|
-
|
|
69
|
+
- The `./test` entry now type-checks under `moduleResolution: nodenext`
|
|
70
|
+
(relative imports use `.js`; Vite client types are referenced). The README
|
|
71
|
+
lists what it needs: `convex-test`, `vitest`, `vite` and `@edge-runtime/vm`.
|
|
72
|
+
- `register(t)` from `./test` now accepts the host app's
|
|
73
|
+
`convexTest(hostSchema)`; it was typed against the component's own schema, so
|
|
74
|
+
any host schema with its own tables failed with TS2345. Types only; no runtime
|
|
75
|
+
change.
|
|
76
|
+
- The `proofValidator` example in the `Suppression` JSDoc passed
|
|
77
|
+
`v.object(...).parse`, which Convex validators do not have; it now shows a
|
|
78
|
+
host parser `(unknown) => TProof`, and the `Parser` TSDoc no longer recommends
|
|
79
|
+
a `convex/values` `.parse`.
|
|
48
80
|
|
|
49
81
|
## [0.1.0] - 2026-09-01
|
|
50
82
|
|