@vllnt/convex-suppression 0.1.0 → 0.1.1-canary.14d41a6
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 +116 -0
- package/README.md +433 -81
- package/dist/client/index.d.ts +18 -9
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +18 -9
- 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/mutations.d.ts +4 -2
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +15 -5
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts +2 -1
- package/dist/component/queries.d.ts.map +1 -1
- package/dist/component/queries.js +11 -4
- package/dist/component/queries.js.map +1 -1
- package/dist/component/schema.d.ts +1 -2
- package/dist/component/schema.js +2 -3
- package/dist/component/schema.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 +12 -1
- 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 +293 -0
- package/llms.txt +87 -0
- package/package.json +43 -24
- package/src/client/index.ts +18 -9
- package/src/client/types.ts +4 -3
- package/src/component/convex.config.ts +1 -0
- package/src/component/mutations.ts +15 -5
- package/src/component/queries.ts +12 -5
- package/src/component/schema.ts +2 -3
- package/src/component/validators.ts +13 -1
- package/src/shared.ts +1 -0
- package/src/test.ts +7 -3
package/README.md
CHANGED
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
<!-- Badges -->
|
|
2
|
-
[](https://www.convex.dev/components)
|
|
3
|
-
[](https://www.npmjs.com/package/@vllnt/convex-suppression)
|
|
4
|
-
[](https://github.com/vllnt/convex-suppression/actions/workflows/ci.yml)
|
|
5
|
-
[](./LICENSE)
|
|
6
|
-
|
|
7
1
|
# @vllnt/convex-suppression
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
TypeScript Convex component for a do-not-contact suppression list (GDPR, CAN-SPAM): unsubscribes, bounces and complaints by contact hash, plus opt-in proof.
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
const dnc = new Suppression(components.suppression);
|
|
13
|
-
await dnc.suppress(ctx, contactHash, "complaint", { channel: "email" });
|
|
14
|
-
const canSend = await dnc.isEligible(ctx, contactHash, { channel: "email" });
|
|
15
|
-
```
|
|
5
|
+
## For coding agents
|
|
16
6
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/ complaint calls `suppress`; a double-opt-in confirmation calls `recordOptIn`.
|
|
21
|
-
Domain-neutral — channels and reasons are the host's.
|
|
7
|
+
Docs for the installed version are in `node_modules/@vllnt/convex-suppression/`:
|
|
8
|
+
`docs/API.md`, `llms.txt`, `CHANGELOG.md` and the TypeScript `src/`. Read them
|
|
9
|
+
before writing code against this package.
|
|
22
10
|
|
|
23
|
-
##
|
|
11
|
+
## When to use
|
|
24
12
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
13
|
+
- Use it when every email, SMS or push send must first check that the contact
|
|
14
|
+
did not unsubscribe, bounce or complain.
|
|
15
|
+
- Use it when the do-not-contact entry must outlive erasure of the person's
|
|
16
|
+
data: the component stores only a hash you compute.
|
|
17
|
+
- Use it when a marketing send must also find a recorded opt-in proof for the
|
|
18
|
+
list.
|
|
19
|
+
- Do not use it when you need consent to processing per purpose, with withdrawal
|
|
20
|
+
and full history: use
|
|
21
|
+
[`@vllnt/convex-consent`](https://oss.vllnt.com/packages/convex-consent).
|
|
22
|
+
- Do not use it when you need to know who is on a subscriber list: use
|
|
23
|
+
[`@vllnt/convex-memberships`](https://oss.vllnt.com/packages/convex-memberships).
|
|
24
|
+
- Do not use it when you need to queue and send the email: use
|
|
25
|
+
[`@vllnt/convex-email`](https://oss.vllnt.com/packages/convex-email), and call
|
|
26
|
+
`isEligible` here first.
|
|
33
27
|
|
|
34
|
-
##
|
|
28
|
+
## Install
|
|
35
29
|
|
|
36
30
|
```bash
|
|
37
31
|
pnpm add @vllnt/convex-suppression
|
|
38
32
|
```
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Usage
|
|
34
|
+
## Quick start
|
|
43
35
|
|
|
44
36
|
```ts
|
|
45
37
|
// convex/convex.config.ts
|
|
46
|
-
import { defineApp } from "convex/server";
|
|
47
38
|
import suppression from "@vllnt/convex-suppression/convex.config";
|
|
39
|
+
import { defineApp } from "convex/server";
|
|
48
40
|
|
|
49
41
|
const app = defineApp();
|
|
50
42
|
app.use(suppression);
|
|
@@ -52,87 +44,447 @@ export default app;
|
|
|
52
44
|
```
|
|
53
45
|
|
|
54
46
|
```ts
|
|
55
|
-
// convex/email.ts
|
|
47
|
+
// convex/email.ts
|
|
48
|
+
import { Suppression } from "@vllnt/convex-suppression";
|
|
49
|
+
import { v } from "convex/values";
|
|
50
|
+
|
|
56
51
|
import { components } from "./_generated/api";
|
|
57
|
-
import {
|
|
52
|
+
import { internalMutation, internalQuery } from "./_generated/server";
|
|
53
|
+
|
|
54
|
+
const dnc = new Suppression(components.suppression);
|
|
55
|
+
|
|
56
|
+
// The send gate: call it before every newsletter email.
|
|
57
|
+
export const canEmail = internalQuery({
|
|
58
|
+
args: { contactHash: v.string() },
|
|
59
|
+
returns: v.boolean(),
|
|
60
|
+
handler: (ctx, { contactHash }) =>
|
|
61
|
+
dnc.isEligible(ctx, contactHash, {
|
|
62
|
+
channel: "email",
|
|
63
|
+
listKey: "newsletter",
|
|
64
|
+
requireOptIn: true,
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Your provider's complaint webhook, after you verify it.
|
|
69
|
+
export const onComplaint = internalMutation({
|
|
70
|
+
args: { contactHash: v.string() },
|
|
71
|
+
returns: v.null(),
|
|
72
|
+
handler: (ctx, { contactHash }) =>
|
|
73
|
+
dnc.suppress(ctx, contactHash, "complaint", { channel: "email" }),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Your double opt-in confirmation link, after you check its token.
|
|
77
|
+
export const confirmOptIn = internalMutation({
|
|
78
|
+
args: { contactHash: v.string() },
|
|
79
|
+
returns: v.null(),
|
|
80
|
+
handler: (ctx, { contactHash }) =>
|
|
81
|
+
dnc.recordOptIn(ctx, contactHash, {
|
|
82
|
+
listKey: "newsletter",
|
|
83
|
+
source: "double-opt-in",
|
|
84
|
+
}),
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Run `npx convex dev` once to generate `components.suppression`. The component
|
|
89
|
+
never reads auth and never sees a raw email or phone number: your code
|
|
90
|
+
normalizes and hashes the contact (see [Common tasks](#common-tasks)), checks
|
|
91
|
+
who may call, and passes the opaque `contactHash`.
|
|
92
|
+
|
|
93
|
+
## API
|
|
94
|
+
|
|
95
|
+
Full reference: [docs/API.md](docs/API.md).
|
|
96
|
+
|
|
97
|
+
| Export | Import from | What it does |
|
|
98
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------ | ----------------------------------------------------------------------------------- |
|
|
99
|
+
| [`Suppression`](docs/API.md#suppression) | `@vllnt/convex-suppression` | Host client: `new Suppression<TProof>(components.suppression, { proofValidator? })` |
|
|
100
|
+
| [`suppress(ctx, contactHash, reason, opts?)`](docs/API.md#suppress) | `Suppression` method, mutation | Add `(contactHash, channel)` to the list; returns `null` |
|
|
101
|
+
| [`unsuppress(ctx, contactHash, channel?)`](docs/API.md#unsuppress) | `Suppression` method, mutation | Remove that exact entry; returns `true` if one was removed |
|
|
102
|
+
| [`isSuppressed(ctx, contactHash, channel?)`](docs/API.md#issuppressed) | `Suppression` method, query | The matching entry (global first) or `null` |
|
|
103
|
+
| [`recordOptIn(ctx, contactHash, opts)`](docs/API.md#recordoptin) | `Suppression` method, mutation | Store the latest opt-in proof for `(contactHash, listKey)`; returns `null` |
|
|
104
|
+
| [`getOptInProof(ctx, contactHash, listKey?)`](docs/API.md#getoptinproof) | `Suppression` method, query | The stored opt-in proof or `null` |
|
|
105
|
+
| [`isEligible(ctx, contactHash, opts?)`](docs/API.md#iseligible) | `Suppression` method, query | Send gate: not suppressed, and opted in when `requireOptIn`; returns `boolean` |
|
|
106
|
+
| [`SuppressionComponent`](docs/API.md#suppressioncomponent) | `@vllnt/convex-suppression` (type) | Type of `components.suppression` the client accepts |
|
|
107
|
+
| [`SuppressionOptions`](docs/API.md#suppressionoptions) | `@vllnt/convex-suppression` (type) | `{ proofValidator? }` |
|
|
108
|
+
| [`SuppressOptions`](docs/API.md#suppressoptions) | `@vllnt/convex-suppression` (type) | `{ channel? }` |
|
|
109
|
+
| [`RecordOptInOptions`](docs/API.md#recordoptinoptions) | `@vllnt/convex-suppression` (type) | `{ listKey?, source, proof? }` |
|
|
110
|
+
| [`IsEligibleOptions`](docs/API.md#iseligibleoptions) | `@vllnt/convex-suppression` (type) | `{ channel?, listKey?, requireOptIn? }` |
|
|
111
|
+
| [`SuppressionView`](docs/API.md#suppressionview) | `@vllnt/convex-suppression` (type) | Result of `isSuppressed` |
|
|
112
|
+
| [`OptInProofView`](docs/API.md#optinproofview) | `@vllnt/convex-suppression` (type) | Result of `getOptInProof` |
|
|
113
|
+
| [`SuppressionReason`](docs/API.md#suppressionreason) | `@vllnt/convex-suppression` (type) | `"unsubscribe" \| "bounce" \| "complaint" \| "manual" \| "global"` |
|
|
114
|
+
| [`Parser`](docs/API.md#parser) | `@vllnt/convex-suppression` (type) | `(value: unknown) => T`, the `proofValidator` shape |
|
|
115
|
+
| [`default` (component config)](docs/API.md#convexconfig) | `@vllnt/convex-suppression/convex.config` | Pass to `app.use(...)` |
|
|
116
|
+
| [`register`](docs/API.md#register) | `@vllnt/convex-suppression/test` | Mount the component in `convex-test` |
|
|
117
|
+
| [`ComponentApi`](docs/API.md#componentapi) | `@vllnt/convex-suppression/_generated/component` | Generated type of the mounted component |
|
|
118
|
+
|
|
119
|
+
`GLOBAL_CHANNEL` (`"*"`) and the other constants in `src/shared.ts` are internal
|
|
120
|
+
and not importable.
|
|
121
|
+
|
|
122
|
+
## Common tasks
|
|
123
|
+
|
|
124
|
+
Gate a transactional email (no opt-in needed) and a marketing email (opt-in
|
|
125
|
+
needed) for the same contact. Always pass the channel you send on:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
// convex/gates.ts
|
|
129
|
+
import { Suppression } from "@vllnt/convex-suppression";
|
|
58
130
|
import { v } from "convex/values";
|
|
131
|
+
|
|
132
|
+
import { components } from "./_generated/api";
|
|
133
|
+
import { internalQuery } from "./_generated/server";
|
|
134
|
+
|
|
135
|
+
const dnc = new Suppression(components.suppression);
|
|
136
|
+
|
|
137
|
+
export const canSendReceipt = internalQuery({
|
|
138
|
+
args: { contactHash: v.string() },
|
|
139
|
+
returns: v.boolean(),
|
|
140
|
+
handler: (ctx, { contactHash }) =>
|
|
141
|
+
dnc.isEligible(ctx, contactHash, { channel: "email" }),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export const canSendPromo = internalQuery({
|
|
145
|
+
args: { contactHash: v.string() },
|
|
146
|
+
returns: v.boolean(),
|
|
147
|
+
handler: (ctx, { contactHash }) =>
|
|
148
|
+
dnc.isEligible(ctx, contactHash, {
|
|
149
|
+
channel: "email",
|
|
150
|
+
listKey: "promotions",
|
|
151
|
+
requireOptIn: true,
|
|
152
|
+
}),
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Suppress one channel, or every channel, and undo it later. A global entry is the
|
|
157
|
+
one with no channel; `unsuppress` removes only the exact entry you name:
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
// convex/lists.ts
|
|
161
|
+
import { Suppression } from "@vllnt/convex-suppression";
|
|
162
|
+
import { v } from "convex/values";
|
|
163
|
+
|
|
164
|
+
import { components } from "./_generated/api";
|
|
165
|
+
import { internalMutation } from "./_generated/server";
|
|
166
|
+
|
|
167
|
+
const dnc = new Suppression(components.suppression);
|
|
168
|
+
|
|
169
|
+
export const onBounce = internalMutation({
|
|
170
|
+
args: { contactHash: v.string() },
|
|
171
|
+
returns: v.null(),
|
|
172
|
+
handler: (ctx, { contactHash }) =>
|
|
173
|
+
dnc.suppress(ctx, contactHash, "bounce", { channel: "email" }),
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
export const blockEverywhere = internalMutation({
|
|
177
|
+
args: { contactHash: v.string() },
|
|
178
|
+
returns: v.null(),
|
|
179
|
+
handler: (ctx, { contactHash }) => dnc.suppress(ctx, contactHash, "manual"),
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
export const resubscribeEmail = internalMutation({
|
|
183
|
+
args: { contactHash: v.string() },
|
|
184
|
+
returns: v.boolean(),
|
|
185
|
+
handler: async (ctx, { contactHash }) => {
|
|
186
|
+
const removedEmail = await dnc.unsuppress(ctx, contactHash, "email");
|
|
187
|
+
const removedGlobal = await dnc.unsuppress(ctx, contactHash);
|
|
188
|
+
return removedEmail || removedGlobal;
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Store typed opt-in evidence. `proofValidator` checks `proof` before it is stored
|
|
194
|
+
and again when `getOptInProof` reads it; it must return the value or throw:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
// convex/optIn.ts
|
|
59
198
|
import { Suppression } from "@vllnt/convex-suppression";
|
|
199
|
+
import { v } from "convex/values";
|
|
60
200
|
|
|
61
|
-
|
|
62
|
-
|
|
201
|
+
import { components } from "./_generated/api";
|
|
202
|
+
import { internalMutation, internalQuery } from "./_generated/server";
|
|
203
|
+
|
|
204
|
+
type Evidence = { ip: string };
|
|
205
|
+
|
|
206
|
+
const dnc = new Suppression<Evidence>(components.suppression, {
|
|
207
|
+
proofValidator: (value) => {
|
|
208
|
+
if (
|
|
209
|
+
typeof value !== "object" ||
|
|
210
|
+
value === null ||
|
|
211
|
+
!("ip" in value) ||
|
|
212
|
+
typeof value.ip !== "string"
|
|
213
|
+
) {
|
|
214
|
+
throw new Error("Expected { ip: string }");
|
|
215
|
+
}
|
|
216
|
+
return { ip: value.ip };
|
|
217
|
+
},
|
|
63
218
|
});
|
|
64
|
-
const hash = (email: string) => myHash(email.trim().toLowerCase()); // host's hashing + salt policy
|
|
65
219
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
handler: (ctx, {
|
|
70
|
-
dnc.
|
|
220
|
+
export const confirm = internalMutation({
|
|
221
|
+
args: { contactHash: v.string(), ip: v.string() },
|
|
222
|
+
returns: v.null(),
|
|
223
|
+
handler: (ctx, { contactHash, ip }) =>
|
|
224
|
+
dnc.recordOptIn(ctx, contactHash, {
|
|
225
|
+
listKey: "newsletter",
|
|
226
|
+
source: "double-opt-in",
|
|
227
|
+
proof: { ip },
|
|
228
|
+
}),
|
|
71
229
|
});
|
|
72
230
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
handler: (ctx, {
|
|
231
|
+
export const evidence = internalQuery({
|
|
232
|
+
args: { contactHash: v.string() },
|
|
233
|
+
returns: v.union(v.null(), v.string()),
|
|
234
|
+
handler: async (ctx, { contactHash }) => {
|
|
235
|
+
const proof = await dnc.getOptInProof(ctx, contactHash, "newsletter");
|
|
236
|
+
return proof?.proof?.ip ?? null;
|
|
237
|
+
},
|
|
77
238
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Read why and when a contact was suppressed, for an audit or support screen:
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
// convex/audit.ts
|
|
245
|
+
import { Suppression } from "@vllnt/convex-suppression";
|
|
246
|
+
import { v } from "convex/values";
|
|
247
|
+
|
|
248
|
+
import { components } from "./_generated/api";
|
|
249
|
+
import { internalQuery } from "./_generated/server";
|
|
250
|
+
|
|
251
|
+
const dnc = new Suppression(components.suppression);
|
|
252
|
+
|
|
253
|
+
export const why = internalQuery({
|
|
254
|
+
args: { contactHash: v.string(), channel: v.string() },
|
|
255
|
+
returns: v.union(
|
|
256
|
+
v.null(),
|
|
257
|
+
v.object({ reason: v.string(), since: v.number() }),
|
|
258
|
+
),
|
|
259
|
+
handler: async (ctx, { contactHash, channel }) => {
|
|
260
|
+
const entry = await dnc.isSuppressed(ctx, contactHash, channel);
|
|
261
|
+
return entry === null
|
|
262
|
+
? null
|
|
263
|
+
: { reason: entry.reason, since: entry.createdAt };
|
|
264
|
+
},
|
|
82
265
|
});
|
|
83
266
|
```
|
|
84
267
|
|
|
85
|
-
|
|
268
|
+
Keep separate lists, for example marketing and transactional. Each named mount
|
|
269
|
+
has its own tables:
|
|
86
270
|
|
|
87
|
-
|
|
271
|
+
```ts
|
|
272
|
+
// convex/convex.config.ts
|
|
273
|
+
import suppression from "@vllnt/convex-suppression/convex.config";
|
|
274
|
+
import { defineApp } from "convex/server";
|
|
88
275
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
| `isSuppressed(ctx, contactHash, channel?)` | query | `SuppressionView \| null` |
|
|
95
|
-
| `getOptInProof(ctx, contactHash, listKey?)` | query | `OptInProofView \| null` |
|
|
96
|
-
| `isEligible(ctx, contactHash, opts?)` | query | `boolean` (`opts`: `{ channel?; listKey?; requireOptIn? }`) |
|
|
276
|
+
const app = defineApp();
|
|
277
|
+
app.use(suppression, { name: "marketingDnc" });
|
|
278
|
+
app.use(suppression, { name: "transactionalDnc" });
|
|
279
|
+
export default app;
|
|
280
|
+
```
|
|
97
281
|
|
|
98
|
-
|
|
282
|
+
```ts
|
|
283
|
+
// convex/clients.ts
|
|
284
|
+
import { Suppression } from "@vllnt/convex-suppression";
|
|
99
285
|
|
|
100
|
-
|
|
286
|
+
import { components } from "./_generated/api";
|
|
101
287
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
`isSuppressed` ref.
|
|
288
|
+
export const marketing = new Suppression(components.marketingDnc);
|
|
289
|
+
export const transactional = new Suppression(components.transactionalDnc);
|
|
290
|
+
```
|
|
106
291
|
|
|
107
|
-
|
|
292
|
+
Hash a contact before you call the component. The package does not do this for
|
|
293
|
+
you. A keyed hash (HMAC) stops anyone who reads the table from hashing guessed
|
|
294
|
+
emails to find a match. Keep the secret on the server, for example in a Convex
|
|
295
|
+
environment variable:
|
|
108
296
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
297
|
+
```ts
|
|
298
|
+
// convex/contactHash.ts
|
|
299
|
+
/** HMAC-SHA-256 of the trimmed, lowercased email, as hex. */
|
|
300
|
+
export async function contactHash(
|
|
301
|
+
email: string,
|
|
302
|
+
secret: string,
|
|
303
|
+
): Promise<string> {
|
|
304
|
+
const encoder = new TextEncoder();
|
|
305
|
+
const key = await crypto.subtle.importKey(
|
|
306
|
+
"raw",
|
|
307
|
+
encoder.encode(secret),
|
|
308
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
309
|
+
false,
|
|
310
|
+
["sign"],
|
|
311
|
+
);
|
|
312
|
+
const signature = await crypto.subtle.sign(
|
|
313
|
+
"HMAC",
|
|
314
|
+
key,
|
|
315
|
+
encoder.encode(email.trim().toLowerCase()),
|
|
316
|
+
);
|
|
317
|
+
return Array.from(new Uint8Array(signature), (byte) =>
|
|
318
|
+
byte.toString(16).padStart(2, "0"),
|
|
319
|
+
).join("");
|
|
320
|
+
}
|
|
321
|
+
```
|
|
112
322
|
|
|
113
|
-
|
|
323
|
+
## Errors and fixes
|
|
324
|
+
|
|
325
|
+
The component throws one coded error: a `ConvexError` whose `data` is
|
|
326
|
+
`{ code, field }`. Catch it in the host with `error instanceof ConvexError` and
|
|
327
|
+
read `error.data.code` and `error.data.field`.
|
|
328
|
+
|
|
329
|
+
| Code or message | Thrown by | Cause | Fix |
|
|
330
|
+
| -------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
331
|
+
| `INVALID_ARGUMENT` | `suppress`, `recordOptIn` | `field` names the empty string: `contactHash` or `channel` (`suppress`); `contactHash`, `listKey` or `source` (`recordOptIn`) | Check the value before calling. Omit `channel` or `listKey` for the global entry instead of passing `""` |
|
|
332
|
+
| Convex argument validation error | any method | An argument has the wrong type, or `reason` is not one of the five `SuppressionReason` values | Pass a `SuppressionReason`; TypeScript catches this at compile time |
|
|
333
|
+
| The error your `proofValidator` throws | `recordOptIn` (before the write), `getOptInProof` (on read) | Your parser rejected `proof`. From `recordOptIn` it is a synchronous throw, not a rejected promise: a try/catch around the call catches it (with or without `await`), and a `.catch()` on the returned promise never runs | Fix the proof, or let the parser accept every shape you have stored before |
|
|
334
|
+
|
|
335
|
+
These never throw `INVALID_ARGUMENT`: `isEligible` returns `false` for an empty
|
|
336
|
+
`contactHash` or `channel`. `isSuppressed` returns `null` for an empty
|
|
337
|
+
`contactHash`; with an empty `channel` it checks only the global entry (it
|
|
338
|
+
returns that entry if one exists, otherwise `null`). `getOptInProof` returns
|
|
339
|
+
`null` for an empty key and `unsuppress` returns `false`. A missing entry is
|
|
340
|
+
`null` or `false`, never an error, and a repeated write updates in place.
|
|
341
|
+
|
|
342
|
+
## Limits and gotchas
|
|
343
|
+
|
|
344
|
+
- Omitting `channel` in `isEligible` or `isSuppressed` checks only the global
|
|
345
|
+
entry, not the channel entries. Always pass the channel you send on.
|
|
346
|
+
- A channel check also matches the global entry, and the global entry wins:
|
|
347
|
+
`isSuppressed` returns it first.
|
|
348
|
+
- Omitting `channel` (or passing `"*"`) makes an entry global; `reason:
|
|
349
|
+
"global"` with another channel still blocks only that channel. `reason` never
|
|
350
|
+
changes the effect.
|
|
351
|
+
- `"*"` is the stored value for "global". Passing `"*"` as a `channel` or
|
|
352
|
+
`listKey` targets the global entry.
|
|
353
|
+
- `isEligible` checks opt-in only when `requireOptIn: true`; the default is
|
|
354
|
+
`false`, and `listKey` is ignored without it.
|
|
355
|
+
- Opt-in `listKey` is matched exactly. A global opt-in (no `listKey`) does not
|
|
356
|
+
satisfy a check for a named list.
|
|
357
|
+
- `recordOptIn` does not remove any suppression. `unsuppress` removes one exact
|
|
358
|
+
entry: clearing the global entry leaves channel entries, and the reverse.
|
|
359
|
+
- One proof per `(contactHash, listKey)`, the latest. Recording again replaces
|
|
360
|
+
`source`, `proof` and `confirmedAt`; recording again without `proof` removes
|
|
361
|
+
the stored proof. There is no history.
|
|
362
|
+
- `proofValidator` runs only when `proof` is set, and its return value is what
|
|
363
|
+
gets stored. `isEligible` does not run it.
|
|
364
|
+
- Keys are matched exactly, with no trimming, case folding or plus-address
|
|
365
|
+
folding: `"Email"` is not `"email"`. Normalize contacts, channels and list
|
|
366
|
+
keys the same way everywhere.
|
|
367
|
+
- Changing your normalization or hash secret changes every hash, so old entries
|
|
368
|
+
stop matching. Keep the old secret, or re-suppress under the new hashes.
|
|
369
|
+
- An empty `contactHash` or `channel` makes `isEligible` return `false`. For
|
|
370
|
+
`isSuppressed`, an empty `contactHash` returns `null` (not suppressed), and an
|
|
371
|
+
empty `channel` checks only the global entry. Use `isEligible` as the gate.
|
|
372
|
+
- No expiry, TTL or cron. Entries stay until `unsuppress`; proofs stay until
|
|
373
|
+
replaced. There is no method to list entries, export them or delete a proof.
|
|
374
|
+
- `proof` is stored as any Convex value (no functions or class instances) and
|
|
375
|
+
counts toward Convex's 1 MiB document limit. Hashes and proof can still be
|
|
376
|
+
personal data; store only what you need.
|
|
377
|
+
- Writes need a context with `runMutation` (a mutation or action); reads need
|
|
378
|
+
`runQuery` (a query, mutation or action).
|
|
379
|
+
- This package is not a legal-compliance guarantee. Your app owns the legal
|
|
380
|
+
basis, consent checks, retention and data minimization.
|
|
381
|
+
|
|
382
|
+
## Compatibility
|
|
383
|
+
|
|
384
|
+
- Peer dependency: `convex@^1.45.0`. CI runs the tests and the packed-package
|
|
385
|
+
test on the locked convex version (1.51.0); 1.45.0 is not tested in CI.
|
|
386
|
+
- Node.js: `engines` says `>=18`, but convex needs Node.js 20 or later
|
|
387
|
+
(1.45–1.48) and Node.js 22 or later (1.49 and newer). ES modules only.
|
|
388
|
+
- The component runs in the default Convex runtime; it needs no `"use node"`.
|
|
389
|
+
- `@vllnt/convex-suppression/test` is TypeScript source and needs `convex-test`,
|
|
390
|
+
`vitest`, `vite` and `@edge-runtime/vm`, with the Vitest config shown under
|
|
391
|
+
Testing.
|
|
392
|
+
- React: not applicable. The package is backend-only and has no `./react` entry;
|
|
393
|
+
to show a status in the UI, call `isSuppressed` from your own query and read
|
|
394
|
+
it with `useQuery`.
|
|
114
395
|
|
|
115
396
|
## Testing
|
|
116
397
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
398
|
+
Mount the component in your own `convex-test` suite with `register`. Use the
|
|
399
|
+
Vitest settings `convex-test` recommends (edge runtime, `convex-test` inlined):
|
|
400
|
+
|
|
401
|
+
```ts
|
|
402
|
+
// vitest.config.mts
|
|
403
|
+
import { defineConfig } from "vitest/config";
|
|
404
|
+
|
|
405
|
+
export default defineConfig({
|
|
406
|
+
test: {
|
|
407
|
+
environment: "edge-runtime",
|
|
408
|
+
server: { deps: { inline: ["convex-test"] } },
|
|
409
|
+
},
|
|
410
|
+
});
|
|
120
411
|
```
|
|
121
412
|
|
|
122
|
-
|
|
413
|
+
This test uses the Quick start functions and your app's `convex/schema.ts`; if
|
|
414
|
+
you have none, `export default defineSchema({})` from `convex/server` is enough:
|
|
123
415
|
|
|
124
|
-
|
|
416
|
+
```ts
|
|
417
|
+
// convex/email.test.ts
|
|
418
|
+
/// <reference types="vite/client" />
|
|
419
|
+
import { register } from "@vllnt/convex-suppression/test";
|
|
420
|
+
import { convexTest } from "convex-test";
|
|
421
|
+
import { expect, test } from "vitest";
|
|
422
|
+
|
|
423
|
+
import { internal } from "./_generated/api";
|
|
424
|
+
import schema from "./schema";
|
|
425
|
+
|
|
426
|
+
test("a complaint blocks the newsletter", async () => {
|
|
427
|
+
const t = convexTest(schema, import.meta.glob("./**/*.ts"));
|
|
428
|
+
register(t);
|
|
429
|
+
const contactHash = "hash-of-a-test-contact";
|
|
430
|
+
const canEmail = () => t.query(internal.email.canEmail, { contactHash });
|
|
431
|
+
|
|
432
|
+
expect(await canEmail()).toBe(false);
|
|
433
|
+
await t.mutation(internal.email.confirmOptIn, { contactHash });
|
|
434
|
+
expect(await canEmail()).toBe(true);
|
|
435
|
+
await t.mutation(internal.email.onComplaint, { contactHash });
|
|
436
|
+
expect(await canEmail()).toBe(false);
|
|
437
|
+
});
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
`register(t, name)` takes the mount name when you used
|
|
441
|
+
`app.use(suppression, { name })`; the default is `"suppression"`.
|
|
442
|
+
|
|
443
|
+
This repository's own tests run on the simulated `convex-test` runtime, not
|
|
444
|
+
mocks (`pnpm test:coverage`, 100% coverage enforced).
|
|
445
|
+
|
|
446
|
+
## Security
|
|
447
|
+
|
|
448
|
+
- The component does not authenticate. Your app decides who may suppress,
|
|
449
|
+
unsuppress or read a hash. Keep these calls in internal functions, or check
|
|
450
|
+
auth before them; never take a `contactHash` from an unauthenticated client.
|
|
451
|
+
- Its tables are sandboxed: they are reachable only through the component's
|
|
452
|
+
functions, and the component reads no host table.
|
|
453
|
+
- Time is set by the server: `createdAt` and `confirmedAt` come from
|
|
454
|
+
`Date.now()` inside each handler; no method accepts a timestamp.
|
|
455
|
+
- Verify provider webhooks before calling `suppress`, and verify the opt-in
|
|
456
|
+
(token, checkbox) before calling `recordOptIn`.
|
|
125
457
|
|
|
126
|
-
|
|
458
|
+
Report vulnerabilities as described in
|
|
459
|
+
[SECURITY.md](https://github.com/vllnt/convex-suppression/blob/main/SECURITY.md).
|
|
127
460
|
|
|
128
|
-
##
|
|
461
|
+
## Related packages
|
|
129
462
|
|
|
130
|
-
|
|
463
|
+
None. This package has no dependency, shared test or example with another
|
|
464
|
+
package. For packages that solve nearby problems, see
|
|
465
|
+
[When to use](#when-to-use).
|
|
131
466
|
|
|
132
|
-
|
|
467
|
+
## Contributing
|
|
468
|
+
|
|
469
|
+
See
|
|
470
|
+
[CONTRIBUTING.md](https://github.com/vllnt/convex-suppression/blob/main/CONTRIBUTING.md).
|
|
471
|
+
|
|
472
|
+
## Links
|
|
133
473
|
|
|
134
|
-
|
|
474
|
+
- Docs and changelog: [oss.vllnt.com/packages/convex-suppression](https://oss.vllnt.com/packages/convex-suppression) · [release feed](https://oss.vllnt.com/packages/convex-suppression/rss.xml)
|
|
475
|
+
- All @vllnt packages: [oss.vllnt.com](https://oss.vllnt.com) · [search packages and docs on index.vllnt.com](https://index.vllnt.com)
|
|
476
|
+
- Source and issues: [GitHub](https://github.com/vllnt/convex-suppression) · [issues](https://github.com/vllnt/convex-suppression/issues) · [npm](https://www.npmjs.com/package/@vllnt/convex-suppression)
|
|
477
|
+
- Questions and updates: [Discord](https://bntvllnt.com/discord) · [X @bntvllnt](https://x.com/bntvllnt)
|
|
478
|
+
- Company and author: [vllnt.com](https://vllnt.com) · [bntvllnt.com](https://bntvllnt.com) · [GitHub @bntvllnt](https://github.com/bntvllnt) · [LinkedIn](https://linkedin.com/in/bntvllnt)
|
|
479
|
+
- Sponsor: [GitHub Sponsors](https://github.com/sponsors/bntvllnt)
|
|
135
480
|
|
|
136
481
|
## License
|
|
137
482
|
|
|
138
|
-
MIT
|
|
483
|
+
MIT. See [LICENSE](LICENSE).
|
|
484
|
+
|
|
485
|
+
[](https://www.npmjs.com/package/@vllnt/convex-suppression)
|
|
486
|
+
[](https://github.com/vllnt/convex-suppression/actions/workflows/ci.yml)
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
Part of [vllnt open source](https://oss.vllnt.com) · [Package page](https://oss.vllnt.com/packages/convex-suppression) · [vllnt.com](https://vllnt.com) · Built by [bntvllnt](https://bntvllnt.com)
|
package/dist/client/index.d.ts
CHANGED
|
@@ -67,27 +67,36 @@ interface RunMutationCtx {
|
|
|
67
67
|
* bounce / complaint webhook calls `suppress`; a double-opt-in confirmation calls
|
|
68
68
|
* `recordOptIn`. The host owns meaning and auth — it resolves identity, hashes the
|
|
69
69
|
* contact, and decides the channel/list semantics. Pass `proofValidator` to narrow
|
|
70
|
-
* the opaque opt-in evidence to `TProof` at the boundary
|
|
71
|
-
*
|
|
70
|
+
* the opaque opt-in evidence to `TProof` at the boundary; without it, `proof` is
|
|
71
|
+
* typed `TProof` but not checked.
|
|
72
72
|
*
|
|
73
73
|
* @typeParam TProof - The host's opt-in proof evidence type (defaults to `unknown`).
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
76
|
* ```ts
|
|
77
|
-
* const dnc = new Suppression(components.suppression, {
|
|
78
|
-
* proofValidator:
|
|
77
|
+
* const dnc = new Suppression<{ ip: string }>(components.suppression, {
|
|
78
|
+
* proofValidator: (value) => parseIpProof(value), // your parser: (unknown) => { ip: string }
|
|
79
79
|
* });
|
|
80
|
-
* // a webhook suppresses
|
|
80
|
+
* // a verified complaint webhook suppresses the email channel:
|
|
81
81
|
* await dnc.suppress(ctx, contactHash, "complaint", { channel: "email" });
|
|
82
|
-
* // a
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
82
|
+
* // a marketing send checks the gate first:
|
|
83
|
+
* const mayEmail = await dnc.isEligible(ctx, contactHash, {
|
|
84
|
+
* channel: "email",
|
|
85
|
+
* listKey: "news",
|
|
86
|
+
* requireOptIn: true,
|
|
87
|
+
* });
|
|
86
88
|
* ```
|
|
89
|
+
*
|
|
90
|
+
* @see https://oss.vllnt.com/packages/convex-suppression
|
|
87
91
|
*/
|
|
88
92
|
export declare class Suppression<TProof = unknown> {
|
|
89
93
|
private readonly component;
|
|
90
94
|
private readonly proofValidator;
|
|
95
|
+
/**
|
|
96
|
+
* @param component - The mounted component, `components.suppression` (or the
|
|
97
|
+
* name given to `app.use`).
|
|
98
|
+
* @param options - Optional `proofValidator`; defaults to `{}`.
|
|
99
|
+
*/
|
|
91
100
|
constructor(component: SuppressionComponent, options?: SuppressionOptions<TProof>);
|
|
92
101
|
/** Narrow an opaque value through a host parser; pass `undefined` and unset parsers through. */
|
|
93
102
|
private parse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,MAAM,YAAY,CAAC;AAGpB;;;;GAIG;AACH,KAAK,YAAY,GAAG;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE;QACT,QAAQ,EAAE,iBAAiB,CACzB,UAAU,EACV,UAAU,EACV;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,iBAAiB,CAAA;SAAE,EACnE,IAAI,CACL,CAAC;QACF,UAAU,EAAE,iBAAiB,CAC3B,UAAU,EACV,UAAU,EACV;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EACxC,OAAO,CACR,CAAC;QACF,WAAW,EAAE,iBAAiB,CAC5B,UAAU,EACV,UAAU,EACV;YAAE,WAAW,EAAE,MAAM,CAAC;YA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