Skip to content

Commit 507e160

Browse files
committed
fix: include convex codegen in git
1 parent d9171a6 commit 507e160

File tree

7 files changed

+385
-1
lines changed

7 files changed

+385
-1
lines changed

apps/convex/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.env.local
2-
src/convex/_generated
2+
# src/convex/_generated
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated `api` utility.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import type * as auth from "../auth.js";
12+
import type * as channels from "../channels.js";
13+
import type * as files from "../files.js";
14+
import type * as http from "../http.js";
15+
import type * as messages from "../messages.js";
16+
import type * as organizations from "../organizations.js";
17+
import type * as perms from "../perms.js";
18+
import type * as personalization from "../personalization.js";
19+
import type * as tasks from "../tasks.js";
20+
import type * as users from "../users.js";
21+
import type * as vote from "../vote.js";
22+
23+
import type {
24+
ApiFromModules,
25+
FilterApi,
26+
FunctionReference,
27+
} from "convex/server";
28+
29+
/**
30+
* A utility for referencing Convex functions in your app's API.
31+
*
32+
* Usage:
33+
* ```js
34+
* const myFunctionReference = api.myModule.myFunction;
35+
* ```
36+
*/
37+
declare const fullApi: ApiFromModules<{
38+
auth: typeof auth;
39+
channels: typeof channels;
40+
files: typeof files;
41+
http: typeof http;
42+
messages: typeof messages;
43+
organizations: typeof organizations;
44+
perms: typeof perms;
45+
personalization: typeof personalization;
46+
tasks: typeof tasks;
47+
users: typeof users;
48+
vote: typeof vote;
49+
}>;
50+
declare const fullApiWithMounts: typeof fullApi;
51+
52+
export declare const api: FilterApi<
53+
typeof fullApiWithMounts,
54+
FunctionReference<any, "public">
55+
>;
56+
export declare const internal: FilterApi<
57+
typeof fullApiWithMounts,
58+
FunctionReference<any, "internal">
59+
>;
60+
61+
export declare const components: {};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated `api` utility.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import { anyApi, componentsGeneric } from "convex/server";
12+
13+
/**
14+
* A utility for referencing Convex functions in your app's API.
15+
*
16+
* Usage:
17+
* ```js
18+
* const myFunctionReference = api.myModule.myFunction;
19+
* ```
20+
*/
21+
export const api = anyApi;
22+
export const internal = anyApi;
23+
export const components = componentsGeneric();
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated data model types.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import type {
12+
DataModelFromSchemaDefinition,
13+
DocumentByName,
14+
TableNamesInDataModel,
15+
SystemTableNames,
16+
} from "convex/server";
17+
import type { GenericId } from "convex/values";
18+
import schema from "../schema.js";
19+
20+
/**
21+
* The names of all of your Convex tables.
22+
*/
23+
export type TableNames = TableNamesInDataModel<DataModel>;
24+
25+
/**
26+
* The type of a document stored in Convex.
27+
*
28+
* @typeParam TableName - A string literal type of the table name (like "users").
29+
*/
30+
export type Doc<TableName extends TableNames> = DocumentByName<
31+
DataModel,
32+
TableName
33+
>;
34+
35+
/**
36+
* An identifier for a document in Convex.
37+
*
38+
* Convex documents are uniquely identified by their `Id`, which is accessible
39+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
40+
*
41+
* Documents can be loaded using `db.get(id)` in query and mutation functions.
42+
*
43+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
44+
* strings when type checking.
45+
*
46+
* @typeParam TableName - A string literal type of the table name (like "users").
47+
*/
48+
export type Id<TableName extends TableNames | SystemTableNames> =
49+
GenericId<TableName>;
50+
51+
/**
52+
* A type describing your Convex data model.
53+
*
54+
* This type includes information about what tables you have, the type of
55+
* documents stored in those tables, and the indexes defined on them.
56+
*
57+
* This type is used to parameterize methods like `queryGeneric` and
58+
* `mutationGeneric` to make them type-safe.
59+
*/
60+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated utilities for implementing server-side Convex query and mutation functions.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
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";
24+
import type { DataModel } from "./dataModel.js";
25+
26+
type GenericCtx =
27+
| GenericActionCtx<DataModel>
28+
| GenericMutationCtx<DataModel>
29+
| GenericQueryCtx<DataModel>;
30+
31+
/**
32+
* Define a query in this Convex app's public API.
33+
*
34+
* This function will be allowed to read your Convex database and will be accessible from the client.
35+
*
36+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
37+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
38+
*/
39+
export declare const query: QueryBuilder<DataModel, "public">;
40+
41+
/**
42+
* Define a query that is only accessible from other Convex functions (but not from the client).
43+
*
44+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
45+
*
46+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
47+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
48+
*/
49+
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
50+
51+
/**
52+
* Define a mutation in this Convex app's public API.
53+
*
54+
* This function will be allowed to modify your Convex database and will be accessible from the client.
55+
*
56+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
57+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
58+
*/
59+
export declare const mutation: MutationBuilder<DataModel, "public">;
60+
61+
/**
62+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
63+
*
64+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
65+
*
66+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
67+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
68+
*/
69+
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
70+
71+
/**
72+
* Define an action in this Convex app's public API.
73+
*
74+
* An action is a function which can execute any JavaScript code, including non-deterministic
75+
* code and code with side-effects, like calling third-party services.
76+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
77+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
78+
*
79+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
80+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
81+
*/
82+
export declare const action: ActionBuilder<DataModel, "public">;
83+
84+
/**
85+
* Define an action that is only accessible from other Convex functions (but not from the client).
86+
*
87+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
88+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
89+
*/
90+
export declare const internalAction: ActionBuilder<DataModel, "internal">;
91+
92+
/**
93+
* Define an HTTP action.
94+
*
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`.
98+
*
99+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
100+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
101+
*/
102+
export declare const httpAction: HttpActionBuilder;
103+
104+
/**
105+
* A set of services for use within Convex query functions.
106+
*
107+
* The query context is passed as the first argument to any Convex query
108+
* function run on the server.
109+
*
110+
* This differs from the {@link MutationCtx} because all of the services are
111+
* read-only.
112+
*/
113+
export type QueryCtx = GenericQueryCtx<DataModel>;
114+
115+
/**
116+
* A set of services for use within Convex mutation functions.
117+
*
118+
* The mutation context is passed as the first argument to any Convex mutation
119+
* function run on the server.
120+
*/
121+
export type MutationCtx = GenericMutationCtx<DataModel>;
122+
123+
/**
124+
* A set of services for use within Convex action functions.
125+
*
126+
* The action context is passed as the first argument to any Convex action
127+
* function run on the server.
128+
*/
129+
export type ActionCtx = GenericActionCtx<DataModel>;
130+
131+
/**
132+
* An interface to read from the database within Convex query functions.
133+
*
134+
* The two entry points are {@link DatabaseReader.get}, which fetches a single
135+
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
136+
* building a query.
137+
*/
138+
export type DatabaseReader = GenericDatabaseReader<DataModel>;
139+
140+
/**
141+
* An interface to read from and write to the database within Convex mutation
142+
* functions.
143+
*
144+
* Convex guarantees that all writes within a single mutation are
145+
* executed atomically, so you never have to worry about partial writes leaving
146+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
147+
* for the guarantees Convex provides your functions.
148+
*/
149+
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated utilities for implementing server-side Convex query and mutation functions.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
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+
22+
/**
23+
* Define a query in this Convex app's public API.
24+
*
25+
* This function will be allowed to read your Convex database and will be accessible from the client.
26+
*
27+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
28+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
29+
*/
30+
export const query = queryGeneric;
31+
32+
/**
33+
* Define a query that is only accessible from other Convex functions (but not from the client).
34+
*
35+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
36+
*
37+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
38+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
39+
*/
40+
export const internalQuery = internalQueryGeneric;
41+
42+
/**
43+
* Define a mutation in this Convex app's public API.
44+
*
45+
* This function will be allowed to modify your Convex database and will be accessible from the client.
46+
*
47+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
48+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
49+
*/
50+
export const mutation = mutationGeneric;
51+
52+
/**
53+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
54+
*
55+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
56+
*
57+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
58+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
59+
*/
60+
export const internalMutation = internalMutationGeneric;
61+
62+
/**
63+
* Define an action in this Convex app's public API.
64+
*
65+
* An action is a function which can execute any JavaScript code, including non-deterministic
66+
* code and code with side-effects, like calling third-party services.
67+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
68+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
69+
*
70+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
71+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
72+
*/
73+
export const action = actionGeneric;
74+
75+
/**
76+
* Define an action that is only accessible from other Convex functions (but not from the client).
77+
*
78+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
79+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
80+
*/
81+
export const internalAction = internalActionGeneric;
82+
83+
/**
84+
* Define a Convex HTTP action.
85+
*
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`.
89+
*/
90+
export const httpAction = httpActionGeneric;

0 commit comments

Comments
 (0)