@mattrglobal/verifier-sdk-web 2.0.3-unstable.4 → 2.0.3-unstable.41

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.
@@ -7,7 +7,7 @@
7
7
  * Do Not Translate or Localize
8
8
  *
9
9
  * Bundle of @mattrglobal/verifier-sdk-web
10
- * Generated: 2025-06-10
10
+ * Generated: 2025-08-19
11
11
  * Version: 2.0.2
12
12
  * Dependencies:
13
13
  *
@@ -1721,7 +1721,7 @@
1721
1721
  walletProviderId: walletProviderId,
1722
1722
  dcApiSupported: dcApiSupported
1723
1723
  };
1724
- const responseResult = await safeFetch(`${apiBaseUrl}/v2/presentations/sessions`, {
1724
+ const responseResult = await safeFetch(`${apiBaseUrl}/v2/presentations/web/sessions`, {
1725
1725
  method: "POST",
1726
1726
  headers: {
1727
1727
  "Content-Type": "application/json"
@@ -1741,7 +1741,7 @@
1741
1741
  return ok(data);
1742
1742
  };
1743
1743
  const abortSession = async ({apiBaseUrl: apiBaseUrl, sessionId: sessionId, sessionKey: sessionKey}) => {
1744
- const responseResult = await safeFetch(`${apiBaseUrl}/v2/presentations/sessions/${sessionId}/abort`, {
1744
+ const responseResult = await safeFetch(`${apiBaseUrl}/v2/presentations/web/sessions/${sessionId}/abort`, {
1745
1745
  method: "POST",
1746
1746
  headers: {
1747
1747
  "Content-Type": "application/json",
@@ -1777,7 +1777,7 @@
1777
1777
  challenge: challenge,
1778
1778
  responseCode: responseCode
1779
1779
  };
1780
- const fetchResultFn = async () => await safeFetch(`${apiBaseUrl}/v2/presentations/sessions/${sessionId}/result`, {
1780
+ const fetchResultFn = async () => await safeFetch(`${apiBaseUrl}/v2/presentations/web/sessions/${sessionId}/result`, {
1781
1781
  method: "POST",
1782
1782
  headers: {
1783
1783
  "Content-Type": "application/json"
@@ -2017,8 +2017,19 @@
2017
2017
  }
2018
2018
  });
2019
2019
  }
2020
+ if (typeof credentialResponse === "object" && "toJSON" in credentialResponse && typeof credentialResponse.toJSON === "function") {
2021
+ return ok(credentialResponse.toJSON());
2022
+ }
2020
2023
  if (typeof credentialResponse === "object") {
2021
- return ok(credentialResponse);
2024
+ const entries = [];
2025
+ for (const key in credentialResponse) {
2026
+ const value = credentialResponse[key];
2027
+ if (typeof value === "function" || value === undefined || value === null) {
2028
+ continue;
2029
+ }
2030
+ entries.push([ key, value ]);
2031
+ }
2032
+ return ok(Object.fromEntries(entries));
2022
2033
  }
2023
2034
  if (typeof credentialResponse === "string") {
2024
2035
  try {
@@ -2049,7 +2060,7 @@
2049
2060
  data: data,
2050
2061
  challenge: challenge
2051
2062
  };
2052
- const credentialVerificationResult = await safeFetch(`${apiBaseUrl}/v2/presentations/sessions/${sessionId}/dc-api/response`, {
2063
+ const credentialVerificationResult = await safeFetch(`${apiBaseUrl}/v2/presentations/web/sessions/${sessionId}/dc-api/response`, {
2053
2064
  method: "POST",
2054
2065
  headers: {
2055
2066
  "Content-Type": "application/json",