eden2query 0.2.0 → 0.3.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.
- package/README.md +47 -37
- package/dist/index.d.ts +20 -14
- package/dist/index.js +15 -13
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -10,69 +10,79 @@ bun add eden2query @elysiajs/eden @tanstack/react-query
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
import { treaty } from "@elysiajs/eden";
|
|
15
|
-
import { edenQueryOptions, edenMutationOptions } from "eden2query";
|
|
16
|
-
import type { App } from "./server"; // your Elysia app type
|
|
17
|
-
|
|
18
|
-
const client = treaty<App>("localhost:3000");
|
|
13
|
+
**Queries (GET)** — pass a thunk that calls the Treaty GET:
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
const
|
|
15
|
+
```ts
|
|
16
|
+
const getOptions = treatyQueryOptions(
|
|
22
17
|
() => client.api.resource.get({ query: { q: "hello" } }),
|
|
23
|
-
{ queryKey: ["resource"] },
|
|
18
|
+
{ queryKey: ["resource"], refetchInterval: 1000 },
|
|
24
19
|
);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Mutations with variables (POST, PUT, etc.)** — pass a function that receives the mutation input, or a bound Treaty method:
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
```ts
|
|
25
|
+
// Wrapper when Treaty uses (body, options)
|
|
26
|
+
const postOptions = treatyMutationOptions(
|
|
27
|
+
(vars: { body: { name: string }; query: { q: string } }) =>
|
|
28
|
+
client.api.resource.post(vars.body, { query: vars.query }),
|
|
29
|
+
{ onSuccess: () => console.log("Success") },
|
|
30
|
+
);
|
|
28
31
|
|
|
29
32
|
// Parameterised routes — bind params first
|
|
30
|
-
const
|
|
31
|
-
client.api.resource({ id: "
|
|
33
|
+
const putOptions = treatyMutationOptions(
|
|
34
|
+
client.api.resource({ id: "dummy" }).put,
|
|
35
|
+
{ onSettled: () => console.log("Settled") },
|
|
36
|
+
);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Mutations without variables (e.g. DELETE with fixed params)** — pass a no-argument function; `mutate()` is then called with no args:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const deleteOptions = treatyMutationOptions(
|
|
43
|
+
() => client.api.resource({ id: "dummy" }).delete(),
|
|
44
|
+
{ onMutate: () => console.log("Mutate") },
|
|
32
45
|
);
|
|
33
46
|
```
|
|
34
47
|
|
|
35
|
-
|
|
48
|
+
Use with React Query as usual:
|
|
36
49
|
|
|
37
50
|
```tsx
|
|
38
|
-
const { data } = useQuery(
|
|
39
|
-
const mutation = useMutation(createResource);
|
|
51
|
+
const { data } = useQuery(getOptions);
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
const postMutation = useMutation(postOptions);
|
|
54
|
+
postMutation.mutate({ body: { name: "World" }, query: { q: "hello" } });
|
|
43
55
|
|
|
44
|
-
|
|
56
|
+
const putMutation = useMutation(putOptions);
|
|
57
|
+
putMutation.mutate({ name: "World" });
|
|
45
58
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
await queryClient.prefetchQuery(resourceQuery);
|
|
59
|
+
const deleteMutation = useMutation(deleteOptions);
|
|
60
|
+
deleteMutation.mutate(); // no arguments
|
|
49
61
|
```
|
|
50
62
|
|
|
51
|
-
|
|
63
|
+
Prefetch and other helpers work as usual:
|
|
52
64
|
|
|
53
65
|
```ts
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
{ queryKey: ["resource"], refetchInterval: 1000 },
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
const createResource = edenMutationOptions(
|
|
60
|
-
client.api.resource.post,
|
|
61
|
-
{ onSuccess: () => console.log("created!") },
|
|
62
|
-
);
|
|
66
|
+
const queryClient = new QueryClient();
|
|
67
|
+
queryClient.prefetchQuery(getOptions);
|
|
63
68
|
```
|
|
64
69
|
|
|
65
70
|
## API
|
|
66
71
|
|
|
67
|
-
**`
|
|
72
|
+
**`treatyQueryOptions(fn, queryOptions)`** — wraps a Treaty GET call into `queryOptions`. `fn` is a **thunk** (zero-argument function) that calls the Treaty GET, e.g. `() => client.api.resource.get({ query: { ... } })`. The second argument accepts all `queryOptions` fields except `queryFn`. Extracts `data` from the response and throws on `error`.
|
|
73
|
+
|
|
74
|
+
**`treatyMutationOptions(fn, mutationOptions?)`** — wraps a Treaty mutation into `mutationOptions`. Two shapes:
|
|
75
|
+
|
|
76
|
+
- **No-arg:** `fn` is `() => Promise<...>`. Use when the mutation has no call-time input (e.g. DELETE with fixed path params). `mutate()` is called with no arguments.
|
|
77
|
+
- **With variables:** `fn` is `(vars) => Promise<...>`. Use for POST/PUT etc. `mutate(vars)` receives a single object (e.g. `{ body, query }` or the Treaty method’s first argument). You can pass the Treaty method directly when its signature matches (e.g. `client.api.resource({ id }).put`).
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
The optional second argument accepts all `mutationOptions` fields except `mutationFn` (e.g. `onSuccess`, `onSettled`, `onMutate`).
|
|
70
80
|
|
|
71
|
-
**`
|
|
81
|
+
**`InferTreatyQueryOptions<T>`** — full `UseQueryOptions` type for a given Treaty query.
|
|
72
82
|
|
|
73
|
-
**`
|
|
83
|
+
**`InferTreatyMutationOptions<TVariables, TResponse>`** — full `UseMutationOptions` type for a given Treaty mutation.
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
Data, error, and input types are inferred end-to-end from your Elysia route definitions.
|
|
76
86
|
|
|
77
87
|
## License
|
|
78
88
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { Treaty } from "@elysiajs/eden";
|
|
2
2
|
import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
type TreatyResponse = Record<number, unknown>;
|
|
4
|
+
type TreatyFunctionWithoutParams<TResponse extends TreatyResponse = TreatyResponse> = () => Promise<Treaty.TreatyResponse<TResponse>>;
|
|
5
|
+
type TreatyFunctionWithParams<
|
|
6
|
+
TParams,
|
|
7
|
+
TResponse extends TreatyResponse
|
|
8
|
+
> = (params: TParams) => Promise<Treaty.TreatyResponse<TResponse>>;
|
|
9
|
+
type InferTreatyData<TResponse extends TreatyResponse> = Treaty.TreatyResponse<TResponse>["data"];
|
|
10
|
+
type InferTreatyError<TResponse extends TreatyResponse> = Treaty.TreatyResponse<TResponse>["error"];
|
|
11
|
+
type InferTreatyMutationOptions<
|
|
12
|
+
TInput,
|
|
13
|
+
TResponse extends TreatyResponse
|
|
14
|
+
> = UseMutationOptions<InferTreatyData<TResponse>, InferTreatyError<TResponse>, TInput>;
|
|
15
|
+
type InferTreatyQueryOptions<TResponse extends Record<number, unknown>> = UseQueryOptions<InferTreatyData<TResponse>, InferTreatyError<TResponse>>;
|
|
16
|
+
declare function treatyMutationOptions<TResponse extends TreatyResponse>(fn: TreatyFunctionWithoutParams<TResponse>, options?: Omit<InferTreatyMutationOptions<void, TResponse>, "mutationFn">): InferTreatyMutationOptions<void, TResponse>;
|
|
17
|
+
declare function treatyMutationOptions<
|
|
18
|
+
TVariables,
|
|
19
|
+
TResponse extends TreatyResponse
|
|
20
|
+
>(fn: TreatyFunctionWithParams<TVariables, TResponse>, options?: Omit<InferTreatyMutationOptions<TVariables, TResponse>, "mutationFn">): InferTreatyMutationOptions<TVariables, TResponse>;
|
|
21
|
+
declare function treatyQueryOptions<TResponse extends TreatyResponse = TreatyResponse>(fn: TreatyFunctionWithoutParams<TResponse>, options: Omit<InferTreatyQueryOptions<TResponse>, "queryFn">): InferTreatyQueryOptions<TResponse>;
|
|
22
|
+
export { treatyQueryOptions, treatyMutationOptions, TreatyFunctionWithoutParams as TreatyQueryFunction, TreatyFunctionWithParams as TreatyMutationFunction, InferTreatyQueryOptions, InferTreatyMutationOptions, InferTreatyError, InferTreatyData };
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
// src/lib.ts
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
mutationOptions,
|
|
4
|
+
queryOptions
|
|
5
|
+
} from "@tanstack/react-query";
|
|
6
|
+
function treatyMutationOptions(fn, options) {
|
|
4
7
|
return mutationOptions({
|
|
8
|
+
...options,
|
|
5
9
|
mutationFn: async (variables) => {
|
|
6
|
-
const
|
|
7
|
-
const response = await fn(body, rest);
|
|
10
|
+
const response = await (fn.length === 0 ? fn() : fn(variables));
|
|
8
11
|
const { data, error } = response;
|
|
9
12
|
if (error)
|
|
10
13
|
throw error;
|
|
11
14
|
return data;
|
|
12
|
-
}
|
|
13
|
-
...options
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
}
|
|
16
|
-
function
|
|
18
|
+
function treatyQueryOptions(fn, options) {
|
|
17
19
|
return queryOptions({
|
|
20
|
+
...options,
|
|
18
21
|
queryFn: async () => {
|
|
19
22
|
const response = await fn();
|
|
20
23
|
const { data, error } = response;
|
|
21
24
|
if (error)
|
|
22
25
|
throw error;
|
|
23
26
|
return data;
|
|
24
|
-
}
|
|
25
|
-
...options
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
treatyQueryOptions,
|
|
32
|
+
treatyMutationOptions
|
|
31
33
|
};
|
|
32
34
|
|
|
33
|
-
//# debugId=
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# debugId=668F4CB9D073178564756E2164756E21
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjXFxsaWIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOi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9uc2U7XHJcbiAgICAgIGlmIChlcnJvcikgdGhyb3cgZXJyb3I7XHJcbiAgICAgIHJldHVybiBkYXRhO1xyXG4gICAgfSxcclxuICB9KTtcclxufSIKICBdLAogICJtYXBwaW5ncyI6ICI7QUFDQTtBQUFBO0FBQUE7QUFBQTtBQStDTyxTQUFTLHFCQUdmLENBQ0MsSUFHQSxTQUNtRDtBQUFBLEVBR25ELE9BQU8sZ0JBQTJDO0FBQUEsT0FDN0M7QUFBQSxJQUNILFlBQVksT0FBTyxjQUFjO0FBQUEsTUFDL0IsTUFBTSxXQUFXLE9BQ2YsR0FBRyxXQUFXLElBQUssR0FBdUQsSUFBSyxHQUF1RCxTQUFTO0FBQUEsTUFFakosUUFBUSxNQUFNLFVBQVU7QUFBQSxNQUN4QixJQUFJO0FBQUEsUUFBTyxNQUFNO0FBQUEsTUFDakIsT0FBTztBQUFBO0FBQUEsRUFFWCxDQUFDO0FBQUE7QUFHSSxTQUFTLGtCQUVmLENBQ0MsSUFDQSxTQUNvQztBQUFBLEVBR3BDLE9BQU8sYUFBNEI7QUFBQSxPQUM5QjtBQUFBLElBQ0gsU0FBUyxZQUFZO0FBQUEsTUFDbkIsTUFBTSxXQUFXLE1BQU0sR0FBRztBQUFBLE1BQzFCLFFBQVEsTUFBTSxVQUFVO0FBQUEsTUFDeEIsSUFBSTtBQUFBLFFBQU8sTUFBTTtBQUFBLE1BQ2pCLE9BQU87QUFBQTtBQUFBLEVBRVgsQ0FBQztBQUFBOyIsCiAgImRlYnVnSWQiOiAiNjY4RjRDQjlEMDczMTc4NTY0NzU2RTIxNjQ3NTZFMjEiLAogICJuYW1lcyI6IFtdCn0=
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eden2query",
|
|
3
3
|
"description": "Type-safe Eden Treaty to React Query helpers",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "bunup",
|
|
38
|
+
"format": "prettier --write .",
|
|
38
39
|
"prepublishOnly": "bun run build"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@types/bun": "latest",
|
|
47
48
|
"bunup": "^0.16.22",
|
|
48
|
-
"elysia": "^1.4.22"
|
|
49
|
+
"elysia": "^1.4.22",
|
|
50
|
+
"prettier": "^3.4.2"
|
|
49
51
|
}
|
|
50
52
|
}
|