Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@candulabs/eventing

Package Overview
Dependencies
Maintainers
4
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@candulabs/eventing - npm Package Compare versions

Comparing version 0.8.4-alpha.0 to 0.8.4

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [0.8.4](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.8.4-alpha.0...v0.8.4) (2021-09-20)
**Note:** Version bump only for package @candulabs/eventing
## 0.8.4-alpha.0 (2021-09-20)

@@ -8,0 +16,0 @@

2

dist/index.cjs.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@sentry/browser");for(var n,t=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(n={exports:{}},n.exports),n.exports),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var a=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var i=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||t)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n)for(var u=0;u<16;++u)n[o+u]=i[u];return n||a(i)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,d,f,p,l={name:"JsClient",version:"0.8.4-alpha.0"},g={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},m=function(){return"undefined"!=typeof window&&window.localStorage},y=function(e){return function(n){m()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},v={anonymousId:{getOrCreate:(s="candu:anonymous_id",d=function(){var e=i();return y("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(m()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}}(s)()||d()}),set:y("candu:anonymous_id")}},h=function(){return(h=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},w=function(){return"undefined"!=typeof window?window:g},x=function(e,n,t){return void 0===t&&(t={}),{id:i(),anonymousId:v.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:(r=t.source,o=t.sdk,a=t.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:o,source:r,locale:w().navigator.language,screen:w().screen&&{height:w().screen.height,width:w().screen.width},page:w().document&&{path:w().location.pathname,url:w().location.href,title:document.title,search:w().location.search,referrer:document.referrer},userAgent:w().navigator.userAgent,library:l,timezone:w().Intl&&w().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits};var r,o,a},I={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},S=v.anonymousId.getOrCreate;exports.eventingFactory=function(n,t,r,o){void 0===r&&(r={});var a=r.url,i=r.disableTracking,u=r.contextAdapter,s=function(e,t){p.setUser({id:n}),p.captureException(e,{data:t})};if(f||(f=new e.BrowserClient({dsn:"https://bf02871777614ec786d84577da9afc6c@o238672.ingest.sentry.io/5589365",release:"0.8.4-alpha.0",environment:"production"}),p=new e.Hub(f)),i)return h(h({},I),{error:s});var d=function(e,t){return function(e,n,t,r){if(w().fetch){var o=(t&&t+"/api/events"||"https://api.candu.ai/api/events")+"?token="+e,a=r?{Signature:r.hmac,UserId:""+r.userId}:{};fetch(o,{method:"POST",headers:h({"Content-Type":"text/plain"},a),body:JSON.stringify(n)})}}(n,e,a,t)};return{identify:function(e,n,t){var r=t?{userId:e,hmac:t}:void 0;return d(x(e,c.Identify,{traits:n,sdk:o,contextAdapter:u}),r)},page:function(e,n){return d(x(t,c.Page,{pageName:e,properties:n,sdk:o,contextAdapter:u}))},screen:function(e,n){return d(x(t,c.Screen,{screenName:e,properties:n,sdk:o,contextAdapter:u}))},track:function(e,n){return d(x(t,c.Track,{eventName:e,properties:n,sdk:o,contextAdapter:u}))},error:s}},exports.getAnonymousId=S,exports.noOpEventing=I;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@sentry/browser");for(var n,t=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(n={exports:{}},n.exports),n.exports),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var a=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var i=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||t)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n)for(var u=0;u<16;++u)n[o+u]=i[u];return n||a(i)};var u,c;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(u||(u={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(c||(c={}));var s,d,f,p,l={name:"JsClient",version:"0.8.4"},g={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},m=function(){return"undefined"!=typeof window&&window.localStorage},y=function(e){return function(n){m()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},v={anonymousId:{getOrCreate:(s="candu:anonymous_id",d=function(){var e=i();return y("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(m()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}}(s)()||d()}),set:y("candu:anonymous_id")}},h=function(){return(h=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},w=function(){return"undefined"!=typeof window?window:g},x=function(e,n,t){return void 0===t&&(t={}),{id:i(),anonymousId:v.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:(r=t.source,o=t.sdk,a=t.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:o,source:r,locale:w().navigator.language,screen:w().screen&&{height:w().screen.height,width:w().screen.width},page:w().document&&{path:w().location.pathname,url:w().location.href,title:document.title,search:w().location.search,referrer:document.referrer},userAgent:w().navigator.userAgent,library:l,timezone:w().Intl&&w().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits};var r,o,a},I={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},S=v.anonymousId.getOrCreate;exports.eventingFactory=function(n,t,r,o){void 0===r&&(r={});var a=r.url,i=r.disableTracking,u=r.contextAdapter,s=function(e,t){p.setUser({id:n}),p.captureException(e,{data:t})};if(f||(f=new e.BrowserClient({dsn:"https://bf02871777614ec786d84577da9afc6c@o238672.ingest.sentry.io/5589365",release:"0.8.4",environment:"production"}),p=new e.Hub(f)),i)return h(h({},I),{error:s});var d=function(e,t){return function(e,n,t,r){if(w().fetch){var o=(t&&t+"/api/events"||"https://api.candu.ai/api/events")+"?token="+e,a=r?{Signature:r.hmac,UserId:""+r.userId}:{};fetch(o,{method:"POST",headers:h({"Content-Type":"text/plain"},a),body:JSON.stringify(n)})}}(n,e,a,t)};return{identify:function(e,n,t){var r=t?{userId:e,hmac:t}:void 0;return d(x(e,c.Identify,{traits:n,sdk:o,contextAdapter:u}),r)},page:function(e,n){return d(x(t,c.Page,{pageName:e,properties:n,sdk:o,contextAdapter:u}))},screen:function(e,n){return d(x(t,c.Screen,{screenName:e,properties:n,sdk:o,contextAdapter:u}))},track:function(e,n){return d(x(t,c.Track,{eventName:e,properties:n,sdk:o,contextAdapter:u}))},error:s}},exports.getAnonymousId=S,exports.noOpEventing=I;

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

import{BrowserClient as e,Hub as n}from"@sentry/browser";for(var t,r=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(t={exports:{}},t.exports),t.exports),o=[],a=0;a<256;++a)o[a]=(a+256).toString(16).substr(1);var i=function(e,n){var t=n||0,r=o;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")};var u=function(e,n,t){var o=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var c,s;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(c||(c={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(s||(s={}));var d,f,p,l,m={name:"JsClient",version:"0.8.4-alpha.0"},g={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},y=function(){return"undefined"!=typeof window&&window.localStorage},v=function(e){return function(n){y()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},h={anonymousId:{getOrCreate:(d="candu:anonymous_id",f=function(){var e=u();return v("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(y()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}}(d)()||f()}),set:v("candu:anonymous_id")}},w=function(){return(w=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},I=function(){return"undefined"!=typeof window?window:g},S=function(e,n,t){return void 0===t&&(t={}),{id:u(),anonymousId:h.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:(r=t.source,o=t.sdk,a=t.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:o,source:r,locale:I().navigator.language,screen:I().screen&&{height:I().screen.height,width:I().screen.width},page:I().document&&{path:I().location.pathname,url:I().location.href,title:document.title,search:I().location.search,referrer:document.referrer},userAgent:I().navigator.userAgent,library:m,timezone:I().Intl&&I().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits};var r,o,a},x={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},k=function(t,r,o,a){void 0===o&&(o={});var i=o.url,u=o.disableTracking,c=o.contextAdapter,d=function(e,n){l.setUser({id:t}),l.captureException(e,{data:n})};if(p||(p=new e({dsn:"https://bf02871777614ec786d84577da9afc6c@o238672.ingest.sentry.io/5589365",release:"0.8.4-alpha.0",environment:"production"}),l=new n(p)),u)return w(w({},x),{error:d});var f=function(e,n){return function(e,n,t,r){if(I().fetch){var o=(t&&t+"/api/events"||"https://api.candu.ai/api/events")+"?token="+e,a=r?{Signature:r.hmac,UserId:""+r.userId}:{};fetch(o,{method:"POST",headers:w({"Content-Type":"text/plain"},a),body:JSON.stringify(n)})}}(t,e,i,n)};return{identify:function(e,n,t){var r=t?{userId:e,hmac:t}:void 0;return f(S(e,s.Identify,{traits:n,sdk:a,contextAdapter:c}),r)},page:function(e,n){return f(S(r,s.Page,{pageName:e,properties:n,sdk:a,contextAdapter:c}))},screen:function(e,n){return f(S(r,s.Screen,{screenName:e,properties:n,sdk:a,contextAdapter:c}))},track:function(e,n){return f(S(r,s.Track,{eventName:e,properties:n,sdk:a,contextAdapter:c}))},error:d}},A=h.anonymousId.getOrCreate;export{k as eventingFactory,A as getAnonymousId,x as noOpEventing};
import{BrowserClient as e,Hub as n}from"@sentry/browser";for(var t,r=(function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}}(t={exports:{}},t.exports),t.exports),o=[],a=0;a<256;++a)o[a]=(a+256).toString(16).substr(1);var i=function(e,n){var t=n||0,r=o;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")};var u=function(e,n,t){var o=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var u=0;u<16;++u)n[o+u]=a[u];return n||i(a)};var c,s;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(c||(c={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(s||(s={}));var d,f,p,l,m={name:"JsClient",version:"0.8.4"},g={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},y=function(){return"undefined"!=typeof window&&window.localStorage},v=function(e){return function(n){y()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},h={anonymousId:{getOrCreate:(d="candu:anonymous_id",f=function(){var e=u();return v("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(y()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}}(d)()||f()}),set:v("candu:anonymous_id")}},w=function(){return(w=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},I=function(){return"undefined"!=typeof window?window:g},S=function(e,n,t){return void 0===t&&(t={}),{id:u(),anonymousId:h.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:(r=t.source,o=t.sdk,a=t.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:o,source:r,locale:I().navigator.language,screen:I().screen&&{height:I().screen.height,width:I().screen.width},page:I().document&&{path:I().location.pathname,url:I().location.href,title:document.title,search:I().location.search,referrer:document.referrer},userAgent:I().navigator.userAgent,library:m,timezone:I().Intl&&I().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits};var r,o,a},x={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},k=function(t,r,o,a){void 0===o&&(o={});var i=o.url,u=o.disableTracking,c=o.contextAdapter,d=function(e,n){l.setUser({id:t}),l.captureException(e,{data:n})};if(p||(p=new e({dsn:"https://bf02871777614ec786d84577da9afc6c@o238672.ingest.sentry.io/5589365",release:"0.8.4",environment:"production"}),l=new n(p)),u)return w(w({},x),{error:d});var f=function(e,n){return function(e,n,t,r){if(I().fetch){var o=(t&&t+"/api/events"||"https://api.candu.ai/api/events")+"?token="+e,a=r?{Signature:r.hmac,UserId:""+r.userId}:{};fetch(o,{method:"POST",headers:w({"Content-Type":"text/plain"},a),body:JSON.stringify(n)})}}(t,e,i,n)};return{identify:function(e,n,t){var r=t?{userId:e,hmac:t}:void 0;return f(S(e,s.Identify,{traits:n,sdk:a,contextAdapter:c}),r)},page:function(e,n){return f(S(r,s.Page,{pageName:e,properties:n,sdk:a,contextAdapter:c}))},screen:function(e,n){return f(S(r,s.Screen,{screenName:e,properties:n,sdk:a,contextAdapter:c}))},track:function(e,n){return f(S(r,s.Track,{eventName:e,properties:n,sdk:a,contextAdapter:c}))},error:d}},A=h.anonymousId.getOrCreate;export{k as eventingFactory,A as getAnonymousId,x as noOpEventing};

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@sentry/browser")):"function"==typeof define&&define.amd?define(["exports","@sentry/browser"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@candulabs/eventing"]={},e.browser)}(this,(function(e,n){"use strict";for(var t=function(e){var n={exports:{}};return e(n,n.exports),n.exports}((function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}})),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var a=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var i=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||t)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n)for(var u=0;u<16;++u)n[o+u]=i[u];return n||a(i)};const u="0.8.4-alpha.0";var c,s;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(c||(c={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(s||(s={}));var d,f,p,l,g="/api/events",y={name:"JsClient",version:u},m="candu:anonymous_id",v={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},h=function(){return"undefined"!=typeof window&&window.localStorage},w=function(e){return function(n){h()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},b={anonymousId:{getOrCreate:(d=m,f=function(){var e=i();return w(m)(e),e},function(){return function(e){return function(){if(h()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}}(d)()||f()}),set:w(m)}},I=function(){return(I=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},x=function(){return"undefined"!=typeof window?window:v},S=function(e,n,t){return void 0===t&&(t={}),{id:i(),anonymousId:b.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:(r=t.source,o=t.sdk,a=t.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:o,source:r,locale:x().navigator.language,screen:x().screen&&{height:x().screen.height,width:x().screen.width},page:x().document&&{path:x().location.pathname,url:x().location.href,title:document.title,search:x().location.search,referrer:document.referrer},userAgent:x().navigator.userAgent,library:y,timezone:x().Intl&&x().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits};var r,o,a},O={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},A=b.anonymousId.getOrCreate;e.eventingFactory=function(e,t,r,o){void 0===r&&(r={});var a=r.url,i=r.disableTracking,c=r.contextAdapter,d=function(n,t){l.setUser({id:e}),l.captureException(n,{data:t})};if(p||(p=new n.BrowserClient({dsn:"https://bf02871777614ec786d84577da9afc6c@o238672.ingest.sentry.io/5589365",release:u,environment:"production"}),l=new n.Hub(p)),i)return I(I({},O),{error:d});var f=function(n,t){return function(e,n,t,r){if(x().fetch){var o=(t&&""+t+g||"https://api.candu.ai/api/events")+"?token="+e,a=r?{Signature:r.hmac,UserId:""+r.userId}:{};fetch(o,{method:"POST",headers:I({"Content-Type":"text/plain"},a),body:JSON.stringify(n)})}}(e,n,a,t)};return{identify:function(e,n,t){var r=t?{userId:e,hmac:t}:void 0;return f(S(e,s.Identify,{traits:n,sdk:o,contextAdapter:c}),r)},page:function(e,n){return f(S(t,s.Page,{pageName:e,properties:n,sdk:o,contextAdapter:c}))},screen:function(e,n){return f(S(t,s.Screen,{screenName:e,properties:n,sdk:o,contextAdapter:c}))},track:function(e,n){return f(S(t,s.Track,{eventName:e,properties:n,sdk:o,contextAdapter:c}))},error:d}},e.getAnonymousId=A,e.noOpEventing=O,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@sentry/browser")):"function"==typeof define&&define.amd?define(["exports","@sentry/browser"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@candulabs/eventing"]={},e.browser)}(this,(function(e,n){"use strict";for(var t=function(e){var n={exports:{}};return e(n,n.exports),n.exports}((function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}})),r=[],o=0;o<256;++o)r[o]=(o+256).toString(16).substr(1);var a=function(e,n){var t=n||0,o=r;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")};var i=function(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||t)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n)for(var u=0;u<16;++u)n[o+u]=i[u];return n||a(i)};const u="0.8.4";var c,s;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(c||(c={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(s||(s={}));var d,f,p,l,g="/api/events",y={name:"JsClient",version:u},m="candu:anonymous_id",v={fetch:null,document:void 0,navigator:{language:"",userAgent:""},location:{pathname:"",href:"",search:""},screen:{height:0,width:0},Intl:{DateTimeFormat:function(){return{resolvedOptions:function(){return{timeZone:""}}}}}},h=function(){return"undefined"!=typeof window&&window.localStorage},w=function(e){return function(n){h()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))}},b={anonymousId:{getOrCreate:(d=m,f=function(){var e=i();return w(m)(e),e},function(){return function(e){return function(){if(h()){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}}}(d)()||f()}),set:w(m)}},I=function(){return(I=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},x=function(){return"undefined"!=typeof window?window:v},S=function(e,n,t){return void 0===t&&(t={}),{id:i(),anonymousId:b.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:(r=t.source,o=t.sdk,a=t.contextAdapter,void 0===a&&(a=function(e){return e}),a({sdk:o,source:r,locale:x().navigator.language,screen:x().screen&&{height:x().screen.height,width:x().screen.width},page:x().document&&{path:x().location.pathname,url:x().location.href,title:document.title,search:x().location.search,referrer:document.referrer},userAgent:x().navigator.userAgent,library:y,timezone:x().Intl&&x().Intl.DateTimeFormat().resolvedOptions().timeZone})),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits};var r,o,a},O={identify:function(){return null},page:function(){return null},screen:function(){return null},track:function(){return null},error:function(){return null}},A=b.anonymousId.getOrCreate;e.eventingFactory=function(e,t,r,o){void 0===r&&(r={});var a=r.url,i=r.disableTracking,c=r.contextAdapter,d=function(n,t){l.setUser({id:e}),l.captureException(n,{data:t})};if(p||(p=new n.BrowserClient({dsn:"https://bf02871777614ec786d84577da9afc6c@o238672.ingest.sentry.io/5589365",release:u,environment:"production"}),l=new n.Hub(p)),i)return I(I({},O),{error:d});var f=function(n,t){return function(e,n,t,r){if(x().fetch){var o=(t&&""+t+g||"https://api.candu.ai/api/events")+"?token="+e,a=r?{Signature:r.hmac,UserId:""+r.userId}:{};fetch(o,{method:"POST",headers:I({"Content-Type":"text/plain"},a),body:JSON.stringify(n)})}}(e,n,a,t)};return{identify:function(e,n,t){var r=t?{userId:e,hmac:t}:void 0;return f(S(e,s.Identify,{traits:n,sdk:o,contextAdapter:c}),r)},page:function(e,n){return f(S(t,s.Page,{pageName:e,properties:n,sdk:o,contextAdapter:c}))},screen:function(e,n){return f(S(t,s.Screen,{screenName:e,properties:n,sdk:o,contextAdapter:c}))},track:function(e,n){return f(S(t,s.Track,{eventName:e,properties:n,sdk:o,contextAdapter:c}))},error:d}},e.getAnonymousId=A,e.noOpEventing=O,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -12,3 +12,3 @@ {

},
"version": "0.8.4-alpha.0",
"version": "0.8.4",
"main": "dist/index.js",

@@ -38,3 +38,3 @@ "module": "dist/index.es.js",

},
"gitHead": "fa49fa1d727fd264fe7a74bcd9d9361d6d9b5351"
"gitHead": "17a23950df822570b01e31f622cb0ad3ba4d2397"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc