@blueid/access-capacitor 1.5.0 → 1.16.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.
Files changed (28) hide show
  1. package/android/build.gradle +5 -7
  2. package/android/src/main/java/com/blueid/access/plugins/capacitor/BlueIDAccess.java +1 -43
  3. package/android/src/main/java/com/blueid/access/plugins/capacitor/BlueIDAccessPlugin.java +1 -87
  4. package/dist/esm/BlueSystem_pb.d.ts +41 -0
  5. package/dist/esm/BlueSystem_pb.js +32 -0
  6. package/dist/esm/BlueSystem_pb.js.map +1 -1
  7. package/dist/esm/interop.js +0 -3
  8. package/dist/esm/interop.js.map +1 -1
  9. package/dist/plugin.cjs.js +34 -3
  10. package/dist/plugin.cjs.js.map +1 -1
  11. package/dist/plugin.js +34 -3
  12. package/dist/plugin.js.map +1 -1
  13. package/ios/CBlueIDAccess.xcframework/Info.plist +8 -8
  14. package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/BlueCore.h +1 -1
  15. package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
  16. package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/BlueCore.h +1 -1
  17. package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/libCBlueIDAccess.a +0 -0
  18. package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/Headers/core/BlueCore.h +1 -1
  19. package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
  20. package/ios/Plugin/BlueIDAccessPlugin.swift +1 -1
  21. package/ios/Plugin/BlueIDAccessSDK/BlueAPI.swift +7 -0
  22. package/ios/Plugin/BlueIDAccessSDK/BlueAPIProtocol.swift +22 -0
  23. package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +9 -1
  24. package/ios/Plugin/BlueIDAccessSDK/BlueSDK.pb.swift +18 -2
  25. package/ios/Plugin/BlueIDAccessSDK/BlueSystem.pb.swift +185 -3
  26. package/ios/Plugin/BlueIDAccessSDK/BlueSystem.swift +43 -17
  27. package/package.json +1 -3
  28. package/android/settings.gradle +0 -4
@@ -10,16 +10,15 @@
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</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libCBlueIDAccess.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
- <string>x86_64</string>
20
19
  </array>
21
20
  <key>SupportedPlatform</key>
22
- <string>macos</string>
21
+ <string>ios</string>
23
22
  </dict>
24
23
  <dict>
25
24
  <key>BinaryPath</key>
@@ -27,15 +26,18 @@
27
26
  <key>HeadersPath</key>
28
27
  <string>Headers</string>
29
28
  <key>LibraryIdentifier</key>
30
- <string>ios-arm64</string>
29
+ <string>ios-arm64_x86_64-simulator</string>
31
30
  <key>LibraryPath</key>
32
31
  <string>libCBlueIDAccess.a</string>
33
32
  <key>SupportedArchitectures</key>
34
33
  <array>
35
34
  <string>arm64</string>
35
+ <string>x86_64</string>
36
36
  </array>
37
37
  <key>SupportedPlatform</key>
38
38
  <string>ios</string>
39
+ <key>SupportedPlatformVariant</key>
40
+ <string>simulator</string>
39
41
  </dict>
40
42
  <dict>
41
43
  <key>BinaryPath</key>
@@ -43,7 +45,7 @@
43
45
  <key>HeadersPath</key>
44
46
  <string>Headers</string>
45
47
  <key>LibraryIdentifier</key>
46
- <string>ios-arm64_x86_64-simulator</string>
48
+ <string>macos-arm64_x86_64</string>
47
49
  <key>LibraryPath</key>
48
50
  <string>libCBlueIDAccess.a</string>
49
51
  <key>SupportedArchitectures</key>
@@ -52,9 +54,7 @@
52
54
  <string>x86_64</string>
53
55
  </array>
54
56
  <key>SupportedPlatform</key>
55
- <string>ios</string>
56
- <key>SupportedPlatformVariant</key>
57
- <string>simulator</string>
57
+ <string>macos</string>
58
58
  </dict>
