@redacto.io/consent-sdk-react-native 1.0.0 → 2.0.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/LICENSE +176 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/index.js +1601 -466
- package/dist/index.mjs +1556 -418
- package/dist/privacy-center.d.mts +652 -0
- package/dist/privacy-center.d.ts +652 -0
- package/dist/privacy-center.js +14592 -0
- package/dist/privacy-center.mjs +14593 -0
- package/package.json +33 -7
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
|
+
import { StyleProp, ViewStyle, TextStyle, KeyboardTypeOptions } from 'react-native';
|
|
5
|
+
|
|
6
|
+
type Workspace = {
|
|
7
|
+
uuid: string;
|
|
8
|
+
suid: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
workspace_type: string;
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
type OrganizationDetail = {
|
|
15
|
+
uuid: string;
|
|
16
|
+
suid: string;
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
description: string;
|
|
20
|
+
domain: string;
|
|
21
|
+
workspaces: Workspace[];
|
|
22
|
+
ai_summary: Record<string, unknown>;
|
|
23
|
+
icon_url: string | null;
|
|
24
|
+
activated: boolean;
|
|
25
|
+
allowed_domains: string[];
|
|
26
|
+
};
|
|
27
|
+
type DataElement = {
|
|
28
|
+
uuid: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
required: boolean;
|
|
33
|
+
given_consent: boolean;
|
|
34
|
+
selected: boolean;
|
|
35
|
+
};
|
|
36
|
+
type Purpose = {
|
|
37
|
+
uuid: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
industries: string;
|
|
41
|
+
selected: boolean;
|
|
42
|
+
given_consent: boolean;
|
|
43
|
+
data_elements: DataElement[];
|
|
44
|
+
status?: string;
|
|
45
|
+
validity?: number | null;
|
|
46
|
+
purpose_uuid?: string;
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
};
|
|
49
|
+
type RawPurposeWrapper = {
|
|
50
|
+
purpose: Purpose;
|
|
51
|
+
};
|
|
52
|
+
type GrievanceValue = 'consent_violation' | 'unlawful_processing' | 'data_breach';
|
|
53
|
+
type GrievanceOptions = {
|
|
54
|
+
value: GrievanceValue;
|
|
55
|
+
label: string;
|
|
56
|
+
};
|
|
57
|
+
type FormData$1 = {
|
|
58
|
+
uuid: string;
|
|
59
|
+
name: string;
|
|
60
|
+
contact: string;
|
|
61
|
+
grievance_options: GrievanceOptions[];
|
|
62
|
+
purposes: RawPurposeWrapper[];
|
|
63
|
+
};
|
|
64
|
+
declare enum RequestTypeEnum {
|
|
65
|
+
ACCESS = "ACCESS",
|
|
66
|
+
CORRECTION = "CORRECTION",
|
|
67
|
+
ERASURE = "erasure",
|
|
68
|
+
GRIEVANCE = "grievance",
|
|
69
|
+
NOMINATION = "nomination"
|
|
70
|
+
}
|
|
71
|
+
type NominationData = {
|
|
72
|
+
nominee_email: string;
|
|
73
|
+
nominee_mobile?: string;
|
|
74
|
+
};
|
|
75
|
+
type UpdatePurpose = {
|
|
76
|
+
purpose_uuid: string;
|
|
77
|
+
data_element_uuids: string[];
|
|
78
|
+
};
|
|
79
|
+
type UpdateCorrectionDataItem = {
|
|
80
|
+
name: string;
|
|
81
|
+
curr_value: string;
|
|
82
|
+
new_value: string;
|
|
83
|
+
};
|
|
84
|
+
declare enum GrievanceTypeEnum {
|
|
85
|
+
CONSENT_VIOLATION = "consent_violation",
|
|
86
|
+
UNLAWFUL_PROCESSING = "unlawful_processing",
|
|
87
|
+
DATA_BREACH = "data_breach"
|
|
88
|
+
}
|
|
89
|
+
type GrievanceTypeElement = {
|
|
90
|
+
grievance: GrievanceValue;
|
|
91
|
+
};
|
|
92
|
+
type UserDataRequest = {
|
|
93
|
+
uuid: string;
|
|
94
|
+
name: string;
|
|
95
|
+
contact: string;
|
|
96
|
+
request_type: RequestTypeEnum;
|
|
97
|
+
supporting_docs_uuids: string[];
|
|
98
|
+
request_details: {
|
|
99
|
+
purposes: UpdatePurpose[];
|
|
100
|
+
correction_data: UpdateCorrectionDataItem[];
|
|
101
|
+
grievance_types: GrievanceTypeElement[];
|
|
102
|
+
nomination_data?: NominationData;
|
|
103
|
+
};
|
|
104
|
+
time_period: number | null;
|
|
105
|
+
requestor_note: string;
|
|
106
|
+
};
|
|
107
|
+
type CreateCaseResponse = {
|
|
108
|
+
code: number;
|
|
109
|
+
status: string;
|
|
110
|
+
detail: {
|
|
111
|
+
uuid: string;
|
|
112
|
+
case_id: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
type OtpResponse = {
|
|
116
|
+
uuid: string;
|
|
117
|
+
to: string;
|
|
118
|
+
channel: string;
|
|
119
|
+
expire_at: string;
|
|
120
|
+
success: boolean;
|
|
121
|
+
message: string;
|
|
122
|
+
};
|
|
123
|
+
type OtpVerificationResponse = {
|
|
124
|
+
token: string;
|
|
125
|
+
success: boolean;
|
|
126
|
+
message: string;
|
|
127
|
+
};
|
|
128
|
+
type TokenExchangeResponse = {
|
|
129
|
+
token: string;
|
|
130
|
+
refresh_token: string;
|
|
131
|
+
expires_at: string;
|
|
132
|
+
notice_uuid: string;
|
|
133
|
+
};
|
|
134
|
+
type ConsentDataElement = {
|
|
135
|
+
uuid: string;
|
|
136
|
+
name: string;
|
|
137
|
+
enabled: boolean;
|
|
138
|
+
required: boolean;
|
|
139
|
+
selected: boolean;
|
|
140
|
+
};
|
|
141
|
+
type UserConsent = {
|
|
142
|
+
purpose_uuid?: string;
|
|
143
|
+
purpose: string;
|
|
144
|
+
purpose_description: string;
|
|
145
|
+
status: ConsentStatusEnum;
|
|
146
|
+
given_date: string;
|
|
147
|
+
valid_till: string;
|
|
148
|
+
method: string;
|
|
149
|
+
data_elements: ConsentDataElement[];
|
|
150
|
+
product_uuid?: string;
|
|
151
|
+
product_name?: string;
|
|
152
|
+
product_description?: string | null;
|
|
153
|
+
nominator_info?: NominatorInfo;
|
|
154
|
+
};
|
|
155
|
+
type NominatorInfo = {
|
|
156
|
+
org_user_id: string;
|
|
157
|
+
name: string | null;
|
|
158
|
+
uuid: string;
|
|
159
|
+
email: string | null;
|
|
160
|
+
};
|
|
161
|
+
type ConsentHistoryStatusSummary = {
|
|
162
|
+
total_purposes: number;
|
|
163
|
+
direct_purposes: number;
|
|
164
|
+
nominated_purposes: number;
|
|
165
|
+
nominee_purposes?: number;
|
|
166
|
+
active_purposes: number;
|
|
167
|
+
inactive_purposes: number;
|
|
168
|
+
};
|
|
169
|
+
type ProductConsentHistoryGroup = {
|
|
170
|
+
product_uuid: string;
|
|
171
|
+
product_name: string;
|
|
172
|
+
product_description: string | null;
|
|
173
|
+
purposes: UserConsent[];
|
|
174
|
+
total_purposes: number;
|
|
175
|
+
active_purposes: number;
|
|
176
|
+
};
|
|
177
|
+
type NominatedPurposesGroup = {
|
|
178
|
+
nominator_info: NominatorInfo;
|
|
179
|
+
product_groups: ProductConsentHistoryGroup[];
|
|
180
|
+
};
|
|
181
|
+
type Pagination = {
|
|
182
|
+
total_count: number;
|
|
183
|
+
offset: number;
|
|
184
|
+
limit: number;
|
|
185
|
+
};
|
|
186
|
+
type UserConsentDetail = {
|
|
187
|
+
data?: UserConsent[];
|
|
188
|
+
product_purpose_groups?: ProductConsentHistoryGroup[];
|
|
189
|
+
pagination: Pagination;
|
|
190
|
+
direct_product_groups?: ProductConsentHistoryGroup[];
|
|
191
|
+
user_status?: 'ACTIVE' | 'TRANSFERRED' | null;
|
|
192
|
+
nominated_purposes?: NominatedPurposesGroup[];
|
|
193
|
+
nominators?: NominatorInfo[];
|
|
194
|
+
status_summary?: ConsentHistoryStatusSummary | null;
|
|
195
|
+
};
|
|
196
|
+
declare enum ConsentStatusEnum {
|
|
197
|
+
ACTIVE = "ACTIVE",
|
|
198
|
+
WITHDRAWN = "WITHDRAW",
|
|
199
|
+
EXPIRED = "EXPIRED",
|
|
200
|
+
DECLINED = "DECLINED"
|
|
201
|
+
}
|
|
202
|
+
type ConsentAction = 'revoke' | 'regrant' | 'renew';
|
|
203
|
+
type ManageConsentParams = {
|
|
204
|
+
organizationId: string;
|
|
205
|
+
workspaceId: string;
|
|
206
|
+
purposeId: string;
|
|
207
|
+
contact: string;
|
|
208
|
+
action: ConsentAction;
|
|
209
|
+
nominatorContact?: string;
|
|
210
|
+
dataElementUuids?: string[];
|
|
211
|
+
};
|
|
212
|
+
type Activity = {
|
|
213
|
+
activity_type: string;
|
|
214
|
+
activity_type_display?: string;
|
|
215
|
+
timestamp: string;
|
|
216
|
+
title: string;
|
|
217
|
+
title_display?: string;
|
|
218
|
+
description: string;
|
|
219
|
+
description_display?: string;
|
|
220
|
+
case_id?: string;
|
|
221
|
+
status?: 'Processing' | 'Completed' | 'Rejected';
|
|
222
|
+
status_display?: string;
|
|
223
|
+
};
|
|
224
|
+
type ActivityDetail = {
|
|
225
|
+
data: Activity[];
|
|
226
|
+
pagination: Pagination;
|
|
227
|
+
};
|
|
228
|
+
type CaseRequest = {
|
|
229
|
+
uuid: string;
|
|
230
|
+
case_id: string;
|
|
231
|
+
status: string;
|
|
232
|
+
status_display?: string;
|
|
233
|
+
request_type: string;
|
|
234
|
+
request_type_display?: string;
|
|
235
|
+
description: string;
|
|
236
|
+
description_display?: string;
|
|
237
|
+
created_at: string;
|
|
238
|
+
completed_at?: string;
|
|
239
|
+
due_date?: string;
|
|
240
|
+
request_details?: any;
|
|
241
|
+
};
|
|
242
|
+
type CaseHistoryDetail = {
|
|
243
|
+
data: CaseRequest[];
|
|
244
|
+
pagination: Pagination;
|
|
245
|
+
};
|
|
246
|
+
type MessageType = 'message_sent' | 'document_requested' | 'document_submitted' | 'document_replaced' | 'document_replacement_requested' | 'document_approved' | 'document_rejected';
|
|
247
|
+
type DocumentRequestStatus = 'pending' | 'under_review' | 'approved' | 'rejected' | 'replacement_requested';
|
|
248
|
+
type FileUrlMap = {
|
|
249
|
+
url?: string;
|
|
250
|
+
download_url?: string;
|
|
251
|
+
};
|
|
252
|
+
type MessageDocument = {
|
|
253
|
+
uuid: string;
|
|
254
|
+
file_name: string | null;
|
|
255
|
+
content_type: string | null;
|
|
256
|
+
file_size: number | null;
|
|
257
|
+
file_url: FileUrlMap | null;
|
|
258
|
+
};
|
|
259
|
+
type DocumentRequestMetadata = {
|
|
260
|
+
title: string;
|
|
261
|
+
accepted_document: string;
|
|
262
|
+
document_request_status: DocumentRequestStatus;
|
|
263
|
+
document_request_uuid: string | null;
|
|
264
|
+
rejection_reason: string;
|
|
265
|
+
};
|
|
266
|
+
type CaseMessage = {
|
|
267
|
+
uuid: string;
|
|
268
|
+
case_uuid: string;
|
|
269
|
+
sender_role: 'data_fiduciary' | 'data_principal';
|
|
270
|
+
triggered_by_email: string;
|
|
271
|
+
created_at: string;
|
|
272
|
+
body: string;
|
|
273
|
+
document_uuids: string[];
|
|
274
|
+
documents: MessageDocument[];
|
|
275
|
+
message_type: MessageType;
|
|
276
|
+
document_request_metadata: DocumentRequestMetadata | null;
|
|
277
|
+
};
|
|
278
|
+
type TabId = 'messages' | 'request-details';
|
|
279
|
+
type PendingUpload = {
|
|
280
|
+
uuid: string;
|
|
281
|
+
file_name: string;
|
|
282
|
+
file_size: number;
|
|
283
|
+
};
|
|
284
|
+
type CaseStatusVariant = 'success' | 'error' | 'warning' | 'info' | 'secondary';
|
|
285
|
+
type UploadDocumentResponse = {
|
|
286
|
+
uuid: string;
|
|
287
|
+
suid: string;
|
|
288
|
+
file_name: string;
|
|
289
|
+
file_type: string;
|
|
290
|
+
content_type: string;
|
|
291
|
+
file_size: number;
|
|
292
|
+
created_at: string;
|
|
293
|
+
is_public: boolean;
|
|
294
|
+
file: string;
|
|
295
|
+
file_hash: string | null;
|
|
296
|
+
status: string;
|
|
297
|
+
allow_ai_processing: boolean;
|
|
298
|
+
metadata: Record<string, string> | null;
|
|
299
|
+
};
|
|
300
|
+
type CaseDetailsTab = Readonly<{
|
|
301
|
+
id: TabId;
|
|
302
|
+
label: string;
|
|
303
|
+
}>;
|
|
304
|
+
|
|
305
|
+
type InternalPage = 'consent-manager' | 'form' | 'activity' | 'case-details';
|
|
306
|
+
interface NavigationContextType {
|
|
307
|
+
currentPage: InternalPage;
|
|
308
|
+
navigateTo: (page: InternalPage) => void;
|
|
309
|
+
selectedCase: CaseRequest | null;
|
|
310
|
+
setSelectedCase: (c: CaseRequest | null) => void;
|
|
311
|
+
pendingCaseUuid: string | null;
|
|
312
|
+
}
|
|
313
|
+
declare function NavigationProvider({ children, initialPage }: {
|
|
314
|
+
children: ReactNode;
|
|
315
|
+
initialPage?: InternalPage;
|
|
316
|
+
}): react_jsx_runtime.JSX.Element;
|
|
317
|
+
declare function useInternalNavigation(): NavigationContextType;
|
|
318
|
+
|
|
319
|
+
interface RedactoPrivacyCenterProps {
|
|
320
|
+
baseUrl: string;
|
|
321
|
+
slug: string;
|
|
322
|
+
theme?: 'light' | 'dark';
|
|
323
|
+
accessToken: string;
|
|
324
|
+
refreshToken: string;
|
|
325
|
+
onError: (error: Error) => boolean;
|
|
326
|
+
initialPage?: InternalPage;
|
|
327
|
+
onBack?: 'back' | 'signout';
|
|
328
|
+
}
|
|
329
|
+
declare function RedactoPrivacyCenter({ baseUrl, slug: _slug, theme, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react_jsx_runtime.JSX.Element;
|
|
330
|
+
|
|
331
|
+
declare function ConsentManager(): react_jsx_runtime.JSX.Element;
|
|
332
|
+
|
|
333
|
+
declare function ActivitiesList(): react_jsx_runtime.JSX.Element;
|
|
334
|
+
|
|
335
|
+
interface FormProps {
|
|
336
|
+
onCreateRequest?: () => void;
|
|
337
|
+
}
|
|
338
|
+
declare function Form({ onCreateRequest }: FormProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
|
|
340
|
+
declare function FormPage(): react_jsx_runtime.JSX.Element;
|
|
341
|
+
|
|
342
|
+
interface CaseHistoryProps {
|
|
343
|
+
onCreateRequest: () => void;
|
|
344
|
+
}
|
|
345
|
+
declare function CaseHistory({ onCreateRequest }: CaseHistoryProps): react_jsx_runtime.JSX.Element;
|
|
346
|
+
|
|
347
|
+
declare function CaseDetailsPage(): react_jsx_runtime.JSX.Element;
|
|
348
|
+
|
|
349
|
+
interface SideMenuProps {
|
|
350
|
+
onBack?: 'back' | 'signout';
|
|
351
|
+
}
|
|
352
|
+
declare function SideMenu({ onBack }?: SideMenuProps): react_jsx_runtime.JSX.Element;
|
|
353
|
+
|
|
354
|
+
interface NavbarProps {
|
|
355
|
+
onBack?: 'back' | 'signout';
|
|
356
|
+
}
|
|
357
|
+
declare function Navbar({ onBack }: NavbarProps): react_jsx_runtime.JSX.Element;
|
|
358
|
+
|
|
359
|
+
declare function Footer(): react_jsx_runtime.JSX.Element;
|
|
360
|
+
|
|
361
|
+
declare function BottomTabBar(): react_jsx_runtime.JSX.Element;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Options for apiFetch function
|
|
365
|
+
*/
|
|
366
|
+
type ApiFetchOptions = RequestInit & {
|
|
367
|
+
/**
|
|
368
|
+
* Auth token getter function
|
|
369
|
+
*/
|
|
370
|
+
getAuthToken?: () => Promise<string | null>;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Standard API response wrapper
|
|
374
|
+
*/
|
|
375
|
+
type ApiResponse<T> = {
|
|
376
|
+
code: number;
|
|
377
|
+
status: string;
|
|
378
|
+
detail: T;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Base request parameters for consent service calls
|
|
383
|
+
*/
|
|
384
|
+
type BaseRequest = {
|
|
385
|
+
organisationUuid: string;
|
|
386
|
+
workspaceUuid: string;
|
|
387
|
+
authToken: string;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Consent service client factory.
|
|
391
|
+
* Creates a client instance with a specific base URL.
|
|
392
|
+
* @param baseUrl - Consent server base URL
|
|
393
|
+
*/
|
|
394
|
+
declare function createConsentClient(baseUrl: string): {
|
|
395
|
+
/**
|
|
396
|
+
* Get form data (privacy center)
|
|
397
|
+
*/
|
|
398
|
+
getFormData(baseRequest: BaseRequest, contact: string, authToken?: string, options?: ApiFetchOptions & {
|
|
399
|
+
useSessionAuth?: boolean;
|
|
400
|
+
}, language?: string): Promise<unknown>;
|
|
401
|
+
/**
|
|
402
|
+
* Create case request (privacy center or case management)
|
|
403
|
+
*/
|
|
404
|
+
createCaseRequest(baseRequest: BaseRequest, payload: unknown, authToken?: string, options?: ApiFetchOptions & {
|
|
405
|
+
useSessionAuth?: boolean;
|
|
406
|
+
}): Promise<unknown>;
|
|
407
|
+
/**
|
|
408
|
+
* Create OTP (public)
|
|
409
|
+
*/
|
|
410
|
+
createOtp(organisationId: string, workspaceId: string, email: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
411
|
+
/**
|
|
412
|
+
* Verify OTP (public)
|
|
413
|
+
*/
|
|
414
|
+
verifyOtp(organisationId: string, workspaceId: string, otpId: string, otp: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
415
|
+
/**
|
|
416
|
+
* Exchange one-time token for JWT tokens (public)
|
|
417
|
+
*/
|
|
418
|
+
exchangeToken(token: string): Promise<unknown>;
|
|
419
|
+
/**
|
|
420
|
+
* Refresh OTP token (public)
|
|
421
|
+
*/
|
|
422
|
+
refreshOtpToken(organisationId: string, workspaceId: string, refreshToken: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
423
|
+
/**
|
|
424
|
+
* Get products
|
|
425
|
+
*/
|
|
426
|
+
getProducts(baseRequest: BaseRequest, skip?: number, limit?: number, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
427
|
+
/**
|
|
428
|
+
* Get user consents (privacy center)
|
|
429
|
+
*/
|
|
430
|
+
getUserConsents(baseRequest: BaseRequest, contact: string, offset?: number, limit?: number, search?: string, status?: string, product_uuid?: string, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
431
|
+
/**
|
|
432
|
+
* Manage consent (privacy center) - revoke, regrant, or renew
|
|
433
|
+
*/
|
|
434
|
+
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[]): Promise<unknown>;
|
|
435
|
+
/**
|
|
436
|
+
* Get activities (privacy center)
|
|
437
|
+
*/
|
|
438
|
+
getActivities(baseRequest: BaseRequest, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
439
|
+
/**
|
|
440
|
+
* Get case history (privacy center)
|
|
441
|
+
*/
|
|
442
|
+
getCaseHistory(baseRequest: BaseRequest, contact: string, offset?: number, limit?: number, language?: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
443
|
+
/**
|
|
444
|
+
* Get case messages (privacy center)
|
|
445
|
+
*/
|
|
446
|
+
getCaseMessages(baseRequest: BaseRequest, caseUuid: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
447
|
+
/**
|
|
448
|
+
* Send a message in a case (privacy center)
|
|
449
|
+
*/
|
|
450
|
+
sendCaseMessage(baseRequest: BaseRequest, caseUuid: string, body: string, documentUuids: string[], authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
451
|
+
/**
|
|
452
|
+
* Upload a document for a case (privacy center)
|
|
453
|
+
*/
|
|
454
|
+
uploadCaseDocument(baseRequest: BaseRequest, caseUuid: string, formData: FormData, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
455
|
+
/**
|
|
456
|
+
* Submit a document for a document request (privacy center)
|
|
457
|
+
*/
|
|
458
|
+
submitDocumentForRequest(baseRequest: BaseRequest, caseUuid: string, requestEventUuid: string, documentUuid: string, body: string, authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">): Promise<unknown>;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
interface BaseUrlContextValue {
|
|
462
|
+
baseUrl: string;
|
|
463
|
+
consentClient: ReturnType<typeof createConsentClient>;
|
|
464
|
+
}
|
|
465
|
+
declare function BaseUrlProvider({ children, baseUrl }: {
|
|
466
|
+
children: ReactNode;
|
|
467
|
+
baseUrl: string;
|
|
468
|
+
}): react_jsx_runtime.JSX.Element;
|
|
469
|
+
declare function useBaseUrl(): BaseUrlContextValue;
|
|
470
|
+
|
|
471
|
+
declare function createOtpServer(email: string, organizationId: string, workspaceId: string, consentClient?: ReturnType<typeof createConsentClient>): Promise<OtpResponse>;
|
|
472
|
+
declare function verifyOtpServer(otpId: string, otp: string, organizationId: string, workspaceId: string, consentClient?: ReturnType<typeof createConsentClient>): Promise<OtpVerificationResponse>;
|
|
473
|
+
declare function exchangeTokenServer(token: string, consentClient?: ReturnType<typeof createConsentClient>): Promise<TokenExchangeResponse>;
|
|
474
|
+
|
|
475
|
+
declare const decodeJwtToken: (token: string) => {
|
|
476
|
+
organisation_uuid?: string;
|
|
477
|
+
organisation_name?: string;
|
|
478
|
+
workspace_uuid?: string;
|
|
479
|
+
[key: string]: any;
|
|
480
|
+
} | null;
|
|
481
|
+
declare const isJwtExpired: (token: string, bufferSeconds?: number) => boolean;
|
|
482
|
+
declare const signOutPrivacyCenter: () => void;
|
|
483
|
+
declare const compareEmails: (email1: string | null, email2: string | null) => boolean;
|
|
484
|
+
declare const ensureValidToken: (organizationId?: string, workspaceId?: string, _slug?: string, authContext?: {
|
|
485
|
+
accessToken?: string;
|
|
486
|
+
refreshToken?: string;
|
|
487
|
+
onError?: (error: Error) => boolean;
|
|
488
|
+
updateTokens?: (accessToken: string, refreshToken?: string) => void;
|
|
489
|
+
}, consentClient?: any) => Promise<string | null>;
|
|
490
|
+
type ActivityBadgeStatus = 'success' | 'warning' | 'error' | 'info' | 'pending';
|
|
491
|
+
declare const getActivityTypeStatus: (activityType: string) => ActivityBadgeStatus;
|
|
492
|
+
declare const formatActivityType: (activityType: string) => string;
|
|
493
|
+
|
|
494
|
+
interface AuthContext {
|
|
495
|
+
accessToken?: string;
|
|
496
|
+
refreshToken?: string;
|
|
497
|
+
onError?: (error: Error) => boolean;
|
|
498
|
+
updateTokens?: (accessToken: string, refreshToken?: string) => void;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
declare const getFormData: (organizationId: string, workspaceId: string, contact: string, _isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<FormData$1 | null>;
|
|
502
|
+
declare const createCaseRequest: (organizationId: string, workspaceId: string, data: UserDataRequest, _isPopup?: boolean, useSessionAuth?: boolean, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CreateCaseResponse | null>;
|
|
503
|
+
declare const fetchProducts: (organizationId: string, workspaceId: string, skip?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<Array<{
|
|
504
|
+
uuid: string;
|
|
505
|
+
name: string;
|
|
506
|
+
description?: string;
|
|
507
|
+
}> | null>;
|
|
508
|
+
declare const fetchUserConsents: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, search?: string, status?: string, product_uuid?: string, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<UserConsentDetail | null>;
|
|
509
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, }: {
|
|
510
|
+
organizationId: string;
|
|
511
|
+
workspaceId: string;
|
|
512
|
+
purposeId: string;
|
|
513
|
+
contact: string;
|
|
514
|
+
action: "revoke" | "regrant" | "renew";
|
|
515
|
+
authContext?: AuthContext;
|
|
516
|
+
consentClient?: BaseUrlContextValue["consentClient"];
|
|
517
|
+
nominatorContact?: string;
|
|
518
|
+
dataElementUuids?: string[];
|
|
519
|
+
}) => Promise<boolean | null>;
|
|
520
|
+
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
521
|
+
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
|
522
|
+
declare const getCaseMessages: (organizationId: string, workspaceId: string, caseUuid: string, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CaseMessage[] | null>;
|
|
523
|
+
declare const sendCaseMessage: (organizationId: string, workspaceId: string, caseUuid: string, body: string, documentUuids: string[], authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CaseMessage | null>;
|
|
524
|
+
declare const uploadCaseDocument: (organizationId: string, workspaceId: string, caseUuid: string, formData: globalThis.FormData, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<UploadDocumentResponse | null>;
|
|
525
|
+
declare const submitDocumentForRequest: (organizationId: string, workspaceId: string, caseUuid: string, requestEventUuid: string, documentUuid: string, body: string, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"]) => Promise<CaseMessage | null>;
|
|
526
|
+
|
|
527
|
+
declare const useCaseHistory: (organizationId: string | undefined, workspaceId: string | undefined, contact: string | undefined, authContext?: AuthContext) => _tanstack_react_query.UseQueryResult<CaseRequest[], Error>;
|
|
528
|
+
declare const useCaseMessages: (organizationId: string | undefined, workspaceId: string | undefined, caseUuid: string | undefined, authContext?: AuthContext, pollingInterval?: number) => _tanstack_react_query.UseQueryResult<CaseMessage[], Error>;
|
|
529
|
+
|
|
530
|
+
interface AuthContextType {
|
|
531
|
+
accessToken: string;
|
|
532
|
+
refreshToken: string;
|
|
533
|
+
email: string | null;
|
|
534
|
+
organizationId: string | null;
|
|
535
|
+
workspaceId: string | null;
|
|
536
|
+
organizationName: string | null;
|
|
537
|
+
updateTokens: (accessToken: string, refreshToken?: string) => void;
|
|
538
|
+
onError: (error: Error) => boolean;
|
|
539
|
+
}
|
|
540
|
+
interface AuthProviderProps {
|
|
541
|
+
children: ReactNode;
|
|
542
|
+
accessToken: string;
|
|
543
|
+
refreshToken: string;
|
|
544
|
+
onError: (error: Error) => boolean;
|
|
545
|
+
}
|
|
546
|
+
declare function AuthProvider({ children, accessToken: initialAccessToken, refreshToken: initialRefreshToken, onError }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
547
|
+
declare function useAuth(): AuthContextType;
|
|
548
|
+
|
|
549
|
+
type Theme = 'light' | 'dark';
|
|
550
|
+
interface ThemeContextType {
|
|
551
|
+
theme: Theme;
|
|
552
|
+
setTheme: (theme: Theme) => void;
|
|
553
|
+
colors: ThemeColors;
|
|
554
|
+
}
|
|
555
|
+
interface ThemeColors {
|
|
556
|
+
background: string;
|
|
557
|
+
surface: string;
|
|
558
|
+
text: string;
|
|
559
|
+
textSecondary: string;
|
|
560
|
+
border: string;
|
|
561
|
+
primary: string;
|
|
562
|
+
primaryText: string;
|
|
563
|
+
error: string;
|
|
564
|
+
success: string;
|
|
565
|
+
warning: string;
|
|
566
|
+
}
|
|
567
|
+
declare function ThemeProvider({ children, defaultTheme }: {
|
|
568
|
+
children: ReactNode;
|
|
569
|
+
defaultTheme?: Theme;
|
|
570
|
+
}): react_jsx_runtime.JSX.Element;
|
|
571
|
+
declare function useTheme(): ThemeContextType;
|
|
572
|
+
|
|
573
|
+
type PCButtonVariant = 'primary' | 'outline' | 'ghost';
|
|
574
|
+
type PCButtonProps = {
|
|
575
|
+
onPress: () => void;
|
|
576
|
+
title: string;
|
|
577
|
+
variant?: PCButtonVariant;
|
|
578
|
+
disabled?: boolean;
|
|
579
|
+
loading?: boolean;
|
|
580
|
+
style?: StyleProp<ViewStyle>;
|
|
581
|
+
textStyle?: StyleProp<TextStyle>;
|
|
582
|
+
};
|
|
583
|
+
declare const PCButton: React.FC<PCButtonProps>;
|
|
584
|
+
|
|
585
|
+
type PCInputProps = {
|
|
586
|
+
label?: string;
|
|
587
|
+
value: string;
|
|
588
|
+
onChangeText: (text: string) => void;
|
|
589
|
+
placeholder?: string;
|
|
590
|
+
error?: string;
|
|
591
|
+
multiline?: boolean;
|
|
592
|
+
keyboardType?: KeyboardTypeOptions;
|
|
593
|
+
secureTextEntry?: boolean;
|
|
594
|
+
editable?: boolean;
|
|
595
|
+
};
|
|
596
|
+
declare const PCInput: React.FC<PCInputProps>;
|
|
597
|
+
|
|
598
|
+
type PCSelectOption = {
|
|
599
|
+
value: string;
|
|
600
|
+
label: string;
|
|
601
|
+
};
|
|
602
|
+
type PCSelectProps = {
|
|
603
|
+
label?: string;
|
|
604
|
+
value: string;
|
|
605
|
+
options: PCSelectOption[];
|
|
606
|
+
onChange: (value: string) => void;
|
|
607
|
+
placeholder?: string;
|
|
608
|
+
compact?: boolean;
|
|
609
|
+
style?: ViewStyle;
|
|
610
|
+
};
|
|
611
|
+
declare const PCSelect: React.FC<PCSelectProps>;
|
|
612
|
+
|
|
613
|
+
type PCModalSize = 'sm' | 'md' | 'lg';
|
|
614
|
+
type PCModalProps = {
|
|
615
|
+
visible: boolean;
|
|
616
|
+
onClose: () => void;
|
|
617
|
+
title?: string;
|
|
618
|
+
children: React.ReactNode;
|
|
619
|
+
size?: PCModalSize;
|
|
620
|
+
};
|
|
621
|
+
declare const PCModal: React.FC<PCModalProps>;
|
|
622
|
+
|
|
623
|
+
type PCCheckboxProps = {
|
|
624
|
+
checked: boolean;
|
|
625
|
+
onChange: (checked: boolean) => void;
|
|
626
|
+
label?: string;
|
|
627
|
+
disabled?: boolean;
|
|
628
|
+
};
|
|
629
|
+
declare const PCCheckbox: React.FC<PCCheckboxProps>;
|
|
630
|
+
|
|
631
|
+
type PCLoaderProps = {
|
|
632
|
+
size?: 'small' | 'large';
|
|
633
|
+
color?: string;
|
|
634
|
+
text?: string;
|
|
635
|
+
};
|
|
636
|
+
declare const PCLoader: React.FC<PCLoaderProps>;
|
|
637
|
+
|
|
638
|
+
type PCEmptyProps = {
|
|
639
|
+
title: string;
|
|
640
|
+
description?: string;
|
|
641
|
+
icon?: React.ReactNode;
|
|
642
|
+
};
|
|
643
|
+
declare const PCEmpty: React.FC<PCEmptyProps>;
|
|
644
|
+
|
|
645
|
+
type PCBadgeStatus = 'success' | 'warning' | 'error' | 'info' | 'pending' | 'secondary';
|
|
646
|
+
type PCBadgeProps = {
|
|
647
|
+
status: PCBadgeStatus;
|
|
648
|
+
label: string;
|
|
649
|
+
};
|
|
650
|
+
declare const PCBadge: React.FC<PCBadgeProps>;
|
|
651
|
+
|
|
652
|
+
export { ActivitiesList, type Activity, type ActivityDetail, type ApiFetchOptions, type ApiResponse, type AuthContext, AuthProvider, type BaseRequest, BaseUrlProvider, BottomTabBar, CaseDetailsPage, type CaseDetailsTab, CaseHistory, type CaseHistoryDetail, type CaseMessage, type CaseRequest, type CaseStatusVariant, type ConsentAction, type ConsentDataElement, type ConsentHistoryStatusSummary, ConsentManager, ConsentStatusEnum, type CreateCaseResponse, type DataElement, type DocumentRequestMetadata, type DocumentRequestStatus, Footer, Form, type FormData$1 as FormData, FormPage, type GrievanceTypeElement, GrievanceTypeEnum, type InternalPage, type ManageConsentParams, type MessageDocument, type MessageType, Navbar, NavigationProvider, type NominatedPurposesGroup, type NominationData, type NominatorInfo, type OrganizationDetail, type OtpResponse, type OtpVerificationResponse, PCBadge, PCButton, PCCheckbox, PCEmpty, PCInput, PCLoader, PCModal, PCSelect, type Pagination, type PendingUpload, type ProductConsentHistoryGroup, type Purpose, RedactoPrivacyCenter, RequestTypeEnum, SideMenu, type TabId, ThemeProvider, type TokenExchangeResponse, type UpdateCorrectionDataItem, type UpdatePurpose, type UploadDocumentResponse, type UserConsent, type UserConsentDetail, type UserDataRequest, type Workspace, compareEmails, createCaseRequest, createConsentClient, createOtpServer as createOtp, decodeJwtToken, ensureValidToken, exchangeTokenServer as exchangeToken, fetchActivities, fetchCaseHistory, fetchProducts, fetchUserConsents, formatActivityType, getActivityTypeStatus, getCaseMessages, getFormData, isJwtExpired, manageConsent, sendCaseMessage, signOutPrivacyCenter, submitDocumentForRequest, uploadCaseDocument, useAuth, useBaseUrl, useCaseHistory, useCaseMessages, useInternalNavigation, useTheme, verifyOtpServer as verifyOtp };
|