Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 21 additions & 230 deletions convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ import type {
FunctionReference,
} from "convex/server";

/**
* A utility for referencing Convex functions in your app's API.
*
* Usage:
* ```js
* const myFunctionReference = api.myModule.myFunction;
* ```
*/
declare const fullApi: ApiFromModules<{
admin: typeof admin;
apiKeys: typeof apiKeys;
Expand All @@ -71,235 +63,34 @@ declare const fullApi: ApiFromModules<{
subchats: typeof subchats;
summarize: typeof summarize;
}>;
declare const fullApiWithMounts: typeof fullApi;

/**
* A utility for referencing Convex functions in your app's public API.
*
* Usage:
* ```js
* const myFunctionReference = api.myModule.myFunction;
* ```
*/
export declare const api: FilterApi<
typeof fullApiWithMounts,
typeof fullApi,
FunctionReference<any, "public">
>;

/**
* A utility for referencing Convex functions in your app's internal API.
*
* Usage:
* ```js
* const myFunctionReference = internal.myModule.myFunction;
* ```
*/
export declare const internal: FilterApi<
typeof fullApiWithMounts,
typeof fullApi,
FunctionReference<any, "internal">
>;

export declare const components: {
rateLimiter: {
lib: {
checkRateLimit: FunctionReference<
"query",
"internal",
{
config:
| {
capacity?: number;
kind: "token bucket";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: null;
}
| {
capacity?: number;
kind: "fixed window";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: number;
};
count?: number;
key?: string;
name: string;
reserve?: boolean;
throws?: boolean;
},
{ ok: true; retryAfter?: number } | { ok: false; retryAfter: number }
>;
clearAll: FunctionReference<
"mutation",
"internal",
{ before?: number },
null
>;
getServerTime: FunctionReference<"mutation", "internal", {}, number>;
getValue: FunctionReference<
"query",
"internal",
{
config:
| {
capacity?: number;
kind: "token bucket";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: null;
}
| {
capacity?: number;
kind: "fixed window";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: number;
};
key?: string;
name: string;
sampleShards?: number;
},
{
config:
| {
capacity?: number;
kind: "token bucket";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: null;
}
| {
capacity?: number;
kind: "fixed window";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: number;
};
shard: number;
ts: number;
value: number;
}
>;
rateLimit: FunctionReference<
"mutation",
"internal",
{
config:
| {
capacity?: number;
kind: "token bucket";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: null;
}
| {
capacity?: number;
kind: "fixed window";
maxReserved?: number;
period: number;
rate: number;
shards?: number;
start?: number;
};
count?: number;
key?: string;
name: string;
reserve?: boolean;
throws?: boolean;
},
{ ok: true; retryAfter?: number } | { ok: false; retryAfter: number }
>;
resetRateLimit: FunctionReference<
"mutation",
"internal",
{ key?: string; name: string },
null
>;
};
time: {
getServerTime: FunctionReference<"mutation", "internal", {}, number>;
};
};
migrations: {
lib: {
cancel: FunctionReference<
"mutation",
"internal",
{ name: string },
{
batchSize?: number;
cursor?: string | null;
error?: string;
isDone: boolean;
latestEnd?: number;
latestStart: number;
name: string;
next?: Array<string>;
processed: number;
state: "inProgress" | "success" | "failed" | "canceled" | "unknown";
}
>;
cancelAll: FunctionReference<
"mutation",
"internal",
{ sinceTs?: number },
Array<{
batchSize?: number;
cursor?: string | null;
error?: string;
isDone: boolean;
latestEnd?: number;
latestStart: number;
name: string;
next?: Array<string>;
processed: number;
state: "inProgress" | "success" | "failed" | "canceled" | "unknown";
}>
>;
clearAll: FunctionReference<
"mutation",
"internal",
{ before?: number },
null
>;
getStatus: FunctionReference<
"query",
"internal",
{ limit?: number; names?: Array<string> },
Array<{
batchSize?: number;
cursor?: string | null;
error?: string;
isDone: boolean;
latestEnd?: number;
latestStart: number;
name: string;
next?: Array<string>;
processed: number;
state: "inProgress" | "success" | "failed" | "canceled" | "unknown";
}>
>;
migrate: FunctionReference<
"mutation",
"internal",
{
batchSize?: number;
cursor?: string | null;
dryRun: boolean;
fnHandle: string;
name: string;
next?: Array<{ fnHandle: string; name: string }>;
},
{
batchSize?: number;
cursor?: string | null;
error?: string;
isDone: boolean;
latestEnd?: number;
latestStart: number;
name: string;
next?: Array<string>;
processed: number;
state: "inProgress" | "success" | "failed" | "canceled" | "unknown";
}
>;
};
};
rateLimiter: import("@convex-dev/rate-limiter/_generated/component.js").ComponentApi<"rateLimiter">;
migrations: import("@convex-dev/migrations/_generated/component.js").ComponentApi<"migrations">;
};
2 changes: 1 addition & 1 deletion convex/_generated/dataModel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export type Doc<TableName extends TableNames> = DocumentByName<
* Convex documents are uniquely identified by their `Id`, which is accessible
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
*
* Documents can be loaded using `db.get(id)` in query and mutation functions.
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
*
* IDs are just strings at runtime, but this type can be used to distinguish them from other
* strings when type checking.
Expand Down
33 changes: 23 additions & 10 deletions convex/_generated/server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import {
ActionBuilder,
AnyComponents,
HttpActionBuilder,
MutationBuilder,
QueryBuilder,
Expand All @@ -19,14 +18,19 @@ import {
GenericQueryCtx,
GenericDatabaseReader,
GenericDatabaseWriter,
FunctionReference,
} from "convex/server";
import type { DataModel } from "./dataModel.js";

type GenericCtx =
| GenericActionCtx<DataModel>
| GenericMutationCtx<DataModel>
| GenericQueryCtx<DataModel>;
/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
type Env = {
readonly CONVEX_CLOUD_URL: string;
readonly CONVEX_SITE_URL: string;
};

/**
* Define a query in this Convex app's public API.
Expand Down Expand Up @@ -92,15 +96,24 @@ export declare const internalAction: ActionBuilder<DataModel, "internal">;
/**
* Define an HTTP action.
*
* This function will be used to respond to HTTP requests received by a Convex
* deployment if the requests matches the path and method where this action
* is routed. Be sure to route your action in `convex/http.js`.
* The wrapped function will be used to respond to HTTP requests received
* by a Convex deployment if the requests matches the path and method where
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
*
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
* @param func - The function. It receives an {@link ActionCtx} as its first argument
* and a Fetch API `Request` object as its second.
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
*/
export declare const httpAction: HttpActionBuilder;

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
export declare const env: Env;

/**
* A set of services for use within Convex query functions.
*
Expand Down
21 changes: 16 additions & 5 deletions convex/_generated/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
internalActionGeneric,
internalMutationGeneric,
internalQueryGeneric,
componentsGeneric,
} from "convex/server";

/**
Expand Down Expand Up @@ -81,10 +80,22 @@ export const action = actionGeneric;
export const internalAction = internalActionGeneric;

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

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
export const env = process.env;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@codemirror/view": "^6.35.0",
"@convex-dev/ai-sdk-google": "1.2.17",
"@convex-dev/design-system": "0.1.11",
"@convex-dev/migrations": "^0.2.8",
"@convex-dev/rate-limiter": "^0.2.9",
"@convex-dev/migrations": "0.3.4",
"@convex-dev/rate-limiter": "^0.3.2",
"@convex-dev/workos": "^0.0.1",
"@fast-check/vitest": "^0.2.1",
"@heroicons/react": "^2.2.0",
Expand Down Expand Up @@ -98,7 +98,7 @@
"chefshot": "workspace:*",
"classnames": "^2.5.1",
"cloudflare": "^4.2.0",
"convex": "^1.31.2",
"convex": "^1.46.0",
"convex-helpers": "^0.1.108",
"date-fns": "^3.6.0",
"diff": "^5.2.0",
Expand Down
Loading
Loading