@lumiapassport/ui-kit 1.8.0 → 1.8.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/iframe/index.html +1 -1
- package/dist/iframe/main.js +2 -4
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1305,7 +1305,7 @@ async function getShareVaultToken(scopes) {
|
|
|
1305
1305
|
async function getShareRecoveryStats() {
|
|
1306
1306
|
try {
|
|
1307
1307
|
const token = await getShareVaultToken(["share:get"]);
|
|
1308
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" }
|
|
1308
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" } });
|
|
1309
1309
|
if (response.status === 404) return null;
|
|
1310
1310
|
if (!response.ok) return null;
|
|
1311
1311
|
return await response.json();
|
|
@@ -1315,26 +1315,26 @@ async function getShareRecoveryStats() {
|
|
|
1315
1315
|
}
|
|
1316
1316
|
async function getShare() {
|
|
1317
1317
|
const token = await getShareVaultToken(["share:get"]);
|
|
1318
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" }
|
|
1318
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" } });
|
|
1319
1319
|
if (response.status === 404) return null;
|
|
1320
1320
|
if (!response.ok) throw new Error(`Failed to fetch share: ${response.status} ${response.statusText}`);
|
|
1321
1321
|
return await response.json();
|
|
1322
1322
|
}
|
|
1323
1323
|
async function uploadShare(share, idempotencyKey) {
|
|
1324
1324
|
const token = await getShareVaultToken(["share:put"]);
|
|
1325
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "PUT", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey },
|
|
1325
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "PUT", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey }, body: JSON.stringify(share) });
|
|
1326
1326
|
if (!response.ok) throw new Error(`Failed to upload share: ${response.status} ${response.statusText}`);
|
|
1327
1327
|
return await response.json();
|
|
1328
1328
|
}
|
|
1329
1329
|
async function rewrapShare(payload, idempotencyKey) {
|
|
1330
1330
|
const token = await getShareVaultToken(["share:rewrap"]);
|
|
1331
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/rewrap`, { method: "POST", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey },
|
|
1331
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/rewrap`, { method: "POST", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey }, body: JSON.stringify(payload) });
|
|
1332
1332
|
if (!response.ok) throw new Error(`Failed to rewrap share: ${response.status} ${response.statusText}`);
|
|
1333
1333
|
return await response.json();
|
|
1334
1334
|
}
|
|
1335
1335
|
async function deleteShare() {
|
|
1336
1336
|
const token = await getShareVaultToken(["share:delete"]);
|
|
1337
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "DELETE", headers: { Authorization: `Bearer ${token.token}` }
|
|
1337
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "DELETE", headers: { Authorization: `Bearer ${token.token}` } });
|
|
1338
1338
|
if (!response.ok && response.status !== 404) throw new Error(`Failed to delete share: ${response.status} ${response.statusText}`);
|
|
1339
1339
|
}
|
|
1340
1340
|
async function deriveKEKFromPasskey(userId, requiredCredentialId) {
|
|
@@ -1511,7 +1511,7 @@ function clearBackupStatus(userId) {
|
|
|
1511
1511
|
async function checkServerBackupAvailability() {
|
|
1512
1512
|
try {
|
|
1513
1513
|
const token = await getShareVaultToken(["share:get"]);
|
|
1514
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" }
|
|
1514
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" } });
|
|
1515
1515
|
if (response.status === 404) return { hasBackup: false, serviceAvailable: true };
|
|
1516
1516
|
if (!response.ok) return { hasBackup: false, serviceAvailable: false };
|
|
1517
1517
|
return { hasBackup: true, serviceAvailable: true };
|
|
@@ -1521,14 +1521,14 @@ async function checkServerBackupAvailability() {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
async function uploadShareToVault(envelope, token) {
|
|
1523
1523
|
const idempotencyKey = crypto.randomUUID ? crypto.randomUUID() : `backup-${Date.now()}`;
|
|
1524
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "PUT", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, "Idempotency-Key": idempotencyKey },
|
|
1524
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "PUT", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, "Idempotency-Key": idempotencyKey }, body: JSON.stringify(envelope) });
|
|
1525
1525
|
if (!response.ok) {
|
|
1526
1526
|
const errorText = await response.text();
|
|
1527
1527
|
throw new Error(`Failed to upload share: ${response.status} ${response.statusText} - ${errorText}`);
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
1530
1530
|
async function downloadShareFromVault(token) {
|
|
1531
|
-
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "GET", headers: { Authorization: `Bearer ${token}`, "X-Client-Device-Id": "lumia-ui-kit", "X-Client-Device-Name": "Lumia UI Kit" }
|
|
1531
|
+
const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "GET", headers: { Authorization: `Bearer ${token}`, "X-Client-Device-Id": "lumia-ui-kit", "X-Client-Device-Name": "Lumia UI Kit" } });
|
|
1532
1532
|
if (!response.ok) {
|
|
1533
1533
|
if (response.status === 404) throw new Error("No backup found on server for this user");
|
|
1534
1534
|
const errorText = await response.text();
|
|
@@ -8645,7 +8645,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
8645
8645
|
// package.json
|
|
8646
8646
|
var package_default = {
|
|
8647
8647
|
name: "@lumiapassport/ui-kit",
|
|
8648
|
-
version: "1.8.
|
|
8648
|
+
version: "1.8.1",
|
|
8649
8649
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
8650
8650
|
type: "module",
|
|
8651
8651
|
main: "./dist/index.cjs",
|