@redacto.io/consent-sdk-react-native 5.0.0-beta.1 → 5.0.0-beta.11
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/README.md +75 -0
- package/dist/chunk-B2TXWC2C.mjs +60 -0
- package/dist/index.d.mts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +239 -190
- package/dist/index.mjs +196 -191
- package/dist/privacy-center.d.mts +147 -63
- package/dist/privacy-center.d.ts +147 -63
- package/dist/privacy-center.js +1614 -713
- package/dist/privacy-center.mjs +1551 -687
- package/package.json +10 -9
- package/LICENSE +0 -176
- package/dist/chunk-Y6FXYEAI.mjs +0 -10
|
@@ -5,6 +5,63 @@ import * as react_native from 'react-native';
|
|
|
5
5
|
import { StyleProp, ViewStyle, TextStyle, KeyboardTypeOptions, DimensionValue, Animated } from 'react-native';
|
|
6
6
|
import * as lucide_react_native from 'lucide-react-native';
|
|
7
7
|
|
|
8
|
+
interface ThemeColors {
|
|
9
|
+
background: string;
|
|
10
|
+
/** Page canvas. Flat mode keeps this equal to background. */
|
|
11
|
+
canvas: string;
|
|
12
|
+
surface: string;
|
|
13
|
+
text: string;
|
|
14
|
+
textSecondary: string;
|
|
15
|
+
border: string;
|
|
16
|
+
primary: string;
|
|
17
|
+
primaryText: string;
|
|
18
|
+
error: string;
|
|
19
|
+
success: string;
|
|
20
|
+
warning: string;
|
|
21
|
+
/** Hyperlink / accent text color. Falls back to primary. */
|
|
22
|
+
link: string;
|
|
23
|
+
/** Secondary brand color. Falls back to primary. */
|
|
24
|
+
secondary: string;
|
|
25
|
+
/** Quiet gray app background that cards sit on. */
|
|
26
|
+
canvasSubtle: string;
|
|
27
|
+
/** Secondary surface fill — inset rows, pressed states, skeletons. */
|
|
28
|
+
surfaceAlt: string;
|
|
29
|
+
/** Separator lighter than `border` (used inside cards). */
|
|
30
|
+
hairline: string;
|
|
31
|
+
/** Soft tint of `primary` for icon tiles / active pills. */
|
|
32
|
+
primarySoft: string;
|
|
33
|
+
/** Foreground (icon/label) color used on `primarySoft`. */
|
|
34
|
+
primaryOn: string;
|
|
35
|
+
/** Informational accent (badges / info states). */
|
|
36
|
+
info: string;
|
|
37
|
+
/** Soft status tints for badges, empty states, and icon tiles. */
|
|
38
|
+
successSoft: string;
|
|
39
|
+
warningSoft: string;
|
|
40
|
+
errorSoft: string;
|
|
41
|
+
infoSoft: string;
|
|
42
|
+
/** Scrim behind modals / bottom sheets. */
|
|
43
|
+
overlay: string;
|
|
44
|
+
}
|
|
45
|
+
type BrandingMeta = {
|
|
46
|
+
logo_url: string | null;
|
|
47
|
+
icon_url: string | null;
|
|
48
|
+
brand_name: string;
|
|
49
|
+
hide_platform_branding: boolean;
|
|
50
|
+
};
|
|
51
|
+
interface ThemeContextType {
|
|
52
|
+
colors: ThemeColors;
|
|
53
|
+
/** Org branding metadata (logo, brand name). Null until/unless it resolves. */
|
|
54
|
+
branding: BrandingMeta | null;
|
|
55
|
+
/** True while org branding is being fetched (used to gate first paint). */
|
|
56
|
+
isLoading: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare function ThemeProvider({ children, slug, baseUrl, }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
slug?: string;
|
|
61
|
+
baseUrl?: string;
|
|
62
|
+
}): React.JSX.Element;
|
|
63
|
+
declare function useTheme(): ThemeContextType;
|
|
64
|
+
|
|
8
65
|
type Workspace = {
|
|
9
66
|
uuid: string;
|
|
10
67
|
suid: string;
|
|
@@ -244,6 +301,7 @@ type UserConsent = {
|
|
|
244
301
|
product_name?: string;
|
|
245
302
|
product_description?: string | null;
|
|
246
303
|
nominator_info?: NominatorInfo;
|
|
304
|
+
revoke_warning_message?: string | null;
|
|
247
305
|
notice_uuid?: string | null;
|
|
248
306
|
};
|
|
249
307
|
type NominatorInfo = {
|
|
@@ -262,6 +320,12 @@ type ConsentHistoryStatusSummary = {
|
|
|
262
320
|
};
|
|
263
321
|
type PurposeItem = {
|
|
264
322
|
purpose_uuid: string;
|
|
323
|
+
/**
|
|
324
|
+
* Alias emitted by the legacy Python user-consents payload, which keys some
|
|
325
|
+
* purposes as `uuid` instead of `purpose_uuid`. Optional: the Go ledger
|
|
326
|
+
* always sends `purpose_uuid`.
|
|
327
|
+
*/
|
|
328
|
+
uuid?: string;
|
|
265
329
|
name: string;
|
|
266
330
|
description: string | null;
|
|
267
331
|
status: ConsentStatusEnum | string;
|
|
@@ -270,6 +334,7 @@ type PurposeItem = {
|
|
|
270
334
|
method: string;
|
|
271
335
|
data_elements: ConsentDataElement[];
|
|
272
336
|
link_reason: string | null;
|
|
337
|
+
revoke_warning_message?: string | null;
|
|
273
338
|
notice_uuid?: string | null;
|
|
274
339
|
};
|
|
275
340
|
type ConsentGroup = {
|
|
@@ -421,6 +486,29 @@ type CaseDetailsTab = Readonly<{
|
|
|
421
486
|
id: TabId;
|
|
422
487
|
label: string;
|
|
423
488
|
}>;
|
|
489
|
+
/**
|
|
490
|
+
* One data principal sharing this session's contact.
|
|
491
|
+
*
|
|
492
|
+
* `org_user_id` is unique per principal within the org/workspace, so it is the
|
|
493
|
+
* reliable way to tell profiles apart when the email and mobile are identical —
|
|
494
|
+
* which is the whole point of a shared contact.
|
|
495
|
+
*/
|
|
496
|
+
type IdentityCandidate = Readonly<{
|
|
497
|
+
uuid: string;
|
|
498
|
+
org_user_id?: string | null;
|
|
499
|
+
primary_email?: string | null;
|
|
500
|
+
primary_mobile?: string | null;
|
|
501
|
+
created_at?: string | null;
|
|
502
|
+
}>;
|
|
503
|
+
type IdentityListResponse = Readonly<{
|
|
504
|
+
identities: IdentityCandidate[];
|
|
505
|
+
}>;
|
|
506
|
+
/** Fresh tokens scoped to the chosen principal. */
|
|
507
|
+
type SelectPrincipalResponse = Readonly<{
|
|
508
|
+
token: string;
|
|
509
|
+
refresh_token: string;
|
|
510
|
+
expires_at?: string;
|
|
511
|
+
}>;
|
|
424
512
|
|
|
425
513
|
type InternalPage = 'home' | 'consent-manager' | 'form' | 'activity' | 'receipts' | 'case-details' | 'notifications';
|
|
426
514
|
interface NavigationContextType {
|
|
@@ -449,15 +537,38 @@ interface RedactoPrivacyCenterProps {
|
|
|
449
537
|
* Accepted for backwards compatibility but ignored.
|
|
450
538
|
*/
|
|
451
539
|
theme?: 'light' | 'dark';
|
|
452
|
-
|
|
453
|
-
|
|
540
|
+
/** JWT access token. Optional so sandbox mode (see `token`) can omit it. */
|
|
541
|
+
accessToken?: string;
|
|
542
|
+
/** JWT refresh token. Optional; used by the OTP-refresh loop in the JWT flow. */
|
|
543
|
+
refreshToken?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Sandbox PoC: a pasted static token. When set, the Privacy Center runs
|
|
546
|
+
* against the sandbox with no JWT — it sends the single `X-Consent-Token`
|
|
547
|
+
* header, carries the acting identity (`email` || `mobile`) in each request's
|
|
548
|
+
* own payload, takes org/workspace from `organisationUuid`/`workspaceUuid`,
|
|
549
|
+
* and never calls `/otp/refresh`.
|
|
550
|
+
*/
|
|
551
|
+
token?: string;
|
|
552
|
+
/** Sandbox test subject email (carried in the request payload when set). */
|
|
553
|
+
email?: string;
|
|
554
|
+
/** Sandbox test subject mobile (fallback subject when `email` is absent). */
|
|
555
|
+
mobile?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Sandbox UCIC: the client's own user id / org_user_id, e.g. a UUID or
|
|
558
|
+
* customer code; optional third identifier alongside email/mobile.
|
|
559
|
+
*/
|
|
560
|
+
ucic?: string;
|
|
561
|
+
/** Sandbox org UUID (replaces the JWT-decoded org in sandbox mode). */
|
|
562
|
+
organisationUuid?: string;
|
|
563
|
+
/** Sandbox workspace UUID (replaces the JWT-decoded workspace in sandbox mode). */
|
|
564
|
+
workspaceUuid?: string;
|
|
454
565
|
onError: (error: Error) => boolean;
|
|
455
566
|
initialPage?: InternalPage;
|
|
456
567
|
/** Optional deep-link: open a specific case (use with initialPage='case-details'). */
|
|
457
568
|
initialCaseUuid?: string;
|
|
458
569
|
onBack?: 'back' | 'signout';
|
|
459
570
|
}
|
|
460
|
-
declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, theme: _theme, accessToken, refreshToken, onError, initialPage, initialCaseUuid, onBack, }: RedactoPrivacyCenterProps): React.JSX.Element;
|
|
571
|
+
declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, theme: _theme, accessToken, refreshToken, token, email, mobile, ucic, organisationUuid, workspaceUuid, onError, initialPage, initialCaseUuid, onBack, }: RedactoPrivacyCenterProps): React.JSX.Element;
|
|
461
572
|
|
|
462
573
|
declare function ConsentManager(): React__default.JSX.Element;
|
|
463
574
|
|
|
@@ -636,11 +747,23 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
|
636
747
|
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], noticeUuid?: string, dataElements?: Array<{
|
|
637
748
|
uuid: string;
|
|
638
749
|
selected: boolean;
|
|
639
|
-
}
|
|
750
|
+
}>, language?: string): Promise<unknown>;
|
|
640
751
|
/**
|
|
641
752
|
* Get activities (privacy center)
|
|
642
753
|
*/
|
|
643
754
|
getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
755
|
+
/**
|
|
756
|
+
* List all data principals that share this session's contact
|
|
757
|
+
* (shared-contact profile picker). Identity is derived server-side from the
|
|
758
|
+
* JWT — the caller sends nothing but its bearer token.
|
|
759
|
+
*/
|
|
760
|
+
listIdentities(baseRequest: BaseRequest, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<IdentityListResponse>;
|
|
761
|
+
/**
|
|
762
|
+
* Re-scope the session to a chosen principal uuid (must be one of the
|
|
763
|
+
* principals sharing this session's contact). Returns fresh access/refresh
|
|
764
|
+
* tokens scoped to that principal.
|
|
765
|
+
*/
|
|
766
|
+
selectPrincipal(baseRequest: BaseRequest, principalUuid: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<SelectPrincipalResponse>;
|
|
644
767
|
/**
|
|
645
768
|
* Get receipts (privacy center)
|
|
646
769
|
*/
|
|
@@ -772,7 +895,7 @@ type FetchUserConsentsParams = {
|
|
|
772
895
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
773
896
|
};
|
|
774
897
|
declare const fetchUserConsents: (params: FetchUserConsentsParams) => Promise<UserConsentDetail | null>;
|
|
775
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, }: {
|
|
898
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, language, }: {
|
|
776
899
|
organizationId: string;
|
|
777
900
|
workspaceId: string;
|
|
778
901
|
purposeId: string;
|
|
@@ -787,6 +910,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
787
910
|
uuid: string;
|
|
788
911
|
selected: boolean;
|
|
789
912
|
}>;
|
|
913
|
+
language?: string;
|
|
790
914
|
}) => Promise<boolean | null>;
|
|
791
915
|
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
792
916
|
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
|
@@ -812,68 +936,28 @@ interface AuthProviderProps {
|
|
|
812
936
|
children: ReactNode;
|
|
813
937
|
accessToken: string;
|
|
814
938
|
refreshToken: string;
|
|
939
|
+
/**
|
|
940
|
+
* Sandbox PoC: when set, the Privacy Center skips the JWT entirely — it seeds
|
|
941
|
+
* org/workspace/subject from the props below, sends the single
|
|
942
|
+
* `X-Consent-Token` header, carries the acting identity in each request's own
|
|
943
|
+
* payload, and never calls `/otp/refresh`.
|
|
944
|
+
*/
|
|
945
|
+
token?: string;
|
|
946
|
+
/** Sandbox UCIC — the client's own user id (`org_user_id`); takes precedence over the subject. */
|
|
947
|
+
sandboxUcic?: string;
|
|
948
|
+
/** Sandbox subject (email or mobile) — carried in the request payload. */
|
|
949
|
+
sandboxSubject?: string;
|
|
950
|
+
/** Sandbox org UUID (replaces the JWT-decoded org). */
|
|
951
|
+
organisationUuid?: string;
|
|
952
|
+
/** Sandbox workspace UUID (replaces the JWT-decoded workspace). */
|
|
953
|
+
workspaceUuid?: string;
|
|
954
|
+
/** Organisation slug — used to seed the sandbox config. */
|
|
955
|
+
slug?: string;
|
|
815
956
|
onError: (error: Error) => boolean;
|
|
816
957
|
}
|
|
817
|
-
declare function AuthProvider(
|
|
958
|
+
declare function AuthProvider(props: AuthProviderProps): React.JSX.Element;
|
|
818
959
|
declare function useAuth(): AuthContextType;
|
|
819
960
|
|
|
820
|
-
interface ThemeColors {
|
|
821
|
-
background: string;
|
|
822
|
-
/** Page canvas. Flat mode keeps this equal to background. */
|
|
823
|
-
canvas: string;
|
|
824
|
-
surface: string;
|
|
825
|
-
text: string;
|
|
826
|
-
textSecondary: string;
|
|
827
|
-
border: string;
|
|
828
|
-
primary: string;
|
|
829
|
-
primaryText: string;
|
|
830
|
-
error: string;
|
|
831
|
-
success: string;
|
|
832
|
-
warning: string;
|
|
833
|
-
/** Hyperlink / accent text color. Falls back to primary. */
|
|
834
|
-
link: string;
|
|
835
|
-
/** Secondary brand color. Falls back to primary. */
|
|
836
|
-
secondary: string;
|
|
837
|
-
/** Quiet gray app background that cards sit on. */
|
|
838
|
-
canvasSubtle: string;
|
|
839
|
-
/** Secondary surface fill — inset rows, pressed states, skeletons. */
|
|
840
|
-
surfaceAlt: string;
|
|
841
|
-
/** Separator lighter than `border` (used inside cards). */
|
|
842
|
-
hairline: string;
|
|
843
|
-
/** Soft tint of `primary` for icon tiles / active pills. */
|
|
844
|
-
primarySoft: string;
|
|
845
|
-
/** Foreground (icon/label) color used on `primarySoft`. */
|
|
846
|
-
primaryOn: string;
|
|
847
|
-
/** Informational accent (badges / info states). */
|
|
848
|
-
info: string;
|
|
849
|
-
/** Soft status tints for badges, empty states, and icon tiles. */
|
|
850
|
-
successSoft: string;
|
|
851
|
-
warningSoft: string;
|
|
852
|
-
errorSoft: string;
|
|
853
|
-
infoSoft: string;
|
|
854
|
-
/** Scrim behind modals / bottom sheets. */
|
|
855
|
-
overlay: string;
|
|
856
|
-
}
|
|
857
|
-
type BrandingMeta = {
|
|
858
|
-
logo_url: string | null;
|
|
859
|
-
icon_url: string | null;
|
|
860
|
-
brand_name: string;
|
|
861
|
-
hide_platform_branding: boolean;
|
|
862
|
-
};
|
|
863
|
-
interface ThemeContextType {
|
|
864
|
-
colors: ThemeColors;
|
|
865
|
-
/** Org branding metadata (logo, brand name). Null until/unless it resolves. */
|
|
866
|
-
branding: BrandingMeta | null;
|
|
867
|
-
/** True while org branding is being fetched (used to gate first paint). */
|
|
868
|
-
isLoading: boolean;
|
|
869
|
-
}
|
|
870
|
-
declare function ThemeProvider({ children, slug, baseUrl, }: {
|
|
871
|
-
children: ReactNode;
|
|
872
|
-
slug?: string;
|
|
873
|
-
baseUrl?: string;
|
|
874
|
-
}): React.JSX.Element;
|
|
875
|
-
declare function useTheme(): ThemeContextType;
|
|
876
|
-
|
|
877
961
|
/**
|
|
878
962
|
* Curated icon registry. The whole Privacy Center draws icons through this one
|
|
879
963
|
* component so sizing, stroke weight and color stay consistent and the icon
|
package/dist/privacy-center.d.ts
CHANGED
|
@@ -5,6 +5,63 @@ import * as react_native from 'react-native';
|
|
|
5
5
|
import { StyleProp, ViewStyle, TextStyle, KeyboardTypeOptions, DimensionValue, Animated } from 'react-native';
|
|
6
6
|
import * as lucide_react_native from 'lucide-react-native';
|
|
7
7
|
|
|
8
|
+
interface ThemeColors {
|
|
9
|
+
background: string;
|
|
10
|
+
/** Page canvas. Flat mode keeps this equal to background. */
|
|
11
|
+
canvas: string;
|
|
12
|
+
surface: string;
|
|
13
|
+
text: string;
|
|
14
|
+
textSecondary: string;
|
|
15
|
+
border: string;
|
|
16
|
+
primary: string;
|
|
17
|
+
primaryText: string;
|
|
18
|
+
error: string;
|
|
19
|
+
success: string;
|
|
20
|
+
warning: string;
|
|
21
|
+
/** Hyperlink / accent text color. Falls back to primary. */
|
|
22
|
+
link: string;
|
|
23
|
+
/** Secondary brand color. Falls back to primary. */
|
|
24
|
+
secondary: string;
|
|
25
|
+
/** Quiet gray app background that cards sit on. */
|
|
26
|
+
canvasSubtle: string;
|
|
27
|
+
/** Secondary surface fill — inset rows, pressed states, skeletons. */
|
|
28
|
+
surfaceAlt: string;
|
|
29
|
+
/** Separator lighter than `border` (used inside cards). */
|
|
30
|
+
hairline: string;
|
|
31
|
+
/** Soft tint of `primary` for icon tiles / active pills. */
|
|
32
|
+
primarySoft: string;
|
|
33
|
+
/** Foreground (icon/label) color used on `primarySoft`. */
|
|
34
|
+
primaryOn: string;
|
|
35
|
+
/** Informational accent (badges / info states). */
|
|
36
|
+
info: string;
|
|
37
|
+
/** Soft status tints for badges, empty states, and icon tiles. */
|
|
38
|
+
successSoft: string;
|
|
39
|
+
warningSoft: string;
|
|
40
|
+
errorSoft: string;
|
|
41
|
+
infoSoft: string;
|
|
42
|
+
/** Scrim behind modals / bottom sheets. */
|
|
43
|
+
overlay: string;
|
|
44
|
+
}
|
|
45
|
+
type BrandingMeta = {
|
|
46
|
+
logo_url: string | null;
|
|
47
|
+
icon_url: string | null;
|
|
48
|
+
brand_name: string;
|
|
49
|
+
hide_platform_branding: boolean;
|
|
50
|
+
};
|
|
51
|
+
interface ThemeContextType {
|
|
52
|
+
colors: ThemeColors;
|
|
53
|
+
/** Org branding metadata (logo, brand name). Null until/unless it resolves. */
|
|
54
|
+
branding: BrandingMeta | null;
|
|
55
|
+
/** True while org branding is being fetched (used to gate first paint). */
|
|
56
|
+
isLoading: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare function ThemeProvider({ children, slug, baseUrl, }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
slug?: string;
|
|
61
|
+
baseUrl?: string;
|
|
62
|
+
}): React.JSX.Element;
|
|
63
|
+
declare function useTheme(): ThemeContextType;
|
|
64
|
+
|
|
8
65
|
type Workspace = {
|
|
9
66
|
uuid: string;
|
|
10
67
|
suid: string;
|
|
@@ -244,6 +301,7 @@ type UserConsent = {
|
|
|
244
301
|
product_name?: string;
|
|
245
302
|
product_description?: string | null;
|
|
246
303
|
nominator_info?: NominatorInfo;
|
|
304
|
+
revoke_warning_message?: string | null;
|
|
247
305
|
notice_uuid?: string | null;
|
|
248
306
|
};
|
|
249
307
|
type NominatorInfo = {
|
|
@@ -262,6 +320,12 @@ type ConsentHistoryStatusSummary = {
|
|
|
262
320
|
};
|
|
263
321
|
type PurposeItem = {
|
|
264
322
|
purpose_uuid: string;
|
|
323
|
+
/**
|
|
324
|
+
* Alias emitted by the legacy Python user-consents payload, which keys some
|
|
325
|
+
* purposes as `uuid` instead of `purpose_uuid`. Optional: the Go ledger
|
|
326
|
+
* always sends `purpose_uuid`.
|
|
327
|
+
*/
|
|
328
|
+
uuid?: string;
|
|
265
329
|
name: string;
|
|
266
330
|
description: string | null;
|
|
267
331
|
status: ConsentStatusEnum | string;
|
|
@@ -270,6 +334,7 @@ type PurposeItem = {
|
|
|
270
334
|
method: string;
|
|
271
335
|
data_elements: ConsentDataElement[];
|
|
272
336
|
link_reason: string | null;
|
|
337
|
+
revoke_warning_message?: string | null;
|
|
273
338
|
notice_uuid?: string | null;
|
|
274
339
|
};
|
|
275
340
|
type ConsentGroup = {
|
|
@@ -421,6 +486,29 @@ type CaseDetailsTab = Readonly<{
|
|
|
421
486
|
id: TabId;
|
|
422
487
|
label: string;
|
|
423
488
|
}>;
|
|
489
|
+
/**
|
|
490
|
+
* One data principal sharing this session's contact.
|
|
491
|
+
*
|
|
492
|
+
* `org_user_id` is unique per principal within the org/workspace, so it is the
|
|
493
|
+
* reliable way to tell profiles apart when the email and mobile are identical —
|
|
494
|
+
* which is the whole point of a shared contact.
|
|
495
|
+
*/
|
|
496
|
+
type IdentityCandidate = Readonly<{
|
|
497
|
+
uuid: string;
|
|
498
|
+
org_user_id?: string | null;
|
|
499
|
+
primary_email?: string | null;
|
|
500
|
+
primary_mobile?: string | null;
|
|
501
|
+
created_at?: string | null;
|
|
502
|
+
}>;
|
|
503
|
+
type IdentityListResponse = Readonly<{
|
|
504
|
+
identities: IdentityCandidate[];
|
|
505
|
+
}>;
|
|
506
|
+
/** Fresh tokens scoped to the chosen principal. */
|
|
507
|
+
type SelectPrincipalResponse = Readonly<{
|
|
508
|
+
token: string;
|
|
509
|
+
refresh_token: string;
|
|
510
|
+
expires_at?: string;
|
|
511
|
+
}>;
|
|
424
512
|
|
|
425
513
|
type InternalPage = 'home' | 'consent-manager' | 'form' | 'activity' | 'receipts' | 'case-details' | 'notifications';
|
|
426
514
|
interface NavigationContextType {
|
|
@@ -449,15 +537,38 @@ interface RedactoPrivacyCenterProps {
|
|
|
449
537
|
* Accepted for backwards compatibility but ignored.
|
|
450
538
|
*/
|
|
451
539
|
theme?: 'light' | 'dark';
|
|
452
|
-
|
|
453
|
-
|
|
540
|
+
/** JWT access token. Optional so sandbox mode (see `token`) can omit it. */
|
|
541
|
+
accessToken?: string;
|
|
542
|
+
/** JWT refresh token. Optional; used by the OTP-refresh loop in the JWT flow. */
|
|
543
|
+
refreshToken?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Sandbox PoC: a pasted static token. When set, the Privacy Center runs
|
|
546
|
+
* against the sandbox with no JWT — it sends the single `X-Consent-Token`
|
|
547
|
+
* header, carries the acting identity (`email` || `mobile`) in each request's
|
|
548
|
+
* own payload, takes org/workspace from `organisationUuid`/`workspaceUuid`,
|
|
549
|
+
* and never calls `/otp/refresh`.
|
|
550
|
+
*/
|
|
551
|
+
token?: string;
|
|
552
|
+
/** Sandbox test subject email (carried in the request payload when set). */
|
|
553
|
+
email?: string;
|
|
554
|
+
/** Sandbox test subject mobile (fallback subject when `email` is absent). */
|
|
555
|
+
mobile?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Sandbox UCIC: the client's own user id / org_user_id, e.g. a UUID or
|
|
558
|
+
* customer code; optional third identifier alongside email/mobile.
|
|
559
|
+
*/
|
|
560
|
+
ucic?: string;
|
|
561
|
+
/** Sandbox org UUID (replaces the JWT-decoded org in sandbox mode). */
|
|
562
|
+
organisationUuid?: string;
|
|
563
|
+
/** Sandbox workspace UUID (replaces the JWT-decoded workspace in sandbox mode). */
|
|
564
|
+
workspaceUuid?: string;
|
|
454
565
|
onError: (error: Error) => boolean;
|
|
455
566
|
initialPage?: InternalPage;
|
|
456
567
|
/** Optional deep-link: open a specific case (use with initialPage='case-details'). */
|
|
457
568
|
initialCaseUuid?: string;
|
|
458
569
|
onBack?: 'back' | 'signout';
|
|
459
570
|
}
|
|
460
|
-
declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, theme: _theme, accessToken, refreshToken, onError, initialPage, initialCaseUuid, onBack, }: RedactoPrivacyCenterProps): React.JSX.Element;
|
|
571
|
+
declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, theme: _theme, accessToken, refreshToken, token, email, mobile, ucic, organisationUuid, workspaceUuid, onError, initialPage, initialCaseUuid, onBack, }: RedactoPrivacyCenterProps): React.JSX.Element;
|
|
461
572
|
|
|
462
573
|
declare function ConsentManager(): React__default.JSX.Element;
|
|
463
574
|
|
|
@@ -636,11 +747,23 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
|
636
747
|
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], noticeUuid?: string, dataElements?: Array<{
|
|
637
748
|
uuid: string;
|
|
638
749
|
selected: boolean;
|
|
639
|
-
}
|
|
750
|
+
}>, language?: string): Promise<unknown>;
|
|
640
751
|
/**
|
|
641
752
|
* Get activities (privacy center)
|
|
642
753
|
*/
|
|
643
754
|
getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
755
|
+
/**
|
|
756
|
+
* List all data principals that share this session's contact
|
|
757
|
+
* (shared-contact profile picker). Identity is derived server-side from the
|
|
758
|
+
* JWT — the caller sends nothing but its bearer token.
|
|
759
|
+
*/
|
|
760
|
+
listIdentities(baseRequest: BaseRequest, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<IdentityListResponse>;
|
|
761
|
+
/**
|
|
762
|
+
* Re-scope the session to a chosen principal uuid (must be one of the
|
|
763
|
+
* principals sharing this session's contact). Returns fresh access/refresh
|
|
764
|
+
* tokens scoped to that principal.
|
|
765
|
+
*/
|
|
766
|
+
selectPrincipal(baseRequest: BaseRequest, principalUuid: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<SelectPrincipalResponse>;
|
|
644
767
|
/**
|
|
645
768
|
* Get receipts (privacy center)
|
|
646
769
|
*/
|
|
@@ -772,7 +895,7 @@ type FetchUserConsentsParams = {
|
|
|
772
895
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
773
896
|
};
|
|
774
897
|
declare const fetchUserConsents: (params: FetchUserConsentsParams) => Promise<UserConsentDetail | null>;
|
|
775
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, }: {
|
|
898
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, language, }: {
|
|
776
899
|
organizationId: string;
|
|
777
900
|
workspaceId: string;
|
|
778
901
|
purposeId: string;
|
|
@@ -787,6 +910,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
787
910
|
uuid: string;
|
|
788
911
|
selected: boolean;
|
|
789
912
|
}>;
|
|
913
|
+
language?: string;
|
|
790
914
|
}) => Promise<boolean | null>;
|
|
791
915
|
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
792
916
|
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
|
@@ -812,68 +936,28 @@ interface AuthProviderProps {
|
|
|
812
936
|
children: ReactNode;
|
|
813
937
|
accessToken: string;
|
|
814
938
|
refreshToken: string;
|
|
939
|
+
/**
|
|
940
|
+
* Sandbox PoC: when set, the Privacy Center skips the JWT entirely — it seeds
|
|
941
|
+
* org/workspace/subject from the props below, sends the single
|
|
942
|
+
* `X-Consent-Token` header, carries the acting identity in each request's own
|
|
943
|
+
* payload, and never calls `/otp/refresh`.
|
|
944
|
+
*/
|
|
945
|
+
token?: string;
|
|
946
|
+
/** Sandbox UCIC — the client's own user id (`org_user_id`); takes precedence over the subject. */
|
|
947
|
+
sandboxUcic?: string;
|
|
948
|
+
/** Sandbox subject (email or mobile) — carried in the request payload. */
|
|
949
|
+
sandboxSubject?: string;
|
|
950
|
+
/** Sandbox org UUID (replaces the JWT-decoded org). */
|
|
951
|
+
organisationUuid?: string;
|
|
952
|
+
/** Sandbox workspace UUID (replaces the JWT-decoded workspace). */
|
|
953
|
+
workspaceUuid?: string;
|
|
954
|
+
/** Organisation slug — used to seed the sandbox config. */
|
|
955
|
+
slug?: string;
|
|
815
956
|
onError: (error: Error) => boolean;
|
|
816
957
|
}
|
|
817
|
-
declare function AuthProvider(
|
|
958
|
+
declare function AuthProvider(props: AuthProviderProps): React.JSX.Element;
|
|
818
959
|
declare function useAuth(): AuthContextType;
|
|
819
960
|
|
|
820
|
-
interface ThemeColors {
|
|
821
|
-
background: string;
|
|
822
|
-
/** Page canvas. Flat mode keeps this equal to background. */
|
|
823
|
-
canvas: string;
|
|
824
|
-
surface: string;
|
|
825
|
-
text: string;
|
|
826
|
-
textSecondary: string;
|
|
827
|
-
border: string;
|
|
828
|
-
primary: string;
|
|
829
|
-
primaryText: string;
|
|
830
|
-
error: string;
|
|
831
|
-
success: string;
|
|
832
|
-
warning: string;
|
|
833
|
-
/** Hyperlink / accent text color. Falls back to primary. */
|
|
834
|
-
link: string;
|
|
835
|
-
/** Secondary brand color. Falls back to primary. */
|
|
836
|
-
secondary: string;
|
|
837
|
-
/** Quiet gray app background that cards sit on. */
|
|
838
|
-
canvasSubtle: string;
|
|
839
|
-
/** Secondary surface fill — inset rows, pressed states, skeletons. */
|
|
840
|
-
surfaceAlt: string;
|
|
841
|
-
/** Separator lighter than `border` (used inside cards). */
|
|
842
|
-
hairline: string;
|
|
843
|
-
/** Soft tint of `primary` for icon tiles / active pills. */
|
|
844
|
-
primarySoft: string;
|
|
845
|
-
/** Foreground (icon/label) color used on `primarySoft`. */
|
|
846
|
-
primaryOn: string;
|
|
847
|
-
/** Informational accent (badges / info states). */
|
|
848
|
-
info: string;
|
|
849
|
-
/** Soft status tints for badges, empty states, and icon tiles. */
|
|
850
|
-
successSoft: string;
|
|
851
|
-
warningSoft: string;
|
|
852
|
-
errorSoft: string;
|
|
853
|
-
infoSoft: string;
|
|
854
|
-
/** Scrim behind modals / bottom sheets. */
|
|
855
|
-
overlay: string;
|
|
856
|
-
}
|
|
857
|
-
type BrandingMeta = {
|
|
858
|
-
logo_url: string | null;
|
|
859
|
-
icon_url: string | null;
|
|
860
|
-
brand_name: string;
|
|
861
|
-
hide_platform_branding: boolean;
|
|
862
|
-
};
|
|
863
|
-
interface ThemeContextType {
|
|
864
|
-
colors: ThemeColors;
|
|
865
|
-
/** Org branding metadata (logo, brand name). Null until/unless it resolves. */
|
|
866
|
-
branding: BrandingMeta | null;
|
|
867
|
-
/** True while org branding is being fetched (used to gate first paint). */
|
|
868
|
-
isLoading: boolean;
|
|
869
|
-
}
|
|
870
|
-
declare function ThemeProvider({ children, slug, baseUrl, }: {
|
|
871
|
-
children: ReactNode;
|
|
872
|
-
slug?: string;
|
|
873
|
-
baseUrl?: string;
|
|
874
|
-
}): React.JSX.Element;
|
|
875
|
-
declare function useTheme(): ThemeContextType;
|
|
876
|
-
|
|
877
961
|
/**
|
|
878
962
|
* Curated icon registry. The whole Privacy Center draws icons through this one
|
|
879
963
|
* component so sizing, stroke weight and color stay consistent and the icon
|