From 0efc89dd10ea32cad7fc631f6621c4ffe6b36e34 Mon Sep 17 00:00:00 2001 From: anotherminh Date: Fri, 1 Dec 2023 10:11:35 -0500 Subject: [PATCH 1/2] Add non TCF vendor config --- src/iab.ts | 18 ++++++++++++++++++ src/ui.ts | 39 +++++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/iab.ts b/src/iab.ts index 5a08579..c7165d1 100644 --- a/src/iab.ts +++ b/src/iab.ts @@ -212,3 +212,21 @@ export const TcfV3VendorList = t.intersection([ * Type override */ export type TcfV3VendorList = t.TypeOf; + +export const NonTcfVendor = t.intersection([ + t.type({ + /** The vendor name */ + name: t.string, + /** The transcend purposes associated with each vendor */ + purposes: t.array(t.string) + }), + t.partial({ + /** The vendor description */ + description: t.string + }) +]); + +/** + * Type override + */ +export type NonTcfVendor = t.TypeOf; diff --git a/src/ui.ts b/src/ui.ts index 862b9a9..4fbe88f 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -14,6 +14,7 @@ import { DismissedViewState, } from './enums'; import { AirgapAuth } from './core'; +import { NonTcfVendor } from './iab'; /** Transcend Smart Quarantine API (window.transcend) */ export type PreInitTranscendAPI = { @@ -232,6 +233,8 @@ const TCFBundledDataConfig = t.partial({ purposeMap: t.array(t.tuple([t.number, t.array(t.string)])), /** These TCF purposes cannot be processed on the basis of legitimate interests */ restrictLegitimateInterestPurposes: t.array(t.number), + /** Vendors that Transcend Consent regulates because they haven't registered with IAB TCF */ + nonTcfVendors: t.array(NonTcfVendor) }); /** Type override */ @@ -252,21 +255,21 @@ export type TranscendView = Window & { }; export const DEFAULT_VIEW_STATE_BY_PRIVACY_REGIME: ExperienceToInitialViewState = - { - // EU - GDPR: InitialViewState.QuickOptions, - // Brazil - LGPD: InitialViewState.QuickOptions, - // Switzerland - nFADP: InitialViewState.QuickOptions, - // US: California - CPRA: InitialViewState.Hidden, - // US: Virginia - CDPA: InitialViewState.Hidden, - // US: Colorado - CPA: InitialViewState.Hidden, - // US: Nevada - NEVADA_SB220: InitialViewState.Hidden, - // Other - Unknown: InitialViewState.Hidden, - }; +{ + // EU + GDPR: InitialViewState.QuickOptions, + // Brazil + LGPD: InitialViewState.QuickOptions, + // Switzerland + nFADP: InitialViewState.QuickOptions, + // US: California + CPRA: InitialViewState.Hidden, + // US: Virginia + CDPA: InitialViewState.Hidden, + // US: Colorado + CPA: InitialViewState.Hidden, + // US: Nevada + NEVADA_SB220: InitialViewState.Hidden, + // Other + Unknown: InitialViewState.Hidden, +}; From 79c5ce02aa3b133b496e9b9664d84433fff64d05 Mon Sep 17 00:00:00 2001 From: anotherminh Date: Fri, 1 Dec 2023 10:12:52 -0500 Subject: [PATCH 2/2] Bump --- package.json | 2 +- src/iab.ts | 6 +++--- src/ui.ts | 38 +++++++++++++++++++------------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index e2574b9..c68e925 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Transcend Inc.", "name": "@transcend-io/airgap.js-types", "description": "TypeScript types for airgap.js interoperability with custom consent UIs", - "version": "10.9.2", + "version": "10.9.3", "homepage": "https://github.com/transcend-io/airgap.js-types", "repository": { "type": "git", diff --git a/src/iab.ts b/src/iab.ts index c7165d1..a7796a2 100644 --- a/src/iab.ts +++ b/src/iab.ts @@ -218,12 +218,12 @@ export const NonTcfVendor = t.intersection([ /** The vendor name */ name: t.string, /** The transcend purposes associated with each vendor */ - purposes: t.array(t.string) + purposes: t.array(t.string), }), t.partial({ /** The vendor description */ - description: t.string - }) + description: t.string, + }), ]); /** diff --git a/src/ui.ts b/src/ui.ts index 4fbe88f..849b6bc 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -234,7 +234,7 @@ const TCFBundledDataConfig = t.partial({ /** These TCF purposes cannot be processed on the basis of legitimate interests */ restrictLegitimateInterestPurposes: t.array(t.number), /** Vendors that Transcend Consent regulates because they haven't registered with IAB TCF */ - nonTcfVendors: t.array(NonTcfVendor) + nonTcfVendors: t.array(NonTcfVendor), }); /** Type override */ @@ -255,21 +255,21 @@ export type TranscendView = Window & { }; export const DEFAULT_VIEW_STATE_BY_PRIVACY_REGIME: ExperienceToInitialViewState = -{ - // EU - GDPR: InitialViewState.QuickOptions, - // Brazil - LGPD: InitialViewState.QuickOptions, - // Switzerland - nFADP: InitialViewState.QuickOptions, - // US: California - CPRA: InitialViewState.Hidden, - // US: Virginia - CDPA: InitialViewState.Hidden, - // US: Colorado - CPA: InitialViewState.Hidden, - // US: Nevada - NEVADA_SB220: InitialViewState.Hidden, - // Other - Unknown: InitialViewState.Hidden, -}; + { + // EU + GDPR: InitialViewState.QuickOptions, + // Brazil + LGPD: InitialViewState.QuickOptions, + // Switzerland + nFADP: InitialViewState.QuickOptions, + // US: California + CPRA: InitialViewState.Hidden, + // US: Virginia + CDPA: InitialViewState.Hidden, + // US: Colorado + CPA: InitialViewState.Hidden, + // US: Nevada + NEVADA_SB220: InitialViewState.Hidden, + // Other + Unknown: InitialViewState.Hidden, + };