@blueid/access-capacitor 0.84.0 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>macos-arm64_x86_64</string>
13
+ <string>ios-arm64_x86_64-simulator</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libCBlueIDAccess.a</string>
16
16
  <key>SupportedArchitectures</key>
@@ -19,7 +19,9 @@
19
19
  <string>x86_64</string>
20
20
  </array>
21
21
  <key>SupportedPlatform</key>
22
- <string>macos</string>
22
+ <string>ios</string>
23
+ <key>SupportedPlatformVariant</key>
24
+ <string>simulator</string>
23
25
  </dict>
24
26
  <dict>
25
27
  <key>BinaryPath</key>
@@ -27,7 +29,7 @@
27
29
  <key>HeadersPath</key>
28
30
  <string>Headers</string>
29
31
  <key>LibraryIdentifier</key>
30
- <string>ios-arm64_x86_64-simulator</string>
32
+ <string>macos-arm64_x86_64</string>
31
33
  <key>LibraryPath</key>
32
34
  <string>libCBlueIDAccess.a</string>
33
35
  <key>SupportedArchitectures</key>
@@ -36,9 +38,7 @@
36
38
  <string>x86_64</string>
37
39
  </array>
38
40
  <key>SupportedPlatform</key>
39
- <string>ios</string>
40
- <key>SupportedPlatformVariant</key>
41
- <string>simulator</string>
41
+ <string>macos</string>
42
42
  </dict>
43
43
  <dict>
44
44
  <key>BinaryPath</key>
@@ -79,7 +79,8 @@ public struct BlueGetAccessCredentialsCommand: BlueAsyncCommand {
79
79
 
80
80
  if let entries = try blueAccessCredentialsKeyChain.getAllEntries() {
81
81
  credentialList.credentials = try entries.compactMap { entry in
82
- if var credential = try? BlueAccessCredential(jsonUTF8Data: entry) {
82
+ do {
83
+ var credential = try BlueAccessCredential(jsonUTF8Data: entry)
83
84
 
84
85
  if includePrivateKey != true {
85
86
  // Never expose it
@@ -87,9 +88,11 @@ public struct BlueGetAccessCredentialsCommand: BlueAsyncCommand {
87
88
  }
88
89
 
89
90
  return credential
91
+
92
+ } catch {
93
+ throw BlueError(.sdkDecodeJsonFailed, cause: error, detail: String(data: entry, encoding: .utf8))
90
94
  }
91
-
92
- return nil
95
+
93
96
  }.filter() { credential in
94
97
  if (!filterByCredentialType(credential)) {
95
98
  return false
@@ -8,6 +8,7 @@ public final class BlueError: Error, LocalizedError, Equatable {
8
8
  public let returnCode: BlueReturnCode
9
9
 
10
10
  private let cause: Error?
11
+ private let detail: String?
11
12
 
12
13
  public var errorDescription: String? {
13
14
  if (returnCode == .timeout) {
@@ -17,6 +18,9 @@ public final class BlueError: Error, LocalizedError, Equatable {
17
18
  if let cause = cause {
18
19
  returnCodeStr += "\nCause: \(cause.localizedDescription)"
19
20
  }
21
+ if let detail = detail {
22
+ returnCodeStr += "\nDetail: \(detail)"
23
+ }
20
24
 
21
25
  return BlueError.returnCodeMessage.replacingOccurrences(of: "%returnCode%", with: returnCodeStr)
22
26
  }
@@ -37,11 +41,13 @@ public final class BlueError: Error, LocalizedError, Equatable {
37
41
  public init(_ returnCode: BlueReturnCode) {
38
42
  self.returnCode = returnCode
39
43
  self.cause = nil
44
+ self.detail = nil
40
45
  }
41
46
 
42
- public init(_ returnCode: BlueReturnCode, cause: Error) {
47
+ public init(_ returnCode: BlueReturnCode, cause: Error, detail: String? = nil) {
43
48
  self.returnCode = returnCode
44
49
  self.cause = cause
50
+ self.detail = detail
45
51
  }
46
52
 
47
53
  static public func == (lhs: BlueError, rhs: BlueError) -> Bool {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueid/access-capacitor",
3
- "version": "0.84.0",
3
+ "version": "0.86.0",
4
4
  "description": "Capacitor JS plugin for the BlueID Access SDK",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",