@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/index.cjs CHANGED
@@ -1316,7 +1316,7 @@ async function getShareVaultToken(scopes) {
1316
1316
  async function getShareRecoveryStats() {
1317
1317
  try {
1318
1318
  const token = await getShareVaultToken(["share:get"]);
1319
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" }, credentials: "include" });
1319
+ const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" } });
1320
1320
  if (response.status === 404) return null;
1321
1321
  if (!response.ok) return null;
1322
1322
  return await response.json();
@@ -1326,26 +1326,26 @@ async function getShareRecoveryStats() {
1326
1326
  }
1327
1327
  async function getShare() {
1328
1328
  const token = await getShareVaultToken(["share:get"]);
1329
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" }, credentials: "include" });
1329
+ const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" } });
1330
1330
  if (response.status === 404) return null;
1331
1331
  if (!response.ok) throw new Error(`Failed to fetch share: ${response.status} ${response.statusText}`);
1332
1332
  return await response.json();
1333
1333
  }
1334
1334
  async function uploadShare(share, idempotencyKey) {
1335
1335
  const token = await getShareVaultToken(["share:put"]);
1336
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "PUT", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey }, credentials: "include", body: JSON.stringify(share) });
1336
+ 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) });
1337
1337
  if (!response.ok) throw new Error(`Failed to upload share: ${response.status} ${response.statusText}`);
1338
1338
  return await response.json();
1339
1339
  }
1340
1340
  async function rewrapShare(payload, idempotencyKey) {
1341
1341
  const token = await getShareVaultToken(["share:rewrap"]);
1342
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/rewrap`, { method: "POST", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey }, credentials: "include", body: JSON.stringify(payload) });
1342
+ 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) });
1343
1343
  if (!response.ok) throw new Error(`Failed to rewrap share: ${response.status} ${response.statusText}`);
1344
1344
  return await response.json();
1345
1345
  }
1346
1346
  async function deleteShare() {
1347
1347
  const token = await getShareVaultToken(["share:delete"]);
1348
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "DELETE", headers: { Authorization: `Bearer ${token.token}` }, credentials: "include" });
1348
+ const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "DELETE", headers: { Authorization: `Bearer ${token.token}` } });
1349
1349
  if (!response.ok && response.status !== 404) throw new Error(`Failed to delete share: ${response.status} ${response.statusText}`);
1350
1350
  }
1351
1351
  async function deriveKEKFromPasskey(userId, requiredCredentialId) {
@@ -1522,7 +1522,7 @@ function clearBackupStatus(userId) {
1522
1522
  async function checkServerBackupAvailability() {
1523
1523
  try {
1524
1524
  const token = await getShareVaultToken(["share:get"]);
1525
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" }, credentials: "include" });
1525
+ const response = await fetch(`${getShareVaultUrl()}/v1/shares/me/recovery/stats`, { method: "GET", headers: { Authorization: `Bearer ${token.token}`, "Content-Type": "application/json" } });
1526
1526
  if (response.status === 404) return { hasBackup: false, serviceAvailable: true };
1527
1527
  if (!response.ok) return { hasBackup: false, serviceAvailable: false };
1528
1528
  return { hasBackup: true, serviceAvailable: true };
@@ -1532,14 +1532,14 @@ async function checkServerBackupAvailability() {
1532
1532
  }
1533
1533
  async function uploadShareToVault(envelope, token) {
1534
1534
  const idempotencyKey = crypto.randomUUID ? crypto.randomUUID() : `backup-${Date.now()}`;
1535
- const response = await fetch(`${getShareVaultUrl()}/v1/shares/me`, { method: "PUT", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, "Idempotency-Key": idempotencyKey }, credentials: "include", body: JSON.stringify(envelope) });
1535
+ 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) });
1536
1536
  if (!response.ok) {
1537
1537
  const errorText = await response.text();
1538
1538
  throw new Error(`Failed to upload share: ${response.status} ${response.statusText} - ${errorText}`);
1539
1539
  }
1540
1540
  }
1541
1541
  async function downloadShareFromVault(token) {
1542
- 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" }, credentials: "include" });
1542
+ 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" } });
1543
1543
  if (!response.ok) {
1544
1544
  if (response.status === 404) throw new Error("No backup found on server for this user");
1545
1545
  const errorText = await response.text();
@@ -8674,7 +8674,7 @@ function useLumiaPassportLinkedProfiles() {
8674
8674
  // package.json
8675
8675
  var package_default = {
8676
8676
  name: "@lumiapassport/ui-kit",
8677
- version: "1.8.0",
8677
+ version: "1.8.1",
8678
8678
  description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
8679
8679
  type: "module",
8680
8680
  main: "./dist/index.cjs",