@transcend-io/airgap.js-types
Advanced tools
Comparing version 10.12.1 to 10.12.2
@@ -5,3 +5,3 @@ import { IsoCountryCode } from '@transcend-io/privacy-types'; | ||
import { PrivacyRegime } from './core'; | ||
import { RegionsOperator } from './enums'; | ||
import { OnConsentExpiry, RegionsOperator } from './enums'; | ||
export interface Region { | ||
@@ -38,5 +38,11 @@ /** A country's ISO code */ | ||
experiencePurposeInputs: ExperiencePurposeInput[]; | ||
/** Time in months after which a user's opt-in consent should expire */ | ||
consentExpiry: number; | ||
/** Behavior to exhibit when the user's consent has expired */ | ||
onConsentExpiry: OnConsentExpiry; | ||
} | ||
export declare const REGIME_REGIONS: Record<PrivacyRegime, Region[]>; | ||
export declare const REGIME_LANGUAGES: Record<PrivacyRegime, string[]>; | ||
export declare const REGIME_CONSENT_EXPIRY: Record<PrivacyRegime, number>; | ||
export declare const REGIME_ON_CONSENT_EXPIRY: Record<PrivacyRegime, OnConsentExpiry>; | ||
/** | ||
@@ -43,0 +49,0 @@ * construct default experience for regime |
@@ -8,3 +8,3 @@ // main | ||
import { DEFAULT_EXPERIENCE_PURPOSE_SCOPES, DEFAULT_EXPERIENCE_PURPOSE_OPT_OUTS, REGIME_DISPLAY_PRIORITY, REGIME_TIMEZONES, } from './constants'; | ||
import { BrowserLanguage, RegionsOperator } from './enums'; | ||
import { BrowserLanguage, OnConsentExpiry, RegionsOperator } from './enums'; | ||
// default to [] | ||
@@ -79,2 +79,10 @@ // Don't put this into constants or you will regret it (per the constants.ts warning) | ||
}; | ||
// default to 0 | ||
export const REGIME_CONSENT_EXPIRY = { | ||
GDPR: 12, | ||
}; | ||
// default to prompt | ||
export const REGIME_ON_CONSENT_EXPIRY = { | ||
GDPR: OnConsentExpiry.ResetOptIns, | ||
}; | ||
/** | ||
@@ -86,3 +94,3 @@ * construct default experience for regime | ||
export function defaultExperience(regime) { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
const isUnknown = regime === 'Unknown'; | ||
@@ -106,2 +114,4 @@ const regimeEnum = PrivacyRegimeEnum[regime]; | ||
}), | ||
consentExpiry: (_f = REGIME_CONSENT_EXPIRY[regime]) !== null && _f !== void 0 ? _f : 0, | ||
onConsentExpiry: (_g = REGIME_ON_CONSENT_EXPIRY[regime]) !== null && _g !== void 0 ? _g : OnConsentExpiry.Prompt, | ||
}; | ||
@@ -108,0 +118,0 @@ } |
@@ -5,3 +5,3 @@ import { IsoCountryCode } from '@transcend-io/privacy-types'; | ||
import { PrivacyRegime } from './core'; | ||
import { RegionsOperator } from './enums'; | ||
import { OnConsentExpiry, RegionsOperator } from './enums'; | ||
export interface Region { | ||
@@ -38,5 +38,11 @@ /** A country's ISO code */ | ||
experiencePurposeInputs: ExperiencePurposeInput[]; | ||
/** Time in months after which a user's opt-in consent should expire */ | ||
consentExpiry: number; | ||
/** Behavior to exhibit when the user's consent has expired */ | ||
onConsentExpiry: OnConsentExpiry; | ||
} | ||
export declare const REGIME_REGIONS: Record<PrivacyRegime, Region[]>; | ||
export declare const REGIME_LANGUAGES: Record<PrivacyRegime, string[]>; | ||
export declare const REGIME_CONSENT_EXPIRY: Record<PrivacyRegime, number>; | ||
export declare const REGIME_ON_CONSENT_EXPIRY: Record<PrivacyRegime, OnConsentExpiry>; | ||
/** | ||
@@ -43,0 +49,0 @@ * construct default experience for regime |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DEFAULT_EXPERIENCES = exports.defaultExperience = exports.REGIME_LANGUAGES = exports.REGIME_REGIONS = void 0; | ||
exports.DEFAULT_EXPERIENCES = exports.defaultExperience = exports.REGIME_ON_CONSENT_EXPIRY = exports.REGIME_CONSENT_EXPIRY = exports.REGIME_LANGUAGES = exports.REGIME_REGIONS = void 0; | ||
// main | ||
@@ -81,2 +81,10 @@ const type_utils_1 = require("@transcend-io/type-utils"); | ||
}; | ||
// default to 0 | ||
exports.REGIME_CONSENT_EXPIRY = { | ||
GDPR: 12, | ||
}; | ||
// default to prompt | ||
exports.REGIME_ON_CONSENT_EXPIRY = { | ||
GDPR: enums_1.OnConsentExpiry.ResetOptIns, | ||
}; | ||
/** | ||
@@ -88,3 +96,3 @@ * construct default experience for regime | ||
function defaultExperience(regime) { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
const isUnknown = regime === 'Unknown'; | ||
@@ -108,2 +116,4 @@ const regimeEnum = privacyRegime_1.PrivacyRegimeEnum[regime]; | ||
}), | ||
consentExpiry: (_f = exports.REGIME_CONSENT_EXPIRY[regime]) !== null && _f !== void 0 ? _f : 0, | ||
onConsentExpiry: (_g = exports.REGIME_ON_CONSENT_EXPIRY[regime]) !== null && _g !== void 0 ? _g : enums_1.OnConsentExpiry.Prompt, | ||
}; | ||
@@ -110,0 +120,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "TypeScript types for airgap.js interoperability with custom consent UIs", | ||
"version": "10.12.1", | ||
"version": "10.12.2", | ||
"homepage": "https://github.com/transcend-io/airgap.js-types", | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394757
6818