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

@snowplow/browser-plugin-ecommerce

Package Overview
Dependencies
Maintainers
3
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snowplow/browser-plugin-ecommerce - npm Package Compare versions

Comparing version 3.0.0-beta.4 to 3.0.0-beta.5

2

dist/index.module.js
/*!
* Ecommerce tracking for Snowplow v3.0.0-beta.4 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.0.0-beta.5 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -4,0 +4,0 @@ * Licensed under BSD-3-Clause

/*!
* Ecommerce tracking for Snowplow v3.0.0-beta.4 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.0.0-beta.5 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -35,3 +35,3 @@ * Licensed under BSD-3-Clause

/*!
* Core functionality for Snowplow JavaScript trackers v3.0.0-beta.4 (http://bit.ly/sp-js)
* Core functionality for Snowplow JavaScript trackers v3.0.0-beta.5 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -209,11 +209,9 @@ * Licensed under BSD-3-Clause

if (logLevel >= LOG_LEVEL.warn && typeof console !== 'undefined') {
if (typeof console !== 'undefined') {
var logMsg = label + message;
if (error) {
console.warn.apply(console, __spreadArray([logMsg + '\n', error], extraParams));
}
else {
console.warn.apply(console, __spreadArray([logMsg], extraParams));
}
var logMsg = label + message;
if (error) {
console.warn.apply(console, __spreadArray([logMsg + '\n', error], extraParams));
}
else {
console.warn.apply(console, __spreadArray([logMsg], extraParams));
}
}

@@ -230,5 +228,3 @@ }

if (logLevel >= LOG_LEVEL.debug && typeof console !== 'undefined') {
if (typeof console !== 'undefined') {
console.warn.apply(console, __spreadArray([label + message], extraParams));
}
console.debug.apply(console, __spreadArray([label + message], extraParams));
}

@@ -245,5 +241,3 @@ }

if (logLevel >= LOG_LEVEL.info && typeof console !== 'undefined') {
if (typeof console !== 'undefined') {
console.info.apply(console, __spreadArray([label + message], extraParams));
}
console.info.apply(console, __spreadArray([label + message], extraParams));
}

@@ -380,3 +374,3 @@ }

/*!
* Core functionality for Snowplow Browser trackers v3.0.0-beta.4 (http://bit.ly/sp-js)
* Core functionality for Snowplow Browser trackers v3.0.0-beta.5 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -383,0 +377,0 @@ * Licensed under BSD-3-Clause

/*!
* Ecommerce tracking for Snowplow v3.0.0-beta.4 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.0.0-beta.5 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -7,3 +7,3 @@ * Licensed under BSD-3-Clause

"use strict";!function(n,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((n="undefined"!=typeof globalThis?globalThis:n||self).snowplowEcommerce={})}(this,(function(n){function o(n,o){for(var t=0,e=o.length,r=n.length;t<e;t++,r++)n[r]=o[t];return n}function t(){var n,o={},t=[],e=[],r=function(n,t){null!=t&&""!==t&&(o[n]=t)};return{add:r,addDict:function(n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&r(o,n[o])},addJson:function(n,o,r){var c;if(c=r)n:{if(null!=r&&(r.constructor==={}.constructor||r.constructor===[].constructor))for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){c=!0;break n}c=!1}c&&(n={keyIfEncoded:n,keyIfNotEncoded:o,json:r},e.push(n),t.push(n))},getPayload:function(){return o},getJson:function(){return t},withJsonProcessor:function(o){n=o},build:function(){return null==n||n(this,e),o}}}function e(n){var o=n.event;return n={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:n=o.schema,data:o.data}},(o=t()).add("e","ue"),o.addJson("ue_px","ue_pr",n),o}function r(n){var o=n.orderId,e=n.sku,r=n.price,c=n.name,a=n.category,i=n.quantity;n=n.currency;var d=t();return d.add("e","ti"),d.add("ti_id",o),d.add("ti_sk",e),d.add("ti_nm",c),d.add("ti_ca",a),d.add("ti_pr",r),d.add("ti_qu",i),d.add("ti_cu",n),d}function c(n,o){void 0===o&&(o={});var t,e={};for(t in n)(o[t]||null!==n[t]&&void 0!==n[t])&&(e[t]=n[t]);return e}function a(n,o,t){try{var e=null!=n?n:Object.keys(o);n=[];for(var r=0;r<e.length;r++){var c=e[r];o.hasOwnProperty(c)?n.push(o[c]):u.warn(c+" not configured")}n.forEach(t)}catch(n){u.error("Function failed",n)}}var i,d;(d=i||(i={}))[d.none=0]="none",d[d.error=1]="error",d[d.warn=2]="warn",d[d.debug=3]="debug",d[d.info=4]="info";var u=function(n){return void 0===n&&(n=i.warn),{setLogLevel:function(o){n=i[o]?o:i.warn},warn:function(t,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=i.warn&&"undefined"!=typeof console&&"undefined"!=typeof console&&(c="Snowplow: "+t,e?console.warn.apply(console,o([c+"\n",e],r)):console.warn.apply(console,o([c],r)))},error:function(t,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=i.error&&"undefined"!=typeof console&&(c="Snowplow: "+t+"\n",e?console.error.apply(console,o([c+"\n",e],r)):console.error.apply(console,o([c],r)))},debug:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=i.debug&&"undefined"!=typeof console&&"undefined"!=typeof console&&console.warn.apply(console,o(["Snowplow: "+t],e))},info:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=i.info&&"undefined"!=typeof console&&"undefined"!=typeof console&&console.info.apply(console,o(["Snowplow: "+t],e))}}}(),s={},f={};n.EcommercePlugin=function(){return{activateBrowserPlugin:function(n){s[n.id]=n,f[n.id]={items:[]}}}},n.addItem=function(n,o){void 0===o&&(o=Object.keys(s)),o.forEach((function(o){f[o]&&f[o].items.push(n)}))},n.addTrans=function(n,o){void 0===o&&(o=Object.keys(s)),o.forEach((function(o){f[o]&&(f[o].transaction=n)}))},n.trackAddToCart=function(n,o){void 0===o&&(o=Object.keys(s)),a(o,s,(function(o){o.core.track(e({event:{schema:"iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0",data:c({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}}),n.context,n.timestamp)}))},n.trackRemoveFromCart=function(n,o){void 0===o&&(o=Object.keys(s)),a(o,s,(function(o){o.core.track(e({event:{schema:"iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0",data:c({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}}),n.context,n.timestamp)}))},n.trackTrans=function(n){void 0===n&&(n=Object.keys(s)),a(n,s,(function(n){var o=f[n.id].transaction;for(o&&n.core.track(function(n){var o=n.orderId,e=n.total,r=n.affiliation,c=n.tax,a=n.shipping,i=n.city,d=n.state,u=n.country;n=n.currency;var s=t();return s.add("e","tr"),s.add("tr_id",o),s.add("tr_af",r),s.add("tr_tt",e),s.add("tr_tx",c),s.add("tr_sh",a),s.add("tr_ci",i),s.add("tr_st",d),s.add("tr_co",u),s.add("tr_cu",n),s}(o),o.context,o.timestamp),o=0;o<f[n.id].items.length;o++){var e=f[n.id].items[o];n.core.track(r(e),e.context,e.timestamp)}f[n.id]={items:[]}}))},Object.defineProperty(n,"__esModule",{value:!0})}));
"use strict";!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).snowplowEcommerce={})}(this,(function(n){function t(n,t){for(var o=0,e=t.length,r=n.length;o<e;o++,r++)n[r]=t[o];return n}function o(){var n,t={},o=[],e=[],r=function(n,o){null!=o&&""!==o&&(t[n]=o)};return{add:r,addDict:function(n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r(t,n[t])},addJson:function(n,t,r){var c;if(c=r)n:{if(null!=r&&(r.constructor==={}.constructor||r.constructor===[].constructor))for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){c=!0;break n}c=!1}c&&(n={keyIfEncoded:n,keyIfNotEncoded:t,json:r},e.push(n),o.push(n))},getPayload:function(){return t},getJson:function(){return o},withJsonProcessor:function(t){n=t},build:function(){return null==n||n(this,e),t}}}function e(n){var t=n.event;return n={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:n=t.schema,data:t.data}},(t=o()).add("e","ue"),t.addJson("ue_px","ue_pr",n),t}function r(n){var t=n.orderId,e=n.sku,r=n.price,c=n.name,a=n.category,i=n.quantity;n=n.currency;var d=o();return d.add("e","ti"),d.add("ti_id",t),d.add("ti_sk",e),d.add("ti_nm",c),d.add("ti_ca",a),d.add("ti_pr",r),d.add("ti_qu",i),d.add("ti_cu",n),d}function c(n,t){void 0===t&&(t={});var o,e={};for(o in n)(t[o]||null!==n[o]&&void 0!==n[o])&&(e[o]=n[o]);return e}function a(n,t,o){try{var e=null!=n?n:Object.keys(t);n=[];for(var r=0;r<e.length;r++){var c=e[r];t.hasOwnProperty(c)?n.push(t[c]):u.warn(c+" not configured")}n.forEach(o)}catch(n){u.error("Function failed",n)}}var i,d;(d=i||(i={}))[d.none=0]="none",d[d.error=1]="error",d[d.warn=2]="warn",d[d.debug=3]="debug",d[d.info=4]="info";var u=function(n){return void 0===n&&(n=i.warn),{setLogLevel:function(t){n=i[t]?t:i.warn},warn:function(o,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=i.warn&&"undefined"!=typeof console&&(c="Snowplow: "+o,e?console.warn.apply(console,t([c+"\n",e],r)):console.warn.apply(console,t([c],r)))},error:function(o,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=i.error&&"undefined"!=typeof console&&(c="Snowplow: "+o+"\n",e?console.error.apply(console,t([c+"\n",e],r)):console.error.apply(console,t([c],r)))},debug:function(o){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=i.debug&&"undefined"!=typeof console&&console.debug.apply(console,t(["Snowplow: "+o],e))},info:function(o){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=i.info&&"undefined"!=typeof console&&console.info.apply(console,t(["Snowplow: "+o],e))}}}(),s={},f={};n.EcommercePlugin=function(){return{activateBrowserPlugin:function(n){s[n.id]=n,f[n.id]={items:[]}}}},n.addItem=function(n,t){void 0===t&&(t=Object.keys(s)),t.forEach((function(t){f[t]&&f[t].items.push(n)}))},n.addTrans=function(n,t){void 0===t&&(t=Object.keys(s)),t.forEach((function(t){f[t]&&(f[t].transaction=n)}))},n.trackAddToCart=function(n,t){void 0===t&&(t=Object.keys(s)),a(t,s,(function(t){t.core.track(e({event:{schema:"iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0",data:c({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}}),n.context,n.timestamp)}))},n.trackRemoveFromCart=function(n,t){void 0===t&&(t=Object.keys(s)),a(t,s,(function(t){t.core.track(e({event:{schema:"iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0",data:c({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}}),n.context,n.timestamp)}))},n.trackTrans=function(n){void 0===n&&(n=Object.keys(s)),a(n,s,(function(n){var t=f[n.id].transaction;for(t&&n.core.track(function(n){var t=n.orderId,e=n.total,r=n.affiliation,c=n.tax,a=n.shipping,i=n.city,d=n.state,u=n.country;n=n.currency;var s=o();return s.add("e","tr"),s.add("tr_id",t),s.add("tr_af",r),s.add("tr_tt",e),s.add("tr_tx",c),s.add("tr_sh",a),s.add("tr_ci",i),s.add("tr_st",d),s.add("tr_co",u),s.add("tr_cu",n),s}(t),t.context,t.timestamp),t=0;t<f[n.id].items.length;t++){var e=f[n.id].items[t];n.core.track(r(e),e.context,e.timestamp)}f[n.id]={items:[]}}))},Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@snowplow/browser-plugin-ecommerce",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"description": "Ecommerce tracking for Snowplow",

@@ -24,4 +24,4 @@ "homepage": "http://bit.ly/sp-js",

"dependencies": {
"@snowplow/browser-tracker-core": "3.0.0-beta.4",
"@snowplow/tracker-core": "3.0.0-beta.4",
"@snowplow/browser-tracker-core": "3.0.0-beta.5",
"@snowplow/tracker-core": "3.0.0-beta.5",
"tslib": "^2.1.0"

@@ -28,0 +28,0 @@ },

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