Socket
Socket
Sign inDemoInstall

@heimdallr-sdk/history

Package Overview
Dependencies
2
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.14 to 0.0.15

2

dist/history.iife.js

@@ -1,1 +0,1 @@

var HEIMDALLR_HISTORY=function(){"use strict";var e,r,t,o,n,E,a,i,c,R,O,s,C,l,u,T,S,A,I,p,L,h,f,d,D,x,N,m,U,w,M,g,y,P,v,F,H,b,G,Y,B,_,j,K,k,W;(e||(e={})).NAME="@heimdallr-sdk","[".concat(e.NAME,"]:"),(t=r||(r={})).FATAL="fatal",t.ERROR="error",t.WARN="warn",t.INFO="info",t.DEBUG="debug",(n=o||(o={})).SESSION="HEIMDALLR_SDK_SESSION_ID",n.APP="HEIMDALLR_SDK_APP_ID",(a=E||(E={})).GET="GET",a.POST="POST",a.PUT="PUT",a.DELETE="DELETE",(c=i||(i={})).API="api",c.DOM="dom",c.PERFORMANCE="performance",c.ROUTE="route",c.ERROR="error",c.CONSOLE="console",c.CUSTOMER="customer",c.VUE="vue",c.LIFECYCLE="lifeCycle",c.EXTEND="extend",c.RECORD="record",(O=R||(R={})).CODEERROR="code",O.RESOURCEERROR="resource",O.UNHANDLEDREJECTION="unhandledrejection",O.PAGECRASH="pageCrash",(C=s||(s={})).UNCAUGHTEXCEPTION="uncaughtException",C.UNHANDLEDREJECTION="unhandledrejection",(l||(l={})).UNCAUGHTEXCEPTION="uncaughtException",(u||(u={})).CLICK="click",(S=T||(T={})).LOG="log",S.INFO="info",S.WARN="warn",S.ERROR="error",S.ASSERT="assert",(I=A||(A={})).FETCH="fetch",I.XHR="xhr",(L=p||(p={})).FMP="fmp",L.FPS="fps",L.BASIC="basic",L.VITALS="vitals",L.RESOURCE="resource",(f=h||(h={})).HASH="hash",f.HISTORY="history",(d||(d={})).CUSTOMER="customer",(x=D||(D={})).LOCAL="local",x.SESSION="session",x.COOKIE="cookie",x.GLOBAL="global",(m=N||(N={})).BEACON="beacon",m.IMG="img",m.GET="get",(w=U||(U={})).LOAD="enter",w.UNLOAD="leave",(g=M||(M={})).MOBILE="mobile",g.PC="pc",(y||(y={})).ERROR="error",(v=P||(P={})).BROWSER="browser",v.NODE="nodejs",v.WECHAT="wechat",(F||(F={})).SESSION="session",(b=H||(H={})).ROUTE="Route",b.CLICK="UI.Click",b.CONSOLE="Console",b.XHR="Xhr",b.FETCH="Fetch",b.UNHANDLEDREJECTION="Unhandledrejection",b.RESOURCE="Resource",b.CODE_ERROR="CodeError",b.CUSTOMER="Customer",b.FRAMEWORK="Framework",b.LIFECYCLE="LifeCycle",b.CRASH="Crash",(Y=G||(G={})).API="Api",Y.ROUTE="Route",Y.CLICK="UI.Click",Y.ERROR="Error",Y.LIFECYCLE="LifeCycle",Y.CUSTOMER="Customer",(_=B||(B={})).SWITCHTAB="switchTab",_.RELAUNCH="reLaunch",_.REDIRECTTO="redirectTo",_.NAVIGATETO="navigateTo",_.NAVIGATEBACK="navigateBack",_.NAVIGATETOMINIPROGRAM="navigateToMiniProgram",_.ROUTEFAIL="routeFail",(K=j||(j={})).REQUEST="request",K.DOWNLOADFILE="downloadFile",K.UPLOADFILE="uploadFile",(W=k||(k={})).BASIC="basic",W.RESOURCE="resource",W.FMP="fmp",W.FPS="fps",W.VITALS="vitals";var V=function(e,r){void 0===e&&(e="Y-M-D h:m:s"),void 0===r&&(r=Date.now());var t=new Date(r||Date.now()),o={Y:"".concat(t.getFullYear()),M:"".concat(t.getMonth()+1),D:"".concat(t.getDate()),h:t.getHours(),m:t.getMinutes(),s:t.getSeconds()},n=function(e){return e>10?e:"0"+e};return(e||"Y-M-D h:m:s").replace("Y",o.Y).replace("M",o.M).replace("D",o.D).replace("h",n(o.h)).replace("m",n(o.m)).replace("s",n(o.s))};function X(e,r,t,o){if(void 0!==e&&(r in e||o)){var n=t(e[r]);"function"==typeof n&&(e[r]=n)}}var J=Object.defineProperty,$=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,z=(e,r,t)=>r in e?J(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Z=(e,r)=>{for(var t in r||(r={}))q.call(r,t)&&z(e,t,r[t]);if($)for(var t of $(r))Q.call(r,t)&&z(e,t,r[t]);return e};return{name:"historyPlugin",monitor(e){let r="";if(!(window&&window.history.pushState&&window.history.replaceState))return;const t=window.onpopstate;function o(t){return function(...o){const n=o.length>2?o[2]:void 0;if(n){const t=r,o=String(n);r=o,e({from:t,to:o})}return t.apply(this,o)}}window.onpopstate=function(...o){const n=document.location.href,E=r;r=n,e({from:E,to:n}),t&&t.apply(this,o)},X(window.history,"pushState",o),X(window.history,"replaceState",o)},transform(e){const r=(t=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?r:3&r|8).toString(16)})));var t;const{from:o,to:n}=e;return this.breadcrumb.unshift({eventId:r,type:H.ROUTE,message:`from "${o}" to "${n}" by history`}),{id:r,time:V(),type:i.ROUTE,data:Z({sub_type:h.HISTORY},e)}}}}();
var HEIMDALLR_HISTORY=function(){"use strict";var e,r,t,o,n,a,E,i,c,R,s,O,l,C,u,S,p,f,h,x,L,d,D,m,I,A,T,w,y,M,U,N,g;(e||(e={})).NAME="@heimdallr-sdk","[".concat(e.NAME,"]:"),(t=r||(r={})).FATAL="fatal",t.ERROR="error",t.WARN="warn",t.INFO="info",t.DEBUG="debug",(n=o||(o={})).SESSION="HEIMDALLR_SDK_SESSION_ID",n.APP="HEIMDALLR_SDK_APP_ID",(E=a||(a={})).GET="GET",E.POST="POST",E.PUT="PUT",E.DELETE="DELETE",(c=i||(i={})).API="api",c.DOM="dom",c.PERFORMANCE="performance",c.ROUTE="route",c.ERROR="error",c.CONSOLE="console",c.CUSTOMER="customer",c.VUE="vue",c.LIFECYCLE="lifeCycle",c.EXTEND="extend",c.RECORD="record",(s=R||(R={})).CODEERROR="code",s.RESOURCEERROR="resource",s.UNHANDLEDREJECTION="unhandledrejection",s.PAGECRASH="pageCrash",(O||(O={})).CLICK="click",(C=l||(l={})).LOG="log",C.INFO="info",C.WARN="warn",C.ERROR="error",C.ASSERT="assert",(S=u||(u={})).FETCH="fetch",S.XHR="xhr",(f=p||(p={})).FMP="fmp",f.FPS="fps",f.BASIC="basic",f.VITALS="vitals",f.RESOURCE="resource",(x=h||(h={})).HASH="hash",x.HISTORY="history",(L||(L={})).CUSTOMER="customer",(D=d||(d={})).LOCAL="local",D.SESSION="session",D.COOKIE="cookie",D.GLOBAL="global",(I=m||(m={})).LOAD="enter",I.UNLOAD="leave",(T=A||(A={})).MOBILE="mobile",T.PC="pc",(y=w||(w={})).BROWSER="browser",y.NODE="nodejs",y.WECHAT="wechat",(U=M||(M={})).ROUTE="Route",U.CLICK="UI.Click",U.CONSOLE="Console",U.XHR="Xhr",U.FETCH="Fetch",U.UNHANDLEDREJECTION="Unhandledrejection",U.RESOURCE="Resource",U.CODE_ERROR="CodeError",U.CUSTOMER="Customer",U.FRAMEWORK="Framework",U.LIFECYCLE="LifeCycle",U.CRASH="Crash",(g=N||(N={})).API="Api",g.ROUTE="Route",g.CLICK="UI.Click",g.ERROR="Error",g.LIFECYCLE="LifeCycle",g.CUSTOMER="Customer";var v=function(e,r){void 0===e&&(e="Y-M-D h:m:s"),void 0===r&&(r=Date.now());var t=new Date(r||Date.now()),o={Y:"".concat(t.getFullYear()),M:"".concat(t.getMonth()+1),D:"".concat(t.getDate()),h:t.getHours(),m:t.getMinutes(),s:t.getSeconds()},n=function(e){return e>10?e:"0"+e};return(e||"Y-M-D h:m:s").replace("Y",o.Y).replace("M",o.M).replace("D",o.D).replace("h",n(o.h)).replace("m",n(o.m)).replace("s",n(o.s))};function P(e,r,t,o){if(void 0!==e&&(r in e||o)){var n=t(e[r]);"function"==typeof n&&(e[r]=n)}}var b=Object.defineProperty,H=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,_=(e,r,t)=>r in e?b(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,j=(e,r)=>{for(var t in r||(r={}))F.call(r,t)&&_(e,t,r[t]);if(H)for(var t of H(r))Y.call(r,t)&&_(e,t,r[t]);return e};return{name:"historyPlugin",monitor(e){let r="";if(!(window&&window.history.pushState&&window.history.replaceState))return;const t=window.onpopstate;function o(t){return function(...o){const n=o.length>2?o[2]:void 0;if(n){const t=r,o=String(n);r=o,e({from:t,to:o})}return t.apply(this,o)}}window.onpopstate=function(...o){const n=document.location.href,a=r;r=n,e({from:a,to:n}),t&&t.apply(this,o)},P(window.history,"pushState",o),P(window.history,"replaceState",o)},transform(e){const r=(t=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?r:3&r|8).toString(16)})));var t;const{from:o,to:n}=e;if(o!==n)return this.breadcrumb.unshift({eventId:r,type:M.ROUTE,message:`from "${o}" to "${n}" by history`}),{id:r,time:v(),type:i.ROUTE,data:j({sub_type:h.HISTORY},e)}}}}();

