@blueid/access-capacitor 0.93.0 → 0.95.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/BlueCore_pb.d.ts +20 -0
- package/dist/esm/BlueCore_pb.js +25 -0
- package/dist/esm/BlueCore_pb.js.map +1 -1
- package/dist/esm/BlueSDK_pb.d.ts +72 -12
- package/dist/esm/BlueSDK_pb.js +24 -9
- package/dist/esm/BlueSDK_pb.js.map +1 -1
- package/dist/plugin.cjs.js +49 -9
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +49 -9
- package/dist/plugin.js.map +1 -1
- package/ios/CBlueIDAccess.xcframework/Info.plist +8 -8
- package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/BlueCore.pb.h +5 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/BlueCore.pb.h +5 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/Headers/core/BlueCore.pb.h +5 -0
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAccess.swift +209 -58
- package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +20 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/{BlueModalSession.swift → BlueAccessDeviceModalSession.swift} +5 -5
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/{BlueModalView.swift → BlueAccessDeviceModalView.swift} +11 -22
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/BlueModal+Extensions.swift +14 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/BlueModal.swift +50 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/BlueSynchronizeAccessDeviceModalSession.swift +56 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/BlueSynchronizeAccessDeviceModalView.swift +237 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueSDK.pb.swift +310 -40
- package/ios/Plugin/BlueIDAccessSDK/BlueTaskRunner.swift +155 -0
- package/package.json +1 -1
|
@@ -180,15 +180,6 @@ public struct BlueI18n {
|
|
|
180
180
|
/// Clears the value of `nfcInitializingWritingProcess`. Subsequent reads from it will return its default value.
|
|
181
181
|
public mutating func clearNfcInitializingWritingProcess() {_uniqueStorage()._nfcInitializingWritingProcess = nil}
|
|
182
182
|
|
|
183
|
-
public var cmnCancelLabel: String {
|
|
184
|
-
get {return _storage._cmnCancelLabel ?? "Cancel"}
|
|
185
|
-
set {_uniqueStorage()._cmnCancelLabel = newValue}
|
|
186
|
-
}
|
|
187
|
-
/// Returns true if `cmnCancelLabel` has been explicitly set.
|
|
188
|
-
public var hasCmnCancelLabel: Bool {return _storage._cmnCancelLabel != nil}
|
|
189
|
-
/// Clears the value of `cmnCancelLabel`. Subsequent reads from it will return its default value.
|
|
190
|
-
public mutating func clearCmnCancelLabel() {_uniqueStorage()._cmnCancelLabel = nil}
|
|
191
|
-
|
|
192
183
|
public var openViaOssTitle: String {
|
|
193
184
|
get {return _storage._openViaOssTitle ?? "Unlocking in Progress"}
|
|
194
185
|
set {_uniqueStorage()._openViaOssTitle = newValue}
|
|
@@ -261,6 +252,150 @@ public struct BlueI18n {
|
|
|
261
252
|
/// Clears the value of `openViaOssErrorTitle`. Subsequent reads from it will return its default value.
|
|
262
253
|
public mutating func clearOpenViaOssErrorTitle() {_uniqueStorage()._openViaOssErrorTitle = nil}
|
|
263
254
|
|
|
255
|
+
public var cmnCancelLabel: String {
|
|
256
|
+
get {return _storage._cmnCancelLabel ?? "Cancel"}
|
|
257
|
+
set {_uniqueStorage()._cmnCancelLabel = newValue}
|
|
258
|
+
}
|
|
259
|
+
/// Returns true if `cmnCancelLabel` has been explicitly set.
|
|
260
|
+
public var hasCmnCancelLabel: Bool {return _storage._cmnCancelLabel != nil}
|
|
261
|
+
/// Clears the value of `cmnCancelLabel`. Subsequent reads from it will return its default value.
|
|
262
|
+
public mutating func clearCmnCancelLabel() {_uniqueStorage()._cmnCancelLabel = nil}
|
|
263
|
+
|
|
264
|
+
public var cmnCloseLabel: String {
|
|
265
|
+
get {return _storage._cmnCloseLabel ?? "Close"}
|
|
266
|
+
set {_uniqueStorage()._cmnCloseLabel = newValue}
|
|
267
|
+
}
|
|
268
|
+
/// Returns true if `cmnCloseLabel` has been explicitly set.
|
|
269
|
+
public var hasCmnCloseLabel: Bool {return _storage._cmnCloseLabel != nil}
|
|
270
|
+
/// Clears the value of `cmnCloseLabel`. Subsequent reads from it will return its default value.
|
|
271
|
+
public mutating func clearCmnCloseLabel() {_uniqueStorage()._cmnCloseLabel = nil}
|
|
272
|
+
|
|
273
|
+
public var syncDeviceInProgressTitle: String {
|
|
274
|
+
get {return _storage._syncDeviceInProgressTitle ?? "Synchronization in Progress"}
|
|
275
|
+
set {_uniqueStorage()._syncDeviceInProgressTitle = newValue}
|
|
276
|
+
}
|
|
277
|
+
/// Returns true if `syncDeviceInProgressTitle` has been explicitly set.
|
|
278
|
+
public var hasSyncDeviceInProgressTitle: Bool {return _storage._syncDeviceInProgressTitle != nil}
|
|
279
|
+
/// Clears the value of `syncDeviceInProgressTitle`. Subsequent reads from it will return its default value.
|
|
280
|
+
public mutating func clearSyncDeviceInProgressTitle() {_uniqueStorage()._syncDeviceInProgressTitle = nil}
|
|
281
|
+
|
|
282
|
+
public var syncDeviceFailedTitle: String {
|
|
283
|
+
get {return _storage._syncDeviceFailedTitle ?? "Synchronization has failed"}
|
|
284
|
+
set {_uniqueStorage()._syncDeviceFailedTitle = newValue}
|
|
285
|
+
}
|
|
286
|
+
/// Returns true if `syncDeviceFailedTitle` has been explicitly set.
|
|
287
|
+
public var hasSyncDeviceFailedTitle: Bool {return _storage._syncDeviceFailedTitle != nil}
|
|
288
|
+
/// Clears the value of `syncDeviceFailedTitle`. Subsequent reads from it will return its default value.
|
|
289
|
+
public mutating func clearSyncDeviceFailedTitle() {_uniqueStorage()._syncDeviceFailedTitle = nil}
|
|
290
|
+
|
|
291
|
+
public var syncDeviceCancellingTitle: String {
|
|
292
|
+
get {return _storage._syncDeviceCancellingTitle ?? "Cancelling..."}
|
|
293
|
+
set {_uniqueStorage()._syncDeviceCancellingTitle = newValue}
|
|
294
|
+
}
|
|
295
|
+
/// Returns true if `syncDeviceCancellingTitle` has been explicitly set.
|
|
296
|
+
public var hasSyncDeviceCancellingTitle: Bool {return _storage._syncDeviceCancellingTitle != nil}
|
|
297
|
+
/// Clears the value of `syncDeviceCancellingTitle`. Subsequent reads from it will return its default value.
|
|
298
|
+
public mutating func clearSyncDeviceCancellingTitle() {_uniqueStorage()._syncDeviceCancellingTitle = nil}
|
|
299
|
+
|
|
300
|
+
public var syncDeviceGetAuthenticationTokenTaskLabel: String {
|
|
301
|
+
get {return _storage._syncDeviceGetAuthenticationTokenTaskLabel ?? "Issue authentication token"}
|
|
302
|
+
set {_uniqueStorage()._syncDeviceGetAuthenticationTokenTaskLabel = newValue}
|
|
303
|
+
}
|
|
304
|
+
/// Returns true if `syncDeviceGetAuthenticationTokenTaskLabel` has been explicitly set.
|
|
305
|
+
public var hasSyncDeviceGetAuthenticationTokenTaskLabel: Bool {return _storage._syncDeviceGetAuthenticationTokenTaskLabel != nil}
|
|
306
|
+
/// Clears the value of `syncDeviceGetAuthenticationTokenTaskLabel`. Subsequent reads from it will return its default value.
|
|
307
|
+
public mutating func clearSyncDeviceGetAuthenticationTokenTaskLabel() {_uniqueStorage()._syncDeviceGetAuthenticationTokenTaskLabel = nil}
|
|
308
|
+
|
|
309
|
+
public var syncDeviceRetrieveDeviceConfigurationTaskLabel: String {
|
|
310
|
+
get {return _storage._syncDeviceRetrieveDeviceConfigurationTaskLabel ?? "Retrieve device configuration"}
|
|
311
|
+
set {_uniqueStorage()._syncDeviceRetrieveDeviceConfigurationTaskLabel = newValue}
|
|
312
|
+
}
|
|
313
|
+
/// Returns true if `syncDeviceRetrieveDeviceConfigurationTaskLabel` has been explicitly set.
|
|
314
|
+
public var hasSyncDeviceRetrieveDeviceConfigurationTaskLabel: Bool {return _storage._syncDeviceRetrieveDeviceConfigurationTaskLabel != nil}
|
|
315
|
+
/// Clears the value of `syncDeviceRetrieveDeviceConfigurationTaskLabel`. Subsequent reads from it will return its default value.
|
|
316
|
+
public mutating func clearSyncDeviceRetrieveDeviceConfigurationTaskLabel() {_uniqueStorage()._syncDeviceRetrieveDeviceConfigurationTaskLabel = nil}
|
|
317
|
+
|
|
318
|
+
public var syncDeviceUpdateDeviceConfigurationTaskLabel: String {
|
|
319
|
+
get {return _storage._syncDeviceUpdateDeviceConfigurationTaskLabel ?? "Update device configuration"}
|
|
320
|
+
set {_uniqueStorage()._syncDeviceUpdateDeviceConfigurationTaskLabel = newValue}
|
|
321
|
+
}
|
|
322
|
+
/// Returns true if `syncDeviceUpdateDeviceConfigurationTaskLabel` has been explicitly set.
|
|
323
|
+
public var hasSyncDeviceUpdateDeviceConfigurationTaskLabel: Bool {return _storage._syncDeviceUpdateDeviceConfigurationTaskLabel != nil}
|
|
324
|
+
/// Clears the value of `syncDeviceUpdateDeviceConfigurationTaskLabel`. Subsequent reads from it will return its default value.
|
|
325
|
+
public mutating func clearSyncDeviceUpdateDeviceConfigurationTaskLabel() {_uniqueStorage()._syncDeviceUpdateDeviceConfigurationTaskLabel = nil}
|
|
326
|
+
|
|
327
|
+
public var syncDeviceUpdateDeviceTimeTaskLabel: String {
|
|
328
|
+
get {return _storage._syncDeviceUpdateDeviceTimeTaskLabel ?? "Update device time"}
|
|
329
|
+
set {_uniqueStorage()._syncDeviceUpdateDeviceTimeTaskLabel = newValue}
|
|
330
|
+
}
|
|
331
|
+
/// Returns true if `syncDeviceUpdateDeviceTimeTaskLabel` has been explicitly set.
|
|
332
|
+
public var hasSyncDeviceUpdateDeviceTimeTaskLabel: Bool {return _storage._syncDeviceUpdateDeviceTimeTaskLabel != nil}
|
|
333
|
+
/// Clears the value of `syncDeviceUpdateDeviceTimeTaskLabel`. Subsequent reads from it will return its default value.
|
|
334
|
+
public mutating func clearSyncDeviceUpdateDeviceTimeTaskLabel() {_uniqueStorage()._syncDeviceUpdateDeviceTimeTaskLabel = nil}
|
|
335
|
+
|
|
336
|
+
public var syncDeviceWaitForDeviceToRestartTaskLabel: String {
|
|
337
|
+
get {return _storage._syncDeviceWaitForDeviceToRestartTaskLabel ?? "Wait for device to restart"}
|
|
338
|
+
set {_uniqueStorage()._syncDeviceWaitForDeviceToRestartTaskLabel = newValue}
|
|
339
|
+
}
|
|
340
|
+
/// Returns true if `syncDeviceWaitForDeviceToRestartTaskLabel` has been explicitly set.
|
|
341
|
+
public var hasSyncDeviceWaitForDeviceToRestartTaskLabel: Bool {return _storage._syncDeviceWaitForDeviceToRestartTaskLabel != nil}
|
|
342
|
+
/// Clears the value of `syncDeviceWaitForDeviceToRestartTaskLabel`. Subsequent reads from it will return its default value.
|
|
343
|
+
public mutating func clearSyncDeviceWaitForDeviceToRestartTaskLabel() {_uniqueStorage()._syncDeviceWaitForDeviceToRestartTaskLabel = nil}
|
|
344
|
+
|
|
345
|
+
public var syncDevicePushEventLogsTaskLabel: String {
|
|
346
|
+
get {return _storage._syncDevicePushEventLogsTaskLabel ?? "Push event logs"}
|
|
347
|
+
set {_uniqueStorage()._syncDevicePushEventLogsTaskLabel = newValue}
|
|
348
|
+
}
|
|
349
|
+
/// Returns true if `syncDevicePushEventLogsTaskLabel` has been explicitly set.
|
|
350
|
+
public var hasSyncDevicePushEventLogsTaskLabel: Bool {return _storage._syncDevicePushEventLogsTaskLabel != nil}
|
|
351
|
+
/// Clears the value of `syncDevicePushEventLogsTaskLabel`. Subsequent reads from it will return its default value.
|
|
352
|
+
public mutating func clearSyncDevicePushEventLogsTaskLabel() {_uniqueStorage()._syncDevicePushEventLogsTaskLabel = nil}
|
|
353
|
+
|
|
354
|
+
public var syncDevicePushSystemLogsTaskLabel: String {
|
|
355
|
+
get {return _storage._syncDevicePushSystemLogsTaskLabel ?? "Push system logs"}
|
|
356
|
+
set {_uniqueStorage()._syncDevicePushSystemLogsTaskLabel = newValue}
|
|
357
|
+
}
|
|
358
|
+
/// Returns true if `syncDevicePushSystemLogsTaskLabel` has been explicitly set.
|
|
359
|
+
public var hasSyncDevicePushSystemLogsTaskLabel: Bool {return _storage._syncDevicePushSystemLogsTaskLabel != nil}
|
|
360
|
+
/// Clears the value of `syncDevicePushSystemLogsTaskLabel`. Subsequent reads from it will return its default value.
|
|
361
|
+
public mutating func clearSyncDevicePushSystemLogsTaskLabel() {_uniqueStorage()._syncDevicePushSystemLogsTaskLabel = nil}
|
|
362
|
+
|
|
363
|
+
public var syncDeviceRetrieveBlacklistEntriesTaskLabel: String {
|
|
364
|
+
get {return _storage._syncDeviceRetrieveBlacklistEntriesTaskLabel ?? "Retrieve blacklist entries"}
|
|
365
|
+
set {_uniqueStorage()._syncDeviceRetrieveBlacklistEntriesTaskLabel = newValue}
|
|
366
|
+
}
|
|
367
|
+
/// Returns true if `syncDeviceRetrieveBlacklistEntriesTaskLabel` has been explicitly set.
|
|
368
|
+
public var hasSyncDeviceRetrieveBlacklistEntriesTaskLabel: Bool {return _storage._syncDeviceRetrieveBlacklistEntriesTaskLabel != nil}
|
|
369
|
+
/// Clears the value of `syncDeviceRetrieveBlacklistEntriesTaskLabel`. Subsequent reads from it will return its default value.
|
|
370
|
+
public mutating func clearSyncDeviceRetrieveBlacklistEntriesTaskLabel() {_uniqueStorage()._syncDeviceRetrieveBlacklistEntriesTaskLabel = nil}
|
|
371
|
+
|
|
372
|
+
public var syncDeviceDeployBlacklistEntriesTaskLabel: String {
|
|
373
|
+
get {return _storage._syncDeviceDeployBlacklistEntriesTaskLabel ?? "Deploy blacklist entries"}
|
|
374
|
+
set {_uniqueStorage()._syncDeviceDeployBlacklistEntriesTaskLabel = newValue}
|
|
375
|
+
}
|
|
376
|
+
/// Returns true if `syncDeviceDeployBlacklistEntriesTaskLabel` has been explicitly set.
|
|
377
|
+
public var hasSyncDeviceDeployBlacklistEntriesTaskLabel: Bool {return _storage._syncDeviceDeployBlacklistEntriesTaskLabel != nil}
|
|
378
|
+
/// Clears the value of `syncDeviceDeployBlacklistEntriesTaskLabel`. Subsequent reads from it will return its default value.
|
|
379
|
+
public mutating func clearSyncDeviceDeployBlacklistEntriesTaskLabel() {_uniqueStorage()._syncDeviceDeployBlacklistEntriesTaskLabel = nil}
|
|
380
|
+
|
|
381
|
+
public var syncDeviceRetrieveSystemStatusTaskLabel: String {
|
|
382
|
+
get {return _storage._syncDeviceRetrieveSystemStatusTaskLabel ?? "Retrieve system status"}
|
|
383
|
+
set {_uniqueStorage()._syncDeviceRetrieveSystemStatusTaskLabel = newValue}
|
|
384
|
+
}
|
|
385
|
+
/// Returns true if `syncDeviceRetrieveSystemStatusTaskLabel` has been explicitly set.
|
|
386
|
+
public var hasSyncDeviceRetrieveSystemStatusTaskLabel: Bool {return _storage._syncDeviceRetrieveSystemStatusTaskLabel != nil}
|
|
387
|
+
/// Clears the value of `syncDeviceRetrieveSystemStatusTaskLabel`. Subsequent reads from it will return its default value.
|
|
388
|
+
public mutating func clearSyncDeviceRetrieveSystemStatusTaskLabel() {_uniqueStorage()._syncDeviceRetrieveSystemStatusTaskLabel = nil}
|
|
389
|
+
|
|
390
|
+
public var syncDevicePushSystemStatusTaskLabel: String {
|
|
391
|
+
get {return _storage._syncDevicePushSystemStatusTaskLabel ?? "Push system status"}
|
|
392
|
+
set {_uniqueStorage()._syncDevicePushSystemStatusTaskLabel = newValue}
|
|
393
|
+
}
|
|
394
|
+
/// Returns true if `syncDevicePushSystemStatusTaskLabel` has been explicitly set.
|
|
395
|
+
public var hasSyncDevicePushSystemStatusTaskLabel: Bool {return _storage._syncDevicePushSystemStatusTaskLabel != nil}
|
|
396
|
+
/// Clears the value of `syncDevicePushSystemStatusTaskLabel`. Subsequent reads from it will return its default value.
|
|
397
|
+
public mutating func clearSyncDevicePushSystemStatusTaskLabel() {_uniqueStorage()._syncDevicePushSystemStatusTaskLabel = nil}
|
|
398
|
+
|
|
264
399
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
265
400
|
|
|
266
401
|
public init() {}
|
|
@@ -854,15 +989,30 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
854
989
|
7: .same(proto: "nfcOssSuccessUnprovisionMessage"),
|
|
855
990
|
8: .same(proto: "nfcOssSuccessFormatMessage"),
|
|
856
991
|
9: .same(proto: "nfcInitializingWritingProcess"),
|
|
857
|
-
10: .same(proto: "
|
|
858
|
-
11: .same(proto: "
|
|
859
|
-
12: .same(proto: "
|
|
860
|
-
13: .same(proto: "
|
|
861
|
-
14: .same(proto: "
|
|
862
|
-
15: .same(proto: "
|
|
863
|
-
16: .same(proto: "
|
|
864
|
-
17: .same(proto: "
|
|
865
|
-
18: .same(proto: "
|
|
992
|
+
10: .same(proto: "openViaOssTitle"),
|
|
993
|
+
11: .same(proto: "openViaOssWaitMessage"),
|
|
994
|
+
12: .same(proto: "openViaOssAccessGrantedTitle"),
|
|
995
|
+
13: .same(proto: "openViaOssAccessGrantedMessage"),
|
|
996
|
+
14: .same(proto: "openViaOssAccessDeniedTitle"),
|
|
997
|
+
15: .same(proto: "openViaOssAccessDeniedMessage"),
|
|
998
|
+
16: .same(proto: "openViaOssAccessDeniedScheduleMismatchMessage"),
|
|
999
|
+
17: .same(proto: "openViaOssErrorTitle"),
|
|
1000
|
+
18: .same(proto: "cmnCancelLabel"),
|
|
1001
|
+
19: .same(proto: "cmnCloseLabel"),
|
|
1002
|
+
20: .same(proto: "syncDeviceInProgressTitle"),
|
|
1003
|
+
21: .same(proto: "syncDeviceFailedTitle"),
|
|
1004
|
+
22: .same(proto: "syncDeviceCancellingTitle"),
|
|
1005
|
+
23: .same(proto: "syncDeviceGetAuthenticationTokenTaskLabel"),
|
|
1006
|
+
24: .same(proto: "syncDeviceRetrieveDeviceConfigurationTaskLabel"),
|
|
1007
|
+
25: .same(proto: "syncDeviceUpdateDeviceConfigurationTaskLabel"),
|
|
1008
|
+
26: .same(proto: "syncDeviceUpdateDeviceTimeTaskLabel"),
|
|
1009
|
+
27: .same(proto: "syncDeviceWaitForDeviceToRestartTaskLabel"),
|
|
1010
|
+
28: .same(proto: "syncDevicePushEventLogsTaskLabel"),
|
|
1011
|
+
29: .same(proto: "syncDevicePushSystemLogsTaskLabel"),
|
|
1012
|
+
30: .same(proto: "syncDeviceRetrieveBlacklistEntriesTaskLabel"),
|
|
1013
|
+
31: .same(proto: "syncDeviceDeployBlacklistEntriesTaskLabel"),
|
|
1014
|
+
32: .same(proto: "syncDeviceRetrieveSystemStatusTaskLabel"),
|
|
1015
|
+
33: .same(proto: "syncDevicePushSystemStatusTaskLabel"),
|
|
866
1016
|
]
|
|
867
1017
|
|
|
868
1018
|
fileprivate class _StorageClass {
|
|
@@ -875,7 +1025,6 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
875
1025
|
var _nfcOssSuccessUnprovisionMessage: String? = nil
|
|
876
1026
|
var _nfcOssSuccessFormatMessage: String? = nil
|
|
877
1027
|
var _nfcInitializingWritingProcess: String? = nil
|
|
878
|
-
var _cmnCancelLabel: String? = nil
|
|
879
1028
|
var _openViaOssTitle: String? = nil
|
|
880
1029
|
var _openViaOssWaitMessage: String? = nil
|
|
881
1030
|
var _openViaOssAccessGrantedTitle: String? = nil
|
|
@@ -884,6 +1033,22 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
884
1033
|
var _openViaOssAccessDeniedMessage: String? = nil
|
|
885
1034
|
var _openViaOssAccessDeniedScheduleMismatchMessage: String? = nil
|
|
886
1035
|
var _openViaOssErrorTitle: String? = nil
|
|
1036
|
+
var _cmnCancelLabel: String? = nil
|
|
1037
|
+
var _cmnCloseLabel: String? = nil
|
|
1038
|
+
var _syncDeviceInProgressTitle: String? = nil
|
|
1039
|
+
var _syncDeviceFailedTitle: String? = nil
|
|
1040
|
+
var _syncDeviceCancellingTitle: String? = nil
|
|
1041
|
+
var _syncDeviceGetAuthenticationTokenTaskLabel: String? = nil
|
|
1042
|
+
var _syncDeviceRetrieveDeviceConfigurationTaskLabel: String? = nil
|
|
1043
|
+
var _syncDeviceUpdateDeviceConfigurationTaskLabel: String? = nil
|
|
1044
|
+
var _syncDeviceUpdateDeviceTimeTaskLabel: String? = nil
|
|
1045
|
+
var _syncDeviceWaitForDeviceToRestartTaskLabel: String? = nil
|
|
1046
|
+
var _syncDevicePushEventLogsTaskLabel: String? = nil
|
|
1047
|
+
var _syncDevicePushSystemLogsTaskLabel: String? = nil
|
|
1048
|
+
var _syncDeviceRetrieveBlacklistEntriesTaskLabel: String? = nil
|
|
1049
|
+
var _syncDeviceDeployBlacklistEntriesTaskLabel: String? = nil
|
|
1050
|
+
var _syncDeviceRetrieveSystemStatusTaskLabel: String? = nil
|
|
1051
|
+
var _syncDevicePushSystemStatusTaskLabel: String? = nil
|
|
887
1052
|
|
|
888
1053
|
static let defaultInstance = _StorageClass()
|
|
889
1054
|
|
|
@@ -899,7 +1064,6 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
899
1064
|
_nfcOssSuccessUnprovisionMessage = source._nfcOssSuccessUnprovisionMessage
|
|
900
1065
|
_nfcOssSuccessFormatMessage = source._nfcOssSuccessFormatMessage
|
|
901
1066
|
_nfcInitializingWritingProcess = source._nfcInitializingWritingProcess
|
|
902
|
-
_cmnCancelLabel = source._cmnCancelLabel
|
|
903
1067
|
_openViaOssTitle = source._openViaOssTitle
|
|
904
1068
|
_openViaOssWaitMessage = source._openViaOssWaitMessage
|
|
905
1069
|
_openViaOssAccessGrantedTitle = source._openViaOssAccessGrantedTitle
|
|
@@ -908,6 +1072,22 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
908
1072
|
_openViaOssAccessDeniedMessage = source._openViaOssAccessDeniedMessage
|
|
909
1073
|
_openViaOssAccessDeniedScheduleMismatchMessage = source._openViaOssAccessDeniedScheduleMismatchMessage
|
|
910
1074
|
_openViaOssErrorTitle = source._openViaOssErrorTitle
|
|
1075
|
+
_cmnCancelLabel = source._cmnCancelLabel
|
|
1076
|
+
_cmnCloseLabel = source._cmnCloseLabel
|
|
1077
|
+
_syncDeviceInProgressTitle = source._syncDeviceInProgressTitle
|
|
1078
|
+
_syncDeviceFailedTitle = source._syncDeviceFailedTitle
|
|
1079
|
+
_syncDeviceCancellingTitle = source._syncDeviceCancellingTitle
|
|
1080
|
+
_syncDeviceGetAuthenticationTokenTaskLabel = source._syncDeviceGetAuthenticationTokenTaskLabel
|
|
1081
|
+
_syncDeviceRetrieveDeviceConfigurationTaskLabel = source._syncDeviceRetrieveDeviceConfigurationTaskLabel
|
|
1082
|
+
_syncDeviceUpdateDeviceConfigurationTaskLabel = source._syncDeviceUpdateDeviceConfigurationTaskLabel
|
|
1083
|
+
_syncDeviceUpdateDeviceTimeTaskLabel = source._syncDeviceUpdateDeviceTimeTaskLabel
|
|
1084
|
+
_syncDeviceWaitForDeviceToRestartTaskLabel = source._syncDeviceWaitForDeviceToRestartTaskLabel
|
|
1085
|
+
_syncDevicePushEventLogsTaskLabel = source._syncDevicePushEventLogsTaskLabel
|
|
1086
|
+
_syncDevicePushSystemLogsTaskLabel = source._syncDevicePushSystemLogsTaskLabel
|
|
1087
|
+
_syncDeviceRetrieveBlacklistEntriesTaskLabel = source._syncDeviceRetrieveBlacklistEntriesTaskLabel
|
|
1088
|
+
_syncDeviceDeployBlacklistEntriesTaskLabel = source._syncDeviceDeployBlacklistEntriesTaskLabel
|
|
1089
|
+
_syncDeviceRetrieveSystemStatusTaskLabel = source._syncDeviceRetrieveSystemStatusTaskLabel
|
|
1090
|
+
_syncDevicePushSystemStatusTaskLabel = source._syncDevicePushSystemStatusTaskLabel
|
|
911
1091
|
}
|
|
912
1092
|
}
|
|
913
1093
|
|
|
@@ -929,7 +1109,6 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
929
1109
|
if _storage._nfcOssSuccessUnprovisionMessage == nil {return false}
|
|
930
1110
|
if _storage._nfcOssSuccessFormatMessage == nil {return false}
|
|
931
1111
|
if _storage._nfcInitializingWritingProcess == nil {return false}
|
|
932
|
-
if _storage._cmnCancelLabel == nil {return false}
|
|
933
1112
|
if _storage._openViaOssTitle == nil {return false}
|
|
934
1113
|
if _storage._openViaOssWaitMessage == nil {return false}
|
|
935
1114
|
if _storage._openViaOssAccessGrantedTitle == nil {return false}
|
|
@@ -938,6 +1117,22 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
938
1117
|
if _storage._openViaOssAccessDeniedMessage == nil {return false}
|
|
939
1118
|
if _storage._openViaOssAccessDeniedScheduleMismatchMessage == nil {return false}
|
|
940
1119
|
if _storage._openViaOssErrorTitle == nil {return false}
|
|
1120
|
+
if _storage._cmnCancelLabel == nil {return false}
|
|
1121
|
+
if _storage._cmnCloseLabel == nil {return false}
|
|
1122
|
+
if _storage._syncDeviceInProgressTitle == nil {return false}
|
|
1123
|
+
if _storage._syncDeviceFailedTitle == nil {return false}
|
|
1124
|
+
if _storage._syncDeviceCancellingTitle == nil {return false}
|
|
1125
|
+
if _storage._syncDeviceGetAuthenticationTokenTaskLabel == nil {return false}
|
|
1126
|
+
if _storage._syncDeviceRetrieveDeviceConfigurationTaskLabel == nil {return false}
|
|
1127
|
+
if _storage._syncDeviceUpdateDeviceConfigurationTaskLabel == nil {return false}
|
|
1128
|
+
if _storage._syncDeviceUpdateDeviceTimeTaskLabel == nil {return false}
|
|
1129
|
+
if _storage._syncDeviceWaitForDeviceToRestartTaskLabel == nil {return false}
|
|
1130
|
+
if _storage._syncDevicePushEventLogsTaskLabel == nil {return false}
|
|
1131
|
+
if _storage._syncDevicePushSystemLogsTaskLabel == nil {return false}
|
|
1132
|
+
if _storage._syncDeviceRetrieveBlacklistEntriesTaskLabel == nil {return false}
|
|
1133
|
+
if _storage._syncDeviceDeployBlacklistEntriesTaskLabel == nil {return false}
|
|
1134
|
+
if _storage._syncDeviceRetrieveSystemStatusTaskLabel == nil {return false}
|
|
1135
|
+
if _storage._syncDevicePushSystemStatusTaskLabel == nil {return false}
|
|
941
1136
|
return true
|
|
942
1137
|
}
|
|
943
1138
|
}
|
|
@@ -959,15 +1154,30 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
959
1154
|
case 7: try { try decoder.decodeSingularStringField(value: &_storage._nfcOssSuccessUnprovisionMessage) }()
|
|
960
1155
|
case 8: try { try decoder.decodeSingularStringField(value: &_storage._nfcOssSuccessFormatMessage) }()
|
|
961
1156
|
case 9: try { try decoder.decodeSingularStringField(value: &_storage._nfcInitializingWritingProcess) }()
|
|
962
|
-
case 10: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
963
|
-
case 11: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
964
|
-
case 12: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
965
|
-
case 13: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
966
|
-
case 14: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
967
|
-
case 15: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
968
|
-
case 16: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
969
|
-
case 17: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
970
|
-
case 18: try { try decoder.decodeSingularStringField(value: &_storage.
|
|
1157
|
+
case 10: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssTitle) }()
|
|
1158
|
+
case 11: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssWaitMessage) }()
|
|
1159
|
+
case 12: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssAccessGrantedTitle) }()
|
|
1160
|
+
case 13: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssAccessGrantedMessage) }()
|
|
1161
|
+
case 14: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssAccessDeniedTitle) }()
|
|
1162
|
+
case 15: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssAccessDeniedMessage) }()
|
|
1163
|
+
case 16: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssAccessDeniedScheduleMismatchMessage) }()
|
|
1164
|
+
case 17: try { try decoder.decodeSingularStringField(value: &_storage._openViaOssErrorTitle) }()
|
|
1165
|
+
case 18: try { try decoder.decodeSingularStringField(value: &_storage._cmnCancelLabel) }()
|
|
1166
|
+
case 19: try { try decoder.decodeSingularStringField(value: &_storage._cmnCloseLabel) }()
|
|
1167
|
+
case 20: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceInProgressTitle) }()
|
|
1168
|
+
case 21: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceFailedTitle) }()
|
|
1169
|
+
case 22: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceCancellingTitle) }()
|
|
1170
|
+
case 23: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceGetAuthenticationTokenTaskLabel) }()
|
|
1171
|
+
case 24: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceRetrieveDeviceConfigurationTaskLabel) }()
|
|
1172
|
+
case 25: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceUpdateDeviceConfigurationTaskLabel) }()
|
|
1173
|
+
case 26: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceUpdateDeviceTimeTaskLabel) }()
|
|
1174
|
+
case 27: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceWaitForDeviceToRestartTaskLabel) }()
|
|
1175
|
+
case 28: try { try decoder.decodeSingularStringField(value: &_storage._syncDevicePushEventLogsTaskLabel) }()
|
|
1176
|
+
case 29: try { try decoder.decodeSingularStringField(value: &_storage._syncDevicePushSystemLogsTaskLabel) }()
|
|
1177
|
+
case 30: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceRetrieveBlacklistEntriesTaskLabel) }()
|
|
1178
|
+
case 31: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceDeployBlacklistEntriesTaskLabel) }()
|
|
1179
|
+
case 32: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceRetrieveSystemStatusTaskLabel) }()
|
|
1180
|
+
case 33: try { try decoder.decodeSingularStringField(value: &_storage._syncDevicePushSystemStatusTaskLabel) }()
|
|
971
1181
|
default: break
|
|
972
1182
|
}
|
|
973
1183
|
}
|
|
@@ -1007,33 +1217,78 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1007
1217
|
try { if let v = _storage._nfcInitializingWritingProcess {
|
|
1008
1218
|
try visitor.visitSingularStringField(value: v, fieldNumber: 9)
|
|
1009
1219
|
} }()
|
|
1010
|
-
try { if let v = _storage.
|
|
1220
|
+
try { if let v = _storage._openViaOssTitle {
|
|
1011
1221
|
try visitor.visitSingularStringField(value: v, fieldNumber: 10)
|
|
1012
1222
|
} }()
|
|
1013
|
-
try { if let v = _storage.
|
|
1223
|
+
try { if let v = _storage._openViaOssWaitMessage {
|
|
1014
1224
|
try visitor.visitSingularStringField(value: v, fieldNumber: 11)
|
|
1015
1225
|
} }()
|
|
1016
|
-
try { if let v = _storage.
|
|
1226
|
+
try { if let v = _storage._openViaOssAccessGrantedTitle {
|
|
1017
1227
|
try visitor.visitSingularStringField(value: v, fieldNumber: 12)
|
|
1018
1228
|
} }()
|
|
1019
|
-
try { if let v = _storage.
|
|
1229
|
+
try { if let v = _storage._openViaOssAccessGrantedMessage {
|
|
1020
1230
|
try visitor.visitSingularStringField(value: v, fieldNumber: 13)
|
|
1021
1231
|
} }()
|
|
1022
|
-
try { if let v = _storage.
|
|
1232
|
+
try { if let v = _storage._openViaOssAccessDeniedTitle {
|
|
1023
1233
|
try visitor.visitSingularStringField(value: v, fieldNumber: 14)
|
|
1024
1234
|
} }()
|
|
1025
|
-
try { if let v = _storage.
|
|
1235
|
+
try { if let v = _storage._openViaOssAccessDeniedMessage {
|
|
1026
1236
|
try visitor.visitSingularStringField(value: v, fieldNumber: 15)
|
|
1027
1237
|
} }()
|
|
1028
|
-
try { if let v = _storage.
|
|
1238
|
+
try { if let v = _storage._openViaOssAccessDeniedScheduleMismatchMessage {
|
|
1029
1239
|
try visitor.visitSingularStringField(value: v, fieldNumber: 16)
|
|
1030
1240
|
} }()
|
|
1031
|
-
try { if let v = _storage.
|
|
1241
|
+
try { if let v = _storage._openViaOssErrorTitle {
|
|
1032
1242
|
try visitor.visitSingularStringField(value: v, fieldNumber: 17)
|
|
1033
1243
|
} }()
|
|
1034
|
-
try { if let v = _storage.
|
|
1244
|
+
try { if let v = _storage._cmnCancelLabel {
|
|
1035
1245
|
try visitor.visitSingularStringField(value: v, fieldNumber: 18)
|
|
1036
1246
|
} }()
|
|
1247
|
+
try { if let v = _storage._cmnCloseLabel {
|
|
1248
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 19)
|
|
1249
|
+
} }()
|
|
1250
|
+
try { if let v = _storage._syncDeviceInProgressTitle {
|
|
1251
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 20)
|
|
1252
|
+
} }()
|
|
1253
|
+
try { if let v = _storage._syncDeviceFailedTitle {
|
|
1254
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 21)
|
|
1255
|
+
} }()
|
|
1256
|
+
try { if let v = _storage._syncDeviceCancellingTitle {
|
|
1257
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 22)
|
|
1258
|
+
} }()
|
|
1259
|
+
try { if let v = _storage._syncDeviceGetAuthenticationTokenTaskLabel {
|
|
1260
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 23)
|
|
1261
|
+
} }()
|
|
1262
|
+
try { if let v = _storage._syncDeviceRetrieveDeviceConfigurationTaskLabel {
|
|
1263
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 24)
|
|
1264
|
+
} }()
|
|
1265
|
+
try { if let v = _storage._syncDeviceUpdateDeviceConfigurationTaskLabel {
|
|
1266
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 25)
|
|
1267
|
+
} }()
|
|
1268
|
+
try { if let v = _storage._syncDeviceUpdateDeviceTimeTaskLabel {
|
|
1269
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 26)
|
|
1270
|
+
} }()
|
|
1271
|
+
try { if let v = _storage._syncDeviceWaitForDeviceToRestartTaskLabel {
|
|
1272
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 27)
|
|
1273
|
+
} }()
|
|
1274
|
+
try { if let v = _storage._syncDevicePushEventLogsTaskLabel {
|
|
1275
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 28)
|
|
1276
|
+
} }()
|
|
1277
|
+
try { if let v = _storage._syncDevicePushSystemLogsTaskLabel {
|
|
1278
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 29)
|
|
1279
|
+
} }()
|
|
1280
|
+
try { if let v = _storage._syncDeviceRetrieveBlacklistEntriesTaskLabel {
|
|
1281
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 30)
|
|
1282
|
+
} }()
|
|
1283
|
+
try { if let v = _storage._syncDeviceDeployBlacklistEntriesTaskLabel {
|
|
1284
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 31)
|
|
1285
|
+
} }()
|
|
1286
|
+
try { if let v = _storage._syncDeviceRetrieveSystemStatusTaskLabel {
|
|
1287
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 32)
|
|
1288
|
+
} }()
|
|
1289
|
+
try { if let v = _storage._syncDevicePushSystemStatusTaskLabel {
|
|
1290
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 33)
|
|
1291
|
+
} }()
|
|
1037
1292
|
}
|
|
1038
1293
|
try unknownFields.traverse(visitor: &visitor)
|
|
1039
1294
|
}
|
|
@@ -1052,7 +1307,6 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1052
1307
|
if _storage._nfcOssSuccessUnprovisionMessage != rhs_storage._nfcOssSuccessUnprovisionMessage {return false}
|
|
1053
1308
|
if _storage._nfcOssSuccessFormatMessage != rhs_storage._nfcOssSuccessFormatMessage {return false}
|
|
1054
1309
|
if _storage._nfcInitializingWritingProcess != rhs_storage._nfcInitializingWritingProcess {return false}
|
|
1055
|
-
if _storage._cmnCancelLabel != rhs_storage._cmnCancelLabel {return false}
|
|
1056
1310
|
if _storage._openViaOssTitle != rhs_storage._openViaOssTitle {return false}
|
|
1057
1311
|
if _storage._openViaOssWaitMessage != rhs_storage._openViaOssWaitMessage {return false}
|
|
1058
1312
|
if _storage._openViaOssAccessGrantedTitle != rhs_storage._openViaOssAccessGrantedTitle {return false}
|
|
@@ -1061,6 +1315,22 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1061
1315
|
if _storage._openViaOssAccessDeniedMessage != rhs_storage._openViaOssAccessDeniedMessage {return false}
|
|
1062
1316
|
if _storage._openViaOssAccessDeniedScheduleMismatchMessage != rhs_storage._openViaOssAccessDeniedScheduleMismatchMessage {return false}
|
|
1063
1317
|
if _storage._openViaOssErrorTitle != rhs_storage._openViaOssErrorTitle {return false}
|
|
1318
|
+
if _storage._cmnCancelLabel != rhs_storage._cmnCancelLabel {return false}
|
|
1319
|
+
if _storage._cmnCloseLabel != rhs_storage._cmnCloseLabel {return false}
|
|
1320
|
+
if _storage._syncDeviceInProgressTitle != rhs_storage._syncDeviceInProgressTitle {return false}
|
|
1321
|
+
if _storage._syncDeviceFailedTitle != rhs_storage._syncDeviceFailedTitle {return false}
|
|
1322
|
+
if _storage._syncDeviceCancellingTitle != rhs_storage._syncDeviceCancellingTitle {return false}
|
|
1323
|
+
if _storage._syncDeviceGetAuthenticationTokenTaskLabel != rhs_storage._syncDeviceGetAuthenticationTokenTaskLabel {return false}
|
|
1324
|
+
if _storage._syncDeviceRetrieveDeviceConfigurationTaskLabel != rhs_storage._syncDeviceRetrieveDeviceConfigurationTaskLabel {return false}
|
|
1325
|
+
if _storage._syncDeviceUpdateDeviceConfigurationTaskLabel != rhs_storage._syncDeviceUpdateDeviceConfigurationTaskLabel {return false}
|
|
1326
|
+
if _storage._syncDeviceUpdateDeviceTimeTaskLabel != rhs_storage._syncDeviceUpdateDeviceTimeTaskLabel {return false}
|
|
1327
|
+
if _storage._syncDeviceWaitForDeviceToRestartTaskLabel != rhs_storage._syncDeviceWaitForDeviceToRestartTaskLabel {return false}
|
|
1328
|
+
if _storage._syncDevicePushEventLogsTaskLabel != rhs_storage._syncDevicePushEventLogsTaskLabel {return false}
|
|
1329
|
+
if _storage._syncDevicePushSystemLogsTaskLabel != rhs_storage._syncDevicePushSystemLogsTaskLabel {return false}
|
|
1330
|
+
if _storage._syncDeviceRetrieveBlacklistEntriesTaskLabel != rhs_storage._syncDeviceRetrieveBlacklistEntriesTaskLabel {return false}
|
|
1331
|
+
if _storage._syncDeviceDeployBlacklistEntriesTaskLabel != rhs_storage._syncDeviceDeployBlacklistEntriesTaskLabel {return false}
|
|
1332
|
+
if _storage._syncDeviceRetrieveSystemStatusTaskLabel != rhs_storage._syncDeviceRetrieveSystemStatusTaskLabel {return false}
|
|
1333
|
+
if _storage._syncDevicePushSystemStatusTaskLabel != rhs_storage._syncDevicePushSystemStatusTaskLabel {return false}
|
|
1064
1334
|
return true
|
|
1065
1335
|
}
|
|
1066
1336
|
if !storagesAreEqual {return false}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import Combine
|
|
2
|
+
import Foundation
|
|
3
|
+
|
|
4
|
+
public protocol BlueTaskRunner {
|
|
5
|
+
func getTasks() -> [BlueTask]
|
|
6
|
+
func execute(_ throwWhenFail: Bool) async throws
|
|
7
|
+
func cancel() -> Bool
|
|
8
|
+
func isFailed() -> Bool
|
|
9
|
+
func isCancelled() -> Bool
|
|
10
|
+
func isSuccessful() -> Bool
|
|
11
|
+
func getResult<ResultType>(_ id: AnyHashable) throws -> ResultType
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
enum BlueTaskStatus {
|
|
15
|
+
case ready
|
|
16
|
+
case started
|
|
17
|
+
case failed
|
|
18
|
+
case succeeded
|
|
19
|
+
case skipped
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum BlueTaskResult {
|
|
23
|
+
case resultWithStatus(Any?, BlueTaskStatus)
|
|
24
|
+
case result(Any?)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public class BlueTask {
|
|
28
|
+
let id: AnyHashable
|
|
29
|
+
let label: String
|
|
30
|
+
|
|
31
|
+
var failable: Bool = false
|
|
32
|
+
var result: Any? = nil
|
|
33
|
+
var error: Error? = nil
|
|
34
|
+
var status: CurrentValueSubject<BlueTaskStatus, Never>
|
|
35
|
+
|
|
36
|
+
let handler: (BlueSerialTaskRunner) async throws -> BlueTaskResult
|
|
37
|
+
|
|
38
|
+
init(id: AnyHashable, label: String, failable: Bool = false, status: BlueTaskStatus = .ready, error: Error? = nil, _ handler: @escaping (BlueSerialTaskRunner) async throws -> BlueTaskResult) {
|
|
39
|
+
self.id = id
|
|
40
|
+
self.label = label
|
|
41
|
+
self.failable = failable
|
|
42
|
+
self.error = error
|
|
43
|
+
self.status = .init(status)
|
|
44
|
+
self.handler = handler
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var errorDescription: String? {
|
|
48
|
+
return error?.localizedDescription
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
func updateStatus(_ status: BlueTaskStatus) {
|
|
52
|
+
blueRunInMainThread {
|
|
53
|
+
self.status.send(status)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public class BlueSerialTaskRunner: BlueTaskRunner {
|
|
59
|
+
private let tasks: [BlueTask]
|
|
60
|
+
|
|
61
|
+
private var failed: Bool = false
|
|
62
|
+
private var cancelled: Bool = false
|
|
63
|
+
private var sucessful: Bool = false
|
|
64
|
+
|
|
65
|
+
init(_ tasks: [BlueTask]) {
|
|
66
|
+
self.tasks = tasks
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public func getTasks() -> [BlueTask] {
|
|
70
|
+
return tasks
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public func execute(_ throwWhenFail: Bool) async throws {
|
|
74
|
+
for task in tasks {
|
|
75
|
+
if (cancelled) {
|
|
76
|
+
blueLogDebug("Cancelled")
|
|
77
|
+
return
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
do {
|
|
81
|
+
blueLogDebug("Started: \(task.id)")
|
|
82
|
+
|
|
83
|
+
task.updateStatus(.started)
|
|
84
|
+
|
|
85
|
+
let taskResult = try await task.handler(self)
|
|
86
|
+
|
|
87
|
+
let taskStatus: BlueTaskStatus
|
|
88
|
+
|
|
89
|
+
switch (taskResult) {
|
|
90
|
+
case .resultWithStatus(let result, let status):
|
|
91
|
+
task.result = result
|
|
92
|
+
taskStatus = status
|
|
93
|
+
break
|
|
94
|
+
|
|
95
|
+
case .result(let result):
|
|
96
|
+
task.result = result
|
|
97
|
+
taskStatus = .succeeded
|
|
98
|
+
break
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
task.updateStatus(taskStatus)
|
|
102
|
+
|
|
103
|
+
if taskStatus == .failed {
|
|
104
|
+
if (!task.failable) {
|
|
105
|
+
failed = true
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
blueLogDebug("Finished: \(task.id)")
|
|
111
|
+
} catch {
|
|
112
|
+
blueLogDebug("Failed: \(task.id)")
|
|
113
|
+
|
|
114
|
+
task.error = error
|
|
115
|
+
task.updateStatus(.failed)
|
|
116
|
+
|
|
117
|
+
if (!task.failable) {
|
|
118
|
+
failed = true
|
|
119
|
+
|
|
120
|
+
if (throwWhenFail) {
|
|
121
|
+
throw error
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
sucessful = true
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public func cancel() -> Bool {
|
|
133
|
+
if (!sucessful && !failed) {
|
|
134
|
+
cancelled = true
|
|
135
|
+
|
|
136
|
+
return true
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return false
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public func isSuccessful() -> Bool { sucessful }
|
|
143
|
+
public func isFailed() -> Bool { failed }
|
|
144
|
+
public func isCancelled() -> Bool { cancelled }
|
|
145
|
+
|
|
146
|
+
public func getResult<ResultType>(_ id: AnyHashable) throws -> ResultType {
|
|
147
|
+
if let task = tasks.first(where: { $0.id == id }) {
|
|
148
|
+
if let result = task.result as? ResultType {
|
|
149
|
+
return result
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
throw BlueError(.invalidArguments)
|
|
154
|
+
}
|
|
155
|
+
}
|