@redacto.io/consent-sdk-react-native 5.1.0 → 6.0.1-beta.0

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/dist/index.d.mts CHANGED
@@ -1,36 +1,110 @@
1
1
  import React__default from 'react';
2
+ import { A as AppearanceStyle, N as NoticeControlStyle, a as NoticeMobileLayout, b as NoticeDesktopPosition, c as NoticeBackdrop, d as NoticePhoneFooter, e as NoticeTextScale } from './types-BYp89x8C.mjs';
2
3
 
3
- type Settings$1 = {
4
+ type SettingsButtonColors = {
5
+ backgroundColor?: string;
6
+ textColor?: string;
7
+ };
8
+ /**
9
+ * The colours `settings` can set: the top-level palette, and the dark palette
10
+ * under `settings.darkPalette`. Colours are any colour React Native paints and
11
+ * are used as given.
12
+ */
13
+ type SettingsPalette = {
4
14
  button: {
5
- /** Styles the "accept selected" button. */
6
- accept: {
7
- backgroundColor: string;
8
- textColor: string;
9
- };
10
- /** Optional: the accept-all shortcut falls back to `accept` when unset. */
11
- acceptAll?: {
12
- backgroundColor: string;
13
- textColor: string;
15
+ /**
16
+ * The brand accent (checkboxes, switches and Accept Selected's outline),
17
+ * and Accept All's colour when `acceptAll` is unset.
18
+ */
19
+ accept?: SettingsButtonColors;
20
+ /** The Accept All button; falls back to `accept`. */
21
+ acceptAll?: SettingsButtonColors;
22
+ /** The Accept Selected button itself. */
23
+ acceptSelected?: SettingsButtonColors;
24
+ decline?: SettingsButtonColors & {
25
+ borderColor?: string;
14
26
  };
15
- decline: {
16
- backgroundColor: string;
17
- textColor: string;
18
- };
19
- language: {
20
- backgroundColor: string;
21
- textColor: string;
27
+ language?: {
28
+ backgroundColor?: string;
29
+ textColor?: string;
22
30
  selectedBackgroundColor?: string;
23
31
  selectedTextColor?: string;
24
32
  };
25
33
  };
26
34
  link: string;
27
- borderRadius?: string;
28
35
  backgroundColor?: string;
36
+ /** Raised surfaces: menus and panels, and the tint of the glass style. */
37
+ surfaceColor?: string;
29
38
  headingColor?: string;
30
39
  textColor?: string;
40
+ /** Descriptions and hints. */
41
+ mutedTextColor?: string;
31
42
  borderColor?: string;
43
+ /** The dim behind the notice. */
44
+ overlayColor?: string;
45
+ toggle?: {
46
+ onColor?: string;
47
+ offColor?: string;
48
+ knobColor?: string;
49
+ };
50
+ /** The element being read aloud by text-to-speech. */
51
+ ttsHighlight?: {
52
+ backgroundColor?: string;
53
+ textColor?: string;
54
+ };
55
+ };
56
+ /**
57
+ * Code-side styling for the notice. Everything here is optional and overrides,
58
+ * key by key, the appearance set in the Redacto console
59
+ * (`active_config.appearance`): host settings, then the console, then the
60
+ * notice's brand colours and the SDK defaults.
61
+ */
62
+ type Settings = SettingsPalette & {
63
+ /**
64
+ * Visual style: `"classic"`, `"glass"`, `"minimal"` or `"soft"`. Unknown
65
+ * values are ignored and the console's style (else classic) applies.
66
+ */
67
+ theme?: AppearanceStyle;
68
+ /** Defaults to "checkbox". Applies to purposes, product headings and data elements. */
69
+ selectionControl?: SelectionControlType;
70
+ /**
71
+ * How checkbox rows are drawn, in any style: `"checkbox"` or `"switch"`.
72
+ * Unset keeps checkboxes, in every style.
73
+ */
74
+ controlStyle?: NoticeControlStyle;
75
+ /**
76
+ * Asks "are you sure" before Accept All, Accept Selected or Decline submits.
77
+ * Defaults to false, so the one-tap path is unchanged.
78
+ */
79
+ confirmBeforeSubmit?: boolean;
80
+ /** Corner radius, in px ("12" or "12px"). */
81
+ borderRadius?: string;
82
+ /** Phones: `"modal"` (centred) or `"sheet"` (docked to the bottom edge). */
83
+ mobileLayout?: NoticeMobileLayout;
84
+ /** Wider screens: `"center"`, `"bottom-right"`, `"bottom-left"` or `"bottom-bar"`. */
85
+ desktopPosition?: NoticeDesktopPosition;
86
+ /** `"dim"` darkens the screen behind the notice; `"none"` leaves it as is. */
87
+ backdrop?: NoticeBackdrop;
88
+ /** Collapse the notice text and the DPO block into disclosures. */
89
+ collapsibleSections?: boolean;
90
+ /** Phones: `"stacked"` buttons, or `"paired"` (Accept All over the other two). */
91
+ phoneFooter?: NoticePhoneFooter;
92
+ /** Follow the device's dark mode with `darkPalette` (else the console's). */
93
+ autoDark?: boolean;
94
+ darkPalette?: Partial<SettingsPalette>;
95
+ /** Wide-screen card width, in px (a number, or "480" / "480px"). */
96
+ maxWidth?: string | number;
97
+ /** Logo height, in px (a number, or "40" / "40px"). */
98
+ logoSize?: string | number;
99
+ /** `"sm"`, `"md"` or `"lg"`: scales every text size. */
100
+ textScale?: NoticeTextScale;
101
+ /** `false` turns entrances and transitions off. */
102
+ motion?: boolean;
103
+ /** Web only: React Native has no CSS, so this is accepted and ignored. */
104
+ customCss?: string;
32
105
  font?: string;
33
106
  };
107
+ type SelectionControlType = "checkbox" | "radio" | "dropdown";
34
108
 
35
109
  type Props$1 = Readonly<{
36
110
  noticeId: string;
@@ -62,48 +136,48 @@ type Props$1 = Readonly<{
62
136
  organisationUuid?: string;
63
137
  /** Sandbox workspace UUID (replaces the JWT-decoded workspace in sandbox mode). */
64
138
  workspaceUuid?: string;
139
+ /**
140
+ * API host, e.g. `https://api.redacto.io` (recommended). The SDK calls the
141
+ * consent server at `{host}/consent` and the ledger at `{host}/consent-ledger`.
142
+ * The consent server URL (`…/consent`) still works but is deprecated.
143
+ */
65
144
  baseUrl?: string;
66
- /** Go ledger base URL — serves check-consent and the consent write; omit to use the legacy consent server. */
145
+ /**
146
+ * @deprecated Read only when `baseUrl` is the consent server URL
147
+ * (`…/consent`) or omitted, as in earlier releases: it is then the Go ledger
148
+ * base URL that serves check-consent and the consent write, and leaving it
149
+ * out keeps the legacy consent server. Ignored when `baseUrl` is the API host.
150
+ */
67
151
  ledgerBaseUrl?: string;
68
- settings?: Partial<Settings$1>;
152
+ settings?: Partial<Settings>;
69
153
  language?: string;
70
154
  blockUI?: boolean;
71
155
  onAccept: () => void;
72
156
  onDecline: () => void;
73
157
  onError?: (error: Error) => void;
158
+ otpGate?: {
159
+ required: boolean;
160
+ onVerify: (code: string) => Promise<{
161
+ ok: boolean;
162
+ message?: string;
163
+ }>;
164
+ title?: string;
165
+ description?: string;
166
+ submitLabel?: string;
167
+ };
74
168
  applicationId?: string;
75
169
  validateAgainst?: "all" | "required";
76
170
  includeFullyConsentedData?: boolean;
171
+ /**
172
+ * The button shown when `includeFullyConsentedData` finds everything already
173
+ * consented; it calls `onAccept`. Defaults to "Continue".
174
+ */
77
175
  reviewModeButtonText?: string;
176
+ defaultOpenProducts?: string[];
78
177
  }>;
79
178
 
80
179
  declare const RedactoNoticeConsent: React__default.FC<Props$1>;
81
180
 
82
- type Settings = {
83
- button: {
84
- accept: {
85
- backgroundColor: string;
86
- textColor: string;
87
- };
88
- decline: {
89
- backgroundColor: string;
90
- textColor: string;
91
- };
92
- language: {
93
- backgroundColor: string;
94
- textColor: string;
95
- selectedBackgroundColor?: string;
96
- selectedTextColor?: string;
97
- };
98
- };
99
- link: string;
100
- borderRadius?: string;
101
- backgroundColor?: string;
102
- headingColor?: string;
103
- textColor?: string;
104
- borderColor?: string;
105
- };
106
-
107
181
  declare const RedactoConsentInline: React__default.NamedExoticComponent<Readonly<{
108
182
  org_uuid: string;
109
183
  workspace_uuid: string;
@@ -121,14 +195,54 @@ declare const RedactoConsentInline: React__default.NamedExoticComponent<Readonly
121
195
  applicationId?: string;
122
196
  }>>;
123
197
 
198
+ type RedactoNoticeAssistedProps = Readonly<{
199
+ organisationUuid: string;
200
+ workspaceUuid: string;
201
+ noticeUuid: string;
202
+ /**
203
+ * API host, e.g. `https://api.redacto.io` (recommended). The SDK calls the
204
+ * consent server at `{host}/consent` and the ledger at `{host}/consent-ledger`.
205
+ * The consent server URL (`…/consent`) still works but is deprecated.
206
+ */
207
+ baseUrl?: string;
208
+ /**
209
+ * @deprecated Read only when `baseUrl` is the consent server URL
210
+ * (`…/consent`) or omitted, as in earlier releases: it is then the Go ledger
211
+ * base URL that serves check-consent and the consent write, and leaving it
212
+ * out keeps the legacy consent server. Ignored when `baseUrl` is the API host.
213
+ */
214
+ ledgerBaseUrl?: string;
215
+ defaultOpenProducts?: string[];
216
+ onDecline?: () => void;
217
+ onComplete?: () => void;
218
+ /**
219
+ * Optional code-side styling, display only: overrides the appearance set in
220
+ * the Redacto console, key by key. The submit payload, verification and
221
+ * gating are unchanged.
222
+ */
223
+ settings?: Partial<Settings>;
224
+ }>;
225
+
226
+ declare const RedactoNoticeAssisted: React__default.FC<RedactoNoticeAssistedProps>;
227
+
124
228
  type Props = Readonly<{
125
229
  org_uuid: string;
126
230
  workspace_uuid: string;
127
231
  notice_uuid: string;
128
232
  accessToken?: string;
129
233
  refreshToken?: string;
234
+ /**
235
+ * API host, e.g. `https://api.redacto.io` (recommended). The SDK calls the
236
+ * consent server at `{host}/consent` and the ledger at `{host}/consent-ledger`.
237
+ * The consent server URL (`…/consent`) still works but is deprecated.
238
+ */
130
239
  baseUrl?: string;
131
- /** Go ledger base URL — serves check-consent and the consent write; omit to use the legacy consent server. */
240
+ /**
241
+ * @deprecated Read only when `baseUrl` is the consent server URL
242
+ * (`…/consent`) or omitted, as in earlier releases: it is then the Go ledger
243
+ * base URL that serves check-consent and the consent write, and leaving it
244
+ * out keeps the legacy consent server. Ignored when `baseUrl` is the API host.
245
+ */
132
246
  ledgerBaseUrl?: string;
133
247
  settings?: Partial<Settings>;
134
248
  language?: string;
@@ -139,4 +253,19 @@ type Props = Readonly<{
139
253
  applicationId?: string;
140
254
  }>;
141
255
 
142
- export { RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline, type Props as RedactoNoticeConsentInlineProps, type Props$1 as RedactoNoticeConsentProps, type Settings$1 as Settings };
256
+ type ApiErrorCode = "INVALID_TOKEN" | "TOKEN_TENANT_MISMATCH" | "UNAUTHORIZED" | "USER_NOT_FOUND" | "USER_EMAIL_MISMATCH" | "USER_MOBILE_MISMATCH" | "USER_CONTACT_MISMATCH" | "NO_IDENTIFIER_PROVIDED" | "INVALID_PAYLOAD" | "VALIDATION_ERROR" | "NOTICE_NOT_FOUND" | "NOTICE_CONFIGURATION_NOT_FOUND" | "NOTICE_STILL_IN_DRAFT" | "CONSENT_ALREADY_PROVIDED" | "PURPOSE_NOT_FOUND" | "INVALID_PURPOSE" | "INVALID_DATA_ELEMENTS" | "MISSING_PURPOSE" | "MISSING_DATA_ELEMENTS" | "REQUIRED_DATA_ELEMENT_NOT_ENABLED" | "AUDIO_NOT_FOUND" | "INVALID_LANGUAGE" | "VERIFICATION_FAILED" | "VERIFICATION_EXPIRED" | "GUARDIAN_INFO_NOT_FOUND" | "GUARDIAN_SESSION_INVALID" | "SESSION_EXPIRED" | "INTERNAL_ERROR";
257
+ type ApiErrorCodeLike = ApiErrorCode | (string & {});
258
+
259
+ declare class ApiError extends Error {
260
+ readonly status: number;
261
+ readonly code?: ApiErrorCodeLike;
262
+ readonly shouldRequestNew?: boolean;
263
+ constructor(opts: {
264
+ status: number;
265
+ code?: ApiErrorCodeLike;
266
+ message: string;
267
+ shouldRequestNew?: boolean;
268
+ });
269
+ }
270
+
271
+ export { ApiError, type ApiErrorCode, RedactoNoticeAssisted, type RedactoNoticeAssistedProps, RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline, type Props as RedactoNoticeConsentInlineProps, type Props$1 as RedactoNoticeConsentProps, type Settings };
package/dist/index.d.ts CHANGED
@@ -1,36 +1,110 @@
1
1
  import React__default from 'react';
2
+ import { A as AppearanceStyle, N as NoticeControlStyle, a as NoticeMobileLayout, b as NoticeDesktopPosition, c as NoticeBackdrop, d as NoticePhoneFooter, e as NoticeTextScale } from './types-BYp89x8C.js';
2
3
 
3
- type Settings$1 = {
4
+ type SettingsButtonColors = {
5
+ backgroundColor?: string;
6
+ textColor?: string;
7
+ };
8
+ /**
9
+ * The colours `settings` can set: the top-level palette, and the dark palette
10
+ * under `settings.darkPalette`. Colours are any colour React Native paints and
11
+ * are used as given.
12
+ */
13
+ type SettingsPalette = {
4
14
  button: {
5
- /** Styles the "accept selected" button. */
6
- accept: {
7
- backgroundColor: string;
8
- textColor: string;
9
- };
10
- /** Optional: the accept-all shortcut falls back to `accept` when unset. */
11
- acceptAll?: {
12
- backgroundColor: string;
13
- textColor: string;
15
+ /**
16
+ * The brand accent (checkboxes, switches and Accept Selected's outline),
17
+ * and Accept All's colour when `acceptAll` is unset.
18
+ */
19
+ accept?: SettingsButtonColors;
20
+ /** The Accept All button; falls back to `accept`. */
21
+ acceptAll?: SettingsButtonColors;
22
+ /** The Accept Selected button itself. */
23
+ acceptSelected?: SettingsButtonColors;
24
+ decline?: SettingsButtonColors & {
25
+ borderColor?: string;
14
26
  };
15
- decline: {
16
- backgroundColor: string;
17
- textColor: string;
18
- };
19
- language: {
20
- backgroundColor: string;
21
- textColor: string;
27
+ language?: {
28
+ backgroundColor?: string;
29
+ textColor?: string;
22
30
  selectedBackgroundColor?: string;
23
31
  selectedTextColor?: string;
24
32
  };
25
33
  };
26
34
  link: string;
27
- borderRadius?: string;
28
35
  backgroundColor?: string;
36
+ /** Raised surfaces: menus and panels, and the tint of the glass style. */
37
+ surfaceColor?: string;
29
38
  headingColor?: string;
30
39
  textColor?: string;
40
+ /** Descriptions and hints. */
41
+ mutedTextColor?: string;
31
42
  borderColor?: string;
43
+ /** The dim behind the notice. */
44
+ overlayColor?: string;
45
+ toggle?: {
46
+ onColor?: string;
47
+ offColor?: string;
48
+ knobColor?: string;
49
+ };
50
+ /** The element being read aloud by text-to-speech. */
51
+ ttsHighlight?: {
52
+ backgroundColor?: string;
53
+ textColor?: string;
54
+ };
55
+ };
56
+ /**
57
+ * Code-side styling for the notice. Everything here is optional and overrides,
58
+ * key by key, the appearance set in the Redacto console
59
+ * (`active_config.appearance`): host settings, then the console, then the
60
+ * notice's brand colours and the SDK defaults.
61
+ */
62
+ type Settings = SettingsPalette & {
63
+ /**
64
+ * Visual style: `"classic"`, `"glass"`, `"minimal"` or `"soft"`. Unknown
65
+ * values are ignored and the console's style (else classic) applies.
66
+ */
67
+ theme?: AppearanceStyle;
68
+ /** Defaults to "checkbox". Applies to purposes, product headings and data elements. */
69
+ selectionControl?: SelectionControlType;
70
+ /**
71
+ * How checkbox rows are drawn, in any style: `"checkbox"` or `"switch"`.
72
+ * Unset keeps checkboxes, in every style.
73
+ */
74
+ controlStyle?: NoticeControlStyle;
75
+ /**
76
+ * Asks "are you sure" before Accept All, Accept Selected or Decline submits.
77
+ * Defaults to false, so the one-tap path is unchanged.
78
+ */
79
+ confirmBeforeSubmit?: boolean;
80
+ /** Corner radius, in px ("12" or "12px"). */
81
+ borderRadius?: string;
82
+ /** Phones: `"modal"` (centred) or `"sheet"` (docked to the bottom edge). */
83
+ mobileLayout?: NoticeMobileLayout;
84
+ /** Wider screens: `"center"`, `"bottom-right"`, `"bottom-left"` or `"bottom-bar"`. */
85
+ desktopPosition?: NoticeDesktopPosition;
86
+ /** `"dim"` darkens the screen behind the notice; `"none"` leaves it as is. */
87
+ backdrop?: NoticeBackdrop;
88
+ /** Collapse the notice text and the DPO block into disclosures. */
89
+ collapsibleSections?: boolean;
90
+ /** Phones: `"stacked"` buttons, or `"paired"` (Accept All over the other two). */
91
+ phoneFooter?: NoticePhoneFooter;
92
+ /** Follow the device's dark mode with `darkPalette` (else the console's). */
93
+ autoDark?: boolean;
94
+ darkPalette?: Partial<SettingsPalette>;
95
+ /** Wide-screen card width, in px (a number, or "480" / "480px"). */
96
+ maxWidth?: string | number;
97
+ /** Logo height, in px (a number, or "40" / "40px"). */
98
+ logoSize?: string | number;
99
+ /** `"sm"`, `"md"` or `"lg"`: scales every text size. */
100
+ textScale?: NoticeTextScale;
101
+ /** `false` turns entrances and transitions off. */
102
+ motion?: boolean;
103
+ /** Web only: React Native has no CSS, so this is accepted and ignored. */
104
+ customCss?: string;
32
105
  font?: string;
33
106
  };
107
+ type SelectionControlType = "checkbox" | "radio" | "dropdown";
34
108
 
35
109
  type Props$1 = Readonly<{
36
110
  noticeId: string;
@@ -62,48 +136,48 @@ type Props$1 = Readonly<{
62
136
  organisationUuid?: string;
63
137
  /** Sandbox workspace UUID (replaces the JWT-decoded workspace in sandbox mode). */
64
138
  workspaceUuid?: string;
139
+ /**
140
+ * API host, e.g. `https://api.redacto.io` (recommended). The SDK calls the
141
+ * consent server at `{host}/consent` and the ledger at `{host}/consent-ledger`.
142
+ * The consent server URL (`…/consent`) still works but is deprecated.
143
+ */
65
144
  baseUrl?: string;
66
- /** Go ledger base URL — serves check-consent and the consent write; omit to use the legacy consent server. */
145
+ /**
146
+ * @deprecated Read only when `baseUrl` is the consent server URL
147
+ * (`…/consent`) or omitted, as in earlier releases: it is then the Go ledger
148
+ * base URL that serves check-consent and the consent write, and leaving it
149
+ * out keeps the legacy consent server. Ignored when `baseUrl` is the API host.
150
+ */
67
151
  ledgerBaseUrl?: string;
68
- settings?: Partial<Settings$1>;
152
+ settings?: Partial<Settings>;
69
153
  language?: string;
70
154
  blockUI?: boolean;
71
155
  onAccept: () => void;
72
156
  onDecline: () => void;
73
157
  onError?: (error: Error) => void;
158
+ otpGate?: {
159
+ required: boolean;
160
+ onVerify: (code: string) => Promise<{
161
+ ok: boolean;
162
+ message?: string;
163
+ }>;
164
+ title?: string;
165
+ description?: string;
166
+ submitLabel?: string;
167
+ };
74
168
  applicationId?: string;
75
169
  validateAgainst?: "all" | "required";
76
170
  includeFullyConsentedData?: boolean;
171
+ /**
172
+ * The button shown when `includeFullyConsentedData` finds everything already
173
+ * consented; it calls `onAccept`. Defaults to "Continue".
174
+ */
77
175
  reviewModeButtonText?: string;
176
+ defaultOpenProducts?: string[];
78
177
  }>;
79
178
 
80
179
  declare const RedactoNoticeConsent: React__default.FC<Props$1>;
81
180
 
82
- type Settings = {
83
- button: {
84
- accept: {
85
- backgroundColor: string;
86
- textColor: string;
87
- };
88
- decline: {
89
- backgroundColor: string;
90
- textColor: string;
91
- };
92
- language: {
93
- backgroundColor: string;
94
- textColor: string;
95
- selectedBackgroundColor?: string;
96
- selectedTextColor?: string;
97
- };
98
- };
99
- link: string;
100
- borderRadius?: string;
101
- backgroundColor?: string;
102
- headingColor?: string;
103
- textColor?: string;
104
- borderColor?: string;
105
- };
106
-
107
181
  declare const RedactoConsentInline: React__default.NamedExoticComponent<Readonly<{
108
182
  org_uuid: string;
109
183
  workspace_uuid: string;
@@ -121,14 +195,54 @@ declare const RedactoConsentInline: React__default.NamedExoticComponent<Readonly
121
195
  applicationId?: string;
122
196
  }>>;
123
197
 
198
+ type RedactoNoticeAssistedProps = Readonly<{
199
+ organisationUuid: string;
200
+ workspaceUuid: string;
201
+ noticeUuid: string;
202
+ /**
203
+ * API host, e.g. `https://api.redacto.io` (recommended). The SDK calls the
204
+ * consent server at `{host}/consent` and the ledger at `{host}/consent-ledger`.
205
+ * The consent server URL (`…/consent`) still works but is deprecated.
206
+ */
207
+ baseUrl?: string;
208
+ /**
209
+ * @deprecated Read only when `baseUrl` is the consent server URL
210
+ * (`…/consent`) or omitted, as in earlier releases: it is then the Go ledger
211
+ * base URL that serves check-consent and the consent write, and leaving it
212
+ * out keeps the legacy consent server. Ignored when `baseUrl` is the API host.
213
+ */
214
+ ledgerBaseUrl?: string;
215
+ defaultOpenProducts?: string[];
216
+ onDecline?: () => void;
217
+ onComplete?: () => void;
218
+ /**
219
+ * Optional code-side styling, display only: overrides the appearance set in
220
+ * the Redacto console, key by key. The submit payload, verification and
221
+ * gating are unchanged.
222
+ */
223
+ settings?: Partial<Settings>;
224
+ }>;
225
+
226
+ declare const RedactoNoticeAssisted: React__default.FC<RedactoNoticeAssistedProps>;
227
+
124
228
  type Props = Readonly<{
125
229
  org_uuid: string;
126
230
  workspace_uuid: string;
127
231
  notice_uuid: string;
128
232
  accessToken?: string;
129
233
  refreshToken?: string;
234
+ /**
235
+ * API host, e.g. `https://api.redacto.io` (recommended). The SDK calls the
236
+ * consent server at `{host}/consent` and the ledger at `{host}/consent-ledger`.
237
+ * The consent server URL (`…/consent`) still works but is deprecated.
238
+ */
130
239
  baseUrl?: string;
131
- /** Go ledger base URL — serves check-consent and the consent write; omit to use the legacy consent server. */
240
+ /**
241
+ * @deprecated Read only when `baseUrl` is the consent server URL
242
+ * (`…/consent`) or omitted, as in earlier releases: it is then the Go ledger
243
+ * base URL that serves check-consent and the consent write, and leaving it
244
+ * out keeps the legacy consent server. Ignored when `baseUrl` is the API host.
245
+ */
132
246
  ledgerBaseUrl?: string;
133
247
  settings?: Partial<Settings>;
134
248
  language?: string;
@@ -139,4 +253,19 @@ type Props = Readonly<{
139
253
  applicationId?: string;
140
254
  }>;
141
255
 
142
- export { RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline, type Props as RedactoNoticeConsentInlineProps, type Props$1 as RedactoNoticeConsentProps, type Settings$1 as Settings };
256
+ type ApiErrorCode = "INVALID_TOKEN" | "TOKEN_TENANT_MISMATCH" | "UNAUTHORIZED" | "USER_NOT_FOUND" | "USER_EMAIL_MISMATCH" | "USER_MOBILE_MISMATCH" | "USER_CONTACT_MISMATCH" | "NO_IDENTIFIER_PROVIDED" | "INVALID_PAYLOAD" | "VALIDATION_ERROR" | "NOTICE_NOT_FOUND" | "NOTICE_CONFIGURATION_NOT_FOUND" | "NOTICE_STILL_IN_DRAFT" | "CONSENT_ALREADY_PROVIDED" | "PURPOSE_NOT_FOUND" | "INVALID_PURPOSE" | "INVALID_DATA_ELEMENTS" | "MISSING_PURPOSE" | "MISSING_DATA_ELEMENTS" | "REQUIRED_DATA_ELEMENT_NOT_ENABLED" | "AUDIO_NOT_FOUND" | "INVALID_LANGUAGE" | "VERIFICATION_FAILED" | "VERIFICATION_EXPIRED" | "GUARDIAN_INFO_NOT_FOUND" | "GUARDIAN_SESSION_INVALID" | "SESSION_EXPIRED" | "INTERNAL_ERROR";
257
+ type ApiErrorCodeLike = ApiErrorCode | (string & {});
258
+
259
+ declare class ApiError extends Error {
260
+ readonly status: number;
261
+ readonly code?: ApiErrorCodeLike;
262
+ readonly shouldRequestNew?: boolean;
263
+ constructor(opts: {
264
+ status: number;
265
+ code?: ApiErrorCodeLike;
266
+ message: string;
267
+ shouldRequestNew?: boolean;
268
+ });
269
+ }
270
+
271
+ export { ApiError, type ApiErrorCode, RedactoNoticeAssisted, type RedactoNoticeAssistedProps, RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline, type Props as RedactoNoticeConsentInlineProps, type Props$1 as RedactoNoticeConsentProps, type Settings };