@checkstack/healthcheck-backend 0.3.0 → 0.3.2
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 +77 -0
- package/package.json +1 -1
- package/src/router.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
1
1
|
# @checkstack/healthcheck-backend
|
|
2
2
|
|
|
3
|
+
## 0.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7a23261: ## TanStack Query Integration
|
|
8
|
+
|
|
9
|
+
Migrated all frontend components to use `usePluginClient` hook with TanStack Query integration, replacing the legacy `forPlugin()` pattern.
|
|
10
|
+
|
|
11
|
+
### New Features
|
|
12
|
+
|
|
13
|
+
- **`usePluginClient` hook**: Provides type-safe access to plugin APIs with `.useQuery()` and `.useMutation()` methods
|
|
14
|
+
- **Automatic request deduplication**: Multiple components requesting the same data share a single network request
|
|
15
|
+
- **Built-in caching**: Configurable stale time and cache duration per query
|
|
16
|
+
- **Loading/error states**: TanStack Query provides `isLoading`, `error`, `isRefetching` states automatically
|
|
17
|
+
- **Background refetching**: Stale data is automatically refreshed when components mount
|
|
18
|
+
|
|
19
|
+
### Contract Changes
|
|
20
|
+
|
|
21
|
+
All RPC contracts now require `operationType: "query"` or `operationType: "mutation"` metadata:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
const getItems = proc()
|
|
25
|
+
.meta({ operationType: "query", access: [access.read] })
|
|
26
|
+
.output(z.array(itemSchema))
|
|
27
|
+
.query();
|
|
28
|
+
|
|
29
|
+
const createItem = proc()
|
|
30
|
+
.meta({ operationType: "mutation", access: [access.manage] })
|
|
31
|
+
.input(createItemSchema)
|
|
32
|
+
.output(itemSchema)
|
|
33
|
+
.mutation();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Migration
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
// Before (forPlugin pattern)
|
|
40
|
+
const api = useApi(myPluginApiRef);
|
|
41
|
+
const [items, setItems] = useState<Item[]>([]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
api.getItems().then(setItems);
|
|
44
|
+
}, [api]);
|
|
45
|
+
|
|
46
|
+
// After (usePluginClient pattern)
|
|
47
|
+
const client = usePluginClient(MyPluginApi);
|
|
48
|
+
const { data: items, isLoading } = client.getItems.useQuery({});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
- Fixed `rpc.test.ts` test setup for middleware type inference
|
|
54
|
+
- Fixed `SearchDialog` to use `setQuery` instead of deprecated `search` method
|
|
55
|
+
- Fixed null→undefined warnings in notification and queue frontends
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [180be38]
|
|
58
|
+
- Updated dependencies [7a23261]
|
|
59
|
+
- @checkstack/queue-api@0.1.0
|
|
60
|
+
- @checkstack/common@0.3.0
|
|
61
|
+
- @checkstack/backend-api@0.3.2
|
|
62
|
+
- @checkstack/catalog-common@1.2.0
|
|
63
|
+
- @checkstack/healthcheck-common@0.4.0
|
|
64
|
+
- @checkstack/integration-backend@0.1.2
|
|
65
|
+
- @checkstack/catalog-backend@0.2.2
|
|
66
|
+
- @checkstack/command-backend@0.1.2
|
|
67
|
+
- @checkstack/signal-common@0.1.1
|
|
68
|
+
|
|
69
|
+
## 0.3.1
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [9a27800]
|
|
74
|
+
- @checkstack/queue-api@0.0.6
|
|
75
|
+
- @checkstack/backend-api@0.3.1
|
|
76
|
+
- @checkstack/integration-backend@0.1.1
|
|
77
|
+
- @checkstack/catalog-backend@0.2.1
|
|
78
|
+
- @checkstack/command-backend@0.1.1
|
|
79
|
+
|
|
3
80
|
## 0.3.0
|
|
4
81
|
|
|
5
82
|
### Minor Changes
|
package/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -184,6 +184,24 @@ export const createHealthCheckRouter = (
|
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
186
|
|
|
187
|
+
getBulkSystemHealthStatus: os.getBulkSystemHealthStatus.handler(
|
|
188
|
+
async ({ input }) => {
|
|
189
|
+
const statuses: Record<
|
|
190
|
+
string,
|
|
191
|
+
Awaited<ReturnType<typeof service.getSystemHealthStatus>>
|
|
192
|
+
> = {};
|
|
193
|
+
|
|
194
|
+
// Fetch health status for each system in parallel
|
|
195
|
+
await Promise.all(
|
|
196
|
+
input.systemIds.map(async (systemId) => {
|
|
197
|
+
statuses[systemId] = await service.getSystemHealthStatus(systemId);
|
|
198
|
+
})
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
return { statuses };
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
|
|
187
205
|
getSystemHealthOverview: os.getSystemHealthOverview.handler(
|
|
188
206
|
async ({ input }) => {
|
|
189
207
|
return service.getSystemHealthOverview(input.systemId);
|