@orpc/tanstack-query 0.0.0-next.dd4e882 → 0.0.0-next.de766b3
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 +4 -6
- package/dist/index.d.mts +13 -14
- package/dist/index.d.ts +13 -14
- package/dist/index.mjs +8 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -49,14 +49,12 @@ 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/
|
|
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/
|
|
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/
|
|
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/).
|
package/dist/index.d.mts
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import { OperationType as OperationType$1, OperationKeyOptions as OperationKeyOptions$1, OperationKey as OperationKey$1 } from '@orpc/tanstack-query';
|
|
2
1
|
import { ClientContext, Client, NestedClient } from '@orpc/client';
|
|
3
2
|
import { SetOptional, PartialDeep, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
3
|
import { SkipToken, QueryObserverOptions, QueryKey, QueryFunction, experimental_streamedQuery, InfiniteQueryObserverOptions, InfiniteData, MutationObserverOptions } from '@tanstack/query-core';
|
|
5
4
|
|
|
6
|
-
/**
|
|
7
|
-
* Utils at any level (procedure or router)
|
|
8
|
-
*/
|
|
9
|
-
interface GeneralUtils<TInput> {
|
|
10
|
-
/**
|
|
11
|
-
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
|
12
|
-
*
|
|
13
|
-
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
|
|
14
|
-
*/
|
|
15
|
-
key<TType extends OperationType$1>(options?: OperationKeyOptions$1<TType, TInput>): OperationKey$1<TType, TInput>;
|
|
16
|
-
}
|
|
17
|
-
declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
|
|
18
|
-
|
|
19
5
|
type experimental_StreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
|
|
20
6
|
type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
|
|
21
7
|
type OperationType = 'query' | 'streamed' | 'infinite' | 'mutation';
|
|
@@ -75,6 +61,19 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
|
75
61
|
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
|
76
62
|
type MutationOptions<TInput, TOutput, TError, TMutationContext> = MutationObserverOptions<TOutput, TError, TInput, TMutationContext>;
|
|
77
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Utils at any level (procedure or router)
|
|
66
|
+
*/
|
|
67
|
+
interface GeneralUtils<TInput> {
|
|
68
|
+
/**
|
|
69
|
+
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
|
|
72
|
+
*/
|
|
73
|
+
key<TType extends OperationType>(options?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
|
|
74
|
+
}
|
|
75
|
+
declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
|
|
76
|
+
|
|
78
77
|
declare function generateOperationKey<TType extends OperationType, TInput>(path: readonly string[], state?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
|
|
79
78
|
|
|
80
79
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import { OperationType as OperationType$1, OperationKeyOptions as OperationKeyOptions$1, OperationKey as OperationKey$1 } from '@orpc/tanstack-query';
|
|
2
1
|
import { ClientContext, Client, NestedClient } from '@orpc/client';
|
|
3
2
|
import { SetOptional, PartialDeep, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
3
|
import { SkipToken, QueryObserverOptions, QueryKey, QueryFunction, experimental_streamedQuery, InfiniteQueryObserverOptions, InfiniteData, MutationObserverOptions } from '@tanstack/query-core';
|
|
5
4
|
|
|
6
|
-
/**
|
|
7
|
-
* Utils at any level (procedure or router)
|
|
8
|
-
*/
|
|
9
|
-
interface GeneralUtils<TInput> {
|
|
10
|
-
/**
|
|
11
|
-
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
|
12
|
-
*
|
|
13
|
-
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
|
|
14
|
-
*/
|
|
15
|
-
key<TType extends OperationType$1>(options?: OperationKeyOptions$1<TType, TInput>): OperationKey$1<TType, TInput>;
|
|
16
|
-
}
|
|
17
|
-
declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
|
|
18
|
-
|
|
19
5
|
type experimental_StreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
|
|
20
6
|
type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
|
|
21
7
|
type OperationType = 'query' | 'streamed' | 'infinite' | 'mutation';
|
|
@@ -75,6 +61,19 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
|
75
61
|
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
|
76
62
|
type MutationOptions<TInput, TOutput, TError, TMutationContext> = MutationObserverOptions<TOutput, TError, TInput, TMutationContext>;
|
|
77
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Utils at any level (procedure or router)
|
|
66
|
+
*/
|
|
67
|
+
interface GeneralUtils<TInput> {
|
|
68
|
+
/**
|
|
69
|
+
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
|
|
72
|
+
*/
|
|
73
|
+
key<TType extends OperationType>(options?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
|
|
74
|
+
}
|
|
75
|
+
declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
|
|
76
|
+
|
|
78
77
|
declare function generateOperationKey<TType extends OperationType, TInput>(path: readonly string[], state?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
|
|
79
78
|
|
|
80
79
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { generateOperationKey as generateOperationKey$1 } from '@orpc/tanstack-query';
|
|
2
1
|
import { isAsyncIteratorObject, toArray } from '@orpc/shared';
|
|
3
2
|
import { skipToken, experimental_streamedQuery } from '@tanstack/query-core';
|
|
4
3
|
|
|
5
|
-
function createGeneralUtils(path) {
|
|
6
|
-
return {
|
|
7
|
-
key(options) {
|
|
8
|
-
return generateOperationKey$1(path, options);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
4
|
function generateOperationKey(path, state = {}) {
|
|
14
5
|
return [path, {
|
|
15
6
|
...state.input !== void 0 ? { input: state.input } : {},
|
|
@@ -18,6 +9,14 @@ function generateOperationKey(path, state = {}) {
|
|
|
18
9
|
}];
|
|
19
10
|
}
|
|
20
11
|
|
|
12
|
+
function createGeneralUtils(path) {
|
|
13
|
+
return {
|
|
14
|
+
key(options) {
|
|
15
|
+
return generateOperationKey(path, options);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
21
20
|
const OPERATION_CONTEXT_SYMBOL = Symbol("ORPC_OPERATION_CONTEXT");
|
|
22
21
|
|
|
23
22
|
function createProcedureUtils(client, options) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/tanstack-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.de766b3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@tanstack/query-core": ">=5.80.2",
|
|
28
|
-
"@orpc/client": "0.0.0-next.
|
|
28
|
+
"@orpc/client": "0.0.0-next.de766b3"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@orpc/shared": "0.0.0-next.
|
|
31
|
+
"@orpc/shared": "0.0.0-next.de766b3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@angular/core": "^20.0.0",
|