basalt / webhooks-prisma/src / PrismaWebhookStore
Class: PrismaWebhookStore
Defined in: webhooks-prisma/src/index.ts:100
Where webhook subscriptions live. Default in-memory; back it with a DB in production.
Implements
Constructors
Constructor
> new PrismaWebhookStore(client, options?): PrismaWebhookStore
Defined in: webhooks-prisma/src/index.ts:103
Parameters
client
options?
PrismaWebhookStoreOptions = {}
Returns
PrismaWebhookStore
Methods
add()
> add(endpoint): Promise<WebhookEndpoint>
Defined in: webhooks-prisma/src/index.ts:123
Adds an endpoint. Re-adding an existing id replaces it only within its own scope (same tenant, or global); an id held by another scope must be refused (the bundled stores throw WebhookEndpointIdInUseError). The check belongs in the store's write — the manager's own check-before-write cannot close the race between two concurrent registrations.
Parameters
endpoint
Omit<WebhookEndpoint, "id"> & object
Returns
Promise<WebhookEndpoint>
Implementation of
forEvent()
> forEvent(event, tenantId?): Promise<WebhookEndpoint[]>
Defined in: webhooks-prisma/src/index.ts:110
Active endpoints subscribed to event, fail-closed on tenancy: with a tenantId, that tenant's endpoints plus tenant-agnostic ones; WITHOUT one (or with null/''), tenant-agnostic endpoints ONLY — never every tenant's. A deliberate system-wide read goes through list() instead.
Parameters
event
string
tenantId?
string
Returns
Promise<WebhookEndpoint[]>
Implementation of
list()
> list(tenantId?): Promise<WebhookEndpoint[]>
Defined in: webhooks-prisma/src/index.ts:171
Parameters
tenantId?
string
Returns
Promise<WebhookEndpoint[]>
Implementation of
remove()
> remove(id, tenantId?): Promise<void>
Defined in: webhooks-prisma/src/index.ts:165
Removes an endpoint. When tenantId is given, only if it owns the endpoint.
Parameters
id
string
tenantId?
string
Returns
Promise<void>