@tantainnovative/ndpr-toolkit 3.4.1 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/adapters.d.mts +34 -25
  3. package/dist/adapters.d.ts +34 -25
  4. package/dist/breach.d.mts +803 -44
  5. package/dist/breach.d.ts +803 -44
  6. package/dist/breach.js +1 -1
  7. package/dist/breach.mjs +1 -1
  8. package/dist/{chunk-ASLMPY54.js → chunk-3EGQWLJ6.js} +3 -3
  9. package/dist/chunk-B4Z5MBUC.mjs +2 -0
  10. package/dist/{chunk-LSCMXAPY.mjs → chunk-CKGJK4D7.mjs} +3 -3
  11. package/dist/{chunk-XSEZDQLB.js → chunk-CKJAECGV.js} +2 -2
  12. package/dist/{chunk-AHSMDPG5.js → chunk-CPK5D5FY.js} +2 -2
  13. package/dist/{chunk-DCJK5OZT.mjs → chunk-CWHBCQGT.mjs} +2 -2
  14. package/dist/{chunk-MLOWRZXO.mjs → chunk-F5TXUA4O.mjs} +3 -3
  15. package/dist/{chunk-BN77GP4W.mjs → chunk-GN5C32JB.mjs} +2 -2
  16. package/dist/{chunk-ZLSWOFAY.mjs → chunk-GRLIPT5V.mjs} +2 -2
  17. package/dist/{chunk-DUY6F3GT.mjs → chunk-H3EYBSVP.mjs} +3 -3
  18. package/dist/{chunk-NFJ4CB63.mjs → chunk-ID2NYIVE.mjs} +3 -3
  19. package/dist/chunk-J5WCPZLW.js +2 -0
  20. package/dist/{chunk-P2YV6DR3.js → chunk-LIM64IV2.js} +3 -3
  21. package/dist/chunk-LU7PKE7Y.mjs +2 -0
  22. package/dist/{chunk-HQSU7LGM.js → chunk-LWXZMKC2.js} +4 -4
  23. package/dist/{chunk-4BOEFDDE.js → chunk-ORFC66EA.js} +3 -3
  24. package/dist/{chunk-VTITKWGX.mjs → chunk-QSVVAZVT.mjs} +2 -2
  25. package/dist/chunk-SCWNM4PC.mjs +2 -0
  26. package/dist/{chunk-EHAZIKDX.js → chunk-SKKOMFXH.js} +2 -2
  27. package/dist/{chunk-WH6ZMUOS.mjs → chunk-TUNQUVHU.mjs} +2 -2
  28. package/dist/chunk-TV4U6AIS.js +2 -0
  29. package/dist/{chunk-ZYLDLGFL.js → chunk-VIQUXWJC.js} +2 -2
  30. package/dist/{chunk-SUEGUY35.js → chunk-XIM7KMD6.js} +2 -2
  31. package/dist/{chunk-P6QAFBCV.js → chunk-XNSZ7KUH.js} +2 -2
  32. package/dist/consent.d.mts +648 -84
  33. package/dist/consent.d.ts +648 -84
  34. package/dist/consent.js +1 -1
  35. package/dist/consent.mjs +1 -1
  36. package/dist/core.d.mts +2049 -23
  37. package/dist/core.d.ts +2049 -23
  38. package/dist/core.js +1 -1
  39. package/dist/core.mjs +1 -1
  40. package/dist/cross-border.d.mts +470 -99
  41. package/dist/cross-border.d.ts +470 -99
  42. package/dist/dpia.d.mts +591 -37
  43. package/dist/dpia.d.ts +591 -37
  44. package/dist/dsr.d.mts +654 -37
  45. package/dist/dsr.d.ts +654 -37
  46. package/dist/dsr.js +1 -1
  47. package/dist/dsr.mjs +1 -1
  48. package/dist/hooks.d.mts +2174 -30
  49. package/dist/hooks.d.ts +2174 -30
  50. package/dist/hooks.js +1 -1
  51. package/dist/hooks.mjs +1 -1
  52. package/dist/index.d.mts +4428 -43
  53. package/dist/index.d.ts +4428 -43
  54. package/dist/index.js +1 -1
  55. package/dist/index.mjs +1 -1
  56. package/dist/lawful-basis.d.mts +368 -32
  57. package/dist/lawful-basis.d.ts +368 -32
  58. package/dist/policy.d.mts +1178 -83
  59. package/dist/policy.d.ts +1178 -83
  60. package/dist/policy.js +1 -1
  61. package/dist/policy.mjs +1 -1
  62. package/dist/presets.d.mts +1020 -114
  63. package/dist/presets.d.ts +1020 -114
  64. package/dist/presets.js +1 -1
  65. package/dist/presets.mjs +1 -1
  66. package/dist/ropa.d.mts +396 -31
  67. package/dist/ropa.d.ts +396 -31
  68. package/dist/ropa.js +1 -1
  69. package/dist/ropa.mjs +1 -1
  70. package/dist/server.d.mts +2133 -24
  71. package/dist/server.d.ts +2133 -24
  72. package/dist/server.js +1 -1
  73. package/dist/server.mjs +1 -1
  74. package/dist/unstyled.d.mts +523 -55
  75. package/dist/unstyled.d.ts +523 -55
  76. package/dist/unstyled.js +1 -1
  77. package/dist/unstyled.mjs +1 -1
  78. package/package.json +3 -3
  79. package/dist/BreachReportForm-DpRrBoxU.d.ts +0 -158
  80. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +0 -158
  81. package/dist/ConsentBanner-F5ayys5K.d.mts +0 -156
  82. package/dist/ConsentBanner-VqIPophc.d.ts +0 -156
  83. package/dist/ConsentManager-C7I3PDe8.d.mts +0 -105
  84. package/dist/ConsentManager-CQ2IZtUU.d.ts +0 -105
  85. package/dist/CrossBorderTransferManager-D5Lc0e46.d.ts +0 -90
  86. package/dist/CrossBorderTransferManager-DkZhv9vD.d.mts +0 -90
  87. package/dist/DPIAQuestionnaire-VXBoWFMC.d.ts +0 -123
  88. package/dist/DPIAQuestionnaire-jkt1Veb6.d.mts +0 -123
  89. package/dist/DSRRequestForm-D8rPTNmU.d.ts +0 -146
  90. package/dist/DSRRequestForm-DRouEr9j.d.mts +0 -146
  91. package/dist/DSRTracker-Bl__d4df.d.ts +0 -163
  92. package/dist/DSRTracker-CSVDfgQQ.d.mts +0 -163
  93. package/dist/LawfulBasisTracker-CBqOxX1D.d.mts +0 -85
  94. package/dist/LawfulBasisTracker-Cg30NbDA.d.ts +0 -85
  95. package/dist/NDPRDashboard-CLJpEg0X.d.mts +0 -44
  96. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +0 -44
  97. package/dist/NDPRProvider-DYFb8xEl.d.ts +0 -68
  98. package/dist/NDPRProvider-U3QNu6MA.d.mts +0 -68
  99. package/dist/PolicyExporter-Bgi6nz82.d.mts +0 -291
  100. package/dist/PolicyExporter-BnvuFncj.d.ts +0 -291
  101. package/dist/ROPAManager-BS4eB8Hw.d.mts +0 -79
  102. package/dist/ROPAManager-qxTrXLkD.d.ts +0 -79
  103. package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +0 -282
  104. package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +0 -282
  105. package/dist/StepIndicator-CgrlokSV.d.ts +0 -171
  106. package/dist/StepIndicator-W8S_QjgO.d.mts +0 -171
  107. package/dist/breach-B_-6lDqS.d.mts +0 -17
  108. package/dist/breach-CzXqSsaY.d.ts +0 -17
  109. package/dist/breach-Eu9byel8.d.mts +0 -185
  110. package/dist/breach-Eu9byel8.d.ts +0 -185
  111. package/dist/chunk-2L7BSG7G.mjs +0 -2
  112. package/dist/chunk-5X32J5IA.mjs +0 -2
  113. package/dist/chunk-7D2OIPHH.mjs +0 -2
  114. package/dist/chunk-JKKRPS4P.js +0 -2
  115. package/dist/chunk-UHTJ6UFW.js +0 -2
  116. package/dist/compliance-score-racQe_E_.d.mts +0 -115
  117. package/dist/compliance-score-racQe_E_.d.ts +0 -115
  118. package/dist/consent-CmVzqZUk.d.mts +0 -99
  119. package/dist/consent-CmVzqZUk.d.ts +0 -99
  120. package/dist/consent-audit-BdByjYlM.d.mts +0 -65
  121. package/dist/consent-audit-DhbfMR0n.d.ts +0 -65
  122. package/dist/cross-border-BBi9rZyO.d.mts +0 -54
  123. package/dist/cross-border-Dy-U9Hu6.d.ts +0 -54
  124. package/dist/cross-border-UyT00llA.d.mts +0 -141
  125. package/dist/cross-border-UyT00llA.d.ts +0 -141
  126. package/dist/docx-4n8g4zul.d.mts +0 -64
  127. package/dist/docx-VvcTLYZM.d.ts +0 -64
  128. package/dist/dpia-D82hUrJe.d.ts +0 -15
  129. package/dist/dpia-DQDFw2_l.d.mts +0 -15
  130. package/dist/dpia-c9GiiOq0.d.mts +0 -137
  131. package/dist/dpia-c9GiiOq0.d.ts +0 -137
  132. package/dist/dsr-CIx5sd7e.d.ts +0 -14
  133. package/dist/dsr-XZ_HqTlA.d.mts +0 -14
  134. package/dist/dsr-yKbqX531.d.mts +0 -128
  135. package/dist/dsr-yKbqX531.d.ts +0 -128
  136. package/dist/lawful-basis-BEyI0kGg.d.ts +0 -57
  137. package/dist/lawful-basis-C2eGaoHM.d.mts +0 -57
  138. package/dist/lawful-basis-Cv1VmDLn.d.mts +0 -112
  139. package/dist/lawful-basis-Cv1VmDLn.d.ts +0 -112
  140. package/dist/locale-CxJx2tzn.d.mts +0 -25
  141. package/dist/locale-DSkrtf-c.d.ts +0 -25
  142. package/dist/policy-engine-5qTfp2z4.d.mts +0 -174
  143. package/dist/policy-engine-DzPxskOK.d.ts +0 -174
  144. package/dist/policy-sections-9tCb7VU7.d.ts +0 -56
  145. package/dist/policy-sections-CBWcJv-R.d.mts +0 -56
  146. package/dist/policy-templates-DhLwq4R-.d.ts +0 -43
  147. package/dist/policy-templates-DwYl2329.d.mts +0 -43
  148. package/dist/privacy-Ca6te9Ir.d.mts +0 -138
  149. package/dist/privacy-Ca6te9Ir.d.ts +0 -138
  150. package/dist/ropa-BDTM06tr.d.ts +0 -152
  151. package/dist/ropa-CFHuT7jE.d.mts +0 -152
  152. package/dist/ropa-CyynscU6.d.ts +0 -51
  153. package/dist/ropa-NIgxd8uP.d.mts +0 -51
  154. package/dist/sanitize-CxxwKxAx.d.mts +0 -94
  155. package/dist/sanitize-CxxwKxAx.d.ts +0 -94
  156. package/dist/styling-BMDGQDgS.d.mts +0 -64
  157. package/dist/styling-BaoQtV06.d.ts +0 -64
  158. package/dist/types-DK2CoKOC.d.mts +0 -10
  159. package/dist/types-DK2CoKOC.d.ts +0 -10
  160. package/dist/useAdaptivePolicyWizard-BSLyltzZ.d.mts +0 -52
  161. package/dist/useAdaptivePolicyWizard-CL7C7MTZ.d.ts +0 -52
  162. package/dist/useBreach-CPr86Yan.d.mts +0 -115
  163. package/dist/useBreach-DkVXvtJK.d.ts +0 -115
  164. package/dist/useConsent-DCNkIJHR.d.mts +0 -75
  165. package/dist/useConsent-dOcELSfX.d.ts +0 -75
  166. package/dist/useCrossBorderTransfer-DixjLjN1.d.mts +0 -78
  167. package/dist/useCrossBorderTransfer-DvSq06lv.d.ts +0 -78
  168. package/dist/useDPIA-B6180UQn.d.mts +0 -109
  169. package/dist/useDPIA-CTqbNbww.d.ts +0 -109
  170. package/dist/useDSR-WvHk8_iu.d.mts +0 -85
  171. package/dist/useDSR-wH4H6hSM.d.ts +0 -85
  172. package/dist/useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts +0 -162
  173. package/dist/useDefaultPrivacyPolicy-DkOqMg2e.d.ts +0 -162
  174. package/dist/useLawfulBasis-CKJ-kw84.d.mts +0 -79
  175. package/dist/useLawfulBasis-DFTmu1ca.d.ts +0 -79
  176. package/dist/useROPA-BSSU1rfx.d.ts +0 -76
  177. package/dist/useROPA-C2hjaBTz.d.mts +0 -76
