Skip to content

Commit aebe2db

Browse files
committed
codegen
1 parent faa667c commit aebe2db

3 files changed

Lines changed: 16 additions & 277 deletions

File tree

example/convex/_generated/api.d.ts

Lines changed: 3 additions & 261 deletions
Original file line numberDiff line numberDiff line change
@@ -49,265 +49,7 @@ export declare const internal: FilterApi<
4949
>;
5050

5151
export declare const components: {
52-
smallPool: {
53-
lib: {
54-
cancel: FunctionReference<
55-
"mutation",
56-
"internal",
57-
{
58-
id: string;
59-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
60-
},
61-
any
62-
>;
63-
cancelAll: FunctionReference<
64-
"mutation",
65-
"internal",
66-
{
67-
before?: number;
68-
limit?: number;
69-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
70-
},
71-
any
72-
>;
73-
enqueue: FunctionReference<
74-
"mutation",
75-
"internal",
76-
{
77-
config: {
78-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
79-
maxParallelism: number;
80-
};
81-
fnArgs: any;
82-
fnHandle: string;
83-
fnName: string;
84-
fnType: "action" | "mutation" | "query";
85-
onComplete?: { context?: any; fnHandle: string };
86-
retryBehavior?: {
87-
base: number;
88-
initialBackoffMs: number;
89-
maxAttempts: number;
90-
};
91-
runAt: number;
92-
},
93-
string
94-
>;
95-
enqueueBatch: FunctionReference<
96-
"mutation",
97-
"internal",
98-
{
99-
config: {
100-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
101-
maxParallelism: number;
102-
};
103-
items: Array<{
104-
fnArgs: any;
105-
fnHandle: string;
106-
fnName: string;
107-
fnType: "action" | "mutation" | "query";
108-
onComplete?: { context?: any; fnHandle: string };
109-
retryBehavior?: {
110-
base: number;
111-
initialBackoffMs: number;
112-
maxAttempts: number;
113-
};
114-
runAt: number;
115-
}>;
116-
},
117-
Array<string>
118-
>;
119-
status: FunctionReference<
120-
"query",
121-
"internal",
122-
{ id: string },
123-
| { previousAttempts: number; state: "pending" }
124-
| { previousAttempts: number; state: "running" }
125-
| { state: "finished" }
126-
>;
127-
statusBatch: FunctionReference<
128-
"query",
129-
"internal",
130-
{ ids: Array<string> },
131-
Array<
132-
| { previousAttempts: number; state: "pending" }
133-
| { previousAttempts: number; state: "running" }
134-
| { state: "finished" }
135-
>
136-
>;
137-
};
138-
};
139-
bigPool: {
140-
lib: {
141-
cancel: FunctionReference<
142-
"mutation",
143-
"internal",
144-
{
145-
id: string;
146-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
147-
},
148-
any
149-
>;
150-
cancelAll: FunctionReference<
151-
"mutation",
152-
"internal",
153-
{
154-
before?: number;
155-
limit?: number;
156-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
157-
},
158-
any
159-
>;
160-
enqueue: FunctionReference<
161-
"mutation",
162-
"internal",
163-
{
164-
config: {
165-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
166-
maxParallelism: number;
167-
};
168-
fnArgs: any;
169-
fnHandle: string;
170-
fnName: string;
171-
fnType: "action" | "mutation" | "query";
172-
onComplete?: { context?: any; fnHandle: string };
173-
retryBehavior?: {
174-
base: number;
175-
initialBackoffMs: number;
176-
maxAttempts: number;
177-
};
178-
runAt: number;
179-
},
180-
string
181-
>;
182-
enqueueBatch: FunctionReference<
183-
"mutation",
184-
"internal",
185-
{
186-
config: {
187-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
188-
maxParallelism: number;
189-
};
190-
items: Array<{
191-
fnArgs: any;
192-
fnHandle: string;
193-
fnName: string;
194-
fnType: "action" | "mutation" | "query";
195-
onComplete?: { context?: any; fnHandle: string };
196-
retryBehavior?: {
197-
base: number;
198-
initialBackoffMs: number;
199-
maxAttempts: number;
200-
};
201-
runAt: number;
202-
}>;
203-
},
204-
Array<string>
205-
>;
206-
status: FunctionReference<
207-
"query",
208-
"internal",
209-
{ id: string },
210-
| { previousAttempts: number; state: "pending" }
211-
| { previousAttempts: number; state: "running" }
212-
| { state: "finished" }
213-
>;
214-
statusBatch: FunctionReference<
215-
"query",
216-
"internal",
217-
{ ids: Array<string> },
218-
Array<
219-
| { previousAttempts: number; state: "pending" }
220-
| { previousAttempts: number; state: "running" }
221-
| { state: "finished" }
222-
>
223-
>;
224-
};
225-
};
226-
serializedPool: {
227-
lib: {
228-
cancel: FunctionReference<
229-
"mutation",
230-
"internal",
231-
{
232-
id: string;
233-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
234-
},
235-
any
236-
>;
237-
cancelAll: FunctionReference<
238-
"mutation",
239-
"internal",
240-
{
241-
before?: number;
242-
limit?: number;
243-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
244-
},
245-
any
246-
>;
247-
enqueue: FunctionReference<
248-
"mutation",
249-
"internal",
250-
{
251-
config: {
252-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
253-
maxParallelism: number;
254-
};
255-
fnArgs: any;
256-
fnHandle: string;
257-
fnName: string;
258-
fnType: "action" | "mutation" | "query";
259-
onComplete?: { context?: any; fnHandle: string };
260-
retryBehavior?: {
261-
base: number;
262-
initialBackoffMs: number;
263-
maxAttempts: number;
264-
};
265-
runAt: number;
266-
},
267-
string
268-
>;
269-
enqueueBatch: FunctionReference<
270-
"mutation",
271-
"internal",
272-
{
273-
config: {
274-
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
275-
maxParallelism: number;
276-
};
277-
items: Array<{
278-
fnArgs: any;
279-
fnHandle: string;
280-
fnName: string;
281-
fnType: "action" | "mutation" | "query";
282-
onComplete?: { context?: any; fnHandle: string };
283-
retryBehavior?: {
284-
base: number;
285-
initialBackoffMs: number;
286-
maxAttempts: number;
287-
};
288-
runAt: number;
289-
}>;
290-
},
291-
Array<string>
292-
>;
293-
status: FunctionReference<
294-
"query",
295-
"internal",
296-
{ id: string },
297-
| { previousAttempts: number; state: "pending" }
298-
| { previousAttempts: number; state: "running" }
299-
| { state: "finished" }
300-
>;
301-
statusBatch: FunctionReference<
302-
"query",
303-
"internal",
304-
{ ids: Array<string> },
305-
Array<
306-
| { previousAttempts: number; state: "pending" }
307-
| { previousAttempts: number; state: "running" }
308-
| { state: "finished" }
309-
>
310-
>;
311-
};
312-
};
52+
smallPool: import("@convex-dev/workpool/_generated/component.js").ComponentApi<"smallPool">;
53+
bigPool: import("@convex-dev/workpool/_generated/component.js").ComponentApi<"bigPool">;
54+
serializedPool: import("@convex-dev/workpool/_generated/component.js").ComponentApi<"serializedPool">;
31355
};

