@redacto.io/consent-sdk-react 11.1.0-beta.1 → 11.1.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/{chunk-W45JQYDG.mjs → chunk-GP2II2WM.mjs} +1 -2
- package/dist/index.js +10 -14
- package/dist/index.mjs +10 -13
- package/dist/privacy-center.js +8 -12
- package/dist/privacy-center.mjs +8 -11
- package/package.json +1 -1
|
@@ -101,7 +101,6 @@ var loadNoticeWebfont = async (value, signal) => {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
// src/shared/idempotency.ts
|
|
104
|
-
var HEADER = "Idempotency-Key";
|
|
105
104
|
var pending = /* @__PURE__ */ new Map();
|
|
106
105
|
var MAX_PENDING = 16;
|
|
107
106
|
var mintKey = () => {
|
|
@@ -149,7 +148,7 @@ ${body}`;
|
|
|
149
148
|
if (entry.inFlight === 0 && !entry.keep) pending.delete(signature);
|
|
150
149
|
};
|
|
151
150
|
try {
|
|
152
|
-
const result = await send(
|
|
151
|
+
const result = await send(entry.key);
|
|
153
152
|
settle(settledOnResolve(result));
|
|
154
153
|
return result;
|
|
155
154
|
} catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -226,7 +226,6 @@ var sandboxBodyIdentity = (sandbox) => {
|
|
|
226
226
|
var sandboxQueryIdentity = (sandbox) => sandboxBodyIdentity(sandbox);
|
|
227
227
|
|
|
228
228
|
// src/shared/idempotency.ts
|
|
229
|
-
var HEADER = "Idempotency-Key";
|
|
230
229
|
var pending = /* @__PURE__ */ new Map();
|
|
231
230
|
var MAX_PENDING = 16;
|
|
232
231
|
var mintKey = () => {
|
|
@@ -274,7 +273,7 @@ ${body}`;
|
|
|
274
273
|
if (entry.inFlight === 0 && !entry.keep) pending.delete(signature);
|
|
275
274
|
};
|
|
276
275
|
try {
|
|
277
|
-
const result = await send(
|
|
276
|
+
const result = await send(entry.key);
|
|
278
277
|
settle(settledOnResolve(result));
|
|
279
278
|
return result;
|
|
280
279
|
} catch (error) {
|
|
@@ -511,14 +510,13 @@ var submitConsentEvent = async ({
|
|
|
511
510
|
const response = await withIdempotencyKey(
|
|
512
511
|
url,
|
|
513
512
|
serialisedBody,
|
|
514
|
-
(
|
|
513
|
+
(idempotencyKey) => fetch(url, {
|
|
515
514
|
method: "POST",
|
|
516
515
|
headers: {
|
|
517
516
|
...buildAuthHeaders(accessToken, sandbox),
|
|
518
|
-
"Content-Type": "application/json"
|
|
519
|
-
...idempotencyHeaders
|
|
517
|
+
"Content-Type": "application/json"
|
|
520
518
|
},
|
|
521
|
-
body:
|
|
519
|
+
body: JSON.stringify({ ...requestBody, idempotency_key: idempotencyKey }),
|
|
522
520
|
signal
|
|
523
521
|
})
|
|
524
522
|
);
|
|
@@ -10009,14 +10007,13 @@ var submitConsentEvent2 = async ({
|
|
|
10009
10007
|
const response = await withIdempotencyKey(
|
|
10010
10008
|
url,
|
|
10011
10009
|
serialisedBody,
|
|
10012
|
-
(
|
|
10010
|
+
(idempotencyKey) => fetch(url, {
|
|
10013
10011
|
method: "POST",
|
|
10014
10012
|
headers: {
|
|
10015
10013
|
Authorization: `Bearer ${accessToken}`,
|
|
10016
|
-
"Content-Type": "application/json"
|
|
10017
|
-
...idempotencyHeaders
|
|
10014
|
+
"Content-Type": "application/json"
|
|
10018
10015
|
},
|
|
10019
|
-
body:
|
|
10016
|
+
body: JSON.stringify({ ...payload, idempotency_key: idempotencyKey })
|
|
10020
10017
|
})
|
|
10021
10018
|
);
|
|
10022
10019
|
if (!response.ok) {
|
|
@@ -12364,15 +12361,14 @@ var submitAssistedConsent = async ({
|
|
|
12364
12361
|
const response = await withIdempotencyKey(
|
|
12365
12362
|
url,
|
|
12366
12363
|
serialisedBody,
|
|
12367
|
-
(
|
|
12364
|
+
(idempotencyKey) => fetch(url, {
|
|
12368
12365
|
method: "POST",
|
|
12369
12366
|
headers: {
|
|
12370
12367
|
accept: "application/json",
|
|
12371
12368
|
Authorization: `Bearer ${accessToken}`,
|
|
12372
|
-
"Content-Type": "application/json"
|
|
12373
|
-
...idempotencyHeaders
|
|
12369
|
+
"Content-Type": "application/json"
|
|
12374
12370
|
},
|
|
12375
|
-
body:
|
|
12371
|
+
body: JSON.stringify({ ...payload, idempotency_key: idempotencyKey }),
|
|
12376
12372
|
signal
|
|
12377
12373
|
})
|
|
12378
12374
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
withAlpha,
|
|
37
37
|
withColorScheme,
|
|
38
38
|
withIdempotencyKey
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-GP2II2WM.mjs";
|
|
40
40
|
import {
|
|
41
41
|
NOTICE_FONT_ROOT_PROPS,
|
|
42
42
|
REQUIRED_MARKER_ARIA_LABEL,
|
|
@@ -407,14 +407,13 @@ var submitConsentEvent = async ({
|
|
|
407
407
|
const response = await withIdempotencyKey(
|
|
408
408
|
url,
|
|
409
409
|
serialisedBody,
|
|
410
|
-
(
|
|
410
|
+
(idempotencyKey) => fetch(url, {
|
|
411
411
|
method: "POST",
|
|
412
412
|
headers: {
|
|
413
413
|
...buildAuthHeaders(accessToken, sandbox),
|
|
414
|
-
"Content-Type": "application/json"
|
|
415
|
-
...idempotencyHeaders
|
|
414
|
+
"Content-Type": "application/json"
|
|
416
415
|
},
|
|
417
|
-
body:
|
|
416
|
+
body: JSON.stringify({ ...requestBody, idempotency_key: idempotencyKey }),
|
|
418
417
|
signal
|
|
419
418
|
})
|
|
420
419
|
);
|
|
@@ -9020,14 +9019,13 @@ var submitConsentEvent2 = async ({
|
|
|
9020
9019
|
const response = await withIdempotencyKey(
|
|
9021
9020
|
url,
|
|
9022
9021
|
serialisedBody,
|
|
9023
|
-
(
|
|
9022
|
+
(idempotencyKey) => fetch(url, {
|
|
9024
9023
|
method: "POST",
|
|
9025
9024
|
headers: {
|
|
9026
9025
|
Authorization: `Bearer ${accessToken}`,
|
|
9027
|
-
"Content-Type": "application/json"
|
|
9028
|
-
...idempotencyHeaders
|
|
9026
|
+
"Content-Type": "application/json"
|
|
9029
9027
|
},
|
|
9030
|
-
body:
|
|
9028
|
+
body: JSON.stringify({ ...payload, idempotency_key: idempotencyKey })
|
|
9031
9029
|
})
|
|
9032
9030
|
);
|
|
9033
9031
|
if (!response.ok) {
|
|
@@ -11375,15 +11373,14 @@ var submitAssistedConsent = async ({
|
|
|
11375
11373
|
const response = await withIdempotencyKey(
|
|
11376
11374
|
url,
|
|
11377
11375
|
serialisedBody,
|
|
11378
|
-
(
|
|
11376
|
+
(idempotencyKey) => fetch(url, {
|
|
11379
11377
|
method: "POST",
|
|
11380
11378
|
headers: {
|
|
11381
11379
|
accept: "application/json",
|
|
11382
11380
|
Authorization: `Bearer ${accessToken}`,
|
|
11383
|
-
"Content-Type": "application/json"
|
|
11384
|
-
...idempotencyHeaders
|
|
11381
|
+
"Content-Type": "application/json"
|
|
11385
11382
|
},
|
|
11386
|
-
body:
|
|
11383
|
+
body: JSON.stringify({ ...payload, idempotency_key: idempotencyKey }),
|
|
11387
11384
|
signal
|
|
11388
11385
|
})
|
|
11389
11386
|
);
|
package/dist/privacy-center.js
CHANGED
|
@@ -10190,7 +10190,6 @@ var useAuth = () => {
|
|
|
10190
10190
|
var import_react6 = require("react");
|
|
10191
10191
|
|
|
10192
10192
|
// src/shared/idempotency.ts
|
|
10193
|
-
var HEADER = "Idempotency-Key";
|
|
10194
10193
|
var pending = /* @__PURE__ */ new Map();
|
|
10195
10194
|
var MAX_PENDING = 16;
|
|
10196
10195
|
var mintKey = () => {
|
|
@@ -10238,7 +10237,7 @@ ${body}`;
|
|
|
10238
10237
|
if (entry.inFlight === 0 && !entry.keep) pending.delete(signature);
|
|
10239
10238
|
};
|
|
10240
10239
|
try {
|
|
10241
|
-
const result = await send(
|
|
10240
|
+
const result = await send(entry.key);
|
|
10242
10241
|
settle(settledOnResolve(result));
|
|
10243
10242
|
return result;
|
|
10244
10243
|
} catch (error) {
|
|
@@ -10733,19 +10732,16 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10733
10732
|
};
|
|
10734
10733
|
const url = ledgerUrl(baseRequest, "/submit-consent");
|
|
10735
10734
|
const serialisedBody = JSON.stringify(body);
|
|
10736
|
-
return withIdempotencyKey(
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
);
|
|
10741
|
-
return privacyCenterApiFetch(url, {
|
|
10735
|
+
return withIdempotencyKey(
|
|
10736
|
+
url,
|
|
10737
|
+
serialisedBody,
|
|
10738
|
+
(idempotencyKey) => privacyCenterApiFetch(url, {
|
|
10742
10739
|
...options,
|
|
10743
10740
|
method: "POST",
|
|
10744
|
-
body:
|
|
10745
|
-
headers,
|
|
10741
|
+
body: JSON.stringify({ ...body, idempotency_key: idempotencyKey }),
|
|
10746
10742
|
authToken: resolveAuthToken(authToken, baseRequest)
|
|
10747
|
-
})
|
|
10748
|
-
|
|
10743
|
+
})
|
|
10744
|
+
);
|
|
10749
10745
|
},
|
|
10750
10746
|
/**
|
|
10751
10747
|
* Get activities (privacy center)
|
package/dist/privacy-center.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
warnEndpointUsage,
|
|
23
23
|
warnSlugDeprecated,
|
|
24
24
|
withIdempotencyKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GP2II2WM.mjs";
|
|
26
26
|
import {
|
|
27
27
|
INHERIT_FONT_FAMILY,
|
|
28
28
|
resolveNoticeFontFamily
|
|
@@ -10512,19 +10512,16 @@ function createConsentClient(baseUrl, ledgerBaseUrl) {
|
|
|
10512
10512
|
};
|
|
10513
10513
|
const url = ledgerUrl(baseRequest, "/submit-consent");
|
|
10514
10514
|
const serialisedBody = JSON.stringify(body);
|
|
10515
|
-
return withIdempotencyKey(
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
);
|
|
10520
|
-
return privacyCenterApiFetch(url, {
|
|
10515
|
+
return withIdempotencyKey(
|
|
10516
|
+
url,
|
|
10517
|
+
serialisedBody,
|
|
10518
|
+
(idempotencyKey) => privacyCenterApiFetch(url, {
|
|
10521
10519
|
...options,
|
|
10522
10520
|
method: "POST",
|
|
10523
|
-
body:
|
|
10524
|
-
headers,
|
|
10521
|
+
body: JSON.stringify({ ...body, idempotency_key: idempotencyKey }),
|
|
10525
10522
|
authToken: resolveAuthToken(authToken, baseRequest)
|
|
10526
|
-
})
|
|
10527
|
-
|
|
10523
|
+
})
|
|
10524
|
+
);
|
|
10528
10525
|
},
|
|
10529
10526
|
/**
|
|
10530
10527
|
* Get activities (privacy center)
|