@orpc/solid-query 1.8.8 → 1.9.0
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/dist/index.d.mts +2 -16
- package/dist/index.d.ts +2 -16
- package/dist/index.mjs +1 -22
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientContext, Client, NestedClient } from '@orpc/client';
|
|
2
2
|
import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
|
|
3
3
|
export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
|
|
4
|
-
import { QueryKey, SkipToken, SolidQueryOptions, QueryFunctionContext,
|
|
4
|
+
import { QueryKey, SkipToken, SolidQueryOptions, QueryFunctionContext, SolidInfiniteQueryOptions, SolidMutationOptions, InfiniteData } from '@tanstack/solid-query';
|
|
5
5
|
import { SetOptional, MaybeOptionalOptions } from '@orpc/shared';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -33,13 +33,6 @@ interface QueryOptionsBase<TOutput, TError> {
|
|
|
33
33
|
retryDelay?: (count: number, error: TError) => number;
|
|
34
34
|
enabled?: boolean;
|
|
35
35
|
}
|
|
36
|
-
type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
|
|
37
|
-
type experimental_InferStreamedOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
|
|
38
|
-
type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & {
|
|
39
|
-
queryFnOptions?: experimental_StreamedQueryOptions;
|
|
40
|
-
};
|
|
41
|
-
interface experimental_StreamedOptionsBase<TOutput, TError> extends QueryOptionsBase<TOutput, TError> {
|
|
42
|
-
}
|
|
43
36
|
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
|
|
44
37
|
input: ((pageParam: TPageParam) => TInput) | SkipToken;
|
|
45
38
|
} & (Record<never, never> extends TClientContext ? {
|
|
@@ -74,13 +67,6 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
|
|
|
74
67
|
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
|
|
75
68
|
*/
|
|
76
69
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
77
|
-
/**
|
|
78
|
-
* Generate [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) options used for useQuery/prefetchQuery/...
|
|
79
|
-
* Built on top of [steamedQuery](https://tanstack.com/query/latest/docs/reference/streamedQuery)
|
|
80
|
-
*
|
|
81
|
-
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
|
|
82
|
-
*/
|
|
83
|
-
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>>;
|
|
84
70
|
/**
|
|
85
71
|
* Generate options used for createInfiniteQuery/prefetchInfiniteQuery/...
|
|
86
72
|
*
|
|
@@ -114,4 +100,4 @@ interface CreateRouterUtilsOptions {
|
|
|
114
100
|
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
|
115
101
|
|
|
116
102
|
export { createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
|
|
117
|
-
export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils
|
|
103
|
+
export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientContext, Client, NestedClient } from '@orpc/client';
|
|
2
2
|
import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
|
|
3
3
|
export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
|
|
4
|
-
import { QueryKey, SkipToken, SolidQueryOptions, QueryFunctionContext,
|
|
4
|
+
import { QueryKey, SkipToken, SolidQueryOptions, QueryFunctionContext, SolidInfiniteQueryOptions, SolidMutationOptions, InfiniteData } from '@tanstack/solid-query';
|
|
5
5
|
import { SetOptional, MaybeOptionalOptions } from '@orpc/shared';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -33,13 +33,6 @@ interface QueryOptionsBase<TOutput, TError> {
|
|
|
33
33
|
retryDelay?: (count: number, error: TError) => number;
|
|
34
34
|
enabled?: boolean;
|
|
35
35
|
}
|
|
36
|
-
type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
|
|
37
|
-
type experimental_InferStreamedOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
|
|
38
|
-
type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & {
|
|
39
|
-
queryFnOptions?: experimental_StreamedQueryOptions;
|
|
40
|
-
};
|
|
41
|
-
interface experimental_StreamedOptionsBase<TOutput, TError> extends QueryOptionsBase<TOutput, TError> {
|
|
42
|
-
}
|
|
43
36
|
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
|
|
44
37
|
input: ((pageParam: TPageParam) => TInput) | SkipToken;
|
|
45
38
|
} & (Record<never, never> extends TClientContext ? {
|
|
@@ -74,13 +67,6 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
|
|
|
74
67
|
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
|
|
75
68
|
*/
|
|
76
69
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
77
|
-
/**
|
|
78
|
-
* Generate [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) options used for useQuery/prefetchQuery/...
|
|
79
|
-
* Built on top of [steamedQuery](https://tanstack.com/query/latest/docs/reference/streamedQuery)
|
|
80
|
-
*
|
|
81
|
-
* @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
|
|
82
|
-
*/
|
|
83
|
-
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>>;
|
|
84
70
|
/**
|
|
85
71
|
* Generate options used for createInfiniteQuery/prefetchInfiniteQuery/...
|
|
86
72
|
*
|
|
@@ -114,4 +100,4 @@ interface CreateRouterUtilsOptions {
|
|
|
114
100
|
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
|
115
101
|
|
|
116
102
|
export { createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
|
|
117
|
-
export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils
|
|
103
|
+
export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { generateOperationKey } from '@orpc/tanstack-query';
|
|
2
2
|
export { generateOperationKey as buildKey } from '@orpc/tanstack-query';
|
|
3
|
-
import {
|
|
4
|
-
import { skipToken, experimental_streamedQuery } from '@tanstack/solid-query';
|
|
3
|
+
import { skipToken } from '@tanstack/solid-query';
|
|
5
4
|
|
|
6
5
|
function createGeneralUtils(path) {
|
|
7
6
|
return {
|
|
@@ -27,26 +26,6 @@ function createProcedureUtils(client, options) {
|
|
|
27
26
|
...optionsIn
|
|
28
27
|
};
|
|
29
28
|
},
|
|
30
|
-
experimental_streamedOptions(...[optionsIn = {}]) {
|
|
31
|
-
return {
|
|
32
|
-
queryKey: generateOperationKey(options.path, { type: "streamed", input: optionsIn.input, fnOptions: optionsIn.queryFnOptions }),
|
|
33
|
-
queryFn: experimental_streamedQuery({
|
|
34
|
-
queryFn: async ({ signal }) => {
|
|
35
|
-
if (optionsIn.input === skipToken) {
|
|
36
|
-
throw new Error("queryFn should not be called with skipToken used as input");
|
|
37
|
-
}
|
|
38
|
-
const output = await client(optionsIn.input, { signal, context: optionsIn.context });
|
|
39
|
-
if (!isAsyncIteratorObject(output)) {
|
|
40
|
-
throw new Error("streamedQuery requires an event iterator output");
|
|
41
|
-
}
|
|
42
|
-
return output;
|
|
43
|
-
},
|
|
44
|
-
...optionsIn.queryFnOptions
|
|
45
|
-
}),
|
|
46
|
-
...optionsIn.input === skipToken ? { enabled: false } : {},
|
|
47
|
-
...optionsIn
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
29
|
infiniteOptions(optionsIn) {
|
|
51
30
|
return {
|
|
52
31
|
queryKey: generateOperationKey(options.path, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/solid-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@tanstack/solid-query": ">=5.80.2",
|
|
31
31
|
"solid-js": ">=1.9.0",
|
|
32
|
-
"@orpc/client": "1.
|
|
32
|
+
"@orpc/client": "1.9.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@orpc/
|
|
36
|
-
"@orpc/
|
|
35
|
+
"@orpc/tanstack-query": "1.9.0",
|
|
36
|
+
"@orpc/shared": "1.9.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tanstack/solid-query": "^5.
|
|
40
|
-
"zod": "^4.1.
|
|
39
|
+
"@tanstack/solid-query": "^5.90.1",
|
|
40
|
+
"zod": "^4.1.11"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "unbuild",
|