compliance-profiles
Lets each tenant select a compliance regime (e.g. eu-dsgvo, swiss-dsg, de-hr-dsgvo-hgb) that bundles user-rights grace periods, breach-disclosure deadlines, sub-processor requirements, and audit-retention rules into a single named profile. Tenant admins call compliance-profiles:write:set-profile to choose a profile (with optional JSON override for edge cases); other features resolve the effective profile via the compliance.forTenant cross-feature API. Required by user-data-rights — mount this feature before it.
Quick example
Section titled “Quick example”From recipes-compliance-profiles-demo — the smallest working mount:
// Compliance-Profiles Demo//// Same App-Code, two different tenants, two different DSGVO-Profile —// das ist die Sales-Story von Compliance-Profiles. Tenant-Admin waehlt// einmal beim Onboarding, danach laufen alle User-Rights-Grace-Periods,// Notification-Sprachen, Breach-Disclosure-Pflichten und Audit-Log-// Retentions automatisch profil-spezifisch.//// Demo-Szenario:// Tenant A (DACH-Customer) → eu-dsgvo// - 30d Grace-Period fuer Forget// - DE/EN-Notifications// - Aufsicht: BlnBDI Berlin//// Tenant B (Swiss-Customer) → swiss-dsg// - 30d Grace-Period (geerbt aus eu-dsgvo via extends)// - DE/FR/IT/EN-Notifications// - Aufsicht: EDÖB Bern//// Beide Tenants laufen auf derselben App-Instance. Das compliance-// profiles-Feature haelt den Profile-State pro Tenant; jedes consumer-// Feature ruft `compliance.forTenant` (Sprint 2+) und sieht das// effektive Profile fuer den aktuellen Tenant.
import { createComplianceProfilesFeature } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles";
export const complianceProfilesDemoFeatures = [createComplianceProfilesFeature()];📄 On GitHub: samples/recipes/compliance-profiles-demo/src/feature.ts
How it fits
Section titled “How it fits”What this feature needs to run (Requires, top) and the write commands it provides (Provides, bottom).
flowchart TB
n_compliance_profiles["compliance-profiles"]
subgraph how_provides["Provides"]
n_cmd_compliance_profiles_write_set_profile(["set-profile"])
end
n_compliance_profiles --> n_cmd_compliance_profiles_write_set_profile
Provides — write commands this feature registers (dispatch them through the command bus):
Getting started
Section titled “Getting started”Start with recipes-compliance-profiles-demo for a step-by-step walkthrough with runnable code and integration tests.
Dependencies
Section titled “Dependencies”- Requires: none
- Activation: always on (not toggleable)
Extensions & cross-feature APIs
Section titled “Extensions & cross-feature APIs”- Exposes API:
compliance.forTenant