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.3 to 3.0.0-beta.4

2

dist/index.module.js
/*!
* Ecommerce tracking for Snowplow v3.0.0-beta.3 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.0.0-beta.4 (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.3 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.0.0-beta.4 (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.3 (http://bit.ly/sp-js)
* Core functionality for Snowplow JavaScript trackers v3.0.0-beta.4 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

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

if (json && isNonEmptyJson(json)) {
var jsonWithKeys = [keyIfEncoded, keyIfNotEncoded, json];
var jsonWithKeys = { keyIfEncoded: keyIfEncoded, keyIfNotEncoded: keyIfNotEncoded, json: json };
jsonForProcessing.push(jsonWithKeys);

@@ -378,3 +378,3 @@ allJson.push(jsonWithKeys);

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

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

/*!
* Ecommerce tracking for Snowplow v3.0.0-beta.3 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.0.0-beta.4 (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=[n,o,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 u=t();return u.add("e","ti"),u.add("ti_id",o),u.add("ti_sk",e),u.add("ti_nm",c),u.add("ti_ca",a),u.add("ti_pr",r),u.add("ti_qu",i),u.add("ti_cu",n),u}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]):d.warn(c+" not configured")}n.forEach(t)}catch(n){d.error("Function failed",n)}}var i,u;(u=i||(i={}))[u.none=0]="none",u[u.error=1]="error",u[u.warn=2]="warn",u[u.debug=3]="debug",u[u.info=4]="info";var d=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,u=n.state,d=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",u),s.add("tr_co",d),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,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})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@snowplow/browser-plugin-ecommerce",
"version": "3.0.0-beta.3",
"version": "3.0.0-beta.4",
"description": "Ecommerce tracking for Snowplow",

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

"dependencies": {
"@snowplow/browser-tracker-core": "3.0.0-beta.3",
"@snowplow/tracker-core": "3.0.0-beta.3",
"@snowplow/browser-tracker-core": "3.0.0-beta.4",
"@snowplow/tracker-core": "3.0.0-beta.4",
"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