@blueid/access-capacitor 0.91.0 → 0.93.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 (26) hide show
  1. package/dist/esm/BlueCore_pb.d.ts +29 -0
  2. package/dist/esm/BlueCore_pb.js +33 -0
  3. package/dist/esm/BlueCore_pb.js.map +1 -1
  4. package/dist/plugin.cjs.js +35 -0
  5. package/dist/plugin.cjs.js.map +1 -1
  6. package/dist/plugin.js +35 -0
  7. package/dist/plugin.js.map +1 -1
  8. package/ios/CBlueIDAccess.xcframework/Info.plist +5 -5
  9. package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/BlueCore.pb.h +35 -5
  10. package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
  11. package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/BlueCore.pb.h +35 -5
  12. package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/libCBlueIDAccess.a +0 -0
  13. package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/Headers/core/BlueCore.pb.h +35 -5
  14. package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
  15. package/ios/Plugin/BlueIDAccessSDK/BlueAPI.swift +8 -1
  16. package/ios/Plugin/BlueIDAccessSDK/BlueAccess.swift +78 -63
  17. package/ios/Plugin/BlueIDAccessSDK/BlueAccessEventService.swift +98 -0
  18. package/ios/Plugin/BlueIDAccessSDK/BlueAccessEventServiceProtocol.swift +5 -0
  19. package/ios/Plugin/BlueIDAccessSDK/BlueAccessSync.swift +9 -9
  20. package/ios/Plugin/BlueIDAccessSDK/BlueCommands.swift +24 -20
  21. package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +105 -0
  22. package/ios/Plugin/BlueIDAccessSDK/BlueNetworkMonitorService.swift +26 -0
  23. package/ios/Plugin/BlueIDAccessSDK/BlueOssSo.swift +9 -9
  24. package/ios/Plugin/BlueIDAccessSDK/BlueSdkService.swift +18 -0
  25. package/ios/Plugin/BlueIDAccessSDK/BlueTerminal.swift +1 -1
  26. package/package.json +1 -1
@@ -1812,6 +1812,29 @@ public struct BlueOssAccessResult {
1812
1812
  fileprivate var _scheduleMissmatch: Bool? = nil
1813
1813
  }
1814
1814
 
