@pubtech-ai/core 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +527 -0
- package/lib/cjs/Cloneable.d.ts +27 -0
- package/lib/cjs/Cloneable.js +1 -0
- package/lib/cjs/GVL.d.ts +295 -0
- package/lib/cjs/GVL.js +1 -0
- package/lib/cjs/Json.d.ts +20 -0
- package/lib/cjs/Json.js +1 -0
- package/lib/cjs/TCModel.d.ts +337 -0
- package/lib/cjs/TCModel.js +1 -0
- package/lib/cjs/TCString.d.ts +27 -0
- package/lib/cjs/TCString.js +1 -0
- package/lib/cjs/encoder/Base64Url.d.ts +29 -0
- package/lib/cjs/encoder/Base64Url.js +1 -0
- package/lib/cjs/encoder/BitLength.d.ts +32 -0
- package/lib/cjs/encoder/BitLength.js +1 -0
- package/lib/cjs/encoder/EncodingOptions.d.ts +6 -0
- package/lib/cjs/encoder/EncodingOptions.js +1 -0
- package/lib/cjs/encoder/SegmentEncoder.d.ts +8 -0
- package/lib/cjs/encoder/SegmentEncoder.js +1 -0
- package/lib/cjs/encoder/SemanticPreEncoder.d.ts +6 -0
- package/lib/cjs/encoder/SemanticPreEncoder.js +1 -0
- package/lib/cjs/encoder/field/BooleanEncoder.d.ts +4 -0
- package/lib/cjs/encoder/field/BooleanEncoder.js +1 -0
- package/lib/cjs/encoder/field/DateEncoder.d.ts +4 -0
- package/lib/cjs/encoder/field/DateEncoder.js +1 -0
- package/lib/cjs/encoder/field/FieldEncoderMap.d.ts +1 -0
- package/lib/cjs/encoder/field/FieldEncoderMap.js +1 -0
- package/lib/cjs/encoder/field/FixedVectorEncoder.d.ts +5 -0
- package/lib/cjs/encoder/field/FixedVectorEncoder.js +1 -0
- package/lib/cjs/encoder/field/IntEncoder.d.ts +4 -0
- package/lib/cjs/encoder/field/IntEncoder.js +1 -0
- package/lib/cjs/encoder/field/LangEncoder.d.ts +4 -0
- package/lib/cjs/encoder/field/LangEncoder.js +1 -0
- package/lib/cjs/encoder/field/PurposeRestrictionVectorEncoder.d.ts +5 -0
- package/lib/cjs/encoder/field/PurposeRestrictionVectorEncoder.js +1 -0
- package/lib/cjs/encoder/field/VectorEncodingType.d.ts +4 -0
- package/lib/cjs/encoder/field/VectorEncodingType.js +1 -0
- package/lib/cjs/encoder/field/VendorVectorEncoder.d.ts +6 -0
- package/lib/cjs/encoder/field/VendorVectorEncoder.js +1 -0
- package/lib/cjs/encoder/field/index.d.ts +9 -0
- package/lib/cjs/encoder/field/index.js +1 -0
- package/lib/cjs/encoder/index.d.ts +7 -0
- package/lib/cjs/encoder/index.js +1 -0
- package/lib/cjs/encoder/sequence/FieldSequence.d.ts +5 -0
- package/lib/cjs/encoder/sequence/FieldSequence.js +1 -0
- package/lib/cjs/encoder/sequence/SegmentSequence.d.ts +9 -0
- package/lib/cjs/encoder/sequence/SegmentSequence.js +1 -0
- package/lib/cjs/encoder/sequence/SequenceVersionMap.d.ts +7 -0
- package/lib/cjs/encoder/sequence/SequenceVersionMap.js +1 -0
- package/lib/cjs/encoder/sequence/index.d.ts +3 -0
- package/lib/cjs/encoder/sequence/index.js +1 -0
- package/lib/cjs/errors/DecodingError.d.ts +15 -0
- package/lib/cjs/errors/DecodingError.js +1 -0
- package/lib/cjs/errors/EncodingError.d.ts +15 -0
- package/lib/cjs/errors/EncodingError.js +1 -0
- package/lib/cjs/errors/GVLError.d.ts +15 -0
- package/lib/cjs/errors/GVLError.js +1 -0
- package/lib/cjs/errors/TCModelError.d.ts +16 -0
- package/lib/cjs/errors/TCModelError.js +1 -0
- package/lib/cjs/errors/index.d.ts +4 -0
- package/lib/cjs/errors/index.js +1 -0
- package/lib/cjs/index.d.ts +8 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/model/BinarySearchTree.d.ts +30 -0
- package/lib/cjs/model/BinarySearchTree.js +1 -0
- package/lib/cjs/model/ConsentLanguages.d.ts +6 -0
- package/lib/cjs/model/ConsentLanguages.js +1 -0
- package/lib/cjs/model/DeviceDisclosure.d.ts +9 -0
- package/lib/cjs/model/DeviceDisclosure.js +1 -0
- package/lib/cjs/model/DeviceDisclosureStorageAccessType.d.ts +5 -0
- package/lib/cjs/model/DeviceDisclosureStorageAccessType.js +1 -0
- package/lib/cjs/model/Fields.d.ts +29 -0
- package/lib/cjs/model/Fields.js +1 -0
- package/lib/cjs/model/IntMap.d.ts +13 -0
- package/lib/cjs/model/IntMap.js +1 -0
- package/lib/cjs/model/KeyMap.d.ts +12 -0
- package/lib/cjs/model/KeyMap.js +1 -0
- package/lib/cjs/model/PurposeRestriction.d.ts +33 -0
- package/lib/cjs/model/PurposeRestriction.js +1 -0
- package/lib/cjs/model/PurposeRestrictionVector.d.ts +100 -0
- package/lib/cjs/model/PurposeRestrictionVector.js +1 -0
- package/lib/cjs/model/RestrictionType.d.ts +19 -0
- package/lib/cjs/model/RestrictionType.js +1 -0
- package/lib/cjs/model/Segment.d.ts +6 -0
- package/lib/cjs/model/Segment.js +1 -0
- package/lib/cjs/model/SegmentIDs.d.ts +12 -0
- package/lib/cjs/model/SegmentIDs.js +1 -0
- package/lib/cjs/model/Vector.d.ts +72 -0
- package/lib/cjs/model/Vector.js +1 -0
- package/lib/cjs/model/gvl/ByPurposeVendorMap.d.ts +7 -0
- package/lib/cjs/model/gvl/ByPurposeVendorMap.js +1 -0
- package/lib/cjs/model/gvl/DataCategory.d.ts +4 -0
- package/lib/cjs/model/gvl/DataCategory.js +1 -0
- package/lib/cjs/model/gvl/DataRetention.d.ts +6 -0
- package/lib/cjs/model/gvl/DataRetention.js +1 -0
- package/lib/cjs/model/gvl/Declarations.d.ts +13 -0
- package/lib/cjs/model/gvl/Declarations.js +1 -0
- package/lib/cjs/model/gvl/Feature.d.ts +5 -0
- package/lib/cjs/model/gvl/Feature.js +1 -0
- package/lib/cjs/model/gvl/GVLMapItem.d.ts +4 -0
- package/lib/cjs/model/gvl/GVLMapItem.js +1 -0
- package/lib/cjs/model/gvl/IDSetMap.d.ts +2 -0
- package/lib/cjs/model/gvl/IDSetMap.js +1 -0
- package/lib/cjs/model/gvl/Purpose.d.ts +5 -0
- package/lib/cjs/model/gvl/Purpose.js +1 -0
- package/lib/cjs/model/gvl/Stack.d.ts +6 -0
- package/lib/cjs/model/gvl/Stack.js +1 -0
- package/lib/cjs/model/gvl/Vendor.d.ts +24 -0
- package/lib/cjs/model/gvl/Vendor.js +1 -0
- package/lib/cjs/model/gvl/VendorList.d.ts +10 -0
- package/lib/cjs/model/gvl/VendorList.js +1 -0
- package/lib/cjs/model/gvl/VendorUrl.d.ts +5 -0
- package/lib/cjs/model/gvl/VendorUrl.js +1 -0
- package/lib/cjs/model/gvl/index.d.ts +10 -0
- package/lib/cjs/model/gvl/index.js +1 -0
- package/lib/cjs/model/index.d.ts +14 -0
- package/lib/cjs/model/index.js +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/mjs/Cloneable.d.ts +27 -0
- package/lib/mjs/Cloneable.js +76 -0
- package/lib/mjs/GVL.d.ts +295 -0
- package/lib/mjs/GVL.js +591 -0
- package/lib/mjs/Json.d.ts +20 -0
- package/lib/mjs/Json.js +74 -0
- package/lib/mjs/TCModel.d.ts +337 -0
- package/lib/mjs/TCModel.js +512 -0
- package/lib/mjs/TCString.d.ts +27 -0
- package/lib/mjs/TCString.js +71 -0
- package/lib/mjs/encoder/Base64Url.d.ts +29 -0
- package/lib/mjs/encoder/Base64Url.js +80 -0
- package/lib/mjs/encoder/BitLength.d.ts +32 -0
- package/lib/mjs/encoder/BitLength.js +32 -0
- package/lib/mjs/encoder/EncodingOptions.d.ts +6 -0
- package/lib/mjs/encoder/EncodingOptions.js +1 -0
- package/lib/mjs/encoder/SegmentEncoder.d.ts +8 -0
- package/lib/mjs/encoder/SegmentEncoder.js +106 -0
- package/lib/mjs/encoder/SemanticPreEncoder.d.ts +6 -0
- package/lib/mjs/encoder/SemanticPreEncoder.js +133 -0
- package/lib/mjs/encoder/field/BooleanEncoder.d.ts +4 -0
- package/lib/mjs/encoder/field/BooleanEncoder.js +9 -0
- package/lib/mjs/encoder/field/DateEncoder.d.ts +4 -0
- package/lib/mjs/encoder/field/DateEncoder.js +15 -0
- package/lib/mjs/encoder/field/FieldEncoderMap.d.ts +1 -0
- package/lib/mjs/encoder/field/FieldEncoderMap.js +39 -0
- package/lib/mjs/encoder/field/FixedVectorEncoder.d.ts +5 -0
- package/lib/mjs/encoder/field/FixedVectorEncoder.js +25 -0
- package/lib/mjs/encoder/field/IntEncoder.d.ts +4 -0
- package/lib/mjs/encoder/field/IntEncoder.js +25 -0
- package/lib/mjs/encoder/field/LangEncoder.d.ts +4 -0
- package/lib/mjs/encoder/field/LangEncoder.js +36 -0
- package/lib/mjs/encoder/field/PurposeRestrictionVectorEncoder.d.ts +5 -0
- package/lib/mjs/encoder/field/PurposeRestrictionVectorEncoder.js +109 -0
- package/lib/mjs/encoder/field/VectorEncodingType.d.ts +4 -0
- package/lib/mjs/encoder/field/VectorEncodingType.js +5 -0
- package/lib/mjs/encoder/field/VendorVectorEncoder.d.ts +6 -0
- package/lib/mjs/encoder/field/VendorVectorEncoder.js +156 -0
- package/lib/mjs/encoder/field/index.d.ts +9 -0
- package/lib/mjs/encoder/field/index.js +9 -0
- package/lib/mjs/encoder/index.d.ts +7 -0
- package/lib/mjs/encoder/index.js +7 -0
- package/lib/mjs/encoder/sequence/FieldSequence.d.ts +5 -0
- package/lib/mjs/encoder/sequence/FieldSequence.js +53 -0
- package/lib/mjs/encoder/sequence/SegmentSequence.d.ts +9 -0
- package/lib/mjs/encoder/sequence/SegmentSequence.js +52 -0
- package/lib/mjs/encoder/sequence/SequenceVersionMap.d.ts +7 -0
- package/lib/mjs/encoder/sequence/SequenceVersionMap.js +1 -0
- package/lib/mjs/encoder/sequence/index.d.ts +3 -0
- package/lib/mjs/encoder/sequence/index.js +4 -0
- package/lib/mjs/errors/DecodingError.d.ts +15 -0
- package/lib/mjs/errors/DecodingError.js +18 -0
- package/lib/mjs/errors/EncodingError.d.ts +15 -0
- package/lib/mjs/errors/EncodingError.js +18 -0
- package/lib/mjs/errors/GVLError.d.ts +15 -0
- package/lib/mjs/errors/GVLError.js +18 -0
- package/lib/mjs/errors/TCModelError.d.ts +16 -0
- package/lib/mjs/errors/TCModelError.js +19 -0
- package/lib/mjs/errors/index.d.ts +4 -0
- package/lib/mjs/errors/index.js +4 -0
- package/lib/mjs/index.d.ts +8 -0
- package/lib/mjs/index.js +9 -0
- package/lib/mjs/model/BinarySearchTree.d.ts +30 -0
- package/lib/mjs/model/BinarySearchTree.js +267 -0
- package/lib/mjs/model/ConsentLanguages.d.ts +6 -0
- package/lib/mjs/model/ConsentLanguages.js +42 -0
- package/lib/mjs/model/DeviceDisclosure.d.ts +9 -0
- package/lib/mjs/model/DeviceDisclosure.js +1 -0
- package/lib/mjs/model/DeviceDisclosureStorageAccessType.d.ts +5 -0
- package/lib/mjs/model/DeviceDisclosureStorageAccessType.js +6 -0
- package/lib/mjs/model/Fields.d.ts +29 -0
- package/lib/mjs/model/Fields.js +29 -0
- package/lib/mjs/model/IntMap.d.ts +13 -0
- package/lib/mjs/model/IntMap.js +1 -0
- package/lib/mjs/model/KeyMap.d.ts +12 -0
- package/lib/mjs/model/KeyMap.js +1 -0
- package/lib/mjs/model/PurposeRestriction.d.ts +33 -0
- package/lib/mjs/model/PurposeRestriction.js +69 -0
- package/lib/mjs/model/PurposeRestrictionVector.d.ts +100 -0
- package/lib/mjs/model/PurposeRestrictionVector.js +286 -0
- package/lib/mjs/model/RestrictionType.d.ts +19 -0
- package/lib/mjs/model/RestrictionType.js +20 -0
- package/lib/mjs/model/Segment.d.ts +6 -0
- package/lib/mjs/model/Segment.js +7 -0
- package/lib/mjs/model/SegmentIDs.d.ts +12 -0
- package/lib/mjs/model/SegmentIDs.js +21 -0
- package/lib/mjs/model/Vector.d.ts +72 -0
- package/lib/mjs/model/Vector.js +161 -0
- package/lib/mjs/model/gvl/ByPurposeVendorMap.d.ts +7 -0
- package/lib/mjs/model/gvl/ByPurposeVendorMap.js +1 -0
- package/lib/mjs/model/gvl/DataCategory.d.ts +4 -0
- package/lib/mjs/model/gvl/DataCategory.js +1 -0
- package/lib/mjs/model/gvl/DataRetention.d.ts +6 -0
- package/lib/mjs/model/gvl/DataRetention.js +1 -0
- package/lib/mjs/model/gvl/Declarations.d.ts +13 -0
- package/lib/mjs/model/gvl/Declarations.js +1 -0
- package/lib/mjs/model/gvl/Feature.d.ts +5 -0
- package/lib/mjs/model/gvl/Feature.js +2 -0
- package/lib/mjs/model/gvl/GVLMapItem.d.ts +4 -0
- package/lib/mjs/model/gvl/GVLMapItem.js +1 -0
- package/lib/mjs/model/gvl/IDSetMap.d.ts +2 -0
- package/lib/mjs/model/gvl/IDSetMap.js +1 -0
- package/lib/mjs/model/gvl/Purpose.d.ts +5 -0
- package/lib/mjs/model/gvl/Purpose.js +1 -0
- package/lib/mjs/model/gvl/Stack.d.ts +6 -0
- package/lib/mjs/model/gvl/Stack.js +1 -0
- package/lib/mjs/model/gvl/Vendor.d.ts +24 -0
- package/lib/mjs/model/gvl/Vendor.js +1 -0
- package/lib/mjs/model/gvl/VendorList.d.ts +10 -0
- package/lib/mjs/model/gvl/VendorList.js +1 -0
- package/lib/mjs/model/gvl/VendorUrl.d.ts +5 -0
- package/lib/mjs/model/gvl/VendorUrl.js +1 -0
- package/lib/mjs/model/gvl/index.d.ts +10 -0
- package/lib/mjs/model/gvl/index.js +11 -0
- package/lib/mjs/model/index.d.ts +14 -0
- package/lib/mjs/model/index.js +14 -0
- package/lib/mjs/package.json +3 -0
- package/package.json +95 -0
package/lib/mjs/GVL.d.ts
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Cloneable } from './Cloneable.js';
|
|
2
|
+
import { GVLError } from './errors/index.js';
|
|
3
|
+
import { ConsentLanguages, IntMap } from './model/index.js';
|
|
4
|
+
import { Feature, Purpose, Stack, Vendor, VendorList, DataCategory } from './model/gvl/index.js';
|
|
5
|
+
export declare type VersionOrVendorList = string | number | VendorList;
|
|
6
|
+
/**
|
|
7
|
+
* class with utilities for managing the global vendor list. Will use JSON to
|
|
8
|
+
* fetch the vendor list from specified url and will serialize it into this
|
|
9
|
+
* object and provide accessors. Provides ways to group vendors on the list by
|
|
10
|
+
* purpose and feature.
|
|
11
|
+
*/
|
|
12
|
+
export declare class GVL extends Cloneable<GVL> implements VendorList {
|
|
13
|
+
private static LANGUAGE_CACHE;
|
|
14
|
+
private static CACHE;
|
|
15
|
+
private static LATEST_CACHE_KEY;
|
|
16
|
+
static readonly DEFAULT_LANGUAGE: string;
|
|
17
|
+
/**
|
|
18
|
+
* Set of available consent languages published by the IAB
|
|
19
|
+
*/
|
|
20
|
+
static readonly consentLanguages: ConsentLanguages;
|
|
21
|
+
private static baseUrl_;
|
|
22
|
+
/**
|
|
23
|
+
* baseUrl - Entities using the vendor-list.json are required by the iab to
|
|
24
|
+
* host their own copy of it to reduce the load on the iab's infrastructure
|
|
25
|
+
* so a 'base' url must be set to be put together with the versioning scheme
|
|
26
|
+
* of the filenames.
|
|
27
|
+
*
|
|
28
|
+
* @static
|
|
29
|
+
* @param {string} url - the base url to load the vendor-list.json from. This is
|
|
30
|
+
* broken out from the filename because it follows a different scheme for
|
|
31
|
+
* latest file vs versioned files.
|
|
32
|
+
*
|
|
33
|
+
* @throws {GVLError} - If the url is http[s]://vendorlist.consensu.org/...
|
|
34
|
+
* this will throw an error. IAB Europe requires that that CMPs and Vendors
|
|
35
|
+
* cache their own copies of the GVL to minimize load on their
|
|
36
|
+
* infrastructure. For more information regarding caching of the
|
|
37
|
+
* vendor-list.json, please see [the TCF documentation on 'Caching the Global
|
|
38
|
+
* Vendor List'
|
|
39
|
+
* ](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md#caching-the-global-vendor-list)
|
|
40
|
+
*/
|
|
41
|
+
static set baseUrl(url: string);
|
|
42
|
+
/**
|
|
43
|
+
* baseUrl - Entities using the vendor-list.json are required by the iab to
|
|
44
|
+
* host their own copy of it to reduce the load on the iab's infrastructure
|
|
45
|
+
* so a 'base' url must be set to be put together with the versioning scheme
|
|
46
|
+
* of the filenames.
|
|
47
|
+
*
|
|
48
|
+
* @static
|
|
49
|
+
* @return {string} - returns the previously set baseUrl, the default is
|
|
50
|
+
* `undefined`
|
|
51
|
+
*/
|
|
52
|
+
static get baseUrl(): string;
|
|
53
|
+
/**
|
|
54
|
+
* @static
|
|
55
|
+
* @param {string} - the latest is assumed to be vendor-list.json because
|
|
56
|
+
* that is what the iab uses, but it could be different... if you want
|
|
57
|
+
*/
|
|
58
|
+
static latestFilename: string;
|
|
59
|
+
/**
|
|
60
|
+
* @static
|
|
61
|
+
* @param {string} - the versioned name is assumed to be
|
|
62
|
+
* vendor-list-v[VERSION].json where [VERSION] will be replaced with the
|
|
63
|
+
* specified version. But it could be different... if you want just make
|
|
64
|
+
* sure to include the [VERSION] macro if you have a numbering scheme, it's a
|
|
65
|
+
* simple string substitution.
|
|
66
|
+
*
|
|
67
|
+
* eg.
|
|
68
|
+
* ```javascript
|
|
69
|
+
* GVL.baseUrl = "http://www.mydomain.com/iabcmp/";
|
|
70
|
+
* GVL.versionedFilename = "vendorlist?getVersion=[VERSION]";
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
static versionedFilename: string;
|
|
74
|
+
/**
|
|
75
|
+
* @param {string} - Translations of the names and descriptions for Purposes,
|
|
76
|
+
* Special Purposes, Features, and Special Features to non-English languages
|
|
77
|
+
* are contained in a file where attributes containing English content
|
|
78
|
+
* (except vendor declaration information) are translated. The iab publishes
|
|
79
|
+
* one following the scheme below where the LANG is the iso639-1 language
|
|
80
|
+
* code. For a list of available translations
|
|
81
|
+
* [please go here](https://register.consensu.org/Translation).
|
|
82
|
+
*
|
|
83
|
+
* eg.
|
|
84
|
+
* ```javascript
|
|
85
|
+
* GVL.baseUrl = "http://www.mydomain.com/iabcmp/";
|
|
86
|
+
* GVL.languageFilename = "purposes?getPurposes=[LANG]";
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
static languageFilename: string;
|
|
90
|
+
/**
|
|
91
|
+
* @param {Promise} resolved when this GVL object is populated with the data
|
|
92
|
+
* or rejected if there is an error.
|
|
93
|
+
*/
|
|
94
|
+
readyPromise: Promise<void | GVLError>;
|
|
95
|
+
/**
|
|
96
|
+
* @param {number} gvlSpecificationVersion - schema version for the GVL that is used
|
|
97
|
+
*/
|
|
98
|
+
gvlSpecificationVersion: number;
|
|
99
|
+
/**
|
|
100
|
+
* @param {number} incremented with each published file change
|
|
101
|
+
*/
|
|
102
|
+
vendorListVersion: number;
|
|
103
|
+
/**
|
|
104
|
+
* @param {number} tcfPolicyVersion - The TCF MO will increment this value
|
|
105
|
+
* whenever a GVL change (such as adding a new Purpose or Feature or a change
|
|
106
|
+
* in Purpose wording) legally invalidates existing TC Strings and requires
|
|
107
|
+
* CMPs to re-establish transparency and consent from users. If the policy
|
|
108
|
+
* version number in the latest GVL is different from the value in your TC
|
|
109
|
+
* String, then you need to re-establish transparency and consent for that
|
|
110
|
+
* user. A version 1 format TC String is considered to have a version value
|
|
111
|
+
* of 1.
|
|
112
|
+
*/
|
|
113
|
+
tcfPolicyVersion: number;
|
|
114
|
+
/**
|
|
115
|
+
* @param {string | Date} lastUpdated - the date in which the vendor list
|
|
116
|
+
* json file was last updated.
|
|
117
|
+
*/
|
|
118
|
+
lastUpdated: string | Date;
|
|
119
|
+
/**
|
|
120
|
+
* @param {IntMap<Purpose>} a collection of [[Purpose]]s
|
|
121
|
+
*/
|
|
122
|
+
purposes: IntMap<Purpose>;
|
|
123
|
+
/**
|
|
124
|
+
* @param {IntMap<Purpose>} a collection of [[Purpose]]s
|
|
125
|
+
*/
|
|
126
|
+
specialPurposes: IntMap<Purpose>;
|
|
127
|
+
/**
|
|
128
|
+
* @param {IntMap<Feature>} a collection of [[Feature]]s
|
|
129
|
+
*/
|
|
130
|
+
features: IntMap<Feature>;
|
|
131
|
+
/**
|
|
132
|
+
* @param {IntMap<Feature>} a collection of [[Feature]]s
|
|
133
|
+
*/
|
|
134
|
+
specialFeatures: IntMap<Feature>;
|
|
135
|
+
/**
|
|
136
|
+
* @param {boolean} internal reference of when the GVL is ready to be used
|
|
137
|
+
*/
|
|
138
|
+
private isReady_;
|
|
139
|
+
/**
|
|
140
|
+
* @param {IntMap<Vendor>} a collection of [[Vendor]]s
|
|
141
|
+
*/
|
|
142
|
+
private vendors_;
|
|
143
|
+
vendorIds: Set<number>;
|
|
144
|
+
/**
|
|
145
|
+
* @param {IntMap<Vendor>} a collection of [[Vendor]]. Used as a backup if a whitelist is sets
|
|
146
|
+
*/
|
|
147
|
+
private fullVendorList;
|
|
148
|
+
/**
|
|
149
|
+
* @param {ByPurposeVendorMap} vendors by purpose
|
|
150
|
+
*/
|
|
151
|
+
private byPurposeVendorMap;
|
|
152
|
+
/**
|
|
153
|
+
* @param {IDSetMap} vendors by special purpose
|
|
154
|
+
*/
|
|
155
|
+
private bySpecialPurposeVendorMap;
|
|
156
|
+
/**
|
|
157
|
+
* @param {IDSetMap} vendors by feature
|
|
158
|
+
*/
|
|
159
|
+
private byFeatureVendorMap;
|
|
160
|
+
/**
|
|
161
|
+
* @param {IDSetMap} vendors by special feature
|
|
162
|
+
*/
|
|
163
|
+
private bySpecialFeatureVendorMap;
|
|
164
|
+
/**
|
|
165
|
+
* @param {IntMap<Stack>} a collection of [[Stack]]s
|
|
166
|
+
*/
|
|
167
|
+
stacks: IntMap<Stack>;
|
|
168
|
+
/**
|
|
169
|
+
* @param {IntMap<DataCategory>} a collection of [[DataCategory]]s
|
|
170
|
+
*/
|
|
171
|
+
dataCategories?: IntMap<DataCategory>;
|
|
172
|
+
private lang_;
|
|
173
|
+
private isLatest;
|
|
174
|
+
/**
|
|
175
|
+
* @param {VersionOrVendorList} [versionOrVendorList] - can be either a
|
|
176
|
+
* [[VendorList]] object or a version number represented as a string or
|
|
177
|
+
* number to download. If nothing is passed the latest version of the GVL
|
|
178
|
+
* will be loaded
|
|
179
|
+
*/
|
|
180
|
+
constructor(versionOrVendorList?: VersionOrVendorList);
|
|
181
|
+
/**
|
|
182
|
+
* emptyLanguageCache
|
|
183
|
+
*
|
|
184
|
+
* @param {string} [lang] - Optional ISO 639-1 langauge code to remove from
|
|
185
|
+
* the cache. Should be one of the languages in GVL.consentLanguages set.
|
|
186
|
+
* If not then the whole cache will be deleted.
|
|
187
|
+
* @return {boolean} - true if anything was deleted from the cache
|
|
188
|
+
*/
|
|
189
|
+
static emptyLanguageCache(lang?: string): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* emptyCache
|
|
192
|
+
*
|
|
193
|
+
* @param {number} [vendorListVersion] - version of the vendor list to delete
|
|
194
|
+
* from the cache. If none is specified then the whole cache is deleted.
|
|
195
|
+
* @return {boolean} - true if anything was deleted from the cache
|
|
196
|
+
*/
|
|
197
|
+
static emptyCache(vendorListVersion?: number): boolean;
|
|
198
|
+
private cacheLanguage;
|
|
199
|
+
private fetchJson;
|
|
200
|
+
/**
|
|
201
|
+
* getJson - Method for getting the JSON that was downloaded to created this
|
|
202
|
+
* `GVL` object
|
|
203
|
+
*
|
|
204
|
+
* @return {VendorList} - The basic JSON structure without the extra
|
|
205
|
+
* functionality and methods of this class.
|
|
206
|
+
*/
|
|
207
|
+
getJson(): VendorList;
|
|
208
|
+
/**
|
|
209
|
+
* changeLanguage - retrieves the purpose language translation and sets the
|
|
210
|
+
* internal language variable
|
|
211
|
+
*
|
|
212
|
+
* @param {string} lang - ISO 639-1 langauge code to change language to
|
|
213
|
+
* @return {Promise<void | GVLError>} - returns the `readyPromise` and
|
|
214
|
+
* resolves when this GVL is populated with the data from the language file.
|
|
215
|
+
*/
|
|
216
|
+
changeLanguage(lang: string): Promise<void | GVLError>;
|
|
217
|
+
get language(): string;
|
|
218
|
+
private isVendorList;
|
|
219
|
+
private populate;
|
|
220
|
+
private mapVendors;
|
|
221
|
+
private getFilteredVendors;
|
|
222
|
+
/**
|
|
223
|
+
* getVendorsWithConsentPurpose
|
|
224
|
+
*
|
|
225
|
+
* @param {number} purposeId
|
|
226
|
+
* @return {IntMap<Vendor>} - list of vendors that have declared the consent purpose id
|
|
227
|
+
*/
|
|
228
|
+
getVendorsWithConsentPurpose(purposeId: number): IntMap<Vendor>;
|
|
229
|
+
/**
|
|
230
|
+
* getVendorsWithLegIntPurpose
|
|
231
|
+
*
|
|
232
|
+
* @param {number} purposeId
|
|
233
|
+
* @return {IntMap<Vendor>} - list of vendors that have declared the legInt (Legitimate Interest) purpose id
|
|
234
|
+
*/
|
|
235
|
+
getVendorsWithLegIntPurpose(purposeId: number): IntMap<Vendor>;
|
|
236
|
+
/**
|
|
237
|
+
* getVendorsWithFlexiblePurpose
|
|
238
|
+
*
|
|
239
|
+
* @param {number} purposeId
|
|
240
|
+
* @return {IntMap<Vendor>} - list of vendors that have declared the flexible purpose id
|
|
241
|
+
*/
|
|
242
|
+
getVendorsWithFlexiblePurpose(purposeId: number): IntMap<Vendor>;
|
|
243
|
+
/**
|
|
244
|
+
* getVendorsWithSpecialPurpose
|
|
245
|
+
*
|
|
246
|
+
* @param {number} specialPurposeId
|
|
247
|
+
* @return {IntMap<Vendor>} - list of vendors that have declared the special purpose id
|
|
248
|
+
*/
|
|
249
|
+
getVendorsWithSpecialPurpose(specialPurposeId: number): IntMap<Vendor>;
|
|
250
|
+
/**
|
|
251
|
+
* getVendorsWithFeature
|
|
252
|
+
*
|
|
253
|
+
* @param {number} featureId
|
|
254
|
+
* @return {IntMap<Vendor>} - list of vendors that have declared the feature id
|
|
255
|
+
*/
|
|
256
|
+
getVendorsWithFeature(featureId: number): IntMap<Vendor>;
|
|
257
|
+
/**
|
|
258
|
+
* getVendorsWithSpecialFeature
|
|
259
|
+
*
|
|
260
|
+
* @param {number} specialFeatureId
|
|
261
|
+
* @return {IntMap<Vendor>} - list of vendors that have declared the special feature id
|
|
262
|
+
*/
|
|
263
|
+
getVendorsWithSpecialFeature(specialFeatureId: number): IntMap<Vendor>;
|
|
264
|
+
/**
|
|
265
|
+
* vendors
|
|
266
|
+
*
|
|
267
|
+
* @return {IntMap<Vendor>} - the list of vendors as it would on the JSON file
|
|
268
|
+
* except if `narrowVendorsTo` was called, it would be that narrowed list
|
|
269
|
+
*/
|
|
270
|
+
get vendors(): IntMap<Vendor>;
|
|
271
|
+
/**
|
|
272
|
+
* narrowVendorsTo - narrows vendors represented in this GVL to the list of ids passed in
|
|
273
|
+
*
|
|
274
|
+
* @param {number[]} vendorIds - list of ids to narrow this GVL to
|
|
275
|
+
* @return {void}
|
|
276
|
+
*/
|
|
277
|
+
narrowVendorsTo(vendorIds: number[]): void;
|
|
278
|
+
/**
|
|
279
|
+
* isReady - Whether or not this instance is ready to be used. This will be
|
|
280
|
+
* immediately and synchronously true if a vendorlist object is passed into
|
|
281
|
+
* the constructor or once the JSON vendorllist is retrieved.
|
|
282
|
+
*
|
|
283
|
+
* @return {boolean} whether or not the instance is ready to be interacted
|
|
284
|
+
* with and all the data is populated
|
|
285
|
+
*/
|
|
286
|
+
get isReady(): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* clone - overrides base `clone()` method since GVL is a special class that
|
|
289
|
+
* represents a JSON structure with some additional functionality.
|
|
290
|
+
*
|
|
291
|
+
* @return {GVL}
|
|
292
|
+
*/
|
|
293
|
+
clone(): GVL;
|
|
294
|
+
static isInstanceOf(questionableInstance: unknown): questionableInstance is GVL;
|
|
295
|
+
}
|