@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.
Files changed (46) hide show
  1. package/dist/chunk-3BAPJGK6.js +302 -0
  2. package/dist/chunk-E7GUWVR4.js +186 -0
  3. package/dist/chunk-WUOGVGWG.js +1 -0
  4. package/dist/fetch.js +11 -103
  5. package/dist/hono.js +30 -0
  6. package/dist/index.js +373 -320
  7. package/dist/node.js +87 -0
  8. package/dist/src/adapters/fetch/index.d.ts +6 -0
  9. package/dist/src/adapters/fetch/orpc-handler.d.ts +20 -0
  10. package/dist/src/adapters/fetch/orpc-payload-codec.d.ts +16 -0
  11. package/dist/src/adapters/fetch/orpc-procedure-matcher.d.ts +12 -0
  12. package/dist/src/adapters/fetch/super-json.d.ts +12 -0
  13. package/dist/src/adapters/fetch/types.d.ts +21 -0
  14. package/dist/src/adapters/hono/index.d.ts +3 -0
  15. package/dist/src/adapters/hono/middleware.d.ts +12 -0
  16. package/dist/src/adapters/node/index.d.ts +5 -0
  17. package/dist/src/adapters/node/orpc-handler.d.ts +12 -0
  18. package/dist/src/adapters/node/request-listener.d.ts +28 -0
  19. package/dist/src/adapters/node/types.d.ts +22 -0
  20. package/dist/src/builder.d.ts +26 -44
  21. package/dist/src/hidden.d.ts +6 -0
  22. package/dist/src/implementer-chainable.d.ts +10 -0
  23. package/dist/src/index.d.ts +10 -3
  24. package/dist/src/lazy-decorated.d.ts +10 -0
  25. package/dist/src/lazy-utils.d.ts +4 -0
  26. package/dist/src/lazy.d.ts +6 -11
  27. package/dist/src/middleware-decorated.d.ts +8 -0
  28. package/dist/src/middleware.d.ts +18 -11
  29. package/dist/src/procedure-builder.d.ts +15 -24
  30. package/dist/src/procedure-client.d.ts +34 -0
  31. package/dist/src/procedure-decorated.d.ts +14 -0
  32. package/dist/src/procedure-implementer.d.ts +13 -17
  33. package/dist/src/procedure.d.ts +23 -25
  34. package/dist/src/router-builder.d.ts +23 -21
  35. package/dist/src/router-client.d.ts +25 -0
  36. package/dist/src/router-implementer.d.ts +18 -21
  37. package/dist/src/router.d.ts +11 -16
  38. package/dist/src/types.d.ts +10 -4
  39. package/package.json +16 -11
  40. package/dist/chunk-FL4ZAGNE.js +0 -267
  41. package/dist/src/fetch/handle.d.ts +0 -7
  42. package/dist/src/fetch/handler.d.ts +0 -3
  43. package/dist/src/fetch/index.d.ts +0 -4
  44. package/dist/src/fetch/types.d.ts +0 -35
  45. package/dist/src/procedure-caller.d.ts +0 -20
  46. 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