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

@candulabs/eventing

Package Overview
Dependencies
Maintainers
2
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.0.7 to 0.0.8

dist/index.esm.js

10

CHANGELOG.md

@@ -6,3 +6,3 @@ # Change Log

## [0.0.7](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.0.6...v0.0.7) (2020-01-31)
## [0.0.8](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.0.6...v0.0.8) (2020-02-07)

@@ -15,2 +15,10 @@ **Note:** Version bump only for package @candulabs/eventing

## [0.0.7](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.0.6...v0.0.7) (2020-02-07)
**Note:** Version bump only for package @candulabs/eventing
## [0.0.6](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-eventing/compare/v0.0.5...v0.0.6) (2020-01-24)

@@ -17,0 +25,0 @@

3

dist/eventRequests.d.ts
import { UserId } from './types/Input';
interface Eventing {
export interface Eventing {
identify: (userId: UserId, traits?: object) => any;
page: (pageName: string, properties?: object) => any;
screen: (screenName: string, properties?: object) => any;
track: (eventName: string, properties?: object) => any;

@@ -6,0 +7,0 @@ }

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

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var Source,EventType,crypto=_interopDefault(require("crypto"));!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(Source||(Source={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(EventType||(EventType={}));for(var rng=function(){return crypto.randomBytes(16)},byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);function bytesToUuid(e,t){var n=t||0,r=byteToHex;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var bytesToUuid_1=bytesToUuid;function v4(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||rng)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var a=0;a<16;++a)t[r+a]=o[a];return t||bytesToUuid_1(o)}var v4_1=v4;const API_BASE_URL="https://api.candu.ai",VERSION="0.0.4",API_BASE_URL$1=API_BASE_URL,EVENT_API="/api/events",EVENT_URL=`${API_BASE_URL$1}/api/events`,clientLibrary={name:"JsClient",version:"0.0.4"},ANONYMOUS_ID_STORAGE_KEY="candu:anonymous_id",hasStorage=()=>window&&window.localStorage,get=e=>()=>{if(hasStorage()){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}},getOrCreate=(e,t)=>()=>get(e)()||t(),set=e=>t=>{hasStorage()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))};var storage={anonymousId:{getOrCreate:getOrCreate("candu:anonymous_id",()=>{const e=v4_1();return set("candu:anonymous_id")(e),e}),set:set("candu:anonymous_id")}};const page=()=>({path:window.location.pathname,url:window.location.href,title:document.title,search:window.location.search,referrer:document.referrer}),eventScreen=()=>({height:window.screen.height,width:window.screen.width}),context=e=>({source:e,locale:navigator.language,screen:window.screen&&eventScreen(),page:window&&document&&page(),userAgent:navigator.userAgent,library:clientLibrary,timezone:window.Intl&&window.Intl.DateTimeFormat().resolvedOptions().timeZone}),event=(e,t,n={})=>({id:v4_1(),anonymousId:storage.anonymousId.getOrCreate(),userId:e&&e.toString(),type:t,context:context(n.source),sentAt:(new Date).toISOString(),eventName:n.eventName,pageName:n.pageName,properties:n.properties,traits:n.traits}),makeAJAXRequest=(e,t,n)=>{fetch(`${n&&`${n}/api/events`||EVENT_URL}?token=${e}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify(t)})};var eventRequests=(e,t,n)=>{const r=t=>makeAJAXRequest(e,t,n);return{identify:(e,t)=>r(event(e,EventType.Identify,{traits:t})),page:(e,n)=>r(event(t,EventType.Page,{pageName:e,properties:n})),track:(e,n)=>r(event(t,EventType.Track,{eventName:e,properties:n}))}};module.exports=eventRequests;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var Source,EventType,crypto=_interopDefault(require("crypto"));!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(Source||(Source={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(EventType||(EventType={}));for(var rng=function(){return crypto.randomBytes(16)},byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);function bytesToUuid(e,t){var n=t||0,r=byteToHex;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var bytesToUuid_1=bytesToUuid;function v4(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||rng)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var a=0;a<16;++a)t[r+a]=o[a];return t||bytesToUuid_1(o)}var v4_1=v4;const API_BASE_URL="https://api.candu.ai",VERSION="0.0.8",API_BASE_URL$1=API_BASE_URL,EVENT_API="/api/events",EVENT_URL=`${API_BASE_URL$1}/api/events`,clientLibrary={name:"JsClient",version:"0.0.8"},ANONYMOUS_ID_STORAGE_KEY="candu:anonymous_id",hasStorage=()=>window&&window.localStorage,get=e=>()=>{if(hasStorage()){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}},getOrCreate=(e,t)=>()=>get(e)()||t(),set=e=>t=>{hasStorage()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))};var storage={anonymousId:{getOrCreate:getOrCreate("candu:anonymous_id",()=>{const e=v4_1();return set("candu:anonymous_id")(e),e}),set:set("candu:anonymous_id")}};const page=()=>({path:window.location.pathname,url:window.location.href,title:document.title,search:window.location.search,referrer:document.referrer}),eventScreen=()=>({height:window.screen.height,width:window.screen.width}),context=e=>({source:e,locale:navigator.language,screen:window.screen&&eventScreen(),page:window&&document&&page(),userAgent:navigator.userAgent,library:clientLibrary,timezone:window.Intl&&window.Intl.DateTimeFormat().resolvedOptions().timeZone}),event=(e,t,n={})=>({id:v4_1(),anonymousId:storage.anonymousId.getOrCreate(),userId:e&&e.toString(),type:t,context:context(n.source),sentAt:(new Date).toISOString(),eventName:n.eventName,pageName:n.pageName,screenName:n.screenName,properties:n.properties,traits:n.traits}),makeAJAXRequest=(e,t,n)=>{fetch(`${n&&`${n}/api/events`||EVENT_URL}?token=${e}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify(t)})};var eventRequests=(e,t,n)=>{const r=t=>makeAJAXRequest(e,t,n);return{identify:(e,t)=>r(event(e,EventType.Identify,{traits:t})),page:(e,n)=>r(event(t,EventType.Page,{pageName:e,properties:n})),screen:(e,n)=>r(event(t,EventType.Screen,{screenName:e,properties:n})),track:(e,n)=>r(event(t,EventType.Track,{eventName:e,properties:n}))}};module.exports=eventRequests;
//# sourceMappingURL=index.cjs.js.map

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

