@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
package/dist/dsr.d.mts
CHANGED
|
@@ -1,37 +1,654 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import * as React_2 from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
export declare const DSR: {
|
|
5
|
+
Provider: React_2.FC<DSRProviderProps>;
|
|
6
|
+
Form: React_2.FC<DSRRequestFormProps>;
|
|
7
|
+
Dashboard: React_2.FC<DSRDashboardProps>;
|
|
8
|
+
Tracker: React_2.FC<DSRTrackerProps>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare interface DSRContextValue extends UseDSRReturn {
|
|
12
|
+
requestTypes: RequestType[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Data Subject Request dashboard component. Supports compliance with NDPA Part IV,
|
|
17
|
+
* providing tools to track, manage, and respond to data subject requests within required timeframes.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DSRDashboard: React__default.FC<DSRDashboardProps>;
|
|
20
|
+
|
|
21
|
+
export declare interface DSRDashboardClassNames {
|
|
22
|
+
root?: string;
|
|
23
|
+
header?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
filters?: string;
|
|
26
|
+
requestList?: string;
|
|
27
|
+
requestItem?: string;
|
|
28
|
+
statusBadge?: string;
|
|
29
|
+
detailPanel?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare interface DSRDashboardProps {
|
|
33
|
+
/**
|
|
34
|
+
* List of DSR requests to display
|
|
35
|
+
*/
|
|
36
|
+
requests: DSRRequest[];
|
|
37
|
+
/**
|
|
38
|
+
* Callback function called when a request is selected
|
|
39
|
+
*/
|
|
40
|
+
onSelectRequest?: (requestId: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Callback function called when a request status is updated
|
|
43
|
+
*/
|
|
44
|
+
onUpdateStatus?: (requestId: string, status: DSRStatus) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Callback function called when a request is assigned
|
|
47
|
+
*/
|
|
48
|
+
onAssignRequest?: (requestId: string, assignee: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Title displayed on the dashboard
|
|
51
|
+
* @default "Data Subject Request Dashboard"
|
|
52
|
+
*/
|
|
53
|
+
title?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Description text displayed on the dashboard
|
|
56
|
+
* @default "Track and manage data subject requests in compliance with NDPA Part IV requirements."
|
|
57
|
+
*/
|
|
58
|
+
description?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Custom CSS class for the dashboard
|
|
61
|
+
*/
|
|
62
|
+
className?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Custom CSS class for the buttons
|
|
65
|
+
*/
|
|
66
|
+
buttonClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to show the request details
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
showRequestDetails?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Whether to show the request timeline
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
showRequestTimeline?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether to show the deadline alerts
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
showDeadlineAlerts?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* List of possible assignees
|
|
84
|
+
*/
|
|
85
|
+
assignees?: string[];
|
|
86
|
+
/**
|
|
87
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
88
|
+
*/
|
|
89
|
+
classNames?: DSRDashboardClassNames;
|
|
90
|
+
/**
|
|
91
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
92
|
+
* can style from scratch using classNames.
|
|
93
|
+
*/
|
|
94
|
+
unstyled?: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Represents the data submitted by the DSR request form.
|
|
99
|
+
*/
|
|
100
|
+
export declare interface DSRFormSubmission {
|
|
101
|
+
/** The selected request type identifier */
|
|
102
|
+
requestType: string;
|
|
103
|
+
/** Data subject personal information */
|
|
104
|
+
dataSubject: {
|
|
105
|
+
fullName: string;
|
|
106
|
+
email: string;
|
|
107
|
+
phone?: string;
|
|
108
|
+
identifierType: string;
|
|
109
|
+
identifierValue: string;
|
|
110
|
+
};
|
|
111
|
+
/** Additional information provided for the selected request type */
|
|
112
|
+
additionalInfo?: Record<string, string | number | boolean | null>;
|
|
113
|
+
/** Timestamp (ms) when the form was submitted */
|
|
114
|
+
submittedAt: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare const DSRProvider: React__default.FC<DSRProviderProps>;
|
|
118
|
+
|
|
119
|
+
export declare interface DSRProviderProps {
|
|
120
|
+
requestTypes: RequestType[];
|
|
121
|
+
adapter?: StorageAdapter<DSRRequest[]>;
|
|
122
|
+
storageKey?: string;
|
|
123
|
+
useLocalStorage?: boolean;
|
|
124
|
+
onSubmit?: (request: DSRRequest) => void;
|
|
125
|
+
onUpdate?: (request: DSRRequest) => void;
|
|
126
|
+
children: React__default.ReactNode;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Represents a data subject request
|
|
131
|
+
*/
|
|
132
|
+
export declare interface DSRRequest {
|
|
133
|
+
/** Unique identifier for the request */
|
|
134
|
+
id: string;
|
|
135
|
+
/** Type of request */
|
|
136
|
+
type: DSRType;
|
|
137
|
+
/** Current status of the request */
|
|
138
|
+
status: DSRStatus;
|
|
139
|
+
/** Timestamp when the request was submitted */
|
|
140
|
+
createdAt: number;
|
|
141
|
+
/** Timestamp when the request was last updated */
|
|
142
|
+
updatedAt: number;
|
|
143
|
+
/** Timestamp when the request was completed (if applicable) */
|
|
144
|
+
completedAt?: number;
|
|
145
|
+
/** Timestamp when the identity was verified (if applicable) */
|
|
146
|
+
verifiedAt?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Due date for responding to the request (timestamp)
|
|
149
|
+
* NDPA requires response within 30 days of receipt
|
|
150
|
+
*/
|
|
151
|
+
dueDate?: number;
|
|
152
|
+
/** Description or details of the request */
|
|
153
|
+
description?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The lawful basis under which the data was originally processed
|
|
156
|
+
* Relevant for evaluating objection and erasure requests
|
|
157
|
+
*/
|
|
158
|
+
lawfulBasis?: string;
|
|
159
|
+
/** Data subject information */
|
|
160
|
+
subject: {
|
|
161
|
+
name: string;
|
|
162
|
+
email: string;
|
|
163
|
+
phone?: string;
|
|
164
|
+
identifierValue?: string;
|
|
165
|
+
identifierType?: string;
|
|
166
|
+
};
|
|
167
|
+
/** Additional information provided by the data subject */
|
|
168
|
+
additionalInfo?: Record<string, string | number | boolean | null>;
|
|
169
|
+
/** Notes added by staff processing the request */
|
|
170
|
+
internalNotes?: Array<{
|
|
171
|
+
timestamp: number;
|
|
172
|
+
author: string;
|
|
173
|
+
note: string;
|
|
174
|
+
}>;
|
|
175
|
+
/** Verification status */
|
|
176
|
+
verification?: {
|
|
177
|
+
verified: boolean;
|
|
178
|
+
method?: string;
|
|
179
|
+
verifiedAt?: number;
|
|
180
|
+
verifiedBy?: string;
|
|
181
|
+
};
|
|
182
|
+
/** Reason for rejection (if status is 'rejected') */
|
|
183
|
+
rejectionReason?: string;
|
|
184
|
+
/** Files attached to the request */
|
|
185
|
+
attachments?: Array<{
|
|
186
|
+
id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
type: string;
|
|
189
|
+
url: string;
|
|
190
|
+
addedAt: number;
|
|
191
|
+
}>;
|
|
192
|
+
/**
|
|
193
|
+
* Whether an extension was requested for this DSR
|
|
194
|
+
* NDPA allows a one-time extension of 30 days with justification
|
|
195
|
+
*/
|
|
196
|
+
extensionRequested?: boolean;
|
|
197
|
+
/** Reason for the extension, if requested */
|
|
198
|
+
extensionReason?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Data Subject Request form component. Implements NDPA Part IV, Sections 29-36
|
|
203
|
+
* covering data subject rights including access, rectification, erasure, and portability.
|
|
204
|
+
*/
|
|
205
|
+
export declare const DSRRequestForm: React__default.FC<DSRRequestFormProps>;
|
|
206
|
+
|
|
207
|
+
export declare interface DSRRequestFormClassNames {
|
|
208
|
+
root?: string;
|
|
209
|
+
title?: string;
|
|
210
|
+
description?: string;
|
|
211
|
+
form?: string;
|
|
212
|
+
fieldGroup?: string;
|
|
213
|
+
label?: string;
|
|
214
|
+
input?: string;
|
|
215
|
+
select?: string;
|
|
216
|
+
textarea?: string;
|
|
217
|
+
submitButton?: string;
|
|
218
|
+
/** Alias for submitButton */
|
|
219
|
+
primaryButton?: string;
|
|
220
|
+
successMessage?: string;
|
|
221
|
+
/** Custom class applied when isSubmitting is true (e.g. a loading overlay) */
|
|
222
|
+
loadingOverlay?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
declare interface DSRRequestFormProps {
|
|
226
|
+
/**
|
|
227
|
+
* Array of request types that can be submitted
|
|
228
|
+
*/
|
|
229
|
+
requestTypes: RequestType[];
|
|
230
|
+
/**
|
|
231
|
+
* Callback function called when form is submitted
|
|
232
|
+
*/
|
|
233
|
+
onSubmit: (data: DSRFormSubmission) => void;
|
|
234
|
+
/**
|
|
235
|
+
* Callback function called when form validation fails
|
|
236
|
+
*/
|
|
237
|
+
onValidationError?: (errors: Record<string, string>) => void;
|
|
238
|
+
/**
|
|
239
|
+
* Title displayed on the form
|
|
240
|
+
* @default "Submit a Data Subject Request"
|
|
241
|
+
*/
|
|
242
|
+
title?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Description text displayed on the form
|
|
245
|
+
* @default "Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36."
|
|
246
|
+
*/
|
|
247
|
+
description?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Text for the submit button
|
|
250
|
+
* @default "Submit Request"
|
|
251
|
+
*/
|
|
252
|
+
submitButtonText?: string;
|
|
253
|
+
/**
|
|
254
|
+
* Custom CSS class for the form
|
|
255
|
+
*/
|
|
256
|
+
className?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Custom CSS class for the submit button
|
|
259
|
+
*/
|
|
260
|
+
buttonClassName?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Whether to show a confirmation message after submission
|
|
263
|
+
* @default true
|
|
264
|
+
*/
|
|
265
|
+
showConfirmation?: boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Confirmation message to display after submission
|
|
268
|
+
* @default "Your request has been submitted successfully. You will receive a confirmation email shortly."
|
|
269
|
+
*/
|
|
270
|
+
confirmationMessage?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Whether to require identity verification
|
|
273
|
+
* @default true
|
|
274
|
+
*/
|
|
275
|
+
requireIdentityVerification?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Types of identifiers accepted for verification
|
|
278
|
+
* @default ["email", "account", "customer_id"]
|
|
279
|
+
*/
|
|
280
|
+
identifierTypes?: Array<{
|
|
281
|
+
id: string;
|
|
282
|
+
label: string;
|
|
283
|
+
}>;
|
|
284
|
+
/**
|
|
285
|
+
* Whether to collect additional contact information
|
|
286
|
+
* @default true
|
|
287
|
+
*/
|
|
288
|
+
collectAdditionalContact?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Custom labels for form fields
|
|
291
|
+
*/
|
|
292
|
+
labels?: {
|
|
293
|
+
name?: string;
|
|
294
|
+
email?: string;
|
|
295
|
+
requestType?: string;
|
|
296
|
+
description?: string;
|
|
297
|
+
submit?: string;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
301
|
+
*/
|
|
302
|
+
classNames?: DSRRequestFormClassNames;
|
|
303
|
+
/**
|
|
304
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
305
|
+
* can style from scratch using classNames.
|
|
306
|
+
*/
|
|
307
|
+
unstyled?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Whether the form is currently submitting.
|
|
310
|
+
* When true, the submit button is disabled and shows "Submitting..." text.
|
|
311
|
+
*/
|
|
312
|
+
isSubmitting?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Default values to pre-fill form fields.
|
|
315
|
+
* Useful for editing existing requests or pre-populating known data.
|
|
316
|
+
*/
|
|
317
|
+
defaultValues?: Partial<DSRFormSubmission>;
|
|
318
|
+
/**
|
|
319
|
+
* Callback fired when the form is reset via the Reset button.
|
|
320
|
+
* To fully remount the component (clearing all internal state),
|
|
321
|
+
* change the `key` prop from the parent.
|
|
322
|
+
*/
|
|
323
|
+
onReset?: () => void;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Status of a data subject request
|
|
328
|
+
*/
|
|
329
|
+
export declare type DSRStatus = 'pending' | 'awaitingVerification' | 'inProgress' | 'completed' | 'rejected';
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Validated DSR submission shape — matches what `<DSRRequestForm onSubmit>`
|
|
333
|
+
* emits client-side. Use this as the typed parameter for your server-side
|
|
334
|
+
* handler after `validateDsrSubmission` returns `valid: true`.
|
|
335
|
+
*/
|
|
336
|
+
export declare interface DsrSubmissionPayload {
|
|
337
|
+
requestType: string;
|
|
338
|
+
dataSubject: {
|
|
339
|
+
fullName: string;
|
|
340
|
+
email: string;
|
|
341
|
+
phone?: string;
|
|
342
|
+
identifierType: string;
|
|
343
|
+
identifierValue: string;
|
|
344
|
+
};
|
|
345
|
+
additionalInfo?: Record<string, string | number | boolean | null>;
|
|
346
|
+
submittedAt: number;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/** Result of validating a raw DSR submission payload. */
|
|
350
|
+
export declare interface DsrSubmissionValidationResult {
|
|
351
|
+
/** True when the payload conforms to the DSR submission contract. */
|
|
352
|
+
valid: boolean;
|
|
353
|
+
/** Field-keyed error messages. Empty when `valid` is true. */
|
|
354
|
+
errors: Record<string, string>;
|
|
355
|
+
/** The narrowed, typed payload — only populated when `valid` is true. */
|
|
356
|
+
data?: DsrSubmissionPayload;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* DSR tracking and analytics component. Supports compliance with NDPA Part IV,
|
|
361
|
+
* providing summary statistics, deadline tracking, and compliance metrics for data subject requests.
|
|
362
|
+
*/
|
|
363
|
+
export declare const DSRTracker: React__default.FC<DSRTrackerProps>;
|
|
364
|
+
|
|
365
|
+
export declare interface DSRTrackerClassNames {
|
|
366
|
+
root?: string;
|
|
367
|
+
header?: string;
|
|
368
|
+
title?: string;
|
|
369
|
+
stats?: string;
|
|
370
|
+
statCard?: string;
|
|
371
|
+
table?: string;
|
|
372
|
+
tableHeader?: string;
|
|
373
|
+
tableRow?: string;
|
|
374
|
+
statusBadge?: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
declare interface DSRTrackerProps {
|
|
378
|
+
/**
|
|
379
|
+
* List of DSR requests to track
|
|
380
|
+
*/
|
|
381
|
+
requests: DSRRequest[];
|
|
382
|
+
/**
|
|
383
|
+
* Callback function called when a request is selected
|
|
384
|
+
*/
|
|
385
|
+
onSelectRequest?: (requestId: string) => void;
|
|
386
|
+
/**
|
|
387
|
+
* Title displayed on the tracker
|
|
388
|
+
* @default "DSR Request Tracker"
|
|
389
|
+
*/
|
|
390
|
+
title?: string;
|
|
391
|
+
/**
|
|
392
|
+
* Description text displayed on the tracker
|
|
393
|
+
* @default "Track the status and progress of data subject requests as required by NDPA Part IV."
|
|
394
|
+
*/
|
|
395
|
+
description?: string;
|
|
396
|
+
/**
|
|
397
|
+
* Custom CSS class for the tracker
|
|
398
|
+
*/
|
|
399
|
+
className?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Custom CSS class for the buttons
|
|
402
|
+
*/
|
|
403
|
+
buttonClassName?: string;
|
|
404
|
+
/**
|
|
405
|
+
* Whether to show the summary statistics
|
|
406
|
+
* @default true
|
|
407
|
+
*/
|
|
408
|
+
showSummaryStats?: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Whether to show the request type breakdown
|
|
411
|
+
* @default true
|
|
412
|
+
*/
|
|
413
|
+
showTypeBreakdown?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* Whether to show the status breakdown
|
|
416
|
+
* @default true
|
|
417
|
+
*/
|
|
418
|
+
showStatusBreakdown?: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Whether to show the timeline chart
|
|
421
|
+
* @default true
|
|
422
|
+
*/
|
|
423
|
+
showTimelineChart?: boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Whether to show the overdue requests
|
|
426
|
+
* @default true
|
|
427
|
+
*/
|
|
428
|
+
showOverdueRequests?: boolean;
|
|
429
|
+
/**
|
|
430
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
431
|
+
*/
|
|
432
|
+
classNames?: DSRTrackerClassNames;
|
|
433
|
+
/**
|
|
434
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
435
|
+
* can style from scratch using classNames.
|
|
436
|
+
*/
|
|
437
|
+
unstyled?: boolean;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Data Subject Rights types aligned with NDPA 2023 Part IV (Sections 29-36)
|
|
442
|
+
*/
|
|
443
|
+
/**
|
|
444
|
+
* Types of data subject requests per NDPA Part IV
|
|
445
|
+
* - 'information': Right to be informed (Section 29)
|
|
446
|
+
* - 'access': Right of access (Section 30)
|
|
447
|
+
* - 'rectification': Right to rectification (Section 31)
|
|
448
|
+
* - 'erasure': Right to erasure (Section 32)
|
|
449
|
+
* - 'restriction': Right to restrict processing (Section 33)
|
|
450
|
+
* - 'portability': Right to data portability (Section 34)
|
|
451
|
+
* - 'objection': Right to object (Section 35)
|
|
452
|
+
* - 'automated_decision_making': Rights related to automated decision-making (Section 36)
|
|
453
|
+
*/
|
|
454
|
+
export declare type DSRType = 'information' | 'access' | 'rectification' | 'erasure' | 'restriction' | 'portability' | 'objection' | 'automated_decision_making';
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Formats a DSR request for display or submission
|
|
458
|
+
* @param request The DSR request to format
|
|
459
|
+
* @returns Formatted request data
|
|
460
|
+
*/
|
|
461
|
+
export declare function formatDSRRequest(request: DSRRequest): {
|
|
462
|
+
formattedRequest: Record<string, unknown>;
|
|
463
|
+
isValid: boolean;
|
|
464
|
+
validationErrors: string[];
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Legacy status of a data subject request
|
|
469
|
+
* @deprecated Use DSRStatus instead
|
|
470
|
+
*/
|
|
471
|
+
export declare type RequestStatus = 'pending' | 'verifying' | 'processing' | 'completed' | 'rejected';
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Represents a type of data subject request (detailed configuration)
|
|
475
|
+
*/
|
|
476
|
+
export declare interface RequestType {
|
|
477
|
+
/** Unique identifier for the request type */
|
|
478
|
+
id: string;
|
|
479
|
+
/** Display name for the request type */
|
|
480
|
+
name: string;
|
|
481
|
+
/** Description of what this request type entails */
|
|
482
|
+
description: string;
|
|
483
|
+
/**
|
|
484
|
+
* NDPA section reference (e.g., "Section 30" for access requests)
|
|
485
|
+
*/
|
|
486
|
+
ndpaSection?: string;
|
|
487
|
+
/**
|
|
488
|
+
* Estimated time to fulfill this type of request (in days)
|
|
489
|
+
* NDPA requires response within 30 days
|
|
490
|
+
*/
|
|
491
|
+
estimatedCompletionTime: number;
|
|
492
|
+
/** Whether additional information is required for this request type */
|
|
493
|
+
requiresAdditionalInfo: boolean;
|
|
494
|
+
/** Custom fields required for this request type */
|
|
495
|
+
additionalFields?: Array<{
|
|
496
|
+
id: string;
|
|
497
|
+
label: string;
|
|
498
|
+
type: 'text' | 'textarea' | 'select' | 'checkbox' | 'file';
|
|
499
|
+
options?: string[];
|
|
500
|
+
required: boolean;
|
|
501
|
+
placeholder?: string;
|
|
502
|
+
}>;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export declare interface StorageAdapter<T = unknown> {
|
|
506
|
+
/** Load persisted data. Called once on hook mount. */
|
|
507
|
+
load(): T | null | Promise<T | null>;
|
|
508
|
+
/** Persist data. Called on every state change. */
|
|
509
|
+
save(data: T): void | Promise<void>;
|
|
510
|
+
/** Clear persisted data. Called on reset. */
|
|
511
|
+
remove(): void | Promise<void>;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Hook for managing Data Subject Requests in compliance with the NDPA
|
|
516
|
+
*/
|
|
517
|
+
export declare function useDSR({ initialRequests, requestTypes, adapter, storageKey, useLocalStorage, onSubmit, onUpdate, }: UseDSROptions): UseDSRReturn;
|
|
518
|
+
|
|
519
|
+
export declare function useDSRCompound(): DSRContextValue;
|
|
520
|
+
|
|
521
|
+
declare interface UseDSROptions {
|
|
522
|
+
/**
|
|
523
|
+
* Initial requests to load
|
|
524
|
+
*/
|
|
525
|
+
initialRequests?: DSRRequest[];
|
|
526
|
+
/**
|
|
527
|
+
* Available request types
|
|
528
|
+
*/
|
|
529
|
+
requestTypes: RequestType[];
|
|
530
|
+
/**
|
|
531
|
+
* Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
|
|
532
|
+
*/
|
|
533
|
+
adapter?: StorageAdapter<DSRRequest[]>;
|
|
534
|
+
/**
|
|
535
|
+
* Storage key for requests
|
|
536
|
+
* @default "ndpr_dsr_requests"
|
|
537
|
+
* @deprecated Use adapter instead
|
|
538
|
+
*/
|
|
539
|
+
storageKey?: string;
|
|
540
|
+
/**
|
|
541
|
+
* Whether to use local storage to persist requests
|
|
542
|
+
* @default true
|
|
543
|
+
* @deprecated Use adapter instead
|
|
544
|
+
*/
|
|
545
|
+
useLocalStorage?: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Callback function called when a request is submitted
|
|
548
|
+
*/
|
|
549
|
+
onSubmit?: (request: DSRRequest) => void;
|
|
550
|
+
/**
|
|
551
|
+
* Callback function called when a request is updated
|
|
552
|
+
*/
|
|
553
|
+
onUpdate?: (request: DSRRequest) => void;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
declare interface UseDSRReturn {
|
|
557
|
+
/**
|
|
558
|
+
* All requests
|
|
559
|
+
*/
|
|
560
|
+
requests: DSRRequest[];
|
|
561
|
+
/**
|
|
562
|
+
* Submit a new request
|
|
563
|
+
*/
|
|
564
|
+
submitRequest: (requestData: Omit<DSRRequest, 'id' | 'status' | 'submittedAt' | 'updatedAt' | 'estimatedCompletionDate'>) => DSRRequest;
|
|
565
|
+
/**
|
|
566
|
+
* Update an existing request
|
|
567
|
+
*/
|
|
568
|
+
updateRequest: (id: string, updates: Partial<DSRRequest>) => DSRRequest | null;
|
|
569
|
+
/**
|
|
570
|
+
* Get a request by ID
|
|
571
|
+
*/
|
|
572
|
+
getRequest: (id: string) => DSRRequest | null;
|
|
573
|
+
/**
|
|
574
|
+
* Get requests by status
|
|
575
|
+
*/
|
|
576
|
+
getRequestsByStatus: (status: RequestStatus) => DSRRequest[];
|
|
577
|
+
/**
|
|
578
|
+
* Get requests by type
|
|
579
|
+
*/
|
|
580
|
+
getRequestsByType: (type: string) => DSRRequest[];
|
|
581
|
+
/**
|
|
582
|
+
* Get the request type definition by ID
|
|
583
|
+
*/
|
|
584
|
+
getRequestType: (typeId: string) => RequestType | undefined;
|
|
585
|
+
/**
|
|
586
|
+
* Format a request for display or submission
|
|
587
|
+
*/
|
|
588
|
+
formatRequest: (request: DSRRequest) => Record<string, unknown>;
|
|
589
|
+
/**
|
|
590
|
+
* Clear all requests
|
|
591
|
+
*/
|
|
592
|
+
clearRequests: () => void;
|
|
593
|
+
/**
|
|
594
|
+
* Whether the adapter is still loading data (relevant for async adapters)
|
|
595
|
+
*/
|
|
596
|
+
isLoading: boolean;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Validate a raw DSR submission payload against the same rules
|
|
601
|
+
* `<DSRRequestForm />` enforces client-side. Designed to be called from a
|
|
602
|
+
* server-side handler (Next.js Route Handler, NestJS controller, Express
|
|
603
|
+
* middleware, Cloudflare Worker) so client and server stay in sync without
|
|
604
|
+
* the consumer hand-rolling zod / class-validator schemas.
|
|
605
|
+
*
|
|
606
|
+
* Defensive — accepts `unknown` and narrows. Safe to call directly on
|
|
607
|
+
* `await request.json()`.
|
|
608
|
+
*
|
|
609
|
+
* @example **Next.js Route Handler**
|
|
610
|
+
* ```ts
|
|
611
|
+
* // app/api/dsr/route.ts
|
|
612
|
+
* import { validateDsrSubmission } from '@tantainnovative/ndpr-toolkit/server';
|
|
613
|
+
*
|
|
614
|
+
* export async function POST(req: Request) {
|
|
615
|
+
* const { valid, errors, data } = validateDsrSubmission(await req.json());
|
|
616
|
+
* if (!valid) return Response.json({ errors }, { status: 422 });
|
|
617
|
+
* // `data` is the typed DsrSubmissionPayload
|
|
618
|
+
* await dsrStore.create(data);
|
|
619
|
+
* return Response.json({ ok: true }, { status: 201 });
|
|
620
|
+
* }
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* @example **Lock to specific request types**
|
|
624
|
+
* ```ts
|
|
625
|
+
* validateDsrSubmission(payload, {
|
|
626
|
+
* allowedRequestTypes: ['access', 'erasure', 'rectification'],
|
|
627
|
+
* });
|
|
628
|
+
* ```
|
|
629
|
+
*
|
|
630
|
+
* @example **Skip identity verification (e.g. authenticated session)**
|
|
631
|
+
* ```ts
|
|
632
|
+
* validateDsrSubmission(payload, { requireIdentityVerification: false });
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
export declare function validateDsrSubmission(payload: unknown, options?: ValidateDsrSubmissionOptions): DsrSubmissionValidationResult;
|
|
636
|
+
|
|
637
|
+
/** Options for {@link validateDsrSubmission}. */
|
|
638
|
+
export declare interface ValidateDsrSubmissionOptions {
|
|
639
|
+
/**
|
|
640
|
+
* Whether the data subject is required to provide an identifier
|
|
641
|
+
* (NDPC's recommended verification step). Mirror whatever you set on
|
|
642
|
+
* the client-side `<DSRRequestForm requireIdentityVerification>`.
|
|
643
|
+
* @default true
|
|
644
|
+
*/
|
|
645
|
+
requireIdentityVerification?: boolean;
|
|
646
|
+
/**
|
|
647
|
+
* Allowed request types. When provided, the payload's `requestType`
|
|
648
|
+
* must be one of these — useful for locking the server to a specific
|
|
649
|
+
* set of supported NDPA Part IV §29-36 rights.
|
|
650
|
+
*/
|
|
651
|
+
allowedRequestTypes?: string[];
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
export { }
|