@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 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
- ## [Unreleased]
7
+ ## [0.2.0] - 2026-11-28
8
8
 
9
9
  ### Added
10
10
 
11
- - The npm package now ships `docs/*.md`, `CHANGELOG.md` and `llms.txt`, so
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 bundled files
14
- with `./` paths. A test fails when a required file is missing from the
15
- tarball.
13
+ `node_modules/@vllnt/convex-suppression/`. `llms.txt` links to them with `./`
14
+ paths.
16
15
 
17
16
  ### Changed
18
17
 
19
- - Every push to `main` that touches the package or its shipped docs publishes a
20
- `@canary` build; the opt-in repository-variable gate is removed.
21
-
22
- - Removed the `by_hash` index; it was unused and a prefix of `by_hash_channel`.
23
- One less index entry written per suppression and less index storage.
24
-
25
- ## [0.1.1] - Unreleased
26
-
27
- ### Fixed
28
-
29
- - `suppress` and `recordOptIn` now throw
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`. `isEligible` previously answered `true` for
32
- an empty `contactHash` or `channel`; it now answers `false`, so the send gate
33
- fails closed. Documented that keys are matched exactly (no case, whitespace or
34
- plus-address normalization; the host normalizes).
35
- - The `./test` entry now type-checks for consumers using
36
- `moduleResolution: nodenext` (relative imports use `.js`; Vite client types
37
- are referenced). The README documents the `convex-test` and `vitest`
38
- requirement.
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
- ### Changed
67
+ ### Fixed
41
68
 
42
- - Release automation: pinned actions, least-privilege permissions, npm trusted
43
- publishing with provenance; `@latest` is published only from a `vX.Y.Z` tag on
44
- `main`.
45
- - Dev tooling: pnpm 10 with a release-age gate, low-memory test/lint defaults,
46
- `deepmerge-ts` override for a dev-only advisory.
47
- - The README install command now installs the stable release.
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