@@ -55,11 +55,2 @@ (function (global, factory) {

})(BrowserErrorTypes || (BrowserErrorTypes = {}));
var NodeErrorTypes;
(function(NodeErrorTypes2) {
NodeErrorTypes2["UNCAUGHTEXCEPTION"] = "uncaughtException";
NodeErrorTypes2["UNHANDLEDREJECTION"] = "unhandledrejection";
})(NodeErrorTypes || (NodeErrorTypes = {}));
var WxErrorTypes;
(function(WxErrorTypes2) {
WxErrorTypes2["UNCAUGHTEXCEPTION"] = "uncaughtException";
})(WxErrorTypes || (WxErrorTypes = {}));
var DomTypes;

@@ -106,8 +97,2 @@ (function(DomTypes2) {

})(StoreType || (StoreType = {}));
var BrowserReportType;
(function(BrowserReportType2) {
BrowserReportType2["BEACON"] = "beacon";
BrowserReportType2["IMG"] = "img";
BrowserReportType2["GET"] = "get";
})(BrowserReportType || (BrowserReportType = {}));
var PageLifeType;

@@ -123,6 +108,2 @@ (function(PageLifeType2) {

})(DeviceType || (DeviceType = {}));
var VueTypes;
(function(VueTypes2) {
VueTypes2["ERROR"] = "error";
})(VueTypes || (VueTypes = {}));
var PlatformTypes;