59
59
  </array>
60
60
  <key>CFBundlePackageType</key>
@@ -38,7 +38,7 @@
38
38
 
39
39
  // Return with void in case of error
40
40
  #define BLUE_ERROR_CHECK_ERROR_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, true, return)
41
- #define BLUE_ERROR_CHECK_DEBUG_VOUD(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
41
+ #define BLUE_ERROR_CHECK_DEBUG_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
42
42
 
43
43
  // Just log errors without returning
44
44
  #define BLUE_ERROR_LOG_ERROR(EXPRESSION, DEBUG_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, DEBUG_MESSAGE, true, (void)0)
@@ -38,7 +38,7 @@
38
38
 
39
39
  // Return with void in case of error
40
40
  #define BLUE_ERROR_CHECK_ERROR_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, true, return)
41
- #define BLUE_ERROR_CHECK_DEBUG_VOUD(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
41
+ #define BLUE_ERROR_CHECK_DEBUG_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
42
42
 
43
43
  // Just log errors without returning
44
44
  #define BLUE_ERROR_LOG_ERROR(EXPRESSION, DEBUG_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, DEBUG_MESSAGE, true, (void)0)
@@ -38,7 +38,7 @@
38
38
 
39
39
  // Return with void in case of error
40
40
  #define BLUE_ERROR_CHECK_ERROR_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, true, return)
41
- #define BLUE_ERROR_CHECK_DEBUG_VOUD(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
41
+ #define BLUE_ERROR_CHECK_DEBUG_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
42
42
 
43
43
  // Just log errors without returning
44
44
  #define BLUE_ERROR_LOG_ERROR(EXPRESSION, DEBUG_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, DEBUG_MESSAGE, true, (void)0)
@@ -4,7 +4,7 @@ import Capacitor
4
4
  @objc(BlueIDAccessPlugin)
