@tantainnovative/ndpr-toolkit 5.5.1 → 5.6.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 +21 -0
- package/README.md +25 -0
- package/dist/chunk-675DXBED.mjs +1 -0
- package/dist/{chunk-QKXGVT2Q.js → chunk-GJH7YFBO.js} +1 -1
- package/dist/chunk-H3Q3I6XC.js +1 -0
- package/dist/chunk-LAAJVTUV.mjs +1 -0
- package/dist/{chunk-PQ5IPUJN.mjs → chunk-VXLOPB33.mjs} +1 -1
- package/dist/chunk-ZVWSSXV2.js +1 -0
- package/dist/consent.d.mts +88 -0
- package/dist/consent.d.ts +88 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +88 -0
- package/dist/core.d.ts +88 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/headless.d.mts +163 -0
- package/dist/headless.d.ts +163 -0
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +90 -0
- package/dist/hooks.d.ts +90 -0
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +105 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/server.d.mts +88 -0
- package/dist/server.d.ts +88 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-C5UYAOYX.mjs +0 -1
- package/dist/chunk-DKLJ5DYN.js +0 -1
- package/dist/chunk-R3ZKV2J7.mjs +0 -1
- package/dist/chunk-T32YQT4Y.js +0 -1
- /package/dist/{chunk-YQTZWPOS.mjs → chunk-23CULZBM.mjs} +0 -0
- /package/dist/{chunk-OVW5ASY3.js → chunk-VKDW2IHV.js} +0 -0
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkLP5KXMBY_js=require('./chunk-LP5KXMBY.js'),chunkNUOHT3LO_js=require('./chunk-NUOHT3LO.js'),chunkHCZDQWHY_js=require('./chunk-HCZDQWHY.js'),chunkVFRGCBJY_js=require('./chunk-VFRGCBJY.js'),chunk7TTXS7JX_js=require('./chunk-7TTXS7JX.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkY346CURW_js=require('./chunk-Y346CURW.js'),chunkD2ZKDQVL_js=require('./chunk-D2ZKDQVL.js'),chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),
|
|
1
|
+
'use strict';var chunkLP5KXMBY_js=require('./chunk-LP5KXMBY.js'),chunkNUOHT3LO_js=require('./chunk-NUOHT3LO.js'),chunkHCZDQWHY_js=require('./chunk-HCZDQWHY.js'),chunkVFRGCBJY_js=require('./chunk-VFRGCBJY.js'),chunk7TTXS7JX_js=require('./chunk-7TTXS7JX.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkY346CURW_js=require('./chunk-Y346CURW.js'),chunkD2ZKDQVL_js=require('./chunk-D2ZKDQVL.js'),chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkZVWSSXV2_js=require('./chunk-ZVWSSXV2.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkR2ZZMATR_js=require('./chunk-R2ZZMATR.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),chunk7563FVMY_js=require('./chunk-7563FVMY.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"arabicLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.e}});Object.defineProperty(exports,"frenchLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.f}});Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunkLP5KXMBY_js.a}});Object.defineProperty(exports,"ORG_POLICY_TEMPLATE_REGISTRY",{enumerable:true,get:function(){return chunkNUOHT3LO_js.a}});Object.defineProperty(exports,"createOrgTemplate",{enumerable:true,get:function(){return chunkNUOHT3LO_js.b}});Object.defineProperty(exports,"templateContextFor",{enumerable:true,get:function(){return chunkNUOHT3LO_js.b}});Object.defineProperty(exports,"formatNdprAuditReport",{enumerable:true,get:function(){return chunkHCZDQWHY_js.b}});Object.defineProperty(exports,"runNdprAudit",{enumerable:true,get:function(){return chunkHCZDQWHY_js.a}});Object.defineProperty(exports,"DEFAULT_DCPMI_FEES_NGN",{enumerable:true,get:function(){return chunkVFRGCBJY_js.b}});Object.defineProperty(exports,"DEFAULT_DCPMI_THRESHOLDS",{enumerable:true,get:function(){return chunkVFRGCBJY_js.a}});Object.defineProperty(exports,"classifyDCPMI",{enumerable:true,get:function(){return chunkVFRGCBJY_js.c}});Object.defineProperty(exports,"generateComplianceAuditReturn",{enumerable:true,get:function(){return chunkVFRGCBJY_js.d}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunk7TTXS7JX_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"assessBreachNotification",{enumerable:true,get:function(){return chunkY346CURW_js.a}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.b}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunk6LJHLE6G_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunk6LJHLE6G_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunk6LJHLE6G_js.f}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_js.a}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"KNOWN_COOKIES",{enumerable:true,get:function(){return chunkZVWSSXV2_js.c}});Object.defineProperty(exports,"scanCookies",{enumerable:true,get:function(){return chunkZVWSSXV2_js.d}});Object.defineProperty(exports,"validateConsentOptionsStructured",{enumerable:true,get:function(){return chunkZVWSSXV2_js.b}});Object.defineProperty(exports,"validateConsentStructured",{enumerable:true,get:function(){return chunkZVWSSXV2_js.a}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"formatDSRRequestStructured",{enumerable:true,get:function(){return chunkR2ZZMATR_js.b}});Object.defineProperty(exports,"validateDsrSubmissionStructured",{enumerable:true,get:function(){return chunkR2ZZMATR_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});Object.defineProperty(exports,"NDPRProvider",{enumerable:true,get:function(){return chunkI5ZDNSX5_js.a}});Object.defineProperty(exports,"useNDPRConfig",{enumerable:true,get:function(){return chunkI5ZDNSX5_js.b}});Object.defineProperty(exports,"useNDPRLocale",{enumerable:true,get:function(){return chunkI5ZDNSX5_js.c}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunk7563FVMY_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunk7563FVMY_js.b}});
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{e as arabicLocale,f as frenchLocale,c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-KUI5W44P.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-CWY2FMIC.mjs';export{b as formatNdprAuditReport,a as runNdprAudit}from'./chunk-ME77GU4Q.mjs';export{b as DEFAULT_DCPMI_FEES_NGN,a as DEFAULT_DCPMI_THRESHOLDS,c as classifyDCPMI,d as generateComplianceAuditReturn}from'./chunk-MGXWQW5I.mjs';export{a as getComplianceScore}from'./chunk-6A7M4CGJ.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{a as assessBreachNotification}from'./chunk-WJSUVPYX.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-NBQQ2GN3.mjs';export{c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-BIJSMSUU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{b as validateConsentOptionsStructured,a as validateConsentStructured}from'./chunk-
|
|
1
|
+
export{e as arabicLocale,f as frenchLocale,c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-KUI5W44P.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-CWY2FMIC.mjs';export{b as formatNdprAuditReport,a as runNdprAudit}from'./chunk-ME77GU4Q.mjs';export{b as DEFAULT_DCPMI_FEES_NGN,a as DEFAULT_DCPMI_THRESHOLDS,c as classifyDCPMI,d as generateComplianceAuditReturn}from'./chunk-MGXWQW5I.mjs';export{a as getComplianceScore}from'./chunk-6A7M4CGJ.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{a as assessBreachNotification}from'./chunk-WJSUVPYX.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-NBQQ2GN3.mjs';export{c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-BIJSMSUU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{c as KNOWN_COOKIES,d as scanCookies,b as validateConsentOptionsStructured,a as validateConsentStructured}from'./chunk-675DXBED.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as formatDSRRequestStructured,a as validateDsrSubmissionStructured}from'./chunk-RRVML7CU.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';export{a as NDPRProvider,b as useNDPRConfig,c as useNDPRLocale}from'./chunk-PHA3YMFO.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-5LJ652AH.mjs';import'./chunk-ZJYULEER.mjs';
|
package/dist/headless.d.mts
CHANGED
|
@@ -794,6 +794,82 @@ export declare interface ConsentStorageOptions {
|
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
+
/** How a present cookie was classified. */
|
|
798
|
+
export declare type CookieMatchSource = 'declared' | 'known' | 'none';
|
|
799
|
+
|
|
800
|
+
/** How a present cookie was classified. */
|
|
801
|
+
declare type CookieMatchSource_2 = 'declared' | 'known' | 'none';
|
|
802
|
+
|
|
803
|
+
export declare interface CookieScanOptions {
|
|
804
|
+
/**
|
|
805
|
+
* The cookie string to scan, in `document.cookie` form (`a=1; b=2`).
|
|
806
|
+
* Defaults to `document.cookie` in the browser, or `''` on the server.
|
|
807
|
+
*/
|
|
808
|
+
cookieString?: string;
|
|
809
|
+
/** Reference timestamp (epoch ms) recorded on the result. Defaults to `Date.now()`. */
|
|
810
|
+
asOf?: number;
|
|
811
|
+
/** Extra known cookies, checked before the built-in registry (so they can override it). */
|
|
812
|
+
knownCookies?: DeclaredCookie[];
|
|
813
|
+
/** Whether to fall back to the built-in known-cookie registry for undeclared cookies. @default true */
|
|
814
|
+
useKnownRegistry?: boolean;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
declare interface CookieScanOptions_2 {
|
|
818
|
+
/**
|
|
819
|
+
* The cookie string to scan, in `document.cookie` form (`a=1; b=2`).
|
|
820
|
+
* Defaults to `document.cookie` in the browser, or `''` on the server.
|
|
821
|
+
*/
|
|
822
|
+
cookieString?: string;
|
|
823
|
+
/** Reference timestamp (epoch ms) recorded on the result. Defaults to `Date.now()`. */
|
|
824
|
+
asOf?: number;
|
|
825
|
+
/** Extra known cookies, checked before the built-in registry (so they can override it). */
|
|
826
|
+
knownCookies?: DeclaredCookie_2[];
|
|
827
|
+
/** Whether to fall back to the built-in known-cookie registry for undeclared cookies. @default true */
|
|
828
|
+
useKnownRegistry?: boolean;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export declare interface CookieScanResult {
|
|
832
|
+
/** When the scan ran (epoch ms). */
|
|
833
|
+
scannedAt: number;
|
|
834
|
+
/** Number of cookies present. */
|
|
835
|
+
total: number;
|
|
836
|
+
/** Every present cookie, classified. */
|
|
837
|
+
cookies: ScannedCookie[];
|
|
838
|
+
/** Cookies that matched one of your declared cookies. */
|
|
839
|
+
declared: ScannedCookie[];
|
|
840
|
+
/** Cookies present but NOT in your declaration — the compliance gap. */
|
|
841
|
+
undeclared: ScannedCookie[];
|
|
842
|
+
/** Undeclared cookies the built-in registry could still identify. */
|
|
843
|
+
identified: ScannedCookie[];
|
|
844
|
+
/** Undeclared cookies that could not be identified at all. */
|
|
845
|
+
unknown: ScannedCookie[];
|
|
846
|
+
/** Present cookies grouped by resolved category; unclassified cookies go under `uncategorized`. */
|
|
847
|
+
byCategory: Record<string, ScannedCookie[]>;
|
|
848
|
+
/** True when there are no undeclared cookies. */
|
|
849
|
+
complete: boolean;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
declare interface CookieScanResult_2 {
|
|
853
|
+
/** When the scan ran (epoch ms). */
|
|
854
|
+
scannedAt: number;
|
|
855
|
+
/** Number of cookies present. */
|
|
856
|
+
total: number;
|
|
857
|
+
/** Every present cookie, classified. */
|
|
858
|
+
cookies: ScannedCookie_2[];
|
|
859
|
+
/** Cookies that matched one of your declared cookies. */
|
|
860
|
+
declared: ScannedCookie_2[];
|
|
861
|
+
/** Cookies present but NOT in your declaration — the compliance gap. */
|
|
862
|
+
undeclared: ScannedCookie_2[];
|
|
863
|
+
/** Undeclared cookies the built-in registry could still identify. */
|
|
864
|
+
identified: ScannedCookie_2[];
|
|
865
|
+
/** Undeclared cookies that could not be identified at all. */
|
|
866
|
+
unknown: ScannedCookie_2[];
|
|
867
|
+
/** Present cookies grouped by resolved category; unclassified cookies go under `uncategorized`. */
|
|
868
|
+
byCategory: Record<string, ScannedCookie_2[]>;
|
|
869
|
+
/** True when there are no undeclared cookies. */
|
|
870
|
+
complete: boolean;
|
|
871
|
+
}
|
|
872
|
+
|
|
797
873
|
/**
|
|
798
874
|
* Summary of cross-border transfer compliance
|
|
799
875
|
*/
|
|
@@ -1061,6 +1137,54 @@ declare type DCPMITier = 'UHL' | 'EHL' | 'OHL' | 'listed' | 'none';
|
|
|
1061
1137
|
*/
|
|
1062
1138
|
declare type DCPMITier_2 = 'UHL' | 'EHL' | 'OHL' | 'listed' | 'none';
|
|
1063
1139
|
|
|
1140
|
+
/**
|
|
1141
|
+
* Cookie scanner — audits the cookies actually present in the browser against
|
|
1142
|
+
* the cookies you have declared, surfacing undeclared cookies that put you out
|
|
1143
|
+
* of step with your cookie notice (NDPA 2023 S.25-26 / NDPC GAID 2025 on
|
|
1144
|
+
* specific, informed consent).
|
|
1145
|
+
*
|
|
1146
|
+
* Pure and DOM-optional: pass `cookieString` to scan an arbitrary value (a
|
|
1147
|
+
* `Cookie:` header on the server, a test fixture), or call it in the browser
|
|
1148
|
+
* and it reads `document.cookie`. Safe to import from a server bundle.
|
|
1149
|
+
*/
|
|
1150
|
+
/** A cookie you declare against a consent category. */
|
|
1151
|
+
export declare interface DeclaredCookie {
|
|
1152
|
+
/** Exact cookie name, a prefix (with `prefix: true`), or a RegExp matched against the name. */
|
|
1153
|
+
name: string | RegExp;
|
|
1154
|
+
/** Consent category this cookie belongs to (e.g. 'necessary', 'analytics', 'marketing'). */
|
|
1155
|
+
category: string;
|
|
1156
|
+
/** Who sets the cookie (e.g. 'Google Analytics'). */
|
|
1157
|
+
provider?: string;
|
|
1158
|
+
/** What the cookie is used for — surfaced in your cookie policy. */
|
|
1159
|
+
purpose?: string;
|
|
1160
|
+
/** Treat a string `name` as a prefix match instead of an exact match. Ignored for RegExp names. */
|
|
1161
|
+
prefix?: boolean;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Cookie scanner — audits the cookies actually present in the browser against
|
|
1166
|
+
* the cookies you have declared, surfacing undeclared cookies that put you out
|
|
1167
|
+
* of step with your cookie notice (NDPA 2023 S.25-26 / NDPC GAID 2025 on
|
|
1168
|
+
* specific, informed consent).
|
|
1169
|
+
*
|
|
1170
|
+
* Pure and DOM-optional: pass `cookieString` to scan an arbitrary value (a
|
|
1171
|
+
* `Cookie:` header on the server, a test fixture), or call it in the browser
|
|
1172
|
+
* and it reads `document.cookie`. Safe to import from a server bundle.
|
|
1173
|
+
*/
|
|
1174
|
+
/** A cookie you declare against a consent category. */
|
|
1175
|
+
declare interface DeclaredCookie_2 {
|
|
1176
|
+
/** Exact cookie name, a prefix (with `prefix: true`), or a RegExp matched against the name. */
|
|
1177
|
+
name: string | RegExp;
|
|
1178
|
+
/** Consent category this cookie belongs to (e.g. 'necessary', 'analytics', 'marketing'). */
|
|
1179
|
+
category: string;
|
|
1180
|
+
/** Who sets the cookie (e.g. 'Google Analytics'). */
|
|
1181
|
+
provider?: string;
|
|
1182
|
+
/** What the cookie is used for — surfaced in your cookie policy. */
|
|
1183
|
+
purpose?: string;
|
|
1184
|
+
/** Treat a string `name` as a prefix match instead of an exact match. Ignored for RegExp names. */
|
|
1185
|
+
prefix?: boolean;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1064
1188
|
/** Options for DOCX export of the finalised policy. */
|
|
1065
1189
|
declare interface DOCXExportOptions {
|
|
1066
1190
|
includeTOC?: boolean;
|
|
@@ -2073,6 +2197,28 @@ export declare interface ROPASummary {
|
|
|
2073
2197
|
lastUpdated: number;
|
|
2074
2198
|
}
|
|
2075
2199
|
|
|
2200
|
+
export declare interface ScannedCookie {
|
|
2201
|
+
/** The cookie name as found in the cookie string. */
|
|
2202
|
+
name: string;
|
|
2203
|
+
/** Resolved consent category, or `null` when it could not be classified. */
|
|
2204
|
+
category: string | null;
|
|
2205
|
+
/** Whether it matched your declaration, only the known registry, or nothing. */
|
|
2206
|
+
matchedBy: CookieMatchSource;
|
|
2207
|
+
provider?: string;
|
|
2208
|
+
purpose?: string;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
declare interface ScannedCookie_2 {
|
|
2212
|
+
/** The cookie name as found in the cookie string. */
|
|
2213
|
+
name: string;
|
|
2214
|
+
/** Resolved consent category, or `null` when it could not be classified. */
|
|
2215
|
+
category: string | null;
|
|
2216
|
+
/** Whether it matched your declaration, only the known registry, or nothing. */
|
|
2217
|
+
matchedBy: CookieMatchSource_2;
|
|
2218
|
+
provider?: string;
|
|
2219
|
+
purpose?: string;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2076
2222
|
/**
|
|
2077
2223
|
* Additional conditions required for processing sensitive personal data
|
|
2078
2224
|
* per NDPA Section 30
|
|
@@ -2505,6 +2651,23 @@ export declare interface UseConsentReturn {
|
|
|
2505
2651
|
isLoading: boolean;
|
|
2506
2652
|
}
|
|
2507
2653
|
|
|
2654
|
+
/**
|
|
2655
|
+
* React hook that scans `document.cookie` against your declared cookies on
|
|
2656
|
+
* mount and exposes a `rescan()` to re-run after you set or clear cookies.
|
|
2657
|
+
*
|
|
2658
|
+
* `result` is `null` until the first client-side scan, so server and first
|
|
2659
|
+
* client render agree (no hydration mismatch). `rescan` is stable and always
|
|
2660
|
+
* reads the latest `declared`/`options` — callers don't need to memoise them.
|
|
2661
|
+
*/
|
|
2662
|
+
export declare function useCookieScan(declared?: DeclaredCookie_2[], options?: CookieScanOptions_2): UseCookieScanReturn;
|
|
2663
|
+
|
|
2664
|
+
export declare interface UseCookieScanReturn {
|
|
2665
|
+
/** The latest scan, or `null` before the first client-side scan (e.g. during SSR). */
|
|
2666
|
+
result: CookieScanResult_2 | null;
|
|
2667
|
+
/** Re-read the cookies and recompute the scan with the current arguments. */
|
|
2668
|
+
rescan: () => void;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2508
2671
|
/**
|
|
2509
2672
|
* Hook for managing cross-border data transfers in compliance with NDPA Part VIII (Sections 41-43).
|
|
2510
2673
|
*
|
package/dist/headless.d.ts
CHANGED
|
@@ -794,6 +794,82 @@ export declare interface ConsentStorageOptions {
|
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
+
/** How a present cookie was classified. */
|
|
798
|
+
export declare type CookieMatchSource = 'declared' | 'known' | 'none';
|
|
799
|
+
|
|
800
|
+
/** How a present cookie was classified. */
|
|
801
|
+
declare type CookieMatchSource_2 = 'declared' | 'known' | 'none';
|
|
802
|
+
|
|
803
|
+
export declare interface CookieScanOptions {
|
|
804
|
+
/**
|
|
805
|
+
* The cookie string to scan, in `document.cookie` form (`a=1; b=2`).
|
|
806
|
+
* Defaults to `document.cookie` in the browser, or `''` on the server.
|
|
807
|
+
*/
|
|
808
|
+
cookieString?: string;
|
|
809
|
+
/** Reference timestamp (epoch ms) recorded on the result. Defaults to `Date.now()`. */
|
|
810
|
+
asOf?: number;
|
|
811
|
+
/** Extra known cookies, checked before the built-in registry (so they can override it). */
|
|
812
|
+
knownCookies?: DeclaredCookie[];
|
|
813
|
+
/** Whether to fall back to the built-in known-cookie registry for undeclared cookies. @default true */
|
|
814
|
+
useKnownRegistry?: boolean;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
declare interface CookieScanOptions_2 {
|
|
818
|
+
/**
|
|
819
|
+
* The cookie string to scan, in `document.cookie` form (`a=1; b=2`).
|
|
820
|
+
* Defaults to `document.cookie` in the browser, or `''` on the server.
|
|
821
|
+
*/
|
|
822
|
+
cookieString?: string;
|
|
823
|
+
/** Reference timestamp (epoch ms) recorded on the result. Defaults to `Date.now()`. */
|
|
824
|
+
asOf?: number;
|
|
825
|
+
/** Extra known cookies, checked before the built-in registry (so they can override it). */
|
|
826
|
+
knownCookies?: DeclaredCookie_2[];
|
|
827
|
+
/** Whether to fall back to the built-in known-cookie registry for undeclared cookies. @default true */
|
|
828
|
+
useKnownRegistry?: boolean;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export declare interface CookieScanResult {
|
|
832
|
+
/** When the scan ran (epoch ms). */
|
|
833
|
+
scannedAt: number;
|
|
834
|
+
/** Number of cookies present. */
|
|
835
|
+
total: number;
|
|
836
|
+
/** Every present cookie, classified. */
|
|
837
|
+
cookies: ScannedCookie[];
|
|
838
|
+
/** Cookies that matched one of your declared cookies. */
|
|
839
|
+
declared: ScannedCookie[];
|
|
840
|
+
/** Cookies present but NOT in your declaration — the compliance gap. */
|
|
841
|
+
undeclared: ScannedCookie[];
|
|
842
|
+
/** Undeclared cookies the built-in registry could still identify. */
|
|
843
|
+
identified: ScannedCookie[];
|
|
844
|
+
/** Undeclared cookies that could not be identified at all. */
|
|
845
|
+
unknown: ScannedCookie[];
|
|
846
|
+
/** Present cookies grouped by resolved category; unclassified cookies go under `uncategorized`. */
|
|
847
|
+
byCategory: Record<string, ScannedCookie[]>;
|
|
848
|
+
/** True when there are no undeclared cookies. */
|
|
849
|
+
complete: boolean;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
declare interface CookieScanResult_2 {
|
|
853
|
+
/** When the scan ran (epoch ms). */
|
|
854
|
+
scannedAt: number;
|
|
855
|
+
/** Number of cookies present. */
|
|
856
|
+
total: number;
|
|
857
|
+
/** Every present cookie, classified. */
|
|
858
|
+
cookies: ScannedCookie_2[];
|
|
859
|
+
/** Cookies that matched one of your declared cookies. */
|
|
860
|
+
declared: ScannedCookie_2[];
|
|
861
|
+
/** Cookies present but NOT in your declaration — the compliance gap. */
|
|
862
|
+
undeclared: ScannedCookie_2[];
|
|
863
|
+
/** Undeclared cookies the built-in registry could still identify. */
|
|
864
|
+
identified: ScannedCookie_2[];
|
|
865
|
+
/** Undeclared cookies that could not be identified at all. */
|
|
866
|
+
unknown: ScannedCookie_2[];
|
|
867
|
+
/** Present cookies grouped by resolved category; unclassified cookies go under `uncategorized`. */
|
|
868
|
+
byCategory: Record<string, ScannedCookie_2[]>;
|
|
869
|
+
/** True when there are no undeclared cookies. */
|
|
870
|
+
complete: boolean;
|
|
871
|
+
}
|
|
872
|
+
|
|
797
873
|
/**
|
|
798
874
|
* Summary of cross-border transfer compliance
|
|
799
875
|
*/
|
|
@@ -1061,6 +1137,54 @@ declare type DCPMITier = 'UHL' | 'EHL' | 'OHL' | 'listed' | 'none';
|
|
|
1061
1137
|
*/
|
|
1062
1138
|
declare type DCPMITier_2 = 'UHL' | 'EHL' | 'OHL' | 'listed' | 'none';
|
|
1063
1139
|
|
|
1140
|
+
/**
|
|
1141
|
+
* Cookie scanner — audits the cookies actually present in the browser against
|
|
1142
|
+
* the cookies you have declared, surfacing undeclared cookies that put you out
|
|
1143
|
+
* of step with your cookie notice (NDPA 2023 S.25-26 / NDPC GAID 2025 on
|
|
1144
|
+
* specific, informed consent).
|
|
1145
|
+
*
|
|
1146
|
+
* Pure and DOM-optional: pass `cookieString` to scan an arbitrary value (a
|
|
1147
|
+
* `Cookie:` header on the server, a test fixture), or call it in the browser
|
|
1148
|
+
* and it reads `document.cookie`. Safe to import from a server bundle.
|
|
1149
|
+
*/
|
|
1150
|
+
/** A cookie you declare against a consent category. */
|
|
1151
|
+
export declare interface DeclaredCookie {
|
|
1152
|
+
/** Exact cookie name, a prefix (with `prefix: true`), or a RegExp matched against the name. */
|
|
1153
|
+
name: string | RegExp;
|
|
1154
|
+
/** Consent category this cookie belongs to (e.g. 'necessary', 'analytics', 'marketing'). */
|
|
1155
|
+
category: string;
|
|
1156
|
+
/** Who sets the cookie (e.g. 'Google Analytics'). */
|
|
1157
|
+
provider?: string;
|
|
1158
|
+
/** What the cookie is used for — surfaced in your cookie policy. */
|
|
1159
|
+
purpose?: string;
|
|
1160
|
+
/** Treat a string `name` as a prefix match instead of an exact match. Ignored for RegExp names. */
|
|
1161
|
+
prefix?: boolean;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Cookie scanner — audits the cookies actually present in the browser against
|
|
1166
|
+
* the cookies you have declared, surfacing undeclared cookies that put you out
|
|
1167
|
+
* of step with your cookie notice (NDPA 2023 S.25-26 / NDPC GAID 2025 on
|
|
1168
|
+
* specific, informed consent).
|
|
1169
|
+
*
|
|
1170
|
+
* Pure and DOM-optional: pass `cookieString` to scan an arbitrary value (a
|
|
1171
|
+
* `Cookie:` header on the server, a test fixture), or call it in the browser
|
|
1172
|
+
* and it reads `document.cookie`. Safe to import from a server bundle.
|
|
1173
|
+
*/
|
|
1174
|
+
/** A cookie you declare against a consent category. */
|
|
1175
|
+
declare interface DeclaredCookie_2 {
|
|
1176
|
+
/** Exact cookie name, a prefix (with `prefix: true`), or a RegExp matched against the name. */
|
|
1177
|
+
name: string | RegExp;
|
|
1178
|
+
/** Consent category this cookie belongs to (e.g. 'necessary', 'analytics', 'marketing'). */
|
|
1179
|
+
category: string;
|
|
1180
|
+
/** Who sets the cookie (e.g. 'Google Analytics'). */
|
|
1181
|
+
provider?: string;
|
|
1182
|
+
/** What the cookie is used for — surfaced in your cookie policy. */
|
|
1183
|
+
purpose?: string;
|
|
1184
|
+
/** Treat a string `name` as a prefix match instead of an exact match. Ignored for RegExp names. */
|
|
1185
|
+
prefix?: boolean;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1064
1188
|
/** Options for DOCX export of the finalised policy. */
|
|
1065
1189
|
declare interface DOCXExportOptions {
|
|
1066
1190
|
includeTOC?: boolean;
|
|
@@ -2073,6 +2197,28 @@ export declare interface ROPASummary {
|
|
|
2073
2197
|
lastUpdated: number;
|
|
2074
2198
|
}
|
|
2075
2199
|
|
|
2200
|
+
export declare interface ScannedCookie {
|
|
2201
|
+
/** The cookie name as found in the cookie string. */
|
|
2202
|
+
name: string;
|
|
2203
|
+
/** Resolved consent category, or `null` when it could not be classified. */
|
|
2204
|
+
category: string | null;
|
|
2205
|
+
/** Whether it matched your declaration, only the known registry, or nothing. */
|
|
2206
|
+
matchedBy: CookieMatchSource;
|
|
2207
|
+
provider?: string;
|
|
2208
|
+
purpose?: string;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
declare interface ScannedCookie_2 {
|
|
2212
|
+
/** The cookie name as found in the cookie string. */
|
|
2213
|
+
name: string;
|
|
2214
|
+
/** Resolved consent category, or `null` when it could not be classified. */
|
|
2215
|
+
category: string | null;
|
|
2216
|
+
/** Whether it matched your declaration, only the known registry, or nothing. */
|
|
2217
|
+
matchedBy: CookieMatchSource_2;
|
|
2218
|
+
provider?: string;
|
|
2219
|
+
purpose?: string;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2076
2222
|
/**
|
|
2077
2223
|
* Additional conditions required for processing sensitive personal data
|
|
2078
2224
|
* per NDPA Section 30
|
|
@@ -2505,6 +2651,23 @@ export declare interface UseConsentReturn {
|
|
|
2505
2651
|
isLoading: boolean;
|
|
2506
2652
|
}
|
|
2507
2653
|
|
|
2654
|
+
/**
|
|
2655
|
+
* React hook that scans `document.cookie` against your declared cookies on
|
|
2656
|
+
* mount and exposes a `rescan()` to re-run after you set or clear cookies.
|
|
2657
|
+
*
|
|
2658
|
+
* `result` is `null` until the first client-side scan, so server and first
|
|
2659
|
+
* client render agree (no hydration mismatch). `rescan` is stable and always
|
|
2660
|
+
* reads the latest `declared`/`options` — callers don't need to memoise them.
|
|
2661
|
+
*/
|
|
2662
|
+
export declare function useCookieScan(declared?: DeclaredCookie_2[], options?: CookieScanOptions_2): UseCookieScanReturn;
|
|
2663
|
+
|
|
2664
|
+
export declare interface UseCookieScanReturn {
|
|
2665
|
+
/** The latest scan, or `null` before the first client-side scan (e.g. during SSR). */
|
|
2666
|
+
result: CookieScanResult_2 | null;
|
|
2667
|
+
/** Re-read the cookies and recompute the scan with the current arguments. */
|
|
2668
|
+
rescan: () => void;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2508
2671
|
/**
|
|
2509
2672
|
* Hook for managing cross-border data transfers in compliance with NDPA Part VIII (Sections 41-43).
|
|
2510
2673
|
*
|
package/dist/headless.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';require('./chunk-
|
|
2
|
+
'use strict';require('./chunk-VKDW2IHV.js');var chunkH3Q3I6XC_js=require('./chunk-H3Q3I6XC.js'),chunkEHQVTFYO_js=require('./chunk-EHQVTFYO.js'),chunkRC3XFXTJ_js=require('./chunk-RC3XFXTJ.js'),chunkQHW4UKGJ_js=require('./chunk-QHW4UKGJ.js'),chunkIRRUYR6M_js=require('./chunk-IRRUYR6M.js'),chunkHHK5LHEG_js=require('./chunk-HHK5LHEG.js'),chunkTLIHFGIJ_js=require('./chunk-TLIHFGIJ.js');require('./chunk-JS7SYL5P.js'),require('./chunk-VFRGCBJY.js'),require('./chunk-7TTXS7JX.js'),require('./chunk-3YTAOT5O.js'),require('./chunk-Y346CURW.js'),require('./chunk-D2ZKDQVL.js'),require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js');var chunkGJH7YFBO_js=require('./chunk-GJH7YFBO.js'),chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js');require('./chunk-C2KEXHRX.js'),require('./chunk-ZVWSSXV2.js');var chunkTVA6D6S4_js=require('./chunk-TVA6D6S4.js');require('./chunk-R2ZZMATR.js');var chunkJLQT3W3E_js=require('./chunk-JLQT3W3E.js');require('./chunk-TQZWJGJ2.js'),require('./chunk-ZVOIR4QH.js'),require('./chunk-VWED6UTN.js'),require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"useBreachNotificationAssessment",{enumerable:true,get:function(){return chunkH3Q3I6XC_js.a}});Object.defineProperty(exports,"useComplianceAuditReturn",{enumerable:true,get:function(){return chunkH3Q3I6XC_js.e}});Object.defineProperty(exports,"useComplianceScore",{enumerable:true,get:function(){return chunkH3Q3I6XC_js.b}});Object.defineProperty(exports,"useCookieScan",{enumerable:true,get:function(){return chunkH3Q3I6XC_js.d}});Object.defineProperty(exports,"useDCPMI",{enumerable:true,get:function(){return chunkH3Q3I6XC_js.c}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkEHQVTFYO_js.a}});Object.defineProperty(exports,"useDefaultPrivacyPolicy",{enumerable:true,get:function(){return chunkRC3XFXTJ_js.b}});Object.defineProperty(exports,"usePrivacyPolicy",{enumerable:true,get:function(){return chunkRC3XFXTJ_js.a}});Object.defineProperty(exports,"useAdaptivePolicyWizard",{enumerable:true,get:function(){return chunkQHW4UKGJ_js.a}});Object.defineProperty(exports,"useLawfulBasis",{enumerable:true,get:function(){return chunkIRRUYR6M_js.a}});Object.defineProperty(exports,"useCrossBorderTransfer",{enumerable:true,get:function(){return chunkHHK5LHEG_js.a}});Object.defineProperty(exports,"useROPA",{enumerable:true,get:function(){return chunkTLIHFGIJ_js.a}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunkGJH7YFBO_js.a}});Object.defineProperty(exports,"useFocusTrap",{enumerable:true,get:function(){return chunkL2VO3MEJ_js.a}});Object.defineProperty(exports,"useDSR",{enumerable:true,get:function(){return chunkTVA6D6S4_js.a}});Object.defineProperty(exports,"useDPIA",{enumerable:true,get:function(){return chunkJLQT3W3E_js.a}});
|
package/dist/headless.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import'./chunk-
|
|
2
|
+
import'./chunk-23CULZBM.mjs';export{a as useBreachNotificationAssessment,e as useComplianceAuditReturn,b as useComplianceScore,d as useCookieScan,c as useDCPMI}from'./chunk-LAAJVTUV.mjs';export{a as useBreach}from'./chunk-RFXGD5NE.mjs';export{b as useDefaultPrivacyPolicy,a as usePrivacyPolicy}from'./chunk-UVXS7KRV.mjs';export{a as useAdaptivePolicyWizard}from'./chunk-KE2FZH2V.mjs';export{a as useLawfulBasis}from'./chunk-B6BRD5SL.mjs';export{a as useCrossBorderTransfer}from'./chunk-KDAZQO3N.mjs';export{a as useROPA}from'./chunk-FRMVSG4N.mjs';import'./chunk-IVSNHT24.mjs';import'./chunk-MGXWQW5I.mjs';import'./chunk-6A7M4CGJ.mjs';import'./chunk-WTGKZX7J.mjs';import'./chunk-WJSUVPYX.mjs';import'./chunk-NBQQ2GN3.mjs';import'./chunk-BIJSMSUU.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';export{a as useConsent}from'./chunk-VXLOPB33.mjs';export{a as useFocusTrap}from'./chunk-YTU4FNM2.mjs';import'./chunk-XC3DLYEG.mjs';import'./chunk-675DXBED.mjs';export{a as useDSR}from'./chunk-ZSRO4L3C.mjs';import'./chunk-RRVML7CU.mjs';export{a as useDPIA}from'./chunk-I3V3ITN7.mjs';import'./chunk-LRRENTT5.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-DBZSN4WP.mjs';import'./chunk-ZJYULEER.mjs';
|
package/dist/hooks.d.mts
CHANGED
|
@@ -478,6 +478,44 @@ export declare interface ConsentStorageOptions {
|
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
/** How a present cookie was classified. */
|
|
482
|
+
export declare type CookieMatchSource = 'declared' | 'known' | 'none';
|
|
483
|
+
|
|
484
|
+
export declare interface CookieScanOptions {
|
|
485
|
+
/**
|
|
486
|
+
* The cookie string to scan, in `document.cookie` form (`a=1; b=2`).
|
|
487
|
+
* Defaults to `document.cookie` in the browser, or `''` on the server.
|
|
488
|
+
*/
|
|
489
|
+
cookieString?: string;
|
|
490
|
+
/** Reference timestamp (epoch ms) recorded on the result. Defaults to `Date.now()`. */
|
|
491
|
+
asOf?: number;
|
|
492
|
+
/** Extra known cookies, checked before the built-in registry (so they can override it). */
|
|
493
|
+
knownCookies?: DeclaredCookie[];
|
|
494
|
+
/** Whether to fall back to the built-in known-cookie registry for undeclared cookies. @default true */
|
|
495
|
+
useKnownRegistry?: boolean;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export declare interface CookieScanResult {
|
|
499
|
+
/** When the scan ran (epoch ms). */
|
|
500
|
+
scannedAt: number;
|
|
501
|
+
/** Number of cookies present. */
|
|
502
|
+
total: number;
|
|
503
|
+
/** Every present cookie, classified. */
|
|
504
|
+
cookies: ScannedCookie[];
|
|
505
|
+
/** Cookies that matched one of your declared cookies. */
|
|
506
|
+
declared: ScannedCookie[];
|
|
507
|
+
/** Cookies present but NOT in your declaration — the compliance gap. */
|
|
508
|
+
undeclared: ScannedCookie[];
|
|
509
|
+
/** Undeclared cookies the built-in registry could still identify. */
|
|
510
|
+
identified: ScannedCookie[];
|
|
511
|
+
/** Undeclared cookies that could not be identified at all. */
|
|
512
|
+
unknown: ScannedCookie[];
|
|
513
|
+
/** Present cookies grouped by resolved category; unclassified cookies go under `uncategorized`. */
|
|
514
|
+
byCategory: Record<string, ScannedCookie[]>;
|
|
515
|
+
/** True when there are no undeclared cookies. */
|
|
516
|
+
complete: boolean;
|
|
517
|
+
}
|
|
518
|
+
|
|
481
519
|
/**
|
|
482
520
|
* Summary of cross-border transfer compliance
|
|
483
521
|
*/
|
|
@@ -667,6 +705,30 @@ declare interface DCPMIThresholds {
|
|
|
667
705
|
*/
|
|
668
706
|
declare type DCPMITier = 'UHL' | 'EHL' | 'OHL' | 'listed' | 'none';
|
|
669
707
|
|
|
708
|
+
/**
|
|
709
|
+
* Cookie scanner — audits the cookies actually present in the browser against
|
|
710
|
+
* the cookies you have declared, surfacing undeclared cookies that put you out
|
|
711
|
+
* of step with your cookie notice (NDPA 2023 S.25-26 / NDPC GAID 2025 on
|
|
712
|
+
* specific, informed consent).
|
|
713
|
+
*
|
|
714
|
+
* Pure and DOM-optional: pass `cookieString` to scan an arbitrary value (a
|
|
715
|
+
* `Cookie:` header on the server, a test fixture), or call it in the browser
|
|
716
|
+
* and it reads `document.cookie`. Safe to import from a server bundle.
|
|
717
|
+
*/
|
|
718
|
+
/** A cookie you declare against a consent category. */
|
|
719
|
+
export declare interface DeclaredCookie {
|
|
720
|
+
/** Exact cookie name, a prefix (with `prefix: true`), or a RegExp matched against the name. */
|
|
721
|
+
name: string | RegExp;
|
|
722
|
+
/** Consent category this cookie belongs to (e.g. 'necessary', 'analytics', 'marketing'). */
|
|
723
|
+
category: string;
|
|
724
|
+
/** Who sets the cookie (e.g. 'Google Analytics'). */
|
|
725
|
+
provider?: string;
|
|
726
|
+
/** What the cookie is used for — surfaced in your cookie policy. */
|
|
727
|
+
purpose?: string;
|
|
728
|
+
/** Treat a string `name` as a prefix match instead of an exact match. Ignored for RegExp names. */
|
|
729
|
+
prefix?: boolean;
|
|
730
|
+
}
|
|
731
|
+
|
|
670
732
|
/** Options for DOCX export of the finalised policy. */
|
|
671
733
|
declare interface DOCXExportOptions {
|
|
672
734
|
includeTOC?: boolean;
|
|
@@ -1555,6 +1617,17 @@ export declare interface ROPASummary {
|
|
|
1555
1617
|
lastUpdated: number;
|
|
1556
1618
|
}
|
|
1557
1619
|
|
|
1620
|
+
export declare interface ScannedCookie {
|
|
1621
|
+
/** The cookie name as found in the cookie string. */
|
|
1622
|
+
name: string;
|
|
1623
|
+
/** Resolved consent category, or `null` when it could not be classified. */
|
|
1624
|
+
category: string | null;
|
|
1625
|
+
/** Whether it matched your declaration, only the known registry, or nothing. */
|
|
1626
|
+
matchedBy: CookieMatchSource;
|
|
1627
|
+
provider?: string;
|
|
1628
|
+
purpose?: string;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1558
1631
|
/**
|
|
1559
1632
|
* Additional conditions required for processing sensitive personal data
|
|
1560
1633
|
* per NDPA Section 30
|
|
@@ -1987,6 +2060,23 @@ export declare interface UseConsentReturn {
|
|
|
1987
2060
|
isLoading: boolean;
|
|
1988
2061
|
}
|
|
1989
2062
|
|
|
2063
|
+
/**
|
|
2064
|
+
* React hook that scans `document.cookie` against your declared cookies on
|
|
2065
|
+
* mount and exposes a `rescan()` to re-run after you set or clear cookies.
|
|
2066
|
+
*
|
|
2067
|
+
* `result` is `null` until the first client-side scan, so server and first
|
|
2068
|
+
* client render agree (no hydration mismatch). `rescan` is stable and always
|
|
2069
|
+
* reads the latest `declared`/`options` — callers don't need to memoise them.
|
|
2070
|
+
*/
|
|
2071
|
+
export declare function useCookieScan(declared?: DeclaredCookie[], options?: CookieScanOptions): UseCookieScanReturn;
|
|
2072
|
+
|
|
2073
|
+
export declare interface UseCookieScanReturn {
|
|
2074
|
+
/** The latest scan, or `null` before the first client-side scan (e.g. during SSR). */
|
|
2075
|
+
result: CookieScanResult | null;
|
|
2076
|
+
/** Re-read the cookies and recompute the scan with the current arguments. */
|
|
2077
|
+
rescan: () => void;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
1990
2080
|
/**
|
|
1991
2081
|
* Hook for managing cross-border data transfers in compliance with NDPA Part VIII (Sections 41-43).
|
|
1992
2082
|
*
|