@devwithbobby/loops 0.1.18 → 0.1.19
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 +91 -96
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +13 -6
- package/dist/component/_generated/api.d.ts +44 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/{src → dist}/component/_generated/api.js +10 -3
- package/dist/component/_generated/component.d.ts +259 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +9 -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 +10 -0
- package/{src → dist}/component/_generated/server.d.ts +10 -38
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/{src → dist}/component/_generated/server.js +9 -22
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/convex.config.js +0 -22
- package/dist/component/helpers.d.ts +1 -1
- package/dist/component/helpers.d.ts.map +1 -1
- package/dist/component/helpers.js +1 -2
- package/dist/test.d.ts +83 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +16 -0
- package/package.json +15 -9
- package/src/client/index.ts +18 -13
- package/src/component/_generated/api.ts +60 -0
- package/src/component/_generated/component.ts +323 -0
- package/src/component/_generated/{dataModel.d.ts → dataModel.ts} +1 -1
- package/src/component/_generated/server.ts +161 -0
- package/src/component/convex.config.ts +0 -27
- package/src/component/helpers.ts +2 -2
- package/src/test.ts +27 -0
- package/src/component/_generated/api.d.ts +0 -47
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated `ComponentApi` utility.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { FunctionReference } from "convex/server";
|
|
10
|
+
/**
|
|
11
|
+
* A utility for referencing a Convex component's exposed API.
|
|
12
|
+
*
|
|
13
|
+
* Useful when expecting a parameter like `components.myComponent`.
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```ts
|
|
16
|
+
* async function myFunction(ctx: QueryCtx, component: ComponentApi) {
|
|
17
|
+
* return ctx.runQuery(component.someFile.someQuery, { ...args });
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
22
|
+
lib: {
|
|
23
|
+
addContact: FunctionReference<"action", "internal", {
|
|
24
|
+
apiKey: string;
|
|
25
|
+
contact: {
|
|
26
|
+
email: string;
|
|
27
|
+
firstName?: string;
|
|
28
|
+
lastName?: string;
|
|
29
|
+
source?: string;
|
|
30
|
+
subscribed?: boolean;
|
|
31
|
+
userGroup?: string;
|
|
32
|
+
userId?: string;
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
id?: string;
|
|
36
|
+
success: boolean;
|
|
37
|
+
}, Name>;
|
|
38
|
+
batchCreateContacts: FunctionReference<"action", "internal", {
|
|
39
|
+
apiKey: string;
|
|
40
|
+
contacts: Array<{
|
|
41
|
+
email: string;
|
|
42
|
+
firstName?: string;
|
|
43
|
+
lastName?: string;
|
|
44
|
+
source?: string;
|
|
45
|
+
subscribed?: boolean;
|
|
46
|
+
userGroup?: string;
|
|
47
|
+
userId?: string;
|
|
48
|
+
}>;
|
|
49
|
+
}, {
|
|
50
|
+
created?: number;
|
|
51
|
+
failed?: number;
|
|
52
|
+
results?: Array<{
|
|
53
|
+
email: string;
|
|
54
|
+
error?: string;
|
|
55
|
+
success: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
success: boolean;
|
|
58
|
+
}, Name>;
|
|
59
|
+
checkActorRateLimit: FunctionReference<"query", "internal", {
|
|
60
|
+
actorId: string;
|
|
61
|
+
maxEmails: number;
|
|
62
|
+
timeWindowMs: number;
|
|
63
|
+
}, {
|
|
64
|
+
allowed: boolean;
|
|
65
|
+
count: number;
|
|
66
|
+
limit: number;
|
|
67
|
+
retryAfter?: number;
|
|
68
|
+
timeWindowMs: number;
|
|
69
|
+
}, Name>;
|
|
70
|
+
checkGlobalRateLimit: FunctionReference<"query", "internal", {
|
|
71
|
+
maxEmails: number;
|
|
72
|
+
timeWindowMs: number;
|
|
73
|
+
}, {
|
|
74
|
+
allowed: boolean;
|
|
75
|
+
count: number;
|
|
76
|
+
limit: number;
|
|
77
|
+
timeWindowMs: number;
|
|
78
|
+
}, Name>;
|
|
79
|
+
checkRecipientRateLimit: FunctionReference<"query", "internal", {
|
|
80
|
+
email: string;
|
|
81
|
+
maxEmails: number;
|
|
82
|
+
timeWindowMs: number;
|
|
83
|
+
}, {
|
|
84
|
+
allowed: boolean;
|
|
85
|
+
count: number;
|
|
86
|
+
limit: number;
|
|
87
|
+
retryAfter?: number;
|
|
88
|
+
timeWindowMs: number;
|
|
89
|
+
}, Name>;
|
|
90
|
+
countContacts: FunctionReference<"query", "internal", {
|
|
91
|
+
source?: string;
|
|
92
|
+
subscribed?: boolean;
|
|
93
|
+
userGroup?: string;
|
|
94
|
+
}, number, Name>;
|
|
95
|
+
deleteContact: FunctionReference<"action", "internal", {
|
|
96
|
+
apiKey: string;
|
|
97
|
+
email: string;
|
|
98
|
+
}, {
|
|
99
|
+
success: boolean;
|
|
100
|
+
}, Name>;
|
|
101
|
+
detectActorSpam: FunctionReference<"query", "internal", {
|
|
102
|
+
maxEmailsPerActor?: number;
|
|
103
|
+
timeWindowMs?: number;
|
|
104
|
+
}, Array<{
|
|
105
|
+
actorId: string;
|
|
106
|
+
count: number;
|
|
107
|
+
timeWindowMs: number;
|
|
108
|
+
}>, Name>;
|
|
109
|
+
detectRapidFirePatterns: FunctionReference<"query", "internal", {
|
|
110
|
+
minEmailsInWindow?: number;
|
|
111
|
+
timeWindowMs?: number;
|
|
112
|
+
}, Array<{
|
|
113
|
+
actorId?: string;
|
|
114
|
+
count: number;
|
|
115
|
+
email?: string;
|
|
116
|
+
firstTimestamp: number;
|
|
117
|
+
lastTimestamp: number;
|
|
118
|
+
timeWindowMs: number;
|
|
119
|
+
}>, Name>;
|
|
120
|
+
detectRecipientSpam: FunctionReference<"query", "internal", {
|
|
121
|
+
maxEmailsPerRecipient?: number;
|
|
122
|
+
timeWindowMs?: number;
|
|
123
|
+
}, Array<{
|
|
124
|
+
count: number;
|
|
125
|
+
email: string;
|
|
126
|
+
timeWindowMs: number;
|
|
127
|
+
}>, Name>;
|
|
128
|
+
findContact: FunctionReference<"action", "internal", {
|
|
129
|
+
apiKey: string;
|
|
130
|
+
email: string;
|
|
131
|
+
}, {
|
|
132
|
+
contact?: {
|
|
133
|
+
createdAt?: string | null;
|
|
134
|
+
email?: string | null;
|
|
135
|
+
firstName?: string | null;
|
|
136
|
+
id?: string | null;
|
|
137
|
+
lastName?: string | null;
|
|
138
|
+
source?: string | null;
|
|
139
|
+
subscribed?: boolean | null;
|
|
140
|
+
userGroup?: string | null;
|
|
141
|
+
userId?: string | null;
|
|
142
|
+
};
|
|
143
|
+
success: boolean;
|
|
144
|
+
}, Name>;
|
|
145
|
+
getEmailStats: FunctionReference<"query", "internal", {
|
|
146
|
+
timeWindowMs?: number;
|
|
147
|
+
}, {
|
|
148
|
+
failedOperations: number;
|
|
149
|
+
operationsByType: Record<string, number>;
|
|
150
|
+
successfulOperations: number;
|
|
151
|
+
totalOperations: number;
|
|
152
|
+
uniqueActors: number;
|
|
153
|
+
uniqueRecipients: number;
|
|
154
|
+
}, Name>;
|
|
155
|
+
listContacts: FunctionReference<"query", "internal", {
|
|
156
|
+
limit?: number;
|
|
157
|
+
offset?: number;
|
|
158
|
+
source?: string;
|
|
159
|
+
subscribed?: boolean;
|
|
160
|
+
userGroup?: string;
|
|
161
|
+
}, {
|
|
162
|
+
contacts: Array<{
|
|
163
|
+
_id: string;
|
|
164
|
+
createdAt: number;
|
|
165
|
+
email: string;
|
|
166
|
+
firstName?: string;
|
|
167
|
+
lastName?: string;
|
|
168
|
+
loopsContactId?: string;
|
|
169
|
+
source?: string;
|
|
170
|
+
subscribed: boolean;
|
|
171
|
+
updatedAt: number;
|
|
172
|
+
userGroup?: string;
|
|
173
|
+
userId?: string;
|
|
174
|
+
}>;
|
|
175
|
+
hasMore: boolean;
|
|
176
|
+
limit: number;
|
|
177
|
+
offset: number;
|
|
178
|
+
total: number;
|
|
179
|
+
}, Name>;
|
|
180
|
+
logEmailOperation: FunctionReference<"mutation", "internal", {
|
|
181
|
+
actorId?: string;
|
|
182
|
+
campaignId?: string;
|
|
183
|
+
email: string;
|
|
184
|
+
eventName?: string;
|
|
185
|
+
loopId?: string;
|
|
186
|
+
messageId?: string;
|
|
187
|
+
metadata?: Record<string, any>;
|
|
188
|
+
operationType: "transactional" | "event" | "campaign" | "loop";
|
|
189
|
+
success: boolean;
|
|
190
|
+
transactionalId?: string;
|
|
191
|
+
}, any, Name>;
|
|
192
|
+
removeContact: FunctionReference<"mutation", "internal", {
|
|
193
|
+
email: string;
|
|
194
|
+
}, any, Name>;
|
|
195
|
+
resubscribeContact: FunctionReference<"action", "internal", {
|
|
196
|
+
apiKey: string;
|
|
197
|
+
email: string;
|
|
198
|
+
}, {
|
|
199
|
+
success: boolean;
|
|
200
|
+
}, Name>;
|
|
201
|
+
sendEvent: FunctionReference<"action", "internal", {
|
|
202
|
+
apiKey: string;
|
|
203
|
+
email: string;
|
|
204
|
+
eventName: string;
|
|
205
|
+
eventProperties?: Record<string, any>;
|
|
206
|
+
}, {
|
|
207
|
+
success: boolean;
|
|
208
|
+
}, Name>;
|
|
209
|
+
sendTransactional: FunctionReference<"action", "internal", {
|
|
210
|
+
apiKey: string;
|
|
211
|
+
dataVariables?: Record<string, any>;
|
|
212
|
+
email: string;
|
|
213
|
+
transactionalId: string;
|
|
214
|
+
}, {
|
|
215
|
+
messageId?: string;
|
|
216
|
+
success: boolean;
|
|
217
|
+
}, Name>;
|
|
218
|
+
storeContact: FunctionReference<"mutation", "internal", {
|
|
219
|
+
email: string;
|
|
220
|
+
firstName?: string;
|
|
221
|
+
lastName?: string;
|
|
222
|
+
loopsContactId?: string;
|
|
223
|
+
source?: string;
|
|
224
|
+
subscribed?: boolean;
|
|
225
|
+
userGroup?: string;
|
|
226
|
+
userId?: string;
|
|
227
|
+
}, any, Name>;
|
|
228
|
+
triggerLoop: FunctionReference<"action", "internal", {
|
|
229
|
+
apiKey: string;
|
|
230
|
+
dataVariables?: Record<string, any>;
|
|
231
|
+
email: string;
|
|
232
|
+
eventName?: string;
|
|
233
|
+
loopId: string;
|
|
234
|
+
}, {
|
|
235
|
+
success: boolean;
|
|
236
|
+
warning?: string;
|
|
237
|
+
}, Name>;
|
|
238
|
+
unsubscribeContact: FunctionReference<"action", "internal", {
|
|
239
|
+
apiKey: string;
|
|
240
|
+
email: string;
|
|
241
|
+
}, {
|
|
242
|
+
success: boolean;
|
|
243
|
+
}, Name>;
|
|
244
|
+
updateContact: FunctionReference<"action", "internal", {
|
|
245
|
+
apiKey: string;
|
|
246
|
+
dataVariables?: Record<string, any>;
|
|
247
|
+
email: string;
|
|
248
|
+
firstName?: string;
|
|
249
|
+
lastName?: string;
|
|
250
|
+
source?: string;
|
|
251
|
+
subscribed?: boolean;
|
|
252
|
+
userGroup?: string;
|
|
253
|
+
userId?: string;
|
|
254
|
+
}, {
|
|
255
|
+
success: boolean;
|
|
256
|
+
}, Name>;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +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,SA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AA;SAAE,EACtC,IAAI,CACL,CAAC;QACF,kBAAkB,EAAE,iBAAiB,CACnC,QAAQ,EACR,UAAU,EACV;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EACjC;YAAE,OAAO,EAAE,OAAO,CAAA;SAAE,EACpB,IAAI,CACL,CAAC;QACF,aAAa,EAAE,iBAAiB,CAC9B,QAAQ,EACR,UAAU,EACV;YACE,MAAM,EAAE,MAAM,CAAC;YACf,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACpC,KAAK,EAAE,MAAM,CAAC;YACd,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,UAAU,CAAC,EAAE,OAAO,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,EACD;YAAE,OAAO,EAAE,OAAO,CAAA;SAAE,EACpB,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated data model types.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
|
|
10
|
+
import type { GenericId } from "convex/values";
|
|
11
|
+
import schema from "../schema.js";
|
|
12
|
+
/**
|
|
13
|
+
* The names of all of your Convex tables.
|
|
14
|
+
*/
|
|
15
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
16
|
+
/**
|
|
17
|
+
* The type of a document stored in Convex.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
20
|
+
*/
|
|
21
|
+
export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
|
|
22
|
+
/**
|
|
23
|
+
* An identifier for a document in Convex.
|
|
24
|
+
*
|
|
25
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
26
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
27
|
+
*
|
|
28
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
29
|
+
*
|
|
30
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
31
|
+
* strings when type checking.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
34
|
+
*/
|
|
35
|
+
export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
|
|
36
|
+
/**
|
|
37
|
+
* A type describing your Convex data model.
|
|
38
|
+
*
|
|
39
|
+
* This type includes information about what tables you have, the type of
|
|
40
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
41
|
+
*
|
|
42
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
43
|
+
* `mutationGeneric` to make them type-safe.
|
|
44
|
+
*/
|
|
45
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|
|
46
|
+
//# sourceMappingURL=dataModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,SAAS,SAAS,UAAU,IAAI,cAAc,CAC5D,SAAS,EACT,SAAS,CACV,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,UAAU,GAAG,gBAAgB,IAC5D,SAAS,CAAC,SAAS,CAAC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,6BAA6B,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
/**
|
|
3
2
|
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
3
|
*
|
|
@@ -7,27 +6,8 @@
|
|
|
7
6
|
* To regenerate, run `npx convex dev`.
|
|
8
7
|
* @module
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
ActionBuilder,
|
|
13
|
-
AnyComponents,
|
|
14
|
-
HttpActionBuilder,
|
|
15
|
-
MutationBuilder,
|
|
16
|
-
QueryBuilder,
|
|
17
|
-
GenericActionCtx,
|
|
18
|
-
GenericMutationCtx,
|
|
19
|
-
GenericQueryCtx,
|
|
20
|
-
GenericDatabaseReader,
|
|
21
|
-
GenericDatabaseWriter,
|
|
22
|
-
FunctionReference,
|
|
23
|
-
} from "convex/server";
|
|
9
|
+
import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
|
|
24
10
|
import type { DataModel } from "./dataModel.js";
|
|
25
|
-
|
|
26
|
-
type GenericCtx =
|
|
27
|
-
| GenericActionCtx<DataModel>
|
|
28
|
-
| GenericMutationCtx<DataModel>
|
|
29
|
-
| GenericQueryCtx<DataModel>;
|
|
30
|
-
|
|
31
11
|
/**
|
|
32
12
|
* Define a query in this Convex app's public API.
|
|
33
13
|
*
|
|
@@ -37,7 +17,6 @@ type GenericCtx =
|
|
|
37
17
|
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
38
18
|
*/
|
|
39
19
|
export declare const query: QueryBuilder<DataModel, "public">;
|
|
40
|
-
|
|
41
20
|
/**
|
|
42
21
|
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
43
22
|
*
|
|
@@ -47,7 +26,6 @@ export declare const query: QueryBuilder<DataModel, "public">;
|
|
|
47
26
|
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
48
27
|
*/
|
|
49
28
|
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
50
|
-
|
|
51
29
|
/**
|
|
52
30
|
* Define a mutation in this Convex app's public API.
|
|
53
31
|
*
|
|
@@ -57,7 +35,6 @@ export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
|
57
35
|
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
58
36
|
*/
|
|
59
37
|
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
60
|
-
|
|
61
38
|
/**
|
|
62
39
|
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
63
40
|
*
|
|
@@ -67,7 +44,6 @@ export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
|
67
44
|
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
68
45
|
*/
|
|
69
46
|
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
70
|
-
|
|
71
47
|
/**
|
|
72
48
|
* Define an action in this Convex app's public API.
|
|
73
49
|
*
|
|
@@ -80,7 +56,6 @@ export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
|
80
56
|
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
81
57
|
*/
|
|
82
58
|
export declare const action: ActionBuilder<DataModel, "public">;
|
|
83
|
-
|
|
84
59
|
/**
|
|
85
60
|
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
86
61
|
*
|
|
@@ -88,38 +63,36 @@ export declare const action: ActionBuilder<DataModel, "public">;
|
|
|
88
63
|
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
89
64
|
*/
|
|
90
65
|
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
91
|
-
|
|
92
66
|
/**
|
|
93
67
|
* Define an HTTP action.
|
|
94
68
|
*
|
|
95
|
-
*
|
|
96
|
-
* deployment if the requests matches the path and method where
|
|
97
|
-
* is routed. Be sure to route your
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
98
72
|
*
|
|
99
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
100
75
|
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
101
76
|
*/
|
|
102
77
|
export declare const httpAction: HttpActionBuilder;
|
|
103
|
-
|
|
104
78
|
/**
|
|
105
79
|
* A set of services for use within Convex query functions.
|
|
106
80
|
*
|
|
107
81
|
* The query context is passed as the first argument to any Convex query
|
|
108
82
|
* function run on the server.
|
|
109
83
|
*
|
|
110
|
-
*
|
|
111
|
-
* read-only.
|
|
84
|
+
* If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
|
|
112
85
|
*/
|
|
113
86
|
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
114
|
-
|
|
115
87
|
/**
|
|
116
88
|
* A set of services for use within Convex mutation functions.
|
|
117
89
|
*
|
|
118
90
|
* The mutation context is passed as the first argument to any Convex mutation
|
|
119
91
|
* function run on the server.
|
|
92
|
+
*
|
|
93
|
+
* If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
|
|
120
94
|
*/
|
|
121
95
|
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
122
|
-
|
|
123
96
|
/**
|
|
124
97
|
* A set of services for use within Convex action functions.
|
|
125
98
|
*
|
|
@@ -127,7 +100,6 @@ export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
|
127
100
|
* function run on the server.
|
|
128
101
|
*/
|
|
129
102
|
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
130
|
-
|
|
131
103
|
/**
|
|
132
104
|
* An interface to read from the database within Convex query functions.
|
|
133
105
|
*
|
|
@@ -136,7 +108,6 @@ export type ActionCtx = GenericActionCtx<DataModel>;
|
|
|
136
108
|
* building a query.
|
|
137
109
|
*/
|
|
138
110
|
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
139
|
-
|
|
140
111
|
/**
|
|
141
112
|
* An interface to read from and write to the database within Convex mutation
|
|
142
113
|
* functions.
|
|
@@ -147,3 +118,4 @@ export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
|
147
118
|
* for the guarantees Convex provides your functions.
|
|
148
119
|
*/
|
|
149
120
|
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
121
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +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,UAAU,EAAE,iBAAqC,CAAC;AAO/D;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;AAElD;;;;;;;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"}
|
|
@@ -7,18 +7,7 @@
|
|
|
7
7
|
* To regenerate, run `npx convex dev`.
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
actionGeneric,
|
|
13
|
-
httpActionGeneric,
|
|
14
|
-
queryGeneric,
|
|
15
|
-
mutationGeneric,
|
|
16
|
-
internalActionGeneric,
|
|
17
|
-
internalMutationGeneric,
|
|
18
|
-
internalQueryGeneric,
|
|
19
|
-
componentsGeneric,
|
|
20
|
-
} from "convex/server";
|
|
21
|
-
|
|
10
|
+
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
|
|
22
11
|
/**
|
|
23
12
|
* Define a query in this Convex app's public API.
|
|
24
13
|
*
|
|
@@ -28,7 +17,6 @@ import {
|
|
|
28
17
|
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
29
18
|
*/
|
|
30
19
|
export const query = queryGeneric;
|
|
31
|
-
|
|
32
20
|
/**
|
|
33
21
|
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
34
22
|
*
|
|
@@ -38,7 +26,6 @@ export const query = queryGeneric;
|
|
|
38
26
|
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
39
27
|
*/
|
|
40
28
|
export const internalQuery = internalQueryGeneric;
|
|
41
|
-
|
|
42
29
|
/**
|
|
43
30
|
* Define a mutation in this Convex app's public API.
|
|
44
31
|
*
|
|
@@ -48,7 +35,6 @@ export const internalQuery = internalQueryGeneric;
|
|
|
48
35
|
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
49
36
|
*/
|
|
50
37
|
export const mutation = mutationGeneric;
|
|
51
|
-
|
|
52
38
|
/**
|
|
53
39
|
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
54
40
|
*
|
|
@@ -58,7 +44,6 @@ export const mutation = mutationGeneric;
|
|
|
58
44
|
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
59
45
|
*/
|
|
60
46
|
export const internalMutation = internalMutationGeneric;
|
|
61
|
-
|
|
62
47
|
/**
|
|
63
48
|
* Define an action in this Convex app's public API.
|
|
64
49
|
*
|
|
@@ -71,7 +56,6 @@ export const internalMutation = internalMutationGeneric;
|
|
|
71
56
|
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
72
57
|
*/
|
|
73
58
|
export const action = actionGeneric;
|
|
74
|
-
|
|
75
59
|
/**
|
|
76
60
|
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
77
61
|
*
|
|
@@ -79,12 +63,15 @@ export const action = actionGeneric;
|
|
|
79
63
|
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
80
64
|
*/
|
|
81
65
|
export const internalAction = internalActionGeneric;
|
|
82
|
-
|
|
83
66
|
/**
|
|
84
|
-
* Define
|
|
67
|
+
* Define an HTTP action.
|
|
85
68
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
72
|
+
*
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
75
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
89
76
|
*/
|
|
90
77
|
export const httpAction = httpActionGeneric;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,kDAA2B,CAAC;AAE3C,eAAe,SAAS,CAAC"}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
1
|
import { defineComponent } from "convex/server";
|
|
2
|
-
import { api } from "./_generated/api";
|
|
3
2
|
const component = defineComponent("loops");
|
|
4
|
-
component.export(api, {
|
|
5
|
-
addContact: api.lib.addContact,
|
|
6
|
-
updateContact: api.lib.updateContact,
|
|
7
|
-
findContact: api.lib.findContact,
|
|
8
|
-
batchCreateContacts: api.lib.batchCreateContacts,
|
|
9
|
-
unsubscribeContact: api.lib.unsubscribeContact,
|
|
10
|
-
resubscribeContact: api.lib.resubscribeContact,
|
|
11
|
-
countContacts: api.lib.countContacts,
|
|
12
|
-
listContacts: api.lib.listContacts,
|
|
13
|
-
sendTransactional: api.lib.sendTransactional,
|
|
14
|
-
sendEvent: api.lib.sendEvent,
|
|
15
|
-
triggerLoop: api.lib.triggerLoop,
|
|
16
|
-
deleteContact: api.lib.deleteContact,
|
|
17
|
-
detectRecipientSpam: api.lib.detectRecipientSpam,
|
|
18
|
-
detectActorSpam: api.lib.detectActorSpam,
|
|
19
|
-
getEmailStats: api.lib.getEmailStats,
|
|
20
|
-
detectRapidFirePatterns: api.lib.detectRapidFirePatterns,
|
|
21
|
-
checkRecipientRateLimit: api.lib.checkRecipientRateLimit,
|
|
22
|
-
checkActorRateLimit: api.lib.checkActorRateLimit,
|
|
23
|
-
checkGlobalRateLimit: api.lib.checkGlobalRateLimit,
|
|
24
|
-
});
|
|
25
3
|
export default component;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { HeadersInitParam } from "../types";
|
|
2
2
|
export declare const LOOPS_API_BASE_URL = "https://app.loops.so/api/v1";
|
|
3
3
|
export declare const sanitizeLoopsError: (status: number, _errorText: string) => Error;
|
|
4
4
|
export type LoopsRequestInit = Omit<RequestInit, "body"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/component/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/component/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAWjD,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAEhE,eAAO,MAAM,kBAAkB,GAC9B,QAAQ,MAAM,EACd,YAAY,MAAM,KAChB,KAcF,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,UAAU,GACtB,QAAQ,MAAM,EACd,MAAM,MAAM,EACZ,OAAM,gBAAqB,sBAe3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,gBAAgB,YAQxD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,EAAE,OAAO,YAAY,aAM9D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,YAAY,aAKhD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,CAAC,EAAE,SAAS,OAAO,KAAG,OAAO,CAAC,CAAC,CAMjE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,GAAG,IAAI,wBAWpD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,IAAI,EAAE,UAAU,MAAM,WAMrE,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAQ9B,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,aAS1C,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {} from "../types";
|
|
2
1
|
const allowedOrigin = process.env.CONVEX_URL ??
|
|
3
2
|
process.env.NEXT_PUBLIC_CONVEX_URL ??
|
|
4
3
|
process.env.CONVEX_SITE_URL ??
|
|
@@ -58,7 +57,7 @@ export const readJsonBody = async (request) => {
|
|
|
58
57
|
try {
|
|
59
58
|
return (await request.json());
|
|
60
59
|
}
|
|
61
|
-
catch (
|
|
60
|
+
catch (_error) {
|
|
62
61
|
throw new Error("Invalid JSON body");
|
|
63
62
|
}
|
|
64
63
|
};
|