@sarimarcus/content-sites-ui 0.22.0 → 0.22.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.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/affiliate/resources.ts +9 -4
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.22.1 (2026-10-04)
|
|
6
|
+
|
|
7
|
+
- `./affiliate` `resources.ts` declares each widget kind's `connect-src` hosts and the hotel widget's `script-src 'unsafe-eval'`, which the CSP coverage gate now requires. A site rendering a hotel widget needs `'unsafe-eval'` in script-src and `https://suggest.apistp.com` in connect-src; a train widget needs `https://api.omio.com`; activity, train and car need `https://tpo.gg` (SLA-2920).
|
|
8
|
+
|
|
5
9
|
## 0.22.0 (2026-10-04)
|
|
6
10
|
|
|
7
11
|
- `./affiliate`: `widgetLoaders` in `resources.ts` declares each Travelpayouts widget kind's loader URL, promo id and campaign id (the CSP coverage gate reads the promo ids from it); `widgetSrc(account, options)` builds a widget loader URL from it; `gygCardItem` and `gygCardLocale` turn a cached GYG activity into an `AffiliateCardItem`. `pageTypeOf` is re-exported from core, unchanged (SLA-2919).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"@lucide/astro": "^1.23.0",
|
|
50
50
|
"astro": "^7.0.6",
|
|
51
51
|
"tailwindcss": "^4.1.18",
|
|
52
|
-
"@sarimarcus/content-sites-core": "0.22.
|
|
52
|
+
"@sarimarcus/content-sites-core": "0.22.1"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
// The third-party hosts each TravelpayoutsWidget kind loads, per CSP directive. A site rendering a kind must allow
|
|
2
2
|
// these in its Content-Security-Policy (scripts/validate-csp-coverage.mjs checks the built site against this list).
|
|
3
3
|
// Read from each loader's own code: the tpwdg.com/c91 loader script, then what it injects (scripts, frames,
|
|
4
|
-
// stylesheets)
|
|
5
|
-
//
|
|
4
|
+
// stylesheets), and the hosts they fetch from (connect-src), traced in a browser (SLA-2920). A quoted CSP keyword
|
|
5
|
+
// ('unsafe-eval') is a requirement too: the hotel loader evals, and without it renders a static fallback card.
|
|
6
6
|
// Every other component in this folder loads nothing: its outbound links are caller data, not resources.
|
|
7
7
|
// Plain data and erasable types only: the gate imports this file under Node.
|
|
8
8
|
|
|
9
9
|
import type { WidgetLoader } from '@sarimarcus/content-sites-core/affiliate';
|
|
10
10
|
|
|
11
11
|
export type WidgetKind = 'hotel' | 'activity' | 'train' | 'car';
|
|
12
|
-
export type CspDirective = 'script-src' | 'frame-src' | 'style-src';
|
|
12
|
+
export type CspDirective = 'script-src' | 'frame-src' | 'style-src' | 'connect-src';
|
|
13
13
|
export type WidgetResources = Partial<Record<CspDirective, readonly string[]>>;
|
|
14
14
|
|
|
15
15
|
export const externalResources: Record<WidgetKind, WidgetResources> = {
|
|
16
16
|
hotel: {
|
|
17
|
-
'script-src': ['https://tpwdg.com'],
|
|
17
|
+
'script-src': ['https://tpwdg.com', "'unsafe-eval'"],
|
|
18
|
+
'connect-src': ['https://suggest.apistp.com', 'https://avsplow.com', 'https://sentry.avs.io'],
|
|
18
19
|
},
|
|
19
20
|
activity: {
|
|
20
21
|
'script-src': ['https://tpwdg.com', 'https://widget.getyourguide.com'],
|
|
21
22
|
'frame-src': ['https://widget.getyourguide.com'],
|
|
23
|
+
'connect-src': ['https://tpo.gg', 'https://widget.getyourguide.com'],
|
|
22
24
|
},
|
|
23
25
|
train: {
|
|
24
26
|
'script-src': ['https://c91.travelpayouts.com', 'https://www.omio.com'],
|
|
25
27
|
'style-src': ['https://www.omio.com'],
|
|
28
|
+
'connect-src': ['https://tpo.gg', 'https://api.omio.com'],
|
|
26
29
|
},
|
|
27
30
|
car: {
|
|
28
31
|
'script-src': ['https://tpwdg.com', 'https://www.discovercars.com'],
|
|
29
32
|
'frame-src': ['https://widget.discovercars.com'],
|
|
33
|
+
'connect-src': ['https://tpo.gg'],
|
|
30
34
|
},
|
|
31
35
|
};
|
|
32
36
|
|
|
@@ -47,4 +51,5 @@ export const EMERALD_ORIGIN = 'https://emrldtp.com';
|
|
|
47
51
|
|
|
48
52
|
export const emeraldResources: Partial<Record<CspDirective, readonly string[]>> = {
|
|
49
53
|
'script-src': [EMERALD_ORIGIN],
|
|
54
|
+
'connect-src': [EMERALD_ORIGIN],
|
|
50
55
|
};
|