@checkstack/maintenance-backend 0.2.1 → 0.2.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,5 +1,77 @@
1
1
  # @checkstack/maintenance-backend
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @checkstack/catalog-common@1.2.1
8
+ - @checkstack/maintenance-common@0.3.1
9
+
10
+ ## 0.2.2
11
+
12
+ ### Patch Changes
13
+
14
+ - 7a23261: ## TanStack Query Integration
15
+
16
+ Migrated all frontend components to use `usePluginClient` hook with TanStack Query integration, replacing the legacy `forPlugin()` pattern.
17
+
18
+ ### New Features
19
+
20
+ - **`usePluginClient` hook**: Provides type-safe access to plugin APIs with `.useQuery()` and `.useMutation()` methods
21
+ - **Automatic request deduplication**: Multiple components requesting the same data share a single network request
22
+ - **Built-in caching**: Configurable stale time and cache duration per query
23
+ - **Loading/error states**: TanStack Query provides `isLoading`, `error`, `isRefetching` states automatically
24
+ - **Background refetching**: Stale data is automatically refreshed when components mount
25
+
26
+ ### Contract Changes
27
+
28
+ All RPC contracts now require `operationType: "query"` or `operationType: "mutation"` metadata:
29
+
30
+ ```typescript
31
+ const getItems = proc()
32
+ .meta({ operationType: "query", access: [access.read] })
33
+ .output(z.array(itemSchema))
34
+ .query();
35
+
36
+ const createItem = proc()
37
+ .meta({ operationType: "mutation", access: [access.manage] })
38
+ .input(createItemSchema)
39
+ .output(itemSchema)
40
+ .mutation();
41
+ ```
42
+
43
+ ### Migration
44
+
45
+ ```typescript
46
+ // Before (forPlugin pattern)
47
+ const api = useApi(myPluginApiRef);
48
+ const [items, setItems] = useState<Item[]>([]);
49
+ useEffect(() => {
50
+ api.getItems().then(setItems);
51
+ }, [api]);
52
+
53
+ // After (usePluginClient pattern)
54
+ const client = usePluginClient(MyPluginApi);
55
+ const { data: items, isLoading } = client.getItems.useQuery({});
56
+ ```
57
+
58
+ ### Bug Fixes
59
+
60
+ - Fixed `rpc.test.ts` test setup for middleware type inference
61
+ - Fixed `SearchDialog` to use `setQuery` instead of deprecated `search` method
62
+ - Fixed null→undefined warnings in notification and queue frontends
63
+
64
+ - Updated dependencies [7a23261]
65
+ - @checkstack/common@0.3.0
66
+ - @checkstack/backend-api@0.3.2
67
+ - @checkstack/catalog-common@1.2.0
68
+ - @checkstack/maintenance-common@0.3.0
69
+ - @checkstack/notification-common@0.2.0
70
+ - @checkstack/integration-common@0.2.0
71
+ - @checkstack/integration-backend@0.1.2
72
+ - @checkstack/command-backend@0.1.2
73
+ - @checkstack/signal-common@0.1.1
74
+
3
75
  ## 0.2.1
4
76
 
5
77
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/maintenance-backend",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/router.ts CHANGED
@@ -84,6 +84,26 @@ export function createRouter(
84
84
  }
85
85
  ),
86
86
 
87
+ getBulkMaintenancesForSystems: os.getBulkMaintenancesForSystems.handler(
88
+ async ({ input }) => {
89
+ const maintenances: Record<
90
+ string,
91
+ Awaited<ReturnType<typeof service.getMaintenancesForSystem>>
92
+ > = {};
93
+
94
+ // Fetch maintenances for each system in parallel
95
+ await Promise.all(
96
+ input.systemIds.map(async (systemId) => {
97
+ maintenances[systemId] = await service.getMaintenancesForSystem(
98
+ systemId
99
+ );
100
+ })
101
+ );
102
+
103
+ return { maintenances };
104
+ }
105
+ ),
106
+
87
107
  createMaintenance: os.createMaintenance.handler(
88
108
  async ({ input, context }) => {
89
109
  const result = await service.createMaintenance(input);