@orpc/vue-query 0.0.0-next.e565b64 → 0.0.0-next.e710b76

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 CHANGED
@@ -30,7 +30,7 @@
30
30
  - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
31
31
  - **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
32
32
  - **📝 Contract-First Development**: Optionally define your API contract before implementation.
33
- - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
33
+ - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
34
34
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
35
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
36
36
  - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
@@ -49,21 +49,19 @@ You can find the full documentation [here](https://orpc.unnoq.com).
49
49
  - [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
50
50
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
51
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
52
- - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with NestJS.
52
+ - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
53
+ - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
53
54
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
54
- - [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
55
- - [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
56
- - [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
57
- - [@orpc/svelte-query](https://www.npmjs.com/package/@orpc/svelte-query): Integration with [Svelte Query](https://tanstack.com/query/latest/docs/framework/svelte/overview).
55
+ - [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration.
58
56
  - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
59
- - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
57
+ - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
60
58
  - [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
61
59
  - [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/).
62
60
  - [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): OpenAPI spec generation from [ArkType](https://arktype.io/).
63
61
 
64
62
  ## `@orpc/vue-query`
65
63
 
66
- Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview). Read the [documentation](https://orpc.unnoq.com/docs/tanstack-query/vue) for more information.
64
+ Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview). Read the [documentation](https://orpc.unnoq.com/docs/integrations/tanstack-query-old/vue) for more information.
67
65
 
68
66
  ```ts
69
67
  export function Setup() {
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
2
- import { OperationType, BuildKeyOptions } from '@orpc/tanstack-query';
3
- export { BuildKeyOptions, OperationType as KeyType, buildKey } from '@orpc/tanstack-query';
2
+ import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
3
+ export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
4
4
  import { QueryKey, SkipToken, QueryObserverOptions, QueryFunctionContext, experimental_streamedQuery, InfiniteQueryObserverOptions, MutationObserverOptions, InfiniteData } from '@tanstack/vue-query';
5
5
  import { AnyFunction, MaybeOptionalOptions } from '@orpc/shared';
6
6
  import { MaybeRef, MaybeRefOrGetter, ComputedRef, Ref } from 'vue';
@@ -9,9 +9,9 @@ interface GeneralUtils<TInput> {
9
9
  /**
10
10
  * Generate a query/mutation key for checking status, invalidate, set, get, etc.
11
11
  *
12
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
12
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
13
13
  */
14
- key<UType extends OperationType>(options?: BuildKeyOptions<UType, TInput>): QueryKey;
14
+ key<UType extends OperationType>(options?: OperationKeyOptions<UType, TInput>): QueryKey;
15
15
  }
16
16
  declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
17
17
 
@@ -41,11 +41,14 @@ interface QueryOptionsBase<TOutput, TError> {
41
41
  queryKey: ComputedRef<QueryKey>;
42
42
  queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
43
43
  throwOnError?(error: TError): boolean;
44
+ retryDelay?: (count: number, error: TError) => number;
44
45
  enabled: ComputedRef<boolean>;
45
46
  }
46
47
  type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
47
48
  type experimental_InferStreamedOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
48
- type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & experimental_StreamedQueryOptions;
49
+ type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & {
50
+ queryFnOptions?: experimental_StreamedQueryOptions;
51
+ };
49
52
  interface experimental_StreamedOptionsBase<TOutput, TError> extends QueryOptionsBase<TOutput, TError> {
50
53
  }
51
54
  type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = (Record<never, never> extends TClientContext ? {
@@ -53,17 +56,18 @@ type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
53
56
  } : {
54
57
  context: MaybeRefDeep<TClientContext>;
55
58
  }) & {
56
- [Property in keyof Omit<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey' | 'enabled'>]: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>[Property]>;
59
+ [Property in keyof Omit<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey' | 'enabled'>]: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>[Property]>;
57
60
  } & {
58
61
  input: MaybeRef<((pageParam: TPageParam) => MaybeRefDeep<TInput>) | SkipToken>;
59
- enabled?: MaybeRefOrGetter<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>['enabled']>;
60
- queryKey?: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>['queryKey']>;
62
+ enabled?: MaybeRefOrGetter<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>['enabled']>;
63
+ queryKey?: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>['queryKey']>;
61
64
  shallow?: boolean;
62
65
  };
63
66
  interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
64
67
  queryKey: ComputedRef<QueryKey>;
65
68
  queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
66
69
  throwOnError?(error: TError): boolean;
70
+ retryDelay?: (count: number, error: TError) => number;
67
71
  enabled: ComputedRef<boolean>;
68
72
  }
69
73
  type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
@@ -81,32 +85,32 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
81
85
  /**
82
86
  * Calling corresponding procedure client
83
87
  *
84
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
88
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
85
89
  */
86
90
  call: Client<TClientContext, TInput, TOutput, TError>;
87
91
  /**
88
92
  * Generate options used for useQuery/prefetchQuery/...
89
93
  *
90
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
94
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
91
95
  */
92
96
  queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
93
97
  /**
94
98
  * Generate [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) options used for useQuery/prefetchQuery/...
95
99
  * Built on top of [steamedQuery](https://tanstack.com/query/latest/docs/reference/streamedQuery)
96
100
  *
97
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
101
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
98
102
  */
99
103
  experimental_streamedOptions<U, USelectData = experimental_InferStreamedOutput<TOutput>>(...rest: MaybeOptionalOptions<U & experimental_StreamedOptionsIn<TClientContext, TInput, experimental_InferStreamedOutput<TOutput>, TError, USelectData>>): NoInfer<U & Omit<experimental_StreamedOptionsBase<experimental_InferStreamedOutput<TOutput>, TError>, keyof U>>;
100
104
  /**
101
105
  * Generate options used for useInfiniteQuery/prefetchInfiniteQuery/...
102
106
  *
103
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
107
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
104
108
  */
105
109
  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>>;
106
110
  /**
107
111
  * Generate options used for useMutation/...
108
112
  *
109
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
113
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#mutation-options Tanstack Mutation Options Docs}
110
114
  */
111
115
  mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
112
116
  }
@@ -125,7 +129,7 @@ interface CreateRouterUtilsOptions {
125
129
  * Create a router utils from a client.
126
130
  *
127
131
  * @info Both client-side and server-side clients are supported.
128
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/vue Tanstack Query Vue Docs}
132
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/vue Tanstack Query Vue Docs}
129
133
  */
130
134
  declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
131
135
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
2
- import { OperationType, BuildKeyOptions } from '@orpc/tanstack-query';
3
- export { BuildKeyOptions, OperationType as KeyType, buildKey } from '@orpc/tanstack-query';
2
+ import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
3
+ export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
4
4
  import { QueryKey, SkipToken, QueryObserverOptions, QueryFunctionContext, experimental_streamedQuery, InfiniteQueryObserverOptions, MutationObserverOptions, InfiniteData } from '@tanstack/vue-query';
5
5
  import { AnyFunction, MaybeOptionalOptions } from '@orpc/shared';
6
6
  import { MaybeRef, MaybeRefOrGetter, ComputedRef, Ref } from 'vue';
@@ -9,9 +9,9 @@ interface GeneralUtils<TInput> {
9
9
  /**
10
10
  * Generate a query/mutation key for checking status, invalidate, set, get, etc.
11
11
  *
12
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
12
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
13
13
  */
14
- key<UType extends OperationType>(options?: BuildKeyOptions<UType, TInput>): QueryKey;
14
+ key<UType extends OperationType>(options?: OperationKeyOptions<UType, TInput>): QueryKey;
15
15
  }
16
16
  declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
17
17
 
@@ -41,11 +41,14 @@ interface QueryOptionsBase<TOutput, TError> {
41
41
  queryKey: ComputedRef<QueryKey>;
42
42
  queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
43
43
  throwOnError?(error: TError): boolean;
44
+ retryDelay?: (count: number, error: TError) => number;
44
45
  enabled: ComputedRef<boolean>;
45
46
  }
46
47
  type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
47
48
  type experimental_InferStreamedOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
48
- type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & experimental_StreamedQueryOptions;
49
+ type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & {
50
+ queryFnOptions?: experimental_StreamedQueryOptions;
51
+ };
49
52
  interface experimental_StreamedOptionsBase<TOutput, TError> extends QueryOptionsBase<TOutput, TError> {
50
53
  }
51
54
  type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = (Record<never, never> extends TClientContext ? {
@@ -53,17 +56,18 @@ type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
53
56
  } : {
54
57
  context: MaybeRefDeep<TClientContext>;
55
58
  }) & {
56
- [Property in keyof Omit<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey' | 'enabled'>]: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>[Property]>;
59
+ [Property in keyof Omit<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey' | 'enabled'>]: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>[Property]>;
57
60
  } & {
58
61
  input: MaybeRef<((pageParam: TPageParam) => MaybeRefDeep<TInput>) | SkipToken>;
59
- enabled?: MaybeRefOrGetter<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>['enabled']>;
60
- queryKey?: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>['queryKey']>;
62
+ enabled?: MaybeRefOrGetter<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>['enabled']>;
63
+ queryKey?: MaybeRefDeep<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>['queryKey']>;
61
64
  shallow?: boolean;
62
65
  };
63
66
  interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
64
67
  queryKey: ComputedRef<QueryKey>;
65
68
  queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
66
69
  throwOnError?(error: TError): boolean;
70
+ retryDelay?: (count: number, error: TError) => number;
67
71
  enabled: ComputedRef<boolean>;
68
72
  }
69
73
  type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
@@ -81,32 +85,32 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
81
85
  /**
82
86
  * Calling corresponding procedure client
83
87
  *
84
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
88
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
85
89
  */
86
90
  call: Client<TClientContext, TInput, TOutput, TError>;
87
91
  /**
88
92
  * Generate options used for useQuery/prefetchQuery/...
89
93
  *
90
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
94
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
91
95
  */
92
96
  queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
93
97
  /**
94
98
  * Generate [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) options used for useQuery/prefetchQuery/...
95
99
  * Built on top of [steamedQuery](https://tanstack.com/query/latest/docs/reference/streamedQuery)
96
100
  *
97
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
101
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
98
102
  */
99
103
  experimental_streamedOptions<U, USelectData = experimental_InferStreamedOutput<TOutput>>(...rest: MaybeOptionalOptions<U & experimental_StreamedOptionsIn<TClientContext, TInput, experimental_InferStreamedOutput<TOutput>, TError, USelectData>>): NoInfer<U & Omit<experimental_StreamedOptionsBase<experimental_InferStreamedOutput<TOutput>, TError>, keyof U>>;
100
104
  /**
101
105
  * Generate options used for useInfiniteQuery/prefetchInfiniteQuery/...
102
106
  *
103
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
107
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
104
108
  */
105
109
  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>>;
106
110
  /**
107
111
  * Generate options used for useMutation/...
108
112
  *
109
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
113
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#mutation-options Tanstack Mutation Options Docs}
110
114
  */
111
115
  mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
112
116
  }
@@ -125,7 +129,7 @@ interface CreateRouterUtilsOptions {
125
129
  * Create a router utils from a client.
126
130
  *
127
131
  * @info Both client-side and server-side clients are supported.
128
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/vue Tanstack Query Vue Docs}
132
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/vue Tanstack Query Vue Docs}
129
133
  */
130
134
  declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
131
135
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { buildKey } from '@orpc/tanstack-query';
2
- export { buildKey } from '@orpc/tanstack-query';
1
+ import { generateOperationKey } from '@orpc/tanstack-query';
2
+ export { generateOperationKey as buildKey } from '@orpc/tanstack-query';
3
3
  import { isObject, isAsyncIteratorObject } from '@orpc/shared';
4
4
  import { skipToken, experimental_streamedQuery } from '@tanstack/vue-query';
5
5
  import { isRef, computed } from 'vue';
@@ -7,7 +7,7 @@ import { isRef, computed } from 'vue';
7
7
  function createGeneralUtils(path) {
8
8
  return {
9
9
  key(options) {
10
- return buildKey(path, options);
10
+ return generateOperationKey(path, options);
11
11
  }
12
12
  };
13
13
  }
@@ -33,7 +33,7 @@ function createProcedureUtils(client, options) {
33
33
  call: client,
34
34
  queryOptions(...[optionsIn = {}]) {
35
35
  return {
36
- queryKey: computed(() => buildKey(options.path, { type: "query", input: unrefDeep(optionsIn.input) })),
36
+ queryKey: computed(() => generateOperationKey(options.path, { type: "query", input: unrefDeep(optionsIn.input) })),
37
37
  queryFn: ({ signal }) => {
38
38
  const input = unrefDeep(optionsIn.input);
39
39
  if (input === skipToken) {
@@ -48,9 +48,8 @@ function createProcedureUtils(client, options) {
48
48
  experimental_streamedOptions(...[optionsIn = {}]) {
49
49
  return {
50
50
  enabled: computed(() => unrefDeep(optionsIn.input) !== skipToken),
51
- queryKey: computed(() => buildKey(options.path, { type: "streamed", input: unrefDeep(optionsIn.input) })),
51
+ queryKey: computed(() => generateOperationKey(options.path, { type: "streamed", input: unrefDeep(optionsIn.input), fnOptions: optionsIn.queryFnOptions })),
52
52
  queryFn: experimental_streamedQuery({
53
- ...optionsIn,
54
53
  queryFn: async ({ signal }) => {
55
54
  const input = unrefDeep(optionsIn.input);
56
55
  if (input === skipToken) {
@@ -61,7 +60,8 @@ function createProcedureUtils(client, options) {
61
60
  throw new Error("streamedQuery requires an event iterator output");
62
61
  }
63
62
  return output;
64
- }
63
+ },
64
+ ...optionsIn.queryFnOptions
65
65
  }),
66
66
  ...optionsIn
67
67
  };
@@ -70,7 +70,7 @@ function createProcedureUtils(client, options) {
70
70
  return {
71
71
  queryKey: computed(() => {
72
72
  const input = unrefDeep(optionsIn.input);
73
- return buildKey(options.path, {
73
+ return generateOperationKey(options.path, {
74
74
  type: "infinite",
75
75
  input: input === skipToken ? skipToken : unrefDeep(input(unrefDeep(optionsIn.initialPageParam)))
76
76
  });
@@ -88,7 +88,7 @@ function createProcedureUtils(client, options) {
88
88
  },
89
89
  mutationOptions(...[optionsIn = {}]) {
90
90
  return {
91
- mutationKey: buildKey(options.path, { type: "mutation" }),
91
+ mutationKey: generateOperationKey(options.path, { type: "mutation" }),
92
92
  mutationFn: (input) => client(input, { context: unrefDeep(optionsIn.context) }),
93
93
  ...optionsIn
94
94
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/vue-query",
3
3
  "type": "module",
4
- "version": "0.0.0-next.e565b64",
4
+ "version": "0.0.0-next.e710b76",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -27,16 +27,16 @@
27
27
  "dist"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@tanstack/vue-query": ">=5.55.0",
30
+ "@tanstack/vue-query": ">=5.80.2",
31
31
  "vue": ">=3.3.0",
32
- "@orpc/client": "0.0.0-next.e565b64"
32
+ "@orpc/client": "0.0.0-next.e710b76"
33
33
  },
34
34
  "dependencies": {
35
- "@orpc/shared": "0.0.0-next.e565b64",
36
- "@orpc/tanstack-query": "0.0.0-next.e565b64"
35
+ "@orpc/shared": "0.0.0-next.e710b76",
36
+ "@orpc/tanstack-query": "0.0.0-next.e710b76"
37
37
  },
38
38
  "devDependencies": {
39
- "@tanstack/vue-query": "^5.77.2"
39
+ "@tanstack/vue-query": "^5.81.5"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",