@wayq/beekon-rn 0.0.9 → 0.1.0
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 +2 -2
- package/CHANGELOG.md +29 -7
- package/LICENSE.txt +3 -3
- package/README.md +84 -325
- package/android/build.gradle +2 -2
- package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +28 -1
- package/ios/BeekonRn.mm +5 -0
- package/ios/BeekonRn.swift +37 -1
- package/ios/Frameworks/BeekonKit.xcframework/LICENSE.txt +3 -3
- 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 +254 -233
- 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 +2 -2
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +254 -233
- 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 +2 -2
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +254 -233
- 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 +2 -2
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +1 -1
- package/lib/module/NativeBeekonRn.js +6 -0
- package/lib/module/NativeBeekonRn.js.map +1 -1
- package/lib/module/beekon.js +13 -1
- package/lib/module/beekon.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/mappers.js +12 -0
- package/lib/module/internal/mappers.js.map +1 -1
- package/lib/module/types/permission.js +2 -0
- package/lib/module/types/permission.js.map +1 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts +19 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
- package/lib/typescript/src/beekon.d.ts +10 -0
- package/lib/typescript/src/beekon.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/mappers.d.ts +3 -1
- package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
- package/lib/typescript/src/types/permission.d.ts +42 -0
- package/lib/typescript/src/types/permission.d.ts.map +1 -0
- package/package.json +5 -5
- package/scripts/fetch-beekonkit.sh +4 -4
- package/src/NativeBeekonRn.ts +21 -0
- package/src/beekon.ts +14 -0
- package/src/index.tsx +5 -0
- package/src/internal/mappers.ts +26 -0
- package/src/types/permission.ts +48 -0
|
@@ -29,6 +29,7 @@ import `in`.wayq.beekon.LogEntry
|
|
|
29
29
|
import `in`.wayq.beekon.LogLevel
|
|
30
30
|
import `in`.wayq.beekon.MotionState
|
|
31
31
|
import `in`.wayq.beekon.NotificationConfig
|
|
32
|
+
import `in`.wayq.beekon.PermissionStatus
|
|
32
33
|
import `in`.wayq.beekon.StationaryMode
|
|
33
34
|
import `in`.wayq.beekon.StopReason
|
|
34
35
|
import `in`.wayq.beekon.SyncConfig
|
|
@@ -235,6 +236,11 @@ class BeekonRnModule(reactContext: ReactApplicationContext) :
|
|
|
235
236
|
promise.resolve(licenseStatusToWire(Beekon.licenseStatus.value))
|
|
236
237
|
}
|
|
237
238
|
|
|
239
|
+
override fun getPermissionStatus(promise: Promise) {
|
|
240
|
+
// Synchronous, non-throwing read on the native SDK.
|
|
241
|
+
promise.resolve(permissionStatusToWire(Beekon.getPermissionStatus()))
|
|
242
|
+
}
|
|
243
|
+
|
|
238
244
|
// ---------------------------------------------------------------------------
|
|
239
245
|
// Diagnostic logs (spec diagnostics/log-format-v1)
|
|
240
246
|
// ---------------------------------------------------------------------------
|
|
@@ -513,6 +519,27 @@ class BeekonRnModule(reactContext: ReactApplicationContext) :
|
|
|
513
519
|
return m
|
|
514
520
|
}
|
|
515
521
|
|
|
522
|
+
private fun permissionStatusToWire(p: PermissionStatus): WritableMap {
|
|
523
|
+
val m = Arguments.createMap()
|
|
524
|
+
m.putString("level", permissionLevelToWire(p.level))
|
|
525
|
+
// '' is the wire encoding of null (not granted).
|
|
526
|
+
m.putString("accuracy", p.accuracy?.let { permissionAccuracyToWire(it) } ?: "")
|
|
527
|
+
return m
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
private fun permissionLevelToWire(l: PermissionStatus.Level): String = when (l) {
|
|
531
|
+
PermissionStatus.Level.NotDetermined -> "notDetermined"
|
|
532
|
+
PermissionStatus.Level.Denied -> "denied"
|
|
533
|
+
PermissionStatus.Level.Restricted -> "restricted"
|
|
534
|
+
PermissionStatus.Level.Foreground -> "foreground"
|
|
535
|
+
PermissionStatus.Level.Background -> "background"
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
private fun permissionAccuracyToWire(a: PermissionStatus.Accuracy): String = when (a) {
|
|
539
|
+
PermissionStatus.Accuracy.Full -> "full"
|
|
540
|
+
PermissionStatus.Accuracy.Reduced -> "reduced"
|
|
541
|
+
}
|
|
542
|
+
|
|
516
543
|
private fun syncStatusToWire(s: SyncStatus): WritableMap {
|
|
517
544
|
val m = Arguments.createMap()
|
|
518
545
|
when (s) {
|
|
@@ -678,6 +705,6 @@ class BeekonRnModule(reactContext: ReactApplicationContext) :
|
|
|
678
705
|
// Reported to the native verifier via setWrapperInfo (diagnostics only — the
|
|
679
706
|
// verifier consumes only the product). Keep in sync with package.json
|
|
680
707
|
// "version" on release.
|
|
681
|
-
private const val WRAPPER_VERSION = "0.0
|
|
708
|
+
private const val WRAPPER_VERSION = "0.1.0"
|
|
682
709
|
}
|
|
683
710
|
}
|
package/ios/BeekonRn.mm
CHANGED
|
@@ -150,6 +150,11 @@
|
|
|
150
150
|
[_impl licenseStatusWithResolver:resolve rejecter:reject];
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
- (void)getPermissionStatus:(RCTPromiseResolveBlock)resolve
|
|
154
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
155
|
+
[_impl getPermissionStatusWithResolver:resolve rejecter:reject];
|
|
156
|
+
}
|
|
157
|
+
|
|
153
158
|
// MARK: - Diagnostic logs
|
|
154
159
|
|
|
155
160
|
- (void)getLog:(double)fromMs
|
package/ios/BeekonRn.swift
CHANGED
|
@@ -37,7 +37,7 @@ import BeekonKit
|
|
|
37
37
|
// Reported to the native verifier via setWrapperInfo (diagnostics only — the
|
|
38
38
|
// verifier consumes only the product). Keep in sync with package.json
|
|
39
39
|
// "version" on release.
|
|
40
|
-
private static let wrapperVersion = "0.0
|
|
40
|
+
private static let wrapperVersion = "0.1.0"
|
|
41
41
|
|
|
42
42
|
@objc public init(
|
|
43
43
|
onState: @escaping (NSDictionary) -> Void,
|
|
@@ -345,6 +345,14 @@ import BeekonKit
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
@objc public func getPermissionStatusWithResolver(
|
|
349
|
+
_ resolve: @escaping @Sendable (Any?) -> Void,
|
|
350
|
+
rejecter _: @escaping @Sendable (String?, String?, Error?) -> Void
|
|
351
|
+
) {
|
|
352
|
+
// `getPermissionStatus()` is `nonisolated` + synchronous — no Task/await.
|
|
353
|
+
resolve(permissionStatusToWire(Beekon.shared.getPermissionStatus()))
|
|
354
|
+
}
|
|
355
|
+
|
|
348
356
|
// MARK: - Diagnostic logs (spec diagnostics/log-format-v1)
|
|
349
357
|
|
|
350
358
|
@objc public func getLogFromMs(
|
|
@@ -594,6 +602,34 @@ import BeekonKit
|
|
|
594
602
|
]
|
|
595
603
|
}
|
|
596
604
|
|
|
605
|
+
private func permissionStatusToWire(_ p: PermissionStatus) -> NSDictionary {
|
|
606
|
+
return [
|
|
607
|
+
"level": permissionLevelToWire(p.level),
|
|
608
|
+
// "" is the wire encoding of null (not granted).
|
|
609
|
+
"accuracy": p.accuracy.map { permissionAccuracyToWire($0) } ?? "",
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
private func permissionLevelToWire(_ l: PermissionStatus.Level) -> String {
|
|
614
|
+
switch l {
|
|
615
|
+
case .notDetermined: return "notDetermined"
|
|
616
|
+
case .denied: return "denied"
|
|
617
|
+
case .restricted: return "restricted"
|
|
618
|
+
case .foreground: return "foreground"
|
|
619
|
+
case .background: return "background"
|
|
620
|
+
// BeekonKit enums are non-frozen (library-evolution binary); handle unknowns.
|
|
621
|
+
@unknown default: return "notDetermined"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
private func permissionAccuracyToWire(_ a: PermissionStatus.Accuracy) -> String {
|
|
626
|
+
switch a {
|
|
627
|
+
case .full: return "full"
|
|
628
|
+
case .reduced: return "reduced"
|
|
629
|
+
@unknown default: return "full"
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
597
633
|
private func stateToWire(_ s: BeekonState) -> NSDictionary {
|
|
598
634
|
switch s {
|
|
599
635
|
case .idle:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Beekon SDK
|
|
2
|
-
Copyright (c) 2026
|
|
2
|
+
Copyright (c) 2026 beekonlabs. All rights reserved.
|
|
3
3
|
|
|
4
4
|
This software is licensed for evaluation use only. No production deployment,
|
|
5
5
|
redistribution, sublicensing, or commercial use is permitted without a separate
|
|
6
|
-
written agreement with
|
|
6
|
+
written agreement with beekonlabs.
|
|
7
7
|
|
|
8
8
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
9
9
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
@@ -11,4 +11,4 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
11
11
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING
|
|
12
12
|
FROM USE OF THE SOFTWARE.
|
|
13
13
|
|
|
14
|
-
For licensing inquiries: contact
|
|
14
|
+
For licensing inquiries: contact beekonlabs.
|
|
Binary file
|