@tantainnovative/ndpr-toolkit 3.10.6 → 3.12.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 +111 -0
- package/README.md +38 -24
- package/dist/adapters.d.mts +90 -4
- package/dist/adapters.d.ts +90 -4
- package/dist/breach.d.mts +13 -1
- package/dist/breach.d.ts +13 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/{chunk-EZCGTHQV.js → chunk-4GIMXUMI.js} +3 -3
- package/dist/{chunk-HBLGN4SD.js → chunk-5AECGMEB.js} +1 -1
- package/dist/chunk-67KA345Q.mjs +1 -0
- package/dist/chunk-6OWCUDTN.mjs +1 -0
- package/dist/{chunk-4G3SRVRI.mjs → chunk-B6BRD5SL.mjs} +1 -1
- package/dist/chunk-CAFCRCTZ.mjs +1 -0
- package/dist/{chunk-VJTQXVAF.js → chunk-EHQVTFYO.js} +1 -1
- package/dist/{chunk-CNM6G5IA.js → chunk-FC3PTJFL.js} +1 -1
- package/dist/{chunk-H3IULCE3.js → chunk-HOAC5VUF.js} +1 -1
- package/dist/{chunk-H3XJV2IR.mjs → chunk-I3V3ITN7.mjs} +1 -1
- package/dist/{chunk-MPBPAEZC.mjs → chunk-IB3KSUPZ.mjs} +1 -1
- package/dist/{chunk-TAHSSITO.mjs → chunk-IHNAFXDM.mjs} +1 -1
- package/dist/chunk-IQO3SIAG.mjs +1 -0
- package/dist/{chunk-UTFBKL73.js → chunk-IRRUYR6M.js} +1 -1
- package/dist/{chunk-C7IDR2IV.js → chunk-JLQT3W3E.js} +1 -1
- package/dist/chunk-JYZOKO2W.mjs +103 -0
- package/dist/chunk-NX5MOBRI.js +1 -0
- package/dist/chunk-O2WEABB3.js +1 -0
- package/dist/chunk-OZHUINWS.js +1 -0
- package/dist/{chunk-66NQ5CVY.mjs → chunk-Q4CSVWSS.mjs} +1 -1
- package/dist/{chunk-CR2QZTGW.js → chunk-QMAVEHOR.js} +1 -1
- package/dist/{chunk-3HOXQNCH.mjs → chunk-RFXGD5NE.mjs} +1 -1
- package/dist/chunk-ROC64RLP.js +1 -0
- package/dist/{chunk-O45PKBZA.mjs → chunk-RR3KXNET.mjs} +3 -3
- package/dist/{chunk-KY6WYHWB.mjs → chunk-TN4TH3CT.mjs} +1 -1
- package/dist/chunk-VPNK7OID.mjs +1 -0
- package/dist/{chunk-O2RDZGM2.js → chunk-VUFTRKKC.js} +1 -1
- package/dist/chunk-WKUC65HL.mjs +1 -0
- package/dist/chunk-WXUXCRAJ.js +1 -0
- package/dist/chunk-YK22SYCT.js +103 -0
- package/dist/chunk-YSD2DFBR.js +6 -0
- package/dist/chunk-ZHX62QAL.mjs +6 -0
- package/dist/consent.d.mts +23 -1
- package/dist/consent.d.ts +23 -1
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +12 -1
- package/dist/cross-border.d.ts +12 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.d.mts +16 -1
- package/dist/dpia.d.ts +16 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +21 -1
- package/dist/dsr.d.ts +21 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +217 -24
- package/dist/headless.d.ts +217 -24
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +217 -24
- package/dist/hooks.d.ts +217 -24
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +419 -29
- package/dist/index.d.ts +419 -29
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +10 -0
- package/dist/lawful-basis.d.ts +10 -0
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.d.mts +39 -1
- package/dist/policy.d.ts +39 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.d.mts +39 -3
- package/dist/ropa.d.ts +39 -3
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +86 -0
- package/dist/server.d.ts +86 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/styles.css +2 -0
- package/package.json +1 -1
- package/dist/chunk-3JPDTXGC.js +0 -1
- package/dist/chunk-43OQNS2J.mjs +0 -6
- package/dist/chunk-5GVMKUMP.js +0 -1
- package/dist/chunk-COD3RMTL.mjs +0 -1
- package/dist/chunk-EXEXUAF6.mjs +0 -1
- package/dist/chunk-L2BRFMVS.js +0 -1
- package/dist/chunk-MOHBL6LX.mjs +0 -1
- package/dist/chunk-PGI2LM6P.js +0 -103
- package/dist/chunk-PZRQWPWD.js +0 -1
- package/dist/chunk-RPXRPGHL.mjs +0 -1
- package/dist/chunk-RZ6GC6WN.mjs +0 -1
- package/dist/chunk-SSH4U4TJ.js +0 -6
- package/dist/chunk-WDDCKYWA.js +0 -1
- package/dist/chunk-X3GCGC3H.mjs +0 -103
- package/dist/chunk-ZQZJNKVB.mjs +0 -1
package/dist/headless.d.mts
CHANGED
|
@@ -1514,6 +1514,28 @@ declare interface TransferValidationResult {
|
|
|
1514
1514
|
warnings: string[];
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
|
+
/**
|
|
1518
|
+
* Multi-step privacy-policy authoring hook that adapts the generated draft
|
|
1519
|
+
* to the supplied template context (industry, processing purposes, data
|
|
1520
|
+
* categories, processors). Auto-persists a draft via the supplied adapter
|
|
1521
|
+
* and surfaces a live compliance score against the configured rule set.
|
|
1522
|
+
*
|
|
1523
|
+
* @example
|
|
1524
|
+
* ```tsx
|
|
1525
|
+
* import { useAdaptivePolicyWizard } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
1526
|
+
*
|
|
1527
|
+
* function PolicyWizard() {
|
|
1528
|
+
* const { currentStep, nextStep, policy, complianceScore } = useAdaptivePolicyWizard();
|
|
1529
|
+
* return (
|
|
1530
|
+
* <div>
|
|
1531
|
+
* <p>Step {currentStep} — compliance: {complianceScore}%</p>
|
|
1532
|
+
* <button onClick={nextStep}>Next</button>
|
|
1533
|
+
* {policy && <pre>{policy.title}</pre>}
|
|
1534
|
+
* </div>
|
|
1535
|
+
* );
|
|
1536
|
+
* }
|
|
1537
|
+
* ```
|
|
1538
|
+
*/
|
|
1517
1539
|
export declare function useAdaptivePolicyWizard(options?: UseAdaptivePolicyWizardOptions): UseAdaptivePolicyWizardReturn;
|
|
1518
1540
|
|
|
1519
1541
|
export declare interface UseAdaptivePolicyWizardOptions {
|
|
@@ -1574,11 +1596,23 @@ export declare interface UseAdaptivePolicyWizardReturn {
|
|
|
1574
1596
|
}
|
|
1575
1597
|
|
|
1576
1598
|
/**
|
|
1577
|
-
* Hook for managing data breach notifications in compliance with the NDPA (Section 40)
|
|
1599
|
+
* Hook for managing data breach notifications in compliance with the NDPA (Section 40).
|
|
1600
|
+
*
|
|
1601
|
+
* @example
|
|
1602
|
+
* ```tsx
|
|
1603
|
+
* import { useBreach } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
1604
|
+
*
|
|
1605
|
+
* function BreachConsole() {
|
|
1606
|
+
* const { reports, reportBreach } = useBreach({
|
|
1607
|
+
* categories: [{ id: 'unauthorized-access', name: 'Unauthorised access', description: '' }],
|
|
1608
|
+
* });
|
|
1609
|
+
* return <p>{reports.length} breach report(s) on record.</p>;
|
|
1610
|
+
* }
|
|
1611
|
+
* ```
|
|
1578
1612
|
*/
|
|
1579
1613
|
export declare function useBreach({ categories, initialReports, adapter, storageKey, useLocalStorage, onReport, onAssessment, onNotification, }: UseBreachOptions): UseBreachReturn;
|
|
1580
1614
|
|
|
1581
|
-
declare interface UseBreachOptions {
|
|
1615
|
+
export declare interface UseBreachOptions {
|
|
1582
1616
|
/**
|
|
1583
1617
|
* Available breach categories
|
|
1584
1618
|
*/
|
|
@@ -1617,7 +1651,7 @@ declare interface UseBreachOptions {
|
|
|
1617
1651
|
onNotification?: (notification: RegulatoryNotification) => void;
|
|
1618
1652
|
}
|
|
1619
1653
|
|
|
1620
|
-
declare interface UseBreachReturn {
|
|
1654
|
+
export declare interface UseBreachReturn {
|
|
1621
1655
|
/**
|
|
1622
1656
|
* All breach reports
|
|
1623
1657
|
*/
|
|
@@ -1681,18 +1715,69 @@ declare interface UseBreachReturn {
|
|
|
1681
1715
|
isLoading: boolean;
|
|
1682
1716
|
}
|
|
1683
1717
|
|
|
1718
|
+
/**
|
|
1719
|
+
* Computes an NDPA compliance score and returns a structured report
|
|
1720
|
+
* (score, rating, per-module breakdown, recommendations).
|
|
1721
|
+
*
|
|
1722
|
+
* The computation is memoised by the structural identity of `input` — passing
|
|
1723
|
+
* a fresh-but-equal object on every render is safe and does not force a recompute.
|
|
1724
|
+
*
|
|
1725
|
+
* @param options - The compliance score options.
|
|
1726
|
+
* @param options.input - A {@link ComplianceInput} snapshot summarising the
|
|
1727
|
+
* organisation's current compliance posture.
|
|
1728
|
+
* @returns A memoised {@link ComplianceReport} with overall score, rating,
|
|
1729
|
+
* module-level breakdowns, and prioritised recommendations.
|
|
1730
|
+
*
|
|
1731
|
+
* @example
|
|
1732
|
+
* ```tsx
|
|
1733
|
+
* import { useComplianceScore } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
1734
|
+
*
|
|
1735
|
+
* function ComplianceBadge({ input }) {
|
|
1736
|
+
* const report = useComplianceScore({ input });
|
|
1737
|
+
* return <span>{report.overallScore}/100 — {report.rating}</span>;
|
|
1738
|
+
* }
|
|
1739
|
+
* ```
|
|
1740
|
+
*/
|
|
1684
1741
|
export declare function useComplianceScore({ input }: UseComplianceScoreOptions): ComplianceReport_2;
|
|
1685
1742
|
|
|
1686
|
-
declare interface UseComplianceScoreOptions {
|
|
1743
|
+
export declare interface UseComplianceScoreOptions {
|
|
1744
|
+
/**
|
|
1745
|
+
* Snapshot of the organisation's compliance signals — consent settings,
|
|
1746
|
+
* DSR queue, breach log, lawful-basis register, transfers, ROPA, etc.
|
|
1747
|
+
* The hook recomputes the report whenever this input changes by value
|
|
1748
|
+
* (compared via a stable JSON key under the hood).
|
|
1749
|
+
*/
|
|
1687
1750
|
input: ComplianceInput_2;
|
|
1688
1751
|
}
|
|
1689
1752
|
|
|
1690
1753
|
/**
|
|
1691
|
-
* Hook for managing user consent in compliance with NDPA
|
|
1754
|
+
* Hook for managing user consent in compliance with the NDPA.
|
|
1755
|
+
*
|
|
1756
|
+
* @example
|
|
1757
|
+
* ```tsx
|
|
1758
|
+
* import { useConsent } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
1759
|
+
*
|
|
1760
|
+
* function App() {
|
|
1761
|
+
* const { hasConsent, acceptAll, rejectAll, shouldShowBanner } = useConsent({
|
|
1762
|
+
* options: [
|
|
1763
|
+
* { id: 'necessary', label: 'Necessary', required: true },
|
|
1764
|
+
* { id: 'analytics', label: 'Analytics' },
|
|
1765
|
+
* ],
|
|
1766
|
+
* });
|
|
1767
|
+
* if (!shouldShowBanner) return null;
|
|
1768
|
+
* return (
|
|
1769
|
+
* <div role="dialog">
|
|
1770
|
+
* <button onClick={acceptAll}>Accept all</button>
|
|
1771
|
+
* <button onClick={rejectAll}>Reject non-essential</button>
|
|
1772
|
+
* {hasConsent('analytics') && <AnalyticsScripts />}
|
|
1773
|
+
* </div>
|
|
1774
|
+
* );
|
|
1775
|
+
* }
|
|
1776
|
+
* ```
|
|
1692
1777
|
*/
|
|
1693
1778
|
export declare function useConsent({ options, adapter, storageOptions, version, onChange, }: UseConsentOptions): UseConsentReturn;
|
|
1694
1779
|
|
|
1695
|
-
declare interface UseConsentOptions {
|
|
1780
|
+
export declare interface UseConsentOptions {
|
|
1696
1781
|
/**
|
|
1697
1782
|
* Consent options to present to the user
|
|
1698
1783
|
*/
|
|
@@ -1717,7 +1802,7 @@ declare interface UseConsentOptions {
|
|
|
1717
1802
|
onChange?: (settings: ConsentSettings) => void;
|
|
1718
1803
|
}
|
|
1719
1804
|
|
|
1720
|
-
declare interface UseConsentReturn {
|
|
1805
|
+
export declare interface UseConsentReturn {
|
|
1721
1806
|
/**
|
|
1722
1807
|
* Current consent settings
|
|
1723
1808
|
*/
|
|
@@ -1761,11 +1846,22 @@ declare interface UseConsentReturn {
|
|
|
1761
1846
|
}
|
|
1762
1847
|
|
|
1763
1848
|
/**
|
|
1764
|
-
* Hook for managing cross-border data transfers in compliance with NDPA Part VIII (Sections 41-43)
|
|
1849
|
+
* Hook for managing cross-border data transfers in compliance with NDPA Part VIII (Sections 41-43).
|
|
1850
|
+
*
|
|
1851
|
+
* @example
|
|
1852
|
+
* ```tsx
|
|
1853
|
+
* import { useCrossBorderTransfer } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
1854
|
+
*
|
|
1855
|
+
* function TransferRegister() {
|
|
1856
|
+
* const { transfers, getSummary } = useCrossBorderTransfer();
|
|
1857
|
+
* const summary = getSummary();
|
|
1858
|
+
* return <p>{summary.totalActiveTransfers} active cross-border transfers.</p>;
|
|
1859
|
+
* }
|
|
1860
|
+
* ```
|
|
1765
1861
|
*/
|
|
1766
1862
|
export declare function useCrossBorderTransfer({ initialTransfers, adapter, storageKey, useLocalStorage, onAdd, onUpdate, onRemove, }?: UseCrossBorderTransferOptions): UseCrossBorderTransferReturn;
|
|
1767
1863
|
|
|
1768
|
-
declare interface UseCrossBorderTransferOptions {
|
|
1864
|
+
export declare interface UseCrossBorderTransferOptions {
|
|
1769
1865
|
/**
|
|
1770
1866
|
* Initial transfers to load
|
|
1771
1867
|
*/
|
|
@@ -1800,7 +1896,7 @@ declare interface UseCrossBorderTransferOptions {
|
|
|
1800
1896
|
onRemove?: (id: string) => void;
|
|
1801
1897
|
}
|
|
1802
1898
|
|
|
1803
|
-
declare interface UseCrossBorderTransferReturn {
|
|
1899
|
+
export declare interface UseCrossBorderTransferReturn {
|
|
1804
1900
|
/**
|
|
1805
1901
|
* All cross-border transfers
|
|
1806
1902
|
*/
|
|
@@ -1907,11 +2003,26 @@ declare interface UseDefaultPrivacyPolicyOptions {
|
|
|
1907
2003
|
}
|
|
1908
2004
|
|
|
1909
2005
|
/**
|
|
1910
|
-
* Hook for conducting Data Protection Impact Assessments in compliance with the NDPA 2023
|
|
2006
|
+
* Hook for conducting Data Protection Impact Assessments in compliance with the NDPA 2023.
|
|
2007
|
+
*
|
|
2008
|
+
* @example
|
|
2009
|
+
* ```tsx
|
|
2010
|
+
* import { useDPIA } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
2011
|
+
*
|
|
2012
|
+
* function DPIAWizard({ sections }) {
|
|
2013
|
+
* const { currentSection, progress, updateAnswer, nextSection } = useDPIA({ sections });
|
|
2014
|
+
* return (
|
|
2015
|
+
* <div>
|
|
2016
|
+
* <h2>{currentSection?.title} ({progress}%)</h2>
|
|
2017
|
+
* <button onClick={nextSection}>Next</button>
|
|
2018
|
+
* </div>
|
|
2019
|
+
* );
|
|
2020
|
+
* }
|
|
2021
|
+
* ```
|
|
1911
2022
|
*/
|
|
1912
2023
|
export declare function useDPIA({ sections, initialAnswers, adapter, storageKey, useLocalStorage, onComplete, }: UseDPIAOptions): UseDPIAReturn;
|
|
1913
2024
|
|
|
1914
|
-
declare interface UseDPIAOptions {
|
|
2025
|
+
export declare interface UseDPIAOptions {
|
|
1915
2026
|
/**
|
|
1916
2027
|
* Sections of the DPIA questionnaire
|
|
1917
2028
|
*/
|
|
@@ -1942,7 +2053,7 @@ declare interface UseDPIAOptions {
|
|
|
1942
2053
|
onComplete?: (result: DPIAResult) => void;
|
|
1943
2054
|
}
|
|
1944
2055
|
|
|
1945
|
-
declare interface UseDPIAReturn {
|
|
2056
|
+
export declare interface UseDPIAReturn {
|
|
1946
2057
|
/**
|
|
1947
2058
|
* Current section index
|
|
1948
2059
|
*/
|
|
@@ -2010,11 +2121,31 @@ declare interface UseDPIAReturn {
|
|
|
2010
2121
|
}
|
|
2011
2122
|
|
|
2012
2123
|
/**
|
|
2013
|
-
* Hook for managing Data Subject Requests in compliance with the NDPA
|
|
2124
|
+
* Hook for managing Data Subject Requests in compliance with the NDPA.
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```tsx
|
|
2128
|
+
* import { useDSR } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
2129
|
+
*
|
|
2130
|
+
* function DSRPanel() {
|
|
2131
|
+
* const { requests, submitRequest } = useDSR({
|
|
2132
|
+
* requestTypes: [
|
|
2133
|
+
* { id: 'access', name: 'Access', description: 'Request access', estimatedCompletionTime: 30 },
|
|
2134
|
+
* ],
|
|
2135
|
+
* });
|
|
2136
|
+
* return (
|
|
2137
|
+
* <ul>
|
|
2138
|
+
* {requests.map((r) => (
|
|
2139
|
+
* <li key={r.id}>{r.type} — {r.status}</li>
|
|
2140
|
+
* ))}
|
|
2141
|
+
* </ul>
|
|
2142
|
+
* );
|
|
2143
|
+
* }
|
|
2144
|
+
* ```
|
|
2014
2145
|
*/
|
|
2015
2146
|
export declare function useDSR({ initialRequests, requestTypes, adapter, storageKey, useLocalStorage, onSubmit, onUpdate, }: UseDSROptions): UseDSRReturn;
|
|
2016
2147
|
|
|
2017
|
-
declare interface UseDSROptions {
|
|
2148
|
+
export declare interface UseDSROptions {
|
|
2018
2149
|
/**
|
|
2019
2150
|
* Initial requests to load
|
|
2020
2151
|
*/
|
|
@@ -2049,7 +2180,7 @@ declare interface UseDSROptions {
|
|
|
2049
2180
|
onUpdate?: (request: DSRRequest) => void;
|
|
2050
2181
|
}
|
|
2051
2182
|
|
|
2052
|
-
declare interface UseDSRReturn {
|
|
2183
|
+
export declare interface UseDSRReturn {
|
|
2053
2184
|
/**
|
|
2054
2185
|
* All requests
|
|
2055
2186
|
*/
|
|
@@ -2135,10 +2266,20 @@ export declare interface UseFocusTrapOptions {
|
|
|
2135
2266
|
/**
|
|
2136
2267
|
* Hook for managing lawful basis documentation for processing activities
|
|
2137
2268
|
* in compliance with NDPA 2023 Section 25.
|
|
2269
|
+
*
|
|
2270
|
+
* @example
|
|
2271
|
+
* ```tsx
|
|
2272
|
+
* import { useLawfulBasis } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
2273
|
+
*
|
|
2274
|
+
* function LawfulBasisRegistry() {
|
|
2275
|
+
* const { activities, addActivity } = useLawfulBasis();
|
|
2276
|
+
* return <p>{activities.length} processing activities documented.</p>;
|
|
2277
|
+
* }
|
|
2278
|
+
* ```
|
|
2138
2279
|
*/
|
|
2139
2280
|
export declare function useLawfulBasis({ initialActivities, adapter, storageKey, useLocalStorage, onAdd, onUpdate, onRemove, }?: UseLawfulBasisOptions): UseLawfulBasisReturn;
|
|
2140
2281
|
|
|
2141
|
-
declare interface UseLawfulBasisOptions {
|
|
2282
|
+
export declare interface UseLawfulBasisOptions {
|
|
2142
2283
|
/**
|
|
2143
2284
|
* Initial processing activities to load
|
|
2144
2285
|
*/
|
|
@@ -2173,7 +2314,7 @@ declare interface UseLawfulBasisOptions {
|
|
|
2173
2314
|
onRemove?: (id: string) => void;
|
|
2174
2315
|
}
|
|
2175
2316
|
|
|
2176
|
-
declare interface UseLawfulBasisReturn {
|
|
2317
|
+
export declare interface UseLawfulBasisReturn {
|
|
2177
2318
|
/**
|
|
2178
2319
|
* All processing activities
|
|
2179
2320
|
*/
|
|
@@ -2209,11 +2350,27 @@ declare interface UseLawfulBasisReturn {
|
|
|
2209
2350
|
}
|
|
2210
2351
|
|
|
2211
2352
|
/**
|
|
2212
|
-
* Hook for generating NDPA-compliant privacy policies
|
|
2353
|
+
* Hook for generating NDPA-compliant privacy policies.
|
|
2354
|
+
*
|
|
2355
|
+
* @example
|
|
2356
|
+
* ```tsx
|
|
2357
|
+
* import { usePrivacyPolicy } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
2358
|
+
*
|
|
2359
|
+
* function PolicyBuilder({ templates }) {
|
|
2360
|
+
* const { policy, selectTemplate, generatePolicy } = usePrivacyPolicy({ templates });
|
|
2361
|
+
* return (
|
|
2362
|
+
* <div>
|
|
2363
|
+
* <button onClick={() => selectTemplate(templates[0].id)}>Select default</button>
|
|
2364
|
+
* <button onClick={generatePolicy}>Generate</button>
|
|
2365
|
+
* {policy && <pre>{policy.title}</pre>}
|
|
2366
|
+
* </div>
|
|
2367
|
+
* );
|
|
2368
|
+
* }
|
|
2369
|
+
* ```
|
|
2213
2370
|
*/
|
|
2214
2371
|
export declare function usePrivacyPolicy({ templates, initialPolicy, adapter, storageKey, persist, useLocalStorage, onGenerate, }: UsePrivacyPolicyOptions): UsePrivacyPolicyReturn;
|
|
2215
2372
|
|
|
2216
|
-
declare interface UsePrivacyPolicyOptions {
|
|
2373
|
+
export declare interface UsePrivacyPolicyOptions {
|
|
2217
2374
|
/**
|
|
2218
2375
|
* Available policy templates
|
|
2219
2376
|
*/
|
|
@@ -2253,7 +2410,7 @@ declare interface UsePrivacyPolicyOptions {
|
|
|
2253
2410
|
onGenerate?: (policy: PrivacyPolicy) => void;
|
|
2254
2411
|
}
|
|
2255
2412
|
|
|
2256
|
-
declare interface UsePrivacyPolicyReturn {
|
|
2413
|
+
export declare interface UsePrivacyPolicyReturn {
|
|
2257
2414
|
/**
|
|
2258
2415
|
* Current policy data
|
|
2259
2416
|
*/
|
|
@@ -2321,6 +2478,21 @@ declare interface UsePrivacyPolicyReturn {
|
|
|
2321
2478
|
*
|
|
2322
2479
|
* Provides state management and utility functions for maintaining
|
|
2323
2480
|
* a comprehensive register of all data processing activities.
|
|
2481
|
+
*
|
|
2482
|
+
* @example
|
|
2483
|
+
* ```tsx
|
|
2484
|
+
* import { useROPA } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
2485
|
+
*
|
|
2486
|
+
* function ROPARegister({ initialData }) {
|
|
2487
|
+
* const { ropa, addRecord, exportCSV } = useROPA({ initialData });
|
|
2488
|
+
* return (
|
|
2489
|
+
* <div>
|
|
2490
|
+
* <p>{ropa.records.length} processing records</p>
|
|
2491
|
+
* <button onClick={() => download(exportCSV())}>Export CSV</button>
|
|
2492
|
+
* </div>
|
|
2493
|
+
* );
|
|
2494
|
+
* }
|
|
2495
|
+
* ```
|
|
2324
2496
|
*/
|
|
2325
2497
|
export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, }: UseROPAOptions): UseROPAReturn;
|
|
2326
2498
|
|
|
@@ -2371,17 +2543,38 @@ export declare interface UseROPAReturn {
|
|
|
2371
2543
|
*/
|
|
2372
2544
|
getRecord: (id: string) => ProcessingRecord | undefined;
|
|
2373
2545
|
/**
|
|
2374
|
-
* Get a summary of the ROPA including statistics
|
|
2546
|
+
* Get a summary of the ROPA including statistics.
|
|
2547
|
+
* @deprecated Use the cached `summary` field instead — it is memoised on
|
|
2548
|
+
* `ropa` so consumers don't pay the recompute cost on every call.
|
|
2375
2549
|
*/
|
|
2376
2550
|
getSummary: () => ROPASummary;
|
|
2377
2551
|
/**
|
|
2378
|
-
* Export the ROPA as a CSV string
|
|
2552
|
+
* Export the ROPA as a CSV string.
|
|
2553
|
+
* @deprecated Use the cached `csv` field instead — it is memoised on
|
|
2554
|
+
* `ropa` so consumers don't pay the recompute cost on every call.
|
|
2379
2555
|
*/
|
|
2380
2556
|
exportCSV: () => string;
|
|
2381
2557
|
/**
|
|
2382
|
-
* Identify compliance gaps across all records
|
|
2558
|
+
* Identify compliance gaps across all records.
|
|
2559
|
+
* @deprecated Use the cached `complianceGaps` field instead — it is
|
|
2560
|
+
* memoised on `ropa` so consumers don't pay the recompute cost on every call.
|
|
2383
2561
|
*/
|
|
2384
2562
|
getComplianceGaps: () => ROPAComplianceGap[];
|
|
2563
|
+
/**
|
|
2564
|
+
* Memoised ROPA summary. Recomputed only when `ropa` changes.
|
|
2565
|
+
* Prefer this over `getSummary()` to avoid redundant recomputation.
|
|
2566
|
+
*/
|
|
2567
|
+
summary: ROPASummary;
|
|
2568
|
+
/**
|
|
2569
|
+
* Memoised CSV export string. Recomputed only when `ropa` changes.
|
|
2570
|
+
* Prefer this over `exportCSV()` to avoid redundant recomputation.
|
|
2571
|
+
*/
|
|
2572
|
+
csv: string;
|
|
2573
|
+
/**
|
|
2574
|
+
* Memoised compliance gap list. Recomputed only when `ropa` changes.
|
|
2575
|
+
* Prefer this over `getComplianceGaps()` to avoid redundant recomputation.
|
|
2576
|
+
*/
|
|
2577
|
+
complianceGaps: ROPAComplianceGap[];
|
|
2385
2578
|
/**
|
|
2386
2579
|
* Whether the adapter is still loading data (relevant for async adapters)
|
|
2387
2580
|
*/
|