@sarimarcus/content-sites-core 0.55.1 → 0.55.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.55.2 (2026-11-04)
6
+
7
+ - `affiliate`: `travelpayoutsWidgetSrc` accepts an optional `subId` on `WidgetOptions`, appending `<marker>.<subId>` to `shmarker` when non-blank (SLA-3334).
8
+
5
9
  ## 0.55.1 (2026-11-04)
6
10
 
7
11
  - Lockstep release, no change (SLA-3756).
@@ -11,7 +11,7 @@ export interface WidgetAccount {
11
11
  /** The Travelpayouts marker. */
12
12
  marker: string;
13
13
  }
14
- export type WidgetOptions = {
14
+ export type WidgetOptions = ({
15
15
  kind: 'hotel';
16
16
  direction: string;
17
17
  } | {
@@ -30,6 +30,9 @@ export type WidgetOptions = {
30
30
  buttonFont: string;
31
31
  };
32
32
  buttonText?: string;
33
+ }) & {
34
+ /** Optional Travelpayouts Sub-ID appended to `shmarker` as `<marker>.<subId>`. */
35
+ subId?: string;
33
36
  };
34
37
  /**
35
38
  * A Travelpayouts widget loader URL. Each kind keeps the parameter order Travelpayouts issued, which differs per kind
@@ -8,7 +8,9 @@ export function travelpayoutsWidgetSrc(loader, account, options) {
8
8
  const campaign = loader.campaignId ? [['campaign_id', loader.campaignId]] : [];
9
9
  return order === 'promo-first' ? [promo, ...campaign] : [...campaign, promo];
10
10
  };
11
- const who = [['trs', account.trs], ['shmarker', account.marker]];
11
+ const subId = options.subId?.trim();
12
+ const shmarker = subId ? `${account.marker}.${subId}` : account.marker;
13
+ const who = [['trs', account.trs], ['shmarker', shmarker]];
12
14
  let pairs;
13
15
  switch (options.kind) {
14
16
  case 'hotel':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-core",
3
- "version": "0.55.1",
3
+ "version": "0.55.2",
4
4
  "description": "Non-visual utilities, Astro config builders and SEO schema assembly shared by the content sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@ export interface WidgetAccount {
13
13
  marker: string;
14
14
  }
15
15
 
16
- export type WidgetOptions =
16
+ export type WidgetOptions = (
17
17
  | { kind: 'hotel'; direction: string }
18
18
  | { kind: 'activity'; place: string }
19
19
  | { kind: 'train' }
@@ -23,7 +23,11 @@ export type WidgetOptions =
23
23
  city: string;
24
24
  colors: { background: string; font: string; button: string; buttonFont: string };
25
25
  buttonText?: string;
26
- };
26
+ }
27
+ ) & {
28
+ /** Optional Travelpayouts Sub-ID appended to `shmarker` as `<marker>.<subId>`. */
29
+ subId?: string;
30
+ };
27
31
 
28
32
  type Pair = [string, string];
29
33
 
@@ -37,7 +41,9 @@ export function travelpayoutsWidgetSrc(loader: WidgetLoader, account: WidgetAcco
37
41
  const campaign: Pair[] = loader.campaignId ? [['campaign_id', loader.campaignId]] : [];
38
42
  return order === 'promo-first' ? [promo, ...campaign] : [...campaign, promo];
39
43
  };
40
- const who: Pair[] = [['trs', account.trs], ['shmarker', account.marker]];
44
+ const subId = options.subId?.trim();
45
+ const shmarker = subId ? `${account.marker}.${subId}` : account.marker;
46
+ const who: Pair[] = [['trs', account.trs], ['shmarker', shmarker]];
41
47
  let pairs: Pair[];
42
48
  switch (options.kind) {
43
49
  case 'hotel':