server.js RawHistoryFolder
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
11import {
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 */
29export 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 */
39export 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 */
49export 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 */
59export 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 */
72export 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 */
80export 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 */
93export 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 */
101export const env = process.env;