| Layer | The question |
|---|---|
| Declare | What is this data, and whose rules apply? |
| Enforce | Encrypt it, hide it, gate it, keep it only so long, keep it here. |
| Prove | Show an auditor. |
@Jurisdiction, @Personal and the age gate, checked when the class loads.@Security switches on the controls GDPR, HIPAA, PCI DSS or SOC 2 expect.prorm audit: code rules, database probes, checklist statuses, SARIF.prorm audit looks at the@Jurisdiction. You name the regimes a modelimport { Jurisdiction, Personal, DataSubjectAge, ParentalConsent, Table, Column, DataTypes, Model } from 'ts-prorm-orm';
@Jurisdiction('EU', 'US-CA')
@Table({ tableName: 'patients' })
class Patient extends Model {
@Personal('identifier', { basis: 'contract', subject: true })
@Column(DataTypes.STRING) declare name: string;
@Personal('health', { basis: 'consent', purpose: 'treatment', retention: 'P5Y' })
@Column(DataTypes.TEXT) declare notes: string;
@DataSubjectAge() @Column(DataTypes.DATEONLY) declare birthday: string;
@ParentalConsent() @Column(DataTypes.BOOLEAN) declare guardianConsented: boolean;
}@Security. You name the standardsimport { Security, SecurityFramework, setupSecurity } from 'ts-prorm-orm';
@Security({
frameworks: [SecurityFramework.GDPR, SecurityFramework.HIPAA],
encrypt: ['ssn'],
mask: { ssn: 'ssn' },
retention: { years: 7 },
})
class Patient extends Model { /* … */ }
setupSecurity(Patient, prorm); // wires the deferred hooks@Jurisdiction('EU') and @Security({
frameworks: [GDPR] }) is told what it may hold and has the controls GDPRapplyCompliance()src/compliance is a set of narrow, single-purpose pieces built on the ORM's| Area | Pieces |
|---|---|
| Jurisdictions | JURISDICTIONS, jurisdiction(), resolve(), @Jurisdiction, @Personal, @DataSubjectAge, @ParentalConsent, applyCompliance(), complianceSheet(), renderComplianceSheet() |
| Frameworks | @Security, @Table, @Database, setupSecurity(), setupAllSecurity(), SecurityFramework, FrameworkRequirements |
| Classification & discovery | DataClassifier (@Classify, @FieldClassification), SensitiveDataDiscovery |
| Protection | FieldEncryption, DataMasker, PseudonymizationService, RowLevelSecurity, SessionIsolation, TLSEnforcer, QueryFirewall, RateLimiter |
| Subject rights | DSARWorkflow, RightToErasure, DataPortabilityExporter, ConsentRecord, ConsentVersioning, PrivacyImpactAssessment |
| Lifecycle & integrity | DataRetentionPolicy, ImmutableRecord, WORMStorage, ComplianceAuditTrail, DataLineage, BackupVerification, BreachDetector, SecurityMonitor |
| Residency | CrossBorderLog, the residency rules inside every jurisdiction |
GRANTs, TLS, column encryption at rest — prefer it. A database-enforced ruleAS_OF tells you the