@vllnt/convex-consent 0.1.0 → 0.1.1-canary.012a88f
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 +120 -0
- package/README.md +422 -83
- package/dist/client/index.d.ts +26 -11
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +26 -11
- package/dist/client/index.js.map +1 -1
- package/dist/client/types.d.ts +4 -3
- package/dist/client/types.d.ts.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/crons.js +1 -1
- package/dist/component/crons.js.map +1 -1
- package/dist/component/mutations.d.ts +16 -10
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +37 -14
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts +6 -4
- package/dist/component/queries.d.ts.map +1 -1
- package/dist/component/queries.js +9 -7
- package/dist/component/queries.js.map +1 -1
- package/dist/component/schema.d.ts +1 -2
- package/dist/component/schema.js +3 -4
- package/dist/component/schema.js.map +1 -1
- package/dist/component/validators.d.ts +3 -2
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +3 -2
- package/dist/component/validators.js.map +1 -1
- package/dist/shared.d.ts +5 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +5 -3
- package/dist/shared.js.map +1 -1
- package/docs/API.md +309 -0
- package/llms.txt +67 -0
- package/package.json +46 -22
- package/src/client/index.ts +26 -11
- package/src/client/types.ts +4 -3
- package/src/component/convex.config.ts +1 -0
- package/src/component/crons.ts +1 -1
- package/src/component/mutations.ts +38 -14
- package/src/component/queries.ts +9 -7
- package/src/component/schema.ts +3 -4
- package/src/component/validators.ts +3 -2
- package/src/shared.ts +5 -3
- package/src/test.ts +17 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.1.1] - 2026-11-28
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Ship `docs/API.md`, `CHANGELOG.md` and `llms.txt` in the npm tarball, so coding agents read
|
|
12
|
+
docs that match the installed version from `node_modules/@vllnt/convex-consent/`. `llms.txt`
|
|
13
|
+
links shipped files by relative path and gains a "For coding agents" note and an ecosystem
|
|
14
|
+
link; the README gains the same note.
|
|
15
|
+
- `docs/API.md` documents the package entry points (`./test`, `./convex.config`,
|
|
16
|
+
`./_generated/component`) and the client options.
|
|
17
|
+
- `pnpm test:package`, which `pnpm build` now runs (so CI and the publish workflow run it), fails
|
|
18
|
+
when a required file is missing from the tarball, when Markdown outside the shipped docs set (such
|
|
19
|
+
as a contributor or internal doc) is packed, or when an `llms.txt` link does not resolve inside the
|
|
20
|
+
tarball.
|
|
21
|
+
- `pnpm test:package` imports every `package.json` `exports` entry point from the installed
|
|
22
|
+
tarball: it type-checks `.`, `./test`, `./convex.config`, `./convex.config.js`,
|
|
23
|
+
`./_generated/component` and `./_generated/component.js` (Bundler and NodeNext), imports
|
|
24
|
+
`.`, both `convex.config` entries and `./package.json` in Node, and fails when an exports key has
|
|
25
|
+
no coverage.
|
|
26
|
+
- `pnpm check:docs` (run by `pnpm lint`) enforces the docs contract in
|
|
27
|
+
`scripts/check-documentation.mjs`: README sections and order, install and first example in the
|
|
28
|
+
first 40 lines, tagged code blocks, resolving relative links and anchors, every public export
|
|
29
|
+
(with a TSDoc summary) and every thrown error code documented in the README and `docs/API.md`,
|
|
30
|
+
and the shared Links block, footer and `llms.txt` Ecosystem block. `pnpm test:package` runs the
|
|
31
|
+
same contract on the installed tarball, type-checks every README example against the built
|
|
32
|
+
package (convex 1.45.0, `Bundler` and `NodeNext` resolution) and runs the README test example.
|
|
33
|
+
- TSDoc summary on the `convex.config` default export and an `@see` link to the package page on
|
|
34
|
+
`Consent`. Comment-only; no runtime or type change.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- The README is rewritten for coding agents: when to use it (and what to use instead), install,
|
|
39
|
+
a quick start with a host mutation and query, an API table of every export, common tasks,
|
|
40
|
+
every error code with its cause and fix, limits and gotchas, compatibility, testing, and links.
|
|
41
|
+
`docs/API.md` gains one heading per export, the data model, every message per error code and
|
|
42
|
+
the built-in cron. `llms.txt` gains a "When to use" section, links to both error tables and the
|
|
43
|
+
shared ecosystem links. "Related packages" now says there are none; the former entries move to
|
|
44
|
+
"When to use".
|
|
45
|
+
- One description, used in `package.json`, the README and `llms.txt`: "TypeScript Convex
|
|
46
|
+
component for GDPR consent: append-only ledger of granted, denied and withdrawn decisions per
|
|
47
|
+
subject and purpose, with a version check." Keywords now cover the problem and the stack.
|
|
48
|
+
- Drop the `consentState.by_subject` index: it was a prefix of `by_subject_purpose`, which now serves
|
|
49
|
+
`getStatesForSubject` (results ordered by `purpose`). Saves one index entry per state row.
|
|
50
|
+
- `homepage` points at the package page on oss.vllnt.com.
|
|
51
|
+
- Canary publishes on every push to `main` that touches the package or its shipped docs; the
|
|
52
|
+
repository-variable gate is removed. It publishes under the `canary` dist-tag only and never moves
|
|
53
|
+
`latest`.
|
|
54
|
+
- Upgrade dev tooling to convex 1.51, convex-test 0.0.73, vitest and `@vitest/coverage-v8` 5.1.1,
|
|
55
|
+
vite 8.3, prettier 3.10 and `@vllnt/typescript` 3 (with `exactOptionalPropertyTypes` kept off),
|
|
56
|
+
and override the vulnerable transitive `handlebars`, `deepmerge-ts` and `minimatch` releases.
|
|
57
|
+
The built `dist` and the `convex@^1.45.0` peer range are unchanged.
|
|
58
|
+
- Adopt pnpm 10 with a release-age gate; releases are published only from CI with npm
|
|
59
|
+
trusted publishing and provenance.
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- `record` rejects an empty `subjectRef`, `purpose` or `version`, and `withdraw` an empty
|
|
64
|
+
`subjectRef` or `purpose`, with `ConvexError({ code: "INVALID_ARGUMENT" })`.
|
|
65
|
+
- `@vllnt/convex-consent/test` now type-checks under `moduleResolution: nodenext`
|
|
66
|
+
(explicit `.js` relative imports, Vite client types referenced).
|
|
67
|
+
- Documentation drift: the shipped `prune` comments now say events are not checked for being
|
|
68
|
+
superseded and that `before` defaults to now minus 365 days; the `proofValidator` comments no
|
|
69
|
+
longer claim `convex/values` validators have a `.parse`; `docs/API.md` states which `ctx` each
|
|
70
|
+
method needs.
|
|
71
|
+
- `register` from `@vllnt/convex-consent/test` accepts the host app's own
|
|
72
|
+
`convexTest(hostSchema, modules)` instance: it was typed against the component schema, so a host
|
|
73
|
+
schema with its own tables failed with TS2345. Type-only; tests and the example are now
|
|
74
|
+
type-checked in CI (`pnpm typecheck:ci` runs `pnpm typecheck:tests`).
|
|
75
|
+
- The package contents check now denies packed `*.spec.mts` and `*.spec.cts` files, like
|
|
76
|
+
`*.test.mts` and `*.test.cts`; its self-test runs in `pnpm test:package` (so in `pnpm build`).
|
|
77
|
+
|
|
78
|
+
## [0.1.0] - 2026-09-01
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- First release of `@vllnt/convex-consent` — an append-only consent ledger
|
|
83
|
+
(GDPR Art. 6/7) per `(subjectRef, purpose)`.
|
|
84
|
+
- `record(subjectRef, purpose, decision, { version?, proof? })` appends an
|
|
85
|
+
immutable `consentEvents` row (the legal proof) and updates the O(1)
|
|
86
|
+
`consentState` projection; `decision` is `granted`/`denied`/`withdrawn`.
|
|
87
|
+
- `withdraw(subjectRef, purpose, proof?)` (GDPR Art. 7(3)) revokes a grant by
|
|
88
|
+
appending a `withdrawn` event — only when a grant is currently held, else throws
|
|
89
|
+
`ConvexError({ code: "NO_CONSENT" })` or `ConvexError({ code: "NOT_GRANTED" })`.
|
|
90
|
+
- `check(subjectRef, purpose, requiredVersion?)` is the runtime gate, returning
|
|
91
|
+
`{ granted, stale, decision, version, at }`; a grant for an older policy version
|
|
92
|
+
returns `stale: true` so the host re-prompts.
|
|
93
|
+
- `getState`, `getStatesForSubject`, and paginated `history` read the record;
|
|
94
|
+
`history` pages the immutable ledger newest-first for an audit or data subject
|
|
95
|
+
request.
|
|
96
|
+
- Append-only ledger: a recorded decision is never mutated — withdrawal is a new
|
|
97
|
+
event, not an edit — so the proof trail can't be silently rewritten.
|
|
98
|
+
- Server-sourced time: every event's `at` is stamped from `Date.now()` inside the
|
|
99
|
+
handler — no caller-supplied clock.
|
|
100
|
+
- Typed generics: `Consent<TProof>` with an optional `proofValidator` host parser
|
|
101
|
+
narrowing the opaque stored `proof` at the client boundary on write and read — no
|
|
102
|
+
`v.any()` dump, no unchecked cast — plus a configurable `defaultVersion`.
|
|
103
|
+
- Bounded, self-rescheduling `prune` (`take(batch)` + scheduler) that removes only
|
|
104
|
+
superseded ledger events past the cutoff, plus a built-in daily prune cron
|
|
105
|
+
(`crons.ts`); idempotent. The current-state projection is never pruned. Default
|
|
106
|
+
retention 365 days.
|
|
107
|
+
- Mount-safe: correct under multiple `app.use(component, { name })` mounts — each
|
|
108
|
+
instance is sandboxed, the cron is registered per instance.
|
|
109
|
+
|
|
110
|
+
### Fixed
|
|
111
|
+
|
|
112
|
+
- Apply the documented 365-day default ledger retention and reject invalid prune batches to
|
|
113
|
+
prevent premature proof deletion and scheduler loops.
|
|
114
|
+
|
|
115
|
+
### Changed
|
|
116
|
+
|
|
117
|
+
- Treat Convex `_generated` output as CLI-owned, exclude it from formatting, and expose a
|
|
118
|
+
dedicated codegen script.
|
|
119
|
+
- Refresh all direct dependencies to their latest compatible releases.
|
|
120
|
+
- Require `convex@^1.45.0` and update `convex-test` to `^0.0.56`.
|