@wayq/beekon-rn 0.0.5 → 0.0.7
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 +127 -0
- package/README.md +303 -81
- package/android/build.gradle +3 -2
- package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +164 -7
- package/ios/BeekonRn.mm +23 -0
- package/ios/BeekonRn.swift +199 -10
- 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 +7784 -2697
- 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 +111 -3
- 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 +7784 -2697
- 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 +111 -3
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +7784 -2697
- 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 +111 -3
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +1 -1
- package/lib/module/NativeBeekonRn.js +20 -0
- package/lib/module/NativeBeekonRn.js.map +1 -1
- package/lib/module/beekon.js +90 -7
- package/lib/module/beekon.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/mappers.js +98 -4
- 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/module/types/license.js +2 -0
- package/lib/module/types/license.js.map +1 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts +84 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
- package/lib/typescript/src/beekon.d.ts +45 -1
- package/lib/typescript/src/beekon.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/mappers.d.ts +12 -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 +29 -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/lib/typescript/src/types/license.d.ts +50 -0
- package/lib/typescript/src/types/license.d.ts.map +1 -0
- package/package.json +10 -2
- package/scripts/fetch-beekonkit.sh +4 -4
- package/src/NativeBeekonRn.ts +93 -0
- package/src/beekon.ts +104 -6
- package/src/index.tsx +4 -0
- package/src/internal/mappers.ts +109 -1
- package/src/types/auth.ts +101 -0
- package/src/types/config.ts +29 -0
- package/src/types/enums.ts +16 -0
- package/src/types/error.ts +19 -4
- package/src/types/license.ts +47 -0
|
Binary file
|
|
@@ -1,17 +1,19 @@
|
|
|
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 x86_64-apple-
|
|
3
|
+
// swift-module-flags: -target x86_64-apple-ios13.0-simulator -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
|
|
7
7
|
@preconcurrency import CoreLocation
|
|
8
8
|
import CoreMotion
|
|
9
|
+
import CryptoKit
|
|
9
10
|
import Darwin
|
|
10
11
|
import Foundation
|
|
11
12
|
import Foundation/*.Bundle*/
|
|
12
13
|
import Foundation/*.ProcessInfo*/
|
|
13
14
|
import Foundation/*.URL*/
|
|
14
15
|
import Network
|
|
16
|
+
import Security
|
|
15
17
|
import Swift
|
|
16
18
|
@preconcurrency import UIKit
|
|
17
19
|
import _Concurrency
|
|
@@ -41,14 +43,75 @@ public enum ActivityType : Swift.String, Swift.Sendable, Swift.Equatable, Swift.
|
|
|
41
43
|
get
|
|
42
44
|
}
|
|
43
45
|
}
|
|
46
|
+
public enum AuthStrategy : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
47
|
+
case bearer
|
|
48
|
+
case raw
|
|
49
|
+
public init?(rawValue: Swift.String)
|
|
50
|
+
public typealias RawValue = Swift.String
|
|
51
|
+
public var rawValue: Swift.String {
|
|
52
|
+
get
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
public enum AuthBodyFormat : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
56
|
+
case form
|
|
57
|
+
case json
|
|
58
|
+
public init?(rawValue: Swift.String)
|
|
59
|
+
public typealias RawValue = Swift.String
|
|
60
|
+
public var rawValue: Swift.String {
|
|
61
|
+
get
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
public struct AuthResponseMapping : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
65
|
+
public var accessToken: Swift.String?
|
|
66
|
+
public var refreshToken: Swift.String?
|
|
67
|
+
public var expiresIn: Swift.String?
|
|
68
|
+
public var expiresAt: Swift.String?
|
|
69
|
+
public init(accessToken: Swift.String? = nil, refreshToken: Swift.String? = nil, expiresIn: Swift.String? = nil, expiresAt: Swift.String? = nil)
|
|
70
|
+
public static func == (a: BeekonKit.AuthResponseMapping, b: BeekonKit.AuthResponseMapping) -> Swift.Bool
|
|
71
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
72
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
73
|
+
}
|
|
74
|
+
public struct AuthConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
75
|
+
public var accessToken: Swift.String?
|
|
76
|
+
public var refreshToken: Swift.String?
|
|
77
|
+
public var expiresAt: Foundation.TimeInterval?
|
|
78
|
+
public var strategy: BeekonKit.AuthStrategy
|
|
79
|
+
public var refreshUrl: Foundation.URL?
|
|
80
|
+
public var refreshPayload: [Swift.String : Swift.String]
|
|
81
|
+
public var refreshHeaders: [Swift.String : Swift.String]
|
|
82
|
+
public var refreshBodyFormat: BeekonKit.AuthBodyFormat
|
|
83
|
+
public var responseMapping: BeekonKit.AuthResponseMapping
|
|
84
|
+
public var skewMarginSeconds: Foundation.TimeInterval
|
|
85
|
+
public var seedEpoch: Swift.Int?
|
|
86
|
+
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)
|
|
87
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
88
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
89
|
+
public static func == (a: BeekonKit.AuthConfig, b: BeekonKit.AuthConfig) -> Swift.Bool
|
|
90
|
+
}
|
|
91
|
+
public struct AuthTokens : Swift.Sendable, Swift.Equatable {
|
|
92
|
+
public let accessToken: Swift.String
|
|
93
|
+
public let refreshToken: Swift.String?
|
|
94
|
+
public let expiresAt: Foundation.TimeInterval?
|
|
95
|
+
public let epoch: Swift.Int
|
|
96
|
+
public init(accessToken: Swift.String, refreshToken: Swift.String?, expiresAt: Foundation.TimeInterval?, epoch: Swift.Int)
|
|
97
|
+
public static func == (a: BeekonKit.AuthTokens, b: BeekonKit.AuthTokens) -> Swift.Bool
|
|
98
|
+
}
|
|
44
99
|
@_hasMissingDesignatedInitializers public actor Beekon {
|
|
45
100
|
public static let shared: BeekonKit.Beekon
|
|
46
101
|
nonisolated public static func registerBackgroundTasks()
|
|
102
|
+
nonisolated public static func setWrapperInfo(product: Swift.String, version: Swift.String)
|
|
103
|
+
public var licenseStatus: BeekonKit.LicenseStatus {
|
|
104
|
+
get
|
|
105
|
+
}
|
|
106
|
+
public var licenseStatusUpdates: _Concurrency.AsyncStream<BeekonKit.LicenseStatus> {
|
|
107
|
+
get
|
|
108
|
+
}
|
|
47
109
|
public func configure(_ config: BeekonKit.BeekonConfig) async
|
|
48
110
|
public func start() async
|
|
49
111
|
public func stop() async
|
|
50
112
|
public func resumeIfNeeded() async
|
|
51
113
|
public func getLocations(from: Foundation.Date, to: Foundation.Date) async throws -> [BeekonKit.Location]
|
|
114
|
+
public func getCurrentLocation(timeout: Foundation.TimeInterval = 15, accuracy: BeekonKit.AccuracyMode? = nil) async throws -> BeekonKit.Location?
|
|
52
115
|
public func deleteLocations(before: Foundation.Date?) async throws -> Swift.Int
|
|
53
116
|
public func pendingUploadCount() async throws -> Swift.Int
|
|
54
117
|
public func sync()
|
|
@@ -68,6 +131,9 @@ public enum ActivityType : Swift.String, Swift.Sendable, Swift.Equatable, Swift.
|
|
|
68
131
|
public var syncStatus: _Concurrency.AsyncStream<BeekonKit.SyncStatus> {
|
|
69
132
|
get
|
|
70
133
|
}
|
|
134
|
+
public var authChanges: _Concurrency.AsyncStream<BeekonKit.AuthTokens> {
|
|
135
|
+
get
|
|
136
|
+
}
|
|
71
137
|
@objc deinit
|
|
72
138
|
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
|
|
73
139
|
@_semantics("defaultActor") nonisolated final public var unownedExecutor: _Concurrency.UnownedSerialExecutor {
|
|
@@ -82,9 +148,10 @@ public struct BeekonConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
|
82
148
|
public var stationaryRadiusMeters: Swift.Double
|
|
83
149
|
public var detectActivity: Swift.Bool
|
|
84
150
|
public var sync: BeekonKit.SyncConfig?
|
|
151
|
+
public var licenseKey: Swift.String?
|
|
85
152
|
public static let minimumLocationIntervalSeconds: Swift.Double
|
|
86
153
|
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)
|
|
154
|
+
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, licenseKey: Swift.String? = nil)
|
|
88
155
|
public init(from decoder: any Swift.Decoder) throws
|
|
89
156
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
90
157
|
public static func == (a: BeekonKit.BeekonConfig, b: BeekonKit.BeekonConfig) -> Swift.Bool
|
|
@@ -94,7 +161,8 @@ public struct SyncConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
|
94
161
|
public var headers: [Swift.String : Swift.String]
|
|
95
162
|
public var intervalSeconds: Foundation.TimeInterval
|
|
96
163
|
public var batchSize: Swift.Int
|
|
97
|
-
public
|
|
164
|
+
public var auth: BeekonKit.AuthConfig?
|
|
165
|
+
public init(url: Foundation.URL, headers: [Swift.String : Swift.String] = [:], intervalSeconds: Foundation.TimeInterval = 300, batchSize: Swift.Int = 100, auth: BeekonKit.AuthConfig? = nil)
|
|
98
166
|
public static func == (a: BeekonKit.SyncConfig, b: BeekonKit.SyncConfig) -> Swift.Bool
|
|
99
167
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
100
168
|
public init(from decoder: any Swift.Decoder) throws
|
|
@@ -102,8 +170,19 @@ public struct SyncConfig : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
|
102
170
|
public enum BeekonError : Swift.Error, Swift.Sendable, Swift.Equatable {
|
|
103
171
|
case invalidGeofence(reason: Swift.String)
|
|
104
172
|
case storage(reason: Swift.String)
|
|
173
|
+
case locationUnavailable(reason: BeekonKit.LocationUnavailableReason)
|
|
105
174
|
public static func == (a: BeekonKit.BeekonError, b: BeekonKit.BeekonError) -> Swift.Bool
|
|
106
175
|
}
|
|
176
|
+
public enum LocationUnavailableReason : Swift.Sendable, Swift.Equatable {
|
|
177
|
+
case permissionDenied
|
|
178
|
+
case locationServicesDisabled
|
|
179
|
+
case unavailable
|
|
180
|
+
public static func == (a: BeekonKit.LocationUnavailableReason, b: BeekonKit.LocationUnavailableReason) -> Swift.Bool
|
|
181
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
182
|
+
public var hashValue: Swift.Int {
|
|
183
|
+
get
|
|
184
|
+
}
|
|
185
|
+
}
|
|
107
186
|
public struct BeekonGeofence : Swift.Sendable, Swift.Equatable, Swift.Codable {
|
|
108
187
|
public var id: Swift.String
|
|
109
188
|
public var latitude: Swift.Double
|
|
@@ -142,6 +221,28 @@ public struct GeofenceEvent : Swift.Sendable, Swift.Equatable {
|
|
|
142
221
|
public init(id: Swift.String, geofenceId: Swift.String, type: BeekonKit.Transition, timestamp: Foundation.Date)
|
|
143
222
|
public static func == (a: BeekonKit.GeofenceEvent, b: BeekonKit.GeofenceEvent) -> Swift.Bool
|
|
144
223
|
}
|
|
224
|
+
public enum LicenseStatus : Swift.Sendable, Swift.Equatable {
|
|
225
|
+
case notDetermined
|
|
226
|
+
case licensed(tier: Swift.String, entitlements: [Swift.String])
|
|
227
|
+
case evaluation
|
|
228
|
+
case expired
|
|
229
|
+
case updateEntitlementLapsed
|
|
230
|
+
case invalid(reason: BeekonKit.LicenseInvalidReason)
|
|
231
|
+
public static func == (a: BeekonKit.LicenseStatus, b: BeekonKit.LicenseStatus) -> Swift.Bool
|
|
232
|
+
}
|
|
233
|
+
public enum LicenseInvalidReason : Swift.String, Swift.Sendable, Swift.Equatable {
|
|
234
|
+
case malformed
|
|
235
|
+
case unknownKey
|
|
236
|
+
case badSignature
|
|
237
|
+
case appIdMismatch
|
|
238
|
+
case productMismatch
|
|
239
|
+
case unsupportedVersion
|
|
240
|
+
public init?(rawValue: Swift.String)
|
|
241
|
+
public typealias RawValue = Swift.String
|
|
242
|
+
public var rawValue: Swift.String {
|
|
243
|
+
get
|
|
244
|
+
}
|
|
245
|
+
}
|
|
145
246
|
public struct Location : Swift.Sendable, Swift.Equatable {
|
|
146
247
|
public let id: Swift.String
|
|
147
248
|
public let latitude: Swift.Double
|
|
@@ -227,7 +328,14 @@ public enum Transition : Swift.String, Swift.Sendable, Swift.Equatable, Swift.Ha
|
|
|
227
328
|
}
|
|
228
329
|
extension BeekonKit.AccuracyMode : Swift.RawRepresentable {}
|
|
229
330
|
extension BeekonKit.ActivityType : Swift.RawRepresentable {}
|
|
331
|
+
extension BeekonKit.AuthStrategy : Swift.Hashable {}
|
|
332
|
+
extension BeekonKit.AuthStrategy : Swift.RawRepresentable {}
|
|
333
|
+
extension BeekonKit.AuthBodyFormat : Swift.Hashable {}
|
|
334
|
+
extension BeekonKit.AuthBodyFormat : Swift.RawRepresentable {}
|
|
335
|
+
extension BeekonKit.LocationUnavailableReason : Swift.Hashable {}
|
|
230
336
|
extension BeekonKit.StopReason : Swift.RawRepresentable {}
|
|
337
|
+
extension BeekonKit.LicenseInvalidReason : Swift.Hashable {}
|
|
338
|
+
extension BeekonKit.LicenseInvalidReason : Swift.RawRepresentable {}
|
|
231
339
|
extension BeekonKit.LocationQuality : Swift.RawRepresentable {}
|
|
232
340
|
extension BeekonKit.LocationTrigger : Swift.RawRepresentable {}
|
|
233
341
|
extension BeekonKit.MotionState : Swift.RawRepresentable {}
|
|
@@ -25,7 +25,27 @@ import { TurboModuleRegistry } from 'react-native';
|
|
|
25
25
|
|
|
26
26
|
/** A single string map entry — see `headers` / `setExtras`. */
|
|
27
27
|
|
|
28
|
+
/** Flat wire form of `AuthResponseMapping`. Omitted keys use common-name detection. */
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Flat wire form of `AuthConfig` on {@link WireSyncConfig.auth}. Enums travel as
|
|
32
|
+
* strings (`strategy`: 'bearer'|'raw'; `refreshBodyFormat`: 'form'|'json'),
|
|
33
|
+
* string maps as `WireKeyValue[]`, and `expiresAtMs` is epoch milliseconds.
|
|
34
|
+
*/
|
|
35
|
+
|
|
28
36
|
/** Android-only foreground-service notification overrides. iOS ignores it. */
|
|
29
37
|
|
|
38
|
+
/**
|
|
39
|
+
* A token set the SDK rotated, delivered on `onAuthTokens`. `expiresAtMs` is
|
|
40
|
+
* epoch milliseconds; both it and `refreshToken` are `null` when absent.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Flat wire form of the current platform's native license status
|
|
45
|
+
* (license-format-v1 §8). `status` is the wire-stable identifier; `tier` and
|
|
46
|
+
* `entitlements` are populated only when `status === 'licensed'` (null / empty
|
|
47
|
+
* otherwise), and `reason` only when `status === 'invalid'`.
|
|
48
|
+
*/
|
|
49
|
+
|
|
30
50
|
export default TurboModuleRegistry.getEnforcing('BeekonRn');
|
|
31
51
|
//# 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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;
|
|
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;;AAMA;;AAQA;AACA;AACA;AACA;AACA;;AAwBA;;AAsFA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;;AA2EA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,UAAU,CAAC","ignoreList":[]}
|
package/lib/module/beekon.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import NativeBeekon from "./NativeBeekonRn.js";
|
|
4
|
-
import { configToWire, geofenceToWire, recordToEntries, rethrowAsBeekonError, wireToGeofence, wireToGeofenceEvent, wireToLocation, wireToState, wireToSyncStatus } from "./internal/mappers.js";
|
|
4
|
+
import { configToWire, geofenceToWire, recordToEntries, rethrowAsBeekonError, wireToAuthTokens, wireToGeofence, wireToGeofenceEvent, wireToLicenseStatus, wireToLocation, wireToState, wireToSyncStatus } from "./internal/mappers.js";
|
|
5
5
|
/**
|
|
6
|
-
* Fans the
|
|
7
|
-
* replay-1 semantics for `state` / `syncStatus` (RN EventEmitters
|
|
8
|
-
* so we cache the latest value and hand it to new subscribers
|
|
9
|
-
* matching the native StateFlow / AsyncStream contract).
|
|
10
|
-
* `geofenceEvent` are plain fan-out with no replay.
|
|
6
|
+
* Fans the five native EventEmitters out to multiple JS subscribers and adds
|
|
7
|
+
* replay-1 semantics for `state` / `syncStatus` / `authTokens` (RN EventEmitters
|
|
8
|
+
* don't replay, so we cache the latest value and hand it to new subscribers
|
|
9
|
+
* immediately — matching the native StateFlow / AsyncStream contract).
|
|
10
|
+
* `location` / `geofenceEvent` are plain fan-out with no replay.
|
|
11
11
|
*
|
|
12
12
|
* Native subscriptions are opened once, on first use, and kept for the app
|
|
13
13
|
* lifetime — the native module collects its flows continuously regardless, so
|
|
@@ -19,6 +19,8 @@ class EventHub {
|
|
|
19
19
|
locationListeners = new Set();
|
|
20
20
|
geofenceListeners = new Set();
|
|
21
21
|
syncListeners = new Set();
|
|
22
|
+
authTokenListeners = new Set();
|
|
23
|
+
licenseListeners = new Set();
|
|
22
24
|
/** Idempotent: opens the native subscriptions the first time it is called. */
|
|
23
25
|
ensureSubscribed() {
|
|
24
26
|
if (this.subscribed) return;
|
|
@@ -41,6 +43,16 @@ class EventHub {
|
|
|
41
43
|
this.lastSyncStatus = s;
|
|
42
44
|
this.syncListeners.forEach(cb => cb(s));
|
|
43
45
|
});
|
|
46
|
+
NativeBeekon.onAuthTokens(w => {
|
|
47
|
+
const t = wireToAuthTokens(w);
|
|
48
|
+
this.lastAuthTokens = t;
|
|
49
|
+
this.authTokenListeners.forEach(cb => cb(t));
|
|
50
|
+
});
|
|
51
|
+
NativeBeekon.onLicenseStatus(w => {
|
|
52
|
+
const s = wireToLicenseStatus(w);
|
|
53
|
+
this.lastLicenseStatus = s;
|
|
54
|
+
this.licenseListeners.forEach(cb => cb(s));
|
|
55
|
+
});
|
|
44
56
|
}
|
|
45
57
|
onState(cb) {
|
|
46
58
|
this.ensureSubscribed();
|
|
@@ -72,6 +84,22 @@ class EventHub {
|
|
|
72
84
|
this.syncListeners.delete(cb);
|
|
73
85
|
};
|
|
74
86
|
}
|
|
87
|
+
onAuthTokens(cb) {
|
|
88
|
+
this.ensureSubscribed();
|
|
89
|
+
this.authTokenListeners.add(cb);
|
|
90
|
+
if (this.lastAuthTokens !== undefined) cb(this.lastAuthTokens);
|
|
91
|
+
return () => {
|
|
92
|
+
this.authTokenListeners.delete(cb);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
onLicenseStatus(cb) {
|
|
96
|
+
this.ensureSubscribed();
|
|
97
|
+
this.licenseListeners.add(cb);
|
|
98
|
+
if (this.lastLicenseStatus !== undefined) cb(this.lastLicenseStatus);
|
|
99
|
+
return () => {
|
|
100
|
+
this.licenseListeners.delete(cb);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
75
103
|
}
|
|
76
104
|
|
|
77
105
|
/**
|
|
@@ -137,6 +165,31 @@ class BeekonImpl {
|
|
|
137
165
|
await NativeBeekon.resumeIfNeeded();
|
|
138
166
|
}
|
|
139
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Return a single fresh fix on demand — for the moment a host needs an
|
|
170
|
+
* immediate position (e.g. the instant a trip starts).
|
|
171
|
+
*
|
|
172
|
+
* Independent of tracking: works whether or not a session is running and never
|
|
173
|
+
* starts, stops, or disturbs one. The fix is not persisted and does not appear
|
|
174
|
+
* on `onLocation` — it is returned here only, tagged `'manual'`.
|
|
175
|
+
*
|
|
176
|
+
* Resolves `null` if no usable fix arrives within `timeoutMs` (default
|
|
177
|
+
* 15000). `accuracy` overrides the configured mode for this call only;
|
|
178
|
+
* omitted uses the configured mode.
|
|
179
|
+
*
|
|
180
|
+
* Throws `BeekonError` with kind `'permissionDenied'`,
|
|
181
|
+
* `'locationServicesDisabled'`, or `'locationUnavailable'` on a precondition
|
|
182
|
+
* failure.
|
|
183
|
+
*/
|
|
184
|
+
async getCurrentLocation(options) {
|
|
185
|
+
try {
|
|
186
|
+
const wires = await NativeBeekon.getCurrentLocation(options?.timeoutMs ?? 15000, options?.accuracy ?? '');
|
|
187
|
+
return wires.length === 0 ? null : wireToLocation(wires[0]);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
rethrowAsBeekonError(e);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
140
193
|
/**
|
|
141
194
|
* Read persisted fixes in the inclusive range `[from, to]`, oldest first.
|
|
142
195
|
* Reads come from the SDK's local storage (Room on Android, GRDB on iOS) — the
|
|
@@ -155,7 +208,7 @@ class BeekonImpl {
|
|
|
155
208
|
}
|
|
156
209
|
|
|
157
210
|
/**
|
|
158
|
-
* Delete stored locations captured
|
|
211
|
+
* Delete stored locations captured before `before` (all of them when
|
|
159
212
|
* `before` is omitted). Returns the number of rows removed. Throws
|
|
160
213
|
* `BeekonError` with kind `'storage'` on a failure.
|
|
161
214
|
*/
|
|
@@ -217,6 +270,16 @@ class BeekonImpl {
|
|
|
217
270
|
return wires.map(wireToGeofence);
|
|
218
271
|
}
|
|
219
272
|
|
|
273
|
+
/**
|
|
274
|
+
* The current platform's license status (license-format-v1 §8). Android and
|
|
275
|
+
* iOS validate independently — this reflects the platform you are running on,
|
|
276
|
+
* with no cross-platform merging. Purely observational: a license never blocks,
|
|
277
|
+
* degrades, or delays the SDK. For live transitions use {@link onLicenseStatus}.
|
|
278
|
+
*/
|
|
279
|
+
async licenseStatus() {
|
|
280
|
+
return wireToLicenseStatus(await NativeBeekon.licenseStatus());
|
|
281
|
+
}
|
|
282
|
+
|
|
220
283
|
/**
|
|
221
284
|
* Subscribe to tracking-state transitions (`idle` / `tracking` /
|
|
222
285
|
* `stopped(reason)`). The current state is delivered to new subscribers
|
|
@@ -251,6 +314,26 @@ class BeekonImpl {
|
|
|
251
314
|
onSyncStatus(cb) {
|
|
252
315
|
return this.hub.onSyncStatus(cb);
|
|
253
316
|
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Subscribe to token rotations the SDK performed during a native refresh (see
|
|
320
|
+
* `SyncConfig.auth`). Mirror them into your own session store. The latest
|
|
321
|
+
* rotation is delivered to new subscribers immediately (replay-1). Sensitive —
|
|
322
|
+
* delivered in-process only, never logged. Returns an unsubscribe function.
|
|
323
|
+
*/
|
|
324
|
+
onAuthTokens(cb) {
|
|
325
|
+
return this.hub.onAuthTokens(cb);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Subscribe to license-status transitions for the current platform
|
|
330
|
+
* (license-format-v1 §8). The current status is delivered to new subscribers
|
|
331
|
+
* immediately (replay-1), then again on each transition (the first validation
|
|
332
|
+
* is lazy). Purely observational. Returns an unsubscribe function.
|
|
333
|
+
*/
|
|
334
|
+
onLicenseStatus(cb) {
|
|
335
|
+
return this.hub.onLicenseStatus(cb);
|
|
336
|
+
}
|
|
254
337
|
}
|
|
255
338
|
export const Beekon = new BeekonImpl();
|
|
256
339
|
//# sourceMappingURL=beekon.js.map
|
package/lib/module/beekon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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","
|
|
1
|
+
{"version":3,"names":["NativeBeekon","configToWire","geofenceToWire","recordToEntries","rethrowAsBeekonError","wireToAuthTokens","wireToGeofence","wireToGeofenceEvent","wireToLicenseStatus","wireToLocation","wireToState","wireToSyncStatus","EventHub","subscribed","stateListeners","Set","locationListeners","geofenceListeners","syncListeners","authTokenListeners","licenseListeners","ensureSubscribed","onState","w","s","lastState","forEach","cb","onLocation","l","onGeofenceEvent","g","onSyncStatus","lastSyncStatus","onAuthTokens","t","lastAuthTokens","onLicenseStatus","lastLicenseStatus","add","undefined","delete","BeekonImpl","hub","configure","config","start","stop","resumeIfNeeded","getCurrentLocation","options","wires","timeoutMs","accuracy","length","e","getLocations","from","to","getTime","map","deleteLocations","before","pendingUploadCount","sync","setExtras","extras","addGeofences","geofences","removeGeofences","ids","listGeofences","licenseStatus","Beekon"],"sourceRoot":"../../src","sources":["beekon.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,qBAAkB;AAS3C,SACEC,YAAY,EACZC,cAAc,EACdC,eAAe,EACfC,oBAAoB,EACpBC,gBAAgB,EAChBC,cAAc,EACdC,mBAAmB,EACnBC,mBAAmB,EACnBC,cAAc,EACdC,WAAW,EACXC,gBAAgB,QACX,uBAAoB;AAI3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,CAAC;EACLC,UAAU,GAAG,KAAK;EACTC,cAAc,GAAG,IAAIC,GAAG,CAAwB,CAAC;EACjDC,iBAAiB,GAAG,IAAID,GAAG,CAAqB,CAAC;EACjDE,iBAAiB,GAAG,IAAIF,GAAG,CAA0B,CAAC;EACtDG,aAAa,GA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,EAA8B;IAC/C,MAAMpB,KAAK,GAAG,MAAMnD,YAAY,CAACuE,aAAa,CAAC,CAAC;IAChD,OAAOpB,KAAK,CAACS,GAAG,CAACtD,cAAc,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAMkE,aAAaA,CAAA,EAA2B;IAC5C,OAAOhE,mBAAmB,CAAC,MAAMR,YAAY,CAACwE,aAAa,CAAC,CAAC,CAAC;EAChE;;EAEA;AACF;AACA;AACA;AACA;EACElD,OAAOA,CAACK,EAA4B,EAAc;IAChD,OAAO,IAAI,CAACgB,GAAG,CAACrB,OAAO,CAACK,EAAE,CAAC;EAC7B;;EAEA;AACF;AACA;AACA;AACA;EACEC,UAAUA,CAACD,EAAyB,EAAc;IAChD,OAAO,IAAI,CAACgB,GAAG,CAACf,UAAU,CAACD,EAAE,CAAC;EAChC;;EAEA;AACF;AACA;AACA;EACEG,eAAeA,CAACH,EAA8B,EAAc;IAC1D,OAAO,IAAI,CAACgB,GAAG,CAACb,eAAe,CAACH,EAAE,CAAC;EACrC;;EAEA;AACF;AACA;AACA;AACA;EACEK,YAAYA,CAACL,EAA2B,EAAc;IACpD,OAAO,IAAI,CAACgB,GAAG,CAACX,YAAY,CAACL,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEO,YAAYA,CAACP,EAA2B,EAAc;IACpD,OAAO,IAAI,CAACgB,GAAG,CAACT,YAAY,CAACP,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEU,eAAeA,CAACV,EAA8B,EAAc;IAC1D,OAAO,IAAI,CAACgB,GAAG,CAACN,eAAe,CAACV,EAAE,CAAC;EACrC;AACF;AAEA,OAAO,MAAM8C,MAAM,GAAG,IAAI/B,UAAU,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Beekon","BeekonError"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,aAAU;
|
|
1
|
+
{"version":3,"names":["Beekon","BeekonError"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,aAAU;AA2BjC,SAASC,WAAW,QAA8B,kBAAe","ignoreList":[]}
|
|
@@ -11,7 +11,13 @@ const DEFAULTS = {
|
|
|
11
11
|
stationaryRadiusMeters: 5,
|
|
12
12
|
detectActivity: false,
|
|
13
13
|
syncIntervalSeconds: 300,
|
|
14
|
-
syncBatchSize: 100
|
|
14
|
+
syncBatchSize: 100,
|
|
15
|
+
authStrategy: 'bearer',
|
|
16
|
+
authBodyFormat: 'form',
|
|
17
|
+
authSkewMarginSeconds: 60,
|
|
18
|
+
authRefreshHeaders: {
|
|
19
|
+
Authorization: 'Bearer {accessToken}'
|
|
20
|
+
}
|
|
15
21
|
};
|
|
16
22
|
|
|
17
23
|
// --- Public → wire ---------------------------------------------------------
|
|
@@ -36,12 +42,18 @@ export function configToWire(config) {
|
|
|
36
42
|
url: sync.url,
|
|
37
43
|
headers: recordToEntries(sync.headers),
|
|
38
44
|
intervalSeconds: sync.intervalSeconds ?? DEFAULTS.syncIntervalSeconds,
|
|
39
|
-
batchSize: sync.batchSize ?? DEFAULTS.syncBatchSize
|
|
45
|
+
batchSize: sync.batchSize ?? DEFAULTS.syncBatchSize,
|
|
46
|
+
auth: sync.auth ? authToWire(sync.auth) : undefined
|
|
40
47
|
} : undefined,
|
|
41
48
|
notification: config.notification ? {
|
|
42
49
|
title: config.notification.title,
|
|
43
|
-
text: config.notification.text
|
|
44
|
-
|
|
50
|
+
text: config.notification.text,
|
|
51
|
+
smallIcon: config.notification.smallIcon
|
|
52
|
+
} : undefined,
|
|
53
|
+
// Passed through verbatim — `undefined` is omitted and the native SDK falls
|
|
54
|
+
// through to manifest/Info.plist. No wrapper-side trimming or fallback
|
|
55
|
+
// (blank/whitespace handling lives in the native SDK; spec §9).
|
|
56
|
+
licenseKey: config.licenseKey
|
|
45
57
|
};
|
|
46
58
|
}
|
|
47
59
|
export function geofenceToWire(g) {
|
|
@@ -55,6 +67,29 @@ export function geofenceToWire(g) {
|
|
|
55
67
|
};
|
|
56
68
|
}
|
|
57
69
|
|
|
70
|
+
// `expiresAt` (a `Date`) becomes epoch millis on the wire; the native side
|
|
71
|
+
// converts to epoch seconds. String maps travel as `WireKeyValue[]`.
|
|
72
|
+
export function authToWire(a) {
|
|
73
|
+
return {
|
|
74
|
+
accessToken: a.accessToken,
|
|
75
|
+
refreshToken: a.refreshToken,
|
|
76
|
+
expiresAtMs: a.expiresAt?.getTime(),
|
|
77
|
+
strategy: a.strategy ?? DEFAULTS.authStrategy,
|
|
78
|
+
refreshUrl: a.refreshUrl,
|
|
79
|
+
refreshPayload: recordToEntries(a.refreshPayload),
|
|
80
|
+
refreshHeaders: recordToEntries(a.refreshHeaders ?? DEFAULTS.authRefreshHeaders),
|
|
81
|
+
refreshBodyFormat: a.refreshBodyFormat ?? DEFAULTS.authBodyFormat,
|
|
82
|
+
responseMapping: {
|
|
83
|
+
accessToken: a.responseMapping?.accessToken,
|
|
84
|
+
refreshToken: a.responseMapping?.refreshToken,
|
|
85
|
+
expiresIn: a.responseMapping?.expiresIn,
|
|
86
|
+
expiresAt: a.responseMapping?.expiresAt
|
|
87
|
+
},
|
|
88
|
+
skewMarginSeconds: a.skewMarginSeconds ?? DEFAULTS.authSkewMarginSeconds,
|
|
89
|
+
seedEpoch: a.seedEpoch
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
58
93
|
// --- Wire → public ---------------------------------------------------------
|
|
59
94
|
|
|
60
95
|
export function wireToLocation(w) {
|
|
@@ -135,6 +170,59 @@ export function wireToSyncStatus(w) {
|
|
|
135
170
|
};
|
|
136
171
|
}
|
|
137
172
|
}
|
|
173
|
+
|
|
174
|
+
/** `expiresAtMs` (epoch millis) becomes a `Date`; `null` propagates faithfully. */
|
|
175
|
+
export function wireToAuthTokens(w) {
|
|
176
|
+
return {
|
|
177
|
+
accessToken: w.accessToken,
|
|
178
|
+
refreshToken: w.refreshToken,
|
|
179
|
+
expiresAt: w.expiresAtMs == null ? null : new Date(w.expiresAtMs),
|
|
180
|
+
epoch: w.epoch
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Decode the wire-stable license status into the public discriminated union. The
|
|
186
|
+
* native side already decided the status (the wrapper performs no validation) —
|
|
187
|
+
* this only re-shapes the flat wire form and validates the enum strings.
|
|
188
|
+
*/
|
|
189
|
+
export function wireToLicenseStatus(w) {
|
|
190
|
+
switch (w.status) {
|
|
191
|
+
case 'licensed':
|
|
192
|
+
return {
|
|
193
|
+
status: 'licensed',
|
|
194
|
+
tier: w.tier ?? '',
|
|
195
|
+
entitlements: w.entitlements ?? []
|
|
196
|
+
};
|
|
197
|
+
case 'invalid':
|
|
198
|
+
return {
|
|
199
|
+
status: 'invalid',
|
|
200
|
+
reason: oneOf(w.reason, ['malformed', 'unknownKey', 'badSignature', 'appIdMismatch', 'productMismatch', 'unsupportedVersion'], 'malformed')
|
|
201
|
+
};
|
|
202
|
+
case 'evaluation':
|
|
203
|
+
return {
|
|
204
|
+
status: 'evaluation'
|
|
205
|
+
};
|
|
206
|
+
case 'expired':
|
|
207
|
+
return {
|
|
208
|
+
status: 'expired'
|
|
209
|
+
};
|
|
210
|
+
case 'updateEntitlementLapsed':
|
|
211
|
+
return {
|
|
212
|
+
status: 'updateEntitlementLapsed'
|
|
213
|
+
};
|
|
214
|
+
case 'notDetermined':
|
|
215
|
+
return {
|
|
216
|
+
status: 'notDetermined'
|
|
217
|
+
};
|
|
218
|
+
default:
|
|
219
|
+
// Forward-compat: an unknown status string means a native build newer than
|
|
220
|
+
// this wrapper — surface as notDetermined rather than throwing.
|
|
221
|
+
return {
|
|
222
|
+
status: 'notDetermined'
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
138
226
|
function toStopReason(s) {
|
|
139
227
|
return oneOf(s, ['user', 'permissionDenied', 'locationServicesDisabled', 'locationUnavailable', 'system'],
|
|
140
228
|
// The native side always populates the reason for a `stopped` state; an
|
|
@@ -173,6 +261,12 @@ function codeToKind(code) {
|
|
|
173
261
|
return 'storage';
|
|
174
262
|
case 'INVALID_GEOFENCE':
|
|
175
263
|
return 'invalidGeofence';
|
|
264
|
+
case 'PERMISSION_DENIED':
|
|
265
|
+
return 'permissionDenied';
|
|
266
|
+
case 'LOCATION_SERVICES_DISABLED':
|
|
267
|
+
return 'locationServicesDisabled';
|
|
268
|
+
case 'LOCATION_UNAVAILABLE':
|
|
269
|
+
return 'locationUnavailable';
|
|
176
270
|
default:
|
|
177
271
|
return undefined;
|
|
178
272
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BeekonError","DEFAULTS","minTimeBetweenLocationsSeconds","minDistanceBetweenLocationsMeters","accuracyMode","whenStationary","stationaryRadiusMeters","detectActivity","syncIntervalSeconds","syncBatchSize","recordToEntries","record","Object","keys","map","key","value","configToWire","config","sync","url","headers","intervalSeconds","batchSize","undefined","notification","title","text","geofenceToWire","g","id","lat","latitude","lng","longitude","radiusMeters","notifyOnEntry","notifyOnExit","wireToLocation","w","timestamp","Date","timestampMs","accuracy","speed","bearing","altitude","quality","oneOf","trigger","motion","activity","isMock","wireToGeofence","wireToGeofenceEvent","geofenceId","type","wireToState","kind","reason","toStopReason","stopReason","wireToSyncStatus","toSyncFailure","failure","s","allowed","fallback","includes","rethrowAsBeekonError","e","code","message","String","codeToKind"],"sourceRoot":"../../../src","sources":["internal/mappers.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["BeekonError","DEFAULTS","minTimeBetweenLocationsSeconds","minDistanceBetweenLocationsMeters","accuracyMode","whenStationary","stationaryRadiusMeters","detectActivity","syncIntervalSeconds","syncBatchSize","authStrategy","authBodyFormat","authSkewMarginSeconds","authRefreshHeaders","Authorization","recordToEntries","record","Object","keys","map","key","value","configToWire","config","sync","url","headers","intervalSeconds","batchSize","auth","authToWire","undefined","notification","title","text","smallIcon","licenseKey","geofenceToWire","g","id","lat","latitude","lng","longitude","radiusMeters","notifyOnEntry","notifyOnExit","a","accessToken","refreshToken","expiresAtMs","expiresAt","getTime","strategy","refreshUrl","refreshPayload","refreshHeaders","refreshBodyFormat","responseMapping","expiresIn","skewMarginSeconds","seedEpoch","wireToLocation","w","timestamp","Date","timestampMs","accuracy","speed","bearing","altitude","quality","oneOf","trigger","motion","activity","isMock","wireToGeofence","wireToGeofenceEvent","geofenceId","type","wireToState","kind","reason","toStopReason","stopReason","wireToSyncStatus","toSyncFailure","failure","wireToAuthTokens","epoch","wireToLicenseStatus","status","tier","entitlements","s","allowed","fallback","includes","rethrowAsBeekonError","e","code","message","String","codeToKind"],"sourceRoot":"../../../src","sources":["internal/mappers.ts"],"mappings":";;AAqBA,SAASA,WAAW,QAA8B,mBAAgB;AAclE;AACA;AACA,MAAMC,QAAQ,GAAG;EACfC,8BAA8B,EAAE,EAAE;EAClCC,iCAAiC,EAAE,GAAG;EACtCC,YAAY,EAAE,UAA0B;EACxCC,cAAc,EAAE,OAAyB;EACzCC,sBAAsB,EAAE,CAAC;EACzBC,cAAc,EAAE,KAAK;EACrBC,mBAAmB,EAAE,GAAG;EACxBC,aAAa,EAAE,GAAG;EAClBC,YAAY,EAAE,QAAwB;EACtCC,cAAc,EAAE,MAAwB;EACxCC,qBAAqB,EAAE,EAAE;EACzBC,kBAAkB,EAAE;IAAEC,aAAa,EAAE;EAAuB;AAI9D,CAAC;;AAED;;AAEA,OAAO,SAASC,eAAeA,CAC7BC,MAA0C,EAC1B;EAChB,IAAI,CAACA,MAAM,EAAE,OAAO,EAAE;EACtB,OAAOC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACG,GAAG,CAAEC,GAAG,KAAM;IAAEA,GAAG;IAAEC,KAAK,EAAEL,MAAM,CAACI,GAAG;EAAG,CAAC,CAAC,CAAC;AACzE;AAEA,OAAO,SAASE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Ae;EACzD,OAAOvB,KAAK,CAAcuB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC;AAChE;;AAEA;AACA,SAASvB,KAAKA,CACZnD,KAAgC,EAChC2E,OAAqB,EACrBC,QAAW,EACR;EACH,OAAQD,OAAO,CAAuBE,QAAQ,CAAC7E,KAAK,IAAI,EAAE,CAAC,GACtDA,KAAK,GACN4E,QAAQ;AACd;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,oBAAoBA,CAACC,CAAU,EAAS;EACtD,MAAMC,IAAI,GAAID,CAAC,EAAoCC,IAAI;EACvD,MAAMC,OAAO,GAAIF,CAAC,EAAuCE,OAAO,IAAIC,MAAM,CAACH,CAAC,CAAC;EAC7E,MAAMlB,IAAI,GAAGsB,UAAU,CAACH,IAAI,CAAC;EAC7B,IAAInB,IAAI,EAAE;IACR,MAAM,IAAIlF,WAAW,CAACkF,IAAI,EAAEoB,OAAO,CAAC;EACtC;EACA,MAAMF,CAAC;AACT;AAEA,SAASI,UAAUA,CAACH,IAAwB,EAA+B;EACzE,QAAQA,IAAI;IACV,KAAK,iBAAiB;MACpB,OAAO,SAAS;IAClB,KAAK,kBAAkB;MACrB,OAAO,iBAAiB;IAC1B,KAAK,mBAAmB;MACtB,OAAO,kBAAkB;IAC3B,KAAK,4BAA4B;MAC/B,OAAO,0BAA0B;IACnC,KAAK,sBAAsB;MACzB,OAAO,qBAAqB;IAC9B;MACE,OAAOtE,SAAS;EACpB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/auth.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Error kinds thrown across the bridge.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Error kinds thrown across the bridge.
|
|
5
|
+
*
|
|
6
|
+
* Lifecycle problems on the tracking path never throw — they surface on the
|
|
7
|
+
* `onState` stream as `stopped(reason)`. The exceptions are the storage/geofence
|
|
8
|
+
* kinds below and the precondition kinds thrown by the explicit one-shot
|
|
9
|
+
* `getCurrentLocation()` (which has no `onState` arc of its own to report on; a
|
|
10
|
+
* plain timeout returns `null` instead of throwing).
|
|
7
11
|
*
|
|
8
12
|
* - `'storage'` — a local-store (SQLite) read/write failed. Thrown by
|
|
9
13
|
* `getLocations()`, `deleteLocations()`, and `pendingUploadCount()`.
|
|
10
14
|
* - `'invalidGeofence'` — a geofence passed to `addGeofences()` failed
|
|
11
15
|
* validation (empty/oversized id, or non-positive radius).
|
|
16
|
+
* - `'permissionDenied'` — location permission is missing. Thrown by
|
|
17
|
+
* `getCurrentLocation()`.
|
|
18
|
+
* - `'locationServicesDisabled'` — system location services are off. Thrown by
|
|
19
|
+
* `getCurrentLocation()`.
|
|
20
|
+
* - `'locationUnavailable'` — location is otherwise unavailable (e.g. Play
|
|
21
|
+
* Services absent/old). Thrown by `getCurrentLocation()`.
|
|
12
22
|
*/
|
|
13
23
|
|
|
14
24
|
/**
|