@orpc/server 0.0.0-next.c59d67c → 0.0.0-next.c72b962
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 +131 -0
- package/dist/adapters/fetch/index.d.mts +58 -0
- package/dist/adapters/fetch/index.d.ts +58 -0
- package/dist/adapters/fetch/index.mjs +11 -0
- package/dist/adapters/hono/index.d.mts +22 -0
- package/dist/adapters/hono/index.d.ts +22 -0
- package/dist/adapters/hono/index.mjs +34 -0
- package/dist/adapters/next/index.d.mts +29 -0
- package/dist/adapters/next/index.d.ts +29 -0
- package/dist/adapters/next/index.mjs +31 -0
- package/dist/adapters/node/index.d.mts +57 -0
- package/dist/adapters/node/index.d.ts +57 -0
- package/dist/adapters/node/index.mjs +90 -0
- package/dist/adapters/standard/index.d.mts +26 -0
- package/dist/adapters/standard/index.d.ts +26 -0
- package/dist/adapters/standard/index.mjs +8 -0
- package/dist/index.d.mts +291 -0
- package/dist/index.d.ts +291 -0
- package/dist/index.mjs +363 -0
- package/dist/plugins/index.d.mts +124 -0
- package/dist/plugins/index.d.ts +124 -0
- package/dist/plugins/index.mjs +244 -0
- package/dist/shared/server.BVwwTHyO.mjs +9 -0
- package/dist/shared/server.BW-nUGgA.mjs +36 -0
- package/dist/shared/server.Bm0UqHzd.mjs +103 -0
- package/dist/shared/server.C37gDhSZ.mjs +364 -0
- package/dist/shared/server.C8NkqxHo.d.ts +17 -0
- package/dist/shared/server.CGCwEAt_.d.mts +10 -0
- package/dist/shared/server.DCQgF_JR.d.mts +17 -0
- package/dist/shared/server.DFFT_EZo.d.ts +73 -0
- package/dist/shared/server.DFuJLDuo.mjs +190 -0
- package/dist/shared/server.DLt5njUb.d.mts +143 -0
- package/dist/shared/server.DLt5njUb.d.ts +143 -0
- package/dist/shared/server.DOYDVeMX.d.mts +73 -0
- package/dist/shared/server._2UufoXA.d.ts +10 -0
- package/package.json +41 -18
- package/dist/chunk-TDFYNRZV.js +0 -190
- package/dist/fetch.js +0 -106
- package/dist/index.js +0 -394
- package/dist/src/builder.d.ts +0 -49
- package/dist/src/fetch/handle.d.ts +0 -7
- package/dist/src/fetch/handler.d.ts +0 -3
- package/dist/src/fetch/index.d.ts +0 -4
- package/dist/src/fetch/types.d.ts +0 -35
- package/dist/src/index.d.ts +0 -15
- package/dist/src/middleware.d.ts +0 -26
- package/dist/src/procedure-builder.d.ts +0 -31
- package/dist/src/procedure-caller.d.ts +0 -19
- package/dist/src/procedure-implementer.d.ts +0 -18
- package/dist/src/procedure.d.ts +0 -29
- package/dist/src/router-builder.d.ts +0 -22
- package/dist/src/router-caller.d.ts +0 -22
- package/dist/src/router-implementer.d.ts +0 -20
- package/dist/src/router.d.ts +0 -20
- package/dist/src/types.d.ts +0 -8
- package/dist/src/utils.d.ts +0 -3
@@ -0,0 +1,143 @@
|
|
1
|
+
import { ORPCErrorCode, ORPCErrorOptions, ORPCError, HTTPPath, ClientContext, Client } from '@orpc/client';
|
2
|
+
import { MaybeOptionalOptions, Promisable, Interceptor, Value } from '@orpc/shared';
|
3
|
+
import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@orpc/contract';
|
4
|
+
|
5
|
+
type Context = Record<PropertyKey, any>;
|
6
|
+
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
7
|
+
type MergedCurrentContext<T extends Context, U extends Context> = Omit<T, keyof U> & U;
|
8
|
+
declare function mergeCurrentContext<T extends Context, U extends Context>(context: T, other: U): MergedCurrentContext<T, U>;
|
9
|
+
|
10
|
+
type ORPCErrorConstructorMapItemOptions<TData> = Omit<ORPCErrorOptions<TData>, 'defined' | 'status'>;
|
11
|
+
type ORPCErrorConstructorMapItem<TCode extends ORPCErrorCode, TInData> = (...rest: MaybeOptionalOptions<ORPCErrorConstructorMapItemOptions<TInData>>) => ORPCError<TCode, TInData>;
|
12
|
+
type ORPCErrorConstructorMap<T extends ErrorMap> = {
|
13
|
+
[K in keyof T]: K extends ORPCErrorCode ? T[K] extends ErrorMapItem<infer UInputSchema> ? ORPCErrorConstructorMapItem<K, InferSchemaInput<UInputSchema>> : never : never;
|
14
|
+
};
|
15
|
+
declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
|
16
|
+
declare function validateORPCError(map: ErrorMap, error: ORPCError<any, any>): Promise<ORPCError<string, unknown>>;
|
17
|
+
|
18
|
+
declare const LAZY_SYMBOL: unique symbol;
|
19
|
+
interface LazyMeta {
|
20
|
+
prefix?: HTTPPath;
|
21
|
+
}
|
22
|
+
interface Lazy<T> {
|
23
|
+
[LAZY_SYMBOL]: {
|
24
|
+
loader: () => Promise<{
|
25
|
+
default: T;
|
26
|
+
}>;
|
27
|
+
meta: LazyMeta;
|
28
|
+
};
|
29
|
+
}
|
30
|
+
type Lazyable<T> = T | Lazy<T>;
|
31
|
+
declare function lazy<T>(loader: () => Promise<{
|
32
|
+
default: T;
|
33
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
34
|
+
declare function isLazy(item: unknown): item is Lazy<any>;
|
35
|
+
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
36
|
+
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
37
|
+
default: T extends Lazy<infer U> ? U : T;
|
38
|
+
}>;
|
39
|
+
|
40
|
+
interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
41
|
+
context: TCurrentContext;
|
42
|
+
input: TInput;
|
43
|
+
path: readonly string[];
|
44
|
+
procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, TMeta>;
|
45
|
+
signal?: AbortSignal;
|
46
|
+
lastEventId: string | undefined;
|
47
|
+
errors: TErrorConstructorMap;
|
48
|
+
}
|
49
|
+
interface ProcedureHandler<TCurrentContext extends Context, TInput, THandlerOutput, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
50
|
+
(opt: ProcedureHandlerOptions<TCurrentContext, TInput, ORPCErrorConstructorMap<TErrorMap>, TMeta>): Promisable<THandlerOutput>;
|
51
|
+
}
|
52
|
+
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta> {
|
53
|
+
__initialContext?: (type: TInitialContext) => unknown;
|
54
|
+
middlewares: readonly AnyMiddleware[];
|
55
|
+
inputValidationIndex: number;
|
56
|
+
outputValidationIndex: number;
|
57
|
+
handler: ProcedureHandler<TCurrentContext, any, any, any, any>;
|
58
|
+
}
|
59
|
+
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
60
|
+
'~orpc': ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
61
|
+
constructor(def: ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>);
|
62
|
+
}
|
63
|
+
type AnyProcedure = Procedure<any, any, any, any, any, any>;
|
64
|
+
declare function isProcedure(item: unknown): item is AnyProcedure;
|
65
|
+
|
66
|
+
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
67
|
+
output: TOutput;
|
68
|
+
context: TOutContext;
|
69
|
+
}>;
|
70
|
+
type MiddlewareNextFnOptions<TOutContext extends Context> = Record<never, never> extends TOutContext ? {
|
71
|
+
context?: TOutContext;
|
72
|
+
} : {
|
73
|
+
context: TOutContext;
|
74
|
+
};
|
75
|
+
interface MiddlewareNextFn<TOutput> {
|
76
|
+
<U extends Context = Record<never, never>>(...rest: MaybeOptionalOptions<MiddlewareNextFnOptions<U>>): MiddlewareResult<U, TOutput>;
|
77
|
+
}
|
78
|
+
interface MiddlewareOutputFn<TOutput> {
|
79
|
+
(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
80
|
+
}
|
81
|
+
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
82
|
+
context: TInContext;
|
83
|
+
path: readonly string[];
|
84
|
+
procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, TMeta>;
|
85
|
+
signal?: AbortSignal;
|
86
|
+
lastEventId: string | undefined;
|
87
|
+
next: MiddlewareNextFn<TOutput>;
|
88
|
+
errors: TErrorConstructorMap;
|
89
|
+
}
|
90
|
+
interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
91
|
+
(options: MiddlewareOptions<TInContext, TOutput, TErrorConstructorMap, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
|
92
|
+
}
|
93
|
+
type AnyMiddleware = Middleware<any, any, any, any, any, any>;
|
94
|
+
interface MapInputMiddleware<TInput, TMappedInput> {
|
95
|
+
(input: TInput): TMappedInput;
|
96
|
+
}
|
97
|
+
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
98
|
+
|
99
|
+
type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>;
|
100
|
+
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
101
|
+
context: TInitialContext;
|
102
|
+
input: unknown;
|
103
|
+
errors: ORPCErrorConstructorMap<TErrorMap>;
|
104
|
+
path: readonly string[];
|
105
|
+
procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, TMeta>;
|
106
|
+
signal?: AbortSignal;
|
107
|
+
lastEventId: string | undefined;
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Options for creating a procedure caller with comprehensive type safety
|
111
|
+
*/
|
112
|
+
type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext> = {
|
113
|
+
/**
|
114
|
+
* This is helpful for logging and analytics.
|
115
|
+
*/
|
116
|
+
path?: readonly string[];
|
117
|
+
interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>[];
|
118
|
+
} & (Record<never, never> extends TInitialContext ? {
|
119
|
+
context?: Value<TInitialContext, [clientContext: TClientContext]>;
|
120
|
+
} : {
|
121
|
+
context: Value<TInitialContext, [clientContext: TClientContext]>;
|
122
|
+
});
|
123
|
+
declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...[options]: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
|
124
|
+
|
125
|
+
type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, UErrorMap, UMeta> : {
|
126
|
+
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
127
|
+
};
|
128
|
+
type AnyRouter = Router<any, any>;
|
129
|
+
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infer UInitialContext> ? UInitialContext : never;
|
130
|
+
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
|
131
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
132
|
+
};
|
133
|
+
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
|
134
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
135
|
+
};
|
136
|
+
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
|
137
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
138
|
+
};
|
139
|
+
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
|
140
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
141
|
+
};
|
142
|
+
|
143
|
+
export { type AnyProcedure as A, middlewareOutputFn as B, type Context as C, type ProcedureHandlerOptions as D, type ProcedureDef as E, isProcedure as F, createProcedureClient as G, type InferRouterInitialContexts as H, type InferRouterInitialContext as I, type InferRouterCurrentContexts as J, type InferRouterInputs as K, type Lazyable as L, type Middleware as M, type InferRouterOutputs as N, type ORPCErrorConstructorMap as O, type ProcedureClientInterceptorOptions as P, type Router as R, type AnyRouter as a, Procedure as b, type MergedInitialContext as c, type MergedCurrentContext as d, type MapInputMiddleware as e, type CreateProcedureClientOptions as f, type ProcedureClient as g, type AnyMiddleware as h, type Lazy as i, type ProcedureHandler as j, type ORPCErrorConstructorMapItemOptions as k, type ORPCErrorConstructorMapItem as l, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, type LazyMeta as p, lazy as q, isLazy as r, getLazyMeta as s, type MiddlewareResult as t, unlazy as u, validateORPCError as v, type MiddlewareNextFnOptions as w, type MiddlewareNextFn as x, type MiddlewareOutputFn as y, type MiddlewareOptions as z };
|
@@ -0,0 +1,143 @@
|
|
1
|
+
import { ORPCErrorCode, ORPCErrorOptions, ORPCError, HTTPPath, ClientContext, Client } from '@orpc/client';
|
2
|
+
import { MaybeOptionalOptions, Promisable, Interceptor, Value } from '@orpc/shared';
|
3
|
+
import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@orpc/contract';
|
4
|
+
|
5
|
+
type Context = Record<PropertyKey, any>;
|
6
|
+
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
7
|
+
type MergedCurrentContext<T extends Context, U extends Context> = Omit<T, keyof U> & U;
|
8
|
+
declare function mergeCurrentContext<T extends Context, U extends Context>(context: T, other: U): MergedCurrentContext<T, U>;
|
9
|
+
|
10
|
+
type ORPCErrorConstructorMapItemOptions<TData> = Omit<ORPCErrorOptions<TData>, 'defined' | 'status'>;
|
11
|
+
type ORPCErrorConstructorMapItem<TCode extends ORPCErrorCode, TInData> = (...rest: MaybeOptionalOptions<ORPCErrorConstructorMapItemOptions<TInData>>) => ORPCError<TCode, TInData>;
|
12
|
+
type ORPCErrorConstructorMap<T extends ErrorMap> = {
|
13
|
+
[K in keyof T]: K extends ORPCErrorCode ? T[K] extends ErrorMapItem<infer UInputSchema> ? ORPCErrorConstructorMapItem<K, InferSchemaInput<UInputSchema>> : never : never;
|
14
|
+
};
|
15
|
+
declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
|
16
|
+
declare function validateORPCError(map: ErrorMap, error: ORPCError<any, any>): Promise<ORPCError<string, unknown>>;
|
17
|
+
|
18
|
+
declare const LAZY_SYMBOL: unique symbol;
|
19
|
+
interface LazyMeta {
|
20
|
+
prefix?: HTTPPath;
|
21
|
+
}
|
22
|
+
interface Lazy<T> {
|
23
|
+
[LAZY_SYMBOL]: {
|
24
|
+
loader: () => Promise<{
|
25
|
+
default: T;
|
26
|
+
}>;
|
27
|
+
meta: LazyMeta;
|
28
|
+
};
|
29
|
+
}
|
30
|
+
type Lazyable<T> = T | Lazy<T>;
|
31
|
+
declare function lazy<T>(loader: () => Promise<{
|
32
|
+
default: T;
|
33
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
34
|
+
declare function isLazy(item: unknown): item is Lazy<any>;
|
35
|
+
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
36
|
+
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
37
|
+
default: T extends Lazy<infer U> ? U : T;
|
38
|
+
}>;
|
39
|
+
|
40
|
+
interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
41
|
+
context: TCurrentContext;
|
42
|
+
input: TInput;
|
43
|
+
path: readonly string[];
|
44
|
+
procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, TMeta>;
|
45
|
+
signal?: AbortSignal;
|
46
|
+
lastEventId: string | undefined;
|
47
|
+
errors: TErrorConstructorMap;
|
48
|
+
}
|
49
|
+
interface ProcedureHandler<TCurrentContext extends Context, TInput, THandlerOutput, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
50
|
+
(opt: ProcedureHandlerOptions<TCurrentContext, TInput, ORPCErrorConstructorMap<TErrorMap>, TMeta>): Promisable<THandlerOutput>;
|
51
|
+
}
|
52
|
+
interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta> {
|
53
|
+
__initialContext?: (type: TInitialContext) => unknown;
|
54
|
+
middlewares: readonly AnyMiddleware[];
|
55
|
+
inputValidationIndex: number;
|
56
|
+
outputValidationIndex: number;
|
57
|
+
handler: ProcedureHandler<TCurrentContext, any, any, any, any>;
|
58
|
+
}
|
59
|
+
declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
60
|
+
'~orpc': ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
61
|
+
constructor(def: ProcedureDef<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>);
|
62
|
+
}
|
63
|
+
type AnyProcedure = Procedure<any, any, any, any, any, any>;
|
64
|
+
declare function isProcedure(item: unknown): item is AnyProcedure;
|
65
|
+
|
66
|
+
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
67
|
+
output: TOutput;
|
68
|
+
context: TOutContext;
|
69
|
+
}>;
|
70
|
+
type MiddlewareNextFnOptions<TOutContext extends Context> = Record<never, never> extends TOutContext ? {
|
71
|
+
context?: TOutContext;
|
72
|
+
} : {
|
73
|
+
context: TOutContext;
|
74
|
+
};
|
75
|
+
interface MiddlewareNextFn<TOutput> {
|
76
|
+
<U extends Context = Record<never, never>>(...rest: MaybeOptionalOptions<MiddlewareNextFnOptions<U>>): MiddlewareResult<U, TOutput>;
|
77
|
+
}
|
78
|
+
interface MiddlewareOutputFn<TOutput> {
|
79
|
+
(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
80
|
+
}
|
81
|
+
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
82
|
+
context: TInContext;
|
83
|
+
path: readonly string[];
|
84
|
+
procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, TMeta>;
|
85
|
+
signal?: AbortSignal;
|
86
|
+
lastEventId: string | undefined;
|
87
|
+
next: MiddlewareNextFn<TOutput>;
|
88
|
+
errors: TErrorConstructorMap;
|
89
|
+
}
|
90
|
+
interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
91
|
+
(options: MiddlewareOptions<TInContext, TOutput, TErrorConstructorMap, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
|
92
|
+
}
|
93
|
+
type AnyMiddleware = Middleware<any, any, any, any, any, any>;
|
94
|
+
interface MapInputMiddleware<TInput, TMappedInput> {
|
95
|
+
(input: TInput): TMappedInput;
|
96
|
+
}
|
97
|
+
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
98
|
+
|
99
|
+
type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>;
|
100
|
+
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
101
|
+
context: TInitialContext;
|
102
|
+
input: unknown;
|
103
|
+
errors: ORPCErrorConstructorMap<TErrorMap>;
|
104
|
+
path: readonly string[];
|
105
|
+
procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, TMeta>;
|
106
|
+
signal?: AbortSignal;
|
107
|
+
lastEventId: string | undefined;
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Options for creating a procedure caller with comprehensive type safety
|
111
|
+
*/
|
112
|
+
type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext> = {
|
113
|
+
/**
|
114
|
+
* This is helpful for logging and analytics.
|
115
|
+
*/
|
116
|
+
path?: readonly string[];
|
117
|
+
interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>[];
|
118
|
+
} & (Record<never, never> extends TInitialContext ? {
|
119
|
+
context?: Value<TInitialContext, [clientContext: TClientContext]>;
|
120
|
+
} : {
|
121
|
+
context: Value<TInitialContext, [clientContext: TClientContext]>;
|
122
|
+
});
|
123
|
+
declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...[options]: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
|
124
|
+
|
125
|
+
type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, UErrorMap, UMeta> : {
|
126
|
+
[K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
|
127
|
+
};
|
128
|
+
type AnyRouter = Router<any, any>;
|
129
|
+
type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infer UInitialContext> ? UInitialContext : never;
|
130
|
+
type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
|
131
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
|
132
|
+
};
|
133
|
+
type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
|
134
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
|
135
|
+
};
|
136
|
+
type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
|
137
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
|
138
|
+
};
|
139
|
+
type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
|
140
|
+
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
|
141
|
+
};
|
142
|
+
|
143
|
+
export { type AnyProcedure as A, middlewareOutputFn as B, type Context as C, type ProcedureHandlerOptions as D, type ProcedureDef as E, isProcedure as F, createProcedureClient as G, type InferRouterInitialContexts as H, type InferRouterInitialContext as I, type InferRouterCurrentContexts as J, type InferRouterInputs as K, type Lazyable as L, type Middleware as M, type InferRouterOutputs as N, type ORPCErrorConstructorMap as O, type ProcedureClientInterceptorOptions as P, type Router as R, type AnyRouter as a, Procedure as b, type MergedInitialContext as c, type MergedCurrentContext as d, type MapInputMiddleware as e, type CreateProcedureClientOptions as f, type ProcedureClient as g, type AnyMiddleware as h, type Lazy as i, type ProcedureHandler as j, type ORPCErrorConstructorMapItemOptions as k, type ORPCErrorConstructorMapItem as l, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, type LazyMeta as p, lazy as q, isLazy as r, getLazyMeta as s, type MiddlewareResult as t, unlazy as u, validateORPCError as v, type MiddlewareNextFnOptions as w, type MiddlewareNextFn as x, type MiddlewareOutputFn as y, type MiddlewareOptions as z };
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { HTTPPath, ORPCError } from '@orpc/client';
|
2
|
+
import { Meta, InferSchemaOutput, AnySchema, ErrorFromErrorMap } from '@orpc/contract';
|
3
|
+
import { Interceptor, ThrowableError } from '@orpc/shared';
|
4
|
+
import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
|
5
|
+
import { a as AnyRouter, A as AnyProcedure, C as Context, P as ProcedureClientInterceptorOptions, R as Router } from './server.DLt5njUb.mjs';
|
6
|
+
|
7
|
+
type StandardParams = Record<string, string>;
|
8
|
+
type StandardMatchResult = {
|
9
|
+
path: readonly string[];
|
10
|
+
procedure: AnyProcedure;
|
11
|
+
params?: StandardParams;
|
12
|
+
} | undefined;
|
13
|
+
interface StandardMatcher {
|
14
|
+
init(router: AnyRouter): void;
|
15
|
+
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
16
|
+
}
|
17
|
+
interface StandardCodec {
|
18
|
+
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
19
|
+
encodeError(error: ORPCError<any, any>): StandardResponse;
|
20
|
+
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
21
|
+
}
|
22
|
+
|
23
|
+
interface StandardHandlerPlugin<TContext extends Context> {
|
24
|
+
order?: number;
|
25
|
+
init?(options: StandardHandlerOptions<TContext>): void;
|
26
|
+
}
|
27
|
+
declare class CompositeStandardHandlerPlugin<T extends Context, TPlugin extends StandardHandlerPlugin<T>> implements StandardHandlerPlugin<T> {
|
28
|
+
protected readonly plugins: TPlugin[];
|
29
|
+
constructor(plugins?: readonly TPlugin[]);
|
30
|
+
init(options: StandardHandlerOptions<T>): void;
|
31
|
+
}
|
32
|
+
|
33
|
+
interface StandardHandleOptions<T extends Context> {
|
34
|
+
prefix?: HTTPPath;
|
35
|
+
context: T;
|
36
|
+
}
|
37
|
+
type StandardHandleResult = {
|
38
|
+
matched: true;
|
39
|
+
response: StandardResponse;
|
40
|
+
} | {
|
41
|
+
matched: false;
|
42
|
+
response: undefined;
|
43
|
+
};
|
44
|
+
interface StandardHandlerInterceptorOptions<T extends Context> extends StandardHandleOptions<T> {
|
45
|
+
request: StandardLazyRequest;
|
46
|
+
}
|
47
|
+
interface StandardHandlerOptions<TContext extends Context> {
|
48
|
+
plugins?: StandardHandlerPlugin<TContext>[];
|
49
|
+
/**
|
50
|
+
* Interceptors at the request level, helpful when you want catch errors
|
51
|
+
*/
|
52
|
+
interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult, ThrowableError>[];
|
53
|
+
/**
|
54
|
+
* Interceptors at the root level, helpful when you want override the request/response
|
55
|
+
*/
|
56
|
+
rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult, ThrowableError>[];
|
57
|
+
/**
|
58
|
+
*
|
59
|
+
* Interceptors for procedure client.
|
60
|
+
*/
|
61
|
+
clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, InferSchemaOutput<AnySchema>, ErrorFromErrorMap<Record<never, never>>>[];
|
62
|
+
}
|
63
|
+
declare class StandardHandler<T extends Context> {
|
64
|
+
private readonly matcher;
|
65
|
+
private readonly codec;
|
66
|
+
private readonly interceptors;
|
67
|
+
private readonly clientInterceptors;
|
68
|
+
private readonly rootInterceptors;
|
69
|
+
constructor(router: Router<any, T>, matcher: StandardMatcher, codec: StandardCodec, options: NoInfer<StandardHandlerOptions<T>>);
|
70
|
+
handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
|
71
|
+
}
|
72
|
+
|
73
|
+
export { CompositeStandardHandlerPlugin as C, type StandardHandleOptions as S, type StandardHandlerOptions as a, StandardHandler as b, type StandardCodec as c, type StandardParams as d, type StandardMatcher as e, type StandardMatchResult as f, type StandardHandleResult as g, type StandardHandlerInterceptorOptions as h, type StandardHandlerPlugin as i };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { C as Context } from './server.DLt5njUb.js';
|
2
|
+
import { S as StandardHandleOptions } from './server.DFFT_EZo.js';
|
3
|
+
|
4
|
+
type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
5
|
+
context?: T;
|
6
|
+
} : {
|
7
|
+
context: T;
|
8
|
+
});
|
9
|
+
|
10
|
+
export type { FriendlyStandardHandleOptions as F };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/server",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next.
|
4
|
+
"version": "0.0.0-next.c72b962",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -15,38 +15,61 @@
|
|
15
15
|
],
|
16
16
|
"exports": {
|
17
17
|
".": {
|
18
|
-
"types": "./dist/
|
19
|
-
"import": "./dist/index.
|
20
|
-
"default": "./dist/index.
|
18
|
+
"types": "./dist/index.d.mts",
|
19
|
+
"import": "./dist/index.mjs",
|
20
|
+
"default": "./dist/index.mjs"
|
21
|
+
},
|
22
|
+
"./plugins": {
|
23
|
+
"types": "./dist/plugins/index.d.mts",
|
24
|
+
"import": "./dist/plugins/index.mjs",
|
25
|
+
"default": "./dist/plugins/index.mjs"
|
26
|
+
},
|
27
|
+
"./standard": {
|
28
|
+
"types": "./dist/adapters/standard/index.d.mts",
|
29
|
+
"import": "./dist/adapters/standard/index.mjs",
|
30
|
+
"default": "./dist/adapters/standard/index.mjs"
|
21
31
|
},
|
22
32
|
"./fetch": {
|
23
|
-
"types": "./dist/
|
24
|
-
"import": "./dist/fetch.
|
25
|
-
"default": "./dist/fetch.
|
33
|
+
"types": "./dist/adapters/fetch/index.d.mts",
|
34
|
+
"import": "./dist/adapters/fetch/index.mjs",
|
35
|
+
"default": "./dist/adapters/fetch/index.mjs"
|
36
|
+
},
|
37
|
+
"./hono": {
|
38
|
+
"types": "./dist/adapters/hono/index.d.mts",
|
39
|
+
"import": "./dist/adapters/hono/index.mjs",
|
40
|
+
"default": "./dist/adapters/hono/index.mjs"
|
41
|
+
},
|
42
|
+
"./next": {
|
43
|
+
"types": "./dist/adapters/next/index.d.mts",
|
44
|
+
"import": "./dist/adapters/next/index.mjs",
|
45
|
+
"default": "./dist/adapters/next/index.mjs"
|
26
46
|
},
|
27
|
-
"
|
28
|
-
"types": "./dist/
|
47
|
+
"./node": {
|
48
|
+
"types": "./dist/adapters/node/index.d.mts",
|
49
|
+
"import": "./dist/adapters/node/index.mjs",
|
50
|
+
"default": "./dist/adapters/node/index.mjs"
|
29
51
|
}
|
30
52
|
},
|
31
53
|
"files": [
|
32
|
-
"!**/*.map",
|
33
|
-
"!**/*.tsbuildinfo",
|
34
54
|
"dist"
|
35
55
|
],
|
36
56
|
"peerDependencies": {
|
37
|
-
"
|
38
|
-
"
|
57
|
+
"hono": ">=4.6.0",
|
58
|
+
"next": ">=14.0.0"
|
39
59
|
},
|
40
60
|
"dependencies": {
|
41
|
-
"@orpc/
|
42
|
-
"@orpc/shared": "0.0.0-next.
|
43
|
-
"@orpc/
|
61
|
+
"@orpc/client": "0.0.0-next.c72b962",
|
62
|
+
"@orpc/shared": "0.0.0-next.c72b962",
|
63
|
+
"@orpc/contract": "0.0.0-next.c72b962",
|
64
|
+
"@orpc/standard-server": "0.0.0-next.c72b962",
|
65
|
+
"@orpc/standard-server-fetch": "0.0.0-next.c72b962",
|
66
|
+
"@orpc/standard-server-node": "0.0.0-next.c72b962"
|
44
67
|
},
|
45
68
|
"devDependencies": {
|
46
|
-
"
|
69
|
+
"supertest": "^7.0.0"
|
47
70
|
},
|
48
71
|
"scripts": {
|
49
|
-
"build": "
|
72
|
+
"build": "unbuild",
|
50
73
|
"build:watch": "pnpm run build --watch",
|
51
74
|
"type:check": "tsc -b"
|
52
75
|
}
|
package/dist/chunk-TDFYNRZV.js
DELETED
@@ -1,190 +0,0 @@
|
|
1
|
-
// src/utils.ts
|
2
|
-
function mergeContext(a, b) {
|
3
|
-
if (!a)
|
4
|
-
return b;
|
5
|
-
if (!b)
|
6
|
-
return a;
|
7
|
-
return {
|
8
|
-
...a,
|
9
|
-
...b
|
10
|
-
};
|
11
|
-
}
|
12
|
-
|
13
|
-
// src/middleware.ts
|
14
|
-
var decoratedMiddlewareSymbol = Symbol("\u{1F512}decoratedMiddleware");
|
15
|
-
function decorateMiddleware(middleware) {
|
16
|
-
if (Reflect.get(middleware, decoratedMiddlewareSymbol)) {
|
17
|
-
return middleware;
|
18
|
-
}
|
19
|
-
const concat = (concatMiddleware, mapInput2) => {
|
20
|
-
const concatMiddleware_ = mapInput2 ? decorateMiddleware(concatMiddleware).mapInput(mapInput2) : concatMiddleware;
|
21
|
-
return decorateMiddleware(async (input, context, meta, ...rest) => {
|
22
|
-
const input_ = input;
|
23
|
-
const context_ = context;
|
24
|
-
const meta_ = meta;
|
25
|
-
const next = async (options) => {
|
26
|
-
return concatMiddleware_(input_, mergeContext(context_, options.context), meta_, ...rest);
|
27
|
-
};
|
28
|
-
const m1 = await middleware(input_, context_, {
|
29
|
-
...meta_,
|
30
|
-
next
|
31
|
-
}, ...rest);
|
32
|
-
return m1;
|
33
|
-
});
|
34
|
-
};
|
35
|
-
const mapInput = (map) => {
|
36
|
-
return decorateMiddleware(
|
37
|
-
(input, ...rest) => middleware(map(input), ...rest)
|
38
|
-
);
|
39
|
-
};
|
40
|
-
return Object.assign(middleware, {
|
41
|
-
[decoratedMiddlewareSymbol]: true,
|
42
|
-
concat,
|
43
|
-
mapInput
|
44
|
-
});
|
45
|
-
}
|
46
|
-
|
47
|
-
// src/procedure-caller.ts
|
48
|
-
import { value } from "@orpc/shared";
|
49
|
-
import { ORPCError } from "@orpc/shared/error";
|
50
|
-
import { OpenAPIDeserializer } from "@orpc/transformer";
|
51
|
-
function createProcedureCaller(options) {
|
52
|
-
const path = options.path ?? [];
|
53
|
-
const procedure = options.procedure;
|
54
|
-
const caller = async (input) => {
|
55
|
-
const input_ = (() => {
|
56
|
-
if (!(input instanceof FormData)) {
|
57
|
-
return input;
|
58
|
-
}
|
59
|
-
const transformer = new OpenAPIDeserializer({
|
60
|
-
schema: procedure.zz$p.contract.zz$cp.InputSchema
|
61
|
-
});
|
62
|
-
return transformer.deserializeAsFormData(input);
|
63
|
-
})();
|
64
|
-
const validInput = (() => {
|
65
|
-
const schema = procedure.zz$p.contract.zz$cp.InputSchema;
|
66
|
-
if (!schema) {
|
67
|
-
return input_;
|
68
|
-
}
|
69
|
-
try {
|
70
|
-
return schema.parse(input_);
|
71
|
-
} catch (e) {
|
72
|
-
throw new ORPCError({
|
73
|
-
message: "Validation input failed",
|
74
|
-
code: "BAD_REQUEST",
|
75
|
-
cause: e
|
76
|
-
});
|
77
|
-
}
|
78
|
-
})();
|
79
|
-
const middlewares = procedure.zz$p.middlewares ?? [];
|
80
|
-
let currentMidIndex = 0;
|
81
|
-
let currentContext = await value(options.context);
|
82
|
-
const next = async (nextOptions) => {
|
83
|
-
const mid = middlewares[currentMidIndex];
|
84
|
-
currentMidIndex += 1;
|
85
|
-
currentContext = mergeContext(currentContext, nextOptions.context);
|
86
|
-
if (mid) {
|
87
|
-
return await mid(validInput, currentContext, {
|
88
|
-
path,
|
89
|
-
procedure,
|
90
|
-
next,
|
91
|
-
output: (output2) => ({ output: output2, context: void 0 })
|
92
|
-
});
|
93
|
-
} else {
|
94
|
-
return {
|
95
|
-
output: await await procedure.zz$p.func(validInput, currentContext, {
|
96
|
-
path,
|
97
|
-
procedure
|
98
|
-
}),
|
99
|
-
context: currentContext
|
100
|
-
};
|
101
|
-
}
|
102
|
-
};
|
103
|
-
const output = (await next({})).output;
|
104
|
-
const validOutput = await (async () => {
|
105
|
-
const schema = procedure.zz$p.contract.zz$cp.OutputSchema;
|
106
|
-
if (!schema) {
|
107
|
-
return output;
|
108
|
-
}
|
109
|
-
const result = await schema.safeParseAsync(output);
|
110
|
-
if (result.error) {
|
111
|
-
throw new ORPCError({
|
112
|
-
message: "Validation output failed",
|
113
|
-
code: "INTERNAL_SERVER_ERROR",
|
114
|
-
cause: result.error
|
115
|
-
});
|
116
|
-
}
|
117
|
-
return result.data;
|
118
|
-
})();
|
119
|
-
return validOutput;
|
120
|
-
};
|
121
|
-
return caller;
|
122
|
-
}
|
123
|
-
|
124
|
-
// src/procedure.ts
|
125
|
-
import {
|
126
|
-
DecoratedContractProcedure,
|
127
|
-
isContractProcedure
|
128
|
-
} from "@orpc/contract";
|
129
|
-
var Procedure = class {
|
130
|
-
constructor(zz$p) {
|
131
|
-
this.zz$p = zz$p;
|
132
|
-
}
|
133
|
-
};
|
134
|
-
var DECORATED_PROCEDURE_SYMBOL = Symbol("DECORATED_PROCEDURE");
|
135
|
-
function decorateProcedure(procedure) {
|
136
|
-
if (DECORATED_PROCEDURE_SYMBOL in procedure) {
|
137
|
-
return procedure;
|
138
|
-
}
|
139
|
-
return Object.assign(createProcedureCaller({
|
140
|
-
procedure,
|
141
|
-
context: void 0
|
142
|
-
}), {
|
143
|
-
[DECORATED_PROCEDURE_SYMBOL]: true,
|
144
|
-
zz$p: procedure.zz$p,
|
145
|
-
prefix(prefix) {
|
146
|
-
return decorateProcedure({
|
147
|
-
zz$p: {
|
148
|
-
...procedure.zz$p,
|
149
|
-
contract: DecoratedContractProcedure.decorate(
|
150
|
-
procedure.zz$p.contract
|
151
|
-
).prefix(prefix)
|
152
|
-
}
|
153
|
-
});
|
154
|
-
},
|
155
|
-
route(opts) {
|
156
|
-
return decorateProcedure({
|
157
|
-
zz$p: {
|
158
|
-
...procedure.zz$p,
|
159
|
-
contract: DecoratedContractProcedure.decorate(
|
160
|
-
procedure.zz$p.contract
|
161
|
-
).route(opts)
|
162
|
-
}
|
163
|
-
});
|
164
|
-
},
|
165
|
-
use(middleware, mapInput) {
|
166
|
-
const middleware_ = mapInput ? decorateMiddleware(middleware).mapInput(mapInput) : middleware;
|
167
|
-
return decorateProcedure({
|
168
|
-
zz$p: {
|
169
|
-
...procedure.zz$p,
|
170
|
-
middlewares: [middleware_, ...procedure.zz$p.middlewares ?? []]
|
171
|
-
}
|
172
|
-
});
|
173
|
-
}
|
174
|
-
});
|
175
|
-
}
|
176
|
-
function isProcedure(item) {
|
177
|
-
if (item instanceof Procedure)
|
178
|
-
return true;
|
179
|
-
return (typeof item === "object" || typeof item === "function") && item !== null && "zz$p" in item && typeof item.zz$p === "object" && item.zz$p !== null && "contract" in item.zz$p && isContractProcedure(item.zz$p.contract) && "func" in item.zz$p && typeof item.zz$p.func === "function";
|
180
|
-
}
|
181
|
-
|
182
|
-
export {
|
183
|
-
mergeContext,
|
184
|
-
decorateMiddleware,
|
185
|
-
createProcedureCaller,
|
186
|
-
Procedure,
|
187
|
-
decorateProcedure,
|
188
|
-
isProcedure
|
189
|
-
};
|
190
|
-
//# sourceMappingURL=chunk-TDFYNRZV.js.map
|