@mattrglobal/verifier-sdk-web 2.0.0-preview-digital-credential-api.1 → 2.0.0-preview-digital-credential-api.3
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/README.md +47 -10
- package/dist/lib/verifier-js-no-deps.cjs.js +11 -8
- package/dist/lib/verifier-js-no-deps.cjs.js.map +1 -1
- package/dist/lib/verifier-js.cjs.js +11 -8
- package/dist/lib/verifier-js.cjs.js.map +1 -1
- package/dist/typings/verifier/types/verifier-web-sdk.d.ts +1 -0
- package/dist/typings/verifier/utils.d.ts +2 -1
- package/dist/verifier-js.development.js +11 -8
- package/dist/verifier-js.development.js.map +1 -1
- package/dist/verifier-js.production.esm.js +4 -4
- package/dist/verifier-js.production.esm.js.map +1 -1
- package/dist/verifier-js.production.js +4 -4
- package/dist/verifier-js.production.js.map +1 -1
- package/package.json +2 -2
|
@@ -308,6 +308,7 @@ export type HandleRedirectCallbackResponse = {
|
|
|
308
308
|
*/
|
|
309
309
|
export type InitialiseOptions = {
|
|
310
310
|
apiBaseUrl: string;
|
|
311
|
+
digitalCredentialsApiProtocol?: string;
|
|
311
312
|
enableDigitalCredentialsApiSameDeviceFlow?: boolean;
|
|
312
313
|
enableDigitalCredentialsApiCrossDeviceFlow?: boolean;
|
|
313
314
|
};
|
|
@@ -64,8 +64,9 @@ export declare const isDigitalCredentialsApiSupported: () => boolean;
|
|
|
64
64
|
* @param apiBaseUrl - The base URL of the API.
|
|
65
65
|
* @returns A promise that resolves to a result containing either the created session response or an error.
|
|
66
66
|
*/
|
|
67
|
-
export declare const createDigitalCredentialsApiSession: ({ credentialQuery, challenge, apiBaseUrl, }: CreateSessionRequest & {
|
|
67
|
+
export declare const createDigitalCredentialsApiSession: ({ credentialQuery, challenge, apiBaseUrl, protocol, }: CreateSessionRequest & {
|
|
68
68
|
apiBaseUrl: string;
|
|
69
|
+
protocol?: string;
|
|
69
70
|
}) => Promise<Result<CreateDigitalCredentialsApiSessionResponse, SafeFetchValidateRespondError>>;
|
|
70
71
|
/**
|
|
71
72
|
* Retrieves the result of a session using the provided parameters.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2025 - MATTR Limited
|
|
3
3
|
* All rights reserved
|
|
4
4
|
* Confidential and proprietary
|
|
5
5
|
*
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Do Not Translate or Localize
|
|
8
8
|
*
|
|
9
9
|
* Bundle of @mattrglobal/verifier-sdk-web
|
|
10
|
-
* Generated:
|
|
11
|
-
* Version: 2.0.0-preview-digital-credential-api.
|
|
10
|
+
* Generated: 2025-02-18
|
|
11
|
+
* Version: 2.0.0-preview-digital-credential-api.3
|
|
12
12
|
* Dependencies:
|
|
13
13
|
*
|
|
14
14
|
* neverthrow -- 4.3.0
|
|
@@ -1520,11 +1520,13 @@
|
|
|
1520
1520
|
return false;
|
|
1521
1521
|
}
|
|
1522
1522
|
};
|
|
1523
|
-
const createDigitalCredentialsApiSession = async ({credentialQuery: credentialQuery, challenge: challenge, apiBaseUrl: apiBaseUrl}) => {
|
|
1524
|
-
const postData = {
|
|
1523
|
+
const createDigitalCredentialsApiSession = async ({credentialQuery: credentialQuery, challenge: challenge, apiBaseUrl: apiBaseUrl, protocol: protocol}) => {
|
|
1524
|
+
const postData = Object.assign({
|
|
1525
1525
|
credentialQuery: credentialQuery,
|
|
1526
1526
|
challenge: challenge
|
|
1527
|
-
}
|
|
1527
|
+
}, protocol && {
|
|
1528
|
+
protocol: protocol
|
|
1529
|
+
});
|
|
1528
1530
|
const responseResult = await safeFetch(`${apiBaseUrl}/v2/presentations/sessions/browserApi/request`, {
|
|
1529
1531
|
method: "POST",
|
|
1530
1532
|
headers: {
|
|
@@ -1740,7 +1742,7 @@
|
|
|
1740
1742
|
})(SameDeviceRequestCredentialsErrorMessage || (SameDeviceRequestCredentialsErrorMessage = {}));
|
|
1741
1743
|
const requestCredentialsDigitalCredentialsApi = async options => {
|
|
1742
1744
|
const {challenge: challenge, credentialQuery: credentialQuery, initialiseOptions: initialiseOptions} = options;
|
|
1743
|
-
const {apiBaseUrl: apiBaseUrl} = initialiseOptions;
|
|
1745
|
+
const {apiBaseUrl: apiBaseUrl, digitalCredentialsApiProtocol: digitalCredentialsApiProtocol} = initialiseOptions;
|
|
1744
1746
|
window.localStorage.setItem(LocalStorageKey.challenge, challenge);
|
|
1745
1747
|
const storedChallenge = window.localStorage.getItem(LocalStorageKey.challenge);
|
|
1746
1748
|
if (!storedChallenge) {
|
|
@@ -1752,7 +1754,8 @@
|
|
|
1752
1754
|
const createSessionResult = await createDigitalCredentialsApiSession({
|
|
1753
1755
|
credentialQuery: credentialQuery,
|
|
1754
1756
|
challenge: storedChallenge,
|
|
1755
|
-
apiBaseUrl: apiBaseUrl
|
|
1757
|
+
apiBaseUrl: apiBaseUrl,
|
|
1758
|
+
protocol: digitalCredentialsApiProtocol
|
|
1756
1759
|
});
|
|
1757
1760
|
if (createSessionResult.isErr()) {
|
|
1758
1761
|
return err({
|