@ketch-sdk/ketch-types 1.4.0 → 1.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.
Files changed (118) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.json +31 -0
  4. package/.github/CODEOWNERS +1 -0
  5. package/.github/CONTRIBUTING.md +177 -0
  6. package/.github/ISSUE_TEMPLATE.md +19 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +30 -0
  8. package/.github/dependabot.yml +18 -0
  9. package/.github/release.yml +18 -0
  10. package/.github/workflows/ci.yml +79 -0
  11. package/.prettierignore +3 -0
  12. package/.prettierrc +15 -0
  13. package/docs/.nojekyll +1 -0
  14. package/docs/assets/highlight.css +22 -0
  15. package/docs/assets/main.js +4 -0
  16. package/docs/assets/search.js +1 -0
  17. package/docs/assets/style.css +1280 -0
  18. package/docs/enums/BannerPosition.html +88 -0
  19. package/docs/enums/ConsentExperienceType.html +81 -0
  20. package/docs/enums/CookieCategory.html +88 -0
  21. package/docs/enums/CookieDuration.html +74 -0
  22. package/docs/enums/CookieProvenance.html +74 -0
  23. package/docs/enums/ExperienceButtonDestination.html +81 -0
  24. package/docs/enums/ExperienceClosedReason.html +91 -0
  25. package/docs/enums/ExperienceDefault.html +74 -0
  26. package/docs/enums/ExperiencePrimaryButtonAction.html +74 -0
  27. package/docs/enums/ExperienceType.html +74 -0
  28. package/docs/enums/IdentityFormat.html +102 -0
  29. package/docs/enums/IdentityType.html +116 -0
  30. package/docs/enums/MigrationOption.html +95 -0
  31. package/docs/enums/ModalPosition.html +81 -0
  32. package/docs/enums/SwitchTextRenderLogic.html +96 -0
  33. package/docs/functions/isTab.html +137 -0
  34. package/docs/index.html +126 -0
  35. package/docs/interfaces/AppDiv.html +78 -0
  36. package/docs/interfaces/Banner.html +129 -0
  37. package/docs/interfaces/CanonicalPurpose.html +85 -0
  38. package/docs/interfaces/Configuration.html +305 -0
  39. package/docs/interfaces/ConsentExperience.html +120 -0
  40. package/docs/interfaces/ConsentsTab.html +161 -0
  41. package/docs/interfaces/Cookie.html +134 -0
  42. package/docs/interfaces/DataSubject.html +152 -0
  43. package/docs/interfaces/DataSubjectType.html +87 -0
  44. package/docs/interfaces/Deployment.html +78 -0
  45. package/docs/interfaces/Environment.html +92 -0
  46. package/docs/interfaces/Experience.html +78 -0
  47. package/docs/interfaces/GetBootstrapConfigurationRequest.html +78 -0
  48. package/docs/interfaces/GetConsentRequest.html +137 -0
  49. package/docs/interfaces/GetConsentResponse.html +139 -0
  50. package/docs/interfaces/GetFullConfigurationRequest.html +113 -0
  51. package/docs/interfaces/GetLocationRequest.html +71 -0
  52. package/docs/interfaces/GetLocationResponse.html +71 -0
  53. package/docs/interfaces/GetPreferenceQRRequest.html +125 -0
  54. package/docs/interfaces/IPInfo.html +155 -0
  55. package/docs/interfaces/IPLanguage.html +85 -0
  56. package/docs/interfaces/IPLocation.html +120 -0
  57. package/docs/interfaces/Identity.html +110 -0
  58. package/docs/interfaces/InvokeRightRequest.html +139 -0
  59. package/docs/interfaces/JIT.html +129 -0
  60. package/docs/interfaces/JurisdictionInfo.html +97 -0
  61. package/docs/interfaces/Ketch.html +735 -0
  62. package/docs/interfaces/Loaded.html +73 -0
  63. package/docs/interfaces/Modal.html +176 -0
  64. package/docs/interfaces/Organization.html +71 -0
  65. package/docs/interfaces/OverviewTab.html +99 -0
  66. package/docs/interfaces/PluginClass.html +354 -0
  67. package/docs/interfaces/PolicyDocument.html +85 -0
  68. package/docs/interfaces/PreferenceExperience.html +120 -0
  69. package/docs/interfaces/Property.html +92 -0
  70. package/docs/interfaces/Purpose.html +179 -0
  71. package/docs/interfaces/PurposeAllowed.html +78 -0
  72. package/docs/interfaces/PurposeAllowedLegalBasis.html +78 -0
  73. package/docs/interfaces/PurposeLegalBasis.html +78 -0
  74. package/docs/interfaces/Pusher.html +83 -0
  75. package/docs/interfaces/Recaptcha.html +73 -0
  76. package/docs/interfaces/Right.html +95 -0
  77. package/docs/interfaces/RightsTab.html +106 -0
  78. package/docs/interfaces/SetConsentRequest.html +144 -0
  79. package/docs/interfaces/Stack.html +82 -0
  80. package/docs/interfaces/StorageProvider.html +117 -0
  81. package/docs/interfaces/Theme.html +262 -0
  82. package/docs/interfaces/Vendor.html +134 -0
  83. package/docs/interfaces/VendorPurpose.html +78 -0
  84. package/docs/interfaces/WebReportRequest.html +104 -0
  85. package/docs/modules.html +218 -0
  86. package/docs/types/Callback.html +141 -0
  87. package/docs/types/Consent.html +135 -0
  88. package/docs/types/Identities.html +133 -0
  89. package/docs/types/IdentityProvider.html +136 -0
  90. package/docs/types/InvokeRightEvent.html +137 -0
  91. package/docs/types/Plugin.html +128 -0
  92. package/docs/types/PluginFunction.html +143 -0
  93. package/docs/types/PurposeCategory.html +139 -0
  94. package/docs/types/ShowConsentOptions.html +135 -0
  95. package/docs/types/ShowPreferenceOptions.html +149 -0
  96. package/docs/types/Status.html +133 -0
  97. package/docs/types/Tab.html +128 -0
  98. package/docs/types/TabTuple.html +128 -0
  99. package/docs/variables/ALL_TABS.html +128 -0
  100. package/jest.config.js +174 -0
  101. package/package.json +1 -1
  102. package/src/index.ts +1339 -0
  103. package/tsconfig.json +8 -3
  104. package/tsfmt.json +19 -0
  105. package/dist/index.d.ts +0 -1183
  106. package/dist/index.js +0 -1
  107. package/test-reports/coverage/clover.xml +0 -6
  108. package/test-reports/coverage/coverage-final.json +0 -1
  109. package/test-reports/coverage/lcov-report/base.css +0 -224
  110. package/test-reports/coverage/lcov-report/block-navigation.js +0 -87
  111. package/test-reports/coverage/lcov-report/favicon.png +0 -0
  112. package/test-reports/coverage/lcov-report/index.html +0 -101
  113. package/test-reports/coverage/lcov-report/prettify.css +0 -1
  114. package/test-reports/coverage/lcov-report/prettify.js +0 -2
  115. package/test-reports/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  116. package/test-reports/coverage/lcov-report/sorter.js +0 -196
  117. package/test-reports/coverage/lcov.info +0 -0
  118. package/test-reports/junit/junit.xml +0 -3
