@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KeyMap - A map of abstract type (defined by implementer) that is keyed by an
|
|
3
|
+
* integer string id. Example `KeyMap<number>`:
|
|
4
|
+
* ```
|
|
5
|
+
* const myKeyMapOfNumbers: KeyMap<number> = {
|
|
6
|
+
* "1":2,
|
|
7
|
+
* "3":4,
|
|
8
|
+
* };
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
import { IntMap } from './IntMap.js';
|
|
12
|
+
export declare type KeyMap<T> = IntMap<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Cloneable } from '../Cloneable.js';
|
|
2
|
+
import { RestrictionType } from './RestrictionType.js';
|
|
3
|
+
export declare class PurposeRestriction extends Cloneable<PurposeRestriction> {
|
|
4
|
+
static hashSeparator: string;
|
|
5
|
+
private purposeId_;
|
|
6
|
+
restrictionType: RestrictionType;
|
|
7
|
+
/**
|
|
8
|
+
* constructor
|
|
9
|
+
*
|
|
10
|
+
* @param {number} purposeId? - may optionally pass the purposeId into the
|
|
11
|
+
* constructor
|
|
12
|
+
* @param {RestrictionType} restrictionType? - may
|
|
13
|
+
* optionally pass the restrictionType into the constructor
|
|
14
|
+
* @return {undefined}
|
|
15
|
+
*/
|
|
16
|
+
constructor(purposeId?: number, restrictionType?: RestrictionType);
|
|
17
|
+
static unHash(hash: string): PurposeRestriction;
|
|
18
|
+
get hash(): string;
|
|
19
|
+
/**
|
|
20
|
+
* @return {number} The purpose Id associated with a publisher
|
|
21
|
+
* purpose-by-vendor restriction that resulted in a different consent or LI
|
|
22
|
+
* status than the consent or LI purposes allowed lists.
|
|
23
|
+
*/
|
|
24
|
+
get purposeId(): number;
|
|
25
|
+
/**
|
|
26
|
+
* @param {number} idNum - The purpose Id associated with a publisher
|
|
27
|
+
* purpose-by-vendor restriction that resulted in a different consent or LI
|
|
28
|
+
* status than the consent or LI purposes allowed lists.
|
|
29
|
+
*/
|
|
30
|
+
set purposeId(idNum: number);
|
|
31
|
+
isValid(): boolean;
|
|
32
|
+
isSameAs(otherPR: PurposeRestriction): boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.PurposeRestriction=void 0;var Cloneable_js_1=require("../Cloneable.js"),index_js_1=require("../errors/index.js"),RestrictionType_js_1=require("./RestrictionType.js"),PurposeRestriction=function(e){function t(t,r){var o=e.call(this)||this;return void 0!==t&&(o.purposeId=t),void 0!==r&&(o.restrictionType=r),o}return __extends(t,e),t.unHash=function(e){var r=e.split(this.hashSeparator),o=new t;if(2!==r.length)throw new index_js_1.TCModelError("hash",e);return o.purposeId=parseInt(r[0],10),o.restrictionType=parseInt(r[1],10),o},Object.defineProperty(t.prototype,"hash",{get:function(){if(!this.isValid())throw new Error("cannot hash invalid PurposeRestriction");return"".concat(this.purposeId).concat(t.hashSeparator).concat(this.restrictionType)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"purposeId",{get:function(){return this.purposeId_},set:function(e){this.purposeId_=e},enumerable:!1,configurable:!0}),t.prototype.isValid=function(){return Number.isInteger(this.purposeId)&&this.purposeId>0&&(this.restrictionType===RestrictionType_js_1.RestrictionType.NOT_ALLOWED||this.restrictionType===RestrictionType_js_1.RestrictionType.REQUIRE_CONSENT||this.restrictionType===RestrictionType_js_1.RestrictionType.REQUIRE_LI)},t.prototype.isSameAs=function(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType},t.hashSeparator="-",t}(Cloneable_js_1.Cloneable);exports.PurposeRestriction=PurposeRestriction;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { PurposeRestriction } from './PurposeRestriction.js';
|
|
2
|
+
import { RestrictionType } from './RestrictionType.js';
|
|
3
|
+
import { GVL } from '../GVL.js';
|
|
4
|
+
import { Cloneable } from '../Cloneable.js';
|
|
5
|
+
export declare class PurposeRestrictionVector extends Cloneable<PurposeRestrictionVector> {
|
|
6
|
+
/**
|
|
7
|
+
* if this originatd from an encoded string we'll need a place to store the
|
|
8
|
+
* bit length; it can be set and got from here
|
|
9
|
+
*/
|
|
10
|
+
bitLength: number;
|
|
11
|
+
/**
|
|
12
|
+
* a map indexed by a string which will be a 'hash' of the purpose and
|
|
13
|
+
* restriction type.
|
|
14
|
+
*
|
|
15
|
+
* Using a BST to keep vendors in a sorted order for encoding later
|
|
16
|
+
*/
|
|
17
|
+
private map;
|
|
18
|
+
private gvl_;
|
|
19
|
+
private has;
|
|
20
|
+
private isOkToHave;
|
|
21
|
+
/**
|
|
22
|
+
* add - adds a given Vendor ID under a given Purpose Restriction
|
|
23
|
+
*
|
|
24
|
+
* @param {number} vendorId
|
|
25
|
+
* @param {PurposeRestriction} purposeRestriction
|
|
26
|
+
* @return {void}
|
|
27
|
+
*/
|
|
28
|
+
add(vendorId: number, purposeRestriction: PurposeRestriction): void;
|
|
29
|
+
/**
|
|
30
|
+
* restrictPurposeToLegalBasis - adds all Vendors under a given Purpose Restriction
|
|
31
|
+
*
|
|
32
|
+
* @param {PurposeRestriction} purposeRestriction
|
|
33
|
+
* @return {void}
|
|
34
|
+
*/
|
|
35
|
+
restrictPurposeToLegalBasis(purposeRestriction: PurposeRestriction): void;
|
|
36
|
+
/**
|
|
37
|
+
* getVendors - returns array of vendor ids optionally narrowed by a given
|
|
38
|
+
* Purpose Restriction. If no purpose restriction is passed then all vendor
|
|
39
|
+
* ids will be returned. One can expect this result to be a unique set of
|
|
40
|
+
* ids no duplicates.
|
|
41
|
+
*
|
|
42
|
+
* @param {PurposeRestriction} [purposeRestriction] - optionally passed to
|
|
43
|
+
* get only Vendor IDs restricted under the given Purpose Restriction
|
|
44
|
+
* @return {number[]} - Unique ID set of vendors
|
|
45
|
+
*/
|
|
46
|
+
getVendors(purposeRestriction?: PurposeRestriction): number[];
|
|
47
|
+
getRestrictionType(vendorId: number, purposeId: number): RestrictionType | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* vendorHasRestriction - determines whether a given Vendor ID is under a
|
|
50
|
+
* given Purpose Restriction
|
|
51
|
+
*
|
|
52
|
+
* @param {number} vendorId
|
|
53
|
+
* @param {PurposeRestriction} purposeRestriction
|
|
54
|
+
* @return {boolean} - true if the give Vendor ID is under the given Purpose
|
|
55
|
+
* Restriction
|
|
56
|
+
*/
|
|
57
|
+
vendorHasRestriction(vendorId: number, purposeRestriction: PurposeRestriction): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* getMaxVendorId - gets the Maximum Vendor ID regardless of Purpose
|
|
60
|
+
* Restriction
|
|
61
|
+
*
|
|
62
|
+
* @return {number} - maximum Vendor ID
|
|
63
|
+
*/
|
|
64
|
+
getMaxVendorId(): number;
|
|
65
|
+
getRestrictions(vendorId?: number): PurposeRestriction[];
|
|
66
|
+
getPurposes(): number[];
|
|
67
|
+
/**
|
|
68
|
+
* remove - removes Vendor ID from a Purpose Restriction
|
|
69
|
+
*
|
|
70
|
+
* @param {number} vendorId
|
|
71
|
+
* @param {PurposeRestriction} purposeRestriction
|
|
72
|
+
* @return {void}
|
|
73
|
+
*/
|
|
74
|
+
remove(vendorId: number, purposeRestriction: PurposeRestriction): void;
|
|
75
|
+
/**
|
|
76
|
+
* Essential for being able to determine whether we can actually set a
|
|
77
|
+
* purpose restriction since they have to have a flexible legal basis
|
|
78
|
+
*
|
|
79
|
+
* @param {GVL} value - the GVL instance
|
|
80
|
+
*/
|
|
81
|
+
set gvl(value: GVL);
|
|
82
|
+
/**
|
|
83
|
+
* gvl returns local copy of the GVL these restrictions apply to
|
|
84
|
+
*
|
|
85
|
+
* @return {GVL}
|
|
86
|
+
*/
|
|
87
|
+
get gvl(): GVL;
|
|
88
|
+
/**
|
|
89
|
+
* isEmpty - whether or not this vector has any restrictions in it
|
|
90
|
+
*
|
|
91
|
+
* @return {boolean}
|
|
92
|
+
*/
|
|
93
|
+
isEmpty(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* numRestrictions - returns the number of Purpose Restrictions.
|
|
96
|
+
*
|
|
97
|
+
* @return {number}
|
|
98
|
+
*/
|
|
99
|
+
get numRestrictions(): number;
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__values=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},__read=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s},__spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PurposeRestrictionVector=void 0;var PurposeRestriction_js_1=require("./PurposeRestriction.js"),BinarySearchTree_js_1=require("./BinarySearchTree.js"),RestrictionType_js_1=require("./RestrictionType.js"),Cloneable_js_1=require("../Cloneable.js"),PurposeRestrictionVector=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.bitLength=0,t.map=new Map,t}return __extends(t,e),t.prototype.has=function(e){return this.map.has(e)},t.prototype.isOkToHave=function(e,t,r){var o,n=!0;if(null===(o=this.gvl)||void 0===o?void 0:o.vendors){var i=this.gvl.vendors[r];if(i)if(e===RestrictionType_js_1.RestrictionType.NOT_ALLOWED)n=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case RestrictionType_js_1.RestrictionType.REQUIRE_CONSENT:n=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case RestrictionType_js_1.RestrictionType.REQUIRE_LI:n=i.flexiblePurposes.includes(t)&&i.purposes.includes(t)}else n=!1;else n=!1}return n},t.prototype.add=function(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){var r=t.hash;this.has(r)||(this.map.set(r,new BinarySearchTree_js_1.BinarySearchTree),this.bitLength=0),this.map.get(r).add(e)}},t.prototype.restrictPurposeToLegalBasis=function(e){for(var t=this.gvl.vendorIds,r=e.hash,o=function(){var e,r,o;try{for(var n=__values(t),i=n.next();!i.done;i=n.next())o=i.value}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return o}(),n=__spreadArray([],__read(Array(o).keys()),!1).map((function(e){return e+1})),i=1;i<=o;i++)this.has(r)||(this.map.set(r,BinarySearchTree_js_1.BinarySearchTree.build(n)),this.bitLength=0),this.map.get(r).add(i)},t.prototype.getVendors=function(e){var t=[];if(e){var r=e.hash;this.has(r)&&(t=this.map.get(r).get())}else{var o=new Set;this.map.forEach((function(e){e.get().forEach((function(e){o.add(e)}))})),t=Array.from(o)}return t},t.prototype.getRestrictionType=function(e,t){var r;return this.getRestrictions(e).forEach((function(e){e.purposeId===t&&(void 0===r||r>e.restrictionType)&&(r=e.restrictionType)})),r},t.prototype.vendorHasRestriction=function(e,t){for(var r=!1,o=this.getRestrictions(e),n=0;n<o.length&&!r;n++)r=t.isSameAs(o[n]);return r},t.prototype.getMaxVendorId=function(){var e=0;return this.map.forEach((function(t){e=Math.max(t.max(),e)})),e},t.prototype.getRestrictions=function(e){var t=[];return this.map.forEach((function(r,o){e?r.contains(e)&&t.push(PurposeRestriction_js_1.PurposeRestriction.unHash(o)):t.push(PurposeRestriction_js_1.PurposeRestriction.unHash(o))})),t},t.prototype.getPurposes=function(){var e=new Set;return this.map.forEach((function(t,r){e.add(PurposeRestriction_js_1.PurposeRestriction.unHash(r).purposeId)})),Array.from(e)},t.prototype.remove=function(e,t){var r=t.hash,o=this.map.get(r);o&&(o.remove(e),o.isEmpty()&&(this.map.delete(r),this.bitLength=0))},Object.defineProperty(t.prototype,"gvl",{get:function(){return this.gvl_},set:function(e){var t=this;this.gvl_||(this.gvl_=e,this.map.forEach((function(e,r){var o=PurposeRestriction_js_1.PurposeRestriction.unHash(r);e.get().forEach((function(r){t.isOkToHave(o.restrictionType,o.purposeId,r)||e.remove(r)}))})))},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return 0===this.map.size},Object.defineProperty(t.prototype,"numRestrictions",{get:function(){return this.map.size},enumerable:!1,configurable:!0}),t}(Cloneable_js_1.Cloneable);exports.PurposeRestrictionVector=PurposeRestrictionVector;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* if a Vendor has declared flexible purposes (see: [[Vendor]] under
|
|
3
|
+
* `flexiblePurposeIds`) on the Global Vendor List ([[Declarations]]) a CMP may
|
|
4
|
+
* change their legal basis for processing in the encoding.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum RestrictionType {
|
|
7
|
+
/**
|
|
8
|
+
* under no circumstances is this purpose allowed.
|
|
9
|
+
*/
|
|
10
|
+
NOT_ALLOWED = 0,
|
|
11
|
+
/**
|
|
12
|
+
* if the default declaration is legitimate interest then this flips the purpose to consent in the encoding.
|
|
13
|
+
*/
|
|
14
|
+
REQUIRE_CONSENT = 1,
|
|
15
|
+
/**
|
|
16
|
+
* if the default declaration is consent then this flips the purpose to Legitimate Interest in the encoding.
|
|
17
|
+
*/
|
|
18
|
+
REQUIRE_LI = 2
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var RestrictionType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RestrictionType=void 0,function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(RestrictionType=exports.RestrictionType||(exports.RestrictionType={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Segment;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Segment=void 0,function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(Segment=exports.Segment||(exports.Segment={}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { KeyMap } from './KeyMap.js';
|
|
2
|
+
import { Segment } from './Segment.js';
|
|
3
|
+
export declare class SegmentIDs {
|
|
4
|
+
/**
|
|
5
|
+
* 0 = default - reserved for core string (does not need to be present in the core string)
|
|
6
|
+
* 1 = OOB vendors disclosed
|
|
7
|
+
* 2 = OOB vendors allowed
|
|
8
|
+
* 3 = PublisherTC
|
|
9
|
+
*/
|
|
10
|
+
static readonly ID_TO_KEY: Segment[];
|
|
11
|
+
static readonly KEY_TO_ID: KeyMap<number>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SegmentIDs=void 0;var Segment_js_1=require("./Segment.js"),SegmentIDs=function(){function e(){}return e.ID_TO_KEY=[Segment_js_1.Segment.CORE,Segment_js_1.Segment.VENDORS_DISCLOSED,Segment_js_1.Segment.VENDORS_ALLOWED,Segment_js_1.Segment.PUBLISHER_TC],e.KEY_TO_ID=((_a={})[Segment_js_1.Segment.CORE]=0,_a[Segment_js_1.Segment.VENDORS_DISCLOSED]=1,_a[Segment_js_1.Segment.VENDORS_ALLOWED]=2,_a[Segment_js_1.Segment.PUBLISHER_TC]=3,_a),e}();exports.SegmentIDs=SegmentIDs;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Cloneable } from '../Cloneable.js';
|
|
2
|
+
import { IntMap } from './IntMap.js';
|
|
3
|
+
declare type SingleIDOrCollection = number | number[] | IntMap<unknown> | Set<number | string>;
|
|
4
|
+
export declare type IdBoolTuple = [number, boolean];
|
|
5
|
+
/**
|
|
6
|
+
* Vector class is like a Set except it keeps track of a max id
|
|
7
|
+
*/
|
|
8
|
+
export declare class Vector extends Cloneable<Vector> implements Iterable<IdBoolTuple> {
|
|
9
|
+
/**
|
|
10
|
+
* if this originatd from an encoded string we'll need a place to store the
|
|
11
|
+
* bit length; it can be set and got from here
|
|
12
|
+
*/
|
|
13
|
+
bitLength: number;
|
|
14
|
+
private maxId_;
|
|
15
|
+
private set_;
|
|
16
|
+
[Symbol.iterator](): Iterator<IdBoolTuple>;
|
|
17
|
+
/**
|
|
18
|
+
* values()
|
|
19
|
+
*
|
|
20
|
+
* @return {IterableIterator<number>} - returns an iterator of the positive
|
|
21
|
+
* values in the set
|
|
22
|
+
*/
|
|
23
|
+
values(): IterableIterator<number>;
|
|
24
|
+
/**
|
|
25
|
+
* maxId
|
|
26
|
+
*
|
|
27
|
+
* @return {number} - the highest id in this Vector
|
|
28
|
+
*/
|
|
29
|
+
get maxId(): number;
|
|
30
|
+
/**
|
|
31
|
+
* get
|
|
32
|
+
*
|
|
33
|
+
* @param {number} id - key for value to check
|
|
34
|
+
* @return {boolean} - value of that key, if never set it will be false
|
|
35
|
+
*/
|
|
36
|
+
has(id: number): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* unset
|
|
39
|
+
*
|
|
40
|
+
* @param {SingleIDOrCollection} id - id or ids to unset
|
|
41
|
+
* @return {void}
|
|
42
|
+
*/
|
|
43
|
+
unset(id: SingleIDOrCollection): void;
|
|
44
|
+
private isIntMap;
|
|
45
|
+
private isValidNumber;
|
|
46
|
+
private isSet;
|
|
47
|
+
/**
|
|
48
|
+
* set - sets an item assumed to be a truthy value by its presence
|
|
49
|
+
*
|
|
50
|
+
* @param {SingleIDOrCollection} item - May be a single id (positive integer)
|
|
51
|
+
* or collection of ids in a set, GVL Int Map, or Array.
|
|
52
|
+
*
|
|
53
|
+
* @return {void}
|
|
54
|
+
*/
|
|
55
|
+
set(item: SingleIDOrCollection): void;
|
|
56
|
+
empty(): void;
|
|
57
|
+
/**
|
|
58
|
+
* forEach - to traverse from id=1 to id=maxId in a sequential non-sparse manner
|
|
59
|
+
*
|
|
60
|
+
*
|
|
61
|
+
* @param {forEachCallback} callback - callback to execute
|
|
62
|
+
* @return {void}
|
|
63
|
+
*
|
|
64
|
+
* @callback forEachCallback
|
|
65
|
+
* @param {boolean} value - whether or not this id exists in the vector
|
|
66
|
+
* @param {number} id - the id number of the current iteration
|
|
67
|
+
*/
|
|
68
|
+
forEach(callback: (value: boolean, id: number) => void): void;
|
|
69
|
+
get size(): number;
|
|
70
|
+
setAll<T>(intMap: IntMap<T>): void;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__generator=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Vector=void 0;var Cloneable_js_1=require("../Cloneable.js"),index_js_1=require("../errors/index.js"),Vector=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bitLength=0,e.maxId_=0,e.set_=new Set,e}return __extends(e,t),e.prototype[Symbol.iterator]=function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=1,e.label=1;case 1:return t<=this.maxId?[4,[t,this.has(t)]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},e.prototype.values=function(){return this.set_.values()},Object.defineProperty(e.prototype,"maxId",{get:function(){return this.maxId_},enumerable:!1,configurable:!0}),e.prototype.has=function(t){return this.set_.has(t)},e.prototype.unset=function(t){var e=this;Array.isArray(t)?t.forEach((function(t){return e.unset(t)})):"object"==typeof t?this.unset(Object.keys(t).map((function(t){return Number(t)}))):(this.set_.delete(Number(t)),this.bitLength=0,t===this.maxId&&(this.maxId_=0,this.set_.forEach((function(t){e.maxId_=Math.max(e.maxId,t)}))))},e.prototype.isIntMap=function(t){var e=this,r="object"==typeof t;return r=r&&Object.keys(t).every((function(r){var n=Number.isInteger(parseInt(r,10));return n=(n=n&&e.isValidNumber(t[r].id))&&void 0!==t[r].name}))},e.prototype.isValidNumber=function(t){return parseInt(t,10)>0},e.prototype.isSet=function(t){var e=!1;return t instanceof Set&&(e=Array.from(t).every(this.isValidNumber)),e},e.prototype.set=function(t){var e=this;if(Array.isArray(t))t.forEach((function(t){return e.set(t)}));else if(this.isSet(t))this.set(Array.from(t));else if(this.isIntMap(t))this.set(Object.keys(t).map((function(t){return Number(t)})));else{if(!this.isValidNumber(t))throw new index_js_1.TCModelError("set()",t,"must be positive integer array, positive integer, Set<number>, or IntMap");this.set_.add(t),this.maxId_=Math.max(this.maxId,t),this.bitLength=0}},e.prototype.empty=function(){this.set_=new Set},e.prototype.forEach=function(t){for(var e=1;e<=this.maxId;e++)t(this.has(e),e)},Object.defineProperty(e.prototype,"size",{get:function(){return this.set_.size},enumerable:!1,configurable:!0}),e.prototype.setAll=function(t){this.set(t)},e}(Cloneable_js_1.Cloneable);exports.Vector=Vector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IntMap } from '../IntMap.js';
|
|
2
|
+
import { Feature } from './Feature.js';
|
|
3
|
+
import { Purpose } from './Purpose.js';
|
|
4
|
+
import { Stack } from './Stack.js';
|
|
5
|
+
import { DataCategory } from './DataCategory.js';
|
|
6
|
+
export interface Declarations {
|
|
7
|
+
purposes: IntMap<Purpose>;
|
|
8
|
+
specialPurposes: IntMap<Purpose>;
|
|
9
|
+
features: IntMap<Feature>;
|
|
10
|
+
specialFeatures: IntMap<Feature>;
|
|
11
|
+
stacks: IntMap<Stack>;
|
|
12
|
+
dataCategories?: IntMap<DataCategory>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GVLMapItem } from './GVLMapItem.js';
|
|
2
|
+
import { DataRetention } from './DataRetention.js';
|
|
3
|
+
import { VendorUrl } from './VendorUrl.js';
|
|
4
|
+
export interface Vendor extends GVLMapItem {
|
|
5
|
+
purposes: number[];
|
|
6
|
+
legIntPurposes: number[];
|
|
7
|
+
flexiblePurposes: number[];
|
|
8
|
+
specialPurposes: number[];
|
|
9
|
+
features: number[];
|
|
10
|
+
specialFeatures: number[];
|
|
11
|
+
policyUrl: string;
|
|
12
|
+
usesCookies: boolean;
|
|
13
|
+
cookieMaxAgeSeconds: number | null;
|
|
14
|
+
cookieRefresh: boolean;
|
|
15
|
+
usesNonCookieAccess: boolean;
|
|
16
|
+
deviceStorageDisclosureUrl?: string;
|
|
17
|
+
deletedDate?: Date | string;
|
|
18
|
+
overflow?: {
|
|
19
|
+
httpGetLimit: 32 | 128;
|
|
20
|
+
};
|
|
21
|
+
dataRetention?: DataRetention;
|
|
22
|
+
urls?: VendorUrl[];
|
|
23
|
+
dataDeclaration?: number[];
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IntMap } from '../IntMap.js';
|
|
2
|
+
import { Vendor } from './Vendor.js';
|
|
3
|
+
import { Declarations } from './Declarations.js';
|
|
4
|
+
export interface VendorList extends Declarations {
|
|
5
|
+
lastUpdated: string | Date;
|
|
6
|
+
gvlSpecificationVersion: number;
|
|
7
|
+
vendorListVersion: number;
|
|
8
|
+
tcfPolicyVersion: number;
|
|
9
|
+
vendors: IntMap<Vendor>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ByPurposeVendorMap.js';
|
|
2
|
+
export * from './Declarations.js';
|
|
3
|
+
export * from './Feature.js';
|
|
4
|
+
export * from './GVLMapItem.js';
|
|
5
|
+
export * from './IDSetMap.js';
|
|
6
|
+
export * from './Purpose.js';
|
|
7
|
+
export * from './Stack.js';
|
|
8
|
+
export * from './Vendor.js';
|
|
9
|
+
export * from './VendorList.js';
|
|
10
|
+
export * from './DataCategory.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./ByPurposeVendorMap.js"),exports),__exportStar(require("./Declarations.js"),exports),__exportStar(require("./Feature.js"),exports),__exportStar(require("./GVLMapItem.js"),exports),__exportStar(require("./IDSetMap.js"),exports),__exportStar(require("./Purpose.js"),exports),__exportStar(require("./Stack.js"),exports),__exportStar(require("./Vendor.js"),exports),__exportStar(require("./VendorList.js"),exports),__exportStar(require("./DataCategory.js"),exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './BinarySearchTree.js';
|
|
2
|
+
export * from './ConsentLanguages.js';
|
|
3
|
+
export * from './Fields.js';
|
|
4
|
+
export * from './IntMap.js';
|
|
5
|
+
export * from './KeyMap.js';
|
|
6
|
+
export * from './PurposeRestriction.js';
|
|
7
|
+
export * from './PurposeRestrictionVector.js';
|
|
8
|
+
export * from './DeviceDisclosureStorageAccessType.js';
|
|
9
|
+
export * from './DeviceDisclosure.js';
|
|
10
|
+
export * from './RestrictionType.js';
|
|
11
|
+
export * from './Segment.js';
|
|
12
|
+
export * from './SegmentIDs.js';
|
|
13
|
+
export * from './Vector.js';
|
|
14
|
+
export * from './gvl/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./BinarySearchTree.js"),exports),__exportStar(require("./ConsentLanguages.js"),exports),__exportStar(require("./Fields.js"),exports),__exportStar(require("./IntMap.js"),exports),__exportStar(require("./KeyMap.js"),exports),__exportStar(require("./PurposeRestriction.js"),exports),__exportStar(require("./PurposeRestrictionVector.js"),exports),__exportStar(require("./DeviceDisclosureStorageAccessType.js"),exports),__exportStar(require("./DeviceDisclosure.js"),exports),__exportStar(require("./RestrictionType.js"),exports),__exportStar(require("./Segment.js"),exports),__exportStar(require("./SegmentIDs.js"),exports),__exportStar(require("./Vector.js"),exports),__exportStar(require("./gvl/index.js"),exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract Class Cloneable<T> can be extended to give the child class the ability to clone its self.
|
|
3
|
+
* The child class must pass its class to super. You can then pass any needed arguments to help build
|
|
4
|
+
* the cloned class to the protected _clone() method.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
*
|
|
8
|
+
* class Example extends Cloneable<Example> {
|
|
9
|
+
*
|
|
10
|
+
* }
|
|
11
|
+
* Todo: There must be more non primitive build in types to check. But for our current purposes, this works great.
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class Cloneable<T> {
|
|
14
|
+
/**
|
|
15
|
+
* clone - returns a copy of the classes with new values and not references
|
|
16
|
+
*
|
|
17
|
+
* @return {T}
|
|
18
|
+
*/
|
|
19
|
+
clone(): T;
|
|
20
|
+
/**
|
|
21
|
+
* deepClone - recursive function that makes copies of reference values
|
|
22
|
+
*
|
|
23
|
+
* @param {unknown} item
|
|
24
|
+
* @return {unknown}
|
|
25
|
+
*/
|
|
26
|
+
private deepClone;
|
|
27
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract Class Cloneable<T> can be extended to give the child class the ability to clone its self.
|
|
3
|
+
* The child class must pass its class to super. You can then pass any needed arguments to help build
|
|
4
|
+
* the cloned class to the protected _clone() method.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
*
|
|
8
|
+
* class Example extends Cloneable<Example> {
|
|
9
|
+
*
|
|
10
|
+
* }
|
|
11
|
+
* Todo: There must be more non primitive build in types to check. But for our current purposes, this works great.
|
|
12
|
+
*/
|
|
13
|
+
export class Cloneable {
|
|
14
|
+
/**
|
|
15
|
+
* clone - returns a copy of the classes with new values and not references
|
|
16
|
+
*
|
|
17
|
+
* @return {T}
|
|
18
|
+
*/
|
|
19
|
+
clone() {
|
|
20
|
+
const myClone = new this.constructor();
|
|
21
|
+
const keys = Object.keys(this);
|
|
22
|
+
keys.forEach((key) => {
|
|
23
|
+
const value = this.deepClone(this[key]);
|
|
24
|
+
if (value !== undefined) {
|
|
25
|
+
myClone[key] = value;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return myClone;
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* deepClone - recursive function that makes copies of reference values
|
|
33
|
+
*
|
|
34
|
+
* @param {unknown} item
|
|
35
|
+
* @return {unknown}
|
|
36
|
+
*/
|
|
37
|
+
deepClone(item) {
|
|
38
|
+
const itsType = typeof item;
|
|
39
|
+
if (itsType === 'number' || itsType === 'string' || itsType === 'boolean') {
|
|
40
|
+
return item;
|
|
41
|
+
}
|
|
42
|
+
else if (item !== null && itsType === 'object') {
|
|
43
|
+
if (typeof item.clone === 'function') {
|
|
44
|
+
return item.clone();
|
|
45
|
+
}
|
|
46
|
+
else if (item instanceof Date) {
|
|
47
|
+
return new Date(item.getTime());
|
|
48
|
+
}
|
|
49
|
+
else if (item[Symbol.iterator] !== undefined) {
|
|
50
|
+
const ar = [];
|
|
51
|
+
for (const subItem of item) {
|
|
52
|
+
ar.push(this.deepClone(subItem));
|
|
53
|
+
}
|
|
54
|
+
if (item instanceof Array) {
|
|
55
|
+
return ar;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return new item.constructor(ar);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const retr = {};
|
|
63
|
+
for (const prop in item) {
|
|
64
|
+
if (item.hasOwnProperty(prop)) {
|
|
65
|
+
retr[prop] = this.deepClone(item[prop]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return retr;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* ignore functions because those will be initialized with the cloning
|
|
73
|
+
* process
|
|
74
|
+
*/
|
|
75
|
+
}
|
|
76
|
+
}
|