@redacto.io/consent-sdk-react 9.1.0 → 9.2.0-beta.1

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 (64) hide show
  1. package/.turbo/turbo-build.log +10 -9
  2. package/CHANGELOG.md +12 -0
  3. package/dist/index.js +2 -4
  4. package/dist/index.mjs +2 -4
  5. package/dist/privacy-center.d.mts +56 -2
  6. package/dist/privacy-center.d.ts +56 -2
  7. package/dist/privacy-center.js +4840 -1874
  8. package/dist/privacy-center.mjs +5124 -2158
  9. package/package.json +1 -1
  10. package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +2 -4
  11. package/src/RedactoNoticeConsent/api/types.ts +1 -0
  12. package/src/RedactoPrivacyCenter/PrivacyCenterCaseDetailsPage.tsx +3 -1
  13. package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +3 -0
  14. package/src/RedactoPrivacyCenter/PrivacyCenterMyReceiptPage.tsx +26 -0
  15. package/src/RedactoPrivacyCenter/api/actions.ts +66 -0
  16. package/src/RedactoPrivacyCenter/api/client.ts +79 -0
  17. package/src/RedactoPrivacyCenter/components/CaseDetails/DocumentRequestCard.tsx +19 -13
  18. package/src/RedactoPrivacyCenter/components/CaseDetails/FinalizedTooltipWrapper.tsx +25 -0
  19. package/src/RedactoPrivacyCenter/components/CaseDetails/MessageComposer.tsx +39 -30
  20. package/src/RedactoPrivacyCenter/components/CaseDetails/MessageItem.tsx +2 -0
  21. package/src/RedactoPrivacyCenter/components/CaseDetails/MessagesTab.tsx +10 -3
  22. package/src/RedactoPrivacyCenter/components/CaseDetails/utils.ts +21 -6
  23. package/src/RedactoPrivacyCenter/components/DataRequest/ProductSelectionSection.tsx +222 -0
  24. package/src/RedactoPrivacyCenter/components/DataRequest/PurposeSelectionSection.tsx +12 -0
  25. package/src/RedactoPrivacyCenter/components/Form.tsx +843 -162
  26. package/src/RedactoPrivacyCenter/components/ReceiptsList.tsx +492 -0
  27. package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +284 -71
  28. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +6 -1
  29. package/src/RedactoPrivacyCenter/components/groupHelpers.ts +56 -0
  30. package/src/RedactoPrivacyCenter/components/receiptColumns.tsx +203 -0
  31. package/src/RedactoPrivacyCenter/components/types.ts +26 -2
  32. package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +2 -2
  33. package/src/RedactoPrivacyCenter/lib/api.ts +95 -1
  34. package/src/RedactoPrivacyCenter/lib/constants.ts +17 -0
  35. package/src/RedactoPrivacyCenter/lib/types.ts +115 -0
  36. package/src/RedactoPrivacyCenter/locales/as/translation.json +40 -1
  37. package/src/RedactoPrivacyCenter/locales/bho/translation.json +40 -1
  38. package/src/RedactoPrivacyCenter/locales/bn/translation.json +40 -1
  39. package/src/RedactoPrivacyCenter/locales/brx/translation.json +40 -1
  40. package/src/RedactoPrivacyCenter/locales/doi/translation.json +40 -1
  41. package/src/RedactoPrivacyCenter/locales/en/translation.json +46 -1
  42. package/src/RedactoPrivacyCenter/locales/gom/translation.json +40 -1
  43. package/src/RedactoPrivacyCenter/locales/gu/translation.json +40 -1
  44. package/src/RedactoPrivacyCenter/locales/hi/translation.json +40 -1
  45. package/src/RedactoPrivacyCenter/locales/kn/translation.json +40 -1
  46. package/src/RedactoPrivacyCenter/locales/ks/translation.json +40 -1
  47. package/src/RedactoPrivacyCenter/locales/mai/translation.json +40 -1
  48. package/src/RedactoPrivacyCenter/locales/ml/translation.json +40 -1
  49. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +40 -1
  50. package/src/RedactoPrivacyCenter/locales/mr/translation.json +40 -1
  51. package/src/RedactoPrivacyCenter/locales/ne/translation.json +40 -1
  52. package/src/RedactoPrivacyCenter/locales/or/translation.json +40 -1
  53. package/src/RedactoPrivacyCenter/locales/pa/translation.json +40 -1
  54. package/src/RedactoPrivacyCenter/locales/sa/translation.json +40 -1
  55. package/src/RedactoPrivacyCenter/locales/sat/translation.json +40 -1
  56. package/src/RedactoPrivacyCenter/locales/sd/translation.json +40 -1
  57. package/src/RedactoPrivacyCenter/locales/ta/translation.json +40 -1
  58. package/src/RedactoPrivacyCenter/locales/te/translation.json +40 -1
  59. package/src/RedactoPrivacyCenter/locales/ur/translation.json +40 -1
  60. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +301 -0
  61. package/src/RedactoPrivacyCenter/ui/PCTooltip.tsx +3 -1
  62. package/tests/Form.test.tsx +1170 -0
  63. package/tests/ProductSelectionSection.test.tsx +293 -0
  64. package/tests/RequestSubmit.test.tsx +295 -0
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @redacto.io/consent-sdk-react@7.1.0 build /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react
3
+ > @redacto.io/consent-sdk-react@9.1.0 build /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: {"index":"src/index.ts","privacy-center":"src/privacy-center.ts"}
@@ -11,15 +11,16 @@
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
13
  CJS Build start
