@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 x86_64-apple-ios17.0-simulator -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.
@@ -6,23 +6,11 @@
6
6
  <dict>
7
7
  <key>Info.plist</key>
8
8
  <data>
9
- w9rsPHfS6nhyFAFD48jpWHGzYuc=
10
- </data>
11
- <key>PrivacyInfo.xcprivacy</key>
12
- <data>
13
- +Hzj9e+o3dYoDboCDA7ofM2a0kc=
9
+ O1peKZ+DrU3WFwjRILn7rOtdq/4=
14
10
  </data>
15
11
  </dict>
16
12
  <key>files2</key>
17
- <dict>
18
- <key>PrivacyInfo.xcprivacy</key>
19
- <dict>
20
- <key>hash2</key>
21
- <data>
22
- E3plr2RiT1CPWdLg5VfDUw1k7yShykpszuDqfKG4YYw=
23
- </data>
24
- </dict>
25
- </dict>
13
+ <dict/>
26
14
  <key>rules</key>
27
15
  <dict>
28
16
  <key>^.*</key>
@@ -1,16 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  /**
4
- * Codegen TurboModule spec — DO NOT export Wire* types from `src/index.tsx`.
5
- * The public TS API in `src/beekon.ts` and `src/types/` is what consumers use;
6
- * mappers in `src/internal/mappers.ts` convert between the two.
4
+ * Codegen TurboModule spec — the single source React Native's Codegen reads to
5
+ * generate the native interface. **DO NOT export Wire* types from
6
+ * `src/index.tsx`.** The public TS API in `src/beekon.ts` and `src/types/` is
7
+ * what consumers use; mappers in `src/internal/mappers.ts` convert between the
8
+ * two.
7
9
  *
8
- * Wire types are flat (primitives + nested flat objects) because Codegen's
9
- * TS-to-Kotlin/ObjC type derivation has limited support for unions and
10
- * recursive structures. State variants are encoded as a `type` discriminator
11
- * string with sibling fields nullable per variant.
10
+ * Wire types are deliberately **flat** (primitives + flat nested objects +
11
+ * arrays) because Codegen's TSKotlin/ObjC derivation has no support for unions
12
+ * or recursive structures:
13
+ *
14
+ * - **Enums travel as plain `string`** (e.g. `accuracyMode`, `quality`); the
15
+ * mappers translate to/from the public string-literal unions with a defensive
16
+ * fallback, so an unknown value never crashes a subscriber.
17
+ * - **Sum types** (`WireState`, `WireSyncStatus`) are a `type` discriminator
18
+ * string plus sibling fields nullable per variant.
19
+ * - **String maps** (`headers`, `extras`) travel as `WireKeyValue[]` pairs —
20
+ * Codegen has no portable dictionary type.
21
+ * - **Timestamps** are epoch-milliseconds; intervals are seconds.
12
22
  */
13
23
 
14
24
  import { TurboModuleRegistry } from 'react-native';
25
+
26
+ /** A single string map entry — see `headers` / `setExtras`. */
27
+
28
+ /** Android-only foreground-service notification overrides. iOS ignores it. */
29
+
15
30
  export default TurboModuleRegistry.getEnforcing('BeekonRn');
16
31
  //# sourceMappingURL=NativeBeekonRn.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBeekonRn.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAoDlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,UAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBeekonRn.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;AAaA;;AAiHA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,UAAU,CAAC","ignoreList":[]}
@@ -1,106 +1,255 @@
1
1
  "use strict";
2
2
 
3
3
  import NativeBeekon from "./NativeBeekonRn.js";
