@vllnt/convex-suppression 0.1.0-canary.f74dec0 → 0.1.0
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/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +15 -15
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/_generated/server.d.ts +12 -0
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js +2 -0
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/mutations.d.ts +4 -4
- package/dist/component/mutations.js +3 -3
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts +3 -3
- package/dist/component/schema.d.ts +7 -7
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/validators.d.ts +8 -8
- package/dist/shared.d.ts.map +1 -1
- package/package.json +18 -15
- package/src/component/_generated/component.ts +20 -30
- package/src/component/_generated/server.ts +13 -0
- package/src/component/mutations.ts +3 -3
|
@@ -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,MA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AAW,EAChB,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,OAAO,CAAC,CAOlB;CACF;AAED,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,CAAC"}
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAkF9C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,WAAW;IAIH;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAkF9C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,WAAW;IAIH,SAAS;IAHX,cAAc,CAA6B;IAE5D,YACmB,SAA+B,EAChD,OAAO,GAA+B,EAAE;yBADvB,SAAS;QAG1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAC/C,CAAC;IAED,gGAAgG;IACxF,KAAK,CAAC,KAAc;QAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,KAAe,CAAC;QACzB,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CACN,GAAmB,EACnB,WAAmB,EACnB,MAAyB,EACzB,IAAI,GAAoB,EAAE;QAE1B,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,C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AC,CAAC;QACH,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;YAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;SAC7B,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,UAAU,CACR,GAAgB,EAChB,WAAmB,EACnB,IAAI,GAAsB,EAAE;QAE5B,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE;YACrD,WAAW;YACX,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,cAAc;YACvC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,cAAc;YACvC,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,KAAK;SACzC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -20,6 +20,12 @@ import type { FunctionReference } from "convex/server";
|
|
|
20
20
|
*/
|
|
21
21
|
export type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
22
22
|
mutations: {
|
|
23
|
+
recordOptIn: FunctionReference<"mutation", "internal", {
|
|
24
|
+
contactHash: string;
|
|
25
|
+
listKey: string;
|
|
26
|
+
proof?: any;
|
|
27
|
+
source: string;
|
|
28
|
+
}, null, Name>;
|
|
23
29
|
suppress: FunctionReference<"mutation", "internal", {
|
|
24
30
|
channel: string;
|
|
25
31
|
contactHash: string;
|
|
@@ -29,23 +35,8 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
29
35
|
channel: string;
|
|
30
36
|
contactHash: string;
|
|
31
37
|
}, boolean, Name>;
|
|
32
|
-
recordOptIn: FunctionReference<"mutation", "internal", {
|
|
33
|
-
contactHash: string;
|
|
34
|
-
listKey: string;
|
|
35
|
-
proof?: any;
|
|
36
|
-
source: string;
|
|
37
|
-
}, null, Name>;
|
|
38
38
|
};
|
|
39
39
|
queries: {
|
|
40
|
-
isSuppressed: FunctionReference<"query", "internal", {
|
|
41
|
-
channel: string;
|
|
42
|
-
contactHash: string;
|
|
43
|
-
}, null | {
|
|
44
|
-
channel: string | null;
|
|
45
|
-
contactHash: string;
|
|
46
|
-
createdAt: number;
|
|
47
|
-
reason: "unsubscribe" | "bounce" | "complaint" | "manual" | "global";
|
|
48
|
-
}, Name>;
|
|
49
40
|
getOptInProof: FunctionReference<"query", "internal", {
|
|
50
41
|
contactHash: string;
|
|
51
42
|
listKey: string;
|
|
@@ -62,6 +53,15 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
62
53
|
listKey: string;
|
|
63
54
|
requireOptIn: boolean;
|
|
64
55
|
}, boolean, Name>;
|
|
56
|
+
isSuppressed: FunctionReference<"query", "internal", {
|
|
57
|
+
channel: string;
|
|
58
|
+
contactHash: string;
|
|
59
|
+
}, null | {
|
|
60
|
+
channel: string | null;
|
|
61
|
+
contactHash: string;
|
|
62
|
+
createdAt: number;
|
|
63
|
+
reason: "unsubscribe" | "bounce" | "complaint" | "manual" | "global";
|
|
64
|
+
}, Name>;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3E;IACE,SAAS,EAAE;QACT,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../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CAC3B,OAAO,EACP,UAAU,EACV;YACE,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,OAAO,EAAE,MAAM,CAAC;YAChB,YAAY,EAAE,OAAO,CAAC;SACvB,EACD,OAAO,EACP,IAAI,CACL,CAAC;QACF,YAAY,EAAE,iBAAiB,CAC7B,OAAO,EACP,UAAU,EACV;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,EACxC,IAAI,GAAG;YACL,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;YACvB,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;SACtE,EACD,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
|
|
10
10
|
import type { DataModel } from "./dataModel.js";
|
|
11
|
+
/**
|
|
12
|
+
* Typesafe environment variables.
|
|
13
|
+
*
|
|
14
|
+
* This includes platform-provided env vars and any variables declared in
|
|
15
|
+
* `convex.config.ts`.
|
|
16
|
+
*/
|
|
17
|
+
type Env = {
|
|
18
|
+
readonly CONVEX_CLOUD_URL: string;
|
|
19
|
+
readonly CONVEX_SITE_URL: string;
|
|
20
|
+
};
|
|
11
21
|
/**
|
|
12
22
|
* Define a query in this Convex app's public API.
|
|
13
23
|
*
|
|
@@ -75,6 +85,7 @@ export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
|
75
85
|
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
76
86
|
*/
|
|
77
87
|
export declare const httpAction: HttpActionBuilder;
|
|
88
|
+
export declare const env: Env;
|
|
78
89
|
/**
|
|
79
90
|
* A set of services for use within Convex query functions.
|
|
80
91
|
*
|
|
@@ -118,4 +129,5 @@ export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
|
118
129
|
* for the guarantees Convex provides your functions.
|
|
119
130
|
*/
|
|
120
131
|
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
132
|
+
export {};
|
|
121
133
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,eAAe,CAAC;AAUvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAgB,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,SAAS,EAAE,UAAU,CACxC,CAAC;AAEvB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAmB,CAAC;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,SAAS,EAAE,UAAU,CAC3C,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAiB,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,SAAS,EAAE,UAAU,CACzC,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,U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ElD;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -75,4 +75,6 @@ export const internalAction = internalActionGeneric;
|
|
|
75
75
|
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
76
76
|
*/
|
|
77
77
|
export const httpAction = httpActionGeneric;
|
|
78
|
+
export const env = globalThis
|
|
79
|
+
.process.env;
|
|
78
80
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAcvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAS,UAAmD;KACzE,OAAO,CAAC,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,sDAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,sDAAiC,CAAC;eAMlC,SAAS"}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* caller-supplied).
|
|
14
14
|
*/
|
|
15
15
|
export declare const suppress: import("convex/server").RegisteredMutation<"public", {
|
|
16
|
-
contactHash: string;
|
|
17
16
|
channel: string;
|
|
18
|
-
|
|
17
|
+
contactHash: string;
|
|
18
|
+
reason: "bounce" | "complaint" | "global" | "manual" | "unsubscribe";
|
|
19
19
|
}, Promise<null>>;
|
|
20
20
|
/**
|
|
21
21
|
* Remove a `(contactHash, channel)` from the do-not-contact list — a rare, audited
|
|
@@ -25,8 +25,8 @@ export declare const suppress: import("convex/server").RegisteredMutation<"publi
|
|
|
25
25
|
* no-op unsuppress of an address that was never suppressed is not an error).
|
|
26
26
|
*/
|
|
27
27
|
export declare const unsuppress: import("convex/server").RegisteredMutation<"public", {
|
|
28
|
-
contactHash: string;
|
|
29
28
|
channel: string;
|
|
29
|
+
contactHash: string;
|
|
30
30
|
}, Promise<boolean>>;
|
|
31
31
|
/**
|
|
32
32
|
* Record an opt-in proof for a `(contactHash, listKey)` — the legal evidence that
|
|
@@ -41,9 +41,9 @@ export declare const unsuppress: import("convex/server").RegisteredMutation<"pub
|
|
|
41
41
|
* server-sourced.
|
|
42
42
|
*/
|
|
43
43
|
export declare const recordOptIn: import("convex/server").RegisteredMutation<"public", {
|
|
44
|
-
proof?: any;
|
|
45
44
|
contactHash: string;
|
|
46
45
|
listKey: string;
|
|
46
|
+
proof?: any;
|
|
47
47
|
source: string;
|
|
48
48
|
}, Promise<null>>;
|
|
49
49
|
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -29,7 +29,7 @@ export const suppress = mutation({
|
|
|
29
29
|
.unique();
|
|
30
30
|
const now = Date.now();
|
|
31
31
|
if (existing !== null) {
|
|
32
|
-
await ctx.db.patch(existing._id, { reason: args.reason, createdAt: now });
|
|
32
|
+
await ctx.db.patch("suppressions", existing._id, { reason: args.reason, createdAt: now });
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
await ctx.db.insert("suppressions", {
|
|
@@ -59,7 +59,7 @@ export const unsuppress = mutation({
|
|
|
59
59
|
if (existing === null) {
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
|
-
await ctx.db.delete(existing._id);
|
|
62
|
+
await ctx.db.delete("suppressions", existing._id);
|
|
63
63
|
return true;
|
|
64
64
|
},
|
|
65
65
|
});
|
|
@@ -90,7 +90,7 @@ export const recordOptIn = mutation({
|
|
|
90
90
|
.unique();
|
|
91
91
|
const now = Date.now();
|
|
92
92
|
if (existing !== null) {
|
|
93
|
-
await ctx.db.patch(existing._id, {
|
|
93
|
+
await ctx.db.patch("optInProofs", existing._id, {
|
|
94
94
|
source: args.source,
|
|
95
95
|
proof: args.proof,
|
|
96
96
|
confirmedAt: now,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings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CAAC,CAAC,EAAE,EAAE,CAC/B,CAAC,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAClE;aACA,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,EAAE;gBAC9C,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,GAAG;aACjB,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,GAAG;SACjB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* only. Two bounded equality reads on `by_hash_channel`; never spans contacts.
|
|
7
7
|
*/
|
|
8
8
|
export declare const isSuppressed: import("convex/server").RegisteredQuery<"public", {
|
|
9
|
-
contactHash: string;
|
|
10
9
|
channel: string;
|
|
10
|
+
contactHash: string;
|
|
11
11
|
}, Promise<{
|
|
12
12
|
contactHash: string;
|
|
13
13
|
channel: string | null;
|
|
14
|
-
reason: "
|
|
14
|
+
reason: "bounce" | "complaint" | "global" | "manual" | "unsubscribe";
|
|
15
15
|
createdAt: number;
|
|
16
16
|
} | null>>;
|
|
17
17
|
/**
|
|
@@ -38,8 +38,8 @@ export declare const getOptInProof: import("convex/server").RegisteredQuery<"pub
|
|
|
38
38
|
* mail sets it; a transactional send may not).
|
|
39
39
|
*/
|
|
40
40
|
export declare const isEligible: import("convex/server").RegisteredQuery<"public", {
|
|
41
|
-
contactHash: string;
|
|
42
41
|
channel: string;
|
|
42
|
+
contactHash: string;
|
|
43
43
|
listKey: string;
|
|
44
44
|
requireOptIn: boolean;
|
|
45
45
|
}, Promise<boolean>>;
|
|
@@ -18,32 +18,32 @@
|
|
|
18
18
|
*/
|
|
19
19
|
declare const _default: import("convex/server").SchemaDefinition<{
|
|
20
20
|
suppressions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
21
|
-
contactHash: string;
|
|
22
21
|
channel: string;
|
|
23
|
-
|
|
22
|
+
contactHash: string;
|
|
24
23
|
createdAt: number;
|
|
24
|
+
reason: "bounce" | "complaint" | "global" | "manual" | "unsubscribe";
|
|
25
25
|
}, {
|
|
26
26
|
contactHash: import("convex/values").VString<string, "required">;
|
|
27
27
|
channel: import("convex/values").VString<string, "required">;
|
|
28
|
-
reason: import("convex/values").VUnion<"
|
|
28
|
+
reason: import("convex/values").VUnion<"bounce" | "complaint" | "global" | "manual" | "unsubscribe", [import("convex/values").VLiteral<"unsubscribe", "required">, import("convex/values").VLiteral<"bounce", "required">, import("convex/values").VLiteral<"complaint", "required">, import("convex/values").VLiteral<"manual", "required">, import("convex/values").VLiteral<"global", "required">], "required", never>;
|
|
29
29
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
30
|
-
}, "required", "
|
|
30
|
+
}, "required", "channel" | "contactHash" | "createdAt" | "reason">, {
|
|
31
31
|
by_hash: ["contactHash", "_creationTime"];
|
|
32
32
|
by_hash_channel: ["contactHash", "channel", "_creationTime"];
|
|
33
33
|
}, {}, {}>;
|
|
34
34
|
optInProofs: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
35
|
-
|
|
35
|
+
confirmedAt: number;
|
|
36
36
|
contactHash: string;
|
|
37
37
|
listKey: string;
|
|
38
|
+
proof?: any;
|
|
38
39
|
source: string;
|
|
39
|
-
confirmedAt: number;
|
|
40
40
|
}, {
|
|
41
41
|
contactHash: import("convex/values").VString<string, "required">;
|
|
42
42
|
listKey: import("convex/values").VString<string, "required">;
|
|
43
43
|
source: import("convex/values").VString<string, "required">;
|
|
44
44
|
proof: import("convex/values").VAny<any, "optional", string>;
|
|
45
45
|
confirmedAt: import("convex/values").VFloat64<number, "required">;
|
|
46
|
-
}, "required", "
|
|
46
|
+
}, "required", "confirmedAt" | "contactHash" | "listKey" | "proof" | "source" | `proof.${string}`>, {
|
|
47
47
|
by_hash_list: ["contactHash", "listKey", "_creationTime"];
|
|
48
48
|
}, {}, {}>;
|
|
49
49
|
}, true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const jsonValue: import("convex/values").VAny<any, "required", string>;
|
|
13
13
|
/** The five standard reasons a `(contactHash, channel)` is suppressed. */
|
|
14
|
-
export declare const suppressionReason: import("convex/values").VUnion<"
|
|
14
|
+
export declare const suppressionReason: import("convex/values").VUnion<"bounce" | "complaint" | "global" | "manual" | "unsubscribe", [import("convex/values").VLiteral<"unsubscribe", "required">, import("convex/values").VLiteral<"bounce", "required">, import("convex/values").VLiteral<"complaint", "required">, import("convex/values").VLiteral<"manual", "required">, import("convex/values").VLiteral<"global", "required">], "required", never>;
|
|
15
15
|
/**
|
|
16
16
|
* Public projection of a suppression returned by {@link isSuppressed}. `channel`
|
|
17
17
|
* is the host-supplied channel the entry applies to, or `null` for a global
|
|
@@ -19,32 +19,32 @@ export declare const suppressionReason: import("convex/values").VUnion<"unsubscr
|
|
|
19
19
|
* a raw email/phone.
|
|
20
20
|
*/
|
|
21
21
|
export declare const suppressionView: import("convex/values").VObject<{
|
|
22
|
-
contactHash: string;
|
|
23
22
|
channel: string | null;
|
|
24
|
-
|
|
23
|
+
contactHash: string;
|
|
25
24
|
createdAt: number;
|
|
25
|
+
reason: "bounce" | "complaint" | "global" | "manual" | "unsubscribe";
|
|
26
26
|
}, {
|
|
27
27
|
contactHash: import("convex/values").VString<string, "required">;
|
|
28
28
|
channel: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
29
|
-
reason: import("convex/values").VUnion<"
|
|
29
|
+
reason: import("convex/values").VUnion<"bounce" | "complaint" | "global" | "manual" | "unsubscribe", [import("convex/values").VLiteral<"unsubscribe", "required">, import("convex/values").VLiteral<"bounce", "required">, import("convex/values").VLiteral<"complaint", "required">, import("convex/values").VLiteral<"manual", "required">, import("convex/values").VLiteral<"global", "required">], "required", never>;
|
|
30
30
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
31
|
-
}, "required", "
|
|
31
|
+
}, "required", "channel" | "contactHash" | "createdAt" | "reason">;
|
|
32
32
|
/**
|
|
33
33
|
* Public projection of an opt-in proof returned by {@link getOptInProof}.
|
|
34
34
|
* `listKey` scopes the proof to one list/purpose, or `null` for a global opt-in.
|
|
35
35
|
* `source` tags how the opt-in was captured; `proof` is opaque host evidence.
|
|
36
36
|
*/
|
|
37
37
|
export declare const optInProofView: import("convex/values").VObject<{
|
|
38
|
-
|
|
38
|
+
confirmedAt: number;
|
|
39
39
|
contactHash: string;
|
|
40
40
|
listKey: string | null;
|
|
41
|
+
proof?: any;
|
|
41
42
|
source: string;
|
|
42
|
-
confirmedAt: number;
|
|
43
43
|
}, {
|
|
44
44
|
contactHash: import("convex/values").VString<string, "required">;
|
|
45
45
|
listKey: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
46
46
|
source: import("convex/values").VString<string, "required">;
|
|
47
47
|
proof: import("convex/values").VAny<any, "optional", string>;
|
|
48
48
|
confirmedAt: import("convex/values").VFloat64<number, "required">;
|
|
49
|
-
}, "required", "
|
|
49
|
+
}, "required", "confirmedAt" | "contactHash" | "listKey" | "proof" | "source" | `proof.${string}`>;
|
|
50
50
|
//# sourceMappingURL=validators.d.ts.map
|
package/dist/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,YAC9B,aAAa,EACb,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,CACA,CAAC;AAEX,mCAAmC;AACnC,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/convex-suppression",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Do-not-contact suppression list + opt-in proof (GDPR/CAN-SPAM), hash-keyed and channel-aware, as a Convex component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"module": "./dist/client/index.js",
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc --project ./tsconfig.build.json",
|
|
38
|
-
"build:codegen": "pnpm
|
|
38
|
+
"build:codegen": "pnpm codegen && pnpm build",
|
|
39
39
|
"build:clean": "rm -rf dist *.tsbuildinfo && pnpm build:codegen",
|
|
40
40
|
"typecheck": "tsc --noEmit",
|
|
41
41
|
"typecheck:ci": "tsc --noEmit --project tsconfig.ci.json",
|
|
42
|
-
"lint": "eslint .",
|
|
42
|
+
"lint": "pnpm check:agents && eslint .",
|
|
43
43
|
"test": "vitest run --passWithNoTests",
|
|
44
44
|
"test:watch": "vitest --typecheck --clearScreen false",
|
|
45
45
|
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
@@ -47,23 +47,26 @@
|
|
|
47
47
|
"preversion": "pnpm install --frozen-lockfile && pnpm build && pnpm test:coverage && pnpm typecheck && pnpm generate:llms",
|
|
48
48
|
"prepublishOnly": "npm whoami || npm login",
|
|
49
49
|
"alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push --follow-tags",
|
|
50
|
-
"release": "npm version patch && npm publish && git push --follow-tags"
|
|
50
|
+
"release": "npm version patch && npm publish && git push --follow-tags",
|
|
51
|
+
"check:agents": "node -e \"const f=require('node:fs');if(!f.existsSync('AGENTS.md')||f.existsSync('CLAUDE.md')||f.existsSync('.claude'))process.exit(1)\"",
|
|
52
|
+
"codegen": "pnpm convex codegen --component-dir ./src/component"
|
|
51
53
|
},
|
|
52
|
-
"dependencies": {},
|
|
53
54
|
"peerDependencies": {
|
|
54
|
-
"convex": "^1.
|
|
55
|
+
"convex": "^1.45.0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@edge-runtime/vm": "^5.0.0",
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@vllnt/
|
|
61
|
-
"
|
|
62
|
-
"convex
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
59
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
60
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
61
|
+
"@vllnt/eslint-config": "2.0.0",
|
|
62
|
+
"@vllnt/typescript": "2.0.0",
|
|
63
|
+
"convex": "^1.45.0",
|
|
64
|
+
"convex-test": "^0.0.56",
|
|
65
|
+
"eslint": "^9.39.5",
|
|
66
|
+
"prettier": "^3.9.6",
|
|
67
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
68
|
+
"vite": "^8.2.2",
|
|
69
|
+
"vitest": "^4.1.11"
|
|
67
70
|
},
|
|
68
71
|
"homepage": "https://github.com/vllnt/convex-suppression#readme",
|
|
69
72
|
"bugs": {
|
|
@@ -24,18 +24,20 @@ import type { FunctionReference } from "convex/server";
|
|
|
24
24
|
export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
25
25
|
{
|
|
26
26
|
mutations: {
|
|
27
|
+
recordOptIn: FunctionReference<
|
|
28
|
+
"mutation",
|
|
29
|
+
"internal",
|
|
30
|
+
{ contactHash: string; listKey: string; proof?: any; source: string },
|
|
31
|
+
null,
|
|
32
|
+
Name
|
|
33
|
+
>;
|
|
27
34
|
suppress: FunctionReference<
|
|
28
35
|
"mutation",
|
|
29
36
|
"internal",
|
|
30
37
|
{
|
|
31
38
|
channel: string;
|
|
32
39
|
contactHash: string;
|
|
33
|
-
reason:
|
|
34
|
-
| "unsubscribe"
|
|
35
|
-
| "bounce"
|
|
36
|
-
| "complaint"
|
|
37
|
-
| "manual"
|
|
38
|
-
| "global";
|
|
40
|
+
reason: "unsubscribe" | "bounce" | "complaint" | "manual" | "global";
|
|
39
41
|
},
|
|
40
42
|
null,
|
|
41
43
|
Name
|
|
@@ -47,32 +49,8 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
47
49
|
boolean,
|
|
48
50
|
Name
|
|
49
51
|
>;
|
|
50
|
-
recordOptIn: FunctionReference<
|
|
51
|
-
"mutation",
|
|
52
|
-
"internal",
|
|
53
|
-
{ contactHash: string; listKey: string; proof?: any; source: string },
|
|
54
|
-
null,
|
|
55
|
-
Name
|
|
56
|
-
>;
|
|
57
52
|
};
|
|
58
53
|
queries: {
|
|
59
|
-
isSuppressed: FunctionReference<
|
|
60
|
-
"query",
|
|
61
|
-
"internal",
|
|
62
|
-
{ channel: string; contactHash: string },
|
|
63
|
-
null | {
|
|
64
|
-
channel: string | null;
|
|
65
|
-
contactHash: string;
|
|
66
|
-
createdAt: number;
|
|
67
|
-
reason:
|
|
68
|
-
| "unsubscribe"
|
|
69
|
-
| "bounce"
|
|
70
|
-
| "complaint"
|
|
71
|
-
| "manual"
|
|
72
|
-
| "global";
|
|
73
|
-
},
|
|
74
|
-
Name
|
|
75
|
-
>;
|
|
76
54
|
getOptInProof: FunctionReference<
|
|
77
55
|
"query",
|
|
78
56
|
"internal",
|
|
@@ -98,5 +76,17 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
98
76
|
boolean,
|
|
99
77
|
Name
|
|
100
78
|
>;
|
|
79
|
+
isSuppressed: FunctionReference<
|
|
80
|
+
"query",
|
|
81
|
+
"internal",
|
|
82
|
+
{ channel: string; contactHash: string },
|
|
83
|
+
null | {
|
|
84
|
+
channel: string | null;
|
|
85
|
+
contactHash: string;
|
|
86
|
+
createdAt: number;
|
|
87
|
+
reason: "unsubscribe" | "bounce" | "complaint" | "manual" | "global";
|
|
88
|
+
},
|
|
89
|
+
Name
|
|
90
|
+
>;
|
|
101
91
|
};
|
|
102
92
|
};
|
|
@@ -30,6 +30,17 @@ import {
|
|
|
30
30
|
} from "convex/server";
|
|
31
31
|
import type { DataModel } from "./dataModel.js";
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Typesafe environment variables.
|
|
35
|
+
*
|
|
36
|
+
* This includes platform-provided env vars and any variables declared in
|
|
37
|
+
* `convex.config.ts`.
|
|
38
|
+
*/
|
|
39
|
+
type Env = {
|
|
40
|
+
readonly CONVEX_CLOUD_URL: string;
|
|
41
|
+
readonly CONVEX_SITE_URL: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
33
44
|
/**
|
|
34
45
|
* Define a query in this Convex app's public API.
|
|
35
46
|
*
|
|
@@ -106,6 +117,8 @@ export const internalAction: ActionBuilder<DataModel, "internal"> =
|
|
|
106
117
|
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
107
118
|
*/
|
|
108
119
|
export const httpAction: HttpActionBuilder = httpActionGeneric;
|
|
120
|
+
export const env: Env = (globalThis as unknown as { process: { env: Env } })
|
|
121
|
+
.process.env;
|
|
109
122
|
|
|
110
123
|
/**
|
|
111
124
|
* A set of services for use within Convex query functions.
|
|
@@ -32,7 +32,7 @@ export const suppress = mutation({
|
|
|
32
32
|
.unique();
|
|
33
33
|
const now = Date.now();
|
|
34
34
|
if (existing !== null) {
|
|
35
|
-
await ctx.db.patch(existing._id, { reason: args.reason, createdAt: now });
|
|
35
|
+
await ctx.db.patch("suppressions", existing._id, { reason: args.reason, createdAt: now });
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
await ctx.db.insert("suppressions", {
|
|
@@ -65,7 +65,7 @@ export const unsuppress = mutation({
|
|
|
65
65
|
if (existing === null) {
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
68
|
-
await ctx.db.delete(existing._id);
|
|
68
|
+
await ctx.db.delete("suppressions", existing._id);
|
|
69
69
|
return true;
|
|
70
70
|
},
|
|
71
71
|
});
|
|
@@ -99,7 +99,7 @@ export const recordOptIn = mutation({
|
|
|
99
99
|
.unique();
|
|
100
100
|
const now = Date.now();
|
|
101
101
|
if (existing !== null) {
|
|
102
|
-
await ctx.db.patch(existing._id, {
|
|
102
|
+
await ctx.db.patch("optInProofs", existing._id, {
|
|
103
103
|
source: args.source,
|
|
104
104
|
proof: args.proof,
|
|
105
105
|
confirmedAt: now,
|