1815
+ public struct BlueOssAccessEventsResult {
1816
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
1817
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
1818
+ // methods supported on all messages.
1819
+
1820
+ public var accessResult: BlueOssAccessResult {
1821
+ get {return _accessResult ?? BlueOssAccessResult()}
1822
+ set {_accessResult = newValue}
1823
+ }
1824
+ /// Returns true if `accessResult` has been explicitly set.
1825
+ public var hasAccessResult: Bool {return self._accessResult != nil}
1826
+ /// Clears the value of `accessResult`. Subsequent reads from it will return its default value.
1827
+ public mutating func clearAccessResult() {self._accessResult = nil}
1828
+
1829
+ public var events: [BlueEvent] = []
1830
+
1831
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
1832
+
1833
+ public init() {}
1834
+
1835
+ fileprivate var _accessResult: BlueOssAccessResult? = nil
1836
+ }
1837
+
1815
1838
  public struct BlueOssSidVersion {
1816
1839
  // SwiftProtobuf.Message conformance is added in an extension below. See the
1817
1840
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@@ -3133,6 +3156,24 @@ public struct BlueOssSoMobile {
3133
3156
  /// Clears the value of `customerExtensionsFile`. Subsequent reads from it will return its default value.
3134
3157
  public mutating func clearCustomerExtensionsFile() {self._customerExtensionsFile = nil}
3135
3158
 
3159
+ public var requestedEventCount: UInt32 {
3160
+ get {return _requestedEventCount ?? 0}
3161
+ set {_requestedEventCount = newValue}
3162
+ }
3163
+ /// Returns true if `requestedEventCount` has been explicitly set.
3164
+ public var hasRequestedEventCount: Bool {return self._requestedEventCount != nil}
3165
+ /// Clears the value of `requestedEventCount`. Subsequent reads from it will return its default value.
3166
+ public mutating func clearRequestedEventCount() {self._requestedEventCount = nil}
3167
+
3168
+ public var supportedEventIds: Data {
3169
+ get {return _supportedEventIds ?? Data()}
3170
+ set {_supportedEventIds = newValue}
3171
+ }
3172
+ /// Returns true if `supportedEventIds` has been explicitly set.
3173
+ public var hasSupportedEventIds: Bool {return self._supportedEventIds != nil}
3174
+ /// Clears the value of `supportedEventIds`. Subsequent reads from it will return its default value.
3175
+ public mutating func clearSupportedEventIds() {self._supportedEventIds = nil}
3176
+
3136
3177
  public var unknownFields = SwiftProtobuf.UnknownStorage()
3137
3178
 
3138
3179
  public init() {}
@@ -3141,6 +3182,8 @@ public struct BlueOssSoMobile {
3141
3182
  fileprivate var _dataFile: Data? = nil
3142
3183
  fileprivate var _blacklistFile: Data? = nil
3143
3184
  fileprivate var _customerExtensionsFile: Data? = nil
3185
+ fileprivate var _requestedEventCount: UInt32? = nil
3186
+ fileprivate var _supportedEventIds: Data? = nil
3144
3187
  }
3145
3188
 
3146
3189
  public struct BlueOssSoMobileProvisioningConfiguration {
@@ -3489,6 +3532,7 @@ extension BlueSPToken: @unchecked Sendable {}
3489
3532
  extension BlueSPToken.OneOf_Payload: @unchecked Sendable {}
3490
3533
  extension BlueSPResult: @unchecked Sendable {}
3491
3534
  extension BlueOssAccessResult: @unchecked Sendable {}
3535
+ extension BlueOssAccessEventsResult: @unchecked Sendable {}
3492
3536
  extension BlueOssSidVersion: @unchecked Sendable {}
3493
3537
  extension BlueOssSidCredentialTypeOss: @unchecked Sendable {}
3494
3538
  extension BlueOssSidCredentialTypeProprietary: @unchecked Sendable {}
@@ -4760,6 +4804,55 @@ extension BlueOssAccessResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl
4760
4804
  }
4761
4805
  }
4762
4806
 
4807
+ extension BlueOssAccessEventsResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
4808
+ public static let protoMessageName: String = "BlueOssAccessEventsResult"
4809
+ public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
4810
+ 1: .same(proto: "accessResult"),
4811
+ 2: .same(proto: "events"),
4812
+ ]
4813
+
4814
+ public var isInitialized: Bool {
4815
+ if self._accessResult == nil {return false}
4816
+ if let v = self._accessResult, !v.isInitialized {return false}
4817
+ if !SwiftProtobuf.Internal.areAllInitialized(self.events) {return false}
4818
+ return true
4819
+ }
4820
+
4821
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
4822
+ while let fieldNumber = try decoder.nextFieldNumber() {
4823
+ // The use of inline closures is to circumvent an issue where the compiler
4824
+ // allocates stack space for every case branch when no optimizations are
4825
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
4826
+ switch fieldNumber {
4827
+ case 1: try { try decoder.decodeSingularMessageField(value: &self._accessResult) }()
4828
+ case 2: try { try decoder.decodeRepeatedMessageField(value: &self.events) }()
4829
+ default: break
4830
+ }
4831
+ }
4832
+ }
4833
+
4834
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
4835
+ // The use of inline closures is to circumvent an issue where the compiler
4836
+ // allocates stack space for every if/case branch local when no optimizations
4837
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
4838
+ // https://github.com/apple/swift-protobuf/issues/1182
4839
+ try { if let v = self._accessResult {
4840
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
4841
+ } }()
4842
+ if !self.events.isEmpty {
4843
+ try visitor.visitRepeatedMessageField(value: self.events, fieldNumber: 2)
4844
+ }
4845
+ try unknownFields.traverse(visitor: &visitor)
4846
+ }
4847
+
4848
+ public static func ==(lhs: BlueOssAccessEventsResult, rhs: BlueOssAccessEventsResult) -> Bool {
4849
+ if lhs._accessResult != rhs._accessResult {return false}
4850
+ if lhs.events != rhs.events {return false}
4851
+ if lhs.unknownFields != rhs.unknownFields {return false}
4852
+ return true
4853
+ }
4854
+ }
4855
+
4763
4856
  extension BlueOssSidVersion: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
4764
4857
  public static let protoMessageName: String = "BlueOssSidVersion"
4765
4858
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
@@ -6575,6 +6668,8 @@ extension BlueOssSoMobile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
6575
6668
  2: .same(proto: "dataFile"),
6576
6669
  3: .same(proto: "blacklistFile"),
6577
6670
  4: .same(proto: "customerExtensionsFile"),
6671
+ 5: .same(proto: "requestedEventCount"),
6672
+ 6: .same(proto: "supportedEventIds"),
6578
6673
  ]
6579
6674
 
6580
6675
  public var isInitialized: Bool {
@@ -6595,6 +6690,8 @@ extension BlueOssSoMobile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
6595
6690
  case 2: try { try decoder.decodeSingularBytesField(value: &self._dataFile) }()
6596
6691
  case 3: try { try decoder.decodeSingularBytesField(value: &self._blacklistFile) }()
6597
6692
  case 4: try { try decoder.decodeSingularBytesField(value: &self._customerExtensionsFile) }()
6693
+ case 5: try { try decoder.decodeSingularUInt32Field(value: &self._requestedEventCount) }()
6694
+ case 6: try { try decoder.decodeSingularBytesField(value: &self._supportedEventIds) }()
6598
6695
  default: break
6599
6696
  }
