@blueid/access-capacitor 0.78.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/BlueSDK_pb.d.ts +43 -1
- package/dist/esm/BlueSDK_pb.js +59 -1
- package/dist/esm/BlueSDK_pb.js.map +1 -1
- package/dist/plugin.cjs.js +63 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +63 -1
- package/dist/plugin.js.map +1 -1
- package/ios/CBlueIDAccess.xcframework/Info.plist +8 -8
- package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAccessSync.swift +66 -3
- package/ios/Plugin/BlueIDAccessSDK/BlueCommands.swift +1 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueSDK.pb.swift +147 -0
- package/ios/Plugin/BlueIDAccessSDK/Extensions.swift +6 -0
- package/package.json +1 -1
|
@@ -10,16 +10,15 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<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>
|
|
21
|
+
<string>ios</string>
|
|
23
22
|
</dict>
|
|
24
23
|
<dict>
|
|
25
24
|
<key>BinaryPath</key>
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
<key>HeadersPath</key>
|
|
28
27
|
<string>Headers</string>
|
|
29
28
|
<key>LibraryIdentifier</key>
|
|
30
|
-
<string>
|
|
29
|
+
<string>macos-arm64_x86_64</string>
|
|
31
30
|
<key>LibraryPath</key>
|
|
32
31
|
<string>libCBlueIDAccess.a</string>
|
|
33
32
|
<key>SupportedArchitectures</key>
|
|
@@ -36,9 +35,7 @@
|
|
|
36
35
|
<string>x86_64</string>
|
|
37
36
|
</array>
|
|
38
37
|
<key>SupportedPlatform</key>
|
|
39
|
-
<string>
|
|
40
|
-
<key>SupportedPlatformVariant</key>
|
|
41
|
-
<string>simulator</string>
|
|
38
|
+
<string>macos</string>
|
|
42
39
|
</dict>
|
|
43
40
|
<dict>
|
|
44
41
|
<key>BinaryPath</key>
|
|
@@ -46,15 +43,18 @@
|
|
|
46
43
|
<key>HeadersPath</key>
|
|
47
44
|
<string>Headers</string>
|
|
48
45
|
<key>LibraryIdentifier</key>
|
|
49
|
-
<string>ios-
|
|
46
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
50
47
|
<key>LibraryPath</key>
|
|
51
48
|
<string>libCBlueIDAccess.a</string>
|
|
52
49
|
<key>SupportedArchitectures</key>
|
|
53
50
|
<array>
|
|
54
51
|
<string>arm64</string>
|
|
52
|
+
<string>x86_64</string>
|
|
55
53
|
</array>
|
|
56
54
|
<key>SupportedPlatform</key>
|
|
57
55
|
<string>ios</string>
|
|
56
|
+
<key>SupportedPlatformVariant</key>
|
|
57
|
+
<string>simulator</string>
|
|
58
58
|
</dict>
|
|
59
59
|
</array>
|
|
60
60
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -56,9 +56,7 @@ internal class BlueAbstractSynchronizeAccessCommand<T>: BlueAPIAsyncCommand wher
|
|
|
56
56
|
return
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
}
|
|
59
|
+
let synchronizationResult = try response.getData()
|
|
62
60
|
|
|
63
61
|
if synchronizationResult.noRefresh == true {
|
|
64
62
|
return
|
|
@@ -188,3 +186,68 @@ internal class BlueSynchronizeMobileAccessCommand: BlueAbstractSynchronizeAccess
|
|
|
188
186
|
blueAccessDevicesStorage.deleteEntry(id: credential.credentialID.id)
|
|
189
187
|
}
|
|
190
188
|
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @class BlueSynchronizeAccessCredentialsCommand
|
|
192
|
+
* A command to synchronize all stored credentials.
|
|
193
|
+
*/
|
|
194
|
+
public class BlueSynchronizeAccessCredentialsCommand: BlueAPIAsyncCommand {
|
|
195
|
+
internal override func runAsync(arg0: Any?, arg1: Any?, arg2: Any?) async throws -> Any? {
|
|
196
|
+
return try await runAsync()
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/// Synchronizes all stored credentials.
|
|
200
|
+
/// Note: Master credentials are not synced in case of any, as they can only be synced once during the claiming process.
|
|
201
|
+
///
|
|
202
|
+
/// - throws: Throws an error of type `BlueError(.sdkUnsupportedPlatform)` If the macOS version is earlier than 10.15.
|
|
203
|
+
/// - returns: The exit status (BlueReturnCode) of each credential, and its error description, if any.
|
|
204
|
+
public func runAsync() async throws -> BlueSynchronizeAccessCredentials {
|
|
205
|
+
guard #available(macOS 10.15, *) else {
|
|
206
|
+
throw BlueError(.sdkUnsupportedPlatform)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let credentials = try await BlueGetAccessCredentialsCommand().runAsync().credentials
|
|
210
|
+
.filter { $0.credentialType != .master }
|
|
211
|
+
|
|
212
|
+
if (credentials.isEmpty) {
|
|
213
|
+
return BlueSynchronizeAccessCredentials()
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return await withTaskGroup(of: BlueSynchronizeAccessCredential.self, returning: BlueSynchronizeAccessCredentials.self) { group in
|
|
217
|
+
|
|
218
|
+
for credential in credentials {
|
|
219
|
+
group.addTask { await self.handleCredential(credential) }
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
var credentials: [BlueSynchronizeAccessCredential] = []
|
|
223
|
+
|
|
224
|
+
for await resultItem in group {
|
|
225
|
+
credentials.append(resultItem)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return BlueSynchronizeAccessCredentials(credentials: credentials)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
private func handleCredential(_ credential: BlueAccessCredential) async -> BlueSynchronizeAccessCredential {
|
|
233
|
+
var resultItem = BlueSynchronizeAccessCredential()
|
|
234
|
+
resultItem.credentialID.id = credential.credentialID.id
|
|
235
|
+
|
|
236
|
+
do {
|
|
237
|
+
try await BlueSynchronizeAccessCredentialCommand(self.blueAPI)
|
|
238
|
+
.runAsync(credentialID: credential.credentialID.id, forceRefresh: true)
|
|
239
|
+
|
|
240
|
+
resultItem.returnCode = .ok
|
|
241
|
+
}
|
|
242
|
+
catch let error as BlueError {
|
|
243
|
+
resultItem.returnCode = error.returnCode
|
|
244
|
+
resultItem.errorDescription = error.localizedDescription
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
resultItem.returnCode = .error
|
|
248
|
+
resultItem.errorDescription = error.localizedDescription
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return resultItem
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -74,6 +74,7 @@ public struct BlueCommands {
|
|
|
74
74
|
public let claimAccessCredential = BlueClaimAccessCredentialCommand()
|
|
75
75
|
public let getAccessCredentials = BlueGetAccessCredentialsCommand()
|
|
76
76
|
public let synchronizeAccessCredential = BlueSynchronizeAccessCredentialCommand()
|
|
77
|
+
public let synchronizeAccessCredentials = BlueSynchronizeAccessCredentialsCommand()
|
|
77
78
|
public let getAccessDevices = BlueGetAccessDevicesCommand()
|
|
78
79
|
public let listAccessDevices = BlueListAccessDevicesCommand()
|
|
79
80
|
public let updateDeviceConfiguration = BlueUpdateDeviceConfigurationCommand()
|
|
@@ -751,6 +751,59 @@ public struct BlueRefreshOssSoCredentials {
|
|
|
751
751
|
public init() {}
|
|
752
752
|
}
|
|
753
753
|
|
|
754
|
+
public struct BlueSynchronizeAccessCredential {
|
|
755
|
+
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
756
|
+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
757
|
+
// methods supported on all messages.
|
|
758
|
+
|
|
759
|
+
public var credentialID: BlueCredentialId {
|
|
760
|
+
get {return _credentialID ?? BlueCredentialId()}
|
|
761
|
+
set {_credentialID = newValue}
|
|
762
|
+
}
|
|
763
|
+
/// Returns true if `credentialID` has been explicitly set.
|
|
764
|
+
public var hasCredentialID: Bool {return self._credentialID != nil}
|
|
765
|
+
/// Clears the value of `credentialID`. Subsequent reads from it will return its default value.
|
|
766
|
+
public mutating func clearCredentialID() {self._credentialID = nil}
|
|
767
|
+
|
|
768
|
+
public var returnCode: BlueReturnCode {
|
|
769
|
+
get {return _returnCode ?? .ok}
|
|
770
|
+
set {_returnCode = newValue}
|
|
771
|
+
}
|
|
772
|
+
/// Returns true if `returnCode` has been explicitly set.
|
|
773
|
+
public var hasReturnCode: Bool {return self._returnCode != nil}
|
|
774
|
+
/// Clears the value of `returnCode`. Subsequent reads from it will return its default value.
|
|
775
|
+
public mutating func clearReturnCode() {self._returnCode = nil}
|
|
776
|
+
|
|
777
|
+
public var errorDescription: String {
|
|
778
|
+
get {return _errorDescription ?? String()}
|
|
779
|
+
set {_errorDescription = newValue}
|
|
780
|
+
}
|
|
781
|
+
/// Returns true if `errorDescription` has been explicitly set.
|
|
782
|
+
public var hasErrorDescription: Bool {return self._errorDescription != nil}
|
|
783
|
+
/// Clears the value of `errorDescription`. Subsequent reads from it will return its default value.
|
|
784
|
+
public mutating func clearErrorDescription() {self._errorDescription = nil}
|
|
785
|
+
|
|
786
|
+
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
787
|
+
|
|
788
|
+
public init() {}
|
|
789
|
+
|
|
790
|
+
fileprivate var _credentialID: BlueCredentialId? = nil
|
|
791
|
+
fileprivate var _returnCode: BlueReturnCode? = nil
|
|
792
|
+
fileprivate var _errorDescription: String? = nil
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
public struct BlueSynchronizeAccessCredentials {
|
|
796
|
+
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
797
|
+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
798
|
+
// methods supported on all messages.
|
|
799
|
+
|
|
800
|
+
public var credentials: [BlueSynchronizeAccessCredential] = []
|
|
801
|
+
|
|
802
|
+
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
803
|
+
|
|
804
|
+
public init() {}
|
|
805
|
+
}
|
|
806
|
+
|
|
754
807
|
#if swift(>=5.5) && canImport(_Concurrency)
|
|
755
808
|
extension BlueDeviceType: @unchecked Sendable {}
|
|
756
809
|
extension BlueRefreshOssSoCredentialStatus: @unchecked Sendable {}
|
|
@@ -767,6 +820,8 @@ extension BlueAccessObject: @unchecked Sendable {}
|
|
|
767
820
|
extension BlueAccessObjectList: @unchecked Sendable {}
|
|
768
821
|
extension BlueRefreshOssSoCredential: @unchecked Sendable {}
|
|
769
822
|
extension BlueRefreshOssSoCredentials: @unchecked Sendable {}
|
|
823
|
+
extension BlueSynchronizeAccessCredential: @unchecked Sendable {}
|
|
824
|
+
extension BlueSynchronizeAccessCredentials: @unchecked Sendable {}
|
|
770
825
|
#endif // swift(>=5.5) && canImport(_Concurrency)
|
|
771
826
|
|
|
772
827
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
@@ -1715,3 +1770,95 @@ extension BlueRefreshOssSoCredentials: SwiftProtobuf.Message, SwiftProtobuf._Mes
|
|
|
1715
1770
|
return true
|
|
1716
1771
|
}
|
|
1717
1772
|
}
|
|
1773
|
+
|
|
1774
|
+
extension BlueSynchronizeAccessCredential: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
1775
|
+
public static let protoMessageName: String = "BlueSynchronizeAccessCredential"
|
|
1776
|
+
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1777
|
+
1: .same(proto: "credentialId"),
|
|
1778
|
+
2: .same(proto: "returnCode"),
|
|
1779
|
+
3: .same(proto: "errorDescription"),
|
|
1780
|
+
]
|
|
1781
|
+
|
|
1782
|
+
public var isInitialized: Bool {
|
|
1783
|
+
if self._credentialID == nil {return false}
|
|
1784
|
+
if self._returnCode == nil {return false}
|
|
1785
|
+
if let v = self._credentialID, !v.isInitialized {return false}
|
|
1786
|
+
return true
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
1790
|
+
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
1791
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
1792
|
+
// allocates stack space for every case branch when no optimizations are
|
|
1793
|
+
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
1794
|
+
switch fieldNumber {
|
|
1795
|
+
case 1: try { try decoder.decodeSingularMessageField(value: &self._credentialID) }()
|
|
1796
|
+
case 2: try { try decoder.decodeSingularEnumField(value: &self._returnCode) }()
|
|
1797
|
+
case 3: try { try decoder.decodeSingularStringField(value: &self._errorDescription) }()
|
|
1798
|
+
default: break
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
1804
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
1805
|
+
// allocates stack space for every if/case branch local when no optimizations
|
|
1806
|
+
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
1807
|
+
// https://github.com/apple/swift-protobuf/issues/1182
|
|
1808
|
+
try { if let v = self._credentialID {
|
|
1809
|
+
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
|
1810
|
+
} }()
|
|
1811
|
+
try { if let v = self._returnCode {
|
|
1812
|
+
try visitor.visitSingularEnumField(value: v, fieldNumber: 2)
|
|
1813
|
+
} }()
|
|
1814
|
+
try { if let v = self._errorDescription {
|
|
1815
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 3)
|
|
1816
|
+
} }()
|
|
1817
|
+
try unknownFields.traverse(visitor: &visitor)
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
public static func ==(lhs: BlueSynchronizeAccessCredential, rhs: BlueSynchronizeAccessCredential) -> Bool {
|
|
1821
|
+
if lhs._credentialID != rhs._credentialID {return false}
|
|
1822
|
+
if lhs._returnCode != rhs._returnCode {return false}
|
|
1823
|
+
if lhs._errorDescription != rhs._errorDescription {return false}
|
|
1824
|
+
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
1825
|
+
return true
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
extension BlueSynchronizeAccessCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
1830
|
+
public static let protoMessageName: String = "BlueSynchronizeAccessCredentials"
|
|
1831
|
+
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1832
|
+
1: .same(proto: "credentials"),
|
|
1833
|
+
]
|
|
1834
|
+
|
|
1835
|
+
public var isInitialized: Bool {
|
|
1836
|
+
if !SwiftProtobuf.Internal.areAllInitialized(self.credentials) {return false}
|
|
1837
|
+
return true
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
1841
|
+
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
1842
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
1843
|
+
// allocates stack space for every case branch when no optimizations are
|
|
1844
|
+
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
1845
|
+
switch fieldNumber {
|
|
1846
|
+
case 1: try { try decoder.decodeRepeatedMessageField(value: &self.credentials) }()
|
|
1847
|
+
default: break
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
1853
|
+
if !self.credentials.isEmpty {
|
|
1854
|
+
try visitor.visitRepeatedMessageField(value: self.credentials, fieldNumber: 1)
|
|
1855
|
+
}
|
|
1856
|
+
try unknownFields.traverse(visitor: &visitor)
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
public static func ==(lhs: BlueSynchronizeAccessCredentials, rhs: BlueSynchronizeAccessCredentials) -> Bool {
|
|
1860
|
+
if lhs.credentials != rhs.credentials {return false}
|
|
1861
|
+
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
1862
|
+
return true
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
@@ -198,6 +198,12 @@ extension BlueRefreshOssSoCredentials {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
extension BlueSynchronizeAccessCredentials {
|
|
202
|
+
public init(credentials: [BlueSynchronizeAccessCredential]) {
|
|
203
|
+
self.credentials = credentials
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
201
207
|
extension Array {
|
|
202
208
|
|
|
203
209
|
/// Extension function for Arrays, allowing the splitting of the collection into subarrays of a specified size.
|