@niama/loops 0.2.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.
Files changed (74) hide show
  1. package/README.md +506 -0
  2. package/dist/client/index.d.ts +510 -0
  3. package/dist/client/index.d.ts.map +1 -0
  4. package/dist/client/index.js +464 -0
  5. package/dist/component/_generated/api.d.ts +232 -0
  6. package/dist/component/_generated/api.d.ts.map +1 -0
  7. package/dist/component/_generated/api.js +30 -0
  8. package/dist/component/_generated/component.d.ts +245 -0
  9. package/dist/component/_generated/component.d.ts.map +1 -0
  10. package/dist/component/_generated/component.js +9 -0
  11. package/dist/component/_generated/dataModel.d.ts +46 -0
  12. package/dist/component/_generated/dataModel.d.ts.map +1 -0
  13. package/dist/component/_generated/dataModel.js +10 -0
  14. package/dist/component/_generated/server.d.ts +121 -0
  15. package/dist/component/_generated/server.d.ts.map +1 -0
  16. package/dist/component/_generated/server.js +77 -0
  17. package/dist/component/actions.d.ts +159 -0
  18. package/dist/component/actions.d.ts.map +1 -0
  19. package/dist/component/actions.js +468 -0
  20. package/dist/component/aggregates.d.ts +42 -0
  21. package/dist/component/aggregates.d.ts.map +1 -0
  22. package/dist/component/aggregates.js +54 -0
  23. package/dist/component/convex.config.d.ts +3 -0
  24. package/dist/component/convex.config.d.ts.map +1 -0
  25. package/dist/component/convex.config.js +5 -0
  26. package/dist/component/helpers.d.ts +16 -0
  27. package/dist/component/helpers.d.ts.map +1 -0
  28. package/dist/component/helpers.js +98 -0
  29. package/dist/component/http.d.ts +3 -0
  30. package/dist/component/http.d.ts.map +1 -0
  31. package/dist/component/http.js +208 -0
  32. package/dist/component/mutations.d.ts +55 -0
  33. package/dist/component/mutations.d.ts.map +1 -0
  34. package/dist/component/mutations.js +167 -0
  35. package/dist/component/queries.d.ts +171 -0
  36. package/dist/component/queries.d.ts.map +1 -0
  37. package/dist/component/queries.js +516 -0
  38. package/dist/component/schema.d.ts +63 -0
  39. package/dist/component/schema.d.ts.map +1 -0
  40. package/dist/component/schema.js +16 -0
  41. package/dist/component/tables/contacts.d.ts +16 -0
  42. package/dist/component/tables/contacts.d.ts.map +1 -0
  43. package/dist/component/tables/contacts.js +16 -0
  44. package/dist/component/tables/emailOperations.d.ts +17 -0
  45. package/dist/component/tables/emailOperations.d.ts.map +1 -0
  46. package/dist/component/tables/emailOperations.js +17 -0
  47. package/dist/component/validators.d.ts +338 -0
  48. package/dist/component/validators.d.ts.map +1 -0
  49. package/dist/component/validators.js +167 -0
  50. package/dist/test.d.ts +78 -0
  51. package/dist/test.d.ts.map +1 -0
  52. package/dist/test.js +16 -0
  53. package/dist/types.d.ts +39 -0
  54. package/dist/types.d.ts.map +1 -0
  55. package/dist/types.js +0 -0
  56. package/package.json +112 -0
  57. package/src/client/index.ts +618 -0
  58. package/src/component/_generated/api.ts +253 -0
  59. package/src/component/_generated/component.ts +291 -0
  60. package/src/component/_generated/dataModel.ts +60 -0
  61. package/src/component/_generated/server.ts +161 -0
  62. package/src/component/actions.ts +556 -0
  63. package/src/component/aggregates.ts +89 -0
  64. package/src/component/convex.config.ts +8 -0
  65. package/src/component/helpers.ts +130 -0
  66. package/src/component/http.ts +236 -0
  67. package/src/component/mutations.ts +192 -0
  68. package/src/component/queries.ts +604 -0
  69. package/src/component/schema.ts +17 -0
  70. package/src/component/tables/contacts.ts +17 -0
  71. package/src/component/tables/emailOperations.ts +23 -0
  72. package/src/component/validators.ts +197 -0
  73. package/src/test.ts +27 -0
  74. package/src/types.ts +62 -0
