@orpc/vue-colada 1.0.0-beta.6 → 1.0.3
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 -17
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/package.json +4 -4
package/README.md
CHANGED
@@ -21,28 +21,24 @@
|
|
21
21
|
|
22
22
|
<h3 align="center">Typesafe APIs Made Simple 🪄</h3>
|
23
23
|
|
24
|
-
**oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards
|
24
|
+
**oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards
|
25
25
|
|
26
26
|
---
|
27
27
|
|
28
28
|
## Highlights
|
29
29
|
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
42
|
-
- **Reusability 🔄**: Write once and reuse your code across multiple purposes effortlessly.
|
43
|
-
- **Extendability 🔌**: Easily enhance oRPC with plugins, middleware, and interceptors.
|
44
|
-
- **Reliability 🛡️**: Well-tested, fully TypeScript, production-ready, and MIT licensed for peace of mind.
|
45
|
-
- **Simplicity 💡**: Enjoy straightforward, clean code with no hidden magic.
|
30
|
+
- **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
|
31
|
+
- **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
|
32
|
+
- **📝 Contract-First Development**: Optionally define your API contract before implementation.
|
33
|
+
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
34
|
+
- **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
|
35
|
+
- **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
|
36
|
+
- **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
|
37
|
+
- **⏱️ Lazy Router**: Enhance cold start times with our lazy routing feature.
|
38
|
+
- **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
|
39
|
+
- **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
|
40
|
+
- **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
|
41
|
+
- **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
|
46
42
|
|
47
43
|
## Documentation
|
48
44
|
|
package/dist/index.d.mts
CHANGED
@@ -9,6 +9,11 @@ interface BuildKeyOptions<TInput> {
|
|
9
9
|
declare function buildKey<TInput>(path: string[], options?: BuildKeyOptions<TInput>): EntryKey;
|
10
10
|
|
11
11
|
interface GeneralUtils<TInput> {
|
12
|
+
/**
|
13
|
+
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
14
|
+
*
|
15
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#query-mutation-key Pinia Colada Query/Mutation Key Docs}
|
16
|
+
*/
|
12
17
|
key(options?: BuildKeyOptions<TInput>): EntryKey;
|
13
18
|
}
|
14
19
|
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
@@ -32,8 +37,23 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
32
37
|
type MutationOptions<TInput, TOutput, TError, TMutationContext extends Record<any, any>> = UseMutationOptions<TOutput, TInput, TError, TMutationContext>;
|
33
38
|
|
34
39
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
40
|
+
/**
|
41
|
+
* Calling corresponding procedure client
|
42
|
+
*
|
43
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#calling-procedure-clients Pinia Colada Calling Procedure Client Docs}
|
44
|
+
*/
|
35
45
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
46
|
+
/**
|
47
|
+
* Generate options used for useQuery/...
|
48
|
+
*
|
49
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#query-options-utility Pinia Colada Query Options Utility Docs}
|
50
|
+
*/
|
36
51
|
queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): QueryOptions<TOutput, TError, UInitialData>;
|
52
|
+
/**
|
53
|
+
* Generate options used for useMutation/...
|
54
|
+
*
|
55
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#mutation-options Pinia Colada Mutation Options Docs}
|
56
|
+
*/
|
37
57
|
mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
38
58
|
}
|
39
59
|
interface CreateProcedureUtilsOptions {
|
@@ -47,6 +67,13 @@ type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientCo
|
|
47
67
|
interface CreateRouterUtilsOptions {
|
48
68
|
path?: string[];
|
49
69
|
}
|
70
|
+
/**
|
71
|
+
* Create a router utils from a client.
|
72
|
+
*
|
73
|
+
* @info Both client-side and server-side clients are supported.
|
74
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada Pinia Colada Docs}
|
75
|
+
*/
|
50
76
|
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
51
77
|
|
52
|
-
export {
|
78
|
+
export { buildKey, createGeneralUtils, createRouterUtils as createORPCVueColadaUtils, createProcedureUtils, createRouterUtils };
|
79
|
+
export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptions, QueryOptionsIn, RouterUtils, UseQueryFnContext };
|
package/dist/index.d.ts
CHANGED
@@ -9,6 +9,11 @@ interface BuildKeyOptions<TInput> {
|
|
9
9
|
declare function buildKey<TInput>(path: string[], options?: BuildKeyOptions<TInput>): EntryKey;
|
10
10
|
|
11
11
|
interface GeneralUtils<TInput> {
|
12
|
+
/**
|
13
|
+
* Generate a query/mutation key for checking status, invalidate, set, get, etc.
|
14
|
+
*
|
15
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#query-mutation-key Pinia Colada Query/Mutation Key Docs}
|
16
|
+
*/
|
12
17
|
key(options?: BuildKeyOptions<TInput>): EntryKey;
|
13
18
|
}
|
14
19
|
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
@@ -32,8 +37,23 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
|
|
32
37
|
type MutationOptions<TInput, TOutput, TError, TMutationContext extends Record<any, any>> = UseMutationOptions<TOutput, TInput, TError, TMutationContext>;
|
33
38
|
|
34
39
|
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
40
|
+
/**
|
41
|
+
* Calling corresponding procedure client
|
42
|
+
*
|
43
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#calling-procedure-clients Pinia Colada Calling Procedure Client Docs}
|
44
|
+
*/
|
35
45
|
call: Client<TClientContext, TInput, TOutput, TError>;
|
46
|
+
/**
|
47
|
+
* Generate options used for useQuery/...
|
48
|
+
*
|
49
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#query-options-utility Pinia Colada Query Options Utility Docs}
|
50
|
+
*/
|
36
51
|
queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): QueryOptions<TOutput, TError, UInitialData>;
|
52
|
+
/**
|
53
|
+
* Generate options used for useMutation/...
|
54
|
+
*
|
55
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada#mutation-options Pinia Colada Mutation Options Docs}
|
56
|
+
*/
|
37
57
|
mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
38
58
|
}
|
39
59
|
interface CreateProcedureUtilsOptions {
|
@@ -47,6 +67,13 @@ type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientCo
|
|
47
67
|
interface CreateRouterUtilsOptions {
|
48
68
|
path?: string[];
|
49
69
|
}
|
70
|
+
/**
|
71
|
+
* Create a router utils from a client.
|
72
|
+
*
|
73
|
+
* @info Both client-side and server-side clients are supported.
|
74
|
+
* @see {@link https://orpc.unnoq.com/docs/pinia-colada Pinia Colada Docs}
|
75
|
+
*/
|
50
76
|
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
51
77
|
|
52
|
-
export {
|
78
|
+
export { buildKey, createGeneralUtils, createRouterUtils as createORPCVueColadaUtils, createProcedureUtils, createRouterUtils };
|
79
|
+
export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptions, QueryOptionsIn, RouterUtils, UseQueryFnContext };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/vue-colada",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.3",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -32,11 +32,11 @@
|
|
32
32
|
"vue": ">=3.3.0"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@orpc/
|
36
|
-
"@orpc/
|
35
|
+
"@orpc/shared": "1.0.3",
|
36
|
+
"@orpc/client": "1.0.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"pinia": "^
|
39
|
+
"pinia": "^3.0.0"
|
40
40
|
},
|
41
41
|
"scripts": {
|
42
42
|
"build": "unbuild",
|