@vllnt/convex-api-keys 0.3.1-canary.080ce0b → 0.4.0-canary.1b4321c

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.4.0] - 2026-11-27
6
+
5
7
  ### Added
6
8
 
7
9
  - The npm package now ships `docs/API.md`, `CHANGELOG.md` and `llms.txt`, so
@@ -10,12 +12,73 @@
10
12
  relative path. `pnpm test:package` (run by `pnpm test` and
11
13
  `pnpm test:coverage`) fails when one of them is missing from the tarball.
12
14
  - `docs/API.md` documents the package entry points and exported types.
15
+ - Every public export and `ApiKeys` method has a TSDoc summary, shipped in the
16
+ `.d.ts` files; `ApiKeys` links its package page with `@see`.
17
+ - `pnpm test:package` runs `scripts/check-docs.mjs`. It fails when a README
18
+ section is missing or out of order, a code block has no language, a relative
19
+ link or anchor breaks, an export or error message is undocumented, a README
20
+ or `docs/API.md` TypeScript example does not type-check against the built
21
+ package, or the vllnt footer, `llms.txt` ecosystem block or package metadata
22
+ drift.
13
23
 
14
24
  ### Changed
15
25
 
26
+ - **Behaviour change: `revoke()` keeps a final status final.** On a key whose
27
+ stored status is `expired` or `exhausted` it now does nothing, as it already
28
+ did for a `revoked` key: the status and `revokedAt` stay as they are and no
29
+ `key.revoked` log entry is written. Before, it changed the status to `revoked`
30
+ and set `revokedAt`. It still returns without error. If your app read
31
+ `status === "revoked"` or `revokedAt` to mean "revoke was called", also treat
32
+ `expired` and `exhausted` as final.
16
33
  - Canary releases publish on every push to `main` that touches the package or
17
34
  its shipped docs; a repository variable no longer gates them.
18
35
  - `homepage` points to https://oss.vllnt.com/packages/convex-api-keys.
36
+ - Update `@convex-dev/sharded-counter` to `^0.2.4`.
37
+ - The README is organised for coding agents: When to use, Install, Quick
38
+ start, an API table of every export, Common tasks, an Errors and fixes table
39
+ of every message and `validate` reason, Limits and gotchas, and
40
+ Compatibility. `llms.txt` carries the same summary and links.
41
+ - `package.json` `description` and `keywords` describe what the package does.
42
+ - The README intro is the `package.json` `description`, the same sentence as
43
+ the `llms.txt` summary.
44
+ - The README has a Links section (docs, release feed, package search, source,
45
+ issues and npm, community, author, sponsor) that replaces the Author section.
46
+ - README Related packages lists only packages this one uses in code; it is now
47
+ "None.".
48
+ - The `llms.txt` Ecosystem block links the release feed and package search.
49
+ - `scripts/check-docs.mjs` also fails when the `package.json` description is
50
+ not one sentence naming Convex, or is not both the first line after the
51
+ README title and the first line after the `llms.txt` title (as `> `); when
52
+ the README Links section differs from the standard list, is not directly
53
+ before License, or License is not the last section; when Related packages
54
+ does not list exactly the `@vllnt` packages in `dependencies`,
55
+ `peerDependencies` or imports in `src/` and `example/` (one "None." line when
56
+ there are none); when `llms.txt` does not end with the Ecosystem block; and
57
+ when a `docs/API.md` TypeScript example does not type-check. CHANGELOG and
58
+ TSDoc examples are not type-checked.
59
+ - `pnpm test:package` runs `scripts/test-consumer.mjs`. It packs the tarball
60
+ and installs it with pnpm in a clean project outside the repo. Node imports
61
+ and runs only `.` and reads `./package.json`. It resolves `./convex.config`
62
+ and `./convex.config.js` without running them, because they only run inside
63
+ the Convex CLI. The other entry points are type-checked: a `strict` consumer
64
+ imports every entry point and calls `ApiKeys` from a mutation, a query, an
65
+ action and an HTTP action. The test fails when an `exports` subpath is not
66
+ covered, and runs in CI's Test job and before every publish.
67
+ - `pnpm typecheck:ci` type-checks `src/component/`, every test file and
68
+ `example/convex/`; before, a type error in a test or the example passed CI.
69
+
70
+ ### Fixed
71
+
72
+ - `scripts/check-package-contents.sh` also blocks `.spec.mts` and `.spec.cts`
73
+ files, and CI runs its test harness.
74
+ - `package.json` `repository.url` uses the form npm expects, so publishing no
75
+ longer prints an auto-correction warning. `pnpm test:package` fails when
76
+ `npm pkg fix` would rewrite any field.
77
+ - `RunMutationCtx` and `RunQueryCtx` accept action and HTTP action contexts.
78
+ They were `Pick`s of the mutation and query context types, which an action
79
+ `ctx` does not satisfy, so calling `ApiKeys` methods from an action or HTTP
80
+ action failed to type-check. They are now interfaces with only the
81
+ `runMutation` / `runQuery` call, for public and internal function references.
19
82
 
20
83
  ## [0.3.0] - 2026-11-26
21
84
 
@@ -82,7 +145,8 @@
82
145
  from return type.
83
146
  - **`validate()`**: `retryAfter` removed from failure response (no internal rate
84
147
  limiting).
85
- - **`list()` / `listByTag()`**: Now paginated with `limit` param (default 100).
148
+ - **`list()` / `listByTag()`**: Now return at most `limit` keys (default 100).
149
+ There is no cursor.
86
150
 
87
151
  ### Migration Guide
88
152
 
@@ -131,7 +195,9 @@ shardedCounterTest.register(t, "apiKeys/shardedCounter");
131
195
  - Public client wrapper now forwards optional `limit` to `list()` and
132
196
  `listByTag()`
133
197
  - `ValidationFailure` no longer advertises the removed `retryAfter` field
134
- - Auth boundary: `ownerId` cross-check on all admin mutations
198
+ - Auth boundary: `ownerId` cross-check on every key-level admin call
199
+ (`revoke`, `rotate`, `update`, `disable`, `enable`, `getUsage`); `configure`
200
+ takes no `ownerId`
135
201
  - Server-side secret generation for `create()` and `rotate()`
136
202
  - Input validation: keyPrefix charset, env charset, gracePeriodMs bounds
137
203
  (60s–30d), metadata size (4KB), scopes (50), tags (20)
@@ -140,7 +206,7 @@ shardedCounterTest.register(t, "apiKeys/shardedCounter");
140
206
  - lastUsedAt throttled to 60s (reduces OCC contention)
141
207
  - Remaining decrement decoupled from lastUsedAt write (single merged patch)
142
208
  - revokeByTag expanded to include `rotating` and `disabled` statuses
143
- - Paginated list/listByTag with configurable limit
209
+ - `list`/`listByTag` return at most `limit` keys (default 100), with no cursor
144
210
 
145
211
  ## 0.1.1
146
212