@tantainnovative/create-ndpr 0.1.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -5
- package/bin/index.mjs +146 -11
- package/package.json +14 -4
- package/templates/drizzle-schema.ts +92 -7
- package/templates/express-consent-route.ts +111 -5
- package/templates/express-cross-border-route.ts +317 -0
- package/templates/express-dpia-route.ts +287 -0
- package/templates/express-lawful-basis-route.ts +292 -0
- package/templates/express-setup.ts +262 -3
- package/templates/github-ndpr-audit.yml +31 -0
- package/templates/ndpr-audit.json +14 -0
- package/templates/nextjs-breach-route.ts +133 -1
- package/templates/nextjs-consent-route.ts +93 -28
- package/templates/nextjs-cross-border-route.ts +325 -0
- package/templates/nextjs-dpia-route.ts +290 -0
- package/templates/nextjs-dsr-route.ts +84 -3
- package/templates/nextjs-lawful-basis-route.ts +297 -0
- package/templates/nextjs-layout.tsx +12 -3
- package/templates/prisma-schema.prisma +63 -5
|
@@ -27,6 +27,7 @@ import React from 'react';
|
|
|
27
27
|
import { NDPRProvider } from '@tantainnovative/ndpr-toolkit/core';
|
|
28
28
|
import { NDPRConsent } from '@tantainnovative/ndpr-toolkit/presets';
|
|
29
29
|
import { apiAdapter } from '@tantainnovative/ndpr-toolkit/adapters';
|
|
30
|
+
import type { ConsentSettings } from '@tantainnovative/ndpr-toolkit/core';
|
|
30
31
|
|
|
31
32
|
interface NDPRLayoutProps {
|
|
32
33
|
children: React.ReactNode;
|
|
@@ -42,9 +43,17 @@ export default function NDPRLayout({ children, userId }: NDPRLayoutProps) {
|
|
|
42
43
|
const subjectId = userId ?? 'anonymous';
|
|
43
44
|
|
|
44
45
|
// apiAdapter connects the consent banner to the /api/consent route.
|
|
45
|
-
//
|
|
46
|
-
// server-side usage in Server Components or Route Handlers
|
|
47
|
-
|
|
46
|
+
// Typed as <ConsentSettings> so the banner's onSave payload matches.
|
|
47
|
+
// For server-side usage in Server Components or Route Handlers, see
|
|
48
|
+
// the recipes under /docs/recipes/.
|
|
49
|
+
const consentStorageAdapter = apiAdapter<ConsentSettings>(
|
|
50
|
+
`/api/consent?subjectId=${subjectId}`,
|
|
51
|
+
{
|
|
52
|
+
credentials: 'same-origin',
|
|
53
|
+
// Add a CSRF header here if your app requires one:
|
|
54
|
+
// headers: () => ({ 'X-CSRF-Token': getCsrfToken() }),
|
|
55
|
+
},
|
|
56
|
+
);
|
|
48
57
|
|
|
49
58
|
return (
|
|
50
59
|
<NDPRProvider
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
// DPO: {{DPO_EMAIL}}
|
|
4
4
|
//
|
|
5
5
|
// Covers:
|
|
6
|
-
// - ConsentRecord
|
|
7
|
-
// - DSRRequest
|
|
8
|
-
// - BreachReport
|
|
9
|
-
// - ProcessingRecord
|
|
10
|
-
// -
|
|
6
|
+
// - ConsentRecord — NDPA §25–26 (consent & withdrawal)
|
|
7
|
+
// - DSRRequest — NDPA Part IV §34–38 (data subject rights)
|
|
8
|
+
// - BreachReport — NDPA §40 (72-hour breach notification)
|
|
9
|
+
// - ProcessingRecord — ROPA (accountability principle)
|
|
10
|
+
// - DPIARecord — NDPA §34(3) (impact assessments)
|
|
11
|
+
// - LawfulBasisRecord — NDPA §25 (lawful basis register)
|
|
12
|
+
// - CrossBorderTransferRecord — NDPA §41–42 (cross-border transfers)
|
|
13
|
+
// - ComplianceAuditLog — §44 audit trail
|
|
11
14
|
//
|
|
12
15
|
// Run `prisma migrate dev --name ndpr-init` to apply.
|
|
13
16
|
|
|
@@ -102,6 +105,61 @@ model ProcessingRecord {
|
|
|
102
105
|
@@map("ndpr_processing_records")
|
|
103
106
|
}
|
|
104
107
|
|
|
108
|
+
model DPIARecord {
|
|
109
|
+
id String @id @default(cuid())
|
|
110
|
+
projectName String
|
|
111
|
+
description String
|
|
112
|
+
dpiaData Json
|
|
113
|
+
overallRisk String
|
|
114
|
+
score Int
|
|
115
|
+
status String @default("draft")
|
|
116
|
+
conductedBy String
|
|
117
|
+
approvedBy String?
|
|
118
|
+
createdAt DateTime @default(now())
|
|
119
|
+
updatedAt DateTime @updatedAt
|
|
120
|
+
|
|
121
|
+
@@index([status])
|
|
122
|
+
@@index([conductedBy])
|
|
123
|
+
@@map("ndpr_dpia_records")
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
model LawfulBasisRecord {
|
|
127
|
+
id String @id @default(cuid())
|
|
128
|
+
activityName String
|
|
129
|
+
lawfulBasis String
|
|
130
|
+
justification String
|
|
131
|
+
dataCategories Json
|
|
132
|
+
purposes Json
|
|
133
|
+
assessedBy String
|
|
134
|
+
assessedAt DateTime @default(now())
|
|
135
|
+
reviewDate DateTime?
|
|
136
|
+
createdAt DateTime @default(now())
|
|
137
|
+
updatedAt DateTime @updatedAt
|
|
138
|
+
|
|
139
|
+
@@index([lawfulBasis])
|
|
140
|
+
@@index([assessedBy])
|
|
141
|
+
@@map("ndpr_lawful_basis_records")
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
model CrossBorderTransferRecord {
|
|
145
|
+
id String @id @default(cuid())
|
|
146
|
+
destinationCountry String
|
|
147
|
+
recipientName String
|
|
148
|
+
transferMechanism String
|
|
149
|
+
safeguards String
|
|
150
|
+
dataCategories Json
|
|
151
|
+
adequacyStatus String
|
|
152
|
+
ndpcApprovalRequired Boolean @default(false)
|
|
153
|
+
ndpcApprovalReference String?
|
|
154
|
+
riskLevel String
|
|
155
|
+
createdAt DateTime @default(now())
|
|
156
|
+
updatedAt DateTime @updatedAt
|
|
157
|
+
|
|
158
|
+
@@index([destinationCountry])
|
|
159
|
+
@@index([riskLevel])
|
|
160
|
+
@@map("ndpr_cross_border_transfer_records")
|
|
161
|
+
}
|
|
162
|
+
|
|
105
163
|
model ComplianceAuditLog {
|
|
106
164
|
id String @id @default(cuid())
|
|
107
165
|
module String
|