@@ -0,0 +1,63 @@
1
+ declare const _default: import("convex/server").SchemaDefinition<{
2
+ contacts: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
+ firstName?: string | undefined;
4
+ lastName?: string | undefined;
5
+ userId?: string | undefined;
6
+ source?: string | undefined;
7
+ subscribed?: boolean | undefined;
8
+ userGroup?: string | undefined;
9
+ loopsContactId?: string | undefined;
10
+ email: string;
11
+ createdAt: number;
12
+ updatedAt: number;
13
+ }, {
14
+ email: import("convex/values").VString<string, "required">;
15
+ firstName: import("convex/values").VString<string | undefined, "optional">;
16
+ lastName: import("convex/values").VString<string | undefined, "optional">;
17
+ userId: import("convex/values").VString<string | undefined, "optional">;
18
+ source: import("convex/values").VString<string | undefined, "optional">;
19
+ subscribed: import("convex/values").VBoolean<boolean | undefined, "optional">;
20
+ userGroup: import("convex/values").VString<string | undefined, "optional">;
21
+ loopsContactId: import("convex/values").VString<string | undefined, "optional">;
22
+ createdAt: import("convex/values").VFloat64<number, "required">;
23
+ updatedAt: import("convex/values").VFloat64<number, "required">;
24
+ }, "required", "email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "loopsContactId" | "createdAt" | "updatedAt">, {
25
+ email: ["email", "_creationTime"];
26
+ userId: ["userId", "_creationTime"];
27
+ userGroup: ["userGroup", "_creationTime"];
28
+ source: ["source", "_creationTime"];
29
+ subscribed: ["subscribed", "_creationTime"];
30
+ }, {}, {}>;
31
+ emailOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
32
+ actorId?: string | undefined;
33
+ transactionalId?: string | undefined;
34
+ campaignId?: string | undefined;
35
+ loopId?: string | undefined;
36
+ eventName?: string | undefined;
37
+ messageId?: string | undefined;
38
+ metadata?: Record<string, any> | undefined;
39
+ email: string;
40
+ operationType: "transactional" | "event" | "campaign" | "loop";
41
+ timestamp: number;
42
+ success: boolean;
43
+ }, {
44
+ operationType: import("convex/values").VUnion<"transactional" | "event" | "campaign" | "loop", [import("convex/values").VLiteral<"transactional", "required">, import("convex/values").VLiteral<"event", "required">, import("convex/values").VLiteral<"campaign", "required">, import("convex/values").VLiteral<"loop", "required">], "required", never>;
45
+ email: import("convex/values").VString<string, "required">;
46
+ actorId: import("convex/values").VString<string | undefined, "optional">;
47
+ transactionalId: import("convex/values").VString<string | undefined, "optional">;
48
+ campaignId: import("convex/values").VString<string | undefined, "optional">;
49
+ loopId: import("convex/values").VString<string | undefined, "optional">;
50
+ eventName: import("convex/values").VString<string | undefined, "optional">;
51
+ timestamp: import("convex/values").VFloat64<number, "required">;
52
+ success: import("convex/values").VBoolean<boolean, "required">;
53
+ messageId: import("convex/values").VString<string | undefined, "optional">;
54
+ metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
55
+ }, "required", "email" | "operationType" | "actorId" | "transactionalId" | "campaignId" | "loopId" | "eventName" | "timestamp" | "success" | "messageId" | "metadata" | `metadata.${string}`>, {
56
+ email: ["email", "timestamp", "_creationTime"];
57
+ actorId: ["actorId", "timestamp", "_creationTime"];
58
+ operationType: ["operationType", "timestamp", "_creationTime"];
59
+ timestamp: ["timestamp", "_creationTime"];
60
+ }, {}, {}>;
61
+ }, true>;
62
+ export default _default;
63
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAYG"}
@@ -0,0 +1,16 @@
1
+ import { defineSchema, defineTable } from "convex/server";
2
+ import { contactsFields } from "./tables/contacts";
3
+ import { emailOperationsFields } from "./tables/emailOperations";
4
+ export default defineSchema({
5
+ contacts: defineTable(contactsFields)
6
+ .index("email", ["email"])
7
+ .index("userId", ["userId"])
8
+ .index("userGroup", ["userGroup"])
9
+ .index("source", ["source"])
10
+ .index("subscribed", ["subscribed"]),
11
+ emailOperations: defineTable(emailOperationsFields)
12
+ .index("email", ["email", "timestamp"])
13
+ .index("actorId", ["actorId", "timestamp"])
14
+ .index("operationType", ["operationType", "timestamp"])
15
+ .index("timestamp", ["timestamp"]),
16
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Contacts table field definitions
3
+ */
4
+ export declare const contactsFields: {
5
+ email: import("convex/values").VString<string, "required">;
6
+ firstName: import("convex/values").VString<string | undefined, "optional">;
7
+ lastName: import("convex/values").VString<string | undefined, "optional">;
8
+ userId: import("convex/values").VString<string | undefined, "optional">;
9
+ source: import("convex/values").VString<string | undefined, "optional">;
10
+ subscribed: import("convex/values").VBoolean<boolean | undefined, "optional">;
11
+ userGroup: import("convex/values").VString<string | undefined, "optional">;
12
+ loopsContactId: import("convex/values").VString<string | undefined, "optional">;
13
+ createdAt: import("convex/values").VFloat64<number, "required">;
14
+ updatedAt: import("convex/values").VFloat64<number, "required">;
15
+ };
16
+ //# sourceMappingURL=contacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../../src/component/tables/contacts.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAW1B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { v } from "convex/values";
2
+ /**
3
+ * Contacts table field definitions
4
+ */
5
+ export const contactsFields = {
6
+ email: v.string(),
7
+ firstName: v.optional(v.string()),
8
+ lastName: v.optional(v.string()),
9
+ userId: v.optional(v.string()),
10
+ source: v.optional(v.string()),
11
+ subscribed: v.optional(v.boolean()),
12
+ userGroup: v.optional(v.string()),
13
+ loopsContactId: v.optional(v.string()),
14
+ createdAt: v.number(),
15
+ updatedAt: v.number(),
16
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Email operations table field definitions
3
+ */
4
+ export declare const emailOperationsFields: {
5
+ operationType: import("convex/values").VUnion<"transactional" | "event" | "campaign" | "loop", [import("convex/values").VLiteral<"transactional", "required">, import("convex/values").VLiteral<"event", "required">, import("convex/values").VLiteral<"campaign", "required">, import("convex/values").VLiteral<"loop", "required">], "required", never>;
6
+ email: import("convex/values").VString<string, "required">;
7
+ actorId: import("convex/values").VString<string | undefined, "optional">;
8
+ transactionalId: import("convex/values").VString<string | undefined, "optional">;
9
+ campaignId: import("convex/values").VString<string | undefined, "optional">;
10
+ loopId: import("convex/values").VString<string | undefined, "optional">;
11
+ eventName: import("convex/values").VString<string | undefined, "optional">;
12
+ timestamp: import("convex/values").VFloat64<number, "required">;
13
+ success: import("convex/values").VBoolean<boolean, "required">;
14
+ messageId: import("convex/values").VString<string | undefined, "optional">;
15
+ metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
16
+ };
17
+ //# sourceMappingURL=emailOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emailOperations.d.ts","sourceRoot":"","sources":["../../../src/component/tables/emailOperations.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CAiBjC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { v } from "convex/values";
2
+ /**
3
+ * Email operations table field definitions
4
+ */
5
+ export const emailOperationsFields = {
6
+ operationType: v.union(v.literal("transactional"), v.literal("event"), v.literal("campaign"), v.literal("loop")),
7
+ email: v.string(),
8
+ actorId: v.optional(v.string()),
9
+ transactionalId: v.optional(v.string()),
10
+ campaignId: v.optional(v.string()),
11
+ loopId: v.optional(v.string()),
12
+ eventName: v.optional(v.string()),
13
+ timestamp: v.number(),
14
+ success: v.boolean(),
15
+ messageId: v.optional(v.string()),
16
+ metadata: v.optional(v.record(v.string(), v.any())),
17
+ };
@@ -0,0 +1,338 @@
1
+ /**
2
+ * Validators for Loops API requests and component operations
3
+ */
4
+ /**
5
+ * Validator for contact data
6
+ * Used for creating and updating contacts
7
+ */
8
+ export declare const contactValidator: import("convex/values").VObject<{
9
+ firstName?: string | undefined;
10
+ lastName?: string | undefined;
11
+ userId?: string | undefined;
12
+ source?: string | undefined;
13
+ subscribed?: boolean | undefined;
14
+ userGroup?: string | undefined;
15
+ email: string;
16
+ }, {
17
+ email: import("convex/values").VString<string, "required">;
18
+ firstName: import("convex/values").VString<string | undefined, "optional">;
19
+ lastName: import("convex/values").VString<string | undefined, "optional">;
20
+ userId: import("convex/values").VString<string | undefined, "optional">;
21
+ source: import("convex/values").VString<string | undefined, "optional">;
22
+ subscribed: import("convex/values").VBoolean<boolean | undefined, "optional">;
23
+ userGroup: import("convex/values").VString<string | undefined, "optional">;
24
+ }, "required", "email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup">;
25
+ /**
26
+ * Validator for transactional email requests
27
+ */
28
+ export declare const transactionalEmailValidator: import("convex/values").VObject<{
29
+ transactionalId?: string | undefined;
30
+ dataVariables?: Record<string, any> | undefined;
31
+ idempotencyKey?: string | undefined;
32
+ email: string;
33
+ }, {
34
+ transactionalId: import("convex/values").VString<string | undefined, "optional">;
35
+ email: import("convex/values").VString<string, "required">;
36
+ dataVariables: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
37
+ idempotencyKey: import("convex/values").VString<string | undefined, "optional">;
38
+ }, "required", "email" | "transactionalId" | "dataVariables" | "idempotencyKey" | `dataVariables.${string}`>;
39
+ /**
40
+ * Validator for event requests
41
+ * Used for sending events that trigger email workflows
42
+ */
43
+ export declare const eventValidator: import("convex/values").VObject<{
44
+ eventProperties?: Record<string, any> | undefined;
45
+ email: string;
46
+ eventName: string;
47
+ }, {
48
+ email: import("convex/values").VString<string, "required">;
49
+ eventName: import("convex/values").VString<string, "required">;
50
+ eventProperties: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
51
+ }, "required", "email" | "eventName" | "eventProperties" | `eventProperties.${string}`>;
52
+ /**
53
+ * Validator for operation type enum
54
+ */
55
+ export declare const operationTypeValidator: import("convex/values").VUnion<"transactional" | "event" | "campaign" | "loop", [import("convex/values").VLiteral<"transactional", "required">, import("convex/values").VLiteral<"event", "required">, import("convex/values").VLiteral<"campaign", "required">, import("convex/values").VLiteral<"loop", "required">], "required", never>;
56
+ /**
57
+ * Common return validators used across functions
58
+ */
59
+ export declare const successResponseValidator: import("convex/values").VObject<{
60
+ success: boolean;
61
+ }, {
62
+ success: import("convex/values").VBoolean<boolean, "required">;
63
+ }, "required", "success">;
64
+ export declare const successWithIdResponseValidator: import("convex/values").VObject<{
65
+ id?: string | undefined;
66
+ success: boolean;
67
+ }, {
68
+ success: import("convex/values").VBoolean<boolean, "required">;
69
+ id: import("convex/values").VString<string | undefined, "optional">;
70
+ }, "required", "id" | "success">;
71
+ export declare const successWithMessageIdResponseValidator: import("convex/values").VObject<{
72
+ messageId?: string | undefined;
73
+ success: boolean;
74
+ }, {
75
+ success: import("convex/values").VBoolean<boolean, "required">;
76
+ messageId: import("convex/values").VString<string | undefined, "optional">;
77
+ }, "required", "success" | "messageId">;
78
+ export declare const successWithWarningResponseValidator: import("convex/values").VObject<{
79
+ warning?: string | undefined;
80
+ success: boolean;
81
+ }, {
82
+ success: import("convex/values").VBoolean<boolean, "required">;
83
+ warning: import("convex/values").VString<string | undefined, "optional">;
84
+ }, "required", "success" | "warning">;
85
+ /**
86
+ * Contact document validator for query returns
87
+ */
88
+ export declare const contactDocValidator: import("convex/values").VObject<{
89
+ firstName?: string | undefined;
90
+ lastName?: string | undefined;
91
+ userId?: string | undefined;
92
+ source?: string | undefined;
93
+ userGroup?: string | undefined;
94
+ loopsContactId?: string | undefined;
95
+ email: string;
96
+ subscribed: boolean;
97
+ createdAt: number;
98
+ updatedAt: number;
99
+ _id: string;
100
+ }, {
101
+ _id: import("convex/values").VString<string, "required">;
102
+ email: import("convex/values").VString<string, "required">;
103
+ firstName: import("convex/values").VString<string | undefined, "optional">;
104
+ lastName: import("convex/values").VString<string | undefined, "optional">;
105
+ userId: import("convex/values").VString<string | undefined, "optional">;
106
+ source: import("convex/values").VString<string | undefined, "optional">;
107
+ subscribed: import("convex/values").VBoolean<boolean, "required">;
108
+ userGroup: import("convex/values").VString<string | undefined, "optional">;
109
+ loopsContactId: import("convex/values").VString<string | undefined, "optional">;
110
+ createdAt: import("convex/values").VFloat64<number, "required">;
111
+ updatedAt: import("convex/values").VFloat64<number, "required">;
112
+ }, "required", "email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "loopsContactId" | "createdAt" | "updatedAt" | "_id">;
113
+ /**
114
+ * Paginated contacts response validator
115
+ */
116
+ export declare const paginatedContactsResponseValidator: import("convex/values").VObject<{
117
+ contacts: {
118
+ firstName?: string | undefined;
119
+ lastName?: string | undefined;
120
+ userId?: string | undefined;
121
+ source?: string | undefined;
122
+ userGroup?: string | undefined;
123
+ loopsContactId?: string | undefined;
124
+ email: string;
125
+ subscribed: boolean;
126
+ createdAt: number;
127
+ updatedAt: number;
128
+ _id: string;
129
+ }[];
130
+ continueCursor: string | null;
131
+ isDone: boolean;
132
+ }, {
133
+ contacts: import("convex/values").VArray<{
134
+ firstName?: string | undefined;
135
+ lastName?: string | undefined;
136
+ userId?: string | undefined;
137
+ source?: string | undefined;
138
+ userGroup?: string | undefined;
139
+ loopsContactId?: string | undefined;
140
+ email: string;
141
+ subscribed: boolean;
142
+ createdAt: number;
143
+ updatedAt: number;
144
+ _id: string;
145
+ }[], import("convex/values").VObject<{
146
+ firstName?: string | undefined;
147
+ lastName?: string | undefined;
148
+ userId?: string | undefined;
149
+ source?: string | undefined;
150
+ userGroup?: string | undefined;
151
+ loopsContactId?: string | undefined;
152
+ email: string;
153
+ subscribed: boolean;
154
+ createdAt: number;
155
+ updatedAt: number;
156
+ _id: string;
157
+ }, {
158
+ _id: import("convex/values").VString<string, "required">;
159
+ email: import("convex/values").VString<string, "required">;
160
+ firstName: import("convex/values").VString<string | undefined, "optional">;
161
+ lastName: import("convex/values").VString<string | undefined, "optional">;
162
+ userId: import("convex/values").VString<string | undefined, "optional">;
163
+ source: import("convex/values").VString<string | undefined, "optional">;
164
+ subscribed: import("convex/values").VBoolean<boolean, "required">;
165
+ userGroup: import("convex/values").VString<string | undefined, "optional">;
166
+ loopsContactId: import("convex/values").VString<string | undefined, "optional">;
167
+ createdAt: import("convex/values").VFloat64<number, "required">;
168
+ updatedAt: import("convex/values").VFloat64<number, "required">;
169
+ }, "required", "email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "loopsContactId" | "createdAt" | "updatedAt" | "_id">, "required">;
170
+ continueCursor: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
171
+ isDone: import("convex/values").VBoolean<boolean, "required">;
172
+ }, "required", "contacts" | "continueCursor" | "isDone">;
173
+ /**
174
+ * Rate limit response validator
175
+ */
176
+ export declare const rateLimitResponseValidator: import("convex/values").VObject<{
177
+ retryAfter?: number | undefined;
178
+ timeWindowMs: number;
179
+ limit: number;
180
+ count: number;
181
+ allowed: boolean;
182
+ }, {
183
+ allowed: import("convex/values").VBoolean<boolean, "required">;
184
+ count: import("convex/values").VFloat64<number, "required">;
185
+ limit: import("convex/values").VFloat64<number, "required">;
186
+ timeWindowMs: import("convex/values").VFloat64<number, "required">;
187
+ retryAfter: import("convex/values").VFloat64<number | undefined, "optional">;
188
+ }, "required", "timeWindowMs" | "limit" | "count" | "allowed" | "retryAfter">;
189
+ /**
190
+ * Email stats response validator
191
+ */
192
+ export declare const emailStatsResponseValidator: import("convex/values").VObject<{
193
+ totalOperations: number;
194
+ successfulOperations: number;
195
+ failedOperations: number;
196
+ operationsByType: Record<string, number>;
197
+ uniqueRecipients: number;
198
+ uniqueActors: number;
199
+ }, {
200
+ totalOperations: import("convex/values").VFloat64<number, "required">;
201
+ successfulOperations: import("convex/values").VFloat64<number, "required">;
202
+ failedOperations: import("convex/values").VFloat64<number, "required">;
203
+ operationsByType: import("convex/values").VRecord<Record<string, number>, import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, "required", string>;
204
+ uniqueRecipients: import("convex/values").VFloat64<number, "required">;
205
+ uniqueActors: import("convex/values").VFloat64<number, "required">;
206
+ }, "required", "totalOperations" | "successfulOperations" | "failedOperations" | "operationsByType" | "uniqueRecipients" | "uniqueActors" | `operationsByType.${string}`>;
207
+ /**
208
+ * Spam detection validators
209
+ */
210
+ export declare const recipientSpamValidator: import("convex/values").VObject<{
211
+ email: string;
212
+ timeWindowMs: number;
213
+ count: number;
214
+ }, {
215
+ email: import("convex/values").VString<string, "required">;
216
+ count: import("convex/values").VFloat64<number, "required">;
217
+ timeWindowMs: import("convex/values").VFloat64<number, "required">;
218
+ }, "required", "email" | "timeWindowMs" | "count">;
219
+ export declare const actorSpamValidator: import("convex/values").VObject<{
220
+ actorId: string;
221
+ timeWindowMs: number;
222
+ count: number;
223
+ }, {
224
+ actorId: import("convex/values").VString<string, "required">;
225
+ count: import("convex/values").VFloat64<number, "required">;
226
+ timeWindowMs: import("convex/values").VFloat64<number, "required">;
227
+ }, "required", "actorId" | "timeWindowMs" | "count">;
228
+ export declare const rapidFirePatternValidator: import("convex/values").VObject<{
229
+ email?: string | undefined;
230
+ actorId?: string | undefined;
231
+ timeWindowMs: number;
232
+ count: number;
233
+ firstTimestamp: number;
234
+ lastTimestamp: number;
235
+ }, {
236
+ email: import("convex/values").VString<string | undefined, "optional">;
237
+ actorId: import("convex/values").VString<string | undefined, "optional">;
238
+ count: import("convex/values").VFloat64<number, "required">;
239
+ timeWindowMs: import("convex/values").VFloat64<number, "required">;
240
+ firstTimestamp: import("convex/values").VFloat64<number, "required">;
241
+ lastTimestamp: import("convex/values").VFloat64<number, "required">;
242
+ }, "required", "email" | "actorId" | "timeWindowMs" | "count" | "firstTimestamp" | "lastTimestamp">;
243
+ /**
244
+ * Batch create response validator
245
+ */
246
+ export declare const batchCreateResponseValidator: import("convex/values").VObject<{
247
+ created?: number | undefined;
248
+ failed?: number | undefined;
249
+ results?: {
250
+ error?: string | undefined;
251
+ email: string;
252
+ success: boolean;
253
+ }[] | undefined;
254
+ success: boolean;
255
+ }, {
256
+ success: import("convex/values").VBoolean<boolean, "required">;
257
+ created: import("convex/values").VFloat64<number | undefined, "optional">;
258
+ failed: import("convex/values").VFloat64<number | undefined, "optional">;
259
+ results: import("convex/values").VArray<{
260
+ error?: string | undefined;
261
+ email: string;
262
+ success: boolean;
263
+ }[] | undefined, import("convex/values").VObject<{
264
+ error?: string | undefined;
265
+ email: string;
266
+ success: boolean;
267
+ }, {
268
+ email: import("convex/values").VString<string, "required">;
269
+ success: import("convex/values").VBoolean<boolean, "required">;
270
+ error: import("convex/values").VString<string | undefined, "optional">;
271
+ }, "required", "email" | "success" | "error">, "optional">;
272
+ }, "required", "success" | "created" | "failed" | "results">;
273
+ /**
274
+ * Find contact response validator
275
+ * Note: Loops API returns additional fields beyond our contact model
276
+ */
277
+ export declare const findContactResponseValidator: import("convex/values").VObject<{
278
+ contact?: {
279
+ id?: string | null | undefined;
280
+ email?: string | null | undefined;
281
+ firstName?: string | null | undefined;
282
+ lastName?: string | null | undefined;
283
+ userId?: string | null | undefined;
284
+ source?: string | null | undefined;
285
+ subscribed?: boolean | null | undefined;
286
+ userGroup?: string | null | undefined;
287
+ createdAt?: string | null | undefined;
288
+ timestamp?: string | null | undefined;
289
+ dataVariables?: any;
290
+ audienceId?: string | null | undefined;
291
+ mailingLists?: any;
292
+ } | undefined;
293
+ success: boolean;
294
+ }, {
295
+ success: import("convex/values").VBoolean<boolean, "required">;
296
+ contact: import("convex/values").VObject<{
297
+ id?: string | null | undefined;
298
+ email?: string | null | undefined;
299
+ firstName?: string | null | undefined;
300
+ lastName?: string | null | undefined;
301
+ userId?: string | null | undefined;
302
+ source?: string | null | undefined;
303
+ subscribed?: boolean | null | undefined;
304
+ userGroup?: string | null | undefined;
305
+ createdAt?: string | null | undefined;
306
+ timestamp?: string | null | undefined;
307
+ dataVariables?: any;
308
+ audienceId?: string | null | undefined;
309
+ mailingLists?: any;
310
+ } | undefined, {
311
+ id: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
312
+ email: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
313
+ firstName: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
314
+ lastName: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
315
+ source: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
316
+ subscribed: import("convex/values").VUnion<boolean | null | undefined, [import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
317
+ userGroup: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
318
+ userId: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
319
+ createdAt: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
320
+ audienceId: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
321
+ timestamp: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
322
+ dataVariables: import("convex/values").VAny<any, "optional", string>;
323
+ mailingLists: import("convex/values").VAny<any, "optional", string>;
324
+ }, "optional", "id" | "email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "createdAt" | "timestamp" | "dataVariables" | "audienceId" | "mailingLists" | `dataVariables.${string}` | `mailingLists.${string}`>;
325
+ }, "required", "success" | "contact" | "contact.id" | "contact.email" | "contact.firstName" | "contact.lastName" | "contact.userId" | "contact.source" | "contact.subscribed" | "contact.userGroup" | "contact.createdAt" | "contact.timestamp" | "contact.dataVariables" | "contact.audienceId" | "contact.mailingLists" | `contact.dataVariables.${string}` | `contact.mailingLists.${string}`>;
326
+ /**
327
+ * Backfill response validator
328
+ */
329
+ export declare const backfillResponseValidator: import("convex/values").VObject<{
330
+ cursor: string | null;
331
+ isDone: boolean;
332
+ processed: number;
333
+ }, {
334
+ processed: import("convex/values").VFloat64<number, "required">;
335
+ cursor: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
336
+ isDone: import("convex/values").VBoolean<boolean, "required">;
337
+ }, "required", "cursor" | "isDone" | "processed">;
338
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/component/validators.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;qGAQ3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;4GAKtC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;uFAIzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB,4UAKlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;yBAEnC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;gCAGzC,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;uCAGhD,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;qCAG9C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;4JAY9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAI7C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;6EAMrC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;yKAOtC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;kDAIjC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;oDAI7B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;mGAOpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;4DAavC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iYAoBvC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;iDAIpC,CAAC"}