@debugkit/dashboard 0.7.0 → 0.8.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/dist/client/assets/_authed-CNObwuZh.js +7 -0
- package/dist/client/assets/_authed-CuP-He8G.js +1 -0
- package/dist/client/assets/{charts-XyOWJI9T.js → charts-CUvev8lV.js} +7 -7
- package/dist/client/assets/copy-button-ORgLIh59.js +1 -0
- package/dist/client/assets/customers-DTMEprFQ.js +1 -0
- package/dist/client/assets/endpoints-lMSO2CdM.js +1 -0
- package/dist/client/assets/events._eventId-bWag-i8J.js +3 -0
- package/dist/client/assets/index-BNpacHyi.js +10 -0
- package/dist/client/assets/invite._token-CxXek2SP.js +1 -0
- package/dist/client/assets/issues._fingerprint-BQr85TVY.js +1 -0
- package/dist/client/assets/login-Dlk3GyyC.js +1 -0
- package/dist/client/assets/sessions._sessionId-3wNImMqM.js +1 -0
- package/dist/client/assets/settings-CzbEYB7k.js +1 -0
- package/dist/client/assets/src-Dq5mIUf0.js +3 -0
- package/dist/client/assets/styles-DPsgRH7g.css +2 -0
- package/dist/client/assets/team-Bud2-07A.js +1 -0
- package/dist/client/assets/timeline-BSDhQPpY.js +1 -0
- package/dist/client/assets/ui-CEv2y56s.js +1 -0
- package/dist/server/assets/{_authed-CrjuC0O3.js → _authed-DkkRwdZl.js} +19 -5
- package/dist/server/assets/{_authed-C-sIPXSO.js → _authed-DsB8kjZB.js} +318 -126
- package/dist/server/assets/_tanstack-start-manifest_v-D1_ErrJK.js +97 -0
- package/dist/server/assets/copy-button-D3RddzTw.js +52 -0
- package/dist/server/assets/customers-CvSLt_xV.js +163 -0
- package/dist/server/assets/{demo-BsMMDk_F.js → demo-BRTkdmQJ.js} +25 -4
- package/dist/server/assets/{dynamodb-Zkk1-mgz.js → dynamodb-B0V3ZO20.js} +45 -17
- package/dist/server/assets/endpoints-mPQXpH8C.js +371 -0
- package/dist/server/assets/{queries-BJxX3Kjp.js → errors-C2KEDL7l.js} +842 -62
- package/dist/server/assets/events._eventId-pkQBQ9sL.js +765 -0
- package/dist/server/assets/{firestore-C52q_vwM.js → firestore-Jd-LeWZI.js} +15 -6
- package/dist/server/assets/fns-B3PHbFwV.js +1295 -0
- package/dist/server/assets/{fns-DwGaMi8S.js → fns-Di0vMpkQ.js} +25 -3
- package/dist/server/assets/{invite._token-xnpnkdRv.js → invite._token-LwWF5YxP.js} +3 -3
- package/dist/server/assets/{issues._fingerprint-e7ubdJf0.js → issues._fingerprint-DAA0QCuA.js} +89 -11
- package/dist/server/assets/{login-EopnOJXA.js → login-DqjCU4DJ.js} +3 -3
- package/dist/server/assets/{memory-BssaqdZm.js → memory-aqsrtEUn.js} +377 -26
- package/dist/server/assets/router-C0Dauj2C.js +510 -0
- package/dist/server/assets/sessions._sessionId-D7JPV0M4.js +264 -0
- package/dist/server/assets/{settings-CaJN69N6.js → settings-Drjd64d7.js} +165 -5
- package/dist/server/assets/{src-D83GYTrp.js → src-C4fNgijW.js} +1 -1
- package/dist/server/assets/{team-B1UcM1jA.js → team-D7iXYnSE.js} +3 -3
- package/dist/server/assets/timeline-MDRNDhiA.js +132 -0
- package/dist/server/assets/{ui-BJokJdYa.js → ui-B_XHlLUQ.js} +53 -13
- package/dist/server/server.js +37 -21
- package/package.json +4 -4
- package/dist/client/assets/_authed-BN39b-7H.js +0 -1
- package/dist/client/assets/_authed-CspAf0jN.js +0 -7
- package/dist/client/assets/index-Bfb2UOzB.js +0 -10
- package/dist/client/assets/invite._token-B4HN51-h.js +0 -1
- package/dist/client/assets/issues._fingerprint-BV1QrETY.js +0 -1
- package/dist/client/assets/login-COlvJ5Je.js +0 -1
- package/dist/client/assets/preload-helper-Dscj_TcA.js +0 -3
- package/dist/client/assets/settings-Dl4EWeWC.js +0 -1
- package/dist/client/assets/styles-DztngwT9.css +0 -2
- package/dist/client/assets/team-7Zekz_Er.js +0 -1
- package/dist/client/assets/ui-C0HGOza2.js +0 -1
- package/dist/server/assets/_tanstack-start-manifest_v-CqaE4wze.js +0 -61
- package/dist/server/assets/fns-mbUIXXep.js +0 -529
- package/dist/server/assets/router-G99085_Q.js +0 -315
|
@@ -1,25 +1,4 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
|
|
2
|
-
// ../../packages/adapters/src/rollups.ts
|
|
3
|
-
/** Merge increments with the same target so each batch does one write per row. */
|
|
4
|
-
function coalesceRollups(incs) {
|
|
5
|
-
const map = /* @__PURE__ */ new Map();
|
|
6
|
-
for (const i of incs) {
|
|
7
|
-
const id = rollupId(i);
|
|
8
|
-
const row = map.get(id) ?? {
|
|
9
|
-
app: i.app,
|
|
10
|
-
day: i.day,
|
|
11
|
-
dimension: i.dimension,
|
|
12
|
-
key: i.key,
|
|
13
|
-
errors: 0,
|
|
14
|
-
events: 0
|
|
15
|
-
};
|
|
16
|
-
if (i.kind === "error") row.errors += i.by;
|
|
17
|
-
else row.events += i.by;
|
|
18
|
-
map.set(id, row);
|
|
19
|
-
}
|
|
20
|
-
return [...map.values()];
|
|
21
|
-
}
|
|
22
|
-
var rollupId = (r) => `${r.day}__${r.dimension}__${encodeURIComponent(r.key)}`;
|
|
23
2
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
24
3
|
var util;
|
|
25
4
|
(function(util) {
|
|
@@ -3559,7 +3538,329 @@ ZodOptional.create;
|
|
|
3559
3538
|
ZodNullable.create;
|
|
3560
3539
|
ZodEffects.createWithPreprocess;
|
|
3561
3540
|
ZodPipeline.create;
|
|
3541
|
+
// ../../packages/schema/src/frames.ts
|
|
3542
|
+
/**
|
|
3543
|
+
* React Native ships one bundle, so a stack can't tell app code from library code by file. Hermes
|
|
3544
|
+
* keeps function names, though, so known library and runtime functions are recognised by name.
|
|
3545
|
+
*
|
|
3546
|
+
* Two lists:
|
|
3547
|
+
* - LIBRARY names are distinctive enough to be library code wherever they appear.
|
|
3548
|
+
* - LIBRARY_AT_TOP names could just as well be an app's own (`request`, `fetchQuery`, `settle`).
|
|
3549
|
+
* They count as library code only in the run of library frames at the top of the stack, i.e.
|
|
3550
|
+
* directly under one we already know is a library's. Lower down they're left as app code.
|
|
3551
|
+
*
|
|
3552
|
+
* Add names from real stacks; keep each list grouped by library.
|
|
3553
|
+
*/
|
|
3554
|
+
var LIBRARY = /* @__PURE__ */ new Set([
|
|
3555
|
+
"dispatchXhrRequest",
|
|
3556
|
+
"throwIfCancellationRequested",
|
|
3557
|
+
"AxiosError",
|
|
3558
|
+
"onloadend",
|
|
3559
|
+
"__didCompleteResponse",
|
|
3560
|
+
"__didReceiveResponse",
|
|
3561
|
+
"__didReceiveData",
|
|
3562
|
+
"setReadyState",
|
|
3563
|
+
"tryCallOne",
|
|
3564
|
+
"tryCallTwo",
|
|
3565
|
+
"doResolve",
|
|
3566
|
+
"handleResolved",
|
|
3567
|
+
"finale",
|
|
3568
|
+
"flushedQueue",
|
|
3569
|
+
"invokeCallbackAndReturnFlushedQueue",
|
|
3570
|
+
"callFunctionReturnFlushedQueue",
|
|
3571
|
+
"__callFunction",
|
|
3572
|
+
"__guard",
|
|
3573
|
+
"callTimers",
|
|
3574
|
+
"_callTimer",
|
|
3575
|
+
"_allocateCallback",
|
|
3576
|
+
"asyncGeneratorStep",
|
|
3577
|
+
"_asyncToGenerator",
|
|
3578
|
+
"_next",
|
|
3579
|
+
"_throw",
|
|
3580
|
+
"executeDispatch",
|
|
3581
|
+
"executeDispatchesInOrder",
|
|
3582
|
+
"processDispatchQueue",
|
|
3583
|
+
"dispatchEvent",
|
|
3584
|
+
"dispatchEventForPluginEventSystem",
|
|
3585
|
+
"batchedUpdatesImpl",
|
|
3586
|
+
"batchedUpdates$1",
|
|
3587
|
+
"batchedUpdates",
|
|
3588
|
+
"invokeGuardedCallbackImpl",
|
|
3589
|
+
"invokeGuardedCallback",
|
|
3590
|
+
"commitRootImpl",
|
|
3591
|
+
"performSyncWorkOnRoot",
|
|
3592
|
+
"renderWithHooks",
|
|
3593
|
+
"mountIndeterminateComponent",
|
|
3594
|
+
"beginWork",
|
|
3595
|
+
"flushPassiveEffects",
|
|
3596
|
+
"commitHookEffectListMount",
|
|
3597
|
+
"#executeFetch"
|
|
3598
|
+
]);
|
|
3599
|
+
var LIBRARY_AT_TOP = /* @__PURE__ */ new Set([
|
|
3600
|
+
"xhr",
|
|
3601
|
+
"_request",
|
|
3602
|
+
"request",
|
|
3603
|
+
"wrap",
|
|
3604
|
+
"dispatchRequest",
|
|
3605
|
+
"transformData",
|
|
3606
|
+
"settle",
|
|
3607
|
+
"createError",
|
|
3608
|
+
"handleLoad",
|
|
3609
|
+
"handleError",
|
|
3610
|
+
"handleTimeout",
|
|
3611
|
+
"step",
|
|
3612
|
+
"spawn",
|
|
3613
|
+
"send",
|
|
3614
|
+
"sendRequest",
|
|
3615
|
+
"fetch",
|
|
3616
|
+
"fetchFn",
|
|
3617
|
+
"fetchQuery",
|
|
3618
|
+
"executeMutation",
|
|
3619
|
+
"run",
|
|
3620
|
+
"start",
|
|
3621
|
+
"refetch",
|
|
3622
|
+
"onFetch"
|
|
3623
|
+
]);
|
|
3624
|
+
/** Hermes names async and generator bodies "?anon_0_name": the name is the function's own. */
|
|
3625
|
+
function cleanFnName(fn) {
|
|
3626
|
+
if (!fn) return fn;
|
|
3627
|
+
return fn.replace(/^\?anon_\d+_/, "");
|
|
3628
|
+
}
|
|
3629
|
+
/** A React Native bundle: "main.jsbundle", "index.android.bundle", or a Metro dev URL "…/index.bundle//&platform=ios". */
|
|
3630
|
+
var RN_BUNDLE = /\.(?:js)?bundle\b/;
|
|
3631
|
+
/**
|
|
3632
|
+
* Mark known library frames in a React Native bundle as not in-app. Frames outside a bundle (web,
|
|
3633
|
+
* Node) are left as they are: their file paths already say whether they're in node_modules.
|
|
3634
|
+
* Returns a new array; the input isn't changed. Never marks a frame in-app, so it's safe to run
|
|
3635
|
+
* again, e.g. after dropping a wrapper frame from the top.
|
|
3636
|
+
*/
|
|
3637
|
+
function markLibraryFrames(frames) {
|
|
3638
|
+
let underLibrary = false;
|
|
3639
|
+
let seenBundleFrame = false;
|
|
3640
|
+
return frames.map((f) => {
|
|
3641
|
+
if (!f.file || !RN_BUNDLE.test(f.file)) return f;
|
|
3642
|
+
const name = cleanFnName(f.fn);
|
|
3643
|
+
const library = !!name && (LIBRARY.has(name) || underLibrary && LIBRARY_AT_TOP.has(name));
|
|
3644
|
+
if (library) {
|
|
3645
|
+
if (!seenBundleFrame) underLibrary = true;
|
|
3646
|
+
} else if (f.inApp !== false) underLibrary = false;
|
|
3647
|
+
seenBundleFrame = true;
|
|
3648
|
+
return library && f.inApp !== false ? {
|
|
3649
|
+
...f,
|
|
3650
|
+
inApp: false
|
|
3651
|
+
} : f;
|
|
3652
|
+
});
|
|
3653
|
+
}
|
|
3654
|
+
// ../../packages/schema/src/taxonomy.ts
|
|
3655
|
+
var CATEGORY_INFO = {
|
|
3656
|
+
"network.never_sent": {
|
|
3657
|
+
name: "Request never sent",
|
|
3658
|
+
description: "The request failed on the phone before reaching the server, usually because the connection wasn't ready."
|
|
3659
|
+
},
|
|
3660
|
+
"network.timeout": {
|
|
3661
|
+
name: "Request timed out",
|
|
3662
|
+
description: "The request was sent but no answer came back in time: a slow network or a slow server."
|
|
3663
|
+
},
|
|
3664
|
+
"network.offline": {
|
|
3665
|
+
name: "Phone offline",
|
|
3666
|
+
description: "The phone had no internet connection when the request was made."
|
|
3667
|
+
},
|
|
3668
|
+
"network.failed": {
|
|
3669
|
+
name: "Connection failed",
|
|
3670
|
+
description: "The phone couldn't reach the server: the address didn't resolve, the secure connection failed or the server refused it."
|
|
3671
|
+
},
|
|
3672
|
+
server: {
|
|
3673
|
+
name: "Server error",
|
|
3674
|
+
description: "The server received the request and failed (5xx). The problem is on the server side."
|
|
3675
|
+
},
|
|
3676
|
+
client_request: {
|
|
3677
|
+
name: "Request rejected",
|
|
3678
|
+
description: "The server refused the request as invalid (4xx): the app sent something the server didn't accept."
|
|
3679
|
+
},
|
|
3680
|
+
auth: {
|
|
3681
|
+
name: "Sign-in problem",
|
|
3682
|
+
description: "The server refused the request because the user wasn't signed in or not allowed (401 or 403)."
|
|
3683
|
+
},
|
|
3684
|
+
crash: {
|
|
3685
|
+
name: "App crash",
|
|
3686
|
+
description: "An error nobody caught closed the app."
|
|
3687
|
+
},
|
|
3688
|
+
unhandled_rejection: {
|
|
3689
|
+
name: "Unhandled background error",
|
|
3690
|
+
description: "Background work failed and nothing handled it. The app kept running, but something may not have happened."
|
|
3691
|
+
},
|
|
3692
|
+
screen_crash: {
|
|
3693
|
+
name: "Screen crash",
|
|
3694
|
+
description: "A screen failed to draw and showed the error screen instead. The rest of the app kept working."
|
|
3695
|
+
},
|
|
3696
|
+
uncaught: {
|
|
3697
|
+
name: "Uncaught error",
|
|
3698
|
+
description: "An error nobody caught. The app kept running, but whatever the user was doing may have failed."
|
|
3699
|
+
},
|
|
3700
|
+
app_reported: {
|
|
3701
|
+
name: "Reported by the app",
|
|
3702
|
+
description: "The app caught this error itself and reported it."
|
|
3703
|
+
},
|
|
3704
|
+
other: {
|
|
3705
|
+
name: "Other",
|
|
3706
|
+
description: "An error that doesn't match any category yet."
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
var OWNERS = [
|
|
3710
|
+
"app",
|
|
3711
|
+
"backend",
|
|
3712
|
+
"infrastructure",
|
|
3713
|
+
"third_party",
|
|
3714
|
+
"unknown"
|
|
3715
|
+
];
|
|
3716
|
+
var OWNER_INFO = {
|
|
3717
|
+
app: {
|
|
3718
|
+
name: "App team",
|
|
3719
|
+
description: "The fix is in the app's code."
|
|
3720
|
+
},
|
|
3721
|
+
backend: {
|
|
3722
|
+
name: "Backend team",
|
|
3723
|
+
description: "The fix is in a server or API the team runs."
|
|
3724
|
+
},
|
|
3725
|
+
infrastructure: {
|
|
3726
|
+
name: "Infrastructure",
|
|
3727
|
+
description: "Hosting, gateways or the network between the app and the servers."
|
|
3728
|
+
},
|
|
3729
|
+
third_party: {
|
|
3730
|
+
name: "Third party",
|
|
3731
|
+
description: "A service or library the team doesn't own."
|
|
3732
|
+
},
|
|
3733
|
+
unknown: {
|
|
3734
|
+
name: "Unknown",
|
|
3735
|
+
description: "Not enough information to say yet."
|
|
3736
|
+
}
|
|
3737
|
+
};
|
|
3738
|
+
/** Worst first. */
|
|
3739
|
+
var IMPACTS = [
|
|
3740
|
+
"blocked",
|
|
3741
|
+
"degraded",
|
|
3742
|
+
"silent"
|
|
3743
|
+
];
|
|
3744
|
+
var IMPACT_INFO = {
|
|
3745
|
+
blocked: {
|
|
3746
|
+
name: "Blocked",
|
|
3747
|
+
description: "The user couldn't carry on: the app closed, or a key journey failed."
|
|
3748
|
+
},
|
|
3749
|
+
degraded: {
|
|
3750
|
+
name: "Degraded",
|
|
3751
|
+
description: "The user saw an error or missing information, but could carry on."
|
|
3752
|
+
},
|
|
3753
|
+
silent: {
|
|
3754
|
+
name: "Silent",
|
|
3755
|
+
description: "The user probably didn't notice: background work failed or recovered."
|
|
3756
|
+
}
|
|
3757
|
+
};
|
|
3758
|
+
Object.fromEntries(IMPACTS.map((impact, i) => [impact, IMPACTS.length - 1 - i]));
|
|
3759
|
+
var CAUSE_INFO = {
|
|
3760
|
+
resumed_from_background: {
|
|
3761
|
+
name: "Right after reopening the app",
|
|
3762
|
+
description: "It happened soon after the app came back to the foreground, and nothing had worked since: the phone hadn't reconnected."
|
|
3763
|
+
},
|
|
3764
|
+
burst: {
|
|
3765
|
+
name: "Several failures at once",
|
|
3766
|
+
description: "Other requests failed within the same few seconds, which points at the connection or a shared service, not one screen."
|
|
3767
|
+
},
|
|
3768
|
+
slow_network: {
|
|
3769
|
+
name: "Slow network",
|
|
3770
|
+
description: "Requests just before it were slow, so the connection was poor."
|
|
3771
|
+
},
|
|
3772
|
+
auth_expired: {
|
|
3773
|
+
name: "Sign-in expired",
|
|
3774
|
+
description: "The user's sign-in had run out, so the server stopped accepting requests."
|
|
3775
|
+
},
|
|
3776
|
+
new_in_release: {
|
|
3777
|
+
name: "New in this version",
|
|
3778
|
+
description: "It first appeared in the app's latest version, so a recent change probably caused it."
|
|
3779
|
+
},
|
|
3780
|
+
regressed: {
|
|
3781
|
+
name: "Came back",
|
|
3782
|
+
description: "It was marked fixed, then happened again in a version that should have the fix."
|
|
3783
|
+
},
|
|
3784
|
+
single_device: {
|
|
3785
|
+
name: "One device model",
|
|
3786
|
+
description: "Every occurrence is on the same device model, so it's probably specific to that phone."
|
|
3787
|
+
}
|
|
3788
|
+
};
|
|
3789
|
+
/** Split a URL into host (lowercase, no scheme or port), path, and query/hash. */
|
|
3790
|
+
function parts(s) {
|
|
3791
|
+
const bare = s.trim().replace(/^[a-z]+:\/\//i, "");
|
|
3792
|
+
const q = bare.search(/[?#]/);
|
|
3793
|
+
const [main, suffix] = q < 0 ? [bare, ""] : [bare.slice(0, q), bare.slice(q)];
|
|
3794
|
+
const cut = main.indexOf("/");
|
|
3795
|
+
return {
|
|
3796
|
+
host: (cut < 0 ? main : main.slice(0, cut)).toLowerCase().replace(/:\d+$/, ""),
|
|
3797
|
+
path: cut < 0 ? "" : main.slice(cut),
|
|
3798
|
+
suffix
|
|
3799
|
+
};
|
|
3800
|
+
}
|
|
3801
|
+
/** "https://API.example.com:443/v1/?x" → "api.example.com/v1". Lowercases the host only. */
|
|
3802
|
+
function normaliseHostMatch(s) {
|
|
3803
|
+
const { host, path } = parts(s);
|
|
3804
|
+
return host + path.replace(/\/+$/, "");
|
|
3805
|
+
}
|
|
3806
|
+
/** The entry for a URL, and the rest of the URL after the matched part ("", "/…" or "?…"). */
|
|
3807
|
+
function hostNameFor(url, hosts) {
|
|
3808
|
+
if (!hosts?.length || !url) return void 0;
|
|
3809
|
+
const { host, path, suffix } = parts(url);
|
|
3810
|
+
const u = host + path;
|
|
3811
|
+
let best;
|
|
3812
|
+
for (const h of hosts) {
|
|
3813
|
+
const m = h.match;
|
|
3814
|
+
if ((u === m || u.startsWith(m) && u[m.length] === "/") && (!best || m.length > best.match.length)) best = h;
|
|
3815
|
+
}
|
|
3816
|
+
return best ? {
|
|
3817
|
+
host: best,
|
|
3818
|
+
rest: u.slice(best.match.length) + suffix
|
|
3819
|
+
} : void 0;
|
|
3820
|
+
}
|
|
3821
|
+
/** "api.x/v1/me" → "Accounts · /v1/me". Unnamed URLs come back as they are. */
|
|
3822
|
+
function nameUrl(url, hosts) {
|
|
3823
|
+
const hit = hostNameFor(url, hosts);
|
|
3824
|
+
return hit ? `${hit.host.name}${hit.rest ? ` · ${hit.rest}` : ""}` : url;
|
|
3825
|
+
}
|
|
3826
|
+
/** A host as it appears in free text: a dotted name, optionally with a port and path. Not the domain of an email address. */
|
|
3827
|
+
var URL_IN_TEXT = /(?<![\w@.-])(?:[a-z]+:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:[/?#][^\s"'`)]*)?/gi;
|
|
3828
|
+
/** Name every URL in a title or message: "GET api.x/v1/me failed" → "GET Accounts · /v1/me failed". */
|
|
3829
|
+
function nameUrlsIn(text, hosts) {
|
|
3830
|
+
if (!hosts?.length) return text;
|
|
3831
|
+
return text.replace(URL_IN_TEXT, (u) => nameUrl(u, hosts));
|
|
3832
|
+
}
|
|
3833
|
+
/** Owners a host can be given: "unknown" is what leaving it unset means. */
|
|
3834
|
+
var OWNER_SET = new Set(OWNERS.filter((o) => o !== "unknown"));
|
|
3835
|
+
/** A dotted host name, optionally with a path. Ports are dropped by normaliseHostMatch. */
|
|
3836
|
+
var MATCH = /^(?:[a-z0-9-]+\.)+[a-z]{2,}(?:\/[^\s?#]*)?$/;
|
|
3837
|
+
/** Check host names from Settings. Returns the cleaned list, or what's wrong with it. */
|
|
3838
|
+
function validHostNames(x) {
|
|
3839
|
+
if (!Array.isArray(x)) return "hosts must be a list";
|
|
3840
|
+
if (x.length > 50) return `Up to 50 host names`;
|
|
3841
|
+
const out = [];
|
|
3842
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3843
|
+
for (const raw of x) {
|
|
3844
|
+
const r = raw ?? {};
|
|
3845
|
+
const match = typeof r.match === "string" ? normaliseHostMatch(r.match) : "";
|
|
3846
|
+
const name = typeof r.name === "string" ? r.name.trim() : "";
|
|
3847
|
+
if (!match && !name) continue;
|
|
3848
|
+
if (!match || match.length > 200 || !MATCH.test(match)) return `"${String(r.match ?? "")}" isn't a host name, like api.example.com or api.example.com/payments`;
|
|
3849
|
+
if (!name || name.length > 60) return `Give ${match} a name of up to 60 characters`;
|
|
3850
|
+
if (r.owner !== void 0 && r.owner !== "" && !OWNER_SET.has(String(r.owner))) return `Unknown owner "${String(r.owner)}"`;
|
|
3851
|
+
if (seen.has(match)) return `${match} is listed twice`;
|
|
3852
|
+
seen.add(match);
|
|
3853
|
+
out.push({
|
|
3854
|
+
match,
|
|
3855
|
+
name,
|
|
3856
|
+
...r.owner ? { owner: r.owner } : {}
|
|
3857
|
+
});
|
|
3858
|
+
}
|
|
3859
|
+
return out;
|
|
3860
|
+
}
|
|
3562
3861
|
// ../../packages/schema/src/core.ts
|
|
3862
|
+
/** The most of a failed call's captured body kept, in characters (16 KB). */
|
|
3863
|
+
var MAX_CAPTURED_BODY = 16384;
|
|
3563
3864
|
/** "2.10.0" sorts after "2.9.1"; pre-release and build suffixes compare as text. */
|
|
3564
3865
|
function compareVersions(a, b) {
|
|
3565
3866
|
const pa = a.split(/[.+-]/);
|
|
@@ -3638,9 +3939,9 @@ var NOT_IN_APP = [
|
|
|
3638
3939
|
* React Native ships one JS bundle, so every frame points at it: in development a Metro URL
|
|
3639
3940
|
* (".../entry.bundle//&platform=ios&dev=true..."), in release "address at index.android.bundle"
|
|
3640
3941
|
* or "main.jsbundle". We can't tell app code from library code without source maps, so bundle
|
|
3641
|
-
* frames count as in-app and the function name carries the signal
|
|
3942
|
+
* frames count as in-app and the function name carries the signal: known library functions are
|
|
3943
|
+
* marked by name (see ./frames).
|
|
3642
3944
|
*/
|
|
3643
|
-
var RN_BUNDLE = /\.(?:js)?bundle\b/;
|
|
3644
3945
|
function cleanFile(file) {
|
|
3645
3946
|
return file.replace(/^address at /, "");
|
|
3646
3947
|
}
|
|
@@ -3661,7 +3962,7 @@ function parseStack(stack) {
|
|
|
3661
3962
|
});
|
|
3662
3963
|
if (frames.length >= 100) break;
|
|
3663
3964
|
}
|
|
3664
|
-
return frames;
|
|
3965
|
+
return markLibraryFrames(frames);
|
|
3665
3966
|
}
|
|
3666
3967
|
// ../../packages/schema/src/index.ts
|
|
3667
3968
|
/** Dotted, lowercase identifier for a part of the app, e.g. "auth.login". */
|
|
@@ -3748,6 +4049,19 @@ var Breadcrumb = objectType({
|
|
|
3748
4049
|
nullType()
|
|
3749
4050
|
])).optional()
|
|
3750
4051
|
});
|
|
4052
|
+
/**
|
|
4053
|
+
* Captured bodies: the SDK cuts at MAX_CAPTURED_BODY and adds a marker; ingest cuts again here
|
|
4054
|
+
* rather than reject an event that came in longer.
|
|
4055
|
+
*/
|
|
4056
|
+
var CUT_MARKER = "…[truncated]";
|
|
4057
|
+
var CapturedText = stringType().transform((s) => s.length > 16448 ? `${s.slice(0, MAX_CAPTURED_BODY)}${CUT_MARKER}` : s);
|
|
4058
|
+
var CapturedHeaders = recordType(stringType().transform((s) => s.slice(0, 2e3))).optional().transform((h) => h ? Object.fromEntries(Object.entries(h).slice(0, 100)) : h);
|
|
4059
|
+
var CapturedBody = {
|
|
4060
|
+
body: CapturedText.optional(),
|
|
4061
|
+
/** The body's size before it was cut, in characters (bytes for a binary body). */
|
|
4062
|
+
bodySize: numberType().int().nonnegative().optional(),
|
|
4063
|
+
truncated: booleanType().optional()
|
|
4064
|
+
};
|
|
3751
4065
|
var StackFrame = objectType({
|
|
3752
4066
|
fn: stringType().optional(),
|
|
3753
4067
|
file: stringType().optional(),
|
|
@@ -3787,7 +4101,17 @@ var Event = discriminatedUnionType("type", [
|
|
|
3787
4101
|
/** Path without query string or fragment, ids replaced with :id, e.g. "/v1/orders/:id". */
|
|
3788
4102
|
url: stringType().max(500),
|
|
3789
4103
|
status: numberType().int().optional(),
|
|
3790
|
-
durationMs: numberType().optional()
|
|
4104
|
+
durationMs: numberType().optional(),
|
|
4105
|
+
/** Below: only with the SDK's `network.bodies`, already redacted on the device. */
|
|
4106
|
+
query: CapturedText.optional(),
|
|
4107
|
+
headers: CapturedHeaders,
|
|
4108
|
+
...CapturedBody
|
|
4109
|
+
}).optional(),
|
|
4110
|
+
/** The failed request's response, with `network.bodies` (absent when there was no answer). */
|
|
4111
|
+
response: objectType({
|
|
4112
|
+
status: numberType().int(),
|
|
4113
|
+
headers: CapturedHeaders,
|
|
4114
|
+
...CapturedBody
|
|
3791
4115
|
}).optional()
|
|
3792
4116
|
}),
|
|
3793
4117
|
EventBase.extend({
|
|
@@ -3840,6 +4164,27 @@ var Envelope = objectType({
|
|
|
3840
4164
|
}),
|
|
3841
4165
|
events: arrayType(Event).min(1).max(100)
|
|
3842
4166
|
});
|
|
4167
|
+
// ../../packages/adapters/src/rollups.ts
|
|
4168
|
+
/** Merge increments with the same target so each batch does one write per row. */
|
|
4169
|
+
function coalesceRollups(incs) {
|
|
4170
|
+
const map = /* @__PURE__ */ new Map();
|
|
4171
|
+
for (const i of incs) {
|
|
4172
|
+
const id = rollupId(i);
|
|
4173
|
+
const row = map.get(id) ?? {
|
|
4174
|
+
app: i.app,
|
|
4175
|
+
day: i.day,
|
|
4176
|
+
dimension: i.dimension,
|
|
4177
|
+
key: i.key,
|
|
4178
|
+
errors: 0,
|
|
4179
|
+
events: 0
|
|
4180
|
+
};
|
|
4181
|
+
if (i.kind === "error") row.errors += i.by;
|
|
4182
|
+
else row.events += i.by;
|
|
4183
|
+
map.set(id, row);
|
|
4184
|
+
}
|
|
4185
|
+
return [...map.values()];
|
|
4186
|
+
}
|
|
4187
|
+
var rollupId = (r) => `${r.day}__${r.dimension}__${encodeURIComponent(r.key)}`;
|
|
3843
4188
|
// ../../packages/adapters/src/memory.ts
|
|
3844
4189
|
var memory_exports = /* @__PURE__ */ __exportAll({ MemoryStore: () => MemoryStore });
|
|
3845
4190
|
/** In-process store for tests and the dashboard's demo mode. */
|
|
@@ -3997,8 +4342,14 @@ var MemoryStore = class {
|
|
|
3997
4342
|
async getRollups(app, dimension, fromDay, toDay) {
|
|
3998
4343
|
return [...this.rollups.values()].filter((r) => r.app === app && r.dimension === dimension && r.day >= fromDay && r.day <= toDay);
|
|
3999
4344
|
}
|
|
4345
|
+
async listSessionEvents(app, sessionId, { limit = 500 } = {}) {
|
|
4346
|
+
return this.events.filter((e) => e.app === app && e.sessionId === sessionId).sort((a, b) => a.event.ts.localeCompare(b.event.ts)).slice(-limit);
|
|
4347
|
+
}
|
|
4348
|
+
async listUserEvents(app, field, values, { limit = 500 } = {}) {
|
|
4349
|
+
return this.events.filter((e) => e.app === app && e.user?.[field] !== void 0 && values.includes(e.user[field])).sort((a, b) => b.event.ts.localeCompare(a.event.ts)).slice(0, limit);
|
|
4350
|
+
}
|
|
4000
4351
|
async listIssueEvents(app, fp, { limit = 50 } = {}) {
|
|
4001
4352
|
return this.events.filter((e) => e.app === app && e.fingerprint === fp).sort((a, b) => b.event.ts.localeCompare(a.event.ts)).slice(0, limit);
|
|
4002
4353
|
}
|
|
4003
4354
|
};
|
|
4004
|
-
export {
|
|
4355
|
+
export { cleanFnName as C, OWNER_INFO as S, validHostNames as _, Envelope as a, IMPACT_INFO as b, compareVersions as c, percentileMs as d, releaseKey as f, normaliseHostMatch as g, nameUrlsIn as h, rollupId as i, isRegression as l, hostNameFor as m, memory_exports as n, DEFAULT_SEVERITY_THRESHOLDS as o, severityFromCount as p, coalesceRollups as r, SEVERITY_ORDER as s, MemoryStore as t, parseStack as u, CATEGORY_INFO as v, markLibraryFrames as w, OWNERS as x, CAUSE_INFO as y };
|