@ketch-sdk/ketch-types 1.1.3 → 1.1.5
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
|
@@ -5,28 +5,28 @@ export declare type Callback = (arg0: any) => void;
|
|
|
5
5
|
/**
|
|
6
6
|
* Status
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type Status = {
|
|
9
9
|
[key: string]: boolean;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Consent
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type Consent = {
|
|
15
15
|
purposes: Status;
|
|
16
16
|
vendors?: string[];
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* Identities
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type Identities = {
|
|
22
22
|
[key: string]: string;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Tabs
|
|
26
26
|
*/
|
|
27
27
|
export declare const ALL_TABS: readonly ["overviewTab", "rightsTab", "consentsTab"];
|
|
28
|
-
|
|
29
|
-
export
|
|
28
|
+
type TabTuple = typeof ALL_TABS;
|
|
29
|
+
export type Tab = TabTuple[number];
|
|
30
30
|
export declare function isTab(value: string): value is Tab;
|
|
31
31
|
/**
|
|
32
32
|
* Plugin class
|
|
@@ -40,19 +40,19 @@ export interface PluginClass {
|
|
|
40
40
|
regionInfoLoaded?: (host: Ketch, config: Configuration, region: string) => void;
|
|
41
41
|
consentChanged?: (host: Ketch, config: Configuration, consent: Consent) => void;
|
|
42
42
|
rightInvoked?: (host: Ketch, config: Configuration, request: InvokeRightRequest) => void;
|
|
43
|
-
showConsentExperience?:
|
|
44
|
-
showPreferenceExperience?:
|
|
45
|
-
willShowExperience?: (host: Ketch, config: Configuration) => void;
|
|
46
|
-
experienceHidden?: (host: Ketch, config: Configuration, reason
|
|
43
|
+
showConsentExperience?: (host: Ketch, config: Configuration, consents: Consent, options?: ShowConsentOptions) => void;
|
|
44
|
+
showPreferenceExperience?: (host: Ketch, config: Configuration, consents: Consent, options?: ShowPreferenceOptions) => void;
|
|
45
|
+
willShowExperience?: (host: Ketch, config: Configuration, type: string) => void;
|
|
46
|
+
experienceHidden?: (host: Ketch, config: Configuration, reason: string) => void;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Plugin factory function signature
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export type PluginFunction = (host: Ketch, config?: any) => Promise<void>;
|
|
52
52
|
/**
|
|
53
53
|
* Plugin
|
|
54
54
|
*/
|
|
55
|
-
export
|
|
55
|
+
export type Plugin = PluginClass | PluginFunction;
|
|
56
56
|
/**
|
|
57
57
|
* Ketch host
|
|
58
58
|
*/
|
|
@@ -62,32 +62,75 @@ export interface Ketch {
|
|
|
62
62
|
hasConsent(): boolean;
|
|
63
63
|
getConsent(): Promise<Consent>;
|
|
64
64
|
setConsent(c: Consent): Promise<Consent>;
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated use on('consent', callback)
|
|
67
|
+
* @param callback
|
|
68
|
+
*/
|
|
66
69
|
onConsent(callback: Callback): Promise<void>;
|
|
67
70
|
setShowConsentExperience(): Promise<void>;
|
|
68
71
|
showConsentExperience(): Promise<Consent>;
|
|
69
|
-
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated use on('showConsentExperience', callback)
|
|
74
|
+
* @param callback
|
|
75
|
+
*/
|
|
76
|
+
onShowConsentExperience(callback: (consents: Consent, options?: ShowConsentOptions) => void): Promise<void>;
|
|
70
77
|
showPreferenceExperience(params: ShowPreferenceOptions): Promise<Consent>;
|
|
71
|
-
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated use on('showPreferenceExperience', callback)
|
|
80
|
+
* @param callback
|
|
81
|
+
*/
|
|
82
|
+
onShowPreferenceExperience(callback: (consents: Consent, options?: ShowPreferenceOptions) => void): Promise<void>;
|
|
72
83
|
experienceClosed(reason: ExperienceClosedReason): Promise<Consent>;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated use on('experienceHidden', callback)
|
|
86
|
+
* @param callback
|
|
87
|
+
*/
|
|
73
88
|
onHideExperience(callback: Callback): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated use on('willShowExperience', callback)
|
|
91
|
+
* @param callback
|
|
92
|
+
*/
|
|
74
93
|
onWillShowExperience(callback: Callback): Promise<void>;
|
|
75
94
|
invokeRight(eventData: InvokeRightEvent): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated use on('rightInvoked', callback)
|
|
97
|
+
* @param callback
|
|
98
|
+
*/
|
|
76
99
|
onInvokeRight(callback: Callback): Promise<void>;
|
|
77
100
|
setEnvironment(env: Environment): Promise<Environment>;
|
|
78
101
|
getEnvironment(): Promise<Environment>;
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated use on('environment', callback)
|
|
104
|
+
* @param callback
|
|
105
|
+
*/
|
|
79
106
|
onEnvironment(callback: Callback): Promise<void>;
|
|
80
107
|
setGeoIP(g: IPInfo): Promise<IPInfo>;
|
|
81
108
|
getGeoIP(): Promise<IPInfo>;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated use on('geoip', callback)
|
|
111
|
+
* @param callback
|
|
112
|
+
*/
|
|
82
113
|
onGeoIP(callback: Callback): Promise<void>;
|
|
83
114
|
setIdentities(id: Identities): Promise<Identities>;
|
|
84
115
|
getIdentities(): Promise<Identities>;
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated use on('identities', callback)
|
|
118
|
+
* @param callback
|
|
119
|
+
*/
|
|
85
120
|
onIdentities(callback: Callback): Promise<void>;
|
|
86
121
|
setJurisdiction(ps: string): Promise<string>;
|
|
87
122
|
getJurisdiction(): Promise<string>;
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated use on('jurisdiction', callback)
|
|
125
|
+
* @param callback
|
|
126
|
+
*/
|
|
88
127
|
onJurisdiction(callback: Callback): Promise<void>;
|
|
89
128
|
setRegionInfo(info: string): Promise<string>;
|
|
90
129
|
getRegionInfo(): Promise<string>;
|
|
130
|
+
/**
|
|
131
|
+
* @deprecated use on('region', callback)
|
|
132
|
+
* @param callback
|
|
133
|
+
*/
|
|
91
134
|
onRegionInfo(callback: Callback): Promise<void>;
|
|
92
135
|
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
93
136
|
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
@@ -96,18 +139,10 @@ export interface Ketch {
|
|
|
96
139
|
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
97
140
|
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
98
141
|
}
|
|
99
|
-
/**
|
|
100
|
-
* ShowPreferenceExperience
|
|
101
|
-
*/
|
|
102
|
-
export declare type ShowPreferenceExperience = (host: Ketch, config: Configuration, consents: Consent, options?: ShowPreferenceOptions) => void;
|
|
103
|
-
/**
|
|
104
|
-
* ShowConsentExperience
|
|
105
|
-
*/
|
|
106
|
-
export declare type ShowConsentExperience = (host: Ketch, config: Configuration, consents: Consent, options?: ShowConsentOptions) => void;
|
|
107
142
|
/**
|
|
108
143
|
* ShowPreferenceOptions
|
|
109
144
|
*/
|
|
110
|
-
export
|
|
145
|
+
export type ShowPreferenceOptions = {
|
|
111
146
|
tab?: Tab;
|
|
112
147
|
/**
|
|
113
148
|
* dataSubjectTypeCodes is the list of data subjects to display. If undefined, all data subjects are displayed.
|
|
@@ -140,14 +175,14 @@ export declare enum ConsentExperienceType {
|
|
|
140
175
|
/**
|
|
141
176
|
* ShowConsentOptions
|
|
142
177
|
*/
|
|
143
|
-
export
|
|
178
|
+
export type ShowConsentOptions = {
|
|
144
179
|
displayHint: ConsentExperienceType;
|
|
145
180
|
purposes?: string[];
|
|
146
181
|
};
|
|
147
182
|
/**
|
|
148
183
|
* InvokeRightEvent
|
|
149
184
|
*/
|
|
150
|
-
export
|
|
185
|
+
export type InvokeRightEvent = {
|
|
151
186
|
right: string;
|
|
152
187
|
subject: DataSubject;
|
|
153
188
|
};
|
|
@@ -497,7 +532,7 @@ export interface Cookie {
|
|
|
497
532
|
/**
|
|
498
533
|
* PurposeCategory
|
|
499
534
|
*/
|
|
500
|
-
export
|
|
535
|
+
export type PurposeCategory = {
|
|
501
536
|
name: string;
|
|
502
537
|
description: string;
|
|
503
538
|
retentionPeriod: string;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@ketch-sdk/ketch-types", "version": "1.1.
|
|
1
|
+
{"name": "@ketch-sdk/ketch-types", "version": "1.1.5", "description": "Ketch Types", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": {"all": "npm run lint && npm run format-check && npm run test && npm run build && npm run docs", "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.3.1", "@types/jest": "^29.2.3", "@typescript-eslint/eslint-plugin": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", "@vercel/ncc": "^0.34.0", "eslint": "^8.28.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^27.1.6", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.3.1", "jest-environment-jsdom": "^29.3.1", "jest-junit": "^15.0.0", "prettier": "^2.8.0", "ts-jest": "^29.0.3", "typedoc": "^0.23.21", "typescript": "^4.9.3"}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1670014381753" clover="3.2.0">
|
|
3
|
+
<project timestamp="1670014381753" 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-12-02T20:53:01.750Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|