@orpc/solid-query 0.0.0-next.e98b833 → 0.0.0-next.ee46dab
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 +13 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
- **Contract-First Development 📜**: (Optional) Define your API contract upfront and implement it with confidence.
|
|
33
33
|
- **Exceptional Developer Experience ✨**: Enjoy a streamlined workflow with robust typing and clear, in-code documentation.
|
|
34
34
|
- **Multi-Runtime Support 🌍**: Run your code seamlessly on Cloudflare, Deno, Bun, Node.js, and more.
|
|
35
|
-
- **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue, Solid), Pinia Colada, and more.
|
|
35
|
+
- **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
|
36
36
|
- **Server Actions ⚡️**: Fully compatible with React Server Actions on Next.js, TanStack Start, and more.
|
|
37
37
|
- **Standard Schema Support 🗂️**: Effortlessly work with Zod, Valibot, ArkType, and others right out of the box.
|
|
38
38
|
- **Fast & Lightweight 💨**: Built on native APIs across all runtimes – optimized for speed and efficiency.
|
|
@@ -53,12 +53,16 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
|
53
53
|
- [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
|
|
54
54
|
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
|
|
55
55
|
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
|
56
|
+
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
|
|
56
57
|
- [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
|
|
57
58
|
- [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
|
|
58
59
|
- [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
|
|
60
|
+
- [@orpc/svelte-query](https://www.npmjs.com/package/@orpc/svelte-query): Integration with [Svelte Query](https://tanstack.com/query/latest/docs/framework/svelte/overview).
|
|
59
61
|
- [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
60
62
|
- [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
|
|
61
63
|
- [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
|
|
64
|
+
- [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/).
|
|
65
|
+
- [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): OpenAPI spec generation from [ArkType](https://arktype.io/).
|
|
62
66
|
|
|
63
67
|
## `@orpc/solid-query`
|
|
64
68
|
|
|
@@ -106,6 +110,14 @@ export function Example() {
|
|
|
106
110
|
}
|
|
107
111
|
```
|
|
108
112
|
|
|
113
|
+
## Sponsors
|
|
114
|
+
|
|
115
|
+
<p align="center">
|
|
116
|
+
<a href="https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg">
|
|
117
|
+
<img src='https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg'/>
|
|
118
|
+
</a>
|
|
119
|
+
</p>
|
|
120
|
+
|
|
109
121
|
## License
|
|
110
122
|
|
|
111
123
|
Distributed under the MIT License. See [LICENSE](https://github.com/unnoq/orpc/blob/main/LICENSE) for more information.
|
package/dist/index.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ interface GeneralUtils<TInput> {
|
|
|
17
17
|
}
|
|
18
18
|
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
|
19
19
|
|
|
20
|
-
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
20
|
+
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = (undefined extends TInput ? {
|
|
21
21
|
input?: TInput;
|
|
22
22
|
} : {
|
|
23
23
|
input: TInput;
|
|
@@ -26,31 +26,31 @@ type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TErro
|
|
|
26
26
|
} : {
|
|
27
27
|
context: TClientContext;
|
|
28
28
|
}) & SetOptional<SolidQueryOptions<TOutput, TError, TSelectData>, 'queryKey'>;
|
|
29
|
-
interface QueryOptionsBase<TOutput, TError
|
|
29
|
+
interface QueryOptionsBase<TOutput, TError> {
|
|
30
30
|
queryKey: QueryKey;
|
|
31
31
|
queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
|
|
32
32
|
retry?(failureCount: number, error: TError): boolean;
|
|
33
33
|
}
|
|
34
|
-
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
34
|
+
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
|
|
35
35
|
input: (pageParam: TPageParam) => TInput;
|
|
36
36
|
} & (Record<never, never> extends TClientContext ? {
|
|
37
37
|
context?: TClientContext;
|
|
38
38
|
} : {
|
|
39
39
|
context: TClientContext;
|
|
40
40
|
}) & SetOptional<SolidInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
|
|
41
|
-
interface InfiniteOptionsBase<TOutput, TError
|
|
41
|
+
interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
|
|
42
42
|
queryKey: QueryKey;
|
|
43
43
|
queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
|
|
44
44
|
retry?(failureCount: number, error: TError): boolean;
|
|
45
45
|
}
|
|
46
|
-
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
46
|
+
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
|
|
47
47
|
context?: TClientContext;
|
|
48
48
|
} : {
|
|
49
49
|
context: TClientContext;
|
|
50
50
|
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
|
51
|
-
type MutationOptions<TInput, TOutput, TError
|
|
51
|
+
type MutationOptions<TInput, TOutput, TError, TMutationContext> = SolidMutationOptions<TOutput, TError, TInput, TMutationContext>;
|
|
52
52
|
|
|
53
|
-
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
53
|
+
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
|
54
54
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
55
55
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
56
56
|
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>>;
|
|
@@ -59,7 +59,7 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
|
|
|
59
59
|
interface CreateProcedureUtilsOptions {
|
|
60
60
|
path: string[];
|
|
61
61
|
}
|
|
62
|
-
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
62
|
+
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError>(client: Client<TClientContext, TInput, TOutput, TError>, options: CreateProcedureUtilsOptions): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
|
63
63
|
|
|
64
64
|
type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
|
65
65
|
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface GeneralUtils<TInput> {
|
|
|
17
17
|
}
|
|
18
18
|
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
|
19
19
|
|
|
20
|
-
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
20
|
+
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = (undefined extends TInput ? {
|
|
21
21
|
input?: TInput;
|
|
22
22
|
} : {
|
|
23
23
|
input: TInput;
|
|
@@ -26,31 +26,31 @@ type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TErro
|
|
|
26
26
|
} : {
|
|
27
27
|
context: TClientContext;
|
|
28
28
|
}) & SetOptional<SolidQueryOptions<TOutput, TError, TSelectData>, 'queryKey'>;
|
|
29
|
-
interface QueryOptionsBase<TOutput, TError
|
|
29
|
+
interface QueryOptionsBase<TOutput, TError> {
|
|
30
30
|
queryKey: QueryKey;
|
|
31
31
|
queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
|
|
32
32
|
retry?(failureCount: number, error: TError): boolean;
|
|
33
33
|
}
|
|
34
|
-
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
34
|
+
type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
|
|
35
35
|
input: (pageParam: TPageParam) => TInput;
|
|
36
36
|
} & (Record<never, never> extends TClientContext ? {
|
|
37
37
|
context?: TClientContext;
|
|
38
38
|
} : {
|
|
39
39
|
context: TClientContext;
|
|
40
40
|
}) & SetOptional<SolidInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
|
|
41
|
-
interface InfiniteOptionsBase<TOutput, TError
|
|
41
|
+
interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
|
|
42
42
|
queryKey: QueryKey;
|
|
43
43
|
queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
|
|
44
44
|
retry?(failureCount: number, error: TError): boolean;
|
|
45
45
|
}
|
|
46
|
-
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
46
|
+
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
|
|
47
47
|
context?: TClientContext;
|
|
48
48
|
} : {
|
|
49
49
|
context: TClientContext;
|
|
50
50
|
}) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
|
|
51
|
-
type MutationOptions<TInput, TOutput, TError
|
|
51
|
+
type MutationOptions<TInput, TOutput, TError, TMutationContext> = SolidMutationOptions<TOutput, TError, TInput, TMutationContext>;
|
|
52
52
|
|
|
53
|
-
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
53
|
+
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
|
54
54
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
55
55
|
queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
|
|
56
56
|
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>>;
|
|
@@ -59,7 +59,7 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
|
|
|
59
59
|
interface CreateProcedureUtilsOptions {
|
|
60
60
|
path: string[];
|
|
61
61
|
}
|
|
62
|
-
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError
|
|
62
|
+
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError>(client: Client<TClientContext, TInput, TOutput, TError>, options: CreateProcedureUtilsOptions): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
|
63
63
|
|
|
64
64
|
type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
|
65
65
|
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/solid-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.ee46dab",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@tanstack/solid-query": ">=5.59.0",
|
|
31
31
|
"solid-js": ">=1.9.0",
|
|
32
|
-
"@orpc/client": "0.0.0-next.
|
|
32
|
+
"@orpc/client": "0.0.0-next.ee46dab"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@orpc/shared": "0.0.0-next.
|
|
35
|
+
"@orpc/shared": "0.0.0-next.ee46dab"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"zod": "^3.24.2"
|