@ketch-sdk/ketch-types 0.3.0 → 0.4.1
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,9 +48,9 @@ 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
|
-
experienceClosed(reason:
|
|
53
|
+
experienceClosed(reason: ExperienceClosedReason): Promise<Consent>;
|
|
54
54
|
onHideExperience(callback: Callback): Promise<void>;
|
|
55
55
|
onWillShowExperience(callback: Callback): Promise<void>;
|
|
56
56
|
invokeRight(eventData: InvokeRightsEvent): Promise<void>;
|
|
@@ -70,7 +70,12 @@ export interface Ketch {
|
|
|
70
70
|
setRegionInfo(info: string): Promise<string>;
|
|
71
71
|
getRegionInfo(): Promise<string>;
|
|
72
72
|
onRegionInfo(callback: Callback): Promise<void>;
|
|
73
|
-
|
|
73
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
74
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
75
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
76
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
77
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
78
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
74
79
|
}
|
|
75
80
|
/**
|
|
76
81
|
* ShowPreferenceExperience
|
|
@@ -84,7 +89,7 @@ export declare type ShowConsentExperience = (host: Ketch, config: Configuration,
|
|
|
84
89
|
* ShowPreferenceOptions
|
|
85
90
|
*/
|
|
86
91
|
export declare type ShowPreferenceOptions = {
|
|
87
|
-
tab?:
|
|
92
|
+
tab?: Tab;
|
|
88
93
|
/**
|
|
89
94
|
* dataSubjectTypeCodes is the list of data subjects to display. If undefined, all data subjects are displayed.
|
|
90
95
|
*/
|
|
@@ -93,6 +98,10 @@ export declare type ShowPreferenceOptions = {
|
|
|
93
98
|
* showRightsTab determines whether the rights tab will show. If undefined, the rights tab is displayed.
|
|
94
99
|
*/
|
|
95
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[];
|
|
96
105
|
};
|
|
97
106
|
/**
|
|
98
107
|
* ShowConsentOptions
|
|
@@ -124,6 +133,14 @@ export interface AppDiv {
|
|
|
124
133
|
id: string;
|
|
125
134
|
zIndex: string;
|
|
126
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* ExperienceClosedReason describes the reason the experience was closed.
|
|
138
|
+
*
|
|
139
|
+
* setConsent = consent was accepted/set
|
|
140
|
+
* invokeRight = the right was invoked
|
|
141
|
+
* close = the close/exit button was clicked
|
|
142
|
+
*/
|
|
143
|
+
export declare type ExperienceClosedReason = 'setConsent' | 'invokeRight' | 'close';
|
|
127
144
|
/**
|
|
128
145
|
* ExperienceDefault
|
|
129
146
|
*/
|
|
@@ -1025,3 +1042,4 @@ declare global {
|
|
|
1025
1042
|
semaphore: Pusher & Loaded;
|
|
1026
1043
|
}
|
|
1027
1044
|
}
|
|
1045
|
+
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.
|
|
1
|
+
{"name": "@ketch-sdk/ketch-types", "version": "0.4.1", "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="1667246176709" clover="3.2.0">
|
|
3
|
+
<project timestamp="1667246176709" 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-10-
|
|
89
|
+
at 2022-10-31T19:56:16.706Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|