Skip to content

NotificationChannelModel

Defined in: packages/core/src/models/notification-channel.ts:39

Data operations for notification channels.

new NotificationChannelModel(db, tables?, secret?): NotificationChannelModel

Defined in: packages/core/src/models/notification-channel.ts:49

DatabaseAdapter

Database adapter.

NotificationChannelTables

Table handles (defaults to the adapter’s tables).

SecretInput

Server secret for channel-secret encryption.

NotificationChannelModel

create(input): Promise<NotificationChannelRow>

Defined in: packages/core/src/models/notification-channel.ts:70

Create a channel (secret encrypted at rest when provided).

NotificationChannelCreateInput

Promise<NotificationChannelRow>


decryptSecret(row): string

Defined in: packages/core/src/models/notification-channel.ts:127

Decrypt the secret for a stored row (in memory only, at send time).

NotificationChannelRow

string


get(id): Promise<NotificationChannelRow | null>

Defined in: packages/core/src/models/notification-channel.ts:88

Fetch a channel by id, or null.

string

Promise<NotificationChannelRow | null>


list(projectId): Promise<NotificationChannelRow[]>

Defined in: packages/core/src/models/notification-channel.ts:56

List channels for a project.

string

Promise<NotificationChannelRow[]>


listSystem(): Promise<NotificationChannelRow[]>

Defined in: packages/core/src/models/notification-channel.ts:63

List site-wide admin channels (project_id IS NULL).

Promise<NotificationChannelRow[]>


recordOutcome(id, error?): Promise<void>

Defined in: packages/core/src/models/notification-channel.ts:138

Record the outcome of a delivery attempt: the sanitized error with its time, or nothing to clear a previous error. Skips the write when the row is already in that state.

string

string

Promise<void>


remove(id): Promise<void>

Defined in: packages/core/src/models/notification-channel.ts:97

Remove a channel by id.

string

Promise<void>


toView(row): NotificationChannel | null

Defined in: packages/core/src/models/notification-channel.ts:105

Turn a stored row into the send-ready view providers take, with the secret decrypted in memory. Returns null when the secret cannot be decrypted with the configured keys.

NotificationChannelRow

NotificationChannel | null


static configOf(row): Record<string, unknown>

Defined in: packages/core/src/models/notification-channel.ts:186

Decode the JSON-serialized config of a channel.

NotificationChannelRow

Record<string, unknown>


static eventsOf(row): string[]

Defined in: packages/core/src/models/notification-channel.ts:181

Decode the JSON-serialized event list of a channel.

NotificationChannelRow

string[]


static isStateKind(notifiers, provider): boolean

Defined in: packages/core/src/models/notification-channel.ts:175

Whether the provider kind delivers state (git hosts), so it needs a project and a token.

readonly NotifierProvider[]

string

boolean


static validateInput(notifiers, provider, config, scope?): ChannelValidation

Defined in: packages/core/src/models/notification-channel.ts:153

Validate channel input against the matching notifier’s schema. With scope, also enforce what state providers (git hosts) need: a project and a token.

readonly NotifierProvider[]

string

unknown

boolean

string | null

ChannelValidation