@redacto.io/consent-sdk-react 9.2.0-beta.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 (51) hide show
  1. package/.turbo/turbo-build.log +15 -10
  2. package/CHANGELOG.md +6 -0
  3. package/dist/privacy-center.d.mts +56 -2
  4. package/dist/privacy-center.d.ts +56 -2
  5. package/dist/privacy-center.js +4213 -1256
  6. package/dist/privacy-center.mjs +4030 -1073
  7. package/package.json +1 -1
  8. package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +3 -0
  9. package/src/RedactoPrivacyCenter/PrivacyCenterMyReceiptPage.tsx +26 -0
  10. package/src/RedactoPrivacyCenter/api/actions.ts +66 -0
  11. package/src/RedactoPrivacyCenter/api/client.ts +79 -0
  12. package/src/RedactoPrivacyCenter/components/DataRequest/ProductSelectionSection.tsx +222 -0
  13. package/src/RedactoPrivacyCenter/components/Form.tsx +828 -33
  14. package/src/RedactoPrivacyCenter/components/ReceiptsList.tsx +492 -0
  15. package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +284 -71
  16. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +6 -1
  17. package/src/RedactoPrivacyCenter/components/groupHelpers.ts +56 -0
  18. package/src/RedactoPrivacyCenter/components/receiptColumns.tsx +203 -0
  19. package/src/RedactoPrivacyCenter/components/types.ts +26 -2
  20. package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +2 -2
  21. package/src/RedactoPrivacyCenter/lib/api.ts +95 -1
  22. package/src/RedactoPrivacyCenter/lib/constants.ts +5 -0
  23. package/src/RedactoPrivacyCenter/lib/types.ts +105 -0
  24. package/src/RedactoPrivacyCenter/locales/as/translation.json +39 -1
  25. package/src/RedactoPrivacyCenter/locales/bho/translation.json +39 -1
  26. package/src/RedactoPrivacyCenter/locales/bn/translation.json +39 -1
  27. package/src/RedactoPrivacyCenter/locales/brx/translation.json +39 -1
  28. package/src/RedactoPrivacyCenter/locales/doi/translation.json +39 -1
  29. package/src/RedactoPrivacyCenter/locales/en/translation.json +44 -1
  30. package/src/RedactoPrivacyCenter/locales/gom/translation.json +39 -1
  31. package/src/RedactoPrivacyCenter/locales/gu/translation.json +39 -1
  32. package/src/RedactoPrivacyCenter/locales/hi/translation.json +39 -1
  33. package/src/RedactoPrivacyCenter/locales/kn/translation.json +39 -1
  34. package/src/RedactoPrivacyCenter/locales/ks/translation.json +39 -1
  35. package/src/RedactoPrivacyCenter/locales/mai/translation.json +39 -1
  36. package/src/RedactoPrivacyCenter/locales/ml/translation.json +39 -1
  37. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +39 -1
  38. package/src/RedactoPrivacyCenter/locales/mr/translation.json +39 -1
  39. package/src/RedactoPrivacyCenter/locales/ne/translation.json +39 -1
  40. package/src/RedactoPrivacyCenter/locales/or/translation.json +39 -1
  41. package/src/RedactoPrivacyCenter/locales/pa/translation.json +39 -1
  42. package/src/RedactoPrivacyCenter/locales/sa/translation.json +39 -1
  43. package/src/RedactoPrivacyCenter/locales/sat/translation.json +39 -1
  44. package/src/RedactoPrivacyCenter/locales/sd/translation.json +39 -1
  45. package/src/RedactoPrivacyCenter/locales/ta/translation.json +39 -1
  46. package/src/RedactoPrivacyCenter/locales/te/translation.json +39 -1
  47. package/src/RedactoPrivacyCenter/locales/ur/translation.json +39 -1
  48. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +301 -0
  49. package/tests/Form.test.tsx +1170 -0
  50. package/tests/ProductSelectionSection.test.tsx +293 -0
  51. package/tests/RequestSubmit.test.tsx +295 -0
@@ -1,21 +1,26 @@
1
1
 
2
2
  
3
- > @redacto.io/consent-sdk-react@3.5.0 build /Users/abhishekashyap/Documents/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
- CLI Building entry: {"index":"src/index.ts"}
6
+ CLI Building entry: {"index":"src/index.ts","privacy-center":"src/privacy-center.ts"}
7
7
  CLI Using tsconfig: tsconfig.json
8
8
  CLI tsup v8.5.1
9
- CLI Using tsup config: /Users/abhishekashyap/Documents/consent-sdk/packages/consent-sdk-react/tsup.config.ts
9
+ CLI Using tsup config: /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react/tsup.config.ts
10
10
  CLI Target: es2019
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
13
  CJS Build start
14
- ESM dist/index.mjs 165.70 KB
15
- ESM ⚡️ Build success in 66ms
16
- CJS dist/index.js 172.18 KB
17
- CJS ⚡️ Build success in 68ms
14
+ CJS dist/index.js 237.00 KB
15
+ CJS dist/privacy-center.js 2.02 MB
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
18
21
  DTS Build start
19
- DTS ⚡️ Build success in 819ms
20
- DTS dist/index.d.mts 2.92 KB
21
- DTS dist/index.d.ts 2.92 KB
22
+ DTS ⚡️ Build success in 5254ms
23
+ DTS dist/index.d.mts 6.12 KB
24
+ DTS dist/privacy-center.d.mts 28.52 KB
25
+ DTS dist/index.d.ts 6.12 KB
26
+ DTS dist/privacy-center.d.ts 28.52 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## 9.2.0-beta.0
4
10
 
5
11
  ### Minor Changes
@@ -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;