Skip to content

basalt / activity/src / ActivityOptions

Interface: ActivityOptions ​

Defined in: activity/src/index.ts:143

Properties ​

onRuleError? ​

> optional onRuleError?: (error, rule) => void

Defined in: activity/src/index.ts:172

Called when a rule throws. Default: a warning on the console.

A rule never rethrows. HookBus propagates to the emitter, which is right for an audit trail — a fact you failed to record must not be reported as recorded — and wrong for a readable feed: a history line that cannot be written must not fail the case closure that produced it.

Parameters ​

error ​

unknown

rule ​

ActivityRule

Returns ​

void


rules? ​

> optional rules?: ActivityRule<string>[]

Defined in: activity/src/index.ts:163

Rules turning domain events into feed lines.


store? ​

> optional store?: ActivityStore

Defined in: activity/src/index.ts:144


tenantScoped? ​

> optional tenantScoped?: boolean | "required"

Defined in: activity/src/index.ts:161

Scope queries to ctx().tenant automatically. Default: true.

  • true (default): auto-scope when a tenant is in context — the context tenant always wins over a caller-supplied query.tenantId (it cannot widen the scope); with NO tenant in context an explicit query.tenantId is honoured, otherwise the query runs unscoped (fail-open, historical behavior).
  • 'required': fail-closed via @basaltkit/tenancy's requireTenantId — the context tenant always wins (a caller-supplied query.tenantId cannot widen the scope), an explicit query.tenantId is honoured when no tenant is in context, and otherwise the query THROWS TenantRequiredError instead of silently returning every tenant's records. Recommended for tenant-facing apps.
  • false: never auto-scope.

Released under the MIT License.