5
5
  public class BlueIDAccessPlugin: CAPPlugin, BluePluginDelegate {
6
6
  let plugin: BluePlugin = BluePlugin()
7
-
7
+
8
8
  override init() {
9
9
  super.init()
10
10
  plugin.delegate = self
@@ -107,6 +107,13 @@ class BlueAPI: BlueAPIProtocol {
107
107
  )
108
108
  }
109
109
 
110
+ func getDevice(deviceID: String, with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetDeviceResult> {
111
+ return try await post(
112
+ endpoint: .AccessGetDevice,
113
+ request: BlueGetDeviceRequest(deviceId: deviceID, tokenAuthentication: tokenAuthentication)
114
+ )
115
+ }
116
+
110
117
  private func post<T>(endpoint: BlueAPIEndpoints, request: Encodable) async throws -> BlueFetchResponse<T> {
111
118
  guard #available(macOS 12.0, *) else {
112
119
  throw BlueError(.sdkUnsupportedPlatform)
@@ -22,6 +22,7 @@ public enum BlueAPIEndpoints: String {
22
22
  case AccessSynchronizeOfflineAccess = "/access/synchronizeOfflineAccess"
23
23
  case AccessClaimCredential = "/access/cc"
24
24
  case AccessGetLatestFirmware = "/access/getLatestFirmware"
25
+ case AccessGetDevice = "/access/device"
25
26
 
26
27
  var url: URL {
27
28
  guard let url = URL(string: baseURL) else {
@@ -258,6 +259,26 @@ internal struct BlueGetLatestFirmwareResult: Decodable {
258
259
  let test: BlueLatestFirmwareInfo?
259
260
  }
260
261
 
262
+ /// [POST] /access/device request
263
+ internal struct BlueGetDeviceRequest: Encodable {
264
+ var deviceId: String
265
+ var tokenAuthentication: BlueTokenAuthentication
266
+ }
267
+
268
+ internal struct BlueDeviceHardware: Decodable {
269
+ let name: String
270
+ let vendor: String
271
+ let vendorName: String
272
+ let version: Int
273
+ let type: Int
274
+ }
275
+
276
+ /// [POST] /access/device response
277
+ internal struct BlueGetDeviceResult: Decodable {
278
+ let configId: String
279
+ let hardware: BlueDeviceHardware
280
+ }
281
+
261
282
  protocol BlueAPIProtocol {
262
283
  func getAccessToken(credentialId: String) async throws -> BlueFetchResponse<BlueAccessToken>
263
284
  func synchronizeMobileAccess(with tokenAuthentication: BlueTokenAuthentication, forceRefresh: Bool?) async throws -> BlueFetchResponse<BlueMobileAccessSynchronizationResult>
@@ -273,4 +294,5 @@ protocol BlueAPIProtocol {
273
294
  func claimAccessCredential(activationToken: String) async throws -> BlueFetchResponse<BlueClaimAccessCredentialResult>
274
295
  func getAccessCredentials(with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetAccessCredentialsResult>
275
296
  func getLatestFirmware(deviceID: String, with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetLatestFirmwareResult>
297
+ func getDevice(deviceID: String, with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetDeviceResult>
276
298
  }
@@ -6406,7 +6406,15 @@ extension BlueOssSoConfiguration: SwiftProtobuf.Message, SwiftProtobuf._MessageI
6406
6406
  var _blacklist: BlueOssSoFileBlacklist? = nil
6407
6407
  var _customerExtensions: BlueOssSoFileCustomerExtensions? = nil
6408
6408
 
6409
- static let defaultInstance = _StorageClass()
6409
+ #if swift(>=5.10)
6410
+ // This property is used as the initial default value for new instances of the type.
6411
+ // The type itself is protecting the reference to its storage via CoW semantics.
6412
+ // This will force a copy to be made of this reference when the first mutation occurs;
6413
+ // hence, it is safe to mark this as `nonisolated(unsafe)`.
6414
+ static nonisolated(unsafe) let defaultInstance = _StorageClass()
6415
+ #else
6416
+ static let defaultInstance = _StorageClass()
6417
+ #endif
6410
6418
 
6411
6419
  private init() {}
6412
6420
 
@@ -1204,7 +1204,15 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
1204
1204
  var _dfuUpdateFwlabel: String? = nil
1205
1205
  var _dfuWaitForDeviceToRestartTaskLabel: String? = nil
1206
1206
 
1207
- static let defaultInstance = _StorageClass()
1207
+ #if swift(>=5.10)
1208
+ // This property is used as the initial default value for new instances of the type.
1209
+ // The type itself is protecting the reference to its storage via CoW semantics.
1210
+ // This will force a copy to be made of this reference when the first mutation occurs;
1211
+ // hence, it is safe to mark this as `nonisolated(unsafe)`.
1212
+ static nonisolated(unsafe) let defaultInstance = _StorageClass()
1213
+ #else
1214
+ static let defaultInstance = _StorageClass()
1215
+ #endif
1208
1216
 
1209
1217
  private init() {}
1210
1218
 
@@ -1824,7 +1832,15 @@ extension BlueAccessCredential: SwiftProtobuf.Message, SwiftProtobuf._MessageImp
1824
1832
  var _organisation: String? = nil
1825
1833
  var _organisationName: String? = nil
1826
1834
 
1827
- static let defaultInstance = _StorageClass()
1835
+ #if swift(>=5.10)
1836
+ // This property is used as the initial default value for new instances of the type.
1837
+ // The type itself is protecting the reference to its storage via CoW semantics.
1838
+ // This will force a copy to be made of this reference when the first mutation occurs;
1839
+ // hence, it is safe to mark this as `nonisolated(unsafe)`.
1840
+ static nonisolated(unsafe) let defaultInstance = _StorageClass()
1841
+ #else
1842
+ static let defaultInstance = _StorageClass()
1843
+ #endif
1828
1844
 
1829
1845
  private init() {}
1830
1846
 
@@ -704,6 +704,67 @@ public struct BlueSystemProvisioning {
704
704
  fileprivate var _signaturePublicKey: Data? = nil
705
705
  }
706
706
 
707
+ public struct BlueHardwareInfo {
708
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
709
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
710
+ // methods supported on all messages.
711
+
712
+ public var name: String {
713
+ get {return _name ?? String()}
714
+ set {_name = newValue}
715
+ }
716
+ /// Returns true if `name` has been explicitly set.
717
+ public var hasName: Bool {return self._name != nil}
718
+ /// Clears the value of `name`. Subsequent reads from it will return its default value.
719
+ public mutating func clearName() {self._name = nil}
720
+
721
+ public var vendor: String {
722
+ get {return _vendor ?? String()}
723
+ set {_vendor = newValue}
724
+ }
725
+ /// Returns true if `vendor` has been explicitly set.
726
+ public var hasVendor: Bool {return self._vendor != nil}
727
+ /// Clears the value of `vendor`. Subsequent reads from it will return its default value.
728
+ public mutating func clearVendor() {self._vendor = nil}
729
+
730
+ public var vendorName: String {
731
+ get {return _vendorName ?? String()}
732
+ set {_vendorName = newValue}
733
+ }
734
+ /// Returns true if `vendorName` has been explicitly set.
735
+ public var hasVendorName: Bool {return self._vendorName != nil}
736
+ /// Clears the value of `vendorName`. Subsequent reads from it will return its default value.
737
+ public mutating func clearVendorName() {self._vendorName = nil}
738
+
739
+ public var version: UInt32 {
740
+ get {return _version ?? 0}
741
+ set {_version = newValue}
742
+ }
743
+ /// Returns true if `version` has been explicitly set.
744
+ public var hasVersion: Bool {return self._version != nil}
745
+ /// Clears the value of `version`. Subsequent reads from it will return its default value.
746
+ public mutating func clearVersion() {self._version = nil}
747
+
748
+ public var type: BlueHardwareType {
749
+ get {return _type ?? .unknownHardware}
750
+ set {_type = newValue}
751
+ }
752
+ /// Returns true if `type` has been explicitly set.
753
+ public var hasType: Bool {return self._type != nil}
754
+ /// Clears the value of `type`. Subsequent reads from it will return its default value.
755
+ public mutating func clearType() {self._type = nil}
756
+
757
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
758
+
759
+ public init() {}
760
+
761
+ fileprivate var _name: String? = nil
762
+ fileprivate var _vendor: String? = nil
763
+ fileprivate var _vendorName: String? = nil
764
+ fileprivate var _version: UInt32? = nil
765
+ fileprivate var _type: BlueHardwareType? = nil
766
+ }
767
+
707
768
  public struct BlueSystemStatus {
708
769
  // SwiftProtobuf.Message conformance is added in an extension below. See the
709
770
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@@ -818,6 +879,24 @@ public struct BlueSystemStatus {
818
879
  /// Clears the value of `newTestFirmwareVersionAvailable`. Subsequent reads from it will return its default value.
819
880
  public mutating func clearNewTestFirmwareVersionAvailable() {_uniqueStorage()._newTestFirmwareVersionAvailable = nil}
820
881
 
882
+ public var newConfigurationAvailable: Bool {
883
+ get {return _storage._newConfigurationAvailable ?? false}
884
+ set {_uniqueStorage()._newConfigurationAvailable = newValue}
885
+ }
886
+ /// Returns true if `newConfigurationAvailable` has been explicitly set.
887
+ public var hasNewConfigurationAvailable: Bool {return _storage._newConfigurationAvailable != nil}
888
+ /// Clears the value of `newConfigurationAvailable`. Subsequent reads from it will return its default value.
889
+ public mutating func clearNewConfigurationAvailable() {_uniqueStorage()._newConfigurationAvailable = nil}
890
+
891
+ public var hardwareInfo: BlueHardwareInfo {
892
+ get {return _storage._hardwareInfo ?? BlueHardwareInfo()}
893
+ set {_uniqueStorage()._hardwareInfo = newValue}
894
+ }
895
+ /// Returns true if `hardwareInfo` has been explicitly set.
896
+ public var hasHardwareInfo: Bool {return _storage._hardwareInfo != nil}
897
+ /// Clears the value of `hardwareInfo`. Subsequent reads from it will return its default value.
898
+ public mutating func clearHardwareInfo() {_uniqueStorage()._hardwareInfo = nil}
899
+
821
900
  public var unknownFields = SwiftProtobuf.UnknownStorage()
822
901
 
823
902
  public init() {}
@@ -1074,6 +1153,7 @@ extension BlueSystemTimeUnix: @unchecked Sendable {}
1074
1153
  extension BlueSystemUpdate: @unchecked Sendable {}
1075
1154
  extension BlueSystemSettings: @unchecked Sendable {}
1076
1155
  extension BlueSystemProvisioning: @unchecked Sendable {}
1156
+ extension BlueHardwareInfo: @unchecked Sendable {}
1077
1157
  extension BlueSystemStatus: @unchecked Sendable {}
1078
1158
  extension BlueSystemLogQuery: @unchecked Sendable {}
1079
1159
  extension BlueSystemLogQuery.OneOf_Start: @unchecked Sendable {}
@@ -1514,7 +1594,15 @@ extension BlueSystemConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
1514
1594
  var _oss: BlueOssConfig? = nil
1515
1595
  var _lock: BlueLockConfig? = nil
1516
1596
 
1517
- static let defaultInstance = _StorageClass()
1597
+ #if swift(>=5.10)
1598
+ // This property is used as the initial default value for new instances of the type.
1599
+ // The type itself is protecting the reference to its storage via CoW semantics.
1600
+ // This will force a copy to be made of this reference when the first mutation occurs;
1601
+ // hence, it is safe to mark this as `nonisolated(unsafe)`.
1602
+ static nonisolated(unsafe) let defaultInstance = _StorageClass()
1603
+ #else
1604
+ static let defaultInstance = _StorageClass()
1605
+ #endif
1518
1606
 
1519
1607
  private init() {}
1520
1608
 
@@ -1903,6 +1991,75 @@ extension BlueSystemProvisioning: SwiftProtobuf.Message, SwiftProtobuf._MessageI
1903
1991
  }
1904
1992
  }
1905
1993
 
1994
+ extension BlueHardwareInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
1995
+ public static let protoMessageName: String = "BlueHardwareInfo"
1996
+ public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1997
+ 1: .same(proto: "name"),
1998
+ 2: .same(proto: "vendor"),
1999
+ 3: .same(proto: "vendorName"),
2000
+ 4: .same(proto: "version"),
2001
+ 5: .same(proto: "type"),
2002
+ ]
2003
+
2004
+ public var isInitialized: Bool {
2005
+ if self._name == nil {return false}
2006
+ if self._vendor == nil {return false}
2007
+ if self._vendorName == nil {return false}
2008
+ if self._version == nil {return false}
2009
+ if self._type == nil {return false}
2010
+ return true
2011
+ }
2012
+
2013
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
2014
+ while let fieldNumber = try decoder.nextFieldNumber() {
2015
+ // The use of inline closures is to circumvent an issue where the compiler
2016
+ // allocates stack space for every case branch when no optimizations are
2017
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
2018
+ switch fieldNumber {
2019
+ case 1: try { try decoder.decodeSingularStringField(value: &self._name) }()
2020
+ case 2: try { try decoder.decodeSingularStringField(value: &self._vendor) }()
2021
+ case 3: try { try decoder.decodeSingularStringField(value: &self._vendorName) }()
2022
+ case 4: try { try decoder.decodeSingularUInt32Field(value: &self._version) }()
2023
+ case 5: try { try decoder.decodeSingularEnumField(value: &self._type) }()
2024
+ default: break
2025
+ }
2026
+ }
2027
+ }
2028
+
2029
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
2030
+ // The use of inline closures is to circumvent an issue where the compiler
2031
+ // allocates stack space for every if/case branch local when no optimizations
2032
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
2033
+ // https://github.com/apple/swift-protobuf/issues/1182
2034
+ try { if let v = self._name {
2035
+ try visitor.visitSingularStringField(value: v, fieldNumber: 1)
2036
+ } }()
2037
+ try { if let v = self._vendor {
2038
+ try visitor.visitSingularStringField(value: v, fieldNumber: 2)
2039
+ } }()
2040
+ try { if let v = self._vendorName {
2041
+ try visitor.visitSingularStringField(value: v, fieldNumber: 3)
2042
+ } }()
2043
+ try { if let v = self._version {
2044
+ try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4)
2045
+ } }()
2046
+ try { if let v = self._type {
2047
+ try visitor.visitSingularEnumField(value: v, fieldNumber: 5)
2048
+ } }()
2049
+ try unknownFields.traverse(visitor: &visitor)
2050
+ }
2051
+
2052
+ public static func ==(lhs: BlueHardwareInfo, rhs: BlueHardwareInfo) -> Bool {
2053
+ if lhs._name != rhs._name {return false}
2054
+ if lhs._vendor != rhs._vendor {return false}
2055
+ if lhs._vendorName != rhs._vendorName {return false}
2056
+ if lhs._version != rhs._version {return false}
2057
+ if lhs._type != rhs._type {return false}
2058
+ if lhs.unknownFields != rhs.unknownFields {return false}
2059
+ return true
2060
+ }
2061
+ }
2062
+
1906
2063
  extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
1907
2064
  public static let protoMessageName: String = "BlueSystemStatus"
1908
2065
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
@@ -1918,6 +2075,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
1918
2075
  10: .same(proto: "applicationVersionTest"),
1919
2076
  11: .same(proto: "newFirmwareVersionAvailable"),
1920
2077
  12: .same(proto: "newTestFirmwareVersionAvailable"),
2078
+ 13: .same(proto: "newConfigurationAvailable"),
2079
+ 14: .same(proto: "hardwareInfo"),
1921
2080
  ]
1922
2081
 
1923
2082
  fileprivate class _StorageClass {
@@ -1933,8 +2092,18 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
1933
2092
  var _applicationVersionTest: UInt32? = nil
1934
2093
  var _newFirmwareVersionAvailable: Bool? = nil
1935
2094
  var _newTestFirmwareVersionAvailable: Bool? = nil
1936
-
1937
- static let defaultInstance = _StorageClass()
2095
+ var _newConfigurationAvailable: Bool? = nil
2096
+ var _hardwareInfo: BlueHardwareInfo? = nil
2097
+
2098
+ #if swift(>=5.10)
2099
+ // This property is used as the initial default value for new instances of the type.
2100
+ // The type itself is protecting the reference to its storage via CoW semantics.
2101
+ // This will force a copy to be made of this reference when the first mutation occurs;
2102
+ // hence, it is safe to mark this as `nonisolated(unsafe)`.
2103
+ static nonisolated(unsafe) let defaultInstance = _StorageClass()
2104
+ #else
2105
+ static let defaultInstance = _StorageClass()
2106
+ #endif
1938
2107
 
1939
2108
  private init() {}
1940
2109
 
@@ -1951,6 +2120,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
1951
2120
  _applicationVersionTest = source._applicationVersionTest
1952
2121
  _newFirmwareVersionAvailable = source._newFirmwareVersionAvailable
1953
2122
  _newTestFirmwareVersionAvailable = source._newTestFirmwareVersionAvailable
2123
+ _newConfigurationAvailable = source._newConfigurationAvailable
2124
+ _hardwareInfo = source._hardwareInfo
1954
2125
  }
1955
2126
  }
1956
2127
 
@@ -1974,6 +2145,7 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
1974
2145
  if let v = _storage._localTime, !v.isInitialized {return false}
1975
2146
  if let v = _storage._settings, !v.isInitialized {return false}
1976
2147
  if let v = _storage._lock, !v.isInitialized {return false}
2148
+ if let v = _storage._hardwareInfo, !v.isInitialized {return false}
1977
2149
  return true
1978
2150
  }
1979
2151
  }
@@ -1998,6 +2170,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
1998
2170
  case 10: try { try decoder.decodeSingularUInt32Field(value: &_storage._applicationVersionTest) }()
1999
2171
  case 11: try { try decoder.decodeSingularBoolField(value: &_storage._newFirmwareVersionAvailable) }()
2000
2172
  case 12: try { try decoder.decodeSingularBoolField(value: &_storage._newTestFirmwareVersionAvailable) }()
2173
+ case 13: try { try decoder.decodeSingularBoolField(value: &_storage._newConfigurationAvailable) }()
2174
+ case 14: try { try decoder.decodeSingularMessageField(value: &_storage._hardwareInfo) }()
2001
2175
  default: break
2002
2176
  }