export { default } from './eventRequests';
export { default, Eventing } from './eventRequests';

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

import e from"crypto";var t,n;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(t||(t={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(n||(n={}));for(var r=function(){return e.randomBytes(16)},o=[],a=0;a<256;++a)o[a]=(a+256).toString(16).substr(1);var i=function(e,t){var n=t||0,r=o;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")};var s=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="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,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)};const c={name:"JsClient",version:"0.0.4"},d=()=>window&&window.localStorage,u=e=>t=>{d()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))};var l={anonymousId:{getOrCreate:((e,t)=>()=>(e=>()=>{if(d()){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}})(e)()||t())("candu:anonymous_id",()=>{const e=s();return u("candu:anonymous_id")(e),e}),set:u("candu:anonymous_id")}};const p=()=>({path:window.location.pathname,url:window.location.href,title:document.title,search:window.location.search,referrer:document.referrer}),w=()=>({height:window.screen.height,width:window.screen.width}),g=e=>({source:e,locale:navigator.language,screen:window.screen&&w(),page:window&&document&&p(),userAgent:navigator.userAgent,library:c,timezone:window.Intl&&window.Intl.DateTimeFormat().resolvedOptions().timeZone}),m=(e,t,n={})=>({id:s(),anonymousId:l.anonymousId.getOrCreate(),userId:e&&e.toString(),type:t,context:g(n.source),sentAt:(new Date).toISOString(),eventName:n.eventName,pageName:n.pageName,properties:n.properties,traits:n.traits});export default(e,t,r)=>{const o=t=>((e,t,n)=>{fetch(`${n&&`${n}/api/events`||"https://api.candu.ai/api/events"}?token=${e}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify(t)})})(e,t,r);return{identify:(e,t)=>o(m(e,n.Identify,{traits:t})),page:(e,r)=>o(m(t,n.Page,{pageName:e,properties:r})),track:(e,r)=>o(m(t,n.Track,{eventName:e,properties:r}))}};
import e from"crypto";var n,t;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(n||(n={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(t||(t={}));for(var r=function(){return e.randomBytes(16)},a=[],o=0;o<256;++o)a[o]=(o+256).toString(16).substr(1);var i=function(e,n){var t=n||0,r=a;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 s=function(e,n,t){var a=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||r)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var s=0;s<16;++s)n[a+s]=o[s];return n||i(o)};const c={name:"JsClient",version:"0.0.8"},d=()=>window&&window.localStorage,u=e=>n=>{d()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))};var p={anonymousId:{getOrCreate:((e,n)=>()=>(e=>()=>{if(d()){const n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}})(e)()||n())("candu:anonymous_id",()=>{const e=s();return u("candu:anonymous_id")(e),e}),set:u("candu:anonymous_id")}};const m=()=>({path:window.location.pathname,url:window.location.href,title:document.title,search:window.location.search,referrer:document.referrer}),l=()=>({height:window.screen.height,width:window.screen.width}),w=e=>({source:e,locale:navigator.language,screen:window.screen&&l(),page:window&&document&&m(),userAgent:navigator.userAgent,library:c,timezone:window.Intl&&window.Intl.DateTimeFormat().resolvedOptions().timeZone}),g=(e,n,t={})=>({id:s(),anonymousId:p.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:w(t.source),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits});export default(e,n,r)=>{const a=n=>((e,n,t)=>{fetch(`${t&&`${t}/api/events`||"https://api.candu.ai/api/events"}?token=${e}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify(n)})})(e,n,r);return{identify:(e,n)=>a(g(e,t.Identify,{traits:n})),page:(e,r)=>a(g(n,t.Page,{pageName:e,properties:r})),screen:(e,r)=>a(g(n,t.Screen,{screenName:e,properties:r})),track:(e,r)=>a(g(n,t.Track,{eventName:e,properties:r}))}};
//# sourceMappingURL=index.es.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("crypto")):"function"==typeof define&&define.amd?define(["crypto"],t):(e=e||self)["@candulabs/eventing"]=t(e.crypto)}(this,(function(e){"use strict";var t,n;e=e&&e.hasOwnProperty("default")?e.default:e,function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(t||(t={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(n||(n={}));for(var r=function(){return e.randomBytes(16)},o=[],a=0;a<256;++a)o[a]=(a+256).toString(16).substr(1);var i=function(e,t){var n=t||0,r=o;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")};var s=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="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,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)};const d={name:"JsClient",version:"0.0.4"},c=()=>window&&window.localStorage,u=e=>t=>{c()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))};var p={anonymousId:{getOrCreate:((e,t)=>()=>(e=>()=>{if(c()){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}})(e)()||t())("candu:anonymous_id",()=>{const e=s();return u("candu:anonymous_id")(e),e}),set:u("candu:anonymous_id")}};const l=()=>({path:window.location.pathname,url:window.location.href,title:document.title,search:window.location.search,referrer:document.referrer}),f=()=>({height:window.screen.height,width:window.screen.width}),w=e=>({source:e,locale:navigator.language,screen:window.screen&&f(),page:window&&document&&l(),userAgent:navigator.userAgent,library:d,timezone:window.Intl&&window.Intl.DateTimeFormat().resolvedOptions().timeZone}),g=(e,t,n={})=>({id:s(),anonymousId:p.anonymousId.getOrCreate(),userId:e&&e.toString(),type:t,context:w(n.source),sentAt:(new Date).toISOString(),eventName:n.eventName,pageName:n.pageName,properties:n.properties,traits:n.traits});return(e,t,r)=>{const o=t=>((e,t,n)=>{fetch(`${n&&`${n}/api/events`||"https://api.candu.ai/api/events"}?token=${e}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify(t)})})(e,t,r);return{identify:(e,t)=>o(g(e,n.Identify,{traits:t})),page:(e,r)=>o(g(t,n.Page,{pageName:e,properties:r})),track:(e,r)=>o(g(t,n.Track,{eventName:e,properties:r}))}}}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("crypto")):"function"==typeof define&&define.amd?define(["crypto"],n):(e=e||self)["@candulabs/eventing"]=n(e.crypto)}(this,(function(e){"use strict";var n,t;e=e&&e.hasOwnProperty("default")?e.default:e,function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(n||(n={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(t||(t={}));for(var r=function(){return e.randomBytes(16)},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 s=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 s=0;s<16;++s)n[o+s]=a[s];return n||i(a)};const c={name:"JsClient",version:"0.0.8"},d=()=>window&&window.localStorage,u=e=>n=>{d()&&null!=n&&window.localStorage.setItem(e,JSON.stringify(n))};var p={anonymousId:{getOrCreate:((e,n)=>()=>(e=>()=>{if(d()){const n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(e){return null}}})(e)()||n())("candu:anonymous_id",()=>{const e=s();return u("candu:anonymous_id")(e),e}),set:u("candu:anonymous_id")}};const l=()=>({path:window.location.pathname,url:window.location.href,title:document.title,search:window.location.search,referrer:document.referrer}),f=()=>({height:window.screen.height,width:window.screen.width}),m=e=>({source:e,locale:navigator.language,screen:window.screen&&f(),page:window&&document&&l(),userAgent:navigator.userAgent,library:c,timezone:window.Intl&&window.Intl.DateTimeFormat().resolvedOptions().timeZone}),w=(e,n,t={})=>({id:s(),anonymousId:p.anonymousId.getOrCreate(),userId:e&&e.toString(),type:n,context:m(t.source),sentAt:(new Date).toISOString(),eventName:t.eventName,pageName:t.pageName,screenName:t.screenName,properties:t.properties,traits:t.traits});return(e,n,r)=>{const o=n=>((e,n,t)=>{fetch(`${t&&`${t}/api/events`||"https://api.candu.ai/api/events"}?token=${e}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify(n)})})(e,n,r);return{identify:(e,n)=>o(w(e,t.Identify,{traits:n})),page:(e,r)=>o(w(n,t.Page,{pageName:e,properties:r})),screen:(e,r)=>o(w(n,t.Screen,{screenName:e,properties:r})),track:(e,r)=>o(w(n,t.Track,{eventName:e,properties:r}))}}}));
//# sourceMappingURL=index.js.map

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

},
"version": "0.0.7",
"version": "0.0.8",
"main": "dist/index.js",

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

},
"gitHead": "1f10420662ca3012603f67bc127d338b3ddc6828"
"gitHead": "2e894aaca4512b81d867aa4d9ef5caf6bb6110af"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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