@burdenoff/fe-libs 2026.518.7 → 2026.520.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.
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlag.d.ts","sourceRoot":"","sources":["../../../src/shared/feature-flags/useFeatureFlag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,UAAO,GAAG,OAAO,CAQ5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EACjE,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,CAAC,GACd,CAAC,CAOH;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAMjF"}
1
+ {"version":3,"file":"useFeatureFlag.d.ts","sourceRoot":"","sources":["../../../src/shared/feature-flags/useFeatureFlag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,UAAO,GAAG,OAAO,CAY5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EACjE,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,CAAC,GACd,CAAC,CAOH;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAMjF"}
@@ -2,8 +2,12 @@ import { useFeatureFlags as e } from "./FeatureFlagProvider.js";
2
2
  import { useMemo as t } from "react";
3
3
  //#region src/shared/feature-flags/useFeatureFlag.ts
4
4
  function n(n, r = !0) {
5
- let { isEnabled: i, isLoading: a } = e();
6
- return t(() => a ? r : i(n), [
5
+ let { getEvaluation: i, isLoading: a } = e();
6
+ return t(() => {
7
+ if (a) return r;
8
+ let e = i(n);
9
+ return e ? !!e.value : r;
10
+ }, [
7
11
  i,
8
12
  a,
9
13
  n,
@@ -9,5 +9,18 @@ export interface CreateApolloClientOptions {
9
9
  retryDelay?: number;
10
10
  }
11
11
  export declare function withBrowserTraceHeader(headersInit?: HeadersInit): Headers;
12
+ /**
13
+ * Decide whether an Apollo link error should be retried. Exported so it
14
+ * can be unit-tested independently of an ApolloClient instance.
15
+ *
16
+ * Retries any unrecognised error (default-true) so genuine transient
17
+ * network / 5xx failures still benefit from the link's retry budget;
18
+ * permanent failures are filtered via three signals, in order:
19
+ * 1. Numeric `statusCode` (Apollo Client 4's `ServerError`)
20
+ * 2. `errors[].extensions.code` (GraphQL response auth codes)
21
+ * 3. Substring match on `message` (fallback for link errors that
22
+ * surface auth codes only in their message string)
23
+ */
24
+ export declare function shouldRetryApolloError(error: unknown): boolean;
12
25
  export declare function createApolloClient(options: CreateApolloClientOptions): ApolloClient;
13
26
  //# sourceMappingURL=apollo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apollo.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/apollo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAQ,MAAM,gBAAgB,CAAC;AAYnE,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAMzE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CA0HnF"}
1
+ {"version":3,"file":"apollo.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/apollo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAQ,MAAM,gBAAgB,CAAC;AAanE,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAMzE;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAiC9D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CAyHnF"}
@@ -9,48 +9,60 @@ function c(t) {
9
9
  let n = new Headers(t);
10
10
  return n.has("traceparent") || n.set("traceparent", e().traceparent), n;
11
11
  }
12
- function l(e) {
13
- let { uri: l, getAuthToken: u, onAuthError: d, onNetworkError: f, cache: p = new n(), retryAttempts: m = 3, retryDelay: h = 1e3 } = e, g = new o({
12
+ var l = new Set([
13
+ 401,
14
+ 403,
15
+ 413
16
+ ]);
17
+ function u(e) {
18
+ if (!e) return !1;
19
+ let t = e.statusCode;
20
+ if (typeof t == "number" && l.has(t) || e.errors?.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.extensions?.code === "FORBIDDEN")) return !1;
21
+ let n = e.message;
22
+ return !(n && /UNAUTHENTICATED|FORBIDDEN/.test(n));
23
+ }
24
+ function d(e) {
25
+ let { uri: l, getAuthToken: d, onAuthError: f, onNetworkError: p, cache: m = new n(), retryAttempts: h = 3, retryDelay: g = 1e3 } = e, _ = new o({
14
26
  delay: {
15
- initial: h,
16
- max: h * 4,
27
+ initial: g,
28
+ max: g * 4,
17
29
  jitter: !0
18
30
  },
19
31
  attempts: {
20
- max: m,
21
- retryIf: (e) => !!e && !e.message.includes("401") && !e.message.includes("403")
32
+ max: h,
33
+ retryIf: u
22
34
  }
23
- }), _ = a(({ error: e }) => {
35
+ }), v = a(({ error: e }) => {
24
36
  let t = e.errors;
25
37
  t ? t.forEach((e) => {
26
- console.error(`[GraphQL error]: Message: ${e.message}, Location: ${JSON.stringify(e.locations)}, Path: ${e.path}`), (e.extensions?.code === "UNAUTHENTICATED" || e.extensions?.code === "FORBIDDEN") && d?.();
27
- }) : e && (console.error(`[Network error]: ${e.message}`), f?.(e));
28
- }), v = s((e, { headers: t }) => {
29
- let n = u?.();
38
+ console.error(`[GraphQL error]: Message: ${e.message}, Location: ${JSON.stringify(e.locations)}, Path: ${e.path}`), (e.extensions?.code === "UNAUTHENTICATED" || e.extensions?.code === "FORBIDDEN") && f?.();
39
+ }) : e && (console.error(`[Network error]: ${e.message}`), p?.(e));
40
+ }), y = s((e, { headers: t }) => {
41
+ let n = d?.();
30
42
  console.log("[fe-libs apollo] getAuthToken returned:", n ? n.substring(0, 20) + "..." : "null");
31
43
  let r = { headers: {
32
44
  ...t,
33
45
  ...n ? { authorization: `Bearer ${n}` } : {}
34
46
  } };
35
47
  return console.log("[fe-libs apollo] Authorization header:", r.headers.authorization ? r.headers.authorization.substring(0, 30) + "..." : "MISSING"), r;
36
- }), y = fetch, b = ((e, t) => fetch(e, {
48
+ }), b = fetch, x = ((e, t) => fetch(e, {
37
49
  ...t,
38
50
  headers: c(t?.headers)
39
51
  }));
40
- return y.preconnect && (b.preconnect = y.preconnect), new t({
52
+ return b.preconnect && (x.preconnect = b.preconnect), new t({
41
53
  link: r([
42
- g,
43
54
  _,
44
55
  v,
56
+ y,
45
57
  new i({
46
58
  uri: l,
47
59
  credentials: "include",
48
- batchMax: 50,
60
+ batchMax: 10,
49
61
  batchInterval: 100,
50
- fetch: b
62
+ fetch: x
51
63
  })
52
64
  ]),
53
- cache: p,
65
+ cache: m,
54
66
  defaultOptions: {
55
67
  watchQuery: {
56
68
  fetchPolicy: "cache-and-network",
@@ -65,4 +77,4 @@ function l(e) {
65
77
  });
66
78
  }
67
79
  //#endregion
68
- export { l as createApolloClient };
80
+ export { d as createApolloClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.518.7",
3
+ "version": "2026.520.1",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {