@velocitycareerlabs/vcl-react-native 1.8.1 → 1.9.1
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/VCLError.js +11 -10
- package/lib/commonjs/api/entities/VCLError.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/VCLError.js +10 -8
- package/lib/module/api/entities/VCLError.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/api/entities/VCLError.d.ts +4 -3
- package/lib/typescript/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/api/VCLApi.ts +18 -18
- package/src/api/entities/VCLError.ts +10 -9
- package/src/index.tsx +1 -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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B;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,IAAAC,oBAAU,EAACD,CAAC,CAAC;IACrB;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,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;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|
|
|
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"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "VCLEnvTypes", {
|
|
|
15
15
|
return _VCLEnvironment.VCLEnvTypes;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "VCLError", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _VCLError.VCLError;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "VCLErrorCode", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function () {
|
|
@@ -40,6 +46,7 @@ var _VCLCountries = require("./api/entities/VCLCountries");
|
|
|
40
46
|
var _VCLServiceType = require("./api/entities/VCLServiceType");
|
|
41
47
|
var _VCLIssuingType = require("./api/entities/VCLIssuingType");
|
|
42
48
|
var _VCLErrorCode = require("./api/entities/VCLErrorCode");
|
|
49
|
+
var _VCLError = require("./api/entities/VCLError");
|
|
43
50
|
/**
|
|
44
51
|
* Created by Michael Avoyan.
|
|
45
52
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VclApi"],"sources":["index.tsx"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypes } from './api/entities/VCLCredentialTypes';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './api/entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './api/entities/VCLJwkPublic';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLServiceTypes } from './api/entities/VCLServiceTypes';\nimport { VCLIssuingType } from './api/entities/VCLIssuingType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './api/entities/VCLDidJwk';\nimport { VCLErrorCode } from './api/entities/VCLErrorCode';\nimport
|
|
1
|
+
{"version":3,"names":["VclApi"],"sources":["index.tsx"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypes } from './api/entities/VCLCredentialTypes';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './api/entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './api/entities/VCLJwkPublic';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLServiceTypes } from './api/entities/VCLServiceTypes';\nimport { VCLIssuingType } from './api/entities/VCLIssuingType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './api/entities/VCLDidJwk';\nimport { VCLErrorCode } from './api/entities/VCLErrorCode';\nimport { VCLError } from './api/entities/VCLError';\n\nexport default VclApi;\nexport {\n Dictionary,\n VCLEnvironment,\n VCLEnvTypes,\n VCLCountry,\n VCLCountries,\n VCLCountryCodes,\n VCLRegion,\n VCLRegions,\n VCLCredentialManifest,\n VCLCredentialManifestDescriptor,\n VCLCredentialManifestDescriptorByDeepLink,\n VCLCredentialManifestDescriptorByService,\n VCLCredentialType,\n VCLCredentialTypes,\n VCLCredentialTypeSchema,\n VCLCredentialTypeSchemas,\n VCLCredentialTypesUIFormSchema,\n VCLCredentialTypesUIFormSchemaDescriptor,\n VCLCredentialManifestDescriptorRefresh,\n VCLDeepLink,\n VCLExchange,\n VCLExchangeDescriptor,\n VCLFilter,\n VCLFinalizeOffersDescriptor,\n VCLGenerateOffersDescriptor,\n VCLJwt,\n VCLJwtVerifiableCredentials,\n VCLOffers,\n VCLOrganization,\n VCLOrganizations,\n VCLOrganizationsSearchDescriptor,\n VCLPage,\n VCLPresentationRequest,\n VCLPresentationSubmission,\n VCLJwkPublic,\n VCLPushDelegate,\n VCLService,\n VCLServiceCredentialAgentIssuer,\n VCLServiceType,\n VCLServiceTypes,\n VCLIssuingType,\n VCLSubmissionResult,\n VCLToken,\n VCLVerifiableCredential,\n VCLVerifiedProfile,\n VCLVerifiedProfileDescriptor,\n VCLInitializationDescriptor,\n VCLPresentationRequestDescriptor,\n VCLJwtDescriptor,\n VCLDidJwk,\n VCLErrorCode,\n VCLError,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;AAEA;AAGA;AAiCA;AAEA;AAWA;AACA;AA3DA;AACA;AACA;AACA;AACA;AACA;AALA,eA6DeA,cAAM;AAAA"}
|
package/lib/module/api/VCLApi.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { toVclError } from './entities/VCLError';
|
|
9
8
|
import { NativeModules } from 'react-native';
|
|
9
|
+
import { VCLError } from './entities/VCLError';
|
|
10
10
|
const {
|
|
11
11
|
VclReactNative
|
|
12
12
|
} = NativeModules;
|
|
@@ -15,119 +15,119 @@ export const VclApi = {
|
|
|
15
15
|
try {
|
|
16
16
|
return await VclReactNative.initialize(initializationDescriptor);
|
|
17
17
|
} catch (e) {
|
|
18
|
-
throw
|
|
18
|
+
throw new VCLError(e);
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
getCountries: async () => {
|
|
22
22
|
try {
|
|
23
23
|
return await VclReactNative.getCountries();
|
|
24
24
|
} catch (e) {
|
|
25
|
-
throw
|
|
25
|
+
throw new VCLError(e);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
getCredentialTypes: async () => {
|
|
29
29
|
try {
|
|
30
30
|
return await VclReactNative.getCredentialTypes();
|
|
31
31
|
} catch (e) {
|
|
32
|
-
throw
|
|
32
|
+
throw new VCLError(e);
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
getCredentialTypeSchemas: async () => {
|
|
36
36
|
try {
|
|
37
37
|
return await VclReactNative.getCredentialTypeSchemas();
|
|
38
38
|
} catch (e) {
|
|
39
|
-
throw
|
|
39
|
+
throw new VCLError(e);
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
getPresentationRequest: async presentationRequestDescriptor => {
|
|
43
43
|
try {
|
|
44
44
|
return await VclReactNative.getPresentationRequest(presentationRequestDescriptor);
|
|
45
45
|
} catch (e) {
|
|
46
|
-
throw
|
|
46
|
+
throw new VCLError(e);
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
submitPresentation: async presentationSubmission => {
|
|
50
50
|
try {
|
|
51
51
|
return await VclReactNative.submitPresentation(presentationSubmission);
|
|
52
52
|
} catch (e) {
|
|
53
|
-
throw
|
|
53
|
+
throw new VCLError(e);
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
getExchangeProgress: async exchangeDescriptor => {
|
|
57
57
|
try {
|
|
58
58
|
return await VclReactNative.getExchangeProgress(exchangeDescriptor);
|
|
59
59
|
} catch (e) {
|
|
60
|
-
throw
|
|
60
|
+
throw new VCLError(e);
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
searchForOrganizations: async organizationsSearchDescriptor => {
|
|
64
64
|
try {
|
|
65
65
|
return await VclReactNative.searchForOrganizations(organizationsSearchDescriptor);
|
|
66
66
|
} catch (e) {
|
|
67
|
-
throw
|
|
67
|
+
throw new VCLError(e);
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
getCredentialManifest: async credentialManifestDescriptor => {
|
|
71
71
|
try {
|
|
72
72
|
return await VclReactNative.getCredentialManifest(credentialManifestDescriptor);
|
|
73
73
|
} catch (e) {
|
|
74
|
-
throw
|
|
74
|
+
throw new VCLError(e);
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
generateOffers: async generateOffersDescriptor => {
|
|
78
78
|
try {
|
|
79
79
|
return await VclReactNative.generateOffers(generateOffersDescriptor);
|
|
80
80
|
} catch (e) {
|
|
81
|
-
throw
|
|
81
|
+
throw new VCLError(e);
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
checkForOffers: async (generateOffersDescriptor, token) => {
|
|
85
85
|
try {
|
|
86
86
|
return await VclReactNative.checkForOffers(generateOffersDescriptor, token);
|
|
87
87
|
} catch (e) {
|
|
88
|
-
throw
|
|
88
|
+
throw new VCLError(e);
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
finalizeOffers: async (finalizeOffersDescriptor, token) => {
|
|
92
92
|
try {
|
|
93
93
|
return await VclReactNative.finalizeOffers(finalizeOffersDescriptor, token);
|
|
94
94
|
} catch (e) {
|
|
95
|
-
throw
|
|
95
|
+
throw new VCLError(e);
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
getCredentialTypesUIFormSchema: async credentialTypesUIFormSchemaDescriptor => {
|
|
99
99
|
try {
|
|
100
100
|
return await VclReactNative.getCredentialTypesUIFormSchema(credentialTypesUIFormSchemaDescriptor);
|
|
101
101
|
} catch (e) {
|
|
102
|
-
throw
|
|
102
|
+
throw new VCLError(e);
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
getVerifiedProfile: async verifiedProfileDescriptor => {
|
|
106
106
|
try {
|
|
107
107
|
return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);
|
|
108
108
|
} catch (e) {
|
|
109
|
-
throw
|
|
109
|
+
throw new VCLError(e);
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
verifyJwt: async (jwt, jwkPublic) => {
|
|
113
113
|
try {
|
|
114
114
|
return await VclReactNative.verifyJwt(jwt, jwkPublic);
|
|
115
115
|
} catch (e) {
|
|
116
|
-
throw
|
|
116
|
+
throw new VCLError(e);
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
generateSignedJwt: async jwtDescriptor => {
|
|
120
120
|
try {
|
|
121
121
|
return await VclReactNative.generateSignedJwt(jwtDescriptor);
|
|
122
122
|
} catch (e) {
|
|
123
|
-
throw
|
|
123
|
+
throw new VCLError(e);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
generateDidJwk: async () => {
|
|
127
127
|
try {
|
|
128
128
|
return await VclReactNative.generateDidJwk();
|
|
129
129
|
} catch (e) {
|
|
130
|
-
throw
|
|
130
|
+
throw new VCLError(e);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["toVclError","NativeModules","VclReactNative","VclApi","initialize","initializationDescriptor","e","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":"AAAA;AACA;AACA;AACA;AACA;AACA;;AA4BA,SAASA,UAAU,QAAQ,qBAAqB;AAGhD,SAASC,aAAa,QAAQ,cAAc;AAC5C,MAAM;EAAEC;AAAe,CAAC,GAAGD,aAAa;AAExC,OAAO,MAAME,MAAM,GAAG;EACpBC,UAAU,EAAE,MACVC,wBAAqD,IACnC;IAClB,IAAI;MACF,OAAO,MAAMH,cAAc,CAACE,UAAU,CAACC,wBAAwB,CAAC;IAClE,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,MAAMN,UAAU,CAACM,CAAC,CAAC;IACrB;EACF,CAAC;EAEDC,YAAY,EAAE,YAAmC;IAC/C,IAAI;MACF,OAAO,MAAML,cAAc,CAACK,YAAY,EAAE;IAC5C,CAAC,CAAC,OAAOD,CAAC,EAAE;MACV,MAAMN,UAAU,CAACM,CAAC,CA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CAAC,CAAC;IACrB;EACF,CAAC;EAEDwB,SAAS,EAAE,OAAOC,GAAW,EAAEC,SAAuB,KAAuB;IAC3E,IAAI;MACF,OAAO,MAAM9B,cAAc,CAAC4B,SAAS,CAACC,GAAG,EAAEC,SAAS,CAAC;IACvD,CAAC,CAAC,OAAO1B,CAAC,EAAE;MACV,MAAMN,UAAU,CAACM,CAAC,CAAC;IACrB;EACF,CAAC;EAED2B,iBAAiB,EAAE,MACjBC,aAA+B,IACX;IACpB,IAAI;MACF,OAAO,MAAMhC,cAAc,CAAC+B,iBAAiB,CAACC,aAAa,CAAC;IAC9D,CAAC,CAAC,OAAO5B,CAAC,EAAE;MACV,MAAMN,UAAU,CAACM,CAAC,CAAC;IACrB;EACF,CAAC;EAED6B,cAAc,EAAE,YAAgC;IAC9C,IAAI;MACF,OAAO,MAAMjC,cAAc,CAACiC,cAAc,EAAE;IAC9C,CAAC,CAAC,OAAO7B,CAAC,EAAE;MACV,MAAMN,UAAU,CAACM,CAAC,CAAC;IACrB;EACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["NativeModules","VCLError","VclReactNative","VclApi","initialize","initializationDescriptor","e","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":"AAAA;AACA;AACA;AACA;AACA;AACA;;AA8BA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,QAA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 +11,20 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
11
11
|
export class VCLError extends Error {
|
|
12
12
|
constructor(error) {
|
|
13
13
|
super(error);
|
|
14
|
-
_defineProperty(this, "
|
|
15
|
-
_defineProperty(this, "
|
|
14
|
+
_defineProperty(this, "payload", void 0);
|
|
15
|
+
_defineProperty(this, "error", void 0);
|
|
16
|
+
_defineProperty(this, "errorCode", void 0);
|
|
17
|
+
_defineProperty(this, "statusCode", void 0);
|
|
16
18
|
try {
|
|
17
19
|
const errorJson = JSON.parse(error.message);
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
+
this.payload = errorJson.payload;
|
|
21
|
+
this.error = errorJson.error;
|
|
22
|
+
this.errorCode = errorJson.errorCode;
|
|
23
|
+
this.message = errorJson.message;
|
|
24
|
+
this.statusCode = parseInt(errorJson.statusCode, 10);
|
|
20
25
|
} catch (e) {
|
|
21
|
-
this.
|
|
26
|
+
this.message = JSON.stringify(error);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
|
-
export const toVclError = error => {
|
|
26
|
-
return new VCLError(error);
|
|
27
|
-
};
|
|
28
30
|
//# 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;;AAEA,OAAO,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"}
|
package/lib/module/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { VCLCountryCodes } from './api/entities/VCLCountries';
|
|
|
11
11
|
import { VCLServiceType } from './api/entities/VCLServiceType';
|
|
12
12
|
import { VCLIssuingType } from './api/entities/VCLIssuingType';
|
|
13
13
|
import { VCLErrorCode } from './api/entities/VCLErrorCode';
|
|
14
|
+
import { VCLError } from './api/entities/VCLError';
|
|
14
15
|
export default VclApi;
|
|
15
|
-
export { VCLEnvTypes, VCLCountryCodes, VCLServiceType, VCLIssuingType, VCLErrorCode };
|
|
16
|
+
export { VCLEnvTypes, VCLCountryCodes, VCLServiceType, VCLIssuingType, VCLErrorCode, VCLError };
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VclApi","VCLEnvTypes","VCLCountryCodes","VCLServiceType","VCLIssuingType","VCLErrorCode"],"sources":["index.tsx"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypes } from './api/entities/VCLCredentialTypes';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './api/entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './api/entities/VCLJwkPublic';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLServiceTypes } from './api/entities/VCLServiceTypes';\nimport { VCLIssuingType } from './api/entities/VCLIssuingType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './api/entities/VCLDidJwk';\nimport { VCLErrorCode } from './api/entities/VCLErrorCode';\nimport
|
|
1
|
+
{"version":3,"names":["VclApi","VCLEnvTypes","VCLCountryCodes","VCLServiceType","VCLIssuingType","VCLErrorCode","VCLError"],"sources":["index.tsx"],"sourcesContent":["/**\n * Created by Michael Avoyan.\n *\n * Copyright 2022 Velocity Career Labs inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VclApi } from './api/VCLApi';\nimport type { VCLEnvironment } from './api/VCLEnvironment';\nimport { VCLEnvTypes } from './api/VCLEnvironment';\nimport type { VCLCountry } from './api/entities/VCLCountry';\nimport type { VCLCountries } from './api/entities/VCLCountries';\nimport { VCLCountryCodes } from './api/entities/VCLCountries';\nimport type { VCLRegion } from './api/entities/VCLRegion';\nimport type { VCLRegions } from './api/entities/VCLRegions';\nimport type { VCLCredentialManifest } from './api/entities/VCLCredentialManifest';\nimport type { VCLCredentialManifestDescriptor } from './api/entities/VCLCredentialManifestDescriptor';\nimport type { VCLCredentialManifestDescriptorByDeepLink } from './api/entities/VCLCredentialManifestDescriptorByDeepLink';\nimport type { VCLCredentialManifestDescriptorByService } from './api/entities/VCLCredentialManifestDescriptorByService';\nimport type { VCLCredentialManifestDescriptorRefresh } from './api/entities/VCLCredentialManifestDescriptorRefresh';\nimport type { VCLCredentialType } from './api/entities/VCLCredentialType';\nimport type { VCLCredentialTypes } from './api/entities/VCLCredentialTypes';\nimport type { VCLCredentialTypeSchema } from './api/entities/VCLCredentialTypeSchema';\nimport type { VCLCredentialTypeSchemas } from './api/entities/VCLCredentialTypeSchemas';\nimport type { VCLCredentialTypesUIFormSchemaDescriptor } from './api/entities/VCLCredentialTypesUIFormSchemaDescriptor';\nimport type { VCLCredentialTypesUIFormSchema } from './api/entities/VCLCredentialTypesUIFormSchema';\nimport type { VCLDeepLink } from './api/entities/VCLDeepLink';\nimport type { VCLExchange } from './api/entities/VCLExchange';\nimport type { VCLExchangeDescriptor } from './api/entities/VCLExchangeDescriptor';\nimport type { VCLFilter } from './api/entities/VCLFilter';\nimport type { VCLFinalizeOffersDescriptor } from './api/entities/VCLFinalizeOffersDescriptor';\nimport type { VCLGenerateOffersDescriptor } from './api/entities/VCLGenerateOffersDescriptor';\nimport type { VCLJwt } from './api/entities/VCLJwt';\nimport type { VCLJwtVerifiableCredentials } from './api/entities/VCLJwtVerifiableCredentials';\nimport type { VCLOffers } from './api/entities/VCLOffers';\nimport type { VCLOrganization } from './api/entities/VCLOrganization';\nimport type { VCLOrganizations } from './api/entities/VCLOrganizations';\nimport type { VCLOrganizationsSearchDescriptor } from './api/entities/VCLOrganizationsSearchDescriptor';\nimport type { VCLPage } from './api/entities/VCLPage';\nimport type { VCLPresentationRequest } from './api/entities/VCLPresentationRequest';\nimport type { VCLPresentationSubmission } from './api/entities/VCLPresentationSubmission';\nimport type { VCLJwkPublic } from './api/entities/VCLJwkPublic';\nimport type { VCLPushDelegate } from './api/entities/VCLPushDelegate';\nimport type { VCLService } from './api/entities/VCLService';\nimport type { VCLServiceCredentialAgentIssuer } from './api/entities/VCLServiceCredentialAgentIssuer';\nimport { VCLServiceType } from './api/entities/VCLServiceType';\nimport type { VCLServiceTypes } from './api/entities/VCLServiceTypes';\nimport { VCLIssuingType } from './api/entities/VCLIssuingType';\nimport type { VCLSubmissionResult } from './api/entities/VCLSubmissionResult';\nimport type { VCLToken } from './api/entities/VCLToken';\nimport type { VCLVerifiableCredential } from './api/entities/VCLVerifiableCredential';\nimport type { VCLVerifiedProfile } from './api/entities/VCLVerifiedProfile';\nimport type { VCLVerifiedProfileDescriptor } from './api/entities/VCLVerifiedProfileDescriptor';\nimport type { Dictionary } from './api/Dictionary';\nimport type { VCLInitializationDescriptor } from './api/entities/VCLInitializationDescriptor';\nimport type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresentationRequestDescriptor';\nimport type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';\nimport type { VCLDidJwk } from './api/entities/VCLDidJwk';\nimport { VCLErrorCode } from './api/entities/VCLErrorCode';\nimport { VCLError } from './api/entities/VCLError';\n\nexport default VclApi;\nexport {\n Dictionary,\n VCLEnvironment,\n VCLEnvTypes,\n VCLCountry,\n VCLCountries,\n VCLCountryCodes,\n VCLRegion,\n VCLRegions,\n VCLCredentialManifest,\n VCLCredentialManifestDescriptor,\n VCLCredentialManifestDescriptorByDeepLink,\n VCLCredentialManifestDescriptorByService,\n VCLCredentialType,\n VCLCredentialTypes,\n VCLCredentialTypeSchema,\n VCLCredentialTypeSchemas,\n VCLCredentialTypesUIFormSchema,\n VCLCredentialTypesUIFormSchemaDescriptor,\n VCLCredentialManifestDescriptorRefresh,\n VCLDeepLink,\n VCLExchange,\n VCLExchangeDescriptor,\n VCLFilter,\n VCLFinalizeOffersDescriptor,\n VCLGenerateOffersDescriptor,\n VCLJwt,\n VCLJwtVerifiableCredentials,\n VCLOffers,\n VCLOrganization,\n VCLOrganizations,\n VCLOrganizationsSearchDescriptor,\n VCLPage,\n VCLPresentationRequest,\n VCLPresentationSubmission,\n VCLJwkPublic,\n VCLPushDelegate,\n VCLService,\n VCLServiceCredentialAgentIssuer,\n VCLServiceType,\n VCLServiceTypes,\n VCLIssuingType,\n VCLSubmissionResult,\n VCLToken,\n VCLVerifiableCredential,\n VCLVerifiedProfile,\n VCLVerifiedProfileDescriptor,\n VCLInitializationDescriptor,\n VCLPresentationRequestDescriptor,\n VCLJwtDescriptor,\n VCLDidJwk,\n VCLErrorCode,\n VCLError,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,cAAc;AAErC,SAASC,WAAW,QAAQ,sBAAsB;AAGlD,SAASC,eAAe,QAAQ,6BAA6B;AAiC7D,SAASC,cAAc,QAAQ,+BAA+B;AAE9D,SAASC,cAAc,QAAQ,+BAA+B;AAW9D,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,QAAQ,QAAQ,yBAAyB;AAElD,eAAeN,MAAM;AACrB,SAGEC,WAAW,EAGXC,eAAe,EAiCfC,cAAc,EAEdC,cAAc,EAUdC,YAAY,EACZC,QAAQ"}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
export declare class VCLError extends Error {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
payload?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
errorCode?: string;
|
|
11
|
+
statusCode?: number;
|
|
10
12
|
constructor(error: any);
|
|
11
13
|
}
|
|
12
|
-
export declare const toVclError: (error: any) => VCLError;
|
|
@@ -56,6 +56,6 @@ import type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresent
|
|
|
56
56
|
import type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';
|
|
57
57
|
import type { VCLDidJwk } from './api/entities/VCLDidJwk';
|
|
58
58
|
import { VCLErrorCode } from './api/entities/VCLErrorCode';
|
|
59
|
-
import
|
|
59
|
+
import { VCLError } from './api/entities/VCLError';
|
|
60
60
|
export default VclApi;
|
|
61
|
-
export { Dictionary, VCLEnvironment, VCLEnvTypes, VCLCountry, VCLCountries, VCLCountryCodes, VCLRegion, VCLRegions, VCLCredentialManifest, VCLCredentialManifestDescriptor, VCLCredentialManifestDescriptorByDeepLink, VCLCredentialManifestDescriptorByService, VCLCredentialType, VCLCredentialTypes, VCLCredentialTypeSchema, VCLCredentialTypeSchemas, VCLCredentialTypesUIFormSchema, VCLCredentialTypesUIFormSchemaDescriptor, VCLCredentialManifestDescriptorRefresh, VCLDeepLink, VCLExchange, VCLExchangeDescriptor, VCLFilter, VCLFinalizeOffersDescriptor, VCLGenerateOffersDescriptor, VCLJwt, VCLJwtVerifiableCredentials, VCLOffers, VCLOrganization, VCLOrganizations, VCLOrganizationsSearchDescriptor, VCLPage, VCLPresentationRequest, VCLPresentationSubmission, VCLJwkPublic, VCLPushDelegate, VCLService, VCLServiceCredentialAgentIssuer, VCLServiceType, VCLServiceTypes, VCLIssuingType, VCLSubmissionResult, VCLToken, VCLVerifiableCredential, VCLVerifiedProfile, VCLVerifiedProfileDescriptor, VCLInitializationDescriptor, VCLPresentationRequestDescriptor, VCLJwtDescriptor, VCLDidJwk, VCLErrorCode, VCLError,
|
|
61
|
+
export { Dictionary, VCLEnvironment, VCLEnvTypes, VCLCountry, VCLCountries, VCLCountryCodes, VCLRegion, VCLRegions, VCLCredentialManifest, VCLCredentialManifestDescriptor, VCLCredentialManifestDescriptorByDeepLink, VCLCredentialManifestDescriptorByService, VCLCredentialType, VCLCredentialTypes, VCLCredentialTypeSchema, VCLCredentialTypeSchemas, VCLCredentialTypesUIFormSchema, VCLCredentialTypesUIFormSchemaDescriptor, VCLCredentialManifestDescriptorRefresh, VCLDeepLink, VCLExchange, VCLExchangeDescriptor, VCLFilter, VCLFinalizeOffersDescriptor, VCLGenerateOffersDescriptor, VCLJwt, VCLJwtVerifiableCredentials, VCLOffers, VCLOrganization, VCLOrganizations, VCLOrganizationsSearchDescriptor, VCLPage, VCLPresentationRequest, VCLPresentationSubmission, VCLJwkPublic, VCLPushDelegate, VCLService, VCLServiceCredentialAgentIssuer, VCLServiceType, VCLServiceTypes, VCLIssuingType, VCLSubmissionResult, VCLToken, VCLVerifiableCredential, VCLVerifiedProfile, VCLVerifiedProfileDescriptor, VCLInitializationDescriptor, VCLPresentationRequestDescriptor, VCLJwtDescriptor, VCLDidJwk, VCLErrorCode, VCLError, };
|
package/package.json
CHANGED
package/src/api/VCLApi.ts
CHANGED
|
@@ -31,10 +31,10 @@ import type { VCLSubmissionResult } from './entities/VCLSubmissionResult';
|
|
|
31
31
|
import type { VCLPresentationRequestDescriptor } from './entities/VCLPresentationRequestDescriptor';
|
|
32
32
|
import type { VCLJwtDescriptor } from './entities/VCLJwtDescriptor';
|
|
33
33
|
import type { VCLDidJwk } from './entities/VCLDidJwk';
|
|
34
|
-
import { toVclError } from './entities/VCLError';
|
|
35
34
|
import type { VCLCredentialTypes } from './entities/VCLCredentialTypes';
|
|
36
35
|
|
|
37
36
|
import { NativeModules } from 'react-native';
|
|
37
|
+
import { VCLError } from './entities/VCLError';
|
|
38
38
|
const { VclReactNative } = NativeModules;
|
|
39
39
|
|
|
40
40
|
export const VclApi = {
|
|
@@ -44,7 +44,7 @@ export const VclApi = {
|
|
|
44
44
|
try {
|
|
45
45
|
return await VclReactNative.initialize(initializationDescriptor);
|
|
46
46
|
} catch (e) {
|
|
47
|
-
throw
|
|
47
|
+
throw new VCLError(e);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
|
|
@@ -52,7 +52,7 @@ export const VclApi = {
|
|
|
52
52
|
try {
|
|
53
53
|
return await VclReactNative.getCountries();
|
|
54
54
|
} catch (e) {
|
|
55
|
-
throw
|
|
55
|
+
throw new VCLError(e);
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
|
|
@@ -60,7 +60,7 @@ export const VclApi = {
|
|
|
60
60
|
try {
|
|
61
61
|
return await VclReactNative.getCredentialTypes();
|
|
62
62
|
} catch (e) {
|
|
63
|
-
throw
|
|
63
|
+
throw new VCLError(e);
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ export const VclApi = {
|
|
|
68
68
|
try {
|
|
69
69
|
return await VclReactNative.getCredentialTypeSchemas();
|
|
70
70
|
} catch (e) {
|
|
71
|
-
throw
|
|
71
|
+
throw new VCLError(e);
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
|
|
@@ -80,7 +80,7 @@ export const VclApi = {
|
|
|
80
80
|
presentationRequestDescriptor
|
|
81
81
|
);
|
|
82
82
|
} catch (e) {
|
|
83
|
-
throw
|
|
83
|
+
throw new VCLError(e);
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
|
|
@@ -90,7 +90,7 @@ export const VclApi = {
|
|
|
90
90
|
try {
|
|
91
91
|
return await VclReactNative.submitPresentation(presentationSubmission);
|
|
92
92
|
} catch (e) {
|
|
93
|
-
throw
|
|
93
|
+
throw new VCLError(e);
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
|
|
@@ -100,7 +100,7 @@ export const VclApi = {
|
|
|
100
100
|
try {
|
|
101
101
|
return await VclReactNative.getExchangeProgress(exchangeDescriptor);
|
|
102
102
|
} catch (e) {
|
|
103
|
-
throw
|
|
103
|
+
throw new VCLError(e);
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
|
|
@@ -112,7 +112,7 @@ export const VclApi = {
|
|
|
112
112
|
organizationsSearchDescriptor
|
|
113
113
|
);
|
|
114
114
|
} catch (e) {
|
|
115
|
-
throw
|
|
115
|
+
throw new VCLError(e);
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
|
|
@@ -124,7 +124,7 @@ export const VclApi = {
|
|
|
124
124
|
credentialManifestDescriptor
|
|
125
125
|
);
|
|
126
126
|
} catch (e) {
|
|
127
|
-
throw
|
|
127
|
+
throw new VCLError(e);
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
|
|
@@ -134,7 +134,7 @@ export const VclApi = {
|
|
|
134
134
|
try {
|
|
135
135
|
return await VclReactNative.generateOffers(generateOffersDescriptor);
|
|
136
136
|
} catch (e) {
|
|
137
|
-
throw
|
|
137
|
+
throw new VCLError(e);
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
|
|
@@ -148,7 +148,7 @@ export const VclApi = {
|
|
|
148
148
|
token
|
|
149
149
|
);
|
|
150
150
|
} catch (e) {
|
|
151
|
-
throw
|
|
151
|
+
throw new VCLError(e);
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
|
|
@@ -162,7 +162,7 @@ export const VclApi = {
|
|
|
162
162
|
token
|
|
163
163
|
);
|
|
164
164
|
} catch (e) {
|
|
165
|
-
throw
|
|
165
|
+
throw new VCLError(e);
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
|
|
@@ -174,7 +174,7 @@ export const VclApi = {
|
|
|
174
174
|
credentialTypesUIFormSchemaDescriptor
|
|
175
175
|
);
|
|
176
176
|
} catch (e) {
|
|
177
|
-
throw
|
|
177
|
+
throw new VCLError(e);
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
180
|
|
|
@@ -184,7 +184,7 @@ export const VclApi = {
|
|
|
184
184
|
try {
|
|
185
185
|
return await VclReactNative.getVerifiedProfile(verifiedProfileDescriptor);
|
|
186
186
|
} catch (e) {
|
|
187
|
-
throw
|
|
187
|
+
throw new VCLError(e);
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
|
|
@@ -192,7 +192,7 @@ export const VclApi = {
|
|
|
192
192
|
try {
|
|
193
193
|
return await VclReactNative.verifyJwt(jwt, jwkPublic);
|
|
194
194
|
} catch (e) {
|
|
195
|
-
throw
|
|
195
|
+
throw new VCLError(e);
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
198
|
|
|
@@ -202,7 +202,7 @@ export const VclApi = {
|
|
|
202
202
|
try {
|
|
203
203
|
return await VclReactNative.generateSignedJwt(jwtDescriptor);
|
|
204
204
|
} catch (e) {
|
|
205
|
-
throw
|
|
205
|
+
throw new VCLError(e);
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
|
|
@@ -210,7 +210,7 @@ export const VclApi = {
|
|
|
210
210
|
try {
|
|
211
211
|
return await VclReactNative.generateDidJwk();
|
|
212
212
|
} catch (e) {
|
|
213
|
-
throw
|
|
213
|
+
throw new VCLError(e);
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
216
|
};
|
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export class VCLError extends Error {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
payload?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
errorCode?: string;
|
|
12
|
+
statusCode?: number;
|
|
11
13
|
|
|
12
14
|
constructor(error: any) {
|
|
13
15
|
super(error);
|
|
14
16
|
try {
|
|
15
17
|
const errorJson = JSON.parse(error.message);
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
+
this.payload = errorJson.payload;
|
|
19
|
+
this.error = errorJson.error;
|
|
20
|
+
this.errorCode = errorJson.errorCode;
|
|
21
|
+
this.message = errorJson.message;
|
|
22
|
+
this.statusCode = parseInt(errorJson.statusCode, 10);
|
|
18
23
|
} catch (e) {
|
|
19
|
-
this.
|
|
24
|
+
this.message = JSON.stringify(error);
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
|
-
|
|
24
|
-
export const toVclError = (error: any) => {
|
|
25
|
-
return new VCLError(error);
|
|
26
|
-
};
|
package/src/index.tsx
CHANGED
|
@@ -57,7 +57,7 @@ import type { VCLPresentationRequestDescriptor } from './api/entities/VCLPresent
|
|
|
57
57
|
import type { VCLJwtDescriptor } from './api/entities/VCLJwtDescriptor';
|
|
58
58
|
import type { VCLDidJwk } from './api/entities/VCLDidJwk';
|
|
59
59
|
import { VCLErrorCode } from './api/entities/VCLErrorCode';
|
|
60
|
-
import
|
|
60
|
+
import { VCLError } from './api/entities/VCLError';
|
|
61
61
|
|
|
62
62
|
export default VclApi;
|
|
63
63
|
export {
|
|
@@ -113,5 +113,4 @@ export {
|
|
|
113
113
|
VCLDidJwk,
|
|
114
114
|
VCLErrorCode,
|
|
115
115
|
VCLError,
|
|
116
|
-
toVclError,
|
|
117
116
|
};
|
package/vcl-react-native.podspec
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// VCLErrorExtensions.swift
|
|
3
|
-
// vcl-react-native
|
|
4
|
-
//
|
|
5
|
-
// Created by Michael Avoyan on 20/12/2022.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import VCL
|
|
10
|
-
|
|
11
|
-
extension VCLError {
|
|
12
|
-
func toJsonDictionary() -> [String: String] {
|
|
13
|
-
var msg = [String: String]()
|
|
14
|
-
msg["description"] = self.description
|
|
15
|
-
msg["code"] = "\(self.code ?? 0)"
|
|
16
|
-
return msg
|
|
17
|
-
}
|
|
18
|
-
func toJsonString() -> String {
|
|
19
|
-
return self.toJsonDictionary().toJsonString() ?? ""
|
|
20
|
-
}
|
|
21
|
-
}
|