@podium/client 5.2.5-beta.1 → 5.2.5-beta.3

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
@@ -1,9 +1,16 @@
1
- ## [5.2.5-beta.1](https://github.com/podium-lib/client/compare/v5.2.4...v5.2.5-beta.1) (2024-12-02)
1
+ ## [5.2.5-beta.3](https://github.com/podium-lib/client/compare/v5.2.5-beta.2...v5.2.5-beta.3) (2025-01-13)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * adding @podium/http-client beta ([e300bde](https://github.com/podium-lib/client/commit/e300bde2fd8e6356227e03a8d9ae847e509cd1f4))
6
+ * correctly build asset urls from link headers ([#446](https://github.com/podium-lib/client/issues/446)) ([89f9e0b](https://github.com/podium-lib/client/commit/89f9e0b44f87c45c1459dce7e53db4fa7fc85d17))
7
+
8
+ ## [5.2.5](https://github.com/podium-lib/client/compare/v5.2.4...v5.2.5) (2024-11-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * correctly build asset urls from link headers ([#446](https://github.com/podium-lib/client/issues/446)) ([5a30079](https://github.com/podium-lib/client/commit/5a30079fb47ee15a49ae6ff77348c400df3fe99a))
7
14
 
8
15
  ## [5.2.4](https://github.com/podium-lib/client/compare/v5.2.3...v5.2.4) (2024-11-21)
9
16
 
package/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  Client for fetching podium component fragments over HTTP.
4
4
 
5
- [![Dependencies](https://img.shields.io/david/podium-lib/client.svg)](https://david-dm.org/podium-lib/client)
6
5
  [![GitHub Actions status](https://github.com/podium-lib/client/workflows/Run%20Lint%20and%20Tests/badge.svg)](https://github.com/podium-lib/client/actions?query=workflow%3A%22Run+Lint+and+Tests%22)
7
- [![Known Vulnerabilities](https://snyk.io/test/github/podium-lib/client/badge.svg?targetFile=package.json)](https://snyk.io/test/github/podium-lib/client?targetFile=package.json)
8
6
 
9
7
  This module is intended for internal use in Podium and is not a module an end
10
8
  user would use directly. End users will typically interact with this module
@@ -165,7 +165,10 @@ export default class PodletClientContentResolver {
165
165
  ...reqOptions,
166
166
  });
167
167
 
168
- const parsedAssetObjects = parseLinkHeaders(hdrs.link);
168
+ const parsedAssetObjects = parseLinkHeaders(
169
+ hdrs.link,
170
+ outgoing.manifestUri,
171
+ );
169
172
 
170
173
  const scriptObjects = parsedAssetObjects.filter(
171
174
  (asset) => asset instanceof AssetJs,
@@ -126,7 +126,10 @@ export default class PodletClientFallbackResolver {
126
126
  ...reqOptions,
127
127
  });
128
128
 
129
- const parsedAssetObjects = parseLinkHeaders(resHeaders.link);
129
+ const parsedAssetObjects = parseLinkHeaders(
130
+ resHeaders.link,
131
+ outgoing.manifestUri,
132
+ );
130
133
 
131
134
  const scriptObjects = parsedAssetObjects.filter(
132
135
  (asset) => asset instanceof AssetJs,
package/lib/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AssetJs, AssetCss } from '@podium/utils';
1
+ import { AssetJs, AssetCss, uriRelativeToAbsolute } from '@podium/utils';
2
2
 
3
3
  /**
4
4
  * Checks if a header object has a header.
@@ -75,14 +75,17 @@ export const filterAssets = (scope, assets) => {
75
75
  };
76
76
 
77
77
  // parse link headers in AssetCss and AssetJs objects
78
- export const parseLinkHeaders = (headers) => {
78
+ export const parseLinkHeaders = (headers, manifestUri) => {
79
79
  const links = [];
80
80
 
81
81
  if (!headers) return links;
82
82
  headers.split(',').forEach((link) => {
83
83
  const parts = link.split(';');
84
84
  const [href, ...rest] = parts;
85
- const value = href.replace(/<|>|"/g, '').trim();
85
+ const value = uriRelativeToAbsolute(
86
+ href.replace(/<|>|"/g, '').trim(),
87
+ manifestUri,
88
+ );
86
89
 
87
90
  const asset = { value };
88
91
  for (const key of rest) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podium/client",
3
- "version": "5.2.5-beta.1",
3
+ "version": "5.2.5-beta.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@hapi/boom": "10.0.1",
41
41
  "@metrics/client": "2.5.4",
42
- "@podium/http-client": "1.0.0-beta.8",
42
+ "@podium/http-client": "1.0.0-beta.9",
43
43
  "@podium/schemas": "5.1.0",
44
44
  "@podium/utils": "5.4.0",
45
45
  "abslog": "2.4.4",
@@ -50,7 +50,7 @@
50
50
  "undici": "6.21.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@podium/eslint-config": "1.0.0",
53
+ "@podium/eslint-config": "1.0.5",
54
54
  "@podium/semantic-release-config": "2.0.0",
55
55
  "@podium/test-utils": "3.1.0-next.5",
56
56
  "@podium/typescript-config": "1.0.0",
@@ -62,15 +62,15 @@
62
62
  "@sinonjs/fake-timers": "11.3.1",
63
63
  "@types/readable-stream": "4.0.18",
64
64
  "benchmark": "2.1.4",
65
- "eslint": "9.6.0",
65
+ "eslint": "9.17.0",
66
66
  "eslint-config-prettier": "9.1.0",
67
- "eslint-plugin-prettier": "5.1.3",
68
- "express": "4.21.1",
67
+ "eslint-plugin-prettier": "5.2.1",
68
+ "express": "4.21.2",
69
69
  "get-stream": "9.0.1",
70
70
  "http-proxy": "1.18.1",
71
71
  "is-stream": "4.0.1",
72
- "npm-run-all2": "6.2.3",
73
- "prettier": "3.3.2",
72
+ "npm-run-all2": "6.2.6",
73
+ "prettier": "3.4.2",
74
74
  "semantic-release": "24.1.2",
75
75
  "tap": "18.7.2",
76
76
  "typescript": "5.6.3",
package/types/utils.d.ts CHANGED
@@ -2,5 +2,5 @@ export function isHeaderDefined(headers: object, header: string): boolean;
2
2
  export function hasManifestChange(item: object): boolean;
3
3
  export function validateIncoming(incoming?: object): boolean;
4
4
  export function filterAssets<T extends import("@podium/utils").AssetCss | import("@podium/utils").AssetJs>(scope: "content" | "fallback" | "all", assets: T[]): T[];
5
- export function parseLinkHeaders(headers: any): any[];
5
+ export function parseLinkHeaders(headers: any, manifestUri: any): any[];
6
6
  export function toPreloadAssetObjects(assetObjects: any): any;