package/dist/index.d.ts DELETED
@@ -1,1183 +0,0 @@
1
- /**
2
- * Callback
3
- */
4
- export declare type Callback = (arg0: any) => void;
5
- /**
6
- * Status
7
- */
8
- export type Status = {
9
- [key: string]: boolean;
10
- };
11
- /**
12
- * Consent
13
- */
14
- export type Consent = {
15
- purposes: Status;
16
- vendors?: string[];
17
- };
18
- /**
19
- * Identities
20
- */
21
- export type Identities = {
22
- [key: string]: string;
23
- };
24
- /**
25
- * Tabs
26
- */
27
- export declare const ALL_TABS: readonly ["overviewTab", "rightsTab", "consentsTab"];
28
- type TabTuple = typeof ALL_TABS;
29
- export type Tab = TabTuple[number];
30
- export declare function isTab(value: string): value is Tab;
31
- /**
32
- * Plugin class
33
- */
34
- export interface PluginClass {
35
- init?: (host: Ketch, config: Configuration) => void;
36
- environmentLoaded?: (host: Ketch, config: Configuration, env: Environment) => void;
37
- geoIPLoaded?: (host: Ketch, config: Configuration, ipInfo: IPInfo) => void;
38
- identitiesLoaded?: (host: Ketch, config: Configuration, identities: Identities) => void;
39
- jurisdictionLoaded?: (host: Ketch, config: Configuration, policyScope: string) => void;
40
- regionInfoLoaded?: (host: Ketch, config: Configuration, region: string) => void;
41
- consentChanged?: (host: Ketch, config: Configuration, consent: Consent) => void;
42
- rightInvoked?: (host: Ketch, config: Configuration, request: InvokeRightRequest) => void;
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
- }
48
- /**
49
- * Plugin factory function signature
50
- */
51
- export type PluginFunction = (host: Ketch, config?: any) => Promise<void>;
52
- /**
53
- * Plugin
54
- */
55
- export type Plugin = PluginClass | PluginFunction;
56
- /**
57
- * IdentityProvider defines a function for providing identities
58
- */
59
- export type IdentityProvider = () => Promise<string[]>;
60
- /**
61
- * StorageProvider defines an interface for storage
62
- */
63
- export interface StorageProvider {
64
- /**
65
- * Get an item with the given key
66
- *
67
- * @param key
68
- */
69
- getItem(key: string): Promise<string | null>;
70
- /**
71
- * Sets the value for the given key
72
- *
73
- * @param key
74
- * @param value
75
- */
76
- setItem(key: string, value: string): Promise<void>;
77
- /**
78
- * Removes the given key
79
- *
80
- * @param key
81
- */
82
- removeItem(key: string): Promise<void>;
83
- }
84
- /**
85
- * Ketch host
86
- */
87
- export interface Ketch {
88
- getConfig(): Promise<Configuration>;
89
- /**
90
- * Register a plugin with the given configuration
91
- *
92
- * @param plugin
93
- * @param config
94
- */
95
- registerPlugin(plugin: Plugin, config?: any): Promise<void>;
96
- /**
97
- * Register an identity provider for the given identity
98
- *
99
- * @param name
100
- * @param provider
101
- */
102
- registerIdentityProvider(name: string, provider: IdentityProvider): Promise<void>;
103
- /**
104
- * Register a storage provider
105
- *
106
- * @param provider
107
- */
108
- registerStorageProvider(provider: StorageProvider): Promise<void>;
109
- hasConsent(): boolean;
110
- getConsent(): Promise<Consent>;
111
- setConsent(c: Consent): Promise<Consent>;
112
- /**
113
- * @deprecated use on('consent', callback)
114
- * @param callback
115
- */
116
- onConsent(callback: Callback): Promise<void>;
117
- setShowConsentExperience(): Promise<void>;
118
- showConsentExperience(): Promise<Consent>;
119
- /**
120
- * @deprecated use on('showConsentExperience', callback)
121
- * @param callback
122
- */
123
- onShowConsentExperience(callback: (consents: Consent, options?: ShowConsentOptions) => void): Promise<void>;
124
- showPreferenceExperience(params: ShowPreferenceOptions): Promise<Consent>;
125
- /**
126
- * @deprecated use on('showPreferenceExperience', callback)
127
- * @param callback
128
- */
129
- onShowPreferenceExperience(callback: (consents: Consent, options?: ShowPreferenceOptions) => void): Promise<void>;
130
- experienceClosed(reason: ExperienceClosedReason): Promise<Consent>;
131
- /**
132
- * @deprecated use on('experienceHidden', callback)
133
- * @param callback
134
- */
135
- onHideExperience(callback: Callback): Promise<void>;
136
- /**
137
- * @deprecated use on('willShowExperience', callback)
138
- * @param callback
139
- */
140
- onWillShowExperience(callback: Callback): Promise<void>;
141
- invokeRight(eventData: InvokeRightEvent): Promise<void>;
142
- /**
143
- * @deprecated use on('rightInvoked', callback)
144
- * @param callback
145
- */
146
- onInvokeRight(callback: Callback): Promise<void>;
147
- setEnvironment(env: Environment): Promise<Environment>;
148
- getEnvironment(): Promise<Environment>;
149
- /**
150
- * @deprecated use on('environment', callback)
151
- * @param callback
152
- */
153
- onEnvironment(callback: Callback): Promise<void>;
154
- setGeoIP(g: IPInfo): Promise<IPInfo>;
155
- getGeoIP(): Promise<IPInfo>;
156
- /**
157
- * @deprecated use on('geoip', callback)
158
- * @param callback
159
- */
160
- onGeoIP(callback: Callback): Promise<void>;
161
- setIdentities(id: Identities): Promise<Identities>;
162
- getIdentities(): Promise<Identities>;
163
- /**
164
- * @deprecated use on('identities', callback)
165
- * @param callback
166
- */
167
- onIdentities(callback: Callback): Promise<void>;
168
- setJurisdiction(ps: string): Promise<string>;
169
- getJurisdiction(): Promise<string>;
170
- /**
171
- * @deprecated use on('jurisdiction', callback)
172
- * @param callback
173
- */
174
- onJurisdiction(callback: Callback): Promise<void>;
175
- setRegionInfo(info: string): Promise<string>;
176
- getRegionInfo(): Promise<string>;
177
- /**
178
- * @deprecated use on('region', callback)
179
- * @param callback
180
- */
181
- onRegionInfo(callback: Callback): Promise<void>;
182
- emit(eventName: string | symbol, ...args: any[]): boolean;
183
- addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
184
- removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
185
- on(eventName: string | symbol, listener: (...args: any[]) => void): this;
186
- once(eventName: string | symbol, listener: (...args: any[]) => void): this;
187
- off(eventName: string | symbol, listener: (...args: any[]) => void): this;
188
- }
189
- /**
190
- * ShowPreferenceOptions
191
- */
192
- export type ShowPreferenceOptions = {
193
- tab?: Tab;
194
- /**
195
- * dataSubjectTypeCodes is the list of data subjects to display. If undefined, all data subjects are displayed.
196
- */
197
- dataSubjectTypeCodes?: string[];
198
- /**
199
- * showRightsTab determines whether the rights tab will show. If undefined, the rights tab is displayed.
200
- */
201
- showRightsTab?: boolean;
202
- /**
203
- * supportedCountries is the list of supported ISO 3166 ALPHA-2 country codes to show in the rights form
204
- */
205
- supportedCountries?: string[];
206
- /**
207
- * showConsentsTab determines whether the consents tab will show. If undefined, the consents tab is displayed
208
- */
209
- showConsentsTab?: boolean;
210
- };
211
- /**
212
- * ExperienceType is the type of experience that will be shown
213
- */
214
- export declare enum ExperienceType {
215
- Consent = "experiences.consent",
216
- Preference = "experiences.preference"
217
- }
218
- /**
219
- * ConsentExperienceType is the type of consent experience that will be shown
220
- */
221
- export declare enum ConsentExperienceType {
222
- Banner = "experiences.consent.banner",
223
- Modal = "experiences.consent.modal",
224
- JIT = "experiences.consent.jit"
225
- }
226
- /**
227
- * ShowConsentOptions
228
- */
229
- export type ShowConsentOptions = {
230
- displayHint: ConsentExperienceType;
231
- purposes?: string[];
232
- };
233
- /**
234
- * InvokeRightEvent
235
- */
236
- export type InvokeRightEvent = {
237
- right: string;
238
- subject: DataSubject;
239
- recaptchaToken?: string;
240
- };
241
- /**
242
- * AppDiv
243
- */
244
- export interface AppDiv {
245
- id: string;
246
- zIndex: string;
247
- }
248
- /**
249
- * ExperienceClosedReason describes the reason the experience was closed.
250
- *
251
- * setConsent = consent was accepted/set
252
- * invokeRight = the right was invoked
253
- * close = the close/exit button was clicked
254
- */
255
- export declare enum ExperienceClosedReason {
256
- SET_CONSENT = "setConsent",
257
- INVOKE_RIGHT = "invokeRight",
258
- CLOSE = "close",
259
- WILL_NOT_SHOW = "willNotShow"
260
- }
261
- /**
262
- * ExperienceDefault
263
- */
264
- export declare enum ExperienceDefault {
265
- BANNER = 1,
266
- MODAL = 2
267
- }
268
- /**
269
- * ExperienceButtonDestination
270
- */
271
- export declare enum ExperienceButtonDestination {
272
- GOTO_MODAL = 1,
273
- GOTO_PREFERENCE = 2,
274
- REJECT_ALL = 3
275
- }
276
- /**
277
- * ExperiencePrimaryButtonAction
278
- */
279
- export declare enum ExperiencePrimaryButtonAction {
280
- SAVE_CURRENT_STATE = 1,
281
- ACCEPT_ALL = 2
282
- }
283
- /**
284
- * MigrationOption
285
- */
286
- export declare enum MigrationOption {
287
- MIGRATE_DEFAULT = 0,
288
- MIGRATE_NEVER = 1,
289
- MIGRATE_FROM_ALLOW = 2,
290
- MIGRATE_FROM_DENY = 3,
291
- MIGRATE_ALWAYS = 4
292
- }
293
- /**
294
- * CookieDuration
295
- */
296
- export declare enum CookieDuration {
297
- SESSION = 1,
298
- PERSISTENT = 2
299
- }
300
- /**
301
- * CookieProvenance
302
- */
303
- export declare enum CookieProvenance {
304
- FIRST_PARTY = 1,
305
- THIRD_PARTY = 2
306
- }
307
- /**
308
- * CookieCategory
309
- */
310
- export declare enum CookieCategory {
311
- STRICTLY_NECESSARY = 1,
312
- FUNCTIONAL = 2,
313
- PERFORMANCE = 3,
314
- MARKETING = 4
315
- }
316
- /**
317
- * IPLanguage
318
- */
319
- export interface IPLanguage {
320
- code: string;
321
- name: string;
322
- native: string;
323
- }
324
- /**
325
- * IPLocation
326
- */
327
- export interface IPLocation {
328
- geonameId: number;
329
- capital: string;
330
- languages: IPLanguage[];
331
- countryFlag: string;
332
- countryFlagEmoji: string;
333
- countryFlagEmojiUnicode: string;
334
- callingCode: string;
335
- isEU: boolean;
336
- }
337
- /**
338
- * IPInfo
339
- */
340
- export interface IPInfo {
341
- ip: string;
342
- hostname: string;
343
- continentCode: string;
344
- continentName: string;
345
- countryCode: string;
346
- countryName: string;
347
- regionCode: string;
348
- regionName: string;
349
- city: string;
350
- zip: string;
351
- latitude: number;
352
- longitude: number;
353
- location: IPLocation;
354
- }
355
- /**
356
- * GetLocationRequest
357
- */
358
- export interface GetLocationRequest {
359
- IP?: string;
360
- }
361
- /**
362
- * GetLocationResponse
363
- */
364
- export interface GetLocationResponse {
365
- location: IPInfo;
366
- }
367
- /**
368
- * PurposeLegalBasis
369
- */
370
- export interface PurposeLegalBasis {
371
- allowed?: string;
372
- legalBasisCode: string;
373
- }
374
- /**
375
- * PurposeAllowed
376
- */
377
- export interface PurposeAllowed {
378
- allowed: string;
379
- legalBasisCode?: string;
380
- }
381
- /**
382
- * PurposeAllowedLegalBasis
383
- */
384
- export interface PurposeAllowedLegalBasis {
385
- allowed: string;
386
- legalBasisCode: string;
387
- }
388
- /**
389
- * GetConsentRequest
390
- */
391
- export interface GetConsentRequest {
392
- organizationCode: string;
393
- controllerCode?: string;
394
- propertyCode: string;
395
- environmentCode: string;
396
- jurisdictionCode: string;
397
- identities: {
398
- [key: string]: string;
399
- };
400
- purposes: {
401
- [key: string]: PurposeLegalBasis;
402
- };
403
- vendors?: string[];
404
- collectedAt?: number;
405
- }
406
- /**
407
- * GetConsentResponse
408
- */
409
- export interface GetConsentResponse {
410
- organizationCode: string;
411
- controllerCode?: string;
412
- propertyCode: string;
413
- environmentCode: string;
414
- jurisdictionCode: string;
415
- identities: {
416
- [key: string]: string;
417
- };
418
- purposes: {
419
- [key: string]: PurposeAllowed | string;
420
- };
421
- /**
422
- * list of vendor ids for which the user has opted out
423
- */
424
- vendors?: string[];
425
- collectedAt?: number;
426
- }
427
- /**
428
- * SetConsentRequest
429
- */
430
- export interface SetConsentRequest {
431
- organizationCode: string;
432
- controllerCode?: string;
433
- propertyCode: string;
434
- environmentCode: string;
435
- jurisdictionCode: string;
436
- identities: {
437
- [key: string]: string;
438
- };
439
- collectedAt?: number;
440
- migrationOption?: MigrationOption;
441
- purposes: {
442
- [key: string]: PurposeAllowedLegalBasis;
443
- };
444
- vendors?: string[];
445
- }
446
- /**
447
- * DataSubject
448
- */
449
- export interface DataSubject {
450
- email: string;
451
- firstName: string;
452
- lastName: string;
453
- country?: string;
454
- stateRegion?: string;
455
- description?: string;
456
- phone?: string;
457
- postalCode?: string;
458
- addressLine1?: string;
459
- addressLine2?: string;
460
- /**
461
- * typeCode is the identifier representing the data subject type specified by the user
462
- */
463
- typeCode?: string;
464
- /**
465
- * typeRelationshipDetails is additional information provided by the user describing their relation to the business
466
- */
467
- typeRelationshipDetails?: string;
468
- }
469
- /**
470
- * InvokeRightRequest
471
- */
472
- export interface InvokeRightRequest {
473
- organizationCode: string;
474
- controllerCode?: string;
475
- propertyCode: string;
476
- environmentCode: string;
477
- identities: {
478
- [key: string]: string;
479
- };
480
- invokedAt?: number;
481
- jurisdictionCode: string;
482
- rightCode: string;
483
- user: DataSubject;
484
- recaptchaToken?: string;
485
- }
486
- /**
487
- * GetBootstrapConfigurationRequest
488
- */
489
- export interface GetBootstrapConfigurationRequest {
490
- organizationCode: string;
491
- propertyCode: string;
492
- }
493
- /**
494
- * GetFullConfigurationRequest
495
- */
496
- export interface GetFullConfigurationRequest {
497
- organizationCode: string;
498
- propertyCode: string;
499
- environmentCode?: string;
500
- hash?: string;
501
- deploymentID?: string;
502
- jurisdictionCode?: string;
503
- languageCode?: string;
504
- }
505
- /**
506
- * GetPreferenceQRRequest
507
- */
508
- export interface GetPreferenceQRRequest {
509
- organizationCode: string;
510
- propertyCode: string;
511
- environmentCode?: string;
512
- imageSize?: number;
513
- path?: string;
514
- backgroundColor?: string;
515
- foregroundColor?: string;
516
- parameters: {
517
- [key: string]: string;
518
- };
519
- }
520
- /**
521
- * WebReportRequest
522
- */
523
- export interface WebReportRequest {
524
- type: string;
525
- age: number;
526
- url: string;
527
- user_agent: string;
528
- body: {
529
- [key: string]: any;
530
- };
531
- }
532
- /**
533
- * Organization
534
- */
535
- export interface Organization {
536
- code: string;
537
- }
538
- /**
539
- * JurisdictionInfo
540
- */
541
- export interface JurisdictionInfo {
542
- code?: string;
543
- defaultScopeCode?: string;
544
- variable?: string;
545
- scopes?: {
546
- [key: string]: string;
547
- };
548
- }
549
- /**
550
- * Property
551
- */
552
- export interface Property {
553
- code?: string;
554
- name?: string;
555
- platform?: string;
556
- proxy?: string;
557
- }
558
- /**
559
- * Environment
560
- */
561
- export interface Environment {
562
- code: string;
563
- pattern?: string;
564
- hash?: string;
565
- domain?: string;
566
- }
567
- /**
568
- * Deployment
569
- */
570
- export interface Deployment {
571
- code: string;
572
- version: number;
573
- }
574
- /**
575
- * Cookie
576
- */
577
- export interface Cookie {
578
- name: string;
579
- code: string;
580
- host: string;
581
- duration: CookieDuration;
582
- provenance: CookieProvenance;
583
- category: CookieCategory;
584
- description: string;
585
- serviceProvider?: string;
586
- latest?: boolean;
587
- version?: number;
588
- }
589
- /**
590
- * PurposeCategory
591
- */
592
- export type PurposeCategory = {
593
- name: string;
594
- description: string;
595
- retentionPeriod: string;
596
- externalTransfers: string;
597
- };
598
- /**
599
- * Purpose
600
- */
601
- export interface Purpose {
602
- code: string;
603
- name?: string;
604
- description?: string;
605
- legalBasisCode: string;
606
- requiresOptIn?: boolean;
607
- allowsOptOut?: boolean;
608
- requiresDisplay?: boolean;
609
- requiresPrivacyPolicy?: boolean;
610
- cookies?: Cookie[];
611
- categories?: PurposeCategory[];
612
- tcfType?: string;
613
- tcfID?: string;
614
- canonicalPurposeCode?: string;
615
- legalBasisName?: string;
616
- legalBasisDescription?: string;
617
- /**
618
- * the data subject types for which the purpose is relevant. If this list is empty then the purpose applies to all
619
- * data subject types
620
- */
621
- dataSubjectTypeCodes?: string[];
622
- }
623
- /**
624
- * CanonicalPurpose
625
- */
626
- export interface CanonicalPurpose {
627
- code: string;
628
- name: string;
629
- purposeCodes?: string[];
630
- }
631
- /**
632
- * IdentityLocation is the location on the page from which to retrieve identity information
633
- */
634
- export declare enum IdentityType {
635
- IDENTITY_TYPE_UNDEFINED = "",
636
- IDENTITY_TYPE_DATA_LAYER = "dataLayer",
637
- IDENTITY_TYPE_WINDOW = "window",
638
- IDENTITY_TYPE_COOKIE = "cookie",
639
- IDENTITY_TYPE_MANAGED = "managedCookie",
640
- IDENTITY_TYPE_LOCAL_STORAGE = "localStorage",
641
- IDENTITY_TYPE_SESSION_STORAGE = "sessionStorage",
642
- IDENTITY_TYPE_QUERY_STRING = "queryString"
643
- }
644
- /**
645
- * IdentityFormat is the encoding of the string identity value
646
- */
647
- export declare enum IdentityFormat {
648
- IDENTITY_FORMAT_UNDEFINED = "",
649
- IDENTITY_FORMAT_STRING = "string",
650
- IDENTITY_FORMAT_JSON = "json",
651
- IDENTITY_FORMAT_JWT = "jwt",
652
- IDENTITY_FORMAT_QUERY = "query",
653
- IDENTITY_FORMAT_SEMICOLON = "semicolon"
654
- }
655
- /**
656
- * Identity represents all the metadata for an identifier on the page
657
- */
658
- export interface Identity {
659
- /**
660
- * type is the location on the page from which to retrieve identity information
661
- */
662
- type: IdentityType;
663
- /**
664
- * variable is the name to look up the identity value in the specified location
665
- */
666
- variable: string;
667
- /**
668
- * format is the encoding of the value
669
- */
670
- format: IdentityFormat;
671
- /**
672
- * key is the identifier to find the identity within the value if the format is IDENTITY_FORMAT_STRING then key
673
- * will be undefined
674
- */
675
- key?: string;
676
- /**
677
- * priority of the identity for consent conflict resolution
678
- */
679
- priority?: number;
680
- }
681
- /**
682
- * PolicyDocument
683
- */
684
- export interface PolicyDocument {
685
- code: string;
686
- version: number;
687
- url: string;
688
- }
689
- /**
690
- * SwitchTextRenderLogic
691
- */
692
- export declare enum SwitchTextRenderLogic {
693
- /**
694
- * SWITCH_TEXT_RENDER_ALL always renders the switch text regardless of state
695
- */
696
- SWITCH_TEXT_RENDER_ALL = 1,
697
- /**
698
- * SWITCH_TEXT_RENDER_LEGAL_BASIS renders the switch text only if different from the legal basis default
699
- */
700
- SWITCH_TEXT_RENDER_LEGAL_BASIS = 2,
701
- /**
702
- * SWITCH_TEXT_RENDER_CHANGE renders the switch only if the user changes the state of the switch
703
- */
704
- SWITCH_TEXT_RENDER_CHANGE = 3,
705
- /**
706
- * SWITCH_TEXT_RENDER_NEVER never renders the switch text
707
- */
708
- SWITCH_TEXT_RENDER_NEVER = 4
709
- }
710
- /**
711
- * Banner
712
- */
713
- export interface Banner {
714
- title?: string;
715
- footerDescription: string;
716
- buttonText: string;
717
- primaryButtonAction?: ExperiencePrimaryButtonAction;
718
- secondaryButtonText?: string;
719
- secondaryButtonDestination?: ExperienceButtonDestination;
720
- /**
721
- * showCloseIcon determines whether the x out icon appears in the experience. Default do not show
722
- */
723
- showCloseIcon?: boolean;
724
- /**
725
- * additional extensions
726
- */
727
- extensions?: {
728
- [key: string]: string;
729
- };
730
- }
731
- /**
732
- * Modal
733
- */
734
- export interface Modal {
735
- title: string;
736
- bodyTitle?: string;
737
- bodyDescription?: string;
738
- footerDescription?: string;
739
- buttonText: string;
740
- /**
741
- * consentTitle is the heading that goes above the list of purposes this optionally overrides the standard title
742
- */
743
- consentTitle?: string;
744
- /**
745
- * hideConsentTitle determines whether the consent title should be hidden. Default is to show
746
- */
747
- hideConsentTitle?: boolean;
748
- /**
749
- * hideLegalBases determines whether the legal bases should be hidden. Default is to show
750
- */
751
- hideLegalBases?: boolean;
752
- /**
753
- * switchOnText overrides the standard text for a consent switch in the on state
754
- */
755
- switchOnText?: string;
756
- /**
757
- * switchOffText overrides the standard text for a consent switch in the off state
758
- */
759
- switchOffText?: string;
760
- /**
761
- * switchTextRenderLogic determines the logic for showing the switch text
762
- */
763
- switchTextRenderLogic?: SwitchTextRenderLogic;
764
- /**
765
- * showCloseIcon determines whether the x out icon appears in the experience. Default do not show
766
- */
767
- showCloseIcon?: boolean;
768
- /**
769
- * additional extensions
770
- */
771
- extensions?: {
772
- [key: string]: string;
773
- };
774
- }
775
- /**
776
- * JIT
777
- */
778
- export interface JIT {
779
- title?: string;
780
- bodyDescription?: string;
781
- acceptButtonText: string;
782
- declineButtonText: string;
783
- moreInfoText?: string;
784
- moreInfoDestination?: ExperienceButtonDestination;
785
- /**
786
- * showCloseIcon determines whether the x out icon appears in the experience. Default do not show
787
- */
788
- showCloseIcon?: boolean;
789
- /**
790
- * additional extensions
791
- */
792
- extensions?: {
793
- [key: string]: string;
794
- };
795
- }
796
- /**
797
- * RightsTab
798
- */
799
- export interface RightsTab {
800
- tabName: string;
801
- bodyTitle?: string;
802
- bodyDescription?: string;
803
- buttonText: string;
804
- /**
805
- * additional extensions
806
- */
807
- extensions?: {
808
- [key: string]: string;
809
- };
810
- }
811
- /**
812
- * ConsentsTab
813
- */
814
- export interface ConsentsTab {
815
- tabName: string;
816
- bodyTitle?: string;
817
- bodyDescription?: string;
818
- buttonText: string;
819
- /**
820
- * consentTitle is the heading that goes above the list of purposes
821
- * this optionally overrides the standard title
822
- */
823
- consentTitle?: string;
824
- /**
825
- * hideConsentTitle determines whether the consent title should be hidden. Default is to show
826
- */
827
- hideConsentTitle?: boolean;
828
- /**
829
- * hideLegalBases determines whether the legal bases should be hidden. Default is to show
830
- */
831
- hideLegalBases?: boolean;
832
- /**
833
- * switchOnText overrides the standard text for a consent switch in the on state
834
- */
835
- switchOnText?: string;
836
- /**
837
- * switchOffText overrides the standard text for a consent switch in the off state
838
- */
839
- switchOffText?: string;
840
- /**
841
- * switchTextRenderLogic determines the logic for showing the switch text
842
- */
843
- switchTextRenderLogic?: SwitchTextRenderLogic;
844
- /**
845
- * additional extensions
846
- */
847
- extensions?: {
848
- [key: string]: string;
849
- };
850
- }
851
- /**
852
- * OverviewTab
853
- */
854
- export interface OverviewTab {
855
- tabName: string;
856
- bodyTitle?: string;
857
- bodyDescription: string;
858
- /**
859
- * additional extensions
860
- * */
861
- extensions?: {
862
- [key: string]: string;
863
- };
864
- }
865
- /**
866
- * ConsentExperience
867
- */
868
- export interface ConsentExperience {
869
- code: string;
870
- version: number;
871
- banner: Banner;
872
- modal: Modal;
873
- jit?: JIT;
874
- experienceDefault: ExperienceDefault;
875
- /**
876
- * additional extensions
877
- */
878
- extensions?: {
879
- [key: string]: string;
880
- };
881
- }
882
- /**
883
- * PreferenceExperience
884
- */
885
- export interface PreferenceExperience {
886
- code: string;
887
- version: number;
888
- title: string;
889
- rights?: RightsTab;
890
- consents?: ConsentsTab;
891
- overview: OverviewTab;
892
- /**
893
- * additional extensions
894
- */
895
- extensions?: {
896
- [key: string]: string;
897
- };
898
- }
899
- /**
900
- * Right
901
- */
902
- export interface Right {
903
- code: string;
904
- name: string;
905
- description: string;
906
- /**
907
- * the data subject types for which the right is relevant. If this list is empty then the right applies to all
908
- * data subject types
909
- */
910
- dataSubjectTypeCodes?: string[];
911
- }
912
- /**
913
- * Experience
914
- */
915
- export interface Experience {
916
- consent?: ConsentExperience;
917
- preference?: PreferenceExperience;
918
- }
919
- /**
920
- * BannerPosition
921
- */
922
- export declare enum BannerPosition {
923
- BOTTOM = 1,
924
- TOP = 2,
925
- BOTTOM_LEFT = 3,
926
- BOTTOM_RIGHT = 4
927
- }
928
- /**
929
- * ModalPosition
930
- */
931
- export declare enum ModalPosition {
932
- CENTER = 1,
933
- LEFT_FULL_HEIGHT = 2,
934
- RIGHT_FULL_HEIGHT = 3
935
- }
936
- /**
937
- * Theme
938
- */
939
- export interface Theme {
940
- code?: string;
941
- name?: string;
942
- description?: string;
943
- watermark?: boolean;
944
- buttonBorderRadius: number;
945
- font?: string;
946
- bannerBackgroundColor: string;
947
- bannerContentColor?: string;
948
- bannerButtonColor: string;
949
- bannerSecondaryButtonColor?: string;
950
- bannerPosition?: BannerPosition;
951
- modalHeaderBackgroundColor: string;
952
- modalHeaderContentColor?: string;
953
- modalContentColor: string;
954
- modalButtonColor: string;
955
- modalPosition?: ModalPosition;
956
- /**
957
- * modalSwitchOnColor is the color of the consent switch in the on state for the modal this overrides standard theme
958
- * colors
959
- */
960
- modalSwitchOnColor?: string;
961
- /**
962
- * modalSwitchOffColor is the color of the consent switch in the off state for the modal this overrides standard
963
- * theme colors
964
- */
965
- modalSwitchOffColor?: string;
966
- formHeaderBackgroundColor: string;
967
- formHeaderContentColor?: string;
968
- formContentColor: string;
969
- formButtonColor: string;
970
- /**
971
- * formSwitchOnColor is the color of the consent switch in the on state for the form this overrides standard theme
972
- * colors
973
- */
974
- formSwitchOnColor?: string;
975
- /**
976
- * formSwitchOffColor is the color of the consent switch in the off state for the form this overrides standard theme
977
- * colors
978
- */
979
- formSwitchOffColor?: string;
980
- /**
981
- * qrBackgroundColor is the override for the QR code background color
982
- */
983
- qrBackgroundColor?: string;
984
- /**
985
- * qrForegroundColor is the override for the QR code foreground color
986
- */
987
- qrForegroundColor?: string;
988
- }
989
- /**
990
- * Vendor purpose
991
- */
992
- export interface VendorPurpose {
993
- name: string;
994
- legalBasis?: string;
995
- }
996
- /**
997
- * Vendor definition
998
- */
999
- export interface Vendor {
1000
- id: string;
1001
- name: string;
1002
- purposes?: VendorPurpose[];
1003
- specialPurposes?: VendorPurpose[];
1004
- features?: VendorPurpose[];
1005
- specialFeatures?: VendorPurpose[];
1006
- policyUrl?: string;
1007
- cookieMaxAgeSeconds?: number;
1008
- usesCookies?: boolean;
1009
- usesNonCookieAccess?: boolean;
1010
- }
1011
- /**
1012
- * DataSubjectType represents user defined data subject types with code as the unique identifier
1013
- */
1014
- export interface DataSubjectType {
1015
- code: string;
1016
- name: string;
1017
- /**
1018
- * requiresUserInput is true if additional information must be requested to describe the data subject relation
1019
- */
1020
- requiresUserInput: boolean;
1021
- }
1022
- /**
1023
- * Stack represents a grouping of purposes to be displayed in an experience
1024
- */
1025
- export interface Stack {
1026
- /**
1027
- * name of the stack to be displayed
1028
- */
1029
- name: string;
1030
- /**
1031
- * list of purpose codes that are members of the stack
1032
- */
1033
- purposeCodes: string[];
1034
- }
1035
- /**
1036
- * Configuration
1037
- */
1038
- export interface Configuration {
1039
- /**
1040
- * Organization this configuration belongs to
1041
- */
1042
- organization: Organization;
1043
- /**
1044
- * Property this configuration belongs to
1045
- */
1046
- property?: Property;
1047
- /**
1048
- * Language for all text
1049
- */
1050
- language?: string;
1051
- /**
1052
- * Available environments. Only available in the "boot" configuration.
1053
- */
1054
- environments?: Environment[];
1055
- /**
1056
- * Environment for this configuration. Only available in the "full" configuration.
1057
- */
1058
- environment?: Environment;
1059
- /**
1060
- * Applicable jurisdiction.
1061
- */
1062
- jurisdiction?: JurisdictionInfo;
1063
- /**
1064
- * Identity spaces defined for this property
1065
- */
1066
- identities?: {
1067
- [key: string]: Identity;
1068
- };
1069
- /**
1070
- * Deployment information. Only available in the "full" configuration.
1071
- */
1072
- deployment?: Deployment;
1073
- /**
1074
- * Regulations enabled for this jurisdiction.
1075
- */
1076
- regulations?: string[];
1077
- /**
1078
- * Rights available in this jurisdiction.
1079
- */
1080
- rights?: Right[];
1081
- /**
1082
- * Purposes in this jurisdiction.
1083
- */
1084
- purposes?: Purpose[];
1085
- /**
1086
- * Mapping of purposes to canonical purposes.
1087
- */
1088
- canonicalPurposes?: {
1089
- [key: string]: CanonicalPurpose;
1090
- };
1091
- /**
1092
- * Privacy policy document
1093
- */
1094
- privacyPolicy?: PolicyDocument;
1095
- /**
1096
- * Terms of Service (ToS) policy document
1097
- */
1098
- termsOfService?: PolicyDocument;
1099
- /**
1100
- * Theme
1101
- */
1102
- theme?: Theme;
1103
- /**
1104
- * Experience definitions
1105
- */
1106
- experiences?: Experience;
1107
- /**
1108
- * Vendors (TCF)
1109
- */
1110
- vendors?: Vendor[];
1111
- /**
1112
- * Data subject types relevant for this configuration
1113
- */
1114
- dataSubjectTypes?: DataSubjectType[];
1115
- /**
1116
- * Stacks to be displayed in an experience
1117
- */
1118
- stacks?: Stack[];
1119
- /**
1120
- * Services
1121
- */
1122
- services?: {
1123
- [key: string]: string;
1124
- };
1125
- /**
1126
- * Flexible options
1127
- */
1128
- options?: {
1129
- [key: string]: string;
1130
- };
1131
- /**
1132
- * Scripts to load
1133
- */
1134
- scripts?: string[];
1135
- /**
1136
- * Plugins configured for the configuration
1137
- */
1138
- plugins?: {
1139
- [key: string]: any;
1140
- };
1141
- /**
1142
- * Recaptcha config
1143
- */
1144
- recaptcha?: Recaptcha;
1145
- }
1146
- /**
1147
- * Recaptcha interface defines the Recaptcha config
1148
- */
1149
- export interface Recaptcha {
1150
- /**
1151
- * siteKey: Recaptcha site/public key used to exchange for a reCaptcha token
1152
- */
1153
- siteKey?: string;
1154
- }
1155
- /**
1156
- * Pusher interface defines a type that has a push function like an array
1157
- */
1158
- export interface Pusher {
1159
- /**
1160
- * Pushes the given arguments.
1161
- *
1162
- * @param args The arguments to push.
1163
- */
1164
- push(args: any[]): void;
1165
- }
1166
- /**
1167
- * Loaded interface defines a type that has a loaded boolean property
1168
- */
1169
- export interface Loaded {
1170
- /**
1171
- * Loaded is set to true if the object has fully loaded
1172
- */
1173
- loaded: boolean;
1174
- }
1175
- declare global {
1176
- interface Window {
1177
- /**
1178
- * Semaphore is the main entrypoint.
1179
- */
1180
- semaphore: Pusher & Loaded;
1181
- }
1182
- }
1183
- export {};