@thg-agentic/hyper-personalisation-web 3.19.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/events.d.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  // Generated from spec/registry.json by scripts/generate-sdk-models.mjs.
2
2
  // DO NOT EDIT. Change the schema and regenerate — the schema is the contract,
3
3
  // and a hand-edit here is an SDK that disagrees with the ingest.
4
- // Spec version: 1.12
4
+ // Spec version: 1.15
5
5
 
6
- /** context.source.environment. Lets non-production traffic be filtered out of the warehouse without a separate writeKey. */
6
+ /** context.source.environment. Environment the producer runs in. */
7
7
  export type CdpSourceEnvironment = 'production' | 'staging' | 'development';
8
8
  export declare const CDP_SOURCE_ENVIRONMENT_VALUES: readonly CdpSourceEnvironment[];
9
9
 
10
- /** context.identity_trust. Whether anonymousId on THIS event identifies a single real visitor. */
10
+ /** context.identity_trust. Whether `anonymousId` on this event identifies a single real visitor. */
11
11
  export type CdpIdentityTrust = 'device' | 'shared_render' | 'none';
12
12
  export declare const CDP_IDENTITY_TRUST_VALUES: readonly CdpIdentityTrust[];
13
13
 
14
- /** context.page.type. Normalised page taxonomy. */
14
+ /** context.page.type. The page's type, from a closed taxonomy every consumer groups by. */
15
15
  export type CdpPageType = 'home' | 'list' | 'product' | 'search' | 'basket' | 'checkout' | 'order_confirmation' | 'login' | 'register' | 'account' | 'info' | 'blog' | 'other';
16
16
  export declare const CDP_PAGE_TYPE_VALUES: readonly CdpPageType[];
17
17
 
18
- /** context.device.type. The kind of thing this is. */
18
+ /** context.device.type. The kind of device, derived by the ingest from the user agent. */
19
19
  export type CdpDeviceType = 'desktop' | 'mobile' | 'tablet' | 'bot' | 'app';
20
20
  export declare const CDP_DEVICE_TYPE_VALUES: readonly CdpDeviceType[];
21
21
 
@@ -23,11 +23,11 @@ export declare const CDP_DEVICE_TYPE_VALUES: readonly CdpDeviceType[];
23
23
  export type CdpDeviceNetwork = 'wifi' | 'cellular' | 'wired' | 'offline' | 'other';
24
24
  export declare const CDP_DEVICE_NETWORK_VALUES: readonly CdpDeviceNetwork[];
25
25
 
26
- /** context.consent.basis. Who decided whether this event may be collected (spec 1.5). */
26
+ /** context.consent.basis. Who decided whether this event may be collected. */
27
27
  export type CdpConsentBasis = 'visitor' | 'host';
28
28
  export declare const CDP_CONSENT_BASIS_VALUES: readonly CdpConsentBasis[];
29
29
 
30
- /** context.decisions[].kind. The KIND of decision this was. */
30
+ /** context.decisions[].kind. The kind of decision, as `Decision Made.kind` (recommendation, banner, offer, layout, price, …), copied so a reward can be rolled up by kind without joining the decision log. */
31
31
  export type CdpDecisionKind = 'recommendation' | 'search_rank' | 'banner' | 'offer' | 'layout' | 'copy' | 'price' | 'other';
32
32
  export declare const CDP_DECISION_KIND_VALUES: readonly CdpDecisionKind[];
33
33
 
@@ -58,7 +58,7 @@ export interface CdpProduct {
58
58
  subscription?: Record<string, unknown> | null;
59
59
  }
60
60
 
