@redacto.io/consent-sdk-react 10.0.0 → 10.1.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.
- package/dist/{chunk-FEGTW73Q.mjs → chunk-FT5G2PXK.mjs} +11 -0
- package/dist/fonts.d.mts +2 -2
- package/dist/fonts.d.ts +2 -2
- package/dist/fonts.mjs +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1454 -1107
- package/dist/index.mjs +1227 -885
- package/dist/privacy-center.js +31 -15
- package/dist/privacy-center.mjs +31 -15
- package/dist/{types-6Aj7faxL.d.mts → types-xaCyZUfo.d.mts} +0 -4
- package/dist/{types-6Aj7faxL.d.ts → types-xaCyZUfo.d.ts} +0 -4
- package/package.json +1 -1
package/dist/privacy-center.js
CHANGED
|
@@ -10450,6 +10450,7 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10450
10450
|
if (params.created_after) queryParams.append("created_after", params.created_after);
|
|
10451
10451
|
if (params.created_before) queryParams.append("created_before", params.created_before);
|
|
10452
10452
|
if (params.language) queryParams.append("language", params.language);
|
|
10453
|
+
appendSandboxIdentity(queryParams);
|
|
10453
10454
|
const queryString = queryParams.toString();
|
|
10454
10455
|
const receiptsSuffix = `/receipts${queryString ? `?${queryString}` : ""}`;
|
|
10455
10456
|
const url = useLedger() ? ledgerUrl(baseRequest, receiptsSuffix) : privacyCenterUrl(baseRequest, receiptsSuffix);
|
|
@@ -10554,7 +10555,11 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10554
10555
|
* Submit a document against a handler document request (privacy center)
|
|
10555
10556
|
*/
|
|
10556
10557
|
async submitDocumentForRequest(baseRequest, caseUuid, requestEventUuid, documentUuid, body, authToken) {
|
|
10557
|
-
const url = caseUrl(
|
|
10558
|
+
const url = caseUrl(
|
|
10559
|
+
baseRequest,
|
|
10560
|
+
caseUuid,
|
|
10561
|
+
`/document-requests/${requestEventUuid}/submit${sandboxIdentitySuffix()}`
|
|
10562
|
+
);
|
|
10558
10563
|
return privacyCenterApiFetch(url, {
|
|
10559
10564
|
method: "POST",
|
|
10560
10565
|
body: JSON.stringify({ document_uuid: documentUuid, body }),
|
|
@@ -10565,7 +10570,7 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10565
10570
|
* Get document info/download URL for a case document (privacy center)
|
|
10566
10571
|
*/
|
|
10567
10572
|
async getCaseDocument(baseRequest, caseUuid, documentUuid, authToken) {
|
|
10568
|
-
const url = caseUrl(baseRequest, caseUuid, `/documents/${documentUuid}`);
|
|
10573
|
+
const url = caseUrl(baseRequest, caseUuid, `/documents/${documentUuid}${sandboxIdentitySuffix()}`);
|
|
10569
10574
|
return privacyCenterApiFetch(url, {
|
|
10570
10575
|
authToken: resolveAuthToken(authToken, baseRequest)
|
|
10571
10576
|
});
|
|
@@ -18953,27 +18958,38 @@ var uploadFileWithS2S = async ({
|
|
|
18953
18958
|
authToken,
|
|
18954
18959
|
baseUrl
|
|
18955
18960
|
}) => {
|
|
18961
|
+
var _a;
|
|
18956
18962
|
try {
|
|
18957
|
-
if (!authToken) {
|
|
18958
|
-
throw new Error("Auth token is required for document upload");
|
|
18959
|
-
}
|
|
18960
18963
|
if (!baseUrl) {
|
|
18961
18964
|
throw new Error("Base URL is required for document upload");
|
|
18962
18965
|
}
|
|
18963
|
-
const
|
|
18964
|
-
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18966
|
+
const sandbox = getSandboxConfig();
|
|
18967
|
+
let organisation_uuid;
|
|
18968
|
+
let workspace_uuid;
|
|
18969
|
+
let authHeaders;
|
|
18970
|
+
if (sandbox) {
|
|
18971
|
+
organisation_uuid = sandbox.organisationUuid;
|
|
18972
|
+
workspace_uuid = sandbox.workspaceUuid;
|
|
18973
|
+
authHeaders = (_a = sandboxAuthHeaders()) != null ? _a : {};
|
|
18974
|
+
} else {
|
|
18975
|
+
if (!authToken) {
|
|
18976
|
+
throw new Error("Auth token is required for document upload");
|
|
18977
|
+
}
|
|
18978
|
+
const decodedToken = decodeJwtToken(authToken);
|
|
18979
|
+
if (!decodedToken) {
|
|
18980
|
+
throw new Error("Invalid access token");
|
|
18981
|
+
}
|
|
18982
|
+
if (!decodedToken.organisation_uuid || !decodedToken.workspace_uuid) {
|
|
18983
|
+
throw new Error("Invalid token: missing organization or workspace UUID");
|
|
18984
|
+
}
|
|
18985
|
+
organisation_uuid = decodedToken.organisation_uuid;
|
|
18986
|
+
workspace_uuid = decodedToken.workspace_uuid;
|
|
18987
|
+
authHeaders = { Authorization: `Bearer ${authToken}` };
|
|
18970
18988
|
}
|
|
18971
18989
|
const url = `${baseUrl}/organisations/${organisation_uuid}/workspaces/${workspace_uuid}/dsar/privacy-center/upload-document`;
|
|
18972
18990
|
const response = await fetch(url, {
|
|
18973
18991
|
method: "POST",
|
|
18974
|
-
headers:
|
|
18975
|
-
"Authorization": `Bearer ${authToken}`
|
|
18976
|
-
},
|
|
18992
|
+
headers: authHeaders,
|
|
18977
18993
|
body: formData
|
|
18978
18994
|
});
|
|
18979
18995
|
if (!response.ok) {
|
package/dist/privacy-center.mjs
CHANGED
|
@@ -10382,6 +10382,7 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10382
10382
|
if (params.created_after) queryParams.append("created_after", params.created_after);
|
|
10383
10383
|
if (params.created_before) queryParams.append("created_before", params.created_before);
|
|
10384
10384
|
if (params.language) queryParams.append("language", params.language);
|
|
10385
|
+
appendSandboxIdentity(queryParams);
|
|
10385
10386
|
const queryString = queryParams.toString();
|
|
10386
10387
|
const receiptsSuffix = `/receipts${queryString ? `?${queryString}` : ""}`;
|
|
10387
10388
|
const url = useLedger() ? ledgerUrl(baseRequest, receiptsSuffix) : privacyCenterUrl(baseRequest, receiptsSuffix);
|
|
@@ -10486,7 +10487,11 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10486
10487
|
* Submit a document against a handler document request (privacy center)
|
|
10487
10488
|
*/
|
|
10488
10489
|
async submitDocumentForRequest(baseRequest, caseUuid, requestEventUuid, documentUuid, body, authToken) {
|
|
10489
|
-
const url = caseUrl(
|
|
10490
|
+
const url = caseUrl(
|
|
10491
|
+
baseRequest,
|
|
10492
|
+
caseUuid,
|
|
10493
|
+
`/document-requests/${requestEventUuid}/submit${sandboxIdentitySuffix()}`
|
|
10494
|
+
);
|
|
10490
10495
|
return privacyCenterApiFetch(url, {
|
|
10491
10496
|
method: "POST",
|
|
10492
10497
|
body: JSON.stringify({ document_uuid: documentUuid, body }),
|
|
@@ -10497,7 +10502,7 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10497
10502
|
* Get document info/download URL for a case document (privacy center)
|
|
10498
10503
|
*/
|
|
10499
10504
|
async getCaseDocument(baseRequest, caseUuid, documentUuid, authToken) {
|
|
10500
|
-
const url = caseUrl(baseRequest, caseUuid, `/documents/${documentUuid}`);
|
|
10505
|
+
const url = caseUrl(baseRequest, caseUuid, `/documents/${documentUuid}${sandboxIdentitySuffix()}`);
|
|
10501
10506
|
return privacyCenterApiFetch(url, {
|
|
10502
10507
|
authToken: resolveAuthToken(authToken, baseRequest)
|
|
10503
10508
|
});
|
|
@@ -18905,27 +18910,38 @@ var uploadFileWithS2S = async ({
|
|
|
18905
18910
|
authToken,
|
|
18906
18911
|
baseUrl
|
|
18907
18912
|
}) => {
|
|
18913
|
+
var _a;
|
|
18908
18914
|
try {
|
|
18909
|
-
if (!authToken) {
|
|
18910
|
-
throw new Error("Auth token is required for document upload");
|
|
18911
|
-
}
|
|
18912
18915
|
if (!baseUrl) {
|
|
18913
18916
|
throw new Error("Base URL is required for document upload");
|
|
18914
18917
|
}
|
|
18915
|
-
const
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
18918
|
+
const sandbox = getSandboxConfig();
|
|
18919
|
+
let organisation_uuid;
|
|
18920
|
+
let workspace_uuid;
|
|
18921
|
+
let authHeaders;
|
|
18922
|
+
if (sandbox) {
|
|
18923
|
+
organisation_uuid = sandbox.organisationUuid;
|
|
18924
|
+
workspace_uuid = sandbox.workspaceUuid;
|
|
18925
|
+
authHeaders = (_a = sandboxAuthHeaders()) != null ? _a : {};
|
|
18926
|
+
} else {
|
|
18927
|
+
if (!authToken) {
|
|
18928
|
+
throw new Error("Auth token is required for document upload");
|
|
18929
|
+
}
|
|
18930
|
+
const decodedToken = decodeJwtToken(authToken);
|
|
18931
|
+
if (!decodedToken) {
|
|
18932
|
+
throw new Error("Invalid access token");
|
|
18933
|
+
}
|
|
18934
|
+
if (!decodedToken.organisation_uuid || !decodedToken.workspace_uuid) {
|
|
18935
|
+
throw new Error("Invalid token: missing organization or workspace UUID");
|
|
18936
|
+
}
|
|
18937
|
+
organisation_uuid = decodedToken.organisation_uuid;
|
|
18938
|
+
workspace_uuid = decodedToken.workspace_uuid;
|
|
18939
|
+
authHeaders = { Authorization: `Bearer ${authToken}` };
|
|
18922
18940
|
}
|
|
18923
18941
|
const url = `${baseUrl}/organisations/${organisation_uuid}/workspaces/${workspace_uuid}/dsar/privacy-center/upload-document`;
|
|
18924
18942
|
const response = await fetch(url, {
|
|
18925
18943
|
method: "POST",
|
|
18926
|
-
headers:
|
|
18927
|
-
"Authorization": `Bearer ${authToken}`
|
|
18928
|
-
},
|
|
18944
|
+
headers: authHeaders,
|
|
18929
18945
|
body: formData
|
|
18930
18946
|
});
|
|
18931
18947
|
if (!response.ok) {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types shared by the three notice components (RedactoNoticeConsent,
|
|
3
|
-
* RedactoNoticeConsentInline, RedactoNoticeAssisted).
|
|
4
|
-
*/
|
|
5
1
|
/** Output format published for each webfont weight. */
|
|
6
2
|
type NoticeFontFormat = "woff2" | "ttf";
|
|
7
3
|
/** Generic CSS family a font falls back to; native platforms map it to their own default. */
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types shared by the three notice components (RedactoNoticeConsent,
|
|
3
|
-
* RedactoNoticeConsentInline, RedactoNoticeAssisted).
|
|
4
|
-
*/
|
|
5
1
|
/** Output format published for each webfont weight. */
|
|
6
2
|
type NoticeFontFormat = "woff2" | "ttf";
|
|
7
3
|
/** Generic CSS family a font falls back to; native platforms map it to their own default. */
|