@tantainnovative/ndpr-toolkit 3.4.1 → 3.5.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.
Files changed (177) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/adapters.d.mts +34 -25
  3. package/dist/adapters.d.ts +34 -25
  4. package/dist/breach.d.mts +803 -44
  5. package/dist/breach.d.ts +803 -44
  6. package/dist/breach.js +1 -1
  7. package/dist/breach.mjs +1 -1
  8. package/dist/{chunk-ASLMPY54.js → chunk-3EGQWLJ6.js} +3 -3
  9. package/dist/chunk-B4Z5MBUC.mjs +2 -0
  10. package/dist/{chunk-LSCMXAPY.mjs → chunk-CKGJK4D7.mjs} +3 -3
  11. package/dist/{chunk-XSEZDQLB.js → chunk-CKJAECGV.js} +2 -2
  12. package/dist/{chunk-AHSMDPG5.js → chunk-CPK5D5FY.js} +2 -2
  13. package/dist/{chunk-DCJK5OZT.mjs → chunk-CWHBCQGT.mjs} +2 -2
  14. package/dist/{chunk-MLOWRZXO.mjs → chunk-F5TXUA4O.mjs} +3 -3
  15. package/dist/{chunk-BN77GP4W.mjs → chunk-GN5C32JB.mjs} +2 -2
  16. package/dist/{chunk-ZLSWOFAY.mjs → chunk-GRLIPT5V.mjs} +2 -2
  17. package/dist/{chunk-DUY6F3GT.mjs → chunk-H3EYBSVP.mjs} +3 -3
  18. package/dist/{chunk-NFJ4CB63.mjs → chunk-ID2NYIVE.mjs} +3 -3
  19. package/dist/chunk-J5WCPZLW.js +2 -0
  20. package/dist/{chunk-P2YV6DR3.js → chunk-LIM64IV2.js} +3 -3
  21. package/dist/chunk-LU7PKE7Y.mjs +2 -0
  22. package/dist/{chunk-HQSU7LGM.js → chunk-LWXZMKC2.js} +4 -4
  23. package/dist/{chunk-4BOEFDDE.js → chunk-ORFC66EA.js} +3 -3
  24. package/dist/{chunk-VTITKWGX.mjs → chunk-QSVVAZVT.mjs} +2 -2
  25. package/dist/chunk-SCWNM4PC.mjs +2 -0
  26. package/dist/{chunk-EHAZIKDX.js → chunk-SKKOMFXH.js} +2 -2
  27. package/dist/{chunk-WH6ZMUOS.mjs → chunk-TUNQUVHU.mjs} +2 -2
  28. package/dist/chunk-TV4U6AIS.js +2 -0
  29. package/dist/{chunk-ZYLDLGFL.js → chunk-VIQUXWJC.js} +2 -2
  30. package/dist/{chunk-SUEGUY35.js → chunk-XIM7KMD6.js} +2 -2
  31. package/dist/{chunk-P6QAFBCV.js → chunk-XNSZ7KUH.js} +2 -2
  32. package/dist/consent.d.mts +648 -84
  33. package/dist/consent.d.ts +648 -84
  34. package/dist/consent.js +1 -1
  35. package/dist/consent.mjs +1 -1
  36. package/dist/core.d.mts +2049 -23
  37. package/dist/core.d.ts +2049 -23
  38. package/dist/core.js +1 -1
  39. package/dist/core.mjs +1 -1
  40. package/dist/cross-border.d.mts +470 -99
  41. package/dist/cross-border.d.ts +470 -99
  42. package/dist/dpia.d.mts +591 -37
  43. package/dist/dpia.d.ts +591 -37
  44. package/dist/dsr.d.mts +654 -37
  45. package/dist/dsr.d.ts +654 -37
  46. package/dist/dsr.js +1 -1
  47. package/dist/dsr.mjs +1 -1
  48. package/dist/hooks.d.mts +2174 -30
  49. package/dist/hooks.d.ts +2174 -30
  50. package/dist/hooks.js +1 -1
  51. package/dist/hooks.mjs +1 -1
  52. package/dist/index.d.mts +4428 -43
  53. package/dist/index.d.ts +4428 -43
  54. package/dist/index.js +1 -1
  55. package/dist/index.mjs +1 -1
  56. package/dist/lawful-basis.d.mts +368 -32
  57. package/dist/lawful-basis.d.ts +368 -32
  58. package/dist/policy.d.mts +1178 -83
  59. package/dist/policy.d.ts +1178 -83
  60. package/dist/policy.js +1 -1
  61. package/dist/policy.mjs +1 -1
  62. package/dist/presets.d.mts +1020 -114
  63. package/dist/presets.d.ts +1020 -114
  64. package/dist/presets.js +1 -1
  65. package/dist/presets.mjs +1 -1
  66. package/dist/ropa.d.mts +396 -31
  67. package/dist/ropa.d.ts +396 -31
  68. package/dist/ropa.js +1 -1
  69. package/dist/ropa.mjs +1 -1
  70. package/dist/server.d.mts +2133 -24
  71. package/dist/server.d.ts +2133 -24
  72. package/dist/server.js +1 -1
  73. package/dist/server.mjs +1 -1
  74. package/dist/unstyled.d.mts +523 -55
  75. package/dist/unstyled.d.ts +523 -55
  76. package/dist/unstyled.js +1 -1
  77. package/dist/unstyled.mjs +1 -1
  78. package/package.json +3 -3
  79. package/dist/BreachReportForm-DpRrBoxU.d.ts +0 -158
  80. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +0 -158
  81. package/dist/ConsentBanner-F5ayys5K.d.mts +0 -156
  82. package/dist/ConsentBanner-VqIPophc.d.ts +0 -156
  83. package/dist/ConsentManager-C7I3PDe8.d.mts +0 -105
  84. package/dist/ConsentManager-CQ2IZtUU.d.ts +0 -105
  85. package/dist/CrossBorderTransferManager-D5Lc0e46.d.ts +0 -90
  86. package/dist/CrossBorderTransferManager-DkZhv9vD.d.mts +0 -90
  87. package/dist/DPIAQuestionnaire-VXBoWFMC.d.ts +0 -123
  88. package/dist/DPIAQuestionnaire-jkt1Veb6.d.mts +0 -123
  89. package/dist/DSRRequestForm-D8rPTNmU.d.ts +0 -146
  90. package/dist/DSRRequestForm-DRouEr9j.d.mts +0 -146
  91. package/dist/DSRTracker-Bl__d4df.d.ts +0 -163
  92. package/dist/DSRTracker-CSVDfgQQ.d.mts +0 -163
  93. package/dist/LawfulBasisTracker-CBqOxX1D.d.mts +0 -85
  94. package/dist/LawfulBasisTracker-Cg30NbDA.d.ts +0 -85
  95. package/dist/NDPRDashboard-CLJpEg0X.d.mts +0 -44
  96. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +0 -44
  97. package/dist/NDPRProvider-DYFb8xEl.d.ts +0 -68
  98. package/dist/NDPRProvider-U3QNu6MA.d.mts +0 -68
  99. package/dist/PolicyExporter-Bgi6nz82.d.mts +0 -291
  100. package/dist/PolicyExporter-BnvuFncj.d.ts +0 -291
  101. package/dist/ROPAManager-BS4eB8Hw.d.mts +0 -79
  102. package/dist/ROPAManager-qxTrXLkD.d.ts +0 -79
  103. package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +0 -282
  104. package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +0 -282
  105. package/dist/StepIndicator-CgrlokSV.d.ts +0 -171
  106. package/dist/StepIndicator-W8S_QjgO.d.mts +0 -171
  107. package/dist/breach-B_-6lDqS.d.mts +0 -17
  108. package/dist/breach-CzXqSsaY.d.ts +0 -17
  109. package/dist/breach-Eu9byel8.d.mts +0 -185
  110. package/dist/breach-Eu9byel8.d.ts +0 -185
  111. package/dist/chunk-2L7BSG7G.mjs +0 -2
  112. package/dist/chunk-5X32J5IA.mjs +0 -2
  113. package/dist/chunk-7D2OIPHH.mjs +0 -2
  114. package/dist/chunk-JKKRPS4P.js +0 -2
  115. package/dist/chunk-UHTJ6UFW.js +0 -2
  116. package/dist/compliance-score-racQe_E_.d.mts +0 -115
  117. package/dist/compliance-score-racQe_E_.d.ts +0 -115
  118. package/dist/consent-CmVzqZUk.d.mts +0 -99
  119. package/dist/consent-CmVzqZUk.d.ts +0 -99
  120. package/dist/consent-audit-BdByjYlM.d.mts +0 -65
  121. package/dist/consent-audit-DhbfMR0n.d.ts +0 -65
  122. package/dist/cross-border-BBi9rZyO.d.mts +0 -54
  123. package/dist/cross-border-Dy-U9Hu6.d.ts +0 -54
  124. package/dist/cross-border-UyT00llA.d.mts +0 -141
  125. package/dist/cross-border-UyT00llA.d.ts +0 -141
  126. package/dist/docx-4n8g4zul.d.mts +0 -64
  127. package/dist/docx-VvcTLYZM.d.ts +0 -64
  128. package/dist/dpia-D82hUrJe.d.ts +0 -15
  129. package/dist/dpia-DQDFw2_l.d.mts +0 -15
  130. package/dist/dpia-c9GiiOq0.d.mts +0 -137
  131. package/dist/dpia-c9GiiOq0.d.ts +0 -137
  132. package/dist/dsr-CIx5sd7e.d.ts +0 -14
  133. package/dist/dsr-XZ_HqTlA.d.mts +0 -14
  134. package/dist/dsr-yKbqX531.d.mts +0 -128
  135. package/dist/dsr-yKbqX531.d.ts +0 -128
  136. package/dist/lawful-basis-BEyI0kGg.d.ts +0 -57
  137. package/dist/lawful-basis-C2eGaoHM.d.mts +0 -57
  138. package/dist/lawful-basis-Cv1VmDLn.d.mts +0 -112
  139. package/dist/lawful-basis-Cv1VmDLn.d.ts +0 -112
  140. package/dist/locale-CxJx2tzn.d.mts +0 -25
  141. package/dist/locale-DSkrtf-c.d.ts +0 -25
  142. package/dist/policy-engine-5qTfp2z4.d.mts +0 -174
  143. package/dist/policy-engine-DzPxskOK.d.ts +0 -174
  144. package/dist/policy-sections-9tCb7VU7.d.ts +0 -56
  145. package/dist/policy-sections-CBWcJv-R.d.mts +0 -56
  146. package/dist/policy-templates-DhLwq4R-.d.ts +0 -43
  147. package/dist/policy-templates-DwYl2329.d.mts +0 -43
  148. package/dist/privacy-Ca6te9Ir.d.mts +0 -138
  149. package/dist/privacy-Ca6te9Ir.d.ts +0 -138
  150. package/dist/ropa-BDTM06tr.d.ts +0 -152
  151. package/dist/ropa-CFHuT7jE.d.mts +0 -152
  152. package/dist/ropa-CyynscU6.d.ts +0 -51
  153. package/dist/ropa-NIgxd8uP.d.mts +0 -51
  154. package/dist/sanitize-CxxwKxAx.d.mts +0 -94
  155. package/dist/sanitize-CxxwKxAx.d.ts +0 -94
  156. package/dist/styling-BMDGQDgS.d.mts +0 -64
  157. package/dist/styling-BaoQtV06.d.ts +0 -64
  158. package/dist/types-DK2CoKOC.d.mts +0 -10
  159. package/dist/types-DK2CoKOC.d.ts +0 -10
  160. package/dist/useAdaptivePolicyWizard-BSLyltzZ.d.mts +0 -52
  161. package/dist/useAdaptivePolicyWizard-CL7C7MTZ.d.ts +0 -52
  162. package/dist/useBreach-CPr86Yan.d.mts +0 -115
  163. package/dist/useBreach-DkVXvtJK.d.ts +0 -115
  164. package/dist/useConsent-DCNkIJHR.d.mts +0 -75
  165. package/dist/useConsent-dOcELSfX.d.ts +0 -75
  166. package/dist/useCrossBorderTransfer-DixjLjN1.d.mts +0 -78
  167. package/dist/useCrossBorderTransfer-DvSq06lv.d.ts +0 -78
  168. package/dist/useDPIA-B6180UQn.d.mts +0 -109
  169. package/dist/useDPIA-CTqbNbww.d.ts +0 -109
  170. package/dist/useDSR-WvHk8_iu.d.mts +0 -85
  171. package/dist/useDSR-wH4H6hSM.d.ts +0 -85
  172. package/dist/useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts +0 -162
  173. package/dist/useDefaultPrivacyPolicy-DkOqMg2e.d.ts +0 -162
  174. package/dist/useLawfulBasis-CKJ-kw84.d.mts +0 -79
  175. package/dist/useLawfulBasis-DFTmu1ca.d.ts +0 -79
  176. package/dist/useROPA-BSSU1rfx.d.ts +0 -76
  177. package/dist/useROPA-C2hjaBTz.d.mts +0 -76
