@mattrglobal/verifier-sdk-web 1.1.1-unstable.142 → 1.1.1-unstable.144
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/lib/verifier-js-no-deps.cjs.js +46 -34
- package/dist/lib/verifier-js-no-deps.cjs.js.map +1 -1
- package/dist/lib/verifier-js.cjs.js +46 -34
- package/dist/lib/verifier-js.cjs.js.map +1 -1
- package/dist/typings/common/safeFetch.d.ts +1 -0
- package/dist/typings/index.d.ts +1 -0
- package/dist/typings/verifier/types/verifier-web-sdk.d.ts +2 -0
- package/dist/typings/verifier/utils.d.ts +4 -0
- package/dist/verifier-js.development.js +38 -29
- package/dist/verifier-js.development.js.map +1 -1
- package/dist/verifier-js.production.esm.js +2 -2
- package/dist/verifier-js.production.esm.js.map +1 -1
- package/dist/verifier-js.production.js +2 -2
- package/dist/verifier-js.production.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Do Not Translate or Localize
|
|
8
8
|
*
|
|
9
9
|
* Bundle of @mattrglobal/verifier-sdk-web
|
|
10
|
-
* Generated: 2025-05-
|
|
10
|
+
* Generated: 2025-05-12
|
|
11
11
|
* Version: 1.1.0
|
|
12
12
|
* Dependencies:
|
|
13
13
|
*/
|
|
@@ -89,39 +89,6 @@ const assertType = (validator, message) => data => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
var SafeFetchCommonRespondErrorType;
|
|
93
|
-
|
|
94
|
-
(function(SafeFetchCommonRespondErrorType) {
|
|
95
|
-
SafeFetchCommonRespondErrorType["UnexpectedRespond"] = "UnexpectedRespond";
|
|
96
|
-
})(SafeFetchCommonRespondErrorType || (SafeFetchCommonRespondErrorType = {}));
|
|
97
|
-
|
|
98
|
-
var SafeFetchErrorType;
|
|
99
|
-
|
|
100
|
-
(function(SafeFetchErrorType) {
|
|
101
|
-
SafeFetchErrorType["HttpError"] = "HttpError";
|
|
102
|
-
SafeFetchErrorType["UnknownError"] = "UnknownError";
|
|
103
|
-
})(SafeFetchErrorType || (SafeFetchErrorType = {}));
|
|
104
|
-
|
|
105
|
-
const safeFetch = async (input, init) => {
|
|
106
|
-
try {
|
|
107
|
-
const response = await fetch(input, init);
|
|
108
|
-
if (response.status > 299 || response.status < 200) {
|
|
109
|
-
return neverthrow.err({
|
|
110
|
-
type: SafeFetchErrorType.HttpError,
|
|
111
|
-
message: `HTTP error, status = ${response.status}`,
|
|
112
|
-
status: response.status
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
return neverthrow.ok(response);
|
|
116
|
-
} catch (error) {
|
|
117
|
-
return neverthrow.err({
|
|
118
|
-
type: SafeFetchErrorType.UnknownError,
|
|
119
|
-
message: "Unknown error",
|
|
120
|
-
cause: error
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
92
|
exports.MobileCredentialVerificationReasonType = void 0;
|
|
126
93
|
|
|
127
94
|
(function(MobileCredentialVerificationReasonType) {
|
|
@@ -244,6 +211,10 @@ var LocalStorageKey;
|
|
|
244
211
|
LocalStorageKey["sessionId"] = "mattr_sid";
|
|
245
212
|
})(LocalStorageKey || (LocalStorageKey = {}));
|
|
246
213
|
|
|
214
|
+
const MATTR_SDK_VERSION_HEADER = "x-mattr-sdk-version";
|
|
215
|
+
|
|
216
|
+
const MATTR_SDK_VERSION_VALUE = "2.0.0";
|
|
217
|
+
|
|
247
218
|
exports.Mode = void 0;
|
|
248
219
|
|
|
249
220
|
(function(Mode) {
|
|
@@ -319,6 +290,44 @@ const InitialiseOptionsValidator = v__namespace.object({
|
|
|
319
290
|
applicationId: v__namespace.pipe(v__namespace.string(), v__namespace.nonEmpty("Must not be empty"))
|
|
320
291
|
});
|
|
321
292
|
|
|
293
|
+
var SafeFetchCommonRespondErrorType;
|
|
294
|
+
|
|
295
|
+
(function(SafeFetchCommonRespondErrorType) {
|
|
296
|
+
SafeFetchCommonRespondErrorType["UnexpectedRespond"] = "UnexpectedRespond";
|
|
297
|
+
})(SafeFetchCommonRespondErrorType || (SafeFetchCommonRespondErrorType = {}));
|
|
298
|
+
|
|
299
|
+
var SafeFetchErrorType;
|
|
300
|
+
|
|
301
|
+
(function(SafeFetchErrorType) {
|
|
302
|
+
SafeFetchErrorType["HttpError"] = "HttpError";
|
|
303
|
+
SafeFetchErrorType["UnknownError"] = "UnknownError";
|
|
304
|
+
})(SafeFetchErrorType || (SafeFetchErrorType = {}));
|
|
305
|
+
|
|
306
|
+
const safeFetch = async (input, init) => {
|
|
307
|
+
try {
|
|
308
|
+
const headers = Object.assign(Object.assign({}, init === null || init === void 0 ? void 0 : init.headers), {
|
|
309
|
+
[MATTR_SDK_VERSION_HEADER]: `verifier-sdk-web/${MATTR_SDK_VERSION_VALUE}`
|
|
310
|
+
});
|
|
311
|
+
const response = await fetch(input, Object.assign(Object.assign({}, init), {
|
|
312
|
+
headers: headers
|
|
313
|
+
}));
|
|
314
|
+
if (response.status > 299 || response.status < 200) {
|
|
315
|
+
return neverthrow.err({
|
|
316
|
+
type: SafeFetchErrorType.HttpError,
|
|
317
|
+
message: `HTTP error, status = ${response.status}`,
|
|
318
|
+
status: response.status
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
return neverthrow.ok(response);
|
|
322
|
+
} catch (error) {
|
|
323
|
+
return neverthrow.err({
|
|
324
|
+
type: SafeFetchErrorType.UnknownError,
|
|
325
|
+
message: "Unknown error",
|
|
326
|
+
cause: error
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
322
331
|
let initialiseOptions = undefined;
|
|
323
332
|
|
|
324
333
|
var InitialiseErrorMessage;
|
|
@@ -519,6 +528,8 @@ const isMobileDetect = userAgent => isMobile.isMobile({
|
|
|
519
528
|
tablet: false
|
|
520
529
|
});
|
|
521
530
|
|
|
531
|
+
const getVersion = () => MATTR_SDK_VERSION_VALUE;
|
|
532
|
+
|
|
522
533
|
var WindowEventListenerType;
|
|
523
534
|
|
|
524
535
|
(function(WindowEventListenerType) {
|
|
@@ -851,6 +862,7 @@ const abortCredentialRequest = async () => {
|
|
|
851
862
|
|
|
852
863
|
const utils = {
|
|
853
864
|
generateChallenge: generateChallenge,
|
|
865
|
+
getVersion: getVersion,
|
|
854
866
|
unwrap: unwrap
|
|
855
867
|
};
|
|
856
868
|
|