@orpc/tanstack-query 2.0.0-beta.43 → 2.0.0-beta.44
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 +2 -10
- package/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.mjs +7 -5
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" />
|
|
18
18
|
</a>
|
|
19
19
|
<a href="https://deepwiki.com/middleapi/orpc">
|
|
20
|
-
<img src="https://
|
|
20
|
+
<img alt="Ask DeepWiki" src="https://img.shields.io/badge/Ask-DeepWiki-blue" />
|
|
21
21
|
</a>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
@@ -95,14 +95,6 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
95
95
|
</tr>
|
|
96
96
|
</table>
|
|
97
97
|
|
|
98
|
-
### Special Sponsors
|
|
99
|
-
|
|
100
|
-
<table>
|
|
101
|
-
<tr>
|
|
102
|
-
<td align="center"><a href="http://twitter.com/rauchg?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Guillermo Rauch"><img src="https://avatars.githubusercontent.com/u/13041?u=1ee8d111657cdd02ff6d253df00978d17ee6d722&v=4" width="279" alt="Guillermo Rauch"/><br />Guillermo Rauch</a></td>
|
|
103
|
-
</tr>
|
|
104
|
-
</table>
|
|
105
|
-
|
|
106
98
|
### Premium Sponsors
|
|
107
99
|
|
|
108
100
|
<table>
|
|
@@ -178,7 +170,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
178
170
|
</tr>
|
|
179
171
|
</table>
|
|
180
172
|
|
|
181
|
-
With thanks to [
|
|
173
|
+
With thanks to [39 past sponsors](https://orpc.dev/sponsors#past-sponsors) who helped get oRPC here.
|
|
182
174
|
|
|
183
175
|
## References
|
|
184
176
|
|
package/dist/index.d.mts
CHANGED
|
@@ -126,7 +126,14 @@ type OperationKeyOptions<TType extends OperationType, TInput> = OperationKeyPref
|
|
|
126
126
|
input?: TType extends 'mutation' ? never : PartialDeep<TInput>;
|
|
127
127
|
fnOptions?: TType extends 'streamed' ? SerializableStreamedQueryOptions : never;
|
|
128
128
|
};
|
|
129
|
-
type
|
|
129
|
+
type OperationKeyContent<TType extends OperationType, TInput> = Omit<OperationKeyOptions<TType, TInput>, 'prefix'> & {
|
|
130
|
+
/**
|
|
131
|
+
* Set in place of `input` when the operation is disabled with `skipToken`,
|
|
132
|
+
* because query key hashers drop symbols.
|
|
133
|
+
*/
|
|
134
|
+
skipToken?: TType extends 'mutation' ? never : true;
|
|
135
|
+
};
|
|
136
|
+
type OperationKey<TType extends OperationType, TInput> = [path: string[], options: OperationKeyContent<TType, TInput>] | [prefix: string, path: string[], options: OperationKeyContent<TType, TInput>];
|
|
130
137
|
declare function generateOperationKey<TType extends OperationType, TInput>(path: string[], options?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
|
|
131
138
|
|
|
132
139
|
declare class SharedUtils<TInput> {
|
|
@@ -242,9 +249,9 @@ declare function isProcedureUtilsOptions(value: unknown): value is ProcedureUtil
|
|
|
242
249
|
/**
|
|
243
250
|
* Merge two procedure utils options where `override` takes priority.
|
|
244
251
|
* A key explicitly set to `undefined` in `override` resets the base value.
|
|
245
|
-
* When both sides define a key
|
|
246
|
-
* modifiers are
|
|
247
|
-
*
|
|
252
|
+
* When both sides define a key, interceptors are concatenated (base ones run first) and
|
|
253
|
+
* modifiers are combined so that, for object values, per-call options beat `override`,
|
|
254
|
+
* which beats `base`. A function modifier receives the merged options and its result wins.
|
|
248
255
|
*/
|
|
249
256
|
declare function mergeProcedureUtilsOptions<TClientContext extends ClientContext, TInput, TOutput, TError>(base: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>, override: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>): ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
|
|
250
257
|
declare class ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> extends SharedUtils<TInput> {
|
package/dist/index.d.ts
CHANGED
|
@@ -126,7 +126,14 @@ type OperationKeyOptions<TType extends OperationType, TInput> = OperationKeyPref
|
|
|
126
126
|
input?: TType extends 'mutation' ? never : PartialDeep<TInput>;
|
|
127
127
|
fnOptions?: TType extends 'streamed' ? SerializableStreamedQueryOptions : never;
|
|
128
128
|
};
|
|
129
|
-
type
|
|
129
|
+
type OperationKeyContent<TType extends OperationType, TInput> = Omit<OperationKeyOptions<TType, TInput>, 'prefix'> & {
|
|
130
|
+
/**
|
|
131
|
+
* Set in place of `input` when the operation is disabled with `skipToken`,
|
|
132
|
+
* because query key hashers drop symbols.
|
|
133
|
+
*/
|
|
134
|
+
skipToken?: TType extends 'mutation' ? never : true;
|
|
135
|
+
};
|
|
136
|
+
type OperationKey<TType extends OperationType, TInput> = [path: string[], options: OperationKeyContent<TType, TInput>] | [prefix: string, path: string[], options: OperationKeyContent<TType, TInput>];
|
|
130
137
|
declare function generateOperationKey<TType extends OperationType, TInput>(path: string[], options?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
|
|
131
138
|
|
|
132
139
|
declare class SharedUtils<TInput> {
|
|
@@ -242,9 +249,9 @@ declare function isProcedureUtilsOptions(value: unknown): value is ProcedureUtil
|
|
|
242
249
|
/**
|
|
243
250
|
* Merge two procedure utils options where `override` takes priority.
|
|
244
251
|
* A key explicitly set to `undefined` in `override` resets the base value.
|
|
245
|
-
* When both sides define a key
|
|
246
|
-
* modifiers are
|
|
247
|
-
*
|
|
252
|
+
* When both sides define a key, interceptors are concatenated (base ones run first) and
|
|
253
|
+
* modifiers are combined so that, for object values, per-call options beat `override`,
|
|
254
|
+
* which beats `base`. A function modifier receives the merged options and its result wins.
|
|
248
255
|
*/
|
|
249
256
|
declare function mergeProcedureUtilsOptions<TClientContext extends ClientContext, TInput, TOutput, TError>(base: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>, override: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>): ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
|
|
250
257
|
declare class ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> extends SharedUtils<TInput> {
|
package/dist/index.mjs
CHANGED
|
@@ -32,7 +32,7 @@ function generateOperationKey(path, options = {}) {
|
|
|
32
32
|
...options.prefix !== void 0 ? [options.prefix] : [],
|
|
33
33
|
path,
|
|
34
34
|
{
|
|
35
|
-
...options.input !== void 0 ? { input: options.input } : {},
|
|
35
|
+
...options.input === skipToken ? { skipToken: true } : options.input !== void 0 ? { input: options.input } : {},
|
|
36
36
|
...options.type !== void 0 ? { type: options.type } : {},
|
|
37
37
|
...options.fnOptions !== void 0 ? { fnOptions: options.fnOptions } : {}
|
|
38
38
|
}
|
|
@@ -172,12 +172,14 @@ function isProcedureUtilsOptions(value) {
|
|
|
172
172
|
return true;
|
|
173
173
|
}
|
|
174
174
|
function mergeProcedureUtilsModifier(base, override) {
|
|
175
|
-
if (typeof
|
|
176
|
-
|
|
175
|
+
if (typeof override !== "function") {
|
|
176
|
+
if (typeof base !== "function") {
|
|
177
|
+
return { ...base, ...override };
|
|
178
|
+
}
|
|
179
|
+
return (options) => base({ ...override, ...options });
|
|
177
180
|
}
|
|
178
181
|
const applyBase = typeof base === "function" ? base : (options) => ({ ...base, ...options });
|
|
179
|
-
|
|
180
|
-
return (options) => applyOverride(applyBase(options));
|
|
182
|
+
return (options) => override(applyBase(options));
|
|
181
183
|
}
|
|
182
184
|
function mergeProcedureUtilsOptions(base, override) {
|
|
183
185
|
const merged = { ...base, ...override };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/tanstack-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.44",
|
|
5
5
|
"description": "TanStack Query integration for oRPC: typesafe queries, mutations, streaming, and SSR for React, Vue, Solid, Svelte, and Angular",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": [
|
|
@@ -44,22 +44,22 @@
|
|
|
44
44
|
"@tanstack/query-core": ">=5.89.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@orpc/client": "2.0.0-beta.
|
|
48
|
-
"@orpc/contract": "2.0.0-beta.
|
|
49
|
-
"@orpc/openapi": "2.0.0-beta.
|
|
50
|
-
"@orpc/shared": "2.0.0-beta.
|
|
47
|
+
"@orpc/client": "2.0.0-beta.44",
|
|
48
|
+
"@orpc/contract": "2.0.0-beta.44",
|
|
49
|
+
"@orpc/openapi": "2.0.0-beta.44",
|
|
50
|
+
"@orpc/shared": "2.0.0-beta.44"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@angular/core": "^22.
|
|
54
|
-
"@tanstack/angular-query-experimental": "^5.
|
|
55
|
-
"@tanstack/query-core": "^5.
|
|
56
|
-
"@tanstack/react-query": "^5.
|
|
57
|
-
"@tanstack/solid-query": "^5.
|
|
58
|
-
"@tanstack/svelte-query": "^6.1
|
|
59
|
-
"@tanstack/vue-query": "^5.
|
|
60
|
-
"svelte": "^5.
|
|
61
|
-
"vue": "^3.5.
|
|
62
|
-
"zod": "^4.5
|
|
53
|
+
"@angular/core": "^22.2.2",
|
|
54
|
+
"@tanstack/angular-query-experimental": "^5.104.1",
|
|
55
|
+
"@tanstack/query-core": "^5.104.1",
|
|
56
|
+
"@tanstack/react-query": "^5.104.1",
|
|
57
|
+
"@tanstack/solid-query": "^5.104.1",
|
|
58
|
+
"@tanstack/svelte-query": "^6.3.1",
|
|
59
|
+
"@tanstack/vue-query": "^5.104.1",
|
|
60
|
+
"svelte": "^5.57.2",
|
|
61
|
+
"vue": "^3.5.43",
|
|
62
|
+
"zod": "^4.6.5"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"type:check": "tsc -b"
|