@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.
- package/CHANGELOG.md +25 -0
- package/README.md +80 -38
- package/dist/adapters.d.mts +34 -25
- package/dist/adapters.d.ts +34 -25
- package/dist/breach.d.mts +803 -44
- package/dist/breach.d.ts +803 -44
- package/dist/breach.js +2 -1
- package/dist/breach.mjs +2 -1
- package/dist/{chunk-2WH4DLV5.js → chunk-3EGQWLJ6.js} +3 -3
- package/dist/chunk-B4Z5MBUC.mjs +2 -0
- package/dist/{chunk-LSCMXAPY.mjs → chunk-CKGJK4D7.mjs} +3 -3
- package/dist/{chunk-XSEZDQLB.js → chunk-CKJAECGV.js} +2 -2
- package/dist/{chunk-AHSMDPG5.js → chunk-CPK5D5FY.js} +2 -2
- package/dist/{chunk-DCJK5OZT.mjs → chunk-CWHBCQGT.mjs} +2 -2
- package/dist/{chunk-KSERBMXW.mjs → chunk-F5TXUA4O.mjs} +3 -3
- package/dist/{chunk-BN77GP4W.mjs → chunk-GN5C32JB.mjs} +2 -2
- package/dist/{chunk-ZLSWOFAY.mjs → chunk-GRLIPT5V.mjs} +2 -2
- package/dist/{chunk-DUY6F3GT.mjs → chunk-H3EYBSVP.mjs} +3 -3
- package/dist/{chunk-MG73MOZC.mjs → chunk-I557S566.mjs} +2 -2
- package/dist/{chunk-QVULSG6J.mjs → chunk-ID2NYIVE.mjs} +3 -3
- package/dist/chunk-J5WCPZLW.js +2 -0
- package/dist/{chunk-4R42ZNO7.mjs → chunk-JFFOPHU3.mjs} +57 -57
- package/dist/{chunk-P2YV6DR3.js → chunk-LIM64IV2.js} +3 -3
- package/dist/chunk-LU7PKE7Y.mjs +2 -0
- package/dist/{chunk-HQSU7LGM.js → chunk-LWXZMKC2.js} +4 -4
- package/dist/{chunk-XMBSJJ5U.js → chunk-ORFC66EA.js} +3 -3
- package/dist/{chunk-VTITKWGX.mjs → chunk-QSVVAZVT.mjs} +2 -2
- package/dist/chunk-SCWNM4PC.mjs +2 -0
- package/dist/{chunk-EHAZIKDX.js → chunk-SKKOMFXH.js} +2 -2
- package/dist/{chunk-WH6ZMUOS.mjs → chunk-TUNQUVHU.mjs} +2 -2
- package/dist/chunk-TV4U6AIS.js +2 -0
- package/dist/{chunk-ZYLDLGFL.js → chunk-VIQUXWJC.js} +2 -2
- package/dist/{chunk-SUEGUY35.js → chunk-XIM7KMD6.js} +2 -2
- package/dist/{chunk-P6QAFBCV.js → chunk-XNSZ7KUH.js} +2 -2
- package/dist/{chunk-RNTNHVKZ.js → chunk-YPKUHSK4.js} +2 -2
- package/dist/{chunk-UFPSUO52.js → chunk-Z73T6MWY.js} +57 -57
- package/dist/consent.d.mts +648 -84
- package/dist/consent.d.ts +648 -84
- package/dist/consent.js +2 -1
- package/dist/consent.mjs +2 -1
- package/dist/core.d.mts +2049 -23
- package/dist/core.d.ts +2049 -23
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +470 -99
- package/dist/cross-border.d.ts +470 -99
- package/dist/cross-border.js +1 -0
- package/dist/cross-border.mjs +1 -0
- package/dist/dpia.d.mts +591 -37
- package/dist/dpia.d.ts +591 -37
- package/dist/dpia.js +1 -0
- package/dist/dpia.mjs +1 -0
- package/dist/dsr.d.mts +654 -37
- package/dist/dsr.d.ts +654 -37
- package/dist/dsr.js +2 -1
- package/dist/dsr.mjs +2 -1
- package/dist/hooks.d.mts +2174 -30
- package/dist/hooks.d.ts +2174 -30
- package/dist/hooks.js +2 -1
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.mts +4428 -43
- package/dist/index.d.ts +4428 -43
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/lawful-basis.d.mts +368 -32
- package/dist/lawful-basis.d.ts +368 -32
- package/dist/lawful-basis.js +1 -0
- package/dist/lawful-basis.mjs +1 -0
- package/dist/policy.d.mts +1178 -83
- package/dist/policy.d.ts +1178 -83
- package/dist/policy.js +2 -1
- package/dist/policy.mjs +2 -1
- package/dist/presets.d.mts +1020 -114
- package/dist/presets.d.ts +1020 -114
- package/dist/presets.js +2 -1
- package/dist/presets.mjs +2 -1
- package/dist/ropa.d.mts +396 -31
- package/dist/ropa.d.ts +396 -31
- package/dist/ropa.js +2 -1
- package/dist/ropa.mjs +2 -1
- package/dist/server.d.mts +2133 -24
- package/dist/server.d.ts +2133 -24
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.d.mts +523 -55
- package/dist/unstyled.d.ts +523 -55
- package/dist/unstyled.js +2 -1
- package/dist/unstyled.mjs +2 -1
- package/package.json +3 -3
- package/dist/BreachReportForm-DpRrBoxU.d.ts +0 -158
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +0 -158
- package/dist/ConsentBanner-F5ayys5K.d.mts +0 -156
- package/dist/ConsentBanner-VqIPophc.d.ts +0 -156
- package/dist/ConsentManager-C7I3PDe8.d.mts +0 -105
- package/dist/ConsentManager-CQ2IZtUU.d.ts +0 -105
- package/dist/CrossBorderTransferManager-D5Lc0e46.d.ts +0 -90
- package/dist/CrossBorderTransferManager-DkZhv9vD.d.mts +0 -90
- package/dist/DPIAQuestionnaire-VXBoWFMC.d.ts +0 -123
- package/dist/DPIAQuestionnaire-jkt1Veb6.d.mts +0 -123
- package/dist/DSRRequestForm-D8rPTNmU.d.ts +0 -146
- package/dist/DSRRequestForm-DRouEr9j.d.mts +0 -146
- package/dist/DSRTracker-Bl__d4df.d.ts +0 -163
- package/dist/DSRTracker-CSVDfgQQ.d.mts +0 -163
- package/dist/LawfulBasisTracker-CBqOxX1D.d.mts +0 -85
- package/dist/LawfulBasisTracker-Cg30NbDA.d.ts +0 -85
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +0 -44
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +0 -44
- package/dist/NDPRProvider-DYFb8xEl.d.ts +0 -68
- package/dist/NDPRProvider-U3QNu6MA.d.mts +0 -68
- package/dist/PolicyExporter-Bgi6nz82.d.mts +0 -291
- package/dist/PolicyExporter-BnvuFncj.d.ts +0 -291
- package/dist/ROPAManager-BS4eB8Hw.d.mts +0 -79
- package/dist/ROPAManager-qxTrXLkD.d.ts +0 -79
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +0 -282
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +0 -282
- package/dist/StepIndicator-CgrlokSV.d.ts +0 -171
- package/dist/StepIndicator-W8S_QjgO.d.mts +0 -171
- package/dist/breach-B_-6lDqS.d.mts +0 -17
- package/dist/breach-CzXqSsaY.d.ts +0 -17
- package/dist/breach-Eu9byel8.d.mts +0 -185
- package/dist/breach-Eu9byel8.d.ts +0 -185
- package/dist/chunk-5X32J5IA.mjs +0 -2
- package/dist/chunk-7D2OIPHH.mjs +0 -2
- package/dist/chunk-JKKRPS4P.js +0 -2
- package/dist/chunk-NCOZB2WU.mjs +0 -2
- package/dist/chunk-RGNP45VR.js +0 -2
- package/dist/compliance-score-racQe_E_.d.mts +0 -115
- package/dist/compliance-score-racQe_E_.d.ts +0 -115
- package/dist/consent-CmVzqZUk.d.mts +0 -99
- package/dist/consent-CmVzqZUk.d.ts +0 -99
- package/dist/consent-audit-BdByjYlM.d.mts +0 -65
- package/dist/consent-audit-DhbfMR0n.d.ts +0 -65
- package/dist/cross-border-BBi9rZyO.d.mts +0 -54
- package/dist/cross-border-Dy-U9Hu6.d.ts +0 -54
- package/dist/cross-border-UyT00llA.d.mts +0 -141
- package/dist/cross-border-UyT00llA.d.ts +0 -141
- package/dist/docx-BxKascXN.d.ts +0 -64
- package/dist/docx-CV7Vsry_.d.mts +0 -64
- package/dist/dpia-D82hUrJe.d.ts +0 -15
- package/dist/dpia-DQDFw2_l.d.mts +0 -15
- package/dist/dpia-c9GiiOq0.d.mts +0 -137
- package/dist/dpia-c9GiiOq0.d.ts +0 -137
- package/dist/dsr-CIx5sd7e.d.ts +0 -14
- package/dist/dsr-XZ_HqTlA.d.mts +0 -14
- package/dist/dsr-yKbqX531.d.mts +0 -128
- package/dist/dsr-yKbqX531.d.ts +0 -128
- package/dist/lawful-basis-BEyI0kGg.d.ts +0 -57
- package/dist/lawful-basis-C2eGaoHM.d.mts +0 -57
- package/dist/lawful-basis-Cv1VmDLn.d.mts +0 -112
- package/dist/lawful-basis-Cv1VmDLn.d.ts +0 -112
- package/dist/locale-CxJx2tzn.d.mts +0 -25
- package/dist/locale-DSkrtf-c.d.ts +0 -25
- package/dist/policy-engine-CCUCud2T.d.ts +0 -154
- package/dist/policy-engine-fYSqEqSW.d.mts +0 -154
- package/dist/policy-sections-BYx6fEFk.d.ts +0 -56
- package/dist/policy-sections-Dm97Nq8m.d.mts +0 -56
- package/dist/policy-templates-DhLwq4R-.d.ts +0 -43
- package/dist/policy-templates-DwYl2329.d.mts +0 -43
- package/dist/privacy-Ca6te9Ir.d.mts +0 -138
- package/dist/privacy-Ca6te9Ir.d.ts +0 -138
- package/dist/ropa-BDTM06tr.d.ts +0 -152
- package/dist/ropa-CFHuT7jE.d.mts +0 -152
- package/dist/ropa-CyynscU6.d.ts +0 -51
- package/dist/ropa-NIgxd8uP.d.mts +0 -51
- package/dist/sanitize-CxxwKxAx.d.mts +0 -94
- package/dist/sanitize-CxxwKxAx.d.ts +0 -94
- package/dist/styling-BMDGQDgS.d.mts +0 -64
- package/dist/styling-BaoQtV06.d.ts +0 -64
- package/dist/types-DK2CoKOC.d.mts +0 -10
- package/dist/types-DK2CoKOC.d.ts +0 -10
- package/dist/useAdaptivePolicyWizard-BnjW4OR4.d.mts +0 -52
- package/dist/useAdaptivePolicyWizard-sb3m4-Zk.d.ts +0 -52
- package/dist/useBreach-CPr86Yan.d.mts +0 -115
- package/dist/useBreach-DkVXvtJK.d.ts +0 -115
- package/dist/useConsent-DCNkIJHR.d.mts +0 -75
- package/dist/useConsent-dOcELSfX.d.ts +0 -75
- package/dist/useCrossBorderTransfer-DixjLjN1.d.mts +0 -78
- package/dist/useCrossBorderTransfer-DvSq06lv.d.ts +0 -78
- package/dist/useDPIA-B6180UQn.d.mts +0 -109
- package/dist/useDPIA-CTqbNbww.d.ts +0 -109
- package/dist/useDSR-WvHk8_iu.d.mts +0 -85
- package/dist/useDSR-wH4H6hSM.d.ts +0 -85
- package/dist/useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts +0 -162
- package/dist/useDefaultPrivacyPolicy-DkOqMg2e.d.ts +0 -162
- package/dist/useLawfulBasis-CKJ-kw84.d.mts +0 -79
- package/dist/useLawfulBasis-DFTmu1ca.d.ts +0 -79
- package/dist/useROPA-BSSU1rfx.d.ts +0 -76
- package/dist/useROPA-C2hjaBTz.d.mts +0 -76
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { O as OrganizationInfo } from './privacy-Ca6te9Ir.mjs';
|
|
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
|
-
/**
|
|
143
|
-
* Comprehensive set of 16 data categories spanning identity, financial,
|
|
144
|
-
* behavioral, sensitive, and children groups. Used to populate the wizard
|
|
145
|
-
* and drive adaptive section generation.
|
|
146
|
-
*/
|
|
147
|
-
declare const DEFAULT_DATA_CATEGORIES: DataCategory[];
|
|
148
|
-
/**
|
|
149
|
-
* Creates a default TemplateContext with sensible empty/initial values.
|
|
150
|
-
* Useful for initialising the wizard state before the user begins editing.
|
|
151
|
-
*/
|
|
152
|
-
declare function createDefaultContext(): TemplateContext;
|
|
153
|
-
|
|
154
|
-
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-CCUCud2T.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-fYSqEqSW.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 };
|