@orpc/server 0.0.0-next.aa57fb6 → 0.0.0-next.aa72097
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/chunk-3BAPJGK6.js +302 -0
- package/dist/chunk-E7GUWVR4.js +186 -0
- package/dist/chunk-WUOGVGWG.js +1 -0
- package/dist/fetch.js +11 -103
- package/dist/hono.js +30 -0
- package/dist/index.js +373 -320
- package/dist/node.js +87 -0
- package/dist/src/adapters/fetch/index.d.ts +6 -0
- package/dist/src/adapters/fetch/orpc-handler.d.ts +20 -0
- package/dist/src/adapters/fetch/orpc-payload-codec.d.ts +16 -0
- package/dist/src/adapters/fetch/orpc-procedure-matcher.d.ts +12 -0
- package/dist/src/adapters/fetch/super-json.d.ts +12 -0
- package/dist/src/adapters/fetch/types.d.ts +21 -0
- package/dist/src/adapters/hono/index.d.ts +3 -0
- package/dist/src/adapters/hono/middleware.d.ts +12 -0
- package/dist/src/adapters/node/index.d.ts +5 -0
- package/dist/src/adapters/node/orpc-handler.d.ts +12 -0
- package/dist/src/adapters/node/request-listener.d.ts +28 -0
- package/dist/src/adapters/node/types.d.ts +22 -0
- package/dist/src/builder.d.ts +26 -44
- package/dist/src/hidden.d.ts +6 -0
- package/dist/src/implementer-chainable.d.ts +10 -0
- package/dist/src/index.d.ts +10 -3
- package/dist/src/lazy-decorated.d.ts +10 -0
- package/dist/src/lazy-utils.d.ts +4 -0
- package/dist/src/lazy.d.ts +6 -11
- package/dist/src/middleware-decorated.d.ts +8 -0
- package/dist/src/middleware.d.ts +18 -11
- package/dist/src/procedure-builder.d.ts +15 -24
- package/dist/src/procedure-client.d.ts +34 -0
- package/dist/src/procedure-decorated.d.ts +14 -0
- package/dist/src/procedure-implementer.d.ts +13 -17
- package/dist/src/procedure.d.ts +23 -25
- package/dist/src/router-builder.d.ts +23 -21
- package/dist/src/router-client.d.ts +25 -0
- package/dist/src/router-implementer.d.ts +18 -21
- package/dist/src/router.d.ts +11 -16
- package/dist/src/types.d.ts +10 -4
- package/package.json +16 -11
- package/dist/chunk-FL4ZAGNE.js +0 -267
- 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/procedure-caller.d.ts +0 -20
- package/dist/src/router-caller.d.ts +0 -22
@@ -1,35 +0,0 @@
|
|
1
|
-
import type { PartialOnUndefinedDeep, Promisable, Value } from '@orpc/shared';
|
2
|
-
import type { Router } from '../router';
|
3
|
-
export interface FetchHandlerHooks {
|
4
|
-
next: () => Promise<Response>;
|
5
|
-
response: (response: Response) => Response;
|
6
|
-
}
|
7
|
-
export type FetchHandlerOptions<TRouter extends Router<any>> = {
|
8
|
-
/**
|
9
|
-
* The `router` used for handling the request and routing,
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
router: TRouter;
|
13
|
-
/**
|
14
|
-
* The request need to be handled.
|
15
|
-
*/
|
16
|
-
request: Request;
|
17
|
-
/**
|
18
|
-
* Remove the prefix from the request path.
|
19
|
-
*
|
20
|
-
* @example /orpc
|
21
|
-
* @example /api
|
22
|
-
*/
|
23
|
-
prefix?: string;
|
24
|
-
/**
|
25
|
-
* Hooks for executing logics on lifecycle events.
|
26
|
-
*/
|
27
|
-
hooks?: (context: TRouter extends Router<infer UContext> ? UContext : never, hooks: FetchHandlerHooks) => Promisable<Response>;
|
28
|
-
} & PartialOnUndefinedDeep<{
|
29
|
-
/**
|
30
|
-
* The context used to handle the request.
|
31
|
-
*/
|
32
|
-
context: Value<TRouter extends Router<infer UContext> ? UContext : never>;
|
33
|
-
}>;
|
34
|
-
export type FetchHandler = <TRouter extends Router<any>>(options: FetchHandlerOptions<TRouter>) => Promise<Response | undefined>;
|
35
|
-
//# sourceMappingURL=types.d.ts.map
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import type { SchemaInput, SchemaOutput } from '@orpc/contract';
|
2
|
-
import type { Lazy } from './lazy';
|
3
|
-
import { type Value } from '@orpc/shared';
|
4
|
-
import { type ANY_LAZY_PROCEDURE, type ANY_PROCEDURE, type Procedure } from './procedure';
|
5
|
-
export interface CreateProcedureCallerOptions<TProcedure extends ANY_PROCEDURE | ANY_LAZY_PROCEDURE> {
|
6
|
-
procedure: TProcedure;
|
7
|
-
/**
|
8
|
-
* The context used when calling the procedure.
|
9
|
-
*/
|
10
|
-
context: Value<TProcedure extends Procedure<infer UContext, any, any, any, any> | Lazy<Procedure<infer UContext, any, any, any, any>> ? UContext : never>;
|
11
|
-
/**
|
12
|
-
* This is helpful for logging and analytics.
|
13
|
-
*
|
14
|
-
* @internal
|
15
|
-
*/
|
16
|
-
path?: string[];
|
17
|
-
}
|
18
|
-
export type ProcedureCaller<TProcedure extends ANY_PROCEDURE | ANY_LAZY_PROCEDURE> = TProcedure extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> | Lazy<Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput>> ? (...input: [input: SchemaInput<UInputSchema> | FormData] | (undefined extends SchemaInput<UInputSchema> ? [] : never)) => Promise<SchemaOutput<UOutputSchema, UFuncOutput>> : never;
|
19
|
-
export declare function createProcedureCaller<TProcedure extends ANY_PROCEDURE | ANY_LAZY_PROCEDURE>(options: CreateProcedureCallerOptions<TProcedure>): ProcedureCaller<TProcedure>;
|
20
|
-
//# sourceMappingURL=procedure-caller.d.ts.map
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import type { Value } from '@orpc/shared';
|
2
|
-
import type { ANY_LAZY_PROCEDURE, ANY_PROCEDURE } from './procedure';
|
3
|
-
import type { Router } from './router';
|
4
|
-
import { type ProcedureCaller } from './procedure-caller';
|
5
|
-
export interface CreateRouterCallerOptions<TRouter extends Router<any>> {
|
6
|
-
router: TRouter;
|
7
|
-
/**
|
8
|
-
* The context used when calling the procedure.
|
9
|
-
*/
|
10
|
-
context: Value<TRouter extends Router<infer UContext> ? UContext : never>;
|
11
|
-
/**
|
12
|
-
* This is helpful for logging and analytics.
|
13
|
-
*
|
14
|
-
* @internal
|
15
|
-
*/
|
16
|
-
basePath?: string[];
|
17
|
-
}
|
18
|
-
export type RouterCaller<TRouter extends Router<any>> = {
|
19
|
-
[K in keyof TRouter]: TRouter[K] extends ANY_PROCEDURE | ANY_LAZY_PROCEDURE ? ProcedureCaller<TRouter[K]> : TRouter[K] extends Router<any> ? RouterCaller<TRouter[K]> : never;
|
20
|
-
};
|
21
|
-
export declare function createRouterCaller<TRouter extends Router<any>>(options: CreateRouterCallerOptions<TRouter>): RouterCaller<TRouter>;
|
22
|
-
//# sourceMappingURL=router-caller.d.ts.map
|