snowplow-tracker-core
Advanced tools
Comparing version 0.5.0 to 0.6.0-beta1
@@ -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); | ||
} | ||
}; | ||
} |
{ | ||
"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 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
52548
7
11
1095