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:
22
packages/core-dsr/src/data-export.interface.ts
Normal file
22
packages/core-dsr/src/data-export.interface.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { DsrFormat, UserDataBundle } from "./dsr-types";
|
||||
|
||||
/**
|
||||
* GDPR Art. 15 (right of access) + Art. 20 (right to data portability).
|
||||
*
|
||||
* Implementations walk all Payload collections with `custom.subject` linkage,
|
||||
* segment rows by role (self/owner vs reference), and filter to fields marked
|
||||
* `exportable: true` in `custom.pii`.
|
||||
*/
|
||||
export interface IDataExport {
|
||||
/**
|
||||
* Export all personal data held for the given subject.
|
||||
*
|
||||
* @param subjectId - The subject's canonical ID (e.g. users.id).
|
||||
* @param format - "json" for a plain JSON bundle; "json-ld" attaches the
|
||||
* @context from `contexts/user-data.jsonld`.
|
||||
*/
|
||||
exportSubjectData(
|
||||
subjectId: string,
|
||||
format: DsrFormat,
|
||||
): Promise<UserDataBundle>;
|
||||
}
|
||||
Reference in New Issue
Block a user