6600
6697
  }
@@ -6617,6 +6714,12 @@ extension BlueOssSoMobile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
6617
6714
  try { if let v = self._customerExtensionsFile {
6618
6715
  try visitor.visitSingularBytesField(value: v, fieldNumber: 4)
6619
6716
  } }()
6717
+ try { if let v = self._requestedEventCount {
6718
+ try visitor.visitSingularUInt32Field(value: v, fieldNumber: 5)
6719
+ } }()
6720
+ try { if let v = self._supportedEventIds {
6721
+ try visitor.visitSingularBytesField(value: v, fieldNumber: 6)
6722
+ } }()
6620
6723
  try unknownFields.traverse(visitor: &visitor)
6621
6724
  }
6622
6725
 
@@ -6625,6 +6728,8 @@ extension BlueOssSoMobile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
6625
6728
  if lhs._dataFile != rhs._dataFile {return false}
6626
6729
  if lhs._blacklistFile != rhs._blacklistFile {return false}
6627
6730
  if lhs._customerExtensionsFile != rhs._customerExtensionsFile {return false}
6731
+ if lhs._requestedEventCount != rhs._requestedEventCount {return false}
6732
+ if lhs._supportedEventIds != rhs._supportedEventIds {return false}
6628
6733
  if lhs.unknownFields != rhs.unknownFields {return false}
6629
6734
  return true
6630
6735
  }
