@orpc/react-query 0.0.0-next.93e6063 → 0.0.0-next.954e6e2
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/dist/index.d.mts +4 -8
- package/dist/index.d.ts +4 -8
- package/dist/index.mjs +11 -11
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -47,18 +47,14 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
|
47
47
|
context?: TClientContext;
|
|
48
48
|
} : {
|
|
49
49
|
context: TClientContext;
|
|
50
|
-
}) &
|
|
51
|
-
|
|
52
|
-
mutationKey: QueryKey;
|
|
53
|
-
mutationFn(input: TInput): Promise<TOutput>;
|
|
54
|
-
retry?(failureCount: number, error: TError): boolean;
|
|
55
|
-
}
|
|
50
|
+
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
|
51
|
+
type MutationOptions<TInput, TOutput, TError extends Error, TMutationContext> = UseMutationOptions<TOutput, TError, TInput, TMutationContext>;
|
|
56
52
|
|
|
57
53
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
|
58
54
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
59
55
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
60
56
|
infiniteOptions<U, UPageParam, USelectData = InfiniteData<TOutput, UPageParam>>(options: U & InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, USelectData, UPageParam>): NoInfer<U & Omit<InfiniteOptionsBase<TOutput, TError, UPageParam>, keyof U>>;
|
|
61
|
-
mutationOptions<
|
|
57
|
+
mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
|
62
58
|
}
|
|
63
59
|
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, path: string[]): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
|
64
60
|
|
|
@@ -73,4 +69,4 @@ declare function createRouterUtils<T extends NestedClient<any>>(client: T, path?
|
|
|
73
69
|
|
|
74
70
|
declare const createORPCReactQueryUtils: typeof createRouterUtils;
|
|
75
71
|
|
|
76
|
-
export { type BuildKeyOptions, type GeneralUtils, type InfiniteOptionsBase, type InfiniteOptionsIn, type KeyType, type
|
|
72
|
+
export { type BuildKeyOptions, type GeneralUtils, type InfiniteOptionsBase, type InfiniteOptionsIn, type KeyType, type MutationOptions, type MutationOptionsIn, type ProcedureUtils, type QueryOptionsBase, type QueryOptionsIn, type RouterUtils, buildKey, createGeneralUtils, createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
|
package/dist/index.d.ts
CHANGED
|
@@ -47,18 +47,14 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
|
47
47
|
context?: TClientContext;
|
|
48
48
|
} : {
|
|
49
49
|
context: TClientContext;
|
|
50
|
-
}) &
|
|
51
|
-
|
|
52
|
-
mutationKey: QueryKey;
|
|
53
|
-
mutationFn(input: TInput): Promise<TOutput>;
|
|
54
|
-
retry?(failureCount: number, error: TError): boolean;
|
|
55
|
-
}
|
|
50
|
+
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
|
51
|
+
type MutationOptions<TInput, TOutput, TError extends Error, TMutationContext> = UseMutationOptions<TOutput, TError, TInput, TMutationContext>;
|
|
56
52
|
|
|
57
53
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
|
58
54
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
59
55
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
60
56
|
infiniteOptions<U, UPageParam, USelectData = InfiniteData<TOutput, UPageParam>>(options: U & InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, USelectData, UPageParam>): NoInfer<U & Omit<InfiniteOptionsBase<TOutput, TError, UPageParam>, keyof U>>;
|
|
61
|
-
mutationOptions<
|
|
57
|
+
mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
|
62
58
|
}
|
|
63
59
|
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, path: string[]): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
|
64
60
|
|
|
@@ -73,4 +69,4 @@ declare function createRouterUtils<T extends NestedClient<any>>(client: T, path?
|
|
|
73
69
|
|
|
74
70
|
declare const createORPCReactQueryUtils: typeof createRouterUtils;
|
|
75
71
|
|
|
76
|
-
export { type BuildKeyOptions, type GeneralUtils, type InfiniteOptionsBase, type InfiniteOptionsIn, type KeyType, type
|
|
72
|
+
export { type BuildKeyOptions, type GeneralUtils, type InfiniteOptionsBase, type InfiniteOptionsIn, type KeyType, type MutationOptions, type MutationOptionsIn, type ProcedureUtils, type QueryOptionsBase, type QueryOptionsIn, type RouterUtils, buildKey, createGeneralUtils, createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
|
package/dist/index.mjs
CHANGED
|
@@ -18,27 +18,27 @@ function createGeneralUtils(path) {
|
|
|
18
18
|
function createProcedureUtils(client, path) {
|
|
19
19
|
return {
|
|
20
20
|
call: client,
|
|
21
|
-
queryOptions(...[
|
|
21
|
+
queryOptions(...[options = {}]) {
|
|
22
22
|
return {
|
|
23
|
-
queryKey: buildKey(path, { type: "query", input }),
|
|
24
|
-
queryFn: ({ signal }) => client(input, { signal, context }),
|
|
25
|
-
...
|
|
23
|
+
queryKey: buildKey(path, { type: "query", input: options.input }),
|
|
24
|
+
queryFn: ({ signal }) => client(options.input, { signal, context: options.context }),
|
|
25
|
+
...options
|
|
26
26
|
};
|
|
27
27
|
},
|
|
28
|
-
infiniteOptions(
|
|
28
|
+
infiniteOptions(options) {
|
|
29
29
|
return {
|
|
30
|
-
queryKey: buildKey(path, { type: "infinite", input: input(
|
|
30
|
+
queryKey: buildKey(path, { type: "infinite", input: options.input(options.initialPageParam) }),
|
|
31
31
|
queryFn: ({ pageParam, signal }) => {
|
|
32
|
-
return client(input(pageParam), { signal, context });
|
|
32
|
+
return client(options.input(pageParam), { signal, context: options.context });
|
|
33
33
|
},
|
|
34
|
-
...
|
|
34
|
+
...options
|
|
35
35
|
};
|
|
36
36
|
},
|
|
37
|
-
mutationOptions(...[
|
|
37
|
+
mutationOptions(...[options = {}]) {
|
|
38
38
|
return {
|
|
39
39
|
mutationKey: buildKey(path, { type: "mutation" }),
|
|
40
|
-
mutationFn: (input) => client(input, { context }),
|
|
41
|
-
...
|
|
40
|
+
mutationFn: (input) => client(input, { context: options.context }),
|
|
41
|
+
...options
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/react-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.954e6e2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@tanstack/react-query": ">=5.59.0",
|
|
31
31
|
"react": ">=18.3.0",
|
|
32
|
-
"@orpc/client": "0.0.0-next.
|
|
32
|
+
"@orpc/client": "0.0.0-next.954e6e2"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@orpc/shared": "0.0.0-next.
|
|
35
|
+
"@orpc/shared": "0.0.0-next.954e6e2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"zod": "^3.24.1"
|