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.4.0 to 3.5.0

2

dist/index.module.js
/*!
* Ecommerce tracking for Snowplow v3.4.0 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.5.0 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang

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

/*!
* Ecommerce tracking for Snowplow v3.4.0 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.5.0 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang

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

/*!
* Core functionality for Snowplow JavaScript trackers v3.4.0 (http://bit.ly/sp-js)
* Core functionality for Snowplow JavaScript trackers v3.5.0 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang

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

function payloadBuilder() {
var dict = {}, allJson = [], jsonForProcessing = [];
var dict = {}, allJson = [], jsonForProcessing = [], contextEntitiesForProcessing = [];
var processor;

@@ -98,2 +98,5 @@ var add = function (key, value) {

};
var addContextEntity = function (entity) {
contextEntitiesForProcessing.push(entity);
};
return {

@@ -103,2 +106,3 @@ add: add,

addJson: addJson,
addContextEntity: addContextEntity,
getPayload: function () { return dict; },

@@ -110,3 +114,3 @@ getJson: function () { return allJson; },

build: function () {
processor === null || processor === void 0 ? void 0 : processor(this, jsonForProcessing);
processor === null || processor === void 0 ? void 0 : processor(this, jsonForProcessing, contextEntitiesForProcessing);
return dict;

@@ -379,3 +383,3 @@ }

/*!
* Core functionality for Snowplow Browser trackers v3.4.0 (http://bit.ly/sp-js)
* Core functionality for Snowplow Browser trackers v3.5.0 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -382,0 +386,0 @@ * Licensed under BSD-3-Clause

/*!
* Ecommerce tracking for Snowplow v3.4.0 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.5.0 (http://bit.ly/sp-js)
* Copyright 2022 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,t){if(t||2===arguments.length)for(var e,r=0,c=o.length;r<c;r++)!e&&r in o||(e||(e=Array.prototype.slice.call(o,0,r)),e[r]=o[r]);return n.concat(e||Array.prototype.slice.call(o))}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,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 c(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 a,i;(i=a||(a={}))[i.none=0]="none",i[i.error=1]="error",i[i.warn=2]="warn",i[i.debug=3]="debug",i[i.info=4]="info";var d=function(n){return void 0===n&&(n=a.warn),{setLogLevel:function(o){n=a[o]?o:a.warn},warn:function(t,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=a.warn&&"undefined"!=typeof console&&(c="Snowplow: "+t,e?console.warn.apply(console,o([c+"\n",e],r,!1)):console.warn.apply(console,o([c],r,!1)))},error:function(t,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=a.error&&"undefined"!=typeof console&&(c="Snowplow: "+t+"\n",e?console.error.apply(console,o([c+"\n",e],r,!1)):console.error.apply(console,o([c],r,!1)))},debug:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=a.debug&&"undefined"!=typeof console&&console.debug.apply(console,o(["Snowplow: "+t],e,!1))},info:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=a.info&&"undefined"!=typeof console&&console.info.apply(console,o(["Snowplow: "+t],e,!1))}}}(),u={},s={};n.EcommercePlugin=function(){return{activateBrowserPlugin:function(n){u[n.id]=n,s[n.id]={items:[]}}}},n.addItem=function(n,o){void 0===o&&(o=Object.keys(u)),o.forEach((function(o){s[o]&&s[o].items.push(n)}))},n.addTrans=function(n,o){void 0===o&&(o=Object.keys(u)),o.forEach((function(o){s[o]&&(s[o].transaction=n)}))},n.trackAddToCart=function(n,o){void 0===o&&(o=Object.keys(u)),c(o,u,(function(o){var t=(o=o.core).track,c=e({event:{schema:"iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0",data:r({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}});t.call(o,c,n.context,n.timestamp)}))},n.trackRemoveFromCart=function(n,o){void 0===o&&(o=Object.keys(u)),c(o,u,(function(o){var t=(o=o.core).track,c=e({event:{schema:"iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0",data:r({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}});t.call(o,c,n.context,n.timestamp)}))},n.trackTrans=function(n){void 0===n&&(n=Object.keys(u)),c(n,u,(function(n){var o=s[n.id].transaction;if(o){var e=n.core,r=e.track,c=o.orderId,a=o.total,i=o.affiliation,d=o.tax,u=o.shipping,l=o.city,f=o.state,p=o.country,y=o.currency,m=t();m.add("e","tr"),m.add("tr_id",c),m.add("tr_af",i),m.add("tr_tt",a),m.add("tr_tx",d),m.add("tr_sh",u),m.add("tr_ci",l),m.add("tr_st",f),m.add("tr_co",p),m.add("tr_cu",y),r.call(e,m,o.context,o.timestamp)}for(o=0;o<s[n.id].items.length;o++)e=s[n.id].items[o],c=(r=n.core).track,a=e.orderId,i=e.sku,d=e.price,u=e.name,l=e.category,f=e.quantity,p=e.currency,(y=t()).add("e","ti"),y.add("ti_id",a),y.add("ti_sk",i),y.add("ti_nm",u),y.add("ti_ca",l),y.add("ti_pr",d),y.add("ti_qu",f),y.add("ti_cu",p),c.call(r,y,e.context,e.timestamp);s[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,o){if(o||2===arguments.length)for(var e,r=0,c=t.length;r<c;r++)!e&&r in t||(e||(e=Array.prototype.slice.call(t,0,r)),e[r]=t[r]);return n.concat(e||Array.prototype.slice.call(t))}function o(){var n,t={},o=[],e=[],r=[],c=function(n,o){null!=o&&""!==o&&(t[n]=o)};return{add:c,addDict:function(n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&c(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))},addContextEntity:function(n){r.push(n)},getPayload:function(){return t},getJson:function(){return o},withJsonProcessor:function(t){n=t},build:function(){return null==n||n(this,e,r),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,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 c(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]):d.warn(c+" not configured")}n.forEach(o)}catch(n){d.error("Function failed",n)}}var a,i;(i=a||(a={}))[i.none=0]="none",i[i.error=1]="error",i[i.warn=2]="warn",i[i.debug=3]="debug",i[i.info=4]="info";var d=function(n){return void 0===n&&(n=a.warn),{setLogLevel:function(t){n=a[t]?t:a.warn},warn:function(o,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=a.warn&&"undefined"!=typeof console&&(c="Snowplow: "+o,e?console.warn.apply(console,t([c+"\n",e],r,!1)):console.warn.apply(console,t([c],r,!1)))},error:function(o,e){for(var r=[],c=2;c<arguments.length;c++)r[c-2]=arguments[c];n>=a.error&&"undefined"!=typeof console&&(c="Snowplow: "+o+"\n",e?console.error.apply(console,t([c+"\n",e],r,!1)):console.error.apply(console,t([c],r,!1)))},debug:function(o){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=a.debug&&"undefined"!=typeof console&&console.debug.apply(console,t(["Snowplow: "+o],e,!1))},info:function(o){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n>=a.info&&"undefined"!=typeof console&&console.info.apply(console,t(["Snowplow: "+o],e,!1))}}}(),u={},s={};n.EcommercePlugin=function(){return{activateBrowserPlugin:function(n){u[n.id]=n,s[n.id]={items:[]}}}},n.addItem=function(n,t){void 0===t&&(t=Object.keys(u)),t.forEach((function(t){s[t]&&s[t].items.push(n)}))},n.addTrans=function(n,t){void 0===t&&(t=Object.keys(u)),t.forEach((function(t){s[t]&&(s[t].transaction=n)}))},n.trackAddToCart=function(n,t){void 0===t&&(t=Object.keys(u)),c(t,u,(function(t){var o=(t=t.core).track,c=e({event:{schema:"iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0",data:r({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}});o.call(t,c,n.context,n.timestamp)}))},n.trackRemoveFromCart=function(n,t){void 0===t&&(t=Object.keys(u)),c(t,u,(function(t){var o=(t=t.core).track,c=e({event:{schema:"iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0",data:r({sku:n.sku,quantity:n.quantity,name:n.name,category:n.category,unitPrice:n.unitPrice,currency:n.currency})}});o.call(t,c,n.context,n.timestamp)}))},n.trackTrans=function(n){void 0===n&&(n=Object.keys(u)),c(n,u,(function(n){var t=s[n.id].transaction;if(t){var e=n.core,r=e.track,c=t.orderId,a=t.total,i=t.affiliation,d=t.tax,u=t.shipping,l=t.city,f=t.state,p=t.country,y=t.currency,m=o();m.add("e","tr"),m.add("tr_id",c),m.add("tr_af",i),m.add("tr_tt",a),m.add("tr_tx",d),m.add("tr_sh",u),m.add("tr_ci",l),m.add("tr_st",f),m.add("tr_co",p),m.add("tr_cu",y),r.call(e,m,t.context,t.timestamp)}for(t=0;t<s[n.id].items.length;t++)e=s[n.id].items[t],c=(r=n.core).track,a=e.orderId,i=e.sku,d=e.price,u=e.name,l=e.category,f=e.quantity,p=e.currency,(y=o()).add("e","ti"),y.add("ti_id",a),y.add("ti_sk",i),y.add("ti_nm",u),y.add("ti_ca",l),y.add("ti_pr",d),y.add("ti_qu",f),y.add("ti_cu",p),c.call(r,y,e.context,e.timestamp);s[n.id]={items:[]}}))},Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@snowplow/browser-plugin-ecommerce",
"version": "3.4.0",
"version": "3.5.0",
"description": "Ecommerce tracking for Snowplow",

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

"dependencies": {
"@snowplow/browser-tracker-core": "3.4.0",
"@snowplow/tracker-core": "3.4.0",
"@snowplow/browser-tracker-core": "3.5.0",
"@snowplow/tracker-core": "3.5.0",
"tslib": "^2.3.1"

@@ -50,3 +50,3 @@ },

"peerDependencies": {
"@snowplow/browser-tracker": "~3.4.0"
"@snowplow/browser-tracker": "~3.5.0"
},

@@ -53,0 +53,0 @@ "scripts": {

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