@redacto.io/consent-sdk-react 10.2.0 → 10.2.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 +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +328 -203
- package/dist/index.mjs +328 -203
- package/dist/privacy-center.d.mts +10 -2
- package/dist/privacy-center.d.ts +10 -2
- package/dist/privacy-center.js +20 -6
- package/dist/privacy-center.mjs +20 -6
- package/package.json +1 -1
|
@@ -117,13 +117,20 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
|
117
117
|
* `product_uuid` pins it to one card -- unscoped, the ledger fans the
|
|
118
118
|
* answer out over every product the notice covers.
|
|
119
119
|
*
|
|
120
|
+
* A nominee acting on a nominator's consent sends `nominator_uuid`: the
|
|
121
|
+
* ledger re-checks the nomination edge and records the consent against the
|
|
122
|
+
* nominator. Without it the principal resolves to the caller, so a
|
|
123
|
+
* nominee's revoke opened a declined consent of their own and left the
|
|
124
|
+
* nominator's granted. The legacy Python endpoint expresses the same thing
|
|
125
|
+
* as `nominator_contact`.
|
|
126
|
+
*
|
|
120
127
|
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
121
128
|
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
122
129
|
*/
|
|
123
130
|
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<{
|
|
124
131
|
uuid: string;
|
|
125
132
|
selected: boolean;
|
|
126
|
-
}>, language?: string): Promise<unknown>;
|
|
133
|
+
}>, language?: string, nominatorUuid?: string): Promise<unknown>;
|
|
127
134
|
/**
|
|
128
135
|
* Get activities (privacy center)
|
|
129
136
|
*/
|
|
@@ -914,7 +921,7 @@ type FetchGroupPurposesParams = {
|
|
|
914
921
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
915
922
|
};
|
|
916
923
|
declare const fetchGroupPurposes: (params: FetchGroupPurposesParams) => Promise<GroupPurposesOut | null>;
|
|
917
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, language, }: {
|
|
924
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, nominatorUuid, dataElementUuids, productUuid, noticeUuid, dataElements, language, }: {
|
|
918
925
|
organizationId: string;
|
|
919
926
|
workspaceId: string;
|
|
920
927
|
purposeId: string;
|
|
@@ -923,6 +930,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
923
930
|
authContext?: AuthContext;
|
|
924
931
|
consentClient?: BaseUrlContextValue["consentClient"];
|
|
925
932
|
nominatorContact?: string;
|
|
933
|
+
nominatorUuid?: string;
|
|
926
934
|
dataElementUuids?: string[];
|
|
927
935
|
productUuid?: string;
|
|
928
936
|
noticeUuid?: string;
|
package/dist/privacy-center.d.ts
CHANGED
|
@@ -117,13 +117,20 @@ declare function createConsentClient(baseUrl: string, ledgerBaseUrl?: string): {
|
|
|
117
117
|
* `product_uuid` pins it to one card -- unscoped, the ledger fans the
|
|
118
118
|
* answer out over every product the notice covers.
|
|
119
119
|
*
|
|
120
|
+
* A nominee acting on a nominator's consent sends `nominator_uuid`: the
|
|
121
|
+
* ledger re-checks the nomination edge and records the consent against the
|
|
122
|
+
* nominator. Without it the principal resolves to the caller, so a
|
|
123
|
+
* nominee's revoke opened a declined consent of their own and left the
|
|
124
|
+
* nominator's granted. The legacy Python endpoint expresses the same thing
|
|
125
|
+
* as `nominator_contact`.
|
|
126
|
+
*
|
|
120
127
|
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
121
128
|
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
122
129
|
*/
|
|
123
130
|
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<{
|
|
124
131
|
uuid: string;
|
|
125
132
|
selected: boolean;
|
|
126
|
-
}>, language?: string): Promise<unknown>;
|
|
133
|
+
}>, language?: string, nominatorUuid?: string): Promise<unknown>;
|
|
127
134
|
/**
|
|
128
135
|
* Get activities (privacy center)
|
|
129
136
|
*/
|
|
@@ -914,7 +921,7 @@ type FetchGroupPurposesParams = {
|
|
|
914
921
|
consentClient?: BaseUrlContextValue['consentClient'];
|
|
915
922
|
};
|
|
916
923
|
declare const fetchGroupPurposes: (params: FetchGroupPurposesParams) => Promise<GroupPurposesOut | null>;
|
|
917
|
-
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, language, }: {
|
|
924
|
+
declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact, action, authContext, consentClient, nominatorContact, nominatorUuid, dataElementUuids, productUuid, noticeUuid, dataElements, language, }: {
|
|
918
925
|
organizationId: string;
|
|
919
926
|
workspaceId: string;
|
|
920
927
|
purposeId: string;
|
|
@@ -923,6 +930,7 @@ declare const manageConsent: ({ organizationId, workspaceId, purposeId, contact,
|
|
|
923
930
|
authContext?: AuthContext;
|
|
924
931
|
consentClient?: BaseUrlContextValue["consentClient"];
|
|
925
932
|
nominatorContact?: string;
|
|
933
|
+
nominatorUuid?: string;
|
|
926
934
|
dataElementUuids?: string[];
|
|
927
935
|
productUuid?: string;
|
|
928
936
|
noticeUuid?: string;
|
package/dist/privacy-center.js
CHANGED
|
@@ -8504,7 +8504,8 @@ async function manageConsentServer(params) {
|
|
|
8504
8504
|
params.productUuid,
|
|
8505
8505
|
params.noticeUuid,
|
|
8506
8506
|
params.dataElements,
|
|
8507
|
-
params.language
|
|
8507
|
+
params.language,
|
|
8508
|
+
params.nominatorUuid
|
|
8508
8509
|
);
|
|
8509
8510
|
if (result && typeof result === "object" && "success" in result) {
|
|
8510
8511
|
return Boolean(result.success);
|
|
@@ -9617,6 +9618,7 @@ var manageConsent = async ({
|
|
|
9617
9618
|
authContext,
|
|
9618
9619
|
consentClient,
|
|
9619
9620
|
nominatorContact,
|
|
9621
|
+
nominatorUuid,
|
|
9620
9622
|
dataElementUuids,
|
|
9621
9623
|
productUuid,
|
|
9622
9624
|
noticeUuid,
|
|
@@ -9637,6 +9639,7 @@ var manageConsent = async ({
|
|
|
9637
9639
|
authToken: accessToken,
|
|
9638
9640
|
consentClient,
|
|
9639
9641
|
nominatorContact,
|
|
9642
|
+
nominatorUuid,
|
|
9640
9643
|
dataElementUuids,
|
|
9641
9644
|
productUuid,
|
|
9642
9645
|
noticeUuid,
|
|
@@ -9660,6 +9663,7 @@ var manageConsent = async ({
|
|
|
9660
9663
|
authToken: newAccessToken || void 0,
|
|
9661
9664
|
consentClient,
|
|
9662
9665
|
nominatorContact,
|
|
9666
|
+
nominatorUuid,
|
|
9663
9667
|
dataElementUuids,
|
|
9664
9668
|
productUuid,
|
|
9665
9669
|
noticeUuid,
|
|
@@ -10435,10 +10439,17 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10435
10439
|
* `product_uuid` pins it to one card -- unscoped, the ledger fans the
|
|
10436
10440
|
* answer out over every product the notice covers.
|
|
10437
10441
|
*
|
|
10442
|
+
* A nominee acting on a nominator's consent sends `nominator_uuid`: the
|
|
10443
|
+
* ledger re-checks the nomination edge and records the consent against the
|
|
10444
|
+
* nominator. Without it the principal resolves to the caller, so a
|
|
10445
|
+
* nominee's revoke opened a declined consent of their own and left the
|
|
10446
|
+
* nominator's granted. The legacy Python endpoint expresses the same thing
|
|
10447
|
+
* as `nominator_contact`.
|
|
10448
|
+
*
|
|
10438
10449
|
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
10439
10450
|
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
10440
10451
|
*/
|
|
10441
|
-
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, language) {
|
|
10452
|
+
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, language, nominatorUuid) {
|
|
10442
10453
|
var _a;
|
|
10443
10454
|
if (!useLedger()) {
|
|
10444
10455
|
const url2 = privacyCenterUrl(
|
|
@@ -10508,7 +10519,8 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10508
10519
|
data_elements: elements
|
|
10509
10520
|
}
|
|
10510
10521
|
],
|
|
10511
|
-
...language ? { language } : {}
|
|
10522
|
+
...language ? { language } : {},
|
|
10523
|
+
...nominatorUuid ? { nominator_uuid: nominatorUuid } : {}
|
|
10512
10524
|
};
|
|
10513
10525
|
const url = ledgerUrl(baseRequest, "/submit-consent");
|
|
10514
10526
|
const serialisedBody = JSON.stringify(body);
|
|
@@ -17028,7 +17040,7 @@ var ModifyConsentModal = ({
|
|
|
17028
17040
|
disabled: !selectedRecord.purpose_uuid || isRegrantAction && selectedDataElementUuids.length === 0,
|
|
17029
17041
|
variant: actionConfig.buttonVariant,
|
|
17030
17042
|
onClick: () => {
|
|
17031
|
-
var _a, _b;
|
|
17043
|
+
var _a, _b, _c;
|
|
17032
17044
|
if (selectedRecord.purpose_uuid) {
|
|
17033
17045
|
const nomContact = ((_a = selectedRecord.nominator) == null ? void 0 : _a.email) || ((_b = selectedRecord.nominator) == null ? void 0 : _b.org_user_id) || void 0;
|
|
17034
17046
|
onManageConsent(
|
|
@@ -17036,7 +17048,8 @@ var ModifyConsentModal = ({
|
|
|
17036
17048
|
actionConfig.action,
|
|
17037
17049
|
nomContact,
|
|
17038
17050
|
isRegrantAction ? selectedDataElementUuids : void 0,
|
|
17039
|
-
selectedRecord.product_uuid
|
|
17051
|
+
selectedRecord.product_uuid,
|
|
17052
|
+
(_c = selectedRecord.nominator) == null ? void 0 : _c.uuid
|
|
17040
17053
|
);
|
|
17041
17054
|
}
|
|
17042
17055
|
},
|
|
@@ -18645,7 +18658,7 @@ function ConsentManager({ variant }) {
|
|
|
18645
18658
|
]
|
|
18646
18659
|
);
|
|
18647
18660
|
const handleManageConsent = (0, import_react40.useCallback)(
|
|
18648
|
-
async (purposeId, action, nominatorContact, dataElementUuids, productUuid) => {
|
|
18661
|
+
async (purposeId, action, nominatorContact, dataElementUuids, productUuid, nominatorUuid) => {
|
|
18649
18662
|
var _a2, _b2;
|
|
18650
18663
|
if (!organizationId || !workspaceId || !contact) {
|
|
18651
18664
|
toast.error(t("missingInfoToManage"));
|
|
@@ -18677,6 +18690,7 @@ function ConsentManager({ variant }) {
|
|
|
18677
18690
|
authContext,
|
|
18678
18691
|
consentClient,
|
|
18679
18692
|
nominatorContact,
|
|
18693
|
+
nominatorUuid,
|
|
18680
18694
|
dataElementUuids,
|
|
18681
18695
|
productUuid,
|
|
18682
18696
|
noticeUuid,
|
package/dist/privacy-center.mjs
CHANGED
|
@@ -8437,7 +8437,8 @@ async function manageConsentServer(params) {
|
|
|
8437
8437
|
params.productUuid,
|
|
8438
8438
|
params.noticeUuid,
|
|
8439
8439
|
params.dataElements,
|
|
8440
|
-
params.language
|
|
8440
|
+
params.language,
|
|
8441
|
+
params.nominatorUuid
|
|
8441
8442
|
);
|
|
8442
8443
|
if (result && typeof result === "object" && "success" in result) {
|
|
8443
8444
|
return Boolean(result.success);
|
|
@@ -9550,6 +9551,7 @@ var manageConsent = async ({
|
|
|
9550
9551
|
authContext,
|
|
9551
9552
|
consentClient,
|
|
9552
9553
|
nominatorContact,
|
|
9554
|
+
nominatorUuid,
|
|
9553
9555
|
dataElementUuids,
|
|
9554
9556
|
productUuid,
|
|
9555
9557
|
noticeUuid,
|
|
@@ -9570,6 +9572,7 @@ var manageConsent = async ({
|
|
|
9570
9572
|
authToken: accessToken,
|
|
9571
9573
|
consentClient,
|
|
9572
9574
|
nominatorContact,
|
|
9575
|
+
nominatorUuid,
|
|
9573
9576
|
dataElementUuids,
|
|
9574
9577
|
productUuid,
|
|
9575
9578
|
noticeUuid,
|
|
@@ -9593,6 +9596,7 @@ var manageConsent = async ({
|
|
|
9593
9596
|
authToken: newAccessToken || void 0,
|
|
9594
9597
|
consentClient,
|
|
9595
9598
|
nominatorContact,
|
|
9599
|
+
nominatorUuid,
|
|
9596
9600
|
dataElementUuids,
|
|
9597
9601
|
productUuid,
|
|
9598
9602
|
noticeUuid,
|
|
@@ -10310,10 +10314,17 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10310
10314
|
* `product_uuid` pins it to one card -- unscoped, the ledger fans the
|
|
10311
10315
|
* answer out over every product the notice covers.
|
|
10312
10316
|
*
|
|
10317
|
+
* A nominee acting on a nominator's consent sends `nominator_uuid`: the
|
|
10318
|
+
* ledger re-checks the nomination edge and records the consent against the
|
|
10319
|
+
* nominator. Without it the principal resolves to the caller, so a
|
|
10320
|
+
* nominee's revoke opened a declined consent of their own and left the
|
|
10321
|
+
* nominator's granted. The legacy Python endpoint expresses the same thing
|
|
10322
|
+
* as `nominator_contact`.
|
|
10323
|
+
*
|
|
10313
10324
|
* Without a ledger, the legacy Python `/manage-consent?status=` endpoint is
|
|
10314
10325
|
* used with its `{ purpose_uuid, contact, ... }` payload.
|
|
10315
10326
|
*/
|
|
10316
|
-
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, language) {
|
|
10327
|
+
async manageConsent(baseRequest, purposeId, contact, status, authToken, options, nominatorContact, dataElementUuids, productUuid, noticeUuid, dataElements, language, nominatorUuid) {
|
|
10317
10328
|
var _a;
|
|
10318
10329
|
if (!useLedger()) {
|
|
10319
10330
|
const url2 = privacyCenterUrl(
|
|
@@ -10383,7 +10394,8 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10383
10394
|
data_elements: elements
|
|
10384
10395
|
}
|
|
10385
10396
|
],
|
|
10386
|
-
...language ? { language } : {}
|
|
10397
|
+
...language ? { language } : {},
|
|
10398
|
+
...nominatorUuid ? { nominator_uuid: nominatorUuid } : {}
|
|
10387
10399
|
};
|
|
10388
10400
|
const url = ledgerUrl(baseRequest, "/submit-consent");
|
|
10389
10401
|
const serialisedBody = JSON.stringify(body);
|
|
@@ -16923,7 +16935,7 @@ var ModifyConsentModal = ({
|
|
|
16923
16935
|
disabled: !selectedRecord.purpose_uuid || isRegrantAction && selectedDataElementUuids.length === 0,
|
|
16924
16936
|
variant: actionConfig.buttonVariant,
|
|
16925
16937
|
onClick: () => {
|
|
16926
|
-
var _a, _b;
|
|
16938
|
+
var _a, _b, _c;
|
|
16927
16939
|
if (selectedRecord.purpose_uuid) {
|
|
16928
16940
|
const nomContact = ((_a = selectedRecord.nominator) == null ? void 0 : _a.email) || ((_b = selectedRecord.nominator) == null ? void 0 : _b.org_user_id) || void 0;
|
|
16929
16941
|
onManageConsent(
|
|
@@ -16931,7 +16943,8 @@ var ModifyConsentModal = ({
|
|
|
16931
16943
|
actionConfig.action,
|
|
16932
16944
|
nomContact,
|
|
16933
16945
|
isRegrantAction ? selectedDataElementUuids : void 0,
|
|
16934
|
-
selectedRecord.product_uuid
|
|
16946
|
+
selectedRecord.product_uuid,
|
|
16947
|
+
(_c = selectedRecord.nominator) == null ? void 0 : _c.uuid
|
|
16935
16948
|
);
|
|
16936
16949
|
}
|
|
16937
16950
|
},
|
|
@@ -18540,7 +18553,7 @@ function ConsentManager({ variant }) {
|
|
|
18540
18553
|
]
|
|
18541
18554
|
);
|
|
18542
18555
|
const handleManageConsent = useCallback14(
|
|
18543
|
-
async (purposeId, action, nominatorContact, dataElementUuids, productUuid) => {
|
|
18556
|
+
async (purposeId, action, nominatorContact, dataElementUuids, productUuid, nominatorUuid) => {
|
|
18544
18557
|
var _a2, _b2;
|
|
18545
18558
|
if (!organizationId || !workspaceId || !contact) {
|
|
18546
18559
|
toast.error(t("missingInfoToManage"));
|
|
@@ -18572,6 +18585,7 @@ function ConsentManager({ variant }) {
|
|
|
18572
18585
|
authContext,
|
|
18573
18586
|
consentClient,
|
|
18574
18587
|
nominatorContact,
|
|
18588
|
+
nominatorUuid,
|
|
18575
18589
|
dataElementUuids,
|
|
18576
18590
|
productUuid,
|
|
18577
18591
|
noticeUuid,
|