@mushi-mushi/core 1.6.0 → 1.7.2
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/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -3
- package/dist/index.d.ts +38 -3
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -47,9 +47,17 @@ interface MushiWidgetConfig {
|
|
|
47
47
|
zIndex?: number;
|
|
48
48
|
/**
|
|
49
49
|
* Controls how, or whether, the default trigger is injected.
|
|
50
|
-
* `auto`
|
|
50
|
+
* `auto` — historical floating stamp FAB.
|
|
51
|
+
* `banner` — slim full-width header strip (recommended default; less obtrusive
|
|
52
|
+
* than a FAB and visible even when the SDK launcher is `hide()`'d).
|
|
53
|
+
* Pair with `bannerConfig` to customise appearance.
|
|
51
54
|
*/
|
|
52
|
-
trigger?: 'auto' | 'edge-tab' | 'attach' | 'manual' | 'hidden';
|
|
55
|
+
trigger?: 'auto' | 'banner' | 'edge-tab' | 'attach' | 'manual' | 'hidden';
|
|
56
|
+
/**
|
|
57
|
+
* Configuration for the header-banner launcher mode.
|
|
58
|
+
* Only applies when `trigger === 'banner'`.
|
|
59
|
+
*/
|
|
60
|
+
bannerConfig?: MushiBannerConfig;
|
|
53
61
|
/** CSS selector used when `trigger` is `attach`. */
|
|
54
62
|
attachToSelector?: string;
|
|
55
63
|
/**
|
|
@@ -110,6 +118,33 @@ interface MushiWidgetConfig {
|
|
|
110
118
|
/** Minimum description character count before the submit button enables. */
|
|
111
119
|
minDescriptionLength?: number;
|
|
112
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Configuration for the `trigger: 'banner'` header-strip launcher.
|
|
123
|
+
*
|
|
124
|
+
* The banner renders as a slim, full-width strip pinned to the top of the
|
|
125
|
+
* viewport (or bottom if `position === 'bottom'`). It is styled to match the
|
|
126
|
+
* app's brand accent and dismissed per-session via a ✕ button.
|
|
127
|
+
*
|
|
128
|
+
* Variants
|
|
129
|
+
* --------
|
|
130
|
+
* `neon` — lime / electric-green strip (high contrast, dev / beta tool feel).
|
|
131
|
+
* `brand` — uses the Mushi vermillion accent (editorial, app-quality feel).
|
|
132
|
+
* `subtle` — near-invisible hairline with muted text (least disruptive).
|
|
133
|
+
*/
|
|
134
|
+
interface MushiBannerConfig {
|
|
135
|
+
/** Visual style of the banner strip. Defaults to `'brand'`. */
|
|
136
|
+
variant?: 'neon' | 'brand' | 'subtle';
|
|
137
|
+
/** 'top' pins the banner below any existing sticky headers; 'bottom' pins above bottom navs. Defaults to 'top'. */
|
|
138
|
+
position?: 'top' | 'bottom';
|
|
139
|
+
/** Override the call-to-action text in the banner. Defaults to 'Report a bug'. */
|
|
140
|
+
bugCta?: string;
|
|
141
|
+
/** Show a "✨ Request a feature" button alongside the bug button. Defaults to true. */
|
|
142
|
+
featureCta?: boolean;
|
|
143
|
+
/** Override the feature-request button label. */
|
|
144
|
+
featureCtaLabel?: string;
|
|
145
|
+
/** CSS z-index of the banner element. Defaults to the widget's configured zIndex. */
|
|
146
|
+
zIndex?: number;
|
|
147
|
+
}
|
|
113
148
|
interface MushiBetaModeConfig {
|
|
114
149
|
enabled?: boolean;
|
|
115
150
|
/** Display name of the app shown in the beta strip. Defaults to 'This app'. */
|
|
@@ -1367,4 +1402,4 @@ declare function createLogger(options: LoggerOptions): Logger;
|
|
|
1367
1402
|
*/
|
|
1368
1403
|
declare const noopLogger: Logger;
|
|
1369
1404
|
|
|
1370
|
-
export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, getDeviceFingerprintHash, getReporterToken, getSessionId, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
|
|
1405
|
+
export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBannerConfig, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, getDeviceFingerprintHash, getReporterToken, getSessionId, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
|
package/dist/index.d.ts
CHANGED
|
@@ -47,9 +47,17 @@ interface MushiWidgetConfig {
|
|
|
47
47
|
zIndex?: number;
|
|
48
48
|
/**
|
|
49
49
|
* Controls how, or whether, the default trigger is injected.
|
|
50
|
-
* `auto`
|
|
50
|
+
* `auto` — historical floating stamp FAB.
|
|
51
|
+
* `banner` — slim full-width header strip (recommended default; less obtrusive
|
|
52
|
+
* than a FAB and visible even when the SDK launcher is `hide()`'d).
|
|
53
|
+
* Pair with `bannerConfig` to customise appearance.
|
|
51
54
|
*/
|
|
52
|
-
trigger?: 'auto' | 'edge-tab' | 'attach' | 'manual' | 'hidden';
|
|
55
|
+
trigger?: 'auto' | 'banner' | 'edge-tab' | 'attach' | 'manual' | 'hidden';
|
|
56
|
+
/**
|
|
57
|
+
* Configuration for the header-banner launcher mode.
|
|
58
|
+
* Only applies when `trigger === 'banner'`.
|
|
59
|
+
*/
|
|
60
|
+
bannerConfig?: MushiBannerConfig;
|
|
53
61
|
/** CSS selector used when `trigger` is `attach`. */
|
|
54
62
|
attachToSelector?: string;
|
|
55
63
|
/**
|
|
@@ -110,6 +118,33 @@ interface MushiWidgetConfig {
|
|
|
110
118
|
/** Minimum description character count before the submit button enables. */
|
|
111
119
|
minDescriptionLength?: number;
|
|
112
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Configuration for the `trigger: 'banner'` header-strip launcher.
|
|
123
|
+
*
|
|
124
|
+
* The banner renders as a slim, full-width strip pinned to the top of the
|
|
125
|
+
* viewport (or bottom if `position === 'bottom'`). It is styled to match the
|
|
126
|
+
* app's brand accent and dismissed per-session via a ✕ button.
|
|
127
|
+
*
|
|
128
|
+
* Variants
|
|
129
|
+
* --------
|
|
130
|
+
* `neon` — lime / electric-green strip (high contrast, dev / beta tool feel).
|
|
131
|
+
* `brand` — uses the Mushi vermillion accent (editorial, app-quality feel).
|
|
132
|
+
* `subtle` — near-invisible hairline with muted text (least disruptive).
|
|
133
|
+
*/
|
|
134
|
+
interface MushiBannerConfig {
|
|
135
|
+
/** Visual style of the banner strip. Defaults to `'brand'`. */
|
|
136
|
+
variant?: 'neon' | 'brand' | 'subtle';
|
|
137
|
+
/** 'top' pins the banner below any existing sticky headers; 'bottom' pins above bottom navs. Defaults to 'top'. */
|
|
138
|
+
position?: 'top' | 'bottom';
|
|
139
|
+
/** Override the call-to-action text in the banner. Defaults to 'Report a bug'. */
|
|
140
|
+
bugCta?: string;
|
|
141
|
+
/** Show a "✨ Request a feature" button alongside the bug button. Defaults to true. */
|
|
142
|
+
featureCta?: boolean;
|
|
143
|
+
/** Override the feature-request button label. */
|
|
144
|
+
featureCtaLabel?: string;
|
|
145
|
+
/** CSS z-index of the banner element. Defaults to the widget's configured zIndex. */
|
|
146
|
+
zIndex?: number;
|
|
147
|
+
}
|
|
113
148
|
interface MushiBetaModeConfig {
|
|
114
149
|
enabled?: boolean;
|
|
115
150
|
/** Display name of the app shown in the beta strip. Defaults to 'This app'. */
|
|
@@ -1367,4 +1402,4 @@ declare function createLogger(options: LoggerOptions): Logger;
|
|
|
1367
1402
|
*/
|
|
1368
1403
|
declare const noopLogger: Logger;
|
|
1369
1404
|
|
|
1370
|
-
export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, getDeviceFingerprintHash, getReporterToken, getSessionId, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
|
|
1405
|
+
export { type ApiClientOptions, type BreadcrumbBuffer, type BreadcrumbBufferOptions, DEFAULT_API_ENDPOINT, type LogEntry, type LogFormat, type LogLevel, type Logger, type LoggerOptions, MUSHI_INTERNAL_HEADER, MUSHI_INTERNAL_INIT_MARKER, type MushiActivityEvent, type MushiApiCascadeConfig, type MushiApiClient, type MushiApiResponse, type MushiBannerConfig, type MushiBetaChangelogEntry, type MushiBetaModeConfig, type MushiBreadcrumb, type MushiCaptureConfig, type MushiCaptureEventInput, type MushiCaptureExceptionOptions, type MushiConfig, type MushiConsoleEntry, type MushiCooldownConfig, type MushiDiagnosticsResult, type MushiDiscoverInventoryConfig, type MushiDiscoveryEventPayload, type MushiEnvironment, type MushiEventHandler, type MushiEventType, type MushiIntegrationsConfig, type MushiInternalRequestKind, type MushiNetworkEntry, type MushiOfflineConfig, type MushiOnDeviceClassifier, type MushiOnDeviceClassifierInput, type MushiOnDeviceClassifierResult, type MushiPerformanceMetrics, type MushiPreFilterConfig, type MushiPreset, type MushiPrivacyConfig, type MushiProactiveConfig, type MushiRegion, type MushiReport, type MushiReportBuilder, type MushiReportCategory, type MushiReportStatus, type MushiReporterComment, type MushiReporterReport, type MushiReputationResult, type MushiRewardsConfig, type MushiRuntimeSdkConfig, type MushiSDKInstance, type MushiSdkVersionInfo, type MushiSelectedElement, type MushiSentryConfig, type MushiSentryContext, type MushiTierResult, type MushiTimelineEntry, type MushiTimelineKind, type MushiUrlMatcher, type MushiWidgetAnchor, type MushiWidgetConfig, type NormalisedException, type OfflineQueue, type PiiScrubberConfig, type PreFilterResult, REGION_ENDPOINTS, type RateLimiter, type RateLimiterConfig, captureEnvironment, createApiClient, createBreadcrumbBuffer, createLogger, createOfflineQueue, createPiiScrubber, createPreFilter, createRateLimiter, getDeviceFingerprintHash, getReporterToken, getSessionId, noopLogger, normaliseThrown, resolveRegionEndpoint, scrubPii };
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ function createApiClient(options) {
|
|
|
50
50
|
return {
|
|
51
51
|
ok: false,
|
|
52
52
|
error: {
|
|
53
|
-
code: `HTTP_${response.status}`,
|
|
53
|
+
code: errorBody.error?.code || `HTTP_${response.status}`,
|
|
54
54
|
message: errorBody.error?.message || errorBody.message || `HTTP ${response.status} error`
|
|
55
55
|
}
|
|
56
56
|
};
|
|
@@ -775,6 +775,17 @@ function createOfflineQueue(config = {}) {
|
|
|
775
775
|
}
|
|
776
776
|
sent++;
|
|
777
777
|
} else {
|
|
778
|
+
const permanent = result.error?.code === "HTTP_400" || result.error?.code === "HTTP_422" || result.error?.code === "INGEST_ERROR" || result.error?.code === "VALIDATION_ERROR" || typeof result.error?.message === "string" && /invalid payload|description must be at least|validation/i.test(
|
|
779
|
+
result.error.message
|
|
780
|
+
);
|
|
781
|
+
if (permanent) {
|
|
782
|
+
try {
|
|
783
|
+
if (backend === "indexeddb") await idbDelete(rowId);
|
|
784
|
+
else lsDelete(rowId);
|
|
785
|
+
} catch {
|
|
786
|
+
lsDelete(rowId);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
778
789
|
failed++;
|
|
779
790
|
if (i < batch.length - 1) {
|
|
780
791
|
await sleep2(getBackoffDelay2(i));
|