@bugsee/react-native 0.0.0-stage → 7.0.0-beta2
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/BugseeReactNative.podspec +95 -0
- package/LICENSE +21 -0
- package/README.md +557 -2
- package/android/build.gradle +162 -0
- package/android/consumer-rules.pro +2 -0
- package/android/src/main/AndroidManifest.xml +33 -0
- package/android/src/main/java/com/bugsee/reactnative/AppearanceBridge.java +82 -0
- package/android/src/main/java/com/bugsee/reactnative/AttributeBridge.java +209 -0
- package/android/src/main/java/com/bugsee/reactnative/BreadcrumbFilterBridge.java +443 -0
- package/android/src/main/java/com/bugsee/reactnative/BridgeJson.java +168 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeModule.java +1869 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeOptionEnums.java +136 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseePackage.java +42 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeReactNativeWrapper.java +200 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeStatusMapper.java +66 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeTokens.java +22 -0
- package/android/src/main/java/com/bugsee/reactnative/ConsoleEchoDedup.java +202 -0
- package/android/src/main/java/com/bugsee/reactnative/CreatedReports.java +127 -0
- package/android/src/main/java/com/bugsee/reactnative/DataRequestBridge.java +375 -0
- package/android/src/main/java/com/bugsee/reactnative/ExceptionBridge.java +88 -0
- package/android/src/main/java/com/bugsee/reactnative/ExceptionExecutors.java +33 -0
- package/android/src/main/java/com/bugsee/reactnative/LogFilterBridge.java +375 -0
- package/android/src/main/java/com/bugsee/reactnative/NetworkEvents.java +227 -0
- package/android/src/main/java/com/bugsee/reactnative/NetworkFilterBridge.java +498 -0
- package/android/src/main/java/com/bugsee/reactnative/PluginEndpoint.java +48 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactNativeWebException.java +19 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactNativeWrapperInitProvider.java +61 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactRootOriginTracker.java +867 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportArgs.java +58 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportHandlerBridge.java +336 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportHandlerDeadlines.java +57 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportOps.java +287 -0
- package/android/src/main/java/com/bugsee/reactnative/SecureRectanglePulls.java +113 -0
- package/android/src/main/java/com/bugsee/reactnative/SecureRectangleStore.java +692 -0
- package/android/src/main/java/com/bugsee/reactnative/SpanHandles.java +143 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperChannelHolder.java +137 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperEventBus.java +110 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperRegistrar.java +54 -0
- package/app.plugin.js +4 -0
- package/ios/BGSRNConsoleCapture.h +52 -0
- package/ios/BGSRNConsoleCapture.mm +344 -0
- package/ios/BugseeModule.h +25 -0
- package/ios/BugseeModule.mm +2728 -0
- package/ios/Package.swift +71 -0
- package/ios/Support/Package.resolved +14 -0
- package/ios/Support/Package.swift +44 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNAttributes.m +52 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReportOps.m +236 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReports.m +184 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNDataRequestBridge.m +431 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNErrorMessage.m +40 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNEventBus.m +70 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNExceptions.m +63 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNGuardedEmit.mm +32 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNJSON.m +40 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNLaunchHold.m +147 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNMainThread.m +23 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkEvents.m +159 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkFilter.m +155 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNPluginEndpoint.m +21 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReactRootOriginTracker.m +63 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReactWindow.m +251 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportArgs.m +47 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportDeadlines.m +8 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportHandlerBridge.m +308 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportOps.m +345 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSecureRectangles.m +508 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSettleOnce.m +62 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSpanHandles.m +136 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNStatusMapper.m +18 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNTokens.m +9 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNValues.m +5 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapper.m +54 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapperChannelHolder.m +59 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNAttributes.h +63 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReportOps.h +51 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReports.h +81 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNDataRequestBridge.h +118 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNErrorMessage.h +30 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNEventBus.h +45 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNExceptions.h +31 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNGuardedEmit.h +31 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNJSON.h +25 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNLaunchHold.h +86 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNMainThread.h +32 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkEvents.h +28 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkFilter.h +28 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNPluginEndpoint.h +17 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactRootOriginTracker.h +48 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactWindow.h +135 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportArgs.h +17 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportDeadlines.h +37 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h +94 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h +86 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSecureRectangles.h +198 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSettleOnce.h +25 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSpanHandles.h +49 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNStatusMapper.h +26 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNTokens.h +14 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNValues.h +18 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapper.h +40 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h +74 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNAttributesTests.m +194 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportOpsTests.m +274 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportsTests.m +240 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNDataRequestBridgeTests.m +685 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNErrorMessageTests.m +102 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNEventBusTests.m +136 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNExceptionsTests.m +68 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h +41 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.m +166 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNGuardedEmitTests.mm +85 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNJSONTests.m +281 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNLaunchHoldTests.m +230 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNMainThreadTests.m +97 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkEventsTests.m +99 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkFilterTests.m +134 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNPluginEndpointTests.m +38 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactRootOriginTrackerTests.m +210 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactWindowTests.m +548 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportArgsTests.m +51 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportDeadlinesTests.m +22 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m +382 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportOpsTests.m +295 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSecureRectanglesTests.m +568 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSettleOnceTests.m +134 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSpanHandlesTests.m +153 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNStatusMapperTests.m +81 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNValuesTests.m +32 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m +205 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperTests.m +66 -0
- package/ios/react-native-spm-prefix.h +10 -0
- package/native-versions.json +10 -0
- package/package.json +62 -3
- package/plugin/build/bundle-phase.d.ts +41 -0
- package/plugin/build/bundle-phase.js +116 -0
- package/plugin/build/bundle-phase.js.map +1 -0
- package/plugin/build/dsym-script.d.ts +32 -0
- package/plugin/build/dsym-script.js +159 -0
- package/plugin/build/dsym-script.js.map +1 -0
- package/plugin/build/endpoint.d.ts +30 -0
- package/plugin/build/endpoint.js +69 -0
- package/plugin/build/endpoint.js.map +1 -0
- package/plugin/build/gradle.d.ts +65 -0
- package/plugin/build/gradle.js +1066 -0
- package/plugin/build/gradle.js.map +1 -0
- package/plugin/build/index.d.ts +85 -0
- package/plugin/build/index.js +217 -0
- package/plugin/build/index.js.map +1 -0
- package/plugin/build/manifest.d.ts +48 -0
- package/plugin/build/manifest.js +69 -0
- package/plugin/build/manifest.js.map +1 -0
- package/plugin/build/native-versions.baked.json +4 -0
- package/plugin/build/native-versions.d.ts +10 -0
- package/plugin/build/native-versions.js +27 -0
- package/plugin/build/native-versions.js.map +1 -0
- package/plugin/build/pbx-string.d.ts +8 -0
- package/plugin/build/pbx-string.js +31 -0
- package/plugin/build/pbx-string.js.map +1 -0
- package/plugin/build/podfile.d.ts +3 -0
- package/plugin/build/podfile.js +28 -0
- package/plugin/build/podfile.js.map +1 -0
- package/plugin/build/properties.d.ts +19 -0
- package/plugin/build/properties.js +41 -0
- package/plugin/build/properties.js.map +1 -0
- package/plugin/build/scheme.d.ts +20 -0
- package/plugin/build/scheme.js +107 -0
- package/plugin/build/scheme.js.map +1 -0
- package/react-native.config.js +26 -0
- package/scripts/bugsee-sourcemaps.gradle +201 -0
- package/scripts/bugsee-xcode.sh +83 -0
- package/scripts/compose-then-inject.js +113 -0
- package/scripts/hermes-sourcemaps.js +634 -0
- package/scripts/hermesc-preserve-js.cmd +6 -0
- package/scripts/hermesc-preserve-js.js +200 -0
- package/scripts/hermesc-preserve-js.sh +7 -0
- package/src/NativeBugsee.ts +622 -0
- package/src/apm/notify.ts +58 -0
- package/src/apm/span.ts +403 -0
- package/src/apm/types.ts +57 -0
- package/src/appearance/report.ts +171 -0
- package/src/architecture.ts +48 -0
- package/src/attributes/errors.ts +39 -0
- package/src/attributes/validate.ts +150 -0
- package/src/breadcrumbs/add.ts +58 -0
- package/src/breadcrumbs/data.ts +33 -0
- package/src/breadcrumbs/filter.ts +215 -0
- package/src/breadcrumbs/types.ts +64 -0
- package/src/bridge/json.ts +110 -0
- package/src/console/capture.ts +180 -0
- package/src/console/dedup.ts +175 -0
- package/src/data/validate.ts +259 -0
- package/src/errorName.ts +32 -0
- package/src/exceptions/ErrorBoundary.tsx +92 -0
- package/src/exceptions/RootErrorReporter.tsx +61 -0
- package/src/exceptions/debugIds.ts +118 -0
- package/src/exceptions/handlers.ts +236 -0
- package/src/exceptions/options.ts +85 -0
- package/src/exceptions/payload.ts +456 -0
- package/src/exceptions/report.ts +170 -0
- package/src/exceptions/sha1.ts +148 -0
- package/src/exceptions/stack.ts +355 -0
- package/src/index.ts +962 -0
- package/src/logs/filter.ts +90 -0
- package/src/logs/log.ts +36 -0
- package/src/network/add.ts +165 -0
- package/src/network/filter.ts +198 -0
- package/src/options/AndroidLaunchOptions.ts +78 -0
- package/src/options/BugseeLaunchOptions.ts +190 -0
- package/src/options/IOSLaunchOptions.ts +57 -0
- package/src/options/android-options-manifest.json +646 -0
- package/src/options/createDefaultLaunchOptions.ts +29 -0
- package/src/options/endpoint.ts +58 -0
- package/src/options/enums.ts +104 -0
- package/src/options/ios-enums.json +19 -0
- package/src/options/keys.ts +39 -0
- package/src/options/option-enums.json +34 -0
- package/src/options/option-keys.json +107 -0
- package/src/report/BugseeReport.ts +264 -0
- package/src/report/CreatedReport.ts +127 -0
- package/src/report/dispatcher.ts +95 -0
- package/src/report/errors.ts +48 -0
- package/src/report/fields.ts +40 -0
- package/src/report/types.ts +157 -0
- package/src/report/validate.ts +197 -0
- package/src/secure/BugseeSecure.tsx +202 -0
- package/src/secure/ancestry.ts +622 -0
- package/src/secure/drivers.ts +342 -0
- package/src/secure/followEvents.ts +57 -0
- package/src/secure/hold.ts +99 -0
- package/src/secure/measureLoop.ts +323 -0
- package/src/secure/nativeAnimation.ts +1005 -0
- package/src/secure/rectangles.ts +93 -0
- package/src/secure/registry.ts +237 -0
- package/src/secure/surface.ts +83 -0
- package/src/secure/tracker.ts +723 -0
- package/src/secure/transition.ts +488 -0
- package/src/secure/unit.ts +22 -0
- package/src/status.ts +16 -0
- package/src/version.ts +9 -0
- package/src/viewtree/anchor.tsx +105 -0
- package/src/viewtree/constants.ts +20 -0
- package/src/viewtree/fiber.ts +251 -0
- package/src/viewtree/requests.ts +347 -0
- package/src/viewtree/walk.ts +902 -0
- package/src/wrapper/channel.ts +33 -0
- package/src/wrapper/collect.ts +52 -0
- package/src/wrapper/events.ts +45 -0
- package/src/wrapper/identity.ts +54 -0
- package/src/wrapper/lifecycle-events.ts +89 -0
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
// CodegenTypes from the package root, not the deep
|
|
2
|
+
// `react-native/Libraries/Types/CodegenTypes` path: 0.87 declares no types for
|
|
3
|
+
// deep imports unless the consumer opts in, and this file is compiled by the
|
|
4
|
+
// consumer's tsc (API-49). Root export and codegen's qualified-name support
|
|
5
|
+
// both exist from 0.80, below the 0.81 floor.
|
|
6
|
+
import type { CodegenTypes, TurboModule } from 'react-native';
|
|
7
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
8
|
+
|
|
9
|
+
import { requireNewArchitecture } from './architecture';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The native surface. Codegen turns this into the C++/Java/ObjC++ spec both
|
|
13
|
+
* bridges implement, so a change here is a change to three files.
|
|
14
|
+
*
|
|
15
|
+
* Launch options cross as `UnsafeObject` because they are an open map of
|
|
16
|
+
* `com.bugsee.option.*` keys whose value types vary per option; the typed
|
|
17
|
+
* model that produces the map lives in JS (Phase 2).
|
|
18
|
+
*/
|
|
19
|
+
export interface Spec extends TurboModule {
|
|
20
|
+
/**
|
|
21
|
+
* Lifecycle events the SDK announces to its wrapper.
|
|
22
|
+
*
|
|
23
|
+
* A codegen `EventEmitter`, not a `NativeEventEmitter`: verified to generate
|
|
24
|
+
* real plumbing on the 0.81 floor, not merely to typecheck there --
|
|
25
|
+
* `emitOnLifecycleEvent(ReadableMap)` on the Java spec base class and
|
|
26
|
+
* `- (void)emitOnLifecycleEvent:(NSDictionary *)` on the ObjC one.
|
|
27
|
+
*
|
|
28
|
+
* `name` is the SDK's own name with the `com.bugsee.lifecycle.` prefix
|
|
29
|
+
* stripped; both platforms dispatch BY NAME, so there is no per-platform
|
|
30
|
+
* mapping to get wrong. `reportId` is present only for the events that
|
|
31
|
+
* carry one.
|
|
32
|
+
*
|
|
33
|
+
* This is the ONLY event channel. Status transitions are derived from it in
|
|
34
|
+
* JS rather than being a second emitter: Android exposes no status listener
|
|
35
|
+
* at all (only `getStatus()`), and iOS's `bugseeDidChangeStatus:` belongs to
|
|
36
|
+
* the app's own `BugseeDelegate` -- taking it would steal it from the app.
|
|
37
|
+
* Deriving keeps one source, one mapping, and tests that cover both
|
|
38
|
+
* platforms at once.
|
|
39
|
+
*/
|
|
40
|
+
readonly onLifecycleEvent: CodegenTypes.EventEmitter<{ name: string; reportId?: string }>;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Registers the wrapper identity with the SDK.
|
|
45
|
+
*
|
|
46
|
+
* Separate from `launch` because both SDKs take the wrapper through
|
|
47
|
+
* `setWrapper`, not through launch options, and because the identity is
|
|
48
|
+
* gathered in JS — the React Native version, the engine and the build
|
|
49
|
+
* configuration are JS-side facts. Call before `launch`: the SDK reads the
|
|
50
|
+
* wrapper while building a report's environment.
|
|
51
|
+
*/
|
|
52
|
+
setWrapperInfo(identity: CodegenTypes.UnsafeObject): void;
|
|
53
|
+
/**
|
|
54
|
+
* Publishes the regions the SDK must not record, for one display, as a flat
|
|
55
|
+
* list of four-number rectangles: `[left, top, right, bottom, ...]`, in the
|
|
56
|
+
* React root's window (`measureInWindow`). Native moves them onto the
|
|
57
|
+
* screen, where the SDK wants them, by the window's place there.
|
|
58
|
+
*
|
|
59
|
+
* Synchronous and fire-and-forget. The SDK PULLS these 2-3 times a second
|
|
60
|
+
* from its own thread; a promise would put a JS round trip on a path that
|
|
61
|
+
* has to answer immediately, and a rejected one would leave the caller
|
|
62
|
+
* believing a region is redacted when it is not.
|
|
63
|
+
*
|
|
64
|
+
* An empty list clears the display's main-surface set. Rectangles measured
|
|
65
|
+
* inside a React Native `<Modal>` go through
|
|
66
|
+
* {@link setSecureRectanglesOnSurface} instead.
|
|
67
|
+
*/
|
|
68
|
+
setSecureRectangles(display: number, coordinates: number[]): void;
|
|
69
|
+
/**
|
|
70
|
+
* Like {@link setSecureRectangles}, for one React surface on the display:
|
|
71
|
+
* `surface` is the React tag of the `<Modal>` host the rectangles were
|
|
72
|
+
* measured in (JS reads it off the fiber tree), or `-1` for a Modal whose
|
|
73
|
+
* tag is unknown. Fabric `measureInWindow` is relative to that Modal's
|
|
74
|
+
* content, so native finds and watches the Modal's root on the first
|
|
75
|
+
* publish and translates the rectangles by its origin at pull time. Until
|
|
76
|
+
* that origin is read, the surface redacts the whole display.
|
|
77
|
+
*/
|
|
78
|
+
setSecureRectanglesOnSurface(
|
|
79
|
+
display: number,
|
|
80
|
+
surface: number,
|
|
81
|
+
coordinates: number[],
|
|
82
|
+
): void;
|
|
83
|
+
/**
|
|
84
|
+
* The display origin `[x, y]` of the `<Modal>` whose host has React tag
|
|
85
|
+
* `surface`, in the units of the `vh` request's `originX`/`originY`. Empty
|
|
86
|
+
* when unknown. Synchronous: the `vh` walk asks once per Modal per walk.
|
|
87
|
+
*/
|
|
88
|
+
secureSurfaceOrigin(surface: number): number[];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Suppresses everything that describes the screen: the video (black
|
|
92
|
+
* frames), the report screenshot (black), touch/gesture recording and the
|
|
93
|
+
* view hierarchy. Logs, network events, custom events and traces keep
|
|
94
|
+
* recording throughout (design doc §4.1).
|
|
95
|
+
*
|
|
96
|
+
* Both platforms honour it before `launch()`: blackout then holds from the
|
|
97
|
+
* first captured frame (Android 7.4.0 applies it at launch,
|
|
98
|
+
* bugsee-android#248).
|
|
99
|
+
*
|
|
100
|
+
* {@link isBlackout} verifies whether it actually took effect.
|
|
101
|
+
*/
|
|
102
|
+
startBlackout(): void;
|
|
103
|
+
/** Resumes everything {@link startBlackout} suppressed. */
|
|
104
|
+
endBlackout(): void;
|
|
105
|
+
/** The current blackout state, as {@link startBlackout} / {@link endBlackout} left it. */
|
|
106
|
+
isBlackout(): Promise<boolean>;
|
|
107
|
+
/** Captures the view hierarchy immediately, outside a normal snapshot pass. */
|
|
108
|
+
captureViewHierarchy(): void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The SDK's request for JS-side data, mid-capture. Only `'vh'` (the view
|
|
112
|
+
* hierarchy) exists today; native answers any other `type` itself and never
|
|
113
|
+
* emits this for it. `requestId` is native-minted and never reused within a
|
|
114
|
+
* process. `originX`/`originY` are the React root's display origin --
|
|
115
|
+
* Android display pixels, iOS points -- the same units `originTracker`
|
|
116
|
+
* publishes for secure rectangles, and the frame the view-tree walk's
|
|
117
|
+
* bounds are offset into (`src/viewtree/walk.ts`'s `WalkEnv`).
|
|
118
|
+
*
|
|
119
|
+
* `Task 6.4` (`src/viewtree/requests.ts`) is the only subscriber; `Task
|
|
120
|
+
* 6.5`/`Task 6.6` are what actually emit it, from the same per-module event
|
|
121
|
+
* bus every other emitter here goes through.
|
|
122
|
+
*/
|
|
123
|
+
readonly onDataRequest: CodegenTypes.EventEmitter<{
|
|
124
|
+
requestId: string;
|
|
125
|
+
type: string;
|
|
126
|
+
originX: number;
|
|
127
|
+
originY: number;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* Answers one {@link onDataRequest} delivery. Called exactly once per
|
|
131
|
+
* `requestId`, synchronously, whether or not there was anything to answer
|
|
132
|
+
* with -- the SDK waits on this mid-capture. `payload` is JSON text for a
|
|
133
|
+
* `'vh'` request that found something to walk, `null` for every other
|
|
134
|
+
* outcome (an unmounted wrapper, an unrecognised `type`, or the walk
|
|
135
|
+
* itself failing).
|
|
136
|
+
*/
|
|
137
|
+
replyDataRequest(requestId: string, payload: string | null): void;
|
|
138
|
+
/**
|
|
139
|
+
* Turns view-hierarchy capture on or off. The wrapper calls this as
|
|
140
|
+
* `Bugsee.wrap`'s anchor mounts and unmounts (`src/viewtree/requests.ts`):
|
|
141
|
+
* on for the first mounted anchor, off once the last one unmounts, so the
|
|
142
|
+
* SDK only asks for a `'vh'` {@link onDataRequest} while there is a
|
|
143
|
+
* registered root to answer it from.
|
|
144
|
+
*/
|
|
145
|
+
setViewTreeEnabled(enabled: boolean): void;
|
|
146
|
+
|
|
147
|
+
launch(token: string, options: CodegenTypes.UnsafeObject): Promise<boolean>;
|
|
148
|
+
relaunch(options: CodegenTypes.UnsafeObject): Promise<boolean>;
|
|
149
|
+
stop(): Promise<boolean>;
|
|
150
|
+
getStatus(): Promise<number>;
|
|
151
|
+
/** The options the SDK reports as being in effect. */
|
|
152
|
+
getLaunchOptions(): Promise<CodegenTypes.UnsafeObject>;
|
|
153
|
+
testCrash(): void;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Creates and uploads a bug report immediately, without showing any UI.
|
|
157
|
+
*
|
|
158
|
+
* `severity` `0` is the SDK default (Android passes null; iOS resolves the
|
|
159
|
+
* launch option, or High). `labels` `null` means none were given.
|
|
160
|
+
* Fire-and-forget like `setSecureRectangles` -- the SDK assembles and
|
|
161
|
+
* uploads the report from its own capture buffer in the background, so
|
|
162
|
+
* there is nothing to await. Does nothing before `launch()`.
|
|
163
|
+
*/
|
|
164
|
+
upload(
|
|
165
|
+
summary: string,
|
|
166
|
+
description: string,
|
|
167
|
+
severity: number,
|
|
168
|
+
labels: string[] | null,
|
|
169
|
+
): void;
|
|
170
|
+
/**
|
|
171
|
+
* Shows the bug-report dialog. Null summary and description, severity `0`
|
|
172
|
+
* and null labels mean every argument was absent. Does nothing before
|
|
173
|
+
* `launch()`. The dialog runs `onBeforeReportCreated` before it opens.
|
|
174
|
+
*/
|
|
175
|
+
showReportDialog(
|
|
176
|
+
summary: string | null,
|
|
177
|
+
description: string | null,
|
|
178
|
+
severity: number,
|
|
179
|
+
labels: string[] | null,
|
|
180
|
+
): void;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Records a named event, with optional params.
|
|
184
|
+
*
|
|
185
|
+
* `paramsJson` is the params as JSON text (`src/bridge/json.ts`), not an
|
|
186
|
+
* `UnsafeObject`: iOS's TurboModule object conversion drops every `null`
|
|
187
|
+
* member, so `{ nil: null }` reached the SDK as `{}` there and as
|
|
188
|
+
* `{ nil: null }` on Android. Both natives parse the text, which keeps it.
|
|
189
|
+
* Text that does not parse as a JSON object drops the event, logged.
|
|
190
|
+
*
|
|
191
|
+
* `null` when JS sent no params (Android: `Bugsee.event(name)`; iOS:
|
|
192
|
+
* `[Bugsee event:name params:nil]`) rather than `'{}'` -- the bundle's
|
|
193
|
+
* `events.user` entry omits `params` entirely when none were given (design
|
|
194
|
+
* doc, Phase 4 bundle facts), and a `{}` here would produce an empty object
|
|
195
|
+
* on the wire instead. JS has already validated `params` against the
|
|
196
|
+
* accepted value domain (`src/data/validate.ts`) and copied it, so nothing
|
|
197
|
+
* unchecked reaches this call.
|
|
198
|
+
*/
|
|
199
|
+
event(name: string, paramsJson: string | null): void;
|
|
200
|
+
/** A numeric trace value, boxed on both platforms so it cannot arrive as a string. */
|
|
201
|
+
traceNumber(name: string, value: number): void;
|
|
202
|
+
/** A string trace value. */
|
|
203
|
+
traceString(name: string, value: string): void;
|
|
204
|
+
/**
|
|
205
|
+
* A boolean trace value, kept a boolean across the bridge -- typed
|
|
206
|
+
* separately from {@link traceNumber} so it cannot silently arrive as `0`
|
|
207
|
+
* or `1` (Planner decisions, Phase 4).
|
|
208
|
+
*/
|
|
209
|
+
traceBoolean(name: string, value: boolean): void;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* One line the app sent with `Bugsee.log()`, through the SDK's public
|
|
213
|
+
* `Bugsee.log`: source `Bugsee`, no tag.
|
|
214
|
+
*
|
|
215
|
+
* `level` is the SDK's by-value level, 1 Error .. 5 Verbose, already
|
|
216
|
+
* checked in JS; native maps anything else to Info. `capture.logs` does not
|
|
217
|
+
* gate it. `requiresFiltering` is the app's choice, passed through: the
|
|
218
|
+
* app's log filter runs on the line, natively and once, only when it is
|
|
219
|
+
* `true`. Fire-and-forget: before launch the SDK drops it.
|
|
220
|
+
*
|
|
221
|
+
* `log` in `src/logs/log.ts` is its only caller.
|
|
222
|
+
*/
|
|
223
|
+
log(message: string, level: number, requiresFiltering: boolean): void;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* One log line into the SDK's wrapper channel, attributed to the wrapper
|
|
227
|
+
* (source `Custom`, no tag) rather than to the app's own `Bugsee.log`:
|
|
228
|
+
* output this wrapper captured on its own, which the SDKs drop with
|
|
229
|
+
* `capture.logs` off.
|
|
230
|
+
*
|
|
231
|
+
* `level` is the SDK's by-value level, 1 Error .. 5 Verbose, already
|
|
232
|
+
* checked in JS; native maps anything else to Info. The line is filtered
|
|
233
|
+
* natively by the app's log filter, once -- never in JS (design doc
|
|
234
|
+
* §10.3). Fire-and-forget: before launch the channel accepts and drops it.
|
|
235
|
+
*
|
|
236
|
+
* Internal. `forwardLog` in `src/wrapper/channel.ts` is its only caller;
|
|
237
|
+
* Phase 9's console routing builds on that, and must not add a second
|
|
238
|
+
* native route. The app's own `log()` does not come here.
|
|
239
|
+
*/
|
|
240
|
+
wrapperLog(message: string, level: number): void;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Arms a native drop of the console echo of `message`, before that echo
|
|
244
|
+
* is written. Android drops the later `ReactNativeJS` logcat line. iOS
|
|
245
|
+
* drops a stderr stamp of `message`. It does not record a line, and a
|
|
246
|
+
* `Bugsee.log` of the same text does not arm another drop.
|
|
247
|
+
*
|
|
248
|
+
* Returns `true`. The return is what keeps the call on the JS thread:
|
|
249
|
+
* codegen queues a `void` TurboModule method onto the native modules
|
|
250
|
+
* thread, and the SDK's logcat reader could then filter the echo before
|
|
251
|
+
* the drop was armed. The console hook calls this before the original
|
|
252
|
+
* hook writes the line, so a synchronous call is armed first.
|
|
253
|
+
*/
|
|
254
|
+
noteConsoleEcho(message: string): boolean;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* A network event the SDK is about to record, offered to the JS filter.
|
|
258
|
+
*
|
|
259
|
+
* `requestId` is native-minted and never reused within a process.
|
|
260
|
+
* `eventJson` is the event (`setNetworkEventFilter`'s keep-value is the
|
|
261
|
+
* event object on both SDKs, not a string). JS answers with
|
|
262
|
+
* {@link replyNetworkFilter}. A request that never gets an answer is
|
|
263
|
+
* dropped by the SDK; this event is not a second timeout that would pass
|
|
264
|
+
* the original through.
|
|
265
|
+
*/
|
|
266
|
+
readonly onNetworkFilterRequest: CodegenTypes.EventEmitter<{ requestId: string; eventJson: string }>;
|
|
267
|
+
/**
|
|
268
|
+
* Installs or removes the native network filter (`setNetworkEventFilter`
|
|
269
|
+
* on both SDKs). `true` registers the bridge; `false` passes `null`, which
|
|
270
|
+
* is how both SDKs clear a filter.
|
|
271
|
+
*
|
|
272
|
+
* Returns `true`. The return is what keeps the call on the JS thread, in
|
|
273
|
+
* order with the request that follows: codegen queues a `void` TurboModule
|
|
274
|
+
* method onto the module queue, so a queued install could land after the
|
|
275
|
+
* next request was recorded and leak its url, headers and body.
|
|
276
|
+
*/
|
|
277
|
+
setNetworkFilterEnabled(enabled: boolean): boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Answers one {@link onNetworkFilterRequest}. `eventJson` is the
|
|
280
|
+
* replacement event to keep; `null` drops the event. A second reply for
|
|
281
|
+
* the same `requestId` is a no-op. Not answering drops the event.
|
|
282
|
+
*/
|
|
283
|
+
replyNetworkFilter(requestId: string, eventJson: string | null): void;
|
|
284
|
+
/**
|
|
285
|
+
* Records a network event the SDK did not capture.
|
|
286
|
+
*
|
|
287
|
+
* `eventJson` is the event (`url`, `method`, a stage name, and the fields
|
|
288
|
+
* a network filter may rewrite). Native stamps the timestamp, builds the
|
|
289
|
+
* event with the SDK exchange factory, and submits it with filtering
|
|
290
|
+
* required. JS does not run the filter. A factory that makes no event
|
|
291
|
+
* drops it, logged `addNetworkEvent dropped: the SDK made no event`.
|
|
292
|
+
*/
|
|
293
|
+
addNetworkEvent(eventJson: string): void;
|
|
294
|
+
/**
|
|
295
|
+
* A log line the SDK is about to record, offered to the JS filter.
|
|
296
|
+
*
|
|
297
|
+
* `requestId` is native-minted and never reused within a process. `line`
|
|
298
|
+
* is the text the SDK would store. JS answers with {@link replyLogFilter}.
|
|
299
|
+
* A request that never gets an answer is dropped by the SDK's own timeout;
|
|
300
|
+
* this event is not a second one.
|
|
301
|
+
*/
|
|
302
|
+
readonly onLogFilterRequest: CodegenTypes.EventEmitter<{ requestId: string; line: string }>;
|
|
303
|
+
/**
|
|
304
|
+
* Installs or removes the native log filter (`setLogEventFilter` on both
|
|
305
|
+
* SDKs). `true` registers the bridge; `false` passes `null`, which is how
|
|
306
|
+
* both SDKs clear a filter. Lines are not filtered in JS as well.
|
|
307
|
+
*
|
|
308
|
+
* Returns `true`. The return is what keeps the call on the JS thread, in
|
|
309
|
+
* order with the console line that follows: codegen queues a `void`
|
|
310
|
+
* TurboModule method onto the module queue, so a queued flag flip could
|
|
311
|
+
* land after that line was captured and leak it unfiltered.
|
|
312
|
+
*/
|
|
313
|
+
setLogFilterEnabled(enabled: boolean): boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Answers one {@link onLogFilterRequest}. `line` is the replacement to
|
|
316
|
+
* keep; `null` drops the line. A second reply for the same `requestId` is
|
|
317
|
+
* a no-op. Not answering drops the line — the SDK's timeout, not a reply
|
|
318
|
+
* that passes the original through.
|
|
319
|
+
*/
|
|
320
|
+
replyLogFilter(requestId: string, line: string | null): void;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Records a breadcrumb the exchange factory constructs. `level` is the
|
|
324
|
+
* name `debug`, `info`, `warning`, `error`, or `fatal`. Each native side
|
|
325
|
+
* maps that name to its own integer. The factory stamps the time; this
|
|
326
|
+
* does not take a timestamp. `dataJson` is the crumb's `data` as JSON
|
|
327
|
+
* text, or `null` when the caller supplied none.
|
|
328
|
+
*
|
|
329
|
+
* `addId` is the id JS retained for this manual add, or `null` when no
|
|
330
|
+
* filter is installed. Returns `true` only when a filter request for that
|
|
331
|
+
* id was emitted or will be emitted. `false` means JS should drop the id:
|
|
332
|
+
* capture is off, or the crumb was not built. The id is not a field of the
|
|
333
|
+
* crumb.
|
|
334
|
+
*/
|
|
335
|
+
addBreadcrumb(
|
|
336
|
+
category: string,
|
|
337
|
+
level: string,
|
|
338
|
+
message: string,
|
|
339
|
+
type: string,
|
|
340
|
+
dataJson: string | null,
|
|
341
|
+
addId: string | null,
|
|
342
|
+
): boolean;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* A breadcrumb the SDK is about to record, offered to the JS filter.
|
|
346
|
+
*
|
|
347
|
+
* `requestId` is native-minted and never reused within a process.
|
|
348
|
+
* `crumbJson` is the snapshot: only the keys the crumb had, `level` as
|
|
349
|
+
* its name, `timestamp` when it is set. JS answers with
|
|
350
|
+
* {@link replyBreadcrumbFilter}. A request that never gets an answer is
|
|
351
|
+
* not recorded; this event is not a second timeout, and the reply is never
|
|
352
|
+
* the original crumb after a failed filter.
|
|
353
|
+
*
|
|
354
|
+
* `addId` is set only on the request for the manual `addBreadcrumb` that
|
|
355
|
+
* passed that id. It sits beside `crumbJson`; it is not a key inside the
|
|
356
|
+
* crumb the callback sees. An SDK crumb omits it.
|
|
357
|
+
*/
|
|
358
|
+
readonly onBreadcrumbFilterRequest: CodegenTypes.EventEmitter<{
|
|
359
|
+
requestId: string;
|
|
360
|
+
crumbJson: string;
|
|
361
|
+
addId?: string;
|
|
362
|
+
}>;
|
|
363
|
+
/**
|
|
364
|
+
* Installs or removes the native breadcrumb filter. `true` registers the
|
|
365
|
+
* bridge on the calling queue, before this method returns. `false` removes
|
|
366
|
+
* it on the main queue, behind any `addBreadcrumb` already queued there.
|
|
367
|
+
* Passing `null` is how both SDKs clear a filter.
|
|
368
|
+
*
|
|
369
|
+
* Returns `true`. The return is what keeps the call on the JS thread, in
|
|
370
|
+
* order with {@link addBreadcrumb}: codegen queues a `void` TurboModule
|
|
371
|
+
* method onto the module queue. A queued clear then ran between a
|
|
372
|
+
* same-turn re-enable and the add after it, and that add recorded with no
|
|
373
|
+
* filter, its original value kept.
|
|
374
|
+
*/
|
|
375
|
+
setBreadcrumbFilterEnabled(enabled: boolean): boolean;
|
|
376
|
+
/**
|
|
377
|
+
* Answers one {@link onBreadcrumbFilterRequest}. `crumbJson` is the keep,
|
|
378
|
+
* with every writable key the snapshot sent and `level` as its name;
|
|
379
|
+
* `null` drops the crumb. A second reply for the same `requestId` is a
|
|
380
|
+
* no-op. Not answering leaves the crumb unrecorded — there is no reply
|
|
381
|
+
* that passes the original through.
|
|
382
|
+
*/
|
|
383
|
+
replyBreadcrumbFilter(requestId: string, crumbJson: string | null): void;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Sets a string attribute, verified by a native read-back: neither SDK's
|
|
387
|
+
* own setter reports a dropped value truthfully (design doc Phase 5,
|
|
388
|
+
* "Planner decisions"), so this rejects `E_ATTRIBUTE_REJECTED` when the
|
|
389
|
+
* value the SDK kept does not match what was just set -- the only way
|
|
390
|
+
* iOS's byte-based archive size limit becomes observable to JS. `name` and
|
|
391
|
+
* `value` are already validated (`src/attributes/validate.ts`); this never
|
|
392
|
+
* rejects for a JS-side reason.
|
|
393
|
+
*/
|
|
394
|
+
setAttributeString(name: string, value: string): Promise<void>;
|
|
395
|
+
/**
|
|
396
|
+
* A numeric attribute. Android stores a fractional or large value as a
|
|
397
|
+
* 32-bit float, so a read-back can differ from what was set -- documented
|
|
398
|
+
* on `Bugsee.setAttribute`, not treated as a rejection here.
|
|
399
|
+
*/
|
|
400
|
+
setAttributeNumber(name: string, value: number): Promise<void>;
|
|
401
|
+
/** A boolean attribute. */
|
|
402
|
+
setAttributeBoolean(name: string, value: boolean): Promise<void>;
|
|
403
|
+
/**
|
|
404
|
+
* One attribute, read back from the SDK's persisted copy on Android --
|
|
405
|
+
* `AttributeBridge.readOne`, the same copy `getAllAttributes` reads from
|
|
406
|
+
* (so a fractional value already carries that copy's 32-bit-float
|
|
407
|
+
* widening), not the SDK's own in-memory `Bugsee.getAttribute`, which only
|
|
408
|
+
* `setAttribute`'s own verification step (`AttributeBridge.setAndVerify`)
|
|
409
|
+
* reads.
|
|
410
|
+
*
|
|
411
|
+
* `{}` when absent, else `{ value }` -- never a bare value or `null`,
|
|
412
|
+
* because `UnsafeObject` has no way to say "absent" other than omitting a
|
|
413
|
+
* member.
|
|
414
|
+
*/
|
|
415
|
+
getAttribute(name: string): Promise<CodegenTypes.UnsafeObject>;
|
|
416
|
+
/**
|
|
417
|
+
* Every attribute, from the persisted copy the report is built from --
|
|
418
|
+
* where a fractional value is a 32-bit float, already widened back to a
|
|
419
|
+
* `Double` the way the SDK's own JSON writer would (design doc Phase 5).
|
|
420
|
+
* `{}` when none are set.
|
|
421
|
+
*/
|
|
422
|
+
getAllAttributes(): Promise<CodegenTypes.UnsafeObject>;
|
|
423
|
+
clearAttribute(name: string): Promise<void>;
|
|
424
|
+
clearAllAttributes(): Promise<void>;
|
|
425
|
+
/**
|
|
426
|
+
* Sets the user identifier. Synchronous and never read back: no size limit
|
|
427
|
+
* applies, and the bundle's `request.json` `email` is the device check
|
|
428
|
+
* (design doc Phase 5). Never called with `''` -- JS maps that to
|
|
429
|
+
* {@link clearUserIdentifier} instead, since both SDKs treat an empty
|
|
430
|
+
* identifier as "no identifier" but only iOS treats setting one as a clear.
|
|
431
|
+
*/
|
|
432
|
+
setUserIdentifier(identifier: string): void;
|
|
433
|
+
/** `{}` when absent (including a native empty string), else `{ value }`. */
|
|
434
|
+
getUserIdentifier(): Promise<CodegenTypes.UnsafeObject>;
|
|
435
|
+
clearUserIdentifier(): void;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* A report handoff, before or after the SDK builds it.
|
|
439
|
+
*
|
|
440
|
+
* `handleId` is opaque and native-minted, never reused within a process, and
|
|
441
|
+
* scopes every `report*` call below to the ONE report this event announces
|
|
442
|
+
* — a second delivery for the same `reportId` (an `after` phase can fire
|
|
443
|
+
* more than once) gets its own handle. `phase` is `'before'` or `'after'`;
|
|
444
|
+
* `type` is an open set (`'bug' | 'crash' | 'error'` today). `deadlineMs` is
|
|
445
|
+
* the native deadline for THIS handle — JS marks the handle dead locally
|
|
446
|
+
* once it passes, whether or not the app's callback has settled.
|
|
447
|
+
*/
|
|
448
|
+
readonly onReportHandlerRequest: CodegenTypes.EventEmitter<{
|
|
449
|
+
handleId: string;
|
|
450
|
+
phase: string;
|
|
451
|
+
reportId: string;
|
|
452
|
+
type: string;
|
|
453
|
+
deadlineMs: number;
|
|
454
|
+
}>;
|
|
455
|
+
/**
|
|
456
|
+
* Tells the SDK which phases JS actually wants delivered. Called once per
|
|
457
|
+
* `setReportHandler`, from the phases the handler defines — the SDK must
|
|
458
|
+
* not pay to assemble a callback's worth of work for a phase nothing
|
|
459
|
+
* listens to.
|
|
460
|
+
*/
|
|
461
|
+
setReportHandlerPhases(before: boolean, after: boolean): void;
|
|
462
|
+
/**
|
|
463
|
+
* Acknowledges one handle, letting the SDK proceed. Called exactly once per
|
|
464
|
+
* handle from JS, whether the app's callback resolved, rejected, threw, or
|
|
465
|
+
* never settled before its deadline; a second call for the same handle is a
|
|
466
|
+
* native no-op.
|
|
467
|
+
*/
|
|
468
|
+
completeReportHandler(handleId: string): void;
|
|
469
|
+
/** The live state of the report behind `handleId`, as a plain snapshot. */
|
|
470
|
+
reportRead(handleId: string): Promise<CodegenTypes.UnsafeObject>;
|
|
471
|
+
/**
|
|
472
|
+
* Applies a validated patch to the report behind `handleId`. All-or-nothing
|
|
473
|
+
* on both sides of the bridge: JS validates before crossing, and native
|
|
474
|
+
* applies nothing unless every field in the patch is valid.
|
|
475
|
+
*
|
|
476
|
+
* `patchJson` is the patch as JSON text (`src/bridge/json.ts`): a `null`
|
|
477
|
+
* summary, description or attribute means clear or remove, and iOS's
|
|
478
|
+
* TurboModule object conversion dropped exactly those members, so on iOS
|
|
479
|
+
* they silently did nothing. Text that does not parse as a JSON object
|
|
480
|
+
* rejects with `E_REPORT_BAD_ARGUMENT`.
|
|
481
|
+
*/
|
|
482
|
+
reportUpdate(handleId: string, patchJson: string): Promise<void>;
|
|
483
|
+
reportAddFileAttachment(
|
|
484
|
+
handleId: string,
|
|
485
|
+
path: string,
|
|
486
|
+
name: string,
|
|
487
|
+
mimeType: string | null,
|
|
488
|
+
move: boolean,
|
|
489
|
+
): Promise<void>;
|
|
490
|
+
reportAddDataAttachment(
|
|
491
|
+
handleId: string,
|
|
492
|
+
base64: string,
|
|
493
|
+
name: string,
|
|
494
|
+
mimeType: string | null,
|
|
495
|
+
): Promise<void>;
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Opens a report the app fills and then uploads. Resolves `'cr-<n>'`, or
|
|
499
|
+
* `null` when the SDK made none. Rejects `E_REPORT_CREATE_BUSY` when one
|
|
500
|
+
* created report is already outstanding.
|
|
501
|
+
*/
|
|
502
|
+
createReport(): Promise<string | null>;
|
|
503
|
+
/** The live state of the created report behind `handleId`, the `BugseeReportSnapshot` wire shape. */
|
|
504
|
+
createdReportRead(handleId: string): Promise<CodegenTypes.UnsafeObject>;
|
|
505
|
+
/**
|
|
506
|
+
* Applies a validated patch, as JSON text, the same transport as
|
|
507
|
+
* {@link reportUpdate}.
|
|
508
|
+
*/
|
|
509
|
+
createdReportUpdate(handleId: string, patchJson: string): Promise<void>;
|
|
510
|
+
createdReportAddDataAttachment(
|
|
511
|
+
handleId: string,
|
|
512
|
+
base64: string,
|
|
513
|
+
name: string,
|
|
514
|
+
mimeType: string | null,
|
|
515
|
+
): Promise<void>;
|
|
516
|
+
/** No `move`: a created-report file attachment is copied. */
|
|
517
|
+
createdReportAddFileAttachment(
|
|
518
|
+
handleId: string,
|
|
519
|
+
path: string,
|
|
520
|
+
name: string,
|
|
521
|
+
mimeType: string | null,
|
|
522
|
+
): Promise<void>;
|
|
523
|
+
/** Uploads the created report. The handle is dead afterwards, whatever the result. */
|
|
524
|
+
createdReportUpload(handleId: string): Promise<boolean>;
|
|
525
|
+
|
|
526
|
+
/** A handled JS exception. `payloadJson` is the Task 7.1a payload; `optionsJson` is `{domain?}` or null. */
|
|
527
|
+
logException(payloadJson: string, optionsJson: string | null): void;
|
|
528
|
+
/** An unhandled JS exception. Resolves once the SDK has the report; never rejects. */
|
|
529
|
+
logUnhandledException(payloadJson: string): Promise<void>;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Queues a notification for the app's messaging integrations. Not a bug
|
|
533
|
+
* report. `severity` `0` means unset (Android passes null; iOS passes 0,
|
|
534
|
+
* which the SDK omits). `fieldsJson` is a JSON object of strings, or null.
|
|
535
|
+
* `urgent` false is the shorter overloads. Does nothing useful before
|
|
536
|
+
* launch; the SDK ignores it.
|
|
537
|
+
*/
|
|
538
|
+
notify(
|
|
539
|
+
title: string,
|
|
540
|
+
body: string | null,
|
|
541
|
+
severity: number,
|
|
542
|
+
fieldsJson: string | null,
|
|
543
|
+
urgent: boolean,
|
|
544
|
+
): void;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Starts a transaction and retains it. The snapshot's `handle` is the
|
|
548
|
+
* bridge id. `attributesJson` null is the two-argument SDK overload.
|
|
549
|
+
* Calls stay on one thread: the active span is thread-local on both SDKs.
|
|
550
|
+
*/
|
|
551
|
+
startTransaction(
|
|
552
|
+
name: string,
|
|
553
|
+
operation: string,
|
|
554
|
+
attributesJson: string | null,
|
|
555
|
+
): CodegenTypes.UnsafeObject;
|
|
556
|
+
/** Starts a span under the active span on this thread and retains it. */
|
|
557
|
+
startSpan(operation: string, description: string | null): CodegenTypes.UnsafeObject;
|
|
558
|
+
/**
|
|
559
|
+
* The active span on this thread, or a snapshot whose `handle` is `''`
|
|
560
|
+
* when there is none. A span this bridge already holds comes back with
|
|
561
|
+
* the same handle.
|
|
562
|
+
*/
|
|
563
|
+
getActiveSpan(): CodegenTypes.UnsafeObject;
|
|
564
|
+
/**
|
|
565
|
+
* `setName`, which sets the operation on both SDKs.
|
|
566
|
+
*
|
|
567
|
+
* Returns whether the live span accepted the value. The return is what
|
|
568
|
+
* keeps the call on the JS thread: codegen queues a `void` TurboModule
|
|
569
|
+
* method, and a setter then `spanFinish` in one turn would release the
|
|
570
|
+
* handle before the setter ran. Same for the three setters below.
|
|
571
|
+
*/
|
|
572
|
+
spanSetName(handle: string, name: string): boolean;
|
|
573
|
+
spanSetDescription(handle: string, description: string | null): boolean;
|
|
574
|
+
/** `valueJson` is one JSON value: a string, number or boolean. */
|
|
575
|
+
spanSetAttribute(handle: string, key: string, valueJson: string): boolean;
|
|
576
|
+
spanSetStatus(handle: string, status: number): boolean;
|
|
577
|
+
spanStartChild(
|
|
578
|
+
handle: string,
|
|
579
|
+
operation: string,
|
|
580
|
+
description: string | null,
|
|
581
|
+
): CodegenTypes.UnsafeObject;
|
|
582
|
+
/**
|
|
583
|
+
* Finishes the span and releases every retained span that is now
|
|
584
|
+
* finished, including children a parent finish cancelled. `statusSet`
|
|
585
|
+
* false is the no-arg `finish` (status OK). The returned handles are
|
|
586
|
+
* the ones dropped. Empty means the handle was already gone. The name
|
|
587
|
+
* is `statusSet` because `explicit` is a keyword in the ObjC++ spec.
|
|
588
|
+
*/
|
|
589
|
+
spanFinish(handle: string, status: number, statusSet: boolean): string[];
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* One report color. `name` is already the platform's native key
|
|
593
|
+
* (`Report::BackgroundColor` on Android, `reportBackgroundColor` on iOS).
|
|
594
|
+
* Components are 0–255.
|
|
595
|
+
*
|
|
596
|
+
* Returns whether the SDK accepted it. The return keeps the call on the
|
|
597
|
+
* JS thread: codegen queues a `void` TurboModule method, and a set then
|
|
598
|
+
* a read in one turn would read the color before the set ran.
|
|
599
|
+
*/
|
|
600
|
+
setAppearanceColor(name: string, r: number, g: number, b: number, a: number): boolean;
|
|
601
|
+
/**
|
|
602
|
+
* The color the SDK has stored for `name`, as `#rrggbbaa`, or `''` when
|
|
603
|
+
* none is stored. Same thread rule as {@link setAppearanceColor}.
|
|
604
|
+
*/
|
|
605
|
+
getAppearanceColor(name: string): string;
|
|
606
|
+
/**
|
|
607
|
+
* Deletes collected data on the device. `includingIntermediate` is the
|
|
608
|
+
* SDK's own flag: Android `Bugsee.deleteCollectedDataOnDevice` and iOS
|
|
609
|
+
* `deleteCollectedDataOnDevice:completion:`.
|
|
610
|
+
*
|
|
611
|
+
* Resolves to the SDK's completion value. Both platforms refuse the
|
|
612
|
+
* deletion while launched; the promise still settles (`false`) so a
|
|
613
|
+
* caller is not left waiting on a completion the SDK does not invoke.
|
|
614
|
+
*/
|
|
615
|
+
deleteCollectedDataOnDevice(includingIntermediate: boolean): Promise<boolean>;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// Before the lookup: on the legacy architecture getEnforcing does not throw,
|
|
619
|
+
// it returns a bridge module without the event emitters (architecture.ts).
|
|
620
|
+
requireNewArchitecture();
|
|
621
|
+
|
|
622
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('Bugsee');
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import NativeBugsee from '../NativeBugsee';
|
|
2
|
+
import { encodeBridgeObject } from '../bridge/json';
|
|
3
|
+
import { severityArgument } from '../report/fields';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Queues a notification for the app's messaging integrations.
|
|
7
|
+
*
|
|
8
|
+
* This does not create a bug report. Both SDKs persist it and upload it in
|
|
9
|
+
* a batch; `urgent` skip-ahead POSTs this item without draining older ones.
|
|
10
|
+
* Shorter calls are non-urgent. A call before `launch()` is ignored by the
|
|
11
|
+
* SDK. An empty title is rejected here: both SDKs drop it and only log.
|
|
12
|
+
*/
|
|
13
|
+
export function notify(
|
|
14
|
+
title: string,
|
|
15
|
+
body?: string | null,
|
|
16
|
+
severity?: Parameters<typeof severityArgument>[0],
|
|
17
|
+
fields?: Readonly<Record<string, string>> | null,
|
|
18
|
+
urgent?: boolean,
|
|
19
|
+
): void {
|
|
20
|
+
if (arguments.length > 5) {
|
|
21
|
+
throw new TypeError('Bugsee.notify takes at most five arguments');
|
|
22
|
+
}
|
|
23
|
+
if (typeof title !== 'string' || title.trim().length === 0) {
|
|
24
|
+
throw new TypeError('Bugsee.notify requires a non-empty title');
|
|
25
|
+
}
|
|
26
|
+
let message: string | null = null;
|
|
27
|
+
if (body !== undefined && body !== null) {
|
|
28
|
+
if (typeof body !== 'string') {
|
|
29
|
+
throw new TypeError('Bugsee.notify body must be a string');
|
|
30
|
+
}
|
|
31
|
+
message = body;
|
|
32
|
+
}
|
|
33
|
+
let fieldsJson: string | null = null;
|
|
34
|
+
if (fields !== undefined && fields !== null) {
|
|
35
|
+
if (typeof fields !== 'object' || Array.isArray(fields)) {
|
|
36
|
+
throw new TypeError('Bugsee.notify fields must be an object of strings');
|
|
37
|
+
}
|
|
38
|
+
const copy: Record<string, string> = Object.create(null);
|
|
39
|
+
for (const key of Object.keys(fields)) {
|
|
40
|
+
const value = fields[key];
|
|
41
|
+
if (typeof value !== 'string') {
|
|
42
|
+
throw new TypeError('Bugsee.notify fields must be an object of strings');
|
|
43
|
+
}
|
|
44
|
+
copy[key] = value;
|
|
45
|
+
}
|
|
46
|
+
fieldsJson = encodeBridgeObject(copy);
|
|
47
|
+
}
|
|
48
|
+
if (urgent !== undefined && typeof urgent !== 'boolean') {
|
|
49
|
+
throw new TypeError('Bugsee.notify urgent must be a boolean');
|
|
50
|
+
}
|
|
51
|
+
NativeBugsee.notify(
|
|
52
|
+
title,
|
|
53
|
+
message,
|
|
54
|
+
severityArgument(severity, 'notify'),
|
|
55
|
+
fieldsJson,
|
|
56
|
+
urgent === true,
|
|
57
|
+
);
|
|
58
|
+
}
|