@tantainnovative/ndpr-toolkit 4.0.0 → 5.0.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/dist/chunk-4FXRJH37.js +1 -0
  3. package/dist/{chunk-3XU6FL2I.js → chunk-6YFPDGNB.js} +1 -1
  4. package/dist/{chunk-WMISQDSV.js → chunk-ASEUTU45.js} +1 -1
  5. package/dist/chunk-BRJKIF7E.mjs +1 -0
  6. package/dist/{chunk-XYGGUGTO.js → chunk-CSE36REY.js} +4 -4
  7. package/dist/chunk-DKLJ5DYN.js +1 -0
  8. package/dist/chunk-FRMVSG4N.mjs +1 -0
  9. package/dist/chunk-MAD7QYRK.js +1 -0
  10. package/dist/chunk-NBOJ2KGN.mjs +1 -0
  11. package/dist/chunk-PQ5IPUJN.mjs +1 -0
  12. package/dist/{chunk-BGV2AKT7.mjs → chunk-PSPYIRIF.mjs} +1 -1
  13. package/dist/chunk-QKXGVT2Q.js +1 -0
  14. package/dist/chunk-R2ZZMATR.js +1 -0
  15. package/dist/chunk-R3ZKV2J7.mjs +1 -0
  16. package/dist/chunk-RRVML7CU.mjs +1 -0
  17. package/dist/{chunk-NB6SKG76.mjs → chunk-SBSYHCPK.mjs} +1 -1
  18. package/dist/chunk-TLIHFGIJ.js +1 -0
  19. package/dist/{chunk-5F2IAUWJ.js → chunk-TVA6D6S4.js} +1 -1
  20. package/dist/{chunk-42JPSNVV.mjs → chunk-WPH6CJDL.mjs} +4 -4
  21. package/dist/{chunk-GUERZD4O.mjs → chunk-ZSRO4L3C.mjs} +1 -1
  22. package/dist/consent.d.mts +59 -19
  23. package/dist/consent.d.ts +59 -19
  24. package/dist/consent.js +1 -1
  25. package/dist/consent.mjs +1 -1
  26. package/dist/core.d.mts +124 -69
  27. package/dist/core.d.ts +124 -69
  28. package/dist/core.js +1 -1
  29. package/dist/core.mjs +1 -1
  30. package/dist/cross-border.d.mts +7 -6
  31. package/dist/cross-border.d.ts +7 -6
  32. package/dist/cross-border.js +1 -1
  33. package/dist/cross-border.mjs +1 -1
  34. package/dist/dsr.d.mts +86 -54
  35. package/dist/dsr.d.ts +86 -54
  36. package/dist/dsr.js +1 -1
  37. package/dist/dsr.mjs +1 -1
  38. package/dist/headless.d.mts +23 -9
  39. package/dist/headless.d.ts +23 -9
  40. package/dist/headless.js +1 -1
  41. package/dist/headless.mjs +1 -1
  42. package/dist/hooks.d.mts +23 -9
  43. package/dist/hooks.d.ts +23 -9
  44. package/dist/hooks.js +1 -1
  45. package/dist/hooks.mjs +1 -1
  46. package/dist/index.d.mts +144 -95
  47. package/dist/index.d.ts +144 -95
  48. package/dist/index.js +1 -1
  49. package/dist/index.mjs +1 -1
  50. package/dist/lawful-basis.d.mts +6 -6
  51. package/dist/lawful-basis.d.ts +6 -6
  52. package/dist/lawful-basis.js +1 -1
  53. package/dist/lawful-basis.mjs +1 -1
  54. package/dist/presets.d.mts +87 -2
  55. package/dist/presets.d.ts +87 -2
  56. package/dist/presets.js +1 -1
  57. package/dist/presets.mjs +1 -1
  58. package/dist/ropa-lite.d.mts +4 -1
  59. package/dist/ropa-lite.d.ts +4 -1
  60. package/dist/ropa-lite.js +1 -1
  61. package/dist/ropa-lite.mjs +1 -1
  62. package/dist/ropa.d.mts +16 -16
  63. package/dist/ropa.d.ts +16 -16
  64. package/dist/ropa.js +1 -1
  65. package/dist/ropa.mjs +1 -1
  66. package/dist/server.d.mts +123 -68
  67. package/dist/server.d.ts +123 -68
  68. package/dist/server.js +1 -1
  69. package/dist/server.mjs +1 -1
  70. package/dist/styles.css +18 -16
  71. package/package.json +1 -1
  72. package/dist/chunk-7FXNGGMO.js +0 -1
  73. package/dist/chunk-B46SJB5V.js +0 -1
  74. package/dist/chunk-BL5W472Q.js +0 -1
  75. package/dist/chunk-HOAC5VUF.js +0 -1
  76. package/dist/chunk-IHNAFXDM.mjs +0 -1
  77. package/dist/chunk-O2WEABB3.js +0 -1
  78. package/dist/chunk-OZHUINWS.js +0 -1
  79. package/dist/chunk-PJNKQPQP.mjs +0 -1
  80. package/dist/chunk-RBKFNCGO.mjs +0 -1
  81. package/dist/chunk-VPNK7OID.mjs +0 -1
  82. package/dist/chunk-WKUC65HL.mjs +0 -1
  83. package/dist/chunk-Z2M5VJX2.mjs +0 -1