2003
2177
  }
@@ -2046,6 +2220,12 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
2046
2220
  try { if let v = _storage._newTestFirmwareVersionAvailable {
2047
2221
  try visitor.visitSingularBoolField(value: v, fieldNumber: 12)
2048
2222
  } }()
2223
+ try { if let v = _storage._newConfigurationAvailable {
2224
+ try visitor.visitSingularBoolField(value: v, fieldNumber: 13)
2225
+ } }()
2226
+ try { if let v = _storage._hardwareInfo {
2227
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 14)
2228
+ } }()
2049
2229
  }
2050
2230
  try unknownFields.traverse(visitor: &visitor)
2051
2231
  }
@@ -2067,6 +2247,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
2067
2247
  if _storage._applicationVersionTest != rhs_storage._applicationVersionTest {return false}
2068
2248
  if _storage._newFirmwareVersionAvailable != rhs_storage._newFirmwareVersionAvailable {return false}
2069
2249
  if _storage._newTestFirmwareVersionAvailable != rhs_storage._newTestFirmwareVersionAvailable {return false}
2250
+ if _storage._newConfigurationAvailable != rhs_storage._newConfigurationAvailable {return false}
2251
+ if _storage._hardwareInfo != rhs_storage._hardwareInfo {return false}
2070
2252
  return true
