@redacto.io/consent-sdk-react 9.5.0-beta.0 → 10.0.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 +22 -25
- package/CHANGELOG.md +16 -2
- package/dist/index.d.mts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +116 -11
- package/dist/index.mjs +116 -11
- package/dist/privacy-center.d.mts +76 -19
- package/dist/privacy-center.d.ts +76 -19
- package/dist/privacy-center.js +2022 -1378
- package/dist/privacy-center.mjs +1946 -1297
- package/package.json +1 -1
- package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +5 -0
- package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +29 -3
- package/src/RedactoNoticeConsent/api/index.ts +130 -1
- package/src/RedactoNoticeConsent/api/types.ts +33 -0
- package/src/RedactoNoticeConsent/types.ts +1 -0
- package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +3 -0
- package/src/RedactoNoticeConsentInline/api/index.ts +4 -1
- package/src/RedactoNoticeConsentInline/api/types.ts +1 -0
- package/src/RedactoNoticeConsentInline/types.ts +1 -0
- package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +8 -5
- package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +3 -1
- package/src/RedactoPrivacyCenter/api/actions.ts +15 -2
- package/src/RedactoPrivacyCenter/api/client.ts +146 -20
- package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +64 -35
- package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +12 -1
- package/src/RedactoPrivacyCenter/components/Form.tsx +63 -7
- package/src/RedactoPrivacyCenter/components/SelectUser.tsx +83 -0
- package/src/RedactoPrivacyCenter/components/SelectUserGate.tsx +193 -0
- package/src/RedactoPrivacyCenter/components/constant.ts +11 -0
- package/src/RedactoPrivacyCenter/components/groupHelpers.ts +64 -1
- package/src/RedactoPrivacyCenter/context/BaseUrlContext.tsx +8 -2
- package/src/RedactoPrivacyCenter/context/ProfileSwitchContext.tsx +15 -0
- package/src/RedactoPrivacyCenter/context/types.ts +1 -0
- package/src/RedactoPrivacyCenter/lib/api.ts +8 -0
- package/src/RedactoPrivacyCenter/lib/constants.ts +9 -0
- package/src/RedactoPrivacyCenter/lib/types.ts +63 -1
- package/src/RedactoPrivacyCenter/locales/as/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/bho/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/bn/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/brx/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/doi/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/en/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/gom/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/gu/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/hi/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/kn/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/ks/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/mai/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/ml/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/mr/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/ne/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/or/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/pa/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/sa/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/sat/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/sd/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/ta/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/te/translation.json +7 -1
- package/src/RedactoPrivacyCenter/locales/ur/translation.json +7 -1
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +105 -0
- package/tests/Form.test.tsx +58 -7
- package/tests/consentClient.test.ts +171 -0
- package/tests/manageConsentServer.test.ts +38 -0
- package/tests/mocks.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -31,9 +31,14 @@ type BaseRequest = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Consent service client factory.
|
|
33
33
|
* Creates a client instance with a specific base URL.
|
|
34
|
-
* @param baseUrl - Consent server base URL
|
|
34
|
+
* @param baseUrl - Consent server base URL (Python service, e.g. http://host/consent)
|
|
35
|
+
* @param ledgerBaseUrl - Go ledger base URL (e.g. http://host:8090/consent-ledger).
|
|
36
|
+
* Used for user-consents reads/writes served from the ledger's `/public/...` paths.
|
|
37
|
+
* When omitted, those calls fall back to the legacy Python
|
|
38
|
+
* `/dsar/privacy-center` endpoints and payloads (pre-ledger behavior), so
|
|
39
|
+
* integrations without a deployed ledger keep working.
|
|
35
40
|
*/
|
|
36
|
-
declare function createConsentClient(baseUrl: string): {
|
|
41
|
+
declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
37
42
|
/**
|
|
38
43
|
* Get form data (privacy center)
|
|
39
44
|
*/
|
|
@@ -92,13 +97,40 @@ declare function createConsentClient(baseUrl: string): {
|
|
|
92
97
|
nominator_uuid?: string;
|
|
93
98
|
}, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
94
99
|
/**
|
|
95
|
-
* Manage consent (privacy center) - revoke, regrant, or renew
|
|
100
|
+
* Manage consent (privacy center) - revoke, regrant, or renew.
|
|
101
|
+
*
|
|
102
|
+
* The Go ledger has no manage-consent route, so with a ledger configured
|
|
103
|
+
* this is expressed as a `partial` submit-consent on the ledger — mirroring
|
|
104
|
+
* the Python dual-write relay (`build_consent_management_payload`): the
|
|
105
|
+
* affected purpose is re-submitted with `selected: false` to revoke or
|
|
106
|
+
* `selected: true` to regrant/renew, and `partial: true` so the rest of the
|
|
107
|
+
* notice's purposes are left untouched. The principal is resolved from the
|
|
108
|
+
* JWT, so no `contact`/identifiers are sent in the body, and
|
|
109
|
+
* `consent_event_uuid` is omitted so the ledger mints a fresh event.
|
|
110
|
+
*
|
|
111
|
+
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
112
|
+
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
96
113
|
*/
|
|
97
|
-
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], productUuid?: string
|
|
114
|
+
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], productUuid?: string, noticeUuid?: string, dataElements?: Array<{
|
|
115
|
+
uuid: string;
|
|
116
|
+
selected: boolean;
|
|
117
|
+
}>): Promise<unknown>;
|
|
98
118
|
/**
|
|
99
119
|
* Get activities (privacy center)
|
|
100
120
|
*/
|
|
101
121
|
getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
122
|
+
/**
|
|
123
|
+
* List all data principals that share this session's contact
|
|
124
|
+
* (shared-contact profile picker). Identity is derived server-side from the
|
|
125
|
+
* JWT — the caller sends nothing but its bearer token.
|
|
126
|
+
*/
|
|
127
|
+
listIdentities(baseRequest: BaseRequest, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<IdentityListResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Re-scope the session to a chosen principal uuid (must be one of the
|
|
130
|
+
* principals sharing this session's contact). Returns fresh access/refresh
|
|
131
|
+
* tokens scoped to that principal.
|
|
132
|
+
*/
|
|
133
|
+
selectPrincipal(baseRequest: BaseRequest, principalUuid: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<SelectPrincipalResponse>;
|
|
102
134
|
/**
|
|
103
135
|
* Get receipts (privacy center) — consent receipts for the authenticated user
|
|
104
136
|
*/
|
|
@@ -358,6 +390,7 @@ type PurposeItem = {
|
|
|
358
390
|
method: string;
|
|
359
391
|
data_elements: ConsentDataElement[];
|
|
360
392
|
link_reason: string | null;
|
|
393
|
+
notice_uuid: string | null;
|
|
361
394
|
};
|
|
362
395
|
type ConsentGroup = {
|
|
363
396
|
product_uuid: string;
|
|
@@ -592,6 +625,21 @@ type NotificationQueryParams = {
|
|
|
592
625
|
include_summary?: boolean;
|
|
593
626
|
language?: string;
|
|
594
627
|
};
|
|
628
|
+
type IdentityCandidate = Readonly<{
|
|
629
|
+
uuid: string;
|
|
630
|
+
org_user_id?: string | null;
|
|
631
|
+
primary_email?: string | null;
|
|
632
|
+
primary_mobile?: string | null;
|
|
633
|
+
created_at?: string | null;
|
|
634
|
+
}>;
|
|
635
|
+
type IdentityListResponse = Readonly<{
|
|
636
|
+
identities: IdentityCandidate[];
|
|
637
|
+
}>;
|
|
638
|
+
type SelectPrincipalResponse = Readonly<{
|
|
639
|
+
token: string;
|
|
640
|
+
refresh_token: string;
|
|
641
|
+
expires_at?: string;
|
|
642
|
+
}>;
|
|
595
643
|
|
|
596
644
|
type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications' | 'receipts';
|
|
597
645
|
interface NavigationContextType {
|
|
@@ -604,11 +652,12 @@ interface NavigationContextType {
|
|
|
604
652
|
declare const NavigationProvider: ({ children, initialPage }: {
|
|
605
653
|
children: ReactNode;
|
|
606
654
|
initialPage?: InternalPage;
|
|
607
|
-
}) =>
|
|
655
|
+
}) => react.JSX.Element;
|
|
608
656
|
declare const useInternalNavigation: () => NavigationContextType;
|
|
609
657
|
|
|
610
658
|
interface RedactoPrivacyCenterProps {
|
|
611
659
|
baseUrl: string;
|
|
660
|
+
ledgerBaseUrl?: string;
|
|
612
661
|
slug: string;
|
|
613
662
|
accessToken: string;
|
|
614
663
|
refreshToken: string;
|
|
@@ -616,26 +665,26 @@ interface RedactoPrivacyCenterProps {
|
|
|
616
665
|
initialPage?: InternalPage;
|
|
617
666
|
onBack?: 'back' | 'signout';
|
|
618
667
|
}
|
|
619
|
-
declare function RedactoPrivacyCenter({ baseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps):
|
|
668
|
+
declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react.JSX.Element;
|
|
620
669
|
|
|
621
670
|
interface PrivacyCenterLayoutProps {
|
|
622
671
|
children: ReactNode;
|
|
623
672
|
slug: string;
|
|
624
673
|
onBack?: 'back' | 'signout';
|
|
625
674
|
}
|
|
626
|
-
declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps):
|
|
675
|
+
declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react.JSX.Element;
|
|
627
676
|
|
|
628
|
-
declare function PrivacyCenterHomePage():
|
|
677
|
+
declare function PrivacyCenterHomePage(): react.JSX.Element;
|
|
629
678
|
|
|
630
|
-
declare function PrivacyCenterConsentManagerPage():
|
|
679
|
+
declare function PrivacyCenterConsentManagerPage(): react.JSX.Element;
|
|
631
680
|
|
|
632
|
-
declare function PrivacyCenterFormPage():
|
|
681
|
+
declare function PrivacyCenterFormPage(): react.JSX.Element;
|
|
633
682
|
|
|
634
|
-
declare function PrivacyCenterActivityPage():
|
|
683
|
+
declare function PrivacyCenterActivityPage(): react.JSX.Element;
|
|
635
684
|
|
|
636
|
-
declare const PrivacyCenterCaseDetailsPage: () =>
|
|
685
|
+
declare const PrivacyCenterCaseDetailsPage: () => react.JSX.Element | null;
|
|
637
686
|
|
|
638
|
-
declare const NotificationsPage: () =>
|
|
687
|
+
declare const NotificationsPage: () => react.JSX.Element;
|
|
639
688
|
|
|
640
689
|
type AuthContextValue = Readonly<{
|
|
641
690
|
accessToken: string;
|
|
@@ -646,15 +695,18 @@ type AuthContextValue = Readonly<{
|
|
|
646
695
|
}>;
|
|
647
696
|
type BaseUrlContextValue = Readonly<{
|
|
648
697
|
baseUrl: string;
|
|
698
|
+
ledgerBaseUrl?: string;
|
|
649
699
|
consentClient: ReturnType<typeof createConsentClient>;
|
|
650
700
|
}>;
|
|
651
701
|
|
|
652
|
-
declare const BaseUrlProvider: ({ children, baseUrl, }: {
|
|
702
|
+
declare const BaseUrlProvider: ({ children, baseUrl, ledgerBaseUrl, }: {
|
|
653
703
|
children: ReactNode;
|
|
654
704
|
baseUrl: string;
|
|
655
|
-
|
|
705
|
+
ledgerBaseUrl?: string;
|
|
706
|
+
}) => react.JSX.Element;
|
|
656
707
|
declare const useBaseUrl: () => Readonly<{
|
|
657
708
|
baseUrl: string;
|
|
709
|
+
ledgerBaseUrl?: string;
|
|
658
710
|
consentClient: ReturnType<typeof createConsentClient>;
|
|
659
711
|
}>;
|
|
660
712
|
|
|
@@ -801,7 +853,7 @@ type FetchGroupPurposesParams = {
|
|
|
801
853
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
802
854
|
};
|
|
803
855
|
declare const fetchGroupPurposes: (params: FetchGroupPurposesParams) => Promise<GroupPurposesOut | null>;
|
|
804
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, productUuid, }: {
|
|
856
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, }: {
|
|
805
857
|
organizationId: string;
|
|
806
858
|
workspaceId: string;
|
|
807
859
|
purposeId: string;
|
|
@@ -812,11 +864,16 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
812
864
|
nominatorContact?: string;
|
|
813
865
|
dataElementUuids?: string[];
|
|
814
866
|
productUuid?: string;
|
|
867
|
+
noticeUuid?: string;
|
|
868
|
+
dataElements?: Array<{
|
|
869
|
+
uuid: string;
|
|
870
|
+
selected: boolean;
|
|
871
|
+
}>;
|
|
815
872
|
}) => Promise<boolean | null>;
|
|
816
873
|
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
817
874
|
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
|
818
875
|
|
|
819
|
-
declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<CaseRequest[]
|
|
876
|
+
declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<NoInfer<CaseRequest[]>, Error>;
|
|
820
877
|
|
|
821
878
|
interface AuthProviderProps {
|
|
822
879
|
children: ReactNode;
|
|
@@ -824,7 +881,7 @@ interface AuthProviderProps {
|
|
|
824
881
|
refreshToken: string;
|
|
825
882
|
onError: (error: Error) => boolean;
|
|
826
883
|
}
|
|
827
|
-
declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) =>
|
|
884
|
+
declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) => react.JSX.Element;
|
|
828
885
|
declare const useAuth: () => AuthContextValue;
|
|
829
886
|
|
|
830
887
|
/**
|
package/dist/privacy-center.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
|
|
@@ -31,9 +31,14 @@ type BaseRequest = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Consent service client factory.
|
|
33
33
|
* Creates a client instance with a specific base URL.
|
|
34
|
-
* @param baseUrl - Consent server base URL
|
|
34
|
+
* @param baseUrl - Consent server base URL (Python service, e.g. http://host/consent)
|
|
35
|
+
* @param ledgerBaseUrl - Go ledger base URL (e.g. http://host:8090/consent-ledger).
|
|
36
|
+
* Used for user-consents reads/writes served from the ledger's `/public/...` paths.
|
|
37
|
+
* When omitted, those calls fall back to the legacy Python
|
|
38
|
+
* `/dsar/privacy-center` endpoints and payloads (pre-ledger behavior), so
|
|
39
|
+
* integrations without a deployed ledger keep working.
|
|
35
40
|
*/
|
|
36
|
-
declare function createConsentClient(baseUrl: string): {
|
|
41
|
+
declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
37
42
|
/**
|
|
38
43
|
* Get form data (privacy center)
|
|
39
44
|
*/
|
|
@@ -92,13 +97,40 @@ declare function createConsentClient(baseUrl: string): {
|
|
|
92
97
|
nominator_uuid?: string;
|
|
93
98
|
}, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
94
99
|
/**
|
|
95
|
-
* Manage consent (privacy center) - revoke, regrant, or renew
|
|
100
|
+
* Manage consent (privacy center) - revoke, regrant, or renew.
|
|
101
|
+
*
|
|
102
|
+
* The Go ledger has no manage-consent route, so with a ledger configured
|
|
103
|
+
* this is expressed as a `partial` submit-consent on the ledger — mirroring
|
|
104
|
+
* the Python dual-write relay (`build_consent_management_payload`): the
|
|
105
|
+
* affected purpose is re-submitted with `selected: false` to revoke or
|
|
106
|
+
* `selected: true` to regrant/renew, and `partial: true` so the rest of the
|
|
107
|
+
* notice's purposes are left untouched. The principal is resolved from the
|
|
108
|
+
* JWT, so no `contact`/identifiers are sent in the body, and
|
|
109
|
+
* `consent_event_uuid` is omitted so the ledger mints a fresh event.
|
|
110
|
+
*
|
|
111
|
+
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
112
|
+
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
96
113
|
*/
|
|
97
|
-
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], productUuid?: string
|
|
114
|
+
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], productUuid?: string, noticeUuid?: string, dataElements?: Array<{
|
|
115
|
+
uuid: string;
|
|
116
|
+
selected: boolean;
|
|
117
|
+
}>): Promise<unknown>;
|
|
98
118
|
/**
|
|
99
119
|
* Get activities (privacy center)
|
|
100
120
|
*/
|
|
101
121
|
getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
122
|
+
/**
|
|
123
|
+
* List all data principals that share this session's contact
|
|
124
|
+
* (shared-contact profile picker). Identity is derived server-side from the
|
|
125
|
+
* JWT — the caller sends nothing but its bearer token.
|
|
126
|
+
*/
|
|
127
|
+
listIdentities(baseRequest: BaseRequest, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<IdentityListResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Re-scope the session to a chosen principal uuid (must be one of the
|
|
130
|
+
* principals sharing this session's contact). Returns fresh access/refresh
|
|
131
|
+
* tokens scoped to that principal.
|
|
132
|
+
*/
|
|
133
|
+
selectPrincipal(baseRequest: BaseRequest, principalUuid: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<SelectPrincipalResponse>;
|
|
102
134
|
/**
|
|
103
135
|
* Get receipts (privacy center) — consent receipts for the authenticated user
|
|
104
136
|
*/
|
|
@@ -358,6 +390,7 @@ type PurposeItem = {
|
|
|
358
390
|
method: string;
|
|
359
391
|
data_elements: ConsentDataElement[];
|
|
360
392
|
link_reason: string | null;
|
|
393
|
+
notice_uuid: string | null;
|
|
361
394
|
};
|
|
362
395
|
type ConsentGroup = {
|
|
363
396
|
product_uuid: string;
|
|
@@ -592,6 +625,21 @@ type NotificationQueryParams = {
|
|
|
592
625
|
include_summary?: boolean;
|
|
593
626
|
language?: string;
|
|
594
627
|
};
|
|
628
|
+
type IdentityCandidate = Readonly<{
|
|
629
|
+
uuid: string;
|
|
630
|
+
org_user_id?: string | null;
|
|
631
|
+
primary_email?: string | null;
|
|
632
|
+
primary_mobile?: string | null;
|
|
633
|
+
created_at?: string | null;
|
|
634
|
+
}>;
|
|
635
|
+
type IdentityListResponse = Readonly<{
|
|
636
|
+
identities: IdentityCandidate[];
|
|
637
|
+
}>;
|
|
638
|
+
type SelectPrincipalResponse = Readonly<{
|
|
639
|
+
token: string;
|
|
640
|
+
refresh_token: string;
|
|
641
|
+
expires_at?: string;
|
|
642
|
+
}>;
|
|
595
643
|
|
|
596
644
|
type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications' | 'receipts';
|
|
597
645
|
interface NavigationContextType {
|
|
@@ -604,11 +652,12 @@ interface NavigationContextType {
|
|
|
604
652
|
declare const NavigationProvider: ({ children, initialPage }: {
|
|
605
653
|
children: ReactNode;
|
|
606
654
|
initialPage?: InternalPage;
|
|
607
|
-
}) =>
|
|
655
|
+
}) => react.JSX.Element;
|
|
608
656
|
declare const useInternalNavigation: () => NavigationContextType;
|
|
609
657
|
|
|
610
658
|
interface RedactoPrivacyCenterProps {
|
|
611
659
|
baseUrl: string;
|
|
660
|
+
ledgerBaseUrl?: string;
|
|
612
661
|
slug: string;
|
|
613
662
|
accessToken: string;
|
|
614
663
|
refreshToken: string;
|
|
@@ -616,26 +665,26 @@ interface RedactoPrivacyCenterProps {
|
|
|
616
665
|
initialPage?: InternalPage;
|
|
617
666
|
onBack?: 'back' | 'signout';
|
|
618
667
|
}
|
|
619
|
-
declare function RedactoPrivacyCenter({ baseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps):
|
|
668
|
+
declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react.JSX.Element;
|
|
620
669
|
|
|
621
670
|
interface PrivacyCenterLayoutProps {
|
|
622
671
|
children: ReactNode;
|
|
623
672
|
slug: string;
|
|
624
673
|
onBack?: 'back' | 'signout';
|
|
625
674
|
}
|
|
626
|
-
declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps):
|
|
675
|
+
declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react.JSX.Element;
|
|
627
676
|
|
|
628
|
-
declare function PrivacyCenterHomePage():
|
|
677
|
+
declare function PrivacyCenterHomePage(): react.JSX.Element;
|
|
629
678
|
|
|
630
|
-
declare function PrivacyCenterConsentManagerPage():
|
|
679
|
+
declare function PrivacyCenterConsentManagerPage(): react.JSX.Element;
|
|
631
680
|
|
|
632
|
-
declare function PrivacyCenterFormPage():
|
|
681
|
+
declare function PrivacyCenterFormPage(): react.JSX.Element;
|
|
633
682
|
|
|
634
|
-
declare function PrivacyCenterActivityPage():
|
|
683
|
+
declare function PrivacyCenterActivityPage(): react.JSX.Element;
|
|
635
684
|
|
|
636
|
-
declare const PrivacyCenterCaseDetailsPage: () =>
|
|
685
|
+
declare const PrivacyCenterCaseDetailsPage: () => react.JSX.Element | null;
|
|
637
686
|
|
|
638
|
-
declare const NotificationsPage: () =>
|
|
687
|
+
declare const NotificationsPage: () => react.JSX.Element;
|
|
639
688
|
|
|
640
689
|
type AuthContextValue = Readonly<{
|
|
641
690
|
accessToken: string;
|
|
@@ -646,15 +695,18 @@ type AuthContextValue = Readonly<{
|
|
|
646
695
|
}>;
|
|
647
696
|
type BaseUrlContextValue = Readonly<{
|
|
648
697
|
baseUrl: string;
|
|
698
|
+
ledgerBaseUrl?: string;
|
|
649
699
|
consentClient: ReturnType<typeof createConsentClient>;
|
|
650
700
|
}>;
|
|
651
701
|
|
|
652
|
-
declare const BaseUrlProvider: ({ children, baseUrl, }: {
|
|
702
|
+
declare const BaseUrlProvider: ({ children, baseUrl, ledgerBaseUrl, }: {
|
|
653
703
|
children: ReactNode;
|
|
654
704
|
baseUrl: string;
|
|
655
|
-
|
|
705
|
+
ledgerBaseUrl?: string;
|
|
706
|
+
}) => react.JSX.Element;
|
|
656
707
|
declare const useBaseUrl: () => Readonly<{
|
|
657
708
|
baseUrl: string;
|
|
709
|
+
ledgerBaseUrl?: string;
|
|
658
710
|
consentClient: ReturnType<typeof createConsentClient>;
|
|
659
711
|
}>;
|
|
660
712
|
|
|
@@ -801,7 +853,7 @@ type FetchGroupPurposesParams = {
|
|
|
801
853
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
802
854
|
};
|
|
803
855
|
declare const fetchGroupPurposes: (params: FetchGroupPurposesParams) => Promise<GroupPurposesOut | null>;
|
|
804
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, productUuid, }: {
|
|
856
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, }: {
|
|
805
857
|
organizationId: string;
|
|
806
858
|
workspaceId: string;
|
|
807
859
|
purposeId: string;
|
|
@@ -812,11 +864,16 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
812
864
|
nominatorContact?: string;
|
|
813
865
|
dataElementUuids?: string[];
|
|
814
866
|
productUuid?: string;
|
|
867
|
+
noticeUuid?: string;
|
|
868
|
+
dataElements?: Array<{
|
|
869
|
+
uuid: string;
|
|
870
|
+
selected: boolean;
|
|
871
|
+
}>;
|
|
815
872
|
}) => Promise<boolean | null>;
|
|
816
873
|
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
817
874
|
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
|
818
875
|
|
|
819
|
-
declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<CaseRequest[]
|
|
876
|
+
declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<NoInfer<CaseRequest[]>, Error>;
|
|
820
877
|
|
|
821
878
|
interface AuthProviderProps {
|
|
822
879
|
children: ReactNode;
|
|
@@ -824,7 +881,7 @@ interface AuthProviderProps {
|
|
|
824
881
|
refreshToken: string;
|
|
825
882
|
onError: (error: Error) => boolean;
|
|
826
883
|
}
|
|
827
|
-
declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) =>
|
|
884
|
+
declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) => react.JSX.Element;
|
|
828
885
|
declare const useAuth: () => AuthContextValue;
|
|
829
886
|
|
|
830
887
|
/**
|