@orpc/vue-query 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ export type QueryOptions<TInput, TOutput, TSelectData> = (undefined extends TInp
13
13
  } : {
14
14
  input: MaybeDeepRef<TInput>;
15
15
  }) & SetOptional<{
16
- [P in keyof QueryObserverOptions<TOutput, DefaultError, TSelectData, TOutput, QueryKey>]: P extends 'enabled' ? MaybeRefOrGetter<MaybeDeepRef<QueryObserverOptions<TOutput, DefaultError, TSelectData, TOutput, QueryKey>[P]>> : MaybeDeepRef<QueryObserverOptions<TOutput, DefaultError, TSelectData, TOutput, QueryKey>[P]>;
16
+ [P in keyof QueryObserverOptions<TOutput, DefaultError, TSelectData, TOutput, QueryKey>]: P extends 'enabled' ? MaybeRefOrGetter<QueryObserverOptions<TOutput, DefaultError, TSelectData, TOutput, QueryKey>[P]> : MaybeDeepRef<QueryObserverOptions<TOutput, DefaultError, TSelectData, TOutput, QueryKey>[P]>;
17
17
  }, 'queryKey'> & {
18
18
  shallow?: MaybeRef<boolean>;
19
19
  initialData?: NonUndefinedGuard<TOutput> | (() => NonUndefinedGuard<TOutput>) | undefined;
@@ -1,4 +1,4 @@
1
- import type { Caller } from '@orpc/server';
1
+ import type { ProcedureClient } from '@orpc/server';
2
2
  import type { IsEqual } from '@orpc/shared';
3
3
  import type { QueryKey } from '@tanstack/vue-query';
4
4
  import type { ComputedRef } from 'vue';
@@ -27,5 +27,5 @@ export interface ProcedureUtils<TInput, TOutput> {
27
27
  mutationFn: (input: TInput) => Promise<TOutput>;
28
28
  }, keyof U> & U;
29
29
  }
30
- export declare function createProcedureUtils<TInput, TOutput>(client: Caller<TInput, TOutput>, path: string[]): ProcedureUtils<TInput, TOutput>;
30
+ export declare function createProcedureUtils<TInput, TOutput>(client: ProcedureClient<TInput, TOutput>, path: string[]): ProcedureUtils<TInput, TOutput>;
31
31
  //# sourceMappingURL=utils-procedure.d.ts.map
@@ -1,14 +1,12 @@
1
- import type { RouterClient } from '@orpc/client';
2
- import type { ContractProcedure, ContractRouter, SchemaInput, SchemaOutput } from '@orpc/contract';
3
- import type { Lazy, Procedure, Router } from '@orpc/server';
1
+ import type { ProcedureClient, RouterClient } from '@orpc/server';
4
2
  import { type GeneralUtils } from './utils-general';
5
3
  import { type ProcedureUtils } from './utils-procedure';
6
- export type RouterUtils<T extends Router<any> | ContractRouter> = {
7
- [K in keyof T]: T[K] extends ContractProcedure<infer UInputSchema, infer UOutputSchema> | Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> | Lazy<Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput>> ? ProcedureUtils<SchemaInput<UInputSchema>, SchemaOutput<UOutputSchema, UFuncOutput>> & GeneralUtils<SchemaInput<UInputSchema>> : T[K] extends Router<any> | ContractRouter ? RouterUtils<T[K]> : never;
4
+ export type RouterUtils<T extends RouterClient<any>> = T extends ProcedureClient<infer TInput, infer TOutput> ? ProcedureUtils<TInput, TOutput> & GeneralUtils<TInput> : {
5
+ [K in keyof T]: T[K] extends RouterClient<any> ? RouterUtils<T[K]> : never;
8
6
  } & GeneralUtils<unknown>;
9
7
  /**
10
8
  * @param client - The client create form `@orpc/client`
11
9
  * @param path - The base path for query key
12
10
  */
13
- export declare function createRouterUtils<T extends Router<any> | ContractRouter>(client: RouterClient<T>, path?: string[]): RouterUtils<T>;
11
+ export declare function createRouterUtils<T extends RouterClient<any>>(client: T, path?: string[]): RouterUtils<T>;
14
12
  //# sourceMappingURL=utils-router.d.ts.map
@@ -1,3 +1,7 @@
1
- import type { MaybeDeepRef } from './types';
2
- export declare function deepUnref<T>(value: MaybeDeepRef<T>): T;
1
+ import type { AnyFunction } from '@orpc/shared';
2
+ import type { Ref } from 'vue';
3
+ export type DeepUnref<T> = T extends Ref<infer U> ? DeepUnref<U> : T extends AnyFunction ? T : T extends object ? {
4
+ [K in keyof T]: DeepUnref<T[K]>;
5
+ } : T;
6
+ export declare function deepUnref<T>(value: T): DeepUnref<T>;
3
7
  //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/vue-query",
3
3
  "type": "module",
4
- "version": "0.15.0",
4
+ "version": "0.17.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -34,9 +34,9 @@
34
34
  "peerDependencies": {
35
35
  "@tanstack/vue-query": ">=5.50.0",
36
36
  "vue": ">=3.3.0",
37
- "@orpc/client": "0.15.0",
38
- "@orpc/contract": "0.15.0",
39
- "@orpc/server": "0.15.0"
37
+ "@orpc/client": "0.17.0",
38
+ "@orpc/server": "0.17.0",
39
+ "@orpc/contract": "0.17.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",