Skip to content

Commit

Permalink
Expand TCF config, defaults (#116)
Browse files Browse the repository at this point in the history
* Expand TCF config, defaults

* prettier
  • Loading branch information
anotherminh authored Nov 30, 2023
1 parent a3ca695 commit 6d21672
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.1",
"version": "10.9.2",
"homepage": "https://github.com/transcend-io/airgap.js-types",
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ export const REGIME_DISPLAY_PRIORITY: Record<PrivacyRegime, number> = {
GDPR: 10,
Unknown: 100,
};

/** These TCF Purposes cannot be allowed to process under legitimate interest legal basis */
export const DEFAULT_RESTRICT_LEGIT_INTEREST_PROCESSING = [1, 3, 4, 5, 6];
11 changes: 11 additions & 0 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ export const TCFConfig = t.type({
/** Type override */
export type TCFConfig = t.TypeOf<typeof TCFConfig>;

/** Configuration that are passed directly to the TCF module, not via airgap.j */
const TCFBundledDataConfig = t.partial({
/** Mapping of TCF Purpose ID to airgap tracking types */
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),
});

/** Type override */
export type TCFBundledDataConfig = t.TypeOf<typeof TCFBundledDataConfig>;

/** Input for Consent manager UI configuration */
export const TCFConfigInput = t.partial(TCFConfig.props);

Expand Down

0 comments on commit 6d21672

Please sign in to comment.