feat(core-shared): add PII and retention type primitives

Introduces PiiCategory, DataProcessingPurpose, RetentionTrigger,
RetentionAction, FieldPii, FieldRetention, PAYLOAD_AUTH_PII_DEFAULTS,
PurgeSchedule, and CollectionRetention in core-shared/payload/.
Augments payload's FieldCustom and CollectionCustom interfaces via
ambient declaration so downstream collection configs gain typed
custom.pii and custom.retention / custom.authPii fields.

Credential fields (password, salt, hash, resetPasswordToken,
resetPasswordExpiration, loginAttempts, lockUntil, apiKey, apiKeyIndex)
are null in PAYLOAD_AUTH_PII_DEFAULTS to exclude security material
from DPA mapping. Adds @vitest/coverage-v8 and coverage exclusions
for boilerplate infrastructure files so coverage:diff is gated on
new executable code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 18:23:24 +00:00
parent c298f396b1
commit a94e8032b5
9 changed files with 296 additions and 12 deletions

View File

@@ -1,18 +1,18 @@
{
"generatedAt": "2026-05-18T15:54:10.661Z",
"commit": "065ca1b",
"generatedAt": "2026-05-18T18:22:54.558Z",
"commit": "c298f39",
"repo": {
"statements": 95.92,
"branches": 89.18,
"functions": 100,
"lines": 95.92,
"statements": 96.34,
"branches": 91.4,
"functions": 96.75,
"lines": 96.34,
"counts": {
"lf": 3165,
"lh": 3036,
"brf": 499,
"brh": 445,
"fnf": 152,
"fnh": 152
"lf": 4100,
"lh": 3950,
"brf": 767,
"brh": 701,
"fnf": 246,
"fnh": 238
}
},
"byPackage": {
@@ -58,6 +58,20 @@
"fnh": 10
}
},
"@repo/core-shared": {
"statements": 97.75,
"branches": 95.52,
"functions": 91.49,
"lines": 97.75,
"counts": {
"lf": 935,
"lh": 914,
"brf": 268,
"brh": 256,
"fnf": 94,
"fnh": 86
}
},
"@repo/marketing-pages": {
"statements": 95.64,
"branches": 83.93,