Skip to content
Draft
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
4 changes: 4 additions & 0 deletions src/component/_generated/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
mutableContent?: boolean;
numPreviousFailures: number;
priority?: "default" | "normal" | "high";
richContent?: { audio?: string; image?: string; video?: string };
sound?: string | null;
state:
| "awaiting_delivery"
Expand Down Expand Up @@ -93,6 +94,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
mutableContent?: boolean;
numPreviousFailures: number;
priority?: "default" | "normal" | "high";
richContent?: { audio?: string; image?: string; video?: string };
sound?: string | null;
state:
| "awaiting_delivery"
Expand Down Expand Up @@ -168,6 +170,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
| "time-sensitive";
mutableContent?: boolean;
priority?: "default" | "normal" | "high";
richContent?: { audio?: string; image?: string; video?: string };
sound?: string | null;
subtitle?: string;
title?: string;
Expand Down Expand Up @@ -200,6 +203,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
| "time-sensitive";
mutableContent?: boolean;
priority?: "default" | "normal" | "high";
richContent?: { audio?: string; image?: string; video?: string };
sound?: string | null;
subtitle?: string;
title?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/component/_generated/dataModel.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
5 changes: 0 additions & 5 deletions src/component/_generated/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ export const internalAction: ActionBuilder<DataModel, "internal"> =
*/
export const httpAction: HttpActionBuilder = httpActionGeneric;

type GenericCtx =
| GenericActionCtx<DataModel>
| GenericMutationCtx<DataModel>
| GenericQueryCtx<DataModel>;

/**
* A set of services for use within Convex query functions.
*
Expand Down
19 changes: 19 additions & 0 deletions src/component/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export const notificationFields = {
channelId: v.optional(v.string()),
categoryId: v.optional(v.string()),
mutableContent: v.optional(v.boolean()),
richContent: v.optional(
v.object({
image: v.optional(v.string()),
audio: v.optional(v.string()),
video: v.optional(v.string()),
}),
),
};

/**
Expand Down Expand Up @@ -143,6 +150,18 @@ export type NotificationFields = {
* Defaults to false.
*/
mutableContent?: boolean;

/**
* iOS Only
*
* Rich content to display with the notification.
* Contains URLs to media files (image, audio, or video) to be displayed with the notification.
*/
richContent?: {
image?: string;
audio?: string;
video?: string;
};
};

export const notificationState = v.union(
Expand Down
Loading