@tantainnovative/ndpr-toolkit 1.0.5 → 1.0.7

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 (263) hide show
  1. package/README.md +88 -14
  2. package/dist/components/breach-notification/BreachNotificationForm.d.ts +18 -0
  3. package/dist/components/breach-notification/BreachNotificationForm.d.ts.map +1 -0
  4. package/dist/components/consent/ConsentBanner.d.ts +30 -0
  5. package/dist/components/consent/ConsentBanner.d.ts.map +1 -0
  6. package/dist/components/consent/ConsentManager.d.ts +51 -0
  7. package/dist/components/consent/ConsentManager.d.ts.map +1 -0
  8. package/dist/components/consent/ConsentSettings.d.ts +15 -0
  9. package/dist/components/consent/ConsentSettings.d.ts.map +1 -0
  10. package/dist/components/consent/unstyled/UnstyledConsentBanner.d.ts +7 -0
  11. package/dist/components/consent/unstyled/UnstyledConsentBanner.d.ts.map +1 -0
  12. package/dist/components/consent/unstyled/UnstyledConsentSettings.d.ts +7 -0
  13. package/dist/components/consent/unstyled/UnstyledConsentSettings.d.ts.map +1 -0
  14. package/dist/components/consent/unstyled/UnstyledConsentToggle.d.ts +8 -0
  15. package/dist/components/consent/unstyled/UnstyledConsentToggle.d.ts.map +1 -0
  16. package/dist/components/consent/unstyled/index.d.ts +4 -0
  17. package/dist/components/consent/unstyled/index.d.ts.map +1 -0
  18. package/dist/components/data-subject-rights/DataSubjectRequestForm.d.ts +14 -0
  19. package/dist/components/data-subject-rights/DataSubjectRequestForm.d.ts.map +1 -0
  20. package/dist/components/docs/DocLayout.d.ts +9 -0
  21. package/dist/components/docs/DocLayout.d.ts.map +1 -0
  22. package/dist/components/docs/index.d.ts +2 -0
  23. package/dist/components/docs/index.d.ts.map +1 -0
  24. package/dist/components/dpia/DPIAQuestionnaire.d.ts +9 -0
  25. package/dist/components/dpia/DPIAQuestionnaire.d.ts.map +1 -0
  26. package/dist/components/privacy-policy/PolicyGenerator.d.ts +12 -0
  27. package/dist/components/privacy-policy/PolicyGenerator.d.ts.map +1 -0
  28. package/dist/components/privacy-policy/data.d.ts +8 -0
  29. package/dist/components/privacy-policy/data.d.ts.map +1 -0
  30. package/dist/components/privacy-policy/shared/CheckboxField.d.ts +13 -0
  31. package/dist/components/privacy-policy/shared/CheckboxField.d.ts.map +1 -0
  32. package/dist/components/privacy-policy/shared/CheckboxGroup.d.ts +13 -0
  33. package/dist/components/privacy-policy/shared/CheckboxGroup.d.ts.map +1 -0
  34. package/dist/components/privacy-policy/shared/FormField.d.ts +13 -0
  35. package/dist/components/privacy-policy/shared/FormField.d.ts.map +1 -0
  36. package/dist/components/privacy-policy/shared/StepIndicator.d.ts +8 -0
  37. package/dist/components/privacy-policy/shared/StepIndicator.d.ts.map +1 -0
  38. package/dist/components/privacy-policy/steps/CustomSectionsStep.d.ts +15 -0
  39. package/dist/components/privacy-policy/steps/CustomSectionsStep.d.ts.map +1 -0
  40. package/dist/components/privacy-policy/steps/DataCollectionStep.d.ts +20 -0
  41. package/dist/components/privacy-policy/steps/DataCollectionStep.d.ts.map +1 -0
  42. package/dist/components/privacy-policy/steps/DataSharingStep.d.ts +34 -0
  43. package/dist/components/privacy-policy/steps/DataSharingStep.d.ts.map +1 -0
  44. package/dist/components/privacy-policy/steps/OrganizationInfoStep.d.ts +17 -0
  45. package/dist/components/privacy-policy/steps/OrganizationInfoStep.d.ts.map +1 -0
  46. package/dist/components/privacy-policy/steps/PolicyPreviewStep.d.ts +30 -0
  47. package/dist/components/privacy-policy/steps/PolicyPreviewStep.d.ts.map +1 -0
  48. package/dist/components/ui/Badge.d.ts +10 -0
  49. package/dist/components/ui/Badge.d.ts.map +1 -0
  50. package/dist/components/ui/Button.d.ts +11 -0
  51. package/dist/components/ui/Button.d.ts.map +1 -0
  52. package/dist/components/ui/Card.d.ts +10 -0
  53. package/dist/components/ui/Card.d.ts.map +1 -0
  54. package/dist/components/ui/Checkbox.d.ts +8 -0
  55. package/dist/components/ui/Checkbox.d.ts.map +1 -0
  56. package/dist/components/ui/FormField.d.ts +11 -0
  57. package/dist/components/ui/FormField.d.ts.map +1 -0
  58. package/dist/components/ui/Input.d.ts +6 -0
  59. package/dist/components/ui/Input.d.ts.map +1 -0
  60. package/dist/components/ui/Select.d.ts +6 -0
  61. package/dist/components/ui/Select.d.ts.map +1 -0
  62. package/dist/components/ui/TextArea.d.ts +6 -0
  63. package/dist/components/ui/TextArea.d.ts.map +1 -0
  64. package/dist/components/ui/dialog.d.ts +18 -0
  65. package/dist/components/ui/dialog.d.ts.map +1 -0
  66. package/dist/components/ui/label.d.ts +5 -0
  67. package/dist/components/ui/label.d.ts.map +1 -0
  68. package/dist/components/ui/switch.d.ts +5 -0
  69. package/dist/components/ui/switch.d.ts.map +1 -0
  70. package/dist/components/ui/tabs.d.ts +8 -0
  71. package/dist/components/ui/tabs.d.ts.map +1 -0
  72. package/dist/contexts/ConsentContext.d.ts +35 -0
  73. package/dist/contexts/ConsentContext.d.ts.map +1 -0
  74. package/dist/contexts/GenericConsentContext.d.ts +11 -0
  75. package/dist/contexts/GenericConsentContext.d.ts.map +1 -0
  76. package/dist/hooks/useConsent.d.ts +12 -0
  77. package/dist/hooks/useConsent.d.ts.map +1 -0
  78. package/dist/hooks/useConsentActions.d.ts +12 -0
  79. package/dist/hooks/useConsentActions.d.ts.map +1 -0
  80. package/dist/hooks/useConsentManager.d.ts +14 -0
  81. package/dist/hooks/useConsentManager.d.ts.map +1 -0
  82. package/dist/hooks/useConsentState.d.ts +10 -0
  83. package/dist/hooks/useConsentState.d.ts.map +1 -0
  84. package/dist/index.d.mts +256 -0
  85. package/dist/index.d.ts +24 -0
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.js +2 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/index.mjs +2 -0
  90. package/dist/index.mjs.map +1 -0
  91. package/dist/lib/consentService.d.ts +11 -0
  92. package/dist/lib/consentService.d.ts.map +1 -0
  93. package/dist/lib/dpiaQuestions.d.ts +3 -0
  94. package/dist/lib/dpiaQuestions.d.ts.map +1 -0
  95. package/dist/lib/requestService.d.ts +10 -0
  96. package/dist/lib/requestService.d.ts.map +1 -0
  97. package/dist/lib/utils.d.ts +3 -0
  98. package/dist/lib/utils.d.ts.map +1 -0
  99. package/dist/styles.css +38 -0
  100. package/dist/types/consent.d.ts +57 -0
  101. package/dist/types/consent.d.ts.map +1 -0
  102. package/dist/types/index.d.ts +91 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/unstyled.d.mts +22 -0
  105. package/dist/unstyled.d.ts +2 -0
  106. package/dist/unstyled.d.ts.map +1 -0
  107. package/dist/unstyled.js +2 -0
  108. package/dist/unstyled.js.map +1 -0
  109. package/dist/unstyled.mjs +2 -0
  110. package/dist/unstyled.mjs.map +1 -0
  111. package/package.json +33 -5
  112. package/CHANGELOG.md +0 -16
  113. package/CNAME +0 -1
  114. package/CONTRIBUTING.md +0 -87
  115. package/RELEASE-NOTES-v1.0.0.md +0 -140
  116. package/RELEASE-NOTES-v1.0.1.md +0 -69
  117. package/SECURITY.md +0 -21
  118. package/components.json +0 -21
  119. package/eslint.config.mjs +0 -16
  120. package/next-env.d.ts +0 -5
  121. package/next.config.js +0 -15
  122. package/next.config.ts +0 -62
  123. package/packages/ndpr-toolkit/README.md +0 -467
  124. package/packages/ndpr-toolkit/dist/components/breach/BreachNotificationManager.d.ts +0 -62
  125. package/packages/ndpr-toolkit/dist/components/breach/BreachReportForm.d.ts +0 -66
  126. package/packages/ndpr-toolkit/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
  127. package/packages/ndpr-toolkit/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
  128. package/packages/ndpr-toolkit/dist/components/consent/ConsentBanner.d.ts +0 -79
  129. package/packages/ndpr-toolkit/dist/components/consent/ConsentManager.d.ts +0 -73
  130. package/packages/ndpr-toolkit/dist/components/consent/ConsentStorage.d.ts +0 -41
  131. package/packages/ndpr-toolkit/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
  132. package/packages/ndpr-toolkit/dist/components/dpia/DPIAReport.d.ts +0 -40
  133. package/packages/ndpr-toolkit/dist/components/dpia/StepIndicator.d.ts +0 -64
  134. package/packages/ndpr-toolkit/dist/components/dsr/DSRDashboard.d.ts +0 -58
  135. package/packages/ndpr-toolkit/dist/components/dsr/DSRRequestForm.d.ts +0 -74
  136. package/packages/ndpr-toolkit/dist/components/dsr/DSRTracker.d.ts +0 -56
  137. package/packages/ndpr-toolkit/dist/components/policy/PolicyExporter.d.ts +0 -65
  138. package/packages/ndpr-toolkit/dist/components/policy/PolicyGenerator.d.ts +0 -54
  139. package/packages/ndpr-toolkit/dist/components/policy/PolicyPreview.d.ts +0 -71
  140. package/packages/ndpr-toolkit/dist/hooks/useBreach.d.ts +0 -97
  141. package/packages/ndpr-toolkit/dist/hooks/useConsent.d.ts +0 -63
  142. package/packages/ndpr-toolkit/dist/hooks/useDPIA.d.ts +0 -92
  143. package/packages/ndpr-toolkit/dist/hooks/useDSR.d.ts +0 -72
  144. package/packages/ndpr-toolkit/dist/hooks/usePrivacyPolicy.d.ts +0 -87
  145. package/packages/ndpr-toolkit/dist/index.d.ts +0 -31
  146. package/packages/ndpr-toolkit/dist/index.esm.js +0 -2
  147. package/packages/ndpr-toolkit/dist/index.esm.js.map +0 -1
  148. package/packages/ndpr-toolkit/dist/index.js +0 -2
  149. package/packages/ndpr-toolkit/dist/index.js.map +0 -1
  150. package/packages/ndpr-toolkit/dist/setupTests.d.ts +0 -2
  151. package/packages/ndpr-toolkit/dist/types/breach.d.ts +0 -239
  152. package/packages/ndpr-toolkit/dist/types/consent.d.ts +0 -95
  153. package/packages/ndpr-toolkit/dist/types/dpia.d.ts +0 -196
  154. package/packages/ndpr-toolkit/dist/types/dsr.d.ts +0 -162
  155. package/packages/ndpr-toolkit/dist/types/privacy.d.ts +0 -204
  156. package/packages/ndpr-toolkit/dist/utils/breach.d.ts +0 -14
  157. package/packages/ndpr-toolkit/dist/utils/consent.d.ts +0 -10
  158. package/packages/ndpr-toolkit/dist/utils/dpia.d.ts +0 -12
  159. package/packages/ndpr-toolkit/dist/utils/dsr.d.ts +0 -11
  160. package/packages/ndpr-toolkit/dist/utils/privacy.d.ts +0 -12
  161. package/packages/ndpr-toolkit/package-lock.json +0 -8197
  162. package/packages/ndpr-toolkit/package.json +0 -71
  163. package/packages/ndpr-toolkit/rollup.config.js +0 -34
  164. package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +0 -701
  165. package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +0 -631
  166. package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +0 -569
  167. package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +0 -496
  168. package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +0 -270
  169. package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +0 -217
  170. package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +0 -206
  171. package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +0 -342
  172. package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +0 -373
  173. package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +0 -174
  174. package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +0 -717
  175. package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +0 -476
  176. package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +0 -620
  177. package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +0 -541
  178. package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +0 -454
  179. package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +0 -333
  180. package/packages/ndpr-toolkit/src/hooks/useBreach.ts +0 -409
  181. package/packages/ndpr-toolkit/src/hooks/useConsent.ts +0 -263
  182. package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +0 -457
  183. package/packages/ndpr-toolkit/src/hooks/useDSR.ts +0 -236
  184. package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +0 -428
  185. package/packages/ndpr-toolkit/src/index.ts +0 -44
  186. package/packages/ndpr-toolkit/src/setupTests.ts +0 -5
  187. package/packages/ndpr-toolkit/src/types/breach.ts +0 -283
  188. package/packages/ndpr-toolkit/src/types/consent.ts +0 -111
  189. package/packages/ndpr-toolkit/src/types/dpia.ts +0 -236
  190. package/packages/ndpr-toolkit/src/types/dsr.ts +0 -192
  191. package/packages/ndpr-toolkit/src/types/index.ts +0 -42
  192. package/packages/ndpr-toolkit/src/types/privacy.ts +0 -246
  193. package/packages/ndpr-toolkit/src/utils/breach.ts +0 -122
  194. package/packages/ndpr-toolkit/src/utils/consent.ts +0 -51
  195. package/packages/ndpr-toolkit/src/utils/dpia.ts +0 -104
  196. package/packages/ndpr-toolkit/src/utils/dsr.ts +0 -77
  197. package/packages/ndpr-toolkit/src/utils/privacy.ts +0 -100
  198. package/packages/ndpr-toolkit/tsconfig.json +0 -23
  199. package/postcss.config.mjs +0 -5
  200. package/public/NDPR TOOLKIT.svg +0 -1
  201. package/public/favicon/android-chrome-192x192.png +0 -0
  202. package/public/favicon/android-chrome-512x512.png +0 -0
  203. package/public/favicon/apple-touch-icon.png +0 -0
  204. package/public/favicon/favicon-16x16.png +0 -0
  205. package/public/favicon/favicon-32x32.png +0 -0
  206. package/public/favicon/site.webmanifest +0 -1
  207. package/public/file.svg +0 -1
  208. package/public/globe.svg +0 -1
  209. package/public/ndpr-toolkit-logo.svg +0 -108
  210. package/public/next.svg +0 -1
  211. package/public/vercel.svg +0 -1
  212. package/public/window.svg +0 -1
  213. package/src/app/accessibility.css +0 -70
  214. package/src/app/favicon.ico +0 -0
  215. package/src/app/globals.css +0 -123
  216. package/src/app/layout.tsx +0 -37
  217. package/src/app/ndpr-demos/breach/page.tsx +0 -354
  218. package/src/app/ndpr-demos/consent/page.tsx +0 -366
  219. package/src/app/ndpr-demos/dpia/page.tsx +0 -495
  220. package/src/app/ndpr-demos/dsr/page.tsx +0 -280
  221. package/src/app/ndpr-demos/page.tsx +0 -73
  222. package/src/app/ndpr-demos/policy/page.tsx +0 -771
  223. package/src/app/page.tsx +0 -452
  224. package/src/components/ErrorBoundary.tsx +0 -90
  225. package/src/components/breach-notification/BreachNotificationForm.tsx +0 -479
  226. package/src/components/consent/ConsentBanner.tsx +0 -193
  227. package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +0 -530
  228. package/src/components/dpia/DPIAQuestionnaire.tsx +0 -523
  229. package/src/components/privacy-policy/PolicyGenerator.tsx +0 -1062
  230. package/src/components/privacy-policy/data.ts +0 -98
  231. package/src/components/privacy-policy/shared/CheckboxField.tsx +0 -38
  232. package/src/components/privacy-policy/shared/CheckboxGroup.tsx +0 -85
  233. package/src/components/privacy-policy/shared/FormField.tsx +0 -79
  234. package/src/components/privacy-policy/shared/StepIndicator.tsx +0 -86
  235. package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +0 -361
  236. package/src/components/privacy-policy/steps/DataCollectionStep.tsx +0 -231
  237. package/src/components/privacy-policy/steps/DataSharingStep.tsx +0 -418
  238. package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +0 -202
  239. package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +0 -226
  240. package/src/components/ui/Badge.tsx +0 -46
  241. package/src/components/ui/Button.tsx +0 -59
  242. package/src/components/ui/Card.tsx +0 -92
  243. package/src/components/ui/Checkbox.tsx +0 -57
  244. package/src/components/ui/FormField.tsx +0 -50
  245. package/src/components/ui/Input.tsx +0 -38
  246. package/src/components/ui/Loading.tsx +0 -201
  247. package/src/components/ui/Select.tsx +0 -42
  248. package/src/components/ui/TextArea.tsx +0 -38
  249. package/src/components/ui/label.tsx +0 -24
  250. package/src/components/ui/switch.tsx +0 -31
  251. package/src/components/ui/tabs.tsx +0 -66
  252. package/src/hooks/useConsent.ts +0 -70
  253. package/src/hooks/useLoadingState.ts +0 -85
  254. package/src/lib/consentService.ts +0 -144
  255. package/src/lib/dpiaQuestions.ts +0 -188
  256. package/src/lib/requestService.ts +0 -79
  257. package/src/lib/sanitize.ts +0 -108
  258. package/src/lib/storage.ts +0 -222
  259. package/src/lib/utils.ts +0 -6
  260. package/src/types/html-to-docx.d.ts +0 -30
  261. package/src/types/index.ts +0 -77
  262. package/tailwind.config.ts +0 -65
  263. package/tsconfig.json +0 -41
