@redacto.io/consent-sdk-react-native 5.0.0-beta.2 → 5.0.0-beta.3
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.
|
@@ -636,7 +636,7 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
|
636
636
|
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], noticeUuid?: string, dataElements?: Array<{
|
|
637
637
|
uuid: string;
|
|
638
638
|
selected: boolean;
|
|
639
|
-
}
|
|
639
|
+
}>, language?: string): Promise<unknown>;
|
|
640
640
|
/**
|
|
641
641
|
* Get activities (privacy center)
|
|
642
642
|
*/
|
|
@@ -772,7 +772,7 @@ type FetchUserConsentsParams = {
|
|
|
772
772
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
773
773
|
};
|
|
774
774
|
declare const fetchUserConsents: (params: FetchUserConsentsParams) => Promise<UserConsentDetail | null>;
|
|
775
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, }: {
|
|
775
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, language, }: {
|
|
776
776
|
organizationId: string;
|
|
777
777
|
workspaceId: string;
|
|
778
778
|
purposeId: string;
|
|
@@ -787,6 +787,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
787
787
|
uuid: string;
|
|
788
788
|
selected: boolean;
|
|
789
789
|
}>;
|
|
790
|
+
language?: string;
|
|
790
791
|
}) => Promise<boolean | null>;
|
|
791
792
|
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
792
793
|
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
package/dist/privacy-center.d.ts
CHANGED
|
@@ -636,7 +636,7 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
|
636
636
|
manageConsent(baseRequest: BaseRequest, purposeId: string, contact: string, status: "revoke" | "regrant" | "renew", authToken?: string, options?: Omit<ApiFetchOptions, "getAuthToken">, nominatorContact?: string, dataElementUuids?: string[], noticeUuid?: string, dataElements?: Array<{
|
|
637
637
|
uuid: string;
|
|
638
638
|
selected: boolean;
|
|
639
|
-
}
|
|
639
|
+
}>, language?: string): Promise<unknown>;
|
|
640
640
|
/**
|
|
641
641
|
* Get activities (privacy center)
|
|
642
642
|
*/
|
|
@@ -772,7 +772,7 @@ type FetchUserConsentsParams = {
|
|
|
772
772
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
773
773
|
};
|
|
774
774
|
declare const fetchUserConsents: (params: FetchUserConsentsParams) => Promise<UserConsentDetail | null>;
|
|
775
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, }: {
|
|
775
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, noticeUuid, dataElements, language, }: {
|
|
776
776
|
organizationId: string;
|
|
777
777
|
workspaceId: string;
|
|
778
778
|
purposeId: string;
|
|
@@ -787,6 +787,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
787
787
|
uuid: string;
|
|
788
788
|
selected: boolean;
|
|
789
789
|
}>;
|
|
790
|
+
language?: string;
|
|
790
791
|
}) => Promise<boolean | null>;
|
|
791
792
|
declare const fetchActivities: (organizationId: string, workspaceId: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<ActivityDetail | null>;
|
|
792
793
|
declare const fetchCaseHistory: (organizationId: string, workspaceId: string, contact: string, offset?: number, limit?: number, authContext?: AuthContext, consentClient?: BaseUrlContextValue["consentClient"], language?: string) => Promise<CaseHistoryDetail | null>;
|
package/dist/privacy-center.js
CHANGED
|
@@ -10235,7 +10235,7 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10235
10235
|
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
10236
10236
|
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
10237
10237
|
*/
|
|
10238
|
-
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, noticeUuid, dataElements) {
|
|
10238
|
+
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, noticeUuid, dataElements, language) {
|
|
10239
10239
|
if (!useLedger) {
|
|
10240
10240
|
const url2 = `${baseUrl}/organisations/${baseRequest.organisationUuid}/workspaces/${baseRequest.workspaceUuid}/dsar/privacy-center/manage-consent?status=${status}`;
|
|
10241
10241
|
const body2 = { purpose_uuid: purposeId, contact };
|
|
@@ -10245,6 +10245,9 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10245
10245
|
if (Array.isArray(dataElementUuids) && dataElementUuids.length > 0) {
|
|
10246
10246
|
body2.data_element_uuids = dataElementUuids;
|
|
10247
10247
|
}
|
|
10248
|
+
if (language) {
|
|
10249
|
+
body2.language = language;
|
|
10250
|
+
}
|
|
10248
10251
|
return privacyCenterApiFetch(url2, {
|
|
10249
10252
|
...options,
|
|
10250
10253
|
method: "POST",
|
|
@@ -10279,7 +10282,8 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10279
10282
|
selected: purposeSelected,
|
|
10280
10283
|
data_elements: elements
|
|
10281
10284
|
}
|
|
10282
|
-
]
|
|
10285
|
+
],
|
|
10286
|
+
...language ? { language } : {}
|
|
10283
10287
|
};
|
|
10284
10288
|
const url = ledgerUrl(baseRequest, "/submit-consent");
|
|
10285
10289
|
return privacyCenterApiFetch(url, {
|
|
@@ -10719,7 +10723,8 @@ async function manageConsentServer(params) {
|
|
|
10719
10723
|
params.nominatorContact,
|
|
10720
10724
|
params.dataElementUuids,
|
|
10721
10725
|
params.noticeUuid,
|
|
10722
|
-
params.dataElements
|
|
10726
|
+
params.dataElements,
|
|
10727
|
+
params.language
|
|
10723
10728
|
);
|
|
10724
10729
|
if (result && typeof result === "object" && "success" in result) {
|
|
10725
10730
|
return Boolean(result.success);
|
|
@@ -11210,7 +11215,8 @@ var manageConsent = async ({
|
|
|
11210
11215
|
nominatorContact,
|
|
11211
11216
|
dataElementUuids,
|
|
11212
11217
|
noticeUuid,
|
|
11213
|
-
dataElements
|
|
11218
|
+
dataElements,
|
|
11219
|
+
language
|
|
11214
11220
|
}) => {
|
|
11215
11221
|
try {
|
|
11216
11222
|
const accessToken = await ensureValidToken(organizationId, workspaceId, void 0, authContext, consentClient);
|
|
@@ -11228,7 +11234,8 @@ var manageConsent = async ({
|
|
|
11228
11234
|
nominatorContact,
|
|
11229
11235
|
dataElementUuids,
|
|
11230
11236
|
noticeUuid,
|
|
11231
|
-
dataElements
|
|
11237
|
+
dataElements,
|
|
11238
|
+
language
|
|
11232
11239
|
});
|
|
11233
11240
|
return result;
|
|
11234
11241
|
} catch (error) {
|
|
@@ -15094,7 +15101,8 @@ function ConsentManager() {
|
|
|
15094
15101
|
dataElements: (_b = selectedRecord == null ? void 0 : selectedRecord.data_elements) == null ? void 0 : _b.map((de) => ({
|
|
15095
15102
|
uuid: de.uuid,
|
|
15096
15103
|
selected: de.selected
|
|
15097
|
-
}))
|
|
15104
|
+
})),
|
|
15105
|
+
language: langParam
|
|
15098
15106
|
});
|
|
15099
15107
|
setIsModalOpen(false);
|
|
15100
15108
|
setSelectedRecord(null);
|
|
@@ -15106,7 +15114,7 @@ function ConsentManager() {
|
|
|
15106
15114
|
setIsManageLoading(false);
|
|
15107
15115
|
}
|
|
15108
15116
|
},
|
|
15109
|
-
[organizationId, workspaceId, email, authContext, consentClient, selectedRecord, fetchData, t]
|
|
15117
|
+
[organizationId, workspaceId, email, authContext, consentClient, selectedRecord, langParam, fetchData, t]
|
|
15110
15118
|
);
|
|
15111
15119
|
const handleExport = (0, import_react25.useCallback)(async () => {
|
|
15112
15120
|
if (!consentData.length) return;
|
|
@@ -15469,6 +15477,7 @@ function ActivitiesList() {
|
|
|
15469
15477
|
() => ({ accessToken, refreshToken, onError, updateTokens }),
|
|
15470
15478
|
[accessToken, refreshToken, onError, updateTokens]
|
|
15471
15479
|
);
|
|
15480
|
+
const { langParam } = useCurrentLanguage();
|
|
15472
15481
|
const [activities, setActivities] = (0, import_react26.useState)([]);
|
|
15473
15482
|
const [totalCount, setTotalCount] = (0, import_react26.useState)(0);
|
|
15474
15483
|
const [isLoading, setIsLoading] = (0, import_react26.useState)(true);
|
|
@@ -15480,7 +15489,7 @@ function ActivitiesList() {
|
|
|
15480
15489
|
var _a3, _b, _c;
|
|
15481
15490
|
if (!organizationId || !workspaceId) return;
|
|
15482
15491
|
try {
|
|
15483
|
-
const response = await fetchActivities(organizationId, workspaceId, nextOffset, PAGE_SIZE, authContext, consentClient);
|
|
15492
|
+
const response = await fetchActivities(organizationId, workspaceId, nextOffset, PAGE_SIZE, authContext, consentClient, langParam);
|
|
15484
15493
|
if (!response) return;
|
|
15485
15494
|
const rows = (_a3 = response.data) != null ? _a3 : [];
|
|
15486
15495
|
setActivities((prev) => append ? [...prev, ...rows] : rows);
|
|
@@ -15491,7 +15500,7 @@ function ActivitiesList() {
|
|
|
15491
15500
|
if (!append) setActivities([]);
|
|
15492
15501
|
}
|
|
15493
15502
|
},
|
|
15494
|
-
[organizationId, workspaceId, authContext, consentClient]
|
|
15503
|
+
[organizationId, workspaceId, authContext, consentClient, langParam]
|
|
15495
15504
|
);
|
|
15496
15505
|
(0, import_react26.useEffect)(() => {
|
|
15497
15506
|
setIsLoading(true);
|
package/dist/privacy-center.mjs
CHANGED
|
@@ -10122,7 +10122,7 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10122
10122
|
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
10123
10123
|
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
10124
10124
|
*/
|
|
10125
|
-
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, noticeUuid, dataElements) {
|
|
10125
|
+
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, noticeUuid, dataElements, language) {
|
|
10126
10126
|
if (!useLedger) {
|
|
10127
10127
|
const url2 = `${baseUrl}/organisations/${baseRequest.organisationUuid}/workspaces/${baseRequest.workspaceUuid}/dsar/privacy-center/manage-consent?status=${status}`;
|
|
10128
10128
|
const body2 = { purpose_uuid: purposeId, contact };
|
|
@@ -10132,6 +10132,9 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10132
10132
|
if (Array.isArray(dataElementUuids) && dataElementUuids.length > 0) {
|
|
10133
10133
|
body2.data_element_uuids = dataElementUuids;
|
|
10134
10134
|
}
|
|
10135
|
+
if (language) {
|
|
10136
|
+
body2.language = language;
|
|
10137
|
+
}
|
|
10135
10138
|
return privacyCenterApiFetch(url2, {
|
|
10136
10139
|
...options,
|
|
10137
10140
|
method: "POST",
|
|
@@ -10166,7 +10169,8 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10166
10169
|
selected: purposeSelected,
|
|
10167
10170
|
data_elements: elements
|
|
10168
10171
|
}
|
|
10169
|
-
]
|
|
10172
|
+
],
|
|
10173
|
+
...language ? { language } : {}
|
|
10170
10174
|
};
|
|
10171
10175
|
const url = ledgerUrl(baseRequest, "/submit-consent");
|
|
10172
10176
|
return privacyCenterApiFetch(url, {
|
|
@@ -10606,7 +10610,8 @@ async function manageConsentServer(params) {
|
|
|
10606
10610
|
params.nominatorContact,
|
|
10607
10611
|
params.dataElementUuids,
|
|
10608
10612
|
params.noticeUuid,
|
|
10609
|
-
params.dataElements
|
|
10613
|
+
params.dataElements,
|
|
10614
|
+
params.language
|
|
10610
10615
|
);
|
|
10611
10616
|
if (result && typeof result === "object" && "success" in result) {
|
|
10612
10617
|
return Boolean(result.success);
|
|
@@ -11097,7 +11102,8 @@ var manageConsent = async ({
|
|
|
11097
11102
|
nominatorContact,
|
|
11098
11103
|
dataElementUuids,
|
|
11099
11104
|
noticeUuid,
|
|
11100
|
-
dataElements
|
|
11105
|
+
dataElements,
|
|
11106
|
+
language
|
|
11101
11107
|
}) => {
|
|
11102
11108
|
try {
|
|
11103
11109
|
const accessToken = await ensureValidToken(organizationId, workspaceId, void 0, authContext, consentClient);
|
|
@@ -11115,7 +11121,8 @@ var manageConsent = async ({
|
|
|
11115
11121
|
nominatorContact,
|
|
11116
11122
|
dataElementUuids,
|
|
11117
11123
|
noticeUuid,
|
|
11118
|
-
dataElements
|
|
11124
|
+
dataElements,
|
|
11125
|
+
language
|
|
11119
11126
|
});
|
|
11120
11127
|
return result;
|
|
11121
11128
|
} catch (error) {
|
|
@@ -15081,7 +15088,8 @@ function ConsentManager() {
|
|
|
15081
15088
|
dataElements: (_b = selectedRecord == null ? void 0 : selectedRecord.data_elements) == null ? void 0 : _b.map((de) => ({
|
|
15082
15089
|
uuid: de.uuid,
|
|
15083
15090
|
selected: de.selected
|
|
15084
|
-
}))
|
|
15091
|
+
})),
|
|
15092
|
+
language: langParam
|
|
15085
15093
|
});
|
|
15086
15094
|
setIsModalOpen(false);
|
|
15087
15095
|
setSelectedRecord(null);
|
|
@@ -15093,7 +15101,7 @@ function ConsentManager() {
|
|
|
15093
15101
|
setIsManageLoading(false);
|
|
15094
15102
|
}
|
|
15095
15103
|
},
|
|
15096
|
-
[organizationId, workspaceId, email, authContext, consentClient, selectedRecord, fetchData, t]
|
|
15104
|
+
[organizationId, workspaceId, email, authContext, consentClient, selectedRecord, langParam, fetchData, t]
|
|
15097
15105
|
);
|
|
15098
15106
|
const handleExport = useCallback6(async () => {
|
|
15099
15107
|
if (!consentData.length) return;
|
|
@@ -15456,6 +15464,7 @@ function ActivitiesList() {
|
|
|
15456
15464
|
() => ({ accessToken, refreshToken, onError, updateTokens }),
|
|
15457
15465
|
[accessToken, refreshToken, onError, updateTokens]
|
|
15458
15466
|
);
|
|
15467
|
+
const { langParam } = useCurrentLanguage();
|
|
15459
15468
|
const [activities, setActivities] = useState14([]);
|
|
15460
15469
|
const [totalCount, setTotalCount] = useState14(0);
|
|
15461
15470
|
const [isLoading, setIsLoading] = useState14(true);
|
|
@@ -15467,7 +15476,7 @@ function ActivitiesList() {
|
|
|
15467
15476
|
var _a3, _b, _c;
|
|
15468
15477
|
if (!organizationId || !workspaceId) return;
|
|
15469
15478
|
try {
|
|
15470
|
-
const response = await fetchActivities(organizationId, workspaceId, nextOffset, PAGE_SIZE, authContext, consentClient);
|
|
15479
|
+
const response = await fetchActivities(organizationId, workspaceId, nextOffset, PAGE_SIZE, authContext, consentClient, langParam);
|
|
15471
15480
|
if (!response) return;
|
|
15472
15481
|
const rows = (_a3 = response.data) != null ? _a3 : [];
|
|
15473
15482
|
setActivities((prev) => append ? [...prev, ...rows] : rows);
|
|
@@ -15478,7 +15487,7 @@ function ActivitiesList() {
|
|
|
15478
15487
|
if (!append) setActivities([]);
|
|
15479
15488
|
}
|
|
15480
15489
|
},
|
|
15481
|
-
[organizationId, workspaceId, authContext, consentClient]
|
|
15490
|
+
[organizationId, workspaceId, authContext, consentClient, langParam]
|
|
15482
15491
|
);
|
|
15483
15492
|
useEffect12(() => {
|
|
15484
15493
|
setIsLoading(true);
|
package/package.json
CHANGED