@beignet/react-query 0.0.23 → 0.0.25

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,19 @@
1
1
  # @beignet/react-query
2
2
 
3
+ ## 0.0.25
4
+
5
+ ### Patch Changes
6
+
7
+ - 7c83da7: Refresh package-shipped TanStack Intent skills to match current Beignet app structure, generators, route helpers, and React Query cache helpers.
8
+
9
+ ## 0.0.24
10
+
11
+ ### Patch Changes
12
+
13
+ - 91bc9b5: Harden framework security defaults for generated tenancy, auth secrets, CORS,
14
+ body limits, uploads, devtools, OpenAPI, rate-limit IP sources, public storage,
15
+ and Meilisearch query fields.
16
+
3
17
  ## 0.0.23
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -23,8 +23,9 @@ This package requires TypeScript 5.0 or higher for proper type inference.
23
23
 
24
24
  This package ships a TanStack Intent skill for coding agents:
25
25
  `@beignet/react-query#client`. Load it when adding typed client setup, React
26
- Query options, feature client helpers, hooks, cache invalidation, server
27
- prefetching, or client/server boundary fixes in a Beignet app.
26
+ Query options, infinite queries, feature client helpers, hooks, cache keys,
27
+ cache invalidation, server prefetching, idempotent mutations, or
28
+ client/server boundary fixes in a Beignet app.
28
29
 
29
30
  ## Setup
30
31
 
@@ -283,19 +284,19 @@ const rq = createReactQuery(apiClient);
283
284
 
284
285
  Headers are **excluded from generated query keys by default** because persisted
285
286
  caches would otherwise store credentials such as `Authorization` tokens. When a
286
- header changes response data — a tenant or workspace header, for example — opt
287
- that specific header into keys with `keyHeaders`:
287
+ non-secret request-shaping header changes response data, opt that specific
288
+ header into keys with `keyHeaders`:
288
289
 
289
290
  ```ts
290
291
  const rq = createReactQuery(apiClient, {
291
- keyHeaders: ["X-Tenant-Id"],
292
+ keyHeaders: ["X-Workspace-Preview"],
292
293
  });
293
294
 
294
295
  rq(listTodos).queryOptions({
295
- headers: { "X-Tenant-Id": "tenant-1", Authorization: "Bearer ..." },
296
+ headers: { "X-Workspace-Preview": "workspace-1", Authorization: "Bearer ..." },
296
297
  });
297
298
  // queryKey: ["beignet", "todos", "listTodos", "GET /todos",
298
- // { headers: { "x-tenant-id": "tenant-1" } }]
299
+ // { headers: { "x-workspace-preview": "workspace-1" } }]
299
300
  ```
300
301
 
301
302
  Only whitelisted header names are included. Names are matched
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beignet/react-query",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "description": "TanStack Query integration for Beignet",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: client
3
- description: "Build Beignet browser client and TanStack Query integration with @beignet/react-query: createClient, createReactQuery, queryOptions, mutationOptions, cache keys, feature client helpers, hooks, QueryClientProvider, server prefetching, and client/server boundary fixes. Use when adding or debugging React Query usage in a Beignet app."
3
+ description: "Build Beignet browser client and TanStack Query integration with @beignet/react-query: createClient, createReactQuery, queryOptions, mutationOptions, infiniteQueryOptions, cache keys and filters, feature client helpers, hooks, QueryClientProvider, server prefetching, idempotent mutations, and client/server boundary fixes. Use when adding or debugging React Query usage in a Beignet app."
4
4
  ---
5
5
 
6
6
  # Beignet React Query Client
@@ -98,10 +98,19 @@ Call server behavior through Beignet contracts and typed clients.
98
98
  - Use `queryOptions(...)` so options work with `useQuery`, `prefetchQuery`,
99
99
  `fetchQuery`, and server prefetching.
100
100
  - Use `mutationOptions(...)` with `useMutation`.
101
- - Use `rq(contract).invalidate(queryClient)` or the app's existing key helper
102
- after successful mutations.
101
+ - Use `infiniteQueryOptions(...)` with `useInfiniteQuery` for paginated
102
+ contracts. Prefer static `path`/`query` plus `page(...)`; if every page needs
103
+ fully dynamic params, pass a custom `key`.
104
+ - Use `rq(contract).key(...)`, `filter(...)`, `contractFilter(...)`, and
105
+ `namespaceFilter(...)` when the app needs explicit cache keys or invalidation
106
+ filters.
107
+ - Use `rq(contract).invalidate(queryClient, params?, options?)` or the app's
108
+ existing key helper after successful mutations.
103
109
  - If the app configures `createReactQuery(apiClient, { keyHeaders })`, preserve
104
110
  that when adding helpers so tenant or header-scoped caches stay distinct.
111
+ - Contracts with idempotency metadata get one generated idempotency key per
112
+ `mutate(...)` variables object, stable across TanStack retry attempts. Pass
113
+ `idempotencyKey` in mutation variables only when the app must control it.
105
114
  - Keep business validation in use cases. Client validation is for UX and early
106
115
  feedback.
107
116