4
- import { configToWire, wireToPosition, wireToState } from "./internal/mappers.js";
4
+ import { configToWire, geofenceToWire, recordToEntries, rethrowAsBeekonError, wireToGeofence, wireToGeofenceEvent, wireToLocation, wireToState, wireToSyncStatus } from "./internal/mappers.js";
5
+ /**
6
+ * Fans the four native EventEmitters out to multiple JS subscribers and adds
7
+ * replay-1 semantics for `state` / `syncStatus` (RN EventEmitters don't replay,
8
+ * so we cache the latest value and hand it to new subscribers immediately —
9
+ * matching the native StateFlow / AsyncStream contract). `location` /
10
+ * `geofenceEvent` are plain fan-out with no replay.
11
+ *
12
+ * Native subscriptions are opened once, on first use, and kept for the app
13
+ * lifetime — the native module collects its flows continuously regardless, so
14
+ * this only keeps the JS cache warm.
15
+ */
16
+ class EventHub {
17
+ subscribed = false;
18
+ stateListeners = new Set();
19
+ locationListeners = new Set();
20
+ geofenceListeners = new Set();
21
+ syncListeners = new Set();
22
+ /** Idempotent: opens the native subscriptions the first time it is called. */
23
+ ensureSubscribed() {
24
+ if (this.subscribed) return;
25
+ this.subscribed = true;
26
+ NativeBeekon.onState(w => {
27
+ const s = wireToState(w);
28
+ this.lastState = s;
29
+ this.stateListeners.forEach(cb => cb(s));
30
+ });
31
+ NativeBeekon.onLocation(w => {
32
+ const l = wireToLocation(w);
33
+ this.locationListeners.forEach(cb => cb(l));
34
+ });
35
+ NativeBeekon.onGeofenceEvent(w => {
36
+ const g = wireToGeofenceEvent(w);
37
+ this.geofenceListeners.forEach(cb => cb(g));
38
+ });
39
+ NativeBeekon.onSyncStatus(w => {
40
+ const s = wireToSyncStatus(w);
41
+ this.lastSyncStatus = s;
42
+ this.syncListeners.forEach(cb => cb(s));
43
+ });
44
+ }
45
+ onState(cb) {
46
+ this.ensureSubscribed();
47
+ this.stateListeners.add(cb);
48
+ if (this.lastState !== undefined) cb(this.lastState);
49
+ return () => {
50
+ this.stateListeners.delete(cb);
51
+ };
52
+ }
53
+ onLocation(cb) {
54
+ this.ensureSubscribed();
55
+ this.locationListeners.add(cb);
56
+ return () => {
57
+ this.locationListeners.delete(cb);
58
+ };
59
+ }
60
+ onGeofenceEvent(cb) {
61
+ this.ensureSubscribed();
62
+ this.geofenceListeners.add(cb);
63
+ return () => {
64
+ this.geofenceListeners.delete(cb);
65
+ };
66
+ }
67
+ onSyncStatus(cb) {
68
+ this.ensureSubscribed();
69
+ this.syncListeners.add(cb);
70
+ if (this.lastSyncStatus !== undefined) cb(this.lastSyncStatus);
71
+ return () => {
72
+ this.syncListeners.delete(cb);
73
+ };
74
+ }
75
+ }
5
76
 
6
77
  /**
7
- * Public facade for the Beekon SDK. Mirrors the native APIs:
78
+ * Public facade for the Beekon SDK a 1:1 mirror of the native APIs:
8
79
  *
9
- * - Android: `com.wayq.beekon.Beekon` (object)
10
- * - iOS: `Beekon.shared` (actor)
80
+ * - Android: `in.wayq.beekon.Beekon` (object)
81
+ * - iOS: `BeekonKit.Beekon.shared` (actor)
11
82
  *
12
- * Lifecycle: `init()` once `configure(config)` `start()` ...
13
- * `stop()` (idempotent) or `shutdown()` (final teardown). Subscribe to
14
- * `onState` / `onPosition` for live updates; query `history(from, to)` for
15
- * persisted points.
83
+ * There is **no `initialize()`** the native SDKs auto-initialize. Lifecycle:
84
+ * `configure(config)` (optional; defaults 30s / 100m) `start()`
85
+ * `stop()`. `start()` / `stop()` **never throw** `onState` is the single
86
+ * source of truth for whether tracking is active and why it stopped.
16
87
  *
17
- * **Threading:** Methods are safe to call from any JS context. Subscribers'
88
+ * **Threading:** methods are safe to call from any JS context; subscriber
18
89
  * callbacks fire on the JS thread.
19
90
  *
20
- * **Persistence invariant:** the SDK persists every gated position natively;
21
- * JS is a passive observer. In background, the JS engine is not guaranteed to
22
- * be alive — for past points, use `history()`.
91
+ * **Persistence invariant:** the SDK persists every gated fix natively; JS is a
92
+ * passive observer that is not guaranteed to be alive in the background. For
93
+ * past fixes use `getLocations()`.
23
94
  */
