@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.
Files changed (64) hide show
  1. package/BeekonRn.podspec +4 -2
  2. package/CHANGELOG.md +127 -0
  3. package/README.md +303 -81
  4. package/android/build.gradle +3 -2
  5. package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +164 -7
  6. package/ios/BeekonRn.mm +23 -0
  7. package/ios/BeekonRn.swift +199 -10
  8. package/ios/Frameworks/BeekonKit.xcframework/Info.plist +5 -5
  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 +7784 -2697
  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 +111 -3
  14. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
  15. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
  16. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +7784 -2697
  17. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +111 -3
  19. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +7784 -2697
  20. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  21. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +111 -3
  22. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +1 -1
  23. package/lib/module/NativeBeekonRn.js +20 -0
  24. package/lib/module/NativeBeekonRn.js.map +1 -1
  25. package/lib/module/beekon.js +90 -7
  26. package/lib/module/beekon.js.map +1 -1
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/internal/mappers.js +98 -4
  29. package/lib/module/internal/mappers.js.map +1 -1
  30. package/lib/module/types/auth.js +4 -0
  31. package/lib/module/types/auth.js.map +1 -0
  32. package/lib/module/types/error.js +13 -3
  33. package/lib/module/types/error.js.map +1 -1
  34. package/lib/module/types/license.js +2 -0
  35. package/lib/module/types/license.js.map +1 -0
  36. package/lib/typescript/src/NativeBeekonRn.d.ts +84 -0
  37. package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
  38. package/lib/typescript/src/beekon.d.ts +45 -1
  39. package/lib/typescript/src/beekon.d.ts.map +1 -1
  40. package/lib/typescript/src/index.d.ts +3 -1
  41. package/lib/typescript/src/index.d.ts.map +1 -1
  42. package/lib/typescript/src/internal/mappers.d.ts +12 -1
  43. package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
  44. package/lib/typescript/src/types/auth.d.ts +99 -0
  45. package/lib/typescript/src/types/auth.d.ts.map +1 -0
  46. package/lib/typescript/src/types/config.d.ts +29 -0
  47. package/lib/typescript/src/types/config.d.ts.map +1 -1
  48. package/lib/typescript/src/types/enums.d.ts +14 -0
  49. package/lib/typescript/src/types/enums.d.ts.map +1 -1
  50. package/lib/typescript/src/types/error.d.ts +14 -4
  51. package/lib/typescript/src/types/error.d.ts.map +1 -1
  52. package/lib/typescript/src/types/license.d.ts +50 -0
  53. package/lib/typescript/src/types/license.d.ts.map +1 -0
  54. package/package.json +10 -2
  55. package/scripts/fetch-beekonkit.sh +4 -4
  56. package/src/NativeBeekonRn.ts +93 -0
  57. package/src/beekon.ts +104 -6
  58. package/src/index.tsx +4 -0
  59. package/src/internal/mappers.ts +109 -1
  60. package/src/types/auth.ts +101 -0
  61. package/src/types/config.ts +29 -0
  62. package/src/types/enums.ts +16 -0
  63. package/src/types/error.ts +19 -4
  64. package/src/types/license.ts +47 -0
@@ -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 arm64-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
3
+ // swift-module-flags: -target arm64-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 init(url: Foundation.URL, headers: [Swift.String : Swift.String] = [:], intervalSeconds: Foundation.TimeInterval = 300, batchSize: Swift.Int = 100)
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 {}