@scalebun/web 1.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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/bootstrap/FeatureRegistry.d.ts +44 -0
- package/dist/bootstrap/FeatureRegistry.d.ts.map +1 -0
- package/dist/bootstrap/FeatureRegistry.js +85 -0
- package/dist/bootstrap/FeatureRegistry.js.map +1 -0
- package/dist/bootstrap/SDKBootstrapper.d.ts +37 -0
- package/dist/bootstrap/SDKBootstrapper.d.ts.map +1 -0
- package/dist/bootstrap/SDKBootstrapper.js +248 -0
- package/dist/bootstrap/SDKBootstrapper.js.map +1 -0
- package/dist/browser.d.ts +51 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +81 -0
- package/dist/browser.js.map +1 -0
- package/dist/config/schema.d.ts +108 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +95 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/breadcrumbs.d.ts +56 -0
- package/dist/core/breadcrumbs.d.ts.map +1 -0
- package/dist/core/breadcrumbs.js +141 -0
- package/dist/core/breadcrumbs.js.map +1 -0
- package/dist/core/capabilities.d.ts +38 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/capabilities.js +78 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/consent.d.ts +17 -0
- package/dist/core/consent.d.ts.map +1 -0
- package/dist/core/consent.js +38 -0
- package/dist/core/consent.js.map +1 -0
- package/dist/core/csp.d.ts +31 -0
- package/dist/core/csp.d.ts.map +1 -0
- package/dist/core/csp.js +74 -0
- package/dist/core/csp.js.map +1 -0
- package/dist/core/evalContext.d.ts +7 -0
- package/dist/core/evalContext.d.ts.map +1 -0
- package/dist/core/evalContext.js +22 -0
- package/dist/core/evalContext.js.map +1 -0
- package/dist/core/ids.d.ts +6 -0
- package/dist/core/ids.d.ts.map +1 -0
- package/dist/core/ids.js +35 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lifecycle.d.ts +4 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +24 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/logger.d.ts +12 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +14 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/observe.d.ts +3 -0
- package/dist/core/observe.d.ts.map +1 -0
- package/dist/core/observe.js +22 -0
- package/dist/core/observe.js.map +1 -0
- package/dist/core/pageContext.d.ts +13 -0
- package/dist/core/pageContext.d.ts.map +1 -0
- package/dist/core/pageContext.js +73 -0
- package/dist/core/pageContext.js.map +1 -0
- package/dist/core/prune.d.ts +7 -0
- package/dist/core/prune.d.ts.map +1 -0
- package/dist/core/prune.js +31 -0
- package/dist/core/prune.js.map +1 -0
- package/dist/core/redact.d.ts +15 -0
- package/dist/core/redact.d.ts.map +1 -0
- package/dist/core/redact.js +50 -0
- package/dist/core/redact.js.map +1 -0
- package/dist/core/replayCoord.d.ts +22 -0
- package/dist/core/replayCoord.d.ts.map +1 -0
- package/dist/core/replayCoord.js +20 -0
- package/dist/core/replayCoord.js.map +1 -0
- package/dist/core/retry.d.ts +25 -0
- package/dist/core/retry.d.ts.map +1 -0
- package/dist/core/retry.js +44 -0
- package/dist/core/retry.js.map +1 -0
- package/dist/core/runtime.d.ts +28 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +67 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/scrollDepth.d.ts +48 -0
- package/dist/core/scrollDepth.d.ts.map +1 -0
- package/dist/core/scrollDepth.js +63 -0
- package/dist/core/scrollDepth.js.map +1 -0
- package/dist/debug/index.d.ts +6 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +2 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/features/analytics/AnalyticsFeature.d.ts +122 -0
- package/dist/features/analytics/AnalyticsFeature.d.ts.map +1 -0
- package/dist/features/analytics/AnalyticsFeature.js +757 -0
- package/dist/features/analytics/AnalyticsFeature.js.map +1 -0
- package/dist/features/analytics/autocapture.d.ts +13 -0
- package/dist/features/analytics/autocapture.d.ts.map +1 -0
- package/dist/features/analytics/autocapture.js +398 -0
- package/dist/features/analytics/autocapture.js.map +1 -0
- package/dist/features/analytics/governance.d.ts +15 -0
- package/dist/features/analytics/governance.d.ts.map +1 -0
- package/dist/features/analytics/governance.js +30 -0
- package/dist/features/analytics/governance.js.map +1 -0
- package/dist/features/analytics/revenue.d.ts +38 -0
- package/dist/features/analytics/revenue.d.ts.map +1 -0
- package/dist/features/analytics/revenue.js +26 -0
- package/dist/features/analytics/revenue.js.map +1 -0
- package/dist/features/analytics/sampler.d.ts +2 -0
- package/dist/features/analytics/sampler.d.ts.map +1 -0
- package/dist/features/analytics/sampler.js +24 -0
- package/dist/features/analytics/sampler.js.map +1 -0
- package/dist/features/analytics/subscription.d.ts +25 -0
- package/dist/features/analytics/subscription.d.ts.map +1 -0
- package/dist/features/analytics/subscription.js +51 -0
- package/dist/features/analytics/subscription.js.map +1 -0
- package/dist/features/attention/index.d.ts +29 -0
- package/dist/features/attention/index.d.ts.map +1 -0
- package/dist/features/attention/index.js +128 -0
- package/dist/features/attention/index.js.map +1 -0
- package/dist/features/bugreport/BugReportFeature.d.ts +36 -0
- package/dist/features/bugreport/BugReportFeature.d.ts.map +1 -0
- package/dist/features/bugreport/BugReportFeature.js +55 -0
- package/dist/features/bugreport/BugReportFeature.js.map +1 -0
- package/dist/features/bugreport/collect.d.ts +21 -0
- package/dist/features/bugreport/collect.d.ts.map +1 -0
- package/dist/features/bugreport/collect.js +27 -0
- package/dist/features/bugreport/collect.js.map +1 -0
- package/dist/features/bugreport/widget.d.ts +21 -0
- package/dist/features/bugreport/widget.d.ts.map +1 -0
- package/dist/features/bugreport/widget.js +111 -0
- package/dist/features/bugreport/widget.js.map +1 -0
- package/dist/features/coach/CoachmarkFeature.d.ts +78 -0
- package/dist/features/coach/CoachmarkFeature.d.ts.map +1 -0
- package/dist/features/coach/CoachmarkFeature.js +161 -0
- package/dist/features/coach/CoachmarkFeature.js.map +1 -0
- package/dist/features/coach/anchor.d.ts +32 -0
- package/dist/features/coach/anchor.d.ts.map +1 -0
- package/dist/features/coach/anchor.js +128 -0
- package/dist/features/coach/anchor.js.map +1 -0
- package/dist/features/coach/observers.d.ts +17 -0
- package/dist/features/coach/observers.d.ts.map +1 -0
- package/dist/features/coach/observers.js +49 -0
- package/dist/features/coach/observers.js.map +1 -0
- package/dist/features/coach/overlay.d.ts +15 -0
- package/dist/features/coach/overlay.d.ts.map +1 -0
- package/dist/features/coach/overlay.js +183 -0
- package/dist/features/coach/overlay.js.map +1 -0
- package/dist/features/coach/position.d.ts +9 -0
- package/dist/features/coach/position.d.ts.map +1 -0
- package/dist/features/coach/position.js +83 -0
- package/dist/features/coach/position.js.map +1 -0
- package/dist/features/coach/predicate.d.ts +10 -0
- package/dist/features/coach/predicate.d.ts.map +1 -0
- package/dist/features/coach/predicate.js +36 -0
- package/dist/features/coach/predicate.js.map +1 -0
- package/dist/features/coach/tour.d.ts +55 -0
- package/dist/features/coach/tour.d.ts.map +1 -0
- package/dist/features/coach/tour.js +181 -0
- package/dist/features/coach/tour.js.map +1 -0
- package/dist/features/coach/types.d.ts +161 -0
- package/dist/features/coach/types.d.ts.map +1 -0
- package/dist/features/coach/types.js +2 -0
- package/dist/features/coach/types.js.map +1 -0
- package/dist/features/coach/wait.d.ts +34 -0
- package/dist/features/coach/wait.d.ts.map +1 -0
- package/dist/features/coach/wait.js +107 -0
- package/dist/features/coach/wait.js.map +1 -0
- package/dist/features/config/ConfigFeature.d.ts +117 -0
- package/dist/features/config/ConfigFeature.d.ts.map +1 -0
- package/dist/features/config/ConfigFeature.js +437 -0
- package/dist/features/config/ConfigFeature.js.map +1 -0
- package/dist/features/config/bucketing.d.ts +20 -0
- package/dist/features/config/bucketing.d.ts.map +1 -0
- package/dist/features/config/bucketing.js +37 -0
- package/dist/features/config/bucketing.js.map +1 -0
- package/dist/features/config/configStore.d.ts +11 -0
- package/dist/features/config/configStore.d.ts.map +1 -0
- package/dist/features/config/configStore.js +66 -0
- package/dist/features/config/configStore.js.map +1 -0
- package/dist/features/config/targeting.d.ts +11 -0
- package/dist/features/config/targeting.d.ts.map +1 -0
- package/dist/features/config/targeting.js +57 -0
- package/dist/features/config/targeting.js.map +1 -0
- package/dist/features/config/types.d.ts +100 -0
- package/dist/features/config/types.d.ts.map +1 -0
- package/dist/features/config/types.js +9 -0
- package/dist/features/config/types.js.map +1 -0
- package/dist/features/console/ConsoleFeature.d.ts +31 -0
- package/dist/features/console/ConsoleFeature.d.ts.map +1 -0
- package/dist/features/console/ConsoleFeature.js +98 -0
- package/dist/features/console/ConsoleFeature.js.map +1 -0
- package/dist/features/console/normalize.d.ts +18 -0
- package/dist/features/console/normalize.d.ts.map +1 -0
- package/dist/features/console/normalize.js +64 -0
- package/dist/features/console/normalize.js.map +1 -0
- package/dist/features/console/serialize.d.ts +24 -0
- package/dist/features/console/serialize.d.ts.map +1 -0
- package/dist/features/console/serialize.js +99 -0
- package/dist/features/console/serialize.js.map +1 -0
- package/dist/features/console/throttle.d.ts +27 -0
- package/dist/features/console/throttle.d.ts.map +1 -0
- package/dist/features/console/throttle.js +37 -0
- package/dist/features/console/throttle.js.map +1 -0
- package/dist/features/crash/CrashFeature.d.ts +46 -0
- package/dist/features/crash/CrashFeature.d.ts.map +1 -0
- package/dist/features/crash/CrashFeature.js +173 -0
- package/dist/features/crash/CrashFeature.js.map +1 -0
- package/dist/features/crash/liveness.d.ts +30 -0
- package/dist/features/crash/liveness.d.ts.map +1 -0
- package/dist/features/crash/liveness.js +131 -0
- package/dist/features/crash/liveness.js.map +1 -0
- package/dist/features/engage/EngageFeature.d.ts +61 -0
- package/dist/features/engage/EngageFeature.d.ts.map +1 -0
- package/dist/features/engage/EngageFeature.js +221 -0
- package/dist/features/engage/EngageFeature.js.map +1 -0
- package/dist/features/engage/attachments.d.ts +24 -0
- package/dist/features/engage/attachments.d.ts.map +1 -0
- package/dist/features/engage/attachments.js +209 -0
- package/dist/features/engage/attachments.js.map +1 -0
- package/dist/features/engage/gameLogic.d.ts +60 -0
- package/dist/features/engage/gameLogic.d.ts.map +1 -0
- package/dist/features/engage/gameLogic.js +213 -0
- package/dist/features/engage/gameLogic.js.map +1 -0
- package/dist/features/engage/gameResolver.d.ts +35 -0
- package/dist/features/engage/gameResolver.d.ts.map +1 -0
- package/dist/features/engage/gameResolver.js +81 -0
- package/dist/features/engage/gameResolver.js.map +1 -0
- package/dist/features/engage/gameTypes.d.ts +76 -0
- package/dist/features/engage/gameTypes.d.ts.map +1 -0
- package/dist/features/engage/gameTypes.js +17 -0
- package/dist/features/engage/gameTypes.js.map +1 -0
- package/dist/features/engage/inappSlots.d.ts +39 -0
- package/dist/features/engage/inappSlots.d.ts.map +1 -0
- package/dist/features/engage/inappSlots.js +50 -0
- package/dist/features/engage/inappSlots.js.map +1 -0
- package/dist/features/engage/normalize.d.ts +11 -0
- package/dist/features/engage/normalize.d.ts.map +1 -0
- package/dist/features/engage/normalize.js +203 -0
- package/dist/features/engage/normalize.js.map +1 -0
- package/dist/features/engage/richInApp.d.ts +64 -0
- package/dist/features/engage/richInApp.d.ts.map +1 -0
- package/dist/features/engage/richInApp.js +1082 -0
- package/dist/features/engage/richInApp.js.map +1 -0
- package/dist/features/engage/runtime.d.ts +78 -0
- package/dist/features/engage/runtime.d.ts.map +1 -0
- package/dist/features/engage/runtime.js +349 -0
- package/dist/features/engage/runtime.js.map +1 -0
- package/dist/features/engage/shakeDetector.d.ts +6 -0
- package/dist/features/engage/shakeDetector.d.ts.map +1 -0
- package/dist/features/engage/shakeDetector.js +105 -0
- package/dist/features/engage/shakeDetector.js.map +1 -0
- package/dist/features/engage/theme.d.ts +129 -0
- package/dist/features/engage/theme.d.ts.map +1 -0
- package/dist/features/engage/theme.js +270 -0
- package/dist/features/engage/theme.js.map +1 -0
- package/dist/features/engage/throttle.d.ts +31 -0
- package/dist/features/engage/throttle.d.ts.map +1 -0
- package/dist/features/engage/throttle.js +130 -0
- package/dist/features/engage/throttle.js.map +1 -0
- package/dist/features/engage/transport.d.ts +62 -0
- package/dist/features/engage/transport.d.ts.map +1 -0
- package/dist/features/engage/transport.js +185 -0
- package/dist/features/engage/transport.js.map +1 -0
- package/dist/features/engage/triggerEngine.d.ts +39 -0
- package/dist/features/engage/triggerEngine.d.ts.map +1 -0
- package/dist/features/engage/triggerEngine.js +105 -0
- package/dist/features/engage/triggerEngine.js.map +1 -0
- package/dist/features/engage/types.d.ts +265 -0
- package/dist/features/engage/types.d.ts.map +1 -0
- package/dist/features/engage/types.js +3 -0
- package/dist/features/engage/types.js.map +1 -0
- package/dist/features/engage/widget/InAppWidget.d.ts +10 -0
- package/dist/features/engage/widget/InAppWidget.d.ts.map +1 -0
- package/dist/features/engage/widget/InAppWidget.js +136 -0
- package/dist/features/engage/widget/InAppWidget.js.map +1 -0
- package/dist/features/engage/widget/SurveyWidget.d.ts +11 -0
- package/dist/features/engage/widget/SurveyWidget.d.ts.map +1 -0
- package/dist/features/engage/widget/SurveyWidget.js +546 -0
- package/dist/features/engage/widget/SurveyWidget.js.map +1 -0
- package/dist/features/errors/ErrorsFeature.d.ts +62 -0
- package/dist/features/errors/ErrorsFeature.d.ts.map +1 -0
- package/dist/features/errors/ErrorsFeature.js +209 -0
- package/dist/features/errors/ErrorsFeature.js.map +1 -0
- package/dist/features/errors/causes.d.ts +15 -0
- package/dist/features/errors/causes.d.ts.map +1 -0
- package/dist/features/errors/causes.js +29 -0
- package/dist/features/errors/causes.js.map +1 -0
- package/dist/features/errors/dedup.d.ts +28 -0
- package/dist/features/errors/dedup.d.ts.map +1 -0
- package/dist/features/errors/dedup.js +42 -0
- package/dist/features/errors/dedup.js.map +1 -0
- package/dist/features/errors/group/fingerprint.d.ts +13 -0
- package/dist/features/errors/group/fingerprint.d.ts.map +1 -0
- package/dist/features/errors/group/fingerprint.js +45 -0
- package/dist/features/errors/group/fingerprint.js.map +1 -0
- package/dist/features/errors/lazy.d.ts +8 -0
- package/dist/features/errors/lazy.d.ts.map +1 -0
- package/dist/features/errors/lazy.js +8 -0
- package/dist/features/errors/lazy.js.map +1 -0
- package/dist/features/errors/normalize.d.ts +26 -0
- package/dist/features/errors/normalize.d.ts.map +1 -0
- package/dist/features/errors/normalize.js +58 -0
- package/dist/features/errors/normalize.js.map +1 -0
- package/dist/features/errors/parse/stacktrace.d.ts +13 -0
- package/dist/features/errors/parse/stacktrace.d.ts.map +1 -0
- package/dist/features/errors/parse/stacktrace.js +85 -0
- package/dist/features/errors/parse/stacktrace.js.map +1 -0
- package/dist/features/errors/redact.d.ts +7 -0
- package/dist/features/errors/redact.d.ts.map +1 -0
- package/dist/features/errors/redact.js +39 -0
- package/dist/features/errors/redact.js.map +1 -0
- package/dist/features/errors/sampling.d.ts +2 -0
- package/dist/features/errors/sampling.d.ts.map +1 -0
- package/dist/features/errors/sampling.js +24 -0
- package/dist/features/errors/sampling.js.map +1 -0
- package/dist/features/errors/scope.d.ts +26 -0
- package/dist/features/errors/scope.d.ts.map +1 -0
- package/dist/features/errors/scope.js +30 -0
- package/dist/features/errors/scope.js.map +1 -0
- package/dist/features/exit-intent/ExitIntentFeature.d.ts +16 -0
- package/dist/features/exit-intent/ExitIntentFeature.d.ts.map +1 -0
- package/dist/features/exit-intent/ExitIntentFeature.js +25 -0
- package/dist/features/exit-intent/ExitIntentFeature.js.map +1 -0
- package/dist/features/exit-intent/engine.d.ts +127 -0
- package/dist/features/exit-intent/engine.d.ts.map +1 -0
- package/dist/features/exit-intent/engine.js +227 -0
- package/dist/features/exit-intent/engine.js.map +1 -0
- package/dist/features/forms/index.d.ts +83 -0
- package/dist/features/forms/index.d.ts.map +1 -0
- package/dist/features/forms/index.js +405 -0
- package/dist/features/forms/index.js.map +1 -0
- package/dist/features/inapp/InApp2Feature.d.ts +24 -0
- package/dist/features/inapp/InApp2Feature.d.ts.map +1 -0
- package/dist/features/inapp/InApp2Feature.js +43 -0
- package/dist/features/inapp/InApp2Feature.js.map +1 -0
- package/dist/features/inapp/a11y/focus.d.ts +24 -0
- package/dist/features/inapp/a11y/focus.d.ts.map +1 -0
- package/dist/features/inapp/a11y/focus.js +112 -0
- package/dist/features/inapp/a11y/focus.js.map +1 -0
- package/dist/features/inapp/anchor/controller.d.ts +64 -0
- package/dist/features/inapp/anchor/controller.d.ts.map +1 -0
- package/dist/features/inapp/anchor/controller.js +155 -0
- package/dist/features/inapp/anchor/controller.js.map +1 -0
- package/dist/features/inapp/api.d.ts +28 -0
- package/dist/features/inapp/api.d.ts.map +1 -0
- package/dist/features/inapp/api.js +41 -0
- package/dist/features/inapp/api.js.map +1 -0
- package/dist/features/inapp/blocks/blocks.d.ts +65 -0
- package/dist/features/inapp/blocks/blocks.d.ts.map +1 -0
- package/dist/features/inapp/blocks/blocks.js +196 -0
- package/dist/features/inapp/blocks/blocks.js.map +1 -0
- package/dist/features/inapp/blocks/feedback.d.ts +13 -0
- package/dist/features/inapp/blocks/feedback.d.ts.map +1 -0
- package/dist/features/inapp/blocks/feedback.js +154 -0
- package/dist/features/inapp/blocks/feedback.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/carousel.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/carousel.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/carousel.js +67 -0
- package/dist/features/inapp/blocks/heavy/carousel.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/chart.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/chart.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/chart.js +83 -0
- package/dist/features/inapp/blocks/heavy/chart.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/code.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/code.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/code.js +47 -0
- package/dist/features/inapp/blocks/heavy/code.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/confetti.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/confetti.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/confetti.js +76 -0
- package/dist/features/inapp/blocks/heavy/confetti.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/countdown.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/countdown.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/countdown.js +59 -0
- package/dist/features/inapp/blocks/heavy/countdown.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/index.d.ts +11 -0
- package/dist/features/inapp/blocks/heavy/index.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/index.js +45 -0
- package/dist/features/inapp/blocks/heavy/index.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/markdown.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/markdown.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/markdown.js +76 -0
- package/dist/features/inapp/blocks/heavy/markdown.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/productgrid.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/productgrid.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/productgrid.js +46 -0
- package/dist/features/inapp/blocks/heavy/productgrid.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/qr.d.ts +10 -0
- package/dist/features/inapp/blocks/heavy/qr.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/qr.js +69 -0
- package/dist/features/inapp/blocks/heavy/qr.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/scratch.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/scratch.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/scratch.js +141 -0
- package/dist/features/inapp/blocks/heavy/scratch.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/slot.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/slot.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/slot.js +96 -0
- package/dist/features/inapp/blocks/heavy/slot.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.js +127 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/steps.d.ts +27 -0
- package/dist/features/inapp/blocks/heavy/steps.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/steps.js +127 -0
- package/dist/features/inapp/blocks/heavy/steps.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/streak.d.ts +18 -0
- package/dist/features/inapp/blocks/heavy/streak.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/streak.js +52 -0
- package/dist/features/inapp/blocks/heavy/streak.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/table.d.ts +7 -0
- package/dist/features/inapp/blocks/heavy/table.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/table.js +30 -0
- package/dist/features/inapp/blocks/heavy/table.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/unavailable.d.ts +28 -0
- package/dist/features/inapp/blocks/heavy/unavailable.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/unavailable.js +33 -0
- package/dist/features/inapp/blocks/heavy/unavailable.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/video.d.ts +7 -0
- package/dist/features/inapp/blocks/heavy/video.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/video.js +38 -0
- package/dist/features/inapp/blocks/heavy/video.js.map +1 -0
- package/dist/features/inapp/blocks/styles.d.ts +7 -0
- package/dist/features/inapp/blocks/styles.d.ts.map +1 -0
- package/dist/features/inapp/blocks/styles.js +198 -0
- package/dist/features/inapp/blocks/styles.js.map +1 -0
- package/dist/features/inapp/center/bridge.d.ts +12 -0
- package/dist/features/inapp/center/bridge.d.ts.map +1 -0
- package/dist/features/inapp/center/bridge.js +59 -0
- package/dist/features/inapp/center/bridge.js.map +1 -0
- package/dist/features/inapp/center/panel.d.ts +20 -0
- package/dist/features/inapp/center/panel.d.ts.map +1 -0
- package/dist/features/inapp/center/panel.js +194 -0
- package/dist/features/inapp/center/panel.js.map +1 -0
- package/dist/features/inapp/center/store.d.ts +50 -0
- package/dist/features/inapp/center/store.d.ts.map +1 -0
- package/dist/features/inapp/center/store.js +188 -0
- package/dist/features/inapp/center/store.js.map +1 -0
- package/dist/features/inapp/center/sync.d.ts +32 -0
- package/dist/features/inapp/center/sync.d.ts.map +1 -0
- package/dist/features/inapp/center/sync.js +60 -0
- package/dist/features/inapp/center/sync.js.map +1 -0
- package/dist/features/inapp/center/types.d.ts +46 -0
- package/dist/features/inapp/center/types.d.ts.map +1 -0
- package/dist/features/inapp/center/types.js +5 -0
- package/dist/features/inapp/center/types.js.map +1 -0
- package/dist/features/inapp/core/analytics.d.ts +35 -0
- package/dist/features/inapp/core/analytics.d.ts.map +1 -0
- package/dist/features/inapp/core/analytics.js +70 -0
- package/dist/features/inapp/core/analytics.js.map +1 -0
- package/dist/features/inapp/core/compat.d.ts +28 -0
- package/dist/features/inapp/core/compat.d.ts.map +1 -0
- package/dist/features/inapp/core/compat.js +104 -0
- package/dist/features/inapp/core/compat.js.map +1 -0
- package/dist/features/inapp/core/debugOverlay.d.ts +5 -0
- package/dist/features/inapp/core/debugOverlay.d.ts.map +1 -0
- package/dist/features/inapp/core/debugOverlay.js +79 -0
- package/dist/features/inapp/core/debugOverlay.js.map +1 -0
- package/dist/features/inapp/core/engine.d.ts +70 -0
- package/dist/features/inapp/core/engine.d.ts.map +1 -0
- package/dist/features/inapp/core/engine.js +248 -0
- package/dist/features/inapp/core/engine.js.map +1 -0
- package/dist/features/inapp/core/environment.d.ts +21 -0
- package/dist/features/inapp/core/environment.d.ts.map +1 -0
- package/dist/features/inapp/core/environment.js +57 -0
- package/dist/features/inapp/core/environment.js.map +1 -0
- package/dist/features/inapp/core/host.d.ts +53 -0
- package/dist/features/inapp/core/host.d.ts.map +1 -0
- package/dist/features/inapp/core/host.js +239 -0
- package/dist/features/inapp/core/host.js.map +1 -0
- package/dist/features/inapp/core/keyboard.d.ts +27 -0
- package/dist/features/inapp/core/keyboard.d.ts.map +1 -0
- package/dist/features/inapp/core/keyboard.js +69 -0
- package/dist/features/inapp/core/keyboard.js.map +1 -0
- package/dist/features/inapp/core/metrics.d.ts +73 -0
- package/dist/features/inapp/core/metrics.d.ts.map +1 -0
- package/dist/features/inapp/core/metrics.js +125 -0
- package/dist/features/inapp/core/metrics.js.map +1 -0
- package/dist/features/inapp/core/migration.d.ts +32 -0
- package/dist/features/inapp/core/migration.d.ts.map +1 -0
- package/dist/features/inapp/core/migration.js +28 -0
- package/dist/features/inapp/core/migration.js.map +1 -0
- package/dist/features/inapp/core/orchestrator.d.ts +77 -0
- package/dist/features/inapp/core/orchestrator.d.ts.map +1 -0
- package/dist/features/inapp/core/orchestrator.js +144 -0
- package/dist/features/inapp/core/orchestrator.js.map +1 -0
- package/dist/features/inapp/core/respect.d.ts +51 -0
- package/dist/features/inapp/core/respect.d.ts.map +1 -0
- package/dist/features/inapp/core/respect.js +78 -0
- package/dist/features/inapp/core/respect.js.map +1 -0
- package/dist/features/inapp/core/slots.d.ts +19 -0
- package/dist/features/inapp/core/slots.d.ts.map +1 -0
- package/dist/features/inapp/core/slots.js +53 -0
- package/dist/features/inapp/core/slots.js.map +1 -0
- package/dist/features/inapp/core/targeting.d.ts +58 -0
- package/dist/features/inapp/core/targeting.d.ts.map +1 -0
- package/dist/features/inapp/core/targeting.js +181 -0
- package/dist/features/inapp/core/targeting.js.map +1 -0
- package/dist/features/inapp/core/transport.d.ts +66 -0
- package/dist/features/inapp/core/transport.d.ts.map +1 -0
- package/dist/features/inapp/core/transport.js +154 -0
- package/dist/features/inapp/core/transport.js.map +1 -0
- package/dist/features/inapp/core/triggers.d.ts +94 -0
- package/dist/features/inapp/core/triggers.d.ts.map +1 -0
- package/dist/features/inapp/core/triggers.js +368 -0
- package/dist/features/inapp/core/triggers.js.map +1 -0
- package/dist/features/inapp/inappContract.web.d.ts +47 -0
- package/dist/features/inapp/inappContract.web.d.ts.map +1 -0
- package/dist/features/inapp/inappContract.web.js +219 -0
- package/dist/features/inapp/inappContract.web.js.map +1 -0
- package/dist/features/inapp/index.d.ts +23 -0
- package/dist/features/inapp/index.d.ts.map +1 -0
- package/dist/features/inapp/index.js +23 -0
- package/dist/features/inapp/index.js.map +1 -0
- package/dist/features/inapp/registry.canonical.hash.d.ts +7 -0
- package/dist/features/inapp/registry.canonical.hash.d.ts.map +1 -0
- package/dist/features/inapp/registry.canonical.hash.js +7 -0
- package/dist/features/inapp/registry.canonical.hash.js.map +1 -0
- package/dist/features/inapp/registry.web.canonical.d.ts +21 -0
- package/dist/features/inapp/registry.web.canonical.d.ts.map +1 -0
- package/dist/features/inapp/registry.web.canonical.js +136 -0
- package/dist/features/inapp/registry.web.canonical.js.map +1 -0
- package/dist/features/inapp/registry.web.catalog.d.ts +12 -0
- package/dist/features/inapp/registry.web.catalog.d.ts.map +1 -0
- package/dist/features/inapp/registry.web.catalog.js +208 -0
- package/dist/features/inapp/registry.web.catalog.js.map +1 -0
- package/dist/features/inapp/surfaces/banner.d.ts +7 -0
- package/dist/features/inapp/surfaces/banner.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/banner.js +30 -0
- package/dist/features/inapp/surfaces/banner.js.map +1 -0
- package/dist/features/inapp/surfaces/checklist.d.ts +13 -0
- package/dist/features/inapp/surfaces/checklist.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/checklist.js +127 -0
- package/dist/features/inapp/surfaces/checklist.js.map +1 -0
- package/dist/features/inapp/surfaces/coachmark.d.ts +10 -0
- package/dist/features/inapp/surfaces/coachmark.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/coachmark.js +92 -0
- package/dist/features/inapp/surfaces/coachmark.js.map +1 -0
- package/dist/features/inapp/surfaces/hotspot.d.ts +8 -0
- package/dist/features/inapp/surfaces/hotspot.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/hotspot.js +88 -0
- package/dist/features/inapp/surfaces/hotspot.js.map +1 -0
- package/dist/features/inapp/surfaces/inline.d.ts +13 -0
- package/dist/features/inapp/surfaces/inline.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/inline.js +72 -0
- package/dist/features/inapp/surfaces/inline.js.map +1 -0
- package/dist/features/inapp/surfaces/launcher.d.ts +9 -0
- package/dist/features/inapp/surfaces/launcher.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/launcher.js +54 -0
- package/dist/features/inapp/surfaces/launcher.js.map +1 -0
- package/dist/features/inapp/surfaces/modal.d.ts +8 -0
- package/dist/features/inapp/surfaces/modal.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/modal.js +70 -0
- package/dist/features/inapp/surfaces/modal.js.map +1 -0
- package/dist/features/inapp/surfaces/mount.d.ts +19 -0
- package/dist/features/inapp/surfaces/mount.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/mount.js +29 -0
- package/dist/features/inapp/surfaces/mount.js.map +1 -0
- package/dist/features/inapp/surfaces/palette.d.ts +9 -0
- package/dist/features/inapp/surfaces/palette.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/palette.js +127 -0
- package/dist/features/inapp/surfaces/palette.js.map +1 -0
- package/dist/features/inapp/surfaces/panel.d.ts +14 -0
- package/dist/features/inapp/surfaces/panel.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/panel.js +91 -0
- package/dist/features/inapp/surfaces/panel.js.map +1 -0
- package/dist/features/inapp/surfaces/popover.d.ts +10 -0
- package/dist/features/inapp/surfaces/popover.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/popover.js +66 -0
- package/dist/features/inapp/surfaces/popover.js.map +1 -0
- package/dist/features/inapp/surfaces/render.d.ts +34 -0
- package/dist/features/inapp/surfaces/render.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/render.js +52 -0
- package/dist/features/inapp/surfaces/render.js.map +1 -0
- package/dist/features/inapp/surfaces/slideover.d.ts +9 -0
- package/dist/features/inapp/surfaces/slideover.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/slideover.js +144 -0
- package/dist/features/inapp/surfaces/slideover.js.map +1 -0
- package/dist/features/inapp/surfaces/styles.d.ts +7 -0
- package/dist/features/inapp/surfaces/styles.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/styles.js +186 -0
- package/dist/features/inapp/surfaces/styles.js.map +1 -0
- package/dist/features/inapp/surfaces/surface.d.ts +69 -0
- package/dist/features/inapp/surfaces/surface.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/surface.js +80 -0
- package/dist/features/inapp/surfaces/surface.js.map +1 -0
- package/dist/features/inapp/surfaces/takeover.d.ts +9 -0
- package/dist/features/inapp/surfaces/takeover.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/takeover.js +60 -0
- package/dist/features/inapp/surfaces/takeover.js.map +1 -0
- package/dist/features/inapp/surfaces/toast.d.ts +7 -0
- package/dist/features/inapp/surfaces/toast.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/toast.js +48 -0
- package/dist/features/inapp/surfaces/toast.js.map +1 -0
- package/dist/features/inapp/surfaces/toolbar.d.ts +8 -0
- package/dist/features/inapp/surfaces/toolbar.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/toolbar.js +62 -0
- package/dist/features/inapp/surfaces/toolbar.js.map +1 -0
- package/dist/features/inapp/surfaces/tour.d.ts +14 -0
- package/dist/features/inapp/surfaces/tour.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/tour.js +199 -0
- package/dist/features/inapp/surfaces/tour.js.map +1 -0
- package/dist/features/inapp/types.d.ts +163 -0
- package/dist/features/inapp/types.d.ts.map +1 -0
- package/dist/features/inapp/types.js +12 -0
- package/dist/features/inapp/types.js.map +1 -0
- package/dist/features/inbox/InboxFeature.d.ts +57 -0
- package/dist/features/inbox/InboxFeature.d.ts.map +1 -0
- package/dist/features/inbox/InboxFeature.js +225 -0
- package/dist/features/inbox/InboxFeature.js.map +1 -0
- package/dist/features/inbox/runtime.d.ts +67 -0
- package/dist/features/inbox/runtime.d.ts.map +1 -0
- package/dist/features/inbox/runtime.js +376 -0
- package/dist/features/inbox/runtime.js.map +1 -0
- package/dist/features/inbox/store.d.ts +37 -0
- package/dist/features/inbox/store.d.ts.map +1 -0
- package/dist/features/inbox/store.js +149 -0
- package/dist/features/inbox/store.js.map +1 -0
- package/dist/features/inbox/sync.d.ts +49 -0
- package/dist/features/inbox/sync.d.ts.map +1 -0
- package/dist/features/inbox/sync.js +131 -0
- package/dist/features/inbox/sync.js.map +1 -0
- package/dist/features/inbox/types.d.ts +275 -0
- package/dist/features/inbox/types.d.ts.map +1 -0
- package/dist/features/inbox/types.js +42 -0
- package/dist/features/inbox/types.js.map +1 -0
- package/dist/features/inbox/widget/InboxWidget.d.ts +16 -0
- package/dist/features/inbox/widget/InboxWidget.d.ts.map +1 -0
- package/dist/features/inbox/widget/InboxWidget.js +608 -0
- package/dist/features/inbox/widget/InboxWidget.js.map +1 -0
- package/dist/features/index.d.ts +21 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +2 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/journey/InteractionTracker.d.ts +34 -0
- package/dist/features/journey/InteractionTracker.d.ts.map +1 -0
- package/dist/features/journey/InteractionTracker.js +125 -0
- package/dist/features/journey/InteractionTracker.js.map +1 -0
- package/dist/features/journey/JourneyFeature.d.ts +18 -0
- package/dist/features/journey/JourneyFeature.d.ts.map +1 -0
- package/dist/features/journey/JourneyFeature.js +57 -0
- package/dist/features/journey/JourneyFeature.js.map +1 -0
- package/dist/features/journey/NavigationTracker.d.ts +16 -0
- package/dist/features/journey/NavigationTracker.d.ts.map +1 -0
- package/dist/features/journey/NavigationTracker.js +92 -0
- package/dist/features/journey/NavigationTracker.js.map +1 -0
- package/dist/features/journey/friction.d.ts +29 -0
- package/dist/features/journey/friction.d.ts.map +1 -0
- package/dist/features/journey/friction.js +65 -0
- package/dist/features/journey/friction.js.map +1 -0
- package/dist/features/manifest.d.ts +20 -0
- package/dist/features/manifest.d.ts.map +1 -0
- package/dist/features/manifest.js +76 -0
- package/dist/features/manifest.js.map +1 -0
- package/dist/features/network/NetworkFeature.d.ts +56 -0
- package/dist/features/network/NetworkFeature.d.ts.map +1 -0
- package/dist/features/network/NetworkFeature.js +235 -0
- package/dist/features/network/NetworkFeature.js.map +1 -0
- package/dist/features/network/capture/body.d.ts +31 -0
- package/dist/features/network/capture/body.d.ts.map +1 -0
- package/dist/features/network/capture/body.js +81 -0
- package/dist/features/network/capture/body.js.map +1 -0
- package/dist/features/network/classify.d.ts +21 -0
- package/dist/features/network/classify.d.ts.map +1 -0
- package/dist/features/network/classify.js +50 -0
- package/dist/features/network/classify.js.map +1 -0
- package/dist/features/network/dedup.d.ts +36 -0
- package/dist/features/network/dedup.d.ts.map +1 -0
- package/dist/features/network/dedup.js +68 -0
- package/dist/features/network/dedup.js.map +1 -0
- package/dist/features/network/fetchInterceptor.d.ts +20 -0
- package/dist/features/network/fetchInterceptor.d.ts.map +1 -0
- package/dist/features/network/fetchInterceptor.js +158 -0
- package/dist/features/network/fetchInterceptor.js.map +1 -0
- package/dist/features/network/intercept/beacon.d.ts +14 -0
- package/dist/features/network/intercept/beacon.d.ts.map +1 -0
- package/dist/features/network/intercept/beacon.js +56 -0
- package/dist/features/network/intercept/beacon.js.map +1 -0
- package/dist/features/network/intercept/sse.d.ts +16 -0
- package/dist/features/network/intercept/sse.d.ts.map +1 -0
- package/dist/features/network/intercept/sse.js +74 -0
- package/dist/features/network/intercept/sse.js.map +1 -0
- package/dist/features/network/intercept/streams.d.ts +23 -0
- package/dist/features/network/intercept/streams.d.ts.map +1 -0
- package/dist/features/network/intercept/streams.js +25 -0
- package/dist/features/network/intercept/streams.js.map +1 -0
- package/dist/features/network/intercept/websocket.d.ts +14 -0
- package/dist/features/network/intercept/websocket.d.ts.map +1 -0
- package/dist/features/network/intercept/websocket.js +97 -0
- package/dist/features/network/intercept/websocket.js.map +1 -0
- package/dist/features/network/lazy.d.ts +23 -0
- package/dist/features/network/lazy.d.ts.map +1 -0
- package/dist/features/network/lazy.js +65 -0
- package/dist/features/network/lazy.js.map +1 -0
- package/dist/features/network/normalize.d.ts +9 -0
- package/dist/features/network/normalize.d.ts.map +1 -0
- package/dist/features/network/normalize.js +49 -0
- package/dist/features/network/normalize.js.map +1 -0
- package/dist/features/network/parse/graphql.d.ts +17 -0
- package/dist/features/network/parse/graphql.d.ts.map +1 -0
- package/dist/features/network/parse/graphql.js +106 -0
- package/dist/features/network/parse/graphql.js.map +1 -0
- package/dist/features/network/parse/url.d.ts +12 -0
- package/dist/features/network/parse/url.d.ts.map +1 -0
- package/dist/features/network/parse/url.js +52 -0
- package/dist/features/network/parse/url.js.map +1 -0
- package/dist/features/network/sampler.d.ts +21 -0
- package/dist/features/network/sampler.d.ts.map +1 -0
- package/dist/features/network/sampler.js +25 -0
- package/dist/features/network/sampler.js.map +1 -0
- package/dist/features/network/size.d.ts +21 -0
- package/dist/features/network/size.d.ts.map +1 -0
- package/dist/features/network/size.js +63 -0
- package/dist/features/network/size.js.map +1 -0
- package/dist/features/network/timing.d.ts +41 -0
- package/dist/features/network/timing.d.ts.map +1 -0
- package/dist/features/network/timing.js +134 -0
- package/dist/features/network/timing.js.map +1 -0
- package/dist/features/network/tracing.d.ts +18 -0
- package/dist/features/network/tracing.d.ts.map +1 -0
- package/dist/features/network/tracing.js +46 -0
- package/dist/features/network/tracing.js.map +1 -0
- package/dist/features/network/types.d.ts +75 -0
- package/dist/features/network/types.d.ts.map +1 -0
- package/dist/features/network/types.js +2 -0
- package/dist/features/network/types.js.map +1 -0
- package/dist/features/network/xhrInterceptor.d.ts +12 -0
- package/dist/features/network/xhrInterceptor.d.ts.map +1 -0
- package/dist/features/network/xhrInterceptor.js +108 -0
- package/dist/features/network/xhrInterceptor.js.map +1 -0
- package/dist/features/performance/PerformanceFeature.d.ts +76 -0
- package/dist/features/performance/PerformanceFeature.d.ts.map +1 -0
- package/dist/features/performance/PerformanceFeature.js +265 -0
- package/dist/features/performance/PerformanceFeature.js.map +1 -0
- package/dist/features/performance/jankTap.d.ts +23 -0
- package/dist/features/performance/jankTap.d.ts.map +1 -0
- package/dist/features/performance/jankTap.js +20 -0
- package/dist/features/performance/jankTap.js.map +1 -0
- package/dist/features/performance/longTasks.d.ts +14 -0
- package/dist/features/performance/longTasks.d.ts.map +1 -0
- package/dist/features/performance/longTasks.js +55 -0
- package/dist/features/performance/longTasks.js.map +1 -0
- package/dist/features/performance/normalize.d.ts +15 -0
- package/dist/features/performance/normalize.d.ts.map +1 -0
- package/dist/features/performance/normalize.js +30 -0
- package/dist/features/performance/normalize.js.map +1 -0
- package/dist/features/performance/resources.d.ts +19 -0
- package/dist/features/performance/resources.d.ts.map +1 -0
- package/dist/features/performance/resources.js +78 -0
- package/dist/features/performance/resources.js.map +1 -0
- package/dist/features/performance/sampler.d.ts +10 -0
- package/dist/features/performance/sampler.d.ts.map +1 -0
- package/dist/features/performance/sampler.js +23 -0
- package/dist/features/performance/sampler.js.map +1 -0
- package/dist/features/performance/spa.d.ts +2 -0
- package/dist/features/performance/spa.d.ts.map +1 -0
- package/dist/features/performance/spa.js +40 -0
- package/dist/features/performance/spa.js.map +1 -0
- package/dist/features/performance/throttle.d.ts +21 -0
- package/dist/features/performance/throttle.d.ts.map +1 -0
- package/dist/features/performance/throttle.js +26 -0
- package/dist/features/performance/throttle.js.map +1 -0
- package/dist/features/performance/trace/context.d.ts +17 -0
- package/dist/features/performance/trace/context.d.ts.map +1 -0
- package/dist/features/performance/trace/context.js +33 -0
- package/dist/features/performance/trace/context.js.map +1 -0
- package/dist/features/performance/trace/index.d.ts +7 -0
- package/dist/features/performance/trace/index.d.ts.map +1 -0
- package/dist/features/performance/trace/index.js +6 -0
- package/dist/features/performance/trace/index.js.map +1 -0
- package/dist/features/performance/trace/pageload.d.ts +3 -0
- package/dist/features/performance/trace/pageload.d.ts.map +1 -0
- package/dist/features/performance/trace/pageload.js +34 -0
- package/dist/features/performance/trace/pageload.js.map +1 -0
- package/dist/features/performance/trace/transaction.d.ts +61 -0
- package/dist/features/performance/trace/transaction.d.ts.map +1 -0
- package/dist/features/performance/trace/transaction.js +90 -0
- package/dist/features/performance/trace/transaction.js.map +1 -0
- package/dist/features/performance/trace/types.d.ts +23 -0
- package/dist/features/performance/trace/types.d.ts.map +1 -0
- package/dist/features/performance/trace/types.js +10 -0
- package/dist/features/performance/trace/types.js.map +1 -0
- package/dist/features/performance/traces.d.ts +36 -0
- package/dist/features/performance/traces.d.ts.map +1 -0
- package/dist/features/performance/traces.js +50 -0
- package/dist/features/performance/traces.js.map +1 -0
- package/dist/features/profiler/ProfilerFeature.d.ts +28 -0
- package/dist/features/profiler/ProfilerFeature.d.ts.map +1 -0
- package/dist/features/profiler/ProfilerFeature.js +82 -0
- package/dist/features/profiler/ProfilerFeature.js.map +1 -0
- package/dist/features/profiler/capture.d.ts +8 -0
- package/dist/features/profiler/capture.d.ts.map +1 -0
- package/dist/features/profiler/capture.js +21 -0
- package/dist/features/profiler/capture.js.map +1 -0
- package/dist/features/push/PushFeature.d.ts +120 -0
- package/dist/features/push/PushFeature.d.ts.map +1 -0
- package/dist/features/push/PushFeature.js +319 -0
- package/dist/features/push/PushFeature.js.map +1 -0
- package/dist/features/push/diagnostics.d.ts +55 -0
- package/dist/features/push/diagnostics.d.ts.map +1 -0
- package/dist/features/push/diagnostics.js +383 -0
- package/dist/features/push/diagnostics.js.map +1 -0
- package/dist/features/push/pushState.d.ts +58 -0
- package/dist/features/push/pushState.d.ts.map +1 -0
- package/dist/features/push/pushState.js +75 -0
- package/dist/features/push/pushState.js.map +1 -0
- package/dist/features/push/softAsk.d.ts +68 -0
- package/dist/features/push/softAsk.d.ts.map +1 -0
- package/dist/features/push/softAsk.js +141 -0
- package/dist/features/push/softAsk.js.map +1 -0
- package/dist/features/replay/ReplayFeature.d.ts +32 -0
- package/dist/features/replay/ReplayFeature.d.ts.map +1 -0
- package/dist/features/replay/ReplayFeature.js +132 -0
- package/dist/features/replay/ReplayFeature.js.map +1 -0
- package/dist/features/replay/engine/canvas.d.ts +45 -0
- package/dist/features/replay/engine/canvas.d.ts.map +1 -0
- package/dist/features/replay/engine/canvas.js +122 -0
- package/dist/features/replay/engine/canvas.js.map +1 -0
- package/dist/features/replay/engine/crossOrigin.d.ts +23 -0
- package/dist/features/replay/engine/crossOrigin.d.ts.map +1 -0
- package/dist/features/replay/engine/crossOrigin.js +108 -0
- package/dist/features/replay/engine/crossOrigin.js.map +1 -0
- package/dist/features/replay/engine/cssom.d.ts +31 -0
- package/dist/features/replay/engine/cssom.d.ts.map +1 -0
- package/dist/features/replay/engine/cssom.js +128 -0
- package/dist/features/replay/engine/cssom.js.map +1 -0
- package/dist/features/replay/engine/iframe.d.ts +65 -0
- package/dist/features/replay/engine/iframe.d.ts.map +1 -0
- package/dist/features/replay/engine/iframe.js +186 -0
- package/dist/features/replay/engine/iframe.js.map +1 -0
- package/dist/features/replay/engine/interactions.d.ts +142 -0
- package/dist/features/replay/engine/interactions.d.ts.map +1 -0
- package/dist/features/replay/engine/interactions.js +371 -0
- package/dist/features/replay/engine/interactions.js.map +1 -0
- package/dist/features/replay/engine/mutations.d.ts +49 -0
- package/dist/features/replay/engine/mutations.d.ts.map +1 -0
- package/dist/features/replay/engine/mutations.js +261 -0
- package/dist/features/replay/engine/mutations.js.map +1 -0
- package/dist/features/replay/engine/nodeRegistry.d.ts +23 -0
- package/dist/features/replay/engine/nodeRegistry.d.ts.map +1 -0
- package/dist/features/replay/engine/nodeRegistry.js +51 -0
- package/dist/features/replay/engine/nodeRegistry.js.map +1 -0
- package/dist/features/replay/engine/player.d.ts +11 -0
- package/dist/features/replay/engine/player.d.ts.map +1 -0
- package/dist/features/replay/engine/player.js +284 -0
- package/dist/features/replay/engine/player.js.map +1 -0
- package/dist/features/replay/engine/rebuild.d.ts +8 -0
- package/dist/features/replay/engine/rebuild.d.ts.map +1 -0
- package/dist/features/replay/engine/rebuild.js +46 -0
- package/dist/features/replay/engine/rebuild.js.map +1 -0
- package/dist/features/replay/engine/replayWorker.d.ts +33 -0
- package/dist/features/replay/engine/replayWorker.d.ts.map +1 -0
- package/dist/features/replay/engine/replayWorker.js +175 -0
- package/dist/features/replay/engine/replayWorker.js.map +1 -0
- package/dist/features/replay/engine/resources.d.ts +52 -0
- package/dist/features/replay/engine/resources.d.ts.map +1 -0
- package/dist/features/replay/engine/resources.js +132 -0
- package/dist/features/replay/engine/resources.js.map +1 -0
- package/dist/features/replay/engine/snapshot.d.ts +103 -0
- package/dist/features/replay/engine/snapshot.d.ts.map +1 -0
- package/dist/features/replay/engine/snapshot.js +409 -0
- package/dist/features/replay/engine/snapshot.js.map +1 -0
- package/dist/features/replay/engine/traverse.d.ts +19 -0
- package/dist/features/replay/engine/traverse.d.ts.map +1 -0
- package/dist/features/replay/engine/traverse.js +39 -0
- package/dist/features/replay/engine/traverse.js.map +1 -0
- package/dist/features/replay/engine/types.d.ts +137 -0
- package/dist/features/replay/engine/types.d.ts.map +1 -0
- package/dist/features/replay/engine/types.js +6 -0
- package/dist/features/replay/engine/types.js.map +1 -0
- package/dist/features/replay/engine/webglPatch.d.ts +26 -0
- package/dist/features/replay/engine/webglPatch.d.ts.map +1 -0
- package/dist/features/replay/engine/webglPatch.js +83 -0
- package/dist/features/replay/engine/webglPatch.js.map +1 -0
- package/dist/features/replay/lifecycle/adaptive.d.ts +38 -0
- package/dist/features/replay/lifecycle/adaptive.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/adaptive.js +90 -0
- package/dist/features/replay/lifecycle/adaptive.js.map +1 -0
- package/dist/features/replay/lifecycle/cadence.d.ts +20 -0
- package/dist/features/replay/lifecycle/cadence.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/cadence.js +62 -0
- package/dist/features/replay/lifecycle/cadence.js.map +1 -0
- package/dist/features/replay/lifecycle/deviceSignals.d.ts +35 -0
- package/dist/features/replay/lifecycle/deviceSignals.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/deviceSignals.js +61 -0
- package/dist/features/replay/lifecycle/deviceSignals.js.map +1 -0
- package/dist/features/replay/lifecycle/pii.d.ts +14 -0
- package/dist/features/replay/lifecycle/pii.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/pii.js +52 -0
- package/dist/features/replay/lifecycle/pii.js.map +1 -0
- package/dist/features/replay/lifecycle/recorder.d.ts +129 -0
- package/dist/features/replay/lifecycle/recorder.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/recorder.js +509 -0
- package/dist/features/replay/lifecycle/recorder.js.map +1 -0
- package/dist/features/replay/lifecycle/sampling.d.ts +28 -0
- package/dist/features/replay/lifecycle/sampling.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/sampling.js +31 -0
- package/dist/features/replay/lifecycle/sampling.js.map +1 -0
- package/dist/features/replay/lifecycle/segmentBuffer.d.ts +75 -0
- package/dist/features/replay/lifecycle/segmentBuffer.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/segmentBuffer.js +130 -0
- package/dist/features/replay/lifecycle/segmentBuffer.js.map +1 -0
- package/dist/features/replay/lifecycle/viewContext.d.ts +7 -0
- package/dist/features/replay/lifecycle/viewContext.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/viewContext.js +51 -0
- package/dist/features/replay/lifecycle/viewContext.js.map +1 -0
- package/dist/features/scroll/index.d.ts +31 -0
- package/dist/features/scroll/index.d.ts.map +1 -0
- package/dist/features/scroll/index.js +102 -0
- package/dist/features/scroll/index.js.map +1 -0
- package/dist/features/session/sessionManager.d.ts +25 -0
- package/dist/features/session/sessionManager.d.ts.map +1 -0
- package/dist/features/session/sessionManager.js +36 -0
- package/dist/features/session/sessionManager.js.map +1 -0
- package/dist/features/session/sessionStore.d.ts +106 -0
- package/dist/features/session/sessionStore.d.ts.map +1 -0
- package/dist/features/session/sessionStore.js +265 -0
- package/dist/features/session/sessionStore.js.map +1 -0
- package/dist/features/watchdog/WatchdogFeature.d.ts +23 -0
- package/dist/features/watchdog/WatchdogFeature.d.ts.map +1 -0
- package/dist/features/watchdog/WatchdogFeature.js +29 -0
- package/dist/features/watchdog/WatchdogFeature.js.map +1 -0
- package/dist/features/watchdog/collectors.d.ts +18 -0
- package/dist/features/watchdog/collectors.d.ts.map +1 -0
- package/dist/features/watchdog/collectors.js +107 -0
- package/dist/features/watchdog/collectors.js.map +1 -0
- package/dist/features/watchdog/config.d.ts +51 -0
- package/dist/features/watchdog/config.d.ts.map +1 -0
- package/dist/features/watchdog/config.js +28 -0
- package/dist/features/watchdog/config.js.map +1 -0
- package/dist/features/watchdog/engine.d.ts +22 -0
- package/dist/features/watchdog/engine.d.ts.map +1 -0
- package/dist/features/watchdog/engine.js +123 -0
- package/dist/features/watchdog/engine.js.map +1 -0
- package/dist/features/watchdog/incidents.d.ts +79 -0
- package/dist/features/watchdog/incidents.d.ts.map +1 -0
- package/dist/features/watchdog/incidents.js +204 -0
- package/dist/features/watchdog/incidents.js.map +1 -0
- package/dist/features/watchdog/rollup.d.ts +41 -0
- package/dist/features/watchdog/rollup.d.ts.map +1 -0
- package/dist/features/watchdog/rollup.js +76 -0
- package/dist/features/watchdog/rollup.js.map +1 -0
- package/dist/features/webVitals/WebVitalsFeature.d.ts +46 -0
- package/dist/features/webVitals/WebVitalsFeature.d.ts.map +1 -0
- package/dist/features/webVitals/WebVitalsFeature.js +252 -0
- package/dist/features/webVitals/WebVitalsFeature.js.map +1 -0
- package/dist/features/webVitals/attribution.d.ts +50 -0
- package/dist/features/webVitals/attribution.d.ts.map +1 -0
- package/dist/features/webVitals/attribution.js +186 -0
- package/dist/features/webVitals/attribution.js.map +1 -0
- package/dist/features/webVitals/observe.d.ts +6 -0
- package/dist/features/webVitals/observe.d.ts.map +1 -0
- package/dist/features/webVitals/observe.js +6 -0
- package/dist/features/webVitals/observe.js.map +1 -0
- package/dist/features/webVitals/vitals.d.ts +99 -0
- package/dist/features/webVitals/vitals.d.ts.map +1 -0
- package/dist/features/webVitals/vitals.js +166 -0
- package/dist/features/webVitals/vitals.js.map +1 -0
- package/dist/features/webperf/WebPerfFeature.d.ts +19 -0
- package/dist/features/webperf/WebPerfFeature.d.ts.map +1 -0
- package/dist/features/webperf/WebPerfFeature.js +48 -0
- package/dist/features/webperf/WebPerfFeature.js.map +1 -0
- package/dist/features/webperf/collectors.d.ts +3 -0
- package/dist/features/webperf/collectors.d.ts.map +1 -0
- package/dist/features/webperf/collectors.js +118 -0
- package/dist/features/webperf/collectors.js.map +1 -0
- package/dist/features/webperf/math.d.ts +12 -0
- package/dist/features/webperf/math.d.ts.map +1 -0
- package/dist/features/webperf/math.js +26 -0
- package/dist/features/webperf/math.js.map +1 -0
- package/dist/inapp.d.ts +6 -0
- package/dist/inapp.d.ts.map +1 -0
- package/dist/inapp.js +6 -0
- package/dist/inapp.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/index.d.ts +7 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +2 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/pipeline/index.d.ts +3 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +3 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/pipeline.d.ts +84 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +284 -0
- package/dist/pipeline/pipeline.js.map +1 -0
- package/dist/public/ScaleBunFacade.d.ts +382 -0
- package/dist/public/ScaleBunFacade.d.ts.map +1 -0
- package/dist/public/ScaleBunFacade.js +787 -0
- package/dist/public/ScaleBunFacade.js.map +1 -0
- package/dist/public/index.d.ts +5 -0
- package/dist/public/index.d.ts.map +1 -0
- package/dist/public/index.js +4 -0
- package/dist/public/index.js.map +1 -0
- package/dist/public/typedTracker.d.ts +91 -0
- package/dist/public/typedTracker.d.ts.map +1 -0
- package/dist/public/typedTracker.js +60 -0
- package/dist/public/typedTracker.js.map +1 -0
- package/dist/scalebun-push-sw.js +236 -0
- package/dist/scalebun.min.js +635 -0
- package/dist/scalebun.min.js.map +7 -0
- package/dist/storage/idb.d.ts +16 -0
- package/dist/storage/idb.d.ts.map +1 -0
- package/dist/storage/idb.js +76 -0
- package/dist/storage/idb.js.map +1 -0
- package/dist/storage/index.d.ts +3 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +3 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/transport/gzip.d.ts +2 -0
- package/dist/transport/gzip.d.ts.map +1 -0
- package/dist/transport/gzip.js +20 -0
- package/dist/transport/gzip.js.map +1 -0
- package/dist/transport/httpClient.d.ts +60 -0
- package/dist/transport/httpClient.d.ts.map +1 -0
- package/dist/transport/httpClient.js +154 -0
- package/dist/transport/httpClient.js.map +1 -0
- package/dist/transport/index.d.ts +3 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +3 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/transport/sign.d.ts +25 -0
- package/dist/transport/sign.d.ts.map +1 -0
- package/dist/transport/sign.js +58 -0
- package/dist/transport/sign.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P1 — Web Push self-diagnosis. `ScaleBun.push.check()` answers "why isn't push working?" without the
|
|
3
|
+
* customer opening a support ticket.
|
|
4
|
+
*
|
|
5
|
+
* Loaded as its own dynamic chunk from PushFeature.check(), so even hosts that DO use push pay nothing
|
|
6
|
+
* for diagnostics unless they ask for them. Core bundle untouched.
|
|
7
|
+
*
|
|
8
|
+
* Three rules this module must never break:
|
|
9
|
+
* 1. **It never prompts.** A diagnostic that calls Notification.requestPermission() is a bug — it
|
|
10
|
+
* burns the one prompt the host gets, from a non-gesture context, and can permanently deny.
|
|
11
|
+
* 2. **It never throws.** Every check is independently guarded; an indeterminate check reports
|
|
12
|
+
* `unknown`, which is information, not failure.
|
|
13
|
+
* 3. **The result is self-describing.** Each check carries its own label + fix copy so a dashboard
|
|
14
|
+
* can render the report generically, with no second copy of the vocabulary to drift.
|
|
15
|
+
*
|
|
16
|
+
* Checks are ordered by CAUSALITY: the first failure is the root cause, and everything downstream of
|
|
17
|
+
* it reports `unknown` rather than piling on derived failures. The list length is stable so a UI can
|
|
18
|
+
* render fixed rows.
|
|
19
|
+
*/
|
|
20
|
+
/** The SW takes a moment to answer a ping; a missing/stale worker never answers at all. */
|
|
21
|
+
const SW_PING_TIMEOUT_MS = 1500;
|
|
22
|
+
// ── helpers ───────────────────────────────────────────────────────────────────
|
|
23
|
+
function isSupported() {
|
|
24
|
+
return (typeof navigator !== 'undefined' &&
|
|
25
|
+
'serviceWorker' in navigator &&
|
|
26
|
+
typeof window !== 'undefined' &&
|
|
27
|
+
'PushManager' in window &&
|
|
28
|
+
'Notification' in window);
|
|
29
|
+
}
|
|
30
|
+
function urlBase64ToBytes(base64) {
|
|
31
|
+
const padding = '='.repeat((4 - (base64.length % 4)) % 4);
|
|
32
|
+
const normalized = (base64 + padding).replace(/-/g, '+').replace(/_/g, '/');
|
|
33
|
+
const raw = atob(normalized);
|
|
34
|
+
const out = new Uint8Array(raw.length);
|
|
35
|
+
for (let i = 0; i < raw.length; i++)
|
|
36
|
+
out[i] = raw.charCodeAt(i);
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
function sameBytes(a, b) {
|
|
40
|
+
if (a.length !== b.length)
|
|
41
|
+
return false;
|
|
42
|
+
for (let i = 0; i < a.length; i++)
|
|
43
|
+
if (a[i] !== b[i])
|
|
44
|
+
return false;
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Ask the active worker its version over a MessageChannel. A worker that predates the ping handler
|
|
49
|
+
* simply never replies — indistinguishable from "no worker", which is why the caller reports both
|
|
50
|
+
* causes in one message rather than guessing.
|
|
51
|
+
*/
|
|
52
|
+
function pingServiceWorker(reg) {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
const worker = reg.active;
|
|
55
|
+
if (!worker || typeof MessageChannel === 'undefined') {
|
|
56
|
+
resolve(null);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let settled = false;
|
|
60
|
+
const done = (v) => {
|
|
61
|
+
if (settled)
|
|
62
|
+
return;
|
|
63
|
+
settled = true;
|
|
64
|
+
resolve(v);
|
|
65
|
+
};
|
|
66
|
+
try {
|
|
67
|
+
const channel = new MessageChannel();
|
|
68
|
+
channel.port1.onmessage = (event) => {
|
|
69
|
+
const data = event.data;
|
|
70
|
+
done(data && data.type === 'scalebun-sw-pong' ? { version: data.version } : null);
|
|
71
|
+
};
|
|
72
|
+
worker.postMessage({ type: 'scalebun-sw-ping' }, [channel.port2]);
|
|
73
|
+
setTimeout(() => done(null), SW_PING_TIMEOUT_MS);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
done(null);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// ── the report ────────────────────────────────────────────────────────────────
|
|
81
|
+
export async function runPushDiagnostics(deps) {
|
|
82
|
+
const checks = [];
|
|
83
|
+
const add = (c) => {
|
|
84
|
+
checks.push(c);
|
|
85
|
+
return c;
|
|
86
|
+
};
|
|
87
|
+
/** Downstream of a root-cause failure: report honestly as not-evaluated, don't invent failures. */
|
|
88
|
+
const skip = (id, label, because) => {
|
|
89
|
+
add({ id, status: 'unknown', label, detail: `Not evaluated — ${because}` });
|
|
90
|
+
};
|
|
91
|
+
// 1. Secure context. isSecureContext (NOT protocol === 'https:') so localhost passes, as browsers
|
|
92
|
+
// themselves treat it.
|
|
93
|
+
const secure = typeof window !== 'undefined' && window.isSecureContext === true;
|
|
94
|
+
add({
|
|
95
|
+
id: 'secure_context',
|
|
96
|
+
status: secure ? 'pass' : 'fail',
|
|
97
|
+
label: 'Secure context (HTTPS)',
|
|
98
|
+
detail: secure ? undefined : 'Page is not a secure context',
|
|
99
|
+
fix: secure ? undefined : 'Serve the site over HTTPS. Web Push is unavailable on plain HTTP (localhost is exempt).',
|
|
100
|
+
});
|
|
101
|
+
// 2. Browser API support — name the MISSING api, and call out the iOS case explicitly since
|
|
102
|
+
// "works on my Android" vs "nothing on iPhone" is the most common confusion.
|
|
103
|
+
const missing = [];
|
|
104
|
+
if (typeof navigator === 'undefined' || !('serviceWorker' in navigator))
|
|
105
|
+
missing.push('ServiceWorker');
|
|
106
|
+
if (typeof window === 'undefined' || !('PushManager' in window))
|
|
107
|
+
missing.push('PushManager');
|
|
108
|
+
if (typeof window === 'undefined' || !('Notification' in window))
|
|
109
|
+
missing.push('Notification');
|
|
110
|
+
const supported = missing.length === 0 && isSupported();
|
|
111
|
+
const iosLike = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent || '');
|
|
112
|
+
add({
|
|
113
|
+
id: 'api_support',
|
|
114
|
+
status: supported ? 'pass' : 'fail',
|
|
115
|
+
label: 'Browser supports Web Push',
|
|
116
|
+
detail: supported ? undefined : `Missing: ${missing.join(', ') || 'push APIs'}`,
|
|
117
|
+
fix: supported
|
|
118
|
+
? undefined
|
|
119
|
+
: iosLike
|
|
120
|
+
? 'On iOS, Web Push only works when the site is installed to the Home Screen as a PWA (iOS 16.4+). In a normal Safari tab these APIs are absent.'
|
|
121
|
+
: 'This browser cannot receive Web Push. Hide your opt-in UI when ScaleBun.push.check() reports this.',
|
|
122
|
+
});
|
|
123
|
+
if (!supported) {
|
|
124
|
+
// Everything below depends on the push APIs existing.
|
|
125
|
+
skip('sw_reachable', 'Service worker file is reachable', 'push APIs are unavailable');
|
|
126
|
+
skip('sw_registered', 'Service worker is registered', 'push APIs are unavailable');
|
|
127
|
+
skip('sw_version', 'Service worker is up to date', 'push APIs are unavailable');
|
|
128
|
+
skip('vapid_configured', 'Web Push configured for this app', 'push APIs are unavailable');
|
|
129
|
+
skip('permission', 'Notification permission', 'push APIs are unavailable');
|
|
130
|
+
skip('subscription_valid', 'Push subscription is valid', 'push APIs are unavailable');
|
|
131
|
+
skip('device_registered', 'Device registered with ScaleBun', 'push APIs are unavailable');
|
|
132
|
+
skip('identified', 'User is identified', 'push APIs are unavailable');
|
|
133
|
+
return finish(checks);
|
|
134
|
+
}
|
|
135
|
+
// 3. Is the worker FILE actually served? Integration step 2 is a manual file copy, so a 404 here is
|
|
136
|
+
// the single most likely failure — and nothing else in the stack reports it clearly.
|
|
137
|
+
let swReachable = null;
|
|
138
|
+
try {
|
|
139
|
+
const res = await fetch(deps.serviceWorkerUrl, { method: 'HEAD', cache: 'no-store' });
|
|
140
|
+
swReachable = res.ok;
|
|
141
|
+
add({
|
|
142
|
+
id: 'sw_reachable',
|
|
143
|
+
status: res.ok ? 'pass' : 'fail',
|
|
144
|
+
label: 'Service worker file is reachable',
|
|
145
|
+
detail: `GET ${deps.serviceWorkerUrl} → ${res.status}`,
|
|
146
|
+
fix: res.ok
|
|
147
|
+
? undefined
|
|
148
|
+
: `Copy scalebun-push-sw.js from @scalebun/web/dist/ to your web root so it is served at ${deps.serviceWorkerUrl}.`,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
add({
|
|
153
|
+
id: 'sw_reachable',
|
|
154
|
+
status: 'unknown',
|
|
155
|
+
label: 'Service worker file is reachable',
|
|
156
|
+
detail: `Could not fetch ${deps.serviceWorkerUrl}`,
|
|
157
|
+
fix: 'Check that the file is served from the same origin and not blocked by CSP.',
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// 4. Registered — and registered to OUR worker. A host may have another service worker claiming
|
|
161
|
+
// the same scope, which looks fine until pushes silently go nowhere.
|
|
162
|
+
let reg = null;
|
|
163
|
+
try {
|
|
164
|
+
reg = (await navigator.serviceWorker.getRegistration(deps.serviceWorkerUrl)) ?? null;
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
reg = null;
|
|
168
|
+
}
|
|
169
|
+
const scriptUrl = reg?.active?.scriptURL ?? reg?.installing?.scriptURL ?? reg?.waiting?.scriptURL ?? null;
|
|
170
|
+
const isOurs = !!scriptUrl && scriptUrl.indexOf('scalebun-push-sw') >= 0;
|
|
171
|
+
add({
|
|
172
|
+
id: 'sw_registered',
|
|
173
|
+
status: reg && isOurs ? 'pass' : 'fail',
|
|
174
|
+
label: 'Service worker is registered',
|
|
175
|
+
detail: !reg
|
|
176
|
+
? 'No registration found for this scope'
|
|
177
|
+
: isOurs
|
|
178
|
+
? `Active: ${scriptUrl}`
|
|
179
|
+
: `A different worker owns this scope: ${scriptUrl}`,
|
|
180
|
+
fix: !reg
|
|
181
|
+
? swReachable === false
|
|
182
|
+
? 'The worker file is missing (see the check above) — fix that first, then call ScaleBun.enablePush().'
|
|
183
|
+
: 'Call ScaleBun.enablePush() from a user gesture to register the worker.'
|
|
184
|
+
: isOurs
|
|
185
|
+
? undefined
|
|
186
|
+
: 'Another service worker controls this scope. Serve the ScaleBun worker at a path it can own, and pass serviceWorkerScope to enablePush().',
|
|
187
|
+
});
|
|
188
|
+
// 5. Version — the worker is copied by hand and therefore goes stale silently.
|
|
189
|
+
if (reg && isOurs) {
|
|
190
|
+
const pong = await pingServiceWorker(reg);
|
|
191
|
+
if (!pong || typeof pong.version !== 'number') {
|
|
192
|
+
add({
|
|
193
|
+
id: 'sw_version',
|
|
194
|
+
status: 'warn',
|
|
195
|
+
label: 'Service worker is up to date',
|
|
196
|
+
// Honest ambiguity: a worker predating the ping handler cannot report that it is stale.
|
|
197
|
+
detail: 'The worker did not answer a version ping',
|
|
198
|
+
fix: `Your copy of scalebun-push-sw.js is older than v${deps.expectedSwVersion} (versions before v3 cannot report themselves). Re-copy it from @scalebun/web/dist/.`,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else if (pong.version < deps.expectedSwVersion) {
|
|
202
|
+
add({
|
|
203
|
+
id: 'sw_version',
|
|
204
|
+
status: 'warn',
|
|
205
|
+
label: 'Service worker is up to date',
|
|
206
|
+
detail: `Worker is v${pong.version}, this SDK expects v${deps.expectedSwVersion}`,
|
|
207
|
+
fix: 'Re-copy scalebun-push-sw.js from @scalebun/web/dist/ to your web root — the deployed copy is stale.',
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
add({ id: 'sw_version', status: 'pass', label: 'Service worker is up to date', detail: `v${pong.version}` });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
skip('sw_version', 'Service worker is up to date', 'no ScaleBun worker is registered');
|
|
216
|
+
}
|
|
217
|
+
// 6. Has the TENANT set Web Push up at all?
|
|
218
|
+
let vapidKey = null;
|
|
219
|
+
try {
|
|
220
|
+
const res = await fetch(`${deps.apiBaseUrl}/sdk/engage/push-config`, {
|
|
221
|
+
headers: { 'content-type': 'application/json', 'x-scalebun-client-key': deps.clientKey },
|
|
222
|
+
cache: 'no-store',
|
|
223
|
+
});
|
|
224
|
+
const cfg = res.ok ? (await res.json()) : null;
|
|
225
|
+
vapidKey = cfg?.enabled === false ? null : (cfg?.vapidPublicKey ?? null);
|
|
226
|
+
add({
|
|
227
|
+
id: 'vapid_configured',
|
|
228
|
+
status: vapidKey ? 'pass' : 'fail',
|
|
229
|
+
label: 'Web Push configured for this app',
|
|
230
|
+
detail: vapidKey ? undefined : 'No VAPID key served for this client key',
|
|
231
|
+
fix: vapidKey
|
|
232
|
+
? undefined
|
|
233
|
+
: 'In the ScaleBun dashboard: Settings → Integrations → Web Push (VAPID) → Generate VAPID keys.',
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
catch {
|
|
237
|
+
add({
|
|
238
|
+
id: 'vapid_configured',
|
|
239
|
+
status: 'unknown',
|
|
240
|
+
label: 'Web Push configured for this app',
|
|
241
|
+
detail: 'Could not reach the ScaleBun API',
|
|
242
|
+
fix: 'Check apiBaseUrl, network access, and CORS.',
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
// 7. Permission — READ ONLY. Never prompts.
|
|
246
|
+
const permission = typeof Notification === 'undefined' ? 'default' : Notification.permission;
|
|
247
|
+
add({
|
|
248
|
+
id: 'permission',
|
|
249
|
+
status: permission === 'granted' ? 'pass' : permission === 'denied' ? 'fail' : 'warn',
|
|
250
|
+
label: 'Notification permission',
|
|
251
|
+
detail: permission,
|
|
252
|
+
fix: permission === 'granted'
|
|
253
|
+
? undefined
|
|
254
|
+
: permission === 'denied'
|
|
255
|
+
? 'The user blocked notifications. This cannot be re-prompted from code — they must re-allow it in browser site settings.'
|
|
256
|
+
: 'Not asked yet. Call ScaleBun.enablePush() from a click handler.',
|
|
257
|
+
});
|
|
258
|
+
// 8. Subscription — exists, unexpired, and minted with the VAPID key the tenant is CURRENTLY using.
|
|
259
|
+
// The last part catches the silent killer: rotating VAPID in the dashboard leaves every existing
|
|
260
|
+
// subscription dead while it still looks perfectly healthy.
|
|
261
|
+
try {
|
|
262
|
+
const sub = reg ? await reg.pushManager.getSubscription() : null;
|
|
263
|
+
if (!sub) {
|
|
264
|
+
add({
|
|
265
|
+
id: 'subscription_valid',
|
|
266
|
+
status: 'fail',
|
|
267
|
+
label: 'Push subscription is valid',
|
|
268
|
+
detail: 'No subscription on this browser',
|
|
269
|
+
fix: permission === 'granted'
|
|
270
|
+
? 'Permission is granted but no subscription exists — call ScaleBun.enablePush() to create one.'
|
|
271
|
+
: 'Call ScaleBun.enablePush() from a user gesture.',
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
const json = sub.toJSON();
|
|
276
|
+
const expired = typeof json.expirationTime === 'number' && json.expirationTime <= Date.now();
|
|
277
|
+
let keyMatches = null;
|
|
278
|
+
if (vapidKey) {
|
|
279
|
+
const appKey = sub.options?.applicationServerKey;
|
|
280
|
+
keyMatches = appKey ? sameBytes(new Uint8Array(appKey), urlBase64ToBytes(vapidKey)) : null;
|
|
281
|
+
}
|
|
282
|
+
const bad = expired || keyMatches === false;
|
|
283
|
+
add({
|
|
284
|
+
id: 'subscription_valid',
|
|
285
|
+
status: bad ? 'fail' : keyMatches === null && vapidKey ? 'warn' : 'pass',
|
|
286
|
+
label: 'Push subscription is valid',
|
|
287
|
+
detail: expired
|
|
288
|
+
? 'Subscription has expired'
|
|
289
|
+
: keyMatches === false
|
|
290
|
+
? 'Subscription was created with a DIFFERENT VAPID key than this app now uses'
|
|
291
|
+
: keyMatches === null && vapidKey
|
|
292
|
+
? 'Could not read the subscription key to compare against the tenant VAPID key'
|
|
293
|
+
: sub.endpoint,
|
|
294
|
+
fix: expired
|
|
295
|
+
? 'Call ScaleBun.enablePush() again to mint a fresh subscription.'
|
|
296
|
+
: keyMatches === false
|
|
297
|
+
? 'The VAPID keypair was rotated after this browser subscribed, so pushes to it will fail. Call ScaleBun.push.disable() then ScaleBun.enablePush() to re-subscribe.'
|
|
298
|
+
: undefined,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
add({
|
|
304
|
+
id: 'subscription_valid',
|
|
305
|
+
status: 'unknown',
|
|
306
|
+
label: 'Push subscription is valid',
|
|
307
|
+
detail: 'Could not read the push subscription',
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
// 9 + 10. What does the SERVER think? Without this the SDK can only claim "we POSTed and got a 200".
|
|
311
|
+
try {
|
|
312
|
+
const res = await fetch(`${deps.apiBaseUrl}/sdk/engage/device-token/status?deviceId=${encodeURIComponent(deps.deviceId)}`, {
|
|
313
|
+
headers: { 'content-type': 'application/json', 'x-scalebun-client-key': deps.clientKey },
|
|
314
|
+
cache: 'no-store',
|
|
315
|
+
});
|
|
316
|
+
const echo = res.ok
|
|
317
|
+
? (await res.json())
|
|
318
|
+
: null;
|
|
319
|
+
if (!echo) {
|
|
320
|
+
add({ id: 'device_registered', status: 'unknown', label: 'Device registered with ScaleBun', detail: `Status lane returned ${res.status}` });
|
|
321
|
+
skip('identified', 'User is identified', 'the server did not answer');
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
const dead = echo.tokenStatus === 'dead';
|
|
325
|
+
add({
|
|
326
|
+
id: 'device_registered',
|
|
327
|
+
status: echo.registered && !dead ? 'pass' : 'fail',
|
|
328
|
+
label: 'Device registered with ScaleBun',
|
|
329
|
+
detail: !echo.registered ? 'No push token stored for this device' : dead ? 'Token marked dead by the push service' : 'Registered and active',
|
|
330
|
+
fix: !echo.registered
|
|
331
|
+
? 'Call ScaleBun.enablePush() — the subscription never reached the backend.'
|
|
332
|
+
: dead
|
|
333
|
+
? 'The browser push service rejected this token (410 Gone). Call ScaleBun.enablePush() to re-subscribe.'
|
|
334
|
+
: undefined,
|
|
335
|
+
});
|
|
336
|
+
// Anonymous is NOT an error — but it silently excludes this browser from every journey and
|
|
337
|
+
// lifecycle program, which is exactly the kind of thing people lose days to.
|
|
338
|
+
add({
|
|
339
|
+
id: 'identified',
|
|
340
|
+
status: echo.identified ? 'pass' : 'warn',
|
|
341
|
+
label: 'User is identified',
|
|
342
|
+
detail: echo.identified ? 'Bound to a person' : 'Anonymous device',
|
|
343
|
+
fix: echo.identified
|
|
344
|
+
? undefined
|
|
345
|
+
: 'Call ScaleBun.identify() — journeys and lifecycle programs only target identified people, so this browser can receive broadcasts but never an automated lifecycle push.',
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
add({ id: 'device_registered', status: 'unknown', label: 'Device registered with ScaleBun', detail: 'Could not reach the ScaleBun API' });
|
|
351
|
+
skip('identified', 'User is identified', 'the server was unreachable');
|
|
352
|
+
}
|
|
353
|
+
return finish(checks);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* The report for "push.check() was called before ScaleBun.init()". Lives HERE rather than inline in
|
|
357
|
+
* the facade so its strings stay in this lazy chunk — the facade is eager core, and core is under a
|
|
358
|
+
* hard size gate.
|
|
359
|
+
*/
|
|
360
|
+
export function notInitializedReport() {
|
|
361
|
+
return {
|
|
362
|
+
ok: false,
|
|
363
|
+
blocking: 'api_support',
|
|
364
|
+
checks: [
|
|
365
|
+
{
|
|
366
|
+
id: 'api_support',
|
|
367
|
+
status: 'fail',
|
|
368
|
+
label: 'ScaleBun is initialized',
|
|
369
|
+
detail: 'push.check() was called before ScaleBun.init()',
|
|
370
|
+
fix: 'Call ScaleBun.init({ clientKey, apiBaseUrl }) first — diagnostics need the resolved config.',
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function finish(checks) {
|
|
376
|
+
const firstFail = checks.find((c) => c.status === 'fail');
|
|
377
|
+
return {
|
|
378
|
+
ok: !firstFail,
|
|
379
|
+
blocking: firstFail?.id ?? null,
|
|
380
|
+
checks,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../../src/features/push/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA6CH,2FAA2F;AAC3F,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,iFAAiF;AACjF,SAAS,WAAW;IAClB,OAAO,CACL,OAAO,SAAS,KAAK,WAAW;QAChC,eAAe,IAAI,SAAS;QAC5B,OAAO,MAAM,KAAK,WAAW;QAC7B,aAAa,IAAI,MAAM;QACvB,cAAc,IAAI,MAAM,CACzB,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc;IACtC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,OAA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AC,CAAC,CAAC,kBAAkB;gBAClE,GAAG,EAAE,IAAI,CAAC,UAAU;oBAClB,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,yKAAyK;aAC9K,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,GAAG,CAAC,EAAE,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,iCAAiC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;QAC1I,IAAI,CAAC,YAAY,EAAE,oBAAoB,EAAE,4BAA4B,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,EAAE,EAAE,KAAK;QACT,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE;YACN;gBACE,EAAE,EAAE,aAAa;gBACjB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,yBAAyB;gBAChC,MAAM,EAAE,gDAAgD;gBACxD,GAAG,EAAE,6FAA6F;aACnG;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,MAAmB;IACjC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IAC1D,OAAO;QACL,EAAE,EAAE,CAAC,SAAS;QACd,QAAQ,EAAE,SAAS,EAAE,EAAE,IAAI,IAAI;QAC/B,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The push state a host can actually act on.
|
|
3
|
+
*
|
|
4
|
+
* ── WHY THIS EXISTS ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* `Notification.permission` has three values and they do NOT map onto the three situations a product
|
|
6
|
+
* needs to tell apart. `denied` covers both "they said no when we asked" and "they had it on and
|
|
7
|
+
* turned it off in browser settings" — different people, needing different copy and different
|
|
8
|
+
* treatment. And `granted` says nothing about whether a subscription still exists: a browser can
|
|
9
|
+
* expire or drop one while permission stays granted, which is the case that silently stops delivery
|
|
10
|
+
* with every signal still reading green.
|
|
11
|
+
*
|
|
12
|
+
* So the SDK collapsed three distinct states into `denied` plus an unrepresented fourth. The
|
|
13
|
+
* distinction is recoverable from one extra fact — whether this browser has EVER held a subscription
|
|
14
|
+
* — which is why `everSubscribed` is persisted.
|
|
15
|
+
*
|
|
16
|
+
* Pure so it can be tested exhaustively without a browser; `PushFeature` supplies the inputs.
|
|
17
|
+
*/
|
|
18
|
+
export type PushPermission = 'granted' | 'denied' | 'default';
|
|
19
|
+
export type PushState =
|
|
20
|
+
/** Working: permission granted and a live subscription registered. */
|
|
21
|
+
'subscribed'
|
|
22
|
+
/** Never asked. The only state where prompting is appropriate. */
|
|
23
|
+
| 'never-granted'
|
|
24
|
+
/** Asked, and they said no. Re-prompting is impossible — the browser will not show it again. */
|
|
25
|
+
| 'blocked'
|
|
26
|
+
/** They HAD it and turned it off. A different person from `blocked`, and a different conversation. */
|
|
27
|
+
| 'revoked'
|
|
28
|
+
/**
|
|
29
|
+
* Permission is still granted but the subscription is gone — expired, or dropped by the browser.
|
|
30
|
+
* Recoverable WITHOUT a prompt, which is what makes it worth separating: calling subscribe again
|
|
31
|
+
* just works, and treating it as "denied" would hide a user who never refused anything.
|
|
32
|
+
*/
|
|
33
|
+
| 'expired'
|
|
34
|
+
/** The browser cannot do web push at all. */
|
|
35
|
+
| 'unsupported';
|
|
36
|
+
export interface PushStateInput {
|
|
37
|
+
supported: boolean;
|
|
38
|
+
permission: PushPermission;
|
|
39
|
+
/** A live `PushSubscription` exists right now. */
|
|
40
|
+
hasSubscription: boolean;
|
|
41
|
+
/** This browser has held a subscription at some point — persisted by the SDK. */
|
|
42
|
+
everSubscribed: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare function resolvePushState(input: PushStateInput): PushState;
|
|
45
|
+
export interface PushStateCopy {
|
|
46
|
+
/** One line stating what is true. Never a euphemism — a blocked user is not "not subscribed yet". */
|
|
47
|
+
title: string;
|
|
48
|
+
detail: string;
|
|
49
|
+
/** Can calling `enablePush()` plausibly fix this? Drives whether a UI offers the button at all. */
|
|
50
|
+
actionable: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The three-states requirement is a COPY requirement as much as a data one: they "must read
|
|
54
|
+
* differently". Kept beside the resolver so a new state cannot be added without answering what it
|
|
55
|
+
* says to a person.
|
|
56
|
+
*/
|
|
57
|
+
export declare const PUSH_STATE_COPY: Record<PushState, PushStateCopy>;
|
|
58
|
+
//# sourceMappingURL=pushState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushState.d.ts","sourceRoot":"","sources":["../../../src/features/push/pushState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D,MAAM,MAAM,SAAS;AACnB,sEAAsE;AACpE,YAAY;AACd,kEAAkE;GAChE,eAAe;AACjB,gGAAgG;GAC9F,SAAS;AACX,sGAAsG;GACpG,SAAS;AACX;;;;GAIG;GACD,SAAS;AACX,6CAA6C;GAC3C,aAAa,CAAC;AAElB,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,kDAAkD;IAClD,eAAe,EAAE,OAAO,CAAC;IACzB,iFAAiF;IACjF,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAgBjE;AAED,MAAM,WAAW,aAAa;IAC5B,qGAAqG;IACrG,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,mGAAmG;IACnG,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAqC5D,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The push state a host can actually act on.
|
|
3
|
+
*
|
|
4
|
+
* ── WHY THIS EXISTS ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* `Notification.permission` has three values and they do NOT map onto the three situations a product
|
|
6
|
+
* needs to tell apart. `denied` covers both "they said no when we asked" and "they had it on and
|
|
7
|
+
* turned it off in browser settings" — different people, needing different copy and different
|
|
8
|
+
* treatment. And `granted` says nothing about whether a subscription still exists: a browser can
|
|
9
|
+
* expire or drop one while permission stays granted, which is the case that silently stops delivery
|
|
10
|
+
* with every signal still reading green.
|
|
11
|
+
*
|
|
12
|
+
* So the SDK collapsed three distinct states into `denied` plus an unrepresented fourth. The
|
|
13
|
+
* distinction is recoverable from one extra fact — whether this browser has EVER held a subscription
|
|
14
|
+
* — which is why `everSubscribed` is persisted.
|
|
15
|
+
*
|
|
16
|
+
* Pure so it can be tested exhaustively without a browser; `PushFeature` supplies the inputs.
|
|
17
|
+
*/
|
|
18
|
+
export function resolvePushState(input) {
|
|
19
|
+
if (!input.supported)
|
|
20
|
+
return 'unsupported';
|
|
21
|
+
if (input.permission === 'denied') {
|
|
22
|
+
// The whole point of `everSubscribed`: a first-ask refusal and a later opt-out are the same
|
|
23
|
+
// browser value and completely different situations.
|
|
24
|
+
return input.everSubscribed ? 'revoked' : 'blocked';
|
|
25
|
+
}
|
|
26
|
+
if (input.permission === 'default')
|
|
27
|
+
return 'never-granted';
|
|
28
|
+
// granted
|
|
29
|
+
if (input.hasSubscription)
|
|
30
|
+
return 'subscribed';
|
|
31
|
+
// Granted but no subscription. If we never had one, the host simply has not called enable() yet —
|
|
32
|
+
// that is still "never granted a subscription", not a failure. If we DID have one, it is gone.
|
|
33
|
+
return input.everSubscribed ? 'expired' : 'never-granted';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The three-states requirement is a COPY requirement as much as a data one: they "must read
|
|
37
|
+
* differently". Kept beside the resolver so a new state cannot be added without answering what it
|
|
38
|
+
* says to a person.
|
|
39
|
+
*/
|
|
40
|
+
export const PUSH_STATE_COPY = {
|
|
41
|
+
subscribed: {
|
|
42
|
+
title: 'Notifications are on',
|
|
43
|
+
detail: 'This browser is registered and can receive push.',
|
|
44
|
+
actionable: false,
|
|
45
|
+
},
|
|
46
|
+
'never-granted': {
|
|
47
|
+
title: 'Not asked yet',
|
|
48
|
+
detail: 'This browser has never been prompted. Ask from a click — browsers ignore the prompt otherwise.',
|
|
49
|
+
actionable: true,
|
|
50
|
+
},
|
|
51
|
+
blocked: {
|
|
52
|
+
title: 'Blocked in this browser',
|
|
53
|
+
detail: 'Notifications were declined, and the browser will not show the prompt again. Only the person can re-enable it, from the site settings beside the address bar.',
|
|
54
|
+
// Deliberately false: offering an Enable button here does nothing and teaches people the product
|
|
55
|
+
// is broken. The recovery is in browser chrome we cannot reach.
|
|
56
|
+
actionable: false,
|
|
57
|
+
},
|
|
58
|
+
revoked: {
|
|
59
|
+
title: 'Turned off after being enabled',
|
|
60
|
+
detail: 'This browser had notifications and they were switched off. Like blocking, only the person can restore it from the site settings — but unlike a first refusal, they opted in once, so a reminder in-product is fair.',
|
|
61
|
+
actionable: false,
|
|
62
|
+
},
|
|
63
|
+
expired: {
|
|
64
|
+
title: 'Registration expired',
|
|
65
|
+
detail: 'Permission is still granted but the subscription is gone — browsers drop them after long inactivity or a data clear. Re-registering fixes it and does NOT prompt.',
|
|
66
|
+
// The one recoverable state that looks like a failure. Worth separating precisely for this.
|
|
67
|
+
actionable: true,
|
|
68
|
+
},
|
|
69
|
+
unsupported: {
|
|
70
|
+
title: 'Not supported in this browser',
|
|
71
|
+
detail: 'Web push needs a service worker, the Push API and Notifications. This browser is missing at least one.',
|
|
72
|
+
actionable: false,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=pushState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushState.js","sourceRoot":"","sources":["../../../src/features/push/pushState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA+BH,MAAM,UAAU,gBAAgB,CAAC,KAAqB;IACpD,IAAI,CAAC,KAAK,CAAC,SAAS;QAAE,OAAO,aAAa,CAAC;IAE3C,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAClC,4FAA4F;QAC5F,qDAAqD;QACrD,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,CAAC;IAED,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC;IAE3D,UAAU;IACV,IAAI,KAAK,CAAC,eAAe;QAAE,OAAO,YAAY,CAAC;IAC/C,kGAAkG;IAClG,+FAA+F;IAC/F,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;AAC5D,CAAC;AAUD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqC;IAC/D,UAAU,EAAE;QACV,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,kDAAkD;QAC1D,UAAU,EAAE,KAAK;KAClB;IACD,eAAe,EAAE;QACf,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,gGAAgG;QACxG,UAAU,EAAE,IAAI;KACjB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,yBAAyB;QAChC,MAAM,EACJ,+JAA+J;QACjK,iGAAiG;QACjG,gEAAgE;QAChE,UAAU,EAAE,KAAK;KAClB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,gCAAgC;QACvC,MAAM,EACJ,qNAAqN;QACvN,UAAU,EAAE,KAAK;KAClB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EACJ,mKAAmK;QACrK,4FAA4F;QAC5F,UAAU,EAAE,IAAI;KACjB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,+BAA+B;QACtC,MAAM,EAAE,wGAAwG;QAChH,UAAU,EAAE,KAAK;KAClB;CACF,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Soft-ask — the in-page prompt that comes BEFORE the browser's permission prompt.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists at all, and why it is not just "prompt on load":
|
|
5
|
+
*
|
|
6
|
+
* `Notification.requestPermission()` needs transient user activation, so a page physically cannot
|
|
7
|
+
* prompt by itself. But the deeper reason is asymmetry, and it is the whole design:
|
|
8
|
+
*
|
|
9
|
+
* • A "Not now" here costs NOTHING. Ask again next week.
|
|
10
|
+
* • A browser "Block" is PERMANENT. `pushState` reports it as `blocked` with `actionable: false`
|
|
11
|
+
* precisely because the recovery lives in browser chrome the SDK cannot reach — an Enable button
|
|
12
|
+
* after a block does nothing and teaches people the product is broken.
|
|
13
|
+
*
|
|
14
|
+
* So the one irreversible prompt is spent only on people who already said yes to a reversible one.
|
|
15
|
+
* Chrome reinforces this: sites with poor accept rates get demoted to "quiet" notification UI, where
|
|
16
|
+
* the real prompt collapses into an address-bar icon almost nobody clicks. One bad auto-prompt can
|
|
17
|
+
* cost a tenant the ability to ask properly at all.
|
|
18
|
+
*
|
|
19
|
+
* ⚠️ ENTIRELY LAZY. Core sits at ~31.5 KB against a 32 KB gate, so none of this — markup, styles,
|
|
20
|
+
* trigger logic — may land in the eager bundle. `ScaleBunFacade` imports it dynamically and only when
|
|
21
|
+
* `push.softAsk` is configured, so a tenant that does not use it pays zero bytes.
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ No third-party runtime deps, per the SDK's core rule: browser APIs only.
|
|
24
|
+
*/
|
|
25
|
+
import type { PushEnableStatus } from './PushFeature';
|
|
26
|
+
export interface SoftAskOptions {
|
|
27
|
+
/**
|
|
28
|
+
* When to show it.
|
|
29
|
+
* • `'immediate'` — on init (still safe: this is OUR dialog, not the browser's)
|
|
30
|
+
* • `{ afterMs }` — after a dwell period
|
|
31
|
+
* • `{ onSelector }` — when the visitor clicks something (a bell icon, "notify me")
|
|
32
|
+
* A selector is the best of the three: intent is already expressed.
|
|
33
|
+
*/
|
|
34
|
+
trigger?: 'immediate' | {
|
|
35
|
+
afterMs: number;
|
|
36
|
+
} | {
|
|
37
|
+
onSelector: string;
|
|
38
|
+
};
|
|
39
|
+
title?: string;
|
|
40
|
+
body?: string;
|
|
41
|
+
allowText?: string;
|
|
42
|
+
denyText?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Days to wait before asking again after a "Not now". Persisted in localStorage, so a dismissal is
|
|
45
|
+
* respected across sessions — asking every page load is how a soft-ask becomes the thing it exists
|
|
46
|
+
* to prevent.
|
|
47
|
+
*/
|
|
48
|
+
remindAfterDays?: number;
|
|
49
|
+
/** Accent colour for the allow button. Defaults to the SDK brand. */
|
|
50
|
+
accent?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SoftAskDeps {
|
|
53
|
+
enable: () => Promise<PushEnableStatus>;
|
|
54
|
+
/** Current permission, so we never re-ask someone who already answered the browser. */
|
|
55
|
+
permission: () => NotificationPermission;
|
|
56
|
+
log?: (m: string) => void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Arm the soft-ask. Resolves once a decision is made (or immediately when it should not run).
|
|
60
|
+
*
|
|
61
|
+
* Every early return is a case where asking would be wrong, not merely unnecessary:
|
|
62
|
+
* • already `granted` — they are subscribed; a dialog would be noise
|
|
63
|
+
* • already `denied` — the browser prompt is unavailable, so "Allow" could not work. Offering a
|
|
64
|
+
* button that cannot succeed is worse than offering nothing.
|
|
65
|
+
* • snoozed — they said not now, and meant it
|
|
66
|
+
*/
|
|
67
|
+
export declare function armSoftAsk(opts: SoftAskOptions, deps: SoftAskDeps): Promise<void>;
|
|
68
|
+
//# sourceMappingURL=softAsk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softAsk.d.ts","sourceRoot":"","sources":["../../../src/features/push/softAsk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA6FD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,uFAAuF;IACvF,UAAU,EAAE,MAAM,sBAAsB,CAAC;IACzC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCvF"}
|