@orpc/server 2.0.0-beta.32 → 2.0.0-beta.34

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 (52) hide show
  1. package/README.md +44 -29
  2. package/dist/adapters/aws-lambda/index.d.mts +2 -2
  3. package/dist/adapters/aws-lambda/index.d.ts +2 -2
  4. package/dist/adapters/aws-lambda/index.mjs +5 -5
  5. package/dist/adapters/crossws/index.d.mts +2 -2
  6. package/dist/adapters/crossws/index.d.ts +2 -2
  7. package/dist/adapters/crossws/index.mjs +5 -5
  8. package/dist/adapters/fastify/index.d.mts +2 -2
  9. package/dist/adapters/fastify/index.d.ts +2 -2
  10. package/dist/adapters/fastify/index.mjs +5 -5
  11. package/dist/adapters/fetch/index.d.mts +3 -3
  12. package/dist/adapters/fetch/index.d.ts +3 -3
  13. package/dist/adapters/fetch/index.mjs +6 -6
  14. package/dist/adapters/message-port/index.d.mts +2 -2
  15. package/dist/adapters/message-port/index.d.ts +2 -2
  16. package/dist/adapters/message-port/index.mjs +5 -5
  17. package/dist/adapters/node/index.d.mts +3 -3
  18. package/dist/adapters/node/index.d.ts +3 -3
  19. package/dist/adapters/node/index.mjs +7 -7
  20. package/dist/adapters/standard/index.d.mts +5 -5
  21. package/dist/adapters/standard/index.d.ts +5 -5
  22. package/dist/adapters/standard/index.mjs +4 -4
  23. package/dist/adapters/standard-peer/index.d.mts +1 -1
  24. package/dist/adapters/standard-peer/index.d.ts +1 -1
  25. package/dist/adapters/websocket/index.d.mts +2 -2
  26. package/dist/adapters/websocket/index.d.ts +2 -2
  27. package/dist/adapters/websocket/index.mjs +5 -5
  28. package/dist/extensions/callable.d.mts +3 -3
  29. package/dist/extensions/callable.d.ts +3 -3
  30. package/dist/extensions/callable.mjs +2 -2
  31. package/dist/index.d.mts +26 -26
  32. package/dist/index.d.ts +26 -26
  33. package/dist/index.mjs +8 -16
  34. package/dist/plugins/index.d.mts +5 -4
  35. package/dist/plugins/index.d.ts +5 -4
  36. package/dist/plugins/index.mjs +33 -17
  37. package/dist/shared/{server.Cd4Z1hpV.mjs → server.1ExWFMze.mjs} +2 -2
  38. package/dist/shared/{server.Cqk3swxs.mjs → server.BNfuzVqH.mjs} +1 -1
  39. package/dist/shared/{server.DtfwuV6U.d.ts → server.BpmUhems.d.mts} +9 -9
  40. package/dist/shared/{server.DrN1Pj1-.d.ts → server.BrURRtO7.d.mts} +3 -3
  41. package/dist/shared/{server.CwrYlF72.d.ts → server.BsujoJoF.d.mts} +12 -23
  42. package/dist/shared/{server.CwrYlF72.d.mts → server.BsujoJoF.d.ts} +12 -23
  43. package/dist/shared/{server.CkNnZ5F-.d.mts → server.ByvwIMbH.d.mts} +4 -4
  44. package/dist/shared/{server.BhHrioCw.d.ts → server.C-hqoApz.d.ts} +2 -2
  45. package/dist/shared/{server.C2n16pp0.d.ts → server.CAmrY_mX.d.ts} +4 -4
  46. package/dist/shared/{server.3Ex_8ISY.mjs → server.CDOFCg6A.mjs} +1 -13
  47. package/dist/shared/{server.D0Ipbmdv.d.mts → server.CGQ3M7fX.d.mts} +2 -2
  48. package/dist/shared/{server.Dm0os-OP.d.mts → server.CRwPbhLO.d.ts} +9 -9
  49. package/dist/shared/{server.JbCIPL4P.d.mts → server.D23TTT5i.d.ts} +3 -3
  50. package/dist/shared/{server.S8BnCR3a.mjs → server.gXC5UaAH.mjs} +1 -1
  51. package/dist/shared/{server.7G43pSxo.mjs → server.ozO1TILY.mjs} +3 -3
  52. package/package.json +11 -12
@@ -1,9 +1,9 @@
1
1
  import { toArray, value, isPlainObject, isTypescriptObject, isAsyncIteratorObject, override, wrapAsyncIterator, isCompressibleContentType, isNoTransformCacheControl, parseAcceptEncodingQualities, varyByAcceptEncoding, stringifyJSON, anyAbortSignal, wrapReadableStream, AbortError } from '@orpc/shared';
