create-convex-monorepo 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 (93) hide show
  1. package/CONTRIBUTING.md +55 -0
  2. package/LICENSE +21 -0
  3. package/README.md +213 -0
  4. package/assets/backend/PROVENANCE.md +3 -0
  5. package/assets/backend/convex/_generated/api.d.ts +51 -0
  6. package/assets/backend/convex/_generated/api.js +23 -0
  7. package/assets/backend/convex/_generated/dataModel.d.ts +60 -0
  8. package/assets/backend/convex/_generated/server.d.ts +162 -0
  9. package/assets/backend/convex/_generated/server.js +101 -0
  10. package/assets/backend/convex/messages.ts +38 -0
  11. package/assets/backend/convex/schema.ts +9 -0
  12. package/assets/backend/convex/tsconfig.json +26 -0
  13. package/assets/backend-blank/PROVENANCE.md +3 -0
  14. package/assets/backend-blank/convex/_generated/api.d.ts +45 -0
  15. package/assets/backend-blank/convex/_generated/api.js +23 -0
  16. package/assets/backend-blank/convex/_generated/dataModel.d.ts +60 -0
  17. package/assets/backend-blank/convex/_generated/server.d.ts +162 -0
  18. package/assets/backend-blank/convex/_generated/server.js +101 -0
  19. package/assets/backend-blank/convex/schema.ts +3 -0
  20. package/assets/setup/convex-setup.mjs +250 -0
  21. package/dist/cli/index.d.ts +2 -0
  22. package/dist/cli/index.js +19 -0
  23. package/dist/cli/index.js.map +1 -0
  24. package/dist/commands/create.d.ts +8 -0
  25. package/dist/commands/create.js +182 -0
  26. package/dist/commands/create.js.map +1 -0
  27. package/dist/generator/context.d.ts +3 -0
  28. package/dist/generator/context.js +81 -0
  29. package/dist/generator/context.js.map +1 -0
  30. package/dist/generator/index.d.ts +12 -0
  31. package/dist/generator/index.js +123 -0
  32. package/dist/generator/index.js.map +1 -0
  33. package/dist/generator/options.d.ts +15 -0
  34. package/dist/generator/options.js +85 -0
  35. package/dist/generator/options.js.map +1 -0
  36. package/dist/generator/types.d.ts +47 -0
  37. package/dist/generator/types.js +2 -0
  38. package/dist/generator/types.js.map +1 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.js +3 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/integrations/auth/clerk/index.d.ts +2 -0
  43. package/dist/integrations/auth/clerk/index.js +114 -0
  44. package/dist/integrations/auth/clerk/index.js.map +1 -0
  45. package/dist/integrations/auth/index.d.ts +2 -0
  46. package/dist/integrations/auth/index.js +7 -0
  47. package/dist/integrations/auth/index.js.map +1 -0
  48. package/dist/integrations/auth/none/index.d.ts +2 -0
  49. package/dist/integrations/auth/none/index.js +18 -0
  50. package/dist/integrations/auth/none/index.js.map +1 -0
  51. package/dist/integrations/auth/shared.d.ts +11 -0
  52. package/dist/integrations/auth/shared.js +40 -0
  53. package/dist/integrations/auth/shared.js.map +1 -0
  54. package/dist/package-manager/index.d.ts +6 -0
  55. package/dist/package-manager/index.js +22 -0
  56. package/dist/package-manager/index.js.map +1 -0
  57. package/dist/templates/apps/expo/index.d.ts +2 -0
  58. package/dist/templates/apps/expo/index.js +91 -0
  59. package/dist/templates/apps/expo/index.js.map +1 -0
  60. package/dist/templates/apps/index.d.ts +2 -0
  61. package/dist/templates/apps/index.js +11 -0
  62. package/dist/templates/apps/index.js.map +1 -0
  63. package/dist/templates/apps/next/index.d.ts +2 -0
  64. package/dist/templates/apps/next/index.js +66 -0
  65. package/dist/templates/apps/next/index.js.map +1 -0
  66. package/dist/templates/apps/shared.d.ts +24 -0
  67. package/dist/templates/apps/shared.js +124 -0
  68. package/dist/templates/apps/shared.js.map +1 -0
  69. package/dist/templates/apps/tanstack-start/index.d.ts +2 -0
  70. package/dist/templates/apps/tanstack-start/index.js +82 -0
  71. package/dist/templates/apps/tanstack-start/index.js.map +1 -0
  72. package/dist/templates/apps/vite/index.d.ts +2 -0
  73. package/dist/templates/apps/vite/index.js +42 -0
  74. package/dist/templates/apps/vite/index.js.map +1 -0
  75. package/dist/templates/backend/index.d.ts +2 -0
  76. package/dist/templates/backend/index.js +58 -0
  77. package/dist/templates/backend/index.js.map +1 -0
  78. package/dist/templates/root/index.d.ts +2 -0
  79. package/dist/templates/root/index.js +178 -0
  80. package/dist/templates/root/index.js.map +1 -0
  81. package/dist/templates/versions.d.ts +18 -0
  82. package/dist/templates/versions.js +19 -0
  83. package/dist/templates/versions.js.map +1 -0
  84. package/dist/version.d.ts +1 -0
  85. package/dist/version.js +11 -0
  86. package/dist/version.js.map +1 -0
  87. package/docs/adding-a-framework.md +27 -0
  88. package/docs/adding-an-auth-provider.md +31 -0
  89. package/docs/architecture.md +49 -0
  90. package/docs/releases.md +78 -0
  91. package/docs/research.md +76 -0
  92. package/docs/verification.md +78 -0
  93. package/package.json +77 -0