61
- /** SERVER-SIDE ONLY. */
61
+ /** A personalisation decision was taken: the decision service chose `arm` for `slot` from `candidates`, with probability `propensity`, under policy `policy_id` at `policy_version`, given `context_features`. */
62
62
  export interface DecisionMade {
63
63
  decision_id: string;
64
64
  slot: string;
@@ -76,7 +76,7 @@ export interface DecisionMade {
76
76
  latency_ms?: number | null;
77
77
  }
78
78
 
79
- /** A visitor interacted with a personalised surface — clicked the hero, opened a recommended product from a rail, dismissed an offer. */
79
+ /** A visitor interacted with a personalised surface: viewed it, clicked it (for example opened a product from a rail), or dismissed it. */
80
80
  export interface SlotEngaged {
81
81
  decision_id: string;
82
82
  slot: string;
@@ -106,7 +106,7 @@ export interface RecommendationsViewed {
106
106
  viewable?: Record<string, unknown>[] | null;
107
107
  }
108
108
 
109
- /** A merchandising slot — a hero banner, a strip banner, an editorial block — was actually on screen. */
109
+ /** A promotion was viewable on screen. */
110
110
  export interface PromotionViewed {
111
111
  promotion_id: string;
112
112
  name?: string | null;
@@ -115,7 +115,7 @@ export interface PromotionViewed {
115
115
  creative_slot?: string | null;
116
116
  }
117
117
 
118
- /** A visitor clicked a merchandising slot. */
118
+ /** A shopper clicked a promotion. */
119
119
  export interface PromotionClicked {
120
120
  promotion_id: string;
121
121
  name?: string | null;
@@ -125,14 +125,14 @@ export interface PromotionClicked {
125
125
  href?: string | null;
126
126
  }
127
127
 
128
- /** A product detail page was viewed. */
128
+ /** A shopper saw one product's details, on its product page or in a quick-view overlay. */
129
129
  export interface ProductViewed {
130
130
  products: CdpProduct[];
131
131
  currency?: string | null;
132
132
  value?: number | null;
133
133
  }
134
134
 
135
- /** A listing/category page rendered a set of products. */
135
+ /** A shopper viewed a list of products: a category or listing page, a collection, or a page of search results. */
136
136
  export interface ProductListViewed {
137
137
  products: CdpProduct[];
138
138
  list_id?: string | null;
@@ -142,7 +142,7 @@ export interface ProductListViewed {
142
142
  sorts?: Record<string, unknown>[] | null;
143
143
  }
144
144
 
145
- /** A product tile in a list was clicked. */
145
+ /** A shopper clicked a product in a list, search results, search suggestions or a recommendation rail. */
146
146
  export interface ProductClicked {
147
147
  products: CdpProduct[];
148
148
  list_id?: string | null;
@@ -151,7 +151,7 @@ export interface ProductClicked {
151
151
  search_request_id?: string | null;
152
152
  }
153
153
 
154
- /** Facet or sort selection changed on a listing. */
154
+ /** A shopper changed the facets or sort order of a list and a new result set loaded. */
155
155
  export interface ProductListFiltered {
156
156
  list_id?: string | null;
157
157
  category?: string | null;
@@ -161,7 +161,7 @@ export interface ProductListFiltered {
161
161
  products?: CdpProduct[] | null;
162
162
  }
163
163
 
164
- /** A search was executed and its results were shown. */
164
+ /** A search was submitted and its results page was shown. */
165
165
  export interface ProductsSearched {
166
166
  query: string;
167
167
  is_suggested?: boolean | null;
@@ -170,7 +170,7 @@ export interface ProductsSearched {
170
170
  search_request_id?: string | null;
171
171
  }
172
172
 
173
- /** A search box suggested products for a partly typed query, and they were seen. */
173
+ /** A search box suggested products for a partly typed query, and they were seen: instant search, typeahead or autocomplete. */
174
174
  export interface SearchSuggestionsViewed {
175
175
  query: string;
176
176
  products: CdpProduct[];
@@ -201,7 +201,7 @@ export interface ProductRemoved {
201
201
  initiator?: 'shopper' | 'system' | null;
202
202
  }
203
203
 
204
- /** The basket page was viewed. */
204
+ /** The shopper viewed the basket page. */
205
205
  export interface CartViewed {
206
206
  cart_id?: string | null;
207
207
  value?: number | null;
@@ -213,7 +213,7 @@ export interface CartViewed {
213
213
  coupon?: string | null;
214
214
  }
215
215
 
216
- /** Checkout was entered. */
216
+ /** The shopper entered checkout. */
217
217
  export interface CheckoutStarted {
218
218
  products: CdpProduct[];
219
219
  cart_id?: string | null;
@@ -234,7 +234,7 @@ export interface CheckoutStarted {
234
234
  discounts?: Record<string, unknown>[] | null;
235
235
  }
236
236
 
237
- /** A checkout step was shown. */
237
+ /** A checkout step was shown to the shopper. */
238
238
  export interface CheckoutStepViewed {
239
239
  step: number;
240
240
  step_name: string | null;
@@ -244,7 +244,7 @@ export interface CheckoutStepViewed {
244
244
  payment_method?: string | null;
245
245
  }
246
246
 
247
- /** A checkout step was completed and the customer moved on. */
247
+ /** The shopper completed a checkout step and moved on. */
248
248
  export interface CheckoutStepCompleted {
249
249
  step: number;
250
250
  step_name: string | null;
@@ -254,7 +254,7 @@ export interface CheckoutStepCompleted {
254
254
  payment_method?: string | null;
255
255
  }
256
256
 
257
- /** Payment details were supplied. */
257
+ /** The shopper supplied payment details in checkout. */
258
258
  export interface PaymentInfoEntered {
259
259
  step: number;
260
260
  step_name: string | null;
@@ -288,7 +288,7 @@ export interface OrderCompleted {
288
288
  is_guest?: boolean | null;
289
289
  }
290
290
 
291
- /** An order changed after it was placed — a line removed, an address corrected, a substitution made. */
291
+ /** An order changed after it was placed, e.g. a line removed, an address corrected or a substitution made. */
292
292
  export interface OrderUpdated {
293
293
  order_id: string;
294
294
  currency: string;
@@ -307,7 +307,7 @@ export interface OrderUpdated {
307
307
  reason_detail?: string | null;
308
308
  }
309
309
 
310
- /** Money went back to the customer, in whole or in part. */
310
+ /** Money went back to the customer for an order, in whole or in part. */
311
311
  export interface OrderRefunded {
312
312
  order_id: string;
313
313
  total: number;
@@ -339,7 +339,7 @@ export interface OrderCancelled {
339
339
  reason_detail?: string | null;
340
340
  }
341
341
 
342
- /** A shopper submitted a discount code on a basket or an order, BEFORE anything decided whether it applies. */
342
+ /** The shopper submitted a discount code on a basket or order, before anything decided whether it applies. */
343
343
  export interface CouponEntered {
344
344
  order_id?: string | null;
345
345
  cart_id?: string | null;
@@ -347,7 +347,7 @@ export interface CouponEntered {
347
347
  coupon_name?: string;
348
348
  }
349
349
 
350
- /** A discount code was accepted. */
350
+ /** A discount code was accepted on a basket or order. */
351
351
  export interface CouponApplied {
352
352
  coupon_name: string;
353
353
  cart_id?: string | null;
@@ -358,7 +358,7 @@ export interface CouponApplied {
358
358
  source?: 'manual' | 'auto_applied' | 'url' | null;
359
359
  }
360
360
 
361
- /** A discount code was rejected. */
361
+ /** A discount code was rejected on a basket or order. */
362
362
  export interface CouponDenied {
363
363
  coupon_name: string;
364
364
  cart_id?: string | null;
@@ -368,7 +368,7 @@ export interface CouponDenied {
368
368
  source?: 'manual' | 'auto_applied' | 'url' | null;
369
369
  }
370
370
 
371
- /** A discount code that was applied was taken off a basket or an order. */
371
+ /** A discount code that had been applied was taken off a basket or order. */
372
372
  export interface CouponRemoved {
373
373
  order_id?: string | null;
374
374
  cart_id?: string | null;
@@ -378,7 +378,7 @@ export interface CouponRemoved {
378
378
  currency?: string | null;
379
379
  }
380
380
 
381
- /** Also covers the logged-out attempt, which is a strong signup-intent signal worth keeping rather than discarding. */
381
+ /** A shopper added a product to a wishlist. */
382
382
  export interface ProductAddedToWishlist {
383
383
  products: CdpProduct[];
384
384
  wishlist_id?: string | null;
@@ -386,14 +386,14 @@ export interface ProductAddedToWishlist {
386
386
  was_blocked_by_auth?: boolean | null;
387
387
  }
388
388
 
389
- /** Product Removed from Wishlist */
389
+ /** A shopper removed a product from a wishlist. */
390
390
  export interface ProductRemovedFromWishlist {
391
391
  products: CdpProduct[];
392
392
  wishlist_id?: string | null;
393
393
  wishlist_name?: string | null;
394
394
  }
395
395
 
396
- /** A shopper moved a product from a wishlist into their basket. */
396
+ /** A shopper moved a product from a wishlist into the basket. */
397
397
  export interface WishlistProductAddedToCart {
398
398
  products: CdpProduct[];
399
399
  wishlist_id?: string | null;
@@ -401,7 +401,7 @@ export interface WishlistProductAddedToCart {
401
401
  cart_id?: string | null;
402
402
  }
403
403
 
404
- /** A shopper shared a product with one or more people — mailed it, copied its link, sent it to an app. */
404
+ /** A shopper shared a product with one or more people: by email, a copied link, or another app. */
405
405
  export interface ProductShared {
406
406
  products: CdpProduct[];
407
407
  share_via?: string | null;
@@ -409,7 +409,7 @@ export interface ProductShared {
409
409
  recipient?: string | null;
410
410
  }
411
411
 
412
- /** A shopper shared their basket with one or more people — a gift list, a team order, a basket sent to whoever holds the card. */
412
+ /** A shopper shared their basket with one or more people, e.g. a gift list or a basket sent to someone else to pay. */
413
413
  export interface CartShared {
414
414
  products: CdpProduct[];
415
415
  share_via?: string | null;
@@ -432,7 +432,7 @@ export interface SignedUp {
432
432
  /** The shopper signed out. */
433
433
  export type SignedOut = Record<string, never>;
434
434
 
435
- /** A marketing opt-in was captured on the site or in the app — a footer form, a modal, a checkbox at checkout or in the account. */
435
+ /** The shopper opted in to marketing messages on the site or in the app, for example through a footer form, a modal, or a checkbox at checkout or in their account. */
436
436
  export interface NewsletterSubscribed {
437
437
  email_sha256: string;
438
438
  requires_verification?: boolean | null;
@@ -441,7 +441,7 @@ export interface NewsletterSubscribed {
441
441
  phone_sha256?: string | null;
442
442
  }
443
443
 
444
- /** A review was submitted. */
444
+ /** A shopper submitted a review of a product. */
445
445
  export interface ProductReviewed {
446
446
  products: CdpProduct[];
447
447
  review_id?: string | null;
@@ -450,20 +450,20 @@ export interface ProductReviewed {
450
450
  has_body?: boolean | null;
451
451
  }
452
452
 
453
- /** The visitor changed their consent state. */
453
+ /** The visitor changed their consent: the record of what they allowed and when. */
454
454
  export interface ConsentUpdated {
455
455
  state: Record<string, unknown> | null;
456
456
  action?: 'accept_all' | 'reject_all' | 'custom' | 'withdrawn' | null;
457
457
  }
458
458
 
459
- /** An explicit assertion that two identifiers belong to the same person. */
459
+ /** An explicit assertion that several identifiers belong to the same person, for links an `identify` cannot imply: a guest checkout, an email click, a newsletter signup, a cross-device link. */
460
460
  export interface IdentityLinked {
461
461
  trigger: 'guest_checkout' | 'signed_up' | 'signed_in' | 'account_update' | 'email_link_clicked' | 'newsletter_subscribed' | 'account_creation' | 'user_login' | 'email_click' | 'newsletter_signup';
462
462
  identifiers: Record<string, unknown>[];
463
463
  confidence: number;
464
464
  }
465
465
 
466
- /** An ESP accepted and delivered a message. */
466
+ /** The ESP delivered a message to the recipient's mailbox provider. */
467
467
  export interface EmailDelivered {
468
468
  email_sha256: string;
469
469
  campaign_id?: string | null;
@@ -472,7 +472,7 @@ export interface EmailDelivered {
472
472
  email_id?: string | null;
473
473
  }
474
474
 
475
- /** A tracking pixel fired. */
475
+ /** The recipient opened a message, as detected by the ESP's tracking pixel. */
476
476
  export interface EmailOpened {
477
477
  email_sha256: string;
478
478
  campaign_id?: string | null;
@@ -481,7 +481,7 @@ export interface EmailOpened {
481
481
  email_id?: string | null;
482
482
  }
483
483
 
484
- /** A link in a message was followed. */
484
+ /** The recipient clicked a link in a message. */
485
485
  export interface EmailLinkClicked {
486
486
  email_sha256: string;
487
487
  campaign_id?: string | null;
@@ -493,7 +493,7 @@ export interface EmailLinkClicked {
493
493
  link_id?: string | null;
494
494
  }
495
495
 
496
- /** The recipient opted out. */
496
+ /** The recipient opted out of email from a message, for example through the ESP's unsubscribe link or a List-Unsubscribe header. */
497
497
  export interface EmailUnsubscribed {
498
498
  email_sha256: string;
499
499
  campaign_id?: string | null;
@@ -516,7 +516,7 @@ export interface PersonalisationExposed {
516
516
  recommendation_request_id?: string | null;
517
517
  }
518
518
 
519
- /** The basket AS IT NOW STANDS, sent after any change the platform has confirmed — a line added, removed or re-quantified, a code applied or removed, a basket merged at sign-in, a line the system dropped or repriced, a saved basket restored. */
519
+ /** The basket as it now stands, sent after any change the platform has confirmed: a line added, removed or re-quantified, a code applied or removed, a basket merged at sign-in, a line the system removed or repriced, a saved basket restored. */
520
520
  export interface CartUpdated {
521
521
  products: CdpProduct[];
522
522
  cart_id?: string | null;
@@ -532,7 +532,7 @@ export interface CartUpdated {
532
532
  merged_from_cart_id?: string | null;
533
533
  }
534
534
 
535
- /** The shopper picked a variant — a size, a colour, a flavour — on a product page or a quick view, and the page now shows that variant. */
535
+ /** The shopper picked a variant (a size, a colour, a flavour) on a product page or a quick view, and the page now shows it. */
536
536
  export interface ProductVariantSelected {
537
537
  products: CdpProduct[];
538
538
  changed_attributes?: Record<string, unknown>[] | null;
@@ -551,7 +551,7 @@ export interface BackInStockSubscribed {
551
551
  currency?: string | null;
552
552
  }
553
553
 
554
- /** The shopper opted out of marketing ON THE SITE OR IN THE APP — a preference centre, an account settings toggle, an unsubscribe page the storefront hosts. */
554
+ /** The shopper opted out of marketing messages on the site or in the app, for example in a preference centre, an account setting or an unsubscribe page the storefront hosts. */
555
555
  export interface NewsletterUnsubscribed {
556
556
  channel?: 'email' | 'sms' | 'post' | 'push' | null;
557
557
  mailing_list_id?: string | null;
@@ -562,7 +562,7 @@ export interface NewsletterUnsubscribed {
562
562
  reason_detail?: string | null;
563
563
  }
564
564
 
565
- /** A checkout attempt was stopped by an error the shopper saw: a payment declined, a 3-D Secure challenge failed, an address that would not validate, an item that went out of stock or changed price under them, a session that expired. */
565
+ /** A checkout attempt was stopped by an error the shopper saw: a payment declined, a 3-D Secure challenge failed, an address that would not validate, an item that went out of stock or changed price, or a session that expired. */
566
566
  export interface CheckoutFailed {
567
567
  stage: 'address' | 'shipping' | 'payment' | 'review' | 'place_order';
568
568
  reason_kind: 'payment_declined' | 'payment_error' | 'three_ds_failed' | 'validation' | 'stock' | 'price_changed' | 'session_expired' | 'other';
@@ -576,7 +576,7 @@ export interface CheckoutFailed {
576
576
  taxes_included?: boolean | null;
577
577
  }
578
578
 
579
- /** A return moved through its lifecycle: the customer asked to return goods (`requested`), the warehouse received them (`received`), or the merchant refused the return (`rejected`). */
579
+ /** A return moved through its lifecycle: the customer asked to return goods (`requested`), the merchant received them (`received`), or the merchant refused the return (`rejected`). */
580
580
  export interface OrderReturned {
581
581
  order_id: string;
582
582
  return_id: string;
@@ -587,7 +587,7 @@ export interface OrderReturned {
587
587
  refund_expected?: boolean | null;
588
588
  }
589
589
 
590
- /** An ESP's message could not be delivered to the address. */
590
+ /** The ESP could not deliver a message to the address. */
591
591
  export interface EmailBounced {
592
592
  email_sha256: string;
593
593
  bounce_type: 'hard' | 'soft';
@@ -597,7 +597,7 @@ export interface EmailBounced {
597
597
  email_id?: string | null;
598
598
  }
599
599
 
600
- /** The recipient reported a message as spam — a feedback-loop complaint the ESP received from the mailbox provider. */
600
+ /** The recipient reported a message as spam, as received by the ESP through the mailbox provider's feedback loop. */
601
601
  export interface EmailMarkedAsSpam {
602
602
  email_sha256: string;
603
603
  campaign_id?: string | null;
@@ -631,7 +631,7 @@ export interface ApplicationUpdated {
631
631
  }
632
632
 
633
633
  /** The spec version these models implement. SDKs stamp it on context.spec.version. */
634
- export const SPEC_VERSION = '1.12';
634
+ export const SPEC_VERSION = '1.15';
635
635
 
636
636
  /** Every event name the registry accepts. Anything else is rejected at the ingest. */
637
637
  export type CdpEventName =
package/types/index.d.ts CHANGED
@@ -106,7 +106,6 @@ export interface AnalyticsContextSources {
106
106
  * Given, it is the only source, even when it returns nothing.
107
107
  */
108
108
  getSessionId?(): string | null | undefined;
109
- getRenderId?(): string | null | undefined;
110
109
  getExperiments?(): Record<string, unknown>[] | null | undefined;
111
110
  getAudiences?(): Record<string, unknown>[] | null | undefined;
112
111
  getDecisions?(): Record<string, unknown>[] | null | undefined;