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

snowplow-tracker-core

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snowplow-tracker-core - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0-beta1

78

lib/core.ts

@@ -881,4 +881,82 @@ /*

}, context, tstamp);
},
/**
* Track a consent withdrawn event
*
* @param {boolean} all - Indicates user withdraws consent for all documents.
* @param {number} [id] - ID number associated with document.
* @param {number} [version] - Version number of document.
* @param {string} [name] - Name of document.
* @param {string} [description] - Description of document.
* @param {Array<SelfDescribingJson>} [context] - Context relating to the event.
* @param {Timestamp} [tstamp] - TrackerTimestamp of the event.
* @return Payload
*/
trackConsentWithdrawn: function(
all: boolean,
id?: number,
version?: number,
name?: string,
description?: string,
context?: Array<SelfDescribingJson>,
tstamp?: Timestamp): PayloadData {
let documentJson = {
schema: 'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0',
data: removeEmptyProperties({
id: id,
version: version,
name: name,
description: description
})
};
return trackSelfDescribingEvent({
schema: 'iglu:com.snowplowanalytics.snowplow/consent_withdrawn/jsonschema/1-0-0',
data: removeEmptyProperties({
all: all
})
}, documentJson.data && context ? context.concat([documentJson]) : context, tstamp);
},
/**
* Track a consent granted event
*
* @param {number} id - ID number associated with document.
* @param {number} version - Version number of document.
* @param {string} [name] - Name of document.
* @param {string} [description] - Description of document.
* @param {string} [expiry] - Date-time when consent expires.
* @param {Array<SelfDescribingJson>} [context] - Context relating to the event.
* @param {Timestamp} [tstamp] - TrackerTimestamp of the event.
* @return Payload
*/
trackConsentGranted: function(
id: number,
version: number,
name?: string,
description?: string,
expiry?: string,
context?: Array<SelfDescribingJson>,
tstamp?: Timestamp): PayloadData {
let documentJson = {
schema: 'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0',
data: removeEmptyProperties({
id: id,
version: version,
name: name,
description: description,
})
};
return trackSelfDescribingEvent({
schema: 'iglu:com.snowplowanalytics.snowplow/consent_granted/jsonschema/1-0-0',
data: removeEmptyProperties({
expiry: expiry,
})
}, context ? context.concat([documentJson]) : [documentJson], tstamp);
}
};
}

5

package.json
{
"name": "snowplow-tracker-core",
"version": "0.5.0",
"version": "0.6.0-beta1",
"devDependencies": {

@@ -9,3 +9,4 @@ "grunt": "0.4.5",

"grunt-ts": "5.5.1",
"typescript": "2.0.6",
"typescript": "2.2.2",
"@types/es6-shim": "0.31.34",
"@types/uuid": "^2.0.29"

@@ -12,0 +13,0 @@ },

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