@christian-ek/sweego 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/README.md +357 -0
- package/dist/client/_generated/_ignore.d.ts +1 -0
- package/dist/client/_generated/_ignore.d.ts.map +1 -0
- package/dist/client/_generated/_ignore.js +3 -0
- package/dist/client/_generated/_ignore.js.map +1 -0
- package/dist/client/index.d.ts +282 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +265 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/webhook.d.ts +42 -0
- package/dist/client/webhook.d.ts.map +1 -0
- package/dist/client/webhook.js +89 -0
- package/dist/client/webhook.js.map +1 -0
- package/dist/component/_generated/api.d.ts +43 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +226 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +10 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/lib.d.ts +319 -0
- package/dist/component/lib.d.ts.map +1 -0
- package/dist/component/lib.js +725 -0
- package/dist/component/lib.js.map +1 -0
- package/dist/component/schema.d.ts +259 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +99 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/shared.d.ts +280 -0
- package/dist/component/shared.d.ts.map +1 -0
- package/dist/component/shared.js +213 -0
- package/dist/component/shared.js.map +1 -0
- package/dist/component/sweego.d.ts +95 -0
- package/dist/component/sweego.d.ts.map +1 -0
- package/dist/component/sweego.js +210 -0
- package/dist/component/sweego.js.map +1 -0
- package/dist/component/utils.d.ts +16 -0
- package/dist/component/utils.d.ts.map +1 -0
- package/dist/component/utils.js +29 -0
- package/dist/component/utils.js.map +1 -0
- package/package.json +100 -0
- package/src/client/_generated/_ignore.ts +1 -0
- package/src/client/index.ts +490 -0
- package/src/client/webhook.test.ts +146 -0
- package/src/client/webhook.ts +130 -0
- package/src/component/_generated/api.ts +59 -0
- package/src/component/_generated/component.ts +244 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/convex.config.ts +12 -0
- package/src/component/lib.test.ts +189 -0
- package/src/component/lib.ts +835 -0
- package/src/component/schema.ts +117 -0
- package/src/component/shared.test.ts +64 -0
- package/src/component/shared.ts +315 -0
- package/src/component/sweego.test.ts +141 -0
- package/src/component/sweego.ts +310 -0
- package/src/component/utils.ts +35 -0
- package/src/test.ts +20 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
export declare const enqueueMessage: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
+
message: {
|
|
3
|
+
variables?: Record<string, string | number | boolean> | undefined;
|
|
4
|
+
emailRecipients?: {
|
|
5
|
+
name?: string | undefined;
|
|
6
|
+
variables?: Record<string, string | number | boolean> | undefined;
|
|
7
|
+
email: string;
|
|
8
|
+
}[] | undefined;
|
|
9
|
+
smsRecipients?: {
|
|
10
|
+
num: string;
|
|
11
|
+
region: string;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
from?: {
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
email: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
subject?: string | undefined;
|
|
18
|
+
cc?: {
|
|
19
|
+
name?: string | undefined;
|
|
20
|
+
email: string;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
bcc?: {
|
|
23
|
+
name?: string | undefined;
|
|
24
|
+
email: string;
|
|
25
|
+
}[] | undefined;
|
|
26
|
+
replyTo?: {
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
email: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
html?: string | undefined;
|
|
31
|
+
text?: string | undefined;
|
|
32
|
+
templateId?: string | undefined;
|
|
33
|
+
attachments?: {
|
|
34
|
+
contentId?: string | undefined;
|
|
35
|
+
disposition?: "attachment" | "inline" | undefined;
|
|
36
|
+
isRelated?: boolean | undefined;
|
|
37
|
+
content: string;
|
|
38
|
+
filename: string;
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
headers?: Record<string, string> | undefined;
|
|
41
|
+
listUnsub?: {
|
|
42
|
+
method?: "mailto" | "one-click" | undefined;
|
|
43
|
+
value: string;
|
|
44
|
+
} | undefined;
|
|
45
|
+
expires?: string | undefined;
|
|
46
|
+
campaignId?: string | undefined;
|
|
47
|
+
campaignTags?: string[] | undefined;
|
|
48
|
+
campaignType?: string | undefined;
|
|
49
|
+
compressStyle?: boolean | undefined;
|
|
50
|
+
forceInlineStyle?: boolean | undefined;
|
|
51
|
+
dryRun?: boolean | undefined;
|
|
52
|
+
senderId?: string | undefined;
|
|
53
|
+
shortenUrls?: boolean | undefined;
|
|
54
|
+
shortenWithProtocol?: boolean | undefined;
|
|
55
|
+
bat?: boolean | undefined;
|
|
56
|
+
channel: "email" | "sms";
|
|
57
|
+
bulk: boolean;
|
|
58
|
+
};
|
|
59
|
+
options: {
|
|
60
|
+
onEvent?: {
|
|
61
|
+
fnHandle: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
apiKey: string;
|
|
64
|
+
provider: string;
|
|
65
|
+
initialBackoffMs: number;
|
|
66
|
+
retryAttempts: number;
|
|
67
|
+
testMode: boolean;
|
|
68
|
+
};
|
|
69
|
+
}, Promise<import("convex/values").GenericId<"messages">>>;
|
|
70
|
+
export declare const sendMessage: import("convex/server").RegisteredAction<"internal", {
|
|
71
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
72
|
+
options: {
|
|
73
|
+
onEvent?: {
|
|
74
|
+
fnHandle: string;
|
|
75
|
+
} | undefined;
|
|
76
|
+
apiKey: string;
|
|
77
|
+
provider: string;
|
|
78
|
+
initialBackoffMs: number;
|
|
79
|
+
retryAttempts: number;
|
|
80
|
+
testMode: boolean;
|
|
81
|
+
};
|
|
82
|
+
}, Promise<{
|
|
83
|
+
swgUids: Record<string, string>;
|
|
84
|
+
transactionId: string | undefined;
|
|
85
|
+
creditLeft: string | undefined;
|
|
86
|
+
channel: string | undefined;
|
|
87
|
+
provider: string | undefined;
|
|
88
|
+
} | null>>;
|
|
89
|
+
export declare const onSendComplete: import("convex/server").RegisteredMutation<"internal", import("@convex-dev/workpool").OnCompleteArgs, null>;
|
|
90
|
+
export declare const recordFailed: import("convex/server").RegisteredMutation<"internal", {
|
|
91
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
92
|
+
errorMessage: string;
|
|
93
|
+
}, Promise<void>>;
|
|
94
|
+
export declare const cancel: import("convex/server").RegisteredMutation<"public", {
|
|
95
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
96
|
+
}, Promise<boolean>>;
|
|
97
|
+
export declare const getMessage: import("convex/server").RegisteredQuery<"internal", {
|
|
98
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
99
|
+
}, Promise<{
|
|
100
|
+
_id: import("convex/values").GenericId<"messages">;
|
|
101
|
+
_creationTime: number;
|
|
102
|
+
variables?: Record<string, string | number | boolean> | undefined;
|
|
103
|
+
transactionId?: string | undefined;
|
|
104
|
+
emailRecipients?: {
|
|
105
|
+
name?: string | undefined;
|
|
106
|
+
variables?: Record<string, string | number | boolean> | undefined;
|
|
107
|
+
email: string;
|
|
108
|
+
}[] | undefined;
|
|
109
|
+
smsRecipients?: {
|
|
110
|
+
num: string;
|
|
111
|
+
region: string;
|
|
112
|
+
}[] | undefined;
|
|
113
|
+
from?: {
|
|
114
|
+
name?: string | undefined;
|
|
115
|
+
email: string;
|
|
116
|
+
} | undefined;
|
|
117
|
+
subject?: string | undefined;
|
|
118
|
+
cc?: {
|
|
119
|
+
name?: string | undefined;
|
|
120
|
+
email: string;
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
bcc?: {
|
|
123
|
+
name?: string | undefined;
|
|
124
|
+
email: string;
|
|
125
|
+
}[] | undefined;
|
|
126
|
+
replyTo?: {
|
|
127
|
+
name?: string | undefined;
|
|
128
|
+
email: string;
|
|
129
|
+
} | undefined;
|
|
130
|
+
html?: string | undefined;
|
|
131
|
+
text?: string | undefined;
|
|
132
|
+
templateId?: string | undefined;
|
|
133
|
+
attachments?: {
|
|
134
|
+
contentId?: string | undefined;
|
|
135
|
+
disposition?: "attachment" | "inline" | undefined;
|
|
136
|
+
isRelated?: boolean | undefined;
|
|
137
|
+
content: string;
|
|
138
|
+
filename: string;
|
|
139
|
+
}[] | undefined;
|
|
140
|
+
headers?: Record<string, string> | undefined;
|
|
141
|
+
listUnsub?: {
|
|
142
|
+
method?: "mailto" | "one-click" | undefined;
|
|
143
|
+
value: string;
|
|
144
|
+
} | undefined;
|
|
145
|
+
expires?: string | undefined;
|
|
146
|
+
campaignId?: string | undefined;
|
|
147
|
+
campaignTags?: string[] | undefined;
|
|
148
|
+
campaignType?: string | undefined;
|
|
149
|
+
compressStyle?: boolean | undefined;
|
|
150
|
+
forceInlineStyle?: boolean | undefined;
|
|
151
|
+
dryRun?: boolean | undefined;
|
|
152
|
+
senderId?: string | undefined;
|
|
153
|
+
shortenUrls?: boolean | undefined;
|
|
154
|
+
shortenWithProtocol?: boolean | undefined;
|
|
155
|
+
bat?: boolean | undefined;
|
|
156
|
+
errorMessage?: string | undefined;
|
|
157
|
+
creditLeft?: string | undefined;
|
|
158
|
+
channel: "email" | "sms";
|
|
159
|
+
provider: string;
|
|
160
|
+
bulk: boolean;
|
|
161
|
+
status: "sent" | "queued" | "failed" | "cancelled";
|
|
162
|
+
finalizedAt: number;
|
|
163
|
+
} | null>>;
|
|
164
|
+
export declare const getStatus: import("convex/server").RegisteredQuery<"public", {
|
|
165
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
166
|
+
}, Promise<{
|
|
167
|
+
status: "sent" | "queued" | "failed" | "cancelled";
|
|
168
|
+
channel: "email" | "sms";
|
|
169
|
+
transactionId: string | null;
|
|
170
|
+
errorMessage: string | null;
|
|
171
|
+
creditLeft: string | null;
|
|
172
|
+
deliveries: {
|
|
173
|
+
swgUid: string;
|
|
174
|
+
recipientKey: string;
|
|
175
|
+
channel: "email" | "sms";
|
|
176
|
+
status: "pending" | "sent" | "delivered" | "soft_bounced" | "bounced" | "undelivered" | "stopped";
|
|
177
|
+
lastEventType: string | null;
|
|
178
|
+
delivered: boolean;
|
|
179
|
+
bounced: boolean;
|
|
180
|
+
softBounced: boolean;
|
|
181
|
+
complained: boolean;
|
|
182
|
+
unsubscribed: boolean;
|
|
183
|
+
opened: boolean;
|
|
184
|
+
clicked: boolean;
|
|
185
|
+
stopped: boolean;
|
|
186
|
+
errorMessage: string | null;
|
|
187
|
+
}[];
|
|
188
|
+
} | null>>;
|
|
189
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
190
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
191
|
+
}, Promise<{
|
|
192
|
+
deliveries: {
|
|
193
|
+
swgUid: string;
|
|
194
|
+
recipientKey: string;
|
|
195
|
+
channel: "email" | "sms";
|
|
196
|
+
status: "pending" | "sent" | "delivered" | "soft_bounced" | "bounced" | "undelivered" | "stopped";
|
|
197
|
+
lastEventType: string | null;
|
|
198
|
+
delivered: boolean;
|
|
199
|
+
bounced: boolean;
|
|
200
|
+
softBounced: boolean;
|
|
201
|
+
complained: boolean;
|
|
202
|
+
unsubscribed: boolean;
|
|
203
|
+
opened: boolean;
|
|
204
|
+
clicked: boolean;
|
|
205
|
+
stopped: boolean;
|
|
206
|
+
errorMessage: string | null;
|
|
207
|
+
}[];
|
|
208
|
+
_id: import("convex/values").GenericId<"messages">;
|
|
209
|
+
_creationTime: number;
|
|
210
|
+
variables?: Record<string, string | number | boolean> | undefined;
|
|
211
|
+
transactionId?: string | undefined;
|
|
212
|
+
emailRecipients?: {
|
|
213
|
+
name?: string | undefined;
|
|
214
|
+
variables?: Record<string, string | number | boolean> | undefined;
|
|
215
|
+
email: string;
|
|
216
|
+
}[] | undefined;
|
|
217
|
+
smsRecipients?: {
|
|
218
|
+
num: string;
|
|
219
|
+
region: string;
|
|
220
|
+
}[] | undefined;
|
|
221
|
+
from?: {
|
|
222
|
+
name?: string | undefined;
|
|
223
|
+
email: string;
|
|
224
|
+
} | undefined;
|
|
225
|
+
subject?: string | undefined;
|
|
226
|
+
cc?: {
|
|
227
|
+
name?: string | undefined;
|
|
228
|
+
email: string;
|
|
229
|
+
}[] | undefined;
|
|
230
|
+
bcc?: {
|
|
231
|
+
name?: string | undefined;
|
|
232
|
+
email: string;
|
|
233
|
+
}[] | undefined;
|
|
234
|
+
replyTo?: {
|
|
235
|
+
name?: string | undefined;
|
|
236
|
+
email: string;
|
|
237
|
+
} | undefined;
|
|
238
|
+
html?: string | undefined;
|
|
239
|
+
text?: string | undefined;
|
|
240
|
+
templateId?: string | undefined;
|
|
241
|
+
attachments?: {
|
|
242
|
+
contentId?: string | undefined;
|
|
243
|
+
disposition?: "attachment" | "inline" | undefined;
|
|
244
|
+
isRelated?: boolean | undefined;
|
|
245
|
+
content: string;
|
|
246
|
+
filename: string;
|
|
247
|
+
}[] | undefined;
|
|
248
|
+
headers?: Record<string, string> | undefined;
|
|
249
|
+
listUnsub?: {
|
|
250
|
+
method?: "mailto" | "one-click" | undefined;
|
|
251
|
+
value: string;
|
|
252
|
+
} | undefined;
|
|
253
|
+
expires?: string | undefined;
|
|
254
|
+
campaignId?: string | undefined;
|
|
255
|
+
campaignTags?: string[] | undefined;
|
|
256
|
+
campaignType?: string | undefined;
|
|
257
|
+
compressStyle?: boolean | undefined;
|
|
258
|
+
forceInlineStyle?: boolean | undefined;
|
|
259
|
+
dryRun?: boolean | undefined;
|
|
260
|
+
senderId?: string | undefined;
|
|
261
|
+
shortenUrls?: boolean | undefined;
|
|
262
|
+
shortenWithProtocol?: boolean | undefined;
|
|
263
|
+
bat?: boolean | undefined;
|
|
264
|
+
errorMessage?: string | undefined;
|
|
265
|
+
creditLeft?: string | undefined;
|
|
266
|
+
channel: "email" | "sms";
|
|
267
|
+
provider: string;
|
|
268
|
+
bulk: boolean;
|
|
269
|
+
status: "sent" | "queued" | "failed" | "cancelled";
|
|
270
|
+
finalizedAt: number;
|
|
271
|
+
} | null>>;
|
|
272
|
+
export declare const handleEvent: import("convex/server").RegisteredMutation<"public", {
|
|
273
|
+
webhookId?: string | undefined;
|
|
274
|
+
event: any;
|
|
275
|
+
}, Promise<void>>;
|
|
276
|
+
export declare const estimateSms: import("convex/server").RegisteredAction<"public", {
|
|
277
|
+
apiKey: string;
|
|
278
|
+
body: any;
|
|
279
|
+
}, Promise<unknown>>;
|
|
280
|
+
export declare const applyLogStatus: import("convex/server").RegisteredMutation<"internal", {
|
|
281
|
+
deliveryId: import("convex/values").GenericId<"deliveries">;
|
|
282
|
+
remoteStatus: string;
|
|
283
|
+
}, Promise<void>>;
|
|
284
|
+
export declare const listDeliveries: import("convex/server").RegisteredQuery<"internal", {
|
|
285
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
286
|
+
}, Promise<{
|
|
287
|
+
_id: import("convex/values").GenericId<"deliveries">;
|
|
288
|
+
_creationTime: number;
|
|
289
|
+
errorMessage?: string | undefined;
|
|
290
|
+
lastEventType?: string | undefined;
|
|
291
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
292
|
+
delivered: boolean;
|
|
293
|
+
bounced: boolean;
|
|
294
|
+
stopped: boolean;
|
|
295
|
+
channel: "email" | "sms";
|
|
296
|
+
swgUid: string;
|
|
297
|
+
status: "pending" | "sent" | "delivered" | "soft_bounced" | "bounced" | "undelivered" | "stopped";
|
|
298
|
+
finalizedAt: number;
|
|
299
|
+
recipientKey: string;
|
|
300
|
+
softBounced: boolean;
|
|
301
|
+
complained: boolean;
|
|
302
|
+
unsubscribed: boolean;
|
|
303
|
+
opened: boolean;
|
|
304
|
+
clicked: boolean;
|
|
305
|
+
}[]>>;
|
|
306
|
+
export declare const refreshStatus: import("convex/server").RegisteredAction<"public", {
|
|
307
|
+
messageId: import("convex/values").GenericId<"messages">;
|
|
308
|
+
apiKey: string;
|
|
309
|
+
}, Promise<number>>;
|
|
310
|
+
export declare const cleanupOldMessages: import("convex/server").RegisteredMutation<"public", {
|
|
311
|
+
olderThan?: number | undefined;
|
|
312
|
+
}, Promise<void>>;
|
|
313
|
+
export declare const cleanupAbandonedMessages: import("convex/server").RegisteredMutation<"public", {
|
|
314
|
+
olderThan?: number | undefined;
|
|
315
|
+
}, Promise<void>>;
|
|
316
|
+
export declare const cleanupOldEvents: import("convex/server").RegisteredMutation<"public", {
|
|
317
|
+
olderThan?: number | undefined;
|
|
318
|
+
}, Promise<void>>;
|
|
319
|
+
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/component/lib.ts"],"names":[],"mappings":"AA2HA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA4FzB,CAAC;AAsBH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;UA+CtB,CAAC;AAEH,eAAO,MAAM,cAAc,6GA0BzB,CAAC;AAwEH,eAAO,MAAM,YAAY;;;iBAIvB,CAAC;AAOH,eAAO,MAAM,MAAM;;oBAajB,CAAC;AAMH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAGrB,CAAC;AAGH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;UAmBpB,CAAC;AAGH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoBd,CAAC;AA0FH,eAAO,MAAM,WAAW;;;iBA+EtB,CAAC;AAyBH,eAAO,MAAM,WAAW;;;oBAItB,CAAC;AAiBH,eAAO,MAAM,cAAc;;;iBA4BzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;KAOzB,CAAC;AAKH,eAAO,MAAM,aAAa;;;mBA2BxB,CAAC;AAqBH,eAAO,MAAM,kBAAkB;;iBAkB7B,CAAC;AAGH,eAAO,MAAM,wBAAwB;;iBAyBnC,CAAC;AAKH,eAAO,MAAM,gBAAgB;;iBAgB3B,CAAC"}
|