@wayq/beekon-rn 0.0.1 → 0.0.5

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 (92) hide show
  1. package/BeekonRn.podspec +4 -4
  2. package/README.md +94 -48
  3. package/android/build.gradle +11 -6
  4. package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +428 -0
  5. package/android/src/main/java/{com → in}/wayq/beekonrn/BeekonRnPackage.kt +1 -1
  6. package/ios/BeekonRn.h +5 -1
  7. package/ios/BeekonRn.mm +90 -34
  8. package/ios/BeekonRn.swift +396 -116
  9. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
  10. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
  11. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +8636 -0
  12. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  13. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +236 -0
  14. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/PrivacyInfo.xcprivacy +1 -1
  15. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
  16. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
  17. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +8636 -0
  18. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  19. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +236 -0
  20. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +8636 -0
  21. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +236 -0
  23. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/PrivacyInfo.xcprivacy +1 -1
  24. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +2 -14
  25. package/lib/module/NativeBeekonRn.js +22 -7
  26. package/lib/module/NativeBeekonRn.js.map +1 -1
  27. package/lib/module/beekon.js +209 -60
  28. package/lib/module/beekon.js.map +1 -1
  29. package/lib/module/index.js +1 -0
  30. package/lib/module/index.js.map +1 -1
  31. package/lib/module/internal/mappers.js +145 -23
  32. package/lib/module/internal/mappers.js.map +1 -1
  33. package/lib/module/types/enums.js +2 -0
  34. package/lib/module/types/{preset.js.map → enums.js.map} +1 -1
  35. package/lib/module/types/error.js +25 -0
  36. package/lib/module/types/error.js.map +1 -0
  37. package/lib/module/types/geofence.js +2 -0
  38. package/lib/module/types/{position.js.map → geofence.js.map} +1 -1
  39. package/lib/module/types/location.js +4 -0
  40. package/lib/module/types/location.js.map +1 -0
  41. package/lib/module/types/sync.js +2 -0
  42. package/lib/module/types/sync.js.map +1 -0
  43. package/lib/typescript/src/NativeBeekonRn.d.ts +113 -35
  44. package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
  45. package/lib/typescript/src/beekon.d.ts +84 -49
  46. package/lib/typescript/src/beekon.d.ts.map +1 -1
  47. package/lib/typescript/src/index.d.ts +7 -4
  48. package/lib/typescript/src/index.d.ts.map +1 -1
  49. package/lib/typescript/src/internal/mappers.d.ts +16 -3
  50. package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
  51. package/lib/typescript/src/types/config.d.ts +53 -31
  52. package/lib/typescript/src/types/config.d.ts.map +1 -1
  53. package/lib/typescript/src/types/enums.d.ts +48 -0
  54. package/lib/typescript/src/types/enums.d.ts.map +1 -0
  55. package/lib/typescript/src/types/error.d.ts +20 -0
  56. package/lib/typescript/src/types/error.d.ts.map +1 -0
  57. package/lib/typescript/src/types/geofence.d.ts +36 -0
  58. package/lib/typescript/src/types/geofence.d.ts.map +1 -0
  59. package/lib/typescript/src/types/location.d.ts +40 -0
  60. package/lib/typescript/src/types/location.d.ts.map +1 -0
  61. package/lib/typescript/src/types/state.d.ts +18 -9
  62. package/lib/typescript/src/types/state.d.ts.map +1 -1
  63. package/lib/typescript/src/types/sync.d.ts +27 -0
  64. package/lib/typescript/src/types/sync.d.ts.map +1 -0
  65. package/package.json +5 -6
  66. package/scripts/fetch-beekonkit.sh +5 -2
  67. package/src/NativeBeekonRn.ts +120 -34
  68. package/src/beekon.ts +235 -63
  69. package/src/index.tsx +23 -4
  70. package/src/internal/mappers.ts +213 -22
  71. package/src/types/config.ts +54 -31
  72. package/src/types/enums.ts +64 -0
  73. package/src/types/error.ts +25 -0
  74. package/src/types/geofence.ts +37 -0
  75. package/src/types/location.ts +45 -0
  76. package/src/types/state.ts +23 -7
  77. package/src/types/sync.ts +23 -0
  78. package/android/src/main/java/com/wayq/beekonrn/BeekonRnModule.kt +0 -233
  79. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeDirectory +0 -0
  80. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeRequirements +0 -0
  81. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  82. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeResources +0 -233
  83. package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeSignature +0 -0
  84. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/_CodeSignature/CodeResources +0 -113
  85. package/lib/module/types/position.js +0 -2
  86. package/lib/module/types/preset.js +0 -2
  87. package/lib/typescript/src/types/position.d.ts +0 -24
  88. package/lib/typescript/src/types/position.d.ts.map +0 -1
  89. package/lib/typescript/src/types/preset.d.ts +0 -12
  90. package/lib/typescript/src/types/preset.d.ts.map +0 -1
  91. package/src/types/position.ts +0 -23
  92. package/src/types/preset.ts +0 -11
