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