package/dist/dsr.d.mts CHANGED
@@ -331,7 +331,7 @@ export declare type DSRStatus = 'pending' | 'awaitingVerification' | 'inProgress
331
331
  /**
332
332
  * Validated DSR submission shape — matches what `<DSRRequestForm onSubmit>`
333
333
  * emits client-side. Use this as the typed parameter for your server-side
334
- * handler after `validateDsrSubmission` returns `valid: true`.
334
+ * handler after `validateDsrSubmissionStructured` returns `valid: true`.
335
335
  */
336
336
  export declare interface DsrSubmissionPayload {
337
337
  requestType: string;
@@ -346,16 +346,6 @@ export declare interface DsrSubmissionPayload {
346
346
  submittedAt: number;
347
347
  }
348
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
349
  /**
360
350
  * DSR tracking and analytics component. Supports compliance with NDPA Part IV,
361
351
  * providing summary statistics, deadline tracking, and compliance metrics for data subject requests.
@@ -459,15 +449,29 @@ declare interface DSRTrackerProps {
459
449
  export declare type DSRType = 'information' | 'access' | 'rectification' | 'erasure' | 'restriction' | 'portability' | 'objection' | 'automated_decision_making' | 'withdraw_consent';
460
450
 
461
451
  /**
462
- * Formats a DSR request for display or submission
463
- * @param request The DSR request to format
464
- * @returns Formatted request data
452
+ * Format a DSR request for display or submission. Returns the formatted
453
+ * payload plus a typed `errors` array of `{ field, code, message }` for any
454
+ * required fields missing from the source request.
455
+ *
456
+ * Codes emitted:
457
+ * - `request_id_required`
458
+ * - `request_type_required`
459
+ * - `request_status_required`
460
+ * - `created_at_required`
461
+ * - `subject_name_required`
462
+ * - `subject_email_required`
465
463
  */
466
- export declare function formatDSRRequest(request: DSRRequest): {
464
+ export declare function formatDSRRequestStructured(request: DSRRequest): FormatDSRRequestStructuredResult;
465
+
466
+ /** Result of {@link formatDSRRequestStructured}. */
467
+ export declare interface FormatDSRRequestStructuredResult {
468
+ valid: boolean;
469
+ errors: StructuredValidationError[];
470
+ /** Formatted request payload — always populated regardless of `valid`. */
467
471
  formattedRequest: Record<string, unknown>;
468
- isValid: boolean;
469
- validationErrors: string[];
470
- };
472
+ /** Narrowed input — populated only on `valid: true`. */
473
+ data?: DSRRequest;
474
+ }
471
475
 
472
476
  /**
473
477
  * Legacy status of a data subject request
@@ -518,6 +522,30 @@ export declare interface StorageAdapter<T = unknown> {
518
522
  remove(): void | Promise<void>;
519
523
  }
520
524
 
525
+ /**
526
+ * Single structured validation error with a stable, locale-independent
527
+ * `code` consumers can switch on programmatically.
528
+ */
529
+ declare interface StructuredValidationError {
530
+ /** Dot-path of the offending field (e.g. `'timestamp'`, `'dataSubject.email'`, `'options[0].purpose'`). */
531
+ field: string;
532
+ /** Stable, snake_case error code — safe to switch on across locales. */
533
+ code: string;
534
+ /** Human-readable English message — informational only; do not regex-match. */
535
+ message: string;
536
+ }
537
+
538
+ /**
539
+ * Result of a structured validator. `errors` is an array (one entry per
540
+ * failed rule). `data` is the narrowed, typed payload, only populated on
541
+ * `valid: true`.
542
+ */
543
+ declare interface StructuredValidationResult<T> {
544
+ valid: boolean;
545
+ errors: StructuredValidationError[];
546
+ data?: T;
547
+ }
548
+
521
549
  /**
522
550
  * Hook for managing Data Subject Requests in compliance with the NDPA.
523
551
  *
@@ -638,6 +666,23 @@ declare interface UseDSRReturn {
638
666
  isLoading: boolean;
639
667
  }
640
668
 
669
+ /** Options for {@link validateDsrSubmissionStructured}. */
670
+ export declare interface ValidateDsrSubmissionOptions {
671
+ /**
672
+ * Whether the data subject is required to provide an identifier
673
+ * (NDPC's recommended verification step). Mirror whatever you set on
674
+ * the client-side `<DSRRequestForm requireIdentityVerification>`.
675
+ * @default true
676
+ */
677
+ requireIdentityVerification?: boolean;
678
+ /**
679
+ * Allowed request types. When provided, the payload's `requestType`
680
+ * must be one of these — useful for locking the server to a specific
681
+ * set of supported NDPA Part VI §34-38 (plus §35, §36, §37) data-subject rights.
682
+ */
683
+ allowedRequestTypes?: string[];
684
+ }
685
+
641
686
  /**
642
687
  * Validate a raw DSR submission payload against the same rules
643
688
  * `<DSRRequestForm />` enforces client-side. Designed to be called from a
@@ -646,51 +691,38 @@ declare interface UseDSRReturn {
646
691
  * the consumer hand-rolling zod / class-validator schemas.
647
692
  *
648
693
  * Defensive — accepts `unknown` and narrows. Safe to call directly on
649
- * `await request.json()`.
694
+ * `await request.json()`. Returns `{ field, code, message }[]` errors so
695
+ * callers can switch on `code` programmatically across locales.
696
+ *
697
+ * Codes emitted:
698
+ * - `payload_not_object`
699
+ * - `request_type_required`
700
+ * - `request_type_not_allowed`
701
+ * - `data_subject_required`
702
+ * - `full_name_required`
703
+ * - `email_required`
704
+ * - `email_invalid_format`
705
+ * - `phone_invalid_type`
706
+ * - `identifier_type_required`
707
+ * - `identifier_value_required`
708
+ * - `submitted_at_invalid`
709
+ * - `additional_info_invalid_type`
710
+ * - `payload_final_narrowing_failed`
650
711
  *
651
712
  * @example **Next.js Route Handler**
652
713
  * ```ts
653
- * // app/api/dsr/route.ts
654
- * import { validateDsrSubmission } from '@tantainnovative/ndpr-toolkit/server';
714
+ * import { validateDsrSubmissionStructured } from '@tantainnovative/ndpr-toolkit/server';
655
715
  *
656
716
  * export async function POST(req: Request) {
657
- * const { valid, errors, data } = validateDsrSubmission(await req.json());
658
- * if (!valid) return Response.json({ errors }, { status: 422 });
659
- * // `data` is the typed DsrSubmissionPayload
717
+ * const { valid, errors, data } = validateDsrSubmissionStructured(await req.json());
718
+ * if (!valid) {
719
+ * return Response.json({ errors }, { status: 422 });
720
+ * }
660
721
  * await dsrStore.create(data);
661
722
  * return Response.json({ ok: true }, { status: 201 });
662
723
  * }
663
724
  * ```
664
- *
665
- * @example **Lock to specific request types**
666
- * ```ts
667
- * validateDsrSubmission(payload, {
668
- * allowedRequestTypes: ['access', 'erasure', 'rectification'],
669
- * });
670
- * ```
671
- *
672
- * @example **Skip identity verification (e.g. authenticated session)**
673
- * ```ts
674
- * validateDsrSubmission(payload, { requireIdentityVerification: false });
675
- * ```
676
725
  */
677
- export declare function validateDsrSubmission(payload: unknown, options?: ValidateDsrSubmissionOptions): DsrSubmissionValidationResult;
678
-
679
- /** Options for {@link validateDsrSubmission}. */
680
- export declare interface ValidateDsrSubmissionOptions {
681
- /**
682
- * Whether the data subject is required to provide an identifier
683
- * (NDPC's recommended verification step). Mirror whatever you set on
684
- * the client-side `<DSRRequestForm requireIdentityVerification>`.
685
- * @default true
686
- */
687
- requireIdentityVerification?: boolean;
688
- /**
689
- * Allowed request types. When provided, the payload's `requestType`
690
- * must be one of these — useful for locking the server to a specific
691
- * set of supported NDPA Part VI §34-38 (plus §35, §36, §37) data-subject rights.
692
- */
693
- allowedRequestTypes?: string[];
694
- }
726
+ export declare function validateDsrSubmissionStructured(payload: unknown, options?: ValidateDsrSubmissionOptions): StructuredValidationResult<DsrSubmissionPayload>;
695
727
 
696
728
  export { }
package/dist/dsr.d.ts CHANGED
@@ -331,7 +331,7 @@ export declare type DSRStatus = 'pending' | 'awaitingVerification' | 'inProgress
331
331
  /**
332
332
  * Validated DSR submission shape — matches what `<DSRRequestForm onSubmit>`
333
333
  * emits client-side. Use this as the typed parameter for your server-side
334
- * handler after `validateDsrSubmission` returns `valid: true`.
334
+ * handler after `validateDsrSubmissionStructured` returns `valid: true`.
335
335
  */
336
336
  export declare interface DsrSubmissionPayload {
337
337
  requestType: string;
@@ -346,16 +346,6 @@ export declare interface DsrSubmissionPayload {
346
346
  submittedAt: number;
347
347
  }
348
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
349
  /**
360
350
  * DSR tracking and analytics component. Supports compliance with NDPA Part IV,
361
351
  * providing summary statistics, deadline tracking, and compliance metrics for data subject requests.
@@ -459,15 +449,29 @@ declare interface DSRTrackerProps {
459
449
  export declare type DSRType = 'information' | 'access' | 'rectification' | 'erasure' | 'restriction' | 'portability' | 'objection' | 'automated_decision_making' | 'withdraw_consent';
460
450
 
461
451
  /**
462
- * Formats a DSR request for display or submission
463
- * @param request The DSR request to format
464
- * @returns Formatted request data
452
+ * Format a DSR request for display or submission. Returns the formatted
453
+ * payload plus a typed `errors` array of `{ field, code, message }` for any
454
+ * required fields missing from the source request.
455
+ *
456
+ * Codes emitted:
457
+ * - `request_id_required`
458
+ * - `request_type_required`
459
+ * - `request_status_required`
460
+ * - `created_at_required`
461
+ * - `subject_name_required`
462
+ * - `subject_email_required`
465
463
  */
466
- export declare function formatDSRRequest(request: DSRRequest): {
464
+ export declare function formatDSRRequestStructured(request: DSRRequest): FormatDSRRequestStructuredResult;
465
+
466
+ /** Result of {@link formatDSRRequestStructured}. */
467
+ export declare interface FormatDSRRequestStructuredResult {
468
+ valid: boolean;
469
+ errors: StructuredValidationError[];
470
+ /** Formatted request payload — always populated regardless of `valid`. */
467
471
  formattedRequest: Record<string, unknown>;
468
- isValid: boolean;
469
- validationErrors: string[];
470
- };
472
+ /** Narrowed input — populated only on `valid: true`. */
473
+ data?: DSRRequest;
474
+ }
471
475
 
472
476
  /**
473
477
  * Legacy status of a data subject request
@@ -518,6 +522,30 @@ export declare interface StorageAdapter<T = unknown> {
518
522
  remove(): void | Promise<void>;
519
523
  }
520
524
 
525
+ /**
526
+ * Single structured validation error with a stable, locale-independent
527
+ * `code` consumers can switch on programmatically.
528
+ */
529
+ declare interface StructuredValidationError {
530
+ /** Dot-path of the offending field (e.g. `'timestamp'`, `'dataSubject.email'`, `'options[0].purpose'`). */
531
+ field: string;
532
+ /** Stable, snake_case error code — safe to switch on across locales. */
533
+ code: string;
534
+ /** Human-readable English message — informational only; do not regex-match. */
535
+ message: string;
536
+ }
537
+
538
+ /**
539
+ * Result of a structured validator. `errors` is an array (one entry per
540
+ * failed rule). `data` is the narrowed, typed payload, only populated on
541
+ * `valid: true`.
542
+ */
543
+ declare interface StructuredValidationResult<T> {
544
+ valid: boolean;
545
+ errors: StructuredValidationError[];
546
+ data?: T;
547
+ }
548
+
521
549
  /**
522
550
  * Hook for managing Data Subject Requests in compliance with the NDPA.
523
551
  *
@@ -638,6 +666,23 @@ declare interface UseDSRReturn {
638
666
  isLoading: boolean;
639
667
  }
640
668
 
669
+ /** Options for {@link validateDsrSubmissionStructured}. */
670
+ export declare interface ValidateDsrSubmissionOptions {
671
+ /**
672
+ * Whether the data subject is required to provide an identifier
673
+ * (NDPC's recommended verification step). Mirror whatever you set on
674
+ * the client-side `<DSRRequestForm requireIdentityVerification>`.
675
+ * @default true
676
+ */
677
+ requireIdentityVerification?: boolean;
678
+ /**
679
+ * Allowed request types. When provided, the payload's `requestType`
680
+ * must be one of these — useful for locking the server to a specific
681
+ * set of supported NDPA Part VI §34-38 (plus §35, §36, §37) data-subject rights.
682
+ */
683
+ allowedRequestTypes?: string[];
684
+ }
685
+
641
686
  /**
642
687
  * Validate a raw DSR submission payload against the same rules
643
688
  * `<DSRRequestForm />` enforces client-side. Designed to be called from a
@@ -646,51 +691,38 @@ declare interface UseDSRReturn {
646
691
  * the consumer hand-rolling zod / class-validator schemas.
647
692
  *
648
693
  * Defensive — accepts `unknown` and narrows. Safe to call directly on
649
- * `await request.json()`.
694
+ * `await request.json()`. Returns `{ field, code, message }[]` errors so
695
+ * callers can switch on `code` programmatically across locales.
696
+ *
697
+ * Codes emitted:
698
+ * - `payload_not_object`
699
+ * - `request_type_required`
700
+ * - `request_type_not_allowed`
701
+ * - `data_subject_required`
702
+ * - `full_name_required`
703
+ * - `email_required`
704
+ * - `email_invalid_format`
705
+ * - `phone_invalid_type`
706
+ * - `identifier_type_required`
707
+ * - `identifier_value_required`
708
+ * - `submitted_at_invalid`
709
+ * - `additional_info_invalid_type`
710
+ * - `payload_final_narrowing_failed`
650
711
  *
651
712
  * @example **Next.js Route Handler**
652
713
  * ```ts
653
- * // app/api/dsr/route.ts
654
- * import { validateDsrSubmission } from '@tantainnovative/ndpr-toolkit/server';
714
+ * import { validateDsrSubmissionStructured } from '@tantainnovative/ndpr-toolkit/server';
655
715
  *
656
716
  * export async function POST(req: Request) {
657
- * const { valid, errors, data } = validateDsrSubmission(await req.json());
658
- * if (!valid) return Response.json({ errors }, { status: 422 });
659
- * // `data` is the typed DsrSubmissionPayload
717
+ * const { valid, errors, data } = validateDsrSubmissionStructured(await req.json());
718
+ * if (!valid) {
719
+ * return Response.json({ errors }, { status: 422 });
720
+ * }
660
721
  * await dsrStore.create(data);
661
722
  * return Response.json({ ok: true }, { status: 201 });
662
723
  * }
663
724
  * ```
664
- *
665
- * @example **Lock to specific request types**
666
- * ```ts
667
- * validateDsrSubmission(payload, {
668
- * allowedRequestTypes: ['access', 'erasure', 'rectification'],
669
- * });
670
- * ```
671
- *
672
- * @example **Skip identity verification (e.g. authenticated session)**
673
- * ```ts
674
- * validateDsrSubmission(payload, { requireIdentityVerification: false });
675
- * ```
676
725
  */
677
- export declare function validateDsrSubmission(payload: unknown, options?: ValidateDsrSubmissionOptions): DsrSubmissionValidationResult;
678
-
679
- /** Options for {@link validateDsrSubmission}. */
680
- export declare interface ValidateDsrSubmissionOptions {
681
- /**
682
- * Whether the data subject is required to provide an identifier
683
- * (NDPC's recommended verification step). Mirror whatever you set on
684
- * the client-side `<DSRRequestForm requireIdentityVerification>`.
685
- * @default true
686
- */
687
- requireIdentityVerification?: boolean;
688
- /**
689
- * Allowed request types. When provided, the payload's `requestType`
690
- * must be one of these — useful for locking the server to a specific
691
- * set of supported NDPA Part VI §34-38 (plus §35, §36, §37) data-subject rights.
692
- */
693
- allowedRequestTypes?: string[];
694
- }
726
+ export declare function validateDsrSubmissionStructured(payload: unknown, options?: ValidateDsrSubmissionOptions): StructuredValidationResult<DsrSubmissionPayload>;
695
727
 
696
728
  export { }
package/dist/dsr.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- 'use strict';var chunkWMISQDSV_js=require('./chunk-WMISQDSV.js'),chunkUZNWXJ2W_js=require('./chunk-UZNWXJ2W.js');require('./chunk-UXUMYP4L.js');var chunk5F2IAUWJ_js=require('./chunk-5F2IAUWJ.js'),chunkOZHUINWS_js=require('./chunk-OZHUINWS.js');require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function P(){let e=react.useContext(p);if(!e)throw new Error("DSR compound components must be wrapped in <DSR.Provider>. Example: <DSR.Provider requestTypes={...}><DSR.Form /></DSR.Provider>");return e}var m=({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:d,onSubmit:u,onUpdate:i,children:n})=>{let f=chunk5F2IAUWJ_js.a({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:d,onSubmit:u,onUpdate:i}),x=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},f),{requestTypes:e});return jsxRuntime.jsx(p.Provider,{value:x,children:n})};var C={Provider:m,Form:chunkUZNWXJ2W_js.a,Dashboard:chunkWMISQDSV_js.a,Tracker:chunkWMISQDSV_js.b};Object.defineProperty(exports,"DSRDashboard",{enumerable:true,get:function(){return chunkWMISQDSV_js.a}});Object.defineProperty(exports,"DSRTracker",{enumerable:true,get:function(){return chunkWMISQDSV_js.b}});Object.defineProperty(exports,"DSRRequestForm",{enumerable:true,get:function(){return chunkUZNWXJ2W_js.a}});Object.defineProperty(exports,"useDSR",{enumerable:true,get:function(){return chunk5F2IAUWJ_js.a}});Object.defineProperty(exports,"formatDSRRequest",{enumerable:true,get:function(){return chunkOZHUINWS_js.b}});Object.defineProperty(exports,"validateDsrSubmission",{enumerable:true,get:function(){return chunkOZHUINWS_js.a}});exports.DSR=C;exports.DSRProvider=m;exports.useDSRCompound=P;
2
+ 'use strict';var chunkASEUTU45_js=require('./chunk-ASEUTU45.js'),chunkUZNWXJ2W_js=require('./chunk-UZNWXJ2W.js');require('./chunk-UXUMYP4L.js');var chunkTVA6D6S4_js=require('./chunk-TVA6D6S4.js'),chunkR2ZZMATR_js=require('./chunk-R2ZZMATR.js');require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function P(){let e=react.useContext(p);if(!e)throw new Error("DSR compound components must be wrapped in <DSR.Provider>. Example: <DSR.Provider requestTypes={...}><DSR.Form /></DSR.Provider>");return e}var R=({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:u,onSubmit:d,onUpdate:n,children:i})=>{let f=chunkTVA6D6S4_js.a({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:u,onSubmit:d,onUpdate:n}),x=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},f),{requestTypes:e});return jsxRuntime.jsx(p.Provider,{value:x,children:i})};var C={Provider:R,Form:chunkUZNWXJ2W_js.a,Dashboard:chunkASEUTU45_js.a,Tracker:chunkASEUTU45_js.b};Object.defineProperty(exports,"DSRDashboard",{enumerable:true,get:function(){return chunkASEUTU45_js.a}});Object.defineProperty(exports,"DSRTracker",{enumerable:true,get:function(){return chunkASEUTU45_js.b}});Object.defineProperty(exports,"DSRRequestForm",{enumerable:true,get:function(){return chunkUZNWXJ2W_js.a}});Object.defineProperty(exports,"useDSR",{enumerable:true,get:function(){return chunkTVA6D6S4_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}});exports.DSR=C;exports.DSRProvider=R;exports.useDSRCompound=P;
package/dist/dsr.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import {b,a}from'./chunk-NB6SKG76.mjs';export{a as DSRDashboard,b as DSRTracker}from'./chunk-NB6SKG76.mjs';import {a as a$1}from'./chunk-L3FR4PQE.mjs';export{a as DSRRequestForm}from'./chunk-L3FR4PQE.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$2}from'./chunk-GUERZD4O.mjs';export{a as useDSR}from'./chunk-GUERZD4O.mjs';export{b as formatDSRRequest,a as validateDsrSubmission}from'./chunk-VPNK7OID.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {b as b$1,a as a$3}from'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null);function P(){let e=useContext(p);if(!e)throw new Error("DSR compound components must be wrapped in <DSR.Provider>. Example: <DSR.Provider requestTypes={...}><DSR.Form /></DSR.Provider>");return e}var m=({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:d,onSubmit:u,onUpdate:i,children:n})=>{let f=a$2({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:d,onSubmit:u,onUpdate:i}),x=b$1(a$3({},f),{requestTypes:e});return jsx(p.Provider,{value:x,children:n})};var C={Provider:m,Form:a$1,Dashboard:a,Tracker:b};export{C as DSR,m as DSRProvider,P as useDSRCompound};
2
+ import {b,a}from'./chunk-SBSYHCPK.mjs';export{a as DSRDashboard,b as DSRTracker}from'./chunk-SBSYHCPK.mjs';import {a as a$1}from'./chunk-L3FR4PQE.mjs';export{a as DSRRequestForm}from'./chunk-L3FR4PQE.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$2}from'./chunk-ZSRO4L3C.mjs';export{a as useDSR}from'./chunk-ZSRO4L3C.mjs';export{b as formatDSRRequestStructured,a as validateDsrSubmissionStructured}from'./chunk-RRVML7CU.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {b as b$1,a as a$3}from'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null);function P(){let e=useContext(p);if(!e)throw new Error("DSR compound components must be wrapped in <DSR.Provider>. Example: <DSR.Provider requestTypes={...}><DSR.Form /></DSR.Provider>");return e}var R=({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:u,onSubmit:d,onUpdate:n,children:i})=>{let f=a$2({requestTypes:e,adapter:S,storageKey:D,useLocalStorage:u,onSubmit:d,onUpdate:n}),x=b$1(a$3({},f),{requestTypes:e});return jsx(p.Provider,{value:x,children:i})};var C={Provider:R,Form:a$1,Dashboard:a,Tracker:b};export{C as DSR,R as DSRProvider,P as useDSRCompound};
@@ -1457,6 +1457,19 @@ declare interface StorageAdapter<T = unknown> {
1457
1457
  remove(): void | Promise<void>;
1458
1458
  }