@@ -0,0 +1,101 @@
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
+ } from "convex/server";
20
+
21
+ /**
22
+ * Define a query in this Convex app's public API.
23
+ *
24
+ * This function will be allowed to read your Convex database and will be accessible from the client.
25
+ *
26
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
27
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
28
+ */
29
+ export const query = queryGeneric;
30
+
31
+ /**
32
+ * Define a query that is only accessible from other Convex functions (but not from the client).
33
+ *
34
+ * This function will be allowed to read from your Convex database. It will not 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 const internalQuery = internalQueryGeneric;
40
+
41
+ /**
42
+ * Define a mutation in this Convex app's public API.
43
+ *
44
+ * This function will be allowed to modify your Convex database and will be accessible from the client.
45
+ *
46
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
47
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
48
+ */
49
+ export const mutation = mutationGeneric;
50
+
51
+ /**
52
+ * Define a mutation that is only accessible from other Convex functions (but not from the client).
53
+ *
54
+ * This function will be allowed to modify your Convex database. It will not 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 const internalMutation = internalMutationGeneric;
60
+
61
+ /**
62
+ * Define an action in this Convex app's public API.
63
+ *
64
+ * An action is a function which can execute any JavaScript code, including non-deterministic
65
+ * code and code with side-effects, like calling third-party services.
66
+ * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
67
+ * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
68
+ *
69
+ * @param func - The action. It receives an {@link ActionCtx} as its first argument.
70
+ * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
71
+ */
72
+ export const action = actionGeneric;
73
+
74
+ /**
75
+ * Define an action that is only accessible from other Convex functions (but not from the client).
76
+ *
77
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument.
78
+ * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
79
+ */
80
+ export const internalAction = internalActionGeneric;
81
+
82
+ /**
83
+ * Define an HTTP action.
84
+ *
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.
92
+ */
93
+ export const httpAction = httpActionGeneric;
94
+
95
+ /**
96
+ * Typesafe environment variables.
97
+ *
98
+ * This includes platform-provided env vars and any variables declared in
99
+ * `convex.config.ts`.
100
+ */
101
+ export const env = process.env;
@@ -0,0 +1,38 @@
1
+ import { query, mutation } from './_generated/server';
2
+ import { v } from 'convex/values';
3
+ import { getOwner } from './access';
4
+
5
+ export const list = query({
6
+ args: {},
7
+ returns: v.array(
8
+ v.object({
9
+ _id: v.id('messages'),
10
+ _creationTime: v.number(),
11
+ body: v.string(),
12
+ owner: v.optional(v.string()),
13
+ }),
14
+ ),
15
+ handler: async (ctx) => {
16
+ const owner = await getOwner(ctx);
17
+ return await ctx.db
18
+ .query('messages')
19
+ .withIndex('by_owner', (q) => q.eq('owner', owner))
20
+ .order('desc')
21
+ .take(50);
22
+ },
23
+ });
24
+
25
+ export const send = mutation({
26
+ args: { body: v.string() },
27
+ returns: v.id('messages'),
28
+ handler: async (ctx, args) => {
29
+ const owner = await getOwner(ctx);
30
+ const body = args.body.trim();
31
+ if (!body || body.length > 1000)
32
+ throw new Error('Messages must contain 1 to 1000 characters.');
33
+ return await ctx.db.insert('messages', {
34
+ body,
35
+ ...(owner === undefined ? {} : { owner }),
36
+ });
37
+ },
38
+ });
@@ -0,0 +1,9 @@
1
+ import { defineSchema, defineTable } from 'convex/server';
2
+ import { v } from 'convex/values';
3
+
4
+ export default defineSchema({
5
+ messages: defineTable({
6
+ body: v.string(),
7
+ owner: v.optional(v.string()),
8
+ }).index('by_owner', ['owner']),
9
+ });
@@ -0,0 +1,26 @@
1
+ {
2
+ /* This TypeScript project config describes the environment that
3
+ * Convex functions run in and is used to typecheck them.
4
+ * You can modify it, but some settings are required to use Convex.
5
+ */
6
+ "compilerOptions": {
7
+ /* These settings are not required by Convex and can be modified. */
8
+ "allowJs": true,
9
+ "strict": true,
10
+ "types": ["node"],
11
+ "moduleResolution": "Bundler",
12
+ "jsx": "react-jsx",
13
+ "skipLibCheck": true,
14
+ "allowSyntheticDefaultImports": true,
15
+
16
+ /* These compiler options are required by Convex */
17
+ "target": "ESNext",
18
+ "lib": ["ES2023", "dom"],
19
+ "forceConsistentCasingInFileNames": true,
20
+ "module": "ESNext",
21
+ "isolatedModules": true,
22
+ "noEmit": true
23
+ },
24
+ "include": ["./**/*"],
25
+ "exclude": ["./_generated"]
26
+ }
@@ -0,0 +1,3 @@
1
+ Generated files under convex/\_generated were produced unchanged by convex@1.45.0 using CONVEX_AGENT_MODE=anonymous convex dev --once on 2026-09-09. The only input was schema.ts with defineSchema({}). No example tables, registered functions or access helper were present. No internal codegen entry point was called. Clerk adds auth.config.ts, which is excluded from the generated function API. Run normal convex dev after adding functions.
2
+
3
+ Convex SDK source is Apache-2.0 licensed: https://github.com/get-convex/convex-js/blob/main/LICENSE.
@@ -0,0 +1,45 @@
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 {
12
+ ApiFromModules,
13
+ FilterApi,
14
+ FunctionReference,
15
+ } from "convex/server";
16
+
17
+ declare const fullApi: ApiFromModules<{}>;
18
+
19
+ /**
20
+ * A utility for referencing Convex functions in your app's public API.
21
+ *
22
+ * Usage:
23
+ * ```js
24
+ * const myFunctionReference = api.myModule.myFunction;
25
+ * ```
26
+ */
27
+ export declare const api: FilterApi<
28
+ typeof fullApi,
29
+ FunctionReference<any, "public">
30
+ >;
31
+
32
+ /**
33
+ * A utility for referencing Convex functions in your app's internal API.
34
+ *
35
+ * Usage:
36
+ * ```js
37
+ * const myFunctionReference = internal.myModule.myFunction;
38
+ * ```
39
+ */
40
+ export declare const internal: FilterApi<
41
+ typeof fullApi,
42
+ FunctionReference<any, "internal">
43
+ >;
44
+
45
+ export declare const components: {};
@@ -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();
@@ -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(tableName, 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>;
@@ -0,0 +1,162 @@
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
+ HttpActionBuilder,
14
+ MutationBuilder,
15
+ QueryBuilder,
16
+ GenericActionCtx,
17
+ GenericMutationCtx,
18
+ GenericQueryCtx,
19
+ GenericDatabaseReader,
20
+ GenericDatabaseWriter,
21
+ } from "convex/server";
22
+ import type { DataModel } from "./dataModel.js";
23
+
24
+ /**
25
+ * Typesafe environment variables.
26
+ *
27
+ * This includes platform-provided env vars and any variables declared in
28
+ * `convex.config.ts`.
29
+ */
30
+ type Env = {
31
+ readonly CONVEX_CLOUD_URL: string;
32
+ readonly CONVEX_SITE_URL: string;
33
+ };
34
+
35
+ /**
36
+ * Define a query in this Convex app's public API.
37
+ *
38
+ * This function will be allowed to read your Convex database and will be accessible from the client.
39
+ *
40
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
41
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
42
+ */
43
+ export declare const query: QueryBuilder<DataModel, "public">;
44
+
45
+ /**
46
+ * Define a query that is only accessible from other Convex functions (but not from the client).
47
+ *
48
+ * This function will be allowed to read from your Convex database. It will not be accessible from the client.
49
+ *
50
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
51
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
52
+ */
53
+ export declare const internalQuery: QueryBuilder<DataModel, "internal">;
54
+
55
+ /**
56
+ * Define a mutation in this Convex app's public API.
57
+ *
58
+ * This function will be allowed to modify your Convex database and will be accessible from the client.
59
+ *
60
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
61
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
62
+ */
63
+ export declare const mutation: MutationBuilder<DataModel, "public">;
64
+
65
+ /**
66
+ * Define a mutation that is only accessible from other Convex functions (but not from the client).
67
+ *
68
+ * This function will be allowed to modify your Convex database. It will not be accessible from the client.
69
+ *
70
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
71
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
72
+ */
73
+ export declare const internalMutation: MutationBuilder<DataModel, "internal">;
74
+
75
+ /**
76
+ * Define an action in this Convex app's public API.
77
+ *
78
+ * An action is a function which can execute any JavaScript code, including non-deterministic
79
+ * code and code with side-effects, like calling third-party services.
80
+ * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
81
+ * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
82
+ *
83
+ * @param func - The action. It receives an {@link ActionCtx} as its first argument.
84
+ * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
85
+ */
86
+ export declare const action: ActionBuilder<DataModel, "public">;
87
+
88
+ /**
89
+ * Define an action that is only accessible from other Convex functions (but not from the client).
90
+ *
91
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument.
92
+ * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
93
+ */
94
+ export declare const internalAction: ActionBuilder<DataModel, "internal">;
95
+
96
+ /**
97
+ * Define an HTTP action.
98
+ *
99
+ * The wrapped function will be used to respond to HTTP requests received
100
+ * by a Convex deployment if the requests matches the path and method where
101
+ * this action is routed. Be sure to route your httpAction in `convex/http.js`.
102
+ *
103
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument
104
+ * and a Fetch API `Request` object as its second.
105
+ * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
106
+ */
107
+ export declare const httpAction: HttpActionBuilder;
108
+
109
+ /**
110
+ * Typesafe environment variables.
111
+ *
112
+ * This includes platform-provided env vars and any variables declared in
113
+ * `convex.config.ts`.
114
+ */
115
+ export declare const env: Env;
116
+
117
+ /**
118
+ * A set of services for use within Convex query functions.
119
+ *
120
+ * The query context is passed as the first argument to any Convex query
121
+ * function run on the server.
122
+ *
123
+ * This differs from the {@link MutationCtx} because all of the services are
124
+ * read-only.
125
+ */
126
+ export type QueryCtx = GenericQueryCtx<DataModel>;
127
+
128
+ /**
129
+ * A set of services for use within Convex mutation functions.
130
+ *
131
+ * The mutation context is passed as the first argument to any Convex mutation
132
+ * function run on the server.
133
+ */
134
+ export type MutationCtx = GenericMutationCtx<DataModel>;
135
+
136
+ /**
137
+ * A set of services for use within Convex action functions.
138
+ *
139
+ * The action context is passed as the first argument to any Convex action
140
+ * function run on the server.
141
+ */
142
+ export type ActionCtx = GenericActionCtx<DataModel>;
143
+
144
+ /**
145
+ * An interface to read from the database within Convex query functions.
146
+ *
147
+ * The two entry points are {@link DatabaseReader.get}, which fetches a single
148
+ * document by its {@link Id}, or {@link DatabaseReader.query}, which starts
149
+ * building a query.
150
+ */
151
+ export type DatabaseReader = GenericDatabaseReader<DataModel>;
152
+
153
+ /**
154
+ * An interface to read from and write to the database within Convex mutation
155
+ * functions.
156
+ *
157
+ * Convex guarantees that all writes within a single mutation are
158
+ * executed atomically, so you never have to worry about partial writes leaving
159
+ * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
160
+ * for the guarantees Convex provides your functions.
161
+ */
162
+ export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
@@ -0,0 +1,101 @@
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
+ } from "convex/server";
20
+
21
+ /**
22
+ * Define a query in this Convex app's public API.
23
+ *
24
+ * This function will be allowed to read your Convex database and will be accessible from the client.
25
+ *
26
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
27
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
28
+ */
29
+ export const query = queryGeneric;
30
+
31
+ /**
32
+ * Define a query that is only accessible from other Convex functions (but not from the client).
33
+ *
34
+ * This function will be allowed to read from your Convex database. It will not 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 const internalQuery = internalQueryGeneric;
40
+
41
+ /**
42
+ * Define a mutation in this Convex app's public API.
43
+ *
44
+ * This function will be allowed to modify your Convex database and will be accessible from the client.
45
+ *
46
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
47
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
48
+ */
49
+ export const mutation = mutationGeneric;
50
+
51
+ /**
52
+ * Define a mutation that is only accessible from other Convex functions (but not from the client).
53
+ *
54
+ * This function will be allowed to modify your Convex database. It will not 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 const internalMutation = internalMutationGeneric;
60
+
61
+ /**
62
+ * Define an action in this Convex app's public API.
63
+ *
64
+ * An action is a function which can execute any JavaScript code, including non-deterministic
65
+ * code and code with side-effects, like calling third-party services.
66
+ * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
67
+ * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
68
+ *
69
+ * @param func - The action. It receives an {@link ActionCtx} as its first argument.
70
+ * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
71
+ */
72
+ export const action = actionGeneric;
73
+
74
+ /**
75
+ * Define an action that is only accessible from other Convex functions (but not from the client).
76
+ *
77
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument.
78
+ * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
79
+ */
80
+ export const internalAction = internalActionGeneric;
81
+
82
+ /**
83
+ * Define an HTTP action.
84
+ *
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.
92
+ */
93
+ export const httpAction = httpActionGeneric;
94
+
95
+ /**
96
+ * Typesafe environment variables.
97
+ *
98
+ * This includes platform-provided env vars and any variables declared in
99
+ * `convex.config.ts`.
100
+ */
101
+ export const env = process.env;
@@ -0,0 +1,3 @@
1
+ import { defineSchema } from 'convex/server';
2
+
3
+ export default defineSchema({});