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.1.1-beta.1 to 3.1.1-beta.2

2

dist/index.module.d.ts

@@ -24,3 +24,3 @@ import { BrowserPlugin } from '@snowplow/browser-tracker-core';

*
* @remark
* @remarks
* This call will send the data specified with addTrans, ddItem methods to the tracking server.

@@ -27,0 +27,0 @@ */

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

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

*
* @remark
* @remarks
* This call will send the data specified with addTrans, ddItem methods to the tracking server.

@@ -91,0 +91,0 @@ */

@@ -24,3 +24,3 @@ import { BrowserPlugin } from '@snowplow/browser-tracker-core';

*
* @remark
* @remarks
* This call will send the data specified with addTrans, ddItem methods to the tracking server.

@@ -27,0 +27,0 @@ */

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

@@ -28,10 +28,14 @@ * Licensed under BSD-3-Clause

function __spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}
/*!
* Core functionality for Snowplow JavaScript trackers v3.1.1-beta.1 (http://bit.ly/sp-js)
* Core functionality for Snowplow JavaScript trackers v3.1.1-beta.2 (http://bit.ly/sp-js)
* Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -250,3 +254,3 @@ * Licensed under BSD-3-Clause

* @param event - Contains the properties and schema location for the event
* @return PayloadBuilder to be sent to {@link Core.track()}
* @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}
*/

@@ -269,3 +273,3 @@ function buildSelfDescribingEvent(event) {

* @param event - Contains the properties for the Ecommerce Transactoion event
* @return PayloadBuilder to be sent to {@link Core.track()}
* @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}
*/

@@ -292,3 +296,3 @@ function buildEcommerceTransaction(event) {

* @param event - Contains the properties for the Ecommerce Transaction Item event
* @return PayloadBuilder to be sent to {@link Core.track()}
* @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}
*/

@@ -313,3 +317,3 @@ function buildEcommerceTransactionItem(event) {

* @param event - Contains the properties for the Add To Cart event
* @return PayloadBuilder to be sent to {@link Core.track()}
* @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}
*/

@@ -338,3 +342,3 @@ function buildAddToCart(event) {

* @param event - Contains the properties for the Remove From Cart event
* @return PayloadBuilder to be sent to {@link Core.track()}
* @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}
*/

@@ -362,3 +366,3 @@ function buildRemoveFromCart(event) {

* @param exemptFields - Set of fields which should not be removed even if empty
* @return A cleaned copy of eventJson
* @returns A cleaned copy of eventJson
*/

@@ -377,3 +381,3 @@ function removeEmptyProperties(event, exemptFields) {

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

@@ -489,3 +493,3 @@ * Licensed under BSD-3-Clause

*
* @remark
* @remarks
* This call will send the data specified with addTrans, ddItem methods to the tracking server.

@@ -492,0 +496,0 @@ */

@@ -24,3 +24,3 @@ import { BrowserPlugin } from '@snowplow/browser-tracker-core';

*
* @remark
* @remarks
* This call will send the data specified with addTrans, ddItem methods to the tracking server.

@@ -27,0 +27,0 @@ */

/*!
* Ecommerce tracking for Snowplow v3.1.1-beta.1 (http://bit.ly/sp-js)
* Ecommerce tracking for Snowplow v3.1.1-beta.2 (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,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})}));
"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||t)}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.1.1-beta.1",
"description": "Ecommerce tracking for Snowplow",
"homepage": "http://bit.ly/sp-js",
"bugs": "https://github.com/snowplow/snowplow-javascript-tracker/issues",
"repository": {
"type": "git",
"url": "https://github.com/snowplow/snowplow-javascript-tracker.git"
},
"license": "BSD-3-Clause",
"author": "Paul Boocock",
"sideEffects": false,
"main": "./dist/index.umd.js",
"module": "./dist/index.module.js",
"types": "./dist/index.module.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rollup -c --silent --failAfterWarnings",
"test": "jest --no-cache"
},
"dependencies": {
"@snowplow/browser-tracker-core": "3.1.1-beta.1",
"@snowplow/tracker-core": "3.1.1-beta.1",
"tslib": "^2.1.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@types/jest": "^26.0.20",
"@types/lodash": "^4.14.168",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"@wessberg/rollup-plugin-ts": "^1.3.10",
"eslint": "^7.7.0",
"jest": "^26.6.3",
"jest-standard-reporter": "^2.0.0",
"lodash": "^4.17.21",
"rollup": "^2.41.1",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-license": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^26.5.0",
"typescript": "^4.2.3"
},
"peerDependencies": {
"@snowplow/browser-tracker": "~3.1.1-beta.1"
}
}
"name": "@snowplow/browser-plugin-ecommerce",
"version": "3.1.1-beta.2",
"description": "Ecommerce tracking for Snowplow",
"homepage": "http://bit.ly/sp-js",
"bugs": "https://github.com/snowplow/snowplow-javascript-tracker/issues",
"repository": {
"type": "git",
"url": "https://github.com/snowplow/snowplow-javascript-tracker.git"
},
"license": "BSD-3-Clause",
"author": "Paul Boocock",
"sideEffects": false,
"main": "./dist/index.umd.js",
"module": "./dist/index.module.js",
"types": "./dist/index.module.d.ts",
"files": [
"dist"
],
"dependencies": {
"@snowplow/browser-tracker-core": "3.1.1-beta.2",
"@snowplow/tracker-core": "3.1.1-beta.2",
"tslib": "^2.3.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@types/jest": "^26.0.20",
"@types/lodash": "^4.14.168",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"rollup-plugin-ts": "^1.4.0",
"eslint": "^7.7.0",
"jest": "^26.6.3",
"jest-standard-reporter": "^2.0.0",
"lodash": "^4.17.21",
"rollup": "^2.41.1",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-license": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^26.5.0",
"typescript": "^4.3.5"
},
"peerDependencies": {
"@snowplow/browser-tracker": "~3.1.1-beta.2"
},
"scripts": {
"build": "rollup -c --silent --failAfterWarnings",
"test": "jest --no-cache"
}
}

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