@ketch-sdk/ketch-types 0.0.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.
@@ -0,0 +1,771 @@
1
+ /**
2
+ * ExperienceDefault
3
+ */
4
+ export declare enum ExperienceDefault {
5
+ BANNER = 1,
6
+ MODAL = 2
7
+ }
8
+ /**
9
+ * ExperienceButtonDestination
10
+ */
11
+ export declare enum ExperienceButtonDestination {
12
+ GOTO_MODAL = 1,
13
+ GOTO_PREFERENCE = 2,
14
+ REJECT_ALL = 3
15
+ }
16
+ /**
17
+ * ExperiencePrimaryButtonAction
18
+ */
19
+ export declare enum ExperiencePrimaryButtonAction {
20
+ SAVE_CURRENT_STATE = 1,
21
+ ACCEPT_ALL = 2
22
+ }
23
+ /**
24
+ * MigrationOption
25
+ */
26
+ export declare enum MigrationOption {
27
+ MIGRATE_DEFAULT = 0,
28
+ MIGRATE_NEVER = 1,
29
+ MIGRATE_FROM_ALLOW = 2,
30
+ MIGRATE_FROM_DENY = 3,
31
+ MIGRATE_ALWAYS = 4
32
+ }
33
+ /**
34
+ * CookieDuration
35
+ */
36
+ export declare enum CookieDuration {
37
+ SESSION = 1,
38
+ PERSISTENT = 2
39
+ }
40
+ /**
41
+ * CookieProvenance
42
+ */
43
+ export declare enum CookieProvenance {
44
+ FIRST_PARTY = 1,
45
+ THIRD_PARTY = 2
46
+ }
47
+ /**
48
+ * CookieCategory
49
+ */
50
+ export declare enum CookieCategory {
51
+ STRICTLY_NECESSARY = 1,
52
+ FUNCTIONAL = 2,
53
+ PERFORMANCE = 3,
54
+ MARKETING = 4
55
+ }
56
+ /**
57
+ * IPLanguage
58
+ */
59
+ export interface IPLanguage {
60
+ code: string;
61
+ name: string;
62
+ native: string;
63
+ }
64
+ /**
65
+ * IPLocation
66
+ */
67
+ export interface IPLocation {
68
+ geonameId: number;
69
+ capital: string;
70
+ languages: IPLanguage[];
71
+ countryFlag: string;
72
+ countryFlagEmoji: string;
73
+ countryFlagEmojiUnicode: string;
74
+ callingCode: string;
75
+ isEU: boolean;
76
+ }
77
+ /**
78
+ * IPInfo
79
+ */
80
+ export interface IPInfo {
81
+ ip: string;
82
+ hostname: string;
83
+ continentCode: string;
84
+ continentName: string;
85
+ countryCode: string;
86
+ countryName: string;
87
+ regionCode: string;
88
+ regionName: string;
89
+ city: string;
90
+ zip: string;
91
+ latitude: number;
92
+ longitude: number;
93
+ location: IPLocation;
94
+ }
95
+ /**
96
+ * GetLocationRequest
97
+ */
98
+ export interface GetLocationRequest {
99
+ IP?: string;
100
+ }
101
+ /**
102
+ * GetLocationResponse
103
+ */
104
+ export interface GetLocationResponse {
105
+ location: IPInfo;
106
+ }
107
+ /**
108
+ * PurposeLegalBasis
109
+ */
110
+ export interface PurposeLegalBasis {
111
+ legalBasisCode: string;
112
+ }
113
+ /**
114
+ * PurposeAllowed
115
+ */
116
+ export interface PurposeAllowed {
117
+ allowed: string;
118
+ }
119
+ /**
120
+ * PurposeAllowedLegalBasis
121
+ */
122
+ export interface PurposeAllowedLegalBasis {
123
+ allowed: string;
124
+ legalBasisCode: string;
125
+ }
126
+ /**
127
+ * GetConsentRequest
128
+ */
129
+ export interface GetConsentRequest {
130
+ organizationCode: string;
131
+ controllerCode?: string;
132
+ propertyCode: string;
133
+ environmentCode: string;
134
+ jurisdictionCode: string;
135
+ identities: {
136
+ [key: string]: string;
137
+ };
138
+ purposes: {
139
+ [key: string]: PurposeLegalBasis;
140
+ };
141
+ }
142
+ /**
143
+ * GetConsentResponse
144
+ */
145
+ export interface GetConsentResponse {
146
+ purposes: {
147
+ [key: string]: PurposeAllowed | string;
148
+ };
149
+ /**
150
+ * list of vendor ids for which the user has opted out
151
+ */
152
+ vendors?: string[];
153
+ }
154
+ /**
155
+ * SetConsentRequest
156
+ */
157
+ export interface SetConsentRequest {
158
+ organizationCode: string;
159
+ controllerCode?: string;
160
+ propertyCode: string;
161
+ environmentCode: string;
162
+ identities: {
163
+ [key: string]: string;
164
+ };
165
+ collectedAt?: number;
166
+ jurisdictionCode: string;
167
+ migrationOption: MigrationOption;
168
+ purposes: {
169
+ [key: string]: PurposeAllowedLegalBasis;
170
+ };
171
+ vendors?: string[];
172
+ /**
173
+ * identityPriority is a map from the identity space code to the priority that should be used to resolve consent
174
+ * conflict
175
+ * lower values take top priority
176
+ * if an identity space codes is not in the identityPriority map then it is the last priority
177
+ */
178
+ identityPriority?: {
179
+ [key: string]: number;
180
+ };
181
+ }
182
+ /**
183
+ * User
184
+ */
185
+ export interface User {
186
+ email: string;
187
+ first: string;
188
+ last: string;
189
+ country?: string;
190
+ stateRegion?: string;
191
+ description?: string;
192
+ phone?: string;
193
+ postalCode?: string;
194
+ addressLine1?: string;
195
+ addressLine2?: string;
196
+ /**
197
+ * typeCode is the identifier representing the data subject type specified by the user
198
+ */
199
+ typeCode?: string;
200
+ /**
201
+ * typeRelationshipDetails is additional information provided by the user describing their relation to the business
202
+ */
203
+ typeRelationshipDetails?: string;
204
+ }
205
+ /**
206
+ * InvokeRightRequest
207
+ */
208
+ export interface InvokeRightRequest {
209
+ organizationCode: string;
210
+ controllerCode?: string;
211
+ propertyCode: string;
212
+ environmentCode: string;
213
+ identities: {
214
+ [key: string]: string;
215
+ };
216
+ invokedAt?: number;
217
+ jurisdictionCode: string;
218
+ rightCode: string;
219
+ user: User;
220
+ }
221
+ /**
222
+ * GetBootstrapConfigurationRequest
223
+ */
224
+ export interface GetBootstrapConfigurationRequest {
225
+ organizationCode: string;
226
+ propertyCode: string;
227
+ }
228
+ /**
229
+ * GetFullConfigurationRequest
230
+ */
231
+ export interface GetFullConfigurationRequest {
232
+ organizationCode: string;
233
+ propertyCode: string;
234
+ environmentCode: string;
235
+ hash: string;
236
+ deploymentID?: string;
237
+ jurisdictionCode: string;
238
+ languageCode: string;
239
+ }
240
+ /**
241
+ * Organization
242
+ */
243
+ export interface Organization {
244
+ code: string;
245
+ }
246
+ /**
247
+ * JurisdictionInfo
248
+ */
249
+ export interface JurisdictionInfo {
250
+ code?: string;
251
+ defaultScopeCode?: string;
252
+ variable?: string;
253
+ scopes?: {
254
+ [key: string]: string;
255
+ };
256
+ }
257
+ /**
258
+ * Property
259
+ */
260
+ export interface Property {
261
+ code?: string;
262
+ name?: string;
263
+ platform?: string;
264
+ }
265
+ /**
266
+ * Environment
267
+ */
268
+ export interface Environment {
269
+ code: string;
270
+ pattern?: string;
271
+ hash?: string;
272
+ }
273
+ /**
274
+ * Deployment
275
+ */
276
+ export interface Deployment {
277
+ code: string;
278
+ version: number;
279
+ }
280
+ /**
281
+ * Cookie
282
+ */
283
+ export interface Cookie {
284
+ name: string;
285
+ code: string;
286
+ host: string;
287
+ duration: CookieDuration;
288
+ provenance: CookieProvenance;
289
+ category: CookieCategory;
290
+ description: string;
291
+ serviceProvider?: string;
292
+ latest?: boolean;
293
+ version?: number;
294
+ }
295
+ /**
296
+ * PurposeCategory
297
+ */
298
+ export declare type PurposeCategory = {
299
+ name: string;
300
+ description: string;
301
+ retentionPeriod: string;
302
+ externalTransfers: string;
303
+ };
304
+ /**
305
+ * Purpose
306
+ */
307
+ export interface Purpose {
308
+ code: string;
309
+ name?: string;
310
+ description?: string;
311
+ legalBasisCode: string;
312
+ requiresOptIn?: boolean;
313
+ allowsOptOut?: boolean;
314
+ requiresDisplay?: boolean;
315
+ requiresPrivacyPolicy?: boolean;
316
+ cookies?: Cookie[];
317
+ categories?: PurposeCategory[];
318
+ tcfType?: string;
319
+ tcfID?: string;
320
+ canonicalPurposeCode?: string;
321
+ legalBasisName?: string;
322
+ legalBasisDescription?: string;
323
+ /**
324
+ * the data subject types for which the purpose is relevant. If this list is empty then the purpose applies to all
325
+ * data subject types
326
+ */
327
+ dataSubjectTypeCodes?: string[];
328
+ }
329
+ /**
330
+ * CanonicalPurpose
331
+ */
332
+ export interface CanonicalPurpose {
333
+ code: string;
334
+ name: string;
335
+ purposeCodes?: string[];
336
+ }
337
+ /**
338
+ * IdentityLocation is the location on the page from which to retrieve identity information
339
+ */
340
+ export declare enum IdentityType {
341
+ IDENTITY_TYPE_UNDEFINED = "",
342
+ IDENTITY_TYPE_DATA_LAYER = "dataLayer",
343
+ IDENTITY_TYPE_WINDOW = "window",
344
+ IDENTITY_TYPE_COOKIE = "cookie",
345
+ IDENTITY_TYPE_MANAGED = "managedCookie",
346
+ IDENTITY_TYPE_LOCAL_STORAGE = "localStorage",
347
+ IDENTITY_TYPE_SESSION_STORAGE = "sessionStorage",
348
+ IDENTITY_TYPE_QUERY_STRING = "queryString"
349
+ }
350
+ /**
351
+ * IdentityFormat is the encoding of the string identity value
352
+ */
353
+ export declare enum IdentityFormat {
354
+ IDENTITY_FORMAT_UNDEFINED = "",
355
+ IDENTITY_FORMAT_STRING = "string",
356
+ IDENTITY_FORMAT_JSON = "json",
357
+ IDENTITY_FORMAT_JWT = "jwt",
358
+ IDENTITY_FORMAT_QUERY = "query",
359
+ IDENTITY_FORMAT_SEMICOLON = "semicolon"
360
+ }
361
+ /**
362
+ * Identity represents all the metadata for an identifier on the page
363
+ */
364
+ export interface Identity {
365
+ /**
366
+ * type is the location on the page from which to retrieve identity information
367
+ */
368
+ type: IdentityType;
369
+ /**
370
+ * variable is the name to look up the identity value in the specified location
371
+ */
372
+ variable: string;
373
+ /**
374
+ * format is the encoding of the value
375
+ */
376
+ format: IdentityFormat;
377
+ /**
378
+ * key is the identifier to find the identity within the value if the format is IDENTITY_FORMAT_STRING then key
379
+ * will be undefined
380
+ */
381
+ key?: string;
382
+ /**
383
+ * priority of the identity for consent conflict resolution
384
+ */
385
+ priority?: number;
386
+ }
387
+ /**
388
+ * PolicyDocument
389
+ */
390
+ export interface PolicyDocument {
391
+ code: string;
392
+ version: number;
393
+ url: string;
394
+ }
395
+ /**
396
+ * SwitchTextRenderLogic
397
+ */
398
+ export declare enum SwitchTextRenderLogic {
399
+ /**
400
+ * SWITCH_TEXT_RENDER_ALL always renders the switch text regardless of state
401
+ */
402
+ SWITCH_TEXT_RENDER_ALL = 1,
403
+ /**
404
+ * SWITCH_TEXT_RENDER_LEGAL_BASIS renders the switch text only if different from the legal basis default
405
+ */
406
+ SWITCH_TEXT_RENDER_LEGAL_BASIS = 2,
407
+ /**
408
+ * SWITCH_TEXT_RENDER_CHANGE renders the switch only if the user changes the state of the switch
409
+ */
410
+ SWITCH_TEXT_RENDER_CHANGE = 3,
411
+ /**
412
+ * SWITCH_TEXT_RENDER_NEVER never renders the switch text
413
+ */
414
+ SWITCH_TEXT_RENDER_NEVER = 4
415
+ }
416
+ /**
417
+ * Banner
418
+ */
419
+ export interface Banner {
420
+ title?: string;
421
+ footerDescription: string;
422
+ buttonText: string;
423
+ primaryButtonAction?: ExperiencePrimaryButtonAction;
424
+ secondaryButtonText?: string;
425
+ secondaryButtonDestination?: ExperienceButtonDestination;
426
+ /**
427
+ * showCloseIcon determines whether the x out icon appears in the experience. Default do not show
428
+ */
429
+ showCloseIcon?: boolean;
430
+ /**
431
+ * additional extensions
432
+ */
433
+ extensions?: {
434
+ [key: string]: string;
435
+ };
436
+ }
437
+ /**
438
+ * Modal
439
+ */
440
+ export interface Modal {
441
+ title: string;
442
+ bodyTitle?: string;
443
+ bodyDescription?: string;
444
+ buttonText: string;
445
+ /**
446
+ * consentTitle is the heading that goes above the list of purposes this optionally overrides the standard title
447
+ */
448
+ consentTitle?: string;
449
+ /**
450
+ * hideConsentTitle determines whether the consent title should be hidden. Default is to show
451
+ */
452
+ hideConsentTitle?: boolean;
453
+ /**
454
+ * hideLegalBases determines whether the legal bases should be hidden. Default is to show
455
+ */
456
+ hideLegalBases?: boolean;
457
+ /**
458
+ * switchOnText overrides the standard text for a consent switch in the on state
459
+ */
460
+ switchOnText?: string;
461
+ /**
462
+ * switchOffText overrides the standard text for a consent switch in the off state
463
+ */
464
+ switchOffText?: string;
465
+ /**
466
+ * switchTextRenderLogic determines the logic for showing the switch text
467
+ */
468
+ switchTextRenderLogic?: SwitchTextRenderLogic;
469
+ /**
470
+ * showCloseIcon determines whether the x out icon appears in the experience. Default do not show
471
+ */
472
+ showCloseIcon?: boolean;
473
+ /**
474
+ * additional extensions
475
+ */
476
+ extensions?: {
477
+ [key: string]: string;
478
+ };
479
+ }
480
+ /**
481
+ * JIT
482
+ */
483
+ export interface JIT {
484
+ title?: string;
485
+ bodyDescription?: string;
486
+ acceptButtonText: string;
487
+ declineButtonText: string;
488
+ moreInfoText?: string;
489
+ moreInfoDestination?: ExperienceButtonDestination;
490
+ /**
491
+ * showCloseIcon determines whether the x out icon appears in the experience. Default do not show
492
+ */
493
+ showCloseIcon?: boolean;
494
+ /**
495
+ * additional extensions
496
+ */
497
+ extensions?: {
498
+ [key: string]: string;
499
+ };
500
+ }
501
+ /**
502
+ * RightsTab
503
+ */
504
+ export interface RightsTab {
505
+ tabName: string;
506
+ bodyTitle?: string;
507
+ bodyDescription?: string;
508
+ buttonText: string;
509
+ /**
510
+ * additional extensions
511
+ */
512
+ extensions?: {
513
+ [key: string]: string;
514
+ };
515
+ }
516
+ /**
517
+ * ConsentsTab
518
+ */
519
+ export interface ConsentsTab {
520
+ tabName: string;
521
+ bodyTitle?: string;
522
+ bodyDescription?: string;
523
+ buttonText: string;
524
+ /**
525
+ * consentTitle is the heading that goes above the list of purposes
526
+ * this optionally overrides the standard title
527
+ */
528
+ consentTitle?: string;
529
+ /**
530
+ * hideConsentTitle determines whether the consent title should be hidden. Default is to show
531
+ */
532
+ hideConsentTitle?: boolean;
533
+ /**
534
+ * hideLegalBases determines whether the legal bases should be hidden. Default is to show
535
+ */
536
+ hideLegalBases?: boolean;
537
+ /**
538
+ * switchOnText overrides the standard text for a consent switch in the on state
539
+ */
540
+ switchOnText?: string;
541
+ /**
542
+ * switchOffText overrides the standard text for a consent switch in the off state
543
+ */
544
+ switchOffText?: string;
545
+ /**
546
+ * switchTextRenderLogic determines the logic for showing the switch text
547
+ */
548
+ switchTextRenderLogic?: SwitchTextRenderLogic;
549
+ /**
550
+ * additional extensions
551
+ */
552
+ extensions?: {
553
+ [key: string]: string;
554
+ };
555
+ }
556
+ /**
557
+ * OverviewTab
558
+ */
559
+ export interface OverviewTab {
560
+ tabName: string;
561
+ bodyTitle?: string;
562
+ bodyDescription: string;
563
+ /**
564
+ * additional extensions
565
+ * */
566
+ extensions?: {
567
+ [key: string]: string;
568
+ };
569
+ }
570
+ /**
571
+ * ConsentExperience
572
+ */
573
+ export interface ConsentExperience {
574
+ code: string;
575
+ version: number;
576
+ banner: Banner;
577
+ modal: Modal;
578
+ jit?: JIT;
579
+ experienceDefault: ExperienceDefault;
580
+ /**
581
+ * additional extensions
582
+ */
583
+ extensions?: {
584
+ [key: string]: string;
585
+ };
586
+ }
587
+ /**
588
+ * PreferenceExperience
589
+ */
590
+ export interface PreferenceExperience {
591
+ code: string;
592
+ version: number;
593
+ title: string;
594
+ rights?: RightsTab;
595
+ consents?: ConsentsTab;
596
+ overview: OverviewTab;
597
+ /**
598
+ * additional extensions
599
+ */
600
+ extensions?: {
601
+ [key: string]: string;
602
+ };
603
+ }
604
+ /**
605
+ * Right
606
+ */
607
+ export interface Right {
608
+ code: string;
609
+ name: string;
610
+ description: string;
611
+ /**
612
+ * the data subject types for which the right is relevant. If this list is empty then the right applies to all
613
+ * data subject types
614
+ */
615
+ dataSubjectTypeCodes?: string[];
616
+ }
617
+ /**
618
+ * Experience
619
+ */
620
+ export interface Experience {
621
+ consent?: ConsentExperience;
622
+ preference?: PreferenceExperience;
623
+ }
624
+ /**
625
+ * BannerPosition
626
+ */
627
+ export declare enum BannerPosition {
628
+ BOTTOM = 1,
629
+ TOP = 2,
630
+ BOTTOM_LEFT = 3,
631
+ BOTTOM_RIGHT = 4
632
+ }
633
+ /**
634
+ * ModalPosition
635
+ */
636
+ export declare enum ModalPosition {
637
+ CENTER = 1,
638
+ LEFT_FULL_HEIGHT = 2,
639
+ RIGHT_FULL_HEIGHT = 3
640
+ }
641
+ /**
642
+ * Theme
643
+ */
644
+ export interface Theme {
645
+ watermark?: boolean;
646
+ buttonBorderRadius: number;
647
+ bannerBackgroundColor: string;
648
+ bannerContentColor?: string;
649
+ bannerButtonColor: string;
650
+ bannerSecondaryButtonColor?: string;
651
+ bannerPosition?: BannerPosition;
652
+ modalHeaderBackgroundColor: string;
653
+ modalHeaderContentColor?: string;
654
+ modalContentColor: string;
655
+ modalButtonColor: string;
656
+ modalPosition?: ModalPosition;
657
+ /**
658
+ * modalSwitchOnColor is the color of the consent switch in the on state for the modal this overrides standard theme
659
+ * colors
660
+ */
661
+ modalSwitchOnColor?: string;
662
+ /**
663
+ * modalSwitchOffColor is the color of the consent switch in the off state for the modal this overrides standard
664
+ * theme colors
665
+ */
666
+ modalSwitchOffColor?: string;
667
+ formHeaderBackgroundColor: string;
668
+ formHeaderContentColor?: string;
669
+ formContentColor: string;
670
+ formButtonColor: string;
671
+ /**
672
+ * formSwitchOnColor is the color of the consent switch in the on state for the form this overrides standard theme
673
+ * colors
674
+ */
675
+ formSwitchOnColor?: string;
676
+ /**
677
+ * formSwitchOffColor is the color of the consent switch in the off state for the form this overrides standard theme
678
+ * colors
679
+ */
680
+ formSwitchOffColor?: string;
681
+ /**
682
+ * qrBackgroundColor is the override for the QR code background color
683
+ */
684
+ qrBackgroundColor?: string;
685
+ /**
686
+ * qrForegroundColor is the override for the QR code foreground color
687
+ */
688
+ qrForegroundColor?: string;
689
+ }
690
+ /**
691
+ * Vendor purpose
692
+ */
693
+ export interface VendorPurpose {
694
+ name: string;
695
+ legalBasis?: string;
696
+ }
697
+ /**
698
+ * Vendor definition
699
+ */
700
+ export interface Vendor {
701
+ id: string;
702
+ name: string;
703
+ purposes?: VendorPurpose[];
704
+ specialPurposes?: VendorPurpose[];
705
+ features?: VendorPurpose[];
706
+ specialFeatures?: VendorPurpose[];
707
+ policyUrl?: string;
708
+ cookieMaxAgeSeconds?: number;
709
+ usesCookies?: boolean;
710
+ UsesNonCookieAccess?: boolean;
711
+ usesNonCookieAccess?: boolean;
712
+ }
713
+ /**
714
+ * DataSubjectType represents user defined data subject types with code as the unique identifier
715
+ */
716
+ export interface DataSubjectType {
717
+ code: string;
718
+ name: string;
719
+ /**
720
+ * requiresUserInput is true if additional information must be requested to describe the data subject relation
721
+ */
722
+ requiresUserInput: boolean;
723
+ }
724
+ /**
725
+ * Stack represents a grouping of purposes to be displayed in an experience
726
+ */
727
+ export interface Stack {
728
+ /**
729
+ * name of the stack to be displayed
730
+ */
731
+ name: string;
732
+ /**
733
+ * list of purpose codes that are members of the stack
734
+ */
735
+ purposeCodes: string[];
736
+ }
737
+ /**
738
+ * Configuration
739
+ */
740
+ export interface Configuration {
741
+ language?: string;
742
+ organization: Organization;
743
+ property?: Property;
744
+ environments?: Environment[];
745
+ environment?: Environment;
746
+ jurisdiction?: JurisdictionInfo;
747
+ identities?: {
748
+ [key: string]: Identity;
749
+ };
750
+ deployment?: Deployment;
751
+ regulations?: string[];
752
+ rights?: Right[];
753
+ purposes?: Purpose[];
754
+ canonicalPurposes?: {
755
+ [key: string]: CanonicalPurpose;
756
+ };
757
+ experiences?: Experience;
758
+ services?: {
759
+ [key: string]: string;
760
+ };
761
+ options?: {
762
+ [key: string]: string;
763
+ };
764
+ privacyPolicy?: PolicyDocument;
765
+ termsOfService?: PolicyDocument;
766
+ theme?: Theme;
767
+ scripts?: string[];
768
+ vendors?: Vendor[];
769
+ dataSubjectTypes?: DataSubjectType[];
770
+ stacks?: Stack[];
771
+ }