@orpc/vue-query 1.0.0-beta.4 → 1.0.0-beta.5
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 +1 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/package.json +3 -3
package/README.md
CHANGED
@@ -53,6 +53,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
53
53
|
- [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
|
54
54
|
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
|
55
55
|
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
56
|
+
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
|
56
57
|
- [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
|
57
58
|
- [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
|
58
59
|
- [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
|
package/dist/index.d.mts
CHANGED
@@ -22,7 +22,7 @@ declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput
|
|
22
22
|
type MaybeRefDeep<T> = MaybeRef<T extends AnyFunction ? T : T extends object ? {
|
23
23
|
[Property in keyof T]: MaybeRefDeep<T[Property]>;
|
24
24
|
} : T>;
|
25
|
-
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
25
|
+
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = (undefined extends TInput ? {
|
26
26
|
input?: MaybeRefDeep<TInput>;
|
27
27
|
} : {
|
28
28
|
input: MaybeRefDeep<TInput>;
|
@@ -37,35 +37,35 @@ type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TErro
|
|
37
37
|
queryKey?: MaybeRefDeep<QueryObserverOptions<TOutput, TError, TSelectData, TOutput>['queryKey']>;
|
38
38
|
shallow?: MaybeRef<boolean>;
|
39
39
|
};
|
40
|
-
interface QueryOptionsBase<TOutput, TError
|
40
|
+
interface QueryOptionsBase<TOutput, TError> {
|
41
41
|
queryKey: ComputedRef<QueryKey>;
|
42
42
|
queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
|
43
43
|
retry?(failureCount: number, error: TError): boolean;
|
44
44
|
}
|
45
|
-
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
45
|
+
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
|
46
46
|
input: (pageParam: TPageParam) => MaybeRefDeep<TInput>;
|
47
47
|
} & (Record<never, never> extends TClientContext ? {
|
48
48
|
context?: MaybeRefDeep<TClientContext>;
|
49
49
|
} : {
|
50
50
|
context: MaybeRefDeep<TClientContext>;
|
51
51
|
}) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
|
52
|
-
interface InfiniteOptionsBase<TOutput, TError
|
52
|
+
interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
|
53
53
|
queryKey: ComputedRef<QueryKey>;
|
54
54
|
queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
|
55
55
|
retry?(failureCount: number, error: TError): boolean;
|
56
56
|
}
|
57
|
-
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
57
|
+
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
|
58
58
|
context?: TClientContext;
|
59
59
|
} : {
|
60
60
|
context: TClientContext;
|
61
61
|
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
62
|
-
type MutationOptions<TInput, TOutput, TError
|
62
|
+
type MutationOptions<TInput, TOutput, TError, TMutationContext> = {
|
63
63
|
[P in keyof MutationObserverOptions<TOutput, TError, TInput, TMutationContext>]: MaybeRefDeep<MutationObserverOptions<TOutput, TError, TInput, TMutationContext>[P]>;
|
64
64
|
} & {
|
65
65
|
shallow?: MaybeRef<boolean>;
|
66
66
|
};
|
67
67
|
|
68
|
-
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
68
|
+
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
69
69
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
70
70
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
71
71
|
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>>;
|
@@ -74,7 +74,7 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
|
|
74
74
|
interface CreateProcedureUtilsOptions {
|
75
75
|
path: string[];
|
76
76
|
}
|
77
|
-
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
77
|
+
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError>(client: Client<TClientContext, TInput, TOutput, TError>, options: CreateProcedureUtilsOptions): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
78
78
|
|
79
79
|
type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
80
80
|
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
package/dist/index.d.ts
CHANGED
@@ -22,7 +22,7 @@ declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput
|
|
22
22
|
type MaybeRefDeep<T> = MaybeRef<T extends AnyFunction ? T : T extends object ? {
|
23
23
|
[Property in keyof T]: MaybeRefDeep<T[Property]>;
|
24
24
|
} : T>;
|
25
|
-
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
25
|
+
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = (undefined extends TInput ? {
|
26
26
|
input?: MaybeRefDeep<TInput>;
|
27
27
|
} : {
|
28
28
|
input: MaybeRefDeep<TInput>;
|
@@ -37,35 +37,35 @@ type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TErro
|
|
37
37
|
queryKey?: MaybeRefDeep<QueryObserverOptions<TOutput, TError, TSelectData, TOutput>['queryKey']>;
|
38
38
|
shallow?: MaybeRef<boolean>;
|
39
39
|
};
|
40
|
-
interface QueryOptionsBase<TOutput, TError
|
40
|
+
interface QueryOptionsBase<TOutput, TError> {
|
41
41
|
queryKey: ComputedRef<QueryKey>;
|
42
42
|
queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
|
43
43
|
retry?(failureCount: number, error: TError): boolean;
|
44
44
|
}
|
45
|
-
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
45
|
+
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
|
46
46
|
input: (pageParam: TPageParam) => MaybeRefDeep<TInput>;
|
47
47
|
} & (Record<never, never> extends TClientContext ? {
|
48
48
|
context?: MaybeRefDeep<TClientContext>;
|
49
49
|
} : {
|
50
50
|
context: MaybeRefDeep<TClientContext>;
|
51
51
|
}) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
|
52
|
-
interface InfiniteOptionsBase<TOutput, TError
|
52
|
+
interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
|
53
53
|
queryKey: ComputedRef<QueryKey>;
|
54
54
|
queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
|
55
55
|
retry?(failureCount: number, error: TError): boolean;
|
56
56
|
}
|
57
|
-
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
57
|
+
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
|
58
58
|
context?: TClientContext;
|
59
59
|
} : {
|
60
60
|
context: TClientContext;
|
61
61
|
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
62
|
-
type MutationOptions<TInput, TOutput, TError
|
62
|
+
type MutationOptions<TInput, TOutput, TError, TMutationContext> = {
|
63
63
|
[P in keyof MutationObserverOptions<TOutput, TError, TInput, TMutationContext>]: MaybeRefDeep<MutationObserverOptions<TOutput, TError, TInput, TMutationContext>[P]>;
|
64
64
|
} & {
|
65
65
|
shallow?: MaybeRef<boolean>;
|
66
66
|
};
|
67
67
|
|
68
|
-
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
68
|
+
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
69
69
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
70
70
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
71
71
|
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>>;
|
@@ -74,7 +74,7 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
|
|
74
74
|
interface CreateProcedureUtilsOptions {
|
75
75
|
path: string[];
|
76
76
|
}
|
77
|
-
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
77
|
+
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError>(client: Client<TClientContext, TInput, TOutput, TError>, options: CreateProcedureUtilsOptions): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
78
78
|
|
79
79
|
type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
80
80
|
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/vue-query",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.0.0-beta.
|
4
|
+
"version": "1.0.0-beta.5",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -29,10 +29,10 @@
|
|
29
29
|
"peerDependencies": {
|
30
30
|
"@tanstack/vue-query": ">=5.50.0",
|
31
31
|
"vue": ">=3.3.0",
|
32
|
-
"@orpc/client": "1.0.0-beta.
|
32
|
+
"@orpc/client": "1.0.0-beta.5"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@orpc/shared": "1.0.0-beta.
|
35
|
+
"@orpc/shared": "1.0.0-beta.5"
|
36
36
|
},
|
37
37
|
"scripts": {
|
38
38
|
"build": "unbuild",
|