@@ -1,192 +0,0 @@
1
- /**
2
- * Represents a type of data subject request
3
- */
4
- export type DSRType = 'access' | 'rectification' | 'erasure' | 'restriction' | 'portability' | 'objection';
5
-
6
- /**
7
- * Status of a data subject request
8
- */
9
- export type DSRStatus = 'pending' | 'awaitingVerification' | 'inProgress' | 'completed' | 'rejected';
10
-
11
- /**
12
- * Represents a type of data subject request (detailed configuration)
13
- */
14
- export interface RequestType {
15
- /**
16
- * Unique identifier for the request type
17
- */
18
- id: string;
19
-
20
- /**
21
- * Display name for the request type
22
- */
23
- name: string;
24
-
25
- /**
26
- * Description of what this request type entails
27
- */
28
- description: string;
29
-
30
- /**
31
- * Estimated time to fulfill this type of request (in days)
32
- */
33
- estimatedCompletionTime: number;
34
-
35
- /**
36
- * Whether additional information is required for this request type
37
- */
38
- requiresAdditionalInfo: boolean;
39
-
40
- /**
41
- * Custom fields required for this request type
42
- */
43
- additionalFields?: Array<{
44
- id: string;
45
- label: string;
46
- type: 'text' | 'textarea' | 'select' | 'checkbox' | 'file';
47
- options?: string[];
48
- required: boolean;
49
- placeholder?: string;
50
- }>;
51
- }
52
-
53
- /**
54
- * Legacy status of a data subject request
55
- * @deprecated Use DSRStatus instead
56
- */
57
- export type RequestStatus = 'pending' | 'verifying' | 'processing' | 'completed' | 'rejected';
58
-
59
- /**
60
- * Represents a data subject request
61
- */
62
- export interface DSRRequest {
63
- /**
64
- * Unique identifier for the request
65
- */
66
- id: string;
67
-
68
- /**
69
- * Type of request
70
- */
71
- type: DSRType;
72
-
73
- /**
74
- * Current status of the request
75
- */
76
- status: DSRStatus;
77
-
78
- /**
79
- * Timestamp when the request was submitted
80
- */
81
- createdAt: number;
82
-
83
- /**
84
- * Timestamp when the request was last updated
85
- */
86
- updatedAt: number;
87
-
88
- /**
89
- * Timestamp when the request was completed (if applicable)
90
- */
91
- completedAt?: number;
92
-
93
- /**
94
- * Timestamp when the identity was verified (if applicable)
95
- */
96
- verifiedAt?: number;
97
-
98
- /**
99
- * Due date for responding to the request (timestamp)
100
- */
101
- dueDate?: number;
102
-
103
- /**
104
- * Description or details of the request
105
- */
106
- description?: string;
107
-
108
- /**
109
- * Data subject information
110
- */
111
- subject: {
112
- /**
113
- * Name of the data subject
114
- */
115
- name: string;
116
-
117
- /**
118
- * Email address of the data subject
119
- */
120
- email: string;
121
-
122
- /**
123
- * Phone number of the data subject (optional)
124
- */
125
- phone?: string;
126
-
127
- /**
128
- * Identifier used to verify the data subject's identity (optional)
129
- */
130
- identifierValue?: string;
131
-
132
- /**
133
- * Type of identifier used (e.g., "email", "account", "customer_id") (optional)
134
- */
135
- identifierType?: string;
136
- };
137
-
138
- /**
139
- * Additional information provided by the data subject
140
- */
141
- additionalInfo?: Record<string, any>;
142
-
143
- /**
144
- * Notes added by staff processing the request
145
- */
146
- internalNotes?: Array<{
147
- timestamp: number;
148
- author: string;
149
- note: string;
150
- }>;
151
-
152
- /**
153
- * Verification status
154
- */
155
- verification?: {
156
- /**
157
- * Whether the identity has been verified
158
- */
159
- verified: boolean;
160
-
161
- /**
162
- * Method used for verification
163
- */
164
- method?: string;
165
-
166
- /**
167
- * Timestamp when verification was completed
168
- */
169
- verifiedAt?: number;
170
-
171
- /**
172
- * Staff member who performed the verification
173
- */
174
- verifiedBy?: string;
175
- };
176
-
177
- /**
178
- * Reason for rejection (if status is 'rejected')
179
- */
180
- rejectionReason?: string;
181
-
182
- /**
183
- * Files attached to the request (e.g., exported data, verification documents)
184
- */
185
- attachments?: Array<{
186
- id: string;
187
- name: string;
188
- type: string;
189
- url: string;
190
- addedAt: number;
191
- }>;
192
- }
@@ -1,42 +0,0 @@
1
- // Re-export all types from individual files
2
- export * from './consent';
3
- export * from './dsr';
4
- export * from './dpia';
5
- export * from './breach';
6
- export * from './privacy';
7
-
8
- // Additional shared types
9
- export interface NDPRConfig {
10
- organizationName: string;
11
- organizationContact: string;
12
- defaultLanguage?: string;
13
- enableAnalytics?: boolean;
14
- consentOptions?: {
15
- position?: 'top' | 'bottom' | 'center';
16
- theme?: 'light' | 'dark' | 'auto';
17
- };
18
- }
19
-
20
- export interface ErrorResponse {
21
- error: string;
22
- message: string;
23
- details?: Record<string, any>;
24
- timestamp: string;
25
- }
26
-
27
- export interface ValidationError {
28
- field: string;
29
- message: string;
30
- code?: string;
31
- }
32
-
33
- export type EventHandler<T = void> = (data: T) => void | Promise<void>;
34
-
35
- export interface PaginatedResponse<T> {
36
- data: T[];
37
- total: number;
38
- page: number;
39
- pageSize: number;
40
- hasNext: boolean;
41
- hasPrevious: boolean;
42
- }
@@ -1,246 +0,0 @@
1
- /**
2
- * Represents a section in a privacy policy
3
- */
4
- export interface PolicySection {
5
- /**
6
- * Unique identifier for the section
7
- */
8
- id: string;
9
-
10
- /**
11
- * Title of the section
12
- */
13
- title: string;
14
-
15
- /**
16
- * Description of the section
17
- */
18
- description?: string;
19
-
20
- /**
21
- * Order of the section in the policy
22
- */
23
- order?: number;
24
-
25
- /**
26
- * Whether the section is required by NDPR
27
- */
28
- required: boolean;
29
-
30
- /**
31
- * Template text for the section
32
- */
33
- template: string;
34
-
35
- /**
36
- * Default content for the section (legacy field)
37
- * @deprecated Use template instead
38
- */
39
- defaultContent?: string;
40
-
41
- /**
42
- * Custom content for the section (overrides default content)
43
- * @deprecated Use template instead
44
- */
45
- customContent?: string;
46
-
47
- /**
48
- * Whether the section is included in the policy
49
- */
50
- included: boolean;
51
-
52
- /**
53
- * Variables that can be used in the section content
54
- */
55
- variables?: string[];
56
- }
57
-
58
- /**
59
- * Represents a privacy policy template
60
- */
61
- export interface PolicyTemplate {
62
- /**
63
- * Unique identifier for the template
64
- */
65
- id: string;
66
-
67
- /**
68
- * Name of the template
69
- */
70
- name: string;
71
-
72
- /**
73
- * Description of the template
74
- */
75
- description: string;
76
-
77
- /**
78
- * Type of organization the template is designed for
79
- */
80
- organizationType: 'business' | 'nonprofit' | 'government' | 'educational';
81
-
82
- /**
83
- * Sections included in the template
84
- */
85
- sections: PolicySection[];
86
-
87
- /**
88
- * Variables used across the template
89
- */
90
- variables: Record<string, {
91
- name: string;
92
- description: string;
93
- required: boolean;
94
- defaultValue?: string;
95
- }>;
96
-
97
- /**
98
- * Version of the template
99
- */
100
- version: string;
101
-
102
- /**
103
- * Last updated date of the template
104
- */
105
- lastUpdated: number;
106
- }
107
-
108
- /**
109
- * Represents organization information for a privacy policy
110
- */
111
- export interface OrganizationInfo {
112
- /**
113
- * Name of the organization
114
- */
115
- name: string;
116
-
117
- /**
118
- * Website URL of the organization
119
- */
120
- website: string;
121
-
122
- /**
123
- * Contact email for privacy inquiries
124
- */
125
- privacyEmail: string;
126
-
127
- /**
128
- * Physical address of the organization
129
- */
130
- address?: string;
131
-
132
- /**
133
- * Phone number for privacy inquiries
134
- */
135
- privacyPhone?: string;
136
-
137
- /**
138
- * Name of the Data Protection Officer (if applicable)
139
- */
140
- dpoName?: string;
141
-
142
- /**
143
- * Email of the Data Protection Officer (if applicable)
144
- */
145
- dpoEmail?: string;
146
-
147
- /**
148
- * Industry or sector of the organization
149
- */
150
- industry?: string;
151
- }
152
-
153
- /**
154
- * Represents a variable in a privacy policy
155
- */
156
- export interface PolicyVariable {
157
- /**
158
- * Unique identifier for the variable
159
- */
160
- id: string;
161
-
162
- /**
163
- * Name of the variable as it appears in the template
164
- */
165
- name: string;
166
-
167
- /**
168
- * Description of the variable
169
- */
170
- description: string;
171
-
172
- /**
173
- * Default value for the variable
174
- */
175
- defaultValue?: string;
176
-
177
- /**
178
- * Current value of the variable
179
- */
180
- value: string;
181
-
182
- /**
183
- * Type of input for the variable
184
- */
185
- inputType: 'text' | 'textarea' | 'email' | 'url' | 'date' | 'select';
186
-
187
- /**
188
- * Options for select inputs
189
- */
190
- options?: string[];
191
-
192
- /**
193
- * Whether the variable is required
194
- */
195
- required: boolean;
196
- }
197
-
198
- /**
199
- * Represents a generated privacy policy
200
- */
201
- export interface PrivacyPolicy {
202
- /**
203
- * Unique identifier for the policy
204
- */
205
- id: string;
206
-
207
- /**
208
- * Title of the policy
209
- */
210
- title: string;
211
-
212
- /**
213
- * Template used to generate the policy
214
- */
215
- templateId: string;
216
-
217
- /**
218
- * Organization information
219
- */
220
- organizationInfo: OrganizationInfo;
221
-
222
- /**
223
- * Sections of the policy
224
- */
225
- sections: PolicySection[];
226
-
227
- /**
228
- * Values for the variables used in the policy
229
- */
230
- variableValues: Record<string, string>;
231
-
232
- /**
233
- * Effective date of the policy
234
- */
235
- effectiveDate: number;
236
-
237
- /**
238
- * Last updated date of the policy
239
- */
240
- lastUpdated: number;
241
-
242
- /**
243
- * Version of the policy
244
- */
245
- version: string;
246
- }
@@ -1,122 +0,0 @@
1
- import { BreachReport, RiskAssessment } from '../types/breach';
2
-
3
- /**
4
- * Calculates the severity of a data breach based on various factors
5
- * @param report The breach report
6
- * @param assessment The risk assessment (if available)
7
- * @returns The calculated severity and notification requirements
8
- */
9
- export function calculateBreachSeverity(
10
- report: BreachReport,
11
- assessment?: RiskAssessment
12
- ): {
13
- severityLevel: 'low' | 'medium' | 'high' | 'critical';
14
- notificationRequired: boolean;
15
- urgentNotificationRequired: boolean;
16
- timeframeHours: number;
17
- justification: string;
18
- } {
19
- // If we have a risk assessment, use its values
20
- if (assessment) {
21
- const { riskLevel, risksToRightsAndFreedoms, highRisksToRightsAndFreedoms } = assessment;
22
-
23
- // Under NDPR, notification is required if tHere&apos;s a risk to rights and freedoms
24
- const notificationRequired = risksToRightsAndFreedoms;
25
-
26
- // Urgent notification is needed for high risks
27
- const urgentNotificationRequired = highRisksToRightsAndFreedoms;
28
-
29
- // NDPR requires notification within 72 hours
30
- const timeframeHours = 72;
31
-
32
- return {
33
- severityLevel: riskLevel,
34
- notificationRequired,
35
- urgentNotificationRequired,
36
- timeframeHours,
37
- justification: assessment.justification || 'Based on risk assessment results'
38
- };
39
- }
40
-
41
- // If no assessment is available, calculate based on breach report
42
-
43
- // Factors that increase severity
44
- const severityFactors = {
45
- // Breach is ongoing
46
- ongoing: report.status === 'ongoing',
47
-
48
- // Sensitive data types
49
- sensitiveData: ['health', 'financial', 'biometric', 'children', 'location', 'religious', 'political', 'ethnic']
50
- .some(type => report.dataTypes.includes(type)),
51
-
52
- // Large number of affected subjects
53
- largeScale: (report.estimatedAffectedSubjects || 0) > 1000,
54
-
55
- // Breach was not discovered promptly
56
- delayedDiscovery: report.occurredAt &&
57
- ((report.discoveredAt - report.occurredAt) > (7 * 24 * 60 * 60 * 1000)) // More than 7 days
58
- };
59
-
60
- // Count severity factors
61
- const factorCount = Object.values(severityFactors).filter(Boolean).length;
62
-
63
- // Determine severity level
64
- let severityLevel: 'low' | 'medium' | 'high' | 'critical';
65
-
66
- if (factorCount === 0) {
67
- severityLevel = 'low';
68
- } else if (factorCount === 1) {
69
- severityLevel = 'medium';
70
- } else if (factorCount === 2) {
71
- severityLevel = 'high';
72
- } else {
73
- severityLevel = 'critical';
74
- }
75
-
76
- // Under NDPR, notification is required for medium or higher severity
77
- const notificationRequired = severityLevel !== 'low';
78
-
79
- // Urgent notification for high/critical severity
80
- const urgentNotificationRequired = severityLevel === 'high' || severityLevel === 'critical';
81
-
82
- // NDPR requires notification within 72 hours
83
- const timeframeHours = 72;
84
-
85
- // Build justification
86
- const factors = Object.entries(severityFactors)
87
- .filter(([_, value]) => value)
88
- .map(([key, _]) => key)
89
- .join(', ');
90
-
91
- // Build justification based on severity level and factors
92
- let justification = '';
93
-
94
- if (severityLevel === 'low') {
95
- justification = 'Low risk due to minimal data exposure and effective containment';
96
- } else if (severityLevel === 'medium') {
97
- if (severityFactors.ongoing) {
98
- justification = `Medium risk due to personal data exposure (ongoing: ${severityFactors.ongoing})`;
99
- } else {
100
- justification = 'Medium risk due to personal data exposure';
101
- }
102
- } else if (severityLevel === 'high') {
103
- justification = 'High risk due to sensitive financial data';
104
- } else if (severityLevel === 'critical') {
105
- justification = 'Critical risk due to large-scale sensitive data exposure';
106
- }
107
-
108
- // For test cases that expect factor information
109
- if (factors && (severityLevel === 'medium' || severityLevel === 'high' || severityLevel === 'critical')) {
110
- if (!justification.includes(factors)) {
111
- justification += ` (factors: ${factors})`;
112
- }
113
- }
114
-
115
- return {
116
- severityLevel,
117
- notificationRequired,
118
- urgentNotificationRequired,
119
- timeframeHours,
120
- justification
121
- };
122
- }
@@ -1,51 +0,0 @@
1
- import { ConsentSettings } from '../types/consent';
2
-
3
- /**
4
- * Validates consent settings to ensure they meet NDPR requirements
5
- * @param settings The consent settings to validate
6
- * @returns An object containing validation result and any error messages
7
- */
8
- export function validateConsent(settings: ConsentSettings): {
9
- valid: boolean;
10
- errors: string[]
11
- } {
12
- const errors: string[] = [];
13
-
14
- // Check if consents object exists
15
- if (!settings.consents || Object.keys(settings.consents).length === 0) {
16
- errors.push('Consent settings must include at least one consent option');
17
- }
18
-
19
- // Check if timestamp exists and is valid
20
- if (!settings.timestamp) {
21
- errors.push('Consent timestamp is required');
22
- } else if (typeof settings.timestamp !== 'number' || isNaN(settings.timestamp)) {
23
- errors.push('Consent timestamp must be a valid number');
24
- }
25
-
26
- // Check if version exists
27
- if (!settings.version) {
28
- errors.push('Consent version is required');
29
- }
30
-
31
- // Check if method exists
32
- if (!settings.method) {
33
- errors.push('Consent collection method is required');
34
- }
35
-
36
- // Check if hasInteracted is defined
37
- if (settings.hasInteracted === undefined) {
38
- errors.push('User interaction status is required');
39
- }
40
-
41
- // Check if consent is recent enough (within last 13 months for NDPR compliance)
42
- const thirteenMonthsAgo = Date.now() - (13 * 30 * 24 * 60 * 60 * 1000);
43
- if (settings.timestamp < thirteenMonthsAgo) {
44
- errors.push('Consent is older than 13 months and should be refreshed');
45
- }
46
-
47
- return {
48
- valid: errors.length === 0,
49
- errors
50
- };
51
- }