example/convex/_generated/server.d.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import {
1212
ActionBuilder,
13-
AnyComponents,
1413
HttpActionBuilder,
1514
MutationBuilder,
1615
QueryBuilder,
@@ -19,15 +18,9 @@ import {
1918
GenericQueryCtx,
2019
GenericDatabaseReader,
2120
GenericDatabaseWriter,
22-
FunctionReference,
2321
} from "convex/server";
2422
import type { DataModel } from "./dataModel.js";
2523

26-
type GenericCtx =
27-
| GenericActionCtx<DataModel>
28-
| GenericMutationCtx<DataModel>
29-
| GenericQueryCtx<DataModel>;
30-
3124
/**
3225
* Define a query in this Convex app's public API.
3326
*
@@ -92,11 +85,12 @@ export declare const internalAction: ActionBuilder<DataModel, "internal">;
9285
/**
9386
* Define an HTTP action.
9487
*
95-
* This function will be used to respond to HTTP requests received by a Convex
96-
* deployment if the requests matches the path and method where this action
97-
* is routed. Be sure to route your action in `convex/http.js`.
88+
* The wrapped function will be used to respond to HTTP requests received
89+
* by a Convex deployment if the requests matches the path and method where
90+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
9891
*
99-
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
92+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
93+
* and a Fetch API `Request` object as its second.
10094
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
10195
*/
10296
export declare const httpAction: HttpActionBuilder;

example/convex/_generated/server.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
internalActionGeneric,
1717
internalMutationGeneric,
1818
internalQueryGeneric,
19-
componentsGeneric,
2019
} from "convex/server";
2120

2221
/**
@@ -81,10 +80,14 @@ export const action = actionGeneric;
8180
export const internalAction = internalActionGeneric;
8281

8382
/**
84-
* Define a Convex HTTP action.
83+
* Define an HTTP action.
8584
*
86-
* @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
87-
* as its second.
88-
* @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
85+
* The wrapped function will be used to respond to HTTP requests received
86+
* by a Convex deployment if the requests matches the path and method where
87+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
88+
*
89+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
90+
* and a Fetch API `Request` object as its second.
91+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
8992
*/
9093
export const httpAction = httpActionGeneric;

0 commit comments

Comments
 (0)