@burdenoff/fe-libs 2026.802.1 → 2026.803.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.
@@ -6,6 +6,13 @@
6
6
  *
7
7
  * @module @burdenoff/fe-libs/shared/hooks/shell/useProducts
8
8
  */
9
+ /**
10
+ * Reject API appUrls that are clearly not production-safe: non-https schemes,
11
+ * localhost/loopback addresses, or empty values. The static catalog URL is
12
+ * authoritative for the switcher, so a bad API value falls back instead of
13
+ * shipping a broken link (BOFF-5485).
14
+ */
15
+ export declare function isTrustedAppUrl(url: string | null | undefined): url is string;
9
16
  export interface Product {
10
17
  id: string;
11
18
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useProducts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8DH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAeD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAuE3E"}
1
+ {"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useProducts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8DH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,GAAG,IAAI,MAAM,CAU7E;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAeD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAuE3E"}
@@ -28,7 +28,16 @@ var d = s`
28
28
  function f(e) {
29
29
  return c.has(e);
30
30
  }
31
- function p() {
31
+ function p(e) {
32
+ if (!e || !e.startsWith("https://") || e.includes("localhost") || e.includes("127.0.0.1")) return !1;
33
+ try {
34
+ let t = new URL(e);
35
+ return t.protocol === "https:" && t.hostname.length > 0;
36
+ } catch {
37
+ return !1;
38
+ }
39
+ }
40
+ function m() {
32
41
  return e.map((e) => ({
33
42
  id: e.id,
34
43
  name: e.name,
@@ -39,9 +48,9 @@ function p() {
39
48
  comingSoon: e.comingSoon === !0
40
49
  }));
41
50
  }
42
- function m(s) {
43
- let c = r("global"), [l, m] = o(p()), [h, g] = o(s?.autoFetch !== !1), [_, v] = o(null), y = i(async () => {
44
- g(!0), v(null);
51
+ function h(s) {
52
+ let c = r("global"), [l, h] = o(m()), [g, _] = o(s?.autoFetch !== !1), [v, y] = o(null), b = i(async () => {
53
+ _(!0), y(null);
45
54
  try {
46
55
  let r = (await c.query({
47
56
  query: d,
@@ -55,32 +64,32 @@ function m(s) {
55
64
  return {
56
65
  id: e.id,
57
66
  name: e.name,
58
- url: r?.appUrl || n(e.id),
67
+ url: p(r?.appUrl) ? r.appUrl : n(e.id),
59
68
  icon: e.icon,
60
69
  color: r?.metadata && typeof r.metadata.color == "string" ? r.metadata.color : e.color,
61
70
  logoUrl: t(e.id),
62
71
  comingSoon: r ? u(e.id, r.status, r.appUrl) : e.comingSoon === !0
63
72
  };
64
73
  });
65
- a.sort((e, t) => e.name.localeCompare(t.name)), m(a);
74
+ a.sort((e, t) => e.name.localeCompare(t.name)), h(a);
66
75
  } catch (e) {
67
- v(e instanceof Error ? e.message : "Failed to fetch products"), m(p());
76
+ y(e instanceof Error ? e.message : "Failed to fetch products"), h(m());
68
77
  } finally {
69
- g(!1);
78
+ _(!1);
70
79
  }
71
80
  }, [c]);
72
81
  return a(() => {
73
82
  if (s?.autoFetch === !1) {
74
- g(!1);
83
+ _(!1);
75
84
  return;
76
85
  }
77
- y();
86
+ b();
78
87
  }, []), {
79
88
  products: l,
80
- isLoading: h,
81
- error: _,
82
- refetch: y
89
+ isLoading: g,
90
+ error: v,
91
+ refetch: b
83
92
  };
84
93
  }
85
94
  //#endregion
86
- export { m as useProducts };
95
+ export { h as useProducts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.802.1",
3
+ "version": "2026.803.1",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "bin": {