@redacto.io/consent-sdk-react 10.0.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.
Files changed (60) hide show
  1. package/.turbo/turbo-build.log +22 -25
  2. package/CHANGELOG.md +14 -0
  3. package/dist/index.d.mts +13 -6
  4. package/dist/index.d.ts +13 -6
  5. package/dist/index.js +6 -8
  6. package/dist/index.mjs +6 -8
  7. package/dist/privacy-center.d.mts +60 -27
  8. package/dist/privacy-center.d.ts +60 -27
  9. package/dist/privacy-center.js +1872 -1363
  10. package/dist/privacy-center.mjs +1796 -1282
  11. package/package.json +1 -1
  12. package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +1 -0
  13. package/src/RedactoNoticeConsent/api/index.ts +4 -4
  14. package/src/RedactoNoticeConsent/api/types.ts +3 -2
  15. package/src/RedactoNoticeConsent/types.ts +1 -1
  16. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +1 -0
  17. package/src/RedactoNoticeConsentInline/api/index.ts +4 -4
  18. package/src/RedactoNoticeConsentInline/api/types.ts +2 -1
  19. package/src/RedactoNoticeConsentInline/types.ts +1 -1
  20. package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +8 -5
  21. package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +1 -1
  22. package/src/RedactoPrivacyCenter/api/actions.ts +10 -4
  23. package/src/RedactoPrivacyCenter/api/client.ts +101 -21
  24. package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +64 -35
  25. package/src/RedactoPrivacyCenter/components/Form.tsx +7 -3
  26. package/src/RedactoPrivacyCenter/components/SelectUser.tsx +83 -0
  27. package/src/RedactoPrivacyCenter/components/SelectUserGate.tsx +193 -0
  28. package/src/RedactoPrivacyCenter/components/constant.ts +11 -0
  29. package/src/RedactoPrivacyCenter/context/BaseUrlContext.tsx +1 -1
  30. package/src/RedactoPrivacyCenter/context/ProfileSwitchContext.tsx +15 -0
  31. package/src/RedactoPrivacyCenter/context/types.ts +1 -1
  32. package/src/RedactoPrivacyCenter/lib/types.ts +54 -2
  33. package/src/RedactoPrivacyCenter/locales/as/translation.json +7 -1
  34. package/src/RedactoPrivacyCenter/locales/bho/translation.json +7 -1
  35. package/src/RedactoPrivacyCenter/locales/bn/translation.json +7 -1
  36. package/src/RedactoPrivacyCenter/locales/brx/translation.json +7 -1
  37. package/src/RedactoPrivacyCenter/locales/doi/translation.json +7 -1
  38. package/src/RedactoPrivacyCenter/locales/en/translation.json +7 -1
  39. package/src/RedactoPrivacyCenter/locales/gom/translation.json +7 -1
  40. package/src/RedactoPrivacyCenter/locales/gu/translation.json +7 -1
  41. package/src/RedactoPrivacyCenter/locales/hi/translation.json +7 -1
  42. package/src/RedactoPrivacyCenter/locales/kn/translation.json +7 -1
  43. package/src/RedactoPrivacyCenter/locales/ks/translation.json +7 -1
  44. package/src/RedactoPrivacyCenter/locales/mai/translation.json +7 -1
  45. package/src/RedactoPrivacyCenter/locales/ml/translation.json +7 -1
  46. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +7 -1
  47. package/src/RedactoPrivacyCenter/locales/mr/translation.json +7 -1
  48. package/src/RedactoPrivacyCenter/locales/ne/translation.json +7 -1
  49. package/src/RedactoPrivacyCenter/locales/or/translation.json +7 -1
  50. package/src/RedactoPrivacyCenter/locales/pa/translation.json +7 -1
  51. package/src/RedactoPrivacyCenter/locales/sa/translation.json +7 -1
  52. package/src/RedactoPrivacyCenter/locales/sat/translation.json +7 -1
  53. package/src/RedactoPrivacyCenter/locales/sd/translation.json +7 -1
  54. package/src/RedactoPrivacyCenter/locales/ta/translation.json +7 -1
  55. package/src/RedactoPrivacyCenter/locales/te/translation.json +7 -1
  56. package/src/RedactoPrivacyCenter/locales/ur/translation.json +7 -1
  57. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +105 -0
  58. package/tests/Form.test.tsx +53 -7
  59. package/tests/consentClient.test.ts +171 -0
  60. package/tests/manageConsentServer.test.ts +38 -0
@@ -1,25 +1,22 @@
1
-
2
- > @redacto.io/consent-sdk-react@9.4.0-beta.0 build /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react
3
- > tsup
4
-
5
- CLI Building entry: {"index":"src/index.ts","privacy-center":"src/privacy-center.ts"}
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.1
8
- CLI Using tsup config: /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react/tsup.config.ts
9
- CLI Target: es2019
10
- CLI Cleaning output folder
11
- ESM Build start
12
- CJS Build start
13
- CJS dist/index.js 517.55 KB
14
- CJS dist/privacy-center.js 2.18 MB
15
- CJS ⚡️ Build success in 60ms
16
- ESM dist/chunk-6A665OPR.mjs 841.00 B
17
- ESM dist/index.mjs 503.10 KB
18
- ESM dist/privacy-center.mjs 2.15 MB
19
- ESM ⚡️ Build success in 66ms
20
- DTS Build start
21
- DTS ⚡️ Build success in 2580ms
22
- DTS dist/index.d.mts 8.03 KB
23
- DTS dist/privacy-center.d.mts 30.69 KB
24
- DTS dist/index.d.ts 8.03 KB
25
- DTS dist/privacy-center.d.ts 30.69 KB
1
+ $ tsup
2
+ CLI Building entry: {"index":"src/index.ts","privacy-center":"src/privacy-center.ts"}
3
+ CLI Using tsconfig: tsconfig.json
4
+ CLI tsup v8.5.1
5
+ CLI Using tsup config: /Users/sadanmianredacto/Developer/redacto/consent-sdk/packages/consent-sdk-react/tsup.config.ts
6
+ CLI Target: es2019
7
+ CLI Cleaning output folder
8
+ ESM Build start
9
+ CJS Build start
10
+ CJS dist/index.js 520.79 KB
11
+ CJS dist/privacy-center.js 2.24 MB
12
+ CJS ⚡️ Build success in 124ms
13
+ ESM dist/index.mjs 506.34 KB
14
+ ESM dist/chunk-6A665OPR.mjs 841.00 B
15
+ ESM dist/privacy-center.mjs 2.20 MB
16
+ ESM ⚡️ Build success in 124ms
17
+ DTS Build start
18
+ DTS ⚡️ Build success in 2664ms
19
+ DTS dist/index.d.mts 8.27 KB
20
+ DTS dist/privacy-center.d.mts 33.25 KB
21
+ DTS dist/index.d.ts 8.27 KB
22
+ DTS dist/privacy-center.d.ts 33.25 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @redacto.io/consent-sdk-react
2
2
 
3
+ ## 10.0.0-beta.1
4
+
5
+ ### Major Changes
6
+
7
+ - feat(privacy-center): shared-contact profile picker (OTP + embeddable SDK)
8
+
9
+ ### Minor Changes
10
+
11
+ - 61d18e8: fix(privacy-center): resolve mobile/org_user_id as contact for mobile-only logins
12
+
13
+ ### Patch Changes
14
+
15
+ - 8145b3d: Privacy Center: when `ledgerBaseUrl` is not provided, consent reads/writes (user-consents, group purposes, manage-consent, receipts list, receipt PDF) fall back to the legacy Python `/dsar/privacy-center` endpoints and payloads instead of 404ing against `${baseUrl}/public/...`, and the DSAR form's ledger picker overlay is skipped. Fixes the Privacy Center showing "No Data" for integrations without a deployed Go ledger.
16
+
3
17
  ## 10.0.0-beta.0
4
18
 
5
19
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import react__default from 'react';
4
3
 
@@ -47,7 +46,7 @@ type Props$1 = Readonly<{
47
46
  accessToken: string;
48
47
  refreshToken: string;
49
48
  baseUrl?: string;
50
- ledgerBaseUrl: string;
49
+ ledgerBaseUrl?: string;
51
50
  settings?: Partial<Settings$1>;
52
51
  language?: string;
53
52
  blockUI?: boolean;
@@ -62,6 +61,14 @@ type Props$1 = Readonly<{
62
61
  reviewModeButtonText?: string;
63
62
  }>;
64
63
 
64
+ /**
65
+ * Redacto Notice Consent Component
66
+ *
67
+ * A comprehensive consent management component that handles both initial consent
68
+ * collection and reconsent flows with visual distinction between already-consented
69
+ * and needs-consent purposes.
70
+ */
71
+
65
72
  /**
66
73
  * RedactoNoticeConsent
67
74
  *
@@ -69,7 +76,7 @@ type Props$1 = Readonly<{
69
76
  * to view and manage their consent preferences. Supports both initial consent
70
77
  * collection and reconsent flows.
71
78
  */
72
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react_jsx_runtime.JSX.Element;
79
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react__default.JSX.Element;
73
80
 
74
81
  type Settings = {
75
82
  button: {
@@ -103,7 +110,7 @@ type Props = Readonly<{
103
110
  accessToken?: string;
104
111
  refreshToken?: string;
105
112
  baseUrl?: string;
106
- ledgerBaseUrl: string;
113
+ ledgerBaseUrl?: string;
107
114
  settings?: Partial<Settings>;
108
115
  language?: string;
109
116
  onAccept?: () => void;
@@ -114,7 +121,7 @@ type Props = Readonly<{
114
121
  }>;
115
122
 
116
123
  declare const RedactoConsentInline: react.MemoExoticComponent<{
117
- ({ org_uuid, workspace_uuid, notice_uuid, accessToken, baseUrl, ledgerBaseUrl, language, onAccept, onError, onValidationChange, settings, applicationId, }: Props): react_jsx_runtime.JSX.Element | null;
124
+ ({ org_uuid, workspace_uuid, notice_uuid, accessToken, baseUrl, ledgerBaseUrl, language, onAccept, onError, onValidationChange, settings, applicationId, }: Props): react.JSX.Element | null;
118
125
  displayName: string;
119
126
  }>;
120
127
 
@@ -152,7 +159,7 @@ type RedactoNoticeAssistedProps = {
152
159
  * submit, `onComplete` fires immediately with no confirmation screen (mirroring
153
160
  * RedactoNoticeConsent's `onAccept`). Steps: `notice` → `verify` (with `otpSent`).
154
161
  */
155
- declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react_jsx_runtime.JSX.Element;
162
+ declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
156
163
 
157
164
  /**
158
165
  * DigiLockerCallback Component
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import react__default from 'react';
4
3
 
@@ -47,7 +46,7 @@ type Props$1 = Readonly<{
47
46
  accessToken: string;
48
47
  refreshToken: string;
49
48
  baseUrl?: string;
50
- ledgerBaseUrl: string;
49
+ ledgerBaseUrl?: string;
51
50
  settings?: Partial<Settings$1>;
52
51
  language?: string;
53
52
  blockUI?: boolean;
@@ -62,6 +61,14 @@ type Props$1 = Readonly<{
62
61
  reviewModeButtonText?: string;
63
62
  }>;
64
63
 
64
+ /**
65
+ * Redacto Notice Consent Component
66
+ *
67
+ * A comprehensive consent management component that handles both initial consent
68
+ * collection and reconsent flows with visual distinction between already-consented
69
+ * and needs-consent purposes.
70
+ */
71
+
65
72
  /**
66
73
  * RedactoNoticeConsent
67
74
  *
@@ -69,7 +76,7 @@ type Props$1 = Readonly<{
69
76
  * to view and manage their consent preferences. Supports both initial consent
70
77
  * collection and reconsent flows.
71
78
  */
72
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react_jsx_runtime.JSX.Element;
79
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, ledgerBaseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, validateAgainst, digilockerMode, digilockerCallbackUrl, includeFullyConsentedData, reviewModeButtonText, }: Props$1) => react__default.JSX.Element;
73
80
 
74
81
  type Settings = {
75
82
  button: {
@@ -103,7 +110,7 @@ type Props = Readonly<{
103
110
  accessToken?: string;
104
111
  refreshToken?: string;
105
112
  baseUrl?: string;
106
- ledgerBaseUrl: string;
113
+ ledgerBaseUrl?: string;
107
114
  settings?: Partial<Settings>;
108
115
  language?: string;
109
116
  onAccept?: () => void;
@@ -114,7 +121,7 @@ type Props = Readonly<{
114
121
  }>;
115
122
 
116
123
  declare const RedactoConsentInline: react.MemoExoticComponent<{
117
- ({ org_uuid, workspace_uuid, notice_uuid, accessToken, baseUrl, ledgerBaseUrl, language, onAccept, onError, onValidationChange, settings, applicationId, }: Props): react_jsx_runtime.JSX.Element | null;
124
+ ({ org_uuid, workspace_uuid, notice_uuid, accessToken, baseUrl, ledgerBaseUrl, language, onAccept, onError, onValidationChange, settings, applicationId, }: Props): react.JSX.Element | null;
118
125
  displayName: string;
119
126
  }>;
120
127
 
@@ -152,7 +159,7 @@ type RedactoNoticeAssistedProps = {
152
159
  * submit, `onComplete` fires immediately with no confirmation screen (mirroring
153
160
  * RedactoNoticeConsent's `onAccept`). Steps: `notice` → `verify` (with `otpSent`).
154
161
  */
155
- declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react_jsx_runtime.JSX.Element;
162
+ declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
156
163
 
157
164
  /**
158
165
  * DigiLockerCallback Component
package/dist/index.js CHANGED
@@ -181,6 +181,7 @@ var fetchConsentContent = async ({
181
181
  };
182
182
  var submitConsentEvent = async ({
183
183
  accessToken,
184
+ baseUrl,
184
185
  ledgerBaseUrl,
185
186
  noticeUuid,
186
187
  purposes,
@@ -202,10 +203,7 @@ var submitConsentEvent = async ({
202
203
  if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
203
204
  throw new Error("Invalid token: missing organization or workspace UUID");
204
205
  }
205
- if (!ledgerBaseUrl) {
206
- throw new Error("ledgerBaseUrl is required to submit consent");
207
- }
208
- const apiBaseUrl = ledgerBaseUrl;
206
+ const apiBaseUrl = ledgerBaseUrl || baseUrl || BASE_URL;
209
207
  const validatedPurposes = purposes.map((purpose) => {
210
208
  if (!purpose.uuid) {
211
209
  throw new Error(`Invalid purpose data: missing uuid`);
@@ -2997,6 +2995,7 @@ var RedactoNoticeConsent = ({
2997
2995
  if (content) {
2998
2996
  await submitConsentEvent({
2999
2997
  accessToken,
2998
+ baseUrl,
3000
2999
  ledgerBaseUrl,
3001
3000
  noticeUuid: content.notice_uuid,
3002
3001
  purposes: content.purposes.map((purpose) => {
@@ -4778,16 +4777,14 @@ var submitConsentEvent2 = async ({
4778
4777
  org_uuid,
4779
4778
  workspace_uuid,
4780
4779
  accessToken,
4780
+ baseUrl,
4781
4781
  ledgerBaseUrl,
4782
4782
  noticeUuid,
4783
4783
  purposes,
4784
4784
  declined,
4785
4785
  meta_data
4786
4786
  }) => {
4787
- if (!ledgerBaseUrl) {
4788
- throw new Error("ledgerBaseUrl is required to submit consent");
4789
- }
4790
- const apiBaseUrl = ledgerBaseUrl;
4787
+ const apiBaseUrl = ledgerBaseUrl || baseUrl || BASE_URL2;
4791
4788
  const payload = {
4792
4789
  notice_uuid: noticeUuid,
4793
4790
  purposes: purposes.map((purpose) => {
@@ -5472,6 +5469,7 @@ var RedactoConsentInlineComponent = ({
5472
5469
  org_uuid,
5473
5470
  workspace_uuid,
5474
5471
  accessToken: tokenToUse,
5472
+ baseUrl,
5475
5473
  ledgerBaseUrl,
5476
5474
  noticeUuid: content.notice_uuid,
5477
5475
  purposes: content.purposes.map((purpose) => {
package/dist/index.mjs CHANGED
@@ -155,6 +155,7 @@ var fetchConsentContent = async ({
155
155
  };
156
156
  var submitConsentEvent = async ({
157
157
  accessToken,
158
+ baseUrl,
158
159
  ledgerBaseUrl,
159
160
  noticeUuid,
160
161
  purposes,
@@ -176,10 +177,7 @@ var submitConsentEvent = async ({
176
177
  if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
177
178
  throw new Error("Invalid token: missing organization or workspace UUID");
178
179
  }
179
- if (!ledgerBaseUrl) {
180
- throw new Error("ledgerBaseUrl is required to submit consent");
181
- }
182
- const apiBaseUrl = ledgerBaseUrl;
180
+ const apiBaseUrl = ledgerBaseUrl || baseUrl || BASE_URL;
183
181
  const validatedPurposes = purposes.map((purpose) => {
184
182
  if (!purpose.uuid) {
185
183
  throw new Error(`Invalid purpose data: missing uuid`);
@@ -2944,6 +2942,7 @@ var RedactoNoticeConsent = ({
2944
2942
  if (content) {
2945
2943
  await submitConsentEvent({
2946
2944
  accessToken,
2945
+ baseUrl,
2947
2946
  ledgerBaseUrl,
2948
2947
  noticeUuid: content.notice_uuid,
2949
2948
  purposes: content.purposes.map((purpose) => {
@@ -4725,16 +4724,14 @@ var submitConsentEvent2 = async ({
4725
4724
  org_uuid,
4726
4725
  workspace_uuid,
4727
4726
  accessToken,
4727
+ baseUrl,
4728
4728
  ledgerBaseUrl,
4729
4729
  noticeUuid,
4730
4730
  purposes,
4731
4731
  declined,
4732
4732
  meta_data
4733
4733
  }) => {
4734
- if (!ledgerBaseUrl) {
4735
- throw new Error("ledgerBaseUrl is required to submit consent");
4736
- }
4737
- const apiBaseUrl = ledgerBaseUrl;
4734
+ const apiBaseUrl = ledgerBaseUrl || baseUrl || BASE_URL2;
4738
4735
  const payload = {
4739
4736
  notice_uuid: noticeUuid,
4740
4737
  purposes: purposes.map((purpose) => {
@@ -5419,6 +5416,7 @@ var RedactoConsentInlineComponent = ({
5419
5416
  org_uuid,
5420
5417
  workspace_uuid,
5421
5418
  accessToken: tokenToUse,
5419
+ baseUrl,
5422
5420
  ledgerBaseUrl,
5423
5421
  noticeUuid: content.notice_uuid,
5424
5422
  purposes: content.purposes.map((purpose) => {
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
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
 
@@ -33,9 +33,12 @@ type BaseRequest = {
33
33
  * Creates a client instance with a specific base URL.
34
34
  * @param baseUrl - Consent server base URL (Python service, e.g. http://host/consent)
35
35
  * @param ledgerBaseUrl - Go ledger base URL (e.g. http://host:8090/consent-ledger).
36
- * Used for user-consents reads which are served from the ledger's `/public/...` paths.
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.
37
40
  */
38
- declare function createConsentClient(baseUrl: string, ledgerBaseUrl: string): {
41
+ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
39
42
  /**
40
43
  * Get form data (privacy center)
41
44
  */
@@ -96,14 +99,17 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl: string): {
96
99
  /**
97
100
  * Manage consent (privacy center) - revoke, regrant, or renew.
98
101
  *
99
- * The Go ledger has no manage-consent route, so this is expressed as a
100
- * `partial` submit-consent on the ledger — mirroring the Python dual-write
101
- * relay (`build_consent_management_payload`): the affected purpose is
102
- * re-submitted with `selected: false` to revoke or `selected: true` to
103
- * regrant/renew, and `partial: true` so the rest of the notice's purposes
104
- * are left untouched. The principal is resolved from the JWT, so no
105
- * `contact`/identifiers are sent in the body, and `consent_event_uuid` is
106
- * omitted so the ledger mints a fresh event.
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.
107
113
  */
108
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<{
109
115
  uuid: string;
@@ -113,6 +119,18 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl: string): {
113
119
  * Get activities (privacy center)
114
120
  */
115
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>;
116
134
  /**
117
135
  * Get receipts (privacy center) — consent receipts for the authenticated user
118
136
  */
@@ -607,6 +625,21 @@ type NotificationQueryParams = {
607
625
  include_summary?: boolean;
608
626
  language?: string;
609
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
+ }>;
610
643
 
611
644
  type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications' | 'receipts';
612
645
  interface NavigationContextType {
@@ -619,12 +652,12 @@ interface NavigationContextType {
619
652
  declare const NavigationProvider: ({ children, initialPage }: {
620
653
  children: ReactNode;
621
654
  initialPage?: InternalPage;
622
- }) => react_jsx_runtime.JSX.Element;
655
+ }) => react.JSX.Element;
623
656
  declare const useInternalNavigation: () => NavigationContextType;
624
657
 
625
658
  interface RedactoPrivacyCenterProps {
626
659
  baseUrl: string;
627
- ledgerBaseUrl: string;
660
+ ledgerBaseUrl?: string;
628
661
  slug: string;
629
662
  accessToken: string;
630
663
  refreshToken: string;
@@ -632,26 +665,26 @@ interface RedactoPrivacyCenterProps {
632
665
  initialPage?: InternalPage;
633
666
  onBack?: 'back' | 'signout';
634
667
  }
635
- declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react_jsx_runtime.JSX.Element;
668
+ declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react.JSX.Element;
636
669
 
637
670
  interface PrivacyCenterLayoutProps {
638
671
  children: ReactNode;
639
672
  slug: string;
640
673
  onBack?: 'back' | 'signout';
641
674
  }
642
- declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react_jsx_runtime.JSX.Element;
675
+ declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react.JSX.Element;
643
676
 
644
- declare function PrivacyCenterHomePage(): react_jsx_runtime.JSX.Element;
677
+ declare function PrivacyCenterHomePage(): react.JSX.Element;
645
678
 
646
- declare function PrivacyCenterConsentManagerPage(): react_jsx_runtime.JSX.Element;
679
+ declare function PrivacyCenterConsentManagerPage(): react.JSX.Element;
647
680
 
648
- declare function PrivacyCenterFormPage(): react_jsx_runtime.JSX.Element;
681
+ declare function PrivacyCenterFormPage(): react.JSX.Element;
649
682
 
650
- declare function PrivacyCenterActivityPage(): react_jsx_runtime.JSX.Element;
683
+ declare function PrivacyCenterActivityPage(): react.JSX.Element;
651
684
 
652
- declare const PrivacyCenterCaseDetailsPage: () => react_jsx_runtime.JSX.Element | null;
685
+ declare const PrivacyCenterCaseDetailsPage: () => react.JSX.Element | null;
653
686
 
654
- declare const NotificationsPage: () => react_jsx_runtime.JSX.Element;
687
+ declare const NotificationsPage: () => react.JSX.Element;
655
688
 
656
689
  type AuthContextValue = Readonly<{
657
690
  accessToken: string;
@@ -662,18 +695,18 @@ type AuthContextValue = Readonly<{
662
695
  }>;
663
696
  type BaseUrlContextValue = Readonly<{
664
697
  baseUrl: string;
665
- ledgerBaseUrl: string;
698
+ ledgerBaseUrl?: string;
666
699
  consentClient: ReturnType<typeof createConsentClient>;
667
700
  }>;
668
701
 
669
702
  declare const BaseUrlProvider: ({ children, baseUrl, ledgerBaseUrl, }: {
670
703
  children: ReactNode;
671
704
  baseUrl: string;
672
- ledgerBaseUrl: string;
673
- }) => react_jsx_runtime.JSX.Element;
705
+ ledgerBaseUrl?: string;
706
+ }) => react.JSX.Element;
674
707
  declare const useBaseUrl: () => Readonly<{
675
708
  baseUrl: string;
676
- ledgerBaseUrl: string;
709
+ ledgerBaseUrl?: string;
677
710
  consentClient: ReturnType<typeof createConsentClient>;
678
711
  }>;
679
712
 
@@ -840,7 +873,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
840
873
  declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
841
874
  declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
842
875
 
843
- declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<CaseRequest[], Error>;
876
+ declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<NoInfer<CaseRequest[]>, Error>;
844
877
 
845
878
  interface AuthProviderProps {
846
879
  children: ReactNode;
@@ -848,7 +881,7 @@ interface AuthProviderProps {
848
881
  refreshToken: string;
849
882
  onError: (error: Error) => boolean;
850
883
  }
851
- declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
884
+ declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) => react.JSX.Element;
852
885
  declare const useAuth: () => AuthContextValue;
853
886
 
854
887
  /**
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
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
 
@@ -33,9 +33,12 @@ type BaseRequest = {
33
33
  * Creates a client instance with a specific base URL.
34
34
  * @param baseUrl - Consent server base URL (Python service, e.g. http://host/consent)
35
35
  * @param ledgerBaseUrl - Go ledger base URL (e.g. http://host:8090/consent-ledger).
36
- * Used for user-consents reads which are served from the ledger's `/public/...` paths.
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.
37
40
  */
38
- declare function createConsentClient(baseUrl: string, ledgerBaseUrl: string): {
41
+ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
39
42
  /**
40
43
  * Get form data (privacy center)
41
44
  */
@@ -96,14 +99,17 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl: string): {
96
99
  /**
97
100
  * Manage consent (privacy center) - revoke, regrant, or renew.
98
101
  *
99
- * The Go ledger has no manage-consent route, so this is expressed as a
100
- * `partial` submit-consent on the ledger — mirroring the Python dual-write
101
- * relay (`build_consent_management_payload`): the affected purpose is
102
- * re-submitted with `selected: false` to revoke or `selected: true` to
103
- * regrant/renew, and `partial: true` so the rest of the notice's purposes
104
- * are left untouched. The principal is resolved from the JWT, so no
105
- * `contact`/identifiers are sent in the body, and `consent_event_uuid` is
106
- * omitted so the ledger mints a fresh event.
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.
107
113
  */
108
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<{
109
115
  uuid: string;
@@ -113,6 +119,18 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl: string): {
113
119
  * Get activities (privacy center)
114
120
  */
115
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>;
116
134
  /**
117
135
  * Get receipts (privacy center) — consent receipts for the authenticated user
118
136
  */
@@ -607,6 +625,21 @@ type NotificationQueryParams = {
607
625
  include_summary?: boolean;
608
626
  language?: string;
609
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
+ }>;
610
643
 
611
644
  type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details' | 'notifications' | 'receipts';
612
645
  interface NavigationContextType {
@@ -619,12 +652,12 @@ interface NavigationContextType {
619
652
  declare const NavigationProvider: ({ children, initialPage }: {
620
653
  children: ReactNode;
621
654
  initialPage?: InternalPage;
622
- }) => react_jsx_runtime.JSX.Element;
655
+ }) => react.JSX.Element;
623
656
  declare const useInternalNavigation: () => NavigationContextType;
624
657
 
625
658
  interface RedactoPrivacyCenterProps {
626
659
  baseUrl: string;
627
- ledgerBaseUrl: string;
660
+ ledgerBaseUrl?: string;
628
661
  slug: string;
629
662
  accessToken: string;
630
663
  refreshToken: string;
@@ -632,26 +665,26 @@ interface RedactoPrivacyCenterProps {
632
665
  initialPage?: InternalPage;
633
666
  onBack?: 'back' | 'signout';
634
667
  }
635
- declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react_jsx_runtime.JSX.Element;
668
+ declare function RedactoPrivacyCenter({ baseUrl, ledgerBaseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react.JSX.Element;
636
669
 
637
670
  interface PrivacyCenterLayoutProps {
638
671
  children: ReactNode;
639
672
  slug: string;
640
673
  onBack?: 'back' | 'signout';
641
674
  }
642
- declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react_jsx_runtime.JSX.Element;
675
+ declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react.JSX.Element;
643
676
 
644
- declare function PrivacyCenterHomePage(): react_jsx_runtime.JSX.Element;
677
+ declare function PrivacyCenterHomePage(): react.JSX.Element;
645
678
 
646
- declare function PrivacyCenterConsentManagerPage(): react_jsx_runtime.JSX.Element;
679
+ declare function PrivacyCenterConsentManagerPage(): react.JSX.Element;
647
680
 
648
- declare function PrivacyCenterFormPage(): react_jsx_runtime.JSX.Element;
681
+ declare function PrivacyCenterFormPage(): react.JSX.Element;
649
682
 
650
- declare function PrivacyCenterActivityPage(): react_jsx_runtime.JSX.Element;
683
+ declare function PrivacyCenterActivityPage(): react.JSX.Element;
651
684
 
652
- declare const PrivacyCenterCaseDetailsPage: () => react_jsx_runtime.JSX.Element | null;
685
+ declare const PrivacyCenterCaseDetailsPage: () => react.JSX.Element | null;
653
686
 
654
- declare const NotificationsPage: () => react_jsx_runtime.JSX.Element;
687
+ declare const NotificationsPage: () => react.JSX.Element;
655
688
 
656
689
  type AuthContextValue = Readonly<{
657
690
  accessToken: string;
@@ -662,18 +695,18 @@ type AuthContextValue = Readonly<{
662
695
  }>;
663
696
  type BaseUrlContextValue = Readonly<{
664
697
  baseUrl: string;
665
- ledgerBaseUrl: string;
698
+ ledgerBaseUrl?: string;
666
699
  consentClient: ReturnType<typeof createConsentClient>;
667
700
  }>;
668
701
 
669
702
  declare const BaseUrlProvider: ({ children, baseUrl, ledgerBaseUrl, }: {
670
703
  children: ReactNode;
671
704
  baseUrl: string;
672
- ledgerBaseUrl: string;
673
- }) => react_jsx_runtime.JSX.Element;
705
+ ledgerBaseUrl?: string;
706
+ }) => react.JSX.Element;
674
707
  declare const useBaseUrl: () => Readonly<{
675
708
  baseUrl: string;
676
- ledgerBaseUrl: string;
709
+ ledgerBaseUrl?: string;
677
710
  consentClient: ReturnType<typeof createConsentClient>;
678
711
  }>;
679
712
 
@@ -840,7 +873,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
840
873
  declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
841
874
  declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
842
875
 
843
- declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<CaseRequest[], Error>;
876
+ declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<NoInfer<CaseRequest[]>, Error>;
844
877
 
845
878
  interface AuthProviderProps {
846
879
  children: ReactNode;
@@ -848,7 +881,7 @@ interface AuthProviderProps {
848
881
  refreshToken: string;
849
882
  onError: (error: Error) => boolean;
850
883
  }
851
- declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
884
+ declare const AuthProvider: ({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError, }: AuthProviderProps) => react.JSX.Element;
852
885
  declare const useAuth: () => AuthContextValue;
853
886
 
854
887
  /**