2
- import { flattenStandardHeader, parseStandardUrl, generateContentDisposition, mergeStandardHeaders } from '@standardserver/core';
3
- import { isClientPeerSendMessage, ServerPeer, encodePeerMessage } from '@standardserver/peer';
2
+ import { flattenStandardHeader, parseStandardUrl, generateContentDisposition, mergeStandardHeaders } from '@standard-server/core';
3
+ import { isClientPeerSendMessage, ServerPeer, encodePeerMessage } from '@standard-server/peer';
4
4
  import { ORPCError } from '@orpc/client';
5
- import { toFetchHeaders, toStandardBody, toStandardHeaders } from '@standardserver/fetch';
6
- export { R as RequestLimitHandlerPlugin } from '../shared/server.Cd4Z1hpV.mjs';
5
+ import { toFetchHeaders, toStandardBody, toStandardHeaders } from '@standard-server/fetch';
6
+ export { R as RequestLimitHandlerPlugin } from '../shared/server.1ExWFMze.mjs';
7
7
 
8
8
  const BATCH_CONTENT_TYPE = "application/vnd.orpc.batch";
9
9
  class BatchHandlerPlugin {
@@ -236,24 +236,20 @@ class CORSHandlerPlugin {
236
236
  }
237
237
  const resHeaders = { ...result.response.headers };
238
238
  const origin = flattenStandardHeader(interceptorOptions.request.headers.origin);
239
- const allowedOrigins = toArray(await value(this.options.origin, origin, interceptorOptions));
240
- if (allowedOrigins.includes("*")) {
241
- resHeaders["access-control-allow-origin"] = "*";
242
- } else {
243
- if (origin !== void 0 && allowedOrigins.includes(origin)) {
244
- resHeaders["access-control-allow-origin"] = origin;
245
- }
239
+ const allowOrigin = await this.resolveOrigin(this.options.origin, origin, interceptorOptions);
240
+ const timingAllowOrigin = await this.resolveOrigin(this.options.timingOrigin, origin, interceptorOptions);
241
+ if (allowOrigin.value !== void 0) {
242
+ resHeaders["access-control-allow-origin"] = allowOrigin.value;
243
+ }
244
+ if (timingAllowOrigin.value !== void 0) {
245
+ resHeaders["timing-allow-origin"] = timingAllowOrigin.value;
246
+ }
247
+ if (allowOrigin.varies || timingAllowOrigin.varies) {
246
248
  const existingVary = flattenStandardHeader(resHeaders.vary);
247
249
  if (!existingVary?.split(",").some((v) => v.trim().toLowerCase() === "origin")) {
248
250
  resHeaders.vary = existingVary ? `${existingVary}, Origin` : "Origin";
249
251
  }
250
252
  }
251
- const allowedTimingOrigins = toArray(await value(this.options.timingOrigin, origin, interceptorOptions));
252
- if (allowedTimingOrigins.includes("*")) {
253
- resHeaders["timing-allow-origin"] = "*";
254
- } else if (origin !== void 0 && allowedTimingOrigins.includes(origin)) {
255
- resHeaders["timing-allow-origin"] = origin;
256
- }
257
253
  if (this.options.credentials) {
258
254
  resHeaders["access-control-allow-credentials"] = "true";
259
255
  }
@@ -295,6 +291,26 @@ class CORSHandlerPlugin {
295
291
  ]
296
292
  };
297
293
  }
294
+ async resolveOrigin(option, origin, interceptorOptions) {
295
+ if (typeof option === "function") {
296
+ if (origin === void 0) {
297
+ return { value: void 0, varies: true };
298
+ }
299
+ const allowed2 = toArray(await option(origin, interceptorOptions));
300
+ if (allowed2.includes("*")) {
301
+ return { value: "*", varies: true };
302
+ }
303
+ return { value: allowed2.includes(origin) ? origin : void 0, varies: true };
304
+ }
305
+ const allowed = toArray(await option);
306
+ if (allowed.includes("*")) {
307
+ return { value: "*", varies: false };
308
+ }
309
+ if (origin !== void 0 && allowed.includes(origin)) {
310
+ return { value: origin, varies: true };
311
+ }
312
+ return { value: void 0, varies: allowed.length > 0 };
313
+ }
298
314
  }
299
315
 
300
316
  class GetMethodCsrfProtectionHandlerPlugin {
@@ -1,7 +1,7 @@
1
1
  import { ORPCError } from '@orpc/client';
2
2
  import { toArray } from '@orpc/shared';
3
- import { flattenStandardHeader } from '@standardserver/core';
4
- import { toFetchHeaders, toStandardBody } from '@standardserver/fetch';
3
+ import { flattenStandardHeader } from '@standard-server/core';
4
+ import { toFetchHeaders, toStandardBody } from '@standard-server/fetch';
5
5
 
6
6
  class RequestLimitHandlerPlugin {
7
7
  name = "~request-limit";
@@ -1,5 +1,5 @@
1
1
  import { resolveMetaPlugins, mergeErrorMap, getHiddenMetaPlugins } from '@orpc/contract';
2
- import { P as Procedure } from './server.3Ex_8ISY.mjs';
2
+ import { P as Procedure } from './server.CDOFCg6A.mjs';
3
3
 
4
4
  class DecoratedProcedure extends Procedure {
5
5
  meta(...plugins) {
@@ -1,10 +1,10 @@
1
1
  import { RouterContract, ProcedureContract, ORPCErrorFromErrorMap, ThrowableError, InferSchemaInput, InferSchemaOutput } from '@orpc/contract';
2
- import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.CwrYlF72.js';
2
+ import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.BsujoJoF.mjs';
3
3
 
4
- type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any, any> | {
4
+ type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any> | {
5
5
  [k: string]: Lazyable<Router<TInitialContext>>;
6
6
  };
7
- type ContractedRouter<T extends RouterContract, TInitialContext extends Context> = T extends ProcedureContract<infer $InputSchema, infer $OutputSchema, infer $ErrorMap> ? Procedure<TInitialContext, any, $InputSchema, $OutputSchema, $ErrorMap, never> : {
7
+ type ContractedRouter<T extends RouterContract, TInitialContext extends Context> = T extends ProcedureContract<infer $InputSchema, infer $OutputSchema, infer $ErrorMap> ? Procedure<TInitialContext, any, $InputSchema, $OutputSchema, $ErrorMap> : {
8
8
  [K in keyof T]: T[K] extends RouterContract ? Lazyable<ContractedRouter<T[K], TInitialContext>> : never;
9
9
  };
10
10
  type AnyRouter = Router<any>;
@@ -17,7 +17,7 @@ type InferRouterInitialContext<T extends AnyRouter> = T extends Router<infer $>
17
17
  *
18
18
  * @see {@link https://orpc.dev/docs/router#infer-router-initial-contexts | Router - Infer Router Initial Contexts}
19
19
  */
20
- type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
20
+ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any> ? UInitialContext : {
21
21
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
22
22
  };
23
23
  /**
@@ -28,7 +28,7 @@ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer
28
28
  *
29
29
  * @see {@link https://orpc.dev/docs/router#infer-router-final-contexts | Router - Infer Router Final Contexts}
30
30
  */
31
- type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, infer UInjectedContext, any, any, any, any> ? MergedContext<UInitialContext, UInjectedContext> : {
31
+ type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, infer UInjectedContext, any, any, any> ? MergedContext<UInitialContext, UInjectedContext> : {
32
32
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterFinalContexts<U> : never;
33
33
  };
34
34
  /**
@@ -39,7 +39,7 @@ type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer U
39
39
  *
40
40
  * @see {@link https://orpc.dev/docs/router#infer-router-inputs | Router - Infer Router Inputs}
41
41
  */
42
- type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
42
+ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any> ? InferSchemaInput<UInputSchema> : {
43
43
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
44
44
  };
45
45
  /**
@@ -50,7 +50,7 @@ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infe
50
50
  *
51
51
  * @see {@link https://orpc.dev/docs/router#infer-router-outputs | Router - Infer Router Outputs}
52
52
  */
53
- type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
53
+ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any> ? InferSchemaOutput<UOutputSchema> : {
54
54
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
55
55
  };
56
56
  /**
@@ -58,7 +58,7 @@ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any
58
58
  *
59
59
  * @see {@link https://orpc.dev/docs/router#infer-router-error | Router - Infer Router Error}
60
60
  */
61
- type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap, infer UReturnedError> ? ORPCErrorFromErrorMap<UErrorMap> | UReturnedError | ThrowableError : {
61
+ type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap> ? ORPCErrorFromErrorMap<UErrorMap> | ThrowableError : {
62
62
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterError<U> : never;
63
63
  }[keyof T];
64
64
  /**
@@ -66,7 +66,7 @@ type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any,
66
66
  *
67
67
  * @see {@link https://orpc.dev/docs/router#infer-router-errors | Router - Infer Router Errors}
68
68
  */
69
- type InferRouterErrors<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap, infer UReturnedError> ? ORPCErrorFromErrorMap<UErrorMap> | UReturnedError | ThrowableError : {
69
+ type InferRouterErrors<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap> ? ORPCErrorFromErrorMap<UErrorMap> | ThrowableError : {
70
70
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterErrors<U> : never;
71
71
  };
72
72
 
@@ -1,7 +1,7 @@
1
1
  import { AnyORPCError } from '@orpc/client';
2
2
  import { OrderablePlugin, Interceptor, Promisable } from '@orpc/shared';
3
- import { StandardLazyRequest, StandardResponse } from '@standardserver/core';
4
- import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.CwrYlF72.js';
3
+ import { StandardLazyRequest, StandardResponse } from '@standard-server/core';
4
+ import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.BsujoJoF.mjs';
5
5
  import { Schema, ErrorMap } from '@orpc/contract';
6
6
 
7
7
  interface StandardHandlerPlugin<T extends Context> extends OrderablePlugin {
@@ -73,7 +73,7 @@ interface StandardHandlerOptions<TContext extends Context> {
73
73
  * ClientInterceptor equivalent with createRouterClient.interceptors / createProcedure.interceptors
74
74
  * useful for error handling, logging, metrics, etc. (not counting encoding/decoding)
75
75
  */
76
- clientInterceptors?: ProcedureClientInterceptor<TContext, Schema<unknown>, ErrorMap, any>[];
76
+ clientInterceptors?: ProcedureClientInterceptor<TContext, Schema<unknown>, ErrorMap>[];
77
77
  plugins?: StandardHandlerPlugin<TContext>[];
78
78
  }
79
79
  declare class StandardHandler<T extends Context> {
@@ -1,4 +1,4 @@
1
- import { AnyORPCError, ClientContext, Client } from '@orpc/client';
1
+ import { ClientContext, Client } from '@orpc/client';
2
2
  import { ErrorMap, AnyMetaPlugin, ORPCErrorConstructorMap, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap, InferSchemaInput } from '@orpc/contract';
3
3
  import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
4
4
 
@@ -60,7 +60,7 @@ interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErro
60
60
  context: TCurrentContext;
61
61
  input: TInput;
62
62
  path: string[];
63
- procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, any>;
63
+ procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap>;
64
64
  signal?: AbortSignal | undefined;
65
65
  lastEventId?: string | undefined;
66
66
  errors: TErrorConstructorMap;
@@ -109,32 +109,21 @@ interface ProcedureConfig {
109
109
  */
110
110
  disableOutputValidation?: boolean | undefined;
111
111
  }
112
- interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap>, ProcedureConfig {
112
+ interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap>, ProcedureConfig {
113
113
  __TInitialContext?: (type: TInitialContext) => unknown;
114
114
  __TInjectedContext?: (type: TInjectedContext) => unknown;
115
- __TReturnedError?: () => TReturnedError;
116
- /**
117
- * When enabled, errors returned (not thrown) by the handler are passed through as-is,
118
- * rather than being transformed into inferrable errors.
119
- *
120
- * This is intended for the contract-first approach, where the procedure adheres to an
121
- * external contract and returned errors should not affect the inferred contract types.
122
- *
123
- * @default false
124
- */
125
- opaqueReturnedErrors?: boolean | undefined;
126
115
  orderedMiddlewares: OrderedMiddleware[];
127
116
  handler: ProcedureHandler<any, any, any, any>;
128
117
  }
129
- declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> {
130
- '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
131
- constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>);
118
+ declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> {
119
+ '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>;
120
+ constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>);
132
121
  /**
133
122
  * Checks if the given instance satisfies the {@link Procedure} class/interface.
134
123
  */
135
124
  static [Symbol.hasInstance](instance: unknown): boolean;
136
125
  }
137
- type AnyProcedure = Procedure<any, any, any, any, any, any>;
126
+ type AnyProcedure = Procedure<any, any, any, any, any>;
138
127
 
139
128
  interface LazyDefinition<T> {
140
129
  meta: Meta;
@@ -156,19 +145,19 @@ declare function unlazy<T extends Lazyable<any>>(maybeLazy: T): Promise<{
156
145
  default: T extends Lazy<infer U> ? U : T;
157
146
  }>;
158
147
 
159
- type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedORPCError extends AnyORPCError> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedORPCError | ThrowableError>;
148
+ type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>;
160
149
  interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap> extends ProcedureHandlerOptions<TInitialContext, unknown, ORPCErrorConstructorMap<TErrorMap>> {
161
150
  }
162
- type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedError | ThrowableError>>;
163
- type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext> = {
151
+ type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>>;
152
+ type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext> = {
164
153
  path?: string[];
165
- interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap, TReturnedError>[];
154
+ interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap>[];
166
155
  } & (object extends TInitialContext ? {
167
156
  context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
168
157
  } : {
169
158
  context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
170
159
  });
171
- declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TReturnedError, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
160
+ declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
172
161
 
173
162
  export { Procedure as a, Lazy as h, createProcedureClient as u, unlazy as v };
174
163
  export type { AnyProcedure as A, Context as C, Lazyable as L, MergedContext as M, OrderedMiddleware as O, ProcedureClientOptions as P, ProcedureClient as b, ProcedureClientInterceptor as c, Middleware as d, MergedInitialContext as e, ProcedureConfig as f, AnyMiddleware as g, ProcedureHandler as i, LazyDefinition as j, MiddlewareDefinition as k, MiddlewareDone as l, MiddlewareDoneOptions as m, MiddlewareNext as n, MiddlewareNextOptions as o, MiddlewareOptions as p, MiddlewareResult as q, ProcedureClientInterceptorOptions as r, ProcedureDefinition as s, ProcedureHandlerOptions as t };
@@ -1,4 +1,4 @@
1
- import { AnyORPCError, ClientContext, Client } from '@orpc/client';
1
+ import { ClientContext, Client } from '@orpc/client';
2
2
  import { ErrorMap, AnyMetaPlugin, ORPCErrorConstructorMap, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap, InferSchemaInput } from '@orpc/contract';
3
3
  import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
4
4
 
@@ -60,7 +60,7 @@ interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErro
60
60
  context: TCurrentContext;
61
61
  input: TInput;
62
62
  path: string[];
63
- procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, any>;
63
+ procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap>;
64
64
  signal?: AbortSignal | undefined;
65
65
  lastEventId?: string | undefined;
66
66
  errors: TErrorConstructorMap;
@@ -109,32 +109,21 @@ interface ProcedureConfig {
109
109
  */
110
110
  disableOutputValidation?: boolean | undefined;
111
111
  }
112
- interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap>, ProcedureConfig {
112
+ interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap>, ProcedureConfig {
113
113
  __TInitialContext?: (type: TInitialContext) => unknown;
114
114
  __TInjectedContext?: (type: TInjectedContext) => unknown;
115
- __TReturnedError?: () => TReturnedError;
116
- /**
117
- * When enabled, errors returned (not thrown) by the handler are passed through as-is,
118
- * rather than being transformed into inferrable errors.
119
- *
120
- * This is intended for the contract-first approach, where the procedure adheres to an
121
- * external contract and returned errors should not affect the inferred contract types.
122
- *
123
- * @default false
124
- */
125
- opaqueReturnedErrors?: boolean | undefined;
126
115
  orderedMiddlewares: OrderedMiddleware[];
127
116
  handler: ProcedureHandler<any, any, any, any>;
128
117
  }
129
- declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> {
130
- '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
131
- constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>);
118
+ declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> {
119
+ '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>;
120
+ constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>);
132
121
  /**
133
122
  * Checks if the given instance satisfies the {@link Procedure} class/interface.
134
123
  */
135
124
  static [Symbol.hasInstance](instance: unknown): boolean;
136
125
  }
137
- type AnyProcedure = Procedure<any, any, any, any, any, any>;
126
+ type AnyProcedure = Procedure<any, any, any, any, any>;
138
127
 
139
128
  interface LazyDefinition<T> {
140
129
  meta: Meta;
@@ -156,19 +145,19 @@ declare function unlazy<T extends Lazyable<any>>(maybeLazy: T): Promise<{
156
145
  default: T extends Lazy<infer U> ? U : T;
157
146
  }>;
158
147
 
159
- type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedORPCError extends AnyORPCError> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedORPCError | ThrowableError>;
148
+ type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>;
160
149
  interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap> extends ProcedureHandlerOptions<TInitialContext, unknown, ORPCErrorConstructorMap<TErrorMap>> {
161
150
  }
162
- type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedError | ThrowableError>>;
163
- type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext> = {
151
+ type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>>;
152
+ type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext> = {
164
153
  path?: string[];
165
- interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap, TReturnedError>[];
154
+ interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap>[];
166
155
  } & (object extends TInitialContext ? {
167
156
  context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
168
157
  } : {
169
158
  context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
170
159
  });
171
- declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TReturnedError, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
160
+ declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
172
161
 
173
162
  export { Procedure as a, Lazy as h, createProcedureClient as u, unlazy as v };
174
163
  export type { AnyProcedure as A, Context as C, Lazyable as L, MergedContext as M, OrderedMiddleware as O, ProcedureClientOptions as P, ProcedureClient as b, ProcedureClientInterceptor as c, Middleware as d, MergedInitialContext as e, ProcedureConfig as f, AnyMiddleware as g, ProcedureHandler as i, LazyDefinition as j, MiddlewareDefinition as k, MiddlewareDone as l, MiddlewareDoneOptions as m, MiddlewareNext as n, MiddlewareNextOptions as o, MiddlewareOptions as p, MiddlewareResult as q, ProcedureClientInterceptorOptions as r, ProcedureDefinition as s, ProcedureHandlerOptions as t };
@@ -1,10 +1,10 @@
1
1
  import { RPCSerializer, AnyORPCError } from '@orpc/client';
2
2
  import { Value, Promisable } from '@orpc/shared';
3
- import { StandardMethod, StandardLazyRequest, StandardResponse } from '@standardserver/core';
4
- import { A as AnyProcedure, C as Context } from './server.CwrYlF72.mjs';
5
- import { A as AnyRouter } from './server.Dm0os-OP.mjs';
3
+ import { StandardMethod, StandardLazyRequest, StandardResponse } from '@standard-server/core';
4
+ import { A as AnyProcedure, C as Context } from './server.BsujoJoF.mjs';
5
+ import { A as AnyRouter } from './server.BpmUhems.mjs';
6
6
  import { AnyProcedureContract } from '@orpc/contract';
7
- import { c as StandardHandlerHandleOptions, d as StandardHandlerCodec, e as StandardHandlerCodecResolvedProcedure } from './server.JbCIPL4P.mjs';
7
+ import { c as StandardHandlerHandleOptions, d as StandardHandlerCodec, e as StandardHandlerCodecResolvedProcedure } from './server.BrURRtO7.mjs';
8
8
 
9
9
  /**
10
10
  * Methods that can invoke procedures by default. Browsers cannot trigger them
@@ -1,5 +1,5 @@
1
- import { C as Context } from './server.CwrYlF72.js';
2
- import { S as StandardHandlerPlugin, a as StandardHandlerOptions } from './server.DrN1Pj1-.js';
1
+ import { C as Context } from './server.BsujoJoF.js';
2
+ import { S as StandardHandlerPlugin, a as StandardHandlerOptions } from './server.D23TTT5i.js';
3
3
 
4
4
  interface RequestLimitHandlerPluginOptions {
5
5
  /**
@@ -1,10 +1,10 @@
1
1
  import { RPCSerializer, AnyORPCError } from '@orpc/client';
2
2
  import { Value, Promisable } from '@orpc/shared';
3
- import { StandardMethod, StandardLazyRequest, StandardResponse } from '@standardserver/core';
4
- import { A as AnyProcedure, C as Context } from './server.CwrYlF72.js';
5
- import { A as AnyRouter } from './server.DtfwuV6U.js';
3
+ import { StandardMethod, StandardLazyRequest, StandardResponse } from '@standard-server/core';
4
+ import { A as AnyProcedure, C as Context } from './server.BsujoJoF.js';
5
+ import { A as AnyRouter } from './server.CRwPbhLO.js';
6
6
  import { AnyProcedureContract } from '@orpc/contract';
7
- import { c as StandardHandlerHandleOptions, d as StandardHandlerCodec, e as StandardHandlerCodecResolvedProcedure } from './server.DrN1Pj1-.js';
7
+ import { c as StandardHandlerHandleOptions, d as StandardHandlerCodec, e as StandardHandlerCodecResolvedProcedure } from './server.D23TTT5i.js';
8
8
 
9
9
  /**
10
10
  * Methods that can invoke procedures by default. Browsers cannot trigger them
@@ -1,4 +1,4 @@
1
- import { wrapAsyncIteratorPreservingEventMeta, ORPCError, cloneORPCError } from '@orpc/client';
1
+ import { wrapAsyncIteratorPreservingEventMeta, ORPCError } from '@orpc/client';
2
2
  import { createORPCErrorConstructorMap, reconcileORPCError, ValidationError, ProcedureContract } from '@orpc/contract';
3
3
  import { getConstructor, isTypescriptObject, resolveMaybeOptionalOptions, toArray, value, runWithSpan, intercept, isAsyncIteratorObject, override, traceAsyncIterator, traceReadableStream, isPlainObject, mergeTwoLevels } from '@orpc/shared';
4
4
 
@@ -169,18 +169,6 @@ async function executeProcedureInternal(procedure, options) {
169
169
  "handler",
170
170
  () => procedure["~orpc"].handler({ ...options, context, input: currentInput }, currentInput)
171
171
  );
172
- if (currentOutput instanceof ORPCError) {
173
- if (procedure["~orpc"].opaqueReturnedErrors) {
174
- throw currentOutput;
175
- }
176
- if (currentOutput.inferable && !currentOutput.defined) {
177
- throw currentOutput;
178
- }
179
- const error = cloneORPCError(currentOutput);
180
- error.defined = false;
181
- error.inferable = true;
182
- throw error;
183
- }
184
172
  }
185
173
  const startOutputIndex = midIndex === 0 ? 0 : orderedMiddlewares[midIndex - 1].outputSchemasLengthAtUse ?? 0;
186
174
  const endOutputIndex = midIndex === orderedMiddlewares.length ? outputSchemas.length : orderedMiddlewares[midIndex].outputSchemasLengthAtUse ?? 0;
@@ -1,5 +1,5 @@
1
- import { C as Context } from './server.CwrYlF72.mjs';
2
- import { S as StandardHandlerPlugin, a as StandardHandlerOptions } from './server.JbCIPL4P.mjs';
1
+ import { C as Context } from './server.BsujoJoF.mjs';
2
+ import { S as StandardHandlerPlugin, a as StandardHandlerOptions } from './server.BrURRtO7.mjs';
3
3
 
4
4
  interface RequestLimitHandlerPluginOptions {
5
5
  /**
@@ -1,10 +1,10 @@
1
1
  import { RouterContract, ProcedureContract, ORPCErrorFromErrorMap, ThrowableError, InferSchemaInput, InferSchemaOutput } from '@orpc/contract';
2
- import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.CwrYlF72.mjs';
2
+ import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.BsujoJoF.js';
3
3
 
4
- type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any, any> | {
4
+ type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any> | {
5
5
  [k: string]: Lazyable<Router<TInitialContext>>;
6
6
  };
7
- type ContractedRouter<T extends RouterContract, TInitialContext extends Context> = T extends ProcedureContract<infer $InputSchema, infer $OutputSchema, infer $ErrorMap> ? Procedure<TInitialContext, any, $InputSchema, $OutputSchema, $ErrorMap, never> : {
7
+ type ContractedRouter<T extends RouterContract, TInitialContext extends Context> = T extends ProcedureContract<infer $InputSchema, infer $OutputSchema, infer $ErrorMap> ? Procedure<TInitialContext, any, $InputSchema, $OutputSchema, $ErrorMap> : {
8
8
  [K in keyof T]: T[K] extends RouterContract ? Lazyable<ContractedRouter<T[K], TInitialContext>> : never;
9
9
  };
10
10
  type AnyRouter = Router<any>;
@@ -17,7 +17,7 @@ type InferRouterInitialContext<T extends AnyRouter> = T extends Router<infer $>
17
17
  *
18
18
  * @see {@link https://orpc.dev/docs/router#infer-router-initial-contexts | Router - Infer Router Initial Contexts}
19
19
  */
20
- type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
20
+ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any> ? UInitialContext : {
21
21
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
22
22
  };
23
23
  /**
@@ -28,7 +28,7 @@ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer
28
28
  *
29
29
  * @see {@link https://orpc.dev/docs/router#infer-router-final-contexts | Router - Infer Router Final Contexts}
30
30
  */
31
- type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, infer UInjectedContext, any, any, any, any> ? MergedContext<UInitialContext, UInjectedContext> : {
31
+ type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, infer UInjectedContext, any, any, any> ? MergedContext<UInitialContext, UInjectedContext> : {
32
32
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterFinalContexts<U> : never;
33
33
  };
34
34
  /**
@@ -39,7 +39,7 @@ type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer U
39
39
  *
40
40
  * @see {@link https://orpc.dev/docs/router#infer-router-inputs | Router - Infer Router Inputs}
41
41
  */
42
- type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
42
+ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any> ? InferSchemaInput<UInputSchema> : {
43
43
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
44
44
  };
45
45
  /**
@@ -50,7 +50,7 @@ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infe
50
50
  *
51
51
  * @see {@link https://orpc.dev/docs/router#infer-router-outputs | Router - Infer Router Outputs}
52
52
  */
53
- type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
53
+ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any> ? InferSchemaOutput<UOutputSchema> : {
54
54
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
55
55
  };
56
56
  /**
@@ -58,7 +58,7 @@ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any
58
58
  *
59
59
  * @see {@link https://orpc.dev/docs/router#infer-router-error | Router - Infer Router Error}
60
60
  */
61
- type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap, infer UReturnedError> ? ORPCErrorFromErrorMap<UErrorMap> | UReturnedError | ThrowableError : {
61
+ type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap> ? ORPCErrorFromErrorMap<UErrorMap> | ThrowableError : {
62
62
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterError<U> : never;
63
63
  }[keyof T];
64
64
  /**
@@ -66,7 +66,7 @@ type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any,
66
66
  *
67
67
  * @see {@link https://orpc.dev/docs/router#infer-router-errors | Router - Infer Router Errors}
68
68
  */
69
- type InferRouterErrors<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap, infer UReturnedError> ? ORPCErrorFromErrorMap<UErrorMap> | UReturnedError | ThrowableError : {
69
+ type InferRouterErrors<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap> ? ORPCErrorFromErrorMap<UErrorMap> | ThrowableError : {
70
70
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterErrors<U> : never;
71
71
  };
72
72
 
@@ -1,7 +1,7 @@
1
1
  import { AnyORPCError } from '@orpc/client';
2
2
  import { OrderablePlugin, Interceptor, Promisable } from '@orpc/shared';
3
- import { StandardLazyRequest, StandardResponse } from '@standardserver/core';
4
- import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.CwrYlF72.mjs';
3
+ import { StandardLazyRequest, StandardResponse } from '@standard-server/core';
4
+ import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.BsujoJoF.js';
5
5
  import { Schema, ErrorMap } from '@orpc/contract';
6
6
 
7
7
  interface StandardHandlerPlugin<T extends Context> extends OrderablePlugin {
@@ -73,7 +73,7 @@ interface StandardHandlerOptions<TContext extends Context> {
73
73
  * ClientInterceptor equivalent with createRouterClient.interceptors / createProcedure.interceptors
74
74
  * useful for error handling, logging, metrics, etc. (not counting encoding/decoding)
75
75
  */
76
- clientInterceptors?: ProcedureClientInterceptor<TContext, Schema<unknown>, ErrorMap, any>[];
76
+ clientInterceptors?: ProcedureClientInterceptor<TContext, Schema<unknown>, ErrorMap>[];
77
77
  plugins?: StandardHandlerPlugin<TContext>[];
78
78
  }
79
79
  declare class StandardHandler<T extends Context> {
@@ -1,4 +1,4 @@
1
- import { c as createProcedureClient, P as Procedure, L as Lazy, u as unlazy } from './server.3Ex_8ISY.mjs';
1
+ import { c as createProcedureClient, P as Procedure, L as Lazy, u as unlazy } from './server.CDOFCg6A.mjs';
2
2
  import { resolveMetaPlugins, mergeErrorMap, ProcedureContract } from '@orpc/contract';
3
3
  import { omit, isTypescriptObject } from '@orpc/shared';
4
4
 
@@ -1,8 +1,8 @@
1
1
  import { ORPCError, toORPCError, RPCSerializer, COMMON_ERROR_STATUS_MAP } from '@orpc/client';
2
2
  import { sortPlugins, getOpenTelemetryConfig, runWithSpan, toArray, matchesHttpPathPrefix, intercept, ORPC_NAME, isAsyncIteratorObject, override, traceAsyncIterator, recordSpanError, pathToHttpPath, normalizeHttpPath, value, parseEmptyableJSON, getOwn } from '@orpc/shared';
3
- import { flattenStandardHeader, parseStandardUrl } from '@standardserver/core';
4
- import { c as createProcedureClient, u as unlazy, P as Procedure } from './server.3Ex_8ISY.mjs';
5
- import { w as walkProcedureContractsSync, g as getRouter, c as createContractProcedure, D as DEFAULT_SUCCESS_STATUS, a as DEFAULT_ERROR_STATUS } from './server.S8BnCR3a.mjs';
3
+ import { flattenStandardHeader, parseStandardUrl } from '@standard-server/core';
4
+ import { c as createProcedureClient, u as unlazy, P as Procedure } from './server.CDOFCg6A.mjs';
5
+ import { w as walkProcedureContractsSync, g as getRouter, c as createContractProcedure, D as DEFAULT_SUCCESS_STATUS, a as DEFAULT_ERROR_STATUS } from './server.gXC5UaAH.mjs';
6
6
 
7
7
  class CompositeStandardHandlerPlugin {
8
8
  name = "~composite";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/server",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.32",
4
+ "version": "2.0.0-beta.34",
5
5
  "description": "Build typesafe APIs with oRPC: RPC and OpenAPI support, middleware, and adapters for Node.js, Bun, Deno, Fetch, Fastify, WebSocket, AWS Lambda, and more",
6
6
  "license": "MIT",
7
7
  "funding": [
@@ -117,25 +117,24 @@
117
117
  }
118
118
  },
119
119
  "dependencies": {
120
- "@orpc/client": "2.0.0-beta.32",
121
- "@orpc/contract": "2.0.0-beta.32",
122
- "@orpc/shared": "2.0.0-beta.32",
123
- "@standardserver/aws-lambda": "^0.8.2",
124
- "@standardserver/core": "^0.8.2",
125
- "@standardserver/fastify": "^0.8.2",
126
- "@standardserver/fetch": "^0.8.2",
127
- "@standardserver/node": "^0.8.2",
128
- "@standardserver/peer": "^0.8.2",
120
+ "@orpc/client": "2.0.0-beta.34",
121
+ "@orpc/contract": "2.0.0-beta.34",
122
+ "@orpc/shared": "2.0.0-beta.34",
123
+ "@standard-server/aws-lambda": "~0.9.0",
124
+ "@standard-server/core": "~0.9.0",
125
+ "@standard-server/fastify": "~0.9.0",
126
+ "@standard-server/fetch": "~0.9.0",
127
+ "@standard-server/node": "~0.9.0",
128
+ "@standard-server/peer": "~0.9.0",
129
129
  "cookie": "^2.0.1"
130
130
  },
131
131
  "devDependencies": {
132
132
  "crossws": "^0.4.6",
133
133
  "fastify": "^5.12.1",
134
134
  "supertest": "^7.2.2",
135
- "zod": "^4.4.3"
135
+ "zod": "^4.5.4"
136
136
  },
137
137
  "scripts": {
138
- "build": "unbuild",
139
138
  "type:check": "tsc -b"
140
139
  }
141
140
  }