@@ -0,0 +1,236 @@
1
+ // swift-interface-format-version: 1.0
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-ios17.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -O -enable-experimental-feature DebugDescriptionMacro -module-name BeekonKit -package-name beekon_ios
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
+ @preconcurrency import BackgroundTasks
6
+ import Compression
7
+ @preconcurrency import CoreLocation
8
+ import CoreMotion
9
+ import Darwin
10
+ import Foundation
11
+ import Foundation/*.Bundle*/
12
+ import Foundation/*.ProcessInfo*/
13
+ import Foundation/*.URL*/
14
+ import Network
15
+ import Swift
16
+ @preconcurrency import UIKit
17
+ import _Concurrency
18
+ import _StringProcessing
19
+ import _SwiftConcurrencyShims
20
+ import os
21
+ public enum AccuracyMode : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
22
+ case high
23
+ case balanced
24
+ case low
25
+ public init?(rawValue: Swift.String)
26
+ public typealias RawValue = Swift.String
27
+ public var rawValue: Swift.String {
28
+ get
29
+ }
30
+ }
31
+ public enum ActivityType : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
32
+ case stationary
33
+ case walking
34
+ case running
35
+ case cycling
36
+ case automotive
37
+ case unknown
38
+ public init?(rawValue: Swift.String)
39
+ public typealias RawValue = Swift.String
40
+ public var rawValue: Swift.String {
41
+ get
42
+ }
43
+ }
44
+ @_hasMissingDesignatedInitializers public actor Beekon {
45
+ public static let shared: BeekonKit.Beekon
46
+ nonisolated public static func registerBackgroundTasks()
47
+ public func configure(_ config: BeekonKit.BeekonConfig) async
48
+ public func start() async
49
+ public func stop() async
50
+ public func resumeIfNeeded() async
51
+ public func getLocations(from: Foundation.Date, to: Foundation.Date) async throws -> [BeekonKit.Location]
52
+ public func deleteLocations(before: Foundation.Date?) async throws -> Swift.Int
53
+ public func pendingUploadCount() async throws -> Swift.Int
54
+ public func sync()
55
+ public func setExtras(_ extras: [Swift.String : Swift.String])
56
+ public func addGeofences(_ geofences: [BeekonKit.BeekonGeofence]) async throws
57
+ public func removeGeofences(ids: [Swift.String]) async
58
+ public func listGeofences() async -> [BeekonKit.BeekonGeofence]
59
+ public var locations: _Concurrency.AsyncStream<BeekonKit.Location> {
60
+ get
61
+ }
62
+ public var state: _Concurrency.AsyncStream<BeekonKit.BeekonState> {
63
+ get
64
+ }
65
+ public var geofenceEvents: _Concurrency.AsyncStream<BeekonKit.GeofenceEvent> {
66
+ get
67
+ }
68
+ public var syncStatus: _Concurrency.AsyncStream<BeekonKit.SyncStatus> {
69
+ get
70
+ }
71
+ @objc deinit
72
+ @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
73
+ @_semantics("defaultActor") nonisolated final public var unownedExecutor: _Concurrency.UnownedSerialExecutor {
74
+ get
75
+ }
76
+ }
77
+ public struct BeekonConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
78
+ public var minTimeBetweenLocationsSeconds: Foundation.TimeInterval
79
+ public var minDistanceBetweenLocationsMeters: Swift.Double
80
+ public var accuracyMode: BeekonKit.AccuracyMode
81
+ public var whenStationary: BeekonKit.StationaryMode
82
+ public var stationaryRadiusMeters: Swift.Double
83
+ public var detectActivity: Swift.Bool
84
+ public var sync: BeekonKit.SyncConfig?
85
+ public static let minimumLocationIntervalSeconds: Swift.Double
86
+ public static let minimumStationaryRadiusMeters: Swift.Double
87
+ public init(minTimeBetweenLocationsSeconds: Foundation.TimeInterval = 30, minDistanceBetweenLocationsMeters: Swift.Double = 100, accuracyMode: BeekonKit.AccuracyMode = .balanced, whenStationary: BeekonKit.StationaryMode = .pause, stationaryRadiusMeters: Swift.Double = 5, detectActivity: Swift.Bool = false, sync: BeekonKit.SyncConfig? = nil)
88
+ public init(from decoder: any Swift.Decoder) throws
89
+ public func encode(to encoder: any Swift.Encoder) throws
90
+ public static func == (a: BeekonKit.BeekonConfig, b: BeekonKit.BeekonConfig) -> Swift.Bool
91
+ }
92
+ public struct SyncConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
93
+ public var url: Foundation.URL
94
+ public var headers: [Swift.String : Swift.String]
95
+ public var intervalSeconds: Foundation.TimeInterval
96
+ public var batchSize: Swift.Int
97
+ public init(url: Foundation.URL, headers: [Swift.String : Swift.String] = [:], intervalSeconds: Foundation.TimeInterval = 300, batchSize: Swift.Int = 100)
98
+ public static func == (a: BeekonKit.SyncConfig, b: BeekonKit.SyncConfig) -> Swift.Bool
99
+ public func encode(to encoder: any Swift.Encoder) throws
100
+ public init(from decoder: any Swift.Decoder) throws
101
+ }
102
+ public enum BeekonError : Swift.Error, Swift.Sendable, Swift.Equatable {
103
+ case invalidGeofence(reason: Swift.String)
104
+ case storage(reason: Swift.String)
105
+ public static func == (a: BeekonKit.BeekonError, b: BeekonKit.BeekonError) -> Swift.Bool
106
+ }
107
+ public struct BeekonGeofence : Swift.Sendable, Swift.Equatable, Swift.Codable {
108
+ public var id: Swift.String
109
+ public var latitude: Swift.Double
110
+ public var longitude: Swift.Double
111
+ public var radiusMeters: Swift.Double
112
+ public var notifyOnEntry: Swift.Bool
113
+ public var notifyOnExit: Swift.Bool
114
+ public init(id: Swift.String, latitude: Swift.Double, longitude: Swift.Double, radiusMeters: Swift.Double, notifyOnEntry: Swift.Bool = true, notifyOnExit: Swift.Bool = true)
115
+ public static func == (a: BeekonKit.BeekonGeofence, b: BeekonKit.BeekonGeofence) -> Swift.Bool
116
+ public func encode(to encoder: any Swift.Encoder) throws
117
+ public init(from decoder: any Swift.Decoder) throws
118
+ }
119
+ public enum BeekonState : Swift.Sendable, Swift.Equatable {
120
+ case idle
121
+ case tracking
122
+ case stopped(BeekonKit.StopReason)
123
+ public static func == (a: BeekonKit.BeekonState, b: BeekonKit.BeekonState) -> Swift.Bool
124
+ }
125
+ public enum StopReason : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
126
+ case user
127
+ case permissionDenied
128
+ case locationServicesDisabled
129
+ case locationUnavailable
130
+ case system
131
+ public init?(rawValue: Swift.String)
132
+ public typealias RawValue = Swift.String
133
+ public var rawValue: Swift.String {
134
+ get
135
+ }
136
+ }
137
+ public struct GeofenceEvent : Swift.Sendable, Swift.Equatable {
138
+ public let id: Swift.String
139
+ public let geofenceId: Swift.String
140
+ public let type: BeekonKit.Transition
141
+ public let timestamp: Foundation.Date
142
+ public init(id: Swift.String, geofenceId: Swift.String, type: BeekonKit.Transition, timestamp: Foundation.Date)
143
+ public static func == (a: BeekonKit.GeofenceEvent, b: BeekonKit.GeofenceEvent) -> Swift.Bool
144
+ }
145
+ public struct Location : Swift.Sendable, Swift.Equatable {
146
+ public let id: Swift.String
147
+ public let latitude: Swift.Double
148
+ public let longitude: Swift.Double
149
+ public let timestamp: Foundation.Date
150
+ public let accuracy: Swift.Double?
151
+ public let speed: Swift.Double?
152
+ public let bearing: Swift.Double?
153
+ public let altitude: Swift.Double?
154
+ public let quality: BeekonKit.LocationQuality
155
+ public let trigger: BeekonKit.LocationTrigger
156
+ public let motion: BeekonKit.MotionState
157
+ public let activity: BeekonKit.ActivityType?
158
+ public let isMock: Swift.Bool
159
+ public init(id: Swift.String, latitude: Swift.Double, longitude: Swift.Double, timestamp: Foundation.Date, accuracy: Swift.Double? = nil, speed: Swift.Double? = nil, bearing: Swift.Double? = nil, altitude: Swift.Double? = nil, quality: BeekonKit.LocationQuality = .ok, trigger: BeekonKit.LocationTrigger = .interval, motion: BeekonKit.MotionState = .unknown, activity: BeekonKit.ActivityType? = nil, isMock: Swift.Bool = false)
160
+ public static func == (a: BeekonKit.Location, b: BeekonKit.Location) -> Swift.Bool
161
+ }
162
+ public enum LocationQuality : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
163
+ case ok
164
+ case lowAccuracy
165
+ case implausibleSpeed
166
+ public init?(rawValue: Swift.String)
167
+ public typealias RawValue = Swift.String
168
+ public var rawValue: Swift.String {
169
+ get
170
+ }
171
+ }
172
+ public enum LocationTrigger : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
173
+ case interval
174
+ case motion
175
+ case checkIn
176
+ case geofence
177
+ case manual
178
+ public init?(rawValue: Swift.String)
179
+ public typealias RawValue = Swift.String
180
+ public var rawValue: Swift.String {
181
+ get
182
+ }
183
+ }
184
+ public enum MotionState : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
185
+ case moving
186
+ case stationary
187
+ case unknown
188
+ public init?(rawValue: Swift.String)
189
+ public typealias RawValue = Swift.String
190
+ public var rawValue: Swift.String {
191
+ get
192
+ }
193
+ }
194
+ public enum StationaryMode : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
195
+ case keepTracking
196
+ case pause
197
+ case pauseWithCheckIns
198
+ public init?(rawValue: Swift.String)
199
+ public typealias RawValue = Swift.String
200
+ public var rawValue: Swift.String {
201
+ get
202
+ }
203
+ }
204
+ public enum SyncStatus : Swift.Sendable, Swift.Equatable {
205
+ case idle
206
+ case pending
207
+ case failed(BeekonKit.SyncFailure)
208
+ public static func == (a: BeekonKit.SyncStatus, b: BeekonKit.SyncStatus) -> Swift.Bool
209
+ }
210
+ public enum SyncFailure : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
211
+ case auth
212
+ case rejected
213
+ public init?(rawValue: Swift.String)
214
+ public typealias RawValue = Swift.String
215
+ public var rawValue: Swift.String {
216
+ get
217
+ }
218
+ }
219
+ public enum Transition : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Hashable, Swift.Codable {
220
+ case enter
221
+ case exit
222
+ public init?(rawValue: Swift.String)
223
+ public typealias RawValue = Swift.String
224
+ public var rawValue: Swift.String {
225
+ get
226
+ }
227
+ }
228
+ extension BeekonKit.AccuracyMode : Swift.RawRepresentable {}
229
+ extension BeekonKit.ActivityType : Swift.RawRepresentable {}
230
+ extension BeekonKit.StopReason : Swift.RawRepresentable {}
231
+ extension BeekonKit.LocationQuality : Swift.RawRepresentable {}
232
+ extension BeekonKit.LocationTrigger : Swift.RawRepresentable {}
233
+ extension BeekonKit.MotionState : Swift.RawRepresentable {}
234
+ extension BeekonKit.StationaryMode : Swift.RawRepresentable {}
235
+ extension BeekonKit.SyncFailure : Swift.RawRepresentable {}
236
+ extension BeekonKit.Transition : Swift.RawRepresentable {}
@@ -48,7 +48,7 @@
48
48
  <!--
49
49
  Required-Reason APIs we use:
50
50
  - UserDefaults (CA92.1): StateHolder/TrackingPersistence stores the
51
- last-known tracking config in the com.wayq.beekon UserDefaults suite
51
+ last-known tracking config in the in.wayq.beekon UserDefaults suite
52
52
  so SLC-driven relaunches can auto-restore tracking.
53
53
  - File timestamp (3B52.1): GRDB queries timestamps on its own SQLite
54
54
  database file inside the host app's container.