14
- ESM dist/index.mjs 227.81 KB
15
- ESM dist/privacy-center.mjs 1.98 MB
16
- ESM ⚡️ Build success in 69ms
17
- CJS dist/index.js 237.08 KB
14
+ CJS dist/index.js 237.00 KB
18
15
  CJS dist/privacy-center.js 2.02 MB
19
- CJS ⚡️ Build success in 69ms
16
+ CJS ⚡️ Build success in 125ms
17
+ ESM dist/index.mjs 226.91 KB
18
+ ESM dist/chunk-6A665OPR.mjs 841.00 B
19
+ ESM dist/privacy-center.mjs 1.99 MB
20
+ ESM ⚡️ Build success in 131ms
20
21
  DTS Build start
21
- DTS ⚡️ Build success in 2460ms
22
+ DTS ⚡️ Build success in 5254ms
22
23
  DTS dist/index.d.mts 6.12 KB
23
- DTS dist/privacy-center.d.mts 28.46 KB
24
+ DTS dist/privacy-center.d.mts 28.52 KB
24
25
  DTS dist/index.d.ts 6.12 KB
25
- DTS dist/privacy-center.d.ts 28.46 KB
26
+ DTS dist/privacy-center.d.ts 28.52 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @redacto.io/consent-sdk-react
2
2
 
3
+ ## 9.2.0-beta.1
4
+
5
+ ### Minor Changes
6
+
7
+ - download receipt and product level grievance form
8
+
9
+ ## 9.2.0-beta.0
10
+
11
+ ### Minor Changes
12
+
13
+ - keep revoked-consent purposes raisable in privacy-center DSAR forms
14
+
3
15
  ## 9.1.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.js CHANGED
@@ -4536,14 +4536,12 @@ var RedactoNoticeConsent = ({
4536
4536
  content.dpo_info.dpo_text || ""
4537
4537
  ) }),
4538
4538
  " ",
4539
- content.dpo_info.dpo_url && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
4539
+ content.dpo_info.dpo_email && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
4540
4540
  "a",
