@mattrglobal/verifier-sdk-web 1.1.1-unstable.143 → 1.1.1-unstable.145

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-05-12
10
+ * Generated: 2025-05-14
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