Skip to content

Commit

Permalink
Implement all GPP sections for completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
zapo committed Dec 18, 2024
1 parent bcf17b3 commit 056e7a2
Show file tree
Hide file tree
Showing 20 changed files with 408 additions and 4 deletions.
23 changes: 19 additions & 4 deletions lib/core/regs/gpp/cmpapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Section as TCFCaV1Section, APIPrefix as TCFCaV1APIPrefix } from "./tcfcav1";
import { Section as TCFEuV2Section, APIPrefix as TCFEuV2APIPrefix } from "./tcfeuv2";
import * as sections from "./sections";

declare global {
interface Window {
Expand All @@ -8,8 +7,24 @@ declare global {
}

type ParsedSections = {
[TCFEuV2APIPrefix]?: TCFEuV2Section;
[TCFCaV1APIPrefix]?: TCFCaV1Section;
[sections.tcfcav1.APIPrefix]?: sections.tcfcav1.Section;
[sections.tcfeuv2.APIPrefix]?: sections.tcfeuv2.Section;
[sections.usnat.APIPrefix]?: sections.usnat.Section;
[sections.usca.APIPrefix]?: sections.usca.Section;
[sections.usco.APIPrefix]?: sections.usco.Section;
[sections.usct.APIPrefix]?: sections.usct.Section;
[sections.usde.APIPrefix]?: sections.usde.Section;
[sections.usfl.APIPrefix]?: sections.usfl.Section;
[sections.usia.APIPrefix]?: sections.usia.Section;
[sections.usmt.APIPrefix]?: sections.usmt.Section;
[sections.usne.APIPrefix]?: sections.usne.Section;
[sections.usnh.APIPrefix]?: sections.usnh.Section;
[sections.usnj.APIPrefix]?: sections.usnj.Section;
[sections.usor.APIPrefix]?: sections.usor.Section;
[sections.ustn.APIPrefix]?: sections.ustn.Section;
[sections.ustx.APIPrefix]?: sections.ustx.Section;
[sections.usut.APIPrefix]?: sections.usut.Section;
[sections.usva.APIPrefix]?: sections.usva.Section;
};

type PingReturn = {
Expand Down
2 changes: 2 additions & 0 deletions lib/core/regs/gpp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./sections";
export * as cmpapi from "./cmpapi";
18 changes: 18 additions & 0 deletions lib/core/regs/gpp/sections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export * as tcfcav1 from "./tcfcav1";
export * as tcfeuv2 from "./tcfeuv2";
export * as usnat from "./usnat";
export * as usca from "./usca";
export * as usco from "./usco";
export * as usct from "./usct";
export * as usde from "./usde";
export * as usfl from "./usfl";
export * as usia from "./usia";
export * as usmt from "./usmt";
export * as usne from "./usne";
export * as usnh from "./usnh";
export * as usnj from "./usnj";
export * as usor from "./usor";
export * as ustn from "./ustn";
export * as ustx from "./ustx";
export * as usut from "./usut";
export * as usva from "./usva";
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usca.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
SaleOptOutNotice: number;
SharingOptOutNotice: number;
SensitiveDataLimitUseNotice: number;
SaleOptOut: number;
SharingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number[];
PersonalDataConsents: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 8;
const APIPrefix = "usca";

export type { Section };

export { SectionID, APIPrefix };
22 changes: 22 additions & 0 deletions lib/core/regs/gpp/usco.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type CoreSubsection = {
Version: number;
SharingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 10;
const APIPrefix = "usco";

export type { Section };

export { SectionID, APIPrefix };
22 changes: 22 additions & 0 deletions lib/core/regs/gpp/usct.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type CoreSubsection = {
Version: number;
SharingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 12;
const APIPrefix = "usct";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usde.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 17;
const APIPrefix = "usde";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usfl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 13;
const APIPrefix = "usfl";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SensitiveDataOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 18;
const APIPrefix = "usia";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usmt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
SharingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 14;
const APIPrefix = "usmt";

export type { Section };

export { SectionID, APIPrefix };
27 changes: 27 additions & 0 deletions lib/core/regs/gpp/usnat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type CoreSegment = {
Version: number;
SharingNotice: number;
SaleOptOutNotice: number;
SharingOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SensitiveDataProcessingOptOutNotice: number;
SensitiveDataLimitUseNotice: number;
SaleOptOut: number;
SharingOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number[];
PersonalDataConsents: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

const SectionID = 7;
const APIPrefix = "usnat";

type Section = Array<CoreSegment>;

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usne.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 19;
const APIPrefix = "usne";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usnh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 20;
const APIPrefix = "usnh";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usnj.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 21;
const APIPrefix = "usnj";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/usor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 15;
const APIPrefix = "usor";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/ustn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 22;
const APIPrefix = "ustn";

export type { Section };

export { SectionID, APIPrefix };
23 changes: 23 additions & 0 deletions lib/core/regs/gpp/ustx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type CoreSubsection = {
Version: number;
ProcessingNotice: number;
SaleOptOutNotice: number;
TargetedAdvertisingOptOutNotice: number;
SaleOptOut: number;
TargetedAdvertisingOptOut: number;
SensitiveDataProcessing: number[];
KnownChildSensitiveDataConsents: number;
AdditionalDataProcessingConsent: number;
MspaCoveredTransaction: number;
MspaOptOutOptionMode: number;
MspaServiceProviderMode: number;
};

type Section = Array<CoreSubsection>;

const SectionID = 16;
const APIPrefix = "ustx";

export type { Section };

export { SectionID, APIPrefix };
Loading

0 comments on commit 056e7a2

Please sign in to comment.