@@ -0,0 +1,26 @@
1
+ import Network
2
+ import Combine
3
+
4
+ internal final class BlueNetworkMonitorService {
5
+ let networkStatus = PassthroughSubject<Bool, Never>()
6
+
7
+ private let pathMonitor = NWPathMonitor()
8
+ private let pathMonitorQueue = DispatchQueue(label: "blueid.network-monitor")
9
+
10
+ private var connected: Bool = false
11
+
12
+ init() {
13
+ pathMonitor.pathUpdateHandler = { [weak self] path in
14
+ guard let self else { return }
15
+
16
+ self.connected = path.status == .satisfied
17
+ self.networkStatus.send(self.connected)
18
+ }
19
+
20
+ pathMonitor.start(queue: pathMonitorQueue)
21
+ }
22
+
23
+ func isConnected() -> Bool {
24
+ return connected
25
+ }
26
+ }
@@ -339,7 +339,7 @@ public struct BlueReadOssSoCredentialCommand: BlueCommand {
339
339
  /**
340
340
  * @class BlueWriteOssSoCredentialCommand represents a command to write/update a credential for a transponder using NFC communication.
341
341
  */
342
- public class BlueWriteOssSoCredentialCommand: BlueAPIAsyncCommand {
342
+ public class BlueWriteOssSoCredentialCommand: BlueSdkAsyncCommand {
343
343
  override func runAsync(arg0: Any?, arg1: Any?, arg2: Any?) async throws -> Any? {
344
344
  return try await runAsync(
345
345
  credentialID: blueCastArg(String.self, arg0),
@@ -390,7 +390,7 @@ public class BlueWriteOssSoCredentialCommand: BlueAPIAsyncCommand {
390
390
 
391
391
  // push transponder's events to the backend
392
392
  try blueRunAsyncBlocking {
393
- try await BlueOssSoAPIHelper(self.blueAPI!)
393
+ try await self.sdkService.ossSoService
394
394
  .pushEventLogs(nfcCredential: credential, ossSoConfiguration: transponderConfiguration)
395
395
  }
396
396
 
@@ -400,7 +400,7 @@ public class BlueWriteOssSoCredentialCommand: BlueAPIAsyncCommand {
400
400
 
401
401
  // sync and get configuration, if any
402
402
  let newConfiguration = try blueRunAsyncBlocking {
403
- return try await BlueOssSoAPIHelper(self.blueAPI!)
403
+ return try await self.sdkService.ossSoService
404
404
  .synchronizeOfflineCredential(nfcCredential: credential, offlineCredentialID: credentialID)
405
405
  }
406
406
 
@@ -425,7 +425,7 @@ public class BlueWriteOssSoCredentialCommand: BlueAPIAsyncCommand {
425
425
  * This class encapsulates the process of starting an NFC session, reading the transponder configuration, retrieving a fresh configuration from the backend, and writing it back to the transponder.
426
426
  * Subsequently, transponder events are pushed to the backend.
427
427
  */
428
- public class BlueRefreshOssSoCredentialCommand: BlueAPIAsyncCommand {
428
+ public class BlueRefreshOssSoCredentialCommand: BlueSdkAsyncCommand {
429
429
  override func runAsync(arg0: Any?, arg1: Any?, arg2: Any?) async throws -> Any? {
430
430
  return try await runAsync(
431
431
  organisation: blueCastArg(String.self, arg0),
@@ -460,7 +460,7 @@ public class BlueRefreshOssSoCredentialCommand: BlueAPIAsyncCommand {
460
460
 
461
461
  // push transponder's events to the backend
462
462
  try blueRunAsyncBlocking {
463
- try await BlueOssSoAPIHelper(self.blueAPI!)
463
+ try await self.sdkService.ossSoService
464
464
  .pushEventLogs(nfcCredential: credential, ossSoConfiguration: transponderConfiguration)
465
465
  }
466
466
 
@@ -469,7 +469,7 @@ public class BlueRefreshOssSoCredentialCommand: BlueAPIAsyncCommand {
469
469
 
470
470
  // sync and get configuration, if any
471
471
  let newConfiguration: BlueOssSoConfiguration? = try blueRunAsyncBlocking {
472
- return try await BlueOssSoAPIHelper(self.blueAPI!)
472
+ return try await self.sdkService.ossSoService
473
473
  .synchronizeOfflineCredential(nfcCredential: credential, offlineCredentialID: transponderConfiguration.info.credentialID.id)
474
474
  }
475
475
 
@@ -495,7 +495,7 @@ public class BlueRefreshOssSoCredentialCommand: BlueAPIAsyncCommand {
495
495
  * This class encapsulates the process of starting an NFC session, reading each transponder configuration, retrieving a fresh configuration from the backend, and writing it back to the transponder.
496
496
  * Subsequently, transponder events are pushed to the backend.
497
497
  */
498
- public class BlueRefreshOssSoCredentialsCommand: BlueAPIAsyncCommand {
498
+ public class BlueRefreshOssSoCredentialsCommand: BlueSdkAsyncCommand {
499
499
 
500
500
  override func runAsync(arg0: Any?, arg1: Any?, arg2: Any?) async throws -> Any? {
501
501
  return try await runAsync()
@@ -550,7 +550,7 @@ public class BlueRefreshOssSoCredentialsCommand: BlueAPIAsyncCommand {
550
550
 
551
551
  // push transponder's events to the backend
552
552
  try blueRunAsyncBlocking {
553
- try await BlueOssSoAPIHelper(self.blueAPI!)
553
+ try await self.sdkService.ossSoService
554
554
  .pushEventLogs(nfcCredential: credential, ossSoConfiguration: transponderConfiguration)
555
555
  }
556
556
 
@@ -559,7 +559,7 @@ public class BlueRefreshOssSoCredentialsCommand: BlueAPIAsyncCommand {
559
559
 
560
560
  // sync and get configuration, if any
561
561
  let newConfiguration: BlueOssSoConfiguration? = try blueRunAsyncBlocking {
562
- return try await BlueOssSoAPIHelper(self.blueAPI!)
562
+ return try await self.sdkService.ossSoService
563
563
  .synchronizeOfflineCredential(nfcCredential: credential, offlineCredentialID: transponderConfiguration.info.credentialID.id)
564
564
  }
565
565
 
@@ -0,0 +1,18 @@
1
+
2
+ struct BlueSdkService {
3
+ let apiService: BlueAPIProtocol
4
+ let eventService: BlueAccessEventServiceProtocol
5
+
6
+ init(_ apiService: BlueAPIProtocol, _ eventService: BlueAccessEventServiceProtocol) {
7
+ self.apiService = apiService
8
+ self.eventService = eventService
9
+ }
10
+
11
+ var authenticationTokenService: BlueAccessAPIHelper {
12
+ return BlueAccessAPIHelper(apiService)
13
+ }
14
+
15
+ var ossSoService: BlueOssSoAPIHelper {
16
+ return BlueOssSoAPIHelper(apiService)
17
+ }
18
+ }
@@ -167,7 +167,7 @@ internal func blueHasSpTokenForAction(device: BlueDevice, action: String) -> Boo
167
167
  }
168
168
  }
169
169
 
170
- private func blueGetSpTokenForAction(device: BlueDevice, action: String, data: Data?) throws -> BlueSPToken {
170
+ internal func blueGetSpTokenForAction(device: BlueDevice, action: String, data: Data?) throws -> BlueSPToken {
171
171
  var token: BlueSPToken? = try blueGetSpToken("\(device.info.deviceID):\(action)")
172
172
 
173
173
  if token == nil {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueid/access-capacitor",
3
- "version": "0.91.0",
3
+ "version": "0.93.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",