import * as convex_server from 'convex/server'; import { TableNamesInDataModel, DataModelFromSchemaDefinition, SystemTableNames } from 'convex/server'; import * as convex_values from 'convex/values'; import { GenericId } from 'convex/values'; /** * @module NotificationSchema * @package @geenius/notifications-convex * @description Defines the mergeable Convex table contract for notification * inbox entries and persisted delivery preferences. Consumers can spread these * tables into a larger application schema while the package exports a default * schema for its own packaged queries and mutations. */ /** * Mergeable Convex tables exposed for consumer schema composition. */ declare const notificationsTables: { notifications: convex_server.TableDefinition | undefined; readAt?: string | undefined; type: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system"; channel: "in-app" | "email" | "push" | "sms"; status: "unread" | "read" | "dismissed"; title: string; body: string; userId: string; createdAt: string; }, { type: convex_values.VUnion<"info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system", [convex_values.VLiteral<"info", "required">, convex_values.VLiteral<"success", "required">, convex_values.VLiteral<"warning", "required">, convex_values.VLiteral<"error", "required">, convex_values.VLiteral<"mention", "required">, convex_values.VLiteral<"invite", "required">, convex_values.VLiteral<"payment", "required">, convex_values.VLiteral<"system", "required">], "required", never>; title: convex_values.VString; body: convex_values.VString; channel: convex_values.VUnion<"in-app" | "email" | "push" | "sms", [convex_values.VLiteral<"in-app", "required">, convex_values.VLiteral<"email", "required">, convex_values.VLiteral<"push", "required">, convex_values.VLiteral<"sms", "required">], "required", never>; status: convex_values.VUnion<"unread" | "read" | "dismissed", [convex_values.VLiteral<"unread", "required">, convex_values.VLiteral<"read", "required">, convex_values.VLiteral<"dismissed", "required">], "required", never>; userId: convex_values.VString; actorId: convex_values.VString; actorName: convex_values.VString; actorAvatar: convex_values.VString; resourceType: convex_values.VString; resourceId: convex_values.VString; resourceUrl: convex_values.VString; actionLabel: convex_values.VString; actionUrl: convex_values.VString; metadata: convex_values.VRecord | undefined, convex_values.VString, convex_values.VUnion, convex_values.VFloat64, convex_values.VBoolean, convex_values.VNull], "required", never>, "optional", string>; createdAt: convex_values.VString; readAt: convex_values.VString; }, "required", "type" | "channel" | "status" | "title" | "body" | "userId" | "actorId" | "actorName" | "actorAvatar" | "resourceType" | "resourceId" | "resourceUrl" | "actionLabel" | "actionUrl" | "metadata" | "createdAt" | "readAt" | `metadata.${string}`>, { by_userId_status: ["userId", "status", "_creationTime"]; by_userId_createdAt: ["userId", "createdAt", "_creationTime"]; by_type: ["type", "_creationTime"]; by_resourceId: ["resourceId", "_creationTime"]; }, {}, {}>; notification_preferences: convex_server.TableDefinition; channels: convex_values.VObject<{ "in-app": boolean; email: boolean; push: boolean; sms: boolean; }, { 'in-app': convex_values.VBoolean; email: convex_values.VBoolean; push: convex_values.VBoolean; sms: convex_values.VBoolean; }, "required", "in-app" | "email" | "push" | "sms">; types: convex_values.VObject<{ info: boolean; success: boolean; warning: boolean; error: boolean; mention: boolean; invite: boolean; payment: boolean; system: boolean; }, { info: convex_values.VBoolean; success: convex_values.VBoolean; warning: convex_values.VBoolean; error: convex_values.VBoolean; mention: convex_values.VBoolean; invite: convex_values.VBoolean; payment: convex_values.VBoolean; system: convex_values.VBoolean; }, "required", "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system">; quietHours: convex_values.VObject<{ start: string; end: string; } | undefined, { start: convex_values.VString; end: convex_values.VString; }, "optional", "start" | "end">; timezone: convex_values.VString; }, "required", "userId" | "channels" | "types" | "quietHours" | "timezone" | "channels.in-app" | "channels.email" | "channels.push" | "channels.sms" | "types.info" | "types.success" | "types.warning" | "types.error" | "types.mention" | "types.invite" | "types.payment" | "types.system" | "quietHours.start" | "quietHours.end">, { by_userId: ["userId", "_creationTime"]; }, {}, {}>; }; /** * Default Convex schema export used by the packaged notifications backend. */ declare const schema: convex_server.SchemaDefinition<{ notifications: convex_server.TableDefinition | undefined; readAt?: string | undefined; type: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system"; channel: "in-app" | "email" | "push" | "sms"; status: "unread" | "read" | "dismissed"; title: string; body: string; userId: string; createdAt: string; }, { type: convex_values.VUnion<"info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system", [convex_values.VLiteral<"info", "required">, convex_values.VLiteral<"success", "required">, convex_values.VLiteral<"warning", "required">, convex_values.VLiteral<"error", "required">, convex_values.VLiteral<"mention", "required">, convex_values.VLiteral<"invite", "required">, convex_values.VLiteral<"payment", "required">, convex_values.VLiteral<"system", "required">], "required", never>; title: convex_values.VString; body: convex_values.VString; channel: convex_values.VUnion<"in-app" | "email" | "push" | "sms", [convex_values.VLiteral<"in-app", "required">, convex_values.VLiteral<"email", "required">, convex_values.VLiteral<"push", "required">, convex_values.VLiteral<"sms", "required">], "required", never>; status: convex_values.VUnion<"unread" | "read" | "dismissed", [convex_values.VLiteral<"unread", "required">, convex_values.VLiteral<"read", "required">, convex_values.VLiteral<"dismissed", "required">], "required", never>; userId: convex_values.VString; actorId: convex_values.VString; actorName: convex_values.VString; actorAvatar: convex_values.VString; resourceType: convex_values.VString; resourceId: convex_values.VString; resourceUrl: convex_values.VString; actionLabel: convex_values.VString; actionUrl: convex_values.VString; metadata: convex_values.VRecord | undefined, convex_values.VString, convex_values.VUnion, convex_values.VFloat64, convex_values.VBoolean, convex_values.VNull], "required", never>, "optional", string>; createdAt: convex_values.VString; readAt: convex_values.VString; }, "required", "type" | "channel" | "status" | "title" | "body" | "userId" | "actorId" | "actorName" | "actorAvatar" | "resourceType" | "resourceId" | "resourceUrl" | "actionLabel" | "actionUrl" | "metadata" | "createdAt" | "readAt" | `metadata.${string}`>, { by_userId_status: ["userId", "status", "_creationTime"]; by_userId_createdAt: ["userId", "createdAt", "_creationTime"]; by_type: ["type", "_creationTime"]; by_resourceId: ["resourceId", "_creationTime"]; }, {}, {}>; notification_preferences: convex_server.TableDefinition; channels: convex_values.VObject<{ "in-app": boolean; email: boolean; push: boolean; sms: boolean; }, { 'in-app': convex_values.VBoolean; email: convex_values.VBoolean; push: convex_values.VBoolean; sms: convex_values.VBoolean; }, "required", "in-app" | "email" | "push" | "sms">; types: convex_values.VObject<{ info: boolean; success: boolean; warning: boolean; error: boolean; mention: boolean; invite: boolean; payment: boolean; system: boolean; }, { info: convex_values.VBoolean; success: convex_values.VBoolean; warning: convex_values.VBoolean; error: convex_values.VBoolean; mention: convex_values.VBoolean; invite: convex_values.VBoolean; payment: convex_values.VBoolean; system: convex_values.VBoolean; }, "required", "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system">; quietHours: convex_values.VObject<{ start: string; end: string; } | undefined, { start: convex_values.VString; end: convex_values.VString; }, "optional", "start" | "end">; timezone: convex_values.VString; }, "required", "userId" | "channels" | "types" | "quietHours" | "timezone" | "channels.in-app" | "channels.email" | "channels.push" | "channels.sms" | "types.info" | "types.success" | "types.warning" | "types.error" | "types.mention" | "types.invite" | "types.payment" | "types.system" | "quietHours.start" | "quietHours.end">, { by_userId: ["userId", "_creationTime"]; }, {}, {}>; }, true>; /* eslint-disable */ /** * THIS CODE IS AUTOMATICALLY GENERATED by @geenius/db codegen. * * Template version: 1.34-r2 * Generated at: 2026-04-13 * Convex SDK: ^1.34.0 * * DO NOT EDIT THIS FILE MANUALLY. * To regenerate, run: geenius-convex-codegen * @module */ type TableNames = TableNamesInDataModel; type Id = GenericId; type DataModel = DataModelFromSchemaDefinition; /** * Creates a single notification for a user. * * @param args Notification data to insert. * @returns The inserted notification document identifier. */ declare const createNotification: convex_server.RegisteredMutation<"public", { channel?: "in-app" | "email" | "push" | "sms" | undefined; actorId?: string | undefined; actorName?: string | undefined; actorAvatar?: string | undefined; resourceType?: string | undefined; resourceId?: string | undefined; resourceUrl?: string | undefined; actionLabel?: string | undefined; actionUrl?: string | undefined; metadata?: Record | undefined; type: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system"; title: string; body: string; userId: string; }, Promise>>; /** * Marks a single notification as read. * * @param args.notificationId Notification document identifier. * @returns Nothing. */ declare const markRead: convex_server.RegisteredMutation<"public", { notificationId: convex_values.GenericId<"notifications">; }, Promise>; /** * Marks every unread notification for a user as read. * * @param args.userId Target user identifier. * @returns Nothing. */ declare const markAllRead: convex_server.RegisteredMutation<"public", { userId: string; }, Promise>; /** * Dismisses a notification without deleting it. * * @param args.notificationId Notification document identifier. * @returns Nothing. */ declare const dismissNotification: convex_server.RegisteredMutation<"public", { notificationId: convex_values.GenericId<"notifications">; }, Promise>; /** * Permanently deletes a notification. * * @param args.notificationId Notification document identifier. * @returns Nothing. */ declare const deleteNotification: convex_server.RegisteredMutation<"public", { notificationId: convex_values.GenericId<"notifications">; }, Promise>; /** * Creates or updates notification preferences for a user. * * @param args Preference updates to persist. * @returns Nothing. */ declare const updatePreferences: convex_server.RegisteredMutation<"public", { channels?: { "in-app": boolean; email: boolean; push: boolean; sms: boolean; } | undefined; types?: { info: boolean; success: boolean; warning: boolean; error: boolean; mention: boolean; invite: boolean; payment: boolean; system: boolean; } | undefined; quietHours?: { start: string; end: string; } | undefined; timezone?: string | undefined; userId: string; }, Promise>; /** * Creates multiple notifications in a single mutation. * * @param args.items Notification records to insert. * @returns Identifiers for the inserted notifications. */ declare const bulkCreateNotifications: convex_server.RegisteredMutation<"public", { items: { channel?: "in-app" | "email" | "push" | "sms" | undefined; actorId?: string | undefined; actorName?: string | undefined; actorAvatar?: string | undefined; resourceType?: string | undefined; resourceId?: string | undefined; resourceUrl?: string | undefined; actionLabel?: string | undefined; actionUrl?: string | undefined; metadata?: Record | undefined; type: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system"; title: string; body: string; userId: string; }[]; }, Promise[]>>; declare const mutations_bulkCreateNotifications: typeof bulkCreateNotifications; declare const mutations_createNotification: typeof createNotification; declare const mutations_deleteNotification: typeof deleteNotification; declare const mutations_dismissNotification: typeof dismissNotification; declare const mutations_markAllRead: typeof markAllRead; declare const mutations_markRead: typeof markRead; declare const mutations_updatePreferences: typeof updatePreferences; declare namespace mutations { export { mutations_bulkCreateNotifications as bulkCreateNotifications, mutations_createNotification as createNotification, mutations_deleteNotification as deleteNotification, mutations_dismissNotification as dismissNotification, mutations_markAllRead as markAllRead, mutations_markRead as markRead, mutations_updatePreferences as updatePreferences }; } /** * @module NotificationQueries * @package @geenius/notifications-convex * @description Defines publishable Convex query functions for notification * inbox data, unread counts, and user preference lookups. */ /** * Lists notifications for a user, with optional status and type filtering. * * @param args.userId Target user identifier. * @param args.status Optional status filter. * @param args.type Optional type filter. * @param args.limit Optional result limit. * @returns Notifications ordered from newest to oldest. */ declare const listNotifications: convex_server.RegisteredQuery<"public", { type?: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system" | undefined; status?: "unread" | "read" | "dismissed" | undefined; limit?: number | undefined; userId: string; }, Promise<{ _id: convex_values.GenericId<"notifications">; _creationTime: number; actorId?: string | undefined; actorName?: string | undefined; actorAvatar?: string | undefined; resourceType?: string | undefined; resourceId?: string | undefined; resourceUrl?: string | undefined; actionLabel?: string | undefined; actionUrl?: string | undefined; metadata?: Record | undefined; readAt?: string | undefined; type: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system"; channel: "in-app" | "email" | "push" | "sms"; status: "unread" | "read" | "dismissed"; title: string; body: string; userId: string; createdAt: string; }[]>>; /** * Counts unread notifications for a single user. * * @param args.userId Target user identifier. * @returns Total unread notification count. */ declare const getUnreadCount: convex_server.RegisteredQuery<"public", { userId: string; }, Promise>; /** * Looks up persisted notification preferences for a user. * * @param args.userId Target user identifier. * @returns The stored preference document, or `null` when absent. */ declare const getNotificationPreferences: convex_server.RegisteredQuery<"public", { userId: string; }, Promise<{ _id: convex_values.GenericId<"notification_preferences">; _creationTime: number; quietHours?: { start: string; end: string; } | undefined; timezone?: string | undefined; userId: string; channels: { "in-app": boolean; email: boolean; push: boolean; sms: boolean; }; types: { info: boolean; success: boolean; warning: boolean; error: boolean; mention: boolean; invite: boolean; payment: boolean; system: boolean; }; } | null>>; /** * Lists the most recent notifications for activity summaries. * * @param args.userId Target user identifier. * @param args.limit Optional result limit. * @returns Recent notification records ordered from newest to oldest. */ declare const listRecentActivity: convex_server.RegisteredQuery<"public", { limit?: number | undefined; userId: string; }, Promise<{ _id: convex_values.GenericId<"notifications">; _creationTime: number; actorId?: string | undefined; actorName?: string | undefined; actorAvatar?: string | undefined; resourceType?: string | undefined; resourceId?: string | undefined; resourceUrl?: string | undefined; actionLabel?: string | undefined; actionUrl?: string | undefined; metadata?: Record | undefined; readAt?: string | undefined; type: "info" | "success" | "warning" | "error" | "mention" | "invite" | "payment" | "system"; channel: "in-app" | "email" | "push" | "sms"; status: "unread" | "read" | "dismissed"; title: string; body: string; userId: string; createdAt: string; }[]>>; declare const queries_getNotificationPreferences: typeof getNotificationPreferences; declare const queries_getUnreadCount: typeof getUnreadCount; declare const queries_listNotifications: typeof listNotifications; declare const queries_listRecentActivity: typeof listRecentActivity; declare namespace queries { export { queries_getNotificationPreferences as getNotificationPreferences, queries_getUnreadCount as getUnreadCount, queries_listNotifications as listNotifications, queries_listRecentActivity as listRecentActivity }; } export { mutations, notificationsTables, queries, schema };