@velocitycareerlabs/vcl-react-native 1.8.0 → 1.9.0
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/android/build.gradle +1 -1
- package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +23 -23
- package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/VCLErrorExtensions.kt +2 -6
- package/ios/VclReactNative.swift +20 -20
- package/lib/commonjs/api/VCLApi.js +18 -18
- package/lib/commonjs/api/VCLApi.js.map +1 -1
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js.map +1 -1
- package/lib/commonjs/api/entities/VCLError.js +11 -10
- package/lib/commonjs/api/entities/VCLError.js.map +1 -1
- package/lib/commonjs/api/entities/VCLIssuingType.js +9 -9
- package/lib/commonjs/api/entities/VCLIssuingType.js.map +1 -1
- package/lib/commonjs/api/entities/VCLPresentationRequestDescriptor.js.map +1 -1
- package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js +0 -4
- package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/api/VCLApi.js +18 -18
- package/lib/module/api/VCLApi.js.map +1 -1
- package/lib/module/api/entities/VCLCredentialManifestDescriptor.js.map +1 -1
- package/lib/module/api/entities/VCLError.js +10 -8
- package/lib/module/api/entities/VCLError.js.map +1 -1
- package/lib/module/api/entities/VCLIssuingType.js +7 -7
- package/lib/module/api/entities/VCLIssuingType.js.map +1 -1
- package/lib/module/api/entities/VCLPresentationRequestDescriptor.js.map +1 -1
- package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js +1 -1
- package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/api/entities/VCLCredentialManifestDescriptor.d.ts +2 -2
- package/lib/typescript/api/entities/VCLError.d.ts +4 -3
- package/lib/typescript/api/entities/VCLIssuingType.d.ts +1 -1
- package/lib/typescript/api/entities/VCLPresentationRequestDescriptor.d.ts +0 -2
- package/lib/typescript/api/entities/VCLVerifiedProfileDescriptor.d.ts +0 -2
- package/lib/typescript/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/api/VCLApi.ts +18 -18
- package/src/api/entities/VCLCredentialManifestDescriptor.ts +2 -2
- package/src/api/entities/VCLError.ts +10 -9
- package/src/api/entities/VCLIssuingType.ts +1 -1
- package/src/api/entities/VCLPresentationRequestDescriptor.ts +0 -2
- package/src/api/entities/VCLVerifiedProfileDescriptor.ts +0 -3
- package/src/index.tsx +5 -2
- package/vcl-react-native.podspec +1 -1
- package/ios/Extensions/VCLErrorExtensions.swift +0 -21
package/android/build.gradle
CHANGED
|
@@ -74,7 +74,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
74
74
|
promise.reject(it.toThrowable())
|
|
75
75
|
})
|
|
76
76
|
} catch (ex: Exception) {
|
|
77
|
-
promise.reject(VCLError(ex.
|
|
77
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -82,9 +82,9 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
82
82
|
fun getCountries(promise: Promise) {
|
|
83
83
|
try {
|
|
84
84
|
vcl.countries?.let { promise.resolve(countriesToMap(it)) }
|
|
85
|
-
?: promise.reject(VCLError("Countries not found"))
|
|
85
|
+
?: promise.reject(VCLError(message = "Countries not found").toThrowable())
|
|
86
86
|
} catch (ex: Exception) {
|
|
87
|
-
promise.reject(VCLError(ex.
|
|
87
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -92,9 +92,9 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
92
92
|
fun getCredentialTypeSchemas(promise: Promise) {
|
|
93
93
|
try {
|
|
94
94
|
vcl.credentialTypeSchemas?.let { promise.resolve(credentialTypeSchemasToMap(it)) }
|
|
95
|
-
?: promise.reject(VCLError("Credential Types not found"))
|
|
95
|
+
?: promise.reject(VCLError(message = "Credential Types not found").toThrowable())
|
|
96
96
|
} catch (ex: Exception) {
|
|
97
|
-
promise.reject(VCLError(ex.
|
|
97
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -102,9 +102,9 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
102
102
|
fun getCredentialTypes(promise: Promise) {
|
|
103
103
|
try {
|
|
104
104
|
vcl.credentialTypes?.let { promise.resolve(credentialTypesToMap(it)) }
|
|
105
|
-
?: promise.reject(VCLError("Credential Types not found"))
|
|
105
|
+
?: promise.reject(VCLError(message = "Credential Types not found").toThrowable())
|
|
106
106
|
} catch (ex: Exception) {
|
|
107
|
-
promise.reject(VCLError(ex.
|
|
107
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -123,7 +123,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
123
123
|
promise.reject(it.toThrowable())
|
|
124
124
|
})
|
|
125
125
|
} catch (ex: Exception) {
|
|
126
|
-
promise.reject(VCLError(ex.
|
|
126
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -142,7 +142,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
142
142
|
promise.reject(it.toThrowable())
|
|
143
143
|
})
|
|
144
144
|
} catch (ex: Exception) {
|
|
145
|
-
promise.reject(VCLError(ex.
|
|
145
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -160,7 +160,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
160
160
|
promise.reject(it.toThrowable())
|
|
161
161
|
})
|
|
162
162
|
} catch (ex: Exception) {
|
|
163
|
-
promise.reject(VCLError(ex.
|
|
163
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
@@ -179,7 +179,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
179
179
|
promise.reject(it.toThrowable())
|
|
180
180
|
})
|
|
181
181
|
} catch (ex: Exception) {
|
|
182
|
-
promise.reject(VCLError(ex.
|
|
182
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -198,9 +198,9 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
198
198
|
promise.reject(it.toThrowable())
|
|
199
199
|
})
|
|
200
200
|
}
|
|
201
|
-
?: promise.reject(VCLError("Unexpected Credential Credential Manifest Descriptor: $credentialManifestDescriptorMap"))
|
|
201
|
+
?: promise.reject(VCLError("Unexpected Credential Credential Manifest Descriptor: $credentialManifestDescriptorMap").toThrowable())
|
|
202
202
|
} catch (ex: Exception) {
|
|
203
|
-
promise.reject(VCLError(ex.
|
|
203
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -219,7 +219,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
219
219
|
promise.reject(it.toThrowable())
|
|
220
220
|
})
|
|
221
221
|
} catch (ex: Exception) {
|
|
222
|
-
promise.reject(VCLError(ex.
|
|
222
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
@@ -240,7 +240,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
240
240
|
promise.reject(it.toThrowable())
|
|
241
241
|
})
|
|
242
242
|
} catch (ex: Exception) {
|
|
243
|
-
promise.reject(VCLError(ex.
|
|
243
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -261,7 +261,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
261
261
|
promise.reject(it.toThrowable())
|
|
262
262
|
})
|
|
263
263
|
} catch (ex: Exception) {
|
|
264
|
-
promise.reject(VCLError(ex.
|
|
264
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -281,7 +281,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
281
281
|
}
|
|
282
282
|
)
|
|
283
283
|
} catch (ex: Exception) {
|
|
284
|
-
promise.reject(VCLError(ex.
|
|
284
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -299,7 +299,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
299
299
|
promise.reject(it.toThrowable())
|
|
300
300
|
})
|
|
301
301
|
} catch (ex: Exception) {
|
|
302
|
-
promise.reject(VCLError(ex.
|
|
302
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
|
|
@@ -318,7 +318,7 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
318
318
|
promise.reject(it.toThrowable())
|
|
319
319
|
})
|
|
320
320
|
} catch (ex: Exception) {
|
|
321
|
-
promise.reject(VCLError(ex.
|
|
321
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -335,8 +335,8 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
335
335
|
{
|
|
336
336
|
promise.reject(it.toThrowable())
|
|
337
337
|
})
|
|
338
|
-
} catch (
|
|
339
|
-
promise.reject(VCLError(
|
|
338
|
+
} catch (ex: Exception) {
|
|
339
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
@@ -352,8 +352,8 @@ class VclReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
|
352
352
|
{
|
|
353
353
|
promise.reject(it.toThrowable())
|
|
354
354
|
})
|
|
355
|
-
} catch (
|
|
356
|
-
promise.reject(VCLError(
|
|
355
|
+
} catch (ex: Exception) {
|
|
356
|
+
promise.reject(VCLError(ex).toThrowable())
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
}
|
package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/VCLErrorExtensions.kt
CHANGED
|
@@ -10,9 +10,5 @@ package io.velocitycareerlabs.reactnative.extensions
|
|
|
10
10
|
import io.velocitycareerlabs.api.entities.VCLError
|
|
11
11
|
import org.json.JSONObject
|
|
12
12
|
|
|
13
|
-
fun VCLError.toThrowable()
|
|
14
|
-
|
|
15
|
-
msg.putOpt("description", this.description)
|
|
16
|
-
msg.putOpt("code", this.code)
|
|
17
|
-
return Throwable(msg.toString())
|
|
18
|
-
}
|
|
13
|
+
fun VCLError.toThrowable() =
|
|
14
|
+
Throwable(this.toJsonObject().toString())
|
package/ios/VclReactNative.swift
CHANGED
|
@@ -22,7 +22,7 @@ class VclReactNative: NSObject {
|
|
|
22
22
|
resolve("VCL initialization succeed!")
|
|
23
23
|
},
|
|
24
24
|
errorHandler: {
|
|
25
|
-
reject(nil,
|
|
25
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
26
26
|
})
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -33,8 +33,8 @@ class VclReactNative: NSObject {
|
|
|
33
33
|
if let countries = vcl.countries {
|
|
34
34
|
resolve(countriesToDictionary(countries))
|
|
35
35
|
} else {
|
|
36
|
-
let
|
|
37
|
-
reject(nil,
|
|
36
|
+
let message = "Countries not found"
|
|
37
|
+
reject(nil, message, VCLError(message: message))
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -45,8 +45,8 @@ class VclReactNative: NSObject {
|
|
|
45
45
|
if let credentialTypeSchemas = vcl.credentialTypeSchemas {
|
|
46
46
|
resolve(credentialTypeSchemasToDictionary(credentialTypeSchemas))
|
|
47
47
|
} else {
|
|
48
|
-
let
|
|
49
|
-
reject(nil,
|
|
48
|
+
let message = "Credential Type Schemas not found"
|
|
49
|
+
reject(nil, message, VCLError(message: message))
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -57,8 +57,8 @@ class VclReactNative: NSObject {
|
|
|
57
57
|
if let credentialTypes = vcl.credentialTypes {
|
|
58
58
|
resolve(credentialTypesToDictionary(credentialTypes))
|
|
59
59
|
} else {
|
|
60
|
-
let
|
|
61
|
-
reject(nil,
|
|
60
|
+
let message = "Credential Types not found"
|
|
61
|
+
reject(nil, message, VCLError(message: message))
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -73,7 +73,7 @@ class VclReactNative: NSObject {
|
|
|
73
73
|
resolve(presentationRequestToDictionary($0))
|
|
74
74
|
},
|
|
75
75
|
errorHandler: {
|
|
76
|
-
reject(nil,
|
|
76
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
77
77
|
}
|
|
78
78
|
)
|
|
79
79
|
}
|
|
@@ -89,7 +89,7 @@ class VclReactNative: NSObject {
|
|
|
89
89
|
resolve(presentationSubmissionResultToDictionary($0))
|
|
90
90
|
},
|
|
91
91
|
errorHandler: {
|
|
92
|
-
reject(nil,
|
|
92
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -104,7 +104,7 @@ class VclReactNative: NSObject {
|
|
|
104
104
|
resolve(exchangeToDictionary($0))
|
|
105
105
|
},
|
|
106
106
|
errorHandler: {
|
|
107
|
-
reject(nil,
|
|
107
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -119,7 +119,7 @@ class VclReactNative: NSObject {
|
|
|
119
119
|
resolve(organizationsToDictionary($0))
|
|
120
120
|
},
|
|
121
121
|
errorHandler: {
|
|
122
|
-
reject(nil,
|
|
122
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
123
123
|
})
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -135,7 +135,7 @@ class VclReactNative: NSObject {
|
|
|
135
135
|
resolve(credentialManifestToDictionary($0))
|
|
136
136
|
},
|
|
137
137
|
errorHandler: {
|
|
138
|
-
reject(nil,
|
|
138
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
139
139
|
})
|
|
140
140
|
} else {
|
|
141
141
|
reject(nil, "Unexpected Credential Credential Manifest Descriptor: \(credentialManifestDescriptorDictionary)", nil)
|
|
@@ -153,7 +153,7 @@ class VclReactNative: NSObject {
|
|
|
153
153
|
resolve(generatedOffersToDictionary($0))
|
|
154
154
|
},
|
|
155
155
|
errorHandler: {
|
|
156
|
-
reject(nil,
|
|
156
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
157
157
|
})
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -170,7 +170,7 @@ class VclReactNative: NSObject {
|
|
|
170
170
|
resolve(generatedOffersToDictionary($0))
|
|
171
171
|
},
|
|
172
172
|
errorHandler: {
|
|
173
|
-
reject(nil,
|
|
173
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
174
174
|
})
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -187,7 +187,7 @@ class VclReactNative: NSObject {
|
|
|
187
187
|
resolve(jwtVerifiableCredentialsToDictionary($0))
|
|
188
188
|
},
|
|
189
189
|
errorHandler: {
|
|
190
|
-
reject(nil,
|
|
190
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
191
191
|
})
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -202,7 +202,7 @@ class VclReactNative: NSObject {
|
|
|
202
202
|
resolve(credentialTypesFormSchemaToDictionary($0))
|
|
203
203
|
},
|
|
204
204
|
errorHandler: {
|
|
205
|
-
reject(nil,
|
|
205
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
206
206
|
}
|
|
207
207
|
)
|
|
208
208
|
}
|
|
@@ -218,7 +218,7 @@ class VclReactNative: NSObject {
|
|
|
218
218
|
resolve(verifiedProfileToDictionary($0))
|
|
219
219
|
},
|
|
220
220
|
errorHandler: {
|
|
221
|
-
reject(nil,
|
|
221
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
222
222
|
})
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -235,7 +235,7 @@ class VclReactNative: NSObject {
|
|
|
235
235
|
resolve($0)
|
|
236
236
|
},
|
|
237
237
|
errorHandler: {
|
|
238
|
-
reject(nil,
|
|
238
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
239
239
|
})
|
|
240
240
|
}
|
|
241
241
|
|
|
@@ -250,7 +250,7 @@ class VclReactNative: NSObject {
|
|
|
250
250
|
resolve(jwtToReadableMap($0))
|
|
251
251
|
},
|
|
252
252
|
errorHandler: {
|
|
253
|
-
reject(nil,
|
|
253
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
254
254
|
})
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -263,7 +263,7 @@ class VclReactNative: NSObject {
|
|
|
263
263
|
resolve(didJwkToDictionary($0))
|
|
264
264
|
},
|
|
265
265
|
errorHandler: {
|
|
266
|
-
reject(nil,
|
|
266
|
+
reject(nil, $0.toDictionary().toJsonString(), $0)
|
|
267
267
|
})
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VclApi = void 0;
|
|
7
|
-
var _VCLError = require("./entities/VCLError");
|
|
8
7
|
var _reactNative = require("react-native");
|
|
8
|
+
var _VCLError = require("./entities/VCLError");
|
|
9
9
|
/**
|
|
10
10
|
* Created by Michael Avoyan.
|
|
11
11
|
*
|
|
@@ -21,119 +21,119 @@ const VclApi = {
|
|
|
21
21
|
try {
|
|
22
22
|
return await VclReactNative.initialize(initializationDescriptor);
|
|
23
23
|
} catch (e) {
|
|
24
|
-
throw
|
|
24
|
+
throw new _VCLError.VCLError(e);
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
getCountries: async () => {
|
|
28
28
|
try {
|
|
29
29
|
return await VclReactNative.getCountries();
|
|
30
30
|
} catch (e) {
|
|
31
|
-
throw
|
|
31
|
+
throw new _VCLError.VCLError(e);
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
getCredentialTypes: async () => {
|
|
35
35
|
try {
|
|
36
36
|
return await VclReactNative.getCredentialTypes();
|
|
37
37
|
} catch (e) {
|
|
38
|
-
throw
|
|
38
|
+
throw new _VCLError.VCLError(e);
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
getCredentialTypeSchemas: async () => {
|
|
42
42
|
try {
|
|
43
43
|
return await VclReactNative.getCredentialTypeSchemas();
|
|
44
44
|
} catch (e) {
|
|
45
|
-
throw
|
|
45
|
+
throw new _VCLError.VCLError(e);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
getPresentationRequest: async presentationRequestDescriptor => {
|
|
49
49
|
try {
|
|
50
50
|
return await VclReactNative.getPresentationRequest(presentationRequestDescriptor);
|
|
51
51
|
} catch (e) {
|
|
52
|
-
throw
|
|
52
|
+
throw new _VCLError.VCLError(e);
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
submitPresentation: async presentationSubmission => {
|
|
56
56
|
try {
|
|
57
57
|
return await VclReactNative.submitPresentation(presentationSubmission);
|
|
58
58
|
} catch (e) {
|
|
59
|
-
throw
|
|
59
|
+
throw new _VCLError.VCLError(e);
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
getExchangeProgress: async exchangeDescriptor => {
|
|
63
63
|
try {
|
|
64
64
|
return await VclReactNative.getExchangeProgress(exchangeDescriptor);
|
|
65
65
|
} catch (e) {
|
|
66
|
-
throw
|
|
66
|
+
throw new _VCLError.VCLError(e);
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
searchForOrganizations: async organizationsSearchDescriptor => {
|
|
70
70
|
try {
|
|
71
71
|
return await VclReactNative.searchForOrganizations(organizationsSearchDescriptor);
|
|
72
72
|
} catch (e) {
|
|
73
|
-
throw
|
|
73
|
+
throw new _VCLError.VCLError(e);
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
getCredentialManifest: async credentialManifestDescriptor => {
|
|
77
77
|
try {
|
|
78
78
|
return await VclReactNative.getCredentialManifest(credentialManifestDescriptor);
|
|
79
79
|
} catch (e) {
|
|
80
|
-
throw
|
|
80
|
+
throw new _VCLError.VCLError(e);
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
generateOffers: async generateOffersDescriptor => {
|
|
84
84
|
try {
|
|
85
85
|
return await VclReactNative.generateOffers(generateOffersDescriptor);
|
|
86
86
|
} catch (e) {
|
|
87
|
-
throw
|
|
87
|
+
throw new _VCLError.VCLError(e);
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
checkForOffers: async (generateOffersDescriptor, token) => {
|
|
91
91
|
try {
|
|
92
92
|
return await VclReactNative.checkForOffers(generateOffersDescriptor, token);
|
|
93
93
|
} catch (e) {
|
|
94
|
-
throw
|
|
94
|
+
throw new _VCLError.VCLError(e);
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
finalizeOffers: async (finalizeOffersDescriptor, token) => {
|
|
98
98
|
try {
|
|
99
99
|
return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, token);
|
|
100
100
|
} catch (e) {
|
|
101
|
-
throw
|
|
101
|
+
throw new _VCLError.VCLError(e);
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
getCredentialTypesUIFormSchema: async credentialTypesUIFormSchemaDescriptor => {
|
|
105
105
|
try {
|
|
106
106
|
return await VclReactNative.getCredentialTypesUIFormSchema(credentialTypesUIFormSchemaDescriptor);
|
|
107
107
|
} catch (e) {
|
|
108
|
-
throw
|
|
108
|
+
throw new _VCLError.VCLError(e);
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
getVerifiedProfile: async verifiedProfileDescriptor => {
|
|
112
112
|
try {
|
|
113
113
|
return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);
|
|
114
114
|
} catch (e) {
|
|
115
|
-
throw
|
|
115
|
+
throw new _VCLError.VCLError(e);
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
verifyJwt: async (jwt, jwkPublic) => {
|
|
119
119
|
try {
|
|
120
120
|
return await VclReactNative.verifyJwt(jwt, jwkPublic);
|
|
121
121
|
} catch (e) {
|
|
122
|
-
throw
|
|
122
|
+
throw new _VCLError.VCLError(e);
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
generateSignedJwt: async jwtDescriptor => {
|
|
126
126
|
try {
|
|
127
127
|
return await VclReactNative.generateSignedJwt(jwtDescriptor);
|
|
128
128
|
} catch (e) {
|
|
129
|
-
throw
|
|
129
|
+
throw new _VCLError.VCLError(e);
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
generateDidJwk: async () => {
|
|
133
133
|
try {
|
|
134
134
|
return await VclReactNative.generateDidJwk();
|
|
135
135
|
} catch (e) {
|
|
136
|
-
throw
|
|
136
|
+
throw new _VCLError.VCLError(e);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VclReactNative","NativeModules","VclApi","initialize","initializationDescriptor","e","toVclError","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","token","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","generateSignedJwt","jwtDescriptor","generateDidJwk"],"sources":["VCLApi.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialTypeSchemas } from './entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchema } from './entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLExchange } from './entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './entities/VCLExchangeDescriptor';\nimport type { VCLFinalizeOffersDescriptor } from './entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './entities/VCLOffers';\nimport type { VCLOrganizations } from './entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPresentationRequest } from './entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './entities/VCLJwkPublic';\nimport type { VCLToken } from './entities/VCLToken';\nimport type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';\nimport type { VCLCountries } from './entities/VCLCountries';\nimport type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';\nimport type { VCLSubmissionResult } from './entities/VCLSubmissionResult';\nimport type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './entities/VCLDidJwk';\nimport { toVclError } from './entities/VCLError';\nimport type { VCLCredentialTypes } from './entities/VCLCredentialTypes';\n\nimport { NativeModules } from 'react-native';\nconst { VclReactNative } = NativeModules;\n\nexport const VclApi = {\n initialize: async (\n initializationDescriptor: VCLInitializationDescriptor\n ): Promise<void> => {\n try {\n return await VclReactNative.initialize(initializationDescriptor);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getCountries: async (): Promise<VCLCountries> => {\n try {\n return await VclReactNative.getCountries();\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getCredentialTypes: async (): Promise<VCLCredentialTypes> => {\n try {\n return await VclReactNative.getCredentialTypes();\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getCredentialTypeSchemas: async (): Promise<VCLCredentialTypeSchemas> => {\n try {\n return await VclReactNative.getCredentialTypeSchemas();\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getPresentationRequest: async (\n presentationRequestDescriptor: VCLPresentationRequestDescriptor\n ): Promise<VCLPresentationRequest> => {\n try {\n return await VclReactNative.getPresentationRequest(\n presentationRequestDescriptor\n );\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n submitPresentation: async (\n presentationSubmission: VCLPresentationSubmission\n ): Promise<VCLSubmissionResult> => {\n try {\n return await VclReactNative.submitPresentation(presentationSubmission);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getExchangeProgress: async (\n exchangeDescriptor: VCLExchangeDescriptor\n ): Promise<VCLExchange> => {\n try {\n return await VclReactNative.getExchangeProgress(exchangeDescriptor);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n searchForOrganizations: async (\n organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor\n ): Promise<VCLOrganizations> => {\n try {\n return await VclReactNative.searchForOrganizations(\n organizationsSearchDescriptor\n );\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getCredentialManifest: async (\n credentialManifestDescriptor: VCLCredentialManifestDescriptor\n ): Promise<VCLCredentialManifest> => {\n try {\n return await VclReactNative.getCredentialManifest(\n credentialManifestDescriptor\n );\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n generateOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.generateOffers(generateOffersDescriptor);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n checkForOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n token: VCLToken\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.checkForOffers(\n generateOffersDescriptor,\n token\n );\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n finalizeOffers: async (\n finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,\n token: VCLToken\n ): Promise<VCLJwtVerifiableCredentials> => {\n try {\n return await VclReactNative.finalizeOffers(\n finalizeOffersDescriptor,\n token\n );\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getCredentialTypesUIFormSchema: async (\n credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor\n ): Promise<VCLCredentialTypesUIFormSchema> => {\n try {\n return await VclReactNative.getCredentialTypesUIFormSchema(\n credentialTypesUIFormSchemaDescriptor\n );\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n getVerifiedProfile: async (\n verifiedProfileDescriptor: VCLVerifiedProfileDescriptor\n ): Promise<VCLVerifiedProfile> => {\n try {\n return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n verifyJwt: async (jwt: VCLJwt, jwkPublic: VCLJwkPublic): Promise<boolean> => {\n try {\n return await VclReactNative.verifyJwt(jwt, jwkPublic);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n generateSignedJwt: async (\n jwtDescriptor: VCLJwtDescriptor\n ): Promise<VCLJwt> => {\n try {\n return await VclReactNative.generateSignedJwt(jwtDescriptor);\n } catch (e) {\n throw toVclError(e);\n }\n },\n\n generateDidJwk: async (): Promise<VCLDidJwk> => {\n try {\n return await VclReactNative.generateDidJwk();\n } catch (e) {\n throw toVclError(e);\n }\n },\n};\n"],"mappings":";;;;;;AAiCA;AAGA;AApCA;AACA;AACA;AACA;AACA;AACA;;AAgCA,MAAM;EAAEA;AAAe,CAAC,GAAGC,0BAAa;AAEjC,MAAMC,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAMJ,cAAc,CAACG,UAAU,CAACC,wBAAwB,CAAC;IAClE,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,MAAM,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;EACF,CAAC;EAEDE,YAAY,EAAE,YAAmC;IAC/C,IAAI;MACF,OAAO,MAAMP,cAAc,CAACO,YAAY,EAAE;IAC5C,CAAC,CAAC,OAAOF,CAAC,EAAE;MACV,MAAM,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;EACF,CAAC;EAEDG,kBAAkB,EAAE,YAAyC;IAC3D,IAAI;MACF,OAAO,MAAMR,cAAc,CAACQ,kBAAkB,EAAE;IAClD,CAAC,CAAC,OAAOH,CAAC,EAAE;MACV,MAAM,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;EACF,CAAC;EAEDI,wBAAwB,EAAE,YAA+C;IACvE,IAAI;MACF,OAAO,MAAMT,cAAc,CAACS,wBAAwB,EAAE;IACxD,CAAC,CAAC,OAAOJ,CAAC,EAAE;MACV,MAAM,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;EACF,CAAC;EAEDK,sBAAsB,EAAE,MACtBC,6BAA+D,IAC3B;IACpC,IAAI;MACF,OAAO,MAA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Aa,CAAC;IAC9D,CAAC,CAAC,OAAO7B,CAAC,EAAE;MACV,MAAM,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;EACF,CAAC;EAED8B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMnC,cAAc,CAACmC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;EACF;AACF,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["VclReactNative","NativeModules","VclApi","initialize","initializationDescriptor","e","VCLError","getCountries","getCredentialTypes","getCredentialTypeSchemas","getPresentationRequest","presentationRequestDescriptor","submitPresentation","presentationSubmission","getExchangeProgress","exchangeDescriptor","searchForOrganizations","organizationsSearchDescriptor","getCredentialManifest","credentialManifestDescriptor","generateOffers","generateOffersDescriptor","checkForOffers","token","finalizeOffers","finalizeOffersDescriptor","getCredentialTypesUIFormSchema","credentialTypesUIFormSchemaDescriptor","getVerifiedProfile","verifiedProfileDescriptor","verifyJwt","jwt","jwkPublic","generateSignedJwt","jwtDescriptor","generateDidJwk"],"sources":["VCLApi.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLCredentialManifest } from './entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialTypeSchemas } from './entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchema } from './entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLExchange } from './entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './entities/VCLExchangeDescriptor';\nimport type { VCLFinalizeOffersDescriptor } from './entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './entities/VCLOffers';\nimport type { VCLOrganizations } from './entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPresentationRequest } from './entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './entities/VCLJwkPublic';\nimport type { VCLToken } from './entities/VCLToken';\nimport type { VCLVerifiedProfile } from './entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './entities/VCLVerifiedProfileDescriptor';\nimport type { VCLCountries } from './entities/VCLCountries';\nimport type { VCLInitializationDescriptor } from './entities/VCLInitializationDescriptor';\nimport type { VCLSubmissionResult } from './entities/VCLSubmissionResult';\nimport type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './entities/VCLDidJwk';\nimport type { VCLCredentialTypes } from './entities/VCLCredentialTypes';\n\nimport { NativeModules } from 'react-native';\nimport { VCLError } from './entities/VCLError';\nconst { VclReactNative } = NativeModules;\n\nexport const VclApi = {\n initialize: async (\n initializationDescriptor: VCLInitializationDescriptor\n ): Promise<void> => {\n try {\n return await VclReactNative.initialize(initializationDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCountries: async (): Promise<VCLCountries> => {\n try {\n return await VclReactNative.getCountries();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypes: async (): Promise<VCLCredentialTypes> => {\n try {\n return await VclReactNative.getCredentialTypes();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypeSchemas: async (): Promise<VCLCredentialTypeSchemas> => {\n try {\n return await VclReactNative.getCredentialTypeSchemas();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getPresentationRequest: async (\n presentationRequestDescriptor: VCLPresentationRequestDescriptor\n ): Promise<VCLPresentationRequest> => {\n try {\n return await VclReactNative.getPresentationRequest(\n presentationRequestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n submitPresentation: async (\n presentationSubmission: VCLPresentationSubmission\n ): Promise<VCLSubmissionResult> => {\n try {\n return await VclReactNative.submitPresentation(presentationSubmission);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getExchangeProgress: async (\n exchangeDescriptor: VCLExchangeDescriptor\n ): Promise<VCLExchange> => {\n try {\n return await VclReactNative.getExchangeProgress(exchangeDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n searchForOrganizations: async (\n organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor\n ): Promise<VCLOrganizations> => {\n try {\n return await VclReactNative.searchForOrganizations(\n organizationsSearchDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialManifest: async (\n credentialManifestDescriptor: VCLCredentialManifestDescriptor\n ): Promise<VCLCredentialManifest> => {\n try {\n return await VclReactNative.getCredentialManifest(\n credentialManifestDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.generateOffers(generateOffersDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n checkForOffers: async (\n generateOffersDescriptor: VCLGenerateOffersDescriptor,\n token: VCLToken\n ): Promise<VCLOffers> => {\n try {\n return await VclReactNative.checkForOffers(\n generateOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n finalizeOffers: async (\n finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,\n token: VCLToken\n ): Promise<VCLJwtVerifiableCredentials> => {\n try {\n return await VclReactNative.finalizeOffers(\n finalizeOffersDescriptor,\n token\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getCredentialTypesUIFormSchema: async (\n credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor\n ): Promise<VCLCredentialTypesUIFormSchema> => {\n try {\n return await VclReactNative.getCredentialTypesUIFormSchema(\n credentialTypesUIFormSchemaDescriptor\n );\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n getVerifiedProfile: async (\n verifiedProfileDescriptor: VCLVerifiedProfileDescriptor\n ): Promise<VCLVerifiedProfile> => {\n try {\n return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n verifyJwt: async (jwt: VCLJwt, jwkPublic: VCLJwkPublic): Promise<boolean> => {\n try {\n return await VclReactNative.verifyJwt(jwt, jwkPublic);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateSignedJwt: async (\n jwtDescriptor: VCLJwtDescriptor\n ): Promise<VCLJwt> => {\n try {\n return await VclReactNative.generateSignedJwt(jwtDescriptor);\n } catch (e) {\n throw new VCLError(e);\n }\n },\n\n generateDidJwk: async (): Promise<VCLDidJwk> => {\n try {\n return await VclReactNative.generateDidJwk();\n } catch (e) {\n throw new VCLError(e);\n }\n },\n};\n"],"mappings":";;;;;;AAmCA;AACA;AApCA;AACA;AACA;AACA;AACA;AACA;;AAgCA,MAAM;EAAEA;AAAe,CAAC,GAAGC,0BAAa;AAEjC,MAAMC,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAMJ,cAAc,CAACG,UAAU,CAACC,wBAAwB,CAAC;IAClE,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDE,YAAY,EAAE,YAAmC;IAC/C,IAAI;MACF,OAAO,MAAMP,cAAc,CAACO,YAAY,EAAE;IAC5C,CAA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EAAE,MAClBC,yBAAuD,IACvB;IAChC,IAAI;MACF,OAAO,MAAM7B,cAAc,CAAC4B,kBAAkB,CAACC,yBAAyB,CAAC;IAC3E,CAAC,CAAC,OAAOxB,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAEDyB,SAAS,EAAE,OAAOC,GAAW,EAAEC,SAAuB,KAAuB;IAC3E,IAAI;MACF,OAAO,MAAMhC,cAAc,CAAC8B,SAAS,CAACC,GAAG,EAAEC,SAAS,CAAC;IACvD,CAAC,CAAC,OAAO3B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED4B,iBAAiB,EAAE,MACjBC,aAA+B,IACX;IACpB,IAAI;MACF,OAAO,MAAMlC,cAAc,CAACiC,iBAAiB,CAACC,aAAa,CAAC;IAC9D,CAAC,CAAC,OAAO7B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF,CAAC;EAED8B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMnC,cAAc,CAACmC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO9B,CAAC,EAAE;MACV,MAAM,IAAIC,kBAAQ,CAACD,CAAC,CAAC;IACvB;EACF;AACF,CAAC;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["VCLCredentialManifestDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLPushDelegate } from './VCLPushDelegate';\nimport type {
|
|
1
|
+
{"version":3,"names":[],"sources":["VCLCredentialManifestDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLPushDelegate } from './VCLPushDelegate';\nimport type { VCLIssuingType } from './VCLIssuingType';\n\nexport interface VCLCredentialManifestDescriptor {\n issuingType?: VCLIssuingType;\n credentialTypes?: string[];\n pushDelegate?: VCLPushDelegate;\n}\n"],"mappings":""}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VCLError = void 0;
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
8
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
9
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -17,20 +17,21 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
17
17
|
class VCLError extends Error {
|
|
18
18
|
constructor(error) {
|
|
19
19
|
super(error);
|
|
20
|
-
_defineProperty(this, "
|
|
21
|
-
_defineProperty(this, "
|
|
20
|
+
_defineProperty(this, "payload", void 0);
|
|
21
|
+
_defineProperty(this, "error", void 0);
|
|
22
|
+
_defineProperty(this, "errorCode", void 0);
|
|
23
|
+
_defineProperty(this, "statusCode", void 0);
|
|
22
24
|
try {
|
|
23
25
|
const errorJson = JSON.parse(error.message);
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
+
this.payload = errorJson.payload;
|
|
27
|
+
this.error = errorJson.error;
|
|
28
|
+
this.errorCode = errorJson.errorCode;
|
|
29
|
+
this.message = errorJson.message;
|
|
30
|
+
this.statusCode = parseInt(errorJson.statusCode, 10);
|
|
26
31
|
} catch (e) {
|
|
27
|
-
this.
|
|
32
|
+
this.message = JSON.stringify(error);
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
exports.VCLError = VCLError;
|
|
32
|
-
const toVclError = error => {
|
|
33
|
-
return new VCLError(error);
|
|
34
|
-
};
|
|
35
|
-
exports.toVclError = toVclError;
|
|
36
37
|
//# sourceMappingURL=VCLError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VCLError","Error","constructor","error","errorJson","JSON","parse","message","
|
|
1
|
+
{"version":3,"names":["VCLError","Error","constructor","error","errorJson","JSON","parse","message","payload","errorCode","statusCode","parseInt","e","stringify"],"sources":["VCLError.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class VCLError extends Error {\n payload?: string;\n error?: string;\n errorCode?: string;\n statusCode?: number;\n\n constructor(error: any) {\n super(error);\n try {\n const errorJson = JSON.parse(error.message);\n this.payload = errorJson.payload;\n this.error = errorJson.error;\n this.errorCode = errorJson.errorCode;\n this.message = errorJson.message;\n this.statusCode = parseInt(errorJson.statusCode, 10);\n } catch (e) {\n this.message = JSON.stringify(error);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,QAAQ,SAASC,KAAK,CAAC;EAMlCC,WAAW,CAACC,KAAU,EAAE;IACtB,KAAK,CAACA,KAAK,CAAC;IAAC;IAAA;IAAA;IAAA;IACb,IAAI;MACF,MAAMC,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,OAAO,CAAC;MAC3C,IAAI,CAACC,OAAO,GAAGJ,SAAS,CAACI,OAAO;MAChC,IAAI,CAACL,KAAK,GAAGC,SAAS,CAACD,KAAK;MAC5B,IAAI,CAACM,SAAS,GAAGL,SAAS,CAACK,SAAS;MACpC,IAAI,CAACF,OAAO,GAAGH,SAAS,CAACG,OAAO;MAChC,IAAI,CAACG,UAAU,GAAGC,QAAQ,CAACP,SAAS,CAACM,UAAU,EAAE,EAAE,CAAC;IACtD,CAAC,CAAC,OAAOE,CAAC,EAAE;MACV,IAAI,CAACL,OAAO,GAAGF,IAAI,CAACQ,SAAS,CAACV,KAAK,CAAC;IACtC;EACF;AACF;AAAC"}
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VCLIssuingType = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Created by Michael Avoyan.
|
|
9
9
|
*
|
|
10
10
|
* Copyright 2022 Velocity Career Labs inc.
|
|
11
11
|
* SPDX-License-Identifier: Apache-2.0
|
|
12
12
|
*/
|
|
13
|
-
let
|
|
14
|
-
exports.
|
|
15
|
-
(function (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})(
|
|
13
|
+
let VCLIssuingType;
|
|
14
|
+
exports.VCLIssuingType = VCLIssuingType;
|
|
15
|
+
(function (VCLIssuingType) {
|
|
16
|
+
VCLIssuingType["Career"] = "Career";
|
|
17
|
+
VCLIssuingType["Identity"] = "Identity";
|
|
18
|
+
VCLIssuingType["Refresh"] = "Refresh";
|
|
19
|
+
VCLIssuingType["Undefined"] = "Undefined";
|
|
20
|
+
})(VCLIssuingType || (exports.VCLIssuingType = VCLIssuingType = {}));
|
|
21
21
|
//# sourceMappingURL=VCLIssuingType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["VCLIssuingType"],"sources":["VCLIssuingType.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport enum VCLIssuingType {\n Career = 'Career',\n Identity = 'Identity',\n Refresh = 'Refresh',\n Undefined = 'Undefined',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AALA,IAOYA,cAAc;AAAA;AAAA,WAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,8BAAdA,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["VCLPresentationRequestDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLDeepLink } from './VCLDeepLink';\nimport type { VCLPushDelegate } from './VCLPushDelegate';\
|
|
1
|
+
{"version":3,"names":[],"sources":["VCLPresentationRequestDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { VCLDeepLink } from './VCLDeepLink';\nimport type { VCLPushDelegate } from './VCLPushDelegate';\n\nexport interface VCLPresentationRequestDescriptor {\n deepLink: VCLDeepLink;\n pushDelegate?: VCLPushDelegate;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["VCLVerifiedProfileDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\
|
|
1
|
+
{"version":3,"names":[],"sources":["VCLVerifiedProfileDescriptor.ts"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface VCLVerifiedProfileDescriptor {\n did: string;\n}\n"],"mappings":""}
|