- Introduced user status management with the ability to update online, busy, offline, and away statuses. - Added metadata fields for user preferences, including phrase preferences and friends list. - Updated API and database schema to accommodate new user fields. - Enhanced the authentication component to handle additional user data effectively. - Implemented hooks for socket management and OLM setup to improve user experience.
1214 lines
35 KiB
TypeScript
1214 lines
35 KiB
TypeScript
/* eslint-disable */
|
|
/**
|
|
* Generated `api` utility.
|
|
*
|
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
*
|
|
* To regenerate, run `npx convex dev`.
|
|
* @module
|
|
*/
|
|
|
|
import type * as auth from "../auth.js";
|
|
import type * as http from "../http.js";
|
|
|
|
import type {
|
|
ApiFromModules,
|
|
FilterApi,
|
|
FunctionReference,
|
|
} from "convex/server";
|
|
|
|
declare const fullApi: ApiFromModules<{
|
|
auth: typeof auth;
|
|
http: typeof http;
|
|
}>;
|
|
|
|
/**
|
|
* 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 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 fullApi,
|
|
FunctionReference<any, "internal">
|
|
>;
|
|
|
|
export declare const components: {
|
|
betterAuth: {
|
|
adapter: {
|
|
create: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{
|
|
input:
|
|
| {
|
|
data: {
|
|
createdAt: number;
|
|
displayUsername?: null | string;
|
|
email: string;
|
|
emailVerified: boolean;
|
|
friends?: Array<string>;
|
|
image?: null | string;
|
|
metadata?: {
|
|
phrasePreference: "comforting" | "mocking" | "both";
|
|
};
|
|
name: string;
|
|
status?: {
|
|
isUserSet: boolean;
|
|
status: "online" | "busy" | "offline" | "away";
|
|
};
|
|
updatedAt: number;
|
|
userId?: null | string;
|
|
username?: null | string;
|
|
};
|
|
model: "user";
|
|
}
|
|
| {
|
|
data: {
|
|
createdAt: number;
|
|
expiresAt: number;
|
|
ipAddress?: null | string;
|
|
token: string;
|
|
updatedAt: number;
|
|
userAgent?: null | string;
|
|
userId: string;
|
|
};
|
|
model: "session";
|
|
}
|
|
| {
|
|
data: {
|
|
accessToken?: null | string;
|
|
accessTokenExpiresAt?: null | number;
|
|
accountId: string;
|
|
createdAt: number;
|
|
idToken?: null | string;
|
|
password?: null | string;
|
|
providerId: string;
|
|
refreshToken?: null | string;
|
|
refreshTokenExpiresAt?: null | number;
|
|
scope?: null | string;
|
|
updatedAt: number;
|
|
userId: string;
|
|
};
|
|
model: "account";
|
|
}
|
|
| {
|
|
data: {
|
|
createdAt: number;
|
|
expiresAt: number;
|
|
identifier: string;
|
|
updatedAt: number;
|
|
value: string;
|
|
};
|
|
model: "verification";
|
|
}
|
|
| {
|
|
data: {
|
|
createdAt: number;
|
|
privateKey: string;
|
|
publicKey: string;
|
|
};
|
|
model: "jwks";
|
|
}
|
|
| {
|
|
data: {
|
|
identityKey: { curve25519: string; ed25519: string };
|
|
oneTimeKeys: Array<{ keyId: string; publicKey: string }>;
|
|
userId: string;
|
|
};
|
|
model: "olmAccount";
|
|
};
|
|
onCreateHandle?: string;
|
|
select?: Array<string>;
|
|
},
|
|
any
|
|
>;
|
|
deleteMany: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{
|
|
input:
|
|
| {
|
|
model: "user";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "name"
|
|
| "email"
|
|
| "emailVerified"
|
|
| "image"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "userId"
|
|
| "username"
|
|
| "displayUsername"
|
|
| "metadata"
|
|
| "status"
|
|
| "friends"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "session";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "expiresAt"
|
|
| "token"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "ipAddress"
|
|
| "userAgent"
|
|
| "userId"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "account";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "accountId"
|
|
| "providerId"
|
|
| "userId"
|
|
| "accessToken"
|
|
| "refreshToken"
|
|
| "idToken"
|
|
| "accessTokenExpiresAt"
|
|
| "refreshTokenExpiresAt"
|
|
| "scope"
|
|
| "password"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "verification";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "identifier"
|
|
| "value"
|
|
| "expiresAt"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "jwks";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "publicKey" | "privateKey" | "createdAt" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "olmAccount";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "userId" | "identityKey" | "oneTimeKeys" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
};
|
|
onDeleteHandle?: string;
|
|
paginationOpts: {
|
|
cursor: string | null;
|
|
endCursor?: string | null;
|
|
id?: number;
|
|
maximumBytesRead?: number;
|
|
maximumRowsRead?: number;
|
|
numItems: number;
|
|
};
|
|
},
|
|
any
|
|
>;
|
|
deleteOne: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{
|
|
input:
|
|
| {
|
|
model: "user";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "name"
|
|
| "email"
|
|
| "emailVerified"
|
|
| "image"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "userId"
|
|
| "username"
|
|
| "displayUsername"
|
|
| "metadata"
|
|
| "status"
|
|
| "friends"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "session";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "expiresAt"
|
|
| "token"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "ipAddress"
|
|
| "userAgent"
|
|
| "userId"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "account";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "accountId"
|
|
| "providerId"
|
|
| "userId"
|
|
| "accessToken"
|
|
| "refreshToken"
|
|
| "idToken"
|
|
| "accessTokenExpiresAt"
|
|
| "refreshTokenExpiresAt"
|
|
| "scope"
|
|
| "password"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "verification";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "identifier"
|
|
| "value"
|
|
| "expiresAt"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "jwks";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "publicKey" | "privateKey" | "createdAt" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "olmAccount";
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "userId" | "identityKey" | "oneTimeKeys" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
};
|
|
onDeleteHandle?: string;
|
|
},
|
|
any
|
|
>;
|
|
findMany: FunctionReference<
|
|
"query",
|
|
"internal",
|
|
{
|
|
limit?: number;
|
|
model:
|
|
| "user"
|
|
| "session"
|
|
| "account"
|
|
| "verification"
|
|
| "jwks"
|
|
| "olmAccount";
|
|
offset?: number;
|
|
paginationOpts: {
|
|
cursor: string | null;
|
|
endCursor?: string | null;
|
|
id?: number;
|
|
maximumBytesRead?: number;
|
|
maximumRowsRead?: number;
|
|
numItems: number;
|
|
};
|
|
sortBy?: { direction: "asc" | "desc"; field: string };
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: string;
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
},
|
|
any
|
|
>;
|
|
findOne: FunctionReference<
|
|
"query",
|
|
"internal",
|
|
{
|
|
model:
|
|
| "user"
|
|
| "session"
|
|
| "account"
|
|
| "verification"
|
|
| "jwks"
|
|
| "olmAccount";
|
|
select?: Array<string>;
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: string;
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
},
|
|
any
|
|
>;
|
|
updateMany: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{
|
|
input:
|
|
| {
|
|
model: "user";
|
|
update: {
|
|
createdAt?: number;
|
|
displayUsername?: null | string;
|
|
email?: string;
|
|
emailVerified?: boolean;
|
|
friends?: Array<string>;
|
|
image?: null | string;
|
|
metadata?: {
|
|
phrasePreference: "comforting" | "mocking" | "both";
|
|
};
|
|
name?: string;
|
|
status?: {
|
|
isUserSet: boolean;
|
|
status: "online" | "busy" | "offline" | "away";
|
|
};
|
|
updatedAt?: number;
|
|
userId?: null | string;
|
|
username?: null | string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "name"
|
|
| "email"
|
|
| "emailVerified"
|
|
| "image"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "userId"
|
|
| "username"
|
|
| "displayUsername"
|
|
| "metadata"
|
|
| "status"
|
|
| "friends"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "session";
|
|
update: {
|
|
createdAt?: number;
|
|
expiresAt?: number;
|
|
ipAddress?: null | string;
|
|
token?: string;
|
|
updatedAt?: number;
|
|
userAgent?: null | string;
|
|
userId?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "expiresAt"
|
|
| "token"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "ipAddress"
|
|
| "userAgent"
|
|
| "userId"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "account";
|
|
update: {
|
|
accessToken?: null | string;
|
|
accessTokenExpiresAt?: null | number;
|
|
accountId?: string;
|
|
createdAt?: number;
|
|
idToken?: null | string;
|
|
password?: null | string;
|
|
providerId?: string;
|
|
refreshToken?: null | string;
|
|
refreshTokenExpiresAt?: null | number;
|
|
scope?: null | string;
|
|
updatedAt?: number;
|
|
userId?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "accountId"
|
|
| "providerId"
|
|
| "userId"
|
|
| "accessToken"
|
|
| "refreshToken"
|
|
| "idToken"
|
|
| "accessTokenExpiresAt"
|
|
| "refreshTokenExpiresAt"
|
|
| "scope"
|
|
| "password"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "verification";
|
|
update: {
|
|
createdAt?: number;
|
|
expiresAt?: number;
|
|
identifier?: string;
|
|
updatedAt?: number;
|
|
value?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "identifier"
|
|
| "value"
|
|
| "expiresAt"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "jwks";
|
|
update: {
|
|
createdAt?: number;
|
|
privateKey?: string;
|
|
publicKey?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "publicKey" | "privateKey" | "createdAt" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "olmAccount";
|
|
update: {
|
|
identityKey?: { curve25519: string; ed25519: string };
|
|
oneTimeKeys?: Array<{ keyId: string; publicKey: string }>;
|
|
userId?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "userId" | "identityKey" | "oneTimeKeys" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
};
|
|
onUpdateHandle?: string;
|
|
paginationOpts: {
|
|
cursor: string | null;
|
|
endCursor?: string | null;
|
|
id?: number;
|
|
maximumBytesRead?: number;
|
|
maximumRowsRead?: number;
|
|
numItems: number;
|
|
};
|
|
},
|
|
any
|
|
>;
|
|
updateOne: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{
|
|
input:
|
|
| {
|
|
model: "user";
|
|
update: {
|
|
createdAt?: number;
|
|
displayUsername?: null | string;
|
|
email?: string;
|
|
emailVerified?: boolean;
|
|
friends?: Array<string>;
|
|
image?: null | string;
|
|
metadata?: {
|
|
phrasePreference: "comforting" | "mocking" | "both";
|
|
};
|
|
name?: string;
|
|
status?: {
|
|
isUserSet: boolean;
|
|
status: "online" | "busy" | "offline" | "away";
|
|
};
|
|
updatedAt?: number;
|
|
userId?: null | string;
|
|
username?: null | string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "name"
|
|
| "email"
|
|
| "emailVerified"
|
|
| "image"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "userId"
|
|
| "username"
|
|
| "displayUsername"
|
|
| "metadata"
|
|
| "status"
|
|
| "friends"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "session";
|
|
update: {
|
|
createdAt?: number;
|
|
expiresAt?: number;
|
|
ipAddress?: null | string;
|
|
token?: string;
|
|
updatedAt?: number;
|
|
userAgent?: null | string;
|
|
userId?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "expiresAt"
|
|
| "token"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "ipAddress"
|
|
| "userAgent"
|
|
| "userId"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "account";
|
|
update: {
|
|
accessToken?: null | string;
|
|
accessTokenExpiresAt?: null | number;
|
|
accountId?: string;
|
|
createdAt?: number;
|
|
idToken?: null | string;
|
|
password?: null | string;
|
|
providerId?: string;
|
|
refreshToken?: null | string;
|
|
refreshTokenExpiresAt?: null | number;
|
|
scope?: null | string;
|
|
updatedAt?: number;
|
|
userId?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "accountId"
|
|
| "providerId"
|
|
| "userId"
|
|
| "accessToken"
|
|
| "refreshToken"
|
|
| "idToken"
|
|
| "accessTokenExpiresAt"
|
|
| "refreshTokenExpiresAt"
|
|
| "scope"
|
|
| "password"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "verification";
|
|
update: {
|
|
createdAt?: number;
|
|
expiresAt?: number;
|
|
identifier?: string;
|
|
updatedAt?: number;
|
|
value?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field:
|
|
| "identifier"
|
|
| "value"
|
|
| "expiresAt"
|
|
| "createdAt"
|
|
| "updatedAt"
|
|
| "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "jwks";
|
|
update: {
|
|
createdAt?: number;
|
|
privateKey?: string;
|
|
publicKey?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "publicKey" | "privateKey" | "createdAt" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
}
|
|
| {
|
|
model: "olmAccount";
|
|
update: {
|
|
identityKey?: { curve25519: string; ed25519: string };
|
|
oneTimeKeys?: Array<{ keyId: string; publicKey: string }>;
|
|
userId?: string;
|
|
};
|
|
where?: Array<{
|
|
connector?: "AND" | "OR";
|
|
field: "userId" | "identityKey" | "oneTimeKeys" | "_id";
|
|
operator?:
|
|
| "lt"
|
|
| "lte"
|
|
| "gt"
|
|
| "gte"
|
|
| "eq"
|
|
| "in"
|
|
| "not_in"
|
|
| "ne"
|
|
| "contains"
|
|
| "starts_with"
|
|
| "ends_with";
|
|
value:
|
|
| string
|
|
| number
|
|
| boolean
|
|
| Array<string>
|
|
| Array<number>
|
|
| null;
|
|
}>;
|
|
};
|
|
onUpdateHandle?: string;
|
|
},
|
|
any
|
|
>;
|
|
};
|
|
olm: {
|
|
index: {
|
|
retrieveServerOlmAccount: FunctionReference<
|
|
"query",
|
|
"internal",
|
|
{ userId: string },
|
|
any
|
|
>;
|
|
sendKeysToServer: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{
|
|
forceInsert: boolean;
|
|
identityKey: { curve25519: string; ed25519: string };
|
|
oneTimeKeys: Array<{ keyId: string; publicKey: string }>;
|
|
userId: string;
|
|
},
|
|
any
|
|
>;
|
|
};
|
|
};
|
|
user: {
|
|
index: {
|
|
updateUserStatus: FunctionReference<
|
|
"mutation",
|
|
"internal",
|
|
{ isUserSet: boolean; status: string },
|
|
any
|
|
>;
|
|
};
|
|
};
|
|
};
|
|
};
|