@didomi/iabtcf-core
Advanced tools
Comparing version 1.2.2 to 1.5.3
{ | ||
"name": "@didomi/iabtcf-core", | ||
"version": "1.2.2", | ||
"version": "1.5.3", | ||
"description": "Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).", | ||
@@ -8,4 +8,12 @@ "author": "Chris Paterson <tcf@chrispaterson.io>", | ||
"license": "Apache-2.0", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"type": "module", | ||
"main": "lib/cjs/index.js", | ||
"types": "lib/mjs/index.d.ts", | ||
"module": "lib/mjs/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./lib/mjs/index.js", | ||
"require": "./lib/cjs/index.js" | ||
} | ||
}, | ||
"files": [ | ||
@@ -24,24 +32,27 @@ "lib/**/*" | ||
"devDependencies": { | ||
"@iabtcf/testing": "1.2.1", | ||
"@didomi/iabtcf-testing": "1.5.3", | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
"@types/sinon": "^7.0.13", | ||
"@types/sinon-chai": "3.2.2", | ||
"@types/sinon": "^10.0.11", | ||
"@types/sinon-chai": "3.2.8", | ||
"@typescript-eslint/eslint-plugin": "^2.10.0", | ||
"@typescript-eslint/parser": "^2.10.0", | ||
"coveralls": "^3.0.4", | ||
"@typescript-eslint/parser": "^5.22.0", | ||
"chai": "^4.3.6", | ||
"coveralls": "^3.1.1", | ||
"eslint": "6.8.0", | ||
"eslint-import-resolver-typescript": "^2.7.1", | ||
"eslint-plugin-import": "^2.26.0", | ||
"jscover": "^1.0.0", | ||
"jsdom": "15.1.1", | ||
"jsdom": "16.5.0", | ||
"jsdom-global": "3.0.2", | ||
"mocha": "^6.2.2", | ||
"mocha": "^9.2.0", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"ndb": "^1.1.5", | ||
"nyc": "^14.1.1", | ||
"sinon": "^7.3.2", | ||
"sinon-chai": "^3.3.0", | ||
"sinon": "^13.0.1", | ||
"sinon-chai": "^3.7.0", | ||
"source-map-support": "^0.5.12", | ||
"terser": "^4.6.3", | ||
"ts-node": "^8.3.0", | ||
"typedoc": "^0.15.0", | ||
"typescript": "3.7" | ||
"terser": "^4.8.1", | ||
"ts-node": "^10.5.0", | ||
"typedoc": "^0.22.11", | ||
"typescript": "4.5.5" | ||
}, | ||
@@ -52,3 +63,4 @@ "eslintIgnore": [ | ||
"publishConfig": { | ||
"access": "public" | ||
"access": "public", | ||
"@didomi:registry": "https://registry.npmjs.org/" | ||
}, | ||
@@ -83,9 +95,6 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/didomi/iabtcf-es", | ||
"url": "https://github.com/InteractiveAdvertisingBureau/iabtcf-es.git", | ||
"directory": "modules/core" | ||
}, | ||
"dependencies": { | ||
"global": "^4.4.0", | ||
"typescript": "3.7" | ||
} | ||
"dependencies": {} | ||
} |
@@ -1,6 +0,6 @@ | ||
[![NPM version](https://img.shields.io/npm/v/@didomi/iabtcf-core.svg?style=flat-square)](https://www.npmjs.com/package/@didomi/iabtcf-core) | ||
[![npm module downloads per month](http://img.shields.io/npm/dm/@didomi/iabtcf-core.svg?style=flat)](https://www.npmjs.org/package/@didomi/iabtcf-core) | ||
[![NPM version](https://img.shields.io/npm/v/@iabtcf/core.svg?style=flat-square)](https://www.npmjs.com/package/@iabtcf/core) | ||
[![npm module downloads per month](http://img.shields.io/npm/dm/@iabtcf/core.svg?style=flat)](https://www.npmjs.org/package/@iabtcf/core) | ||
[![InteractiveAdvertisingBureau](https://circleci.com/gh/InteractiveAdvertisingBureau/iabtcf-es.svg?style=shield)](https://circleci.com/gh/InteractiveAdvertisingBureau/iabtcf-es) | ||
# @didomi/iabtcf-core | ||
# @iabtcf/core | ||
@@ -18,2 +18,3 @@ Ensures consistent encoding and decoding of [IAB's Transparency and Consent Framework (TCF)](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework) [TC Strings](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md#about-the-transparency--consent-string-tc-string) and the stateful persistence of the Transparency and Consent information while providing tools for the handling and manipulation of the [TCF](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework) [Global Vendor List](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md#the-global-vendor-list) data all free and open sourced ([License](LICENSE)). | ||
+ [Change GVL Language](#change-gvl-language) | ||
+ [Cloning a GVL with a Non-Default language](#cloning-a-gvl-with-a-non-default-language) | ||
+ [Get only vendors with a specific feature or purpose under legal basis](#get-only-vendors-with-a-specific-feature-or-purpose-under-legal-basis) | ||
@@ -33,3 +34,3 @@ + [Narrow the list of vendors](#narrow-the-list-of-vendors) | ||
``` | ||
npm install @didomi/iabtcf-core --save | ||
npm install @iabtcf/core --save | ||
``` | ||
@@ -39,3 +40,3 @@ | ||
``` | ||
yarn add @didomi/iabtcf-core | ||
yarn add @iabtcf/core | ||
``` | ||
@@ -47,3 +48,3 @@ | ||
```javascript | ||
import {TCModel, TCString, GVL} from '@didomi/iabtcf-core'; | ||
import {TCModel, TCString, GVL} from '@iabtcf/core'; | ||
@@ -82,3 +83,3 @@ /** | ||
```javascript | ||
import {TCModel} from '@didomi/iabtcf-core'; | ||
import {TCModel} from '@iabtcf/core'; | ||
@@ -104,3 +105,3 @@ // creates a TCModel | ||
```javascript | ||
import {TCModel} from '@didomi/iabtcf-core'; | ||
import {TCModel} from '@iabtcf/core'; | ||
@@ -183,3 +184,3 @@ const tcModel = new TCModel(); | ||
import {TCModel, PurposeRestriction, RestrictionType} from '@didomi/iabtcf-core'; | ||
import {TCModel, PurposeRestriction, RestrictionType} from '@iabtcf/core'; | ||
@@ -204,2 +205,3 @@ // first you must create a PurposeRestriction | ||
* [Change GVL Language](#change-gvl-language) | ||
* [Cloning a GVL with a Non-Default language](#cloning-a-gvl-with-a-non-default-language) | ||
* [Get only vendors with a specific feature or purpose under legal basis](#get-only-vendors-with-a-specific-feature-or-purpose-under-legal-basis) | ||
@@ -215,3 +217,3 @@ * [Narrow the list of vendors](#narrow-the-list-of-vendors) | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -233,3 +235,3 @@ // only needs to be set once per application as this is a static variable | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -257,3 +259,3 @@ // only needs to be set once per application as this is a static variable | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -275,3 +277,3 @@ // only needs to be set once per application as this is a static variable | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -297,3 +299,3 @@ // only needs to be set once per application as this is a static variable | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -311,3 +313,3 @@ const gvl = new GVL(gvljson); | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -329,3 +331,3 @@ // only needs to be set once per application as this is a static variable | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -347,3 +349,28 @@ const gvl = new GVL(gvljson); | ||
### Cloning a GVL with a Non-Default language | ||
When cloning a GVL with a non-default language, make sure that any prior `changeLanguage` call is resolved. If changeLanguage has not yet resolved, `clone` will make an http request for the current language but will have no indication of resolving that request since it is synchronous. | ||
```javascript | ||
import {GVL} from '@iabtcf/core'; | ||
const gvl = new GVL(); | ||
// Resolving changeLanguage promise using thenables. | ||
gvl.changeLanguage('fr').then(() => { | ||
const clone = gvl.clone(); | ||
}) | ||
// Resolving changeLanguage through async/await | ||
const someAsyncFunction = async () => { | ||
await gvl.changeLanguage('fr'); | ||
const clone = gvl.clone(); | ||
} | ||
``` | ||
### Get only vendors with a specific feature or purpose under legal basis | ||
@@ -361,3 +388,3 @@ A CMP UI may want to group vendors by what purpose they use under what legal basis and/or features. This can be accomplished quite easily by using one of the 6 grouping methods: | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -384,3 +411,3 @@ // only needs to be set once per application as this is a static variable | ||
```javascript | ||
import {GVL} from '@didomi/iabtcf-core'; | ||
import {GVL} from '@iabtcf/core'; | ||
@@ -421,3 +448,3 @@ // only needs to be set once per application as this is a static variable | ||
import {TCString, TCModel} from '@didomi/iabtcf-core'; | ||
import {TCString, TCModel} from '@iabtcf/core'; | ||
@@ -433,3 +460,3 @@ const myTCModel = TCString.decode(encodedTCString); | ||
```typescript | ||
import {TCString, TCModel, GVL} from '@didomi/iabtcf-core'; | ||
import {TCString, TCModel, GVL} from '@iabtcf/core'; | ||
@@ -468,3 +495,3 @@ /** | ||
import {TCString, Segment} from '@didomi/iabtcf-core'; | ||
import {TCString, Segment} from '@iabtcf/core'; | ||
@@ -491,6 +518,6 @@ // if you had a getCookie function that returned just that segment | ||
Options may be passed to the encoder to override defaults. In most cases the encoder can figure out what segments to include but if the string is surfaced to vendors or for storing in a cookie the encoding is slightly different. The `@didomi/iabtcf-cmpapi` handles this difference and CMPs don't need to worry about it. | ||
Options may be passed to the encoder to override defaults. In most cases the encoder can figure out what segments to include but if the string is surfaced to vendors or for storing in a cookie the encoding is slightly different. The `@iabtcf/cmpapi` handles this difference and CMPs don't need to worry about it. | ||
```typescript | ||
import {TCString, Segment} from '@didomi/iabtcf-core'; | ||
import {TCString, Segment} from '@iabtcf/core'; | ||
@@ -522,3 +549,2 @@ // produces the version of the string for the __tcfapi function | ||
const publisherTCSegment = TCString.encode(tcModel, encodingOptions); | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 4 instances in 1 package
307219
0
225
5930
527
Yes
25
28
1
- Removedglobal@^4.4.0
- Removedtypescript@3.7
- Removeddom-walk@0.1.2(transitive)
- Removedglobal@4.4.0(transitive)
- Removedmin-document@2.19.0(transitive)
- Removedprocess@0.11.10(transitive)
- Removedtypescript@3.7.7(transitive)