package/dist/core.d.mts CHANGED
@@ -1,23 +1,2049 @@
1
- export { C as ConsentOption, a as ConsentSettings, b as ConsentStorageOptions, L as LawfulBasisType } from './consent-CmVzqZUk.mjs';
2
- export { D as DSRRequest, a as DSRStatus, b as DSRType, R as RequestStatus, c as RequestType } from './dsr-yKbqX531.mjs';
3
- export { D as DPIAQuestion, a as DPIAResult, b as DPIARisk, c as DPIASection } from './dpia-c9GiiOq0.mjs';
4
- export { B as BreachCategory, a as BreachReport, N as NotificationRequirement, R as RegulatoryNotification, b as RiskAssessment } from './breach-Eu9byel8.mjs';
5
- export { O as OrganizationInfo, P as PolicySection, a as PolicyTemplate, b as PolicyVariable, c as PrivacyPolicy } from './privacy-Ca6te9Ir.mjs';
6
- export { L as LawfulBasis, a as LawfulBasisSummary, b as LegitimateInterestAssessment, P as ProcessingActivity, S as SensitiveDataCondition } from './lawful-basis-Cv1VmDLn.mjs';
7
- export { A as AdequacyStatus, C as CrossBorderSummary, a as CrossBorderTransfer, T as TransferImpactAssessment, b as TransferMechanism } from './cross-border-UyT00llA.mjs';
8
- export { P as ProcessingRecord, R as ROPASummary, a as RecordOfProcessingActivities } from './ropa-CFHuT7jE.mjs';
9
- export { L as LawfulBasisComplianceGap, a as LawfulBasisValidationResult, b as assessComplianceGaps, g as generateLawfulBasisSummary, c as getLawfulBasisDescription, v as validateProcessingActivity } from './lawful-basis-C2eGaoHM.mjs';
10
- export { T as TransferRiskResult, a as TransferValidationResult, b as assessTransferRisk, g as getTransferMechanismDescription, i as isNDPCApprovalRequired, v as validateTransfer } from './cross-border-BBi9rZyO.mjs';
11
- export { R as ROPAComplianceGap, a as ROPAValidationResult, e as exportROPAToCSV, g as generateROPASummary, i as identifyComplianceGaps, v as validateProcessingRecord } from './ropa-NIgxd8uP.mjs';
12
- export { N as NDPRConfig, a as NDPRProvider, u as useNDPRConfig, b as useNDPRLocale } from './NDPRProvider-U3QNu6MA.mjs';
13
- export { N as NDPRLocale, d as defaultLocale, s as sanitizeInput } from './sanitize-CxxwKxAx.mjs';
14
- export { h as hausaLocale, i as igboLocale, m as mergeLocale, p as pidginLocale, y as yorubaLocale } from './locale-CxJx2tzn.mjs';
15
- export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-BdByjYlM.mjs';
16
- export { f as formatDSRRequest } from './dsr-XZ_HqTlA.mjs';
17
- export { a as assessDPIARisk } from './dpia-DQDFw2_l.mjs';
18
- export { c as calculateBreachSeverity } from './breach-B_-6lDqS.mjs';
19
- export { D as DEFAULT_POLICY_SECTIONS, a as DEFAULT_POLICY_VARIABLES, c as createBusinessPolicyTemplate, f as findUnfilledTokens, g as generatePolicyText } from './policy-templates-DwYl2329.mjs';
20
- export { C as ComplianceGap, a as ComplianceResult, b as CustomSection, D as DataCategory, P as PolicyDraft, T as TemplateContext, c as ThirdPartyProcessor, d as createDefaultContext } from './policy-engine-5qTfp2z4.mjs';
21
- export { a as assemblePolicy, e as evaluatePolicyCompliance } from './policy-sections-CBWcJv-R.mjs';
22
- export { C as ComplianceInput, a as ComplianceRating, b as ComplianceReport, E as EffortLevel, M as ModuleScore, R as Recommendation, c as RecommendationPriority, d as RegulatoryReference, g as getComplianceScore } from './compliance-score-racQe_E_.mjs';
23
- import 'react';
1
+ import { ErrorInfo } from 'react';
2
+ import React__default from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ /**
6
+ * Adequacy status of a destination country
7
+ */
8
+ export declare type AdequacyStatus = 'adequate' | 'inadequate' | 'pending_review' | 'unknown';
9
+
10
+ /**
11
+ * Appends a single audit entry to the consent audit log in localStorage.
12
+ * The log is append-only; existing entries are never modified.
13
+ *
14
+ * @param entry - The audit entry to append
15
+ * @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
16
+ */
17
+ export declare function appendAuditEntry(entry: ConsentAuditEntry, storageKey?: string): void;
18
+
19
+ /**
20
+ * Assemble an ordered, NDPA-aligned array of privacy-policy sections from
21
+ * a {@link TemplateContext}. This is the canonical "compute the policy"
22
+ * function it produces structured `PolicySection[]` data that downstream
23
+ * renderers (`exportHTML`, `exportMarkdown`, `exportPDF`, `exportDOCX`,
24
+ * `<PolicyPage />`) consume.
25
+ *
26
+ * Section composition:
27
+ * - **Core sections** (always included): Introduction, Data Collection,
28
+ * Legal Basis, Data Usage, Data Sharing, Data Retention, Data Security,
29
+ * Data Subject Rights, Contact Information.
30
+ * - **Conditional sections** (included based on context flags):
31
+ * - `hasChildrenData` → Children's Data Protection (NDPA §31)
32
+ * - `hasSensitiveData` → Sensitive / Special-Category Data
33
+ * - `hasCrossBorderTransfer` → Cross-Border Transfers (NDPA Part VI)
34
+ * - `hasAutomatedDecisions` → Automated Decision-Making (NDPA §37)
35
+ *
36
+ * Section text uses `«TODO: fieldName»` markers (see {@link UNFILLED_PREFIX})
37
+ * for any required org-info field that's empty in the context. Pair with
38
+ * {@link findUnfilledTokens} to surface those before publishing.
39
+ *
40
+ * @param context - Organisation info, data categories, processing purposes,
41
+ * third-party processors, and feature flags. Build a default
42
+ * context with `createDefaultContext()` then mutate.
43
+ * @returns An ordered array of {@link PolicySection} objects ready to pass
44
+ * to `exportHTML(policy)` or `<PolicyPage policy={...} />`.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * import { assemblePolicy, createDefaultContext } from '@tantainnovative/ndpr-toolkit/server';
49
+ *
50
+ * const ctx = createDefaultContext();
51
+ * ctx.org.name = 'Acme Nigeria Ltd';
52
+ * ctx.org.privacyEmail = 'privacy@acme.ng';
53
+ * ctx.hasCrossBorderTransfer = true;
54
+ *
55
+ * const sections = assemblePolicy(ctx);
56
+ * // sections is a 10-element array (9 core + 1 cross-border)
57
+ * ```
58
+ */
59
+ export declare function assemblePolicy(context: TemplateContext): PolicySection[];
60
+
61
+ /**
62
+ * Analyzes all processing activities and returns compliance gaps including
63
+ * missing DPO approval, overdue reviews, undocumented justifications,
64
+ * missing LIA for legitimate interests, and other documentation issues.
65
+ *
66
+ * @param activities Array of processing activities to analyze
67
+ * @returns Array of identified compliance gaps
68
+ */
69
+ export declare function assessComplianceGaps(activities: ProcessingActivity[]): LawfulBasisComplianceGap[];
70
+
71
+ /**
72
+ * Assesses the risk level of a DPIA based on the identified risks
73
+ * @param dpiaResult The DPIA result containing risks to assess
74
+ * @returns Assessment result with overall risk level and recommendations
75
+ */
76
+ export declare function assessDPIARisk(dpiaResult: DPIAResult): {
77
+ overallRiskLevel: 'low' | 'medium' | 'high' | 'critical';
78
+ requiresConsultation: boolean;
79
+ canProceed: boolean;
80
+ recommendations: string[];
81
+ };
82
+
83
+ /**
84
+ * Performs a basic risk assessment of a cross-border transfer based on adequacy status,
85
+ * transfer mechanism, and data sensitivity.
86
+ *
87
+ * @param transfer The cross-border transfer to assess
88
+ * @returns Risk assessment result with score, factors, and recommendations
89
+ */
90
+ export declare function assessTransferRisk(transfer: CrossBorderTransfer): TransferRiskResult;
91
+
92
+ /**
93
+ * Breach notification types aligned with NDPA 2023 Section 40
94
+ * Data controllers must notify the NDPC within 72 hours of becoming aware of a breach
95
+ * Data subjects must be notified without undue delay when breach is likely to result in high risk
96
+ */
97
+ /**
98
+ * Represents a data breach category
99
+ */
100
+ export declare interface BreachCategory {
101
+ /** Unique identifier for the category */
102
+ id: string;
103
+ /** Display name for the category */
104
+ name: string;
105
+ /** Description of this breach category */
106
+ description: string;
107
+ /** Default severity level for this category */
108
+ defaultSeverity: 'low' | 'medium' | 'high' | 'critical';
109
+ }
110
+
111
+ /**
112
+ * Represents a data breach report
113
+ */
114
+ export declare interface BreachReport {
115
+ /** Unique identifier for the breach report */
116
+ id: string;
117
+ /** Title/summary of the breach */
118
+ title: string;
119
+ /** Detailed description of the breach */
120
+ description: string;
121
+ /** Category of the breach */
122
+ category: string;
123
+ /** Timestamp when the breach was discovered */
124
+ discoveredAt: number;
125
+ /** Timestamp when the breach occurred (if known) */
126
+ occurredAt?: number;
127
+ /** Timestamp when the breach was reported internally */
128
+ reportedAt: number;
129
+ /** Person who reported the breach */
130
+ reporter: {
131
+ name: string;
132
+ email: string;
133
+ department: string;
134
+ phone?: string;
135
+ };
136
+ /** Systems or data affected by the breach */
137
+ affectedSystems: string[];
138
+ /** Types of data involved in the breach */
139
+ dataTypes: string[];
140
+ /** Whether sensitive personal data is involved (NDPA Section 27) */
141
+ involvesSensitiveData?: boolean;
142
+ /** Estimated number of data subjects affected */
143
+ estimatedAffectedSubjects?: number;
144
+ /** Whether the breach is ongoing or contained */
145
+ status: 'ongoing' | 'contained' | 'resolved';
146
+ /** Initial actions taken to address the breach */
147
+ initialActions?: string;
148
+ /** Attachments related to the breach */
149
+ attachments?: Array<{
150
+ id: string;
151
+ name: string;
152
+ type: string;
153
+ url: string;
154
+ addedAt: number;
155
+ }>;
156
+ }
157
+
158
+ /**
159
+ * Calculates the severity of a data breach based on various factors
160
+ * @param report The breach report
161
+ * @param assessment The risk assessment (if available)
162
+ * @returns The calculated severity and notification requirements
163
+ */
164
+ export declare function calculateBreachSeverity(report: BreachReport, assessment?: RiskAssessment): {
165
+ severityLevel: 'low' | 'medium' | 'high' | 'critical';
166
+ notificationRequired: boolean;
167
+ urgentNotificationRequired: boolean;
168
+ timeframeHours: number;
169
+ justification: string;
170
+ };
171
+
172
+ /** A single gap found during NDPA compliance evaluation. */
173
+ export declare interface ComplianceGap {
174
+ /** Machine-readable requirement identifier. */
175
+ requirementId: string;
176
+ /** Human-readable name of the requirement. */
177
+ requirement: string;
178
+ /** Reference to the relevant NDPA section. */
179
+ ndpaSection: string;
180
+ /** How severe the gap is. */
181
+ severity: 'critical' | 'important' | 'recommended';
182
+ /** Explanation of what is missing. */
183
+ message: string;
184
+ /** Suggested fix type for the UI. */
185
+ fixType: 'add_section' | 'add_content' | 'fill_field';
186
+ /** Label for the fix action button. */
187
+ fixLabel: string;
188
+ /** Pre-written content the user can insert to close the gap. */
189
+ suggestedContent?: string;
190
+ }
191
+
192
+ export declare interface ComplianceInput {
193
+ consent: {
194
+ hasConsentMechanism: boolean;
195
+ hasPurposeSpecification: boolean;
196
+ hasWithdrawalMechanism: boolean;
197
+ hasMinorProtection: boolean;
198
+ consentRecordsRetained: boolean;
199
+ };
200
+ dsr: {
201
+ hasRequestMechanism: boolean;
202
+ supportsAccess: boolean;
203
+ supportsRectification: boolean;
204
+ supportsErasure: boolean;
205
+ supportsPortability: boolean;
206
+ supportsObjection: boolean;
207
+ /** Expected max response time in days (>30 counts as a gap) */
208
+ responseTimelineDays: number;
209
+ };
210
+ dpia: {
211
+ conductedForHighRisk: boolean;
212
+ documentedRisks: boolean;
213
+ mitigationMeasures: boolean;
214
+ };
215
+ breach: {
216
+ hasNotificationProcess: boolean;
217
+ notifiesWithin72Hours: boolean;
218
+ hasRiskAssessment: boolean;
219
+ hasRecordKeeping: boolean;
220
+ };
221
+ policy: {
222
+ hasPrivacyPolicy: boolean;
223
+ isPubliclyAccessible: boolean;
224
+ /** ISO date string (YYYY-MM-DD); >13 months old counts as a gap */
225
+ lastUpdated: string;
226
+ coversAllSections: boolean;
227
+ };
228
+ lawfulBasis: {
229
+ documentedForAllProcessing: boolean;
230
+ hasLegitimateInterestAssessment: boolean;
231
+ };
232
+ crossBorder: {
233
+ hasTransferMechanisms: boolean;
234
+ adequacyAssessed: boolean;
235
+ ndpcApprovalObtained: boolean;
236
+ };
237
+ ropa: {
238
+ maintained: boolean;
239
+ includesAllProcessing: boolean;
240
+ /** ISO date string (YYYY-MM-DD); >6 months since review counts as a gap */
241
+ lastReviewed: string;
242
+ };
243
+ }
244
+
245
+ /**
246
+ * Compliance Score Engine
247
+ *
248
+ * Evaluates an organisation's NDPA compliance posture across eight modules and
249
+ * returns a scored, rated report with per-module breakdowns and sorted
250
+ * recommendations.
251
+ *
252
+ * Pure utility — zero React dependency.
253
+ */
254
+ export declare type ComplianceRating = 'excellent' | 'good' | 'needs-work' | 'critical';
255
+
256
+ export declare interface ComplianceReport {
257
+ /** Overall compliance score, 0–100 */
258
+ score: number;
259
+ /** Rating bucket */
260
+ rating: ComplianceRating;
261
+ /** Per-module breakdown keyed by module name */
262
+ modules: Record<string, ModuleScore>;
263
+ /** Recommendations sorted by priority (critical first) */
264
+ recommendations: Recommendation[];
265
+ /** Top-level regulatory references */
266
+ regulatoryReferences: RegulatoryReference[];
267
+ /** ISO date of when the report was generated */
268
+ generatedAt: string;
269
+ }
270
+
271
+ /** Result of evaluating a policy against NDPA requirements. */
272
+ export declare interface ComplianceResult {
273
+ /** Points earned. */
274
+ score: number;
275
+ /** Maximum achievable points (115). */
276
+ maxScore: number;
277
+ /** Percentage score (0-100). */
278
+ percentage: number;
279
+ /** Overall compliance rating. */
280
+ rating: 'compliant' | 'nearly_compliant' | 'not_compliant';
281
+ /** List of identified compliance gaps. */
282
+ gaps: ComplianceGap[];
283
+ /** List of requirement ids that passed. */
284
+ passed: string[];
285
+ }
286
+
287
+ /**
288
+ * Represents a single entry in the consent audit trail.
289
+ * Each entry captures what happened, when, and the full consent state
290
+ * at that point in time, satisfying NDPA recordkeeping requirements.
291
+ */
292
+ export declare interface ConsentAuditEntry {
293
+ /** The type of consent action that occurred */
294
+ action: 'consent_given' | 'consent_withdrawn' | 'consent_updated' | 'consent_expired';
295
+ /** Unix timestamp (ms) when the action occurred */
296
+ timestamp: number;
297
+ /** Version of the consent form at the time of the action */
298
+ version: string;
299
+ /** Full snapshot of consent category states */
300
+ categories: Record<string, boolean>;
301
+ /** How consent was collected (e.g. "banner", "customize", "api") */
302
+ method: string;
303
+ /** Browser user-agent string for forensic traceability */
304
+ userAgent?: string;
305
+ }
306
+
307
+ /**
308
+ * Consent types aligned with NDPA 2023 Section 25-26
309
+ * Consent must be freely given, specific, informed, and unambiguous
310
+ */
311
+ /**
312
+ * Represents a consent option that can be presented to users
313
+ */
314
+ export declare interface ConsentOption {
315
+ /** Unique identifier for the consent option */
316
+ id: string;
317
+ /** Display label for the consent option */
318
+ label: string;
319
+ /** Detailed description of what this consent option covers */
320
+ description: string;
321
+ /** Whether this consent option is required (cannot be declined) */
322
+ required: boolean;
323
+ /**
324
+ * The specific purpose for which data will be processed
325
+ * NDPA Section 25(2) requires consent to be specific to each purpose
326
+ */
327
+ purpose: string;
328
+ /**
329
+ * Default state of the consent option
330
+ * @default false
331
+ */
332
+ defaultValue?: boolean;
333
+ /**
334
+ * Categories of personal data covered by this consent option
335
+ */
336
+ dataCategories?: string[];
337
+ }
338
+
339
+ /**
340
+ * Represents the user's consent settings
341
+ */
342
+ export declare interface ConsentSettings {
343
+ /** Map of consent option IDs to boolean values indicating consent status */
344
+ consents: Record<string, boolean>;
345
+ /** Timestamp when consent was last updated */
346
+ timestamp: number;
347
+ /** Version of the consent form that was accepted */
348
+ version: string;
349
+ /** Method used to collect consent (e.g., "banner", "settings", "api") */
350
+ method: string;
351
+ /** Whether the user has actively made a choice (as opposed to default settings) */
352
+ hasInteracted: boolean;
353
+ /**
354
+ * The lawful basis under which processing is conducted
355
+ * Required by NDPA Section 25(1)
356
+ */
357
+ lawfulBasis?: LawfulBasisType;
358
+ }
359
+
360
+ /**
361
+ * Represents the storage mechanism for consent settings
362
+ */
363
+ export declare interface ConsentStorageOptions {
364
+ /**
365
+ * Storage key for consent settings
366
+ * @default "ndpr_consent"
367
+ */
368
+ storageKey?: string;
369
+ /**
370
+ * Storage type to use
371
+ * @default "localStorage"
372
+ */
373
+ storageType?: 'localStorage' | 'sessionStorage' | 'cookie';
374
+ /**
375
+ * Cookie options (only used when storageType is "cookie")
376
+ */
377
+ cookieOptions?: {
378
+ /** Domain for the cookie */
379
+ domain?: string;
380
+ /**
381
+ * Path for the cookie
382
+ * @default "/"
383
+ */
384
+ path?: string;
385
+ /**
386
+ * Expiration days for the cookie
387
+ * @default 365
388
+ */
389
+ expires?: number;
390
+ /**
391
+ * Whether the cookie should be secure
392
+ * @default true
393
+ */
394
+ secure?: boolean;
395
+ /**
396
+ * SameSite attribute for the cookie
397
+ * @default "Lax"
398
+ */
399
+ sameSite?: 'Strict' | 'Lax' | 'None';
400
+ };
401
+ }
402
+
403
+ /**
404
+ * Creates a new audit entry from consent settings. If `previousSettings` is
405
+ * provided, the action is automatically determined by comparing old and new
406
+ * states. Otherwise `action` defaults to `'consent_given'`.
407
+ */
408
+ export declare function createAuditEntry(settings: ConsentSettings, previousSettings?: ConsentSettings | null, actionOverride?: ConsentAuditEntry['action']): ConsentAuditEntry;
409
+
410
+ /**
411
+ * Creates a complete business privacy policy template with default
412
+ * NDPA-compliant sections and variables.
413
+ *
414
+ * @returns An object containing the default sections and variables.
415
+ */
416
+ export declare function createBusinessPolicyTemplate(): {
417
+ sections: PolicySection[];
418
+ variables: PolicyVariable[];
419
+ };
420
+
421
+ /**
422
+ * Creates a default TemplateContext with sensible empty/initial values.
423
+ * Useful for initialising the wizard state before the user begins editing.
424
+ */
425
+ export declare function createDefaultContext(): TemplateContext;
426
+
427
+ /**
428
+ * Summary of cross-border transfer compliance
429
+ */
430
+ export declare interface CrossBorderSummary {
431
+ /** Total number of active transfers */
432
+ totalActiveTransfers: number;
433
+ /** Breakdown by transfer mechanism */
434
+ byMechanism: Record<TransferMechanism, number>;
435
+ /** Breakdown by adequacy status */
436
+ byAdequacy: Record<AdequacyStatus, number>;
437
+ /** Transfers pending NDPC approval */
438
+ pendingApproval: CrossBorderTransfer[];
439
+ /** Transfers due for review */
440
+ dueForReview: CrossBorderTransfer[];
441
+ /** Transfers missing TIA */
442
+ missingTIA: CrossBorderTransfer[];
443
+ /** High-risk transfers */
444
+ highRiskTransfers: CrossBorderTransfer[];
445
+ /** Last updated timestamp */
446
+ lastUpdated: number;
447
+ }
448
+
449
+ /**
450
+ * Represents a cross-border data transfer record
451
+ */
452
+ export declare interface CrossBorderTransfer {
453
+ /** Unique identifier */
454
+ id: string;
455
+ /** Destination country or territory */
456
+ destinationCountry: string;
457
+ /** ISO country code */
458
+ destinationCountryCode?: string;
459
+ /** Adequacy status of the destination */
460
+ adequacyStatus: AdequacyStatus;
461
+ /** The transfer mechanism being relied upon */
462
+ transferMechanism: TransferMechanism;
463
+ /** Categories of personal data being transferred */
464
+ dataCategories: string[];
465
+ /** Whether sensitive personal data is included */
466
+ includesSensitiveData: boolean;
467
+ /** Estimated number of data subjects whose data is transferred */
468
+ estimatedDataSubjects?: number;
469
+ /** Name of the recipient organization */
470
+ recipientOrganization: string;
471
+ /** Contact details of the recipient */
472
+ recipientContact: {
473
+ name: string;
474
+ email: string;
475
+ phone?: string;
476
+ address?: string;
477
+ };
478
+ /** Purpose of the data transfer */
479
+ purpose: string;
480
+ /** Safeguards in place to protect the data */
481
+ safeguards: string[];
482
+ /** Risk assessment summary */
483
+ riskAssessment: string;
484
+ /** Risk level of the transfer */
485
+ riskLevel: 'low' | 'medium' | 'high';
486
+ /** NDPC approval details (required for some transfer mechanisms) */
487
+ ndpcApproval?: {
488
+ required: boolean;
489
+ applied: boolean;
490
+ approved?: boolean;
491
+ referenceNumber?: string;
492
+ appliedAt?: number;
493
+ approvedAt?: number;
494
+ };
495
+ /** Whether a Transfer Impact Assessment has been conducted */
496
+ tiaCompleted: boolean;
497
+ /** Reference to the TIA document */
498
+ tiaReference?: string;
499
+ /** Frequency of the transfer */
500
+ frequency: 'one_time' | 'periodic' | 'continuous';
501
+ /** Start date of the transfer */
502
+ startDate: number;
503
+ /** End date of the transfer (if applicable) */
504
+ endDate?: number;
505
+ /** Status of the transfer */
506
+ status: 'active' | 'suspended' | 'terminated' | 'pending_approval';
507
+ /** Timestamp when the record was created */
508
+ createdAt: number;
509
+ /** Timestamp when the record was last updated */
510
+ updatedAt: number;
511
+ /** Next review date */
512
+ reviewDate?: number;
513
+ }
514
+
515
+ /** A user-defined section added to the policy outside the generated ones. */
516
+ export declare interface CustomSection {
517
+ id: string;
518
+ title: string;
519
+ content: string;
520
+ order: number;
521
+ required: false;
522
+ }
523
+
524
+ /** A logical category of personal data the organisation may collect. */
525
+ export declare interface DataCategory {
526
+ /** Machine-readable identifier. */
527
+ id: string;
528
+ /** Human-readable label shown in the wizard. */
529
+ label: string;
530
+ /** Grouping for display and compliance checks. */
531
+ group: 'identity' | 'financial' | 'behavioral' | 'sensitive' | 'children';
532
+ /** Specific data points within this category. */
533
+ dataPoints: string[];
534
+ /** Whether this category is currently selected by the user. */
535
+ selected: boolean;
536
+ }
537
+
538
+ /**
539
+ * Default NDPA-compliant privacy policy sections.
540
+ * Each section uses {{variable}} placeholders that are resolved at generation time.
541
+ */
542
+ export declare const DEFAULT_POLICY_SECTIONS: PolicySection[];
543
+
544
+ /**
545
+ * Default policy variables for NDPA-compliant privacy policies.
546
+ * These map to the {{variable}} placeholders used in DEFAULT_POLICY_SECTIONS.
547
+ */
548
+ export declare const DEFAULT_POLICY_VARIABLES: PolicyVariable[];
549
+
550
+ export declare const defaultLocale: Required<{
551
+ [K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
552
+ }>;
553
+
554
+ /**
555
+ * Data Protection Impact Assessment types aligned with NDPA 2023 Sections 38-39
556
+ * A DPIA is required when processing is likely to result in high risk to data subjects
557
+ */
558
+ /**
559
+ * Represents a question in the DPIA questionnaire
560
+ */
561
+ export declare interface DPIAQuestion {
562
+ /** Unique identifier for the question */
563
+ id: string;
564
+ /** The text of the question */
565
+ text: string;
566
+ /** Additional guidance for answering the question */
567
+ guidance?: string;
568
+ /** Type of input required for the answer */
569
+ type: 'text' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'scale';
570
+ /** Options for select, radio, or checkbox questions */
571
+ options?: Array<{
572
+ value: string;
573
+ label: string;
574
+ riskLevel?: 'low' | 'medium' | 'high';
575
+ }>;
576
+ /** For scale questions, the minimum value */
577
+ minValue?: number;
578
+ /** For scale questions, the maximum value */
579
+ maxValue?: number;
580
+ /** For scale questions, labels for the scale points */
581
+ scaleLabels?: Record<number, string>;
582
+ /** Whether the question is required */
583
+ required: boolean;
584
+ /** Risk level associated with this question */
585
+ riskLevel?: 'low' | 'medium' | 'high';
586
+ /** Whether this question triggers additional questions based on the answer */
587
+ hasDependentQuestions?: boolean;
588
+ /** Conditions that determine when this question should be shown */
589
+ showWhen?: Array<{
590
+ questionId: string;
591
+ operator: 'equals' | 'contains' | 'greaterThan' | 'lessThan';
592
+ value: string | number | boolean;
593
+ }>;
594
+ }
595
+
596
+ /**
597
+ * Represents the result of a completed DPIA
598
+ */
599
+ export declare interface DPIAResult {
600
+ /** Unique identifier for the DPIA */
601
+ id: string;
602
+ /** Title of the DPIA */
603
+ title: string;
604
+ /** Description of the processing activity being assessed */
605
+ processingDescription: string;
606
+ /** Timestamp when the DPIA was started */
607
+ startedAt: number;
608
+ /** Timestamp when the DPIA was completed */
609
+ completedAt?: number;
610
+ /** Person responsible for conducting the DPIA */
611
+ assessor: {
612
+ name: string;
613
+ role: string;
614
+ email: string;
615
+ };
616
+ /** Answers to all questions in the DPIA */
617
+ answers: Record<string, string | number | boolean | string[]>;
618
+ /** Risks identified in the DPIA */
619
+ risks: DPIARisk[];
620
+ /** Overall risk level of the processing activity */
621
+ overallRiskLevel: 'low' | 'medium' | 'high' | 'critical';
622
+ /** Whether the DPIA concluded that the processing can proceed */
623
+ canProceed: boolean;
624
+ /** Reasons why the processing can or cannot proceed */
625
+ conclusion: string;
626
+ /** Recommendations for the processing activity */
627
+ recommendations?: string[];
628
+ /** Next review date for the DPIA */
629
+ reviewDate?: number;
630
+ /** Version of the DPIA questionnaire used */
631
+ version: string;
632
+ /**
633
+ * Whether prior consultation with NDPC is required
634
+ * Per NDPA Section 39, consultation is required when DPIA indicates high residual risk
635
+ */
636
+ ndpcConsultationRequired?: boolean;
637
+ /** Date when NDPC consultation was initiated */
638
+ ndpcConsultationDate?: number;
639
+ /** Reference number from NDPC consultation */
640
+ ndpcConsultationReference?: string;
641
+ /**
642
+ * The lawful basis for the processing activity being assessed
643
+ */
644
+ lawfulBasis?: string;
645
+ /**
646
+ * Whether this DPIA involves cross-border data transfers
647
+ */
648
+ involvesCrossBorderTransfer?: boolean;
649
+ }
650
+
651
+ /**
652
+ * Represents a risk identified in the DPIA
653
+ */
654
+ export declare interface DPIARisk {
655
+ /** Unique identifier for the risk */
656
+ id: string;
657
+ /** Description of the risk */
658
+ description: string;
659
+ /** Likelihood of the risk occurring (1-5) */
660
+ likelihood: number;
661
+ /** Impact if the risk occurs (1-5) */
662
+ impact: number;
663
+ /** Overall risk score (likelihood * impact) */
664
+ score: number;
665
+ /** Risk level based on the score */
666
+ level: 'low' | 'medium' | 'high' | 'critical';
667
+ /** Measures to mitigate the risk */
668
+ mitigationMeasures?: string[];
669
+ /** Whether the risk has been mitigated */
670
+ mitigated: boolean;
671
+ /** Residual risk score after mitigation */
672
+ residualScore?: number;
673
+ /** Questions that identified this risk */
674
+ relatedQuestionIds: string[];
675
+ }
676
+
677
+ /**
678
+ * Represents a section in the DPIA questionnaire
679
+ */
680
+ export declare interface DPIASection {
681
+ /** Unique identifier for the section */
682
+ id: string;
683
+ /** Title of the section */
684
+ title: string;
685
+ /** Description of the section */
686
+ description?: string;
687
+ /** Questions in this section */
688
+ questions: DPIAQuestion[];
689
+ /** Order of the section in the questionnaire */
690
+ order: number;
691
+ }
692
+
693
+ /**
694
+ * Represents a data subject request
695
+ */
696
+ export declare interface DSRRequest {
697
+ /** Unique identifier for the request */
698
+ id: string;
699
+ /** Type of request */
700
+ type: DSRType;
701
+ /** Current status of the request */
702
+ status: DSRStatus;
703
+ /** Timestamp when the request was submitted */
704
+ createdAt: number;
705
+ /** Timestamp when the request was last updated */
706
+ updatedAt: number;
707
+ /** Timestamp when the request was completed (if applicable) */
708
+ completedAt?: number;
709
+ /** Timestamp when the identity was verified (if applicable) */
710
+ verifiedAt?: number;
711
+ /**
712
+ * Due date for responding to the request (timestamp)
713
+ * NDPA requires response within 30 days of receipt
714
+ */
715
+ dueDate?: number;
716
+ /** Description or details of the request */
717
+ description?: string;
718
+ /**
719
+ * The lawful basis under which the data was originally processed
720
+ * Relevant for evaluating objection and erasure requests
721
+ */
722
+ lawfulBasis?: string;
723
+ /** Data subject information */
724
+ subject: {
725
+ name: string;
726
+ email: string;
727
+ phone?: string;
728
+ identifierValue?: string;
729
+ identifierType?: string;
730
+ };
731
+ /** Additional information provided by the data subject */
732
+ additionalInfo?: Record<string, string | number | boolean | null>;
733
+ /** Notes added by staff processing the request */
734
+ internalNotes?: Array<{
735
+ timestamp: number;
736
+ author: string;
737
+ note: string;
738
+ }>;
739
+ /** Verification status */
740
+ verification?: {
741
+ verified: boolean;
742
+ method?: string;
743
+ verifiedAt?: number;
744
+ verifiedBy?: string;
745
+ };
746
+ /** Reason for rejection (if status is 'rejected') */
747
+ rejectionReason?: string;
748
+ /** Files attached to the request */
749
+ attachments?: Array<{
750
+ id: string;
751
+ name: string;
752
+ type: string;
753
+ url: string;
754
+ addedAt: number;
755
+ }>;
756
+ /**
757
+ * Whether an extension was requested for this DSR
758
+ * NDPA allows a one-time extension of 30 days with justification
759
+ */
760
+ extensionRequested?: boolean;
761
+ /** Reason for the extension, if requested */
762
+ extensionReason?: string;
763
+ }
764
+
765
+ /**
766
+ * Status of a data subject request
767
+ */
768
+ export declare type DSRStatus = 'pending' | 'awaitingVerification' | 'inProgress' | 'completed' | 'rejected';
769
+
770
+ /**
771
+ * Validated DSR submission shape — matches what `<DSRRequestForm onSubmit>`
772
+ * emits client-side. Use this as the typed parameter for your server-side
773
+ * handler after `validateDsrSubmission` returns `valid: true`.
774
+ */
775
+ export declare interface DsrSubmissionPayload {
776
+ requestType: string;
777
+ dataSubject: {
778
+ fullName: string;
779
+ email: string;
780
+ phone?: string;
781
+ identifierType: string;
782
+ identifierValue: string;
783
+ };
784
+ additionalInfo?: Record<string, string | number | boolean | null>;
785
+ submittedAt: number;
786
+ }
787
+
788
+ /** Result of validating a raw DSR submission payload. */
789
+ export declare interface DsrSubmissionValidationResult {
790
+ /** True when the payload conforms to the DSR submission contract. */
791
+ valid: boolean;
792
+ /** Field-keyed error messages. Empty when `valid` is true. */
793
+ errors: Record<string, string>;
794
+ /** The narrowed, typed payload — only populated when `valid` is true. */
795
+ data?: DsrSubmissionPayload;
796
+ }
797
+
798
+ /**
799
+ * Data Subject Rights types aligned with NDPA 2023 Part IV (Sections 29-36)
800
+ */
801
+ /**
802
+ * Types of data subject requests per NDPA Part IV
803
+ * - 'information': Right to be informed (Section 29)
804
+ * - 'access': Right of access (Section 30)
805
+ * - 'rectification': Right to rectification (Section 31)
806
+ * - 'erasure': Right to erasure (Section 32)
807
+ * - 'restriction': Right to restrict processing (Section 33)
808
+ * - 'portability': Right to data portability (Section 34)
809
+ * - 'objection': Right to object (Section 35)
810
+ * - 'automated_decision_making': Rights related to automated decision-making (Section 36)
811
+ */
812
+ export declare type DSRType = 'information' | 'access' | 'rectification' | 'erasure' | 'restriction' | 'portability' | 'objection' | 'automated_decision_making';
813
+
814
+ export declare type EffortLevel = 'low' | 'medium' | 'high';
815
+
816
+ /**
817
+ * NDPA policy compliance checker.
818
+ *
819
+ * Evaluates a {@link PrivacyPolicy} against 15 requirements drawn from
820
+ * the Nigeria Data Protection Act (NDPA) 2023, producing a scored
821
+ * {@link ComplianceResult} with actionable gaps.
822
+ *
823
+ * Scoring:
824
+ * 6 critical @ 10 pts = 60
825
+ * 5 important @ 7 pts = 35
826
+ * 4 recommended @ 5 pts = 20
827
+ * Total max = 115
828
+ *
829
+ * Rating thresholds:
830
+ * >= 100 → compliant
831
+ * >= 80 → nearly_compliant
832
+ * < 80 → not_compliant
833
+ */
834
+
835
+ /**
836
+ * Evaluates a privacy policy against 15 NDPA 2023 requirements and
837
+ * returns a scored compliance result with actionable gap information.
838
+ *
839
+ * @param policy - The privacy policy to evaluate.
840
+ * @param context - The template context that was used to generate the policy.
841
+ * @returns A {@link ComplianceResult} with score, rating, gaps, and passed ids.
842
+ */
843
+ export declare function evaluatePolicyCompliance(policy: PrivacyPolicy, context: TemplateContext): ComplianceResult;
844
+
845
+ /**
846
+ * Exports the Record of Processing Activities to a CSV string.
847
+ * The CSV includes all key fields from each processing record.
848
+ *
849
+ * @param ropa - The full Record of Processing Activities
850
+ * @returns CSV-formatted string
851
+ */
852
+ export declare function exportROPAToCSV(ropa: RecordOfProcessingActivities): string;
853
+
854
+ /**
855
+ * Scan rendered policy text for unfilled placeholder tokens.
856
+ *
857
+ * Detects two token forms:
858
+ * - `«TODO: fieldName»` — sentinel emitted by {@link assemblePolicy} when
859
+ * a required org-info field is missing from the context.
860
+ * - `{{fieldName}}` — mustache token that escaped substitution (either
861
+ * because the variable wasn't declared or its value was empty).
862
+ *
863
+ * Returns a deduplicated list of the field names found. An empty array
864
+ * means the rendered text is fully populated.
865
+ *
866
+ * Two recommended uses:
867
+ *
868
+ * 1. **CI guard** — assert your canonical org-info fixture renders without
869
+ * leaving any tokens behind:
870
+ * ```ts
871
+ * const html = exportHTML(policy);
872
+ * expect(findUnfilledTokens(html)).toEqual([]);
873
+ * ```
874
+ *
875
+ * 2. **Runtime guard** — surface a clear error to compliance officers
876
+ * before they publish a policy with `{{orgName}}` visible to visitors:
877
+ * ```ts
878
+ * const missing = findUnfilledTokens(getPolicyText().fullText);
879
+ * if (missing.length) throw new Error(`Policy is missing: ${missing.join(', ')}`);
880
+ * ```
881
+ *
882
+ * @param rendered - The substituted policy text (from `exportHTML`,
883
+ * `exportMarkdown`, or `usePrivacyPolicy().getPolicyText().fullText`).
884
+ * @returns Deduplicated array of unfilled field names; `[]` if fully filled.
885
+ */
886
+ export declare function findUnfilledTokens(rendered: string): string[];
887
+
888
+ /**
889
+ * Formats a DSR request for display or submission
890
+ * @param request The DSR request to format
891
+ * @returns Formatted request data
892
+ */
893
+ export declare function formatDSRRequest(request: DSRRequest): {
894
+ formattedRequest: Record<string, unknown>;
895
+ isValid: boolean;
896
+ validationErrors: string[];
897
+ };
898
+
899
+ /**
900
+ * Generates a summary of all lawful basis documentation across processing activities.
901
+ *
902
+ * @param activities Array of processing activities to summarize
903
+ * @returns LawfulBasisSummary with counts, breakdowns, and flagged activities
904
+ */
905
+ export declare function generateLawfulBasisSummary(activities: ProcessingActivity[]): LawfulBasisSummary;
906
+
907
+ /**
908
+ * Generates policy text by replacing variables in a template with organization-specific values
909
+ * @param sectionsOrTemplate The policy sections or template string to generate text for
910
+ * @param organizationInfoOrVariables The organization information or variable map to use for replacement
911
+ * @returns The generated policy text or an object with the generated text and metadata
912
+ */
913
+ export declare function generatePolicyText(sectionsOrTemplate: PolicySection[] | string, organizationInfoOrVariables: OrganizationInfo | Record<string, string>): string | {
914
+ fullText: string;
915
+ sectionTexts: Record<string, string>;
916
+ missingVariables: string[];
917
+ };
918
+
919
+ /**
920
+ * Generates a summary of the Record of Processing Activities.
921
+ * Provides statistics and identifies records that are due for review.
922
+ *
923
+ * @param ropa - The full Record of Processing Activities
924
+ * @returns Summary statistics for the ROPA
925
+ */
926
+ export declare function generateROPASummary(ropa: RecordOfProcessingActivities): ROPASummary;
927
+
928
+ /**
929
+ * Retrieves the full consent audit log from localStorage.
930
+ * Returns an empty array if no log exists or parsing fails.
931
+ *
932
+ * @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
933
+ */
934
+ export declare function getAuditLog(storageKey?: string): ConsentAuditEntry[];
935
+
936
+ /**
937
+ * Evaluate an organisation's NDPA compliance across all modules.
938
+ *
939
+ * @param input - Compliance input object
940
+ * @returns ComplianceReport with overall score, per-module breakdown, and sorted recommendations
941
+ */
942
+ export declare function getComplianceScore(input: ComplianceInput): ComplianceReport;
943
+
944
+ /**
945
+ * Returns a human-readable description of a lawful basis with the relevant
946
+ * NDPA section reference.
947
+ *
948
+ * @param basis The lawful basis to describe
949
+ * @returns Description string including NDPA section reference
950
+ */
951
+ export declare function getLawfulBasisDescription(basis: LawfulBasis): string;
952
+
953
+ /**
954
+ * Returns a human-readable description of a transfer mechanism with its NDPA section reference.
955
+ *
956
+ * @param mechanism The transfer mechanism
957
+ * @returns Description including the relevant NDPA section
958
+ */
959
+ export declare function getTransferMechanismDescription(mechanism: TransferMechanism): string;
960
+
961
+ export declare const hausaLocale: Required<{
962
+ [K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
963
+ }>;
964
+
965
+ /**
966
+ * Identifies compliance gaps in the Record of Processing Activities.
967
+ * Finds records that are missing required information per NDPA 2023.
968
+ *
969
+ * @param ropa - The full Record of Processing Activities
970
+ * @returns Array of compliance gaps grouped by record
971
+ */
972
+ export declare function identifyComplianceGaps(ropa: RecordOfProcessingActivities): ROPAComplianceGap[];
973
+
974
+ export declare const igboLocale: Required<{
975
+ [K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
976
+ }>;
977
+
978
+ /**
979
+ * Policy engine types for the adaptive privacy policy generator.
980
+ * These types power the wizard-driven policy builder, compliance checker,
981
+ * and export functionality — all aligned with the NDPA 2023.
982
+ */
983
+
984
+ /** Industry verticals with sector-specific compliance requirements. */
985
+ declare type Industry = 'fintech' | 'healthcare' | 'ecommerce' | 'saas' | 'education' | 'government' | 'other';
986
+
987
+ /**
988
+ * Returns whether NDPC approval is required for a given transfer mechanism.
989
+ * Approval is required for standard contractual clauses (Section 42),
990
+ * binding corporate rules (Section 43), and specific NDPC authorization (Section 44).
991
+ *
992
+ * @param mechanism The transfer mechanism
993
+ * @returns Whether NDPC approval is required
994
+ */
995
+ export declare function isNDPCApprovalRequired(mechanism: TransferMechanism): boolean;
996
+
997
+ /**
998
+ * Lawful Basis types aligned with NDPA 2023 Part III (Sections 24-28)
999
+ * Every processing activity must have a documented lawful basis
1000
+ */
1001
+ /**
1002
+ * The six lawful bases for processing personal data per NDPA Section 25(1)
1003
+ */
1004
+ export declare type LawfulBasis = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_interest' | 'legitimate_interests';
1005
+
1006
+ /**
1007
+ * Compliance gap identified across processing activities
1008
+ */
1009
+ export declare interface LawfulBasisComplianceGap {
1010
+ activityId: string;
1011
+ activityName: string;
1012
+ type: 'missing_approval' | 'overdue_review' | 'missing_justification' | 'missing_lia' | 'missing_sensitive_condition' | 'missing_retention' | 'missing_data_categories' | 'missing_purposes';
1013
+ severity: 'high' | 'medium' | 'low';
1014
+ description: string;
1015
+ }
1016
+
1017
+ /**
1018
+ * Summary of all lawful basis documentation for compliance reporting
1019
+ */
1020
+ export declare interface LawfulBasisSummary {
1021
+ /** Total number of processing activities */
1022
+ totalActivities: number;
1023
+ /** Breakdown by lawful basis */
1024
+ byBasis: Record<LawfulBasis, number>;
1025
+ /** Number of activities involving sensitive data */
1026
+ sensitiveDataActivities: number;
1027
+ /** Number of activities involving cross-border transfers */
1028
+ crossBorderActivities: number;
1029
+ /** Activities due for review */
1030
+ activitiesDueForReview: ProcessingActivity[];
1031
+ /** Activities without DPO approval */
1032
+ activitiesWithoutApproval: ProcessingActivity[];
1033
+ /** Last updated timestamp */
1034
+ lastUpdated: number;
1035
+ }
1036
+
1037
+ /**
1038
+ * Lawful basis for processing personal data per NDPA Section 25(1)
1039
+ */
1040
+ export declare type LawfulBasisType = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_interest' | 'legitimate_interests';
1041
+
1042
+ /**
1043
+ * Validation result for a processing activity
1044
+ */
1045
+ export declare interface LawfulBasisValidationResult {
1046
+ isValid: boolean;
1047
+ errors: string[];
1048
+ warnings: string[];
1049
+ }
1050
+
1051
+ /**
1052
+ * Represents a Legitimate Interest Assessment (LIA)
1053
+ * Required when the lawful basis is 'legitimate_interests'
1054
+ */
1055
+ export declare interface LegitimateInterestAssessment {
1056
+ /** Unique identifier */
1057
+ id: string;
1058
+ /** ID of the associated processing activity */
1059
+ processingActivityId: string;
1060
+ /** Date the assessment was conducted */
1061
+ assessmentDate: number;
1062
+ /** Person who conducted the assessment */
1063
+ assessor: {
1064
+ name: string;
1065
+ role: string;
1066
+ email: string;
1067
+ };
1068
+ /** Description of the legitimate interest being pursued */
1069
+ purposeTest: string;
1070
+ /** Why the processing is necessary for this purpose */
1071
+ necessityTest: string;
1072
+ /** Balancing test: rights of data subject vs. legitimate interest */
1073
+ balancingTest: string;
1074
+ /** Safeguards applied to protect data subject rights */
1075
+ safeguards: string[];
1076
+ /** Overall conclusion */
1077
+ conclusion: string;
1078
+ /** Whether the assessment concluded the processing is justified */
1079
+ approved: boolean;
1080
+ }
1081
+
1082
+ /**
1083
+ * Deep merges a partial locale with the default English locale.
1084
+ * Any missing keys fall back to English.
1085
+ */
1086
+ export declare function mergeLocale(partial?: NDPRLocale): typeof defaultLocale;
1087
+
1088
+ export declare interface ModuleScore {
1089
+ /** Module name (e.g. "consent") */
1090
+ name: string;
1091
+ /** Raw module score 0-100 */
1092
+ score: number;
1093
+ /** Maximum possible score for this module (always 100) */
1094
+ maxScore: number;
1095
+ /** Weighted contribution to the overall score */
1096
+ weightedScore: number;
1097
+ /** NDPA sections this module maps to */
1098
+ ndpaSections: string[];
1099
+ /** Gaps found — list of human-readable gap descriptions */
1100
+ gaps: string[];
1101
+ }
1102
+
1103
+ /**
1104
+ * Configuration for the NDPR toolkit provider.
1105
+ */
1106
+ export declare interface NDPRConfig {
1107
+ /** The official name of the organisation */
1108
+ organizationName?: string;
1109
+ /** Email address of the Data Protection Officer */
1110
+ dpoEmail?: string;
1111
+ /** NDPC registration number, if registered */
1112
+ ndpcRegistrationNumber?: string;
1113
+ /** Prefix for localStorage/sessionStorage keys used by toolkit components */
1114
+ storageKeyPrefix?: string;
1115
+ /** When true, removes all default styles from toolkit components */
1116
+ unstyled?: boolean;
1117
+ /** Theme overrides applied as CSS custom properties */
1118
+ theme?: {
1119
+ /** Primary brand colour (e.g. "#0070f3") */
1120
+ primary?: string;
1121
+ /** Hover state for primary colour */
1122
+ primaryHover?: string;
1123
+ /** Foreground colour used on primary backgrounds */
1124
+ primaryForeground?: string;
1125
+ };
1126
+ /**
1127
+ * Locale strings for all toolkit components.
1128
+ * Pass partial overrides — missing keys fall back to English defaults.
1129
+ */
1130
+ locale?: NDPRLocale;
1131
+ /**
1132
+ * Custom fallback UI to render when a child component throws during rendering.
1133
+ * Receives the error and a reset function. If omitted, a default fallback is shown.
1134
+ */
1135
+ fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
1136
+ /**
1137
+ * Called when the error boundary catches an error.
1138
+ * Useful for sending errors to an external reporting service.
1139
+ */
1140
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
1141
+ }
1142
+
1143
+ /**
1144
+ * Locale strings for all toolkit components.
1145
+ * Pass partial overrides — missing keys fall back to English defaults.
1146
+ */
1147
+ export declare interface NDPRLocale {
1148
+ consent?: {
1149
+ title?: string;
1150
+ description?: string;
1151
+ acceptAll?: string;
1152
+ rejectAll?: string;
1153
+ customize?: string;
1154
+ savePreferences?: string;
1155
+ selectAll?: string;
1156
+ deselectAll?: string;
1157
+ required?: string;
1158
+ cookieNotice?: string;
1159
+ };
1160
+ dsr?: {
1161
+ title?: string;
1162
+ description?: string;
1163
+ submitRequest?: string;
1164
+ reset?: string;
1165
+ fullName?: string;
1166
+ email?: string;
1167
+ phone?: string;
1168
+ requestType?: string;
1169
+ additionalInfo?: string;
1170
+ identityVerification?: string;
1171
+ identifierType?: string;
1172
+ identifierValue?: string;
1173
+ privacyNotice?: string;
1174
+ successMessage?: string;
1175
+ };
1176
+ breach?: {
1177
+ title?: string;
1178
+ description?: string;
1179
+ submitReport?: string;
1180
+ breachTitle?: string;
1181
+ category?: string;
1182
+ discoveredAt?: string;
1183
+ detailedDescription?: string;
1184
+ };
1185
+ dpia?: {
1186
+ title?: string;
1187
+ next?: string;
1188
+ previous?: string;
1189
+ complete?: string;
1190
+ progress?: string;
1191
+ };
1192
+ policy?: {
1193
+ title?: string;
1194
+ generate?: string;
1195
+ preview?: string;
1196
+ export?: string;
1197
+ sections?: string;
1198
+ variables?: string;
1199
+ };
1200
+ compliance?: {
1201
+ score?: string;
1202
+ excellent?: string;
1203
+ good?: string;
1204
+ needsWork?: string;
1205
+ critical?: string;
1206
+ recommendations?: string;
1207
+ passed?: string;
1208
+ gaps?: string;
1209
+ };
1210
+ common?: {
1211
+ loading?: string;
1212
+ error?: string;
1213
+ save?: string;
1214
+ cancel?: string;
1215
+ delete?: string;
1216
+ edit?: string;
1217
+ add?: string;
1218
+ back?: string;
1219
+ next?: string;
1220
+ search?: string;
1221
+ noResults?: string;
1222
+ };
1223
+ }
1224
+
1225
+ /**
1226
+ * Provides NDPR configuration to all descendant toolkit components.
1227
+ *
1228
+ * When a `theme` is supplied, the corresponding CSS custom properties
1229
+ * (`--ndpr-primary`, `--ndpr-primary-hover`, `--ndpr-primary-foreground`)
1230
+ * are set on the wrapping element so components can reference them.
1231
+ *
1232
+ * Wraps children in an error boundary so that a rendering failure in any
1233
+ * toolkit component does not crash the host application.
1234
+ */
1235
+ export declare const NDPRProvider: React__default.FC<NDPRConfig & {
1236
+ children: React__default.ReactNode;
1237
+ }>;
1238
+
1239
+ /**
1240
+ * Represents notification requirements for a data breach per NDPA Section 40
1241
+ */
1242
+ export declare interface NotificationRequirement {
1243
+ /**
1244
+ * Whether NDPC notification is required
1245
+ * Per NDPA Section 40, notification to NDPC is required for all breaches
1246
+ * that pose a risk to data subjects' rights and freedoms
1247
+ */
1248
+ ndpcNotificationRequired: boolean;
1249
+ /**
1250
+ * Deadline for NDPC notification (72 hours from discovery)
1251
+ * NDPA Section 40(1)
1252
+ */
1253
+ ndpcNotificationDeadline: number;
1254
+ /**
1255
+ * Whether data subject notification is required
1256
+ * Per NDPA Section 40(4), required when breach is likely to result in
1257
+ * high risk to rights and freedoms of data subjects
1258
+ */
1259
+ dataSubjectNotificationRequired: boolean;
1260
+ /** Justification for the notification decision */
1261
+ justification: string;
1262
+ /**
1263
+ * @deprecated Use ndpcNotificationRequired instead. Kept for backward compatibility.
1264
+ */
1265
+ nitdaNotificationRequired?: boolean;
1266
+ /**
1267
+ * @deprecated Use ndpcNotificationDeadline instead. Kept for backward compatibility.
1268
+ */
1269
+ nitdaNotificationDeadline?: number;
1270
+ }
1271
+
1272
+ /**
1273
+ * Represents organization information for a privacy policy
1274
+ */
1275
+ export declare interface OrganizationInfo {
1276
+ /** Name of the organization */
1277
+ name: string;
1278
+ /** Website URL of the organization */
1279
+ website: string;
1280
+ /** Contact email for privacy inquiries */
1281
+ privacyEmail: string;
1282
+ /** Physical address of the organization */
1283
+ address?: string;
1284
+ /** Phone number for privacy inquiries */
1285
+ privacyPhone?: string;
1286
+ /** Name of the Data Protection Officer */
1287
+ dpoName?: string;
1288
+ /** Email of the Data Protection Officer */
1289
+ dpoEmail?: string;
1290
+ /** Industry or sector of the organization */
1291
+ industry?: string;
1292
+ /** NDPC registration number (if registered) */
1293
+ ndpcRegistrationNumber?: string;
1294
+ }
1295
+
1296
+ /** Organisation size tiers — affects complexity of generated language. */
1297
+ declare type OrgSize = 'startup' | 'midsize' | 'enterprise';
1298
+
1299
+ export declare const pidginLocale: Required<{
1300
+ [K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
1301
+ }>;
1302
+
1303
+ /** Represents an in-progress policy being built in the wizard. */
1304
+ export declare interface PolicyDraft {
1305
+ /** Unique identifier for the draft. */
1306
+ id: string;
1307
+ /** The template context driving section generation. */
1308
+ templateContext: TemplateContext;
1309
+ /** Custom sections added by the user. */
1310
+ customSections: CustomSection[];
1311
+ /** Per-section content overrides keyed by section id. */
1312
+ sectionOverrides: Record<string, string>;
1313
+ /** Ordered list of section ids defining the final order. */
1314
+ sectionOrder: string[];
1315
+ /** Current wizard step (0-indexed). */
1316
+ currentStep: number;
1317
+ /** Timestamp of the last save. */
1318
+ lastSavedAt: number;
1319
+ /** The draft is always in "draft" status until finalised. */
1320
+ status: 'draft';
1321
+ }
1322
+
1323
+ /**
1324
+ * Privacy policy types aligned with NDPA 2023
1325
+ * Privacy policies must clearly inform data subjects of their rights under the NDPA
1326
+ */
1327
+ /**
1328
+ * Represents a section in a privacy policy
1329
+ */
1330
+ export declare interface PolicySection {
1331
+ /** Unique identifier for the section */
1332
+ id: string;
1333
+ /** Title of the section */
1334
+ title: string;
1335
+ /** Description of the section */
1336
+ description?: string;
1337
+ /** Order of the section in the policy */
1338
+ order?: number;
1339
+ /** Whether the section is required by NDPA */
1340
+ required: boolean;
1341
+ /** Template text for the section */
1342
+ template: string;
1343
+ /**
1344
+ * Default content for the section (legacy field)
1345
+ * @deprecated Use template instead
1346
+ */
1347
+ defaultContent?: string;
1348
+ /**
1349
+ * Custom content for the section (overrides default content)
1350
+ * @deprecated Use template instead
1351
+ */
1352
+ customContent?: string;
1353
+ /** Whether the section is included in the policy */
1354
+ included: boolean;
1355
+ /** Variables that can be used in the section content */
1356
+ variables?: string[];
1357
+ }
1358
+
1359
+ /**
1360
+ * Represents a privacy policy template
1361
+ */
1362
+ export declare interface PolicyTemplate {
1363
+ /** Unique identifier for the template */
1364
+ id: string;
1365
+ /** Name of the template */
1366
+ name: string;
1367
+ /** Description of the template */
1368
+ description: string;
1369
+ /** Type of organization the template is designed for */
1370
+ organizationType: 'business' | 'nonprofit' | 'government' | 'educational';
1371
+ /** Sections included in the template */
1372
+ sections: PolicySection[];
1373
+ /** Variables used across the template */
1374
+ variables: Record<string, {
1375
+ name: string;
1376
+ description: string;
1377
+ required: boolean;
1378
+ defaultValue?: string;
1379
+ }>;
1380
+ /** Version of the template */
1381
+ version: string;
1382
+ /** Last updated date of the template */
1383
+ lastUpdated: number;
1384
+ /**
1385
+ * Whether this template is NDPA 2023 compliant
1386
+ */
1387
+ ndpaCompliant: boolean;
1388
+ }
1389
+
1390
+ /**
1391
+ * Represents a variable in a privacy policy
1392
+ */
1393
+ export declare interface PolicyVariable {
1394
+ /** Unique identifier for the variable */
1395
+ id: string;
1396
+ /** Name of the variable as it appears in the template */
1397
+ name: string;
1398
+ /** Description of the variable */
1399
+ description: string;
1400
+ /** Default value for the variable */
1401
+ defaultValue?: string;
1402
+ /** Current value of the variable */
1403
+ value: string;
1404
+ /** Type of input for the variable */
1405
+ inputType: 'text' | 'textarea' | 'email' | 'url' | 'date' | 'select';
1406
+ /** Options for select inputs */
1407
+ options?: string[];
1408
+ /** Whether the variable is required */
1409
+ required: boolean;
1410
+ }
1411
+
1412
+ /**
1413
+ * Represents a generated privacy policy
1414
+ */
1415
+ export declare interface PrivacyPolicy {
1416
+ /** Unique identifier for the policy */
1417
+ id: string;
1418
+ /** Title of the policy */
1419
+ title: string;
1420
+ /** Template used to generate the policy */
1421
+ templateId: string;
1422
+ /** Organization information */
1423
+ organizationInfo: OrganizationInfo;
1424
+ /** Sections of the policy */
1425
+ sections: PolicySection[];
1426
+ /** Values for the variables used in the policy */
1427
+ variableValues: Record<string, string>;
1428
+ /** Effective date of the policy */
1429
+ effectiveDate: number;
1430
+ /** Last updated date of the policy */
1431
+ lastUpdated: number;
1432
+ /** Version of the policy */
1433
+ version: string;
1434
+ /**
1435
+ * Applicable legal frameworks
1436
+ */
1437
+ applicableFrameworks?: ('ndpa' | 'ndpr' | 'gdpr' | 'ccpa')[];
1438
+ }
1439
+
1440
+ /**
1441
+ * Represents a processing activity and its lawful basis
1442
+ */
1443
+ export declare interface ProcessingActivity {
1444
+ /** Unique identifier */
1445
+ id: string;
1446
+ /** Name of the processing activity */
1447
+ name: string;
1448
+ /** Description of what processing is performed */
1449
+ description: string;
1450
+ /** The lawful basis for this processing activity */
1451
+ lawfulBasis: LawfulBasis;
1452
+ /** Justification for why this lawful basis applies */
1453
+ lawfulBasisJustification: string;
1454
+ /** Categories of personal data being processed */
1455
+ dataCategories: string[];
1456
+ /** Whether sensitive personal data is involved */
1457
+ involvesSensitiveData: boolean;
1458
+ /** Condition for processing sensitive data (required if involvesSensitiveData is true) */
1459
+ sensitiveDataCondition?: SensitiveDataCondition;
1460
+ /** Categories of data subjects */
1461
+ dataSubjectCategories: string[];
1462
+ /** Purposes of the processing */
1463
+ purposes: string[];
1464
+ /** Data retention period */
1465
+ retentionPeriod: string;
1466
+ /** Justification for the retention period */
1467
+ retentionJustification?: string;
1468
+ /** Recipients or categories of recipients */
1469
+ recipients?: string[];
1470
+ /** Whether data is transferred outside Nigeria */
1471
+ crossBorderTransfer: boolean;
1472
+ /** Timestamp when the record was created */
1473
+ createdAt: number;
1474
+ /** Timestamp when the record was last updated */
1475
+ updatedAt: number;
1476
+ /** Next review date */
1477
+ reviewDate?: number;
1478
+ /** Status of the processing activity */
1479
+ status: 'active' | 'inactive' | 'under_review' | 'archived';
1480
+ /** DPO approval details */
1481
+ dpoApproval?: {
1482
+ approved: boolean;
1483
+ approvedBy: string;
1484
+ approvedAt: number;
1485
+ notes?: string;
1486
+ };
1487
+ }
1488
+
1489
+ /** Lawful processing purposes recognised under the NDPA. */
1490
+ declare type ProcessingPurpose = 'service_delivery' | 'marketing' | 'analytics' | 'research' | 'legal_compliance' | 'fraud_prevention';
1491
+
1492
+ /**
1493
+ * Record of Processing Activities (ROPA) types aligned with NDPA 2023
1494
+ * Data controllers must maintain comprehensive records of all processing activities
1495
+ */
1496
+
1497
+ /**
1498
+ * Represents a single processing record in the ROPA
1499
+ */
1500
+ export declare interface ProcessingRecord {
1501
+ /** Unique identifier */
1502
+ id: string;
1503
+ /** Name of the processing activity */
1504
+ name: string;
1505
+ /** Detailed description of the processing */
1506
+ description: string;
1507
+ /** Data controller details */
1508
+ controllerDetails: {
1509
+ name: string;
1510
+ contact: string;
1511
+ address: string;
1512
+ registrationNumber?: string;
1513
+ dpoContact?: string;
1514
+ };
1515
+ /** Joint controller details (if applicable) */
1516
+ jointControllerDetails?: {
1517
+ name: string;
1518
+ contact: string;
1519
+ address: string;
1520
+ responsibilities: string;
1521
+ };
1522
+ /** Data processor details (if processing is outsourced) */
1523
+ processorDetails?: {
1524
+ name: string;
1525
+ contact: string;
1526
+ address: string;
1527
+ contractReference?: string;
1528
+ };
1529
+ /** Lawful basis for the processing */
1530
+ lawfulBasis: LawfulBasis;
1531
+ /** Justification for the chosen lawful basis */
1532
+ lawfulBasisJustification: string;
1533
+ /** Purposes of the processing */
1534
+ purposes: string[];
1535
+ /** Categories of personal data processed */
1536
+ dataCategories: string[];
1537
+ /** Categories of sensitive personal data (if any) */
1538
+ sensitiveDataCategories?: string[];
1539
+ /** Categories of data subjects */
1540
+ dataSubjectCategories: string[];
1541
+ /** Recipients or categories of recipients */
1542
+ recipients: string[];
1543
+ /** Cross-border transfer details */
1544
+ crossBorderTransfers?: Array<{
1545
+ destinationCountry: string;
1546
+ countryCode?: string;
1547
+ safeguards: string;
1548
+ transferMechanism: string;
1549
+ }>;
1550
+ /** Data retention period */
1551
+ retentionPeriod: string;
1552
+ /** Justification for the retention period */
1553
+ retentionJustification?: string;
1554
+ /** Technical and organizational security measures */
1555
+ securityMeasures: string[];
1556
+ /** Data source (directly from data subject or from third party) */
1557
+ dataSource: 'data_subject' | 'third_party' | 'public_source' | 'other';
1558
+ /** Third-party source details (if dataSource is 'third_party') */
1559
+ thirdPartySourceDetails?: string;
1560
+ /** Whether a DPIA is required for this processing */
1561
+ dpiaRequired: boolean;
1562
+ /** Reference to the DPIA (if conducted) */
1563
+ dpiaReference?: string;
1564
+ /** Whether automated decision-making is involved */
1565
+ automatedDecisionMaking: boolean;
1566
+ /** Details of automated decision-making (if applicable) */
1567
+ automatedDecisionMakingDetails?: string;
1568
+ /** Status of the processing record */
1569
+ status: 'active' | 'inactive' | 'archived';
1570
+ /** Department or business unit responsible */
1571
+ department?: string;
1572
+ /** System or application used for processing */
1573
+ systemsUsed?: string[];
1574
+ /** Timestamp when the record was created */
1575
+ createdAt: number;
1576
+ /** Timestamp when the record was last updated */
1577
+ updatedAt: number;
1578
+ /** Timestamp when the record was last reviewed */
1579
+ lastReviewedAt?: number;
1580
+ /** Next review date */
1581
+ nextReviewDate?: number;
1582
+ }
1583
+
1584
+ export declare interface Recommendation {
1585
+ module: string;
1586
+ key: string;
1587
+ label: string;
1588
+ priority: RecommendationPriority;
1589
+ effort: EffortLevel;
1590
+ recommendation: string;
1591
+ ndpaSection: string;
1592
+ }
1593
+
1594
+ export declare type RecommendationPriority = 'critical' | 'high' | 'medium' | 'low';
1595
+
1596
+ /**
1597
+ * Represents a complete Record of Processing Activities
1598
+ */
1599
+ export declare interface RecordOfProcessingActivities {
1600
+ /** Unique identifier */
1601
+ id: string;
1602
+ /** Organization name */
1603
+ organizationName: string;
1604
+ /** Organization contact information */
1605
+ organizationContact: string;
1606
+ /** Organization address */
1607
+ organizationAddress: string;
1608
+ /** Data Protection Officer details */
1609
+ dpoDetails?: {
1610
+ name: string;
1611
+ email: string;
1612
+ phone?: string;
1613
+ };
1614
+ /** NDPC registration number */
1615
+ ndpcRegistrationNumber?: string;
1616
+ /** All processing records */
1617
+ records: ProcessingRecord[];
1618
+ /** Timestamp when the ROPA was last updated */
1619
+ lastUpdated: number;
1620
+ /** Version of the ROPA */
1621
+ version: string;
1622
+ /** Export format options */
1623
+ exportFormats?: ('pdf' | 'csv' | 'json' | 'xlsx')[];
1624
+ }
1625
+
1626
+ /**
1627
+ * Represents a notification sent to the NDPC (Nigeria Data Protection Commission)
1628
+ */
1629
+ export declare interface RegulatoryNotification {
1630
+ /** Unique identifier for the notification */
1631
+ id: string;
1632
+ /** ID of the breach this notification is for */
1633
+ breachId: string;
1634
+ /** Timestamp when the notification was sent */
1635
+ sentAt: number;
1636
+ /** Method used to send the notification */
1637
+ method: 'email' | 'portal' | 'letter' | 'other';
1638
+ /** Reference number assigned by the NDPC (if available) */
1639
+ referenceNumber?: string;
1640
+ /** Contact person at the NDPC */
1641
+ ndpcContact?: {
1642
+ name: string;
1643
+ email: string;
1644
+ phone?: string;
1645
+ };
1646
+ /** Content of the notification */
1647
+ content: string;
1648
+ /** Attachments included with the notification */
1649
+ attachments?: Array<{
1650
+ id: string;
1651
+ name: string;
1652
+ type: string;
1653
+ url: string;
1654
+ }>;
1655
+ /** Follow-up communications with the NDPC */
1656
+ followUps?: Array<{
1657
+ timestamp: number;
1658
+ direction: 'sent' | 'received';
1659
+ content: string;
1660
+ attachments?: Array<{
1661
+ id: string;
1662
+ name: string;
1663
+ type: string;
1664
+ url: string;
1665
+ }>;
1666
+ }>;
1667
+ /**
1668
+ * @deprecated Use ndpcContact instead. Kept for backward compatibility.
1669
+ */
1670
+ nitdaContact?: {
1671
+ name: string;
1672
+ email: string;
1673
+ phone?: string;
1674
+ };
1675
+ }
1676
+
1677
+ export declare interface RegulatoryReference {
1678
+ section: string;
1679
+ title: string;
1680
+ url?: string;
1681
+ }
1682
+
1683
+ /**
1684
+ * Legacy status of a data subject request
1685
+ * @deprecated Use DSRStatus instead
1686
+ */
1687
+ export declare type RequestStatus = 'pending' | 'verifying' | 'processing' | 'completed' | 'rejected';
1688
+
1689
+ /**
1690
+ * Represents a type of data subject request (detailed configuration)
1691
+ */
1692
+ export declare interface RequestType {
1693
+ /** Unique identifier for the request type */
1694
+ id: string;
1695
+ /** Display name for the request type */
1696
+ name: string;
1697
+ /** Description of what this request type entails */
1698
+ description: string;
1699
+ /**
1700
+ * NDPA section reference (e.g., "Section 30" for access requests)
1701
+ */
1702
+ ndpaSection?: string;
1703
+ /**
1704
+ * Estimated time to fulfill this type of request (in days)
1705
+ * NDPA requires response within 30 days
1706
+ */
1707
+ estimatedCompletionTime: number;
1708
+ /** Whether additional information is required for this request type */
1709
+ requiresAdditionalInfo: boolean;
1710
+ /** Custom fields required for this request type */
1711
+ additionalFields?: Array<{
1712
+ id: string;
1713
+ label: string;
1714
+ type: 'text' | 'textarea' | 'select' | 'checkbox' | 'file';
1715
+ options?: string[];
1716
+ required: boolean;
1717
+ placeholder?: string;
1718
+ }>;
1719
+ }
1720
+
1721
+ /**
1722
+ * Represents a risk assessment for a data breach
1723
+ */
1724
+ export declare interface RiskAssessment {
1725
+ /** Unique identifier for the risk assessment */
1726
+ id: string;
1727
+ /** ID of the breach this assessment is for */
1728
+ breachId: string;
1729
+ /** Timestamp when the assessment was conducted */
1730
+ assessedAt: number;
1731
+ /** Person who conducted the assessment */
1732
+ assessor: {
1733
+ name: string;
1734
+ role: string;
1735
+ email: string;
1736
+ };
1737
+ /** Confidentiality impact (1-5) */
1738
+ confidentialityImpact: number;
1739
+ /** Integrity impact (1-5) */
1740
+ integrityImpact: number;
1741
+ /** Availability impact (1-5) */
1742
+ availabilityImpact: number;
1743
+ /** Likelihood of harm to data subjects (1-5) */
1744
+ harmLikelihood: number;
1745
+ /** Severity of potential harm to data subjects (1-5) */
1746
+ harmSeverity: number;
1747
+ /** Overall risk score */
1748
+ overallRiskScore: number;
1749
+ /** Risk level based on the overall score */
1750
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
1751
+ /** Whether the breach is likely to result in a risk to rights and freedoms */
1752
+ risksToRightsAndFreedoms: boolean;
1753
+ /** Whether the breach is likely to result in a high risk to rights and freedoms */
1754
+ highRisksToRightsAndFreedoms: boolean;
1755
+ /** Justification for the risk assessment */
1756
+ justification: string;
1757
+ }
1758
+
1759
+ /**
1760
+ * Compliance gap found in a processing record
1761
+ */
1762
+ export declare interface ROPAComplianceGap {
1763
+ recordId: string;
1764
+ recordName: string;
1765
+ gaps: string[];
1766
+ }
1767
+
1768
+ /**
1769
+ * Summary statistics for the ROPA
1770
+ */
1771
+ export declare interface ROPASummary {
1772
+ /** Total number of processing records */
1773
+ totalRecords: number;
1774
+ /** Active processing records */
1775
+ activeRecords: number;
1776
+ /** Records by lawful basis */
1777
+ byLawfulBasis: Record<LawfulBasis, number>;
1778
+ /** Records involving sensitive data */
1779
+ sensitiveDataRecords: number;
1780
+ /** Records involving cross-border transfers */
1781
+ crossBorderRecords: number;
1782
+ /** Records requiring DPIA */
1783
+ dpiaRequiredRecords: number;
1784
+ /** Records involving automated decision-making */
1785
+ automatedDecisionRecords: number;
1786
+ /** Records due for review */
1787
+ recordsDueForReview: ProcessingRecord[];
1788
+ /** Departments with most processing activities */
1789
+ topDepartments: Array<{
1790
+ department: string;
1791
+ count: number;
1792
+ }>;
1793
+ /** Last updated timestamp */
1794
+ lastUpdated: number;
1795
+ }
1796
+
1797
+ /**
1798
+ * Validation result for a processing record
1799
+ */
1800
+ export declare interface ROPAValidationResult {
1801
+ valid: boolean;
1802
+ errors: string[];
1803
+ }
1804
+
1805
+ /**
1806
+ * Sanitizes user input to prevent XSS attacks.
1807
+ * Escapes HTML special characters so that data rendered in dashboards
1808
+ * or other consumer UIs cannot execute embedded scripts.
1809
+ */
1810
+ export declare function sanitizeInput(input: string): string;
1811
+
1812
+ /**
1813
+ * Additional conditions required for processing sensitive personal data
1814
+ * per NDPA Section 27
1815
+ */
1816
+ export declare type SensitiveDataCondition = 'explicit_consent' | 'employment_law' | 'vital_interests_incapable' | 'nonprofit_legitimate' | 'publicly_available' | 'legal_claims' | 'substantial_public_interest' | 'health_purposes' | 'public_health' | 'archiving_research';
1817
+
1818
+ /** Full context used to generate an adaptive privacy policy. */
1819
+ export declare interface TemplateContext {
1820
+ /** Organisation details, extended with industry and size. */
1821
+ org: OrganizationInfo & {
1822
+ industry: Industry;
1823
+ orgSize: OrgSize;
1824
+ country: string;
1825
+ };
1826
+ /** Data categories the organisation collects. */
1827
+ dataCategories: DataCategory[];
1828
+ /** Processing purposes relevant to the organisation. */
1829
+ purposes: ProcessingPurpose[];
1830
+ /** Whether the organisation processes children's data. */
1831
+ hasChildrenData: boolean;
1832
+ /** Whether the organisation processes sensitive/special-category data. */
1833
+ hasSensitiveData: boolean;
1834
+ /** Whether the organisation processes financial data. */
1835
+ hasFinancialData: boolean;
1836
+ /** Whether data is transferred outside Nigeria. */
1837
+ hasCrossBorderTransfer: boolean;
1838
+ /** Whether automated decision-making or profiling is used. */
1839
+ hasAutomatedDecisions: boolean;
1840
+ /** Third-party processors that receive personal data. */
1841
+ thirdPartyProcessors: ThirdPartyProcessor[];
1842
+ }
1843
+
1844
+ /** A third-party entity that processes data on behalf of the organisation. */
1845
+ export declare interface ThirdPartyProcessor {
1846
+ /** Name of the third party. */
1847
+ name: string;
1848
+ /** Purpose of sharing data with this processor. */
1849
+ purpose: string;
1850
+ /** Country where the processor is located. */
1851
+ country: string;
1852
+ }
1853
+
1854
+ /**
1855
+ * Transfer Impact Assessment (TIA) for cross-border transfers
1856
+ */
1857
+ export declare interface TransferImpactAssessment {
1858
+ /** Unique identifier */
1859
+ id: string;
1860
+ /** ID of the associated cross-border transfer */
1861
+ transferId: string;
1862
+ /** Date the assessment was conducted */
1863
+ assessmentDate: number;
1864
+ /** Person who conducted the assessment */
1865
+ assessor: {
1866
+ name: string;
1867
+ role: string;
1868
+ email: string;
1869
+ };
1870
+ /** Analysis of the destination country's legal framework */
1871
+ destinationLegalFramework: string;
1872
+ /** Whether the destination has data protection legislation */
1873
+ hasDataProtectionLaw: boolean;
1874
+ /** Whether the destination has an independent supervisory authority */
1875
+ hasIndependentAuthority: boolean;
1876
+ /** Risk of government access to the data */
1877
+ governmentAccessRisk: 'low' | 'medium' | 'high';
1878
+ /** Overall assessment of data protection level */
1879
+ dataProtectionLevel: 'adequate' | 'partially_adequate' | 'inadequate';
1880
+ /** Supplementary measures to address gaps */
1881
+ supplementaryMeasures: string[];
1882
+ /** Technical measures (encryption, pseudonymization, etc.) */
1883
+ technicalMeasures: string[];
1884
+ /** Contractual measures */
1885
+ contractualMeasures: string[];
1886
+ /** Organizational measures */
1887
+ organizationalMeasures: string[];
1888
+ /** Overall conclusion */
1889
+ conclusion: string;
1890
+ /** Whether the transfer can proceed based on the assessment */
1891
+ approved: boolean;
1892
+ /** Conditions for the transfer (if approved with conditions) */
1893
+ conditions?: string[];
1894
+ }
1895
+
1896
+ /**
1897
+ * Cross-Border Data Transfer types aligned with NDPA 2023 Part VI (Sections 41-45)
1898
+ * Personal data may only be transferred outside Nigeria under specific conditions
1899
+ */
1900
+ /**
1901
+ * Transfer mechanisms recognized under the NDPA
1902
+ */
1903
+ export declare type TransferMechanism = 'adequacy_decision' | 'standard_clauses' | 'binding_corporate_rules' | 'ndpc_authorization' | 'explicit_consent' | 'contract_performance' | 'public_interest' | 'legal_claims' | 'vital_interests';
1904
+
1905
+ /**
1906
+ * Risk assessment result for a cross-border transfer
1907
+ */
1908
+ export declare interface TransferRiskResult {
1909
+ riskLevel: 'low' | 'medium' | 'high';
1910
+ riskScore: number;
1911
+ factors: string[];
1912
+ recommendations: string[];
1913
+ }
1914
+
1915
+ /**
1916
+ * Validation result for a cross-border transfer
1917
+ */
1918
+ export declare interface TransferValidationResult {
1919
+ isValid: boolean;
1920
+ errors: string[];
1921
+ warnings: string[];
1922
+ }
1923
+
1924
+ /**
1925
+ * Returns the current NDPR configuration from the nearest `NDPRProvider`.
1926
+ * If no provider is found, returns an empty config object.
1927
+ */
1928
+ export declare function useNDPRConfig(): NDPRConfig;
1929
+
1930
+ /**
1931
+ * Returns the resolved locale for the nearest `NDPRProvider`.
1932
+ * Merges any partial `locale` prop with the default English strings,
1933
+ * so all keys are always present and non-nullable.
1934
+ */
1935
+ export declare function useNDPRLocale(): typeof defaultLocale;
1936
+
1937
+ /**
1938
+ * Validates consent settings to ensure they meet NDPA requirements
1939
+ * @param settings The consent settings to validate
1940
+ * @returns An object containing validation result and any error messages
1941
+ */
1942
+ export declare function validateConsent(settings: ConsentSettings): {
1943
+ valid: boolean;
1944
+ errors: string[];
1945
+ };
1946
+
1947
+ /**
1948
+ * Validates that consent options meet NDPA Section 26 requirements.
1949
+ * Each consent option must specify a purpose for which data will be processed,
1950
+ * as consent must be specific and informed per the Nigeria Data Protection Act.
1951
+ * @param options The consent options to validate
1952
+ * @returns An object containing validation result and any error messages
1953
+ */
1954
+ export declare function validateConsentOptions(options: ConsentOption[]): {
1955
+ valid: boolean;
1956
+ errors: string[];
1957
+ };
1958
+
1959
+ /**
1960
+ * Validate a raw DSR submission payload against the same rules
1961
+ * `<DSRRequestForm />` enforces client-side. Designed to be called from a
1962
+ * server-side handler (Next.js Route Handler, NestJS controller, Express
1963
+ * middleware, Cloudflare Worker) so client and server stay in sync without
1964
+ * the consumer hand-rolling zod / class-validator schemas.
1965
+ *
1966
+ * Defensive — accepts `unknown` and narrows. Safe to call directly on
1967
+ * `await request.json()`.
1968
+ *
1969
+ * @example **Next.js Route Handler**
1970
+ * ```ts
1971
+ * // app/api/dsr/route.ts
1972
+ * import { validateDsrSubmission } from '@tantainnovative/ndpr-toolkit/server';
1973
+ *
1974
+ * export async function POST(req: Request) {
1975
+ * const { valid, errors, data } = validateDsrSubmission(await req.json());
1976
+ * if (!valid) return Response.json({ errors }, { status: 422 });
1977
+ * // `data` is the typed DsrSubmissionPayload
1978
+ * await dsrStore.create(data);
1979
+ * return Response.json({ ok: true }, { status: 201 });
1980
+ * }
1981
+ * ```
1982
+ *
1983
+ * @example **Lock to specific request types**
1984
+ * ```ts
1985
+ * validateDsrSubmission(payload, {
1986
+ * allowedRequestTypes: ['access', 'erasure', 'rectification'],
1987
+ * });
1988
+ * ```
1989
+ *
1990
+ * @example **Skip identity verification (e.g. authenticated session)**
1991
+ * ```ts
1992
+ * validateDsrSubmission(payload, { requireIdentityVerification: false });
1993
+ * ```
1994
+ */
1995
+ export declare function validateDsrSubmission(payload: unknown, options?: ValidateDsrSubmissionOptions): DsrSubmissionValidationResult;
1996
+
1997
+ /** Options for {@link validateDsrSubmission}. */
1998
+ export declare interface ValidateDsrSubmissionOptions {
1999
+ /**
2000
+ * Whether the data subject is required to provide an identifier
2001
+ * (NDPC's recommended verification step). Mirror whatever you set on
2002
+ * the client-side `<DSRRequestForm requireIdentityVerification>`.
2003
+ * @default true
2004
+ */
2005
+ requireIdentityVerification?: boolean;
2006
+ /**
2007
+ * Allowed request types. When provided, the payload's `requestType`
2008
+ * must be one of these — useful for locking the server to a specific
2009
+ * set of supported NDPA Part IV §29-36 rights.
2010
+ */
2011
+ allowedRequestTypes?: string[];
2012
+ }
2013
+
2014
+ /**
2015
+ * Validates that all required fields are present on a processing activity
2016
+ * and that the lawful basis is properly documented.
2017
+ *
2018
+ * If lawfulBasis is 'legitimate_interests', ensures a LIA justification exists.
2019
+ * If involvesSensitiveData is true, ensures sensitiveDataCondition is set.
2020
+ *
2021
+ * @param activity The processing activity to validate
2022
+ * @returns Validation result with errors and warnings
2023
+ */
2024
+ export declare function validateProcessingActivity(activity: ProcessingActivity): LawfulBasisValidationResult;
2025
+
2026
+ /**
2027
+ * Validates a processing record to ensure all required fields are present
2028
+ * and properly filled per NDPA 2023 requirements.
2029
+ *
2030
+ * @param record - The processing record to validate
2031
+ * @returns Validation result with any errors found
2032
+ */
2033
+ export declare function validateProcessingRecord(record: ProcessingRecord): ROPAValidationResult;
2034
+
2035
+ /**
2036
+ * Validates a cross-border transfer record for completeness and compliance.
2037
+ * Checks required fields, verifies that NDPC approval is documented when required,
2038
+ * and ensures safeguards are in place.
2039
+ *
2040
+ * @param transfer The cross-border transfer to validate
2041
+ * @returns Validation result with errors and warnings
2042
+ */
2043
+ export declare function validateTransfer(transfer: CrossBorderTransfer): TransferValidationResult;
2044
+
2045
+ export declare const yorubaLocale: Required<{
2046
+ [K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
2047
+ }>;
2048
+
2049
+ export { }