NotificationSubscriptionModel
Defined in: packages/core/src/models/notification-subscription.ts:22
Data operations for per-user notification subscriptions.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NotificationSubscriptionModel(
db,tables?):NotificationSubscriptionModel
Defined in: packages/core/src/models/notification-subscription.ts:30
Parameters
Section titled “Parameters”Database adapter.
tables?
Section titled “tables?”NotificationSubscriptionTables
Table handles (defaults to the adapter’s tables).
Returns
Section titled “Returns”NotificationSubscriptionModel
Methods
Section titled “Methods”getFor()
Section titled “getFor()”getFor(
projectId,userId):Promise<NotificationSubscriptionRow|null>
Defined in: packages/core/src/models/notification-subscription.ts:36
Fetch a user’s subscription for a project, or null (null = silent).
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<NotificationSubscriptionRow | null>
list()
Section titled “list()”list(
projectId):Promise<NotificationSubscriptionRow[]>
Defined in: packages/core/src/models/notification-subscription.ts:47
List all subscriptions for a project (admin audit).
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”Promise<NotificationSubscriptionRow[]>
listForUser()
Section titled “listForUser()”listForUser(
userId):Promise<NotificationSubscriptionRow[]>
Defined in: packages/core/src/models/notification-subscription.ts:54
List all subscriptions for a user (profile overview).
Parameters
Section titled “Parameters”userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<NotificationSubscriptionRow[]>
remove()
Section titled “remove()”remove(
projectId,userId):Promise<void>
Defined in: packages/core/src/models/notification-subscription.ts:86
Remove a user’s subscription (opt out).
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<void>
upsert()
Section titled “upsert()”upsert(
projectId,userId,input):Promise<NotificationSubscriptionRow>
Defined in: packages/core/src/models/notification-subscription.ts:61
Create or replace a user’s subscription for a project.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<NotificationSubscriptionRow>
eventsOf()
Section titled “eventsOf()”
staticeventsOf(row):string[]
Defined in: packages/core/src/models/notification-subscription.ts:94
Decode the JSON-serialized event list of a subscription.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string[]
viaOf()
Section titled “viaOf()”
staticviaOf(row):string[]
Defined in: packages/core/src/models/notification-subscription.ts:99
Decode the JSON-serialized channel list of a subscription.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string[]