🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sentry/replay

Package Overview
Dependencies
Maintainers
1
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/replay - npm Package Compare versions

Comparing version
8.0.0-alpha.5
to
10.58.0
build/npm/cjs/index.js

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

+1
var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return {b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1;}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l;}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return (t+7)/8|0},b=function(n,r,e){return (null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8;},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16;},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return {t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e;}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s;}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w);}g=e;}return {t:new t(p),l:g}},A=function(t,n,r){return -1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t;},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else {if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0);}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0);}for(;a--;)o(s);a=1,s=t[h];}return {c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12);}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et]);}else _(r,m,N[rt]),m+=P[rt];}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r;}return t}(),S=function(){var t=1,n=0;return {p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16);}t=e,n=i;},d:function(){return (255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length;}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return (s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0;}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt);}}}W+=(J=K)-(K=_[J])&32767;}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L;}else F[q++]=s[j],++I[s[j]];}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B);}else {for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at));}c.i=v;}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8;},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length;}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n);},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i;}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768;}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2);},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2;},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return {p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r;},d:function(){return ~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e);}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n);}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n);},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d());}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n);},t.prototype.flush=function(){j.prototype.flush.call(this);},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0});}catch(t){}var J=function(){function t(t){this.ondata=t;}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1);},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t;},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h;}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f));}return b(i,0,s)}const N=new class{constructor(){this._init();}clear(){this._init();}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0;}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length;}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t);},this.stream=new J((t,n)=>{this.deflate.push(t,n);}),this.stream.push("[");}},P={clear:()=>{N.clear();},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t});}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t);}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

{"type":"module","version":"10.58.0","sideEffects":false}
var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return {b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1;}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l;}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return (t+7)/8|0},b=function(n,r,e){return (null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8;},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16;},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return {t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e;}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s;}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w);}g=e;}return {t:new t(p),l:g}},A=function(t,n,r){return -1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t;},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else {if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0);}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0);}for(;a--;)o(s);a=1,s=t[h];}return {c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12);}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et]);}else _(r,m,N[rt]),m+=P[rt];}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r;}return t}(),S=function(){var t=1,n=0;return {p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16);}t=e,n=i;},d:function(){return (255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length;}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return (s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0;}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt);}}}W+=(J=K)-(K=_[J])&32767;}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L;}else F[q++]=s[j],++I[s[j]];}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B);}else {for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at));}c.i=v;}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8;},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length;}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n);},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i;}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768;}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2);},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2;},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return {p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r;},d:function(){return ~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e);}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n);}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n);},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d());}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n);},t.prototype.flush=function(){j.prototype.flush.call(this);},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0});}catch(t){}var J=function(){function t(t){this.ondata=t;}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1);},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t;},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h;}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f));}return b(i,0,s)}const N=new class{constructor(){this._init();}clear(){this._init();}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0;}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length;}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t);},this.stream=new J((t,n)=>{this.deflate.push(t,n);}),this.stream.push("[");}},P={clear:()=>{N.clear();},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t});}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t);}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});
import { GLOBAL_OBJ } from '@sentry/core';
export declare const WINDOW: typeof GLOBAL_OBJ & Window;
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
export declare const REPLAY_EVENT_NAME = "replay_event";
export declare const RECORDING_EVENT_NAME = "replay_recording";
export declare const UNABLE_TO_SEND_REPLAY = "Unable to send Replay";
export declare const SESSION_IDLE_PAUSE_DURATION = 300000;
export declare const SESSION_IDLE_EXPIRE_DURATION = 900000;
/** Default flush delays */
export declare const DEFAULT_FLUSH_MIN_DELAY = 5000;
export declare const DEFAULT_FLUSH_MAX_DELAY = 5500;
export declare const BUFFER_CHECKOUT_TIME = 60000;
export declare const RETRY_BASE_INTERVAL = 5000;
export declare const RETRY_MAX_COUNT = 3;
export declare const NETWORK_BODY_MAX_SIZE = 150000;
export declare const CONSOLE_ARG_MAX_SIZE = 5000;
export declare const SLOW_CLICK_THRESHOLD = 3000;
export declare const SLOW_CLICK_SCROLL_TIMEOUT = 300;
/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */
export declare const REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000;
/** Replays must be min. 5s long before we send them. */
export declare const MIN_REPLAY_DURATION = 4999;
export declare const MIN_REPLAY_DURATION_LIMIT = 50000;
/** The max. length of a replay. */
export declare const MAX_REPLAY_DURATION = 3600000;
/** Default attributes to be ignored when `maskAllText` is enabled */
export declare const DEFAULT_IGNORED_ATTRIBUTES: string[];
//# sourceMappingURL=constants.d.ts.map
import { Event, TransportMakeRequestResponse } from '@sentry/core';
import { ReplayContainer } from '../types';
type AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback;
export {};
//# sourceMappingURL=handleAfterSendEvent.d.ts.map
import { Event } from '@sentry/core';
import { ReplayContainer } from '../types';
type BeforeSendEventCallback = (event: Event) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleBeforeSendEvent(replay: ReplayContainer): BeforeSendEventCallback;
export {};
//# sourceMappingURL=handleBeforeSendEvent.d.ts.map
import { Breadcrumb } from '@sentry/core';
import { ReplayContainer } from '../types';
import { ReplayFrame } from '../types/replayFrame';
type BreadcrumbWithCategory = Required<Pick<Breadcrumb, 'category'>>;
/**
* Handle breadcrumbs that Sentry captures, and make sure to capture relevant breadcrumbs to Replay as well.
*/
export declare function handleBreadcrumbs(replay: ReplayContainer): void;
/** Exported only for tests. */
export declare function normalizeBreadcrumb(breadcrumb: Breadcrumb): Breadcrumb | null;
/** exported for tests only */
export declare function normalizeConsoleBreadcrumb(breadcrumb: Pick<Breadcrumb, Exclude<keyof Breadcrumb, 'category'>> & BreadcrumbWithCategory): ReplayFrame;
export {};
//# sourceMappingURL=handleBreadcrumbs.d.ts.map
import { Breadcrumb } from '@sentry/core';
import { RecordingEvent, ReplayClickDetector, ReplayContainer, SlowClickConfig } from '../types';
import { addBreadcrumbEvent } from './util/addBreadcrumbEvent';
/** Handle a click. */
export declare function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void;
/** A click detector class that can be used to detect slow or rage clicks on elements. */
export declare class ClickDetector implements ReplayClickDetector {
protected _lastMutation: number;
protected _lastScroll: number;
private _clicks;
private _teardown;
private _threshold;
private _scrollTimeout;
private _timeout;
private _ignoreSelector;
private _replay;
private _checkClickTimeout?;
private _addBreadcrumbEvent;
constructor(replay: ReplayContainer, slowClickConfig: SlowClickConfig, _addBreadcrumbEvent?: typeof addBreadcrumbEvent);
/** Register click detection handlers on mutation or scroll. */
addListeners(): void;
/** Clean up listeners. */
removeListeners(): void;
/** @inheritDoc */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** @inheritDoc */
registerMutation(timestamp?: number): void;
/** @inheritDoc */
registerScroll(timestamp?: number): void;
/** @inheritDoc */
registerClick(element: HTMLElement): void;
/** Count multiple clicks on elements. */
private _handleMultiClick;
/** Get all pending clicks for a given node. */
private _getClicks;
/** Check the clicks that happened. */
private _checkClicks;
/** Generate matching breadcrumb(s) for the click. */
private _generateBreadcrumbs;
/** Schedule to check current clicks. */
private _scheduleCheckClicks;
}
/** exported for tests only */
export declare function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean;
/** Update the click detector based on a recording event of rrweb. */
export declare function updateClickDetectorForRecordingEvent(clickDetector: ReplayClickDetector, event: RecordingEvent): void;
//# sourceMappingURL=handleClick.d.ts.map
import { Breadcrumb, HandlerDataDom } from '@sentry/core';
import { ReplayContainer } from '../types';
export declare const handleDomListener: (replay: ReplayContainer) => (handlerData: HandlerDataDom) => void;
/** Get the base DOM breadcrumb. */
export declare function getBaseDomBreadcrumb(target: Node | null, message: string): Breadcrumb;
/**
* An event handler to react to DOM events.
* Exported for tests.
*/
export declare function handleDom(handlerData: HandlerDataDom): Breadcrumb | null;
//# sourceMappingURL=handleDom.d.ts.map
import { Event, EventHint } from '@sentry/core';
import { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addEventProcessor(listener)`.
*/
export declare function handleGlobalEventListener(replay: ReplayContainer): (event: Event, hint: EventHint) => Event | null;
//# sourceMappingURL=handleGlobalEvent.d.ts.map
import { HandlerDataHistory } from '@sentry/core';
import { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`.
*/
export declare function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HandlerDataHistory) => void;
//# sourceMappingURL=handleHistory.d.ts.map
import { Breadcrumb } from '@sentry/core';
import { ReplayContainer } from '../types';
/** Handle keyboard events & create breadcrumbs. */
export declare function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void;
/** exported only for tests */
export declare function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null;
//# sourceMappingURL=handleKeyboardEvent.d.ts.map
import { Breadcrumb, BreadcrumbHint } from '@sentry/core';
import { ReplayContainer, ReplayNetworkOptions } from '../types';
interface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {
replay: ReplayContainer;
}
/**
* This method does two things:
* - It enriches the regular XHR/fetch breadcrumbs with request/response size data
* - It captures the XHR/fetch breadcrumbs to the replay
* (enriching it with further data that is _not_ added to the regular breadcrumbs)
*/
export declare function handleNetworkBreadcrumbs(replay: ReplayContainer): void;
/** just exported for tests */
export declare function beforeAddNetworkBreadcrumb(options: ExtendedNetworkBreadcrumbsOptions, breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
export {};
//# sourceMappingURL=handleNetworkBreadcrumbs.d.ts.map
import { ReplayContainer } from '../types';
/**
* Sets up a PerformanceObserver to listen to all performance entry types.
* Returns a callback to stop observing.
*/
export declare function setupPerformanceObserver(replay: ReplayContainer): () => void;
//# sourceMappingURL=performanceObserver.d.ts.map
import { Breadcrumb } from '@sentry/core';
import { ReplayContainer } from '../../types';
/**
* Add a breadcrumb event to replay.
*/
export declare function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void;
//# sourceMappingURL=addBreadcrumbEvent.d.ts.map
import { FeedbackEvent } from '@sentry/core';
import { ReplayContainer } from '../../types';
/**
* Add a feedback breadcrumb event to replay.
*/
export declare function addFeedbackBreadcrumb(replay: ReplayContainer, event: FeedbackEvent): void;
//# sourceMappingURL=addFeedbackBreadcrumb.d.ts.map
import { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';
/** Add a performance entry breadcrumb */
export declare function addNetworkBreadcrumb(replay: ReplayContainer, result: ReplayPerformanceEntry<NetworkRequestData> | null): void;
//# sourceMappingURL=addNetworkBreadcrumb.d.ts.map
import { INode } from '@sentry/rrweb-snapshot';
/** Get the closest interactive parent element, or else return the given element. */
export declare function getClosestInteractive(element: Element): Element;
/**
* For clicks, we check if the target is inside of a button or link
* If so, we use this as the target instead
* This is useful because if you click on the image in <button><img></button>,
* The target will be the image, not the button, which we don't want here
*/
export declare function getClickTargetNode(event: Event | MouseEvent | Node): Node | INode | null;
/** Get the event target node. */
export declare function getTargetNode(event: Node | {
target: EventTarget | null;
}): Node | INode | null;
//# sourceMappingURL=domUtils.d.ts.map
import { Breadcrumb, FetchBreadcrumbData } from '@sentry/core';
import { FetchHint } from '@sentry/browser-utils';
import { ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestOrResponse } from '../../types';
/**
* Capture a fetch breadcrumb to a replay.
* This adds additional data (where appropriate).
*/
export declare function captureFetchBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichFetchBreadcrumb(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>): void;
/** Exported only for tests. */
export declare function _getResponseInfo(captureDetails: boolean, { networkCaptureBodies, networkResponseHeaders, }: Pick<ReplayNetworkOptions, 'networkCaptureBodies' | 'networkResponseHeaders'>, response: Response | undefined, responseBodySize?: number): Promise<ReplayNetworkRequestOrResponse | undefined>;
//# sourceMappingURL=fetchUtils.d.ts.map
/**
* Inclusion list of attributes that we want to record from the DOM element
*/
export declare function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown>;
//# sourceMappingURL=getAttributesToRecord.d.ts.map
import { NetworkMetaWarning } from '@sentry/browser-utils';
import { NetworkRequestData, ReplayNetworkRequestData, ReplayNetworkRequestOrResponse, ReplayPerformanceEntry } from '../../types';
/** Get the size of a body. */
export declare function getBodySize(body: RequestInit['body']): number | undefined;
/** Convert a Content-Length header to number/undefined. */
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
/** Merge a warning into an existing network request/response. */
export declare function mergeWarning(info: ReplayNetworkRequestOrResponse | undefined, warning: NetworkMetaWarning): ReplayNetworkRequestOrResponse;
/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
export declare function makeNetworkReplayBreadcrumb(type: string, data: ReplayNetworkRequestData | null): ReplayPerformanceEntry<NetworkRequestData> | null;
/** Build the request or response part of a replay network breadcrumb that was skipped. */
export declare function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse;
/** Build the request or response part of a replay network breadcrumb. */
export declare function buildNetworkRequestOrResponse(headers: Record<string, string>, bodySize: number | undefined, body: string | undefined): ReplayNetworkRequestOrResponse | undefined;
/** Filter a set of headers */
export declare function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string>;
/** Match an URL against a list of strings/Regex. */
export declare function urlMatches(url: string, urls: (string | RegExp)[]): boolean;
/** exported for tests */
export declare function getFullUrl(url: string, baseURI?: string): string;
//# sourceMappingURL=networkUtils.d.ts.map
type WindowOpenHandler = () => void;
/**
* Register a handler to be called when `window.open()` is called.
* Returns a cleanup function.
*/
export declare function onWindowOpen(cb: WindowOpenHandler): () => void;
export {};
//# sourceMappingURL=onWindowOpen.d.ts.map
import { Event } from '@sentry/core';
import { ReplayContainer } from '../../types';
/**
* Determine if event should be sampled (only applies in buffer mode).
* When an event is captured by `handleGlobalEvent`, when in buffer mode
* we determine if we want to sample the error or not.
*/
export declare function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean;
//# sourceMappingURL=shouldSampleForBufferEvent.d.ts.map
import { Breadcrumb, XhrBreadcrumbData } from '@sentry/core';
import { NetworkMetaWarning, XhrHint } from '@sentry/browser-utils';
import { ReplayContainer, ReplayNetworkOptions } from '../../types';
/**
* Capture an XHR breadcrumb to a replay.
* This adds additional data (where appropriate).
*/
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>): void;
/**
* Get the string representation of the XHR response.
* Based on MDN, these are the possible types of the response:
* string
* ArrayBuffer
* Blob
* Document
* POJO
*
* Exported only for tests.
*/
export declare function _parseXhrResponse(body: XMLHttpRequest['response'], responseType: XMLHttpRequest['responseType']): [
string | undefined,
NetworkMetaWarning?
];
//# sourceMappingURL=xhrUtils.d.ts.map
/**
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
*
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
*/
export declare const DEBUG_BUILD: boolean;
//# sourceMappingURL=debug-build.d.ts.map
/** This error indicates that the event buffer size exceeded the limit.. */
export declare class EventBufferSizeExceededError extends Error {
constructor();
}
//# sourceMappingURL=error.d.ts.map
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* A basic event buffer that does not do any compression.
* Used as fallback if the compression worker cannot be loaded or is disabled.
*/
export declare class EventBufferArray implements EventBuffer {
/** All the events that are buffered to be sent. */
events: RecordingEvent[];
/** @inheritdoc */
hasCheckout: boolean;
/** @inheritdoc */
waitForCheckout: boolean;
private _totalSize;
constructor();
/*@inheritdoc */
readonly hasEvents: boolean;
/*@inheritdoc */
readonly type: EventBufferType;
/** @inheritdoc */
destroy(): void;
/** @inheritdoc */
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritdoc */
finish(): Promise<string>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
}
//# sourceMappingURL=EventBufferArray.d.ts.map
import { ReplayRecordingData } from '@sentry/core';
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class EventBufferCompressionWorker implements EventBuffer {
/** @inheritdoc */
hasCheckout: boolean;
/** @inheritdoc */
waitForCheckout: boolean;
private _worker;
private _earliestTimestamp;
private _totalSize;
constructor(worker: Worker);
/*@inheritdoc */
readonly hasEvents: boolean;
/*@inheritdoc */
readonly type: EventBufferType;
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occurred.
*/
ensureReady(): Promise<void>;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully received and processed by worker.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Finish the event buffer and return the compressed data.
*/
finish(): Promise<ReplayRecordingData>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Send the event to the worker.
*/
private _sendEventToWorker;
/**
* Finish the request and return the compressed data from the worker.
*/
private _finishRequest;
}
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map
import { ReplayRecordingData } from '@sentry/core';
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
* This can happen e.g. if the worker cannot be loaded.
* Exported only for testing.
*/
export declare class EventBufferProxy implements EventBuffer {
private _fallback;
private _compression;
private _used;
private _ensureWorkerIsLoadedPromise;
constructor(worker: Worker);
/*@inheritdoc
@inheritdoc */
waitForCheckout: boolean;
/*@inheritdoc */
readonly type: EventBufferType;
/*@inheritDoc */
readonly hasEvents: boolean;
/*@inheritdoc
@inheritdoc */
hasCheckout: boolean;
/** @inheritDoc */
destroy(): void;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully added.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritDoc */
finish(): Promise<ReplayRecordingData>;
/** Ensure the worker has loaded. */
ensureWorkerIsLoaded(): Promise<void>;
/** Actually check if the worker has been loaded. */
private _ensureWorkerIsLoaded;
/** Switch the used buffer to the compression worker. */
private _switchToCompressionWorker;
}
//# sourceMappingURL=EventBufferProxy.d.ts.map
import { EventBuffer, ReplayWorkerURL } from '../types';
interface CreateEventBufferParams {
useCompression: boolean;
workerUrl?: ReplayWorkerURL;
}
/**
* Create an event buffer for replays.
*/
export declare function createEventBuffer({ useCompression, workerUrl: customWorkerUrl, }: CreateEventBufferParams): EventBuffer;
export {};
//# sourceMappingURL=index.d.ts.map
import { WorkerRequest } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class WorkerHandler {
private _worker;
private _id;
private _ensureReadyPromise?;
private _pending;
constructor(worker: Worker);
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occurred.
*/
ensureReady(): Promise<void>;
/**
* Destroy the worker.
*/
destroy(): void;
/**
* Post message to worker and wait for response before resolving promise.
*/
postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T>;
private _onMessage;
/** Get the current ID and increment it for the next call. */
private _getAndIncrementId;
}
//# sourceMappingURL=WorkerHandler.d.ts.map
export { replayIntegration } from './integration';
export { ReplayConfiguration, ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, CanvasManagerInterface, CanvasManagerOptions, } from './types';
export { getReplay } from './util/getReplay';
//# sourceMappingURL=index.d.ts.map
import { Client, Integration, ReplayRecordingMode, StreamedSpanJSON } from '@sentry/core';
import { ReplayConfiguration, SendBufferedReplayOptions } from './types';
/**
* Instruments the global Request constructor to store the original body.
* This allows us to retrieve the original body value later, since Request
* converts string bodies to ReadableStreams.
*/
export declare function _INTERNAL_instrumentRequestInterface(): void;
/**
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/).
*
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information.
*
* @example
*
* ```
* Sentry.init({
* dsn: '__DSN__',
* integrations: [Sentry.replayIntegration()],
* });
* ```
*/
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay;
/**
* Replay integration
*/
export declare class Replay implements Integration {
/**
* @inheritDoc
*/
name: string;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
/**
* Initial options passed to the replay integration, merged with default values.
* Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
* can only be finally set when setupOnce() is called.
*
* @private
*/
private readonly _initialOptions;
private _replay?;
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, onError, attachRawBodyFromRequest, }?: ReplayConfiguration);
/*If replay has already been initialized
Update _isInitialized */
protected _isInitialized: boolean;
/**
* Setup and initialize replay container
*/
afterAllSetup(client: Client): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will log a message if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* PerformanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, until an error occurs.
*/
startBuffering(): void;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop(): Promise<void>;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* If replay is not enabled, a new session replay is started.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
flush(options?: SendBufferedReplayOptions): Promise<void>;
/**
* Get the current session ID.
*
* @param onlyIfSampled - If true, will only return the session ID if the session is sampled.
*
*/
getReplayId(onlyIfSampled?: boolean): string | undefined;
/**
* Get the current recording mode. This can be either `session` or `buffer`.
*
* `session`: Recording the whole session, sending it continuously
* `buffer`: Always keeping the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
getRecordingMode(): ReplayRecordingMode | undefined;
processSpan(span: StreamedSpanJSON): void;
/**
* Initializes replay.
*/
protected _initialize(client: Client): void;
/** Setup the integration. */
private _setup;
/** Get canvas options from ReplayCanvas integration, if it is also added. */
private _maybeLoadFromReplayCanvasIntegration;
}
//# sourceMappingURL=integration.d.ts.map
import { ReplayRecordingMode, ReplayStopReason, Span } from '@sentry/core';
import { ClickDetector } from './coreHandlers/handleClick';
import { AddEventResult, AddUpdateCallback, AllPerformanceEntry, AllPerformanceEntryData, EventBuffer, InternalEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPerformanceEntry, ReplayPluginOptions, SendBufferedReplayOptions, Session, Timeouts } from './types';
import { SKIPPED } from './util/throttle';
import { THROTTLED } from './util/throttle';
/**
* The main replay container class, which holds all the state and methods for recording and sending replays.
*/
export declare class ReplayContainer implements ReplayContainerInterface {
eventBuffer: EventBuffer | null;
performanceEntries: AllPerformanceEntry[];
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
clickDetector: ClickDetector | undefined;
/**
* Recording can happen in one of two modes:
* - session: Record the whole session, sending it continuously
* - buffer: Always keep the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
recordingMode: ReplayRecordingMode;
/**
* The current or last active span.
* This is only available when performance is enabled.
*/
lastActiveSpan?: Span;
/**
* These are here so we can overwrite them in tests etc.
* @hidden
*/
readonly timeouts: Timeouts;
/** The replay has to be manually started, because no sample rate (neither session or error) was provided. */
private _requiresManualStart;
private _throttledAddEvent;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
private readonly _options;
private _performanceCleanupCallback?;
private _debouncedFlush;
private _flushLock;
/**
* Timestamp of the last user activity. This lives across sessions.
*/
private _lastActivity;
/**
* Is the integration currently active?
*/
private _isEnabled;
/**
* Paused is a state where:
* - DOM Recording is not listening at all
* - Nothing will be added to event buffer (e.g. core SDK events)
*/
private _isPaused;
/**
* Have we attached listeners to the core SDK?
* Note we have to track this as there is no way to remove instrumentation handlers.
*/
private _hasInitializedCoreListeners;
/**
* Function to stop recording
*/
private _stopRecording;
private _context;
/**
* Internal use for canvas recording options
*/
private _canvas;
/**
* Handle when visibility of the page content changes. Opening a new tab will
* cause the state to change to hidden because of content of current page will
* be hidden. Likewise, moving a different window to cover the contents of the
* page will also trigger a change to a hidden state.
*/
private _handleVisibilityChange;
/**
* Handle when page is blurred
*/
private _handleWindowBlur;
/**
* Handle when page is focused
*/
private _handleWindowFocus;
/** Ensure page remains active when a key is pressed. */
private _handleKeyboardEvent;
constructor({ options, recordingOptions, }: {
options: ReplayPluginOptions;
recordingOptions: RecordingOptions;
});
/** Get the event context. */
getContext(): InternalEventContext;
/** If recording is currently enabled. */
isEnabled(): boolean;
/** If recording is currently paused. */
isPaused(): boolean;
/**
* Determine if canvas recording is enabled
*/
isRecordingCanvas(): boolean;
/** Get the replay integration options. */
getOptions(): ReplayPluginOptions;
/** A wrapper to conditionally capture exceptions. */
handleException(error: unknown): void;
/**
* Initializes the plugin based on sampling configuration. Should not be
* called outside of constructor.
*/
initializeSampling(previousSessionId?: string): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will log a message if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* _performanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, an error occurs.
*/
startBuffering(): void;
/**
* Start recording.
*
* Note that this will cause a new DOM checkout
*/
startRecording(): void;
/**
* Stops the recording, if it was running.
*
* Returns true if it was previously stopped, or is now stopped,
* otherwise false.
*/
stopRecording(): boolean;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop({ forceFlush, reason, }?: {
forceFlush?: boolean;
reason?: ReplayStopReason;
}): Promise<void>;
/**
* Pause some replay functionality. See comments for `_isPaused`.
* This differs from stop as this only stops DOM recording, it is
* not as thorough of a shutdown as `stop()`.
*/
pause(): void;
/**
* Resumes recording, see notes for `pause().
*
* Note that calling `startRecording()` here will cause a
* new DOM checkout.`
*/
resume(): void;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
sendBufferedReplayOrFlush({ continueRecording }?: SendBufferedReplayOptions): Promise<void>;
/**
* We want to batch uploads of replay events. Save events only if
* `<flushMinDelay>` milliseconds have elapsed since the last event
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
*
* Accepts a callback to perform side-effects and returns true to stop batch
* processing and hand back control to caller.
*/
addUpdate(cb: AddUpdateCallback): void;
/**
* Updates the user activity timestamp and resumes recording. This should be
* called in an event handler for a user action that we consider as the user
* being "active" (e.g. a mouse click).
*/
triggerUserActivity(): void;
/**
* Updates the user activity timestamp *without* resuming
* recording. Some user events (e.g. keydown) can be create
* low-value replays that only contain the keypress as a
* breadcrumb. Instead this would require other events to
* create a new replay after a session has expired.
*/
updateUserActivity(): void;
/**
* Only flush if `this.recordingMode === 'session'`
*/
conditionalFlush(): Promise<void>;
/**
* Flush using debounce flush
*/
flush(): Promise<void>;
/**
* Always flush via `_debouncedFlush` so that we do not have flushes triggered
* from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
* cases of multiple flushes happening closely together.
*/
flushImmediate(): Promise<void>;
/**
* Cancels queued up flushes.
*/
cancelFlush(): void;
/** Get the current session (=replay) ID
*
* @param onlyIfSampled - If true, will only return the session ID if the session is sampled.
*/
getSessionId(onlyIfSampled?: boolean): string | undefined;
/**
* Checks if recording should be stopped due to user inactivity. Otherwise
* check if session is expired and create a new session if so. Triggers a new
* full snapshot on new session.
*
* Returns true if session is not expired, false otherwise.
* @hidden
*/
checkAndHandleExpiredSession(): boolean | void;
/**
* Capture some initial state that can change throughout the lifespan of the
* replay. This is required because otherwise they would be captured at the
* first flush.
*/
setInitialState(): void;
/**
* Add a breadcrumb event, that may be throttled.
* If it was throttled, we add a custom breadcrumb to indicate that.
*/
throttledAddEvent(event: RecordingEvent, isCheckout?: boolean): typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
/**
* This will get the parametrized route name of the current page.
* This is only available if performance is enabled, and if an instrumented router is used.
*/
getCurrentRoute(): string | undefined;
/**
* Initialize and start all listeners to varying events (DOM,
* Performance Observer, Recording, Sentry SDK, etc)
*/
private _initializeRecording;
/**
* Loads (or refreshes) the current session.
*/
private _initializeSessionForSampling;
/**
* Checks and potentially refreshes the current session.
* Returns false if session is not recorded.
*/
private _checkSession;
/**
* Refresh a session with a new one.
* This stops the current session (without forcing a flush, as that would never work since we are expired),
* and then does a new sampling based on the refreshed session.
*/
private _refreshSession;
/**
* Adds listeners to record events for the replay
*/
private _addListeners;
/**
* Cleans up listeners that were created in `_addListeners`
*/
private _removeListeners;
/**
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
*/
private _doChangeToBackgroundTasks;
/**
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
*/
private _doChangeToForegroundTasks;
/**
* Update user activity (across session lifespans)
*/
private _updateUserActivity;
/**
* Updates the session's last activity timestamp
*/
private _updateSessionActivity;
/**
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
*/
private _createCustomBreadcrumb;
/**
* Observed performance events are added to `this.performanceEntries`. These
* are included in the replay event before it is finished and sent to Sentry.
*/
private _addPerformanceEntries;
/**
* Clear _context
*/
private _clearContext;
/** Update the initial timestamp based on the buffer content. */
private _updateInitialTimestampFromEventBuffer;
/**
* Return and clear _context
*/
private _popEventContext;
/**
* Flushes replay event buffer to Sentry.
*
* Performance events are only added right before flushing - this is
* due to the buffered performance observer events.
*
* Should never be called directly, only by `flush`
*/
private _runFlush;
/**
* Flush recording data to Sentry. Creates a lock so that only a single flush
* can be active at a time. Do not call this directly.
*/
private _flush;
/** Save the session, if it is sticky */
private _maybeSaveSession;
/** Handler for rrweb.record.onMutation */
private _onMutationHandler;
}
//# sourceMappingURL=replay.d.ts.map
import { ReplayContainer } from '../../src/types';
/**
* Removes the session from Session Storage and unsets session in replay instance
*/
export declare function clearSession(replay: ReplayContainer): void;
//# sourceMappingURL=clearSession.d.ts.map
import { Sampled, Session, SessionOptions } from '../types';
/**
* Get the sampled status for a session based on sample rates & current sampled status.
*/
export declare function getSessionSampleType(sessionSampleRate: number, allowBuffering: boolean): Sampled;
/**
* Create a new session, which in its current implementation is a Sentry event
* that all replays will be saved to as attachments. Currently, we only expect
* one of these Sentry events per "replay session".
*/
export declare function createSession({ sessionSampleRate, allowBuffering, stickySession }: SessionOptions, { previousSessionId }?: {
previousSessionId?: string;
}): Session;
//# sourceMappingURL=createSession.d.ts.map
import { Session } from '../types';
/**
* Fetches a session from storage
*/
export declare function fetchSession(): Session | null;
//# sourceMappingURL=fetchSession.d.ts.map
import { Session, SessionOptions } from '../types';
/**
* Get or create a session, when initializing the replay.
* Returns a session that may be unsampled.
*/
export declare function loadOrCreateSession({ sessionIdleExpire, maxReplayDuration, previousSessionId, }: {
sessionIdleExpire: number;
maxReplayDuration: number;
previousSessionId?: string;
}, sessionOptions: SessionOptions): Session;
//# sourceMappingURL=loadOrCreateSession.d.ts.map
import { Session } from '../types';
/**
* Save a session to session storage.
*/
export declare function saveSession(session: Session): void;
//# sourceMappingURL=saveSession.d.ts.map
import { Sampled, Session } from '../types';
/**
* Get a session with defaults & applied sampling.
*/
export declare function makeSession(session: Partial<Session> & {
sampled: Sampled;
}): Session;
//# sourceMappingURL=Session.d.ts.map
import { Session } from '../types';
/** If the session should be refreshed or not. */
export declare function shouldRefreshSession(session: Session, { sessionIdleExpire, maxReplayDuration }: {
sessionIdleExpire: number;
maxReplayDuration: number;
}): boolean;
//# sourceMappingURL=shouldRefreshSession.d.ts.map
export * from './performance';
export * from './replay';
export * from './replayFrame';
export * from './request';
export * from './rrweb';
//# sourceMappingURL=index.d.ts.map
import { ReplayNetworkRequestOrResponse } from './request';
export type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
export type PerformancePaintTiming = PerformanceEntry;
export type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
type: string;
transferSize: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "interactive".
*/
domInteractive: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's DOMContentLoaded event handler starts.
*/
domContentLoadedEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's DOMContentLoaded event handler completes.
*/
domContentLoadedEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's load event handler starts.
*/
loadEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's load event handler completes.
*/
loadEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "complete".
*/
domComplete: number;
/**
* A number representing the number of redirects since the last non-redirect
* navigation in the current browsing context.
*/
redirectCount: number;
};
export type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
responseStatus?: number;
};
export type PaintData = undefined;
/**
* See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
*
* Note `navigation.push` will not have any data
*/
export type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
/**
* Transfer size of resource
*/
size?: number;
};
export type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
/**
* Transfer size of resource
*/
size: number;
/**
* HTTP status code. Note this is experimental and not available on all browsers.
*/
statusCode?: number;
};
export interface WebVitalData {
/**
* Render time (in ms) of the LCP
*/
value: number;
size: number;
/**
* The rating as to whether the metric value is within the "good",
* "needs improvement", or "poor" thresholds of the metric.
*/
rating: 'good' | 'needs-improvement' | 'poor';
/**
* The recording id of the web vital nodes. -1 if not found
*/
nodeIds?: number[];
/**
* The layout shifts of a CLS metric
*/
attributions?: {
value: number;
nodeIds: number[] | undefined;
}[];
}
/**
* Entries that come from window.performance
*/
export type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | WebVitalData;
export interface MemoryData {
memory: {
jsHeapSizeLimit: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
};
}
export interface NetworkRequestData {
method?: string;
statusCode?: number;
requestBodySize?: number;
responseBodySize?: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
}
export interface HistoryData {
previous: string | undefined;
}
export type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
export interface ReplayPerformanceEntry<T> {
/**
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
*/
type: string;
/**
* A more specific description of the performance entry
*/
name: string;
/**
* The start timestamp in seconds
*/
start: number;
/**
* The end timestamp in seconds
*/
end: number;
/**
* Additional unstructured data to be included
*/
data: T;
}
//# sourceMappingURL=performance.d.ts.map
import { Breadcrumb, ErrorEvent, ReplayRecordingData, ReplayRecordingMode, ReplayStopReason, Span } from '@sentry/core';
import { SKIPPED, THROTTLED } from '../util/throttle';
import { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance';
import { ReplayFrameEvent } from './replayFrame';
import { ReplayNetworkRequestOrResponse } from './request';
import { CanvasManagerInterface, CanvasManagerOptions, ReplayEventWithTime, RrwebRecordOptions } from './rrweb';
export type RecordingEvent = ReplayFrameEvent | ReplayEventWithTime;
export type RecordingOptions = RrwebRecordOptions;
export interface SendReplayData {
recordingData: ReplayRecordingData;
replayId: string;
segmentId: number;
eventContext: PopEventContext;
timestamp: number;
session: Session;
onError?: (err: unknown) => void;
}
export interface Timeouts {
sessionIdlePause: number;
sessionIdleExpire: number;
}
/**
* The request payload to worker
*/
export interface WorkerRequest {
id: number;
method: 'clear' | 'addEvent' | 'finish';
arg?: string;
}
/**
* The response from the worker
*/
export interface WorkerResponse {
id: number;
method: string;
success: boolean;
response: unknown;
}
export type AddEventResult = void;
export interface BeforeAddRecordingEvent {
(event: ReplayFrameEvent): ReplayFrameEvent | null | undefined;
}
export interface ReplayNetworkOptions {
/**
* Capture request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will match any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
*
* Only URLs matching these patterns will have bodies & additional headers captured.
*/
networkDetailAllowUrls: (string | RegExp)[];
/**
* Deny request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will deny any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
* URLs matching these patterns will not have bodies & additional headers captured.
*/
networkDetailDenyUrls: (string | RegExp)[];
/**
* If request & response bodies should be captured.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Defaults to true.
*/
networkCaptureBodies: boolean;
/**
* Capture the following request headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkRequestHeaders: string[];
/**
* Capture the following response headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkResponseHeaders: string[];
}
export type ReplayWorkerURL = string | URL;
export interface ReplayPluginOptions extends ReplayNetworkOptions {
/**
* The sample rate for session-long replays. 1.0 will record all sessions and
* 0 will record none.
*/
sessionSampleRate: number;
/**
* The sample rate for sessions that has had an error occur. This is
* independent of `sessionSampleRate`.
*/
errorSampleRate: number;
/**
* If false, will create a new session per pageload. Otherwise, saves session
* to Session Storage.
*/
stickySession: boolean;
/**
* The amount of time to wait before sending a replay
*/
flushMinDelay: number;
/**
* The max amount of time to wait before sending a replay
*/
flushMaxDelay: number;
/**
* Attempt to use compression when web workers are available
*
* (default is true)
*/
useCompression: boolean;
/**
* If defined, use this worker URL instead of the default included one for compression.
* This will only be used if `useCompression` is not false.
*/
workerUrl?: ReplayWorkerURL;
/**
* Block all media (e.g. images, svg, video) in recordings.
*/
blockAllMedia: boolean;
/**
* Mask all inputs in recordings
*/
maskAllInputs: boolean;
/**
* Mask all text in recordings
*/
maskAllText: boolean;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will create
* a breadcrumb in the recording when the limit has been reached.
*/
mutationBreadcrumbLimit: number;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will cause
* recording to stop when the limit has been reached.
*/
mutationLimit: number;
/**
* The max. time in ms to wait for a slow click to finish.
* After this amount of time we stop waiting for actions after a click happened.
* Set this to 0 to disable slow click capture.
*
* Default: 7000ms
*/
slowClickTimeout: number;
/**
* Ignore clicks on elements matching the given selectors for slow click detection.
*/
slowClickIgnoreSelectors: string[];
/**
* The min. duration (in ms) a replay has to have before it is sent to Sentry.
* Whenever attempting to flush a session that is shorter than this, it will not actually send it to Sentry.
* Note that this is capped at max. 50s, so we don't unintentionally drop buffered replays that are longer than 60s
*
* Warning: Setting this to a higher value can result in unintended drops of onError-sampled replays.
*
*/
minReplayDuration: number;
/**
* The max. duration (in ms) a replay session may be.
* This is capped at max. 60min.
*/
maxReplayDuration: number;
/**
* Callback before adding a custom recording event
*
* Events added by the underlying DOM recording library can *not* be modified,
* only custom recording events from the Replay integration will trigger the
* callback listeners. This can be used to scrub certain fields in an event (e.g. URLs from navigation events).
*
* Returning a `null` will drop the event completely. Note, dropping a recording
* event is not the same as dropping the replay, the replay will still exist and
* continue to function.
*/
beforeAddRecordingEvent?: BeforeAddRecordingEvent;
/**
* An optional callback to be called before we decide to sample based on an error.
* If specified, this callback will receive an error that was captured by Sentry.
* Return `true` to continue sampling for this error, or `false` to ignore this error for replay sampling.
* Note that returning `true` means that the `replaysOnErrorSampleRate` will be checked,
* not that it will definitely be sampled.
* Use this to filter out groups of errors that should def. not be sampled.
*/
beforeErrorSampling?: (event: ErrorEvent) => boolean;
/**
* Callback when an internal SDK error occurs. This can be used to debug SDK
* issues.
*/
onError?: (err: unknown) => void;
/**
* Patch the global Request() interface to store original request bodies.
* This allows Replay to capture the original body from Request objects passed to fetch().
*
* When enabled, creates a copy of the original body before it's converted to a ReadableStream.
* This is useful for capturing request bodies in network breadcrumbs.
*
* Note: This modifies the global Request constructor.
*
* @default false
*/
attachRawBodyFromRequest?: boolean;
/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
captureExceptions: boolean;
traceInternals: boolean;
continuousCheckout: number;
/**
* Before enabling, please read the security considerations:
* https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/cross-origin-iframes.md#considerations
*/
recordCrossOriginIframes: boolean;
/**
* Completely ignore mutations matching the given selectors.
* This can be used if a specific type of mutation is causing (e.g. performance) problems.
* NOTE: This can be dangerous to use, as mutations are applied as incremental patches.
* Make sure to verify that the captured replays still work when using this option.
*/
ignoreMutations: string[];
}>;
}
/**
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`.
*/
export type InitialReplayPluginOptions = Pick<ReplayPluginOptions, Exclude<keyof ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>;
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & {
/**
* Mask element attributes that are contained in list
*/
maskAttributes?: string[];
};
/**
* Session options that are configurable by the integration configuration
*/
export interface SessionOptions extends Pick<ReplayPluginOptions, 'sessionSampleRate' | 'stickySession'> {
/**
* Should buffer recordings to be saved later either by error sampling, or by
* manually calling `flush()`. This is only a factor if not sampled for a
* session-based replay.
*/
allowBuffering: boolean;
}
export interface ReplayIntegrationPrivacyOptions {
/**
* Mask text content for elements that match the CSS selectors in the list.
*/
mask?: string[];
/**
* Unmask text content for elements that match the CSS selectors in the list.
*/
unmask?: string[];
/**
* Block elements that match the CSS selectors in the list. Blocking replaces
* the element with an empty placeholder with the same dimensions.
*/
block?: string[];
/**
* Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
*/
unblock?: string[];
/**
* Ignore input events for elements that match the CSS selectors in the list.
*/
ignore?: string[];
/**
* A callback function to customize how your text is masked.
*/
maskFn?: (s: string) => string;
}
export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
}
interface CommonEventContext {
/**
* The initial URL of the session
*/
initialUrl: string;
/**
* The initial starting timestamp in ms of the session.
*/
initialTimestamp: number;
/**
* Ordered list of URLs that have been visited during a replay segment
*/
urls: string[];
}
export interface PopEventContext extends CommonEventContext {
/**
* List of Sentry error ids that have occurred during a replay segment
*/
errorIds: Array<string>;
/**
* List of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Array<string>;
}
/**
* Additional context that will be sent w/ `replay_event`
*/
export interface InternalEventContext extends CommonEventContext {
/**
* Set of Sentry error ids that have occurred during a replay segment
*/
errorIds: Set<string>;
/**
* Set of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Set<string>;
}
export type Sampled = false | 'session' | 'buffer';
export interface Session {
id: string;
/**
* Start time of current session (in ms)
*/
started: number;
/**
* Last known activity of the session (in ms)
*/
lastActivity: number;
/**
* Segment ID for replay events
*/
segmentId: number;
/**
* The ID of the previous session.
* If this is empty, there was no previous session.
*/
previousSessionId?: string;
/**
* Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer`
*/
sampled: Sampled;
/**
* Session is dirty when its id has been linked to an event (e.g. error event).
* This is helpful when a session is mistakenly stuck in "buffer" mode (e.g. network issues preventing it from being converted to "session" mode).
* The dirty flag is used to prevent updating the session start time to the earliest event in the buffer so that it can be refreshed if it's been expired.
*/
dirty?: boolean;
}
export type EventBufferType = 'sync' | 'worker';
export interface EventBuffer {
/**
* If any events have been added to the buffer.
*/
readonly hasEvents: boolean;
/**
* The buffer type
*/
readonly type: EventBufferType;
/**
* If the event buffer contains a checkout event.
*/
hasCheckout: boolean;
/**
* If the event buffer needs to wait for a checkout event before it
* starts buffering events.
*/
waitForCheckout: boolean;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Clear the event buffer.
*/
clear(): void;
/**
* Add an event to the event buffer.
*
* Returns a promise that resolves if the event was successfully added, else rejects.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Clears and returns the contents of the buffer.
*/
finish(): Promise<ReplayRecordingData>;
/**
* Get the earliest timestamp in ms of any event currently in the buffer.
*/
getEarliestTimestamp(): number | null;
}
export type AddUpdateCallback = () => boolean | void;
export interface SendBufferedReplayOptions {
continueRecording?: boolean;
}
export interface ReplayClickDetector {
addListeners(): void;
removeListeners(): void;
/** Handle a click breadcrumb. */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** Register a mutation that happened at a given time. */
registerMutation(timestamp?: number): void;
/** Register a scroll that happened at a given time. */
registerScroll(timestamp?: number): void;
/** Register that a click on an element happened. */
registerClick(element: HTMLElement): void;
}
export interface ReplayContainer {
eventBuffer: EventBuffer | null;
clickDetector: ReplayClickDetector | undefined;
/**
* List of PerformanceEntry from PerformanceObservers.
*/
performanceEntries: AllPerformanceEntry[];
/**
* List of already processed performance data, ready to be added to replay.
*/
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
recordingMode: ReplayRecordingMode;
timeouts: Timeouts;
lastActiveSpan?: Span;
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
isEnabled(): boolean;
isPaused(): boolean;
isRecordingCanvas(): boolean;
getContext(): InternalEventContext;
initializeSampling(): void;
start(): void;
stop(options?: {
reason?: ReplayStopReason;
forceFlush?: boolean;
}): Promise<void>;
pause(): void;
resume(): void;
startRecording(): void;
stopRecording(): boolean;
sendBufferedReplayOrFlush(options?: SendBufferedReplayOptions): Promise<void>;
conditionalFlush(): Promise<void>;
flush(): Promise<void>;
flushImmediate(): Promise<void>;
cancelFlush(): void;
triggerUserActivity(): void;
updateUserActivity(): void;
addUpdate(cb: AddUpdateCallback): void;
getOptions(): ReplayPluginOptions;
getSessionId(): string | undefined;
checkAndHandleExpiredSession(): boolean | void;
setInitialState(): void;
getCurrentRoute(): string | undefined;
handleException(err: unknown): void;
}
export type ReplayNetworkRequestData = {
startTimestamp: number;
endTimestamp: number;
url: string;
method?: string;
statusCode: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
};
export interface SlowClickConfig {
threshold: number;
timeout: number;
scrollTimeout: number;
ignoreSelector: string;
}
export interface ReplayCanvasIntegrationOptions {
enableManualSnapshot?: boolean;
recordCanvas: true;
getCanvasManager: (options: CanvasManagerOptions) => CanvasManagerInterface;
sampling: {
canvas: number;
};
dataURLOptions: {
type: string;
quality: number;
};
}
export {};
//# sourceMappingURL=replay.d.ts.map
import { Breadcrumb } from '@sentry/core';
import { HistoryData, MemoryData, NavigationData, NetworkRequestData, PaintData, ResourceData, WebVitalData } from './performance';
import { ReplayEventTypeCustom } from './rrweb';
type AnyRecord = Record<string, any>;
interface ReplayBaseBreadcrumbFrame {
timestamp: number;
/**
* For compatibility reasons
*/
type: string;
category: string;
data?: AnyRecord;
message?: string;
}
interface ReplayBaseDomFrameData {
nodeId?: number;
node?: {
id: number;
tagName: string;
textContent: string;
attributes: AnyRecord;
};
}
interface ReplayConsoleFrameData {
logger: string;
arguments?: unknown[];
}
interface ReplayConsoleFrame extends ReplayBaseBreadcrumbFrame {
category: 'console';
level: Breadcrumb['level'];
message: string;
data: ReplayConsoleFrameData;
}
type ReplayClickFrameData = ReplayBaseDomFrameData;
interface ReplayClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.click';
message: string;
data: ReplayClickFrameData;
}
interface ReplayInputFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.input';
message: string;
}
interface ReplayMutationFrameData {
count: number;
limit: boolean;
}
interface ReplayMutationFrame extends ReplayBaseBreadcrumbFrame {
category: 'replay.mutations';
data: ReplayMutationFrameData;
}
interface ReplayHydrationErrorFrameData {
url: string;
}
interface ReplayHydrationErrorFrame extends ReplayBaseBreadcrumbFrame {
category: 'replay.hydrate-error';
data: ReplayHydrationErrorFrameData;
}
interface ReplayKeyboardEventFrameData extends ReplayBaseDomFrameData {
metaKey: boolean;
shiftKey: boolean;
ctrlKey: boolean;
altKey: boolean;
key: string;
}
interface ReplayKeyboardEventFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.keyDown';
data: ReplayKeyboardEventFrameData;
}
interface ReplayBlurFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.blur';
}
interface ReplayFocusFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.focus';
}
interface ReplaySlowClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
timeAfterClickMs: number;
endReason: string;
clickCount?: number;
}
export interface ReplaySlowClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.slowClickDetected';
data: ReplaySlowClickFrameData;
}
interface ReplayMultiClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
clickCount: number;
metric: true;
}
export interface ReplayMultiClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.multiClick';
data: ReplayMultiClickFrameData;
}
interface ReplayOptionFrame {
blockAllMedia: boolean;
errorSampleRate: number;
maskAllInputs: boolean;
maskAllText: boolean;
networkCaptureBodies: boolean;
networkDetailHasUrls: boolean;
networkRequestHasHeaders: boolean;
networkResponseHasHeaders: boolean;
sessionSampleRate: number;
shouldRecordCanvas: boolean;
useCompression: boolean;
useCompressionOption: boolean;
}
interface ReplayFeedbackFrameData {
feedbackId: string;
}
interface ReplayFeedbackFrame extends ReplayBaseBreadcrumbFrame {
category: 'sentry.feedback';
data: ReplayFeedbackFrameData;
}
export type ReplayBreadcrumbFrame = ReplayConsoleFrame | ReplayClickFrame | ReplayInputFrame | ReplayKeyboardEventFrame | ReplayBlurFrame | ReplayFocusFrame | ReplaySlowClickFrame | ReplayMultiClickFrame | ReplayMutationFrame | ReplayHydrationErrorFrame | ReplayFeedbackFrame | ReplayBaseBreadcrumbFrame;
interface ReplayBaseSpanFrame {
op: string;
description: string;
startTimestamp: number;
endTimestamp: number;
data?: undefined | AnyRecord;
}
interface ReplayHistoryFrame extends ReplayBaseSpanFrame {
data: HistoryData;
op: 'navigation.push';
}
interface ReplayWebVitalFrame extends ReplayBaseSpanFrame {
data: WebVitalData;
op: 'largest-contentful-paint' | 'cumulative-layout-shift' | 'interaction-to-next-paint';
}
interface ReplayMemoryFrame extends ReplayBaseSpanFrame {
data: MemoryData;
op: 'memory';
}
interface ReplayNavigationFrame extends ReplayBaseSpanFrame {
data: NavigationData;
op: 'navigation.navigate' | 'navigation.reload' | 'navigation.back_forward';
}
interface ReplayPaintFrame extends ReplayBaseSpanFrame {
data: PaintData;
op: 'paint';
}
interface ReplayRequestFrame extends ReplayBaseSpanFrame {
data: NetworkRequestData;
op: 'resource.fetch' | 'resource.xhr';
}
interface ReplayResourceFrame extends ReplayBaseSpanFrame {
data: ResourceData;
op: 'resource.css' | 'resource.iframe' | 'resource.img' | 'resource.link' | 'resource.other' | 'resource.script';
}
export type ReplaySpanFrame = ReplayBaseSpanFrame | ReplayHistoryFrame | ReplayRequestFrame | ReplayWebVitalFrame | ReplayMemoryFrame | ReplayNavigationFrame | ReplayPaintFrame | ReplayResourceFrame;
export type ReplayFrame = ReplayBreadcrumbFrame | ReplaySpanFrame;
interface RecordingCustomEvent {
type: typeof ReplayEventTypeCustom;
timestamp: number;
data: {
tag: string;
payload: unknown;
};
}
export interface ReplayBreadcrumbFrameEvent extends RecordingCustomEvent {
data: {
tag: 'breadcrumb';
payload: ReplayBreadcrumbFrame;
/**
* This will indicate to backend to additionally log as a metric
*/
metric?: boolean;
};
}
export interface ReplaySpanFrameEvent extends RecordingCustomEvent {
data: {
tag: 'performanceSpan';
payload: ReplaySpanFrame;
};
}
export interface ReplayOptionFrameEvent extends RecordingCustomEvent {
data: {
tag: 'options';
payload: ReplayOptionFrame;
};
}
export type ReplayFrameEvent = ReplayBreadcrumbFrameEvent | ReplaySpanFrameEvent | ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=replayFrame.d.ts.map
import { NetworkMetaWarning } from '@sentry/browser-utils';
type JsonObject = Record<string, unknown>;
type JsonArray = unknown[];
export type NetworkBody = JsonObject | JsonArray | string;
interface NetworkMeta {
warnings?: NetworkMetaWarning[];
}
export interface ReplayNetworkRequestOrResponse {
size?: number;
body?: NetworkBody;
headers: Record<string, string>;
_meta?: NetworkMeta;
}
export {};
//# sourceMappingURL=request.d.ts.map
type ClassOption = string | RegExp;
/** Duplicate this from @sentry/rrweb so we can export this as well. */
export declare const ReplayEventTypeDomContentLoaded = 0;
export declare const ReplayEventTypeLoad = 1;
export declare const ReplayEventTypeFullSnapshot = 2;
export declare const ReplayEventTypeIncrementalSnapshot = 3;
export declare const ReplayEventTypeMeta = 4;
export declare const ReplayEventTypeCustom = 5;
export declare const ReplayEventTypePlugin = 6;
export type ReplayEventType = typeof ReplayEventTypeDomContentLoaded | typeof ReplayEventTypeLoad | typeof ReplayEventTypeFullSnapshot | typeof ReplayEventTypeIncrementalSnapshot | typeof ReplayEventTypeMeta | typeof ReplayEventTypeCustom | typeof ReplayEventTypePlugin;
/**
* This is a partial copy of rrweb's eventWithTime type which only contains the properties
* we specifically need in the SDK.
*/
export type ReplayEventWithTime = {
type: ReplayEventType;
data: unknown;
timestamp: number;
delay?: number;
};
/**
* This is a partial copy of rrweb's recording options which only contains the properties
* we specifically use in the SDK. Users can specify additional properties, hence we add the
* Record<string, unknown> union type.
*/
export type RrwebRecordOptions = {
maskAllText?: boolean;
maskAllInputs?: boolean;
blockClass?: ClassOption;
ignoreClass?: string;
maskTextClass?: ClassOption;
maskTextSelector?: string;
blockSelector?: string;
maskInputOptions?: Record<string, boolean>;
recordCrossOriginIframes?: boolean;
} & Record<string, unknown>;
export interface CanvasManagerInterface {
reset(): void;
freeze(): void;
unfreeze(): void;
lock(): void;
unlock(): void;
snapshot(): void;
addWindow(win: typeof globalThis & Window): void;
addShadowRoot(shadowRoot: ShadowRoot): void;
resetShadowRoots(): void;
}
export interface CanvasManagerOptions {
recordCanvas: boolean;
enableManualSnapshot?: boolean;
blockClass: string | RegExp;
blockSelector: string | null;
unblockSelector: string | null;
sampling?: 'all' | number;
dataURLOptions: Partial<{
type: string;
quality: number;
}>;
mutationCb: (p: any) => void;
win: typeof globalThis & Window;
mirror: any;
}
export {};
//# sourceMappingURL=rrweb.d.ts.map
import { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
/**
* Add an event to the event buffer.
* In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.
* Instead this returns `true` if we tried to add the event, else false.
* It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEventSync(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): boolean;
/**
* Add an event to the event buffer.
* Resolves to `null` if no event was added, else to `void`.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
/** Exported only for tests. */
export declare function shouldAddEvent(replay: ReplayContainer, event: RecordingEvent): boolean;
//# sourceMappingURL=addEvent.d.ts.map
import { ReplayContainer } from '../types';
/**
* Add global listeners that cannot be removed.
*/
export declare function addGlobalListeners(replay: ReplayContainer): void;
//# sourceMappingURL=addGlobalListeners.d.ts.map
import { AddEventResult, ReplayContainer } from '../types';
/**
* Create a "span" for the total amount of memory being used by JS objects
* (including v8 internal objects).
*/
export declare function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>>;
//# sourceMappingURL=addMemoryEntry.d.ts.map
import { ReplayBreadcrumbFrame } from '../types/replayFrame';
/**
* Create a breadcrumb for a replay.
*/
export declare function createBreadcrumb(breadcrumb: Pick<ReplayBreadcrumbFrame, Exclude<keyof ReplayBreadcrumbFrame, 'timestamp' | 'type'>> & Partial<Pick<ReplayBreadcrumbFrame, 'timestamp'>>): ReplayBreadcrumbFrame;
//# sourceMappingURL=createBreadcrumb.d.ts.map
import { AllPerformanceEntry, AllPerformanceEntryData, ReplayContainer, ReplayPerformanceEntry, WebVitalData } from '../types';
export interface Metric {
/**
* The current value of the metric.
*/
value: number;
/**
* The rating as to whether the metric value is within the "good",
* "needs improvement", or "poor" thresholds of the metric.
*/
rating: 'good' | 'needs-improvement' | 'poor';
/**
* Any performance entries relevant to the metric value calculation.
* The array may also be empty if the metric value was not based on any
* entries (e.g. a CLS value of 0 given no layout shifts).
*/
entries: PerformanceEntry[] | LayoutShift[];
}
interface LayoutShift extends PerformanceEntry {
value: number;
sources: LayoutShiftAttribution[];
hadRecentInput: boolean;
}
interface LayoutShiftAttribution {
node?: Node;
previousRect: DOMRectReadOnly;
currentRect: DOMRectReadOnly;
}
/**
* Handler creater for web vitals
*/
export declare function webVitalHandler(getter: (metric: Metric) => ReplayPerformanceEntry<AllPerformanceEntryData>, replay: ReplayContainer): (data: {
metric: Metric;
}) => void;
/**
* Create replay performance entries from the browser performance entries.
*/
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry<AllPerformanceEntryData>[];
/**
* Add a LCP event to the replay based on a LCP metric.
*/
export declare function getLargestContentfulPaint(metric: Metric): ReplayPerformanceEntry<WebVitalData>;
/**
* Add a CLS event to the replay based on a CLS metric.
*/
export declare function getCumulativeLayoutShift(metric: Metric): ReplayPerformanceEntry<WebVitalData>;
/**
* Add an INP event to the replay based on an INP metric.
*/
export declare function getInteractionToNextPaint(metric: Metric): ReplayPerformanceEntry<WebVitalData>;
export {};
//# sourceMappingURL=createPerformanceEntries.d.ts.map
import { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/**
* Create a "span" for each performance entry.
*/
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
//# sourceMappingURL=createPerformanceSpans.d.ts.map
import { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/core';
/**
* Create a replay envelope ready to be sent.
* This includes both the replay event, as well as the recording data.
*/
export declare function createReplayEnvelope(replayEvent: ReplayEvent, recordingData: ReplayRecordingData, dsn: DsnComponents, tunnel?: string): ReplayEnvelope;
//# sourceMappingURL=createReplayEnvelope.d.ts.map
type DebouncedCallback = {
(): void | unknown;
flush: () => void | unknown;
cancel: () => void;
};
type CallbackFunction = () => unknown;
type DebounceOptions = {
maxWait?: number;
};
/**
* Heavily simplified debounce function based on lodash.debounce.
*
* This function takes a callback function (@param fun) and delays its invocation
* by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
* which ensures that the callback is invoked at least once after the specified max. wait time.
*
* @param func the function whose invocation is to be debounced
* @param wait the minimum time until the function is invoked after it was called once
* @param options the options object, which can contain the `maxWait` property
*
* @returns the debounced version of the function, which needs to be called at least once to start the
* debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
* was already invoked in the meantime, return @param func's return value.
* The debounced function has two additional properties:
* - `flush`: Invokes the debounced function immediately and returns its return value
* - `cancel`: Cancels the debouncing process and resets the debouncing timer
*/
export declare function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback;
export {};
//# sourceMappingURL=debounce.d.ts.map
import { ErrorEvent, Event, FeedbackEvent, ReplayEvent, TransactionEvent } from '@sentry/core';
/** If the event is an error event */
export declare function isErrorEvent(event: Event): event is ErrorEvent;
/** If the event is a transaction event */
export declare function isTransactionEvent(event: Event): event is TransactionEvent;
/** If the event is an replay event */
export declare function isReplayEvent(event: Event): event is ReplayEvent;
/** If the event is a feedback event */
export declare function isFeedbackEvent(event: Event): event is FeedbackEvent;
//# sourceMappingURL=eventUtils.d.ts.map
import { ReplayIntegrationPrivacyOptions } from '../types';
type GetPrivacyOptions = Required<Pick<ReplayIntegrationPrivacyOptions, Exclude<keyof ReplayIntegrationPrivacyOptions, 'maskFn'>>>;
interface GetPrivacyReturn {
maskTextSelector: string;
unmaskTextSelector: string;
blockSelector: string;
unblockSelector: string;
ignoreSelector: string;
blockClass?: RegExp;
maskTextClass?: RegExp;
}
/**
* Returns privacy related configuration for use in rrweb
*/
export declare function getPrivacyOptions({ mask, unmask, block, unblock, ignore }: GetPrivacyOptions): GetPrivacyReturn;
export {};
//# sourceMappingURL=getPrivacyOptions.d.ts.map
/**
* Disable sampling mousemove events on iOS browsers as this can cause blocking the main thread
* https://github.com/getsentry/sentry-javascript/issues/14534
*/
export declare function getRecordingSamplingOptions(): Partial<{
sampling: {
mousemove: boolean;
};
}>;
//# sourceMappingURL=getRecordingSamplingOptions.d.ts.map
import { replayIntegration } from '../integration';
/**
* This is a small utility to get a type-safe instance of the Replay integration.
*/
export declare function getReplay(): ReturnType<typeof replayIntegration> | undefined;
//# sourceMappingURL=getReplay.d.ts.map
import { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';
type RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;
/**
* Handler for recording events.
*
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
*/
export declare function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback;
export declare function syncMirrorAttributesFromMutationEvent(event: RecordingEvent): void;
/**
* Exported for tests
*/
export declare function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=handleRecordingEmit.d.ts.map
/** If sessionStorage is available. */
export declare function hasSessionStorage(): boolean;
//# sourceMappingURL=hasSessionStorage.d.ts.map
/**
* Given an initial timestamp and an expiry duration, checks to see if current
* time should be considered as expired.
*/
export declare function isExpired(initialTime: null | number, expiry: undefined | number, targetTime?: number): boolean;
//# sourceMappingURL=isExpired.d.ts.map
import { Event, EventHint } from '@sentry/core';
/**
* Returns true if we think the given event is an error originating inside of rrweb.
*/
export declare function isRrwebError(event: Event, hint: EventHint): boolean;
//# sourceMappingURL=isRrwebError.d.ts.map
/**
* Given a sample rate, returns true if replay should be sampled.
*
* 1.0 = 100% sampling
* 0.0 = 0% sampling
*/
export declare function isSampled(sampleRate?: number): boolean;
//# sourceMappingURL=isSampled.d.ts.map
import { Session } from '../types';
/**
* Checks to see if session is expired
*/
export declare function isSessionExpired(session: Session, { maxReplayDuration, sessionIdleExpire, targetTime, }: {
maxReplayDuration: number;
sessionIdleExpire: number;
targetTime?: number;
}): boolean;
//# sourceMappingURL=isSessionExpired.d.ts.map
import { debug as coreDebug } from '@sentry/core';
interface LoggerConfig {
captureExceptions: boolean;
traceInternals: boolean;
}
type CoreDebugLogger = typeof coreDebug;
interface ReplayDebugLogger extends CoreDebugLogger {
/**
* Calls `debug.log` but saves breadcrumb in the next tick due to race
* conditions before replay is initialized.
*/
infoTick: CoreDebugLogger['log'];
/**
* Captures exceptions (`Error`) if "capture internal exceptions" is enabled
*/
exception: CoreDebugLogger['error'];
/**
* Configures the logger with additional debugging behavior
*/
setConfig(config: Partial<LoggerConfig>): void;
}
export declare const debug: ReplayDebugLogger;
export {};
//# sourceMappingURL=logger.d.ts.map
import { getPrivacyOptions } from './getPrivacyOptions';
interface MaskAttributeParams {
maskAttributes: string[];
maskAllText: boolean;
privacyOptions: ReturnType<typeof getPrivacyOptions>;
key: string;
value: string;
el: HTMLElement;
}
/**
* Masks an attribute if necessary, otherwise return attribute value as-is.
* Keys listed in `maskAttributes` are masked even when `maskAllText` is false;
* masking `value` on submit/button inputs without listing `value` still requires `maskAllText`.
*/
export declare function maskAttribute({ el, key, maskAttributes, maskAllText, privacyOptions, value, }: MaskAttributeParams): string;
export {};
//# sourceMappingURL=maskAttribute.d.ts.map
import { ReplayRecordingData } from '@sentry/core';
/**
* Prepare the recording data ready to be sent.
*/
export declare function prepareRecordingData({ recordingData, headers, }: {
recordingData: ReplayRecordingData;
headers: Record<string, unknown>;
}): ReplayRecordingData;
//# sourceMappingURL=prepareRecordingData.d.ts.map
import { Client, ReplayEvent, Scope } from '@sentry/core';
/**
* Prepare a replay event & enrich it with the SDK metadata.
*/
export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
client: Client;
scope: Scope;
replayId: string;
event: ReplayEvent;
}): Promise<ReplayEvent | null>;
//# sourceMappingURL=prepareReplayEvent.d.ts.map
/**
* Reset the `replay_id` field on the DSC.
*/
export declare function resetReplayIdOnDynamicSamplingContext(): void;
/**
* Set the `replay_id` field on the cached DSC.
* This is needed after a session refresh because the cached DSC on the scope
* (set by browserTracingIntegration when the idle span ended) persists across
* session boundaries. Without updating it, the new session's replay_id would
* never appear in DSC since `getDynamicSamplingContextFromClient` (and its
* `createDsc` hook) is not called when a cached DSC already exists.
*/
export declare function setReplayIdOnDynamicSamplingContext(replayId: string): void;
//# sourceMappingURL=resetReplayIdOnDynamicSamplingContext.d.ts.map
/**
* Vendored in from @sentry/rrweb.
*
* This is a copy of the function from rrweb, it is not nicely exported there.
*/
export declare function closestElementOfNode(node: Node | null): HTMLElement | null;
//# sourceMappingURL=rrweb.d.ts.map
import { SendReplayData } from '../types';
/**
* Finalize and send the current replay event to Sentry
*/
export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
count: number;
interval: number;
}): Promise<unknown>;
//# sourceMappingURL=sendReplay.d.ts.map
import { RateLimits, TransportMakeRequestResponse } from '@sentry/core';
import { SendReplayData } from '../types';
/**
* Send replay attachment using `fetch()`
*/
export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, eventContext, timestamp, session, }: SendReplayData): Promise<TransportMakeRequestResponse>;
/**
* This error indicates that the transport returned an invalid status code.
*/
export declare class TransportStatusCodeError extends Error {
constructor(statusCode: number);
}
/**
* This error indicates that we hit a rate limit API error.
*/
export declare class RateLimitError extends Error {
rateLimits: RateLimits;
constructor(rateLimits: RateLimits);
}
/**
* This error indicates that the replay duration limit was exceeded and the session is too long.
*
*/
export declare class ReplayDurationLimitError extends Error {
constructor();
}
//# sourceMappingURL=sendReplayRequest.d.ts.map
import { ReplayContainer } from '../types';
/**
* Check whether a given request URL should be filtered out. This is so we
* don't log Sentry ingest requests.
*/
export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
//# sourceMappingURL=shouldFilterRequest.d.ts.map
export declare const THROTTLED = "__THROTTLED";
export declare const SKIPPED = "__SKIPPED";
/**
* Create a throttled function off a given function.
* When calling the throttled function, it will call the original function only
* if it hasn't been called more than `maxCount` times in the last `durationSeconds`.
*
* Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,
* or else the return value of the original function.
*/
export declare function throttle<T extends (...rest: any[]) => any>(fn: T, maxCount: number, durationSeconds: number): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED;
//# sourceMappingURL=throttle.d.ts.map
/**
* Converts a timestamp to ms, if it was in s, or keeps it as ms.
*/
export declare function timestampToMs(timestamp: number): number;
/**
* Converts a timestamp to s, if it was in ms, or keeps it as s.
*/
export declare function timestampToS(timestamp: number): number;
//# sourceMappingURL=timestamp.d.ts.map
import '@sentry-internal/replay-worker/worker-bundler';
//# sourceMappingURL=worker-bundler.d.ts.map
import { GLOBAL_OBJ } from '@sentry/core';
export declare const WINDOW: typeof GLOBAL_OBJ & Window;
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
export declare const REPLAY_EVENT_NAME = "replay_event";
export declare const RECORDING_EVENT_NAME = "replay_recording";
export declare const UNABLE_TO_SEND_REPLAY = "Unable to send Replay";
export declare const SESSION_IDLE_PAUSE_DURATION = 300000;
export declare const SESSION_IDLE_EXPIRE_DURATION = 900000;
/** Default flush delays */
export declare const DEFAULT_FLUSH_MIN_DELAY = 5000;
export declare const DEFAULT_FLUSH_MAX_DELAY = 5500;
export declare const BUFFER_CHECKOUT_TIME = 60000;
export declare const RETRY_BASE_INTERVAL = 5000;
export declare const RETRY_MAX_COUNT = 3;
export declare const NETWORK_BODY_MAX_SIZE = 150000;
export declare const CONSOLE_ARG_MAX_SIZE = 5000;
export declare const SLOW_CLICK_THRESHOLD = 3000;
export declare const SLOW_CLICK_SCROLL_TIMEOUT = 300;
/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */
export declare const REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000;
/** Replays must be min. 5s long before we send them. */
export declare const MIN_REPLAY_DURATION = 4999;
export declare const MIN_REPLAY_DURATION_LIMIT = 50000;
/** The max. length of a replay. */
export declare const MAX_REPLAY_DURATION = 3600000;
/** Default attributes to be ignored when `maskAllText` is enabled */
export declare const DEFAULT_IGNORED_ATTRIBUTES: string[];
//# sourceMappingURL=constants.d.ts.map
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,eAAO,MAAM,MAAM,EAAiB,OAAO,UAAU,GAAG,MAAM,CAAC;AAE/D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAG7D,eAAO,MAAM,2BAA2B,SAAU,CAAC;AAGnD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD,2BAA2B;AAC3B,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,eAAe,IAAI,CAAC;AAGjC,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAG7C,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAG1C,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,qHAAqH;AACrH,eAAO,MAAM,4BAA4B,WAAa,CAAC;AAEvD,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AAMzC,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,mCAAmC;AACnC,eAAO,MAAM,mBAAmB,UAAY,CAAC;AAE7C,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,UAA2B,CAAC"}
import type { Event, TransportMakeRequestResponse } from '@sentry/core';
import type { ReplayContainer } from '../types';
type AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback;
export {};
//# sourceMappingURL=handleAfterSendEvent.d.ts.map
{"version":3,"file":"handleAfterSendEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleAfterSendEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAoB,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAEtG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,4BAA4B,KAAK,IAAI,CAAC;AAEjG;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,sBAAsB,CAqBpF"}
import type { Event } from '@sentry/core';
import type { ReplayContainer } from '../types';
type BeforeSendEventCallback = (event: Event) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleBeforeSendEvent(replay: ReplayContainer): BeforeSendEventCallback;
export {};
//# sourceMappingURL=handleBeforeSendEvent.d.ts.map
{"version":3,"file":"handleBeforeSendEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleBeforeSendEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,KAAK,uBAAuB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAEtD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,uBAAuB,CAQtF"}
import type { Breadcrumb } from '@sentry/core';
import type { ReplayContainer } from '../types';
import type { ReplayFrame } from '../types/replayFrame';
type BreadcrumbWithCategory = Required<Pick<Breadcrumb, 'category'>>;
/**
* Handle breadcrumbs that Sentry captures, and make sure to capture relevant breadcrumbs to Replay as well.
*/
export declare function handleBreadcrumbs(replay: ReplayContainer): void;
/** Exported only for tests. */
export declare function normalizeBreadcrumb(breadcrumb: Breadcrumb): Breadcrumb | null;
/** exported for tests only */
export declare function normalizeConsoleBreadcrumb(breadcrumb: Omit<Breadcrumb, 'category'> & BreadcrumbWithCategory): ReplayFrame;
export {};
//# sourceMappingURL=handleBreadcrumbs.d.ts.map
{"version":3,"file":"handleBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleBreadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,KAAK,sBAAsB,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAErE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAQ/D;AAaD,+BAA+B;AAC/B,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAsB7E;AAED,8BAA8B;AAC9B,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,sBAAsB,GAChE,WAAW,CAgDb"}
import type { Breadcrumb } from '@sentry/core';
import type { RecordingEvent, ReplayClickDetector, ReplayContainer, SlowClickConfig } from '../types';
import { addBreadcrumbEvent } from './util/addBreadcrumbEvent';
/** Handle a click. */
export declare function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void;
/** A click detector class that can be used to detect slow or rage clicks on elements. */
export declare class ClickDetector implements ReplayClickDetector {
protected _lastMutation: number;
protected _lastScroll: number;
private _clicks;
private _teardown;
private _threshold;
private _scrollTimeout;
private _timeout;
private _ignoreSelector;
private _replay;
private _checkClickTimeout?;
private _addBreadcrumbEvent;
constructor(replay: ReplayContainer, slowClickConfig: SlowClickConfig, _addBreadcrumbEvent?: typeof addBreadcrumbEvent);
/** Register click detection handlers on mutation or scroll. */
addListeners(): void;
/** Clean up listeners. */
removeListeners(): void;
/** @inheritDoc */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** @inheritDoc */
registerMutation(timestamp?: number): void;
/** @inheritDoc */
registerScroll(timestamp?: number): void;
/** @inheritDoc */
registerClick(element: HTMLElement): void;
/** Count multiple clicks on elements. */
private _handleMultiClick;
/** Get all pending clicks for a given node. */
private _getClicks;
/** Check the clicks that happened. */
private _checkClicks;
/** Generate matching breadcrumb(s) for the click. */
private _generateBreadcrumbs;
/** Schedule to check current clicks. */
private _scheduleCheckClicks;
}
/** exported for tests only */
export declare function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean;
/** Update the click detector based on a recording event of rrweb. */
export declare function updateClickDetectorForRecordingEvent(clickDetector: ReplayClickDetector, event: RecordingEvent): void;
//# sourceMappingURL=handleClick.d.ts.map
{"version":3,"file":"handleClick.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EAGf,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAsC/D,sBAAsB;AACtB,wBAAgB,WAAW,CAAC,aAAa,EAAE,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,CAyBhF;AAWD,qEAAqE;AACrE,wBAAgB,oCAAoC,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAkCpH"}
import type { Breadcrumb, HandlerDataDom } from '@sentry/core';
import type { ReplayContainer } from '../types';
export declare const handleDomListener: (replay: ReplayContainer) => (handlerData: HandlerDataDom) => void;
/** Get the base DOM breadcrumb. */
export declare function getBaseDomBreadcrumb(target: Node | null, message: string): Breadcrumb;
/**
* An event handler to react to DOM events.
* Exported for tests.
*/
export declare function handleDom(handlerData: HandlerDataDom): Breadcrumb | null;
//# sourceMappingURL=handleDom.d.ts.map
{"version":3,"file":"handleDom.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleDom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAOhD,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,CAAC,WAAW,EAAE,cAAc,KAAK,IAmC7F,CAAC;AAEF,mCAAmC;AACnC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAwBrF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,cAAc,GAAG,UAAU,GAAG,IAAI,CAOxE"}
import type { Event, EventHint } from '@sentry/core';
import type { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addEventProcessor(listener)`.
*/
export declare function handleGlobalEventListener(replay: ReplayContainer): (event: Event, hint: EventHint) => Event | null;
//# sourceMappingURL=handleGlobalEvent.d.ts.map
{"version":3,"file":"handleGlobalEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleGlobalEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,KAAK,GAAG,IAAI,CA2FlH"}
import type { HandlerDataHistory } from '@sentry/core';
import type { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`.
*/
export declare function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HandlerDataHistory) => void;
//# sourceMappingURL=handleHistory.d.ts.map
{"version":3,"file":"handleHistory.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAe,eAAe,EAA0B,MAAM,UAAU,CAAC;AAmBrF;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,WAAW,EAAE,kBAAkB,KAAK,IAAI,CAuB5G"}
import type { Breadcrumb } from '@sentry/core';
import type { ReplayContainer } from '../types';
/** Handle keyboard events & create breadcrumbs. */
export declare function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void;
/** exported only for tests */
export declare function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null;
//# sourceMappingURL=handleKeyboardEvent.d.ts.map
{"version":3,"file":"handleKeyboardEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleKeyboardEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,mDAAmD;AACnD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAiBvF;AAED,8BAA8B;AAC9B,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI,CAiC7E"}
import type { Breadcrumb, BreadcrumbHint } from '@sentry/core';
import type { ReplayContainer, ReplayNetworkOptions } from '../types';
interface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {
replay: ReplayContainer;
}
/**
* This method does two things:
* - It enriches the regular XHR/fetch breadcrumbs with request/response size data
* - It captures the XHR/fetch breadcrumbs to the replay
* (enriching it with further data that is _not_ added to the regular breadcrumbs)
*/
export declare function handleNetworkBreadcrumbs(replay: ReplayContainer): void;
/** just exported for tests */
export declare function beforeAddNetworkBreadcrumb(options: ExtendedNetworkBreadcrumbsOptions, breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
export {};
//# sourceMappingURL=handleNetworkBreadcrumbs.d.ts.map
{"version":3,"file":"handleNetworkBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleNetworkBreadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAA0C,MAAM,cAAc,CAAC;AAIvG,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKtE,UAAU,iCAAkC,SAAQ,oBAAoB;IACtE,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA2BtE;AAED,8BAA8B;AAC9B,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iCAAiC,EAC1C,UAAU,EAAE,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,IAAI,CA8BN"}
import type { ReplayContainer } from '../types';
/**
* Sets up a PerformanceObserver to listen to all performance entry types.
* Returns a callback to stop observing.
*/
export declare function setupPerformanceObserver(replay: ReplayContainer): () => void;
//# sourceMappingURL=performanceObserver.d.ts.map
{"version":3,"file":"performanceObserver.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/performanceObserver.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,IAAI,CA4B5E"}
import type { Breadcrumb } from '@sentry/core';
import type { ReplayContainer } from '../../types';
/**
* Add a breadcrumb event to replay.
*/
export declare function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void;
//# sourceMappingURL=addBreadcrumbEvent.d.ts.map
{"version":3,"file":"addBreadcrumbEvent.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addBreadcrumbEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CA6BxF"}
import type { FeedbackEvent } from '@sentry/core';
import type { ReplayContainer } from '../../types';
/**
* Add a feedback breadcrumb event to replay.
*/
export declare function addFeedbackBreadcrumb(replay: ReplayContainer, event: FeedbackEvent): void;
//# sourceMappingURL=addFeedbackBreadcrumb.d.ts.map
{"version":3,"file":"addFeedbackBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addFeedbackBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAA8B,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/E;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CA6BzF"}
import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';
/** Add a performance entry breadcrumb */
export declare function addNetworkBreadcrumb(replay: ReplayContainer, result: ReplayPerformanceEntry<NetworkRequestData> | null): void;
//# sourceMappingURL=addNetworkBreadcrumb.d.ts.map
{"version":3,"file":"addNetworkBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addNetworkBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI/F,yCAAyC;AACzC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,GACxD,IAAI,CAqBN"}
import type { INode } from '@sentry/rrweb-snapshot';
/** Get the closest interactive parent element, or else return the given element. */
export declare function getClosestInteractive(element: Element): Element;
/**
* For clicks, we check if the target is inside of a button or link
* If so, we use this as the target instead
* This is useful because if you click on the image in <button><img></button>,
* The target will be the image, not the button, which we don't want here
*/
export declare function getClickTargetNode(event: Event | MouseEvent | Node): Node | INode | null;
/** Get the event target node. */
export declare function getTargetNode(event: Node | {
target: EventTarget | null;
}): Node | INode | null;
//# sourceMappingURL=domUtils.d.ts.map
{"version":3,"file":"domUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/domUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAIpD,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG/D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAQxF;AAED,iCAAiC;AACjC,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,GAAG;IAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAM/F"}
import type { Breadcrumb, FetchBreadcrumbData } from '@sentry/core';
import type { FetchHint } from '@sentry/browser-utils';
import type { ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestOrResponse } from '../../types';
/**
* Capture a fetch breadcrumb to a replay.
* This adds additional data (where appropriate).
*/
export declare function captureFetchBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichFetchBreadcrumb(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>): void;
/** Exported only for tests. */
export declare function _getResponseInfo(captureDetails: boolean, { networkCaptureBodies, networkResponseHeaders, }: Pick<ReplayNetworkOptions, 'networkCaptureBodies' | 'networkResponseHeaders'>, response: Response | undefined, responseBodySize?: number): Promise<ReplayNetworkRequestOrResponse | undefined>;
//# sourceMappingURL=fetchUtils.d.ts.map
{"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAsB,MAAM,uBAAuB,CAAC;AAG3E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EAEpB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAcrB;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,EACtD,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,EACxB,OAAO,EAAE,oBAAoB,GAAG;IAC9B,MAAM,EAAE,eAAe,CAAC;CACzB,GACA,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,EACtD,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GACvB,IAAI,CAcN;AA4DD,+BAA+B;AAC/B,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,OAAO,EACvB,EACE,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,IAAI,CAAC,oBAAoB,EAAE,sBAAsB,GAAG,wBAAwB,CAAC,EAChF,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,8BAA8B,GAAG,SAAS,CAAC,CAyBrD"}
/**
* Inclusion list of attributes that we want to record from the DOM element
*/
export declare function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown>;
//# sourceMappingURL=getAttributesToRecord.d.ts.map
{"version":3,"file":"getAttributesToRecord.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/getAttributesToRecord.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkBlG"}
import type { NetworkMetaWarning } from '@sentry/browser-utils';
import type { NetworkRequestData, ReplayNetworkRequestData, ReplayNetworkRequestOrResponse, ReplayPerformanceEntry } from '../../types';
/** Get the size of a body. */
export declare function getBodySize(body: RequestInit['body']): number | undefined;
/** Convert a Content-Length header to number/undefined. */
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
/** Merge a warning into an existing network request/response. */
export declare function mergeWarning(info: ReplayNetworkRequestOrResponse | undefined, warning: NetworkMetaWarning): ReplayNetworkRequestOrResponse;
/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
export declare function makeNetworkReplayBreadcrumb(type: string, data: ReplayNetworkRequestData | null): ReplayPerformanceEntry<NetworkRequestData> | null;
/** Build the request or response part of a replay network breadcrumb that was skipped. */
export declare function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse;
/** Build the request or response part of a replay network breadcrumb. */
export declare function buildNetworkRequestOrResponse(headers: Record<string, string>, bodySize: number | undefined, body: string | undefined): ReplayNetworkRequestOrResponse | undefined;
/** Filter a set of headers */
export declare function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string>;
/** Match an URL against a list of strings/Regex. */
export declare function urlMatches(url: string, urls: (string | RegExp)[]): boolean;
/** exported for tests */
export declare function getFullUrl(url: string, baseURI?: string): string;
//# sourceMappingURL=networkUtils.d.ts.map
{"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/networkUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,KAAK,EAEV,kBAAkB,EAClB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAmCzE;AAED,4DAA4D;AAC5D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,iEAAiE;AACjE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,8BAA8B,GAAG,SAAS,EAChD,OAAO,EAAE,kBAAkB,GAC1B,8BAA8B,CAiBhC;AAED,8DAA8D;AAC9D,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,wBAAwB,GAAG,IAAI,GACpC,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAqBnD;AAED,0FAA0F;AAC1F,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,8BAA8B,CAQjH;AAED,yEAAyE;AACzE,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,8BAA8B,GAAG,SAAS,CAgC5C;AAED,8BAA8B;AAC9B,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASnH;AAuDD,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAI1E;AAED,yBAAyB;AACzB,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAA0B,GAAG,MAAM,CAoBjF"}
type WindowOpenHandler = () => void;
/**
* Register a handler to be called when `window.open()` is called.
* Returns a cleanup function.
*/
export declare function onWindowOpen(cb: WindowOpenHandler): () => void;
export {};
//# sourceMappingURL=onWindowOpen.d.ts.map
{"version":3,"file":"onWindowOpen.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/onWindowOpen.ts"],"names":[],"mappings":"AAGA,KAAK,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAIpC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAe9D"}
import type { Event } from '@sentry/core';
import type { ReplayContainer } from '../../types';
/**
* Determine if event should be sampled (only applies in buffer mode).
* When an event is captured by `handleGlobalEvent`, when in buffer mode
* we determine if we want to sample the error or not.
*/
export declare function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean;
//# sourceMappingURL=shouldSampleForBufferEvent.d.ts.map
{"version":3,"file":"shouldSampleForBufferEvent.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/shouldSampleForBufferEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAiBzF"}
import type { Breadcrumb, XhrBreadcrumbData } from '@sentry/core';
import type { NetworkMetaWarning, XhrHint } from '@sentry/browser-utils';
import type { ReplayContainer, ReplayNetworkOptions } from '../../types';
/**
* Capture an XHR breadcrumb to a replay.
* This adds additional data (where appropriate).
*/
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>): void;
/**
* Get the string representation of the XHR response.
* Based on MDN, these are the possible types of the response:
* string
* ArrayBuffer
* Blob
* Document
* POJO
*
* Exported only for tests.
*/
export declare function _parseXhrResponse(body: XMLHttpRequest['response'], responseType: XMLHttpRequest['responseType']): [string | undefined, NetworkMetaWarning?];
//# sourceMappingURL=xhrUtils.d.ts.map
{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGzE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAA4B,MAAM,aAAa,CAAC;AAcnG;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,EACpD,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EACtB,OAAO,EAAE,oBAAoB,GAAG;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAC1D,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,EACpD,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GACrB,IAAI,CAkBN;AAmFD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,GAC3C,CAAC,MAAM,GAAG,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAyB3C"}
/**
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
*
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
*/
export declare const DEBUG_BUILD: boolean;
//# sourceMappingURL=debug-build.d.ts.map
{"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../src/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
/** This error indicates that the event buffer size exceeded the limit.. */
export declare class EventBufferSizeExceededError extends Error {
constructor();
}
//# sourceMappingURL=error.d.ts.map
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/error.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,qBAAa,4BAA6B,SAAQ,KAAK;;CAItD"}
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* A basic event buffer that does not do any compression.
* Used as fallback if the compression worker cannot be loaded or is disabled.
*/
export declare class EventBufferArray implements EventBuffer {
/** All the events that are buffered to be sent. */
events: RecordingEvent[];
/** @inheritdoc */
hasCheckout: boolean;
/** @inheritdoc */
waitForCheckout: boolean;
private _totalSize;
constructor();
/** @inheritdoc */
get hasEvents(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/** @inheritdoc */
destroy(): void;
/** @inheritdoc */
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritdoc */
finish(): Promise<string>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
}
//# sourceMappingURL=EventBufferArray.d.ts.map
{"version":3,"file":"EventBufferArray.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferArray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI7F;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,mDAAmD;IAC5C,MAAM,EAAE,cAAc,EAAE,CAAC;IAEhC,kBAAkB;IACX,WAAW,EAAE,OAAO,CAAC;IAE5B,kBAAkB;IACX,eAAe,EAAE,OAAO,CAAC;IAEhC,OAAO,CAAC,UAAU,CAAS;;IAS3B,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAItB,kBAAkB;IACL,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAUrE,kBAAkB;IACX,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAWhC,kBAAkB;IACX,KAAK,IAAI,IAAI;IAMpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;CAO7C"}
import type { ReplayRecordingData } from '@sentry/core';
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class EventBufferCompressionWorker implements EventBuffer {
/** @inheritdoc */
hasCheckout: boolean;
/** @inheritdoc */
waitForCheckout: boolean;
private _worker;
private _earliestTimestamp;
private _totalSize;
constructor(worker: Worker);
/** @inheritdoc */
get hasEvents(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occurred.
*/
ensureReady(): Promise<void>;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully received and processed by worker.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Finish the event buffer and return the compressed data.
*/
finish(): Promise<ReplayRecordingData>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Send the event to the worker.
*/
private _sendEventToWorker;
/**
* Finish the request and return the compressed data from the worker.
*/
private _finishRequest;
}
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map
{"version":3,"file":"EventBufferCompressionWorker.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferCompressionWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM7F;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IAC9D,kBAAkB;IACX,WAAW,EAAE,OAAO,CAAC;IAE5B,kBAAkB;IACX,eAAe,EAAE,OAAO,CAAC;IAEhC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,kBAAkB,CAAgB;IAC1C,OAAO,CAAC,UAAU,CAAC;gBAEA,MAAM,EAAE,MAAM;IAQjC,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED;;;OAGG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC;;OAEG;IACI,OAAO,IAAI,IAAI;IAItB;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB/D;;OAEG;IACI,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI7C,kBAAkB;IACX,KAAK,IAAI,IAAI;IAWpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAI5C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;OAEG;YACW,cAAc;CAQ7B"}
import type { ReplayRecordingData } from '@sentry/core';
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
* This can happen e.g. if the worker cannot be loaded.
* Exported only for testing.
*/
export declare class EventBufferProxy implements EventBuffer {
private _fallback;
private _compression;
private _used;
private _ensureWorkerIsLoadedPromise;
constructor(worker: Worker);
/** @inheritdoc */
get waitForCheckout(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/** @inheritDoc */
get hasEvents(): boolean;
/** @inheritdoc */
get hasCheckout(): boolean;
/** @inheritdoc */
set hasCheckout(value: boolean);
/** @inheritdoc */
set waitForCheckout(value: boolean);
/** @inheritDoc */
destroy(): void;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully added.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritDoc */
finish(): Promise<ReplayRecordingData>;
/** Ensure the worker has loaded. */
ensureWorkerIsLoaded(): Promise<void>;
/** Actually check if the worker has been loaded. */
private _ensureWorkerIsLoaded;
/** Switch the used buffer to the compression worker. */
private _switchToCompressionWorker;
}
//# sourceMappingURL=EventBufferProxy.d.ts.map
{"version":3,"file":"EventBufferProxy.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK7F;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,4BAA4B,CAAgB;gBAEjC,MAAM,EAAE,MAAM;IAQjC,kBAAkB;IAClB,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,WAAW,IAAI,OAAO,CAEhC;IACD,kBAAkB;IAClB,IAAW,WAAW,CAAC,KAAK,EAAE,OAAO,EAEpC;IAED,kBAAkB;IAElB,IAAW,eAAe,CAAC,KAAK,EAAE,OAAO,EAExC;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAKtB,kBAAkB;IACX,KAAK,IAAI,IAAI;IAIpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAI5C;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAI/D,kBAAkB;IACL,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAOnD,oCAAoC;IAC7B,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C,oDAAoD;YACtC,qBAAqB;IAcnC,wDAAwD;YAC1C,0BAA0B;CAyBzC"}
import type { EventBuffer, ReplayWorkerURL } from '../types';
interface CreateEventBufferParams {
useCompression: boolean;
workerUrl?: ReplayWorkerURL;
}
/**
* Create an event buffer for replays.
*/
export declare function createEventBuffer({ useCompression, workerUrl: customWorkerUrl, }: CreateEventBufferParams): EventBuffer;
export {};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK7D,UAAU,uBAAuB;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAKD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,SAAS,EAAE,eAAe,GAC3B,EAAE,uBAAuB,GAAG,WAAW,CAevC"}
import type { WorkerRequest } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class WorkerHandler {
private _worker;
private _id;
private _ensureReadyPromise?;
private _pending;
constructor(worker: Worker);
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occurred.
*/
ensureReady(): Promise<void>;
/**
* Destroy the worker.
*/
destroy(): void;
/**
* Post message to worker and wait for response before resolving promise.
*/
postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T>;
private _onMessage;
/** Get the current ID and increment it for the next call. */
private _getAndIncrementId;
}
//# sourceMappingURL=WorkerHandler.d.ts.map
{"version":3,"file":"WorkerHandler.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/WorkerHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAS9D;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,mBAAmB,CAAC,CAAgB;IAC5C,OAAO,CAAC,QAAQ,CAA8B;gBAE3B,MAAM,EAAE,MAAM;IAUjC;;;OAGG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCnC;;OAEG;IACI,OAAO,IAAI,IAAI;IAQtB;;OAEG;IACI,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAoB9F,OAAO,CAAC,UAAU,CAsBhB;IAEF,6DAA6D;IAC7D,OAAO,CAAC,kBAAkB;CAG3B"}
export { replayIntegration } from './integration';
export type { ReplayConfiguration, ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, CanvasManagerInterface, CanvasManagerOptions, } from './types';
export { getReplay } from './util/getReplay';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
import type { Client, Integration, ReplayRecordingMode, StreamedSpanJSON } from '@sentry/core';
import type { ReplayConfiguration, SendBufferedReplayOptions } from './types';
/**
* Instruments the global Request constructor to store the original body.
* This allows us to retrieve the original body value later, since Request
* converts string bodies to ReadableStreams.
*/
export declare function _INTERNAL_instrumentRequestInterface(): void;
/**
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/).
*
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information.
*
* @example
*
* ```
* Sentry.init({
* dsn: '__DSN__',
* integrations: [Sentry.replayIntegration()],
* });
* ```
*/
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay;
/**
* Replay integration
*/
export declare class Replay implements Integration {
/**
* @inheritDoc
*/
name: string;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
/**
* Initial options passed to the replay integration, merged with default values.
* Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
* can only be finally set when setupOnce() is called.
*
* @private
*/
private readonly _initialOptions;
private _replay?;
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, onError, attachRawBodyFromRequest, }?: ReplayConfiguration);
/** If replay has already been initialized */
protected get _isInitialized(): boolean;
/** Update _isInitialized */
protected set _isInitialized(value: boolean);
/**
* Setup and initialize replay container
*/
afterAllSetup(client: Client): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will log a message if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* PerformanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, until an error occurs.
*/
startBuffering(): void;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop(): Promise<void>;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* If replay is not enabled, a new session replay is started.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
flush(options?: SendBufferedReplayOptions): Promise<void>;
/**
* Get the current session ID.
*
* @param onlyIfSampled - If true, will only return the session ID if the session is sampled.
*
*/
getReplayId(onlyIfSampled?: boolean): string | undefined;
/**
* Get the current recording mode. This can be either `session` or `buffer`.
*
* `session`: Recording the whole session, sending it continuously
* `buffer`: Always keeping the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
getRecordingMode(): ReplayRecordingMode | undefined;
processSpan(span: StreamedSpanJSON): void;
/**
* Initializes replay.
*/
protected _initialize(client: Client): void;
/** Setup the integration. */
private _setup;
/** Get canvas options from ReplayCanvas integration, if it is also added. */
private _maybeLoadFromReplayCanvasIntegration;
}
//# sourceMappingURL=integration.d.ts.map
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EACN,WAAW,EAEX,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAUtB,OAAO,KAAK,EAIV,mBAAmB,EAEnB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAejB;;;;GAIG;AACH,wBAAgB,oCAAoC,IAAI,IAAI,CA0B3D;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,aAAe,mBAAmB,WAEtC,CAAC;AAE3B;;GAEG;AACH,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAE7D,OAAO,CAAC,OAAO,CAAC,CAAkB;gBAEf,EACjB,aAAuC,EACvC,aAAuC,EACvC,iBAAuC,EACvC,iBAAuC,EACvC,aAAoB,EACpB,cAAqB,EACrB,SAAS,EACT,YAAiB,EACjB,WAAkB,EAClB,aAAoB,EACpB,aAAoB,EAEpB,uBAA6B,EAC7B,aAAsB,EAEtB,gBAAwB,EACxB,wBAA6B,EAE7B,sBAA2B,EAC3B,qBAA0B,EAC1B,oBAA2B,EAC3B,qBAA0B,EAC1B,sBAA2B,EAE3B,IAAS,EACT,cAAuD,EACvD,MAAW,EACX,KAAU,EACV,OAAY,EACZ,MAAW,EACX,MAAM,EAEN,uBAAuB,EACvB,mBAAmB,EACnB,OAAO,EACP,wBAAgC,GACjC,GAAE,mBAAwB;IA6F3B,6CAA6C;IAC7C,SAAS,KAAK,cAAc,IAAI,OAAO,CAEtC;IAED,4BAA4B;IAC5B,SAAS,KAAK,cAAc,CAAC,KAAK,EAAE,OAAO,EAE1C;IAED;;OAEG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAa1C;;;;;;OAMG;IACI,KAAK,IAAI,IAAI;IAOpB;;;OAGG;IACI,cAAc,IAAI,IAAI;IAQ7B;;;OAGG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B;;;;;;;OAOG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAchE;;;;;OAKG;IACI,WAAW,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAQ/D;;;;;;;OAOG;IACI,gBAAgB,IAAI,mBAAmB,GAAG,SAAS;IAQnD,WAAW,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAUhD;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAS3C,6BAA6B;IAC7B,OAAO,CAAC,MAAM;IAUd,6EAA6E;IAC7E,OAAO,CAAC,qCAAqC;CAkB9C"}
import type { ReplayRecordingMode, ReplayStopReason, Span } from '@sentry/core';
import { ClickDetector } from './coreHandlers/handleClick';
import type { AddEventResult, AddUpdateCallback, AllPerformanceEntry, AllPerformanceEntryData, EventBuffer, InternalEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPerformanceEntry, ReplayPluginOptions, SendBufferedReplayOptions, Session, Timeouts } from './types';
import type { SKIPPED } from './util/throttle';
import { THROTTLED } from './util/throttle';
/**
* The main replay container class, which holds all the state and methods for recording and sending replays.
*/
export declare class ReplayContainer implements ReplayContainerInterface {
eventBuffer: EventBuffer | null;
performanceEntries: AllPerformanceEntry[];
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
clickDetector: ClickDetector | undefined;
/**
* Recording can happen in one of two modes:
* - session: Record the whole session, sending it continuously
* - buffer: Always keep the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
recordingMode: ReplayRecordingMode;
/**
* The current or last active span.
* This is only available when performance is enabled.
*/
lastActiveSpan?: Span;
/**
* These are here so we can overwrite them in tests etc.
* @hidden
*/
readonly timeouts: Timeouts;
/** The replay has to be manually started, because no sample rate (neither session or error) was provided. */
private _requiresManualStart;
private _throttledAddEvent;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
private readonly _options;
private _performanceCleanupCallback?;
private _debouncedFlush;
private _flushLock;
/**
* Timestamp of the last user activity. This lives across sessions.
*/
private _lastActivity;
/**
* Is the integration currently active?
*/
private _isEnabled;
/**
* Paused is a state where:
* - DOM Recording is not listening at all
* - Nothing will be added to event buffer (e.g. core SDK events)
*/
private _isPaused;
/**
* Have we attached listeners to the core SDK?
* Note we have to track this as there is no way to remove instrumentation handlers.
*/
private _hasInitializedCoreListeners;
/**
* Function to stop recording
*/
private _stopRecording;
private _context;
/**
* Internal use for canvas recording options
*/
private _canvas;
/**
* Handle when visibility of the page content changes. Opening a new tab will
* cause the state to change to hidden because of content of current page will
* be hidden. Likewise, moving a different window to cover the contents of the
* page will also trigger a change to a hidden state.
*/
private _handleVisibilityChange;
/**
* Handle when page is blurred
*/
private _handleWindowBlur;
/**
* Handle when page is focused
*/
private _handleWindowFocus;
/** Ensure page remains active when a key is pressed. */
private _handleKeyboardEvent;
constructor({ options, recordingOptions, }: {
options: ReplayPluginOptions;
recordingOptions: RecordingOptions;
});
/** Get the event context. */
getContext(): InternalEventContext;
/** If recording is currently enabled. */
isEnabled(): boolean;
/** If recording is currently paused. */
isPaused(): boolean;
/**
* Determine if canvas recording is enabled
*/
isRecordingCanvas(): boolean;
/** Get the replay integration options. */
getOptions(): ReplayPluginOptions;
/** A wrapper to conditionally capture exceptions. */
handleException(error: unknown): void;
/**
* Initializes the plugin based on sampling configuration. Should not be
* called outside of constructor.
*/
initializeSampling(previousSessionId?: string): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will log a message if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* _performanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, an error occurs.
*/
startBuffering(): void;
/**
* Start recording.
*
* Note that this will cause a new DOM checkout
*/
startRecording(): void;
/**
* Stops the recording, if it was running.
*
* Returns true if it was previously stopped, or is now stopped,
* otherwise false.
*/
stopRecording(): boolean;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop({ forceFlush, reason, }?: {
forceFlush?: boolean;
reason?: ReplayStopReason;
}): Promise<void>;
/**
* Pause some replay functionality. See comments for `_isPaused`.
* This differs from stop as this only stops DOM recording, it is
* not as thorough of a shutdown as `stop()`.
*/
pause(): void;
/**
* Resumes recording, see notes for `pause().
*
* Note that calling `startRecording()` here will cause a
* new DOM checkout.`
*/
resume(): void;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
sendBufferedReplayOrFlush({ continueRecording }?: SendBufferedReplayOptions): Promise<void>;
/**
* We want to batch uploads of replay events. Save events only if
* `<flushMinDelay>` milliseconds have elapsed since the last event
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
*
* Accepts a callback to perform side-effects and returns true to stop batch
* processing and hand back control to caller.
*/
addUpdate(cb: AddUpdateCallback): void;
/**
* Updates the user activity timestamp and resumes recording. This should be
* called in an event handler for a user action that we consider as the user
* being "active" (e.g. a mouse click).
*/
triggerUserActivity(): void;
/**
* Updates the user activity timestamp *without* resuming
* recording. Some user events (e.g. keydown) can be create
* low-value replays that only contain the keypress as a
* breadcrumb. Instead this would require other events to
* create a new replay after a session has expired.
*/
updateUserActivity(): void;
/**
* Only flush if `this.recordingMode === 'session'`
*/
conditionalFlush(): Promise<void>;
/**
* Flush using debounce flush
*/
flush(): Promise<void>;
/**
* Always flush via `_debouncedFlush` so that we do not have flushes triggered
* from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
* cases of multiple flushes happening closely together.
*/
flushImmediate(): Promise<void>;
/**
* Cancels queued up flushes.
*/
cancelFlush(): void;
/** Get the current session (=replay) ID
*
* @param onlyIfSampled - If true, will only return the session ID if the session is sampled.
*/
getSessionId(onlyIfSampled?: boolean): string | undefined;
/**
* Checks if recording should be stopped due to user inactivity. Otherwise
* check if session is expired and create a new session if so. Triggers a new
* full snapshot on new session.
*
* Returns true if session is not expired, false otherwise.
* @hidden
*/
checkAndHandleExpiredSession(): boolean | void;
/**
* Capture some initial state that can change throughout the lifespan of the
* replay. This is required because otherwise they would be captured at the
* first flush.
*/
setInitialState(): void;
/**
* Add a breadcrumb event, that may be throttled.
* If it was throttled, we add a custom breadcrumb to indicate that.
*/
throttledAddEvent(event: RecordingEvent, isCheckout?: boolean): typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
/**
* This will get the parametrized route name of the current page.
* This is only available if performance is enabled, and if an instrumented router is used.
*/
getCurrentRoute(): string | undefined;
/**
* Initialize and start all listeners to varying events (DOM,
* Performance Observer, Recording, Sentry SDK, etc)
*/
private _initializeRecording;
/**
* Loads (or refreshes) the current session.
*/
private _initializeSessionForSampling;
/**
* Checks and potentially refreshes the current session.
* Returns false if session is not recorded.
*/
private _checkSession;
/**
* Refresh a session with a new one.
* This stops the current session (without forcing a flush, as that would never work since we are expired),
* and then does a new sampling based on the refreshed session.
*/
private _refreshSession;
/**
* Adds listeners to record events for the replay
*/
private _addListeners;
/**
* Cleans up listeners that were created in `_addListeners`
*/
private _removeListeners;
/**
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
*/
private _doChangeToBackgroundTasks;
/**
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
*/
private _doChangeToForegroundTasks;
/**
* Update user activity (across session lifespans)
*/
private _updateUserActivity;
/**
* Updates the session's last activity timestamp
*/
private _updateSessionActivity;
/**
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
*/
private _createCustomBreadcrumb;
/**
* Observed performance events are added to `this.performanceEntries`. These
* are included in the replay event before it is finished and sent to Sentry.
*/
private _addPerformanceEntries;
/**
* Clear _context
*/
private _clearContext;
/** Update the initial timestamp based on the buffer content. */
private _updateInitialTimestampFromEventBuffer;
/**
* Return and clear _context
*/
private _popEventContext;
/**
* Flushes replay event buffer to Sentry.
*
* Performance events are only added right before flushing - this is
* due to the buffered performance observer events.
*
* Should never be called directly, only by `flush`
*/
private _runFlush;
/**
* Flush recording data to Sentry. Creates a lock so that only a single flush
* can be active at a time. Do not call this directly.
*/
private _flush;
/** Save the session, if it is sticky */
private _maybeSaveSession;
/** Handler for rrweb.record.onMutation */
private _onMutationHandler;
}
//# sourceMappingURL=replay.d.ts.map
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/replay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAWhF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,OAAO,KAAK,EACV,cAAc,EACd,iBAAi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H,OAAO,CAAC,uBAAuB;IAe/B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAoB9B;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB,gEAAgE;IAChE,OAAO,CAAC,sCAAsC;IAmB9C;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;;;;;OAOG;YACW,SAAS;IAoFvB;;;OAGG;YACW,MAAM;IAkFpB,wCAAwC;IACxC,OAAO,CAAC,iBAAiB;IAMzB,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB;CA4C3B"}
import type { ReplayContainer } from '../../src/types';
/**
* Removes the session from Session Storage and unsets session in replay instance
*/
export declare function clearSession(replay: ReplayContainer): void;
//# sourceMappingURL=clearSession.d.ts.map
{"version":3,"file":"clearSession.d.ts","sourceRoot":"","sources":["../../../../src/session/clearSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAG1D"}
import type { Sampled, Session, SessionOptions } from '../types';
/**
* Get the sampled status for a session based on sample rates & current sampled status.
*/
export declare function getSessionSampleType(sessionSampleRate: number, allowBuffering: boolean): Sampled;
/**
* Create a new session, which in its current implementation is a Sentry event
* that all replays will be saved to as attachments. Currently, we only expect
* one of these Sentry events per "replay session".
*/
export declare function createSession({ sessionSampleRate, allowBuffering, stickySession }: SessionOptions, { previousSessionId }?: {
previousSessionId?: string;
}): Session;
//# sourceMappingURL=createSession.d.ts.map
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../src/session/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAKjE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAEhG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAqB,EAAE,EAAE,cAAc,EAC5E,EAAE,iBAAiB,EAAE,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GACzD,OAAO,CAYT"}
import type { Session } from '../types';
/**
* Fetches a session from storage
*/
export declare function fetchSession(): Session | null;
//# sourceMappingURL=fetchSession.d.ts.map
{"version":3,"file":"fetchSession.d.ts","sourceRoot":"","sources":["../../../../src/session/fetchSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKxC;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,GAAG,IAAI,CAqB7C"}
import type { Session, SessionOptions } from '../types';
/**
* Get or create a session, when initializing the replay.
* Returns a session that may be unsampled.
*/
export declare function loadOrCreateSession({ sessionIdleExpire, maxReplayDuration, previousSessionId, }: {
sessionIdleExpire: number;
maxReplayDuration: number;
previousSessionId?: string;
}, sessionOptions: SessionOptions): Session;
//# sourceMappingURL=loadOrCreateSession.d.ts.map
{"version":3,"file":"loadOrCreateSession.d.ts","sourceRoot":"","sources":["../../../../src/session/loadOrCreateSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAMxD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,EACE,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,EAAE;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,EACD,cAAc,EAAE,cAAc,GAC7B,OAAO,CAeT"}
import type { Session } from '../types';
/**
* Save a session to session storage.
*/
export declare function saveSession(session: Session): void;
//# sourceMappingURL=saveSession.d.ts.map
{"version":3,"file":"saveSession.d.ts","sourceRoot":"","sources":["../../../../src/session/saveSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAUlD"}
import type { Sampled, Session } from '../types';
/**
* Get a session with defaults & applied sampling.
*/
export declare function makeSession(session: Partial<Session> & {
sampled: Sampled;
}): Session;
//# sourceMappingURL=Session.d.ts.map
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../src/session/Session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEjD;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAoBrF"}
import type { Session } from '../types';
/** If the session should be refreshed or not. */
export declare function shouldRefreshSession(session: Session, { sessionIdleExpire, maxReplayDuration }: {
sessionIdleExpire: number;
maxReplayDuration: number;
}): boolean;
//# sourceMappingURL=shouldRefreshSession.d.ts.map
{"version":3,"file":"shouldRefreshSession.d.ts","sourceRoot":"","sources":["../../../../src/session/shouldRefreshSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,iDAAiD;AACjD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACjG,OAAO,CAYT"}
export * from './performance';
export * from './replay';
export * from './replayFrame';
export * from './request';
export * from './rrweb';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
import type { ReplayNetworkRequestOrResponse } from './request';
export type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
export type PerformancePaintTiming = PerformanceEntry;
export type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
type: string;
transferSize: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "interactive".
*/
domInteractive: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's DOMContentLoaded event handler starts.
*/
domContentLoadedEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's DOMContentLoaded event handler completes.
*/
domContentLoadedEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's load event handler starts.
*/
loadEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's load event handler completes.
*/
loadEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "complete".
*/
domComplete: number;
/**
* A number representing the number of redirects since the last non-redirect
* navigation in the current browsing context.
*/
redirectCount: number;
};
export type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
responseStatus?: number;
};
export type PaintData = undefined;
/**
* See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
*
* Note `navigation.push` will not have any data
*/
export type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
/**
* Transfer size of resource
*/
size?: number;
};
export type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
/**
* Transfer size of resource
*/
size: number;
/**
* HTTP status code. Note this is experimental and not available on all browsers.
*/
statusCode?: number;
};
export interface WebVitalData {
/**
* Render time (in ms) of the LCP
*/
value: number;
size: number;
/**
* The rating as to whether the metric value is within the "good",
* "needs improvement", or "poor" thresholds of the metric.
*/
rating: 'good' | 'needs-improvement' | 'poor';
/**
* The recording id of the web vital nodes. -1 if not found
*/
nodeIds?: number[];
/**
* The layout shifts of a CLS metric
*/
attributions?: {
value: number;
nodeIds: number[] | undefined;
}[];
}
/**
* Entries that come from window.performance
*/
export type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | WebVitalData;
export interface MemoryData {
memory: {
jsHeapSizeLimit: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
};
}
export interface NetworkRequestData {
method?: string;
statusCode?: number;
requestBodySize?: number;
responseBodySize?: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
}
export interface HistoryData {
previous: string | undefined;
}
export type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
export interface ReplayPerformanceEntry<T> {
/**
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
*/
type: string;
/**
* A more specific description of the performance entry
*/
name: string;
/**
* The start timestamp in seconds
*/
start: number;
/**
* The end timestamp in seconds
*/
end: number;
/**
* Additional unstructured data to be included
*/
data: T;
}
//# sourceMappingURL=performance.d.ts.map
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../src/types/performance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,GAAG,yBAAyB,GAAG,2BAA2B,CAAC;AAInH,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AACtD,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GACxD,yBAAyB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,0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;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAE/F,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE;QACN,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,8BAA8B,CAAC;IACzC,QAAQ,CAAC,EAAE,8BAA8B,CAAC;CAC3C;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,uBAAuB,GAAG,UAAU,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAEnG,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;CACT"}
import type { Breadcrumb, ErrorEvent, ReplayRecordingData, ReplayRecordingMode, ReplayStopReason, Span } from '@sentry/core';
import type { SKIPPED, THROTTLED } from '../util/throttle';
import type { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance';
import type { ReplayFrameEvent } from './replayFrame';
import type { ReplayNetworkRequestOrResponse } from './request';
import type { CanvasManagerInterface, CanvasManagerOptions, ReplayEventWithTime, RrwebRecordOptions } from './rrweb';
export type RecordingEvent = ReplayFrameEvent | ReplayEventWithTime;
export type RecordingOptions = RrwebRecordOptions;
export interface SendReplayData {
recordingData: ReplayRecordingData;
replayId: string;
segmentId: number;
eventContext: PopEventContext;
timestamp: number;
session: Session;
onError?: (err: unknown) => void;
}
export interface Timeouts {
sessionIdlePause: number;
sessionIdleExpire: number;
}
/**
* The request payload to worker
*/
export interface WorkerRequest {
id: number;
method: 'clear' | 'addEvent' | 'finish';
arg?: string;
}
/**
* The response from the worker
*/
export interface WorkerResponse {
id: number;
method: string;
success: boolean;
response: unknown;
}
export type AddEventResult = void;
export interface BeforeAddRecordingEvent {
(event: ReplayFrameEvent): ReplayFrameEvent | null | undefined;
}
export interface ReplayNetworkOptions {
/**
* Capture request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will match any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
*
* Only URLs matching these patterns will have bodies & additional headers captured.
*/
networkDetailAllowUrls: (string | RegExp)[];
/**
* Deny request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will deny any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
* URLs matching these patterns will not have bodies & additional headers captured.
*/
networkDetailDenyUrls: (string | RegExp)[];
/**
* If request & response bodies should be captured.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Defaults to true.
*/
networkCaptureBodies: boolean;
/**
* Capture the following request headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkRequestHeaders: string[];
/**
* Capture the following response headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkResponseHeaders: string[];
}
export type ReplayWorkerURL = string | URL;
export interface ReplayPluginOptions extends ReplayNetworkOptions {
/**
* The sample rate for session-long replays. 1.0 will record all sessions and
* 0 will record none.
*/
sessionSampleRate: number;
/**
* The sample rate for sessions that has had an error occur. This is
* independent of `sessionSampleRate`.
*/
errorSampleRate: number;
/**
* If false, will create a new session per pageload. Otherwise, saves session
* to Session Storage.
*/
stickySession: boolean;
/**
* The amount of time to wait before sending a replay
*/
flushMinDelay: number;
/**
* The max amount of time to wait before sending a replay
*/
flushMaxDelay: number;
/**
* Attempt to use compression when web workers are available
*
* (default is true)
*/
useCompression: boolean;
/**
* If defined, use this worker URL instead of the default included one for compression.
* This will only be used if `useCompression` is not false.
*/
workerUrl?: ReplayWorkerURL;
/**
* Block all media (e.g. images, svg, video) in recordings.
*/
blockAllMedia: boolean;
/**
* Mask all inputs in recordings
*/
maskAllInputs: boolean;
/**
* Mask all text in recordings
*/
maskAllText: boolean;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will create
* a breadcrumb in the recording when the limit has been reached.
*/
mutationBreadcrumbLimit: number;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will cause
* recording to stop when the limit has been reached.
*/
mutationLimit: number;
/**
* The max. time in ms to wait for a slow click to finish.
* After this amount of time we stop waiting for actions after a click happened.
* Set this to 0 to disable slow click capture.
*
* Default: 7000ms
*/
slowClickTimeout: number;
/**
* Ignore clicks on elements matching the given selectors for slow click detection.
*/
slowClickIgnoreSelectors: string[];
/**
* The min. duration (in ms) a replay has to have before it is sent to Sentry.
* Whenever attempting to flush a session that is shorter than this, it will not actually send it to Sentry.
* Note that this is capped at max. 50s, so we don't unintentionally drop buffered replays that are longer than 60s
*
* Warning: Setting this to a higher value can result in unintended drops of onError-sampled replays.
*
*/
minReplayDuration: number;
/**
* The max. duration (in ms) a replay session may be.
* This is capped at max. 60min.
*/
maxReplayDuration: number;
/**
* Callback before adding a custom recording event
*
* Events added by the underlying DOM recording library can *not* be modified,
* only custom recording events from the Replay integration will trigger the
* callback listeners. This can be used to scrub certain fields in an event (e.g. URLs from navigation events).
*
* Returning a `null` will drop the event completely. Note, dropping a recording
* event is not the same as dropping the replay, the replay will still exist and
* continue to function.
*/
beforeAddRecordingEvent?: BeforeAddRecordingEvent;
/**
* An optional callback to be called before we decide to sample based on an error.
* If specified, this callback will receive an error that was captured by Sentry.
* Return `true` to continue sampling for this error, or `false` to ignore this error for replay sampling.
* Note that returning `true` means that the `replaysOnErrorSampleRate` will be checked,
* not that it will definitely be sampled.
* Use this to filter out groups of errors that should def. not be sampled.
*/
beforeErrorSampling?: (event: ErrorEvent) => boolean;
/**
* Callback when an internal SDK error occurs. This can be used to debug SDK
* issues.
*/
onError?: (err: unknown) => void;
/**
* Patch the global Request() interface to store original request bodies.
* This allows Replay to capture the original body from Request objects passed to fetch().
*
* When enabled, creates a copy of the original body before it's converted to a ReadableStream.
* This is useful for capturing request bodies in network breadcrumbs.
*
* Note: This modifies the global Request constructor.
*
* @default false
*/
attachRawBodyFromRequest?: boolean;
/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
captureExceptions: boolean;
traceInternals: boolean;
continuousCheckout: number;
/**
* Before enabling, please read the security considerations:
* https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/cross-origin-iframes.md#considerations
*/
recordCrossOriginIframes: boolean;
/**
* Completely ignore mutations matching the given selectors.
* This can be used if a specific type of mutation is causing (e.g. performance) problems.
* NOTE: This can be dangerous to use, as mutations are applied as incremental patches.
* Make sure to verify that the captured replays still work when using this option.
*/
ignoreMutations: string[];
}>;
}
/**
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`.
*/
export type InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>;
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & {
/**
* Mask element attributes that are contained in list
*/
maskAttributes?: string[];
};
/**
* Session options that are configurable by the integration configuration
*/
export interface SessionOptions extends Pick<ReplayPluginOptions, 'sessionSampleRate' | 'stickySession'> {
/**
* Should buffer recordings to be saved later either by error sampling, or by
* manually calling `flush()`. This is only a factor if not sampled for a
* session-based replay.
*/
allowBuffering: boolean;
}
export interface ReplayIntegrationPrivacyOptions {
/**
* Mask text content for elements that match the CSS selectors in the list.
*/
mask?: string[];
/**
* Unmask text content for elements that match the CSS selectors in the list.
*/
unmask?: string[];
/**
* Block elements that match the CSS selectors in the list. Blocking replaces
* the element with an empty placeholder with the same dimensions.
*/
block?: string[];
/**
* Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
*/
unblock?: string[];
/**
* Ignore input events for elements that match the CSS selectors in the list.
*/
ignore?: string[];
/**
* A callback function to customize how your text is masked.
*/
maskFn?: (s: string) => string;
}
export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
}
interface CommonEventContext {
/**
* The initial URL of the session
*/
initialUrl: string;
/**
* The initial starting timestamp in ms of the session.
*/
initialTimestamp: number;
/**
* Ordered list of URLs that have been visited during a replay segment
*/
urls: string[];
}
export interface PopEventContext extends CommonEventContext {
/**
* List of Sentry error ids that have occurred during a replay segment
*/
errorIds: Array<string>;
/**
* List of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Array<string>;
}
/**
* Additional context that will be sent w/ `replay_event`
*/
export interface InternalEventContext extends CommonEventContext {
/**
* Set of Sentry error ids that have occurred during a replay segment
*/
errorIds: Set<string>;
/**
* Set of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Set<string>;
}
export type Sampled = false | 'session' | 'buffer';
export interface Session {
id: string;
/**
* Start time of current session (in ms)
*/
started: number;
/**
* Last known activity of the session (in ms)
*/
lastActivity: number;
/**
* Segment ID for replay events
*/
segmentId: number;
/**
* The ID of the previous session.
* If this is empty, there was no previous session.
*/
previousSessionId?: string;
/**
* Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer`
*/
sampled: Sampled;
/**
* Session is dirty when its id has been linked to an event (e.g. error event).
* This is helpful when a session is mistakenly stuck in "buffer" mode (e.g. network issues preventing it from being converted to "session" mode).
* The dirty flag is used to prevent updating the session start time to the earliest event in the buffer so that it can be refreshed if it's been expired.
*/
dirty?: boolean;
}
export type EventBufferType = 'sync' | 'worker';
export interface EventBuffer {
/**
* If any events have been added to the buffer.
*/
readonly hasEvents: boolean;
/**
* The buffer type
*/
readonly type: EventBufferType;
/**
* If the event buffer contains a checkout event.
*/
hasCheckout: boolean;
/**
* If the event buffer needs to wait for a checkout event before it
* starts buffering events.
*/
waitForCheckout: boolean;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Clear the event buffer.
*/
clear(): void;
/**
* Add an event to the event buffer.
*
* Returns a promise that resolves if the event was successfully added, else rejects.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Clears and returns the contents of the buffer.
*/
finish(): Promise<ReplayRecordingData>;
/**
* Get the earliest timestamp in ms of any event currently in the buffer.
*/
getEarliestTimestamp(): number | null;
}
export type AddUpdateCallback = () => boolean | void;
export interface SendBufferedReplayOptions {
continueRecording?: boolean;
}
export interface ReplayClickDetector {
addListeners(): void;
removeListeners(): void;
/** Handle a click breadcrumb. */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** Register a mutation that happened at a given time. */
registerMutation(timestamp?: number): void;
/** Register a scroll that happened at a given time. */
registerScroll(timestamp?: number): void;
/** Register that a click on an element happened. */
registerClick(element: HTMLElement): void;
}
export interface ReplayContainer {
eventBuffer: EventBuffer | null;
clickDetector: ReplayClickDetector | undefined;
/**
* List of PerformanceEntry from PerformanceObservers.
*/
performanceEntries: AllPerformanceEntry[];
/**
* List of already processed performance data, ready to be added to replay.
*/
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
recordingMode: ReplayRecordingMode;
timeouts: Timeouts;
lastActiveSpan?: Span;
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
isEnabled(): boolean;
isPaused(): boolean;
isRecordingCanvas(): boolean;
getContext(): InternalEventContext;
initializeSampling(): void;
start(): void;
stop(options?: {
reason?: ReplayStopReason;
forceFlush?: boolean;
}): Promise<void>;
pause(): void;
resume(): void;
startRecording(): void;
stopRecording(): boolean;
sendBufferedReplayOrFlush(options?: SendBufferedReplayOptions): Promise<void>;
conditionalFlush(): Promise<void>;
flush(): Promise<void>;
flushImmediate(): Promise<void>;
cancelFlush(): void;
triggerUserActivity(): void;
updateUserActivity(): void;
addUpdate(cb: AddUpdateCallback): void;
getOptions(): ReplayPluginOptions;
getSessionId(): string | undefined;
checkAndHandleExpiredSession(): boolean | void;
setInitialState(): void;
getCurrentRoute(): string | undefined;
handleException(err: unknown): void;
}
export type ReplayNetworkRequestData = {
startTimestamp: number;
endTimestamp: number;
url: string;
method?: string;
statusCode: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
};
export interface SlowClickConfig {
threshold: number;
timeout: number;
scrollTimeout: number;
ignoreSelector: string;
}
export interface ReplayCanvasIntegrationOptions {
enableManualSnapshot?: boolean;
recordCanvas: true;
getCanvasManager: (options: CanvasManagerOptions) => CanvasManagerInterface;
sampling: {
canvas: number;
};
dataURLOptions: {
type: string;
quality: number;
};
}
export {};
//# sourceMappingURL=replay.d.ts.map
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../../src/types/replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,IAAI,EACL,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE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I,CAAC;IACxB,eAAe,IAAI,MAAM,GAAG,SAAS,CAAC;IACtC,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,8BAA8B,CAAC;IACzC,QAAQ,CAAC,EAAE,8BAA8B,CAAC;CAC3C,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,EAAE,IAAI,CAAC;IACnB,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,sBAAsB,CAAC;IAC5E,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
import type { Breadcrumb } from '@sentry/core';
import type { HistoryData, MemoryData, NavigationData, NetworkRequestData, PaintData, ResourceData, WebVitalData } from './performance';
import type { ReplayEventTypeCustom } from './rrweb';
type AnyRecord = Record<string, any>;
interface ReplayBaseBreadcrumbFrame {
timestamp: number;
/**
* For compatibility reasons
*/
type: string;
category: string;
data?: AnyRecord;
message?: string;
}
interface ReplayBaseDomFrameData {
nodeId?: number;
node?: {
id: number;
tagName: string;
textContent: string;
attributes: AnyRecord;
};
}
interface ReplayConsoleFrameData {
logger: string;
arguments?: unknown[];
}
interface ReplayConsoleFrame extends ReplayBaseBreadcrumbFrame {
category: 'console';
level: Breadcrumb['level'];
message: string;
data: ReplayConsoleFrameData;
}
type ReplayClickFrameData = ReplayBaseDomFrameData;
interface ReplayClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.click';
message: string;
data: ReplayClickFrameData;
}
interface ReplayInputFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.input';
message: string;
}
interface ReplayMutationFrameData {
count: number;
limit: boolean;
}
interface ReplayMutationFrame extends ReplayBaseBreadcrumbFrame {
category: 'replay.mutations';
data: ReplayMutationFrameData;
}
interface ReplayHydrationErrorFrameData {
url: string;
}
interface ReplayHydrationErrorFrame extends ReplayBaseBreadcrumbFrame {
category: 'replay.hydrate-error';
data: ReplayHydrationErrorFrameData;
}
interface ReplayKeyboardEventFrameData extends ReplayBaseDomFrameData {
metaKey: boolean;
shiftKey: boolean;
ctrlKey: boolean;
altKey: boolean;
key: string;
}
interface ReplayKeyboardEventFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.keyDown';
data: ReplayKeyboardEventFrameData;
}
interface ReplayBlurFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.blur';
}
interface ReplayFocusFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.focus';
}
interface ReplaySlowClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
timeAfterClickMs: number;
endReason: string;
clickCount?: number;
}
export interface ReplaySlowClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.slowClickDetected';
data: ReplaySlowClickFrameData;
}
interface ReplayMultiClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
clickCount: number;
metric: true;
}
export interface ReplayMultiClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.multiClick';
data: ReplayMultiClickFrameData;
}
interface ReplayOptionFrame {
blockAllMedia: boolean;
errorSampleRate: number;
maskAllInputs: boolean;
maskAllText: boolean;
networkCaptureBodies: boolean;
networkDetailHasUrls: boolean;
networkRequestHasHeaders: boolean;
networkResponseHasHeaders: boolean;
sessionSampleRate: number;
shouldRecordCanvas: boolean;
useCompression: boolean;
useCompressionOption: boolean;
}
interface ReplayFeedbackFrameData {
feedbackId: string;
}
interface ReplayFeedbackFrame extends ReplayBaseBreadcrumbFrame {
category: 'sentry.feedback';
data: ReplayFeedbackFrameData;
}
export type ReplayBreadcrumbFrame = ReplayConsoleFrame | ReplayClickFrame | ReplayInputFrame | ReplayKeyboardEventFrame | ReplayBlurFrame | ReplayFocusFrame | ReplaySlowClickFrame | ReplayMultiClickFrame | ReplayMutationFrame | ReplayHydrationErrorFrame | ReplayFeedbackFrame | ReplayBaseBreadcrumbFrame;
interface ReplayBaseSpanFrame {
op: string;
description: string;
startTimestamp: number;
endTimestamp: number;
data?: undefined | AnyRecord;
}
interface ReplayHistoryFrame extends ReplayBaseSpanFrame {
data: HistoryData;
op: 'navigation.push';
}
interface ReplayWebVitalFrame extends ReplayBaseSpanFrame {
data: WebVitalData;
op: 'largest-contentful-paint' | 'cumulative-layout-shift' | 'interaction-to-next-paint';
}
interface ReplayMemoryFrame extends ReplayBaseSpanFrame {
data: MemoryData;
op: 'memory';
}
interface ReplayNavigationFrame extends ReplayBaseSpanFrame {
data: NavigationData;
op: 'navigation.navigate' | 'navigation.reload' | 'navigation.back_forward';
}
interface ReplayPaintFrame extends ReplayBaseSpanFrame {
data: PaintData;
op: 'paint';
}
interface ReplayRequestFrame extends ReplayBaseSpanFrame {
data: NetworkRequestData;
op: 'resource.fetch' | 'resource.xhr';
}
interface ReplayResourceFrame extends ReplayBaseSpanFrame {
data: ResourceData;
op: 'resource.css' | 'resource.iframe' | 'resource.img' | 'resource.link' | 'resource.other' | 'resource.script';
}
export type ReplaySpanFrame = ReplayBaseSpanFrame | ReplayHistoryFrame | ReplayRequestFrame | ReplayWebVitalFrame | ReplayMemoryFrame | ReplayNavigationFrame | ReplayPaintFrame | ReplayResourceFrame;
export type ReplayFrame = ReplayBreadcrumbFrame | ReplaySpanFrame;
interface RecordingCustomEvent {
type: typeof ReplayEventTypeCustom;
timestamp: number;
data: {
tag: string;
payload: unknown;
};
}
export interface ReplayBreadcrumbFrameEvent extends RecordingCustomEvent {
data: {
tag: 'breadcrumb';
payload: ReplayBreadcrumbFrame;
/**
* This will indicate to backend to additionally log as a metric
*/
metric?: boolean;
};
}
export interface ReplaySpanFrameEvent extends RecordingCustomEvent {
data: {
tag: 'performanceSpan';
payload: ReplaySpanFrame;
};
}
export interface ReplayOptionFrameEvent extends RecordingCustomEvent {
data: {
tag: 'options';
payload: ReplayOptionFrame;
};
}
export type ReplayFrameEvent = ReplayBreadcrumbFrameEvent | ReplaySpanFrameEvent | ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=replayFrame.d.ts.map
{"version":3,"file":"replayFrame.d.ts","sourceRoot":"","sources":["../../../../src/types/replayFrame.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAErC,UAAU,yBAAyB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,sBAAsB;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,SAAS,CAAC;KACvB,CAAC;CACH;AAG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AAE,EAAE,cAAc,GAAG,iBAAiB,GAAG,cAAc,GAAG,eAAe,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;CAClH;AAED,MAAM,MAAM,eAAe,GACvB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,qBAAqB,GACrB,gBAAgB,GAChB,mBAAmB,CAAC;AAExB,MAAM,MAAM,WAAW,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAElE,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,qBAAqB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,IAAI,EAAE;QACJ,GAAG,EAAE,YAAY,CAAC;QAClB,OAAO,EAAE,qBAAqB,CAAC;QAC/B;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,IAAI,EAAE;QACJ,GAAG,EAAE,iBAAiB,CAAC;QACvB,OAAO,EAAE,eAAe,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,IAAI,EAAE;QACJ,GAAG,EAAE,SAAS,CAAC;QACf,OAAO,EAAE,iBAAiB,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,MAAM,gBAAgB,GAAG,0BAA0B,GAAG,oBAAoB,GAAG,sBAAsB,CAAC"}
import type { NetworkMetaWarning } from '@sentry/browser-utils';
type JsonObject = Record<string, unknown>;
type JsonArray = unknown[];
export type NetworkBody = JsonObject | JsonArray | string;
interface NetworkMeta {
warnings?: NetworkMetaWarning[];
}
export interface ReplayNetworkRequestOrResponse {
size?: number;
body?: NetworkBody;
headers: Record<string, string>;
_meta?: NetworkMeta;
}
export {};
//# sourceMappingURL=request.d.ts.map
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/types/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1C,KAAK,SAAS,GAAG,OAAO,EAAE,CAAC;AAE3B,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB"}
type ClassOption = string | RegExp;
/** Duplicate this from @sentry/rrweb so we can export this as well. */
export declare const ReplayEventTypeDomContentLoaded = 0;
export declare const ReplayEventTypeLoad = 1;
export declare const ReplayEventTypeFullSnapshot = 2;
export declare const ReplayEventTypeIncrementalSnapshot = 3;
export declare const ReplayEventTypeMeta = 4;
export declare const ReplayEventTypeCustom = 5;
export declare const ReplayEventTypePlugin = 6;
export type ReplayEventType = typeof ReplayEventTypeDomContentLoaded | typeof ReplayEventTypeLoad | typeof ReplayEventTypeFullSnapshot | typeof ReplayEventTypeIncrementalSnapshot | typeof ReplayEventTypeMeta | typeof ReplayEventTypeCustom | typeof ReplayEventTypePlugin;
/**
* This is a partial copy of rrweb's eventWithTime type which only contains the properties
* we specifically need in the SDK.
*/
export type ReplayEventWithTime = {
type: ReplayEventType;
data: unknown;
timestamp: number;
delay?: number;
};
/**
* This is a partial copy of rrweb's recording options which only contains the properties
* we specifically use in the SDK. Users can specify additional properties, hence we add the
* Record<string, unknown> union type.
*/
export type RrwebRecordOptions = {
maskAllText?: boolean;
maskAllInputs?: boolean;
blockClass?: ClassOption;
ignoreClass?: string;
maskTextClass?: ClassOption;
maskTextSelector?: string;
blockSelector?: string;
maskInputOptions?: Record<string, boolean>;
recordCrossOriginIframes?: boolean;
} & Record<string, unknown>;
export interface CanvasManagerInterface {
reset(): void;
freeze(): void;
unfreeze(): void;
lock(): void;
unlock(): void;
snapshot(): void;
addWindow(win: typeof globalThis & Window): void;
addShadowRoot(shadowRoot: ShadowRoot): void;
resetShadowRoots(): void;
}
export interface CanvasManagerOptions {
recordCanvas: boolean;
enableManualSnapshot?: boolean;
blockClass: string | RegExp;
blockSelector: string | null;
unblockSelector: string | null;
sampling?: 'all' | number;
dataURLOptions: Partial<{
type: string;
quality: number;
}>;
mutationCb: (p: any) => void;
win: typeof globalThis & Window;
mirror: any;
}
export {};
//# sourceMappingURL=rrweb.d.ts.map
{"version":3,"file":"rrweb.d.ts","sourceRoot":"","sources":["../../../../src/types/rrweb.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnC,uEAAuE;AACvE,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,MAAM,MAAM,eAAe,GACvB,OAAO,+BAA+B,GACtC,OAAO,mBAAmB,GAC1B,OAAO,2BAA2B,GAClC,OAAO,kCAAkC,GACzC,OAAO,mBAAmB,GAC1B,OAAO,qBAAqB,GAC5B,OAAO,qBAAqB,CAAC;AAEjC;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,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AE,OAAO,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IAEH,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,GAAG,EAAE,OAAO,UAAU,GAAG,MAAM,CAAC;IAEhC,MAAM,EAAE,GAAG,CAAC;CACb"}
import type { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
/**
* Add an event to the event buffer.
* In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.
* Instead this returns `true` if we tried to add the event, else false.
* It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEventSync(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): boolean;
/**
* Add an event to the event buffer.
* Resolves to `null` if no event was added, else to `void`.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
/** Exported only for tests. */
export declare function shouldAddEvent(replay: ReplayContainer, event: RecordingEvent): boolean;
//# sourceMappingURL=addEvent.d.ts.map
{"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/addEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAyC,MAAM,UAAU,CAAC;AAQvH;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAU1G;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,cAAc,EACrB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAMhC;AA4DD,+BAA+B;AAC/B,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAuBtF"}
import type { ReplayContainer } from '../types';
/**
* Add global listeners that cannot be removed.
*/
export declare function addGlobalListeners(replay: ReplayContainer): void;
//# sourceMappingURL=addGlobalListeners.d.ts.map
{"version":3,"file":"addGlobalListeners.d.ts","sourceRoot":"","sources":["../../../../src/util/addGlobalListeners.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAwDhE"}
import type { AddEventResult, ReplayContainer } from '../types';
/**
* Create a "span" for the total amount of memory being used by JS objects
* (including v8 internal objects).
*/
export declare function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>>;
//# sourceMappingURL=addMemoryEntry.d.ts.map
{"version":3,"file":"addMemoryEntry.d.ts","sourceRoot":"","sources":["../../../../src/util/addMemoryEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,eAAe,EAA0B,MAAM,UAAU,CAAC;AAWpG;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,CAanG"}
import type { ReplayBreadcrumbFrame } from '../types/replayFrame';
/**
* Create a breadcrumb for a replay.
*/
export declare function createBreadcrumb(breadcrumb: Omit<ReplayBreadcrumbFrame, 'timestamp' | 'type'> & Partial<Pick<ReplayBreadcrumbFrame, 'timestamp'>>): ReplayBreadcrumbFrame;
//# sourceMappingURL=createBreadcrumb.d.ts.map
{"version":3,"file":"createBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/util/createBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC,GAChH,qBAAqB,CAMvB"}
import type { AllPerformanceEntry, AllPerformanceEntryData, ReplayContainer, ReplayPerformanceEntry, WebVitalData } from '../types';
export interface Metric {
/**
* The current value of the metric.
*/
value: number;
/**
* The rating as to whether the metric value is within the "good",
* "needs improvement", or "poor" thresholds of the metric.
*/
rating: 'good' | 'needs-improvement' | 'poor';
/**
* Any performance entries relevant to the metric value calculation.
* The array may also be empty if the metric value was not based on any
* entries (e.g. a CLS value of 0 given no layout shifts).
*/
entries: PerformanceEntry[] | LayoutShift[];
}
interface LayoutShift extends PerformanceEntry {
value: number;
sources: LayoutShiftAttribution[];
hadRecentInput: boolean;
}
interface LayoutShiftAttribution {
node?: Node;
previousRect: DOMRectReadOnly;
currentRect: DOMRectReadOnly;
}
/**
* Handler creater for web vitals
*/
export declare function webVitalHandler(getter: (metric: Metric) => ReplayPerformanceEntry<AllPerformanceEntryData>, replay: ReplayContainer): (data: {
metric: Metric;
}) => void;
/**
* Create replay performance entries from the browser performance entries.
*/
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry<AllPerformanceEntryData>[];
/**
* Add a LCP event to the replay based on a LCP metric.
*/
export declare function getLargestContentfulPaint(metric: Metric): ReplayPerformanceEntry<WebVitalData>;
/**
* Add a CLS event to the replay based on a CLS metric.
*/
export declare function getCumulativeLayoutShift(metric: Metric): ReplayPerformanceEntry<WebVitalData>;
/**
* Add an INP event to the replay based on an INP metric.
*/
export declare function getInteractionToNextPaint(metric: Metric): ReplayPerformanceEntry<WebVitalData>;
export {};
//# sourceMappingURL=createPerformanceEntries.d.ts.map
{"version":3,"file":"createPerformanceEntries.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceEntries.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
import type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/**
* Create a "span" for each performance entry.
*/
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
//# sourceMappingURL=createPerformanceSpans.d.ts.map
{"version":3,"file":"createPerformanceSpans.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceSpans.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEtG;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,CAAC,YAAY,CAAC,EAAE,GAC9C,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAoBlC"}
import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/core';
/**
* Create a replay envelope ready to be sent.
* This includes both the replay event, as well as the recording data.
*/
export declare function createReplayEnvelope(replayEvent: ReplayEvent, recordingData: ReplayRecordingData, dsn: DsnComponents, tunnel?: string): ReplayEnvelope;
//# sourceMappingURL=createReplayEnvelope.d.ts.map
{"version":3,"file":"createReplayEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/util/createReplayEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGpG;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,mBAAmB,EAClC,GAAG,EAAE,aAAa,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAkBhB"}
type DebouncedCallback = {
(): void | unknown;
flush: () => void | unknown;
cancel: () => void;
};
type CallbackFunction = () => unknown;
type DebounceOptions = {
maxWait?: number;
};
/**
* Heavily simplified debounce function based on lodash.debounce.
*
* This function takes a callback function (@param fun) and delays its invocation
* by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
* which ensures that the callback is invoked at least once after the specified max. wait time.
*
* @param func the function whose invocation is to be debounced
* @param wait the minimum time until the function is invoked after it was called once
* @param options the options object, which can contain the `maxWait` property
*
* @returns the debounced version of the function, which needs to be called at least once to start the
* debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
* was already invoked in the meantime, return @param func's return value.
* The debounced function has two additional properties:
* - `flush`: Invokes the debounced function immediately and returns its return value
* - `cancel`: Cancels the debouncing process and resets the debouncing timer
*/
export declare function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback;
export {};
//# sourceMappingURL=debounce.d.ts.map
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../src/util/debounce.ts"],"names":[],"mappings":"AAGA,KAAK,iBAAiB,GAAG;IACvB,IAAI,IAAI,GAAG,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AACF,KAAK,gBAAgB,GAAG,MAAM,OAAO,CAAC;AACtC,KAAK,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAM3G"}
import type { ErrorEvent, Event, FeedbackEvent, ReplayEvent, TransactionEvent } from '@sentry/core';
/** If the event is an error event */
export declare function isErrorEvent(event: Event): event is ErrorEvent;
/** If the event is a transaction event */
export declare function isTransactionEvent(event: Event): event is TransactionEvent;
/** If the event is an replay event */
export declare function isReplayEvent(event: Event): event is ReplayEvent;
/** If the event is a feedback event */
export declare function isFeedbackEvent(event: Event): event is FeedbackEvent;
//# sourceMappingURL=eventUtils.d.ts.map
{"version":3,"file":"eventUtils.d.ts","sourceRoot":"","sources":["../../../../src/util/eventUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpG,qCAAqC;AACrC,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,UAAU,CAE9D;AAED,0CAA0C;AAC1C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,gBAAgB,CAE1E;AAED,sCAAsC;AACtC,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,WAAW,CAEhE;AAED,uCAAuC;AACvC,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAEpE"}
import type { ReplayIntegrationPrivacyOptions } from '../types';
type GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>>;
interface GetPrivacyReturn {
maskTextSelector: string;
unmaskTextSelector: string;
blockSelector: string;
unblockSelector: string;
ignoreSelector: string;
blockClass?: RegExp;
maskTextClass?: RegExp;
}
/**
* Returns privacy related configuration for use in rrweb
*/
export declare function getPrivacyOptions({ mask, unmask, block, unblock, ignore }: GetPrivacyOptions): GetPrivacyReturn;
export {};
//# sourceMappingURL=getPrivacyOptions.d.ts.map
{"version":3,"file":"getPrivacyOptions.d.ts","sourceRoot":"","sources":["../../../../src/util/getPrivacyOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAEhE,KAAK,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnF,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAG,gBAAgB,CAiB/G"}
/**
* Disable sampling mousemove events on iOS browsers as this can cause blocking the main thread
* https://github.com/getsentry/sentry-javascript/issues/14534
*/
export declare function getRecordingSamplingOptions(): Partial<{
sampling: {
mousemove: boolean;
};
}>;
//# sourceMappingURL=getRecordingSamplingOptions.d.ts.map
{"version":3,"file":"getRecordingSamplingOptions.d.ts","sourceRoot":"","sources":["../../../../src/util/getRecordingSamplingOptions.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAAC;IAAE,QAAQ,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC,CAa3F"}
import type { replayIntegration } from '../integration';
/**
* This is a small utility to get a type-safe instance of the Replay integration.
*/
export declare function getReplay(): ReturnType<typeof replayIntegration> | undefined;
//# sourceMappingURL=getReplay.d.ts.map
{"version":3,"file":"getReplay.d.ts","sourceRoot":"","sources":["../../../../src/util/getReplay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,wBAAgB,SAAS,IAAI,UAAU,CAAC,OAAO,iBAAiB,CAAC,GAAG,SAAS,CAG5E"}
import type { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';
type RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;
/**
* Handler for recording events.
*
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
*/
export declare function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback;
export declare function syncMirrorAttributesFromMutationEvent(event: RecordingEvent): void;
/**
* Exported for tests
*/
export declare function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=handleRecordingEmit.d.ts.map
{"version":3,"file":"handleRecordingEmit.d.ts","sourceRoot":"","sources":["../../../../src/util/handleRecordingEmit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AASxF,KAAK,qBAAqB,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAEnF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,qBAAqB,CAmGrF;AAED,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAgCjF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,sBAAsB,CAuBlF"}
/** If sessionStorage is available. */
export declare function hasSessionStorage(): boolean;
//# sourceMappingURL=hasSessionStorage.d.ts.map
{"version":3,"file":"hasSessionStorage.d.ts","sourceRoot":"","sources":["../../../../src/util/hasSessionStorage.ts"],"names":[],"mappings":"AAEA,sCAAsC;AACtC,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C"}
/**
* Given an initial timestamp and an expiry duration, checks to see if current
* time should be considered as expired.
*/
export declare function isExpired(initialTime: null | number, expiry: undefined | number, targetTime?: number): boolean;
//# sourceMappingURL=isExpired.d.ts.map
{"version":3,"file":"isExpired.d.ts","sourceRoot":"","sources":["../../../../src/util/isExpired.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,IAAI,GAAG,MAAM,EAC1B,MAAM,EAAE,SAAS,GAAG,MAAM,EAC1B,UAAU,GAAE,MAAoB,GAC/B,OAAO,CAYT"}
import type { Event, EventHint } from '@sentry/core';
/**
* Returns true if we think the given event is an error originating inside of rrweb.
*/
export declare function isRrwebError(event: Event, hint: EventHint): boolean;
//# sourceMappingURL=isRrwebError.d.ts.map
{"version":3,"file":"isRrwebError.d.ts","sourceRoot":"","sources":["../../../../src/util/isRrwebError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAWnE"}
/**
* Given a sample rate, returns true if replay should be sampled.
*
* 1.0 = 100% sampling
* 0.0 = 0% sampling
*/
export declare function isSampled(sampleRate?: number): boolean;
//# sourceMappingURL=isSampled.d.ts.map
{"version":3,"file":"isSampled.d.ts","sourceRoot":"","sources":["../../../../src/util/isSampled.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAOtD"}
import type { Session } from '../types';
/**
* Checks to see if session is expired
*/
export declare function isSessionExpired(session: Session, { maxReplayDuration, sessionIdleExpire, targetTime, }: {
maxReplayDuration: number;
sessionIdleExpire: number;
targetTime?: number;
}): boolean;
//# sourceMappingURL=isSessionExpired.d.ts.map
{"version":3,"file":"isSessionExpired.d.ts","sourceRoot":"","sources":["../../../../src/util/isSessionExpired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,EACE,iBAAiB,EACjB,iBAAiB,EACjB,UAAuB,GACxB,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,OAAO,CAQT"}
import { debug as coreDebug } from '@sentry/core';
interface LoggerConfig {
captureExceptions: boolean;
traceInternals: boolean;
}
type CoreDebugLogger = typeof coreDebug;
interface ReplayDebugLogger extends CoreDebugLogger {
/**
* Calls `debug.log` but saves breadcrumb in the next tick due to race
* conditions before replay is initialized.
*/
infoTick: CoreDebugLogger['log'];
/**
* Captures exceptions (`Error`) if "capture internal exceptions" is enabled
*/
exception: CoreDebugLogger['error'];
/**
* Configures the logger with additional debugging behavior
*/
setConfig(config: Partial<LoggerConfig>): void;
}
export declare const debug: ReplayDebugLogger;
export {};
//# sourceMappingURL=logger.d.ts.map
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/util/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,IAAI,SAAS,EAA2B,MAAM,cAAc,CAAC;AAO5G,UAAU,YAAY;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,KAAK,eAAe,GAAG,OAAO,SAAS,CAAC;AAExC,UAAU,iBAAkB,SAAQ,eAAe;IACjD;;;OAGG;IACH,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACjC;;OAEG;IACH,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CAChD;AA6ED,eAAO,MAAM,KAAK,mBAA0B,CAAC"}
import type { getPrivacyOptions } from './getPrivacyOptions';
interface MaskAttributeParams {
maskAttributes: string[];
maskAllText: boolean;
privacyOptions: ReturnType<typeof getPrivacyOptions>;
key: string;
value: string;
el: HTMLElement;
}
/**
* Masks an attribute if necessary, otherwise return attribute value as-is.
* Keys listed in `maskAttributes` are masked even when `maskAllText` is false;
* masking `value` on submit/button inputs without listing `value` still requires `maskAllText`.
*/
export declare function maskAttribute({ el, key, maskAttributes, maskAllText, privacyOptions, value, }: MaskAttributeParams): string;
export {};
//# sourceMappingURL=maskAttribute.d.ts.map
{"version":3,"file":"maskAttribute.d.ts","sourceRoot":"","sources":["../../../../src/util/maskAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,WAAW,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,GAAG,EACH,cAAc,EACd,WAAW,EACX,cAAc,EACd,KAAK,GACN,EAAE,mBAAmB,GAAG,MAAM,CAmB9B"}
import type { ReplayRecordingData } from '@sentry/core';
/**
* Prepare the recording data ready to be sent.
*/
export declare function prepareRecordingData({ recordingData, headers, }: {
recordingData: ReplayRecordingData;
headers: Record<string, unknown>;
}): ReplayRecordingData;
//# sourceMappingURL=prepareRecordingData.d.ts.map
{"version":3,"file":"prepareRecordingData.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareRecordingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,OAAO,GACR,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GAAG,mBAAmB,CAoBtB"}
import type { Client, ReplayEvent, Scope } from '@sentry/core';
/**
* Prepare a replay event & enrich it with the SDK metadata.
*/
export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
client: Client;
scope: Scope;
replayId: string;
event: ReplayEvent;
}): Promise<ReplayEvent | null>;
//# sourceMappingURL=prepareReplayEvent.d.ts.map
{"version":3,"file":"prepareReplayEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareReplayEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAa,WAAW,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1E;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,QAAQ,EAAE,QAAQ,EAClB,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CA6C9B"}
/**
* Reset the `replay_id` field on the DSC.
*/
export declare function resetReplayIdOnDynamicSamplingContext(): void;
/**
* Set the `replay_id` field on the cached DSC.
* This is needed after a session refresh because the cached DSC on the scope
* (set by browserTracingIntegration when the idle span ended) persists across
* session boundaries. Without updating it, the new session's replay_id would
* never appear in DSC since `getDynamicSamplingContextFromClient` (and its
* `createDsc` hook) is not called when a cached DSC already exists.
*/
export declare function setReplayIdOnDynamicSamplingContext(replayId: string): void;
//# sourceMappingURL=resetReplayIdOnDynamicSamplingContext.d.ts.map
{"version":3,"file":"resetReplayIdOnDynamicSamplingContext.d.ts","sourceRoot":"","sources":["../../../../src/util/resetReplayIdOnDynamicSamplingContext.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAa5D;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAW1E"}
/**
* Vendored in from @sentry/rrweb.
*
* This is a copy of the function from rrweb, it is not nicely exported there.
*/
export declare function closestElementOfNode(node: Node | null): HTMLElement | null;
//# sourceMappingURL=rrweb.d.ts.map
{"version":3,"file":"rrweb.d.ts","sourceRoot":"","sources":["../../../../src/util/rrweb.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAY1E"}
import type { SendReplayData } from '../types';
/**
* Finalize and send the current replay event to Sentry
*/
export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
count: number;
interval: number;
}): Promise<unknown>;
//# sourceMappingURL=sendReplay.d.ts.map
{"version":3,"file":"sendReplay.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,cAAc,EAC1B,WAAW;;;CAGV,GACA,OAAO,CAAC,OAAO,CAAC,CAuDlB"}
import type { RateLimits, TransportMakeRequestResponse } from '@sentry/core';
import type { SendReplayData } from '../types';
/**
* Send replay attachment using `fetch()`
*/
export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, eventContext, timestamp, session, }: SendReplayData): Promise<TransportMakeRequestResponse>;
/**
* This error indicates that the transport returned an invalid status code.
*/
export declare class TransportStatusCodeError extends Error {
constructor(statusCode: number);
}
/**
* This error indicates that we hit a rate limit API error.
*/
export declare class RateLimitError extends Error {
rateLimits: RateLimits;
constructor(rateLimits: RateLimits);
}
/**
* This error indicates that the replay duration limit was exceeded and the session is too long.
*
*/
export declare class ReplayDurationLimitError extends Error {
constructor();
}
//# sourceMappingURL=sendReplayRequest.d.ts.map
{"version":3,"file":"sendReplayRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplayRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAe,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAI1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,aAAa,EACb,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,YAAY,EACZ,SAAS,EACT,OAAO,GACR,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CA+GxD;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBAC9B,UAAU,EAAE,MAAM;CAGtC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAChC,UAAU,EAAE,UAAU,CAAC;gBAEX,UAAU,EAAE,UAAU;CAI1C;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;;CAIlD"}
import type { ReplayContainer } from '../types';
/**
* Check whether a given request URL should be filtered out. This is so we
* don't log Sentry ingest requests.
*/
export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
//# sourceMappingURL=shouldFilterRequest.d.ts.map
{"version":3,"file":"shouldFilterRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/shouldFilterRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOjF"}
export declare const THROTTLED = "__THROTTLED";
export declare const SKIPPED = "__SKIPPED";
/**
* Create a throttled function off a given function.
* When calling the throttled function, it will call the original function only
* if it hasn't been called more than `maxCount` times in the last `durationSeconds`.
*
* Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,
* or else the return value of the original function.
*/
export declare function throttle<T extends (...rest: any[]) => any>(fn: T, maxCount: number, durationSeconds: number): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED;
//# sourceMappingURL=throttle.d.ts.map
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../../src/util/throttle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC;;;;;;;GAOG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,SAAS,GAAG,OAAO,OAAO,CAsC/E"}
/**
* Converts a timestamp to ms, if it was in s, or keeps it as ms.
*/
export declare function timestampToMs(timestamp: number): number;
/**
* Converts a timestamp to s, if it was in ms, or keeps it as s.
*/
export declare function timestampToS(timestamp: number): number;
//# sourceMappingURL=timestamp.d.ts.map
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../src/util/timestamp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGtD"}
import '@sentry-internal/replay-worker/worker-bundler';
//# sourceMappingURL=worker-bundler.d.ts.map
{"version":3,"file":"worker-bundler.d.ts","sourceRoot":"","sources":["../../../src/worker-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,+CAA+C,CAAC"}
+18
-11

@@ -1,14 +0,21 @@

Copyright (c) 2022 Sentry (https://sentry.io) and individual contributors. All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2022 Functional Software, Inc. dba Sentry
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"name": "@sentry/replay",
"version": "8.0.0-alpha.5",
"version": "10.58.0",
"description": "User replays for Sentry",
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "types/index.d.ts",
"main": "build/npm/cjs/index.js",
"module": "build/npm/esm/index.js",
"types": "build/npm/types/index.d.ts",
"exports": {
"./package.json": "./package.json",
"./worker-bundler": {
"react-native": "./build/npm/esm/worker-bundler.js",
"import": {
"types": "./build/npm/types/worker-bundler.d.ts",
"default": "./build/npm/esm/worker-bundler.js"
},
"require": {
"types": "./build/npm/types/worker-bundler.d.ts",
"default": "./build/npm/cjs/worker-bundler.js"
}
},
".": {
"react-native": "./build/npm/esm/index.js",
"import": {
"types": "./types/index.d.ts",
"default": "./esm/index.js"
"types": "./build/npm/types/index.d.ts",
"default": "./build/npm/esm/index.js"
},
"require": {
"types": "./types/index.d.ts",
"default": "./cjs/index.js"
"types": "./build/npm/types/index.d.ts",
"default": "./build/npm/cjs/index.js"
}

@@ -22,5 +34,5 @@ }

"typesVersions": {
"<4.9": {
"types/index.d.ts": [
"types-ts3.8/index.d.ts"
"<5.0": {
"build/npm/types/index.d.ts": [
"build/npm/types-ts3.8/index.d.ts"
]

@@ -30,8 +42,32 @@ }

"files": [
"cjs",
"esm",
"types",
"types-ts3.8"
"/build/npm"
],
"sideEffects": false,
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "run-p build:transpile build:types build:bundle",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:bundle": "rollup -c rollup.bundle.config.mjs",
"build:dev": "run-p build:transpile build:types",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/npm/types build/npm/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:bundle:watch",
"build:dev:watch": "run-p build:transpile:watch",
"build:transpile:watch": "yarn build:transpile --watch",
"build:bundle:watch": "yarn build:bundle --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build sentry-replay-*.tgz",
"format": "oxfmt \"src/**/*.ts\" \"test/**/*.ts\" --write",
"format:check": "oxfmt \"src/**/*.ts\" \"test/**/*.ts\" --check",
"lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware",
"lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware",
"lint:es-compatibility": "es-check es2020 ./build/{bundles,npm/cjs}/*.js && es-check es2020 ./build/npm/esm/*.js --module",
"test": "vitest run",
"test:watch": "vitest --watch",
"yalc:publish": "yalc publish --push --sig"
},
"repository": {

@@ -48,18 +84,20 @@ "type": "git",

"devDependencies": {
"@babel/core": "^7.17.5",
"@sentry-internal/replay-worker": "8.0.0-alpha.5",
"@sentry-internal/rrweb": "2.11.0",
"@sentry-internal/rrweb-snapshot": "2.11.0",
"fflate": "^0.8.1",
"jsdom-worker": "^0.2.1"
"@babel/core": "^7.27.7",
"@sentry-internal/replay-worker": "10.58.0",
"@sentry/rrweb": "2.43.2",
"@sentry/rrweb-snapshot": "2.43.2",
"fflate": "0.8.2",
"jest-matcher-utils": "^29.0.0",
"jsdom-worker": "^0.3.0"
},
"dependencies": {
"@sentry-internal/tracing": "8.0.0-alpha.5",
"@sentry/core": "8.0.0-alpha.5",
"@sentry/types": "8.0.0-alpha.5",
"@sentry/utils": "8.0.0-alpha.5"
"@sentry/browser-utils": "10.58.0",
"@sentry/core": "10.58.0"
},
"engines": {
"node": ">=14.18"
"node": ">=18"
},
"volta": {
"extends": "../../package.json"
}
}
}

@@ -13,2 +13,7 @@ <p align="center">

> [!NOTE]
> This package is an internal library published for use by Sentry-owned JavaScript SDK packages. It is re-exported from
> `@sentry/browser` and other browser-related SDKs like `@sentry/react` and `@sentry/vue`. It is not part of the public
> API contract and may change in any release. Do not rely on SemVer compatibility if you depend on it directly.
## Pre-requisites

@@ -73,3 +78,3 @@

const { Replay } = await import('@sentry/browser');
const client = Sentry.getCurrentHub().getClient<BrowserClient>();
const client = Sentry.getClient<BrowserClient>();

@@ -107,5 +112,5 @@ // Client can be undefined

const client = Sentry.getCurrentHub().getClient<BrowserClient>();
const client = Sentry.getClient<BrowserClient>();
// Add replay integration, will start recoring
// Add replay integration, will start recording
client?.addIntegration(replay);

@@ -215,16 +220,2 @@

#### Deprecated options
In order to streamline our privacy options, the following have been deprecated in favor for the respective options
above.
| deprecated key | replaced by | description |
| ---------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| maskInputOptions | mask | Use CSS selectors in `mask` in order to mask all inputs of a certain type. For example, `input[type="address"]` |
| blockSelector | block | The selector(s) can be moved directly in the `block` array. |
| blockClass | block | Convert the class name to a CSS selector and add to `block` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
| maskClass | mask | Convert the class name to a CSS selector and add to `mask` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
| maskSelector | mask | The selector(s) can be moved directly in the `mask` array. |
| ignoreClass | ignore | Convert the class name to a CSS selector and add to `ignore` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
## Privacy

@@ -231,0 +222,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

{"type":"module","sideEffects":false}
export declare const WINDOW: import("@sentry/utils").InternalGlobal & Window;
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
export declare const REPLAY_EVENT_NAME = "replay_event";
export declare const RECORDING_EVENT_NAME = "replay_recording";
export declare const UNABLE_TO_SEND_REPLAY = "Unable to send Replay";
export declare const SESSION_IDLE_PAUSE_DURATION = 300000;
export declare const SESSION_IDLE_EXPIRE_DURATION = 900000;
/** Default flush delays */
export declare const DEFAULT_FLUSH_MIN_DELAY = 5000;
export declare const DEFAULT_FLUSH_MAX_DELAY = 5500;
export declare const BUFFER_CHECKOUT_TIME = 60000;
export declare const RETRY_BASE_INTERVAL = 5000;
export declare const RETRY_MAX_COUNT = 3;
export declare const NETWORK_BODY_MAX_SIZE = 150000;
export declare const CONSOLE_ARG_MAX_SIZE = 5000;
export declare const SLOW_CLICK_THRESHOLD = 3000;
export declare const SLOW_CLICK_SCROLL_TIMEOUT = 300;
/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */
export declare const REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000;
/** Replays must be min. 5s long before we send them. */
export declare const MIN_REPLAY_DURATION = 4999;
export declare const MIN_REPLAY_DURATION_LIMIT = 15000;
/** The max. length of a replay. */
export declare const MAX_REPLAY_DURATION = 3600000;
/** Default attributes to be ignored when `maskAllText` is enabled */
export declare const DEFAULT_IGNORED_ATTRIBUTES: string[];
//# sourceMappingURL=constants.d.ts.map
import { Event, TransportMakeRequestResponse } from '@sentry/types';
import { ReplayContainer } from '../types';
type AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback;
export {};
//# sourceMappingURL=handleAfterSendEvent.d.ts.map
import { Event } from '@sentry/types';
import { ReplayContainer } from '../types';
type BeforeSendEventCallback = (event: Event) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleBeforeSendEvent(replay: ReplayContainer): BeforeSendEventCallback;
export {};
//# sourceMappingURL=handleBeforeSendEvent.d.ts.map
import { Breadcrumb } from '@sentry/types';
import { ReplayContainer } from '../types';
import { ReplayFrame } from '../types/replayFrame';
type BreadcrumbWithCategory = Required<Pick<Breadcrumb, 'category'>>;
/**
* Handle breadcrumbs that Sentry captures, and make sure to capture relevant breadcrumbs to Replay as well.
*/
export declare function handleBreadcrumbs(replay: ReplayContainer): void;
/** Exported only for tests. */
export declare function normalizeBreadcrumb(breadcrumb: Breadcrumb): Breadcrumb | null;
/** exported for tests only */
export declare function normalizeConsoleBreadcrumb(breadcrumb: Pick<Breadcrumb, Exclude<keyof Breadcrumb, 'category'>> & BreadcrumbWithCategory): ReplayFrame;
export {};
//# sourceMappingURL=handleBreadcrumbs.d.ts.map
import { Breadcrumb } from '@sentry/types';
import { RecordingEvent, ReplayClickDetector, ReplayContainer, SlowClickConfig } from '../types';
import { addBreadcrumbEvent } from './util/addBreadcrumbEvent';
/** Handle a click. */
export declare function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void;
/** A click detector class that can be used to detect slow or rage clicks on elements. */
export declare class ClickDetector implements ReplayClickDetector {
protected _lastMutation: number;
protected _lastScroll: number;
private _clicks;
private _teardown;
private _threshold;
private _scollTimeout;
private _timeout;
private _ignoreSelector;
private _replay;
private _checkClickTimeout?;
private _addBreadcrumbEvent;
constructor(replay: ReplayContainer, slowClickConfig: SlowClickConfig, _addBreadcrumbEvent?: typeof addBreadcrumbEvent);
/** Register click detection handlers on mutation or scroll. */
addListeners(): void;
/** Clean up listeners. */
removeListeners(): void;
/** @inheritDoc */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** @inheritDoc */
registerMutation(timestamp?: number): void;
/** @inheritDoc */
registerScroll(timestamp?: number): void;
/** @inheritDoc */
registerClick(element: HTMLElement): void;
/** Count multiple clicks on elements. */
private _handleMultiClick;
/** Get all pending clicks for a given node. */
private _getClicks;
/** Check the clicks that happened. */
private _checkClicks;
/** Generate matching breadcrumb(s) for the click. */
private _generateBreadcrumbs;
/** Schedule to check current clicks. */
private _scheduleCheckClicks;
}
/** exported for tests only */
export declare function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean;
/** Update the click detector based on a recording event of rrweb. */
export declare function updateClickDetectorForRecordingEvent(clickDetector: ReplayClickDetector, event: RecordingEvent): void;
//# sourceMappingURL=handleClick.d.ts.map
import { Breadcrumb, HandlerDataDom } from '@sentry/types';
import { ReplayContainer } from '../types';
export declare const handleDomListener: (replay: ReplayContainer) => (handlerData: HandlerDataDom) => void;
/** Get the base DOM breadcrumb. */
export declare function getBaseDomBreadcrumb(target: Node | null, message: string): Breadcrumb;
/**
* An event handler to react to DOM events.
* Exported for tests.
*/
export declare function handleDom(handlerData: HandlerDataDom): Breadcrumb | null;
//# sourceMappingURL=handleDom.d.ts.map
import { Event, EventHint } from '@sentry/types';
import { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addEventProcessor(listener)`.
*/
export declare function handleGlobalEventListener(replay: ReplayContainer): (event: Event, hint: EventHint) => Event | null;
//# sourceMappingURL=handleGlobalEvent.d.ts.map
import { HandlerDataHistory } from '@sentry/types';
import { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`.
*/
export declare function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HandlerDataHistory) => void;
//# sourceMappingURL=handleHistory.d.ts.map
import { Breadcrumb } from '@sentry/types';
import { ReplayContainer } from '../types';
/** Handle keyboard events & create breadcrumbs. */
export declare function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void;
/** exported only for tests */
export declare function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null;
//# sourceMappingURL=handleKeyboardEvent.d.ts.map
import { Breadcrumb, BreadcrumbHint } from '@sentry/types';
import { ReplayContainer, ReplayNetworkOptions } from '../types';
interface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {
replay: ReplayContainer;
}
/**
* This method does two things:
* - It enriches the regular XHR/fetch breadcrumbs with request/response size data
* - It captures the XHR/fetch breadcrumbs to the replay
* (enriching it with further data that is _not_ added to the regular breadcrumbs)
*/
export declare function handleNetworkBreadcrumbs(replay: ReplayContainer): void;
/** just exported for tests */
export declare function beforeAddNetworkBreadcrumb(options: ExtendedNetworkBreadcrumbsOptions, breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
export {};
//# sourceMappingURL=handleNetworkBreadcrumbs.d.ts.map
import { ReplayContainer } from '../types';
/**
* Sets up a PerformanceObserver to listen to all performance entry types.
* Returns a callback to stop observing.
*/
export declare function setupPerformanceObserver(replay: ReplayContainer): () => void;
//# sourceMappingURL=performanceObserver.d.ts.map
import { Breadcrumb } from '@sentry/types';
import { ReplayContainer } from '../../types';
/**
* Add a breadcrumb event to replay.
*/
export declare function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void;
//# sourceMappingURL=addBreadcrumbEvent.d.ts.map
import { FeedbackEvent } from '@sentry/types';
import { ReplayContainer } from '../../types';
/**
* Add a feedback breadcrumb event to replay.
*/
export declare function addFeedbackBreadcrumb(replay: ReplayContainer, event: FeedbackEvent): void;
//# sourceMappingURL=addFeedbackBreadcrumb.d.ts.map
import { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';
/** Add a performance entry breadcrumb */
export declare function addNetworkBreadcrumb(replay: ReplayContainer, result: ReplayPerformanceEntry<NetworkRequestData> | null): void;
//# sourceMappingURL=addNetworkBreadcrumb.d.ts.map
import { INode } from '@sentry-internal/rrweb-snapshot';
/** Get the closest interactive parent element, or else return the given element. */
export declare function getClosestInteractive(element: Element): Element;
/**
* For clicks, we check if the target is inside of a button or link
* If so, we use this as the target instead
* This is useful because if you click on the image in <button><img></button>,
* The target will be the image, not the button, which we don't want here
*/
export declare function getClickTargetNode(event: Event | MouseEvent | Node): Node | INode | null;
/** Get the event target node. */
export declare function getTargetNode(event: Node | {
target: EventTarget | null;
}): Node | INode | null;
//# sourceMappingURL=domUtils.d.ts.map
import { Breadcrumb, FetchBreadcrumbData } from '@sentry/types';
import { FetchHint, ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestOrResponse } from '../../types';
/**
* Capture a fetch breadcrumb to a replay.
* This adds additional data (where approriate).
*/
export declare function captureFetchBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichFetchBreadcrumb(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>): void;
/** Exported only for tests. */
export declare function _getResponseInfo(captureDetails: boolean, { networkCaptureBodies, networkResponseHeaders, }: Pick<ReplayNetworkOptions, 'networkCaptureBodies' | 'networkResponseHeaders'>, response: Response | undefined, responseBodySize?: number): Promise<ReplayNetworkRequestOrResponse | undefined>;
//# sourceMappingURL=fetchUtils.d.ts.map
/**
* Inclusion list of attributes that we want to record from the DOM element
*/
export declare function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown>;
//# sourceMappingURL=getAttributesToRecord.d.ts.map
import { NetworkMetaWarning, NetworkRequestData, ReplayNetworkRequestData, ReplayNetworkRequestOrResponse, ReplayPerformanceEntry } from '../../types';
/** Get the size of a body. */
export declare function getBodySize(body: RequestInit['body']): number | undefined;
/** Convert a Content-Length header to number/undefined. */
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
/** Get the string representation of a body. */
export declare function getBodyString(body: unknown): [
string | undefined,
NetworkMetaWarning?
];
/** Merge a warning into an existing network request/response. */
export declare function mergeWarning(info: ReplayNetworkRequestOrResponse | undefined, warning: NetworkMetaWarning): ReplayNetworkRequestOrResponse;
/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
export declare function makeNetworkReplayBreadcrumb(type: string, data: ReplayNetworkRequestData | null): ReplayPerformanceEntry<NetworkRequestData> | null;
/** Build the request or response part of a replay network breadcrumb that was skipped. */
export declare function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse;
/** Build the request or response part of a replay network breadcrumb. */
export declare function buildNetworkRequestOrResponse(headers: Record<string, string>, bodySize: number | undefined, body: string | undefined): ReplayNetworkRequestOrResponse | undefined;
/** Filter a set of headers */
export declare function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string>;
/** Match an URL against a list of strings/Regex. */
export declare function urlMatches(url: string, urls: (string | RegExp)[]): boolean;
/** exported for tests */
export declare function getFullUrl(url: string, baseURI?: string): string;
//# sourceMappingURL=networkUtils.d.ts.map
type WindowOpenHandler = () => void;
/**
* Register a handler to be called when `window.open()` is called.
* Returns a cleanup function.
*/
export declare function onWindowOpen(cb: WindowOpenHandler): () => void;
export {};
//# sourceMappingURL=onWindowOpen.d.ts.map
import { Event } from '@sentry/types';
import { ReplayContainer } from '../../types';
/**
* Determine if event should be sampled (only applies in buffer mode).
* When an event is captured by `hanldleGlobalEvent`, when in buffer mode
* we determine if we want to sample the error or not.
*/
export declare function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean;
//# sourceMappingURL=shouldSampleForBufferEvent.d.ts.map
import { Breadcrumb, XhrBreadcrumbData } from '@sentry/types';
import { NetworkMetaWarning, ReplayContainer, ReplayNetworkOptions, XhrHint } from '../../types';
/**
* Capture an XHR breadcrumb to a replay.
* This adds additional data (where approriate).
*/
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>): void;
/**
* Get the string representation of the XHR response.
* Based on MDN, these are the possible types of the response:
* string
* ArrayBuffer
* Blob
* Document
* POJO
*
* Exported only for tests.
*/
export declare function _parseXhrResponse(body: XMLHttpRequest['response'], responseType: XMLHttpRequest['responseType']): [
string | undefined,
NetworkMetaWarning?
];
//# sourceMappingURL=xhrUtils.d.ts.map
/**
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
*
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
*/
export declare const DEBUG_BUILD: boolean;
//# sourceMappingURL=debug-build.d.ts.map
/** This error indicates that the event buffer size exceeded the limit.. */
export declare class EventBufferSizeExceededError extends Error {
constructor();
}
//# sourceMappingURL=error.d.ts.map
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* A basic event buffer that does not do any compression.
* Used as fallback if the compression worker cannot be loaded or is disabled.
*/
export declare class EventBufferArray implements EventBuffer {
/** All the events that are buffered to be sent. */
events: RecordingEvent[];
/** @inheritdoc */
hasCheckout: boolean;
private _totalSize;
constructor();
/*@inheritdoc */
readonly hasEvents: boolean;
/*@inheritdoc */
readonly type: EventBufferType;
/** @inheritdoc */
destroy(): void;
/** @inheritdoc */
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritdoc */
finish(): Promise<string>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
}
//# sourceMappingURL=EventBufferArray.d.ts.map
import { ReplayRecordingData } from '@sentry/types';
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class EventBufferCompressionWorker implements EventBuffer {
/** @inheritdoc */
hasCheckout: boolean;
private _worker;
private _earliestTimestamp;
private _totalSize;
constructor(worker: Worker);
/*@inheritdoc */
readonly hasEvents: boolean;
/*@inheritdoc */
readonly type: EventBufferType;
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occured.
*/
ensureReady(): Promise<void>;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfuly received and processed by worker.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Finish the event buffer and return the compressed data.
*/
finish(): Promise<ReplayRecordingData>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Send the event to the worker.
*/
private _sendEventToWorker;
/**
* Finish the request and return the compressed data from the worker.
*/
private _finishRequest;
}
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map
import { ReplayRecordingData } from '@sentry/types';
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
* This can happen e.g. if the worker cannot be loaded.
* Exported only for testing.
*/
export declare class EventBufferProxy implements EventBuffer {
private _fallback;
private _compression;
private _used;
private _ensureWorkerIsLoadedPromise;
constructor(worker: Worker);
/*@inheritdoc */
readonly type: EventBufferType;
/*@inheritDoc */
readonly hasEvents: boolean;
/*@inheritdoc
@inheritdoc */
hasCheckout: boolean;
/** @inheritDoc */
destroy(): void;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully added.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritDoc */
finish(): Promise<ReplayRecordingData>;
/** Ensure the worker has loaded. */
ensureWorkerIsLoaded(): Promise<void>;
/** Actually check if the worker has been loaded. */
private _ensureWorkerIsLoaded;
/** Switch the used buffer to the compression worker. */
private _switchToCompressionWorker;
}
//# sourceMappingURL=EventBufferProxy.d.ts.map
import { EventBuffer } from '../types';
interface CreateEventBufferParams {
useCompression: boolean;
workerUrl?: string;
}
/**
* Create an event buffer for replays.
*/
export declare function createEventBuffer({ useCompression, workerUrl: customWorkerUrl, }: CreateEventBufferParams): EventBuffer;
export {};
//# sourceMappingURL=index.d.ts.map
import { WorkerRequest } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class WorkerHandler {
private _worker;
private _id;
private _ensureReadyPromise?;
constructor(worker: Worker);
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occured.
*/
ensureReady(): Promise<void>;
/**
* Destroy the worker.
*/
destroy(): void;
/**
* Post message to worker and wait for response before resolving promise.
*/
postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T>;
/** Get the current ID and increment it for the next call. */
private _getAndIncrementId;
}
//# sourceMappingURL=WorkerHandler.d.ts.map
export { replayIntegration } from './integration';
export { ReplayConfiguration, ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, CanvasManagerInterface, CanvasManagerOptions, } from './types';
export { getReplay } from './util/getReplay';
//# sourceMappingURL=index.d.ts.map
import { Integration } from '@sentry/types';
import { ReplayConfiguration, SendBufferedReplayOptions } from './types';
/**
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/).
*
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information.
*
* @example
*
* ```
* Sentry.init({
* dsn: '__DSN__',
* integrations: [Sentry.replayIntegration()],
* });
* ```
*/
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay;
/**
* Replay integration
*
* TODO: Rewrite this to be functional integration
* Exported for tests.
*/
export declare class Replay implements Integration {
/**
* @inheritDoc
*/
static id: string;
/**
* @inheritDoc
*/
name: string;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
/**
* Initial options passed to the replay integration, merged with default values.
* Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
* can only be finally set when setupOnce() is called.
*
* @private
*/
private readonly _initialOptions;
private _replay?;
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration);
/*If replay has already been initialized
Update _isInitialized */
protected _isInitialized: boolean;
/**
* Setup and initialize replay container
*/
setupOnce(): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will throw an error if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* PerformanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, until an error occurs.
*/
startBuffering(): void;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop(): Promise<void>;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
flush(options?: SendBufferedReplayOptions): Promise<void>;
/**
* Get the current session ID.
*/
getReplayId(): string | undefined;
/**
* Initializes replay.
*/
protected _initialize(): void;
/** Setup the integration. */
private _setup;
/** Get canvas options from ReplayCanvas integration, if it is also added. */
private _maybeLoadFromReplayCanvasIntegration;
}
//# sourceMappingURL=integration.d.ts.map
import { ReplayRecordingMode, Span } from '@sentry/types';
import { ClickDetector } from './coreHandlers/handleClick';
import { AddEventResult, AddUpdateCallback, AllPerformanceEntry, AllPerformanceEntryData, EventBuffer, InternalEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPerformanceEntry, ReplayPluginOptions, SendBufferedReplayOptions, Session, Timeouts } from './types';
import { SKIPPED } from './util/throttle';
import { THROTTLED } from './util/throttle';
/**
* The main replay container class, which holds all the state and methods for recording and sending replays.
*/
export declare class ReplayContainer implements ReplayContainerInterface {
eventBuffer: EventBuffer | null;
performanceEntries: AllPerformanceEntry[];
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
clickDetector: ClickDetector | undefined;
/**
* Recording can happen in one of three modes:
* - session: Record the whole session, sending it continuously
* - buffer: Always keep the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
recordingMode: ReplayRecordingMode;
/**
* The current or last active span.
* This is only available when performance is enabled.
*/
lastActiveSpan?: Span;
/**
* These are here so we can overwrite them in tests etc.
* @hidden
*/
readonly timeouts: Timeouts;
private _throttledAddEvent;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
private readonly _options;
private _performanceCleanupCallback?;
private _debouncedFlush;
private _flushLock;
/**
* Timestamp of the last user activity. This lives across sessions.
*/
private _lastActivity;
/**
* Is the integration currently active?
*/
private _isEnabled;
/**
* Paused is a state where:
* - DOM Recording is not listening at all
* - Nothing will be added to event buffer (e.g. core SDK events)
*/
private _isPaused;
/**
* Have we attached listeners to the core SDK?
* Note we have to track this as there is no way to remove instrumentation handlers.
*/
private _hasInitializedCoreListeners;
/**
* Function to stop recording
*/
private _stopRecording;
private _context;
/**
* Internal use for canvas recording options
*/
private _canvas;
constructor({ options, recordingOptions, }: {
options: ReplayPluginOptions;
recordingOptions: RecordingOptions;
});
/** Get the event context. */
getContext(): InternalEventContext;
/** If recording is currently enabled. */
isEnabled(): boolean;
/** If recording is currently paused. */
isPaused(): boolean;
/**
* Determine if canvas recording is enabled
*/
isRecordingCanvas(): boolean;
/** Get the replay integration options. */
getOptions(): ReplayPluginOptions;
/**
* Initializes the plugin based on sampling configuration. Should not be
* called outside of constructor.
*/
initializeSampling(previousSessionId?: string): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will throw an error if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* _performanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, an error occurs.
*/
startBuffering(): void;
/**
* Start recording.
*
* Note that this will cause a new DOM checkout
*/
startRecording(): void;
/**
* Stops the recording, if it was running.
*
* Returns true if it was previously stopped, or is now stopped,
* otherwise false.
*/
stopRecording(): boolean;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop({ forceFlush, reason }?: {
forceFlush?: boolean;
reason?: string;
}): Promise<void>;
/**
* Pause some replay functionality. See comments for `_isPaused`.
* This differs from stop as this only stops DOM recording, it is
* not as thorough of a shutdown as `stop()`.
*/
pause(): void;
/**
* Resumes recording, see notes for `pause().
*
* Note that calling `startRecording()` here will cause a
* new DOM checkout.`
*/
resume(): void;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
sendBufferedReplayOrFlush({ continueRecording }?: SendBufferedReplayOptions): Promise<void>;
/**
* We want to batch uploads of replay events. Save events only if
* `<flushMinDelay>` milliseconds have elapsed since the last event
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
*
* Accepts a callback to perform side-effects and returns true to stop batch
* processing and hand back control to caller.
*/
addUpdate(cb: AddUpdateCallback): void;
/**
* Updates the user activity timestamp and resumes recording. This should be
* called in an event handler for a user action that we consider as the user
* being "active" (e.g. a mouse click).
*/
triggerUserActivity(): void;
/**
* Updates the user activity timestamp *without* resuming
* recording. Some user events (e.g. keydown) can be create
* low-value replays that only contain the keypress as a
* breadcrumb. Instead this would require other events to
* create a new replay after a session has expired.
*/
updateUserActivity(): void;
/**
* Only flush if `this.recordingMode === 'session'`
*/
conditionalFlush(): Promise<void>;
/**
* Flush using debounce flush
*/
flush(): Promise<void>;
/**
* Always flush via `_debouncedFlush` so that we do not have flushes triggered
* from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
* cases of mulitple flushes happening closely together.
*/
flushImmediate(): Promise<void>;
/**
* Cancels queued up flushes.
*/
cancelFlush(): void;
/** Get the current sesion (=replay) ID */
getSessionId(): string | undefined;
/**
* Checks if recording should be stopped due to user inactivity. Otherwise
* check if session is expired and create a new session if so. Triggers a new
* full snapshot on new session.
*
* Returns true if session is not expired, false otherwise.
* @hidden
*/
checkAndHandleExpiredSession(): boolean | void;
/**
* Capture some initial state that can change throughout the lifespan of the
* replay. This is required because otherwise they would be captured at the
* first flush.
*/
setInitialState(): void;
/**
* Add a breadcrumb event, that may be throttled.
* If it was throttled, we add a custom breadcrumb to indicate that.
*/
throttledAddEvent(event: RecordingEvent, isCheckout?: boolean): typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
/**
* This will get the parametrized route name of the current page.
* This is only available if performance is enabled, and if an instrumented router is used.
*/
getCurrentRoute(): string | undefined;
/**
* Initialize and start all listeners to varying events (DOM,
* Performance Observer, Recording, Sentry SDK, etc)
*/
private _initializeRecording;
/** A wrapper to conditionally capture exceptions. */
private _handleException;
/**
* Loads (or refreshes) the current session.
*/
private _initializeSessionForSampling;
/**
* Checks and potentially refreshes the current session.
* Returns false if session is not recorded.
*/
private _checkSession;
/**
* Refresh a session with a new one.
* This stops the current session (without forcing a flush, as that would never work since we are expired),
* and then does a new sampling based on the refreshed session.
*/
private _refreshSession;
/**
* Adds listeners to record events for the replay
*/
private _addListeners;
/**
* Cleans up listeners that were created in `_addListeners`
*/
private _removeListeners;
/**
* Handle when visibility of the page content changes. Opening a new tab will
* cause the state to change to hidden because of content of current page will
* be hidden. Likewise, moving a different window to cover the contents of the
* page will also trigger a change to a hidden state.
*/
private _handleVisibilityChange;
/**
* Handle when page is blurred
*/
private _handleWindowBlur;
/**
* Handle when page is focused
*/
private _handleWindowFocus;
/** Ensure page remains active when a key is pressed. */
private _handleKeyboardEvent;
/**
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
*/
private _doChangeToBackgroundTasks;
/**
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
*/
private _doChangeToForegroundTasks;
/**
* Update user activity (across session lifespans)
*/
private _updateUserActivity;
/**
* Updates the session's last activity timestamp
*/
private _updateSessionActivity;
/**
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
*/
private _createCustomBreadcrumb;
/**
* Observed performance events are added to `this.performanceEntries`. These
* are included in the replay event before it is finished and sent to Sentry.
*/
private _addPerformanceEntries;
/**
* Clear _context
*/
private _clearContext;
/** Update the initial timestamp based on the buffer content. */
private _updateInitialTimestampFromEventBuffer;
/**
* Return and clear _context
*/
private _popEventContext;
/**
* Flushes replay event buffer to Sentry.
*
* Performance events are only added right before flushing - this is
* due to the buffered performance observer events.
*
* Should never be called directly, only by `flush`
*/
private _runFlush;
/**
* Flush recording data to Sentry. Creates a lock so that only a single flush
* can be active at a time. Do not call this directly.
*/
private _flush;
/** Save the session, if it is sticky */
private _maybeSaveSession;
/** Handler for rrweb.record.onMutation */
private _onMutationHandler;
}
//# sourceMappingURL=replay.d.ts.map
import { ReplayContainer } from '../../src/types';
/**
* Removes the session from Session Storage and unsets session in replay instance
*/
export declare function clearSession(replay: ReplayContainer): void;
//# sourceMappingURL=clearSession.d.ts.map
import { Sampled, Session, SessionOptions } from '../types';
/**
* Get the sampled status for a session based on sample rates & current sampled status.
*/
export declare function getSessionSampleType(sessionSampleRate: number, allowBuffering: boolean): Sampled;
/**
* Create a new session, which in its current implementation is a Sentry event
* that all replays will be saved to as attachments. Currently, we only expect
* one of these Sentry events per "replay session".
*/
export declare function createSession({ sessionSampleRate, allowBuffering, stickySession }: SessionOptions, { previousSessionId }?: {
previousSessionId?: string;
}): Session;
//# sourceMappingURL=createSession.d.ts.map
import { Session } from '../types';
/**
* Fetches a session from storage
*/
export declare function fetchSession(traceInternals?: boolean): Session | null;
//# sourceMappingURL=fetchSession.d.ts.map
export * from './createSession';
//# sourceMappingURL=index.d.ts.map
import { Session, SessionOptions } from '../types';
/**
* Get or create a session, when initializing the replay.
* Returns a session that may be unsampled.
*/
export declare function loadOrCreateSession({ traceInternals, sessionIdleExpire, maxReplayDuration, previousSessionId, }: {
sessionIdleExpire: number;
maxReplayDuration: number;
traceInternals?: boolean;
previousSessionId?: string;
}, sessionOptions: SessionOptions): Session;
//# sourceMappingURL=loadOrCreateSession.d.ts.map
import { Session } from '../types';
/**
* Save a session to session storage.
*/
export declare function saveSession(session: Session): void;
//# sourceMappingURL=saveSession.d.ts.map
import { Sampled, Session } from '../types';
/**
* Get a session with defaults & applied sampling.
*/
export declare function makeSession(session: Partial<Session> & {
sampled: Sampled;
}): Session;
//# sourceMappingURL=Session.d.ts.map
import { Session } from '../types';
/** If the session should be refreshed or not. */
export declare function shouldRefreshSession(session: Session, { sessionIdleExpire, maxReplayDuration }: {
sessionIdleExpire: number;
maxReplayDuration: number;
}): boolean;
//# sourceMappingURL=shouldRefreshSession.d.ts.map
export * from './performance';
export * from './replay';
export * from './replayFrame';
export * from './request';
export * from './rrweb';
//# sourceMappingURL=index.d.ts.map
import { ReplayNetworkRequestOrResponse } from './request';
export type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
export type PerformancePaintTiming = PerformanceEntry;
export type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
type: string;
transferSize: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "interactive".
*/
domInteractive: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's DOMContentLoaded event handler starts.
*/
domContentLoadedEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's DOMContentLoaded event handler completes.
*/
domContentLoadedEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's load event handler starts.
*/
loadEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's load event handler completes.
*/
loadEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "complete".
*/
domComplete: number;
/**
* A number representing the number of redirects since the last non-redirect
* navigation in the current browsing context.
*/
redirectCount: number;
};
export type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
responseStatus?: number;
};
export type PaintData = undefined;
/**
* See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
*
* Note `navigation.push` will not have any data
*/
export type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
/**
* Transfer size of resource
*/
size?: number;
};
export type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
/**
* Transfer size of resource
*/
size: number;
/**
* HTTP status code. Note this is experimental and not available on all browsers.
*/
statusCode?: number;
};
export interface LargestContentfulPaintData {
/**
* Render time (in ms) of the LCP
*/
value: number;
size: number;
/**
* The recording id of the LCP node. -1 if not found
*/
nodeId?: number;
}
/**
* Entries that come from window.performance
*/
export type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | LargestContentfulPaintData;
export interface MemoryData {
memory: {
jsHeapSizeLimit: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
};
}
export interface NetworkRequestData {
method?: string;
statusCode?: number;
requestBodySize?: number;
responseBodySize?: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
}
export interface HistoryData {
previous: string | undefined;
}
export type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
export interface ReplayPerformanceEntry<T> {
/**
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
*/
type: string;
/**
* A more specific description of the performance entry
*/
name: string;
/**
* The start timestamp in seconds
*/
start: number;
/**
* The end timestamp in seconds
*/
end: number;
/**
* Additional unstructured data to be included
*/
data: T;
}
//# sourceMappingURL=performance.d.ts.map
import { Breadcrumb, ErrorEvent, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Span, XhrBreadcrumbHint } from '@sentry/types';
import { SKIPPED, THROTTLED } from '../util/throttle';
import { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance';
import { ReplayFrameEvent } from './replayFrame';
import { ReplayNetworkRequestOrResponse } from './request';
import { CanvasManagerInterface, CanvasManagerOptions, ReplayEventWithTime, RrwebRecordOptions } from './rrweb';
export type RecordingEvent = ReplayFrameEvent | ReplayEventWithTime;
export type RecordingOptions = RrwebRecordOptions;
export interface SendReplayData {
recordingData: ReplayRecordingData;
replayId: string;
segmentId: number;
eventContext: PopEventContext;
timestamp: number;
session: Session;
options: ReplayPluginOptions;
}
export interface Timeouts {
sessionIdlePause: number;
sessionIdleExpire: number;
}
/**
* The request payload to worker
*/
export interface WorkerRequest {
id: number;
method: 'clear' | 'addEvent' | 'finish';
arg?: string;
}
/**
* The response from the worker
*/
export interface WorkerResponse {
id: number;
method: string;
success: boolean;
response: unknown;
}
export type AddEventResult = void;
export interface BeforeAddRecordingEvent {
(event: ReplayFrameEvent): ReplayFrameEvent | null | undefined;
}
export interface ReplayNetworkOptions {
/**
* Capture request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will match any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
*
* Only URLs matching these patterns will have bodies & additional headers captured.
*/
networkDetailAllowUrls: (string | RegExp)[];
/**
* Deny request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will deny any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
* URLs matching these patterns will not have bodies & additional headers captured.
*/
networkDetailDenyUrls: (string | RegExp)[];
/**
* If request & response bodies should be captured.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Defaults to true.
*/
networkCaptureBodies: boolean;
/**
* Capture the following request headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkRequestHeaders: string[];
/**
* Capture the following response headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkResponseHeaders: string[];
}
export interface ReplayPluginOptions extends ReplayNetworkOptions {
/**
* The sample rate for session-long replays. 1.0 will record all sessions and
* 0 will record none.
*/
sessionSampleRate: number;
/**
* The sample rate for sessions that has had an error occur. This is
* independent of `sessionSampleRate`.
*/
errorSampleRate: number;
/**
* If false, will create a new session per pageload. Otherwise, saves session
* to Session Storage.
*/
stickySession: boolean;
/**
* The amount of time to wait before sending a replay
*/
flushMinDelay: number;
/**
* The max amount of time to wait before sending a replay
*/
flushMaxDelay: number;
/**
* Attempt to use compression when web workers are available
*
* (default is true)
*/
useCompression: boolean;
/**
* If defined, use this worker URL instead of the default included one for compression.
* This will only be used if `useCompression` is not false.
*/
workerUrl?: string;
/**
* Block all media (e.g. images, svg, video) in recordings.
*/
blockAllMedia: boolean;
/**
* Mask all inputs in recordings
*/
maskAllInputs: boolean;
/**
* Mask all text in recordings
*/
maskAllText: boolean;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will create
* a breadcrumb in the recording when the limit has been reached.
*/
mutationBreadcrumbLimit: number;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will cause
* recording to stop when the limit has been reached.
*/
mutationLimit: number;
/**
* The max. time in ms to wait for a slow click to finish.
* After this amount of time we stop waiting for actions after a click happened.
* Set this to 0 to disable slow click capture.
*
* Default: 7000ms
*/
slowClickTimeout: number;
/**
* Ignore clicks on elements matching the given selectors for slow click detection.
*/
slowClickIgnoreSelectors: string[];
/**
* The min. duration (in ms) a replay has to have before it is sent to Sentry.
* Whenever attempting to flush a session that is shorter than this, it will not actually send it to Sentry.
* Note that this is capped at max. 15s.
*/
minReplayDuration: number;
/**
* The max. duration (in ms) a replay session may be.
* This is capped at max. 60min.
*/
maxReplayDuration: number;
/**
* Callback before adding a custom recording event
*
* Events added by the underlying DOM recording library can *not* be modified,
* only custom recording events from the Replay integration will trigger the
* callback listeners. This can be used to scrub certain fields in an event (e.g. URLs from navigation events).
*
* Returning a `null` will drop the event completely. Note, dropping a recording
* event is not the same as dropping the replay, the replay will still exist and
* continue to function.
*/
beforeAddRecordingEvent?: BeforeAddRecordingEvent;
/**
* An optional callback to be called before we decide to sample based on an error.
* If specified, this callback will receive an error that was captured by Sentry.
* Return `true` to continue sampling for this error, or `false` to ignore this error for replay sampling.
* Note that returning `true` means that the `replaysOnErrorSampleRate` will be checked,
* not that it will definitely be sampled.
* Use this to filter out groups of errors that should def. not be sampled.
*/
beforeErrorSampling?: (event: ErrorEvent) => boolean;
/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
captureExceptions: boolean;
traceInternals: boolean;
}>;
}
/**
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`.
*/
export type InitialReplayPluginOptions = Pick<ReplayPluginOptions, Exclude<keyof ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>;
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & {
/**
* Mask element attributes that are contained in list
*/
maskAttributes?: string[];
};
/**
* Session options that are configurable by the integration configuration
*/
export interface SessionOptions extends Pick<ReplayPluginOptions, 'sessionSampleRate' | 'stickySession'> {
/**
* Should buffer recordings to be saved later either by error sampling, or by
* manually calling `flush()`. This is only a factor if not sampled for a
* session-based replay.
*/
allowBuffering: boolean;
}
export interface ReplayIntegrationPrivacyOptions {
/**
* Mask text content for elements that match the CSS selectors in the list.
*/
mask?: string[];
/**
* Unmask text content for elements that match the CSS selectors in the list.
*/
unmask?: string[];
/**
* Block elements that match the CSS selectors in the list. Blocking replaces
* the element with an empty placeholder with the same dimensions.
*/
block?: string[];
/**
* Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
*/
unblock?: string[];
/**
* Ignore input events for elements that match the CSS selectors in the list.
*/
ignore?: string[];
/**
* A callback function to customize how your text is masked.
*/
maskFn?: (s: string) => string;
}
export interface DeprecatedPrivacyOptions {
/**
* @deprecated Use `block` which accepts an array of CSS selectors
*/
blockSelector?: RecordingOptions['blockSelector'];
/**
* @deprecated Use `block` which accepts an array of CSS selectors
*/
blockClass?: RecordingOptions['blockClass'];
/**
* @deprecated Use `ignore` which accepts an array of CSS selectors
*/
ignoreClass?: RecordingOptions['ignoreClass'];
/**
* @deprecated Use `mask` which accepts an array of CSS selectors
*/
maskInputOptions?: RecordingOptions['maskInputOptions'];
/**
* @deprecated Use `mask` which accepts an array of CSS selectors
*/
maskTextClass?: RecordingOptions['maskTextClass'];
/**
* @deprecated Use `mask` which accepts an array of CSS selectors
*/
maskTextSelector?: RecordingOptions['maskTextSelector'];
}
export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, DeprecatedPrivacyOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
}
interface CommonEventContext {
/**
* The initial URL of the session
*/
initialUrl: string;
/**
* The initial starting timestamp in ms of the session.
*/
initialTimestamp: number;
/**
* Ordered list of URLs that have been visited during a replay segment
*/
urls: string[];
}
export interface PopEventContext extends CommonEventContext {
/**
* List of Sentry error ids that have occurred during a replay segment
*/
errorIds: Array<string>;
/**
* List of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Array<string>;
}
/**
* Additional context that will be sent w/ `replay_event`
*/
export interface InternalEventContext extends CommonEventContext {
/**
* Set of Sentry error ids that have occurred during a replay segment
*/
errorIds: Set<string>;
/**
* Set of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Set<string>;
}
export type Sampled = false | 'session' | 'buffer';
export interface Session {
id: string;
/**
* Start time of current session (in ms)
*/
started: number;
/**
* Last known activity of the session (in ms)
*/
lastActivity: number;
/**
* Segment ID for replay events
*/
segmentId: number;
/**
* The ID of the previous session.
* If this is empty, there was no previous session.
*/
previousSessionId?: string;
/**
* Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer`
*/
sampled: Sampled;
}
export type EventBufferType = 'sync' | 'worker';
export interface EventBuffer {
/**
* If any events have been added to the buffer.
*/
readonly hasEvents: boolean;
/**
* The buffer type
*/
readonly type: EventBufferType;
/**
* If the event buffer contains a checkout event.
*/
hasCheckout: boolean;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Clear the event buffer.
*/
clear(): void;
/**
* Add an event to the event buffer.
*
* Returns a promise that resolves if the event was successfully added, else rejects.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Clears and returns the contents of the buffer.
*/
finish(): Promise<ReplayRecordingData>;
/**
* Get the earliest timestamp in ms of any event currently in the buffer.
*/
getEarliestTimestamp(): number | null;
}
export type AddUpdateCallback = () => boolean | void;
export interface SendBufferedReplayOptions {
continueRecording?: boolean;
}
export interface ReplayClickDetector {
addListeners(): void;
removeListeners(): void;
/** Handle a click breadcrumb. */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** Register a mutation that happened at a given time. */
registerMutation(timestamp?: number): void;
/** Register a scroll that happened at a given time. */
registerScroll(timestamp?: number): void;
/** Register that a click on an element happened. */
registerClick(element: HTMLElement): void;
}
export interface ReplayContainer {
eventBuffer: EventBuffer | null;
clickDetector: ReplayClickDetector | undefined;
/**
* List of PerformanceEntry from PerformanceObservers.
*/
performanceEntries: AllPerformanceEntry[];
/**
* List of already processed performance data, ready to be added to replay.
*/
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
recordingMode: ReplayRecordingMode;
timeouts: Timeouts;
lastActiveSpan?: Span;
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
isEnabled(): boolean;
isPaused(): boolean;
isRecordingCanvas(): boolean;
getContext(): InternalEventContext;
initializeSampling(): void;
start(): void;
stop(options?: {
reason?: string;
forceflush?: boolean;
}): Promise<void>;
pause(): void;
resume(): void;
startRecording(): void;
stopRecording(): boolean;
sendBufferedReplayOrFlush(options?: SendBufferedReplayOptions): Promise<void>;
conditionalFlush(): Promise<void>;
flush(): Promise<void>;
flushImmediate(): Promise<void>;
cancelFlush(): void;
triggerUserActivity(): void;
updateUserActivity(): void;
addUpdate(cb: AddUpdateCallback): void;
getOptions(): ReplayPluginOptions;
getSessionId(): string | undefined;
checkAndHandleExpiredSession(): boolean | void;
setInitialState(): void;
getCurrentRoute(): string | undefined;
}
type RequestBody = null | Blob | BufferSource | FormData | URLSearchParams | string;
export type XhrHint = XhrBreadcrumbHint & {
xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;
input?: RequestBody;
};
export type FetchHint = FetchBreadcrumbHint & {
input: HandlerDataFetch['args'];
response: Response;
};
export type ReplayNetworkRequestData = {
startTimestamp: number;
endTimestamp: number;
url: string;
method?: string;
statusCode: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
};
export interface SlowClickConfig {
threshold: number;
timeout: number;
scrollTimeout: number;
ignoreSelector: string;
}
export interface ReplayCanvasIntegrationOptions {
enableManualSnapshot?: boolean;
recordCanvas: true;
getCanvasManager: (options: CanvasManagerOptions) => CanvasManagerInterface;
sampling: {
canvas: number;
};
dataURLOptions: {
type: string;
quality: number;
};
}
export {};
//# sourceMappingURL=replay.d.ts.map
import { Breadcrumb } from '@sentry/types';
import { HistoryData, LargestContentfulPaintData, MemoryData, NavigationData, NetworkRequestData, PaintData, ResourceData } from './performance';
import { ReplayEventTypeCustom } from './rrweb';
type AnyRecord = Record<string, any>;
interface ReplayBaseBreadcrumbFrame {
timestamp: number;
/**
* For compatibility reasons
*/
type: string;
category: string;
data?: AnyRecord;
message?: string;
}
interface ReplayBaseDomFrameData {
nodeId?: number;
node?: {
id: number;
tagName: string;
textContent: string;
attributes: AnyRecord;
};
}
interface ReplayConsoleFrameData {
logger: string;
arguments?: unknown[];
}
interface ReplayConsoleFrame extends ReplayBaseBreadcrumbFrame {
category: 'console';
level: Breadcrumb['level'];
message: string;
data: ReplayConsoleFrameData;
}
type ReplayClickFrameData = ReplayBaseDomFrameData;
interface ReplayClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.click';
message: string;
data: ReplayClickFrameData;
}
interface ReplayInputFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.input';
message: string;
}
interface ReplayMutationFrameData {
count: number;
limit: boolean;
}
interface ReplayMutationFrame extends ReplayBaseBreadcrumbFrame {
category: 'replay.mutations';
data: ReplayMutationFrameData;
}
interface ReplayKeyboardEventFrameData extends ReplayBaseDomFrameData {
metaKey: boolean;
shiftKey: boolean;
ctrlKey: boolean;
altKey: boolean;
key: string;
}
interface ReplayKeyboardEventFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.keyDown';
data: ReplayKeyboardEventFrameData;
}
interface ReplayBlurFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.blur';
}
interface ReplayFocusFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.focus';
}
interface ReplaySlowClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
timeAfterClickMs: number;
endReason: string;
clickCount?: number;
}
export interface ReplaySlowClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.slowClickDetected';
data: ReplaySlowClickFrameData;
}
interface ReplayMultiClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
clickCount: number;
metric: true;
}
export interface ReplayMultiClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.multiClick';
data: ReplayMultiClickFrameData;
}
interface ReplayOptionFrame {
blockAllMedia: boolean;
errorSampleRate: number;
maskAllInputs: boolean;
maskAllText: boolean;
networkCaptureBodies: boolean;
networkDetailHasUrls: boolean;
networkRequestHasHeaders: boolean;
networkResponseHasHeaders: boolean;
sessionSampleRate: number;
shouldRecordCanvas: boolean;
useCompression: boolean;
useCompressionOption: boolean;
}
interface ReplayFeedbackFrameData {
feedbackId: string;
}
interface ReplayFeedbackFrame extends ReplayBaseBreadcrumbFrame {
category: 'sentry.feedback';
data: ReplayFeedbackFrameData;
}
export type ReplayBreadcrumbFrame = ReplayConsoleFrame | ReplayClickFrame | ReplayInputFrame | ReplayKeyboardEventFrame | ReplayBlurFrame | ReplayFocusFrame | ReplaySlowClickFrame | ReplayMultiClickFrame | ReplayMutationFrame | ReplayFeedbackFrame | ReplayBaseBreadcrumbFrame;
interface ReplayBaseSpanFrame {
op: string;
description: string;
startTimestamp: number;
endTimestamp: number;
data?: undefined | AnyRecord;
}
interface ReplayHistoryFrame extends ReplayBaseSpanFrame {
data: HistoryData;
op: 'navigation.push';
}
interface ReplayLargestContentfulPaintFrame extends ReplayBaseSpanFrame {
data: LargestContentfulPaintData;
op: 'largest-contentful-paint';
}
interface ReplayMemoryFrame extends ReplayBaseSpanFrame {
data: MemoryData;
op: 'memory';
}
interface ReplayNavigationFrame extends ReplayBaseSpanFrame {
data: NavigationData;
op: 'navigation.navigate' | 'navigation.reload' | 'navigation.back_forward';
}
interface ReplayPaintFrame extends ReplayBaseSpanFrame {
data: PaintData;
op: 'paint';
}
interface ReplayRequestFrame extends ReplayBaseSpanFrame {
data: NetworkRequestData;
op: 'resource.fetch' | 'resource.xhr';
}
interface ReplayResourceFrame extends ReplayBaseSpanFrame {
data: ResourceData;
op: 'resource.css' | 'resource.iframe' | 'resource.img' | 'resource.link' | 'resource.other' | 'resource.script';
}
export type ReplaySpanFrame = ReplayBaseSpanFrame | ReplayHistoryFrame | ReplayRequestFrame | ReplayLargestContentfulPaintFrame | ReplayMemoryFrame | ReplayNavigationFrame | ReplayPaintFrame | ReplayResourceFrame;
export type ReplayFrame = ReplayBreadcrumbFrame | ReplaySpanFrame;
interface RecordingCustomEvent {
type: typeof ReplayEventTypeCustom;
timestamp: number;
data: {
tag: string;
payload: unknown;
};
}
export interface ReplayBreadcrumbFrameEvent extends RecordingCustomEvent {
data: {
tag: 'breadcrumb';
payload: ReplayBreadcrumbFrame;
/**
* This will indicate to backend to additionally log as a metric
*/
metric?: boolean;
};
}
export interface ReplaySpanFrameEvent extends RecordingCustomEvent {
data: {
tag: 'performanceSpan';
payload: ReplaySpanFrame;
};
}
export interface ReplayOptionFrameEvent extends RecordingCustomEvent {
data: {
tag: 'options';
payload: ReplayOptionFrame;
};
}
export type ReplayFrameEvent = ReplayBreadcrumbFrameEvent | ReplaySpanFrameEvent | ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=replayFrame.d.ts.map
type JsonObject = Record<string, unknown>;
type JsonArray = unknown[];
export type NetworkBody = JsonObject | JsonArray | string;
export type NetworkMetaWarning = 'MAYBE_JSON_TRUNCATED' | 'TEXT_TRUNCATED' | 'URL_SKIPPED' | 'BODY_PARSE_ERROR' | 'UNPARSEABLE_BODY_TYPE';
interface NetworkMeta {
warnings?: NetworkMetaWarning[];
}
export interface ReplayNetworkRequestOrResponse {
size?: number;
body?: NetworkBody;
headers: Record<string, string>;
_meta?: NetworkMeta;
}
export {};
//# sourceMappingURL=request.d.ts.map
type ClassOption = string | RegExp;
/** Duplicate this from @sentry-internal/rrweb so we can export this as well. */
export declare const ReplayEventTypeDomContentLoaded = 0;
export declare const ReplayEventTypeLoad = 1;
export declare const ReplayEventTypeFullSnapshot = 2;
export declare const ReplayEventTypeIncrementalSnapshot = 3;
export declare const ReplayEventTypeMeta = 4;
export declare const ReplayEventTypeCustom = 5;
export declare const ReplayEventTypePlugin = 6;
export type ReplayEventType = typeof ReplayEventTypeDomContentLoaded | typeof ReplayEventTypeLoad | typeof ReplayEventTypeFullSnapshot | typeof ReplayEventTypeIncrementalSnapshot | typeof ReplayEventTypeMeta | typeof ReplayEventTypeCustom | typeof ReplayEventTypePlugin;
/**
* This is a partial copy of rrweb's eventWithTime type which only contains the properties
* we specifcally need in the SDK.
*/
export type ReplayEventWithTime = {
type: ReplayEventType;
data: unknown;
timestamp: number;
delay?: number;
};
/**
* This is a partial copy of rrweb's recording options which only contains the properties
* we specifically us in the SDK. Users can specify additional properties, hence we add the
* Record<string, unknown> union type.
*/
export type RrwebRecordOptions = {
maskAllText?: boolean;
maskAllInputs?: boolean;
blockClass?: ClassOption;
ignoreClass?: string;
maskTextClass?: ClassOption;
maskTextSelector?: string;
blockSelector?: string;
maskInputOptions?: Record<string, boolean>;
} & Record<string, unknown>;
export interface CanvasManagerInterface {
reset(): void;
freeze(): void;
unfreeze(): void;
lock(): void;
unlock(): void;
snapshot(): void;
}
export interface CanvasManagerOptions {
recordCanvas: boolean;
enableManualSnapshot?: boolean;
blockClass: string | RegExp;
blockSelector: string | null;
unblockSelector: string | null;
sampling?: 'all' | number;
dataURLOptions: Partial<{
type: string;
quality: number;
}>;
mutationCb: (p: any) => void;
win: typeof globalThis & Window;
mirror: any;
}
export {};
//# sourceMappingURL=rrweb.d.ts.map
import { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
/**
* Add an event to the event buffer.
* In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.
* Instead this returns `true` if we tried to add the event, else false.
* It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEventSync(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): boolean;
/**
* Add an event to the event buffer.
* Resolves to `null` if no event was added, else to `void`.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
/** Exported only for tests. */
export declare function shouldAddEvent(replay: ReplayContainer, event: RecordingEvent): boolean;
//# sourceMappingURL=addEvent.d.ts.map
import { ReplayContainer } from '../types';
/**
* Add global listeners that cannot be removed.
*/
export declare function addGlobalListeners(replay: ReplayContainer): void;
//# sourceMappingURL=addGlobalListeners.d.ts.map
import { AddEventResult, ReplayContainer } from '../types';
/**
* Create a "span" for the total amount of memory being used by JS objects
* (including v8 internal objects).
*/
export declare function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>>;
//# sourceMappingURL=addMemoryEntry.d.ts.map
import { ReplayBreadcrumbFrame } from '../types/replayFrame';
/**
* Create a breadcrumb for a replay.
*/
export declare function createBreadcrumb(breadcrumb: Pick<ReplayBreadcrumbFrame, Exclude<keyof ReplayBreadcrumbFrame, 'timestamp' | 'type'>> & Partial<Pick<ReplayBreadcrumbFrame, 'timestamp'>>): ReplayBreadcrumbFrame;
//# sourceMappingURL=createBreadcrumb.d.ts.map
import { AllPerformanceEntry, AllPerformanceEntryData, LargestContentfulPaintData, ReplayPerformanceEntry } from '../types';
/**
* Create replay performance entries from the browser performance entries.
*/
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry<AllPerformanceEntryData>[];
/**
* Add a LCP event to the replay based on an LCP metric.
*/
export declare function getLargestContentfulPaint(metric: {
value: number;
entries: PerformanceEntry[];
}): ReplayPerformanceEntry<LargestContentfulPaintData>;
//# sourceMappingURL=createPerformanceEntries.d.ts.map
import { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/**
* Create a "span" for each performance entry.
*/
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
//# sourceMappingURL=createPerformanceSpans.d.ts.map
import { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
/**
* Create a replay envelope ready to be sent.
* This includes both the replay event, as well as the recording data.
*/
export declare function createReplayEnvelope(replayEvent: ReplayEvent, recordingData: ReplayRecordingData, dsn: DsnComponents, tunnel?: string): ReplayEnvelope;
//# sourceMappingURL=createReplayEnvelope.d.ts.map
type DebouncedCallback = {
(): void | unknown;
flush: () => void | unknown;
cancel: () => void;
};
type CallbackFunction = () => unknown;
type DebounceOptions = {
maxWait?: number;
};
/**
* Heavily simplified debounce function based on lodash.debounce.
*
* This function takes a callback function (@param fun) and delays its invocation
* by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
* which ensures that the callback is invoked at least once after the specified max. wait time.
*
* @param func the function whose invocation is to be debounced
* @param wait the minimum time until the function is invoked after it was called once
* @param options the options object, which can contain the `maxWait` property
*
* @returns the debounced version of the function, which needs to be called at least once to start the
* debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
* was already invoked in the meantime, return @param func's return value.
* The debounced function has two additional properties:
* - `flush`: Invokes the debounced function immediately and returns its return value
* - `cancel`: Cancels the debouncing process and resets the debouncing timer
*/
export declare function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback;
export {};
//# sourceMappingURL=debounce.d.ts.map
import { ErrorEvent, Event, FeedbackEvent, ReplayEvent, TransactionEvent } from '@sentry/types';
/** If the event is an error event */
export declare function isErrorEvent(event: Event): event is ErrorEvent;
/** If the event is a transaction event */
export declare function isTransactionEvent(event: Event): event is TransactionEvent;
/** If the event is an replay event */
export declare function isReplayEvent(event: Event): event is ReplayEvent;
/** If the event is a feedback event */
export declare function isFeedbackEvent(event: Event): event is FeedbackEvent;
//# sourceMappingURL=eventUtils.d.ts.map
import { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';
type GetPrivacyOptions = Required<Pick<ReplayIntegrationPrivacyOptions, Exclude<keyof ReplayIntegrationPrivacyOptions, 'maskFn'>>> & Pick<DeprecatedPrivacyOptions, Exclude<keyof DeprecatedPrivacyOptions, 'maskInputOptions'>>;
interface GetPrivacyReturn {
maskTextSelector: string;
unmaskTextSelector: string;
blockSelector: string;
unblockSelector: string;
ignoreSelector: string;
blockClass?: RegExp;
maskTextClass?: RegExp;
}
/**
* Returns privacy related configuration for use in rrweb
*/
export declare function getPrivacyOptions({ mask, unmask, block, unblock, ignore, blockClass, blockSelector, maskTextClass, maskTextSelector, ignoreClass, }: GetPrivacyOptions): GetPrivacyReturn;
export {};
//# sourceMappingURL=getPrivacyOptions.d.ts.map
import { replayIntegration } from '../integration';
/**
* This is a small utility to get a type-safe instance of the Replay integration.
*/
export declare function getReplay(): ReturnType<typeof replayIntegration> | undefined;
//# sourceMappingURL=getReplay.d.ts.map
import { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';
type RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;
/**
* Handler for recording events.
*
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
*/
export declare function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback;
/**
* Exported for tests
*/
export declare function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=handleRecordingEmit.d.ts.map
/** If sessionStorage is available. */
export declare function hasSessionStorage(): boolean;
//# sourceMappingURL=hasSessionStorage.d.ts.map
/**
* Given an initial timestamp and an expiry duration, checks to see if current
* time should be considered as expired.
*/
export declare function isExpired(initialTime: null | number, expiry: undefined | number, targetTime?: number): boolean;
//# sourceMappingURL=isExpired.d.ts.map
import { Event, EventHint } from '@sentry/types';
/**
* Returns true if we think the given event is an error originating inside of rrweb.
*/
export declare function isRrwebError(event: Event, hint: EventHint): boolean;
//# sourceMappingURL=isRrwebError.d.ts.map
/**
* Given a sample rate, returns true if replay should be sampled.
*
* 1.0 = 100% sampling
* 0.0 = 0% sampling
*/
export declare function isSampled(sampleRate?: number): boolean;
//# sourceMappingURL=isSampled.d.ts.map
import { Session } from '../types';
/**
* Checks to see if session is expired
*/
export declare function isSessionExpired(session: Session, { maxReplayDuration, sessionIdleExpire, targetTime, }: {
maxReplayDuration: number;
sessionIdleExpire: number;
targetTime?: number;
}): boolean;
//# sourceMappingURL=isSessionExpired.d.ts.map
/**
* Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.
*/
export declare function logInfo(message: string, shouldAddBreadcrumb?: boolean): void;
/**
* Log a message, and add a breadcrumb in the next tick.
* This is necessary when the breadcrumb may be added before the replay is initialized.
*/
export declare function logInfoNextTick(message: string, shouldAddBreadcrumb?: boolean): void;
//# sourceMappingURL=log.d.ts.map
import { getPrivacyOptions } from './getPrivacyOptions';
interface MaskAttributeParams {
maskAttributes: string[];
maskAllText: boolean;
privacyOptions: ReturnType<typeof getPrivacyOptions>;
key: string;
value: string;
el: HTMLElement;
}
/**
* Masks an attribute if necessary, otherwise return attribute value as-is.
*/
export declare function maskAttribute({ el, key, maskAttributes, maskAllText, privacyOptions, value, }: MaskAttributeParams): string;
export {};
//# sourceMappingURL=maskAttribute.d.ts.map
import { ReplayRecordingData } from '@sentry/types';
/**
* Prepare the recording data ready to be sent.
*/
export declare function prepareRecordingData({ recordingData, headers, }: {
recordingData: ReplayRecordingData;
headers: Record<string, unknown>;
}): ReplayRecordingData;
//# sourceMappingURL=prepareRecordingData.d.ts.map
import { IntegrationIndex } from '@sentry/core';
import { Client, ReplayEvent, Scope } from '@sentry/types';
/**
* Prepare a replay event & enrich it with the SDK metadata.
*/
export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
client: Client & {
_integrations?: IntegrationIndex;
};
scope: Scope;
replayId: string;
event: ReplayEvent;
}): Promise<ReplayEvent | null>;
//# sourceMappingURL=prepareReplayEvent.d.ts.map
import { SendReplayData } from '../types';
/**
* Finalize and send the current replay event to Sentry
*/
export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
count: number;
interval: number;
}): Promise<unknown>;
//# sourceMappingURL=sendReplay.d.ts.map
import { TransportMakeRequestResponse } from '@sentry/types';
import { RateLimits } from '@sentry/utils';
import { SendReplayData } from '../types';
/**
* Send replay attachment using `fetch()`
*/
export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, eventContext, timestamp, session, }: SendReplayData): Promise<TransportMakeRequestResponse>;
/**
* This error indicates that the transport returned an invalid status code.
*/
export declare class TransportStatusCodeError extends Error {
constructor(statusCode: number);
}
/**
* This error indicates that we hit a rate limit API error.
*/
export declare class RateLimitError extends Error {
rateLimits: RateLimits;
constructor(rateLimits: RateLimits);
}
//# sourceMappingURL=sendReplayRequest.d.ts.map
import { ReplayContainer } from '../types';
/**
* Check whether a given request URL should be filtered out. This is so we
* don't log Sentry ingest requests.
*/
export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
//# sourceMappingURL=shouldFilterRequest.d.ts.map
export declare const THROTTLED = "__THROTTLED";
export declare const SKIPPED = "__SKIPPED";
/**
* Create a throttled function off a given function.
* When calling the throttled function, it will call the original function only
* if it hasn't been called more than `maxCount` times in the last `durationSeconds`.
*
* Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,
* or else the return value of the original function.
*/
export declare function throttle<T extends (...rest: any[]) => any>(fn: T, maxCount: number, durationSeconds: number): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED;
//# sourceMappingURL=throttle.d.ts.map
/**
* Converts a timestamp to ms, if it was in s, or keeps it as ms.
*/
export declare function timestampToMs(timestamp: number): number;
/**
* Converts a timestamp to s, if it was in ms, or keeps it as s.
*/
export declare function timestampToS(timestamp: number): number;
//# sourceMappingURL=timestamp.d.ts.map
export declare const WINDOW: import("@sentry/utils").InternalGlobal & Window;
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
export declare const REPLAY_EVENT_NAME = "replay_event";
export declare const RECORDING_EVENT_NAME = "replay_recording";
export declare const UNABLE_TO_SEND_REPLAY = "Unable to send Replay";
export declare const SESSION_IDLE_PAUSE_DURATION = 300000;
export declare const SESSION_IDLE_EXPIRE_DURATION = 900000;
/** Default flush delays */
export declare const DEFAULT_FLUSH_MIN_DELAY = 5000;
export declare const DEFAULT_FLUSH_MAX_DELAY = 5500;
export declare const BUFFER_CHECKOUT_TIME = 60000;
export declare const RETRY_BASE_INTERVAL = 5000;
export declare const RETRY_MAX_COUNT = 3;
export declare const NETWORK_BODY_MAX_SIZE = 150000;
export declare const CONSOLE_ARG_MAX_SIZE = 5000;
export declare const SLOW_CLICK_THRESHOLD = 3000;
export declare const SLOW_CLICK_SCROLL_TIMEOUT = 300;
/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */
export declare const REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000;
/** Replays must be min. 5s long before we send them. */
export declare const MIN_REPLAY_DURATION = 4999;
export declare const MIN_REPLAY_DURATION_LIMIT = 15000;
/** The max. length of a replay. */
export declare const MAX_REPLAY_DURATION = 3600000;
/** Default attributes to be ignored when `maskAllText` is enabled */
export declare const DEFAULT_IGNORED_ATTRIBUTES: string[];
//# sourceMappingURL=constants.d.ts.map
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,iDAA2C,CAAC;AAE/D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAG7D,eAAO,MAAM,2BAA2B,SAAU,CAAC;AAGnD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD,2BAA2B;AAC3B,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,eAAe,IAAI,CAAC;AAGjC,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAG7C,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAG1C,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,qHAAqH;AACrH,eAAO,MAAM,4BAA4B,WAAa,CAAC;AAEvD,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AAEzC,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,mCAAmC;AACnC,eAAO,MAAM,mBAAmB,UAAY,CAAC;AAE7C,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,UAA2B,CAAC"}
import type { Event, TransportMakeRequestResponse } from '@sentry/types';
import type { ReplayContainer } from '../types';
type AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback;
export {};
//# sourceMappingURL=handleAfterSendEvent.d.ts.map
{"version":3,"file":"handleAfterSendEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleAfterSendEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAoB,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,4BAA4B,KAAK,IAAI,CAAC;AAEjG;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,sBAAsB,CAsBpF"}
import type { Event } from '@sentry/types';
import type { ReplayContainer } from '../types';
type BeforeSendEventCallback = (event: Event) => void;
/**
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
*/
export declare function handleBeforeSendEvent(replay: ReplayContainer): BeforeSendEventCallback;
export {};
//# sourceMappingURL=handleBeforeSendEvent.d.ts.map
{"version":3,"file":"handleBeforeSendEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleBeforeSendEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,KAAK,uBAAuB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAEtD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,uBAAuB,CAQtF"}
import type { Breadcrumb } from '@sentry/types';
import type { ReplayContainer } from '../types';
import type { ReplayFrame } from '../types/replayFrame';
type BreadcrumbWithCategory = Required<Pick<Breadcrumb, 'category'>>;
/**
* Handle breadcrumbs that Sentry captures, and make sure to capture relevant breadcrumbs to Replay as well.
*/
export declare function handleBreadcrumbs(replay: ReplayContainer): void;
/** Exported only for tests. */
export declare function normalizeBreadcrumb(breadcrumb: Breadcrumb): Breadcrumb | null;
/** exported for tests only */
export declare function normalizeConsoleBreadcrumb(breadcrumb: Omit<Breadcrumb, 'category'> & BreadcrumbWithCategory): ReplayFrame;
export {};
//# sourceMappingURL=handleBreadcrumbs.d.ts.map
{"version":3,"file":"handleBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleBreadcrumbs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,KAAK,sBAAsB,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAErE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAQ/D;AAaD,+BAA+B;AAC/B,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAsB7E;AAED,8BAA8B;AAC9B,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,sBAAsB,GAChE,WAAW,CAgDb"}
import type { Breadcrumb } from '@sentry/types';
import type { RecordingEvent, ReplayClickDetector, ReplayContainer, SlowClickConfig } from '../types';
import { addBreadcrumbEvent } from './util/addBreadcrumbEvent';
/** Handle a click. */
export declare function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void;
/** A click detector class that can be used to detect slow or rage clicks on elements. */
export declare class ClickDetector implements ReplayClickDetector {
protected _lastMutation: number;
protected _lastScroll: number;
private _clicks;
private _teardown;
private _threshold;
private _scollTimeout;
private _timeout;
private _ignoreSelector;
private _replay;
private _checkClickTimeout?;
private _addBreadcrumbEvent;
constructor(replay: ReplayContainer, slowClickConfig: SlowClickConfig, _addBreadcrumbEvent?: typeof addBreadcrumbEvent);
/** Register click detection handlers on mutation or scroll. */
addListeners(): void;
/** Clean up listeners. */
removeListeners(): void;
/** @inheritDoc */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** @inheritDoc */
registerMutation(timestamp?: number): void;
/** @inheritDoc */
registerScroll(timestamp?: number): void;
/** @inheritDoc */
registerClick(element: HTMLElement): void;
/** Count multiple clicks on elements. */
private _handleMultiClick;
/** Get all pending clicks for a given node. */
private _getClicks;
/** Check the clicks that happened. */
private _checkClicks;
/** Generate matching breadcrumb(s) for the click. */
private _generateBreadcrumbs;
/** Schedule to check current clicks. */
private _scheduleCheckClicks;
}
/** exported for tests only */
export declare function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean;
/** Update the click detector based on a recording event of rrweb. */
export declare function updateClickDetectorForRecordingEvent(clickDetector: ReplayClickDetector, event: RecordingEvent): void;
//# sourceMappingURL=handleClick.d.ts.map
{"version":3,"file":"handleClick.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleClick.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EAGf,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AA2B/D,sBAAsB;AACtB,wBAAgB,WAAW,CAAC,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAEpH;AAED,yFAAyF;AACzF,qBAAa,aAAc,YAAW,mBAAmB;IAEvD,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAE9B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,SAAS,CAA2B;IAE5C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,kBAAkB,CAAC,CAAgC;IAC3D,OAAO,CAAC,mBAAmB,CAA4B;gBAGrD,MAAM,EAAE,eAAe,EACvB,eAAe,EAAE,eAAe,EAEhC,mBAAmB,4BAAqB;IAe1C,+DAA+D;IACxD,YAAY,IAAI,IAAI;IAe3B,0BAA0B;IACnB,eAAe,IAAI,IAAI;IAU9B,kBAAkB;IACX,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IA4BnE,kBAAkB;IACX,gBAAgB,CAAC,SAAS,SAAa,GAAG,IAAI;IAIrD,kBAAkB;IACX,cAAc,CAAC,SAAS,SAAa,GAAG,IAAI;IAInD,kBAAkB;IACX,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAKhD,yCAAyC;IACzC,OAAO,CAAC,iBAAiB;IAMzB,+CAA+C;IAC/C,OAAO,CAAC,UAAU;IAIlB,sCAAsC;IACtC,OAAO,CAAC,YAAY;IAmCpB,qDAAqD;IACrD,OAAO,CAAC,oBAAoB;IAwD5B,wCAAwC;IACxC,OAAO,CAAC,oBAAoB;CAO7B;AAID,8BAA8B;AAC9B,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAyBhF;AAWD,qEAAqE;AACrE,wBAAgB,oCAAoC,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAkCpH"}
import type { Breadcrumb, HandlerDataDom } from '@sentry/types';
import type { ReplayContainer } from '../types';
export declare const handleDomListener: (replay: ReplayContainer) => (handlerData: HandlerDataDom) => void;
/** Get the base DOM breadcrumb. */
export declare function getBaseDomBreadcrumb(target: Node | null, message: string): Breadcrumb;
/**
* An event handler to react to DOM events.
* Exported for tests.
*/
export declare function handleDom(handlerData: HandlerDataDom): Breadcrumb | null;
//# sourceMappingURL=handleDom.d.ts.map
{"version":3,"file":"handleDom.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleDom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAOhD,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,CAAC,WAAW,EAAE,cAAc,KAAK,IAoC7F,CAAC;AAEF,mCAAmC;AACnC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAwBrF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,cAAc,GAAG,UAAU,GAAG,IAAI,CAOxE"}
import type { Event, EventHint } from '@sentry/types';
import type { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addEventProcessor(listener)`.
*/
export declare function handleGlobalEventListener(replay: ReplayContainer): (event: Event, hint: EventHint) => Event | null;
//# sourceMappingURL=handleGlobalEvent.d.ts.map
{"version":3,"file":"handleGlobalEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleGlobalEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,KAAK,GAAG,IAAI,CA4DlH"}
import type { HandlerDataHistory } from '@sentry/types';
import type { ReplayContainer } from '../types';
/**
* Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`.
*/
export declare function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HandlerDataHistory) => void;
//# sourceMappingURL=handleHistory.d.ts.map
{"version":3,"file":"handleHistory.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,KAAK,EAAe,eAAe,EAA0B,MAAM,UAAU,CAAC;AAmBrF;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,WAAW,EAAE,kBAAkB,KAAK,IAAI,CAsB5G"}
import type { Breadcrumb } from '@sentry/types';
import type { ReplayContainer } from '../types';
/** Handle keyboard events & create breadcrumbs. */
export declare function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void;
/** exported only for tests */
export declare function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null;
//# sourceMappingURL=handleKeyboardEvent.d.ts.map
{"version":3,"file":"handleKeyboardEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleKeyboardEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,mDAAmD;AACnD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAiBvF;AAED,8BAA8B;AAC9B,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI,CAiC7E"}
import type { Breadcrumb, BreadcrumbHint } from '@sentry/types';
import type { ReplayContainer, ReplayNetworkOptions } from '../types';
interface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {
replay: ReplayContainer;
}
/**
* This method does two things:
* - It enriches the regular XHR/fetch breadcrumbs with request/response size data
* - It captures the XHR/fetch breadcrumbs to the replay
* (enriching it with further data that is _not_ added to the regular breadcrumbs)
*/
export declare function handleNetworkBreadcrumbs(replay: ReplayContainer): void;
/** just exported for tests */
export declare function beforeAddNetworkBreadcrumb(options: ExtendedNetworkBreadcrumbsOptions, breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
export {};
//# sourceMappingURL=handleNetworkBreadcrumbs.d.ts.map
{"version":3,"file":"handleNetworkBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleNetworkBreadcrumbs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAA0C,MAAM,eAAe,CAAC;AAIxG,OAAO,KAAK,EAAa,eAAe,EAAE,oBAAoB,EAAW,MAAM,UAAU,CAAC;AAI1F,UAAU,iCAAkC,SAAQ,oBAAoB;IACtE,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA2BtE;AAED,8BAA8B;AAC9B,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iCAAiC,EAC1C,UAAU,EAAE,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,IAAI,CA8BN"}
import type { ReplayContainer } from '../types';
/**
* Sets up a PerformanceObserver to listen to all performance entry types.
* Returns a callback to stop observing.
*/
export declare function setupPerformanceObserver(replay: ReplayContainer): () => void;
//# sourceMappingURL=performanceObserver.d.ts.map
{"version":3,"file":"performanceObserver.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/performanceObserver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,IAAI,CA4B5E"}
import type { Breadcrumb } from '@sentry/types';
import type { ReplayContainer } from '../../types';
/**
* Add a breadcrumb event to replay.
*/
export declare function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void;
//# sourceMappingURL=addBreadcrumbEvent.d.ts.map
{"version":3,"file":"addBreadcrumbEvent.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addBreadcrumbEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CA6BxF"}
import type { FeedbackEvent } from '@sentry/types';
import type { ReplayContainer } from '../../types';
/**
* Add a feedback breadcrumb event to replay.
*/
export declare function addFeedbackBreadcrumb(replay: ReplayContainer, event: FeedbackEvent): void;
//# sourceMappingURL=addFeedbackBreadcrumb.d.ts.map
{"version":3,"file":"addFeedbackBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addFeedbackBreadcrumb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAA8B,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/E;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CA6BzF"}
import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';
/** Add a performance entry breadcrumb */
export declare function addNetworkBreadcrumb(replay: ReplayContainer, result: ReplayPerformanceEntry<NetworkRequestData> | null): void;
//# sourceMappingURL=addNetworkBreadcrumb.d.ts.map
{"version":3,"file":"addNetworkBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addNetworkBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI/F,yCAAyC;AACzC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,GACxD,IAAI,CAoBN"}
import type { INode } from '@sentry-internal/rrweb-snapshot';
/** Get the closest interactive parent element, or else return the given element. */
export declare function getClosestInteractive(element: Element): Element;
/**
* For clicks, we check if the target is inside of a button or link
* If so, we use this as the target instead
* This is useful because if you click on the image in <button><img></button>,
* The target will be the image, not the button, which we don't want here
*/
export declare function getClickTargetNode(event: Event | MouseEvent | Node): Node | INode | null;
/** Get the event target node. */
export declare function getTargetNode(event: Node | {
target: EventTarget | null;
}): Node | INode | null;
//# sourceMappingURL=domUtils.d.ts.map
{"version":3,"file":"domUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/domUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAI7D,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG/D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAQxF;AAED,iCAAiC;AACjC,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,GAAG;IAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAM/F"}
import type { Breadcrumb, FetchBreadcrumbData } from '@sentry/types';
import type { FetchHint, ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestOrResponse } from '../../types';
/**
* Capture a fetch breadcrumb to a replay.
* This adds additional data (where approriate).
*/
export declare function captureFetchBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichFetchBreadcrumb(breadcrumb: Breadcrumb & {
data: FetchBreadcrumbData;
}, hint: Partial<FetchHint>): void;
/** Exported only for tests. */
export declare function _getResponseInfo(captureDetails: boolean, { networkCaptureBodies, networkResponseHeaders, }: Pick<ReplayNetworkOptions, 'networkCaptureBodies' | 'networkResponseHeaders'>, response: Response | undefined, responseBodySize?: number): Promise<ReplayNetworkRequestOrResponse | undefined>;
//# sourceMappingURL=fetchUtils.d.ts.map
{"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIrE,OAAO,KAAK,EACV,SAAS,EAET,eAAe,EACf,oBAAoB,EAEpB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAcrB;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,EACtD,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,EACxB,OAAO,EAAE,oBAAoB,GAAG;IAC9B,MAAM,EAAE,eAAe,CAAC;CACzB,GACA,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,EACtD,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GACvB,IAAI,CAcN;AA4DD,+BAA+B;AAC/B,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,OAAO,EACvB,EACE,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,IAAI,CAAC,oBAAoB,EAAE,sBAAsB,GAAG,wBAAwB,CAAC,EAChF,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,8BAA8B,GAAG,SAAS,CAAC,CAyBrD"}
/**
* Inclusion list of attributes that we want to record from the DOM element
*/
export declare function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown>;
//# sourceMappingURL=getAttributesToRecord.d.ts.map
{"version":3,"file":"getAttributesToRecord.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/getAttributesToRecord.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAelG"}
import type { NetworkMetaWarning, NetworkRequestData, ReplayNetworkRequestData, ReplayNetworkRequestOrResponse, ReplayPerformanceEntry } from '../../types';
/** Get the size of a body. */
export declare function getBodySize(body: RequestInit['body']): number | undefined;
/** Convert a Content-Length header to number/undefined. */
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
/** Get the string representation of a body. */
export declare function getBodyString(body: unknown): [string | undefined, NetworkMetaWarning?];
/** Merge a warning into an existing network request/response. */
export declare function mergeWarning(info: ReplayNetworkRequestOrResponse | undefined, warning: NetworkMetaWarning): ReplayNetworkRequestOrResponse;
/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
export declare function makeNetworkReplayBreadcrumb(type: string, data: ReplayNetworkRequestData | null): ReplayPerformanceEntry<NetworkRequestData> | null;
/** Build the request or response part of a replay network breadcrumb that was skipped. */
export declare function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse;
/** Build the request or response part of a replay network breadcrumb. */
export declare function buildNetworkRequestOrResponse(headers: Record<string, string>, bodySize: number | undefined, body: string | undefined): ReplayNetworkRequestOrResponse | undefined;
/** Filter a set of headers */
export declare function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string>;
/** Match an URL against a list of strings/Regex. */
export declare function urlMatches(url: string, urls: (string | RegExp)[]): boolean;
/** exported for tests */
export declare function getFullUrl(url: string, baseURI?: string): string;
//# sourceMappingURL=networkUtils.d.ts.map
{"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":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AM,EAAE,MAAM,CAAC,CASnH;AA8DD,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAI1E;AAED,yBAAyB;AACzB,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAA0B,GAAG,MAAM,CAoBjF"}
type WindowOpenHandler = () => void;
/**
* Register a handler to be called when `window.open()` is called.
* Returns a cleanup function.
*/
export declare function onWindowOpen(cb: WindowOpenHandler): () => void;
export {};
//# sourceMappingURL=onWindowOpen.d.ts.map
{"version":3,"file":"onWindowOpen.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/onWindowOpen.ts"],"names":[],"mappings":"AAIA,KAAK,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAIpC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAe9D"}
import type { Event } from '@sentry/types';
import type { ReplayContainer } from '../../types';
/**
* Determine if event should be sampled (only applies in buffer mode).
* When an event is captured by `hanldleGlobalEvent`, when in buffer mode
* we determine if we want to sample the error or not.
*/
export declare function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean;
//# sourceMappingURL=shouldSampleForBufferEvent.d.ts.map
{"version":3,"file":"shouldSampleForBufferEvent.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/shouldSampleForBufferEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAiBzF"}
import type { Breadcrumb, XhrBreadcrumbData } from '@sentry/types';
import type { NetworkMetaWarning, ReplayContainer, ReplayNetworkOptions, XhrHint } from '../../types';
/**
* Capture an XHR breadcrumb to a replay.
* This adds additional data (where approriate).
*/
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>): void;
/**
* Get the string representation of the XHR response.
* Based on MDN, these are the possible types of the response:
* string
* ArrayBuffer
* Blob
* Document
* POJO
*
* Exported only for tests.
*/
export declare function _parseXhrResponse(body: XMLHttpRequest['response'], responseType: XMLHttpRequest['responseType']): [string | undefined, NetworkMetaWarning?];
//# sourceMappingURL=xhrUtils.d.ts.map
{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAInE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EAEpB,OAAO,EACR,MAAM,aAAa,CAAC;AAcrB;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,EACpD,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EACtB,OAAO,EAAE,oBAAoB,GAAG;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAC1D,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,EACpD,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GACrB,IAAI,CAkBN;AA+FD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,GAC3C,CAAC,MAAM,GAAG,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAyB3C"}
/**
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
*
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
*/
export declare const DEBUG_BUILD: boolean;
//# sourceMappingURL=debug-build.d.ts.map
{"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../src/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
/** This error indicates that the event buffer size exceeded the limit.. */
export declare class EventBufferSizeExceededError extends Error {
constructor();
}
//# sourceMappingURL=error.d.ts.map
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/error.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,qBAAa,4BAA6B,SAAQ,KAAK;;CAItD"}
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* A basic event buffer that does not do any compression.
* Used as fallback if the compression worker cannot be loaded or is disabled.
*/
export declare class EventBufferArray implements EventBuffer {
/** All the events that are buffered to be sent. */
events: RecordingEvent[];
/** @inheritdoc */
hasCheckout: boolean;
private _totalSize;
constructor();
/** @inheritdoc */
get hasEvents(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/** @inheritdoc */
destroy(): void;
/** @inheritdoc */
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritdoc */
finish(): Promise<string>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
}
//# sourceMappingURL=EventBufferArray.d.ts.map
{"version":3,"file":"EventBufferArray.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferArray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI7F;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,mDAAmD;IAC5C,MAAM,EAAE,cAAc,EAAE,CAAC;IAEhC,kBAAkB;IACX,WAAW,EAAE,OAAO,CAAC;IAE5B,OAAO,CAAC,UAAU,CAAS;;IAQ3B,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAItB,kBAAkB;IACL,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAUrE,kBAAkB;IACX,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAWhC,kBAAkB;IACX,KAAK,IAAI,IAAI;IAMpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;CAS7C"}
import type { ReplayRecordingData } from '@sentry/types';
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class EventBufferCompressionWorker implements EventBuffer {
/** @inheritdoc */
hasCheckout: boolean;
private _worker;
private _earliestTimestamp;
private _totalSize;
constructor(worker: Worker);
/** @inheritdoc */
get hasEvents(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occured.
*/
ensureReady(): Promise<void>;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfuly received and processed by worker.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Finish the event buffer and return the compressed data.
*/
finish(): Promise<ReplayRecordingData>;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Send the event to the worker.
*/
private _sendEventToWorker;
/**
* Finish the request and return the compressed data from the worker.
*/
private _finishRequest;
}
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map
{"version":3,"file":"EventBufferCompressionWorker.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferCompressionWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKzD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK7F;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IAC9D,kBAAkB;IACX,WAAW,EAAE,OAAO,CAAC;IAE5B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,kBAAkB,CAAgB;IAC1C,OAAO,CAAC,UAAU,CAAC;gBAEA,MAAM,EAAE,MAAM;IAOjC,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED;;;OAGG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC;;OAEG;IACI,OAAO,IAAI,IAAI;IAItB;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB/D;;OAEG;IACI,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI7C,kBAAkB;IACX,KAAK,IAAI,IAAI;IAWpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAI5C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;OAEG;YACW,cAAc;CAQ7B"}
import type { ReplayRecordingData } from '@sentry/types';
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
* This can happen e.g. if the worker cannot be loaded.
* Exported only for testing.
*/
export declare class EventBufferProxy implements EventBuffer {
private _fallback;
private _compression;
private _used;
private _ensureWorkerIsLoadedPromise;
constructor(worker: Worker);
/** @inheritdoc */
get type(): EventBufferType;
/** @inheritDoc */
get hasEvents(): boolean;
/** @inheritdoc */
get hasCheckout(): boolean;
/** @inheritdoc */
set hasCheckout(value: boolean);
/** @inheritDoc */
destroy(): void;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully added.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritDoc */
finish(): Promise<ReplayRecordingData>;
/** Ensure the worker has loaded. */
ensureWorkerIsLoaded(): Promise<void>;
/** Actually check if the worker has been loaded. */
private _ensureWorkerIsLoaded;
/** Switch the used buffer to the compression worker. */
private _switchToCompressionWorker;
}
//# sourceMappingURL=EventBufferProxy.d.ts.map
{"version":3,"file":"EventBufferProxy.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK7F;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,4BAA4B,CAAgB;gBAEjC,MAAM,EAAE,MAAM;IAQjC,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,WAAW,IAAI,OAAO,CAEhC;IACD,kBAAkB;IAClB,IAAW,WAAW,CAAC,KAAK,EAAE,OAAO,EAEpC;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAKtB,kBAAkB;IACX,KAAK,IAAI,IAAI;IAIpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAI5C;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAI/D,kBAAkB;IACL,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAOnD,oCAAoC;IAC7B,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C,oDAAoD;YACtC,qBAAqB;IAcnC,wDAAwD;YAC1C,0BAA0B;CAqBzC"}
import type { EventBuffer } from '../types';
interface CreateEventBufferParams {
useCompression: boolean;
workerUrl?: string;
}
/**
* Create an event buffer for replays.
*/
export declare function createEventBuffer({ useCompression, workerUrl: customWorkerUrl, }: CreateEventBufferParams): EventBuffer;
export {};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,UAAU,uBAAuB;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,SAAS,EAAE,eAAe,GAC3B,EAAE,uBAAuB,GAAG,WAAW,CAevC"}
import type { WorkerRequest } from '../types';
/**
* Event buffer that uses a web worker to compress events.
* Exported only for testing.
*/
export declare class WorkerHandler {
private _worker;
private _id;
private _ensureReadyPromise?;
constructor(worker: Worker);
/**
* Ensure the worker is ready (or not).
* This will either resolve when the worker is ready, or reject if an error occured.
*/
ensureReady(): Promise<void>;
/**
* Destroy the worker.
*/
destroy(): void;
/**
* Post message to worker and wait for response before resolving promise.
*/
postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T>;
/** Get the current ID and increment it for the next call. */
private _getAndIncrementId;
}
//# sourceMappingURL=WorkerHandler.d.ts.map
{"version":3,"file":"WorkerHandler.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/WorkerHandler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAG9D;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,mBAAmB,CAAC,CAAgB;gBAEzB,MAAM,EAAE,MAAM;IAKjC;;;OAGG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BnC;;OAEG;IACI,OAAO,IAAI,IAAI;IAKtB;;OAEG;IACI,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAqC9F,6DAA6D;IAC7D,OAAO,CAAC,kBAAkB;CAG3B"}
export { replayIntegration } from './integration';
export type { ReplayConfiguration, ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, CanvasManagerInterface, CanvasManagerOptions, } from './types';
export { getReplay } from './util/getReplay';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
import type { Integration } from '@sentry/types';
import type { ReplayConfiguration, SendBufferedReplayOptions } from './types';
/**
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/).
*
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information.
*
* @example
*
* ```
* Sentry.init({
* dsn: '__DSN__',
* integrations: [Sentry.replayIntegration()],
* });
* ```
*/
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay;
/**
* Replay integration
*
* TODO: Rewrite this to be functional integration
* Exported for tests.
*/
export declare class Replay implements Integration {
/**
* @inheritDoc
*/
static id: string;
/**
* @inheritDoc
*/
name: string;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
/**
* Initial options passed to the replay integration, merged with default values.
* Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
* can only be finally set when setupOnce() is called.
*
* @private
*/
private readonly _initialOptions;
private _replay?;
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration);
/** If replay has already been initialized */
protected get _isInitialized(): boolean;
/** Update _isInitialized */
protected set _isInitialized(value: boolean);
/**
* Setup and initialize replay container
*/
setupOnce(): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will throw an error if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* PerformanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, until an error occurs.
*/
startBuffering(): void;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop(): Promise<void>;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
flush(options?: SendBufferedReplayOptions): Promise<void>;
/**
* Get the current session ID.
*/
getReplayId(): string | undefined;
/**
* Initializes replay.
*/
protected _initialize(): void;
/** Setup the integration. */
private _setup;
/** Get canvas options from ReplayCanvas integration, if it is also added. */
private _maybeLoadFromReplayCanvasIntegration;
}
//# sourceMappingURL=integration.d.ts.map
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8B,WAAW,EAAiB,MAAM,eAAe,CAAC;AAW5F,OAAO,KAAK,EAIV,mBAAmB,EAEnB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAWjB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,aAAe,mBAAmB,WAEtC,CAAC;AAE3B;;;;;GAKG;AACH,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAE7D,OAAO,CAAC,OAAO,CAAC,CAAkB;gBAEf,EACjB,aAAuC,EACvC,aAAuC,EACvC,iBAAuC,EACvC,iBAAuC,EACvC,aAAoB,EACpB,cAAqB,EACrB,SAAS,EACT,YAAiB,EACjB,WAAkB,EAClB,aAAoB,EACpB,aAAoB,EAEpB,uBAA6B,EAC7B,aAAsB,EAEtB,gBAAwB,EACxB,wBAA6B,EAE7B,sBAA2B,EAC3B,qBAA0B,EAC1B,oBAA2B,EAC3B,qBAA0B,EAC1B,sBAA2B,EAE3B,IAAS,EACT,cAAyC,EACzC,MAAW,EACX,KAAU,EACV,OAAY,EACZ,MAAW,EACX,MAAM,EAEN,uBAAuB,EACvB,mBAAmB,EAGnB,UAAU,EAEV,aAAa,EAEb,gBAAgB,EAEhB,aAAa,EAEb,gBAAgB,EAEhB,WAAW,GACZ,GAAE,mBAAwB;IA6F3B,6CAA6C;IAC7C,SAAS,KAAK,cAAc,IAAI,OAAO,CAEtC;IAED,4BAA4B;IAC5B,SAAS,KAAK,cAAc,CAAC,KAAK,EAAE,OAAO,EAE1C;IAED;;OAEG;IACI,SAAS,IAAI,IAAI;IAkBxB;;;;;;OAMG;IACI,KAAK,IAAI,IAAI;IAQpB;;;OAGG;IACI,cAAc,IAAI,IAAI;IAQ7B;;;OAGG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B;;;;;;OAMG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhE;;OAEG;IACI,WAAW,IAAI,MAAM,GAAG,SAAS;IAQxC;;OAEG;IACH,SAAS,CAAC,WAAW,IAAI,IAAI;IAc7B,6BAA6B;IAC7B,OAAO,CAAC,MAAM;IAUd,6EAA6E;IAC7E,OAAO,CAAC,qCAAqC;CAmB9C"}
import type { ReplayRecordingMode, Span } from '@sentry/types';
import { ClickDetector } from './coreHandlers/handleClick';
import type { AddEventResult, AddUpdateCallback, AllPerformanceEntry, AllPerformanceEntryData, EventBuffer, InternalEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPerformanceEntry, ReplayPluginOptions, SendBufferedReplayOptions, Session, Timeouts } from './types';
import type { SKIPPED } from './util/throttle';
import { THROTTLED } from './util/throttle';
/**
* The main replay container class, which holds all the state and methods for recording and sending replays.
*/
export declare class ReplayContainer implements ReplayContainerInterface {
eventBuffer: EventBuffer | null;
performanceEntries: AllPerformanceEntry[];
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
clickDetector: ClickDetector | undefined;
/**
* Recording can happen in one of three modes:
* - session: Record the whole session, sending it continuously
* - buffer: Always keep the last 60s of recording, requires:
* - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs
* - or calling `flush()` to send the replay
*/
recordingMode: ReplayRecordingMode;
/**
* The current or last active span.
* This is only available when performance is enabled.
*/
lastActiveSpan?: Span;
/**
* These are here so we can overwrite them in tests etc.
* @hidden
*/
readonly timeouts: Timeouts;
private _throttledAddEvent;
/**
* Options to pass to `rrweb.record()`
*/
private readonly _recordingOptions;
private readonly _options;
private _performanceCleanupCallback?;
private _debouncedFlush;
private _flushLock;
/**
* Timestamp of the last user activity. This lives across sessions.
*/
private _lastActivity;
/**
* Is the integration currently active?
*/
private _isEnabled;
/**
* Paused is a state where:
* - DOM Recording is not listening at all
* - Nothing will be added to event buffer (e.g. core SDK events)
*/
private _isPaused;
/**
* Have we attached listeners to the core SDK?
* Note we have to track this as there is no way to remove instrumentation handlers.
*/
private _hasInitializedCoreListeners;
/**
* Function to stop recording
*/
private _stopRecording;
private _context;
/**
* Internal use for canvas recording options
*/
private _canvas;
constructor({ options, recordingOptions, }: {
options: ReplayPluginOptions;
recordingOptions: RecordingOptions;
});
/** Get the event context. */
getContext(): InternalEventContext;
/** If recording is currently enabled. */
isEnabled(): boolean;
/** If recording is currently paused. */
isPaused(): boolean;
/**
* Determine if canvas recording is enabled
*/
isRecordingCanvas(): boolean;
/** Get the replay integration options. */
getOptions(): ReplayPluginOptions;
/**
* Initializes the plugin based on sampling configuration. Should not be
* called outside of constructor.
*/
initializeSampling(previousSessionId?: string): void;
/**
* Start a replay regardless of sampling rate. Calling this will always
* create a new session. Will throw an error if replay is already in progress.
*
* Creates or loads a session, attaches listeners to varying events (DOM,
* _performanceObserver, Recording, Sentry SDK, etc)
*/
start(): void;
/**
* Start replay buffering. Buffers until `flush()` is called or, if
* `replaysOnErrorSampleRate` > 0, an error occurs.
*/
startBuffering(): void;
/**
* Start recording.
*
* Note that this will cause a new DOM checkout
*/
startRecording(): void;
/**
* Stops the recording, if it was running.
*
* Returns true if it was previously stopped, or is now stopped,
* otherwise false.
*/
stopRecording(): boolean;
/**
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
* does not support a teardown
*/
stop({ forceFlush, reason }?: {
forceFlush?: boolean;
reason?: string;
}): Promise<void>;
/**
* Pause some replay functionality. See comments for `_isPaused`.
* This differs from stop as this only stops DOM recording, it is
* not as thorough of a shutdown as `stop()`.
*/
pause(): void;
/**
* Resumes recording, see notes for `pause().
*
* Note that calling `startRecording()` here will cause a
* new DOM checkout.`
*/
resume(): void;
/**
* If not in "session" recording mode, flush event buffer which will create a new replay.
* Unless `continueRecording` is false, the replay will continue to record and
* behave as a "session"-based replay.
*
* Otherwise, queue up a flush.
*/
sendBufferedReplayOrFlush({ continueRecording }?: SendBufferedReplayOptions): Promise<void>;
/**
* We want to batch uploads of replay events. Save events only if
* `<flushMinDelay>` milliseconds have elapsed since the last event
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
*
* Accepts a callback to perform side-effects and returns true to stop batch
* processing and hand back control to caller.
*/
addUpdate(cb: AddUpdateCallback): void;
/**
* Updates the user activity timestamp and resumes recording. This should be
* called in an event handler for a user action that we consider as the user
* being "active" (e.g. a mouse click).
*/
triggerUserActivity(): void;
/**
* Updates the user activity timestamp *without* resuming
* recording. Some user events (e.g. keydown) can be create
* low-value replays that only contain the keypress as a
* breadcrumb. Instead this would require other events to
* create a new replay after a session has expired.
*/
updateUserActivity(): void;
/**
* Only flush if `this.recordingMode === 'session'`
*/
conditionalFlush(): Promise<void>;
/**
* Flush using debounce flush
*/
flush(): Promise<void>;
/**
* Always flush via `_debouncedFlush` so that we do not have flushes triggered
* from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
* cases of mulitple flushes happening closely together.
*/
flushImmediate(): Promise<void>;
/**
* Cancels queued up flushes.
*/
cancelFlush(): void;
/** Get the current sesion (=replay) ID */
getSessionId(): string | undefined;
/**
* Checks if recording should be stopped due to user inactivity. Otherwise
* check if session is expired and create a new session if so. Triggers a new
* full snapshot on new session.
*
* Returns true if session is not expired, false otherwise.
* @hidden
*/
checkAndHandleExpiredSession(): boolean | void;
/**
* Capture some initial state that can change throughout the lifespan of the
* replay. This is required because otherwise they would be captured at the
* first flush.
*/
setInitialState(): void;
/**
* Add a breadcrumb event, that may be throttled.
* If it was throttled, we add a custom breadcrumb to indicate that.
*/
throttledAddEvent(event: RecordingEvent, isCheckout?: boolean): typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
/**
* This will get the parametrized route name of the current page.
* This is only available if performance is enabled, and if an instrumented router is used.
*/
getCurrentRoute(): string | undefined;
/**
* Initialize and start all listeners to varying events (DOM,
* Performance Observer, Recording, Sentry SDK, etc)
*/
private _initializeRecording;
/** A wrapper to conditionally capture exceptions. */
private _handleException;
/**
* Loads (or refreshes) the current session.
*/
private _initializeSessionForSampling;
/**
* Checks and potentially refreshes the current session.
* Returns false if session is not recorded.
*/
private _checkSession;
/**
* Refresh a session with a new one.
* This stops the current session (without forcing a flush, as that would never work since we are expired),
* and then does a new sampling based on the refreshed session.
*/
private _refreshSession;
/**
* Adds listeners to record events for the replay
*/
private _addListeners;
/**
* Cleans up listeners that were created in `_addListeners`
*/
private _removeListeners;
/**
* Handle when visibility of the page content changes. Opening a new tab will
* cause the state to change to hidden because of content of current page will
* be hidden. Likewise, moving a different window to cover the contents of the
* page will also trigger a change to a hidden state.
*/
private _handleVisibilityChange;
/**
* Handle when page is blurred
*/
private _handleWindowBlur;
/**
* Handle when page is focused
*/
private _handleWindowFocus;
/** Ensure page remains active when a key is pressed. */
private _handleKeyboardEvent;
/**
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
*/
private _doChangeToBackgroundTasks;
/**
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
*/
private _doChangeToForegroundTasks;
/**
* Update user activity (across session lifespans)
*/
private _updateUserActivity;
/**
* Updates the session's last activity timestamp
*/
private _updateSessionActivity;
/**
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
*/
private _createCustomBreadcrumb;
/**
* Observed performance events are added to `this.performanceEntries`. These
* are included in the replay event before it is finished and sent to Sentry.
*/
private _addPerformanceEntries;
/**
* Clear _context
*/
private _clearContext;
/** Update the initial timestamp based on the buffer content. */
private _updateInitialTimestampFromEventBuffer;
/**
* Return and clear _context
*/
private _popEventContext;
/**
* Flushes replay event buffer to Sentry.
*
* Performance events are only added right before flushing - this is
* due to the buffered performance observer events.
*
* Should never be called directly, only by `flush`
*/
private _runFlush;
/**
* Flush recording data to Sentry. Creates a lock so that only a single flush
* can be active at a time. Do not call this directly.
*/
private _flush;
/** Save the session, if it is sticky */
private _maybeSaveSession;
/** Handler for rrweb.record.onMutation */
private _onMutationHandler;
}
//# sourceMappingURL=replay.d.ts.map
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/replay.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAW/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EAEpB,cAAc,EACd,gBAAgB,EAGhB,eAAe,IAAI,wBAAwB,EAC3C,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,OAAO,EAEP,QAAQ,EACT,MAAM,SAAS,CAAC;AAcjB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAY,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,qBAAa,eAAgB,YAAW,wBAAwB;IACvD,WAAW,EAA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AG,OAAO,OAAO,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IA2BrE;;;OAGG;IACI,eAAe,IAAI,MAAM,GAAG,SAAS;IAa5C;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAsB5B,qDAAqD;IACrD,OAAO,CAAC,gBAAgB;IAQxB;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAsBrC;;;OAGG;IACH,OAAO,CAAC,aAAa;IAwBrB;;;;OAIG;YACW,eAAe;IAQ7B;;OAEG;IACH,OAAO,CAAC,aAAa;IAwBrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB,CAM7B;IAEF;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAQvB;IAEF;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAQxB;IAEF,wDAAwD;IACxD,OAAO,CAAC,oBAAoB,CAE1B;IAEF;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA0BlC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAoBlC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB,gEAAgE;IAChE,OAAO,CAAC,sCAAsC;IAiB9C;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;;;;;OAOG;YACW,SAAS;IA4EvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CA8EZ;IAEF,wCAAwC;IACxC,OAAO,CAAC,iBAAiB;IAMzB,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB,CA8BxB;CACH"}
import type { ReplayContainer } from '../../src/types';
/**
* Removes the session from Session Storage and unsets session in replay instance
*/
export declare function clearSession(replay: ReplayContainer): void;
//# sourceMappingURL=clearSession.d.ts.map
{"version":3,"file":"clearSession.d.ts","sourceRoot":"","sources":["../../../../src/session/clearSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAG1D"}
import type { Sampled, Session, SessionOptions } from '../types';
/**
* Get the sampled status for a session based on sample rates & current sampled status.
*/
export declare function getSessionSampleType(sessionSampleRate: number, allowBuffering: boolean): Sampled;
/**
* Create a new session, which in its current implementation is a Sentry event
* that all replays will be saved to as attachments. Currently, we only expect
* one of these Sentry events per "replay session".
*/
export declare function createSession({ sessionSampleRate, allowBuffering, stickySession }: SessionOptions, { previousSessionId }?: {
previousSessionId?: string;
}): Session;
//# sourceMappingURL=createSession.d.ts.map
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../src/session/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAKjE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO,CAEhG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAqB,EAAE,EAAE,cAAc,EAC5E,EAAE,iBAAiB,EAAE,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GACzD,OAAO,CAYT"}
import type { Session } from '../types';
/**
* Fetches a session from storage
*/
export declare function fetchSession(traceInternals?: boolean): Session | null;
//# sourceMappingURL=fetchSession.d.ts.map
{"version":3,"file":"fetchSession.d.ts","sourceRoot":"","sources":["../../../../src/session/fetchSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKxC;;GAEG;AACH,wBAAgB,YAAY,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAqBrE"}
export * from './createSession';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
import type { Session, SessionOptions } from '../types';
/**
* Get or create a session, when initializing the replay.
* Returns a session that may be unsampled.
*/
export declare function loadOrCreateSession({ traceInternals, sessionIdleExpire, maxReplayDuration, previousSessionId, }: {
sessionIdleExpire: number;
maxReplayDuration: number;
traceInternals?: boolean;
previousSessionId?: string;
}, sessionOptions: SessionOptions): Session;
//# sourceMappingURL=loadOrCreateSession.d.ts.map
{"version":3,"file":"loadOrCreateSession.d.ts","sourceRoot":"","sources":["../../../../src/session/loadOrCreateSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAMxD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,EACE,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,EAAE;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,EACD,cAAc,EAAE,cAAc,GAC7B,OAAO,CAeT"}
import type { Session } from '../types';
/**
* Save a session to session storage.
*/
export declare function saveSession(session: Session): void;
//# sourceMappingURL=saveSession.d.ts.map
{"version":3,"file":"saveSession.d.ts","sourceRoot":"","sources":["../../../../src/session/saveSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAUlD"}
import type { Sampled, Session } from '../types';
/**
* Get a session with defaults & applied sampling.
*/
export declare function makeSession(session: Partial<Session> & {
sampled: Sampled;
}): Session;
//# sourceMappingURL=Session.d.ts.map
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../src/session/Session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEjD;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAkBrF"}
import type { Session } from '../types';
/** If the session should be refreshed or not. */
export declare function shouldRefreshSession(session: Session, { sessionIdleExpire, maxReplayDuration }: {
sessionIdleExpire: number;
maxReplayDuration: number;
}): boolean;
//# sourceMappingURL=shouldRefreshSession.d.ts.map
{"version":3,"file":"shouldRefreshSession.d.ts","sourceRoot":"","sources":["../../../../src/session/shouldRefreshSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,iDAAiD;AACjD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACjG,OAAO,CAYT"}
export * from './performance';
export * from './replay';
export * from './replayFrame';
export * from './request';
export * from './rrweb';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
import type { ReplayNetworkRequestOrResponse } from './request';
export type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
export type PerformancePaintTiming = PerformanceEntry;
export type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
type: string;
transferSize: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "interactive".
*/
domInteractive: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's DOMContentLoaded event handler starts.
*/
domContentLoadedEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's DOMContentLoaded event handler completes.
*/
domContentLoadedEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the current
* document's load event handler starts.
*/
loadEventStart: number;
/**
* A DOMHighResTimeStamp representing the time immediately after the current
* document's load event handler completes.
*/
loadEventEnd: number;
/**
* A DOMHighResTimeStamp representing the time immediately before the user agent
* sets the document's readyState to "complete".
*/
domComplete: number;
/**
* A number representing the number of redirects since the last non-redirect
* navigation in the current browsing context.
*/
redirectCount: number;
};
export type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
responseStatus?: number;
};
export type PaintData = undefined;
/**
* See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
*
* Note `navigation.push` will not have any data
*/
export type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
/**
* Transfer size of resource
*/
size?: number;
};
export type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
/**
* Transfer size of resource
*/
size: number;
/**
* HTTP status code. Note this is experimental and not available on all browsers.
*/
statusCode?: number;
};
export interface LargestContentfulPaintData {
/**
* Render time (in ms) of the LCP
*/
value: number;
size: number;
/**
* The recording id of the LCP node. -1 if not found
*/
nodeId?: number;
}
/**
* Entries that come from window.performance
*/
export type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | LargestContentfulPaintData;
export interface MemoryData {
memory: {
jsHeapSizeLimit: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
};
}
export interface NetworkRequestData {
method?: string;
statusCode?: number;
requestBodySize?: number;
responseBodySize?: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
}
export interface HistoryData {
previous: string | undefined;
}
export type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
export interface ReplayPerformanceEntry<T> {
/**
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
*/
type: string;
/**
* A more specific description of the performance entry
*/
name: string;
/**
* The start timestamp in seconds
*/
start: number;
/**
* The end timestamp in seconds
*/
end: number;
/**
* Additional unstructured data to be included
*/
data: T;
}
//# sourceMappingURL=performance.d.ts.map
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../src/types/performance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,GAAG,yBAAyB,GAAG,2BAA2B,CAAC;AAInH,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AACtD,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GACxD,yBAAyB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AACJ,MAAM,MAAM,qCAAqC,GAAG,yBAAyB,GAAG;IAG9E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF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;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,uBAAuB,GAAG,UAAU,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAEnG,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;CACT"}
import type { Breadcrumb, ErrorEvent, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Span, XhrBreadcrumbHint } from '@sentry/types';
import type { SKIPPED, THROTTLED } from '../util/throttle';
import type { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance';
import type { ReplayFrameEvent } from './replayFrame';
import type { ReplayNetworkRequestOrResponse } from './request';
import type { CanvasManagerInterface, CanvasManagerOptions, ReplayEventWithTime, RrwebRecordOptions } from './rrweb';
export type RecordingEvent = ReplayFrameEvent | ReplayEventWithTime;
export type RecordingOptions = RrwebRecordOptions;
export interface SendReplayData {
recordingData: ReplayRecordingData;
replayId: string;
segmentId: number;
eventContext: PopEventContext;
timestamp: number;
session: Session;
options: ReplayPluginOptions;
}
export interface Timeouts {
sessionIdlePause: number;
sessionIdleExpire: number;
}
/**
* The request payload to worker
*/
export interface WorkerRequest {
id: number;
method: 'clear' | 'addEvent' | 'finish';
arg?: string;
}
/**
* The response from the worker
*/
export interface WorkerResponse {
id: number;
method: string;
success: boolean;
response: unknown;
}
export type AddEventResult = void;
export interface BeforeAddRecordingEvent {
(event: ReplayFrameEvent): ReplayFrameEvent | null | undefined;
}
export interface ReplayNetworkOptions {
/**
* Capture request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will match any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
*
* Only URLs matching these patterns will have bodies & additional headers captured.
*/
networkDetailAllowUrls: (string | RegExp)[];
/**
* Deny request/response details for XHR/Fetch requests that match the given URLs.
* The URLs can be strings or regular expressions.
* When provided a string, we will deny any URL that contains the given string.
* You can use a Regex to handle exact matches or more complex matching.
* URLs matching these patterns will not have bodies & additional headers captured.
*/
networkDetailDenyUrls: (string | RegExp)[];
/**
* If request & response bodies should be captured.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Defaults to true.
*/
networkCaptureBodies: boolean;
/**
* Capture the following request headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkRequestHeaders: string[];
/**
* Capture the following response headers, in addition to the default ones.
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
* Any headers defined here will be captured in addition to the default headers.
*/
networkResponseHeaders: string[];
}
export interface ReplayPluginOptions extends ReplayNetworkOptions {
/**
* The sample rate for session-long replays. 1.0 will record all sessions and
* 0 will record none.
*/
sessionSampleRate: number;
/**
* The sample rate for sessions that has had an error occur. This is
* independent of `sessionSampleRate`.
*/
errorSampleRate: number;
/**
* If false, will create a new session per pageload. Otherwise, saves session
* to Session Storage.
*/
stickySession: boolean;
/**
* The amount of time to wait before sending a replay
*/
flushMinDelay: number;
/**
* The max amount of time to wait before sending a replay
*/
flushMaxDelay: number;
/**
* Attempt to use compression when web workers are available
*
* (default is true)
*/
useCompression: boolean;
/**
* If defined, use this worker URL instead of the default included one for compression.
* This will only be used if `useCompression` is not false.
*/
workerUrl?: string;
/**
* Block all media (e.g. images, svg, video) in recordings.
*/
blockAllMedia: boolean;
/**
* Mask all inputs in recordings
*/
maskAllInputs: boolean;
/**
* Mask all text in recordings
*/
maskAllText: boolean;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will create
* a breadcrumb in the recording when the limit has been reached.
*/
mutationBreadcrumbLimit: number;
/**
* A high number of DOM mutations (in a single event loop) can cause
* performance regressions in end-users' browsers. This setting will cause
* recording to stop when the limit has been reached.
*/
mutationLimit: number;
/**
* The max. time in ms to wait for a slow click to finish.
* After this amount of time we stop waiting for actions after a click happened.
* Set this to 0 to disable slow click capture.
*
* Default: 7000ms
*/
slowClickTimeout: number;
/**
* Ignore clicks on elements matching the given selectors for slow click detection.
*/
slowClickIgnoreSelectors: string[];
/**
* The min. duration (in ms) a replay has to have before it is sent to Sentry.
* Whenever attempting to flush a session that is shorter than this, it will not actually send it to Sentry.
* Note that this is capped at max. 15s.
*/
minReplayDuration: number;
/**
* The max. duration (in ms) a replay session may be.
* This is capped at max. 60min.
*/
maxReplayDuration: number;
/**
* Callback before adding a custom recording event
*
* Events added by the underlying DOM recording library can *not* be modified,
* only custom recording events from the Replay integration will trigger the
* callback listeners. This can be used to scrub certain fields in an event (e.g. URLs from navigation events).
*
* Returning a `null` will drop the event completely. Note, dropping a recording
* event is not the same as dropping the replay, the replay will still exist and
* continue to function.
*/
beforeAddRecordingEvent?: BeforeAddRecordingEvent;
/**
* An optional callback to be called before we decide to sample based on an error.
* If specified, this callback will receive an error that was captured by Sentry.
* Return `true` to continue sampling for this error, or `false` to ignore this error for replay sampling.
* Note that returning `true` means that the `replaysOnErrorSampleRate` will be checked,
* not that it will definitely be sampled.
* Use this to filter out groups of errors that should def. not be sampled.
*/
beforeErrorSampling?: (event: ErrorEvent) => boolean;
/**
* _experiments allows users to enable experimental or internal features.
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
* Experimental features can be added, changed or removed at any time.
*
* Default: undefined
*/
_experiments: Partial<{
captureExceptions: boolean;
traceInternals: boolean;
}>;
}
/**
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`.
*/
export type InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>;
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & {
/**
* Mask element attributes that are contained in list
*/
maskAttributes?: string[];
};
/**
* Session options that are configurable by the integration configuration
*/
export interface SessionOptions extends Pick<ReplayPluginOptions, 'sessionSampleRate' | 'stickySession'> {
/**
* Should buffer recordings to be saved later either by error sampling, or by
* manually calling `flush()`. This is only a factor if not sampled for a
* session-based replay.
*/
allowBuffering: boolean;
}
export interface ReplayIntegrationPrivacyOptions {
/**
* Mask text content for elements that match the CSS selectors in the list.
*/
mask?: string[];
/**
* Unmask text content for elements that match the CSS selectors in the list.
*/
unmask?: string[];
/**
* Block elements that match the CSS selectors in the list. Blocking replaces
* the element with an empty placeholder with the same dimensions.
*/
block?: string[];
/**
* Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
*/
unblock?: string[];
/**
* Ignore input events for elements that match the CSS selectors in the list.
*/
ignore?: string[];
/**
* A callback function to customize how your text is masked.
*/
maskFn?: (s: string) => string;
}
export interface DeprecatedPrivacyOptions {
/**
* @deprecated Use `block` which accepts an array of CSS selectors
*/
blockSelector?: RecordingOptions['blockSelector'];
/**
* @deprecated Use `block` which accepts an array of CSS selectors
*/
blockClass?: RecordingOptions['blockClass'];
/**
* @deprecated Use `ignore` which accepts an array of CSS selectors
*/
ignoreClass?: RecordingOptions['ignoreClass'];
/**
* @deprecated Use `mask` which accepts an array of CSS selectors
*/
maskInputOptions?: RecordingOptions['maskInputOptions'];
/**
* @deprecated Use `mask` which accepts an array of CSS selectors
*/
maskTextClass?: RecordingOptions['maskTextClass'];
/**
* @deprecated Use `mask` which accepts an array of CSS selectors
*/
maskTextSelector?: RecordingOptions['maskTextSelector'];
}
export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, DeprecatedPrivacyOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
}
interface CommonEventContext {
/**
* The initial URL of the session
*/
initialUrl: string;
/**
* The initial starting timestamp in ms of the session.
*/
initialTimestamp: number;
/**
* Ordered list of URLs that have been visited during a replay segment
*/
urls: string[];
}
export interface PopEventContext extends CommonEventContext {
/**
* List of Sentry error ids that have occurred during a replay segment
*/
errorIds: Array<string>;
/**
* List of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Array<string>;
}
/**
* Additional context that will be sent w/ `replay_event`
*/
export interface InternalEventContext extends CommonEventContext {
/**
* Set of Sentry error ids that have occurred during a replay segment
*/
errorIds: Set<string>;
/**
* Set of Sentry trace ids that have occurred during a replay segment
*/
traceIds: Set<string>;
}
export type Sampled = false | 'session' | 'buffer';
export interface Session {
id: string;
/**
* Start time of current session (in ms)
*/
started: number;
/**
* Last known activity of the session (in ms)
*/
lastActivity: number;
/**
* Segment ID for replay events
*/
segmentId: number;
/**
* The ID of the previous session.
* If this is empty, there was no previous session.
*/
previousSessionId?: string;
/**
* Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer`
*/
sampled: Sampled;
}
export type EventBufferType = 'sync' | 'worker';
export interface EventBuffer {
/**
* If any events have been added to the buffer.
*/
readonly hasEvents: boolean;
/**
* The buffer type
*/
readonly type: EventBufferType;
/**
* If the event buffer contains a checkout event.
*/
hasCheckout: boolean;
/**
* Destroy the event buffer.
*/
destroy(): void;
/**
* Clear the event buffer.
*/
clear(): void;
/**
* Add an event to the event buffer.
*
* Returns a promise that resolves if the event was successfully added, else rejects.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/**
* Clears and returns the contents of the buffer.
*/
finish(): Promise<ReplayRecordingData>;
/**
* Get the earliest timestamp in ms of any event currently in the buffer.
*/
getEarliestTimestamp(): number | null;
}
export type AddUpdateCallback = () => boolean | void;
export interface SendBufferedReplayOptions {
continueRecording?: boolean;
}
export interface ReplayClickDetector {
addListeners(): void;
removeListeners(): void;
/** Handle a click breadcrumb. */
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
/** Register a mutation that happened at a given time. */
registerMutation(timestamp?: number): void;
/** Register a scroll that happened at a given time. */
registerScroll(timestamp?: number): void;
/** Register that a click on an element happened. */
registerClick(element: HTMLElement): void;
}
export interface ReplayContainer {
eventBuffer: EventBuffer | null;
clickDetector: ReplayClickDetector | undefined;
/**
* List of PerformanceEntry from PerformanceObservers.
*/
performanceEntries: AllPerformanceEntry[];
/**
* List of already processed performance data, ready to be added to replay.
*/
replayPerformanceEntries: ReplayPerformanceEntry<AllPerformanceEntryData>[];
session: Session | undefined;
recordingMode: ReplayRecordingMode;
timeouts: Timeouts;
lastActiveSpan?: Span;
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
isEnabled(): boolean;
isPaused(): boolean;
isRecordingCanvas(): boolean;
getContext(): InternalEventContext;
initializeSampling(): void;
start(): void;
stop(options?: {
reason?: string;
forceflush?: boolean;
}): Promise<void>;
pause(): void;
resume(): void;
startRecording(): void;
stopRecording(): boolean;
sendBufferedReplayOrFlush(options?: SendBufferedReplayOptions): Promise<void>;
conditionalFlush(): Promise<void>;
flush(): Promise<void>;
flushImmediate(): Promise<void>;
cancelFlush(): void;
triggerUserActivity(): void;
updateUserActivity(): void;
addUpdate(cb: AddUpdateCallback): void;
getOptions(): ReplayPluginOptions;
getSessionId(): string | undefined;
checkAndHandleExpiredSession(): boolean | void;
setInitialState(): void;
getCurrentRoute(): string | undefined;
}
type RequestBody = null | Blob | BufferSource | FormData | URLSearchParams | string;
export type XhrHint = XhrBreadcrumbHint & {
xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;
input?: RequestBody;
};
export type FetchHint = FetchBreadcrumbHint & {
input: HandlerDataFetch['args'];
response: Response;
};
export type ReplayNetworkRequestData = {
startTimestamp: number;
endTimestamp: number;
url: string;
method?: string;
statusCode: number;
request?: ReplayNetworkRequestOrResponse;
response?: ReplayNetworkRequestOrResponse;
};
export interface SlowClickConfig {
threshold: number;
timeout: number;
scrollTimeout: number;
ignoreSelector: string;
}
export interface ReplayCanvasIntegrationOptions {
enableManualSnapshot?: boolean;
recordCanvas: true;
getCanvasManager: (options: CanvasManagerOptions) => CanvasManagerInterface;
sampling: {
canvas: number;
};
dataURLOptions: {
type: string;
quality: number;
};
}
export {};
//# sourceMappingURL=replay.d.ts.map
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../../src/types/replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,IAAI,EACJ,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAErH,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,mBAAmB,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,eAAe,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,MAAM,WAAW,QAAQ;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MA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AC3C,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,EAAE,IAAI,CAAC;IACnB,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,sBAAsB,CAAC;IAC5E,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
import type { Breadcrumb } from '@sentry/types';
import type { HistoryData, LargestContentfulPaintData, MemoryData, NavigationData, NetworkRequestData, PaintData, ResourceData } from './performance';
import type { ReplayEventTypeCustom } from './rrweb';
type AnyRecord = Record<string, any>;
interface ReplayBaseBreadcrumbFrame {
timestamp: number;
/**
* For compatibility reasons
*/
type: string;
category: string;
data?: AnyRecord;
message?: string;
}
interface ReplayBaseDomFrameData {
nodeId?: number;
node?: {
id: number;
tagName: string;
textContent: string;
attributes: AnyRecord;
};
}
interface ReplayConsoleFrameData {
logger: string;
arguments?: unknown[];
}
interface ReplayConsoleFrame extends ReplayBaseBreadcrumbFrame {
category: 'console';
level: Breadcrumb['level'];
message: string;
data: ReplayConsoleFrameData;
}
type ReplayClickFrameData = ReplayBaseDomFrameData;
interface ReplayClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.click';
message: string;
data: ReplayClickFrameData;
}
interface ReplayInputFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.input';
message: string;
}
interface ReplayMutationFrameData {
count: number;
limit: boolean;
}
interface ReplayMutationFrame extends ReplayBaseBreadcrumbFrame {
category: 'replay.mutations';
data: ReplayMutationFrameData;
}
interface ReplayKeyboardEventFrameData extends ReplayBaseDomFrameData {
metaKey: boolean;
shiftKey: boolean;
ctrlKey: boolean;
altKey: boolean;
key: string;
}
interface ReplayKeyboardEventFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.keyDown';
data: ReplayKeyboardEventFrameData;
}
interface ReplayBlurFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.blur';
}
interface ReplayFocusFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.focus';
}
interface ReplaySlowClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
timeAfterClickMs: number;
endReason: string;
clickCount?: number;
}
export interface ReplaySlowClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.slowClickDetected';
data: ReplaySlowClickFrameData;
}
interface ReplayMultiClickFrameData extends ReplayClickFrameData {
url: string;
route?: string;
clickCount: number;
metric: true;
}
export interface ReplayMultiClickFrame extends ReplayBaseBreadcrumbFrame {
category: 'ui.multiClick';
data: ReplayMultiClickFrameData;
}
interface ReplayOptionFrame {
blockAllMedia: boolean;
errorSampleRate: number;
maskAllInputs: boolean;
maskAllText: boolean;
networkCaptureBodies: boolean;
networkDetailHasUrls: boolean;
networkRequestHasHeaders: boolean;
networkResponseHasHeaders: boolean;
sessionSampleRate: number;
shouldRecordCanvas: boolean;
useCompression: boolean;
useCompressionOption: boolean;
}
interface ReplayFeedbackFrameData {
feedbackId: string;
}
interface ReplayFeedbackFrame extends ReplayBaseBreadcrumbFrame {
category: 'sentry.feedback';
data: ReplayFeedbackFrameData;
}
export type ReplayBreadcrumbFrame = ReplayConsoleFrame | ReplayClickFrame | ReplayInputFrame | ReplayKeyboardEventFrame | ReplayBlurFrame | ReplayFocusFrame | ReplaySlowClickFrame | ReplayMultiClickFrame | ReplayMutationFrame | ReplayFeedbackFrame | ReplayBaseBreadcrumbFrame;
interface ReplayBaseSpanFrame {
op: string;
description: string;
startTimestamp: number;
endTimestamp: number;
data?: undefined | AnyRecord;
}
interface ReplayHistoryFrame extends ReplayBaseSpanFrame {
data: HistoryData;
op: 'navigation.push';
}
interface ReplayLargestContentfulPaintFrame extends ReplayBaseSpanFrame {
data: LargestContentfulPaintData;
op: 'largest-contentful-paint';
}
interface ReplayMemoryFrame extends ReplayBaseSpanFrame {
data: MemoryData;
op: 'memory';
}
interface ReplayNavigationFrame extends ReplayBaseSpanFrame {
data: NavigationData;
op: 'navigation.navigate' | 'navigation.reload' | 'navigation.back_forward';
}
interface ReplayPaintFrame extends ReplayBaseSpanFrame {
data: PaintData;
op: 'paint';
}
interface ReplayRequestFrame extends ReplayBaseSpanFrame {
data: NetworkRequestData;
op: 'resource.fetch' | 'resource.xhr';
}
interface ReplayResourceFrame extends ReplayBaseSpanFrame {
data: ResourceData;
op: 'resource.css' | 'resource.iframe' | 'resource.img' | 'resource.link' | 'resource.other' | 'resource.script';
}
export type ReplaySpanFrame = ReplayBaseSpanFrame | ReplayHistoryFrame | ReplayRequestFrame | ReplayLargestContentfulPaintFrame | ReplayMemoryFrame | ReplayNavigationFrame | ReplayPaintFrame | ReplayResourceFrame;
export type ReplayFrame = ReplayBreadcrumbFrame | ReplaySpanFrame;
interface RecordingCustomEvent {
type: typeof ReplayEventTypeCustom;
timestamp: number;
data: {
tag: string;
payload: unknown;
};
}
export interface ReplayBreadcrumbFrameEvent extends RecordingCustomEvent {
data: {
tag: 'breadcrumb';
payload: ReplayBreadcrumbFrame;
/**
* This will indicate to backend to additionally log as a metric
*/
metric?: boolean;
};
}
export interface ReplaySpanFrameEvent extends RecordingCustomEvent {
data: {
tag: 'performanceSpan';
payload: ReplaySpanFrame;
};
}
export interface ReplayOptionFrameEvent extends RecordingCustomEvent {
data: {
tag: 'options';
payload: ReplayOptionFrame;
};
}
export type ReplayFrameEvent = ReplayBreadcrumbFrameEvent | ReplaySpanFrameEvent | ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=replayFrame.d.ts.map
{"version":3,"file":"replayFrame.d.ts","sourceRoot":"","sources":["../../../../src/types/replayFrame.ts"],"names":[],"mappings":"AAAA,OAAO,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AAE;QACJ,GAAG,EAAE,iBAAiB,CAAC;QACvB,OAAO,EAAE,eAAe,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,IAAI,EAAE;QACJ,GAAG,EAAE,SAAS,CAAC;QACf,OAAO,EAAE,iBAAiB,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,MAAM,gBAAgB,GAAG,0BAA0B,GAAG,oBAAoB,GAAG,sBAAsB,CAAC"}
type JsonObject = Record<string, unknown>;
type JsonArray = unknown[];
export type NetworkBody = JsonObject | JsonArray | string;
export type NetworkMetaWarning = 'MAYBE_JSON_TRUNCATED' | 'TEXT_TRUNCATED' | 'URL_SKIPPED' | 'BODY_PARSE_ERROR' | 'UNPARSEABLE_BODY_TYPE';
interface NetworkMeta {
warnings?: NetworkMetaWarning[];
}
export interface ReplayNetworkRequestOrResponse {
size?: number;
body?: NetworkBody;
headers: Record<string, string>;
_meta?: NetworkMeta;
}
export {};
//# sourceMappingURL=request.d.ts.map
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/types/request.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1C,KAAK,SAAS,GAAG,OAAO,EAAE,CAAC;AAE3B,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,uBAAuB,CAAC;AAE5B,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB"}
type ClassOption = string | RegExp;
/** Duplicate this from @sentry-internal/rrweb so we can export this as well. */
export declare const ReplayEventTypeDomContentLoaded = 0;
export declare const ReplayEventTypeLoad = 1;
export declare const ReplayEventTypeFullSnapshot = 2;
export declare const ReplayEventTypeIncrementalSnapshot = 3;
export declare const ReplayEventTypeMeta = 4;
export declare const ReplayEventTypeCustom = 5;
export declare const ReplayEventTypePlugin = 6;
export type ReplayEventType = typeof ReplayEventTypeDomContentLoaded | typeof ReplayEventTypeLoad | typeof ReplayEventTypeFullSnapshot | typeof ReplayEventTypeIncrementalSnapshot | typeof ReplayEventTypeMeta | typeof ReplayEventTypeCustom | typeof ReplayEventTypePlugin;
/**
* This is a partial copy of rrweb's eventWithTime type which only contains the properties
* we specifcally need in the SDK.
*/
export type ReplayEventWithTime = {
type: ReplayEventType;
data: unknown;
timestamp: number;
delay?: number;
};
/**
* This is a partial copy of rrweb's recording options which only contains the properties
* we specifically us in the SDK. Users can specify additional properties, hence we add the
* Record<string, unknown> union type.
*/
export type RrwebRecordOptions = {
maskAllText?: boolean;
maskAllInputs?: boolean;
blockClass?: ClassOption;
ignoreClass?: string;
maskTextClass?: ClassOption;
maskTextSelector?: string;
blockSelector?: string;
maskInputOptions?: Record<string, boolean>;
} & Record<string, unknown>;
export interface CanvasManagerInterface {
reset(): void;
freeze(): void;
unfreeze(): void;
lock(): void;
unlock(): void;
snapshot(): void;
}
export interface CanvasManagerOptions {
recordCanvas: boolean;
enableManualSnapshot?: boolean;
blockClass: string | RegExp;
blockSelector: string | null;
unblockSelector: string | null;
sampling?: 'all' | number;
dataURLOptions: Partial<{
type: string;
quality: number;
}>;
mutationCb: (p: any) => void;
win: typeof globalThis & Window;
mirror: any;
}
export {};
//# sourceMappingURL=rrweb.d.ts.map
{"version":3,"file":"rrweb.d.ts","sourceRoot":"","sources":["../../../../src/types/rrweb.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CA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,MAAM,IAAI,IAAI,CAAC;IACf,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,GAAG,EAAE,OAAO,UAAU,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC;CACb"}
import type { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
/**
* Add an event to the event buffer.
* In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.
* Instead this returns `true` if we tried to add the event, else false.
* It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEventSync(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): boolean;
/**
* Add an event to the event buffer.
* Resolves to `null` if no event was added, else to `void`.
*
* `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
*/
export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
/** Exported only for tests. */
export declare function shouldAddEvent(replay: ReplayContainer, event: RecordingEvent): boolean;
//# sourceMappingURL=addEvent.d.ts.map
{"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/addEvent.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAyC,MAAM,UAAU,CAAC;AAQvH;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAU1G;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,cAAc,EACrB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAMhC;AA2CD,+BAA+B;AAC/B,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAyBtF"}
import type { ReplayContainer } from '../types';
/**
* Add global listeners that cannot be removed.
*/
export declare function addGlobalListeners(replay: ReplayContainer): void;
//# sourceMappingURL=addGlobalListeners.d.ts.map
{"version":3,"file":"addGlobalListeners.d.ts","sourceRoot":"","sources":["../../../../src/util/addGlobalListeners.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAmDhE"}
import type { AddEventResult, ReplayContainer } from '../types';
/**
* Create a "span" for the total amount of memory being used by JS objects
* (including v8 internal objects).
*/
export declare function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>>;
//# sourceMappingURL=addMemoryEntry.d.ts.map
{"version":3,"file":"addMemoryEntry.d.ts","sourceRoot":"","sources":["../../../../src/util/addMemoryEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,eAAe,EAA0B,MAAM,UAAU,CAAC;AAWpG;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,CAanG"}
import type { ReplayBreadcrumbFrame } from '../types/replayFrame';
/**
* Create a breadcrumb for a replay.
*/
export declare function createBreadcrumb(breadcrumb: Omit<ReplayBreadcrumbFrame, 'timestamp' | 'type'> & Partial<Pick<ReplayBreadcrumbFrame, 'timestamp'>>): ReplayBreadcrumbFrame;
//# sourceMappingURL=createBreadcrumb.d.ts.map
{"version":3,"file":"createBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/util/createBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC,GAChH,qBAAqB,CAMvB"}
import type { AllPerformanceEntry, AllPerformanceEntryData, LargestContentfulPaintData, ReplayPerformanceEntry } from '../types';
/**
* Create replay performance entries from the browser performance entries.
*/
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry<AllPerformanceEntryData>[];
/**
* Add a LCP event to the replay based on an LCP metric.
*/
export declare function getLargestContentfulPaint(metric: {
value: number;
entries: PerformanceEntry[];
}): ReplayPerformanceEntry<LargestContentfulPaintData>;
//# sourceMappingURL=createPerformanceEntries.d.ts.map
{"version":3,"file":"createPerformanceEntries.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceEntries.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EAEvB,0BAA0B,EAG1B,sBAAsB,EAEvB,MAAM,UAAU,CAAC;AAclB;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,mBAAmB,EAAE,GAC7B,sBAAsB,CAAC,uBAAuB,CAAC,EAAE,CAEnD;AA4GD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B,GAAG,sBAAsB,CAAC,0BAA0B,CAAC,CAsBrD"}
import type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/**
* Create a "span" for each performance entry.
*/
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
//# sourceMappingURL=createPerformanceSpans.d.ts.map
{"version":3,"file":"createPerformanceSpans.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceSpans.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEtG;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,CAAC,YAAY,CAAC,EAAE,GAC9C,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAoBlC"}
import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
/**
* Create a replay envelope ready to be sent.
* This includes both the replay event, as well as the recording data.
*/
export declare function createReplayEnvelope(replayEvent: ReplayEvent, recordingData: ReplayRecordingData, dsn: DsnComponents, tunnel?: string): ReplayEnvelope;
//# sourceMappingURL=createReplayEnvelope.d.ts.map
{"version":3,"file":"createReplayEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/util/createReplayEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGrG;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,mBAAmB,EAClC,GAAG,EAAE,aAAa,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAkBhB"}
type DebouncedCallback = {
(): void | unknown;
flush: () => void | unknown;
cancel: () => void;
};
type CallbackFunction = () => unknown;
type DebounceOptions = {
maxWait?: number;
};
/**
* Heavily simplified debounce function based on lodash.debounce.
*
* This function takes a callback function (@param fun) and delays its invocation
* by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
* which ensures that the callback is invoked at least once after the specified max. wait time.
*
* @param func the function whose invocation is to be debounced
* @param wait the minimum time until the function is invoked after it was called once
* @param options the options object, which can contain the `maxWait` property
*
* @returns the debounced version of the function, which needs to be called at least once to start the
* debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
* was already invoked in the meantime, return @param func's return value.
* The debounced function has two additional properties:
* - `flush`: Invokes the debounced function immediately and returns its return value
* - `cancel`: Cancels the debouncing process and resets the debouncing timer
*/
export declare function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback;
export {};
//# sourceMappingURL=debounce.d.ts.map
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../src/util/debounce.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,IAAI,IAAI,GAAG,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AACF,KAAK,gBAAgB,GAAG,MAAM,OAAO,CAAC;AACtC,KAAK,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,iBAAiB,CA2C3G"}
import type { ErrorEvent, Event, FeedbackEvent, ReplayEvent, TransactionEvent } from '@sentry/types';
/** If the event is an error event */
export declare function isErrorEvent(event: Event): event is ErrorEvent;
/** If the event is a transaction event */
export declare function isTransactionEvent(event: Event): event is TransactionEvent;
/** If the event is an replay event */
export declare function isReplayEvent(event: Event): event is ReplayEvent;
/** If the event is a feedback event */
export declare function isFeedbackEvent(event: Event): event is FeedbackEvent;
//# sourceMappingURL=eventUtils.d.ts.map
{"version":3,"file":"eventUtils.d.ts","sourceRoot":"","sources":["../../../../src/util/eventUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAErG,qCAAqC;AACrC,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,UAAU,CAE9D;AAED,0CAA0C;AAC1C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,gBAAgB,CAE1E;AAED,sCAAsC;AACtC,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,WAAW,CAEhE;AAED,uCAAuC;AACvC,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAEpE"}
import type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';
type GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> & Omit<DeprecatedPrivacyOptions, 'maskInputOptions'>;
interface GetPrivacyReturn {
maskTextSelector: string;
unmaskTextSelector: string;
blockSelector: string;
unblockSelector: string;
ignoreSelector: string;
blockClass?: RegExp;
maskTextClass?: RegExp;
}
/**
* Returns privacy related configuration for use in rrweb
*/
export declare function getPrivacyOptions({ mask, unmask, block, unblock, ignore, blockClass, blockSelector, maskTextClass, maskTextSelector, ignoreClass, }: GetPrivacyOptions): GetPrivacyReturn;
export {};
//# sourceMappingURL=getPrivacyOptions.d.ts.map
{"version":3,"file":"getPrivacyOptions.d.ts","sourceRoot":"","sources":["../../../../src/util/getPrivacyOptions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAE1F,KAAK,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,GAChF,IAAI,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AACrD,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAqCD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,OAAO,EACP,MAAM,EAGN,UAAU,EAEV,aAAa,EAEb,aAAa,EAEb,gBAAgB,EAEhB,WAAW,GACZ,EAAE,iBAAiB,GAAG,gBAAgB,CA8BtC"}
import type { replayIntegration } from '../integration';
/**
* This is a small utility to get a type-safe instance of the Replay integration.
*/
export declare function getReplay(): ReturnType<typeof replayIntegration> | undefined;
//# sourceMappingURL=getReplay.d.ts.map
{"version":3,"file":"getReplay.d.ts","sourceRoot":"","sources":["../../../../src/util/getReplay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,wBAAgB,SAAS,IAAI,UAAU,CAAC,OAAO,iBAAiB,CAAC,GAAG,SAAS,CAG5E"}
import type { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';
type RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;
/**
* Handler for recording events.
*
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
*/
export declare function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback;
/**
* Exported for tests
*/
export declare function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent;
export {};
//# sourceMappingURL=handleRecordingEmit.d.ts.map
{"version":3,"file":"handleRecordingEmit.d.ts","sourceRoot":"","sources":["../../../../src/util/handleRecordingEmit.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIxF,KAAK,qBAAqB,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAEnF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,qBAAqB,CA8FrF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,sBAAsB,CAuBlF"}
/** If sessionStorage is available. */
export declare function hasSessionStorage(): boolean;
//# sourceMappingURL=hasSessionStorage.d.ts.map
{"version":3,"file":"hasSessionStorage.d.ts","sourceRoot":"","sources":["../../../../src/util/hasSessionStorage.ts"],"names":[],"mappings":"AAEA,sCAAsC;AACtC,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C"}
/**
* Given an initial timestamp and an expiry duration, checks to see if current
* time should be considered as expired.
*/
export declare function isExpired(initialTime: null | number, expiry: undefined | number, targetTime?: number): boolean;
//# sourceMappingURL=isExpired.d.ts.map
{"version":3,"file":"isExpired.d.ts","sourceRoot":"","sources":["../../../../src/util/isExpired.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,IAAI,GAAG,MAAM,EAC1B,MAAM,EAAE,SAAS,GAAG,MAAM,EAC1B,UAAU,GAAE,MAAoB,GAC/B,OAAO,CAYT"}
import type { Event, EventHint } from '@sentry/types';
/**
* Returns true if we think the given event is an error originating inside of rrweb.
*/
export declare function isRrwebError(event: Event, hint: EventHint): boolean;
//# sourceMappingURL=isRrwebError.d.ts.map
{"version":3,"file":"isRrwebError.d.ts","sourceRoot":"","sources":["../../../../src/util/isRrwebError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAWnE"}
/**
* Given a sample rate, returns true if replay should be sampled.
*
* 1.0 = 100% sampling
* 0.0 = 0% sampling
*/
export declare function isSampled(sampleRate?: number): boolean;
//# sourceMappingURL=isSampled.d.ts.map
{"version":3,"file":"isSampled.d.ts","sourceRoot":"","sources":["../../../../src/util/isSampled.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAOtD"}
import type { Session } from '../types';
/**
* Checks to see if session is expired
*/
export declare function isSessionExpired(session: Session, { maxReplayDuration, sessionIdleExpire, targetTime, }: {
maxReplayDuration: number;
sessionIdleExpire: number;
targetTime?: number;
}): boolean;
//# sourceMappingURL=isSessionExpired.d.ts.map
{"version":3,"file":"isSessionExpired.d.ts","sourceRoot":"","sources":["../../../../src/util/isSessionExpired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,EACE,iBAAiB,EACjB,iBAAiB,EACjB,UAAuB,GACxB,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,OAAO,CAQT"}
/**
* Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.
*/
export declare function logInfo(message: string, shouldAddBreadcrumb?: boolean): void;
/**
* Log a message, and add a breadcrumb in the next tick.
* This is necessary when the breadcrumb may be added before the replay is initialized.
*/
export declare function logInfoNextTick(message: string, shouldAddBreadcrumb?: boolean): void;
//# sourceMappingURL=log.d.ts.map
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/util/log.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CAU5E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CAcpF"}
import type { getPrivacyOptions } from './getPrivacyOptions';
interface MaskAttributeParams {
maskAttributes: string[];
maskAllText: boolean;
privacyOptions: ReturnType<typeof getPrivacyOptions>;
key: string;
value: string;
el: HTMLElement;
}
/**
* Masks an attribute if necessary, otherwise return attribute value as-is.
*/
export declare function maskAttribute({ el, key, maskAttributes, maskAllText, privacyOptions, value, }: MaskAttributeParams): string;
export {};
//# sourceMappingURL=maskAttribute.d.ts.map
{"version":3,"file":"maskAttribute.d.ts","sourceRoot":"","sources":["../../../../src/util/maskAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,WAAW,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,GAAG,EACH,cAAc,EACd,WAAW,EACX,cAAc,EACd,KAAK,GACN,EAAE,mBAAmB,GAAG,MAAM,CAqB9B"}
import type { ReplayRecordingData } from '@sentry/types';
/**
* Prepare the recording data ready to be sent.
*/
export declare function prepareRecordingData({ recordingData, headers, }: {
recordingData: ReplayRecordingData;
headers: Record<string, unknown>;
}): ReplayRecordingData;
//# sourceMappingURL=prepareRecordingData.d.ts.map
{"version":3,"file":"prepareRecordingData.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareRecordingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,OAAO,GACR,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GAAG,mBAAmB,CAoBtB"}
import type { IntegrationIndex } from '@sentry/core';
import type { Client, ReplayEvent, Scope } from '@sentry/types';
/**
* Prepare a replay event & enrich it with the SDK metadata.
*/
export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
client: Client & {
_integrations?: IntegrationIndex;
};
scope: Scope;
replayId: string;
event: ReplayEvent;
}): Promise<ReplayEvent | null>;
//# sourceMappingURL=prepareReplayEvent.d.ts.map
{"version":3,"file":"prepareReplayEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareReplayEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAa,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3E;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,QAAQ,EAAE,QAAQ,EAClB,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,GAAG;QAAE,aAAa,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IACtD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAwC9B"}
import type { SendReplayData } from '../types';
/**
* Finalize and send the current replay event to Sentry
*/
export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
count: number;
interval: number;
}): Promise<unknown>;
//# sourceMappingURL=sendReplay.d.ts.map
{"version":3,"file":"sendReplay.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplay.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,cAAc,EAC1B,WAAW;;;CAGV,GACA,OAAO,CAAC,OAAO,CAAC,CAuDlB"}
import type { TransportMakeRequestResponse } from '@sentry/types';
import type { RateLimits } from '@sentry/utils';
import type { SendReplayData } from '../types';
/**
* Send replay attachment using `fetch()`
*/
export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, eventContext, timestamp, session, }: SendReplayData): Promise<TransportMakeRequestResponse>;
/**
* This error indicates that the transport returned an invalid status code.
*/
export declare class TransportStatusCodeError extends Error {
constructor(statusCode: number);
}
/**
* This error indicates that we hit a rate limit API error.
*/
export declare class RateLimitError extends Error {
rateLimits: RateLimits;
constructor(rateLimits: RateLimits);
}
//# sourceMappingURL=sendReplayRequest.d.ts.map
{"version":3,"file":"sendReplayRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplayRequest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,aAAa,EACb,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,YAAY,EACZ,SAAS,EACT,OAAO,GACR,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CA8GxD;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBAC9B,UAAU,EAAE,MAAM;CAGtC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAChC,UAAU,EAAE,UAAU,CAAC;gBAEX,UAAU,EAAE,UAAU;CAI1C"}
import type { ReplayContainer } from '../types';
/**
* Check whether a given request URL should be filtered out. This is so we
* don't log Sentry ingest requests.
*/
export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
//# sourceMappingURL=shouldFilterRequest.d.ts.map
{"version":3,"file":"shouldFilterRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/shouldFilterRequest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOjF"}
export declare const THROTTLED = "__THROTTLED";
export declare const SKIPPED = "__SKIPPED";
/**
* Create a throttled function off a given function.
* When calling the throttled function, it will call the original function only
* if it hasn't been called more than `maxCount` times in the last `durationSeconds`.
*
* Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,
* or else the return value of the original function.
*/
export declare function throttle<T extends (...rest: any[]) => any>(fn: T, maxCount: number, durationSeconds: number): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED;
//# sourceMappingURL=throttle.d.ts.map
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../../src/util/throttle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC;;;;;;;GAOG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,SAAS,GAAG,OAAO,OAAO,CAsC/E"}
/**
* Converts a timestamp to ms, if it was in s, or keeps it as ms.
*/
export declare function timestampToMs(timestamp: number): number;
/**
* Converts a timestamp to s, if it was in ms, or keeps it as s.
*/
export declare function timestampToS(timestamp: number): number;
//# sourceMappingURL=timestamp.d.ts.map
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../src/util/timestamp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGtD"}