@@ -134,6 +115,2 @@ (function(PlatformTypes2) {

})(PlatformTypes || (PlatformTypes = {}));
var RecordTypes;
(function(RecordTypes2) {
RecordTypes2["SESSION"] = "session";
})(RecordTypes || (RecordTypes = {}));
var BrowserBreadcrumbTypes;

@@ -163,28 +140,3 @@ (function(BrowserBreadcrumbTypes2) {

})(WxBreadcrumbTypes || (WxBreadcrumbTypes = {}));
var WxRouteEvents;
(function(WxRouteEvents2) {
WxRouteEvents2["SWITCHTAB"] = "switchTab";
WxRouteEvents2["RELAUNCH"] = "reLaunch";
WxRouteEvents2["REDIRECTTO"] = "redirectTo";
WxRouteEvents2["NAVIGATETO"] = "navigateTo";
WxRouteEvents2["NAVIGATEBACK"] = "navigateBack";
WxRouteEvents2["NAVIGATETOMINIPROGRAM"] = "navigateToMiniProgram";
WxRouteEvents2["ROUTEFAIL"] = "routeFail";
})(WxRouteEvents || (WxRouteEvents = {}));
var WxXhrTypes;
(function(WxXhrTypes2) {
WxXhrTypes2["REQUEST"] = "request";
WxXhrTypes2["DOWNLOADFILE"] = "downloadFile";
WxXhrTypes2["UPLOADFILE"] = "uploadFile";
})(WxXhrTypes || (WxXhrTypes = {}));
var PerformanceFeat;
(function(PerformanceFeat2) {
PerformanceFeat2["BASIC"] = "basic";
PerformanceFeat2["RESOURCE"] = "resource";
PerformanceFeat2["FMP"] = "fmp";
PerformanceFeat2["FPS"] = "fps";
PerformanceFeat2["VITALS"] = "vitals";
})(PerformanceFeat || (PerformanceFeat = {}));
function generateUUID() {

@@ -291,2 +243,5 @@ var d = new Date().getTime();

const { from, to } = collectedData;
if (from === to) {
return;
}
this.breadcrumb.unshift({

@@ -293,0 +248,0 @@ eventId: id,

@@ -61,2 +61,5 @@ var __assign = (this && this.__assign) || function () {

var from = collectedData.from, to = collectedData.to;
if (from === to) {
return;
}
this.breadcrumb.unshift({

@@ -63,0 +66,0 @@ eventId: id,

{
"name": "@heimdallr-sdk/history",
"version": "0.0.14",
"version": "0.0.15",
"description": "A Plugin For Browser SDK",

@@ -40,6 +40,6 @@ "license": "MIT",

"dependencies": {
"@heimdallr-sdk/types": "^0.0.12",
"@heimdallr-sdk/utils": "^0.0.15"
"@heimdallr-sdk/types": "^0.0.13",
"@heimdallr-sdk/utils": "^0.0.16"
},
"gitHead": "86370321545cbc0ec383b4a16c8e72fb47cfafd4"
"gitHead": "5c2857d54fa5ad7701f58b115b03520e7f65f2e4"
}

@@ -1,4 +0,4 @@

# `history`
# @heimdallr-sdk/history
> 捕获路由变化,记录 from 与 to 并上报
> Capture route changes, record from and to and report

@@ -5,0 +5,0 @@ ## Usage

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc