@goliapkg/sentori-react-native 4.0.0 → 5.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/MIGRATION.md +131 -0
- package/README.md +40 -30
- package/android/build.gradle +21 -0
- package/android/src/main/java/com/sentori/SentoriCrashHandler.kt +29 -0
- package/android/src/main/java/com/sentori/SentoriModule.kt +8 -0
- package/android/src/main/java/com/sentori/SentoriScreenshotCapture.kt +36 -4
- package/android/src/test/java/com/sentori/SentoriCrashHandlerTest.kt +7 -2
- package/android/src/test/resources/robolectric.properties +10 -0
- package/ios/SentoriCrashHandler.swift +48 -4
- package/ios/SentoriModule.swift +12 -0
- package/ios/SentoriScreenshotCapture.swift +34 -3
- package/lib/config.d.ts +17 -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 +32 -109
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +54 -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 +100 -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/mask.d.ts +5 -13
- package/lib/mask.d.ts.map +1 -1
- package/lib/mask.js +29 -30
- package/lib/mask.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/native.d.ts +4 -11
- package/lib/native.d.ts.map +1 -1
- package/lib/native.js +23 -0
- package/lib/native.js.map +1 -1
- 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 +56 -23
- package/lib/rage-tap.js.map +1 -1
- package/lib/replay-screens.d.ts +15 -0
- package/lib/replay-screens.d.ts.map +1 -0
- package/lib/replay-screens.js +87 -0
- package/lib/replay-screens.js.map +1 -0
- package/lib/replay.d.ts.map +1 -1
- package/lib/replay.js +3 -24
- package/lib/replay.js.map +1 -1
- package/lib/responsiveness-detector.d.ts +18 -0
- package/lib/responsiveness-detector.d.ts.map +1 -0
- package/lib/responsiveness-detector.js +55 -0
- package/lib/responsiveness-detector.js.map +1 -0
- 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 +4 -3
- package/src/__tests__/iron-rule.test.ts +128 -0
- package/src/__tests__/replay-screens.test.ts +63 -0
- package/src/__tests__/responsiveness-detector.test.ts +74 -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 +20 -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 +84 -215
- package/src/init.ts +115 -449
- package/src/long-task-monitor.ts +42 -64
- package/src/mask.ts +29 -31
- package/src/mobile-vitals.ts +22 -82
- package/src/native-pending.ts +92 -0
- package/src/native.ts +33 -0
- package/src/navigation.ts +34 -142
- package/src/netinfo.ts +3 -3
- package/src/push.ts +2 -5
- package/src/rage-tap.tsx +72 -25
- package/src/replay-screens.ts +95 -0
- package/src/replay.ts +3 -20
- package/src/responsiveness-detector.ts +66 -0
- 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/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/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/capture.js
DELETED
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
import { hashIdentities, logger, safeFn, sealTrail, shouldSample, } from '@goliapkg/sentori-core';
|
|
2
|
-
import { base64Utf8 } from './base64';
|
|
3
|
-
import { __peekBreadcrumbCount, addBreadcrumb, getBreadcrumbs, } from './breadcrumbs';
|
|
4
|
-
import { getBundleInfo } from './bundle-info';
|
|
5
|
-
import { getConfig, isInitialized } from './config';
|
|
6
|
-
import { getFeatureFlagSnapshot } from './feature-flags';
|
|
7
|
-
import { drainReplay, isReplayRunning } from './replay';
|
|
8
|
-
import { clearStateSnapshots, getStateSnapshots } from './state-snapshots';
|
|
9
|
-
import { symbolicateErrorViaMetro } from './handlers/dev-symbolicate';
|
|
10
|
-
import { captureScreenshot } from './handlers/screenshot';
|
|
11
|
-
import { markSessionErrored } from './session-tracker';
|
|
12
|
-
import { parseStack } from './stack';
|
|
13
|
-
import { getTrailBuffer } from './trail';
|
|
14
|
-
import { enqueue, sendUserReport, uploadAttachment } from './transport';
|
|
15
|
-
import { uuidV7 } from './uuid';
|
|
16
|
-
import { peekInstallId } from './install-id';
|
|
17
|
-
import { getCachedNetworkType } from './netinfo';
|
|
18
|
-
import { getRecentNativeException } from './native';
|
|
19
|
-
export { captureStep, __resetTrailForTests } from './trail';
|
|
20
|
-
let _user = null;
|
|
21
|
-
/** v2.0 — global scope tags merged onto every captured event
|
|
22
|
-
* (captureException + captureMessage). Set via `setTag` /
|
|
23
|
-
* `setTags`; reset by passing `{}`. Per-call tags win on conflict. */
|
|
24
|
-
let _scopeTags = {};
|
|
25
|
-
/**
|
|
26
|
-
* v2.0 — set a single scope tag merged onto every subsequent
|
|
27
|
-
* capture. Per-call `extras.tags` / `opts.tags` win over scope tags.
|
|
28
|
-
*
|
|
29
|
-
* sentori.setTag('rollout', 'dark-mode-v2');
|
|
30
|
-
* sentori.captureException(err); // event.tags carries rollout
|
|
31
|
-
*/
|
|
32
|
-
export const setTag = (key, value) => {
|
|
33
|
-
_scopeTags[key] = String(value);
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* v2.0 — bulk variant of setTag. Existing tags are merged with
|
|
37
|
-
* the input record (`Object.assign` style).
|
|
38
|
-
*/
|
|
39
|
-
export const setTags = (record) => {
|
|
40
|
-
for (const [k, v] of Object.entries(record))
|
|
41
|
-
_scopeTags[k] = String(v);
|
|
42
|
-
};
|
|
43
|
-
/** Internal — merge global scope tags into a per-call tag record. */
|
|
44
|
-
function mergeScopeTags(perCall) {
|
|
45
|
-
if (Object.keys(_scopeTags).length === 0)
|
|
46
|
-
return perCall;
|
|
47
|
-
return { ..._scopeTags, ...(perCall ?? {}) };
|
|
48
|
-
}
|
|
49
|
-
export const __resetScopeForTests = () => {
|
|
50
|
-
_user = null;
|
|
51
|
-
_scopeTags = {};
|
|
52
|
-
};
|
|
53
|
-
// Phase 42 sub-D.08 — per-session screenshot quota. Defaults: 10 in
|
|
54
|
-
// prod, unlimited (-1 sentinel) in dev so test loops + react-error-
|
|
55
|
-
// overlay reruns don't run out partway through the session.
|
|
56
|
-
const SCREENSHOT_PROD_LIMIT = 10;
|
|
57
|
-
let _screenshotsTaken = 0;
|
|
58
|
-
function screenshotBudget() {
|
|
59
|
-
return typeof __DEV__ !== 'undefined' && __DEV__ ? -1 : SCREENSHOT_PROD_LIMIT;
|
|
60
|
-
}
|
|
61
|
-
export const __resetScreenshotBudgetForTests = () => {
|
|
62
|
-
_screenshotsTaken = 0;
|
|
63
|
-
};
|
|
64
|
-
export const setUser = (input) => {
|
|
65
|
-
if (input == null) {
|
|
66
|
-
// `null` (explicit clear) or `undefined` (callers occasionally
|
|
67
|
-
// pass through optional state). Both clear the scope user.
|
|
68
|
-
_user = null;
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
// Stage 1: commit id + name + anonymous immediately so the next
|
|
72
|
-
// captured event picks them up even if hashing is still in flight.
|
|
73
|
-
const { linkBy: rawLinkBy, ...stable } = input;
|
|
74
|
-
_user = { ...stable };
|
|
75
|
-
// Stage 2: hash any linkBy values async; commit to scope when done.
|
|
76
|
-
if (rawLinkBy && Object.keys(rawLinkBy).length > 0) {
|
|
77
|
-
void hashIdentities(rawLinkBy)
|
|
78
|
-
.then((linkHashes) => {
|
|
79
|
-
// Re-merge to guard against setUser being called again
|
|
80
|
-
// between stage 1 and stage 2 — if the user changed, drop
|
|
81
|
-
// the now-stale hash.
|
|
82
|
-
if (_user && _user.id === stable.id) {
|
|
83
|
-
_user = { ..._user, linkHashes };
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
.catch((e) => {
|
|
87
|
-
logger.warn('identity', 'linkBy hash failed; identities dropped:', e);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
export const getUser = () => _user;
|
|
92
|
-
/** v1.1 +S7 升级 — read just the current user id for the control
|
|
93
|
-
* channel poll. Returns `undefined` until `setUser({ id })` runs. */
|
|
94
|
-
export const getCurrentUserId = () => _user?.id ?? undefined;
|
|
95
|
-
/**
|
|
96
|
-
* v0.8.2 — submit an end-user-supplied bug report. Use this when the
|
|
97
|
-
* host app surfaces a "Report a problem" form. Pass `eventId` if the
|
|
98
|
-
* user is reporting a specific crash they just saw — the server links
|
|
99
|
-
* the report to that event's issue automatically.
|
|
100
|
-
*
|
|
101
|
-
* Returns `{ id, issueId }` on success or `null` on any failure
|
|
102
|
-
* (network down, ingest token revoked, validation rejected). Doesn't
|
|
103
|
-
* throw.
|
|
104
|
-
*/
|
|
105
|
-
export const sendUserFeedback = async (input) => {
|
|
106
|
-
if (!isInitialized())
|
|
107
|
-
return null;
|
|
108
|
-
const config = getConfig();
|
|
109
|
-
if (!config)
|
|
110
|
-
return null;
|
|
111
|
-
return sendUserReport(config.ingestUrl, config.token, input);
|
|
112
|
-
};
|
|
113
|
-
export const captureError = (error, extras) => {
|
|
114
|
-
if (!isInitialized())
|
|
115
|
-
return;
|
|
116
|
-
const config = getConfig();
|
|
117
|
-
if (!config)
|
|
118
|
-
return;
|
|
119
|
-
// Phase 44 sub-B: client-side sampling. Skip the whole pipeline
|
|
120
|
-
// (no screenshot capture either) when the sample dice come up
|
|
121
|
-
// wrong. Default rate = null = keep, so existing callers unaffected.
|
|
122
|
-
if (!shouldSample(config.errorSampleRate)) {
|
|
123
|
-
addBreadcrumb({ type: 'custom', data: { reason: 'sampled-out', kind: 'error' } });
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const flags = getFeatureFlagSnapshot();
|
|
127
|
-
const bundle = getBundleInfo();
|
|
128
|
-
const crumbs = getBreadcrumbs();
|
|
129
|
-
const event = {
|
|
130
|
-
id: uuidV7(),
|
|
131
|
-
timestamp: new Date().toISOString(),
|
|
132
|
-
kind: 'error',
|
|
133
|
-
platform: 'javascript',
|
|
134
|
-
release: config.release,
|
|
135
|
-
environment: config.environment,
|
|
136
|
-
device: collectDevice(),
|
|
137
|
-
app: collectApp(config.release),
|
|
138
|
-
user: extras?.user ?? _user,
|
|
139
|
-
tags: mergeScopeTags(extras?.tags),
|
|
140
|
-
...(flags ? { flags } : {}),
|
|
141
|
-
...(bundle ? { bundle } : {}),
|
|
142
|
-
breadcrumbs: crumbs,
|
|
143
|
-
error: errorToObject(error),
|
|
144
|
-
fingerprint: extras?.fingerprint,
|
|
145
|
-
};
|
|
146
|
-
// v0.9.8 — dev-only diagnostic. Insight saw `breadcrumbs: []` on
|
|
147
|
-
// every event in 0.9.7 despite handlers being installed; this line
|
|
148
|
-
// makes it visible in Metro that the snapshot at captureException
|
|
149
|
-
// time really is empty (no breadcrumb events fired yet) vs. having
|
|
150
|
-
// been silently dropped on the wire. Production builds gate out.
|
|
151
|
-
logger.debug('capture', 'captureException', 'eventId=', event.id, 'breadcrumbs=', crumbs.length, 'wantScreenshot=', config.screenshotsEnabled && extras?.screenshot !== false, 'wantSessionTrail=', config.sessionTrailEnabled, 'wantReplay=', isReplayRunning());
|
|
152
|
-
// Phase 26 sub-B: a captured error promotes the current session to
|
|
153
|
-
// `errored` so the next AppState=background ping reports unhealthy.
|
|
154
|
-
markSessionErrored();
|
|
155
|
-
// Phase 42 sub-D.07: opt-in screenshot. Default off; per-call
|
|
156
|
-
// `extras.screenshot: false` always wins so callers can mute it
|
|
157
|
-
// on a sensitive flow even when init has it on globally.
|
|
158
|
-
const wantScreenshot = config.screenshotsEnabled && extras?.screenshot !== false && allowScreenshot();
|
|
159
|
-
// Phase 40 sub-E: in dev there's no uploaded source map, so ask
|
|
160
|
-
// Metro to symbolicate the stack before we send it (best-effort,
|
|
161
|
-
// short timeout). Release builds skip straight to enqueue and let
|
|
162
|
-
// the server symbolicate at ingest against the uploaded map.
|
|
163
|
-
const pipeline = async () => {
|
|
164
|
-
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
165
|
-
await symbolicateErrorViaMetro(event.error).catch(() => { });
|
|
166
|
-
}
|
|
167
|
-
if (wantScreenshot) {
|
|
168
|
-
await captureAndAttachScreenshot(event);
|
|
169
|
-
}
|
|
170
|
-
const trail = getTrailBuffer();
|
|
171
|
-
if (config.sessionTrailEnabled && trail.size() > 0) {
|
|
172
|
-
await captureAndAttachSessionTrail(event);
|
|
173
|
-
}
|
|
174
|
-
// v0.9.2 +S2 — state time-travel attachment. Only if anything has
|
|
175
|
-
// been bound or recorded; cleared on success so the next crash's
|
|
176
|
-
// ring doesn't carry stale entries.
|
|
177
|
-
const stateSnapshots = getStateSnapshots();
|
|
178
|
-
if (stateSnapshots.length > 0) {
|
|
179
|
-
await captureAndAttachStateSnapshots(event, stateSnapshots);
|
|
180
|
-
clearStateSnapshots();
|
|
181
|
-
}
|
|
182
|
-
// v0.9.6 #2 — wireframe replay attachment. drainReplay clears the
|
|
183
|
-
// ring as a side effect so next session's replay starts fresh.
|
|
184
|
-
const replayNdjson = drainReplay();
|
|
185
|
-
if (replayNdjson.length > 0) {
|
|
186
|
-
await captureAndAttachReplay(event, replayNdjson);
|
|
187
|
-
}
|
|
188
|
-
else if (typeof __DEV__ !== 'undefined' && __DEV__ && isReplayRunning()) {
|
|
189
|
-
// rc.4 — explicit "replay was on but ring drained empty" signal.
|
|
190
|
-
// Without this, "kinds=screenshot,sessionTrail" looks
|
|
191
|
-
// indistinguishable from `replay: off` even though the ticks
|
|
192
|
-
// were healthy upstream. Insight 2026-05-18 verify shape made
|
|
193
|
-
// this gap painful to triage.
|
|
194
|
-
logger.debug('capture', 'replay drain empty (no frames buffered at captureException)', 'eventId=', event.id);
|
|
195
|
-
}
|
|
196
|
-
logger.debug('capture', 'enqueue', 'eventId=', event.id, 'attachments=', event.attachments?.length ?? 0, 'kinds=', (event.attachments ?? []).map((a) => a.kind).join(',') || '(none)', 'breadcrumbsAtEnqueue=', __peekBreadcrumbCount());
|
|
197
|
-
// v2.3 — host beforeSend hook. Sync; drops on null, falls back
|
|
198
|
-
// to unmutated event on throw or non-event return.
|
|
199
|
-
const finalEvent = applyBeforeSend(event, config.beforeSend);
|
|
200
|
-
if (finalEvent === null)
|
|
201
|
-
return;
|
|
202
|
-
enqueue(finalEvent);
|
|
203
|
-
};
|
|
204
|
-
void pipeline();
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* v2.3 — invoke the host's `beforeSend` hook (if any) under the
|
|
208
|
-
* NEVER rule. Returns the (possibly mutated) event, or null to
|
|
209
|
-
* drop. A throw / non-event return is treated as a no-op
|
|
210
|
-
* (one-shot warn + send unmodified) so a buggy host hook can't
|
|
211
|
-
* stall captures.
|
|
212
|
-
*/
|
|
213
|
-
let _beforeSendThrewWarned = false;
|
|
214
|
-
function applyBeforeSend(event, hook) {
|
|
215
|
-
if (!hook)
|
|
216
|
-
return event;
|
|
217
|
-
try {
|
|
218
|
-
const result = hook(event);
|
|
219
|
-
if (result === null) {
|
|
220
|
-
logger.debug('capture', 'beforeSend dropped event', 'eventId=', event.id);
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
if (typeof result !== 'object' || !result || typeof result.id !== 'string') {
|
|
224
|
-
// Host returned a non-event shape; fall back.
|
|
225
|
-
if (!_beforeSendThrewWarned) {
|
|
226
|
-
_beforeSendThrewWarned = true;
|
|
227
|
-
logger.warn('capture', 'beforeSend returned non-event shape; falling back to unmodified event');
|
|
228
|
-
}
|
|
229
|
-
return event;
|
|
230
|
-
}
|
|
231
|
-
return result;
|
|
232
|
-
}
|
|
233
|
-
catch (e) {
|
|
234
|
-
if (!_beforeSendThrewWarned) {
|
|
235
|
-
_beforeSendThrewWarned = true;
|
|
236
|
-
logger.warn('capture', 'beforeSend threw; falling back to unmodified event', e);
|
|
237
|
-
}
|
|
238
|
-
return event;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/** v0.9.6 #2 — upload the wireframe replay ring as a `replay`
|
|
242
|
-
* attachment. Plain NDJSON (one snapshot per line) — server may
|
|
243
|
-
* gzip on storage; the network upload is base64.
|
|
244
|
-
*
|
|
245
|
-
* rc.4: route through `base64Utf8` so non-Latin-1 text inside any
|
|
246
|
-
* walked TextView (Japanese / Chinese / em-dash etc.) doesn't blow
|
|
247
|
-
* up the Hermes-spec `btoa`. The pre-rc.4 inline `btoa(ndjson)` path
|
|
248
|
-
* threw `InvalidCharacterError` on those code points, the
|
|
249
|
-
* surrounding catch swallowed it silently, and the replay
|
|
250
|
-
* attachment never landed. Insight 2026-05-18 verify caught it
|
|
251
|
-
* after rc.3's walker fix surfaced deep TextView content. Dev
|
|
252
|
-
* logs replace the silent catch so the next failure shape is
|
|
253
|
-
* visible. */
|
|
254
|
-
async function captureAndAttachReplay(event, ndjson) {
|
|
255
|
-
try {
|
|
256
|
-
const base64 = base64Utf8(ndjson);
|
|
257
|
-
const meta = await uploadAttachment(event.id, 'replay', { base64, mediaType: 'application/x-ndjson' }, { source: 'js' });
|
|
258
|
-
if (!meta) {
|
|
259
|
-
logger.debug('capture', 'replay upload returned null', 'eventId=', event.id, 'ndjsonBytes=', ndjson.length);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
if (!event.attachments)
|
|
263
|
-
event.attachments = [];
|
|
264
|
-
event.attachments.push(meta);
|
|
265
|
-
}
|
|
266
|
-
catch (e) {
|
|
267
|
-
logger.debug('capture', 'replay attachment threw', 'eventId=', event.id, 'ndjsonBytes=', ndjson.length, e);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
/** v0.9.2 +S2 — upload the rolling state-snapshot ring as a
|
|
271
|
-
* `stateSnapshot` attachment so the dashboard time-travel viewer can
|
|
272
|
-
* scrub through diffs alongside the breadcrumb timeline. */
|
|
273
|
-
async function captureAndAttachStateSnapshots(event, snapshots) {
|
|
274
|
-
try {
|
|
275
|
-
const payload = JSON.stringify({ snapshots });
|
|
276
|
-
const base64 = base64Utf8(payload);
|
|
277
|
-
const meta = await uploadAttachment(event.id, 'stateSnapshot', { base64, mediaType: 'application/json' }, { source: 'js' });
|
|
278
|
-
if (meta) {
|
|
279
|
-
if (!event.attachments)
|
|
280
|
-
event.attachments = [];
|
|
281
|
-
event.attachments.push(meta);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
catch {
|
|
285
|
-
// best-effort
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Phase 46 — seal the trail buffer, upload it as a `sessionTrail`
|
|
290
|
-
* attachment, attach the ref. Best-effort: any failure leaves a
|
|
291
|
-
* breadcrumb and lets the event ship without the trail.
|
|
292
|
-
*
|
|
293
|
-
* The trail is **always cleared** after `captureException`, even if
|
|
294
|
-
* upload fails — we don't want a stale 30-step buffer leaking into
|
|
295
|
-
* the next crash's trail.
|
|
296
|
-
*/
|
|
297
|
-
async function captureAndAttachSessionTrail(event) {
|
|
298
|
-
const trail = getTrailBuffer();
|
|
299
|
-
const payload = sealTrail(trail);
|
|
300
|
-
trail.clear();
|
|
301
|
-
const json = JSON.stringify(payload);
|
|
302
|
-
const base64 = base64Utf8(json);
|
|
303
|
-
const attachment = await uploadAttachment(event.id, 'sessionTrail', { base64, mediaType: 'application/json' }, { source: 'js' });
|
|
304
|
-
if (!attachment) {
|
|
305
|
-
addBreadcrumb({ type: 'custom', data: { reason: 'session-trail-upload-failed' } });
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
if (!event.attachments)
|
|
309
|
-
event.attachments = [];
|
|
310
|
-
event.attachments.push(attachment);
|
|
311
|
-
}
|
|
312
|
-
export const captureException = captureError;
|
|
313
|
-
const DEFAULT_MESSAGE_LEVEL = 'info';
|
|
314
|
-
/**
|
|
315
|
-
* Manually report an issue without an Error instance.
|
|
316
|
-
*
|
|
317
|
-
* Routes to the dashboard Issues module — distinct from `track`
|
|
318
|
-
* (analytics) and `recordMetric` (numeric). Use for "operator should
|
|
319
|
-
* look at this" signals: a fallback that fired, an unexpected state,
|
|
320
|
-
* a feature flag rollout that crossed a threshold.
|
|
321
|
-
*
|
|
322
|
-
* sentori.captureMessage('Payment provider returned 500, used fallback')
|
|
323
|
-
* sentori.captureMessage('Detected impossible state in session reducer', {
|
|
324
|
-
* level: 'error',
|
|
325
|
-
* tags: { reducer: 'session' },
|
|
326
|
-
* })
|
|
327
|
-
*
|
|
328
|
-
* Wrapped in `safeFn` per the NEVER rule — any internal failure is
|
|
329
|
-
* swallowed and (optionally) self-reported; the host app never sees
|
|
330
|
-
* a thrown error.
|
|
331
|
-
*/
|
|
332
|
-
export const captureMessage = safeFn('captureMessage', (message, opts = {}) => {
|
|
333
|
-
if (!isInitialized())
|
|
334
|
-
return;
|
|
335
|
-
if (typeof message !== 'string' || message.length === 0)
|
|
336
|
-
return;
|
|
337
|
-
const config = getConfig();
|
|
338
|
-
if (!config)
|
|
339
|
-
return;
|
|
340
|
-
if (!shouldSample(config.messageSampleRate)) {
|
|
341
|
-
addBreadcrumb({ type: 'custom', data: { reason: 'sampled-out', kind: 'message' } });
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
const flags = getFeatureFlagSnapshot();
|
|
345
|
-
const bundle = getBundleInfo();
|
|
346
|
-
const crumbs = opts.breadcrumbs ?? getBreadcrumbs();
|
|
347
|
-
const event = {
|
|
348
|
-
id: uuidV7(),
|
|
349
|
-
timestamp: new Date().toISOString(),
|
|
350
|
-
kind: 'message',
|
|
351
|
-
level: opts.level ?? DEFAULT_MESSAGE_LEVEL,
|
|
352
|
-
message,
|
|
353
|
-
platform: 'javascript',
|
|
354
|
-
release: config.release,
|
|
355
|
-
environment: config.environment,
|
|
356
|
-
device: collectDevice(),
|
|
357
|
-
app: collectApp(config.release),
|
|
358
|
-
user: opts.user ?? _user,
|
|
359
|
-
tags: mergeScopeTags(opts.tags),
|
|
360
|
-
...(flags ? { flags } : {}),
|
|
361
|
-
...(bundle ? { bundle } : {}),
|
|
362
|
-
breadcrumbs: crumbs,
|
|
363
|
-
};
|
|
364
|
-
const finalEvent = applyBeforeSend(event, config.beforeSend);
|
|
365
|
-
if (finalEvent === null)
|
|
366
|
-
return;
|
|
367
|
-
enqueue(finalEvent);
|
|
368
|
-
});
|
|
369
|
-
/** rc.4 — test hook. The real replay attach path is internal so we
|
|
370
|
-
* don't bloat the public surface, but the encoding bug Insight hit
|
|
371
|
-
* on 2026-05-18 needs a behaviour-level test that exercises the
|
|
372
|
-
* same code path captureException runs in production. */
|
|
373
|
-
export const __captureAndAttachReplayForTests = captureAndAttachReplay;
|
|
374
|
-
/** v2.3 — test hook for the beforeSend dispatcher. The dispatcher
|
|
375
|
-
* is internal so the unit test reaches it directly without
|
|
376
|
-
* needing to stub the whole transport pipeline. */
|
|
377
|
-
export const __applyBeforeSendForTests = applyBeforeSend;
|
|
378
|
-
/** Phase 42 sub-D.08: per-session screenshot quota gate. */
|
|
379
|
-
function allowScreenshot() {
|
|
380
|
-
const budget = screenshotBudget();
|
|
381
|
-
if (budget < 0)
|
|
382
|
-
return true; // dev: unlimited
|
|
383
|
-
if (_screenshotsTaken >= budget)
|
|
384
|
-
return false;
|
|
385
|
-
_screenshotsTaken += 1;
|
|
386
|
-
return true;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Phase 42 sub-D.06/07: take a screenshot, upload it, push the
|
|
390
|
-
* server-issued ref into `event.attachments`. Every step is
|
|
391
|
-
* best-effort — on any failure we leave a breadcrumb and let the
|
|
392
|
-
* event ship without a thumbnail.
|
|
393
|
-
*/
|
|
394
|
-
async function captureAndAttachScreenshot(event) {
|
|
395
|
-
let blob = null;
|
|
396
|
-
try {
|
|
397
|
-
blob = await captureScreenshot();
|
|
398
|
-
}
|
|
399
|
-
catch (e) {
|
|
400
|
-
logger.debug('capture', 'screenshot capture threw', e);
|
|
401
|
-
}
|
|
402
|
-
if (!blob) {
|
|
403
|
-
logger.debug('capture', 'screenshot blob null — native module missing or capture returned null', 'eventId=', event.id);
|
|
404
|
-
addBreadcrumb({ type: 'custom', data: { reason: 'screenshot-capture-failed' } });
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
logger.debug('capture', 'screenshot blob ok, uploading', 'eventId=', event.id, 'mediaType=', blob.mediaType, 'base64Bytes=', blob.base64.length);
|
|
408
|
-
const attachment = await uploadAttachment(event.id, 'screenshot', blob, { source: 'js' });
|
|
409
|
-
if (!attachment) {
|
|
410
|
-
logger.debug('capture', 'screenshot upload returned null', 'eventId=', event.id);
|
|
411
|
-
addBreadcrumb({ type: 'custom', data: { reason: 'screenshot-upload-failed' } });
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
if (!event.attachments)
|
|
415
|
-
event.attachments = [];
|
|
416
|
-
event.attachments.push(attachment);
|
|
417
|
-
}
|
|
418
|
-
const errorToObject = (error) => {
|
|
419
|
-
const causeRaw = error.cause;
|
|
420
|
-
let cause = null;
|
|
421
|
-
if (causeRaw instanceof Error) {
|
|
422
|
-
cause = errorToObject(causeRaw);
|
|
423
|
-
}
|
|
424
|
-
// v0.9.5 #8 — TurboModule swallowed-exception bridge. If the host
|
|
425
|
-
// wrapped a native call with `@try @catch + recordException`, the
|
|
426
|
-
// native ring may hold a fresh entry (< 1 s old). Synthesize that
|
|
427
|
-
// as a `cause` so the JS event includes the original native stack.
|
|
428
|
-
if (cause === null) {
|
|
429
|
-
const recent = getRecentNativeException();
|
|
430
|
-
if (recent && recent.ageMs <= 1500) {
|
|
431
|
-
cause = {
|
|
432
|
-
type: recent.name || 'NativeException',
|
|
433
|
-
message: recent.reason,
|
|
434
|
-
stack: recent.stack.map((line, i) => ({
|
|
435
|
-
function: line.trim(),
|
|
436
|
-
file: '<native>',
|
|
437
|
-
inApp: false,
|
|
438
|
-
line: i + 1,
|
|
439
|
-
})),
|
|
440
|
-
cause: null,
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
return {
|
|
445
|
-
type: error.name || 'Error',
|
|
446
|
-
message: error.message,
|
|
447
|
-
stack: parseStack(error.stack),
|
|
448
|
-
cause,
|
|
449
|
-
};
|
|
450
|
-
};
|
|
451
|
-
const collectDevice = () => {
|
|
452
|
-
let os = 'other';
|
|
453
|
-
let osVersion = '0';
|
|
454
|
-
let locale;
|
|
455
|
-
const networkType = getCachedNetworkType();
|
|
456
|
-
try {
|
|
457
|
-
const RN = require('react-native');
|
|
458
|
-
const rnOS = RN.Platform.OS;
|
|
459
|
-
os = rnOS === 'ios' || rnOS === 'android' || rnOS === 'web' ? rnOS : 'other';
|
|
460
|
-
osVersion = String(RN.Platform.Version);
|
|
461
|
-
// v0.8.0-a — RN reads user locale through native modules. These
|
|
462
|
-
// are stable RN-internal modules (SettingsManager since 0.4,
|
|
463
|
-
// I18nManager since 0.16) so we can read them directly without
|
|
464
|
-
// an extra peer dep. iOS returns e.g. "en_US"; Android returns
|
|
465
|
-
// e.g. "en_US" via `getDefault().toString()`. `AppleLocale` is
|
|
466
|
-
// the format the user picked in Settings; `AppleLanguages[0]`
|
|
467
|
-
// is the resolved language priority — prefer the former.
|
|
468
|
-
if (rnOS === 'ios') {
|
|
469
|
-
const s = RN.NativeModules.SettingsManager?.settings;
|
|
470
|
-
locale = s?.AppleLocale ?? s?.AppleLanguages?.[0];
|
|
471
|
-
}
|
|
472
|
-
else if (rnOS === 'android') {
|
|
473
|
-
locale = RN.NativeModules.I18nManager?.localeIdentifier;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
catch {
|
|
477
|
-
// not in RN runtime (jest, bun test)
|
|
478
|
-
}
|
|
479
|
-
const device = { os, osVersion };
|
|
480
|
-
if (locale)
|
|
481
|
-
device.locale = locale;
|
|
482
|
-
if (networkType)
|
|
483
|
-
device.networkType = networkType;
|
|
484
|
-
// v1.1 chunk S1 — stable per-install id. Read sync from the
|
|
485
|
-
// in-memory cache populated by the install-id module's first
|
|
486
|
-
// resolve (kicked off from init()). `null` before init resolves —
|
|
487
|
-
// the field is omitted in that case rather than blocking event
|
|
488
|
-
// assembly, which sits on the JS thread.
|
|
489
|
-
const installId = peekInstallId();
|
|
490
|
-
if (installId)
|
|
491
|
-
device.installId = installId;
|
|
492
|
-
return device;
|
|
493
|
-
};
|
|
494
|
-
const collectApp = (release) => {
|
|
495
|
-
const m = /^(?:[^@]+@)?([^+]+)(?:\+(.+))?$/.exec(release);
|
|
496
|
-
const version = m?.[1] ?? '0.0.0';
|
|
497
|
-
const build = m?.[2];
|
|
498
|
-
let rnVersion = 'unknown';
|
|
499
|
-
try {
|
|
500
|
-
rnVersion = require('react-native/package.json').version;
|
|
501
|
-
}
|
|
502
|
-
catch {
|
|
503
|
-
// not in RN runtime
|
|
504
|
-
}
|
|
505
|
-
return {
|
|
506
|
-
version,
|
|
507
|
-
build,
|
|
508
|
-
framework: { name: 'react-native', version: rnVersion },
|
|
509
|
-
};
|
|
510
|
-
};
|
|
511
|
-
//# sourceMappingURL=capture.js.map
|
package/lib/capture.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEd,MAAM,EAEN,MAAM,EACN,SAAS,EACT,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MA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C1D,MAAM,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;IAClC,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAErB,IAAI,SAAS,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC;QACH,SAAS,GAAI,OAAO,CAAC,2BAA2B,CAAyB,CAAC,OAAO,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,oBAAoB;IACtB,CAAC;IAED,OAAO;QACL,OAAO;QACP,KAAK;QACL,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE;KACxD,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/compat/sentry.d.ts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2.3 W6.3 — Sentry-compatible API surface.
|
|
3
|
-
*
|
|
4
|
-
* Drop-in for code (or LLM-generated code) written against
|
|
5
|
-
* `@sentry/react-native`. Every Sentry call maps to exactly one
|
|
6
|
-
* Sentori-native call internally. Translation differences (e.g.
|
|
7
|
-
* `Sentry.setUser({ ip_address })` — Sentori never stores IP) fire
|
|
8
|
-
* a one-shot console hint at `info` level, deduplicated per
|
|
9
|
-
* (api, dropped_field).
|
|
10
|
-
*
|
|
11
|
-
* Why this exists: LLMs have seen a LOT of Sentry code; letting
|
|
12
|
-
* them write the same syntax against Sentori is one less thing
|
|
13
|
-
* Sentori asks the host to think about. Combined with the v2.3
|
|
14
|
-
* "free bonus" stance — host adds Sentori without unlearning
|
|
15
|
-
* anything.
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
*
|
|
19
|
-
* import * as Sentry from '@goliapkg/sentori-react-native/compat'
|
|
20
|
-
*
|
|
21
|
-
* Sentry.init({ dsn: 'https://<token>@<host>/<projectId>', ... })
|
|
22
|
-
* Sentry.captureException(err)
|
|
23
|
-
* Sentry.setUser({ id, email }) // email → linkBy.email (hashed)
|
|
24
|
-
*
|
|
25
|
-
* The compat layer holds NO state of its own — it's a thin shim
|
|
26
|
-
* over the same Sentori internals. Mixing `Sentry.*` and
|
|
27
|
-
* `sentori.*` calls in the same app works fine.
|
|
28
|
-
*
|
|
29
|
-
* See `docs/design/sdk-v2.3-redesign.md` §4 for the full
|
|
30
|
-
* translation table + design rationale.
|
|
31
|
-
*/
|
|
32
|
-
type SentryInitOpts = {
|
|
33
|
-
dsn: string;
|
|
34
|
-
environment?: string;
|
|
35
|
-
release?: string;
|
|
36
|
-
tracesSampleRate?: number;
|
|
37
|
-
sampleRate?: number;
|
|
38
|
-
attachStacktrace?: boolean;
|
|
39
|
-
autoSessionTracking?: boolean;
|
|
40
|
-
/** Sentry's `debug: true` ≈ Sentori's `logLevel: 'debug'`. */
|
|
41
|
-
debug?: boolean;
|
|
42
|
-
/** Catch-all for fields Sentori either ignores or doesn't map yet. */
|
|
43
|
-
[other: string]: unknown;
|
|
44
|
-
};
|
|
45
|
-
/** Exported for tests only — direct callers should use `Sentry.init`,
|
|
46
|
-
* which threads the parsed DSN through the rest of the init machinery. */
|
|
47
|
-
export declare const __parseDsnForTests: typeof parseDsn;
|
|
48
|
-
declare function parseDsn(dsn: string): {
|
|
49
|
-
token: string;
|
|
50
|
-
ingestUrl: string;
|
|
51
|
-
};
|
|
52
|
-
export declare function init(opts: SentryInitOpts): void;
|
|
53
|
-
/** Sentry's severity values, surfaced as strings (Sentori only
|
|
54
|
-
* uses 5 levels). `Log` and `Critical` collapse to `'info'` and
|
|
55
|
-
* `'fatal'` respectively. */
|
|
56
|
-
export declare const Severity: {
|
|
57
|
-
Fatal: "fatal";
|
|
58
|
-
Critical: "fatal";
|
|
59
|
-
Error: "error";
|
|
60
|
-
Warning: "warning";
|
|
61
|
-
Log: "info";
|
|
62
|
-
Info: "info";
|
|
63
|
-
Debug: "debug";
|
|
64
|
-
};
|
|
65
|
-
type SentryLevelString = 'critical' | 'debug' | 'error' | 'fatal' | 'info' | 'log' | 'warning';
|
|
66
|
-
type SentoriLevel = 'debug' | 'error' | 'fatal' | 'info' | 'warning';
|
|
67
|
-
declare function mapLevel(level: SentryLevelString | undefined): SentoriLevel | undefined;
|
|
68
|
-
type SentryCaptureContext = {
|
|
69
|
-
tags?: Record<string, string>;
|
|
70
|
-
extra?: Record<string, unknown>;
|
|
71
|
-
level?: SentryLevelString;
|
|
72
|
-
fingerprint?: string[];
|
|
73
|
-
user?: SentrySetUserInput;
|
|
74
|
-
};
|
|
75
|
-
export declare function captureException(err: unknown, hint?: {
|
|
76
|
-
captureContext?: SentryCaptureContext;
|
|
77
|
-
} | SentryCaptureContext): void;
|
|
78
|
-
export declare function captureMessage(msg: string, levelOrCtx?: SentryCaptureContext | SentryLevelString): void;
|
|
79
|
-
type SentrySetUserInput = {
|
|
80
|
-
id?: string;
|
|
81
|
-
email?: string;
|
|
82
|
-
username?: string;
|
|
83
|
-
ip_address?: string;
|
|
84
|
-
segment?: string;
|
|
85
|
-
[other: string]: unknown;
|
|
86
|
-
} | null;
|
|
87
|
-
export declare function setUser(user: SentrySetUserInput): void;
|
|
88
|
-
export declare const setTag: (key: string, value: string) => void;
|
|
89
|
-
export declare const setTags: (record: Record<string, string>) => void;
|
|
90
|
-
type SentryBreadcrumb = {
|
|
91
|
-
category?: string;
|
|
92
|
-
message?: string;
|
|
93
|
-
level?: SentryLevelString;
|
|
94
|
-
type?: 'default' | 'error' | 'http' | 'info' | 'navigation' | 'query' | 'user' | string;
|
|
95
|
-
data?: Record<string, unknown>;
|
|
96
|
-
timestamp?: number;
|
|
97
|
-
};
|
|
98
|
-
type SentoriBreadcrumbType = 'custom' | 'log' | 'nav' | 'net' | 'user';
|
|
99
|
-
/** Exported for tests only. */
|
|
100
|
-
export declare const __mapCategoryToTypeForTests: typeof mapCategoryToType;
|
|
101
|
-
export declare const __mapLevelForTests: typeof mapLevel;
|
|
102
|
-
declare function mapCategoryToType(category: string | undefined): SentoriBreadcrumbType | undefined;
|
|
103
|
-
export declare function addBreadcrumb(crumb: SentryBreadcrumb): void;
|
|
104
|
-
export { close, flush } from '../lifecycle';
|
|
105
|
-
type SentrySpanOpts = {
|
|
106
|
-
op?: string;
|
|
107
|
-
name?: string;
|
|
108
|
-
description?: string;
|
|
109
|
-
tags?: Record<string, string>;
|
|
110
|
-
};
|
|
111
|
-
export declare function startTransaction(opts: SentrySpanOpts): {
|
|
112
|
-
finish: (status?: 'cancelled' | 'error' | 'ok') => void;
|
|
113
|
-
setStatus: (status: 'cancelled' | 'error' | 'ok') => void;
|
|
114
|
-
setTag: (k: string, v: string) => void;
|
|
115
|
-
startChild: (childOpts: SentrySpanOpts) => unknown;
|
|
116
|
-
};
|
|
117
|
-
type ScopeProxy = {
|
|
118
|
-
setTag: (k: string, v: string) => void;
|
|
119
|
-
setTags: (rec: Record<string, string>) => void;
|
|
120
|
-
setUser: (u: SentrySetUserInput) => void;
|
|
121
|
-
setExtra: (k: string, v: unknown) => void;
|
|
122
|
-
setLevel: (l: SentryLevelString) => void;
|
|
123
|
-
};
|
|
124
|
-
export declare function withScope<T>(fn: (scope: ScopeProxy) => T): T;
|
|
125
|
-
export declare function configureScope(fn: (scope: ScopeProxy) => void): void;
|
|
126
|
-
//# sourceMappingURL=sentry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../src/compat/sentry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAyBH,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,8DAA8D;IAC9D,KAAK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