apiforgejs 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +11 -3
  2. package/src/ui.html +6 -6
package/package.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "name": "apiforgejs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "API observability & intelligence SDK for Express.js — local-first, privacy-first",
5
5
  "main": "src/index.js",
6
6
  "keywords": [
7
- "api", "observability", "monitoring", "express", "metrics",
8
- "performance", "analytics", "middleware", "latency", "local-first"
7
+ "api",
8
+ "observability",
9
+ "monitoring",
10
+ "express",
11
+ "metrics",
12
+ "performance",
13
+ "analytics",
14
+ "middleware",
15
+ "latency",
16
+ "local-first"
9
17
  ],
10
18
  "author": "APIForge",
11
19
  "license": "MIT",
package/src/ui.html CHANGED
@@ -717,7 +717,7 @@ function StatusStackChart({ data, height = 200 }) {
717
717
  }
718
718
 
719
719
  // ─── Overview ─────────────────────────────────────────────────────────────────
720
- function Overview({ timeRange, setRoute, setParams }) {
720
+ function Overview({ timeRange, setRoute, setParams, lastUpdated }) {
721
721
  const { ENDPOINTS, RELEASES, INSIGHTS, SUMMARY } = window.AF_DATA;
722
722
  const [globalTs, setGlobalTs] = useState(null);
723
723
  const hours = TIME_HOURS[timeRange] || 24;
@@ -726,7 +726,7 @@ function Overview({ timeRange, setRoute, setParams }) {
726
726
  setGlobalTs(null);
727
727
  fetch(`/api/global-timeseries?hours=${hours}`)
728
728
  .then(r => r.json()).then(d => setGlobalTs(d)).catch(() => setGlobalTs([]));
729
- }, [hours]);
729
+ }, [hours, lastUpdated]);
730
730
 
731
731
  const chartData = globalTs ? tsBucketsToChart(globalTs, hours) : null;
732
732
  const points = Math.max(chartData?.p90?.length || 0, 2);
@@ -1048,7 +1048,7 @@ function Endpoints({ setRoute, setParams }) {
1048
1048
  }
1049
1049
 
1050
1050
  // ─── Endpoint detail ──────────────────────────────────────────────────────────
1051
- function EndpointDetail({ id, timeRange, setRoute, setParams }) {
1051
+ function EndpointDetail({ id, timeRange, setRoute, setParams, lastUpdated }) {
1052
1052
  const { ENDPOINTS, INSIGHTS } = window.AF_DATA;
1053
1053
  const ep = ENDPOINTS.find(e => e.id === id) || ENDPOINTS[0];
1054
1054
  const [tab, setTab] = useState('performance');
@@ -1063,7 +1063,7 @@ function EndpointDetail({ id, timeRange, setRoute, setParams }) {
1063
1063
  setTs(null);
1064
1064
  fetch(`/api/timeseries?route=${encodeURIComponent(route)}&method=${encodeURIComponent(method)}&hours=${hours}`)
1065
1065
  .then(r => r.json()).then(d => setTs(d)).catch(() => setTs([]));
1066
- }, [id, hours]);
1066
+ }, [id, hours, lastUpdated]);
1067
1067
 
1068
1068
  if (!ep) return <div className="empty-state">Endpoint not found.</div>;
1069
1069
 
@@ -1626,9 +1626,9 @@ function App() {
1626
1626
  lastUpdated={lastUpdated} onRefresh={() => fetchData.current()}/>
1627
1627
  <div className="content">
1628
1628
  <div className="content-inner">
1629
- {route === 'overview' && <Overview timeRange={timeRange} setRoute={setRoute} setParams={setParams}/>}
1629
+ {route === 'overview' && <Overview timeRange={timeRange} setRoute={setRoute} setParams={setParams} lastUpdated={lastUpdated}/>}
1630
1630
  {route === 'endpoints' && <Endpoints setRoute={setRoute} setParams={setParams}/>}
1631
- {route === 'endpoint' && <EndpointDetail id={params.id} timeRange={timeRange} setRoute={setRoute} setParams={setParams}/>}
1631
+ {route === 'endpoint' && <EndpointDetail id={params.id} timeRange={timeRange} setRoute={setRoute} setParams={setParams} lastUpdated={lastUpdated}/>}
1632
1632
  {route === 'insights' && <Insights setRoute={setRoute} setParams={setParams}/>}
1633
1633
  {route === 'releases' && <Releases/>}
1634
1634
  {route === 'settings' && <Settings/>}