@ketch-sdk/ketch-types 0.4.0 → 0.4.2
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/dist/index.d.ts
CHANGED
|
@@ -22,12 +22,12 @@ export declare type Identities = {
|
|
|
22
22
|
[key: string]: string;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Tabs
|
|
26
26
|
*/
|
|
27
|
-
export declare
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export declare const ALL_TABS: readonly ["overviewTab", "rightsTab", "consentsTab"];
|
|
28
|
+
declare type TabTuple = typeof ALL_TABS;
|
|
29
|
+
export declare type Tab = TabTuple[number];
|
|
30
|
+
export declare function isTab(value: string): value is Tab;
|
|
31
31
|
/**
|
|
32
32
|
* Plugin factory function signature
|
|
33
33
|
*/
|
|
@@ -48,12 +48,12 @@ export interface Ketch {
|
|
|
48
48
|
shouldShowConsent(c: Consent): boolean;
|
|
49
49
|
showConsentExperience(): Promise<Consent>;
|
|
50
50
|
onShowConsentExperience(callback: ShowConsentExperience): Promise<void>;
|
|
51
|
-
showPreferenceExperience(params:
|
|
51
|
+
showPreferenceExperience(params: ShowPreferenceOptions): Promise<Consent>;
|
|
52
52
|
onShowPreferenceExperience(callback: ShowPreferenceExperience): Promise<void>;
|
|
53
53
|
experienceClosed(reason: ExperienceClosedReason): Promise<Consent>;
|
|
54
54
|
onHideExperience(callback: Callback): Promise<void>;
|
|
55
55
|
onWillShowExperience(callback: Callback): Promise<void>;
|
|
56
|
-
invokeRight(eventData:
|
|
56
|
+
invokeRight(eventData: InvokeRightEvent): Promise<void>;
|
|
57
57
|
onInvokeRight(callback: Callback): Promise<void>;
|
|
58
58
|
setEnvironment(env: Environment): Promise<Environment>;
|
|
59
59
|
getEnvironment(): Promise<Environment>;
|
|
@@ -89,7 +89,7 @@ export declare type ShowConsentExperience = (host: Ketch, config: Configuration,
|
|
|
89
89
|
* ShowPreferenceOptions
|
|
90
90
|
*/
|
|
91
91
|
export declare type ShowPreferenceOptions = {
|
|
92
|
-
tab?:
|
|
92
|
+
tab?: Tab;
|
|
93
93
|
/**
|
|
94
94
|
* dataSubjectTypeCodes is the list of data subjects to display. If undefined, all data subjects are displayed.
|
|
95
95
|
*/
|
|
@@ -98,6 +98,10 @@ export declare type ShowPreferenceOptions = {
|
|
|
98
98
|
* showRightsTab determines whether the rights tab will show. If undefined, the rights tab is displayed.
|
|
99
99
|
*/
|
|
100
100
|
showRightsTab?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* supportedCountries is the list of supported ISO 3166 ALPHA-2 country codes to show in the rights form
|
|
103
|
+
*/
|
|
104
|
+
supportedCountries?: string[];
|
|
101
105
|
};
|
|
102
106
|
/**
|
|
103
107
|
* ShowConsentOptions
|
|
@@ -107,20 +111,11 @@ export declare type ShowConsentOptions = {
|
|
|
107
111
|
purposes?: string[];
|
|
108
112
|
};
|
|
109
113
|
/**
|
|
110
|
-
*
|
|
114
|
+
* InvokeRightEvent
|
|
111
115
|
*/
|
|
112
|
-
export declare type
|
|
113
|
-
addressLine1?: string;
|
|
114
|
-
addressLine2?: string;
|
|
115
|
-
country?: string;
|
|
116
|
-
details?: string;
|
|
117
|
-
firstName: string;
|
|
118
|
-
lastName: string;
|
|
119
|
-
phoneNumber?: string;
|
|
120
|
-
postalCode?: string;
|
|
116
|
+
export declare type InvokeRightEvent = {
|
|
121
117
|
right: string;
|
|
122
|
-
|
|
123
|
-
stateRegion?: string;
|
|
118
|
+
subject: DataSubject;
|
|
124
119
|
};
|
|
125
120
|
/**
|
|
126
121
|
* AppDiv
|
|
@@ -303,7 +298,7 @@ export interface SetConsentRequest {
|
|
|
303
298
|
};
|
|
304
299
|
collectedAt?: number;
|
|
305
300
|
jurisdictionCode: string;
|
|
306
|
-
migrationOption
|
|
301
|
+
migrationOption?: MigrationOption;
|
|
307
302
|
purposes: {
|
|
308
303
|
[key: string]: PurposeAllowedLegalBasis;
|
|
309
304
|
};
|
|
@@ -323,8 +318,8 @@ export interface SetConsentRequest {
|
|
|
323
318
|
*/
|
|
324
319
|
export interface DataSubject {
|
|
325
320
|
email: string;
|
|
326
|
-
|
|
327
|
-
|
|
321
|
+
firstName: string;
|
|
322
|
+
lastName: string;
|
|
328
323
|
country?: string;
|
|
329
324
|
stateRegion?: string;
|
|
330
325
|
description?: string;
|
|
@@ -608,6 +603,7 @@ export interface Modal {
|
|
|
608
603
|
title: string;
|
|
609
604
|
bodyTitle?: string;
|
|
610
605
|
bodyDescription?: string;
|
|
606
|
+
footerDescription?: string;
|
|
611
607
|
buttonText: string;
|
|
612
608
|
/**
|
|
613
609
|
* consentTitle is the heading that goes above the list of purposes this optionally overrides the standard title
|
|
@@ -809,8 +805,12 @@ export declare enum ModalPosition {
|
|
|
809
805
|
* Theme
|
|
810
806
|
*/
|
|
811
807
|
export interface Theme {
|
|
808
|
+
code?: string;
|
|
809
|
+
name?: string;
|
|
810
|
+
description?: string;
|
|
812
811
|
watermark?: boolean;
|
|
813
812
|
buttonBorderRadius: number;
|
|
813
|
+
font?: string;
|
|
814
814
|
bannerBackgroundColor: string;
|
|
815
815
|
bannerContentColor?: string;
|
|
816
816
|
bannerButtonColor: string;
|
|
@@ -874,7 +874,6 @@ export interface Vendor {
|
|
|
874
874
|
policyUrl?: string;
|
|
875
875
|
cookieMaxAgeSeconds?: number;
|
|
876
876
|
usesCookies?: boolean;
|
|
877
|
-
UsesNonCookieAccess?: boolean;
|
|
878
877
|
usesNonCookieAccess?: boolean;
|
|
879
878
|
}
|
|
880
879
|
/**
|
|
@@ -953,8 +952,6 @@ export interface Configuration {
|
|
|
953
952
|
purposes?: Purpose[];
|
|
954
953
|
/**
|
|
955
954
|
* Mapping of purposes to canonical purposes.
|
|
956
|
-
*
|
|
957
|
-
* @deprecated
|
|
958
955
|
*/
|
|
959
956
|
canonicalPurposes?: {
|
|
960
957
|
[key: string]: CanonicalPurpose;
|
|
@@ -975,6 +972,18 @@ export interface Configuration {
|
|
|
975
972
|
* Experience definitions
|
|
976
973
|
*/
|
|
977
974
|
experiences?: Experience;
|
|
975
|
+
/**
|
|
976
|
+
* Vendors (TCF)
|
|
977
|
+
*/
|
|
978
|
+
vendors?: Vendor[];
|
|
979
|
+
/**
|
|
980
|
+
* Data subject types relevant for this configuration
|
|
981
|
+
*/
|
|
982
|
+
dataSubjectTypes?: DataSubjectType[];
|
|
983
|
+
/**
|
|
984
|
+
* Stacks to be displayed in an experience
|
|
985
|
+
*/
|
|
986
|
+
stacks?: Stack[];
|
|
978
987
|
/**
|
|
979
988
|
* Services
|
|
980
989
|
*/
|
|
@@ -997,18 +1006,6 @@ export interface Configuration {
|
|
|
997
1006
|
plugins?: {
|
|
998
1007
|
[key: string]: any;
|
|
999
1008
|
};
|
|
1000
|
-
/**
|
|
1001
|
-
* Vendors (TCF)
|
|
1002
|
-
*/
|
|
1003
|
-
vendors?: Vendor[];
|
|
1004
|
-
/**
|
|
1005
|
-
* Data subject types relevant for this configuration
|
|
1006
|
-
*/
|
|
1007
|
-
dataSubjectTypes?: DataSubjectType[];
|
|
1008
|
-
/**
|
|
1009
|
-
* Stacks to be displayed in an experience
|
|
1010
|
-
*/
|
|
1011
|
-
stacks?: Stack[];
|
|
1012
1009
|
}
|
|
1013
1010
|
/**
|
|
1014
1011
|
* Pusher interface defines a type that has a push function like an array
|
|
@@ -1038,3 +1035,4 @@ declare global {
|
|
|
1038
1035
|
semaphore: Pusher & Loaded;
|
|
1039
1036
|
}
|
|
1040
1037
|
}
|
|
1038
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var T={};(()=>{T.d=(E,_)=>{for(var R in _){if(T.o(_,R)&&!T.o(E,R)){Object.defineProperty(E,R,{enumerable:true,get:_[R]})}}}})();(()=>{T.o=(T,E)=>Object.prototype.hasOwnProperty.call(T,E)})();(()=>{T.r=T=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(T,"__esModule",{value:true})}})();if(typeof T!=="undefined")T.ab=__dirname+"/";var E={};T.r(E);T.d(E,{
|
|
1
|
+
(()=>{"use strict";var T={};(()=>{T.d=(E,_)=>{for(var R in _){if(T.o(_,R)&&!T.o(E,R)){Object.defineProperty(E,R,{enumerable:true,get:_[R]})}}}})();(()=>{T.o=(T,E)=>Object.prototype.hasOwnProperty.call(T,E)})();(()=>{T.r=T=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(T,"__esModule",{value:true})}})();if(typeof T!=="undefined")T.ab=__dirname+"/";var E={};T.r(E);T.d(E,{ALL_TABS:()=>_,isTab:()=>isTab,ExperienceDefault:()=>R,ExperienceButtonDestination:()=>I,ExperiencePrimaryButtonAction:()=>e,MigrationOption:()=>n,CookieDuration:()=>o,CookieProvenance:()=>A,CookieCategory:()=>t,IdentityType:()=>N,IdentityFormat:()=>i,SwitchTextRenderLogic:()=>O,BannerPosition:()=>r,ModalPosition:()=>S});const _=["overviewTab","rightsTab","consentsTab"];function isTab(T){return _.includes(T)}var R;(function(T){T[T["BANNER"]=1]="BANNER";T[T["MODAL"]=2]="MODAL"})(R||(R={}));var I;(function(T){T[T["GOTO_MODAL"]=1]="GOTO_MODAL";T[T["GOTO_PREFERENCE"]=2]="GOTO_PREFERENCE";T[T["REJECT_ALL"]=3]="REJECT_ALL"})(I||(I={}));var e;(function(T){T[T["SAVE_CURRENT_STATE"]=1]="SAVE_CURRENT_STATE";T[T["ACCEPT_ALL"]=2]="ACCEPT_ALL"})(e||(e={}));var n;(function(T){T[T["MIGRATE_DEFAULT"]=0]="MIGRATE_DEFAULT";T[T["MIGRATE_NEVER"]=1]="MIGRATE_NEVER";T[T["MIGRATE_FROM_ALLOW"]=2]="MIGRATE_FROM_ALLOW";T[T["MIGRATE_FROM_DENY"]=3]="MIGRATE_FROM_DENY";T[T["MIGRATE_ALWAYS"]=4]="MIGRATE_ALWAYS"})(n||(n={}));var o;(function(T){T[T["SESSION"]=1]="SESSION";T[T["PERSISTENT"]=2]="PERSISTENT"})(o||(o={}));var A;(function(T){T[T["FIRST_PARTY"]=1]="FIRST_PARTY";T[T["THIRD_PARTY"]=2]="THIRD_PARTY"})(A||(A={}));var t;(function(T){T[T["STRICTLY_NECESSARY"]=1]="STRICTLY_NECESSARY";T[T["FUNCTIONAL"]=2]="FUNCTIONAL";T[T["PERFORMANCE"]=3]="PERFORMANCE";T[T["MARKETING"]=4]="MARKETING"})(t||(t={}));var N;(function(T){T["IDENTITY_TYPE_UNDEFINED"]="";T["IDENTITY_TYPE_DATA_LAYER"]="dataLayer";T["IDENTITY_TYPE_WINDOW"]="window";T["IDENTITY_TYPE_COOKIE"]="cookie";T["IDENTITY_TYPE_MANAGED"]="managedCookie";T["IDENTITY_TYPE_LOCAL_STORAGE"]="localStorage";T["IDENTITY_TYPE_SESSION_STORAGE"]="sessionStorage";T["IDENTITY_TYPE_QUERY_STRING"]="queryString"})(N||(N={}));var i;(function(T){T["IDENTITY_FORMAT_UNDEFINED"]="";T["IDENTITY_FORMAT_STRING"]="string";T["IDENTITY_FORMAT_JSON"]="json";T["IDENTITY_FORMAT_JWT"]="jwt";T["IDENTITY_FORMAT_QUERY"]="query";T["IDENTITY_FORMAT_SEMICOLON"]="semicolon"})(i||(i={}));var O;(function(T){T[T["SWITCH_TEXT_RENDER_ALL"]=1]="SWITCH_TEXT_RENDER_ALL";T[T["SWITCH_TEXT_RENDER_LEGAL_BASIS"]=2]="SWITCH_TEXT_RENDER_LEGAL_BASIS";T[T["SWITCH_TEXT_RENDER_CHANGE"]=3]="SWITCH_TEXT_RENDER_CHANGE";T[T["SWITCH_TEXT_RENDER_NEVER"]=4]="SWITCH_TEXT_RENDER_NEVER"})(O||(O={}));var r;(function(T){T[T["BOTTOM"]=1]="BOTTOM";T[T["TOP"]=2]="TOP";T[T["BOTTOM_LEFT"]=3]="BOTTOM_LEFT";T[T["BOTTOM_RIGHT"]=4]="BOTTOM_RIGHT"})(r||(r={}));var S;(function(T){T[T["CENTER"]=1]="CENTER";T[T["LEFT_FULL_HEIGHT"]=2]="LEFT_FULL_HEIGHT";T[T["RIGHT_FULL_HEIGHT"]=3]="RIGHT_FULL_HEIGHT"})(S||(S={}));module.exports=E})();
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@ketch-sdk/ketch-types", "version": "0.4.
|
|
1
|
+
{"name": "@ketch-sdk/ketch-types", "version": "0.4.2", "description": "Ketch Types", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": {"build": "ncc build --minify --license licenses.txt src/index.ts", "lint": "eslint src/**/*.ts", "test": "jest --runInBand --passWithNoTests", "format": "prettier --write \"**/*.{ts,tsx,yml,yaml}\"", "format-check": "prettier --check '**/*.ts'", "docs": "typedoc --githubPages true --excludeInternal src/index.ts"}, "repository": {"type": "git", "url": "git+https://github.com/ketch-sdk/ketch-types.git"}, "author": "Ketch Kloud, Inc. (https://www.ketch.com/)", "license": "MIT", "homepage": "https://github.com/ketch-sdk/ketch-types", "bugs": {"url": "https://github.com/ketch-sdk/ketch-types/issues"}, "devDependencies": {"@jest/globals": "^29.2.2", "@types/jest": "^29.2.0", "@typescript-eslint/eslint-plugin": "^5.42.0", "@typescript-eslint/parser": "^5.42.0", "@vercel/ncc": "^0.34.0", "eslint": "^8.26.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^27.1.3", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.2.2", "jest-environment-jsdom": "^29.2.2", "jest-junit": "^14.0.1", "prettier": "^2.7.1", "ts-jest": "^29.0.3", "typedoc": "^0.23.19", "typescript": "^4.8.4"}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1667261557722" clover="3.2.0">
|
|
3
|
+
<project timestamp="1667261557722" name="All files">
|
|
4
4
|
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
|
|
5
5
|
</project>
|
|
6
6
|
</coverage>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
87
87
|
Code coverage generated by
|
|
88
88
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
89
|
-
at 2022-
|
|
89
|
+
at 2022-11-01T00:12:37.718Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|