@nathanclaire/edge-telemetry-sdk 3.0.0 → 5.0.1
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 +985 -185
- package/dist/appLifecycle-DS_fEclk.cjs +2 -0
- package/dist/appLifecycle-DS_fEclk.cjs.map +1 -0
- package/dist/appLifecycle-PffQ4vC1.js +24 -0
- package/dist/appLifecycle-PffQ4vC1.js.map +1 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs +2 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs.map +1 -0
- package/dist/autoTaps.native-DQCXevD7.js +66 -0
- package/dist/autoTaps.native-DQCXevD7.js.map +1 -0
- package/dist/crashHandler.web-6KvedEB-.cjs +2 -0
- package/dist/crashHandler.web-6KvedEB-.cjs.map +1 -0
- package/dist/crashHandler.web-BUlSXYoS.js +30 -0
- package/dist/crashHandler.web-BUlSXYoS.js.map +1 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs +2 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs.map +1 -0
- package/dist/crashHandlerNative.native-DsCRd-oN.js +39 -0
- package/dist/crashHandlerNative.native-DsCRd-oN.js.map +1 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs +2 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs.map +1 -0
- package/dist/deviceInfo.native-DiiHrnI3.js +53 -0
- package/dist/deviceInfo.native-DiiHrnI3.js.map +1 -0
- package/dist/deviceInfo.web-BHsjVveq.js +41 -0
- package/dist/deviceInfo.web-BHsjVveq.js.map +1 -0
- package/dist/deviceInfo.web-DGCUHAnv.cjs +2 -0
- package/dist/deviceInfo.web-DGCUHAnv.cjs.map +1 -0
- package/dist/deviceState.native-BEysbZ6O.js +58 -0
- package/dist/deviceState.native-BEysbZ6O.js.map +1 -0
- package/dist/deviceState.native-CrQMy11_.cjs +2 -0
- package/dist/deviceState.native-CrQMy11_.cjs.map +1 -0
- package/dist/deviceState.web-ByaQm9Ry.js +14 -0
- package/dist/deviceState.web-ByaQm9Ry.js.map +1 -0
- package/dist/deviceState.web-CSfUgHDU.cjs +2 -0
- package/dist/deviceState.web-CSfUgHDU.cjs.map +1 -0
- package/dist/frameTracker-9j0en6Zm.cjs +2 -0
- package/dist/frameTracker-9j0en6Zm.cjs.map +1 -0
- package/dist/frameTracker-BzXnxSkb.js +53 -0
- package/dist/frameTracker-BzXnxSkb.js.map +1 -0
- package/dist/httpAttributes-BWXOr4eP.js +70 -0
- package/dist/httpAttributes-BWXOr4eP.js.map +1 -0
- package/dist/httpAttributes-COY0_kiF.cjs +2 -0
- package/dist/httpAttributes-COY0_kiF.cjs.map +1 -0
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.cjs.map +1 -1
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.js +173 -81
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.cjs +1 -1
- package/dist/index.web.cjs.map +1 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +107 -39
- package/dist/index.web.js.map +1 -1
- package/dist/interactionWeb.web-BWBjmovb.js +109 -0
- package/dist/interactionWeb.web-BWBjmovb.js.map +1 -0
- package/dist/interactionWeb.web-CKDJLD9r.cjs +2 -0
- package/dist/interactionWeb.web-CKDJLD9r.cjs.map +1 -0
- package/dist/interceptFetchWeb.web-DjSR_Rft.js +62 -0
- package/dist/interceptFetchWeb.web-DjSR_Rft.js.map +1 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs +2 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs.map +1 -0
- package/dist/interceptHttpNative.native-C5scIcgY.cjs +2 -0
- package/dist/interceptHttpNative.native-C5scIcgY.cjs.map +1 -0
- package/dist/interceptHttpNative.native-vF_Fksjk.js +18 -0
- package/dist/interceptHttpNative.native-vF_Fksjk.js.map +1 -0
- package/dist/loadingTime-Cj5Oh8lT.cjs +2 -0
- package/dist/loadingTime-Cj5Oh8lT.cjs.map +1 -0
- package/dist/loadingTime-DMc0zTY8.js +70 -0
- package/dist/loadingTime-DMc0zTY8.js.map +1 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs +2 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs.map +1 -0
- package/dist/memoryNative.native-DkA6f7id.js +54 -0
- package/dist/memoryNative.native-DkA6f7id.js.map +1 -0
- package/dist/nativeSender-Dt1HLaLi.js +37 -0
- package/dist/nativeSender-Dt1HLaLi.js.map +1 -0
- package/dist/nativeSender-hCgUa7Vz.cjs +2 -0
- package/dist/nativeSender-hCgUa7Vz.cjs.map +1 -0
- package/dist/navigationRef-CVIv0aIK.js +30 -0
- package/dist/navigationRef-CVIv0aIK.js.map +1 -0
- package/dist/navigationRef-CfIbeXX8.cjs +2 -0
- package/dist/navigationRef-CfIbeXX8.cjs.map +1 -0
- package/dist/navigationWeb.web-CRHpr5zl.js +51 -0
- package/dist/navigationWeb.web-CRHpr5zl.js.map +1 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs +2 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs.map +1 -0
- package/dist/{networkChange-CUO1hRLj.cjs → networkChange-2FGIQM-N.cjs} +2 -2
- package/dist/networkChange-2FGIQM-N.cjs.map +1 -0
- package/dist/{networkChange-D39hdSb0.js → networkChange-QA0893vW.js} +2 -2
- package/dist/networkChange-QA0893vW.js.map +1 -0
- package/dist/networkInfo.native-CcJ3JVRF.js +31 -0
- package/dist/networkInfo.native-CcJ3JVRF.js.map +1 -0
- package/dist/networkInfo.native-whB2wf6a.cjs +2 -0
- package/dist/networkInfo.native-whB2wf6a.cjs.map +1 -0
- package/dist/{networkInfo.web-twcNn_hc.js → networkInfo.web-CcUpXMUK.js} +4 -4
- package/dist/networkInfo.web-CcUpXMUK.js.map +1 -0
- package/dist/networkInfo.web-DfO-BUFx.cjs +2 -0
- package/dist/networkInfo.web-DfO-BUFx.cjs.map +1 -0
- package/dist/react-bqe7KPOf.cjs +4 -0
- package/dist/react-bqe7KPOf.cjs.map +1 -0
- package/dist/react-urNtDGTL.js +413 -0
- package/dist/react-urNtDGTL.js.map +1 -0
- package/dist/runtimeReady.native-CxFl1rQR.js +35 -0
- package/dist/runtimeReady.native-CxFl1rQR.js.map +1 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs +2 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs.map +1 -0
- package/dist/runtimeReady.web-JuE239Tg.js +25 -0
- package/dist/runtimeReady.web-JuE239Tg.js.map +1 -0
- package/dist/runtimeReady.web-vhAJFU61.cjs +2 -0
- package/dist/runtimeReady.web-vhAJFU61.cjs.map +1 -0
- package/dist/seedRuntimeReady-BlRdf3pR.js +10 -0
- package/dist/seedRuntimeReady-BlRdf3pR.js.map +1 -0
- package/dist/seedRuntimeReady-CbjqbWCd.cjs +2 -0
- package/dist/seedRuntimeReady-CbjqbWCd.cjs.map +1 -0
- package/dist/src/adapters/appLifecycle.d.ts +11 -4
- package/dist/src/adapters/batch.d.ts +46 -0
- package/dist/src/adapters/crashCapture.d.ts +42 -9
- package/dist/src/adapters/deviceState.d.ts +9 -0
- package/dist/src/adapters/failedEvents.d.ts +43 -0
- package/dist/src/adapters/frameAggregate.d.ts +19 -12
- package/dist/src/adapters/frameTracker.d.ts +30 -0
- package/dist/src/adapters/hangDetector.d.ts +41 -0
- package/dist/src/adapters/httpAttributes.d.ts +18 -0
- package/dist/src/adapters/loadingTime.d.ts +67 -0
- package/dist/src/adapters/manualSpans.d.ts +41 -0
- package/dist/src/adapters/native/autoTaps.native.d.ts +15 -0
- package/dist/src/adapters/native/deviceState.native.d.ts +15 -0
- package/dist/src/adapters/native/interceptHttpNative.native.d.ts +18 -0
- package/dist/src/adapters/native/memoryNative.native.d.ts +15 -11
- package/dist/src/adapters/native/networkInfo.native.d.ts +1 -1
- package/dist/src/adapters/native/runtimeReady.native.d.ts +17 -0
- package/dist/src/adapters/native/store.native.d.ts +10 -0
- package/dist/src/adapters/nativeSender.d.ts +2 -2
- package/dist/src/adapters/navigationRef.d.ts +29 -0
- package/dist/src/adapters/networkChange.d.ts +2 -2
- package/dist/src/adapters/seedRuntimeReady.d.ts +8 -0
- package/dist/src/adapters/traceHeader.d.ts +33 -0
- package/dist/src/adapters/traceManager.d.ts +144 -0
- package/dist/src/adapters/uiInteraction.d.ts +111 -0
- package/dist/src/adapters/viewManager.d.ts +177 -0
- package/dist/src/adapters/viewport.d.ts +15 -0
- package/dist/src/adapters/web/deviceState.web.d.ts +10 -0
- package/dist/src/adapters/web/interactionWeb.web.d.ts +36 -0
- package/dist/src/adapters/web/interceptFetchWeb.web.d.ts +3 -11
- package/dist/src/adapters/web/navigationWeb.web.d.ts +13 -7
- package/dist/src/adapters/web/runtimeReady.web.d.ts +5 -0
- package/dist/src/adapters/web/store.web.d.ts +12 -0
- package/dist/src/adapters/web/webVitals.web.d.ts +56 -0
- package/dist/src/adapters/webSender.d.ts +2 -2
- package/dist/src/adapters/webVitals.d.ts +25 -0
- package/dist/src/adapters/xhrIntercept.d.ts +55 -0
- package/dist/src/core/beforeSend.d.ts +20 -0
- package/dist/src/core/breadcrumbs.d.ts +10 -0
- package/dist/src/core/debug.d.ts +7 -0
- package/dist/src/core/memoryStore.d.ts +23 -0
- package/dist/src/core/store.d.ts +41 -0
- package/dist/src/core/telemetry.d.ts +422 -42
- package/dist/src/core/userProfile.d.ts +19 -0
- package/dist/src/core/utils/json.d.ts +7 -0
- package/dist/src/core/utils/uuid.d.ts +10 -1
- package/dist/src/createTelemetry.native.d.ts +10 -1
- package/dist/src/createTelemetry.web.d.ts +9 -1
- package/dist/src/golden.helper.d.ts +4 -0
- package/dist/src/index.base.d.ts +93 -3
- package/dist/src/index.native.d.ts +7 -27
- package/dist/src/index.web.d.ts +7 -23
- package/dist/src/react.d.ts +45 -0
- package/dist/src/telemetryNative.native.d.ts +79 -0
- package/dist/src/telemetryWeb.web.d.ts +59 -0
- package/dist/store.native-BbS76uWV.cjs +2 -0
- package/dist/store.native-BbS76uWV.cjs.map +1 -0
- package/dist/store.native-MlWyGgBp.js +32 -0
- package/dist/store.native-MlWyGgBp.js.map +1 -0
- package/dist/store.web-BzKaP57Z.cjs +2 -0
- package/dist/store.web-BzKaP57Z.cjs.map +1 -0
- package/dist/store.web-rhh0NOfs.js +31 -0
- package/dist/store.web-rhh0NOfs.js.map +1 -0
- package/dist/telemetry-60sfWkh0.js +1754 -0
- package/dist/telemetry-60sfWkh0.js.map +1 -0
- package/dist/telemetry-CW63glwb.cjs +2 -0
- package/dist/telemetry-CW63glwb.cjs.map +1 -0
- package/dist/uiInteraction-BIDOMcrL.js +109 -0
- package/dist/uiInteraction-BIDOMcrL.js.map +1 -0
- package/dist/uiInteraction-DxlwCVSn.cjs +2 -0
- package/dist/uiInteraction-DxlwCVSn.cjs.map +1 -0
- package/dist/viewport-9JcVIXYF.cjs +2 -0
- package/dist/viewport-9JcVIXYF.cjs.map +1 -0
- package/dist/viewport-GWTEBt2K.js +15 -0
- package/dist/viewport-GWTEBt2K.js.map +1 -0
- package/dist/web-vitals.attribution-DAvBvdng.cjs +2 -0
- package/dist/web-vitals.attribution-DAvBvdng.cjs.map +1 -0
- package/dist/web-vitals.attribution-DcoMtvlY.js +488 -0
- package/dist/web-vitals.attribution-DcoMtvlY.js.map +1 -0
- package/dist/webSender-DA087xb5.cjs +2 -0
- package/dist/webSender-DA087xb5.cjs.map +1 -0
- package/dist/webSender-g4rs5TIg.js +44 -0
- package/dist/webSender-g4rs5TIg.js.map +1 -0
- package/dist/webVitals.web-DRTDK6s5.js +100 -0
- package/dist/webVitals.web-DRTDK6s5.js.map +1 -0
- package/dist/webVitals.web-DvScDIjX.cjs +2 -0
- package/dist/webVitals.web-DvScDIjX.cjs.map +1 -0
- package/dist/xhrIntercept-9uAkQh3N.js +55 -0
- package/dist/xhrIntercept-9uAkQh3N.js.map +1 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs +2 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs.map +1 -0
- package/docs/migration-v4.md +190 -0
- package/docs/migration-v5.md +178 -0
- package/package.json +22 -6
- package/dist/appLifecycle-Cynw0kAv.js +0 -14
- package/dist/appLifecycle-Cynw0kAv.js.map +0 -1
- package/dist/appLifecycle-DvJIt7ym.cjs +0 -2
- package/dist/appLifecycle-DvJIt7ym.cjs.map +0 -1
- package/dist/batch-CLBFgYPC.cjs +0 -2
- package/dist/batch-CLBFgYPC.cjs.map +0 -1
- package/dist/batch-DLG_gtOm.js +0 -12
- package/dist/batch-DLG_gtOm.js.map +0 -1
- package/dist/crashCapture-BYTM4FLC.cjs +0 -2
- package/dist/crashCapture-BYTM4FLC.cjs.map +0 -1
- package/dist/crashCapture-D_rkkBVa.js +0 -31
- package/dist/crashCapture-D_rkkBVa.js.map +0 -1
- package/dist/crashHandler.web-BSxDpFTo.cjs +0 -2
- package/dist/crashHandler.web-BSxDpFTo.cjs.map +0 -1
- package/dist/crashHandler.web-D59bmhg9.js +0 -32
- package/dist/crashHandler.web-D59bmhg9.js.map +0 -1
- package/dist/crashHandlerNative.native-DeAFze4E.cjs +0 -2
- package/dist/crashHandlerNative.native-DeAFze4E.cjs.map +0 -1
- package/dist/crashHandlerNative.native-d7qJkzA6.js +0 -41
- package/dist/crashHandlerNative.native-d7qJkzA6.js.map +0 -1
- package/dist/debug-DsvQ9y3W.js +0 -68
- package/dist/debug-DsvQ9y3W.js.map +0 -1
- package/dist/debug-rnOOxFpN.cjs +0 -2
- package/dist/debug-rnOOxFpN.cjs.map +0 -1
- package/dist/deviceInfo.native-7hbRYixR.cjs +0 -2
- package/dist/deviceInfo.native-7hbRYixR.cjs.map +0 -1
- package/dist/deviceInfo.native-D2k0LDhI.js +0 -1171
- package/dist/deviceInfo.native-D2k0LDhI.js.map +0 -1
- package/dist/deviceInfo.web-ByNAlEJh.cjs +0 -2
- package/dist/deviceInfo.web-ByNAlEJh.cjs.map +0 -1
- package/dist/deviceInfo.web-DzQyEku6.js +0 -40
- package/dist/deviceInfo.web-DzQyEku6.js.map +0 -1
- package/dist/frameAggregate-C_HoVFcK.cjs +0 -2
- package/dist/frameAggregate-C_HoVFcK.cjs.map +0 -1
- package/dist/frameAggregate-Cwh1juw1.js +0 -17
- package/dist/frameAggregate-Cwh1juw1.js.map +0 -1
- package/dist/frameDropsNative.native-CP7zrXDf.js +0 -23
- package/dist/frameDropsNative.native-CP7zrXDf.js.map +0 -1
- package/dist/frameDropsNative.native-DKqEDqip.cjs +0 -2
- package/dist/frameDropsNative.native-DKqEDqip.cjs.map +0 -1
- package/dist/frameDropsWeb.web-C9Lt3Fuj.js +0 -22
- package/dist/frameDropsWeb.web-C9Lt3Fuj.js.map +0 -1
- package/dist/frameDropsWeb.web-azpwQCUz.cjs +0 -2
- package/dist/frameDropsWeb.web-azpwQCUz.cjs.map +0 -1
- package/dist/httpAttributes-BV50UKQU.js +0 -19
- package/dist/httpAttributes-BV50UKQU.js.map +0 -1
- package/dist/httpAttributes-xXOD9trQ.cjs +0 -2
- package/dist/httpAttributes-xXOD9trQ.cjs.map +0 -1
- package/dist/interaction-CH8yoY5-.js +0 -23
- package/dist/interaction-CH8yoY5-.js.map +0 -1
- package/dist/interaction-DcNFBW7a.cjs +0 -2
- package/dist/interaction-DcNFBW7a.cjs.map +0 -1
- package/dist/interceptFetchNative.native-VlhtMG-U.js +0 -49
- package/dist/interceptFetchNative.native-VlhtMG-U.js.map +0 -1
- package/dist/interceptFetchNative.native-jEAldH14.cjs +0 -2
- package/dist/interceptFetchNative.native-jEAldH14.cjs.map +0 -1
- package/dist/interceptFetchWeb.web-DFzZliik.cjs +0 -2
- package/dist/interceptFetchWeb.web-DFzZliik.cjs.map +0 -1
- package/dist/interceptFetchWeb.web-DfsMfoRP.js +0 -77
- package/dist/interceptFetchWeb.web-DfsMfoRP.js.map +0 -1
- package/dist/memoryNative.native-BWLh2S9L.js +0 -48
- package/dist/memoryNative.native-BWLh2S9L.js.map +0 -1
- package/dist/memoryNative.native-DCXSOd4Q.cjs +0 -2
- package/dist/memoryNative.native-DCXSOd4Q.cjs.map +0 -1
- package/dist/memoryWeb.web-B3YuV-cB.js +0 -48
- package/dist/memoryWeb.web-B3YuV-cB.js.map +0 -1
- package/dist/memoryWeb.web-CheXAcJn.cjs +0 -2
- package/dist/memoryWeb.web-CheXAcJn.cjs.map +0 -1
- package/dist/nativeSender-BE_mzw_S.js +0 -70
- package/dist/nativeSender-BE_mzw_S.js.map +0 -1
- package/dist/nativeSender-DyAUGY7c.cjs +0 -2
- package/dist/nativeSender-DyAUGY7c.cjs.map +0 -1
- package/dist/navigationNative.native-3tO5JxSd.cjs +0 -2
- package/dist/navigationNative.native-3tO5JxSd.cjs.map +0 -1
- package/dist/navigationNative.native-BUCGPQX2.js +0 -25
- package/dist/navigationNative.native-BUCGPQX2.js.map +0 -1
- package/dist/navigationTracker-B2GMwyKk.cjs +0 -2
- package/dist/navigationTracker-B2GMwyKk.cjs.map +0 -1
- package/dist/navigationTracker-Cts68dgG.js +0 -19
- package/dist/navigationTracker-Cts68dgG.js.map +0 -1
- package/dist/navigationWeb.web-B0necr5j.cjs +0 -2
- package/dist/navigationWeb.web-B0necr5j.cjs.map +0 -1
- package/dist/navigationWeb.web-CORzE_Id.js +0 -46
- package/dist/navigationWeb.web-CORzE_Id.js.map +0 -1
- package/dist/networkChange-CUO1hRLj.cjs.map +0 -1
- package/dist/networkChange-D39hdSb0.js.map +0 -1
- package/dist/networkInfo.native-BK5fpAOL.js +0 -343
- package/dist/networkInfo.native-BK5fpAOL.js.map +0 -1
- package/dist/networkInfo.native-cxuw93Uy.cjs +0 -2
- package/dist/networkInfo.native-cxuw93Uy.cjs.map +0 -1
- package/dist/networkInfo.web-DJmw1sNK.cjs +0 -2
- package/dist/networkInfo.web-DJmw1sNK.cjs.map +0 -1
- package/dist/networkInfo.web-twcNn_hc.js.map +0 -1
- package/dist/src/adapters/interaction.d.ts +0 -17
- package/dist/src/adapters/native/frameDropsNative.native.d.ts +0 -16
- package/dist/src/adapters/native/interceptFetchNative.native.d.ts +0 -23
- package/dist/src/adapters/native/navigationNative.native.d.ts +0 -12
- package/dist/src/adapters/navigationTracker.d.ts +0 -6
- package/dist/src/adapters/screenTiming.d.ts +0 -9
- package/dist/src/adapters/web/frameDropsWeb.web.d.ts +0 -16
- package/dist/src/adapters/web/memoryWeb.web.d.ts +0 -26
- package/dist/telemetry-Co4MYdwa.cjs +0 -2
- package/dist/telemetry-Co4MYdwa.cjs.map +0 -1
- package/dist/telemetry-KI0x4gzC.js +0 -389
- package/dist/telemetry-KI0x4gzC.js.map +0 -1
- package/dist/v4-BysszJq8.js +0 -31
- package/dist/v4-BysszJq8.js.map +0 -1
- package/dist/v4-CqdK_b8Y.cjs +0 -2
- package/dist/v4-CqdK_b8Y.cjs.map +0 -1
- package/dist/webSender-B27tmT1w.js +0 -42
- package/dist/webSender-B27tmT1w.js.map +0 -1
- package/dist/webSender-BWi4x1df.cjs +0 -2
- package/dist/webSender-BWi4x1df.cjs.map +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TelemetryEvent } from './core/telemetry';
|
|
2
|
+
export declare const RAW_DIR = "test/raw";
|
|
3
|
+
/** Writes `batch<suffix>-<i>.json` per batch, after removing this build's files from a prior run. */
|
|
4
|
+
export declare function dumpRaw(batches: TelemetryEvent[][], suffix?: string): void;
|
package/dist/src/index.base.d.ts
CHANGED
|
@@ -1,23 +1,112 @@
|
|
|
1
|
+
import { Telemetry } from './core/telemetry';
|
|
2
|
+
import { TaskOutcome } from './adapters/manualSpans';
|
|
3
|
+
/** What `startSpan()` returns. `end()` is idempotent, never throws, and returns nothing to await. */
|
|
4
|
+
export type SpanHandle = {
|
|
5
|
+
/** `reason` becomes `task.failure_reason` on a `failed` end, and is ignored otherwise (#179). */
|
|
6
|
+
end(opts?: {
|
|
7
|
+
outcome?: TaskOutcome;
|
|
8
|
+
reason?: string;
|
|
9
|
+
attributes?: Record<string, unknown>;
|
|
10
|
+
}): void;
|
|
11
|
+
};
|
|
1
12
|
type ProfileInput = {
|
|
2
13
|
userId?: string;
|
|
14
|
+
/** @deprecated Removed in v6 — use `identify({ name })`. */
|
|
3
15
|
fullName?: string;
|
|
16
|
+
/** @deprecated Removed in v6 — never reaches the wire (§3.4). */
|
|
4
17
|
firstName?: string;
|
|
18
|
+
/** @deprecated Removed in v6 — never reaches the wire (§3.4). */
|
|
5
19
|
lastName?: string;
|
|
6
20
|
email?: string;
|
|
7
21
|
phone?: string;
|
|
22
|
+
/** @deprecated Removed in v6 — never reaches the wire (§3.4). */
|
|
8
23
|
avatar?: string;
|
|
9
24
|
customAttributes?: Record<string, any>;
|
|
10
25
|
};
|
|
11
26
|
export declare abstract class TelemetryBase {
|
|
12
27
|
protected instancePromise: Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* The resolved core, once `instancePromise` settles — set by each entry. The synchronous
|
|
30
|
+
* methods (`startSpan`, native `trackTap`) cannot afford an `await` before they read the
|
|
31
|
+
* world: the host navigates on the very next line (§4.6's mint/emit split). Before it is
|
|
32
|
+
* set they fall back to emit-time identity.
|
|
33
|
+
*/
|
|
34
|
+
protected resolved?: Telemetry;
|
|
35
|
+
/** Run `fn` against the core now if it is resolved, else once it is. Never throws or rejects. */
|
|
36
|
+
private now;
|
|
37
|
+
/**
|
|
38
|
+
* "This screen is usable now" (#171). Synchronous, no arguments: it marks the **current**
|
|
39
|
+
* view, so your name and the SDK's cannot disagree. The time is taken now; the view is
|
|
40
|
+
* chosen one macrotask later, so a mark from a new screen's mount effect lands on that
|
|
41
|
+
* screen even though the navigation that opened it settles behind it. The `view` row then
|
|
42
|
+
* carries `view.ready_time` and `view.ready_outcome`. First mark per view wins. Before init
|
|
43
|
+
* the mark is buffered and lands on the initial view.
|
|
44
|
+
*/
|
|
45
|
+
markScreenReady(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Stop collecting, and keep nothing: the queue, the offline store and the session record
|
|
48
|
+
* are dropped, every timer stops, and the network patches pass through untouched. The flag
|
|
49
|
+
* is off before this returns. Survives only this process — persist the user's choice
|
|
50
|
+
* yourself and construct with `enabled: false` next launch.
|
|
51
|
+
*/
|
|
52
|
+
disable(): void;
|
|
53
|
+
/** Resume collection. A session that expired while disabled rotates. */
|
|
54
|
+
enable(): void;
|
|
55
|
+
/** Ship your own number. `unit` → `metric.unit`. The SDK's metric names are reserved; a non-finite value is dropped. */
|
|
56
|
+
recordMetric(name: string, value: number, attributes?: Record<string, any>, opts?: {
|
|
57
|
+
unit?: string;
|
|
58
|
+
}): Promise<any>;
|
|
59
|
+
/** Add a step to the trail of 20 that rides `app.crash` and `app.hang`. Name ≤64, ≤8 data keys, values ≤255. */
|
|
60
|
+
addBreadcrumb(name: string, data?: Record<string, unknown>): Promise<void>;
|
|
61
|
+
/** End the current session and start a fresh one — e.g. on logout. `session.reason: manual`. */
|
|
62
|
+
startNewSession(): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Time a journey: one `task.complete` row when the handle is ended. Synchronous — the
|
|
65
|
+
* trace keys, `view.id` and `session.id` freeze here. A span joins the live action's
|
|
66
|
+
* root, else mints a `custom` one; requests inside it parent to that root, not the span.
|
|
67
|
+
* Starting a name that is already open supersedes it. Blank names and a 33rd open span
|
|
68
|
+
* are inert. Misuse never throws.
|
|
69
|
+
*/
|
|
70
|
+
startSpan(name: string, attributes?: Record<string, unknown>): SpanHandle;
|
|
71
|
+
/**
|
|
72
|
+
* `startSpan` + `end` around `fn`, sync or async. A throw (or rejection) ends the span
|
|
73
|
+
* `failed` and is rethrown untouched — no `app.error` is emitted; your catch decides.
|
|
74
|
+
*/
|
|
75
|
+
withSpan<T>(name: string, fn: () => T, attributes?: Record<string, unknown>): T;
|
|
76
|
+
/**
|
|
77
|
+
* Close an open span by name — for a journey that ends in a different component. `reason`
|
|
78
|
+
* becomes `task.failure_reason` on a `failed` end (#179).
|
|
79
|
+
*/
|
|
80
|
+
endSpan(name: string, outcome?: TaskOutcome, attributes?: Record<string, unknown>, reason?: string): void;
|
|
13
81
|
log(event: string, data?: Record<string, any>): Promise<any>;
|
|
14
82
|
flush(): Promise<any>;
|
|
15
83
|
shutdown(): Promise<any>;
|
|
16
|
-
|
|
84
|
+
/**
|
|
85
|
+
* React Navigation → rung 2 of the name ladder, on **both** builds (§4.5.1, #96).
|
|
86
|
+
* `getCurrentRoute()` is a navigation-tree API that works identically on RN-Web, so a
|
|
87
|
+
* consumer wires navigation once and gets the same `view.name` on web and native.
|
|
88
|
+
*/
|
|
89
|
+
attachNavigation(navigationRef: any): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* §4.7 — report a handled error as `app.error`. Accepts `unknown`, so a `catch` block
|
|
92
|
+
* that received a string or an axios rejection object needs no narrowing first.
|
|
93
|
+
* There is no public path to `app.crash`, by design (#100).
|
|
94
|
+
*/
|
|
95
|
+
captureError(error: unknown, context?: Record<string, any>): Promise<any>;
|
|
96
|
+
/**
|
|
97
|
+
* `<EdgeErrorBoundary>`'s path (#166) — `app.error` with `error.source: boundary` and the
|
|
98
|
+
* component stack. Not for host code: `captureError()` is the public way to report.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
captureBoundaryError(error: unknown, componentStack?: string | null): Promise<any>;
|
|
102
|
+
/**
|
|
103
|
+
* Wired per entry (#160): each build imports its own crash handler. Shared code importing
|
|
104
|
+
* the native one is what made the web build resolve it at runtime and reject.
|
|
105
|
+
*/
|
|
106
|
+
abstract trackErrors(options?: {
|
|
17
107
|
captureConsole?: boolean;
|
|
18
|
-
}): Promise<
|
|
108
|
+
}): Promise<void>;
|
|
19
109
|
setUserId(id: string): Promise<void>;
|
|
20
|
-
generateUserId(): Promise<any>;
|
|
21
110
|
setUserProfile(profile: ProfileInput): Promise<void>;
|
|
22
111
|
setUserDetails(details: ProfileInput): Promise<void>;
|
|
23
112
|
updateUserProfile(updates: ProfileInput): Promise<void>;
|
|
@@ -26,6 +115,7 @@ export declare abstract class TelemetryBase {
|
|
|
26
115
|
setUserName(fullName: string, firstName?: string, lastName?: string): Promise<void>;
|
|
27
116
|
setUserContact(email?: string, phone?: string): Promise<void>;
|
|
28
117
|
identify(profile: {
|
|
118
|
+
userId?: string;
|
|
29
119
|
name?: string;
|
|
30
120
|
email?: string;
|
|
31
121
|
phone?: string;
|
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
import { TelemetryBase } from './index.base';
|
|
2
1
|
export { createTelemetry, type TelemetryOpts } from './createTelemetry.native';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
captureConsole?: boolean;
|
|
11
|
-
debug?: boolean;
|
|
12
|
-
});
|
|
13
|
-
private startSessionOnInit;
|
|
14
|
-
private attachAppState;
|
|
15
|
-
attachAppLifecycle(): Promise<void>;
|
|
16
|
-
getDeviceInfo(): Promise<any>;
|
|
17
|
-
getNetworkInfo(): Promise<any>;
|
|
18
|
-
trackFrameDrops(): Promise<any>;
|
|
19
|
-
trackNetworkRequests(): Promise<any>;
|
|
20
|
-
trackMemoryUsage(): Promise<any>;
|
|
21
|
-
screenStart(name: string): Promise<void>;
|
|
22
|
-
screenEnd(name: string): Promise<void>;
|
|
23
|
-
trackRoute(from: string, to: string): Promise<void>;
|
|
24
|
-
interactionProps(): Promise<{
|
|
25
|
-
onStartShouldSetResponderCapture: () => boolean;
|
|
26
|
-
}>;
|
|
27
|
-
attachNavigation(navigationRef: any): Promise<void>;
|
|
28
|
-
}
|
|
2
|
+
export type { TelemetryNative } from './telemetryNative.native';
|
|
3
|
+
export type { Store, SyncStore, AsyncStore, StoreRead, StoreWrite } from './core/store';
|
|
4
|
+
export { memoryStore, type MemoryStoreOpts } from './core/memoryStore';
|
|
5
|
+
export type { BeforeSend } from './core/beforeSend';
|
|
6
|
+
export type { SpanHandle } from './index.base';
|
|
7
|
+
export type { TaskOutcome } from './adapters/manualSpans';
|
|
8
|
+
export { EdgeErrorBoundary, useScreenReady, type EdgeErrorBoundaryProps } from './react';
|
package/dist/src/index.web.d.ts
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
import { TelemetryBase } from './index.base';
|
|
2
1
|
export { createTelemetry, type TelemetryOpts } from './createTelemetry.web';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
captureConsole?: boolean;
|
|
11
|
-
debug?: boolean;
|
|
12
|
-
});
|
|
13
|
-
attachAppLifecycle(): Promise<void>;
|
|
14
|
-
trackErrors(options?: {
|
|
15
|
-
captureConsole?: boolean;
|
|
16
|
-
}): Promise<any>;
|
|
17
|
-
private startSessionOnInit;
|
|
18
|
-
trackFrameDrops(): Promise<any>;
|
|
19
|
-
trackNetworkRequests(): Promise<any>;
|
|
20
|
-
trackMemoryUsage(): Promise<any>;
|
|
21
|
-
autoTrackNavigation(): Promise<any>;
|
|
22
|
-
getDeviceInfo(): Promise<any>;
|
|
23
|
-
getNetworkInfo(): Promise<any>;
|
|
24
|
-
}
|
|
2
|
+
export type { TelemetryWeb } from './telemetryWeb.web';
|
|
3
|
+
export type { Store, SyncStore, AsyncStore, StoreRead, StoreWrite } from './core/store';
|
|
4
|
+
export { memoryStore, type MemoryStoreOpts } from './core/memoryStore';
|
|
5
|
+
export type { BeforeSend } from './core/beforeSend';
|
|
6
|
+
export type { SpanHandle } from './index.base';
|
|
7
|
+
export type { TaskOutcome } from './adapters/manualSpans';
|
|
8
|
+
export { EdgeErrorBoundary, useScreenReady, type EdgeErrorBoundaryProps } from './react';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
type BoundaryTelemetry = {
|
|
3
|
+
captureBoundaryError(error: unknown, componentStack?: string | null): Promise<unknown>;
|
|
4
|
+
};
|
|
5
|
+
export type EdgeErrorBoundaryProps = {
|
|
6
|
+
telemetry: BoundaryTelemetry;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Rendered in place of the failed subtree: a node, or a render function given the error and a reset. */
|
|
9
|
+
fallback?: ReactNode | ((props: {
|
|
10
|
+
error: unknown;
|
|
11
|
+
resetError: () => void;
|
|
12
|
+
}) => ReactNode);
|
|
13
|
+
/** Runs after the SDK's emit. A throw here is swallowed — your handler cannot break the boundary. */
|
|
14
|
+
onError?: (error: unknown, info: ErrorInfo) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Reports a caught render error as `app.error`, `error.source: boundary` — **never**
|
|
18
|
+
* `app.crash`: the boundary handled it — exactly once. The error is marked in
|
|
19
|
+
* `getDerivedStateFromError`, before React's own reporting, so `captureConsole` and the
|
|
20
|
+
* global handlers skip it.
|
|
21
|
+
*/
|
|
22
|
+
export declare class EdgeErrorBoundary extends Component<EdgeErrorBoundaryProps, {
|
|
23
|
+
error?: unknown;
|
|
24
|
+
failed: boolean;
|
|
25
|
+
}> {
|
|
26
|
+
state: {
|
|
27
|
+
error: unknown;
|
|
28
|
+
failed: boolean;
|
|
29
|
+
};
|
|
30
|
+
static getDerivedStateFromError(error: unknown): {
|
|
31
|
+
error: unknown;
|
|
32
|
+
failed: boolean;
|
|
33
|
+
};
|
|
34
|
+
componentDidCatch(error: unknown, info: ErrorInfo): void;
|
|
35
|
+
resetError: () => void;
|
|
36
|
+
render(): ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Marks the current screen ready (#171) once `ready` is truthy — `useScreenReady(telemetry,
|
|
40
|
+
* !loading)`. First mark per view wins, so re-renders and a `ready` that flips back are harmless.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useScreenReady(telemetry: {
|
|
43
|
+
markScreenReady(): void;
|
|
44
|
+
}, ready?: unknown): void;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { TelemetryBase } from './index.base';
|
|
2
|
+
import { Store } from './core/store';
|
|
3
|
+
import { BeforeSend } from './core/beforeSend';
|
|
4
|
+
export declare class TelemetryNative extends TelemetryBase {
|
|
5
|
+
/** ≥3 named taps in a 1000 ms window, keyed on the name — see `trackTap`. */
|
|
6
|
+
private readonly tapRage;
|
|
7
|
+
/** Explicit `trackTap()` calls so far — an auto row is skipped when one fired inside its handler. */
|
|
8
|
+
private explicitTaps;
|
|
9
|
+
constructor(opts?: {
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
sender?: any;
|
|
12
|
+
batchSize?: number;
|
|
13
|
+
flushIntervalMs?: number;
|
|
14
|
+
endpoint?: string;
|
|
15
|
+
captureConsole?: boolean;
|
|
16
|
+
debug?: boolean;
|
|
17
|
+
store?: Store;
|
|
18
|
+
beforeSend?: BeforeSend;
|
|
19
|
+
sessionSampleRate?: number;
|
|
20
|
+
traceHostAllowlist?: string[];
|
|
21
|
+
buildId?: string;
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
autoTrackTaps?: boolean;
|
|
24
|
+
});
|
|
25
|
+
attachAppLifecycle(): Promise<void>;
|
|
26
|
+
trackErrors(options?: {
|
|
27
|
+
captureConsole?: boolean;
|
|
28
|
+
}): Promise<any>;
|
|
29
|
+
getDeviceInfo(): Promise<any>;
|
|
30
|
+
getNetworkInfo(): Promise<any>;
|
|
31
|
+
trackFrameDrops(): Promise<any>;
|
|
32
|
+
trackNetworkRequests(): Promise<any>;
|
|
33
|
+
trackMemoryUsage(): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* Rung 1 of the name ladder (§4.5.1) — `explicit`, and never normalized: a host naming a
|
|
36
|
+
* screen "Step 2 of 3" must not receive "Step {id} of {id}". Emits no `navigation` (#163).
|
|
37
|
+
*/
|
|
38
|
+
screenStart(name: string): Promise<any>;
|
|
39
|
+
/** @deprecated No-op since v5 (#163) — `screen.duration` is gone; `view.time_spent` replaces it. Deleted in v6. */
|
|
40
|
+
screenEnd(_name: string): Promise<void>;
|
|
41
|
+
/** @deprecated No-op since v5 (#163) — use `attachNavigation(ref)` or `screenStart(name)`. Deleted in v6. */
|
|
42
|
+
trackRoute(_from: string, _to: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* §4.6's native producer, explicit-only (#103). `interactionProps()` is gone with
|
|
45
|
+
* `user.interaction` (#102): it sat on the consumer's **root** `<View>`, where
|
|
46
|
+
* `PressEvent.nativeEvent.target` is a node tag number with no public API resolving it,
|
|
47
|
+
* so it could not tell a tap on a button from a tap on padding and every row it emitted
|
|
48
|
+
* was un-nameable. There is no role model to gate on and no DOM to derive from, so
|
|
49
|
+
* anything auto-derived here would be either wrong or a PII leak.
|
|
50
|
+
*
|
|
51
|
+
* `name` is web's rung 1 — explicit author intent — so it ships **unnormalized and
|
|
52
|
+
* uncapped**, and `ui.name_source` has exactly **two** values: `edge_action`, or `none`
|
|
53
|
+
* for a blank name, whose `ui.target` is `unnamed`. **`surface` never appears**: it only
|
|
54
|
+
* means something where role-less elements exist.
|
|
55
|
+
*
|
|
56
|
+
* ⚠ **The mint/emit split.** The row's `timestamp`, `view.id`, `view.name` and
|
|
57
|
+
* `session.id` are snapshotted **here, synchronously**, because the host's press handler
|
|
58
|
+
* navigates on the next line and the emit rides a promise. Stamping emit time would
|
|
59
|
+
* attribute a navigating tap to **the view it opened**, inverting every "which screen
|
|
60
|
+
* frustrates users" query. Before `instancePromise` settles there is no core to snapshot
|
|
61
|
+
* from, so a tap that early falls back to emit-time identity — the launch view either
|
|
62
|
+
* way.
|
|
63
|
+
*
|
|
64
|
+
* ⚠ **`ui.dead` is absent on every native row**, never `false`: with no DOM there is no
|
|
65
|
+
* mutation signal, so any dead-click *rate* must filter to the web build.
|
|
66
|
+
*/
|
|
67
|
+
trackTap(name: string): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* #174's hook. Patches `react/jsx-runtime`, `react/jsx-dev-runtime` and `React.createElement`
|
|
70
|
+
* — the module exports objects, which is what Babel's `(0, _jsxRuntime.jsx)` reads — so an
|
|
71
|
+
* element with a function `onPress`/`onLongPress` gets a wrapper that emits on activation.
|
|
72
|
+
*
|
|
73
|
+
* Names never come from text or accessibility labels (`"Pay John Kamau KES 5,000"`):
|
|
74
|
+
* `trackTap(name)` > `testID` (normalized like web rung 2, cap 64) > `unnamed`. Identity is
|
|
75
|
+
* snapshotted and the interaction root minted **before** the handler runs; the row is emitted
|
|
76
|
+
* after it, and skipped if the handler called `trackTap` itself.
|
|
77
|
+
*/
|
|
78
|
+
private autoTrackTaps;
|
|
79
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { TelemetryBase } from './index.base';
|
|
2
|
+
import { SyncStore } from './core/store';
|
|
3
|
+
import { BeforeSend } from './core/beforeSend';
|
|
4
|
+
export declare class TelemetryWeb extends TelemetryBase {
|
|
5
|
+
constructor(opts?: {
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
sender?: any;
|
|
8
|
+
batchSize?: number;
|
|
9
|
+
flushIntervalMs?: number;
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
captureConsole?: boolean;
|
|
12
|
+
debug?: boolean;
|
|
13
|
+
store?: SyncStore;
|
|
14
|
+
beforeSend?: BeforeSend;
|
|
15
|
+
sessionSampleRate?: number;
|
|
16
|
+
traceHostAllowlist?: string[];
|
|
17
|
+
buildId?: string;
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* #161 — the session record is `localStorage`, shared by every tab, but each tab keeps its
|
|
22
|
+
* own in-memory `lastActivity`. The `storage` event fires in every *other* tab on a write,
|
|
23
|
+
* so this tab adopts the sibling's progress — or its rotation — instead of diverging and
|
|
24
|
+
* finalizing the same `session.id` a second time. Native has no sibling and no listener.
|
|
25
|
+
*/
|
|
26
|
+
private attachCrossTabSync;
|
|
27
|
+
/**
|
|
28
|
+
* A bfcache restore resumes a frozen JS context, so the in-memory session survives on its
|
|
29
|
+
* own — but the freeze can have outlasted the idle window, and a sibling tab may have
|
|
30
|
+
* rotated the shared localStorage record while this one was suspended. Re-running the
|
|
31
|
+
* init decision against the Store is what reconciles both (#92, §4.2).
|
|
32
|
+
*/
|
|
33
|
+
private attachBfcacheRestore;
|
|
34
|
+
attachAppLifecycle(): Promise<void>;
|
|
35
|
+
trackErrors(options?: {
|
|
36
|
+
captureConsole?: boolean;
|
|
37
|
+
}): Promise<any>;
|
|
38
|
+
trackFrameDrops(): Promise<any>;
|
|
39
|
+
trackNetworkRequests(): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* §4.6/#102 — one capture-phase `click` listener on `document`. Auto-started, like every
|
|
42
|
+
* other capture: `ui.interaction` is what §6.2's interaction root hangs off, so a
|
|
43
|
+
* consumer forgetting to call it would leave every tap-driven request unattributed.
|
|
44
|
+
*/
|
|
45
|
+
trackInteractions(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* §5.3/#106 — the five Core Web Vitals on the metric path, web only. Auto-started and
|
|
48
|
+
* deliberately not public API: there is nothing for a consumer to configure, and a vital
|
|
49
|
+
* that only fires if someone remembered to call a method is a vital nobody has.
|
|
50
|
+
*
|
|
51
|
+
* `web-vitals/attribution` is bundled, so this is the only import of it in the tree and
|
|
52
|
+
* `index.native` never reaches it. A failed chunk load is caught by the caller and costs
|
|
53
|
+
* the vitals, nothing else.
|
|
54
|
+
*/
|
|
55
|
+
private trackWebVitals;
|
|
56
|
+
autoTrackNavigation(): Promise<any>;
|
|
57
|
+
getDeviceInfo(): Promise<any>;
|
|
58
|
+
getNetworkInfo(): Promise<any>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@react-native-async-storage/async-storage");function r(){return{sync:!1,async get(t){try{const e=await a.getItem(t);return e==null?{status:"miss"}:{status:"hit",value:e}}catch{return{status:"unavailable"}}},async set(t,e){try{return await a.setItem(t,e),{status:"ok"}}catch{return{status:"unavailable"}}},async remove(t){try{return await a.removeItem(t),{status:"ok"}}catch{return{status:"unavailable"}}}}}exports.nativeStore=r;
|
|
2
|
+
//# sourceMappingURL=store.native-BbS76uWV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.native-BbS76uWV.cjs","sources":["../src/adapters/native/store.native.ts"],"sourcesContent":["import AsyncStorage from \"@react-native-async-storage/async-storage\";\nimport type { AsyncStore, StoreRead, StoreWrite } from \"../../core/store\";\n\n/**\n * AsyncStorage-backed Store for the native build (#89). Reads settle later, so a\n * caller cannot assume a write has landed before the process dies — the crash-loss\n * window narrows here, it does not close. The port keeps that visible.\n *\n * A rejected AsyncStorage call — no native module linked, SQLite/disk full — is\n * `unavailable`, distinct from a key that simply isn't there.\n */\nexport function nativeStore(): AsyncStore {\n return {\n sync: false,\n async get(key: string): Promise<StoreRead> {\n try {\n const value = await AsyncStorage.getItem(key);\n return value === null || value === undefined\n ? { status: \"miss\" }\n : { status: \"hit\", value };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n async set(key: string, value: string): Promise<StoreWrite> {\n try {\n await AsyncStorage.setItem(key, value);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n async remove(key: string): Promise<StoreWrite> {\n try {\n await AsyncStorage.removeItem(key);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n };\n}\n"],"names":["nativeStore","key","value","AsyncStorage"],"mappings":"6IAWO,SAASA,GAA0B,CACtC,MAAO,CACH,KAAM,GACN,MAAM,IAAIC,EAAiC,CACvC,GAAI,CACA,MAAMC,EAAQ,MAAMC,EAAa,QAAQF,CAAG,EAC5C,OAAOC,GAAU,KACX,CAAE,OAAQ,QACV,CAAE,OAAQ,MAAO,MAAAA,CAAA,CAC3B,MAAQ,CACJ,MAAO,CAAE,OAAQ,aAAA,CACrB,CACJ,EACA,MAAM,IAAID,EAAaC,EAAoC,CACvD,GAAI,CACA,aAAMC,EAAa,QAAQF,EAAKC,CAAK,EAC9B,CAAE,OAAQ,IAAA,CACrB,MAAQ,CACJ,MAAO,CAAE,OAAQ,aAAA,CACrB,CACJ,EACA,MAAM,OAAOD,EAAkC,CAC3C,GAAI,CACA,aAAME,EAAa,WAAWF,CAAG,EAC1B,CAAE,OAAQ,IAAA,CACrB,MAAQ,CACJ,MAAO,CAAE,OAAQ,aAAA,CACrB,CACJ,CAAA,CAER"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import e from "@react-native-async-storage/async-storage";
|
|
2
|
+
function r() {
|
|
3
|
+
return {
|
|
4
|
+
sync: !1,
|
|
5
|
+
async get(t) {
|
|
6
|
+
try {
|
|
7
|
+
const a = await e.getItem(t);
|
|
8
|
+
return a == null ? { status: "miss" } : { status: "hit", value: a };
|
|
9
|
+
} catch {
|
|
10
|
+
return { status: "unavailable" };
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
async set(t, a) {
|
|
14
|
+
try {
|
|
15
|
+
return await e.setItem(t, a), { status: "ok" };
|
|
16
|
+
} catch {
|
|
17
|
+
return { status: "unavailable" };
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
async remove(t) {
|
|
21
|
+
try {
|
|
22
|
+
return await e.removeItem(t), { status: "ok" };
|
|
23
|
+
} catch {
|
|
24
|
+
return { status: "unavailable" };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
r as nativeStore
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=store.native-MlWyGgBp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.native-MlWyGgBp.js","sources":["../src/adapters/native/store.native.ts"],"sourcesContent":["import AsyncStorage from \"@react-native-async-storage/async-storage\";\nimport type { AsyncStore, StoreRead, StoreWrite } from \"../../core/store\";\n\n/**\n * AsyncStorage-backed Store for the native build (#89). Reads settle later, so a\n * caller cannot assume a write has landed before the process dies — the crash-loss\n * window narrows here, it does not close. The port keeps that visible.\n *\n * A rejected AsyncStorage call — no native module linked, SQLite/disk full — is\n * `unavailable`, distinct from a key that simply isn't there.\n */\nexport function nativeStore(): AsyncStore {\n return {\n sync: false,\n async get(key: string): Promise<StoreRead> {\n try {\n const value = await AsyncStorage.getItem(key);\n return value === null || value === undefined\n ? { status: \"miss\" }\n : { status: \"hit\", value };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n async set(key: string, value: string): Promise<StoreWrite> {\n try {\n await AsyncStorage.setItem(key, value);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n async remove(key: string): Promise<StoreWrite> {\n try {\n await AsyncStorage.removeItem(key);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n };\n}\n"],"names":["nativeStore","key","value","AsyncStorage"],"mappings":";AAWO,SAASA,IAA0B;AACtC,SAAO;AAAA,IACH,MAAM;AAAA,IACN,MAAM,IAAIC,GAAiC;AACvC,UAAI;AACA,cAAMC,IAAQ,MAAMC,EAAa,QAAQF,CAAG;AAC5C,eAAOC,KAAU,OACX,EAAE,QAAQ,WACV,EAAE,QAAQ,OAAO,OAAAA,EAAA;AAAA,MAC3B,QAAQ;AACJ,eAAO,EAAE,QAAQ,cAAA;AAAA,MACrB;AAAA,IACJ;AAAA,IACA,MAAM,IAAID,GAAaC,GAAoC;AACvD,UAAI;AACA,qBAAMC,EAAa,QAAQF,GAAKC,CAAK,GAC9B,EAAE,QAAQ,KAAA;AAAA,MACrB,QAAQ;AACJ,eAAO,EAAE,QAAQ,cAAA;AAAA,MACrB;AAAA,IACJ;AAAA,IACA,MAAM,OAAOD,GAAkC;AAC3C,UAAI;AACA,qBAAME,EAAa,WAAWF,CAAG,GAC1B,EAAE,QAAQ,KAAA;AAAA,MACrB,QAAQ;AACJ,eAAO,EAAE,QAAQ,cAAA;AAAA,MACrB;AAAA,IACJ;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(){return{sync:!0,get(t){try{const e=localStorage.getItem(t);return e===null?{status:"miss"}:{status:"hit",value:e}}catch{return{status:"unavailable"}}},set(t,e){try{return localStorage.setItem(t,e),{status:"ok"}}catch{return{status:"unavailable"}}},remove(t){try{return localStorage.removeItem(t),{status:"ok"}}catch{return{status:"unavailable"}}}}}exports.webStore=r;
|
|
2
|
+
//# sourceMappingURL=store.web-BzKaP57Z.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.web-BzKaP57Z.cjs","sources":["../src/adapters/web/store.web.ts"],"sourcesContent":["import type { StoreRead, StoreWrite, SyncStore } from \"../../core/store\";\n\n/**\n * localStorage-backed Store for the web build (#89). Reads are synchronous, and\n * that is the point: state written here is durable before the next line runs, so\n * the crash-loss window closes rather than narrows.\n *\n * Every access is guarded. Touching `localStorage` throws — not returns null — in\n * incognito with cookies blocked, in a partitioned third-party iframe, and once\n * quota is exhausted; and the identifier isn't declared at all outside a browser.\n * All of those are `unavailable`, never an exception out of the SDK.\n */\nexport function webStore(): SyncStore {\n return {\n sync: true,\n get(key: string): StoreRead {\n try {\n const value = localStorage.getItem(key);\n return value === null ? { status: \"miss\" } : { status: \"hit\", value };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n set(key: string, value: string): StoreWrite {\n try {\n localStorage.setItem(key, value);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n remove(key: string): StoreWrite {\n try {\n localStorage.removeItem(key);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n };\n}\n"],"names":["webStore","key","value"],"mappings":"gFAYO,SAASA,GAAsB,CAClC,MAAO,CACH,KAAM,GACN,IAAIC,EAAwB,CACxB,GAAI,CACA,MAAMC,EAAQ,aAAa,QAAQD,CAAG,EACtC,OAAOC,IAAU,KAAO,CAAE,OAAQ,QAAW,CAAE,OAAQ,MAAO,MAAAA,CAAA,CAClE,MAAQ,CACJ,MAAO,CAAE,OAAQ,aAAA,CACrB,CACJ,EACA,IAAID,EAAaC,EAA2B,CACxC,GAAI,CACA,oBAAa,QAAQD,EAAKC,CAAK,EACxB,CAAE,OAAQ,IAAA,CACrB,MAAQ,CACJ,MAAO,CAAE,OAAQ,aAAA,CACrB,CACJ,EACA,OAAOD,EAAyB,CAC5B,GAAI,CACA,oBAAa,WAAWA,CAAG,EACpB,CAAE,OAAQ,IAAA,CACrB,MAAQ,CACJ,MAAO,CAAE,OAAQ,aAAA,CACrB,CACJ,CAAA,CAER"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function a() {
|
|
2
|
+
return {
|
|
3
|
+
sync: !0,
|
|
4
|
+
get(t) {
|
|
5
|
+
try {
|
|
6
|
+
const e = localStorage.getItem(t);
|
|
7
|
+
return e === null ? { status: "miss" } : { status: "hit", value: e };
|
|
8
|
+
} catch {
|
|
9
|
+
return { status: "unavailable" };
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
set(t, e) {
|
|
13
|
+
try {
|
|
14
|
+
return localStorage.setItem(t, e), { status: "ok" };
|
|
15
|
+
} catch {
|
|
16
|
+
return { status: "unavailable" };
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
remove(t) {
|
|
20
|
+
try {
|
|
21
|
+
return localStorage.removeItem(t), { status: "ok" };
|
|
22
|
+
} catch {
|
|
23
|
+
return { status: "unavailable" };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
a as webStore
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=store.web-rhh0NOfs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.web-rhh0NOfs.js","sources":["../src/adapters/web/store.web.ts"],"sourcesContent":["import type { StoreRead, StoreWrite, SyncStore } from \"../../core/store\";\n\n/**\n * localStorage-backed Store for the web build (#89). Reads are synchronous, and\n * that is the point: state written here is durable before the next line runs, so\n * the crash-loss window closes rather than narrows.\n *\n * Every access is guarded. Touching `localStorage` throws — not returns null — in\n * incognito with cookies blocked, in a partitioned third-party iframe, and once\n * quota is exhausted; and the identifier isn't declared at all outside a browser.\n * All of those are `unavailable`, never an exception out of the SDK.\n */\nexport function webStore(): SyncStore {\n return {\n sync: true,\n get(key: string): StoreRead {\n try {\n const value = localStorage.getItem(key);\n return value === null ? { status: \"miss\" } : { status: \"hit\", value };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n set(key: string, value: string): StoreWrite {\n try {\n localStorage.setItem(key, value);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n remove(key: string): StoreWrite {\n try {\n localStorage.removeItem(key);\n return { status: \"ok\" };\n } catch {\n return { status: \"unavailable\" };\n }\n },\n };\n}\n"],"names":["webStore","key","value"],"mappings":"AAYO,SAASA,IAAsB;AAClC,SAAO;AAAA,IACH,MAAM;AAAA,IACN,IAAIC,GAAwB;AACxB,UAAI;AACA,cAAMC,IAAQ,aAAa,QAAQD,CAAG;AACtC,eAAOC,MAAU,OAAO,EAAE,QAAQ,WAAW,EAAE,QAAQ,OAAO,OAAAA,EAAA;AAAA,MAClE,QAAQ;AACJ,eAAO,EAAE,QAAQ,cAAA;AAAA,MACrB;AAAA,IACJ;AAAA,IACA,IAAID,GAAaC,GAA2B;AACxC,UAAI;AACA,4BAAa,QAAQD,GAAKC,CAAK,GACxB,EAAE,QAAQ,KAAA;AAAA,MACrB,QAAQ;AACJ,eAAO,EAAE,QAAQ,cAAA;AAAA,MACrB;AAAA,IACJ;AAAA,IACA,OAAOD,GAAyB;AAC5B,UAAI;AACA,4BAAa,WAAWA,CAAG,GACpB,EAAE,QAAQ,KAAA;AAAA,MACrB,QAAQ;AACJ,eAAO,EAAE,QAAQ,cAAA;AAAA,MACrB;AAAA,IACJ;AAAA,EAAA;AAER;"}
|