2071
2253
  }
2072
2254
  if !storagesAreEqual {return false}
@@ -37,6 +37,12 @@ public class BlueGetSystemStatusCommand: BlueSdkAsyncCommand {
37
37
  public func runAsync(deviceID: String) async throws -> BlueSystemStatus {
38
38
  var status: BlueSystemStatus = try await blueTerminalRun(deviceID: deviceID, timeoutSeconds: 30.0, action: "STATUS")
39
39
 
40
+ await self.tryUpdateWithOnlineInformation(deviceID, &status)
41
+
42
+ return status
43
+ }
44
+
45
+ private func tryUpdateWithOnlineInformation(_ deviceID: String, _ status: inout BlueSystemStatus) async {
40
46
  do {
41
47
  let credentials = try BlueGetAccessCredentialsCommand().run(credentialType: .maintenance, for: deviceID, includePrivateKey: true)
42
48
 
@@ -44,32 +50,52 @@ public class BlueGetSystemStatusCommand: BlueSdkAsyncCommand {
44
50
  let tokenAuthentication = try await sdkService.authenticationTokenService
45
51
  .getTokenAuthentication(credential: credential)
46
52
 
47
- let latestFW = try await self.sdkService.apiService.getLatestFirmware(deviceID: deviceID, with: tokenAuthentication).getData()
48
-
49
- self.updateFirmwareFlags(&status, latestFW)
53
+ await self.tryUpdateFirmwareFlags(deviceID, &status, tokenAuthentication)
54
+ await self.tryUpdateHardwareInformation(deviceID, &status, tokenAuthentication)
50
55
  }
51
56
  } catch {
52
57
  blueLogError(error.localizedDescription)
53
58
  }
54
-
55
- return status
56
59
  }
57
60
 
58
- internal func updateFirmwareFlags(_ status: inout BlueSystemStatus, _ latestFW: BlueGetLatestFirmwareResult) {
59
- if let testFW = latestFW.test {
60
- if let testVersion = testFW.testVersion {
61
- status.newTestFirmwareVersionAvailable = testVersion != status.applicationVersionTest || testFW.version != status.applicationVersion
61
+ internal func tryUpdateFirmwareFlags(_ deviceID: String, _ status: inout BlueSystemStatus, _ tokenAuthentication: BlueTokenAuthentication) async {
62
+ do {
63
+ let latestFW = try await self.sdkService.apiService.getLatestFirmware(deviceID: deviceID, with: tokenAuthentication).getData()
64
+
65
+ if let testFW = latestFW.test {
66
+ if let testVersion = testFW.testVersion {
67
+ status.newTestFirmwareVersionAvailable = testVersion != status.applicationVersionTest || testFW.version != status.applicationVersion
68
+ }
62
69
  }
63
- }
64
-
65
- if let productionFW = latestFW.production {
66
- let isTestVersion = status.hasApplicationVersionTest && status.applicationVersionTest != 0
67
70
 
68
- if isTestVersion {
69
- status.newFirmwareVersionAvailable = true
70
- } else {
71
- status.newFirmwareVersionAvailable = productionFW.version != status.applicationVersion
71
+ if let productionFW = latestFW.production {
72
+ let isTestVersion = status.hasApplicationVersionTest && status.applicationVersionTest != 0
73
+
74
+ if isTestVersion {
75
+ status.newFirmwareVersionAvailable = true
76
+ } else {
77
+ status.newFirmwareVersionAvailable = productionFW.version != status.applicationVersion
78
+ }
72
79
  }
80
+ } catch {
81
+ blueLogError(error.localizedDescription)
82
+ }
83
+ }
84
+
85
+ internal func tryUpdateHardwareInformation(_ deviceID: String, _ status: inout BlueSystemStatus, _ tokenAuthentication: BlueTokenAuthentication) async {
86
+ do {
87
+ let device = try await self.sdkService.apiService.getDevice(deviceID: deviceID, with: tokenAuthentication).getData()
88
+
89
+ status.hardwareInfo = BlueHardwareInfo()
90
+ status.hardwareInfo.name = device.hardware.name
91
+ status.hardwareInfo.vendor = device.hardware.vendor
92
+ status.hardwareInfo.vendorName = device.hardware.vendorName
93
+ status.hardwareInfo.version = UInt32(device.hardware.version)
94
+ status.hardwareInfo.type = BlueHardwareType(rawValue: device.hardware.type) ?? status.hardwareType
95
+
96
+ status.newConfigurationAvailable = status.configID != device.configId
97
+ } catch {
98
+ blueLogError(error.localizedDescription)
73
99
  }
74
100
  }
75
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueid/access-capacitor",
3
- "version": "1.5.0",
3
+ "version": "1.16.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",
@@ -8,9 +8,7 @@
8
8
  "unpkg": "dist/plugin.js",
9
9
  "files": [
10
10
  "android/src/main/",
11
- "android/sdk/",
12
11
  "android/build.gradle",
13
- "android/settings.gradle",
14
12
  "dist/",
15
13
  "ios/Plugin/",
16
14
  "ios/CBlueIDAccess.xcframework/",
@@ -1,4 +0,0 @@
1
- rootProject.name = "AndroidCapacitorPlugin"
2
- include ':capacitor-android'
3
- project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
4
- //include ':sdk'