24
95
  class BeekonImpl {
96
+ hub = new EventHub();
97
+
25
98
  /**
26
- * Initialize the SDK. Idempotent; safe to call more than once. Must be
27
- * called once before `configure()`.
28
- *
29
- * Errors:
30
- * - `NO_GMS_AVAILABLE` (Android) — Google Play Services missing.
99
+ * Set tracking parameters. Optional `start()` falls back to the previously
100
+ * persisted config, or the SDK defaults if never configured. While tracking,
101
+ * gate thresholds take effect on the next admitted fix without restarting the
102
+ * location subscription; `accuracyMode` applies on the next `start()`.
31
103
  */
32
- async init() {
33
- return NativeBeekon.initialize();
104
+ async configure(config) {
105
+ this.hub.ensureSubscribed();
106
+ await NativeBeekon.configure(configToWire(config));
34
107
  }
35
108
 
36
109
  /**
37
- * Set sampling and platform-specific config. Replaces any previous config.
38
- * Must be called before `start()`.
110
+ * Begin tracking. Never throws observe `onState` for the outcome
111
+ * (`stopped(reason)` on a permission / services / system problem). Beekon
112
+ * ships no permission API: request permissions in the host app, then observe
113
+ * `onState`.
114
+ */
115
+ async start() {
116
+ this.hub.ensureSubscribed();
117
+ await NativeBeekon.start();
118
+ }
119
+
120
+ /** Stop tracking. Idempotent. Registered geofences keep firing. */
121
+ async stop() {
122
+ this.hub.ensureSubscribed();
123
+ await NativeBeekon.stop();
124
+ }
125
+
126
+ /**
127
+ * Resume tracking if a session was active before the app was terminated. A
128
+ * no-op if the user explicitly stopped. Call early in app startup.
39
129
  *
40
- * Errors:
41
- * - `NOT_INITIALISED` `init()` was not called first.
42
- * - `NOT_CONFIGURED` Android only, `androidNotification` was missing.
130
+ * Note: on a background relaunch the JS engine may not be running, so true
131
+ * cold-launch resume also requires native host wiring (Android: call
132
+ * `Beekon.start()` from `Application.onCreate`; iOS: `registerBackgroundTasks`
133
+ * in the AppDelegate). See the README.
43
134
  */
44
- async configure(config) {
45
- return NativeBeekon.configure(configToWire(config));
135
+ async resumeIfNeeded() {
136
+ this.hub.ensureSubscribed();
137
+ await NativeBeekon.resumeIfNeeded();
46
138
  }
47
139
 
48
140
  /**
49
- * Begin tracking. Transitions state from `idle` `starting` `tracking`.
141
+ * Read persisted fixes in the inclusive range `[from, to]`, oldest first.
142
+ * Reads come from the SDK's local storage (Room on Android, GRDB on iOS) — the
143
+ * source of truth even when JS was asleep. With sync enabled, rows are deleted
144
+ * locally once the server accepts them, so this returns only un-uploaded fixes.
50
145
  *
51
- * Errors:
52
- * - `PERMISSION_DENIED` — location permission not granted.
53
- * - `LOCATION_SERVICES_DISABLED` (iOS) — system location services off.
54
- * - `SERVICE_FAILED` — native service couldn't start.
146
+ * Throws `BeekonError` with kind `'storage'` on a database read failure.
55
147
  */
56
- async start() {
57
- return NativeBeekon.start();
148
+ async getLocations(from, to) {
149
+ try {
150
+ const wires = await NativeBeekon.getLocations(from.getTime(), to.getTime());
151
+ return wires.map(wireToLocation);
152
+ } catch (e) {
153
+ rethrowAsBeekonError(e);
154
+ }
58
155
  }
59
156
 
60
- /** Stop tracking. Idempotent. State → `stopped`. */
61
- async stop() {
62
- return NativeBeekon.stop();
157
+ /**
158
+ * Delete stored locations captured at or before `before` (all of them when
159
+ * `before` is omitted). Returns the number of rows removed. Throws
160
+ * `BeekonError` with kind `'storage'` on a failure.
161
+ */
162
+ async deleteLocations(before) {
163
+ try {
164
+ // Negative is the wire sentinel for "delete all" (see NativeBeekonRn.ts).
165
+ return await NativeBeekon.deleteLocations(before ? before.getTime() : -1);
166
+ } catch (e) {
167
+ rethrowAsBeekonError(e);
168
+ }
63
169
  }
64
170
 
65
171
  /**
66
- * Final teardown releases native resources. Most apps don't need this;
67
- * `stop()` is sufficient between sessions.
172
+ * The number of stored locations not yet uploaded. Throws `BeekonError` with
173
+ * kind `'storage'` on a failure.
68
174
  */
69
- async shutdown() {
70
- return NativeBeekon.shutdown();
175
+ async pendingUploadCount() {
176
+ try {
177
+ return await NativeBeekon.pendingUploadCount();
178
+ } catch (e) {
179
+ rethrowAsBeekonError(e);
180
+ }
71
181
  }
72
182
 
73
183
  /**
74
- * Read persisted positions in the time range [from, to]. Returns positions
75
- * in chronological order. Reads come from the SDK's local storage (Room on
76
- * Android, GRDB on iOS) — the source of truth even when JS was asleep.
77
- *
78
- * Retention: positions older than 7 days OR beyond the most recent 100K are
79
- * pruned automatically.
184
+ * Request an immediate upload. Best-effort and self-retrying; a no-op when
185
+ * sync is not configured.
80
186
  */
81
- async history(from, to) {
82
- const wires = await NativeBeekon.history(from.getTime(), to.getTime());
83
- return wires.map(wireToPosition);
187
+ async sync() {
188
+ await NativeBeekon.sync();
189
+ }
190
+
191
+ /** Set custom key/value fields (e.g. `user_id`) included with every upload. */
192
+ async setExtras(extras) {
193
+ await NativeBeekon.setExtras(recordToEntries(extras));
194
+ }
195
+
196
+ /**
197
+ * Register geofences. Re-adding an `id` replaces the existing one. Throws
198
+ * `BeekonError` with kind `'invalidGeofence'` if any entry fails validation —
199
+ * none are added when one is invalid.
200
+ */
201
+ async addGeofences(geofences) {
202
+ try {
203
+ await NativeBeekon.addGeofences(geofences.map(geofenceToWire));
204
+ } catch (e) {
205
+ rethrowAsBeekonError(e);
206
+ }
207
+ }
208
+
209
+ /** Unregister geofences by id. Unknown ids are ignored. */
210
+ async removeGeofences(ids) {
211
+ await NativeBeekon.removeGeofences(ids);
212
+ }
213
+
214
+ /** The currently registered geofences. */
215
+ async listGeofences() {
216
+ const wires = await NativeBeekon.listGeofences();
217
+ return wires.map(wireToGeofence);
84
218
  }
85
219
 
86
220
  /**
87
- * Subscribe to state transitions. Returns an unsubscribe function. The
88
- * current state is delivered to new subscribers immediately (replay-1
89
- * semantics, matching the native `state` flow).
221
+ * Subscribe to tracking-state transitions (`idle` / `tracking` /
222
+ * `stopped(reason)`). The current state is delivered to new subscribers
223
+ * immediately (replay-1). Returns an unsubscribe function.
90
224
  */
91
225
  onState(cb) {
92
- const subscription = NativeBeekon.onState(wire => cb(wireToState(wire)));
93
- return () => subscription.remove();
226
+ return this.hub.onState(cb);
227
+ }
228
+
229
+ /**
230
+ * Subscribe to gated locations as they arrive. Broadcast (no replay) — only
231
+ * delivers while the JS engine is alive. For fixes emitted while JS was
232
+ * asleep, use `getLocations()`. Returns an unsubscribe function.
233
+ */
234
+ onLocation(cb) {
235
+ return this.hub.onLocation(cb);
236
+ }
237
+
238
+ /**
239
+ * Subscribe to geofence enter / exit crossings. Broadcast (no replay).
240
+ * Returns an unsubscribe function.
241
+ */
242
+ onGeofenceEvent(cb) {
243
+ return this.hub.onGeofenceEvent(cb);
94
244
  }
95
245
 
96
246
  /**
97
- * Subscribe to gated positions as they arrive. Returns an unsubscribe
98
- * function. Broadcast (no replay) only delivers while the JS engine is
99
- * alive. For points emitted while JS was asleep, use `history()`.
247
+ * Subscribe to upload health (`idle` / `pending` / `failed(reason)`). The
248
+ * current status is delivered to new subscribers immediately (replay-1).
249
+ * Returns an unsubscribe function.
100
250
  */
101
- onPosition(cb) {
102
- const subscription = NativeBeekon.onPosition(wire => cb(wireToPosition(wire)));
103
- return () => subscription.remove();
251
+ onSyncStatus(cb) {
252
+ return this.hub.onSyncStatus(cb);
104
253
  }
105
254
  }
106
255
  export const Beekon = new BeekonImpl();
@@ -1 +1 @@
1
- {"version":3,"names":["NativeBeekon","configToWire","wireToPosition","wireToState","BeekonImpl","init","initialize","configure","config","start","stop","shutdown","history","from","to","wires","getTime","map","onState","cb","subscription","wire","remove","onPosition","Beekon"],"sourceRoot":"../../src","sources":["beekon.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,qBAAkB;AAI3C,SAASC,YAAY,EAAEC,cAAc,EAAEC,WAAW,QAAQ,uBAAoB;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,CAAC;EACf;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,IAAIA,CAAA,EAAkB;IAC1B,OAAOL,YAAY,CAACM,UAAU,CAAC,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,SAASA,CAACC,MAAoB,EAAiB;IACnD,OAAOR,YAAY,CAACO,SAAS,CAACN,YAAY,CAACO,MAAM,CAAC,CAAC;EACrD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,KAAKA,CAAA,EAAkB;IAC3B,OAAOT,YAAY,CAACS,KAAK,CAAC,CAAC;EAC7B;;EAEA;EACA,MAAMC,IAAIA,CAAA,EAAkB;IAC1B,OAAOV,YAAY,CAACU,IAAI,CAAC,CAAC;EAC5B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,QAAQA,CAAA,EAAkB;IAC9B,OAAOX,YAAY,CAACW,QAAQ,CAAC,CAAC;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,OAAOA,CAACC,IAAU,EAAEC,EAAQ,EAAuB;IACvD,MAAMC,KAAK,GAAG,MAAMf,YAAY,CAACY,OAAO,CAACC,IAAI,CAACG,OAAO,CAAC,CAAC,EAAEF,EAAE,CAACE,OAAO,CAAC,CAAC,CAAC;IACtE,OAAOD,KAAK,CAACE,GAAG,CAACf,cAAc,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;EACEgB,OAAOA,CAACC,EAA4B,EAAc;IAChD,MAAMC,YAAY,GAAGpB,YAAY,CAACkB,OAAO,CAAEG,IAAI,IAAKF,EAAE,CAAChB,WAAW,CAACkB,IAAI,CAAC,CAAC,CAAC;IAC1E,OAAO,MAAMD,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;;EAEA;AACF;AACA;AACA;AACA;EACEC,UAAUA,CAACJ,EAAyB,EAAc;IAChD,MAAMC,YAAY,GAAGpB,YAAY,CAACuB,UAAU,CAAEF,IAAI,IAChDF,EAAE,CAACjB,cAAc,CAACmB,IAAI,CAAC,CACzB,CAAC;IACD,OAAO,MAAMD,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;AACF;AAEA,OAAO,MAAME,MAAM,GAAG,IAAIpB,UAAU,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeBeekon","configToWire","geofenceToWire","recordToEntries","rethrowAsBeekonError","wireToGeofence","wireToGeofenceEvent","wireToLocation","wireToState","wireToSyncStatus","EventHub","subscribed","stateListeners","Set","locationListeners","geofenceListeners","syncListeners","ensureSubscribed","onState","w","s","lastState","forEach","cb","onLocation","l","onGeofenceEvent","g","onSyncStatus","lastSyncStatus","add","undefined","delete","BeekonImpl","hub","configure","config","start","stop","resumeIfNeeded","getLocations","from","to","wires","getTime","map","e","deleteLocations","before","pendingUploadCount","sync","setExtras","extras","addGeofences","geofences","removeGeofences","ids","listGeofences","Beekon"],"sourceRoot":"../../src","sources":["beekon.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,qBAAkB;AAM3C,SACEC,YAAY,EACZC,cAAc,EACdC,eAAe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