@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.
- package/.turbo/turbo-build.log +15 -10
- package/CHANGELOG.md +6 -0
- package/dist/privacy-center.d.mts +56 -2
- package/dist/privacy-center.d.ts +56 -2
- package/dist/privacy-center.js +4213 -1256
- package/dist/privacy-center.mjs +4030 -1073
- package/package.json +1 -1
- package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +3 -0
- package/src/RedactoPrivacyCenter/PrivacyCenterMyReceiptPage.tsx +26 -0
- package/src/RedactoPrivacyCenter/api/actions.ts +66 -0
- package/src/RedactoPrivacyCenter/api/client.ts +79 -0
- package/src/RedactoPrivacyCenter/components/DataRequest/ProductSelectionSection.tsx +222 -0
- package/src/RedactoPrivacyCenter/components/Form.tsx +828 -33
- package/src/RedactoPrivacyCenter/components/ReceiptsList.tsx +492 -0
- package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +284 -71
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +6 -1
- package/src/RedactoPrivacyCenter/components/groupHelpers.ts +56 -0
- package/src/RedactoPrivacyCenter/components/receiptColumns.tsx +203 -0
- package/src/RedactoPrivacyCenter/components/types.ts +26 -2
- package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +2 -2
- package/src/RedactoPrivacyCenter/lib/api.ts +95 -1
- package/src/RedactoPrivacyCenter/lib/constants.ts +5 -0
- package/src/RedactoPrivacyCenter/lib/types.ts +105 -0
- package/src/RedactoPrivacyCenter/locales/as/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/bho/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/bn/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/brx/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/doi/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/en/translation.json +44 -1
- package/src/RedactoPrivacyCenter/locales/gom/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/gu/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/hi/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/kn/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/ks/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/mai/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/ml/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/mr/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/ne/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/or/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/pa/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/sa/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/sat/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/sd/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/ta/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/te/translation.json +39 -1
- package/src/RedactoPrivacyCenter/locales/ur/translation.json +39 -1
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +301 -0
- package/tests/Form.test.tsx +1170 -0
- package/tests/ProductSelectionSection.test.tsx +293 -0
- package/tests/RequestSubmit.test.tsx +295 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @redacto.io/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
|
-
[34mCLI[39m Building entry: {"index":"src/index.ts"}
|
|
6
|
+
[34mCLI[39m Building entry: {"index":"src/index.ts","privacy-center":"src/privacy-center.ts"}
|
|
7
7
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
8
|
[34mCLI[39m tsup v8.5.1
|
|
9
|
-
[34mCLI[39m Using tsup config: /Users/
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react/tsup.config.ts
|
|
10
10
|
[34mCLI[39m Target: es2019
|
|
11
11
|
[34mCLI[39m Cleaning output folder
|
|
12
12
|
[34mESM[39m Build start
|
|
13
13
|
[34mCJS[39m Build start
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[32mCJS[39m
|
|
17
|
-
[
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m237.00 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/privacy-center.js [22m[32m2.02 MB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 125ms
|
|
17
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m226.91 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/chunk-6A665OPR.mjs [22m[32m841.00 B[39m
|
|
19
|
+
[32mESM[39m [1mdist/privacy-center.mjs [22m[32m1.99 MB[39m
|
|
20
|
+
[32mESM[39m ⚡️ Build success in 131ms
|
|
18
21
|
DTS Build start
|
|
19
|
-
DTS ⚡️ Build success in
|
|
20
|
-
DTS dist/index.d.mts
|
|
21
|
-
DTS dist/
|
|
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
|
@@ -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
|
-
|
|
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;
|
package/dist/privacy-center.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|