@orpc/pinia-colada 2.0.0-beta.49 → 2.0.0-beta.51
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 +10 -8
- package/dist/contract-utils.d.ts +9 -11
- package/dist/contract-utils.js +38 -38
- package/dist/index.d.ts +13 -20
- package/dist/index.js +7 -14
- package/dist/key.d.ts +27 -36
- package/dist/key.js +37 -39
- package/dist/live-query.js +32 -36
- package/dist/meta.d.ts +15 -15
- package/dist/meta.js +49 -51
- package/dist/plugin.d.ts +38 -45
- package/dist/plugin.js +19 -25
- package/dist/procedure-utils.d.ts +160 -163
- package/dist/procedure-utils.js +374 -390
- package/dist/router-utils.d.ts +47 -50
- package/dist/router-utils.js +50 -65
- package/dist/shared-utils.d.ts +12 -12
- package/dist/shared-utils.js +23 -21
- package/dist/ssr.d.ts +13 -13
- package/dist/ssr.js +21 -23
- package/dist/stream-query.d.ts +30 -39
- package/dist/stream-query.js +45 -57
- package/dist/types.d.ts +37 -37
- package/dist/types.js +8 -6
- package/package.json +5 -5
- package/dist/live-query.d.ts +0 -8
package/dist/meta.js
CHANGED
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mergeProcedureUtilsOptions } from "./procedure-utils.js";
|
|
2
|
+
import { ProcedureContract, getRouterContract } from "@orpc/contract";
|
|
3
|
+
// src/meta.ts
|
|
3
4
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
* Define base Pinia Colada options and interceptors on a procedure contract.
|
|
6
|
+
* Applied multiple times, later options are spread-merged with higher priority
|
|
7
|
+
* while interceptors are concatenated. A key explicitly set to `undefined`
|
|
8
|
+
* resets the value from earlier applications instead of merging.
|
|
9
|
+
*
|
|
10
|
+
* Apply them to router utils with {@link ContractOptionsUtilsPlugin}.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
|
|
13
|
+
*/
|
|
14
|
+
function piniaColada(options) {
|
|
15
|
+
return {
|
|
16
|
+
name: "~pinia-colada",
|
|
17
|
+
init(meta) {
|
|
18
|
+
const current = meta["~pinia-colada"];
|
|
19
|
+
return {
|
|
20
|
+
...meta,
|
|
21
|
+
"~pinia-colada": current ? mergeProcedureUtilsOptions(current, options) : options
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
};
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
function getPiniaColadaMeta(procedureOrLazy) {
|
|
27
|
+
return procedureOrLazy["~orpc"].meta["~pinia-colada"];
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return mergeProcedureUtilsOptions(base, options);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
30
|
+
* Router utils plugin that applies base options defined via {@link piniaColada}
|
|
31
|
+
* on the given router contract. Meta options act as the base layer: options defined
|
|
32
|
+
* on the utils override them, and utils interceptors run after meta interceptors.
|
|
33
|
+
*
|
|
34
|
+
* The contract shape must match the client the utils are created from,
|
|
35
|
+
* so pass the root router contract when utils paths start from the root.
|
|
36
|
+
*
|
|
37
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
|
|
38
|
+
*/
|
|
39
|
+
var ContractOptionsUtilsPlugin = class {
|
|
40
|
+
contract;
|
|
41
|
+
name = "~contract-options";
|
|
42
|
+
constructor(contract) {
|
|
43
|
+
this.contract = contract;
|
|
44
|
+
}
|
|
45
|
+
initProcedureOptions(path, options) {
|
|
46
|
+
const procedure = getRouterContract(this.contract, path);
|
|
47
|
+
if (!(procedure instanceof ProcedureContract)) return options;
|
|
48
|
+
const base = getPiniaColadaMeta(procedure);
|
|
49
|
+
if (!base) return options;
|
|
50
|
+
return mergeProcedureUtilsOptions(base, options);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export { ContractOptionsUtilsPlugin, getPiniaColadaMeta, piniaColada };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { ProcedureUtilsOptions } from "./procedure-utils.js";
|
|
2
|
+
import { RouterUtilsOptions } from "./router-utils.js";
|
|
3
|
+
import { OrderablePlugin } from "@orpc/shared";
|
|
4
|
+
import { AnyNestedClient, InferClientContext, InferClientError } from "@orpc/client";
|
|
5
5
|
export interface RouterUtilsPlugin<T extends AnyNestedClient> extends OrderablePlugin {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
export declare class CompositeRouterUtilsPlugin<T extends AnyNestedClient> implements RouterUtilsPlugin<T> {
|
|
41
|
-
protected readonly plugins: RouterUtilsPlugin<T>[];
|
|
42
|
-
readonly name = "~composite";
|
|
43
|
-
constructor(plugins?: RouterUtilsPlugin<T>[]);
|
|
44
|
-
init(options: RouterUtilsOptions<T>): RouterUtilsOptions<T>;
|
|
45
|
-
initProcedureOptions(path: string[], options: ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>): ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>;
|
|
46
|
-
}
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the router utils plugin and returns updated router utils options.
|
|
8
|
+
* Called once per plugin instance during composition.
|
|
9
|
+
*
|
|
10
|
+
* This method allows plugins to wrap, extend, or transform router utils options,
|
|
11
|
+
* such as interceptors or configuration.
|
|
12
|
+
*
|
|
13
|
+
* @param options - The current router utils options from previous plugins or base configuration
|
|
14
|
+
* @returns Transformed router utils options with this plugin's modifications applied
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* init(options) {
|
|
19
|
+
* return {
|
|
20
|
+
* ...options,
|
|
21
|
+
* mutationInterceptors: [...(options.mutationInterceptors ?? []), myInterceptor]
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
init?(options: RouterUtilsOptions<T>): RouterUtilsOptions<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Initializes per-procedure router utils options and returns updated options.
|
|
29
|
+
* Called once per procedure utils instance during composition.
|
|
30
|
+
*
|
|
31
|
+
* This method allows plugins to customize merged procedure-specific defaults,
|
|
32
|
+
* such as query or mutation options, for the current path.
|
|
33
|
+
*
|
|
34
|
+
* @param path - The current procedure path
|
|
35
|
+
* @param options - The merged procedure utils options for the current procedure
|
|
36
|
+
* @returns Transformed procedure utils options with this plugin's modifications applied
|
|
37
|
+
*/
|
|
38
|
+
initProcedureOptions?(path: string[], options: ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>): ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>;
|
|
39
|
+
}
|
package/dist/plugin.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { sortPlugins } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
options = plugin.initProcedureOptions(path, options);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return options;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
import { sortPlugins } from "@orpc/shared";
|
|
2
|
+
// src/plugin.ts
|
|
3
|
+
var CompositeRouterUtilsPlugin = class {
|
|
4
|
+
plugins;
|
|
5
|
+
name = "~composite";
|
|
6
|
+
constructor(plugins = []) {
|
|
7
|
+
this.plugins = plugins;
|
|
8
|
+
this.plugins = sortPlugins(plugins);
|
|
9
|
+
}
|
|
10
|
+
init(options) {
|
|
11
|
+
for (const plugin of this.plugins) if (plugin.init) options = plugin.init(options);
|
|
12
|
+
return options;
|
|
13
|
+
}
|
|
14
|
+
initProcedureOptions(path, options) {
|
|
15
|
+
for (const plugin of this.plugins) if (plugin.initProcedureOptions) options = plugin.initProcedureOptions(path, options);
|
|
16
|
+
return options;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export { CompositeRouterUtilsPlugin };
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { OperationKeyBaseOptions } from "./key.js";
|
|
2
|
+
import { SharedUtils } from "./shared-utils.js";
|
|
3
|
+
import { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, MutationKeyOptions, MutationOptionsIn, MutationOptionsOut, OperationContext, QueryKeyOptions, QueryOptionsIn, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsOut, UseMutationFnContext, UseQueryFnContext } from "./types.js";
|
|
4
|
+
import { Interceptor, MaybeOptionalOptions, PromiseWithError } from "@orpc/shared";
|
|
5
|
+
import { Client, ClientContext } from "@orpc/client";
|
|
6
|
+
import { EntryKeyTagged, UseInfiniteQueryData, UseInfiniteQueryFnContext, _EmptyObject } from "@pinia/colada";
|
|
7
7
|
export interface ProcedureUtilsQueryInterceptorOptions<TClientContext extends ClientContext, TInput> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
path: string[];
|
|
9
|
+
context: TClientContext & OperationContext;
|
|
10
|
+
input: TInput;
|
|
11
|
+
fnContext: UseQueryFnContext;
|
|
12
12
|
}
|
|
13
13
|
export type ProcedureUtilsQueryInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
|
|
14
|
-
export interface ProcedureUtilsStreamedInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {
|
|
15
|
-
}
|
|
14
|
+
export interface ProcedureUtilsStreamedInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {}
|
|
16
15
|
export type ProcedureUtilsStreamedInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsStreamedInterceptorOptions<TClientContext, TInput>, PromiseWithError<InferStreamedQueryOutput<TOutput>, TError>>;
|
|
17
|
-
export interface ProcedureUtilsLiveInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {
|
|
18
|
-
}
|
|
16
|
+
export interface ProcedureUtilsLiveInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {}
|
|
19
17
|
export type ProcedureUtilsLiveInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsLiveInterceptorOptions<TClientContext, TInput>, PromiseWithError<InferLiveQueryOutput<TOutput>, TError>>;
|
|
20
18
|
export interface ProcedureUtilsInfiniteInterceptorOptions<TClientContext extends ClientContext, TInput> {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
path: string[];
|
|
20
|
+
context: TClientContext & OperationContext;
|
|
21
|
+
input: TInput;
|
|
22
|
+
fnContext: UseInfiniteQueryFnContext<any, any, any, any>;
|
|
25
23
|
}
|
|
26
24
|
export type ProcedureUtilsInfiniteInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsInfiniteInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
|
|
27
25
|
export interface ProcedureUtilsMutationInterceptorOptions<TClientContext extends ClientContext, TInput> {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
path: string[];
|
|
27
|
+
context: TClientContext & OperationContext;
|
|
28
|
+
input: TInput;
|
|
29
|
+
fnContext: UseMutationFnContext;
|
|
32
30
|
}
|
|
33
31
|
export type ProcedureUtilsMutationInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsMutationInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
|
|
34
32
|
/**
|
|
@@ -37,78 +35,77 @@ export type ProcedureUtilsMutationInterceptor<TClientContext extends ClientConte
|
|
|
37
35
|
*/
|
|
38
36
|
export type ProcedureUtilsModifier<T extends object> = Partial<T> | ((options: T) => T);
|
|
39
37
|
export interface ProcedureUtilsOptions<TClientContext extends ClientContext, TInput, TOutput, TError> extends OperationKeyBaseOptions {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Key options modifier for .queryKey and .queryOptions
|
|
40
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
41
|
+
*/
|
|
42
|
+
queryKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Interceptors that intercept query inside .queryOptions, guaranteed to be executed.
|
|
45
|
+
*/
|
|
46
|
+
queryInterceptors?: ProcedureUtilsQueryInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Options modifier for .queryOptions
|
|
49
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
50
|
+
*/
|
|
51
|
+
queryOptions?: ProcedureUtilsModifier<QueryOptionsIn<TClientContext, TInput, TOutput, TError, TOutput | undefined>> | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Key options modifier for .streamedKey and .streamedOptions
|
|
54
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
55
|
+
*/
|
|
56
|
+
streamedKey?: ProcedureUtilsModifier<StreamedKeyOptions<TInput>> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Interceptors that intercept query inside .streamedOptions, guaranteed to be executed.
|
|
59
|
+
*/
|
|
60
|
+
streamedInterceptors?: ProcedureUtilsStreamedInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Options modifier for .streamedOptions
|
|
63
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
64
|
+
*/
|
|
65
|
+
streamedOptions?: ProcedureUtilsModifier<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, InferStreamedQueryOutput<TOutput> | undefined>> | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Key options modifier for .liveKey and .liveOptions
|
|
68
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
69
|
+
*/
|
|
70
|
+
liveKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Interceptors that intercept query inside .liveOptions, guaranteed to be executed.
|
|
73
|
+
*/
|
|
74
|
+
liveInterceptors?: ProcedureUtilsLiveInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Options modifier for .liveOptions
|
|
77
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
78
|
+
*/
|
|
79
|
+
liveOptions?: ProcedureUtilsModifier<LiveOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, InferLiveQueryOutput<TOutput> | undefined>> | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Key options modifier for .infiniteKey and .infiniteOptions
|
|
82
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
83
|
+
*/
|
|
84
|
+
infiniteKey?: ProcedureUtilsModifier<InfiniteKeyOptions<TInput, unknown>> | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Interceptors that intercept query inside .infiniteOptions, guaranteed to be executed.
|
|
87
|
+
*/
|
|
88
|
+
infiniteInterceptors?: ProcedureUtilsInfiniteInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Options modifier for .infiniteOptions
|
|
91
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
92
|
+
*/
|
|
93
|
+
infiniteOptions?: ProcedureUtilsModifier<InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, unknown, UseInfiniteQueryData<TOutput, unknown> | undefined>> | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Key options modifier for .mutationKey and .mutationOptions
|
|
96
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
97
|
+
*/
|
|
98
|
+
mutationKey?: ProcedureUtilsModifier<MutationKeyOptions<TInput>> | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Interceptors that intercept mutation inside .mutationOptions, guaranteed to be executed.
|
|
101
|
+
*/
|
|
102
|
+
mutationInterceptors?: ProcedureUtilsMutationInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Options modifier for .mutationOptions
|
|
105
|
+
* Can be partial options or a function that receives per-call options and returns override this.options.
|
|
106
|
+
*/
|
|
107
|
+
mutationOptions?: ProcedureUtilsModifier<MutationOptionsIn<TClientContext, TInput, TOutput, TError, Record<any, any>>> | undefined;
|
|
110
108
|
}
|
|
111
|
-
export declare function isProcedureUtilsOptions(value: unknown): value is ProcedureUtilsOptions<any, any, any, any>;
|
|
112
109
|
/**
|
|
113
110
|
* Merge two procedure utils options where `override` takes priority.
|
|
114
111
|
* A key explicitly set to `undefined` in `override` resets the base value.
|
|
@@ -118,73 +115,73 @@ export declare function isProcedureUtilsOptions(value: unknown): value is Proced
|
|
|
118
115
|
*/
|
|
119
116
|
export 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>;
|
|
120
117
|
export declare class ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> extends SharedUtils<TInput> {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
118
|
+
protected readonly options: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
|
|
119
|
+
/**
|
|
120
|
+
* Calling corresponding procedure client
|
|
121
|
+
*
|
|
122
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#calling-procedure-clients | Pinia Colada Integration - Calling Procedure Clients}
|
|
123
|
+
*/
|
|
124
|
+
call: Client<TClientContext, TInput, TOutput, TError>;
|
|
125
|
+
constructor(path: string[], client: Client<TClientContext, TInput, TOutput, TError>, options?: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>);
|
|
126
|
+
/**
|
|
127
|
+
* Generate a **full matching** key for useQuery/...
|
|
128
|
+
*
|
|
129
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
|
|
130
|
+
*/
|
|
131
|
+
queryKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<TOutput, TError>;
|
|
132
|
+
/**
|
|
133
|
+
* Generate options used for useQuery/...
|
|
134
|
+
*
|
|
135
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#query-options-utility | Pinia Colada Integration - Query Options Utility}
|
|
136
|
+
*/
|
|
137
|
+
queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): NoInfer<QueryOptionsOut<TOutput, TError, UInitialData>>;
|
|
138
|
+
/**
|
|
139
|
+
* Generate a **full matching** key for [Streamed Query Options](https://orpc.dev/docs/integrations/pinia-colada#streamed-query-options-utility).
|
|
140
|
+
*
|
|
141
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
|
|
142
|
+
*/
|
|
143
|
+
streamedKey(...rest: MaybeOptionalOptions<StreamedKeyOptions<TInput>>): EntryKeyTagged<InferStreamedQueryOutput<TOutput>, TError>;
|
|
144
|
+
/**
|
|
145
|
+
* Configure queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
|
|
146
|
+
* The resulting data is an array of chunks, and each new chunk is appended as it arrives.
|
|
147
|
+
* It never returns to pending once it has data.
|
|
148
|
+
* Works with `useQuery` and any other API that accepts query options.
|
|
149
|
+
*/
|
|
150
|
+
streamedOptions<UInitialData extends InferStreamedQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<StreamedOptionsOut<InferStreamedQueryOutput<TOutput>, TError, UInitialData>>;
|
|
151
|
+
/**
|
|
152
|
+
* Generate a **full matching** key for [Live Query Options](https://orpc.dev/docs/integrations/pinia-colada#live-query-options-utility).
|
|
153
|
+
*
|
|
154
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
|
|
155
|
+
*/
|
|
156
|
+
liveKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<InferLiveQueryOutput<TOutput>, TError>;
|
|
157
|
+
/**
|
|
158
|
+
* Configure live queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
|
|
159
|
+
* Unlike `.streamedOptions` which accumulates chunks, live queries replace the entire result with each new chunk received.
|
|
160
|
+
* Works with `useQuery` and any other API that accepts query options.
|
|
161
|
+
*/
|
|
162
|
+
liveOptions<UInitialData extends InferLiveQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<LiveOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<QueryOptionsOut<InferLiveQueryOutput<TOutput>, TError, UInitialData>>;
|
|
163
|
+
/**
|
|
164
|
+
* Generate a **full matching** key for useInfiniteQuery/...
|
|
165
|
+
*
|
|
166
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
|
|
167
|
+
*/
|
|
168
|
+
infiniteKey<UPageParam>(optionsIn: InfiniteKeyOptions<TInput, UPageParam>): EntryKeyTagged<UseInfiniteQueryData<TOutput, UPageParam>, TError>;
|
|
169
|
+
/**
|
|
170
|
+
* Generate options used for useInfiniteQuery/...
|
|
171
|
+
*
|
|
172
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#infinite-query-options-utility | Pinia Colada Integration - Infinite Query Options Utility}
|
|
173
|
+
*/
|
|
174
|
+
infiniteOptions<UPageParam, UInitialData extends UseInfiniteQueryData<TOutput, UPageParam> | undefined = undefined>(optionsIn: InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, UPageParam, UInitialData>): NoInfer<InfiniteOptionsOut<TOutput, TError, UPageParam, UInitialData>>;
|
|
175
|
+
/**
|
|
176
|
+
* Generate a **full matching** key for useMutation/...
|
|
177
|
+
*
|
|
178
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
|
|
179
|
+
*/
|
|
180
|
+
mutationKey(...rest: MaybeOptionalOptions<MutationKeyOptions<TInput>>): MutationOptionsOut<TInput, TOutput, TError, _EmptyObject>["key"];
|
|
181
|
+
/**
|
|
182
|
+
* Generate options used for useMutation/...
|
|
183
|
+
*
|
|
184
|
+
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#mutation-options | Pinia Colada Integration - Mutation Options}
|
|
185
|
+
*/
|
|
186
|
+
mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): NoInfer<MutationOptionsOut<TInput, TOutput, TError, UMutationContext>>;
|
|
187
|
+
}
|