Socket
Socket
Sign inDemoInstall

@heimdallr-sdk/fetch

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.8 to 0.0.9

2

dist/fetch.iife.js

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

var HEIMDALLR_FETCH=function(){"use strict";var e,t,r,o,n,s,a,c,E,i,O,u,R,l,p,C,S,d,x,f,h,D,T,m,L,I,A,P,b,g,v,H;(e||(e={})).VUE="Vue",(r=t||(t={})).SESSION="HEIMDALLR_SDK_SESSION_ID",r.APP="HEIMDALLR_SDK_APP_ID",(n=o||(o={})).GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",(a=s||(s={})).API="api",a.DOM="dom",a.PERFORMANCE="performance",a.ROUTE="route",a.ERROR="error",a.CONSOLE="console",a.CUSTOMER="customer",a.VUE="vue",a.LIFECYCLE="lifeCycle",(E=c||(c={})).CODEERROR="code",E.RESOURCEERROR="resource",E.UNHANDLEDREJECTION="unhandledrejection",E.PAGECRASH="pageCrash",(i||(i={})).CLICK="click",(u=O||(O={})).LOG="log",u.INFO="info",u.WARN="warn",u.ERROR="error",u.ASSERT="assert",(l=R||(R={})).FETCH="fetch",l.XHR="xhr",(C=p||(p={})).FMP="fmp",C.FPS="fps",C.BASIC="basic",C.VITALS="vitals",C.RESOURCE="resource",(d=S||(S={})).HASH="hash",d.HISTORY="history",(x||(x={})).CUSTOMER="customer",(h=f||(f={})).LOCAL="local",h.SESSION="session",h.COOKIE="cookie",h.GLOBAL="global",(T=D||(D={})).BEACON="beacon",T.IMG="img",T.GET="get",(L=m||(m={})).LOAD="enter",L.UNLOAD="leave",(A=I||(I={})).MOBILE="mobile",A.PC="pc",(P||(P={})).ERROR="error",(g=b||(b={})).BASIC="basic",g.RESOURCE="resource",g.FMP="fmp",g.FPS="fps",g.VITALS="vitals",(H=v||(v={})).ROUTE="Route",H.CLICK="UI.Click",H.CONSOLE="Console",H.XHR="Xhr",H.FETCH="Fetch",H.UNHANDLEDREJECTION="Unhandledrejection",H.RESOURCE="Resource",H.CODE_ERROR="CodeError",H.CUSTOMER="Customer",H.FRAMEWORK="Framework",H.LIFECYCLE="LifeCycle",H.CRASH="Crash";"undefined"!=typeof process&&process;var M=function(e,t){void 0===e&&(e="Y-M-D h:m:s"),void 0===t&&(t=Date.now());var r=new Date(t),o={Y:"".concat(r.getFullYear()),M:"".concat(r.getMonth()+1),D:"".concat(r.getDate()),h:r.getHours(),m:r.getMinutes(),s:r.getSeconds()},n=function(e){return e>10?e:"0"+e};return e.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))};var y=Object.defineProperty,U=Object.defineProperties,w=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,_=(e,t,r)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t)=>{for(var r in t||(t={}))N.call(t,r)&&_(e,r,t[r]);if(F)for(var r of F(t))j.call(t,r)&&_(e,r,t[r]);return e};const Y="fetchPlugin";return{name:Y,monitor(e){const{context:t}=this,{ignoreUrls:r=[]}=t;!function(e,t,r,o){if(void 0!==e&&(t in e||o)){var n=r(e[t]);"function"==typeof n&&(e[t]=n)}}(window,R.FETCH,(t=>function(n,s={}){const a=Date.now(),c={request:{url:n,method:s&&s.method||o.GET,data:s&&s.body},time:a,response:{}},E=new Headers(s.headers||{});var i;Object.assign(E,{setRequestHeader:E.set}),i=G({},s),s=U(i,w({headers:E}));const O=r.includes(function(e){var t="".concat(e.replace(/^http(s|):/,"").split("?")[0]),r=t.length-1;return"/"===t[r]?t.substring(0,r):t}(n));return t.apply(window,[n,s]).then((t=>{const r=t.clone(),o=Date.now();return c.elapsedTime=o-a,c.response.status=r.status,r.text().then((t=>{O||(c.response.data=t,e(Y,c))})),t}),(t=>{if(O)return;const r=Date.now();throw c.elapsedTime=r-a,c.response.status=0,e(Y,c),t}))}))},transform(e){const t=(r=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})));var r;return this.breadcrumb.unshift({eventId:t,type:v.FETCH,data:e}),{id:t,time:M(),type:s.API,data:G({sub_type:R.FETCH},e)}}}}();
var HEIMDALLR_FETCH=function(){"use strict";var e,t,r,o,n,s,a,c,E,i,O,u,R,l,p,C,S,d,x,f,h,D,m,T,L,I,A,P,b,g,M,v;(e||(e={})).VUE="Vue",(r=t||(t={})).SESSION="HEIMDALLR_SDK_SESSION_ID",r.APP="HEIMDALLR_SDK_APP_ID",(n=o||(o={})).GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",(a=s||(s={})).API="api",a.DOM="dom",a.PERFORMANCE="performance",a.ROUTE="route",a.ERROR="error",a.CONSOLE="console",a.CUSTOMER="customer",a.VUE="vue",a.LIFECYCLE="lifeCycle",(E=c||(c={})).CODEERROR="code",E.RESOURCEERROR="resource",E.UNHANDLEDREJECTION="unhandledrejection",E.PAGECRASH="pageCrash",(i||(i={})).CLICK="click",(u=O||(O={})).LOG="log",u.INFO="info",u.WARN="warn",u.ERROR="error",u.ASSERT="assert",(l=R||(R={})).FETCH="fetch",l.XHR="xhr",(C=p||(p={})).FMP="fmp",C.FPS="fps",C.BASIC="basic",C.VITALS="vitals",C.RESOURCE="resource",(d=S||(S={})).HASH="hash",d.HISTORY="history",(x||(x={})).CUSTOMER="customer",(h=f||(f={})).LOCAL="local",h.SESSION="session",h.COOKIE="cookie",h.GLOBAL="global",(m=D||(D={})).BEACON="beacon",m.IMG="img",m.GET="get",(L=T||(T={})).LOAD="enter",L.UNLOAD="leave",(A=I||(I={})).MOBILE="mobile",A.PC="pc",(P||(P={})).ERROR="error",(g=b||(b={})).BASIC="basic",g.RESOURCE="resource",g.FMP="fmp",g.FPS="fps",g.VITALS="vitals",(v=M||(M={})).ROUTE="Route",v.CLICK="UI.Click",v.CONSOLE="Console",v.XHR="Xhr",v.FETCH="Fetch",v.UNHANDLEDREJECTION="Unhandledrejection",v.RESOURCE="Resource",v.CODE_ERROR="CodeError",v.CUSTOMER="Customer",v.FRAMEWORK="Framework",v.LIFECYCLE="LifeCycle",v.CRASH="Crash";"undefined"!=typeof process&&process;var H=function(e,t){void 0===e&&(e="Y-M-D h:m:s"),void 0===t&&(t=Date.now());var r=new Date(t||Date.now()),o={Y:"".concat(r.getFullYear()),M:"".concat(r.getMonth()+1),D:"".concat(r.getDate()),h:r.getHours(),m:r.getMinutes(),s:r.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))};var y=Object.defineProperty,w=Object.defineProperties,U=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,Y=(e,t,r)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))N.call(t,r)&&Y(e,r,t[r]);if(F)for(var r of F(t))j.call(t,r)&&Y(e,r,t[r]);return e};const G="fetchPlugin";return{name:G,monitor(e){const{context:t}=this,{ignoreUrls:r=[]}=t;!function(e,t,r,o){if(void 0!==e&&(t in e||o)){var n=r(e[t]);"function"==typeof n&&(e[t]=n)}}(window,R.FETCH,(t=>function(n,s={}){const a=Date.now(),c={request:{url:n,method:s&&s.method||o.GET,data:s&&s.body},time:a,response:{}},E=new Headers(s.headers||{});var i;Object.assign(E,{setRequestHeader:E.set}),i=_({},s),s=w(i,U({headers:E}));const O=r.includes(function(e){var t="".concat((e||"").replace(/^http(s|):/,"").split("?")[0]),r=t.length-1;return"/"===t[r]?t.substring(0,r):t}(n));return t.apply(window,[n,s]).then((t=>{const r=t.clone(),o=Date.now();return c.elapsedTime=o-a,c.response.status=r.status,r.text().then((t=>{O||(c.response.data=t,e(G,c))})),t}),(t=>{if(O)return;const r=Date.now();throw c.elapsedTime=r-a,c.response.status=0,e(G,c),t}))}))},transform(e){const t=(r=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})));var r;return this.breadcrumb.unshift({eventId:t,type:M.FETCH,data:e}),{id:t,time:H(),type:s.API,data:_({sub_type:R.FETCH},e)}}}}();

@@ -131,3 +131,3 @@ (function (global, factory) {

var getUrlPath = function(url) {
var path = "".concat(url.replace(/^http(s|):/, "").split("?")[0]);
var path = "".concat((url || "").replace(/^http(s|):/, "").split("?")[0]);
var endIndex = path.length - 1;

@@ -154,3 +154,3 @@ return path[endIndex] === "/" ? path.substring(0, endIndex) : path;

}
var date = new Date(timestamp);
var date = new Date(timestamp || Date.now());
var dateInfo = {

@@ -167,3 +167,3 @@ Y: "".concat(date.getFullYear()),

};
var res = format.replace("Y", dateInfo.Y).replace("M", dateInfo.M).replace("D", dateInfo.D).replace("h", formatNumber(dateInfo.h)).replace("m", formatNumber(dateInfo.m)).replace("s", formatNumber(dateInfo.s));
var res = (format || "Y-M-D h:m:s").replace("Y", dateInfo.Y).replace("M", dateInfo.M).replace("D", dateInfo.D).replace("h", formatNumber(dateInfo.h)).replace("m", formatNumber(dateInfo.m)).replace("s", formatNumber(dateInfo.s));
return res;

@@ -170,0 +170,0 @@ };

{
"name": "@heimdallr-sdk/fetch",
"version": "0.0.8",
"version": "0.0.9",
"description": "A Plugin For Browser SDK",

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

"@heimdallr-sdk/types": "^0.0.7",
"@heimdallr-sdk/utils": "^0.0.8"
"@heimdallr-sdk/utils": "^0.0.9"
},
"gitHead": "261a108f06d34727622b9bb7956066ec669a9e5f"
"gitHead": "5c228c2425059428fa1329e430525bcd374520c6"
}
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