feat(core-dsr): scaffold package + GDPR DSR interfaces and types
- Add pnpm turbo gen core-package dsr generator template and register dsr in CORE_PACKAGE_GENERATORS / choices list - Run generator to produce packages/core-dsr/ shell - Define IDataExport (Art. 15/20), IDataDelete (Art. 17), IDataRectify (Art. 16), IProcessingRestriction (Art. 18) interfaces - Add UserDataBundle and DeletionCertificate types in dsr-types.ts - Ship core-dsr/contexts/user-data.jsonld schema.org JSON-LD @context - Wire @repo/core-dsr into transpilePackages (web-next) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
29
packages/core-dsr/src/data-delete.interface.ts
Normal file
29
packages/core-dsr/src/data-delete.interface.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { DeletionCertificate, DeletionMode } from "./dsr-types";
|
||||
|
||||
/**
|
||||
* GDPR Art. 17 (right to erasure / "right to be forgotten").
|
||||
*
|
||||
* Two modes:
|
||||
*
|
||||
* - `"soft"` — sets `processingRestrictedAt`, NULLs all `exportable: true`
|
||||
* PII fields, and redacts `reference`-role linked fields to null. The row
|
||||
* structure is preserved so other subjects' data in shared rows remains
|
||||
* intact. Emits one RESTRICT audit entry per affected collection.
|
||||
*
|
||||
* - `"cascade-hard"` — hard-deletes `self` and `owner` rows immediately, then
|
||||
* redacts `reference` fields. Auth-guarded at the procedure layer; must not
|
||||
* be called from user-facing flows. Emits DELETE audit entries.
|
||||
*/
|
||||
export interface IDataDelete {
|
||||
/**
|
||||
* Delete or erase all personal data held for the given subject.
|
||||
*
|
||||
* @param subjectId - The subject's canonical ID.
|
||||
* @param mode - Deletion strategy (soft redaction vs hard cascade).
|
||||
* @returns A signed `DeletionCertificate` linking to the audit log entry.
|
||||
*/
|
||||
deleteSubjectData(
|
||||
subjectId: string,
|
||||
mode: DeletionMode,
|
||||
): Promise<DeletionCertificate>;
|
||||
}
|
||||
Reference in New Issue
Block a user