@blueid/access-capacitor 0.106.0 → 0.107.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/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/BlueAccess.swift +1 -43
- package/ios/Plugin/BlueIDAccessSDK/BlueCommands.swift +1 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueSystem.swift +46 -27
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -139,7 +139,6 @@ public class BlueSynchronizeAccessDeviceCommand: BlueSdkAsyncCommand {
|
|
|
139
139
|
case deployBlacklistEntries
|
|
140
140
|
case getSystemStatus
|
|
141
141
|
case pushSystemStatus
|
|
142
|
-
case checkLatestFirmware
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
internal override func runAsync(arg0: Any? = nil, arg1: Any? = nil, arg2: Any? = nil) async throws -> Any? {
|
|
@@ -267,20 +266,6 @@ public class BlueSynchronizeAccessDeviceCommand: BlueSdkAsyncCommand {
|
|
|
267
266
|
|
|
268
267
|
try await self.pushDeviceSystemStatus(status: status, with: tokenAuthentication)
|
|
269
268
|
|
|
270
|
-
return .result(status)
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
BlueTask(
|
|
274
|
-
id: BlueSynchronizeAccessTaskId.checkLatestFirmware,
|
|
275
|
-
label: blueI18n.syncDeviceCheckLatestFwlabel,
|
|
276
|
-
failable: true
|
|
277
|
-
) {_, runner in
|
|
278
|
-
let tokenAuthentication: BlueTokenAuthentication = try runner.getResult(BlueSynchronizeAccessTaskId.getAuthenticationToken)
|
|
279
|
-
var status: BlueSystemStatus = try runner.getResult(BlueSynchronizeAccessTaskId.pushSystemStatus)
|
|
280
|
-
let latestFW = try await self.sdkService.apiService.getLatestFirmware(deviceID: deviceID, with: tokenAuthentication).getData()
|
|
281
|
-
|
|
282
|
-
self.updateFirmwareFlags(&status, latestFW)
|
|
283
|
-
|
|
284
269
|
return .result(status)
|
|
285
270
|
}
|
|
286
271
|
]
|
|
@@ -298,11 +283,6 @@ public class BlueSynchronizeAccessDeviceCommand: BlueSdkAsyncCommand {
|
|
|
298
283
|
#endif
|
|
299
284
|
|
|
300
285
|
if runner.isSuccessful() {
|
|
301
|
-
let status: BlueSystemStatus? = try runner.getResult(BlueSynchronizeAccessTaskId.checkLatestFirmware)
|
|
302
|
-
if let status = status {
|
|
303
|
-
return status
|
|
304
|
-
}
|
|
305
|
-
|
|
306
286
|
return try runner.getResult(BlueSynchronizeAccessTaskId.pushSystemStatus)
|
|
307
287
|
}
|
|
308
288
|
|
|
@@ -349,11 +329,7 @@ public class BlueSynchronizeAccessDeviceCommand: BlueSdkAsyncCommand {
|
|
|
349
329
|
|
|
350
330
|
private func getSystemStatus(_ deviceID: String) async throws -> BlueSystemStatus {
|
|
351
331
|
do {
|
|
352
|
-
return try await
|
|
353
|
-
deviceID: deviceID,
|
|
354
|
-
timeoutSeconds: 30.0,
|
|
355
|
-
action: "STATUS"
|
|
356
|
-
)
|
|
332
|
+
return try await BlueGetSystemStatusCommand(sdkService).runAsync(deviceID: deviceID)
|
|
357
333
|
} catch {
|
|
358
334
|
throw BlueError(.sdkGetSystemStatusFailed, cause: error)
|
|
359
335
|
}
|
|
@@ -518,24 +494,6 @@ public class BlueSynchronizeAccessDeviceCommand: BlueSdkAsyncCommand {
|
|
|
518
494
|
|
|
519
495
|
} while (sent < limit && offset < entriesCount)
|
|
520
496
|
}
|
|
521
|
-
|
|
522
|
-
internal func updateFirmwareFlags(_ status: inout BlueSystemStatus, _ latestFW: BlueGetLatestFirmwareResult) {
|
|
523
|
-
if let testFW = latestFW.test {
|
|
524
|
-
if let testVersion = testFW.testVersion {
|
|
525
|
-
status.newTestFirmwareVersionAvailable = testVersion != status.applicationVersionTest || testFW.version != status.applicationVersion
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
if let productionFW = latestFW.production {
|
|
530
|
-
let isTestVersion = status.hasApplicationVersionTest && status.applicationVersionTest != 0
|
|
531
|
-
|
|
532
|
-
if isTestVersion {
|
|
533
|
-
status.newFirmwareVersionAvailable = true
|
|
534
|
-
} else {
|
|
535
|
-
status.newFirmwareVersionAvailable = productionFW.version != status.applicationVersion
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
497
|
}
|
|
540
498
|
|
|
541
499
|
public class BlueGetAccessObjectsCommand: BlueSdkAsyncCommand {
|
|
@@ -89,7 +89,7 @@ public struct BlueCommands {
|
|
|
89
89
|
public let clearBlacklist = BlueClearBlacklistCommand()
|
|
90
90
|
public let clearEventLog = BlueClearEventLogCommand()
|
|
91
91
|
public let clearSystemLog = BlueClearSystemLogCommand()
|
|
92
|
-
public let getSystemStatus = BlueGetSystemStatusCommand()
|
|
92
|
+
public let getSystemStatus = BlueGetSystemStatusCommand(defaultSdkService)
|
|
93
93
|
|
|
94
94
|
public let openAppSettings = BlueOpenAppSettingsCommand()
|
|
95
95
|
|
|
@@ -7,38 +7,14 @@ public class BlueAsyncTerminalCommand: BlueAsyncCommand {
|
|
|
7
7
|
init(action: String) { self.action = action }
|
|
8
8
|
|
|
9
9
|
internal func runAsync(arg0: Any? = nil, arg1: Any? = nil, arg2: Any? = nil) async throws -> Any? {
|
|
10
|
-
|
|
11
|
-
return try await runAsync(deviceID: try blueCastArg(String.self, arg0))
|
|
12
|
-
} else {
|
|
13
|
-
throw BlueError(.unavailable)
|
|
14
|
-
}
|
|
10
|
+
return try await runAsync(deviceID: try blueCastArg(String.self, arg0))
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
@available(macOS 10.15, *)
|
|
18
13
|
public func runAsync(deviceID: String) async throws {
|
|
19
14
|
return try await blueTerminalRun(deviceID: deviceID, timeoutSeconds: 30.0, action: action)
|
|
20
15
|
}
|
|
21
16
|
}
|
|
22
17
|
|
|
23
|
-
public class BlueAsyncTerminalCommandWithResult<T>: BlueAsyncCommand where T: Message {
|
|
24
|
-
let action: String
|
|
25
|
-
|
|
26
|
-
init(action: String) { self.action = action }
|
|
27
|
-
|
|
28
|
-
internal func runAsync(arg0: Any? = nil, arg1: Any? = nil, arg2: Any? = nil) async throws -> Any? {
|
|
29
|
-
if #available(macOS 10.15, *) {
|
|
30
|
-
return try await runAsync(deviceID: try blueCastArg(String.self, arg0))
|
|
31
|
-
} else {
|
|
32
|
-
throw BlueError(.unavailable)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@available(macOS 10.15, *)
|
|
37
|
-
public func runAsync(deviceID: String) async throws -> T {
|
|
38
|
-
return try await blueTerminalRun(deviceID: deviceID, timeoutSeconds: 30.0, action: action)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
18
|
public class BlueClearBlacklistCommand: BlueAsyncTerminalCommand {
|
|
43
19
|
init() { super.init(action: "BL_CLEAR") }
|
|
44
20
|
}
|
|
@@ -51,6 +27,49 @@ public class BlueClearSystemLogCommand: BlueAsyncTerminalCommand {
|
|
|
51
27
|
init() { super.init(action: "SL_CLEAR") }
|
|
52
28
|
}
|
|
53
29
|
|
|
54
|
-
public class BlueGetSystemStatusCommand:
|
|
55
|
-
|
|
30
|
+
public class BlueGetSystemStatusCommand: BlueSdkAsyncCommand {
|
|
31
|
+
internal override func runAsync(arg0: Any? = nil, arg1: Any? = nil, arg2: Any? = nil) async throws -> Any? {
|
|
32
|
+
return try await runAsync(
|
|
33
|
+
deviceID: try blueCastArg(String.self, arg0)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public func runAsync(deviceID: String) async throws -> BlueSystemStatus {
|
|
38
|
+
var status: BlueSystemStatus = try await blueTerminalRun(deviceID: deviceID, timeoutSeconds: 30.0, action: "STATUS")
|
|
39
|
+
|
|
40
|
+
do {
|
|
41
|
+
let credentials = try BlueGetAccessCredentialsCommand().run(credentialType: .maintenance, for: deviceID, includePrivateKey: true)
|
|
42
|
+
|
|
43
|
+
if let credential = credentials.credentials.first {
|
|
44
|
+
let tokenAuthentication = try await sdkService.authenticationTokenService
|
|
45
|
+
.getTokenAuthentication(credential: credential)
|
|
46
|
+
|
|
47
|
+
let latestFW = try await self.sdkService.apiService.getLatestFirmware(deviceID: deviceID, with: tokenAuthentication).getData()
|
|
48
|
+
|
|
49
|
+
self.updateFirmwareFlags(&status, latestFW)
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
blueLogError(error.localizedDescription)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return status
|
|
56
|
+
}
|
|
57
|
+
|
|
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
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if let productionFW = latestFW.production {
|
|
66
|
+
let isTestVersion = status.hasApplicationVersionTest && status.applicationVersionTest != 0
|
|
67
|
+
|
|
68
|
+
if isTestVersion {
|
|
69
|
+
status.newFirmwareVersionAvailable = true
|
|
70
|
+
} else {
|
|
71
|
+
status.newFirmwareVersionAvailable = productionFW.version != status.applicationVersion
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
56
75
|
}
|