1459
1459
 
1460
+ /**
1461
+ * Single structured validation error with a stable, locale-independent
1462
+ * `code` consumers can switch on programmatically.
1463
+ */
1464
+ declare interface StructuredValidationError {
1465
+ /** Dot-path of the offending field (e.g. `'timestamp'`, `'dataSubject.email'`, `'options[0].purpose'`). */
1466
+ field: string;
1467
+ /** Stable, snake_case error code — safe to switch on across locales. */
1468
+ code: string;
1469
+ /** Human-readable English message — informational only; do not regex-match. */
1470
+ message: string;
1471
+ }
1472
+
1460
1473
  /** Full context used to generate an adaptive privacy policy. */
1461
1474
  declare interface TemplateContext {
1462
1475
  /** Organisation details, extended with industry and size. */
@@ -1832,9 +1845,10 @@ export declare interface UseConsentReturn {
1832
1845
  */
1833
1846
  isValid: boolean;
1834
1847
  /**
1835
- * Validation errors (if any)
1848
+ * Validation errors (if any). Each entry is a structured `{ field, code,
1849
+ * message }` so consumers can switch on `code` across locales.
1836
1850
  */
1837
- validationErrors: string[];
1851
+ validationErrors: StructuredValidationError[];
1838
1852
  /**
1839
1853
  * Reset consent settings (clear from storage)
1840
1854
  */
@@ -2503,7 +2517,7 @@ export declare interface UsePrivacyPolicyReturn {
2503
2517
  * }
2504
2518
  * ```
2505
2519
  */
2506
- export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, }: UseROPAOptions): UseROPAReturn;
2520
+ export declare function useROPA({ initialData, adapter, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
2507
2521
 
2508
2522
  export declare interface UseROPAOptions {
2509
2523
  /**
@@ -2517,17 +2531,17 @@ export declare interface UseROPAOptions {
2517
2531
  */
2518
2532
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
2519
2533
  /**
2520
- * Callback when a record is added
2534
+ * Callback when a record is added.
2521
2535
  */
2522
- onRecordAdd?: (record: ProcessingRecord) => void;
2536
+ onAdd?: (record: ProcessingRecord) => void;
2523
2537
  /**
2524
- * Callback when a record is updated
2538
+ * Callback when a record is updated.
2525
2539
  */
2526
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2540
+ onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2527
2541
  /**
2528
- * Callback when a record is archived
2542
+ * Callback when a record is archived.
2529
2543
  */
2530
- onRecordArchive?: (id: string) => void;
2544
+ onArchive?: (id: string) => void;
2531
2545
  }
2532
2546
 
2533
2547
  export declare interface UseROPAReturn {
@@ -1457,6 +1457,19 @@ declare interface StorageAdapter<T = unknown> {
1457
1457
  remove(): void | Promise<void>;
1458
1458
  }
1459
1459
 
1460
+ /**
1461
+ * Single structured validation error with a stable, locale-independent
1462
+ * `code` consumers can switch on programmatically.
1463
+ */
1464
+ declare interface StructuredValidationError {
1465
+ /** Dot-path of the offending field (e.g. `'timestamp'`, `'dataSubject.email'`, `'options[0].purpose'`). */
1466
+ field: string;
1467
+ /** Stable, snake_case error code — safe to switch on across locales. */
1468
+ code: string;
1469
+ /** Human-readable English message — informational only; do not regex-match. */
1470
+ message: string;
1471
+ }
1472
+
1460
1473
  /** Full context used to generate an adaptive privacy policy. */
1461
1474
  declare interface TemplateContext {
1462
1475
  /** Organisation details, extended with industry and size. */
@@ -1832,9 +1845,10 @@ export declare interface UseConsentReturn {
1832
1845
  */
1833
1846
  isValid: boolean;
1834
1847
  /**
1835
- * Validation errors (if any)
1848
+ * Validation errors (if any). Each entry is a structured `{ field, code,
1849
+ * message }` so consumers can switch on `code` across locales.
1836
1850
  */
1837
- validationErrors: string[];
1851
+ validationErrors: StructuredValidationError[];
1838
1852
  /**
1839
1853
  * Reset consent settings (clear from storage)
1840
1854
  */
@@ -2503,7 +2517,7 @@ export declare interface UsePrivacyPolicyReturn {
2503
2517
  * }
2504
2518
  * ```
2505
2519
  */
2506
- export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, }: UseROPAOptions): UseROPAReturn;
2520
+ export declare function useROPA({ initialData, adapter, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
2507
2521
 
2508
2522
  export declare interface UseROPAOptions {
2509
2523
  /**
@@ -2517,17 +2531,17 @@ export declare interface UseROPAOptions {
2517
2531
  */
2518
2532
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
2519
2533
  /**
2520
- * Callback when a record is added
2534
+ * Callback when a record is added.
2521
2535
  */
2522
- onRecordAdd?: (record: ProcessingRecord) => void;
2536
+ onAdd?: (record: ProcessingRecord) => void;
2523
2537
  /**
2524
- * Callback when a record is updated
2538
+ * Callback when a record is updated.
2525
2539
  */
2526
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2540
+ onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2527
2541
  /**
2528
- * Callback when a record is archived
2542
+ * Callback when a record is archived.
2529
2543
  */
2530
- onRecordArchive?: (id: string) => void;
2544
+ onArchive?: (id: string) => void;
2531
2545
  }
2532
2546
 
2533
2547
  export declare interface UseROPAReturn {
package/dist/headless.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- 'use strict';require('./chunk-OZCNFB5C.js');var chunkFC3PTJFL_js=require('./chunk-FC3PTJFL.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'),chunkO2WEABB3_js=require('./chunk-O2WEABB3.js');require('./chunk-JS7SYL5P.js'),require('./chunk-RDALAH3Y.js'),require('./chunk-3YTAOT5O.js'),require('./chunk-D2ZKDQVL.js'),require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js');var chunkHOAC5VUF_js=require('./chunk-HOAC5VUF.js'),chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js');require('./chunk-C2KEXHRX.js'),require('./chunk-B46SJB5V.js');var chunk5F2IAUWJ_js=require('./chunk-5F2IAUWJ.js');require('./chunk-OZHUINWS.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,"useComplianceScore",{enumerable:true,get:function(){return chunkFC3PTJFL_js.a}});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 chunkO2WEABB3_js.a}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunkHOAC5VUF_js.a}});Object.defineProperty(exports,"useFocusTrap",{enumerable:true,get:function(){return chunkL2VO3MEJ_js.a}});Object.defineProperty(exports,"useDSR",{enumerable:true,get:function(){return chunk5F2IAUWJ_js.a}});Object.defineProperty(exports,"useDPIA",{enumerable:true,get:function(){return chunkJLQT3W3E_js.a}});
2
+ 'use strict';require('./chunk-OZCNFB5C.js');var chunkFC3PTJFL_js=require('./chunk-FC3PTJFL.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-RDALAH3Y.js'),require('./chunk-3YTAOT5O.js'),require('./chunk-D2ZKDQVL.js'),require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js');var chunkQKXGVT2Q_js=require('./chunk-QKXGVT2Q.js'),chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js');require('./chunk-C2KEXHRX.js'),require('./chunk-DKLJ5DYN.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,"useComplianceScore",{enumerable:true,get:function(){return chunkFC3PTJFL_js.a}});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 chunkQKXGVT2Q_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-GQYBS3A7.mjs';export{a as useComplianceScore}from'./chunk-IQO3SIAG.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-WKUC65HL.mjs';import'./chunk-IVSNHT24.mjs';import'./chunk-7RBO42IW.mjs';import'./chunk-WTGKZX7J.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-IHNAFXDM.mjs';export{a as useFocusTrap}from'./chunk-YTU4FNM2.mjs';import'./chunk-XC3DLYEG.mjs';import'./chunk-PJNKQPQP.mjs';export{a as useDSR}from'./chunk-GUERZD4O.mjs';import'./chunk-VPNK7OID.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';
2
+ import'./chunk-GQYBS3A7.mjs';export{a as useComplianceScore}from'./chunk-IQO3SIAG.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-7RBO42IW.mjs';import'./chunk-WTGKZX7J.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-PQ5IPUJN.mjs';export{a as useFocusTrap}from'./chunk-YTU4FNM2.mjs';import'./chunk-XC3DLYEG.mjs';import'./chunk-R3ZKV2J7.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
@@ -1343,6 +1343,19 @@ declare interface StorageAdapter<T = unknown> {
1343
1343
  remove(): void | Promise<void>;
1344
1344
  }
1345
1345
 
1346
+ /**
1347
+ * Single structured validation error with a stable, locale-independent
1348
+ * `code` consumers can switch on programmatically.
1349
+ */
1350
+ declare interface StructuredValidationError {
1351
+ /** Dot-path of the offending field (e.g. `'timestamp'`, `'dataSubject.email'`, `'options[0].purpose'`). */
1352
+ field: string;
1353
+ /** Stable, snake_case error code — safe to switch on across locales. */
1354
+ code: string;
1355
+ /** Human-readable English message — informational only; do not regex-match. */
1356
+ message: string;
1357
+ }
1358
+
1346
1359
  /** Full context used to generate an adaptive privacy policy. */
1347
1360
  declare interface TemplateContext {
1348
1361
  /** Organisation details, extended with industry and size. */
@@ -1718,9 +1731,10 @@ export declare interface UseConsentReturn {
1718
1731
  */
1719
1732
  isValid: boolean;
1720
1733
  /**
1721
- * Validation errors (if any)
1734
+ * Validation errors (if any). Each entry is a structured `{ field, code,
1735
+ * message }` so consumers can switch on `code` across locales.
1722
1736
  */
1723
- validationErrors: string[];
1737
+ validationErrors: StructuredValidationError[];
1724
1738
  /**
1725
1739
  * Reset consent settings (clear from storage)
1726
1740
  */
@@ -2389,7 +2403,7 @@ export declare interface UsePrivacyPolicyReturn {
2389
2403
  * }
2390
2404
  * ```
2391
2405
  */
2392
- export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, }: UseROPAOptions): UseROPAReturn;
2406
+ export declare function useROPA({ initialData, adapter, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
2393
2407
 
2394
2408
  export declare interface UseROPAOptions {
2395
2409
  /**
@@ -2403,17 +2417,17 @@ export declare interface UseROPAOptions {
2403
2417
  */
2404
2418
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
2405
2419
  /**
2406
- * Callback when a record is added
2420
+ * Callback when a record is added.
2407
2421
  */
2408
- onRecordAdd?: (record: ProcessingRecord) => void;
2422
+ onAdd?: (record: ProcessingRecord) => void;
2409
2423
  /**
2410
- * Callback when a record is updated
2424
+ * Callback when a record is updated.
2411
2425
  */
2412
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2426
+ onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2413
2427
  /**
2414
- * Callback when a record is archived
2428
+ * Callback when a record is archived.
2415
2429
  */
2416
- onRecordArchive?: (id: string) => void;
2430
+ onArchive?: (id: string) => void;
2417
2431
  }
2418
2432
 
2419
2433
  export declare interface UseROPAReturn {