4541
4541
  {
4542
4542
  id: "dpo-dpo-link",
4543
4543
  style: { ...styles.link, ...linkStyle },
4544
- href: content.dpo_info.dpo_url,
4545
- target: "_blank",
4546
- rel: "noopener noreferrer",
4544
+ href: `mailto:${content.dpo_info.dpo_email}`,
4547
4545
  children: getTranslatedDpoText(
4548
4546
  "dpo_anchor_text",
4549
4547
  content.dpo_info.dpo_anchor_text || "Click here"
package/dist/index.mjs CHANGED
@@ -4484,14 +4484,12 @@ var RedactoNoticeConsent = ({
4484
4484
  content.dpo_info.dpo_text || ""
4485
4485
  ) }),
4486
4486
  " ",
4487
- content.dpo_info.dpo_url && /* @__PURE__ */ jsx(
4487
+ content.dpo_info.dpo_email && /* @__PURE__ */ jsx(
4488
4488
  "a",
4489
4489
  {
4490
4490
  id: "dpo-dpo-link",
4491
4491
  style: { ...styles.link, ...linkStyle },
4492
- href: content.dpo_info.dpo_url,
4493
- target: "_blank",
4494
- rel: "noopener noreferrer",
4492
+ href: `mailto:${content.dpo_info.dpo_email}`,
4495
4493
  children: getTranslatedDpoText(
4496
4494
  "dpo_anchor_text",
4497
4495
  content.dpo_info.dpo_anchor_text || "Click here"
@@ -99,6 +99,26 @@ declare function createConsentClient(baseUrl: string): {
99
99
  * Get activities (privacy center)
100
100
  */
101
101
  getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
102
+ /**
103
+ * Get receipts (privacy center) — consent receipts for the authenticated user
104
+ */
105
+ getReceipts(baseRequest: BaseRequest, params: {
106
+ skip?: number;
107
+ limit?: number;
108
+ notice_uuid?: string;
109
+ event_type?: string;
110
+ status?: string;
111
+ created_after?: string;
112
+ created_before?: string;
113
+ language?: string;
114
+ }, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
115
+ /**
116
+ * Download a single receipt as a PDF (privacy center).
117
+ * Returns raw PDF bytes as a Blob — the caller builds an object URL to open/save it.
118
+ * Uses a direct fetch (not privacyCenterApiFetch) because the response is binary, not JSON,
119
+ * and the Authorization header must be sent (anchor navigation wouldn't carry it).
120
+ */
121
+ getReceiptPdf(baseRequest: BaseRequest, receiptUuid: string, authToken?: string): Promise<Blob>;
102
122
  /**
103
123
  * Get case history (privacy center)
104
124
  */
@@ -205,12 +225,28 @@ type GrievanceOptions = {
205
225
  value: GrievanceValue;
206
226
  label: string;
207
227
  };
228
+ /**
229
+ * Product-scoped form-data group.
230
+ *
231
+ * Phase 2 of TECH-3712. Mirrors the backend `FormProductGroupOut`. Used to
232
+ * render per-product sections inside the privacy-center form. `nominator`
233
+ * is populated on nominated groups and `null` on direct (own-data) groups.
234
+ */
235
+ type FormProductGroup = {
236
+ product_uuid: string;
237
+ product_name: string;
238
+ product_description: string | null;
239
+ nominator: NominatorInfo | null;
240
+ purposes: Purpose[];
241
+ };
208
242
  type FormData = {
209
243
  uuid: string;
210
244
  name: string;
211
245
  contact: string;
212
246
  grievance_options: GrievanceOptions[];
213
247
  purposes: RawPurposeWrapper[];
248
+ direct_groups?: FormProductGroup[];
249
+ nominated_groups?: FormProductGroup[];
214
250
  };
215
251
  type FormDataResponse = {
216
252
  code: number;
@@ -265,6 +301,8 @@ type UserDataRequest = {
265
301
  time_period: number | null;
266
302
  requestor_note: string;
267
303
  revoke_consent_on_fulfilment?: boolean;
304
+ product_uuid?: string;
305
+ data_principal_uuid?: string;
268
306
  };
269
307
  type CreateCaseResponse = {
270
308
  code: number;
@@ -439,6 +477,11 @@ type CaseRequest = {
439
477
  completed_at?: string;
440
478
  due_date?: string;
441
479
  request_details?: CaseRequestDetails;
480
+ product_uuid?: string;
481
+ product_name?: string;
482
+ data_principal_uuid?: string;
483
+ requestor_uuid?: string;
484
+ nominator_uuid?: string;
442
485
  };
443
486
  type CaseHistoryDetail = {
444
487
  data: CaseRequest[];
@@ -550,7 +593,7 @@ type NotificationQueryParams = {
550
593
  language?: string;
551
594
  };
552
595
 
553
- type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications';
596
+ type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications' | 'receipts';
554
597
  interface NavigationContextType {
555
598
  currentPage: InternalPage;
556
599
  navigateTo: (page: InternalPage) => void;
@@ -712,7 +755,18 @@ interface AuthContext {
712
755
  }
713
756
 
714
757
  declare const getFormData: (organizationId: string, workspaceId: string, contact: string, _isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<FormData | null>;
715
- declare const createCaseRequest: (organizationId: string, workspaceId: string, data: UserDataRequest, _isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CreateCaseResponse | null>;
758
+ /**
759
+ * Public helper for creating a case request. Returns `null` on error
760
+ * (preserves the original `Promise<CreateCaseResponse | null>` contract
761
+ * the SDK exposes to consumers) — does NOT throw. Internally wraps
762
+ * `createCaseRequestUnsafe` and swallows non-auth errors.
763
+ *
764
+ * The batch-submission path in Form.tsx uses `createCaseRequestUnsafe`
765
+ * directly so partial-failure UI can surface per-row backend messages;
766
+ * everywhere else (including the legacy single-case path) should use
767
+ * this helper.
768
+ */
769
+ declare const createCaseRequest: (organizationId: string, workspaceId: string, data: UserDataRequest, isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CreateCaseResponse | null>;
716
770
  declare const fetchProducts: (organizationId: string, workspaceId: string, skip?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<Array<{
717
771
  uuid: string;
718
772
  name: string;
@@ -99,6 +99,26 @@ declare function createConsentClient(baseUrl: string): {
99
99
  * Get activities (privacy center)
100
100
  */
101
101
  getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
102
+ /**
103
+ * Get receipts (privacy center) — consent receipts for the authenticated user
104
+ */
105
+ getReceipts(baseRequest: BaseRequest, params: {
106
+ skip?: number;
107
+ limit?: number;
108
+ notice_uuid?: string;
109
+ event_type?: string;
110
+ status?: string;
111
+ created_after?: string;
112
+ created_before?: string;
113
+ language?: string;
114
+ }, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
115
+ /**
116
+ * Download a single receipt as a PDF (privacy center).
117
+ * Returns raw PDF bytes as a Blob — the caller builds an object URL to open/save it.
118
+ * Uses a direct fetch (not privacyCenterApiFetch) because the response is binary, not JSON,
119
+ * and the Authorization header must be sent (anchor navigation wouldn't carry it).
120
+ */
121
+ getReceiptPdf(baseRequest: BaseRequest, receiptUuid: string, authToken?: string): Promise<Blob>;
102
122
  /**
103
123
  * Get case history (privacy center)
104
124
  */
@@ -205,12 +225,28 @@ type GrievanceOptions = {
205
225
  value: GrievanceValue;
206
226
  label: string;
207
227
  };
228
+ /**
229
+ * Product-scoped form-data group.
230
+ *
231
+ * Phase 2 of TECH-3712. Mirrors the backend `FormProductGroupOut`. Used to
232
+ * render per-product sections inside the privacy-center form. `nominator`
233
+ * is populated on nominated groups and `null` on direct (own-data) groups.
234
+ */
235
+ type FormProductGroup = {
236
+ product_uuid: string;
237
+ product_name: string;
238
+ product_description: string | null;
239
+ nominator: NominatorInfo | null;
240
+ purposes: Purpose[];
241
+ };
208
242
  type FormData = {
209
243
  uuid: string;
210
244
  name: string;
211
245
  contact: string;
212
246
  grievance_options: GrievanceOptions[];
213
247
  purposes: RawPurposeWrapper[];
248
+ direct_groups?: FormProductGroup[];
249
+ nominated_groups?: FormProductGroup[];
214
250
  };
215
251
  type FormDataResponse = {
216
252
  code: number;
@@ -265,6 +301,8 @@ type UserDataRequest = {
265
301
  time_period: number | null;
266
302
  requestor_note: string;
267
303
  revoke_consent_on_fulfilment?: boolean;
304
+ product_uuid?: string;
305
+ data_principal_uuid?: string;
268
306
  };
269
307
  type CreateCaseResponse = {
270
308
  code: number;
@@ -439,6 +477,11 @@ type CaseRequest = {
439
477
  completed_at?: string;
440
478
  due_date?: string;
441
479
  request_details?: CaseRequestDetails;
480
+ product_uuid?: string;
481
+ product_name?: string;
482
+ data_principal_uuid?: string;
483
+ requestor_uuid?: string;
484
+ nominator_uuid?: string;
442
485
  };
443
486
  type CaseHistoryDetail = {
444
487
  data: CaseRequest[];
@@ -550,7 +593,7 @@ type NotificationQueryParams = {
550
593
  language?: string;
551
594
  };
552
595
 
553
- type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications';
596
+ type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications' | 'receipts';
554
597
  interface NavigationContextType {
555
598
  currentPage: InternalPage;
556
599
  navigateTo: (page: InternalPage) => void;
@@ -712,7 +755,18 @@ interface AuthContext {
712
755
  }
713
756
 
714
757
  declare const getFormData: (organizationId: string, workspaceId: string, contact: string, _isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<FormData | null>;
715
- declare const createCaseRequest: (organizationId: string, workspaceId: string, data: UserDataRequest, _isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CreateCaseResponse | null>;
758
+ /**
759
+ * Public helper for creating a case request. Returns `null` on error
760
+ * (preserves the original `Promise<CreateCaseResponse | null>` contract
761
+ * the SDK exposes to consumers) — does NOT throw. Internally wraps
762
+ * `createCaseRequestUnsafe` and swallows non-auth errors.
763
+ *
764
+ * The batch-submission path in Form.tsx uses `createCaseRequestUnsafe`
765
+ * directly so partial-failure UI can surface per-row backend messages;
766
+ * everywhere else (including the legacy single-case path) should use
767
+ * this helper.
768
+ */
769
+ declare const createCaseRequest: (organizationId: string, workspaceId: string, data: UserDataRequest, isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CreateCaseResponse | null>;
716
770
  declare const fetchProducts: (organizationId: string, workspaceId: string, skip?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<Array<{
717
771
  uuid: string;
718
772
  name: string;