@goliapkg/sentori-react-native 3.1.0 → 5.0.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/android/build.gradle +21 -0
- package/android/src/main/java/com/sentori/SentoriCrashHandler.kt +29 -0
- package/android/src/test/java/com/sentori/SentoriCrashHandlerTest.kt +7 -2
- package/android/src/test/resources/robolectric.properties +10 -0
- package/lib/config.d.ts +16 -47
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -0
- package/lib/config.js.map +1 -1
- package/lib/device.d.ts +5 -0
- package/lib/device.d.ts.map +1 -0
- package/lib/device.js +29 -0
- package/lib/device.js.map +1 -0
- package/lib/emit-hooks.d.ts +7 -0
- package/lib/emit-hooks.d.ts.map +1 -0
- package/lib/emit-hooks.js +24 -0
- package/lib/emit-hooks.js.map +1 -0
- package/lib/error-boundary.d.ts.map +1 -1
- package/lib/error-boundary.js +1 -1
- package/lib/error-boundary.js.map +1 -1
- package/lib/feature-flags.d.ts.map +1 -1
- package/lib/handlers/dev-symbolicate.d.ts +1 -1
- package/lib/handlers/dev-symbolicate.d.ts.map +1 -1
- package/lib/handlers/dev-symbolicate.js +2 -0
- package/lib/handlers/dev-symbolicate.js.map +1 -1
- package/lib/handlers/global.js +1 -1
- package/lib/handlers/global.js.map +1 -1
- package/lib/handlers/lifecycle.js +3 -3
- package/lib/handlers/lifecycle.js.map +1 -1
- package/lib/handlers/network.d.ts +2 -2
- package/lib/handlers/network.d.ts.map +1 -1
- package/lib/handlers/network.js +69 -187
- package/lib/handlers/network.js.map +1 -1
- package/lib/handlers/promise.js +1 -1
- package/lib/handlers/promise.js.map +1 -1
- package/lib/handlers/screenshot.d.ts.map +1 -1
- package/lib/handlers/screenshot.js +3 -12
- package/lib/handlers/screenshot.js.map +1 -1
- package/lib/index.d.ts +31 -109
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +51 -103
- package/lib/index.js.map +1 -1
- package/lib/init.d.ts +3 -150
- package/lib/init.d.ts.map +1 -1
- package/lib/init.js +88 -261
- package/lib/init.js.map +1 -1
- package/lib/long-task-monitor.d.ts +1 -7
- package/lib/long-task-monitor.d.ts.map +1 -1
- package/lib/long-task-monitor.js +37 -58
- package/lib/long-task-monitor.js.map +1 -1
- package/lib/mobile-vitals.d.ts +3 -31
- package/lib/mobile-vitals.d.ts.map +1 -1
- package/lib/mobile-vitals.js +22 -61
- package/lib/mobile-vitals.js.map +1 -1
- package/lib/native-pending.d.ts +3 -0
- package/lib/native-pending.d.ts.map +1 -0
- package/lib/native-pending.js +64 -0
- package/lib/native-pending.js.map +1 -0
- package/lib/navigation.d.ts +3 -17
- package/lib/navigation.d.ts.map +1 -1
- package/lib/navigation.js +32 -133
- package/lib/navigation.js.map +1 -1
- package/lib/netinfo.d.ts +1 -1
- package/lib/netinfo.d.ts.map +1 -1
- package/lib/netinfo.js +2 -2
- package/lib/netinfo.js.map +1 -1
- package/lib/push.d.ts.map +1 -1
- package/lib/push.js +2 -4
- package/lib/push.js.map +1 -1
- package/lib/rage-tap.d.ts.map +1 -1
- package/lib/rage-tap.js +28 -23
- package/lib/rage-tap.js.map +1 -1
- package/lib/replay.d.ts.map +1 -1
- package/lib/replay.js +3 -24
- package/lib/replay.js.map +1 -1
- package/lib/scope.d.ts +7 -0
- package/lib/scope.d.ts.map +1 -0
- package/lib/scope.js +41 -0
- package/lib/scope.js.map +1 -0
- package/lib/transport.d.ts +19 -92
- package/lib/transport.d.ts.map +1 -1
- package/lib/transport.js +75 -288
- package/lib/transport.js.map +1 -1
- package/lib/verbs.d.ts +16 -0
- package/lib/verbs.d.ts.map +1 -0
- package/lib/verbs.js +153 -0
- package/lib/verbs.js.map +1 -0
- package/package.json +5 -5
- package/src/__tests__/iron-rule.test.ts +128 -0
- package/src/__tests__/screenshot.test.ts +0 -2
- package/src/__tests__/transport.test.ts +66 -213
- package/src/__tests__/verbs.test.ts +91 -0
- package/src/config.ts +19 -47
- package/src/device.ts +36 -0
- package/src/emit-hooks.ts +30 -0
- package/src/error-boundary.tsx +1 -1
- package/src/handlers/dev-symbolicate.ts +2 -1
- package/src/handlers/global.ts +1 -1
- package/src/handlers/lifecycle.ts +3 -3
- package/src/handlers/network.ts +95 -211
- package/src/handlers/promise.ts +1 -1
- package/src/handlers/screenshot.ts +3 -11
- package/src/index.ts +81 -215
- package/src/init.ts +94 -446
- package/src/long-task-monitor.ts +42 -64
- package/src/mobile-vitals.ts +22 -82
- package/src/native-pending.ts +92 -0
- package/src/navigation.ts +34 -142
- package/src/netinfo.ts +3 -3
- package/src/push.ts +2 -5
- package/src/rage-tap.tsx +29 -26
- package/src/replay.ts +3 -20
- package/src/scope.ts +50 -0
- package/src/transport.ts +84 -371
- package/src/verbs.ts +198 -0
- package/lib/breadcrumbs.d.ts +0 -18
- package/lib/breadcrumbs.d.ts.map +0 -1
- package/lib/breadcrumbs.js +0 -42
- package/lib/breadcrumbs.js.map +0 -1
- package/lib/bundle-info.d.ts +0 -12
- package/lib/bundle-info.d.ts.map +0 -1
- package/lib/bundle-info.js +0 -73
- package/lib/bundle-info.js.map +0 -1
- package/lib/capture.d.ts +0 -140
- package/lib/capture.d.ts.map +0 -1
- package/lib/capture.js +0 -511
- package/lib/capture.js.map +0 -1
- package/lib/compat/sentry.d.ts +0 -126
- package/lib/compat/sentry.d.ts.map +0 -1
- package/lib/compat/sentry.js +0 -332
- package/lib/compat/sentry.js.map +0 -1
- package/lib/control-channel.d.ts +0 -6
- package/lib/control-channel.d.ts.map +0 -1
- package/lib/control-channel.js +0 -96
- package/lib/control-channel.js.map +0 -1
- package/lib/expo-compat.d.ts +0 -270
- package/lib/expo-compat.d.ts.map +0 -1
- package/lib/expo-compat.js +0 -500
- package/lib/expo-compat.js.map +0 -1
- package/lib/feedback-widget.d.ts +0 -35
- package/lib/feedback-widget.d.ts.map +0 -1
- package/lib/feedback-widget.js +0 -193
- package/lib/feedback-widget.js.map +0 -1
- package/lib/feedback.d.ts +0 -2
- package/lib/feedback.d.ts.map +0 -1
- package/lib/feedback.js +0 -17
- package/lib/feedback.js.map +0 -1
- package/lib/heartbeat.d.ts +0 -9
- package/lib/heartbeat.d.ts.map +0 -1
- package/lib/heartbeat.js +0 -138
- package/lib/heartbeat.js.map +0 -1
- package/lib/index.js.bak +0 -64
- package/lib/install-id.d.ts +0 -17
- package/lib/install-id.d.ts.map +0 -1
- package/lib/install-id.js +0 -125
- package/lib/install-id.js.map +0 -1
- package/lib/lifecycle.d.ts +0 -28
- package/lib/lifecycle.d.ts.map +0 -1
- package/lib/lifecycle.js +0 -73
- package/lib/lifecycle.js.map +0 -1
- package/lib/mask.d.ts +0 -16
- package/lib/mask.d.ts.map +0 -1
- package/lib/mask.js +0 -36
- package/lib/mask.js.map +0 -1
- package/lib/measure.d.ts +0 -4
- package/lib/measure.d.ts.map +0 -1
- package/lib/measure.js +0 -25
- package/lib/measure.js.map +0 -1
- package/lib/metrics.d.ts +0 -24
- package/lib/metrics.d.ts.map +0 -1
- package/lib/metrics.js +0 -81
- package/lib/metrics.js.map +0 -1
- package/lib/pre-crash-sentinel.d.ts +0 -12
- package/lib/pre-crash-sentinel.d.ts.map +0 -1
- package/lib/pre-crash-sentinel.js +0 -116
- package/lib/pre-crash-sentinel.js.map +0 -1
- package/lib/report-security.d.ts +0 -40
- package/lib/report-security.d.ts.map +0 -1
- package/lib/report-security.js +0 -159
- package/lib/report-security.js.map +0 -1
- package/lib/runtime-metrics-fps.d.ts +0 -19
- package/lib/runtime-metrics-fps.d.ts.map +0 -1
- package/lib/runtime-metrics-fps.js +0 -128
- package/lib/runtime-metrics-fps.js.map +0 -1
- package/lib/runtime-metrics-heap.d.ts +0 -13
- package/lib/runtime-metrics-heap.d.ts.map +0 -1
- package/lib/runtime-metrics-heap.js +0 -67
- package/lib/runtime-metrics-heap.js.map +0 -1
- package/lib/runtime-metrics-network.d.ts +0 -23
- package/lib/runtime-metrics-network.d.ts.map +0 -1
- package/lib/runtime-metrics-network.js +0 -99
- package/lib/runtime-metrics-network.js.map +0 -1
- package/lib/runtime-metrics.d.ts +0 -43
- package/lib/runtime-metrics.d.ts.map +0 -1
- package/lib/runtime-metrics.js +0 -115
- package/lib/runtime-metrics.js.map +0 -1
- package/lib/sample-profiler.d.ts +0 -21
- package/lib/sample-profiler.d.ts.map +0 -1
- package/lib/sample-profiler.js +0 -152
- package/lib/sample-profiler.js.map +0 -1
- package/lib/sentinel-context.d.ts +0 -4
- package/lib/sentinel-context.d.ts.map +0 -1
- package/lib/sentinel-context.js +0 -52
- package/lib/sentinel-context.js.map +0 -1
- package/lib/session-tracker.d.ts +0 -6
- package/lib/session-tracker.d.ts.map +0 -1
- package/lib/session-tracker.js +0 -50
- package/lib/session-tracker.js.map +0 -1
- package/lib/stack.d.ts +0 -3
- package/lib/stack.d.ts.map +0 -1
- package/lib/stack.js +0 -7
- package/lib/stack.js.map +0 -1
- package/lib/state-snapshots.d.ts +0 -33
- package/lib/state-snapshots.d.ts.map +0 -1
- package/lib/state-snapshots.js +0 -109
- package/lib/state-snapshots.js.map +0 -1
- package/lib/track.d.ts +0 -34
- package/lib/track.d.ts.map +0 -1
- package/lib/track.js +0 -107
- package/lib/track.js.map +0 -1
- package/lib/trail.d.ts +0 -12
- package/lib/trail.d.ts.map +0 -1
- package/lib/trail.js +0 -28
- package/lib/trail.js.map +0 -1
- package/lib/trust-score.d.ts +0 -20
- package/lib/trust-score.d.ts.map +0 -1
- package/lib/trust-score.js +0 -151
- package/lib/trust-score.js.map +0 -1
- package/lib/types.d.ts +0 -2
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -4
- package/lib/types.js.map +0 -1
- package/lib/uuid.d.ts +0 -2
- package/lib/uuid.d.ts.map +0 -1
- package/lib/uuid.js +0 -3
- package/lib/uuid.js.map +0 -1
- package/src/__tests__/before-send.test.ts +0 -72
- package/src/__tests__/breadcrumbs.test.ts +0 -44
- package/src/__tests__/capture-replay.test.ts +0 -150
- package/src/__tests__/compat-sentry.test.ts +0 -121
- package/src/__tests__/control-channel.test.ts +0 -111
- package/src/__tests__/install-id.test.ts +0 -60
- package/src/__tests__/long-task-monitor.test.ts +0 -59
- package/src/__tests__/measure.test.ts +0 -45
- package/src/__tests__/navigation.test.ts +0 -175
- package/src/__tests__/push.test.ts +0 -238
- package/src/__tests__/report-security.test.ts +0 -106
- package/src/__tests__/runtime-metrics-instruments.test.ts +0 -109
- package/src/__tests__/runtime-metrics-network.test.ts +0 -78
- package/src/__tests__/sample-profiler.test.ts +0 -59
- package/src/__tests__/stack.test.ts +0 -45
- package/src/__tests__/state-snapshots.test.ts +0 -119
- package/src/__tests__/tracing.test.ts +0 -201
- package/src/__tests__/track.test.ts +0 -91
- package/src/__tests__/uuid.test.ts +0 -41
- package/src/breadcrumbs.ts +0 -57
- package/src/bundle-info.ts +0 -95
- package/src/capture.ts +0 -660
- package/src/compat/sentry.ts +0 -490
- package/src/control-channel.ts +0 -98
- package/src/expo-compat.ts +0 -698
- package/src/feedback-widget.tsx +0 -316
- package/src/feedback.ts +0 -21
- package/src/heartbeat.ts +0 -157
- package/src/install-id.ts +0 -146
- package/src/lifecycle.ts +0 -76
- package/src/mask.ts +0 -41
- package/src/measure.ts +0 -28
- package/src/metrics.ts +0 -94
- package/src/pre-crash-sentinel.ts +0 -140
- package/src/report-security.ts +0 -165
- package/src/runtime-metrics-fps.ts +0 -137
- package/src/runtime-metrics-heap.ts +0 -78
- package/src/runtime-metrics-network.ts +0 -103
- package/src/runtime-metrics.ts +0 -122
- package/src/sample-profiler.ts +0 -169
- package/src/sentinel-context.ts +0 -60
- package/src/session-tracker.ts +0 -53
- package/src/stack.ts +0 -10
- package/src/state-snapshots.ts +0 -133
- package/src/track.ts +0 -123
- package/src/trail.ts +0 -32
- package/src/trust-score.ts +0 -176
- package/src/types.ts +0 -21
- package/src/uuid.ts +0 -2
package/lib/index.js
CHANGED
|
@@ -1,111 +1,59 @@
|
|
|
1
|
+
// @goliapkg/sentori-react-native — the 8-verb surface (design.md §4).
|
|
2
|
+
//
|
|
3
|
+
// sentori.init(config) sentori.user(u) sentori.context(patch)
|
|
4
|
+
// sentori.error(err) sentori.warn(name) sentori.trace(name)
|
|
5
|
+
// sentori.assert(n, ok) sentori.probe(ref)
|
|
6
|
+
//
|
|
7
|
+
// Everything is synchronous, returns immediately, and can never
|
|
8
|
+
// throw into the host app. Learn eight words and you know the whole
|
|
9
|
+
// product. The only additions beyond the verbs: ErrorBoundary (React
|
|
10
|
+
// idiom for the error verb) and the push namespace (carried).
|
|
1
11
|
import { init } from './init';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ErrorBoundary } from './error-boundary';
|
|
5
|
-
import { FeedbackButton } from './feedback-widget';
|
|
6
|
-
import { clearAllFeatureFlags, clearFeatureFlag, getFeatureFlags, setFeatureFlag, } from './feature-flags';
|
|
7
|
-
import { clearMaskQuery, registerMaskQuery } from './mask';
|
|
8
|
-
import { measureFn } from './measure';
|
|
9
|
-
import { getColdStartMs, markTimeToFullDisplay, } from './mobile-vitals';
|
|
10
|
-
import { bindState, recordState, unbindState } from './state-snapshots';
|
|
11
|
-
import { startMoment, startSpan, startTrace, withScopedSpan, } from '@goliapkg/sentori-core';
|
|
12
|
-
import { getInstallId } from './install-id';
|
|
13
|
-
import { flushMetrics, recordMetric } from './metrics';
|
|
14
|
-
import { close, flush } from './lifecycle';
|
|
15
|
-
import { linkFederatedIdentity, reportPinMismatch, reportSecurity } from './report-security';
|
|
16
|
-
import { flushTrack, track } from './track';
|
|
17
|
-
import { queryTrustScore } from './trust-score';
|
|
18
|
-
import { RageTapCapture } from './rage-tap';
|
|
19
|
-
import { endSession, markSessionCrashed, startSession, } from './session-tracker';
|
|
12
|
+
import { patchContext, setUser } from './scope';
|
|
13
|
+
import { verbs } from './verbs';
|
|
20
14
|
export const sentori = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
clearFeatureFlag,
|
|
53
|
-
clearAllFeatureFlags,
|
|
54
|
-
getFeatureFlags,
|
|
55
|
-
ErrorBoundary,
|
|
56
|
-
FeedbackButton,
|
|
57
|
-
RageTapCapture,
|
|
58
|
-
registerMaskQuery,
|
|
59
|
-
clearMaskQuery,
|
|
60
|
-
startSession,
|
|
61
|
-
endSession,
|
|
62
|
-
markSessionCrashed,
|
|
63
|
-
flush,
|
|
64
|
-
close,
|
|
15
|
+
/** Configure and start the SDK. One call, at app start. */
|
|
16
|
+
init: (config) => {
|
|
17
|
+
init(config);
|
|
18
|
+
},
|
|
19
|
+
/** Set (or clear, with null) the current user. Drives the
|
|
20
|
+
* breadth × depth importance stats via a salted hash — raw
|
|
21
|
+
* identity never leaves the device. */
|
|
22
|
+
user: (u) => {
|
|
23
|
+
setUser(u);
|
|
24
|
+
},
|
|
25
|
+
/** Merge ambient context (feature flags, AB variants, tags)
|
|
26
|
+
* attached to every subsequent event. */
|
|
27
|
+
context: (patch) => {
|
|
28
|
+
patchContext(patch);
|
|
29
|
+
},
|
|
30
|
+
/** 出了什么事 — report a caught-but-fatal-worthy error. Unhandled
|
|
31
|
+
* errors are captured automatically; this is the manual lane. */
|
|
32
|
+
error: (err, data) => verbs.error(err, data),
|
|
33
|
+
/** 用户哪里不舒服 — a hand-written sub-health report. */
|
|
34
|
+
warn: (name, data) => verbs.warn(name, data),
|
|
35
|
+
/** 这里发生了什么 — a neutral observation point. Also lands in the
|
|
36
|
+
* signal ring; `{ quiet: true }` keeps it ring-only. */
|
|
37
|
+
trace: (name, data, opts) => verbs.trace(name, data, opts),
|
|
38
|
+
/** 这里应该成立吗 — a production assertion. Failure reports and
|
|
39
|
+
* NEVER halts the program (unlike a language-level assert);
|
|
40
|
+
* passes aggregate into a liveness ledger. */
|
|
41
|
+
assert: (name, ok, data) => verbs.assert(name, ok, data),
|
|
42
|
+
/** 那个 bug 回来了吗 — a regression tripwire. Reaching this call is
|
|
43
|
+
* the signal; it never changes control flow. Plant it in the
|
|
44
|
+
* branch that used to break. */
|
|
45
|
+
probe: (ref, data) => verbs.probe(ref, data),
|
|
65
46
|
};
|
|
66
47
|
export default sentori;
|
|
67
|
-
export { init
|
|
68
|
-
export { addBreadcrumb } from './breadcrumbs';
|
|
69
|
-
export { captureError, captureException, captureMessage, captureStep, getUser, sendUserFeedback, setTag, setTags, setUser, } from './capture';
|
|
70
|
-
export { startMoment, startSpan, startTrace, withScopedSpan, } from '@goliapkg/sentori-core';
|
|
71
|
-
export { close, flush } from './lifecycle';
|
|
72
|
-
/** v2.3 — logger surface re-exported from core so hosts can
|
|
73
|
-
* `import { setLogLevel } from '@goliapkg/sentori-react-native'`
|
|
74
|
-
* per design §3 ("Production override"). `setLogTransport` lets
|
|
75
|
-
* hosts route Sentori-internal lines into their own log
|
|
76
|
-
* aggregator (Datadog, etc.). */
|
|
77
|
-
export { getLogLevel, logger, setLogLevel, setLogTransport, } from '@goliapkg/sentori-core';
|
|
48
|
+
export { init } from './init';
|
|
78
49
|
export { ErrorBoundary } from './error-boundary';
|
|
79
|
-
export { FeedbackButton } from './feedback-widget';
|
|
80
|
-
export { clearAllFeatureFlags, clearFeatureFlag, getFeatureFlags, setFeatureFlag, } from './feature-flags';
|
|
81
|
-
export { clearMaskQuery, registerMaskQuery } from './mask';
|
|
82
|
-
export { flushMetrics, recordMetric } from './metrics';
|
|
83
|
-
export { flushTrack, track } from './track';
|
|
84
|
-
export { getInstallId, peekInstallId } from './install-id';
|
|
85
|
-
export { linkFederatedIdentity, reportPinMismatch, reportSecurity, } from './report-security';
|
|
86
|
-
export { queryTrustScore, } from './trust-score';
|
|
87
|
-
export { measureFn } from './measure';
|
|
88
|
-
export { getColdStartMs, markTimeToFullDisplay, } from './mobile-vitals';
|
|
89
|
-
export { MomentHandle } from '@goliapkg/sentori-core';
|
|
90
|
-
export { bindState, recordState, unbindState, } from './state-snapshots';
|
|
91
50
|
export { RageTapCapture } from './rage-tap';
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
export {
|
|
51
|
+
// Dev-panel helper: crash the native layer on purpose to exercise
|
|
52
|
+
// the pending-crash upload pipeline. Not part of the 8-verb surface.
|
|
53
|
+
export { triggerNativeCrash } from './native';
|
|
95
54
|
export { useTraceNavigation } from './navigation';
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
import * as _push from './push';
|
|
101
|
-
export const push = {
|
|
102
|
-
register: _push.register,
|
|
103
|
-
unregister: _push.unregister,
|
|
104
|
-
getCachedIpt: _push.getCachedIpt,
|
|
105
|
-
getStatus: _push.getStatus,
|
|
106
|
-
requestPermission: _push.requestPermission,
|
|
107
|
-
// v2.26 — let the host stamp the current session id on outgoing
|
|
108
|
-
// ack POSTs so v2.27 push-correlation BI can JOIN on session_id.
|
|
109
|
-
setSessionContext: _push.setSessionContext,
|
|
110
|
-
};
|
|
55
|
+
// Logger gate, for hosts debugging Sentori itself.
|
|
56
|
+
export { getLogLevel, setLogLevel, setLogTransport, } from '@goliapkg/sentori-core';
|
|
57
|
+
// Push namespace — carried as-is; outside the v1 acceptance surface.
|
|
58
|
+
export * as push from './push';
|
|
111
59
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,uEAAuE;AACvE,oEAAoE;AACpE,8CAA8C;AAC9C,EAAE;AACF,gEAAgE;AAChE,oEAAoE;AACpE,qEAAqE;AACrE,8DAA8D;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAShC,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,2DAA2D;IAC3D,IAAI,EAAE,CAAC,MAAkB,EAAQ,EAAE;QACjC,IAAI,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IACD;;4CAEwC;IACxC,IAAI,EAAE,CAAC,CAAc,EAAQ,EAAE;QAC7B,OAAO,CAAC,CAAC,CAAC,CAAC;IACb,CAAC;IACD;8CAC0C;IAC1C,OAAO,EAAE,CAAC,KAA8B,EAAQ,EAAE;QAChD,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED;sEACkE;IAClE,KAAK,EAAE,CAAC,GAAY,EAAE,IAAgB,EAAU,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;IACzE,kDAAkD;IAClD,IAAI,EAAE,CAAC,IAAY,EAAE,IAAgB,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;IACxE;6DACyD;IACzD,KAAK,EAAE,CAAC,IAAY,EAAE,IAAgB,EAAE,IAAmB,EAAU,EAAE,CACrE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAC/B;;mDAE+C;IAC/C,MAAM,EAAE,CAAC,IAAY,EAAE,EAAW,EAAE,IAAgB,EAAU,EAAE,CAC9D,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;IAC9B;;qCAEiC;IACjC,KAAK,EAAE,CAAC,GAAW,EAAE,IAAgB,EAAU,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;CACzE,CAAC;AAEF,eAAe,OAAO,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,kEAAkE;AAClE,qEAAqE;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAA0B,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAoB1E,mDAAmD;AACnD,OAAO,EACL,WAAW,EAEX,WAAW,EAEX,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,qEAAqE;AACrE,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
|
package/lib/init.d.ts
CHANGED
|
@@ -1,151 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { AttachmentMeta } from './types';
|
|
5
|
-
export type InitOptions = {
|
|
6
|
-
/** Project token starting with `st_pk_`. Required. */
|
|
7
|
-
token: string;
|
|
8
|
-
/** Release identifier, e.g. `myapp@1.2.3+456`. Required. */
|
|
9
|
-
release: string;
|
|
10
|
-
/** Environment label. Defaults to `dev` if `__DEV__`, else `prod`. */
|
|
11
|
-
environment?: string;
|
|
12
|
-
/** Override ingestion URL (self-hosted). Default: https://ingest.sentori.golia.jp */
|
|
13
|
-
ingestUrl?: string;
|
|
14
|
-
/** Toggle individual capture sources. All enabled by default. */
|
|
15
|
-
capture?: {
|
|
16
|
-
globalErrors?: boolean;
|
|
17
|
-
promiseRejections?: boolean;
|
|
18
|
-
network?: boolean | {
|
|
19
|
-
/** v0.9.0 #11 — auto-extract GraphQL `operationName` from
|
|
20
|
-
* POST request bodies and use it as the breadcrumb / span
|
|
21
|
-
* name (instead of `POST /graphql`). Default `true`. */
|
|
22
|
-
graphql?: boolean;
|
|
23
|
-
};
|
|
24
|
-
/** Session tracking: opens a session on init and on each
|
|
25
|
-
* foreground (`AppState` → `active`), ends it on background.
|
|
26
|
-
* Drives crash-free rate. Set `false` to opt out. */
|
|
27
|
-
sessions?: boolean;
|
|
28
|
-
/** Capture a screenshot of the current screen on
|
|
29
|
-
* `captureException`. Opt-in. The capture runs through the
|
|
30
|
-
* bundled native module — no extra peer dep required since
|
|
31
|
-
* v0.7.3. To redact PII regions, register a mask query via
|
|
32
|
-
* `sentori.registerMaskQuery(() => string[])` and put
|
|
33
|
-
* `nativeID="..."` on the `<View>`s the SDK should black out.
|
|
34
|
-
* The image is webp q=70 / jpeg q=70 at 480 px max, < 100 KB
|
|
35
|
-
* typical. */
|
|
36
|
-
screenshot?: boolean;
|
|
37
|
-
/** Phase 46: record the last N steps (route changes, custom
|
|
38
|
-
* breadcrumbs) leading up to a crash. On `captureException`
|
|
39
|
-
* the buffer is sealed and uploaded as a `sessionTrail`
|
|
40
|
-
* attachment. Defaults to false. */
|
|
41
|
-
sessionTrail?: boolean;
|
|
42
|
-
/** v2.0 W3 — when `true`, every `sentori.track(name, props)`
|
|
43
|
-
* also pushes a `{ type: 'track', data: { name, props } }`
|
|
44
|
-
* breadcrumb so a subsequent `captureException` /
|
|
45
|
-
* `captureMessage` carries the customer journey leading up to
|
|
46
|
-
* the failure. Defaults to `false` to preserve v1 customer
|
|
47
|
-
* breadcrumb shape on upgrade; recommended `true` for new
|
|
48
|
-
* integrations. See `docs/recipes/track-and-metrics.md`. */
|
|
49
|
-
trackAutoBreadcrumb?: boolean;
|
|
50
|
-
/** v2.1 W2 — auto-instrument runtime metrics (FPS, JS heap,
|
|
51
|
-
* cold-start, route nav timing, network bytes). Drains the
|
|
52
|
-
* shared `@goliapkg/sentori-core` ring to
|
|
53
|
-
* `/v1/runtime-metrics:batch` every 30 s. Defaults to `true`
|
|
54
|
-
* in W2 part 2 — cold-start only, ~6 emits per session
|
|
55
|
-
* per device, ~zero main-thread cost. Higher-cost instruments
|
|
56
|
-
* (FPS / route-nav) land in W2 part 3 with per-tick perf
|
|
57
|
-
* budget tests as stop-ship gates per
|
|
58
|
-
* `.claude/CLAUDE.md` performance bedrock. */
|
|
59
|
-
runtimeMetrics?: boolean;
|
|
60
|
-
/** v0.9.1 +S4 — pre-crash sentinel. Subscribes to JS-thread
|
|
61
|
-
* frame timing; when ≥ 50% of a 60-frame window misses the
|
|
62
|
-
* budget (default 32 ms / < 30 fps), emits a `kind: nearCrash`
|
|
63
|
-
* event proactively so dashboards see the "about-to-die"
|
|
64
|
-
* signal before an actual crash. */
|
|
65
|
-
preCrashSentinel?: boolean;
|
|
66
|
-
sentinelChannels?: PreCrashChannel[];
|
|
67
|
-
/** v0.9.6 #4 — JS-thread long-task monitor. setInterval(50ms)
|
|
68
|
-
* tick detects JS thread stalls ≥ 200ms (configurable) and
|
|
69
|
-
* emits a `sentori.longtask` span. Pairs with
|
|
70
|
-
* `preCrashSentinel` (slow frames < 32ms) to cover the
|
|
71
|
-
* "JS thread is stuck" spectrum. */
|
|
72
|
-
longTaskMonitor?: boolean | {
|
|
73
|
-
thresholdMs?: number;
|
|
74
|
-
};
|
|
75
|
-
/** v0.9.6 #2 — wireframe session replay. Native walks the iOS
|
|
76
|
-
* UIView / Android View hierarchy at 1 Hz and serializes
|
|
77
|
-
* visible nodes; captureException flushes the last 60 s as a
|
|
78
|
-
* `replay` attachment. Set to `'wireframe'` to enable. */
|
|
79
|
-
replay?: 'off' | 'wireframe' | {
|
|
80
|
-
hz?: number;
|
|
81
|
-
mode: 'off' | 'wireframe';
|
|
82
|
-
};
|
|
83
|
-
/** v1.1 #4 升级 — JS sample profiler. setInterval(50ms) idle-tick
|
|
84
|
-
* sampler aggregates frame counts → emits sentori.profile span
|
|
85
|
-
* every 60s with `flameData` (frame → tick count). Pairs with
|
|
86
|
-
* longTaskMonitor (≥200ms outliers) — sample profiler 看 idle
|
|
87
|
-
* 分布、long-task 看 outliers。 */
|
|
88
|
-
sampleProfiler?: boolean | {
|
|
89
|
-
flushMs?: number;
|
|
90
|
-
sampleMs?: number;
|
|
91
|
-
};
|
|
92
|
-
/** Analytics v1 — live-presence heartbeat. Foreground 1/min
|
|
93
|
-
* default; opt out with `false`, or pass an options object
|
|
94
|
-
* to tune. Powers the Audience > Live dashboard.
|
|
95
|
-
* Iron-rule budget: < 1 KB / min, < 1 ms / call. */
|
|
96
|
-
heartbeat?: boolean | HeartbeatOptions;
|
|
97
|
-
/** v0.9.0 #3 — launch-crash loop guard. When two consecutive
|
|
98
|
-
* launches don't reach `markLaunchCompleted()` (typical of an
|
|
99
|
-
* OTA update with a fatal bug), invoke the host callback with
|
|
100
|
-
* a 200 ms timeout to decide rollback / reset / continue. */
|
|
101
|
-
launchCrashGuard?: {
|
|
102
|
-
enabled: boolean;
|
|
103
|
-
onLaunchCrashDetected?: (info: import('./launch-crash-guard').LaunchCrashInfo) => import('./launch-crash-guard').LaunchCrashAction | Promise<import('./launch-crash-guard').LaunchCrashAction>;
|
|
104
|
-
threshold?: number;
|
|
105
|
-
timeoutMs?: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/** Phase 44 sub-B: client-side sampling. Each rate is `[0, 1]`;
|
|
109
|
-
* absent / null keeps everything. Defaults to 1.0 for both
|
|
110
|
-
* (no drop). Set traces to e.g. 0.1 once the app's at user
|
|
111
|
-
* volume to keep ingest budget under control without changing
|
|
112
|
-
* the server-side quota. Decisions are made per-event for
|
|
113
|
-
* errors and per-trace (all spans together) for traces. */
|
|
114
|
-
sampling?: {
|
|
115
|
-
errors?: null | number;
|
|
116
|
-
traces?: null | number;
|
|
117
|
-
/** v2.0 — sampling rate for `kind: 'message'` events emitted
|
|
118
|
-
* via `sentori.captureMessage()`. `null` / absent → keep all. */
|
|
119
|
-
messages?: null | number;
|
|
120
|
-
};
|
|
121
|
-
/** v2.3 — canonical sampling field (renamed from `sampling`).
|
|
122
|
-
* Same shape; if both are passed, `sample` wins. The older
|
|
123
|
-
* `sampling` stays accepted indefinitely as a back-compat alias —
|
|
124
|
-
* this is the kind of rename that's only worth doing if it's
|
|
125
|
-
* also zero-cost for existing callers. */
|
|
126
|
-
sample?: {
|
|
127
|
-
errors?: null | number;
|
|
128
|
-
traces?: null | number;
|
|
129
|
-
messages?: null | number;
|
|
130
|
-
};
|
|
131
|
-
/** v2.3 — Sentori SDK's own console output gate. Default `'warn'`:
|
|
132
|
-
* SDK is silent unless something is genuinely broken (transport
|
|
133
|
-
* sustained failure, native module not found, internal SDK
|
|
134
|
-
* exception). Set to `'silent'` for absolute silence; bump to
|
|
135
|
-
* `'info'` / `'debug'` when debugging Sentori itself. */
|
|
136
|
-
logLevel?: import('@goliapkg/sentori-core').LogLevel;
|
|
137
|
-
/** v2.3 — fires once after init completes. Use this to know the
|
|
138
|
-
* SDK is live instead of scanning the console. The `ReadyInfo`
|
|
139
|
-
* carries native-module bind status + cold-start timing. */
|
|
140
|
-
onReady?: (info: ReadyInfo) => void;
|
|
141
|
-
/** v2.3 — mutate-or-drop hook on each outbound event (sync).
|
|
142
|
-
* Return the event to ship it (possibly mutated), or `null` to
|
|
143
|
-
* drop. See `BeforeSendHook` for the throwing / non-event
|
|
144
|
-
* fallback policy. Used for host-side PII scrubbing the SDK
|
|
145
|
-
* can't do automatically; server-side privacy_lab still runs
|
|
146
|
-
* regardless. */
|
|
147
|
-
beforeSend?: import('@goliapkg/sentori-core').BeforeSendHook;
|
|
148
|
-
};
|
|
149
|
-
export declare const init: (options: InitOptions) => void;
|
|
150
|
-
export type { AttachmentMeta };
|
|
1
|
+
import type { InitConfig } from '@goliapkg/sentori-core';
|
|
2
|
+
export declare const init: (config: InitConfig) => void | undefined;
|
|
3
|
+
export declare const __resetForTests: () => void;
|
|
151
4
|
//# sourceMappingURL=init.d.ts.map
|
package/lib/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAiBzD,eAAO,MAAM,IAAI,0CA+Ef,CAAC;AAeH,eAAO,MAAM,eAAe,QAAO,IAElC,CAAC"}
|