Return the tenant resolved for this request context, or undefined.
Create a tenant-scoped repository for the given entity type. Throws TenantNotResolvedError if no tenant is resolved.
The current request context
Entity name for scoping
A tenant-scoped repository
Create a tenant-scoped repository for the given entity type, scoped to
the tenant id GIVEN — no IRequestContext required. This is the entry
point for non-HTTP work (an ingress behaviour, a queue processor, a
scheduled job), where no request exists to resolve a tenant from; the
caller reads the tenant id from the work item's own payload. Modelled on
prefixCacheKey — this interface's other ctx-free, id-taking
member.
The id is TRUSTED INPUT: nothing resolves it, so a caller passing a
user-controlled value bypasses the resolved tenant. On the HTTP path use
getRepository, which reads the middleware-resolved
ctx.request.tenant.
The tenant id to scope the repository to (trusted input)
Entity name for scoping
A tenant-scoped repository
Build a cache key that includes the tenant id, joined by the separator
the plugin was configured with (cache.separator, default ':'). The
separator is deliberately NOT a per-call argument: this method is the
single home for separator resolution, so the middleware's ctx.state
prefix and a caller's key can never disagree.
The resolved tenant id
The base cache key
The prefixed cache key
Multi-tenancy service — exposes tenant context, repository creation, and cache-key helpers.
Since
0.1.0