@tantainnovative/ndpr-toolkit 1.0.2 → 1.0.3

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.
Files changed (212) hide show
  1. package/.claude/settings.local.json +20 -0
  2. package/.eslintrc.json +10 -0
  3. package/.github/workflows/ci.yml +36 -0
  4. package/.github/workflows/nextjs.yml +104 -0
  5. package/.husky/commit-msg +4 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.lintstagedrc.js +4 -0
  8. package/.nvmrc +1 -0
  9. package/.versionrc +17 -0
  10. package/CHANGELOG.md +16 -0
  11. package/CLAUDE.md +90 -0
  12. package/CNAME +1 -0
  13. package/CONTRIBUTING.md +87 -0
  14. package/README.md +84 -447
  15. package/RELEASE-NOTES-v1.0.0.md +140 -0
  16. package/RELEASE-NOTES-v1.0.1.md +69 -0
  17. package/SECURITY.md +21 -0
  18. package/commitlint.config.js +36 -0
  19. package/components.json +21 -0
  20. package/eslint.config.mjs +16 -0
  21. package/jest.config.js +31 -0
  22. package/jest.setup.js +15 -0
  23. package/next.config.js +15 -0
  24. package/next.config.ts +62 -0
  25. package/package.json +70 -52
  26. package/packages/ndpr-toolkit/README.md +467 -0
  27. package/packages/ndpr-toolkit/jest.config.js +23 -0
  28. package/packages/ndpr-toolkit/package-lock.json +8197 -0
  29. package/packages/ndpr-toolkit/package.json +71 -0
  30. package/packages/ndpr-toolkit/rollup.config.js +34 -0
  31. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentBanner.test.tsx +119 -0
  32. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentManager.test.tsx +122 -0
  33. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentStorage.test.tsx +270 -0
  34. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRDashboard.test.tsx +199 -0
  35. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRRequestForm.test.tsx +224 -0
  36. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRTracker.test.tsx +104 -0
  37. package/packages/ndpr-toolkit/src/__tests__/hooks/useConsent.test.tsx +161 -0
  38. package/packages/ndpr-toolkit/src/__tests__/hooks/useDSR.test.tsx +330 -0
  39. package/packages/ndpr-toolkit/src/__tests__/utils/breach.test.ts +149 -0
  40. package/packages/ndpr-toolkit/src/__tests__/utils/consent.test.ts +88 -0
  41. package/packages/ndpr-toolkit/src/__tests__/utils/dpia.test.ts +160 -0
  42. package/packages/ndpr-toolkit/src/__tests__/utils/dsr.test.ts +110 -0
  43. package/packages/ndpr-toolkit/src/__tests__/utils/privacy.test.ts +97 -0
  44. package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +701 -0
  45. package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +631 -0
  46. package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +569 -0
  47. package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +496 -0
  48. package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +270 -0
  49. package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +217 -0
  50. package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +206 -0
  51. package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +342 -0
  52. package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +373 -0
  53. package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +174 -0
  54. package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +717 -0
  55. package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +476 -0
  56. package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +620 -0
  57. package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +541 -0
  58. package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +454 -0
  59. package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +333 -0
  60. package/packages/ndpr-toolkit/src/hooks/useBreach.ts +409 -0
  61. package/packages/ndpr-toolkit/src/hooks/useConsent.ts +263 -0
  62. package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +457 -0
  63. package/packages/ndpr-toolkit/src/hooks/useDSR.ts +236 -0
  64. package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +428 -0
  65. package/{dist/index.d.ts → packages/ndpr-toolkit/src/index.ts} +13 -0
  66. package/packages/ndpr-toolkit/src/setupTests.ts +5 -0
  67. package/packages/ndpr-toolkit/src/types/breach.ts +283 -0
  68. package/packages/ndpr-toolkit/src/types/consent.ts +111 -0
  69. package/packages/ndpr-toolkit/src/types/dpia.ts +236 -0
  70. package/packages/ndpr-toolkit/src/types/dsr.ts +192 -0
  71. package/packages/ndpr-toolkit/src/types/index.ts +42 -0
  72. package/packages/ndpr-toolkit/src/types/privacy.ts +246 -0
  73. package/packages/ndpr-toolkit/src/utils/breach.ts +122 -0
  74. package/packages/ndpr-toolkit/src/utils/consent.ts +51 -0
  75. package/packages/ndpr-toolkit/src/utils/dpia.ts +104 -0
  76. package/packages/ndpr-toolkit/src/utils/dsr.ts +77 -0
  77. package/packages/ndpr-toolkit/src/utils/privacy.ts +100 -0
  78. package/packages/ndpr-toolkit/tsconfig.json +23 -0
  79. package/postcss.config.mjs +5 -0
  80. package/public/NDPR TOOLKIT.svg +1 -0
  81. package/public/favicon/android-chrome-192x192.png +0 -0
  82. package/public/favicon/android-chrome-512x512.png +0 -0
  83. package/public/favicon/apple-touch-icon.png +0 -0
  84. package/public/favicon/favicon-16x16.png +0 -0
  85. package/public/favicon/favicon-32x32.png +0 -0
  86. package/public/favicon/site.webmanifest +1 -0
  87. package/public/file.svg +1 -0
  88. package/public/globe.svg +1 -0
  89. package/public/ndpr-toolkit-logo.svg +108 -0
  90. package/public/next.svg +1 -0
  91. package/public/vercel.svg +1 -0
  92. package/public/window.svg +1 -0
  93. package/src/__tests__/example.test.ts +13 -0
  94. package/src/__tests__/requestService.test.ts +57 -0
  95. package/src/app/accessibility.css +70 -0
  96. package/src/app/docs/components/DocLayout.tsx +267 -0
  97. package/src/app/docs/components/breach-notification/page.tsx +797 -0
  98. package/src/app/docs/components/consent-management/page.tsx +576 -0
  99. package/src/app/docs/components/data-subject-rights/page.tsx +511 -0
  100. package/src/app/docs/components/dpia-questionnaire/layout.tsx +15 -0
  101. package/src/app/docs/components/dpia-questionnaire/metadata.ts +31 -0
  102. package/src/app/docs/components/dpia-questionnaire/page.tsx +666 -0
  103. package/src/app/docs/components/hooks/page.tsx +305 -0
  104. package/src/app/docs/components/page.tsx +84 -0
  105. package/src/app/docs/components/privacy-policy-generator/page.tsx +634 -0
  106. package/src/app/docs/guides/breach-notification-process/components/BestPractices.tsx +123 -0
  107. package/src/app/docs/guides/breach-notification-process/components/ImplementationSteps.tsx +328 -0
  108. package/src/app/docs/guides/breach-notification-process/components/Introduction.tsx +28 -0
  109. package/src/app/docs/guides/breach-notification-process/components/NotificationTimeline.tsx +91 -0
  110. package/src/app/docs/guides/breach-notification-process/components/Resources.tsx +118 -0
  111. package/src/app/docs/guides/breach-notification-process/page.tsx +39 -0
  112. package/src/app/docs/guides/conducting-dpia/page.tsx +593 -0
  113. package/src/app/docs/guides/data-subject-requests/page.tsx +666 -0
  114. package/src/app/docs/guides/managing-consent/page.tsx +738 -0
  115. package/src/app/docs/guides/ndpr-compliance-checklist/components/ComplianceChecklist.tsx +296 -0
  116. package/src/app/docs/guides/ndpr-compliance-checklist/components/ImplementationTools.tsx +145 -0
  117. package/src/app/docs/guides/ndpr-compliance-checklist/components/Introduction.tsx +33 -0
  118. package/src/app/docs/guides/ndpr-compliance-checklist/components/KeyRequirements.tsx +99 -0
  119. package/src/app/docs/guides/ndpr-compliance-checklist/components/Resources.tsx +159 -0
  120. package/src/app/docs/guides/ndpr-compliance-checklist/page.tsx +38 -0
  121. package/src/app/docs/guides/page.tsx +67 -0
  122. package/src/app/docs/layout.tsx +15 -0
  123. package/src/app/docs/metadata.ts +31 -0
  124. package/src/app/docs/page.tsx +572 -0
  125. package/src/app/favicon.ico +0 -0
  126. package/src/app/globals.css +123 -0
  127. package/src/app/layout.tsx +37 -0
  128. package/src/app/ndpr-demos/breach/page.tsx +354 -0
  129. package/src/app/ndpr-demos/consent/page.tsx +366 -0
  130. package/src/app/ndpr-demos/dpia/page.tsx +495 -0
  131. package/src/app/ndpr-demos/dsr/page.tsx +280 -0
  132. package/src/app/ndpr-demos/page.tsx +73 -0
  133. package/src/app/ndpr-demos/policy/page.tsx +771 -0
  134. package/src/app/page.tsx +452 -0
  135. package/src/components/ErrorBoundary.tsx +90 -0
  136. package/src/components/breach-notification/BreachNotificationForm.tsx +479 -0
  137. package/src/components/consent/ConsentBanner.tsx +159 -0
  138. package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +419 -0
  139. package/src/components/docs/DocLayout.tsx +289 -0
  140. package/src/components/docs/index.ts +2 -0
  141. package/src/components/dpia/DPIAQuestionnaire.tsx +483 -0
  142. package/src/components/privacy-policy/PolicyGenerator.tsx +1062 -0
  143. package/src/components/privacy-policy/data.ts +98 -0
  144. package/src/components/privacy-policy/shared/CheckboxField.tsx +38 -0
  145. package/src/components/privacy-policy/shared/CheckboxGroup.tsx +85 -0
  146. package/src/components/privacy-policy/shared/FormField.tsx +79 -0
  147. package/src/components/privacy-policy/shared/StepIndicator.tsx +86 -0
  148. package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +335 -0
  149. package/src/components/privacy-policy/steps/DataCollectionStep.tsx +231 -0
  150. package/src/components/privacy-policy/steps/DataSharingStep.tsx +418 -0
  151. package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +202 -0
  152. package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +172 -0
  153. package/src/components/ui/Badge.tsx +46 -0
  154. package/src/components/ui/Button.tsx +59 -0
  155. package/src/components/ui/Card.tsx +92 -0
  156. package/src/components/ui/Checkbox.tsx +57 -0
  157. package/src/components/ui/FormField.tsx +50 -0
  158. package/src/components/ui/Input.tsx +38 -0
  159. package/src/components/ui/Loading.tsx +201 -0
  160. package/src/components/ui/Select.tsx +42 -0
  161. package/src/components/ui/TextArea.tsx +38 -0
  162. package/src/components/ui/label.tsx +24 -0
  163. package/src/components/ui/switch.tsx +31 -0
  164. package/src/components/ui/tabs.tsx +66 -0
  165. package/src/hooks/useConsent.ts +64 -0
  166. package/src/hooks/useLoadingState.ts +85 -0
  167. package/src/lib/consentService.ts +137 -0
  168. package/src/lib/dpiaQuestions.ts +148 -0
  169. package/src/lib/requestService.ts +75 -0
  170. package/src/lib/sanitize.ts +108 -0
  171. package/src/lib/storage.ts +222 -0
  172. package/src/lib/utils.ts +6 -0
  173. package/src/types/html-to-docx.d.ts +30 -0
  174. package/src/types/index.ts +72 -0
  175. package/tailwind.config.ts +65 -0
  176. package/tsconfig.json +41 -0
  177. package/dist/components/breach/BreachNotificationManager.d.ts +0 -62
  178. package/dist/components/breach/BreachReportForm.d.ts +0 -66
  179. package/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
  180. package/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
  181. package/dist/components/consent/ConsentBanner.d.ts +0 -79
  182. package/dist/components/consent/ConsentManager.d.ts +0 -73
  183. package/dist/components/consent/ConsentStorage.d.ts +0 -41
  184. package/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
  185. package/dist/components/dpia/DPIAReport.d.ts +0 -40
  186. package/dist/components/dpia/StepIndicator.d.ts +0 -64
  187. package/dist/components/dsr/DSRDashboard.d.ts +0 -58
  188. package/dist/components/dsr/DSRRequestForm.d.ts +0 -74
  189. package/dist/components/dsr/DSRTracker.d.ts +0 -56
  190. package/dist/components/policy/PolicyExporter.d.ts +0 -65
  191. package/dist/components/policy/PolicyGenerator.d.ts +0 -54
  192. package/dist/components/policy/PolicyPreview.d.ts +0 -71
  193. package/dist/hooks/useBreach.d.ts +0 -97
  194. package/dist/hooks/useConsent.d.ts +0 -63
  195. package/dist/hooks/useDPIA.d.ts +0 -92
  196. package/dist/hooks/useDSR.d.ts +0 -72
  197. package/dist/hooks/usePrivacyPolicy.d.ts +0 -87
  198. package/dist/index.esm.js +0 -2
  199. package/dist/index.esm.js.map +0 -1
  200. package/dist/index.js +0 -2
  201. package/dist/index.js.map +0 -1
  202. package/dist/setupTests.d.ts +0 -2
  203. package/dist/types/breach.d.ts +0 -239
  204. package/dist/types/consent.d.ts +0 -95
  205. package/dist/types/dpia.d.ts +0 -196
  206. package/dist/types/dsr.d.ts +0 -162
  207. package/dist/types/privacy.d.ts +0 -204
  208. package/dist/utils/breach.d.ts +0 -14
  209. package/dist/utils/consent.d.ts +0 -10
  210. package/dist/utils/dpia.d.ts +0 -12
  211. package/dist/utils/dsr.d.ts +0 -11
  212. package/dist/utils/privacy.d.ts +0 -12
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Represents a data breach category
3
+ */
4
+ export interface BreachCategory {
5
+ /**
6
+ * Unique identifier for the category
7
+ */
8
+ id: string;
9
+
10
+ /**
11
+ * Display name for the category
12
+ */
13
+ name: string;
14
+
15
+ /**
16
+ * Description of this breach category
17
+ */
18
+ description: string;
19
+
20
+ /**
21
+ * Default severity level for this category
22
+ */
23
+ defaultSeverity: 'low' | 'medium' | 'high' | 'critical';
24
+ }
25
+
26
+ /**
27
+ * Represents a data breach report
28
+ */
29
+ export interface BreachReport {
30
+ /**
31
+ * Unique identifier for the breach report
32
+ */
33
+ id: string;
34
+
35
+ /**
36
+ * Title/summary of the breach
37
+ */
38
+ title: string;
39
+
40
+ /**
41
+ * Detailed description of the breach
42
+ */
43
+ description: string;
44
+
45
+ /**
46
+ * Category of the breach
47
+ */
48
+ category: string;
49
+
50
+ /**
51
+ * Timestamp when the breach was discovered
52
+ */
53
+ discoveredAt: number;
54
+
55
+ /**
56
+ * Timestamp when the breach occurred (if known)
57
+ */
58
+ occurredAt?: number;
59
+
60
+ /**
61
+ * Timestamp when the breach was reported internally
62
+ */
63
+ reportedAt: number;
64
+
65
+ /**
66
+ * Person who reported the breach
67
+ */
68
+ reporter: {
69
+ name: string;
70
+ email: string;
71
+ department: string;
72
+ phone?: string;
73
+ };
74
+
75
+ /**
76
+ * Systems or data affected by the breach
77
+ */
78
+ affectedSystems: string[];
79
+
80
+ /**
81
+ * Types of data involved in the breach
82
+ */
83
+ dataTypes: string[];
84
+
85
+ /**
86
+ * Estimated number of data subjects affected
87
+ */
88
+ estimatedAffectedSubjects?: number;
89
+
90
+ /**
91
+ * Whether the breach is ongoing or contained
92
+ */
93
+ status: 'ongoing' | 'contained' | 'resolved';
94
+
95
+ /**
96
+ * Initial actions taken to address the breach
97
+ */
98
+ initialActions?: string;
99
+
100
+ /**
101
+ * Attachments related to the breach (e.g., screenshots, logs)
102
+ */
103
+ attachments?: Array<{
104
+ id: string;
105
+ name: string;
106
+ type: string;
107
+ url: string;
108
+ addedAt: number;
109
+ }>;
110
+ }
111
+
112
+ /**
113
+ * Represents a risk assessment for a data breach
114
+ */
115
+ export interface RiskAssessment {
116
+ /**
117
+ * Unique identifier for the risk assessment
118
+ */
119
+ id: string;
120
+
121
+ /**
122
+ * ID of the breach this assessment is for
123
+ */
124
+ breachId: string;
125
+
126
+ /**
127
+ * Timestamp when the assessment was conducted
128
+ */
129
+ assessedAt: number;
130
+
131
+ /**
132
+ * Person who conducted the assessment
133
+ */
134
+ assessor: {
135
+ name: string;
136
+ role: string;
137
+ email: string;
138
+ };
139
+
140
+ /**
141
+ * Confidentiality impact (1-5)
142
+ */
143
+ confidentialityImpact: number;
144
+
145
+ /**
146
+ * Integrity impact (1-5)
147
+ */
148
+ integrityImpact: number;
149
+
150
+ /**
151
+ * Availability impact (1-5)
152
+ */
153
+ availabilityImpact: number;
154
+
155
+ /**
156
+ * Likelihood of harm to data subjects (1-5)
157
+ */
158
+ harmLikelihood: number;
159
+
160
+ /**
161
+ * Severity of potential harm to data subjects (1-5)
162
+ */
163
+ harmSeverity: number;
164
+
165
+ /**
166
+ * Overall risk score
167
+ */
168
+ overallRiskScore: number;
169
+
170
+ /**
171
+ * Risk level based on the overall score
172
+ */
173
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
174
+
175
+ /**
176
+ * Whether the breach is likely to result in a risk to the rights and freedoms of data subjects
177
+ */
178
+ risksToRightsAndFreedoms: boolean;
179
+
180
+ /**
181
+ * Whether the breach is likely to result in a high risk to the rights and freedoms of data subjects
182
+ */
183
+ highRisksToRightsAndFreedoms: boolean;
184
+
185
+ /**
186
+ * Justification for the risk assessment
187
+ */
188
+ justification: string;
189
+ }
190
+
191
+ /**
192
+ * Represents notification requirements for a data breach
193
+ */
194
+ export interface NotificationRequirement {
195
+ /**
196
+ * Whether NITDA notification is required
197
+ */
198
+ nitdaNotificationRequired: boolean;
199
+
200
+ /**
201
+ * Deadline for NITDA notification (72 hours from discovery)
202
+ */
203
+ nitdaNotificationDeadline: number;
204
+
205
+ /**
206
+ * Whether data subject notification is required
207
+ */
208
+ dataSubjectNotificationRequired: boolean;
209
+
210
+ /**
211
+ * Justification for the notification decision
212
+ */
213
+ justification: string;
214
+ }
215
+
216
+ /**
217
+ * Represents a notification sent to NITDA
218
+ */
219
+ export interface RegulatoryNotification {
220
+ /**
221
+ * Unique identifier for the notification
222
+ */
223
+ id: string;
224
+
225
+ /**
226
+ * ID of the breach this notification is for
227
+ */
228
+ breachId: string;
229
+
230
+ /**
231
+ * Timestamp when the notification was sent
232
+ */
233
+ sentAt: number;
234
+
235
+ /**
236
+ * Method used to send the notification
237
+ */
238
+ method: 'email' | 'portal' | 'letter' | 'other';
239
+
240
+ /**
241
+ * Reference number assigned by NITDA (if available)
242
+ */
243
+ referenceNumber?: string;
244
+
245
+ /**
246
+ * Contact person at NITDA
247
+ */
248
+ nitdaContact?: {
249
+ name: string;
250
+ email: string;
251
+ phone?: string;
252
+ };
253
+
254
+ /**
255
+ * Content of the notification
256
+ */
257
+ content: string;
258
+
259
+ /**
260
+ * Attachments included with the notification
261
+ */
262
+ attachments?: Array<{
263
+ id: string;
264
+ name: string;
265
+ type: string;
266
+ url: string;
267
+ }>;
268
+
269
+ /**
270
+ * Follow-up communications with NITDA
271
+ */
272
+ followUps?: Array<{
273
+ timestamp: number;
274
+ direction: 'sent' | 'received';
275
+ content: string;
276
+ attachments?: Array<{
277
+ id: string;
278
+ name: string;
279
+ type: string;
280
+ url: string;
281
+ }>;
282
+ }>;
283
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Represents a consent option that can be presented to users
3
+ */
4
+ export interface ConsentOption {
5
+ /**
6
+ * Unique identifier for the consent option
7
+ */
8
+ id: string;
9
+
10
+ /**
11
+ * Display label for the consent option
12
+ */
13
+ label: string;
14
+
15
+ /**
16
+ * Detailed description of what this consent option covers
17
+ */
18
+ description: string;
19
+
20
+ /**
21
+ * Whether this consent option is required (cannot be declined)
22
+ */
23
+ required: boolean;
24
+
25
+ /**
26
+ * Default state of the consent option
27
+ * @default false
28
+ */
29
+ defaultValue?: boolean;
30
+ }
31
+
32
+ /**
33
+ * Represents the user's consent settings
34
+ */
35
+ export interface ConsentSettings {
36
+ /**
37
+ * Map of consent option IDs to boolean values indicating consent status
38
+ */
39
+ consents: Record<string, boolean>;
40
+
41
+ /**
42
+ * Timestamp when consent was last updated
43
+ */
44
+ timestamp: number;
45
+
46
+ /**
47
+ * Version of the consent form that was accepted
48
+ */
49
+ version: string;
50
+
51
+ /**
52
+ * Method used to collect consent (e.g., "banner", "settings", "api")
53
+ */
54
+ method: string;
55
+
56
+ /**
57
+ * Whether the user has actively made a choice (as opposed to default settings)
58
+ */
59
+ hasInteracted: boolean;
60
+ }
61
+
62
+ /**
63
+ * Represents the storage mechanism for consent settings
64
+ */
65
+ export interface ConsentStorageOptions {
66
+ /**
67
+ * Storage key for consent settings
68
+ * @default "ndpr_consent"
69
+ */
70
+ storageKey?: string;
71
+
72
+ /**
73
+ * Storage type to use
74
+ * @default "localStorage"
75
+ */
76
+ storageType?: 'localStorage' | 'sessionStorage' | 'cookie';
77
+
78
+ /**
79
+ * Cookie options (only used when storageType is "cookie")
80
+ */
81
+ cookieOptions?: {
82
+ /**
83
+ * Domain for the cookie
84
+ */
85
+ domain?: string;
86
+
87
+ /**
88
+ * Path for the cookie
89
+ * @default "/"
90
+ */
91
+ path?: string;
92
+
93
+ /**
94
+ * Expiration days for the cookie
95
+ * @default 365
96
+ */
97
+ expires?: number;
98
+
99
+ /**
100
+ * Whether the cookie should be secure
101
+ * @default true
102
+ */
103
+ secure?: boolean;
104
+
105
+ /**
106
+ * SameSite attribute for the cookie
107
+ * @default "Lax"
108
+ */
109
+ sameSite?: 'Strict' | 'Lax' | 'None';
110
+ };
111
+ }
@@ -0,0 +1,236 @@
1
+ /**
2
+ * Represents a question in the DPIA questionnaire
3
+ */
4
+ export interface DPIAQuestion {
5
+ /**
6
+ * Unique identifier for the question
7
+ */
8
+ id: string;
9
+
10
+ /**
11
+ * The text of the question
12
+ */
13
+ text: string;
14
+
15
+ /**
16
+ * Additional guidance for answering the question
17
+ */
18
+ guidance?: string;
19
+
20
+ /**
21
+ * Type of input required for the answer
22
+ */
23
+ type: 'text' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'scale';
24
+
25
+ /**
26
+ * Options for select, radio, or checkbox questions
27
+ */
28
+ options?: Array<{
29
+ value: string;
30
+ label: string;
31
+ riskLevel?: 'low' | 'medium' | 'high';
32
+ }>;
33
+
34
+ /**
35
+ * For scale questions, the minimum value
36
+ */
37
+ minValue?: number;
38
+
39
+ /**
40
+ * For scale questions, the maximum value
41
+ */
42
+ maxValue?: number;
43
+
44
+ /**
45
+ * For scale questions, labels for the scale points
46
+ */
47
+ scaleLabels?: Record<number, string>;
48
+
49
+ /**
50
+ * Whether the question is required
51
+ */
52
+ required: boolean;
53
+
54
+ /**
55
+ * Risk level associated with this question
56
+ */
57
+ riskLevel?: 'low' | 'medium' | 'high';
58
+
59
+ /**
60
+ * Whether this question triggers additional questions based on the answer
61
+ */
62
+ hasDependentQuestions?: boolean;
63
+
64
+ /**
65
+ * Conditions that determine when this question should be shown
66
+ */
67
+ showWhen?: Array<{
68
+ questionId: string;
69
+ operator: 'equals' | 'contains' | 'greaterThan' | 'lessThan';
70
+ value: any;
71
+ }>;
72
+ }
73
+
74
+ /**
75
+ * Represents a section in the DPIA questionnaire
76
+ */
77
+ export interface DPIASection {
78
+ /**
79
+ * Unique identifier for the section
80
+ */
81
+ id: string;
82
+
83
+ /**
84
+ * Title of the section
85
+ */
86
+ title: string;
87
+
88
+ /**
89
+ * Description of the section
90
+ */
91
+ description?: string;
92
+
93
+ /**
94
+ * Questions in this section
95
+ */
96
+ questions: DPIAQuestion[];
97
+
98
+ /**
99
+ * Order of the section in the questionnaire
100
+ */
101
+ order: number;
102
+ }
103
+
104
+ /**
105
+ * Represents a risk identified in the DPIA
106
+ */
107
+ export interface DPIARisk {
108
+ /**
109
+ * Unique identifier for the risk
110
+ */
111
+ id: string;
112
+
113
+ /**
114
+ * Description of the risk
115
+ */
116
+ description: string;
117
+
118
+ /**
119
+ * Likelihood of the risk occurring (1-5)
120
+ */
121
+ likelihood: number;
122
+
123
+ /**
124
+ * Impact if the risk occurs (1-5)
125
+ */
126
+ impact: number;
127
+
128
+ /**
129
+ * Overall risk score (likelihood * impact)
130
+ */
131
+ score: number;
132
+
133
+ /**
134
+ * Risk level based on the score
135
+ */
136
+ level: 'low' | 'medium' | 'high' | 'critical';
137
+
138
+ /**
139
+ * Measures to mitigate the risk
140
+ */
141
+ mitigationMeasures?: string[];
142
+
143
+ /**
144
+ * Whether the risk has been mitigated
145
+ */
146
+ mitigated: boolean;
147
+
148
+ /**
149
+ * Residual risk score after mitigation
150
+ */
151
+ residualScore?: number;
152
+
153
+ /**
154
+ * Questions that identified this risk
155
+ */
156
+ relatedQuestionIds: string[];
157
+ }
158
+
159
+ /**
160
+ * Represents the result of a completed DPIA
161
+ */
162
+ export interface DPIAResult {
163
+ /**
164
+ * Unique identifier for the DPIA
165
+ */
166
+ id: string;
167
+
168
+ /**
169
+ * Title of the DPIA
170
+ */
171
+ title: string;
172
+
173
+ /**
174
+ * Description of the processing activity being assessed
175
+ */
176
+ processingDescription: string;
177
+
178
+ /**
179
+ * Timestamp when the DPIA was started
180
+ */
181
+ startedAt: number;
182
+
183
+ /**
184
+ * Timestamp when the DPIA was completed
185
+ */
186
+ completedAt?: number;
187
+
188
+ /**
189
+ * Person responsible for conducting the DPIA
190
+ */
191
+ assessor: {
192
+ name: string;
193
+ role: string;
194
+ email: string;
195
+ };
196
+
197
+ /**
198
+ * Answers to all questions in the DPIA
199
+ */
200
+ answers: Record<string, any>;
201
+
202
+ /**
203
+ * Risks identified in the DPIA
204
+ */
205
+ risks: DPIARisk[];
206
+
207
+ /**
208
+ * Overall risk level of the processing activity
209
+ */
210
+ overallRiskLevel: 'low' | 'medium' | 'high' | 'critical';
211
+
212
+ /**
213
+ * Whether the DPIA concluded that the processing can proceed
214
+ */
215
+ canProceed: boolean;
216
+
217
+ /**
218
+ * Reasons why the processing can or cannot proceed
219
+ */
220
+ conclusion: string;
221
+
222
+ /**
223
+ * Recommendations for the processing activity
224
+ */
225
+ recommendations?: string[];
226
+
227
+ /**
228
+ * Next review date for the DPIA
229
+ */
230
+ reviewDate?: number;
231
+
232
+ /**
233
+ * Version of the DPIA questionnaire used
234
+ */
235
+ version: string;
236
+ }