@@ -1,174 +0,0 @@
1
- import { O as OrganizationInfo } from './privacy-Ca6te9Ir.js';
2
-
3
- /**
4
- * Policy engine types for the adaptive privacy policy generator.
5
- * These types power the wizard-driven policy builder, compliance checker,
6
- * and export functionality — all aligned with the NDPA 2023.
7
- */
8
-
9
- /** Industry verticals with sector-specific compliance requirements. */
10
- type Industry = 'fintech' | 'healthcare' | 'ecommerce' | 'saas' | 'education' | 'government' | 'other';
11
- /** Organisation size tiers — affects complexity of generated language. */
12
- type OrgSize = 'startup' | 'midsize' | 'enterprise';
13
- /** Lawful processing purposes recognised under the NDPA. */
14
- type ProcessingPurpose = 'service_delivery' | 'marketing' | 'analytics' | 'research' | 'legal_compliance' | 'fraud_prevention';
15
- /** A logical category of personal data the organisation may collect. */
16
- interface DataCategory {
17
- /** Machine-readable identifier. */
18
- id: string;
19
- /** Human-readable label shown in the wizard. */
20
- label: string;
21
- /** Grouping for display and compliance checks. */
22
- group: 'identity' | 'financial' | 'behavioral' | 'sensitive' | 'children';
23
- /** Specific data points within this category. */
24
- dataPoints: string[];
25
- /** Whether this category is currently selected by the user. */
26
- selected: boolean;
27
- }
28
- /** A third-party entity that processes data on behalf of the organisation. */
29
- interface ThirdPartyProcessor {
30
- /** Name of the third party. */
31
- name: string;
32
- /** Purpose of sharing data with this processor. */
33
- purpose: string;
34
- /** Country where the processor is located. */
35
- country: string;
36
- }
37
- /** Full context used to generate an adaptive privacy policy. */
38
- interface TemplateContext {
39
- /** Organisation details, extended with industry and size. */
40
- org: OrganizationInfo & {
41
- industry: Industry;
42
- orgSize: OrgSize;
43
- country: string;
44
- };
45
- /** Data categories the organisation collects. */
46
- dataCategories: DataCategory[];
47
- /** Processing purposes relevant to the organisation. */
48
- purposes: ProcessingPurpose[];
49
- /** Whether the organisation processes children's data. */
50
- hasChildrenData: boolean;
51
- /** Whether the organisation processes sensitive/special-category data. */
52
- hasSensitiveData: boolean;
53
- /** Whether the organisation processes financial data. */
54
- hasFinancialData: boolean;
55
- /** Whether data is transferred outside Nigeria. */
56
- hasCrossBorderTransfer: boolean;
57
- /** Whether automated decision-making or profiling is used. */
58
- hasAutomatedDecisions: boolean;
59
- /** Third-party processors that receive personal data. */
60
- thirdPartyProcessors: ThirdPartyProcessor[];
61
- }
62
- /** A user-defined section added to the policy outside the generated ones. */
63
- interface CustomSection {
64
- id: string;
65
- title: string;
66
- content: string;
67
- order: number;
68
- required: false;
69
- }
70
- /** Represents an in-progress policy being built in the wizard. */
71
- interface PolicyDraft {
72
- /** Unique identifier for the draft. */
73
- id: string;
74
- /** The template context driving section generation. */
75
- templateContext: TemplateContext;
76
- /** Custom sections added by the user. */
77
- customSections: CustomSection[];
78
- /** Per-section content overrides keyed by section id. */
79
- sectionOverrides: Record<string, string>;
80
- /** Ordered list of section ids defining the final order. */
81
- sectionOrder: string[];
82
- /** Current wizard step (0-indexed). */
83
- currentStep: number;
84
- /** Timestamp of the last save. */
85
- lastSavedAt: number;
86
- /** The draft is always in "draft" status until finalised. */
87
- status: 'draft';
88
- }
89
- /** A single gap found during NDPA compliance evaluation. */
90
- interface ComplianceGap {
91
- /** Machine-readable requirement identifier. */
92
- requirementId: string;
93
- /** Human-readable name of the requirement. */
94
- requirement: string;
95
- /** Reference to the relevant NDPA section. */
96
- ndpaSection: string;
97
- /** How severe the gap is. */
98
- severity: 'critical' | 'important' | 'recommended';
99
- /** Explanation of what is missing. */
100
- message: string;
101
- /** Suggested fix type for the UI. */
102
- fixType: 'add_section' | 'add_content' | 'fill_field';
103
- /** Label for the fix action button. */
104
- fixLabel: string;
105
- /** Pre-written content the user can insert to close the gap. */
106
- suggestedContent?: string;
107
- }
108
- /** Result of evaluating a policy against NDPA requirements. */
109
- interface ComplianceResult {
110
- /** Points earned. */
111
- score: number;
112
- /** Maximum achievable points (115). */
113
- maxScore: number;
114
- /** Percentage score (0-100). */
115
- percentage: number;
116
- /** Overall compliance rating. */
117
- rating: 'compliant' | 'nearly_compliant' | 'not_compliant';
118
- /** List of identified compliance gaps. */
119
- gaps: ComplianceGap[];
120
- /** List of requirement ids that passed. */
121
- passed: string[];
122
- }
123
- /** Options for PDF export of the finalised policy. */
124
- interface PDFExportOptions {
125
- includeCoverPage?: boolean;
126
- includeTOC?: boolean;
127
- includeComplianceBadge?: boolean;
128
- logoUrl?: string;
129
- filename?: string;
130
- }
131
- /** Options for DOCX export of the finalised policy. */
132
- interface DOCXExportOptions {
133
- includeTOC?: boolean;
134
- filename?: string;
135
- }
136
- /** Options for HTML export of the finalised policy. */
137
- interface HTMLExportOptions {
138
- includeStyles?: boolean;
139
- includePrintCSS?: boolean;
140
- customCSS?: string;
141
- /**
142
- * Theme controlling the embedded design tokens.
143
- *
144
- * - `'light'` (default): emits the light token palette only. No
145
- * `prefers-color-scheme: dark` block is included, so a visitor's OS
146
- * dark-mode setting will NOT recolour the policy. This is the right
147
- * default for an embedded compliance widget — most consumer host sites
148
- * are single-theme and Shadow DOM does not isolate `prefers-color-scheme`.
149
- * - `'dark'`: emits the dark token palette as the primary style.
150
- * - `'auto'`: emits light tokens plus a `@media (prefers-color-scheme: dark)`
151
- * block that swaps to dark on the user's OS preference. Use this when
152
- * your host site genuinely follows OS dark mode and you want the policy
153
- * to match.
154
- *
155
- * Pre-3.4.1 the export effectively behaved like `'auto'` unconditionally,
156
- * which leaked dark colours into light-only host sites via Shadow DOM.
157
- *
158
- * @default 'light'
159
- */
160
- theme?: 'light' | 'dark' | 'auto';
161
- }
162
- /**
163
- * Comprehensive set of 16 data categories spanning identity, financial,
164
- * behavioral, sensitive, and children groups. Used to populate the wizard
165
- * and drive adaptive section generation.
166
- */
167
- declare const DEFAULT_DATA_CATEGORIES: DataCategory[];
168
- /**
169
- * Creates a default TemplateContext with sensible empty/initial values.
170
- * Useful for initialising the wizard state before the user begins editing.
171
- */
172
- declare function createDefaultContext(): TemplateContext;
173
-
174
- export { type ComplianceGap as C, type DataCategory as D, type HTMLExportOptions as H, type Industry as I, type OrgSize as O, type PolicyDraft as P, type TemplateContext as T, type ComplianceResult as a, type CustomSection as b, type ThirdPartyProcessor as c, createDefaultContext as d, DEFAULT_DATA_CATEGORIES as e, type DOCXExportOptions as f, type PDFExportOptions as g, type ProcessingPurpose as h };
@@ -1,56 +0,0 @@
1
- import { c as PrivacyPolicy, P as PolicySection } from './privacy-Ca6te9Ir.js';
2
- import { T as TemplateContext, a as ComplianceResult } from './policy-engine-DzPxskOK.js';
3
-
4
- /**
5
- * NDPA policy compliance checker.
6
- *
7
- * Evaluates a {@link PrivacyPolicy} against 15 requirements drawn from
8
- * the Nigeria Data Protection Act (NDPA) 2023, producing a scored
9
- * {@link ComplianceResult} with actionable gaps.
10
- *
11
- * Scoring:
12
- * 6 critical @ 10 pts = 60
13
- * 5 important @ 7 pts = 35
14
- * 4 recommended @ 5 pts = 20
15
- * Total max = 115
16
- *
17
- * Rating thresholds:
18
- * >= 100 → compliant
19
- * >= 80 → nearly_compliant
20
- * < 80 → not_compliant
21
- */
22
-
23
- /**
24
- * Evaluates a privacy policy against 15 NDPA 2023 requirements and
25
- * returns a scored compliance result with actionable gap information.
26
- *
27
- * @param policy - The privacy policy to evaluate.
28
- * @param context - The template context that was used to generate the policy.
29
- * @returns A {@link ComplianceResult} with score, rating, gaps, and passed ids.
30
- */
31
- declare function evaluatePolicyCompliance(policy: PrivacyPolicy, context: TemplateContext): ComplianceResult;
32
-
33
- /**
34
- * Adaptive privacy policy section generators.
35
- *
36
- * Builds NDPA 2023-compliant policy sections based on the organisation's
37
- * template context (industry, data categories, purposes, flags, etc.).
38
- *
39
- * Every section produces a {@link PolicySection} matching the existing
40
- * interface from `types/privacy.ts`.
41
- */
42
-
43
- declare const UNFILLED_PREFIX = "\u00ABTODO: ";
44
- declare const UNFILLED_SUFFIX = "\u00BB";
45
- /**
46
- * Assembles an ordered array of privacy policy sections based on the
47
- * provided template context. Core sections are always included; conditional
48
- * sections are added based on context flags (children, sensitive data,
49
- * cross-border transfers, automated decisions).
50
- *
51
- * @param context - The template context describing the organisation and its data practices.
52
- * @returns An array of {@link PolicySection} objects, ordered and ready for rendering.
53
- */
54
- declare function assemblePolicy(context: TemplateContext): PolicySection[];
55
-
56
- export { UNFILLED_PREFIX as U, assemblePolicy as a, UNFILLED_SUFFIX as b, evaluatePolicyCompliance as e };
@@ -1,56 +0,0 @@
1
- import { c as PrivacyPolicy, P as PolicySection } from './privacy-Ca6te9Ir.mjs';
2
- import { T as TemplateContext, a as ComplianceResult } from './policy-engine-5qTfp2z4.mjs';
3
-
4
- /**
5
- * NDPA policy compliance checker.
6
- *
7
- * Evaluates a {@link PrivacyPolicy} against 15 requirements drawn from
8
- * the Nigeria Data Protection Act (NDPA) 2023, producing a scored
9
- * {@link ComplianceResult} with actionable gaps.
10
- *
11
- * Scoring:
12
- * 6 critical @ 10 pts = 60
13
- * 5 important @ 7 pts = 35
14
- * 4 recommended @ 5 pts = 20
15
- * Total max = 115
16
- *
17
- * Rating thresholds:
18
- * >= 100 → compliant
19
- * >= 80 → nearly_compliant
20
- * < 80 → not_compliant
21
- */
22
-
23
- /**
24
- * Evaluates a privacy policy against 15 NDPA 2023 requirements and
25
- * returns a scored compliance result with actionable gap information.
26
- *
27
- * @param policy - The privacy policy to evaluate.
28
- * @param context - The template context that was used to generate the policy.
29
- * @returns A {@link ComplianceResult} with score, rating, gaps, and passed ids.
30
- */
31
- declare function evaluatePolicyCompliance(policy: PrivacyPolicy, context: TemplateContext): ComplianceResult;
32
-
33
- /**
34
- * Adaptive privacy policy section generators.
35
- *
36
- * Builds NDPA 2023-compliant policy sections based on the organisation's
37
- * template context (industry, data categories, purposes, flags, etc.).
38
- *
39
- * Every section produces a {@link PolicySection} matching the existing
40
- * interface from `types/privacy.ts`.
41
- */
42
-
43
- declare const UNFILLED_PREFIX = "\u00ABTODO: ";
44
- declare const UNFILLED_SUFFIX = "\u00BB";
45
- /**
46
- * Assembles an ordered array of privacy policy sections based on the
47
- * provided template context. Core sections are always included; conditional
48
- * sections are added based on context flags (children, sensitive data,
49
- * cross-border transfers, automated decisions).
50
- *
51
- * @param context - The template context describing the organisation and its data practices.
52
- * @returns An array of {@link PolicySection} objects, ordered and ready for rendering.
53
- */
54
- declare function assemblePolicy(context: TemplateContext): PolicySection[];
55
-
56
- export { UNFILLED_PREFIX as U, assemblePolicy as a, UNFILLED_SUFFIX as b, evaluatePolicyCompliance as e };
@@ -1,43 +0,0 @@
1
- import { P as PolicySection, O as OrganizationInfo, b as PolicyVariable } from './privacy-Ca6te9Ir.js';
2
-
3
- /**
4
- * Scans rendered policy text for unfilled tokens. Returns the list of field
5
- * names that were left unfilled (deduplicated). Use in CI to assert a
6
- * canonical org-info fixture renders cleanly, or at runtime to surface
7
- * "policy is missing X" errors before publishing.
8
- */
9
- declare function findUnfilledTokens(rendered: string): string[];
10
- /**
11
- * Generates policy text by replacing variables in a template with organization-specific values
12
- * @param sectionsOrTemplate The policy sections or template string to generate text for
13
- * @param organizationInfoOrVariables The organization information or variable map to use for replacement
14
- * @returns The generated policy text or an object with the generated text and metadata
15
- */
16
- declare function generatePolicyText(sectionsOrTemplate: PolicySection[] | string, organizationInfoOrVariables: OrganizationInfo | Record<string, string>): string | {
17
- fullText: string;
18
- sectionTexts: Record<string, string>;
19
- missingVariables: string[];
20
- };
21
-
22
- /**
23
- * Default NDPA-compliant privacy policy sections.
24
- * Each section uses {{variable}} placeholders that are resolved at generation time.
25
- */
26
- declare const DEFAULT_POLICY_SECTIONS: PolicySection[];
27
- /**
28
- * Default policy variables for NDPA-compliant privacy policies.
29
- * These map to the {{variable}} placeholders used in DEFAULT_POLICY_SECTIONS.
30
- */
31
- declare const DEFAULT_POLICY_VARIABLES: PolicyVariable[];
32
- /**
33
- * Creates a complete business privacy policy template with default
34
- * NDPA-compliant sections and variables.
35
- *
36
- * @returns An object containing the default sections and variables.
37
- */
38
- declare function createBusinessPolicyTemplate(): {
39
- sections: PolicySection[];
40
- variables: PolicyVariable[];
41
- };
42
-
43
- export { DEFAULT_POLICY_SECTIONS as D, DEFAULT_POLICY_VARIABLES as a, createBusinessPolicyTemplate as c, findUnfilledTokens as f, generatePolicyText as g };
@@ -1,43 +0,0 @@
1
- import { P as PolicySection, O as OrganizationInfo, b as PolicyVariable } from './privacy-Ca6te9Ir.mjs';
2
-
3
- /**
4
- * Scans rendered policy text for unfilled tokens. Returns the list of field
5
- * names that were left unfilled (deduplicated). Use in CI to assert a
6
- * canonical org-info fixture renders cleanly, or at runtime to surface
7
- * "policy is missing X" errors before publishing.
8
- */
9
- declare function findUnfilledTokens(rendered: string): string[];
10
- /**
11
- * Generates policy text by replacing variables in a template with organization-specific values
12
- * @param sectionsOrTemplate The policy sections or template string to generate text for
13
- * @param organizationInfoOrVariables The organization information or variable map to use for replacement
14
- * @returns The generated policy text or an object with the generated text and metadata
15
- */
16
- declare function generatePolicyText(sectionsOrTemplate: PolicySection[] | string, organizationInfoOrVariables: OrganizationInfo | Record<string, string>): string | {
17
- fullText: string;
18
- sectionTexts: Record<string, string>;
19
- missingVariables: string[];
20
- };
21
-
22
- /**
23
- * Default NDPA-compliant privacy policy sections.
24
- * Each section uses {{variable}} placeholders that are resolved at generation time.
25
- */
26
- declare const DEFAULT_POLICY_SECTIONS: PolicySection[];
27
- /**
28
- * Default policy variables for NDPA-compliant privacy policies.
29
- * These map to the {{variable}} placeholders used in DEFAULT_POLICY_SECTIONS.
30
- */
31
- declare const DEFAULT_POLICY_VARIABLES: PolicyVariable[];
32
- /**
33
- * Creates a complete business privacy policy template with default
34
- * NDPA-compliant sections and variables.
35
- *
36
- * @returns An object containing the default sections and variables.
37
- */
38
- declare function createBusinessPolicyTemplate(): {
39
- sections: PolicySection[];
40
- variables: PolicyVariable[];
41
- };
42
-
43
- export { DEFAULT_POLICY_SECTIONS as D, DEFAULT_POLICY_VARIABLES as a, createBusinessPolicyTemplate as c, findUnfilledTokens as f, generatePolicyText as g };
@@ -1,138 +0,0 @@
1
- /**
2
- * Privacy policy types aligned with NDPA 2023
3
- * Privacy policies must clearly inform data subjects of their rights under the NDPA
4
- */
5
- /**
6
- * Represents a section in a privacy policy
7
- */
8
- interface PolicySection {
9
- /** Unique identifier for the section */
10
- id: string;
11
- /** Title of the section */
12
- title: string;
13
- /** Description of the section */
14
- description?: string;
15
- /** Order of the section in the policy */
16
- order?: number;
17
- /** Whether the section is required by NDPA */
18
- required: boolean;
19
- /** Template text for the section */
20
- template: string;
21
- /**
22
- * Default content for the section (legacy field)
23
- * @deprecated Use template instead
24
- */
25
- defaultContent?: string;
26
- /**
27
- * Custom content for the section (overrides default content)
28
- * @deprecated Use template instead
29
- */
30
- customContent?: string;
31
- /** Whether the section is included in the policy */
32
- included: boolean;
33
- /** Variables that can be used in the section content */
34
- variables?: string[];
35
- }
36
- /**
37
- * Represents a privacy policy template
38
- */
39
- interface PolicyTemplate {
40
- /** Unique identifier for the template */
41
- id: string;
42
- /** Name of the template */
43
- name: string;
44
- /** Description of the template */
45
- description: string;
46
- /** Type of organization the template is designed for */
47
- organizationType: 'business' | 'nonprofit' | 'government' | 'educational';
48
- /** Sections included in the template */
49
- sections: PolicySection[];
50
- /** Variables used across the template */
51
- variables: Record<string, {
52
- name: string;
53
- description: string;
54
- required: boolean;
55
- defaultValue?: string;
56
- }>;
57
- /** Version of the template */
58
- version: string;
59
- /** Last updated date of the template */
60
- lastUpdated: number;
61
- /**
62
- * Whether this template is NDPA 2023 compliant
63
- */
64
- ndpaCompliant: boolean;
65
- }
66
- /**
67
- * Represents organization information for a privacy policy
68
- */
69
- interface OrganizationInfo {
70
- /** Name of the organization */
71
- name: string;
72
- /** Website URL of the organization */
73
- website: string;
74
- /** Contact email for privacy inquiries */
75
- privacyEmail: string;
76
- /** Physical address of the organization */
77
- address?: string;
78
- /** Phone number for privacy inquiries */
79
- privacyPhone?: string;
80
- /** Name of the Data Protection Officer */
81
- dpoName?: string;
82
- /** Email of the Data Protection Officer */
83
- dpoEmail?: string;
84
- /** Industry or sector of the organization */
85
- industry?: string;
86
- /** NDPC registration number (if registered) */
87
- ndpcRegistrationNumber?: string;
88
- }
89
- /**
90
- * Represents a variable in a privacy policy
91
- */
92
- interface PolicyVariable {
93
- /** Unique identifier for the variable */
94
- id: string;
95
- /** Name of the variable as it appears in the template */
96
- name: string;
97
- /** Description of the variable */
98
- description: string;
99
- /** Default value for the variable */
100
- defaultValue?: string;
101
- /** Current value of the variable */
102
- value: string;
103
- /** Type of input for the variable */
104
- inputType: 'text' | 'textarea' | 'email' | 'url' | 'date' | 'select';
105
- /** Options for select inputs */
106
- options?: string[];
107
- /** Whether the variable is required */
108
- required: boolean;
109
- }
110
- /**
111
- * Represents a generated privacy policy
112
- */
113
- interface PrivacyPolicy {
114
- /** Unique identifier for the policy */
115
- id: string;
116
- /** Title of the policy */
117
- title: string;
118
- /** Template used to generate the policy */
119
- templateId: string;
120
- /** Organization information */
121
- organizationInfo: OrganizationInfo;
122
- /** Sections of the policy */
123
- sections: PolicySection[];
124
- /** Values for the variables used in the policy */
125
- variableValues: Record<string, string>;
126
- /** Effective date of the policy */
127
- effectiveDate: number;
128
- /** Last updated date of the policy */
129
- lastUpdated: number;
130
- /** Version of the policy */
131
- version: string;
132
- /**
133
- * Applicable legal frameworks
134
- */
135
- applicableFrameworks?: ('ndpa' | 'ndpr' | 'gdpr' | 'ccpa')[];
136
- }
137
-
138
- export type { OrganizationInfo as O, PolicySection as P, PolicyTemplate as a, PolicyVariable as b, PrivacyPolicy as c };
@@ -1,138 +0,0 @@
1
- /**
2
- * Privacy policy types aligned with NDPA 2023
3
- * Privacy policies must clearly inform data subjects of their rights under the NDPA
4
- */
5
- /**
6
- * Represents a section in a privacy policy
7
- */
8
- interface PolicySection {
9
- /** Unique identifier for the section */
10
- id: string;
11
- /** Title of the section */
12
- title: string;
13
- /** Description of the section */
14
- description?: string;
15
- /** Order of the section in the policy */
16
- order?: number;
17
- /** Whether the section is required by NDPA */
18
- required: boolean;
19
- /** Template text for the section */
20
- template: string;
21
- /**
22
- * Default content for the section (legacy field)
23
- * @deprecated Use template instead
24
- */
25
- defaultContent?: string;
26
- /**
27
- * Custom content for the section (overrides default content)
28
- * @deprecated Use template instead
29
- */
30
- customContent?: string;
31
- /** Whether the section is included in the policy */
32
- included: boolean;
33
- /** Variables that can be used in the section content */
34
- variables?: string[];
35
- }
36
- /**
37
- * Represents a privacy policy template
38
- */
39
- interface PolicyTemplate {
40
- /** Unique identifier for the template */
41
- id: string;
42
- /** Name of the template */
43
- name: string;
44
- /** Description of the template */
45
- description: string;
46
- /** Type of organization the template is designed for */
47
- organizationType: 'business' | 'nonprofit' | 'government' | 'educational';
48
- /** Sections included in the template */
49
- sections: PolicySection[];
50
- /** Variables used across the template */
51
- variables: Record<string, {
52
- name: string;
53
- description: string;
54
- required: boolean;
55
- defaultValue?: string;
56
- }>;
57
- /** Version of the template */
58
- version: string;
59
- /** Last updated date of the template */
60
- lastUpdated: number;
61
- /**
62
- * Whether this template is NDPA 2023 compliant
63
- */
64
- ndpaCompliant: boolean;
65
- }
66
- /**
67
- * Represents organization information for a privacy policy
68
- */
69
- interface OrganizationInfo {
70
- /** Name of the organization */
71
- name: string;
72
- /** Website URL of the organization */
73
- website: string;
74
- /** Contact email for privacy inquiries */
75
- privacyEmail: string;
76
- /** Physical address of the organization */
77
- address?: string;
78
- /** Phone number for privacy inquiries */
79
- privacyPhone?: string;
80
- /** Name of the Data Protection Officer */
81
- dpoName?: string;
82
- /** Email of the Data Protection Officer */
83
- dpoEmail?: string;
84
- /** Industry or sector of the organization */
85
- industry?: string;
86
- /** NDPC registration number (if registered) */
87
- ndpcRegistrationNumber?: string;
88
- }
89
- /**
90
- * Represents a variable in a privacy policy
91
- */
92
- interface PolicyVariable {
93
- /** Unique identifier for the variable */
94
- id: string;
95
- /** Name of the variable as it appears in the template */
96
- name: string;
97
- /** Description of the variable */
98
- description: string;
99
- /** Default value for the variable */
100
- defaultValue?: string;
101
- /** Current value of the variable */
102
- value: string;
103
- /** Type of input for the variable */
104
- inputType: 'text' | 'textarea' | 'email' | 'url' | 'date' | 'select';
105
- /** Options for select inputs */
106
- options?: string[];
107
- /** Whether the variable is required */
108
- required: boolean;
109
- }
110
- /**
111
- * Represents a generated privacy policy
112
- */
113
- interface PrivacyPolicy {
114
- /** Unique identifier for the policy */
115
- id: string;
116
- /** Title of the policy */
117
- title: string;
118
- /** Template used to generate the policy */
119
- templateId: string;
120
- /** Organization information */
121
- organizationInfo: OrganizationInfo;
122
- /** Sections of the policy */
123
- sections: PolicySection[];
124
- /** Values for the variables used in the policy */
125
- variableValues: Record<string, string>;
126
- /** Effective date of the policy */
127
- effectiveDate: number;
128
- /** Last updated date of the policy */
129
- lastUpdated: number;
130
- /** Version of the policy */
131
- version: string;
132
- /**
133
- * Applicable legal frameworks
134
- */
135
- applicableFrameworks?: ('ndpa' | 'ndpr' | 'gdpr' | 'ccpa')[];
136
- }
137
-
138
- export type { OrganizationInfo as O, PolicySection as P, PolicyTemplate as a, PolicyVariable as b, PrivacyPolicy as c };