@mushi-mushi/core 1.7.2 → 1.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/README.md +7 -0
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +97 -2
- package/dist/index.d.ts +97 -2
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ Core types, API client, and utilities for the Mushi Mushi SDK.
|
|
|
37
37
|
| `MushiSentryContext` | 1.0+ — rich Sentry handshake the SDK captures via `@sentry/browser` v7/v8/v9: `eventId`, `replayId`, `traceId`, `spanId`, `transaction`, `release`, `environment`, `user`, `tags`, `breadcrumbs`, `issueUrl`, `mushiReportId` (bidirectional). |
|
|
38
38
|
| `MushiCaptureExceptionOptions` | 1.0+ — options for `Mushi.captureException(err, opts)`: `level`, `tags`, `extras`, `category`, `userIntent` overrides for the structured report. |
|
|
39
39
|
| `NormalisedException` | 1.0+ — return type of `normaliseThrown(err)` (`{ name, message, stack?, cause? }`); used internally by `captureException` and exposed for adapters that want to ship their own thin wrappers. |
|
|
40
|
+
| `MushiBannerLink` | 1.8+ — flat action on the rich banner layout: `{ label, href? }` opens an external URL in a new tab, `{ label, featureRequest: true }` opens the widget in feature-request mode. Consumed via `MushiBannerConfig.links`. |
|
|
40
41
|
|
|
41
42
|
Constants: `MUSHI_INTERNAL_HEADER` (`'X-Mushi-Internal'`),
|
|
42
43
|
`MUSHI_INTERNAL_INIT_MARKER`, and the `MushiInternalRequestKind` literal union
|
|
@@ -63,3 +64,9 @@ This package is used internally by `@mushi-mushi/web` and `@mushi-mushi/react`.
|
|
|
63
64
|
## License
|
|
64
65
|
|
|
65
66
|
MIT
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<!-- mushi-readme-stats-footer -->
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
<sub>Monorepo scale (June 2026): 43 edge functions · 234 SQL migrations · 13 outbound plugins · 11 inbound adapters. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
|
package/dist/index.cjs
CHANGED
|
@@ -1037,6 +1037,26 @@ function generateToken() {
|
|
|
1037
1037
|
return `mushi_${hex}`;
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
|
+
// src/uuid.ts
|
|
1041
|
+
function newUuid() {
|
|
1042
|
+
const c = typeof crypto !== "undefined" ? crypto : void 0;
|
|
1043
|
+
if (c?.randomUUID) {
|
|
1044
|
+
return c.randomUUID();
|
|
1045
|
+
}
|
|
1046
|
+
const bytes = new Uint8Array(16);
|
|
1047
|
+
if (c?.getRandomValues) {
|
|
1048
|
+
c.getRandomValues(bytes);
|
|
1049
|
+
} else {
|
|
1050
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1051
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
1055
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
1056
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
1057
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1040
1060
|
// src/fingerprint.ts
|
|
1041
1061
|
var CACHE_KEY = "mushi_fingerprint_hash";
|
|
1042
1062
|
function collectInputs() {
|
|
@@ -1295,6 +1315,7 @@ exports.createRateLimiter = createRateLimiter;
|
|
|
1295
1315
|
exports.getDeviceFingerprintHash = getDeviceFingerprintHash;
|
|
1296
1316
|
exports.getReporterToken = getReporterToken;
|
|
1297
1317
|
exports.getSessionId = getSessionId;
|
|
1318
|
+
exports.newUuid = newUuid;
|
|
1298
1319
|
exports.noopLogger = noopLogger;
|
|
1299
1320
|
exports.normaliseThrown = normaliseThrown;
|
|
1300
1321
|
exports.resolveRegionEndpoint = resolveRegionEndpoint;
|