@wayq/beekon-rn 0.0.5 → 0.0.6
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/BeekonRn.podspec +4 -2
- package/CHANGELOG.md +103 -0
- package/README.md +303 -81
- package/android/build.gradle +1 -1
- package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +113 -7
- package/ios/BeekonRn.mm +13 -0
- package/ios/BeekonRn.swift +113 -9
- package/ios/Frameworks/BeekonKit.xcframework/Info.plist +5 -5
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +5399 -1463
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +77 -2
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +5399 -1463
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +77 -2
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +5399 -1463
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +77 -2
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +1 -1
- package/lib/module/NativeBeekonRn.js +13 -0
- package/lib/module/NativeBeekonRn.js.map +1 -1
- package/lib/module/beekon.js +56 -7
- package/lib/module/beekon.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/mappers.js +50 -3
- package/lib/module/internal/mappers.js.map +1 -1
- package/lib/module/types/auth.js +4 -0
- package/lib/module/types/auth.js.map +1 -0
- package/lib/module/types/error.js +13 -3
- package/lib/module/types/error.js.map +1 -1
- package/lib/typescript/src/NativeBeekonRn.d.ts +48 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
- package/lib/typescript/src/beekon.d.ts +30 -1
- package/lib/typescript/src/beekon.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/mappers.d.ts +5 -1
- package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
- package/lib/typescript/src/types/auth.d.ts +99 -0
- package/lib/typescript/src/types/auth.d.ts.map +1 -0
- package/lib/typescript/src/types/config.d.ts +16 -0
- package/lib/typescript/src/types/config.d.ts.map +1 -1
- package/lib/typescript/src/types/enums.d.ts +14 -0
- package/lib/typescript/src/types/enums.d.ts.map +1 -1
- package/lib/typescript/src/types/error.d.ts +14 -4
- package/lib/typescript/src/types/error.d.ts.map +1 -1
- package/package.json +5 -1
- package/scripts/fetch-beekonkit.sh +4 -4
- package/src/NativeBeekonRn.ts +55 -0
- package/src/beekon.ts +66 -6
- package/src/index.tsx +3 -0
- package/src/internal/mappers.ts +59 -1
- package/src/types/auth.ts +101 -0
- package/src/types/config.ts +16 -0
- package/src/types/enums.ts +16 -0
- package/src/types/error.ts +19 -4
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// swift-interface-format-version: 1.0
|
|
2
2
|
// swift-compiler-version: Apple Swift version 6.3.1 (swiftlang-6.3.1.1.2 clang-2100.0.123.102)
|
|
3
|
-
// swift-module-flags: -target arm64-apple-
|
|
3
|
+
// swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -O -enable-experimental-feature DebugDescriptionMacro -module-name BeekonKit -package-name beekon_ios
|
|
4
4
|
// swift-module-flags-ignorable: -no-verify-emitted-module-interface -no-verify-emitted-module-interface -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.1
|
|
5
5
|
@preconcurrency import BackgroundTasks
|
|
6
6
|
import Compression
|
|
@@ -12,6 +12,7 @@ import Foundation/*.Bundle*/
|
|
|
12
12
|
import Foundation/*.ProcessInfo*/
|
|
13
13
|
import Foundation/*.URL*/
|
|
14
14
|
import Network
|
|
15
|
+
import Security
|
|
15
16
|
import Swift
|
|
16
17
|
@preconcurrency import UIKit
|
|
17
18
|
import _Concurrency
|
|
@@ -41,6 +42,59 @@ public enum ActivityType : Swift.String, Swift.Sendable, Swift.Equatable, Swift.
|
|
|
41
42
|
get
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
public enum AuthStrategy : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
46
|
+
case bearer
|
|
47
|
+
case raw
|
|
48
|
+
public init?(rawValue: Swift.String)
|
|
49
|
+
public typealias RawValue = Swift.String
|
|
50
|
+
public var rawValue: Swift.String {
|
|
51
|
+
get
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
public enum AuthBodyFormat : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
55
|
+
case form
|
|
56
|
+
case json
|
|
57
|
+
public init?(rawValue: Swift.String)
|
|
58
|
+
public typealias RawValue = Swift.String
|
|
59
|
+
public var rawValue: Swift.String {
|
|
60
|
+
get
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
public struct AuthResponseMapping : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
64
|
+
public var accessToken: Swift.String?
|
|
65
|
+
public var refreshToken: Swift.String?
|
|
66
|
+
public var expiresIn: Swift.String?
|
|
67
|
+
public var expiresAt: Swift.String?
|
|
68
|
+
public init(accessToken: Swift.String? = nil, refreshToken: Swift.String? = nil, expiresIn: Swift.String? = nil, expiresAt: Swift.String? = nil)
|
|
69
|
+
public static func == (a: BeekonKit.AuthResponseMapping, b: BeekonKit.AuthResponseMapping) -> Swift.Bool
|
|
70
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
71
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
72
|
+
}
|
|
73
|
+
public struct AuthConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
74
|
+
public var accessToken: Swift.String?
|
|
75
|
+
public var refreshToken: Swift.String?
|
|
76
|
+
public var expiresAt: Foundation.TimeInterval?
|
|
77
|
+
public var strategy: BeekonKit.AuthStrategy
|
|
78
|
+
public var refreshUrl: Foundation.URL?
|
|
79
|
+
public var refreshPayload: [Swift.String : Swift.String]
|
|
80
|
+
public var refreshHeaders: [Swift.String : Swift.String]
|
|
81
|
+
public var refreshBodyFormat: BeekonKit.AuthBodyFormat
|
|
82
|
+
public var responseMapping: BeekonKit.AuthResponseMapping
|
|
83
|
+
public var skewMarginSeconds: Foundation.TimeInterval
|
|
84
|
+
public var seedEpoch: Swift.Int?
|
|
85
|
+
public init(accessToken: Swift.String? = nil, refreshToken: Swift.String? = nil, expiresAt: Foundation.TimeInterval? = nil, strategy: BeekonKit.AuthStrategy = .bearer, refreshUrl: Foundation.URL? = nil, refreshPayload: [Swift.String : Swift.String] = [:], refreshHeaders: [Swift.String : Swift.String] = ["Authorization": "Bearer {accessToken}"], refreshBodyFormat: BeekonKit.AuthBodyFormat = .form, responseMapping: BeekonKit.AuthResponseMapping = AuthResponseMapping(), skewMarginSeconds: Foundation.TimeInterval = 60, seedEpoch: Swift.Int? = nil)
|
|
86
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
87
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
88
|
+
public static func == (a: BeekonKit.AuthConfig, b: BeekonKit.AuthConfig) -> Swift.Bool
|
|
89
|
+
}
|
|
90
|
+
public struct AuthTokens : Swift.Sendable, Swift.Equatable {
|
|
91
|
+
public let accessToken: Swift.String
|
|
92
|
+
public let refreshToken: Swift.String?
|
|
93
|
+
public let expiresAt: Foundation.TimeInterval?
|
|
94
|
+
public let epoch: Swift.Int
|
|
95
|
+
public init(accessToken: Swift.String, refreshToken: Swift.String?, expiresAt: Foundation.TimeInterval?, epoch: Swift.Int)
|
|
96
|
+
public static func == (a: BeekonKit.AuthTokens, b: BeekonKit.AuthTokens) -> Swift.Bool
|
|
97
|
+
}
|
|
44
98
|
@_hasMissingDesignatedInitializers public actor Beekon {
|
|
45
99
|
public static let shared: BeekonKit.Beekon
|
|
46
100
|
nonisolated public static func registerBackgroundTasks()
|
|
@@ -49,6 +103,7 @@ public enum ActivityType : Swift.String, Swift.Sendable, Swift.Equatable, Swift.
|
|
|
49
103
|
public func stop() async
|
|
50
104
|
public func resumeIfNeeded() async
|
|
51
105
|
public func getLocations(from: Foundation.Date, to: Foundation.Date) async throws -> [BeekonKit.Location]
|
|
106
|
+
public func getCurrentLocation(timeout: Foundation.TimeInterval = 15, accuracy: BeekonKit.AccuracyMode? = nil) async throws -> BeekonKit.Location?
|
|
52
107
|
public func deleteLocations(before: Foundation.Date?) async throws -> Swift.Int
|
|
53
108
|
public func pendingUploadCount() async throws -> Swift.Int
|
|
54
109
|
public func sync()
|
|
@@ -68,6 +123,9 @@ public enum ActivityType : Swift.String, Swift.Sendable, Swift.Equatable, Swift.
|
|
|
68
123
|
public var syncStatus: _Concurrency.AsyncStream<BeekonKit.SyncStatus> {
|
|
69
124
|
get
|
|
70
125
|
}
|
|
126
|
+
public var authChanges: _Concurrency.AsyncStream<BeekonKit.AuthTokens> {
|
|
127
|
+
get
|
|
128
|
+
}
|
|
71
129
|
@objc deinit
|
|
72
130
|
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
|
|
73
131
|
@_semantics("defaultActor") nonisolated final public var unownedExecutor: _Concurrency.UnownedSerialExecutor {
|
|
@@ -94,7 +152,8 @@ public struct SyncConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
|
94
152
|
public var headers: [Swift.String : Swift.String]
|
|
95
153
|
public var intervalSeconds: Foundation.TimeInterval
|
|
96
154
|
public var batchSize: Swift.Int
|
|
97
|
-
public
|
|
155
|
+
public var auth: BeekonKit.AuthConfig?
|
|
156
|
+
public init(url: Foundation.URL, headers: [Swift.String : Swift.String] = [:], intervalSeconds: Foundation.TimeInterval = 300, batchSize: Swift.Int = 100, auth: BeekonKit.AuthConfig? = nil)
|
|
98
157
|
public static func == (a: BeekonKit.SyncConfig, b: BeekonKit.SyncConfig) -> Swift.Bool
|
|
99
158
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
100
159
|
public init(from decoder: any Swift.Decoder) throws
|
|
@@ -102,8 +161,19 @@ public struct SyncConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
|
102
161
|
public enum BeekonError : Swift.Error, Swift.Sendable, Swift.Equatable {
|
|
103
162
|
case invalidGeofence(reason: Swift.String)
|
|
104
163
|
case storage(reason: Swift.String)
|
|
164
|
+
case locationUnavailable(reason: BeekonKit.LocationUnavailableReason)
|
|
105
165
|
public static func == (a: BeekonKit.BeekonError, b: BeekonKit.BeekonError) -> Swift.Bool
|
|
106
166
|
}
|
|
167
|
+
public enum LocationUnavailableReason : Swift.Sendable, Swift.Equatable {
|
|
168
|
+
case permissionDenied
|
|
169
|
+
case locationServicesDisabled
|
|
170
|
+
case unavailable
|
|
171
|
+
public static func == (a: BeekonKit.LocationUnavailableReason, b: BeekonKit.LocationUnavailableReason) -> Swift.Bool
|
|
172
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
173
|
+
public var hashValue: Swift.Int {
|
|
174
|
+
get
|
|
175
|
+
}
|
|
176
|
+
}
|
|
107
177
|
public struct BeekonGeofence : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
108
178
|
public var id: Swift.String
|
|
109
179
|
public var latitude: Swift.Double
|
|
@@ -227,6 +297,11 @@ public enum Transition : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Ha
|
|
|
227
297
|
}
|
|
228
298
|
extension BeekonKit.AccuracyMode : Swift.RawRepresentable {}
|
|
229
299
|
extension BeekonKit.ActivityType : Swift.RawRepresentable {}
|
|
300
|
+
extension BeekonKit.AuthStrategy : Swift.Hashable {}
|
|
301
|
+
extension BeekonKit.AuthStrategy : Swift.RawRepresentable {}
|
|
302
|
+
extension BeekonKit.AuthBodyFormat : Swift.Hashable {}
|
|
303
|
+
extension BeekonKit.AuthBodyFormat : Swift.RawRepresentable {}
|
|
304
|
+
extension BeekonKit.LocationUnavailableReason : Swift.Hashable {}
|
|
230
305
|
extension BeekonKit.StopReason : Swift.RawRepresentable {}
|
|
231
306
|
extension BeekonKit.LocationQuality : Swift.RawRepresentable {}
|
|
232
307
|
extension BeekonKit.LocationTrigger : Swift.RawRepresentable {}
|
|
Binary file
|