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