@orpc/server 1.14.10 → 1.14.11

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 (78) hide show
  1. package/README.md +52 -98
  2. package/dist/adapters/crossws/index.d.mts +45 -21
  3. package/dist/adapters/crossws/index.d.ts +45 -21
  4. package/dist/adapters/crossws/index.mjs +40 -18
  5. package/dist/adapters/fetch/index.d.mts +64 -96
  6. package/dist/adapters/fetch/index.d.ts +64 -96
  7. package/dist/adapters/fetch/index.mjs +34 -139
  8. package/dist/adapters/message-port/index.d.mts +49 -34
  9. package/dist/adapters/message-port/index.d.ts +49 -34
  10. package/dist/adapters/message-port/index.mjs +68 -37
  11. package/dist/adapters/node/index.d.mts +63 -71
  12. package/dist/adapters/node/index.d.ts +63 -71
  13. package/dist/adapters/node/index.mjs +36 -113
  14. package/dist/adapters/standard/index.d.mts +16 -18
  15. package/dist/adapters/standard/index.d.ts +16 -18
  16. package/dist/adapters/standard/index.mjs +5 -5
  17. package/dist/adapters/standard-peer/index.d.mts +12 -14
  18. package/dist/adapters/standard-peer/index.d.ts +12 -14
  19. package/dist/adapters/standard-peer/index.mjs +2 -21
  20. package/dist/adapters/websocket/index.d.mts +53 -38
  21. package/dist/adapters/websocket/index.d.ts +53 -38
  22. package/dist/adapters/websocket/index.mjs +59 -42
  23. package/dist/extensions/callable.d.mts +10 -0
  24. package/dist/extensions/callable.d.ts +10 -0
  25. package/dist/extensions/callable.mjs +11 -0
  26. package/dist/helpers/index.d.mts +4 -4
  27. package/dist/helpers/index.d.ts +4 -4
  28. package/dist/helpers/index.mjs +13 -5
  29. package/dist/index.d.mts +166 -770
  30. package/dist/index.d.ts +166 -770
  31. package/dist/index.mjs +306 -399
  32. package/dist/plugins/index.d.mts +214 -121
  33. package/dist/plugins/index.d.ts +214 -121
  34. package/dist/plugins/index.mjs +576 -214
  35. package/dist/shared/server.15O7oC1p.d.mts +61 -0
  36. package/dist/shared/server.B4BnEWWm.d.mts +67 -0
  37. package/dist/shared/server.BhsVw7m7.d.ts +104 -0
  38. package/dist/shared/server.BoiFpNT7.mjs +224 -0
  39. package/dist/shared/server.COPVXhDG.mjs +271 -0
  40. package/dist/shared/server.CX4vUnDk.mjs +11 -0
  41. package/dist/shared/server.CcR4kgje.d.mts +206 -0
  42. package/dist/shared/server.CcR4kgje.d.ts +206 -0
  43. package/dist/shared/server.CnN50DHH.d.ts +67 -0
  44. package/dist/shared/server.DBs0rrf9.mjs +41 -0
  45. package/dist/shared/server.DDFizwfU.d.mts +104 -0
  46. package/dist/shared/server.D_QauotT.mjs +30 -0
  47. package/dist/shared/server.DofEOwf-.mjs +237 -0
  48. package/dist/shared/{server.DZ5BIITo.mjs → server.W91HSRkE.mjs} +2 -2
  49. package/dist/shared/server.m3szVJGU.d.ts +61 -0
  50. package/package.json +26 -56
  51. package/dist/adapters/aws-lambda/index.d.mts +0 -46
  52. package/dist/adapters/aws-lambda/index.d.ts +0 -46
  53. package/dist/adapters/aws-lambda/index.mjs +0 -40
  54. package/dist/adapters/bun-ws/index.d.mts +0 -36
  55. package/dist/adapters/bun-ws/index.d.ts +0 -36
  56. package/dist/adapters/bun-ws/index.mjs +0 -47
  57. package/dist/adapters/fastify/index.d.mts +0 -53
  58. package/dist/adapters/fastify/index.d.ts +0 -53
  59. package/dist/adapters/fastify/index.mjs +0 -52
  60. package/dist/adapters/ws/index.d.mts +0 -31
  61. package/dist/adapters/ws/index.d.ts +0 -31
  62. package/dist/adapters/ws/index.mjs +0 -41
  63. package/dist/hibernation/index.d.mts +0 -44
  64. package/dist/hibernation/index.d.ts +0 -44
  65. package/dist/hibernation/index.mjs +0 -65
  66. package/dist/shared/server.7cEtMB30.d.ts +0 -74
  67. package/dist/shared/server.B8gYOD5g.d.mts +0 -12
  68. package/dist/shared/server.BqadksTP.d.mts +0 -74
  69. package/dist/shared/server.C8_sRzQB.d.mts +0 -42
  70. package/dist/shared/server.ChUyt5-i.d.mts +0 -32
  71. package/dist/shared/server.ChyoA9XY.d.ts +0 -42
  72. package/dist/shared/server.DEBcqOjg.mjs +0 -418
  73. package/dist/shared/server.EfTOZ2Q7.d.ts +0 -12
  74. package/dist/shared/server.TEVCLCFC.mjs +0 -39
  75. package/dist/shared/server.ZxHCEN1h.mjs +0 -226
  76. package/dist/shared/server.qKsRrdxW.d.mts +0 -193
  77. package/dist/shared/server.qKsRrdxW.d.ts +0 -193
  78. package/dist/shared/server.yoEB3Fx4.d.ts +0 -32
@@ -1,204 +1,297 @@
1
1
  import { Value, Promisable, ThrowableError } from '@orpc/shared';
2
- import { StandardRequest, StandardHeaders } from '@orpc/standard-server';
3
- import { BatchResponseBodyItem } from '@orpc/standard-server/batch';
4
- import { C as Context, d as ProcedureClientInterceptorOptions } from '../shared/server.qKsRrdxW.js';
5
- import { d as StandardHandlerInterceptorOptions, g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.7cEtMB30.js';
6
- import { Meta, ORPCError as ORPCError$1 } from '@orpc/contract';
7
- import { ORPCError } from '@orpc/client';
2
+ import { StandardLazyRequest, StandardHeaders } from '@standardserver/core';
3
+ import { C as Context } from '../shared/server.CcR4kgje.js';
4
+ import { e as StandardHandlerPlugin, f as StandardHandlerRoutingInterceptorOptions, a as StandardHandlerOptions, g as StandardHandlerInterceptorOptions } from '../shared/server.BhsVw7m7.js';
5
+ import '@orpc/client';
6
+ import '@orpc/contract';
8
7
 
9
- interface BatchHandlerOptions<T extends Context> {
8
+ interface BatchHandlerPluginOptions<T extends Context> {
10
9
  /**
11
10
  * The max size of the batch allowed.
12
11
  *
13
12
  * @default 10
14
13
  */
15
- maxSize?: Value<Promisable<number>, [StandardHandlerInterceptorOptions<T>]>;
14
+ maxSize?: Value<Promisable<number>, [options: StandardHandlerRoutingInterceptorOptions<T>]>;
16
15
  /**
17
- * Map the request before processing it.
16
+ * Map each subrequest in the batch before it is processed.
18
17
  *
19
- * @default merged back batch request headers into the request
18
+ * @default merges the batch request headers into the subrequest and remove `orpc-batch` header to prevent nested batching
20
19
  */
21
- mapRequestItem?(request: StandardRequest, batchOptions: StandardHandlerInterceptorOptions<T>): StandardRequest;
20
+ mapSubrequest?: (subrequest: StandardLazyRequest, batchOptions: StandardHandlerRoutingInterceptorOptions<T>) => StandardLazyRequest;
22
21
  /**
23
22
  * Success batch response status code.
24
23
  *
25
24
  * @default 207
26
25
  */
27
- successStatus?: Value<Promisable<number>, [responses: Promise<BatchResponseBodyItem>[], batchOptions: StandardHandlerInterceptorOptions<T>]>;
26
+ successStatus?: Value<Promisable<number>, [batchOptions: StandardHandlerRoutingInterceptorOptions<T>]>;
28
27
  /**
29
- * success batch response headers.
28
+ * Success batch response headers.
30
29
  *
31
30
  * @default {}
32
31
  */
33
- headers?: Value<Promisable<StandardHeaders>, [responses: Promise<BatchResponseBodyItem>[], batchOptions: StandardHandlerInterceptorOptions<T>]>;
32
+ headers?: Value<Promisable<StandardHeaders>, [batchOptions: StandardHandlerRoutingInterceptorOptions<T>]>;
33
+ /**
34
+ * Keep-alive settings for streaming batch responses.
35
+ *
36
+ * When enabled, a zero-length length-prefixed frame is sent periodically while the
37
+ * stream is idle (no message sent for `interval` ms). Clients ignore these frames.
38
+ * Only applies to streaming mode.
39
+ *
40
+ * @default { enabled: true, interval: 15000 }
41
+ */
42
+ keepAlive?: undefined | {
43
+ /**
44
+ * If true, a keep-alive frame is sent periodically while the stream is idle.
45
+ *
46
+ * @default true
47
+ */
48
+ enabled: boolean;
49
+ /**
50
+ * Interval (in milliseconds) between keep-alive frames after the last message.
51
+ *
52
+ * @default 15000
53
+ */
54
+ interval?: number;
55
+ };
34
56
  }
35
- /**
36
- * The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
37
- * reducing the overhead of sending each one separately.
38
- *
39
- * @see {@link https://orpc.dev/docs/plugins/batch-requests Batch Requests Plugin Docs}
40
- */
41
57
  declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
58
+ name: string;
59
+ /**
60
+ * Run batch interceptors before OpenTelemetry interceptors
61
+ * so each subrequest gets its own span instead of sharing one batch-level span.
62
+ */
63
+ after: string[];
42
64
  private readonly maxSize;
43
- private readonly mapRequestItem;
65
+ private readonly mapSubrequest;
44
66
  private readonly successStatus;
45
67
  private readonly headers;
46
- order: number;
47
- constructor(options?: BatchHandlerOptions<T>);
48
- init(options: StandardHandlerOptions<T>): void;
68
+ private readonly keepAliveEnabled;
69
+ private readonly keepAliveInterval;
70
+ constructor(options?: BatchHandlerPluginOptions<T>);
71
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
49
72
  }
50
73
 
51
- interface CORSOptions<T extends Context> {
52
- origin?: Value<Promisable<string | readonly string[] | null | undefined>, [origin: string, options: StandardHandlerInterceptorOptions<T>]>;
53
- timingOrigin?: Value<Promisable<string | readonly string[] | null | undefined>, [origin: string, options: StandardHandlerInterceptorOptions<T>]>;
74
+ interface CORSHandlerPluginOptions<T extends Context> {
75
+ /**
76
+ * Configures the `Access-Control-Allow-Origin` header.
77
+ * Can be a string, an array of allowed origins, or a function that returns the allowed origin(s).
78
+ *
79
+ * @default (origin) => origin
80
+ */
81
+ origin?: Value<Promisable<string | readonly string[] | null | undefined>, [origin: string, options: StandardHandlerRoutingInterceptorOptions<T>]>;
82
+ /**
83
+ * Configures the `Timing-Allow-Origin` header.
84
+ * Can be a string, an array of allowed origins, or a function that returns the allowed origin(s).
85
+ *
86
+ * @default undefined
87
+ */
88
+ timingOrigin?: Value<Promisable<string | readonly string[] | null | undefined>, [origin: string, options: StandardHandlerRoutingInterceptorOptions<T>]>;
89
+ /**
90
+ * Configures the `Access-Control-Allow-Methods` header for preflight requests.
91
+ *
92
+ * @default ['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH']
93
+ */
54
94
  allowMethods?: readonly string[];
95
+ /**
96
+ * Configures the `Access-Control-Allow-Headers` header for preflight requests.
97
+ * Falls back to the request's `Access-Control-Request-Headers` if not set.
98
+ *
99
+ * @default undefined
100
+ */
55
101
  allowHeaders?: readonly string[];
102
+ /**
103
+ * Configures the `Access-Control-Max-Age` header (in seconds) for preflight requests.
104
+ *
105
+ * @default undefined
106
+ */
56
107
  maxAge?: number;
108
+ /**
109
+ * Configures the `Access-Control-Allow-Credentials` header.
110
+ *
111
+ * @default undefined
112
+ */
57
113
  credentials?: boolean;
114
+ /**
115
+ * Configures the `Access-Control-Expose-Headers` header.
116
+ *
117
+ * @default undefined
118
+ */
58
119
  exposeHeaders?: readonly string[];
59
120
  }
60
121
  /**
61
- * CORSPlugin is a plugin for oRPC that allows you to configure CORS for your API.
122
+ * CORSHandlerPlugin is a plugin for oRPC that allows you to configure CORS for your API.
62
123
  *
63
124
  * @see {@link https://orpc.dev/docs/plugins/cors CORS Plugin Docs}
64
125
  */
65
- declare class CORSPlugin<T extends Context> implements StandardHandlerPlugin<T> {
126
+ declare class CORSHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
66
127
  private readonly options;
67
- order: number;
68
- constructor(options?: CORSOptions<T>);
69
- init(options: StandardHandlerOptions<T>): void;
128
+ name: string;
129
+ /**
130
+ * - Do not create spans for CORS preflight requests.
131
+ * - Run CORS interceptors before batch interceptors so headers are applied to
132
+ * the actual response rather than sub-responses.
133
+ */
134
+ after: string[];
135
+ constructor(options?: CORSHandlerPluginOptions<T>);
136
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
70
137
  }
71
138
 
72
- interface RequestHeadersPluginContext {
73
- reqHeaders?: Headers;
74
- }
75
139
  /**
76
- * The Request Headers Plugin injects a `reqHeaders` instance into the context,
77
- * allowing access to request headers in oRPC.
140
+ * Adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
141
+ * When a request includes cookies, it helps ensure the request originates from JavaScript
142
+ * (for example, fetch/XHR) rather than from standard HTML forms or direct browser navigation.
78
143
  *
79
- * @see {@link https://orpc.dev/docs/plugins/request-headers Request Headers Plugin Docs}
144
+ * @info This plugin is enabled by default for `RPCHandler` over HTTP.
80
145
  */
81
- declare class RequestHeadersPlugin<T extends RequestHeadersPluginContext> implements StandardHandlerPlugin<T> {
82
- init(options: StandardHandlerOptions<T>): void;
146
+ declare class CSRFGuardHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
147
+ name: string;
148
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
83
149
  }
84
150
 
85
- interface ResponseHeadersPluginContext {
86
- resHeaders?: Headers;
151
+ declare class RequestCompressionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
152
+ name: string;
153
+ /**
154
+ * Should decompress the original batch request body instead of sub-requests.
155
+ */
156
+ after: string[];
157
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
158
+ }
159
+
160
+ interface RequestHeadersHandlerPluginContext {
161
+ /**
162
+ * Request headers as a Headers instance. This is injected by the Request Headers Plugin.
163
+ */
164
+ reqHeaders?: Headers | undefined;
87
165
  }
88
166
  /**
89
- * The Response Headers Plugin allows you to set response headers in oRPC.
90
- * It injects a resHeaders instance into the context, enabling you to modify response headers easily.
167
+ * The Request Headers Plugin injects a `reqHeaders` instance into the context,
168
+ * allowing access to request headers in oRPC.
91
169
  *
92
- * @see {@link https://orpc.dev/docs/plugins/response-headers Response Headers Plugin Docs}
170
+ * @see {@link https://orpc.dev/docs/plugins/request-headers Request Headers Plugin Docs}
93
171
  */
94
- declare class ResponseHeadersPlugin<T extends ResponseHeadersPluginContext> implements StandardHandlerPlugin<T> {
95
- init(options: StandardHandlerOptions<T>): void;
172
+ declare class RequestHeadersHandlerPlugin<T extends RequestHeadersHandlerPluginContext> implements StandardHandlerPlugin<T> {
173
+ name: string;
174
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
96
175
  }
97
176
 
98
- interface experimental_RethrowHandlerPluginOptions<T extends Context> {
177
+ interface RequestLimitHandlerPluginOptions {
99
178
  /**
100
- * Decide which errors should be rethrown.
101
- *
102
- * @example
103
- * ```ts
104
- * const rethrowPlugin = new RethrowHandlerPlugin({
105
- * filter: (error) => {
106
- * // Rethrow all non-ORPCError errors
107
- * return !(error instanceof ORPCError)
108
- * }
109
- * })
110
- * ```
179
+ * The maximum allowed request body size in bytes.
111
180
  */
112
- filter: Value<boolean, [error: ThrowableError, options: StandardHandlerInterceptorOptions<T>]>;
181
+ maxBodySize: number;
113
182
  }
114
183
  /**
115
- * The plugin allows you to catch and rethrow specific errors that occur during request handling.
116
- * This is particularly useful when your framework has its own error handling mechanism
117
- * (e.g., global exception filters in NestJS, error middleware in Express)
118
- * and you want certain errors to be processed by that mechanism instead of being handled by the
119
- * oRPC error handling flow.
184
+ * Rejects requests whose body exceeds `maxBodySize`.
120
185
  *
121
- * @see {@link https://orpc.dev/docs/plugins/rethrow-handler Rethrow Handler Plugin Docs}
186
+ * When used with the request compression plugin, the limit applies to the
187
+ * decompressed payload rather than the compressed wire size.
188
+ *
189
+ * @see {@link https://orpc.dev/docs/plugins/request-limit Request Limit Plugin Docs}
122
190
  */
123
- declare class experimental_RethrowHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
124
- private readonly filter;
125
- CONTEXT_SYMBOL: symbol;
126
- constructor(options: experimental_RethrowHandlerPluginOptions<T>);
127
- init(options: StandardHandlerOptions<T>): void;
191
+ declare class RequestLimitHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
192
+ name: string;
193
+ /**
194
+ * Should limit the original batch request body instead of sub-requests.
195
+ */
196
+ after: string[];
197
+ /**
198
+ * Should limit the final body size instead of the compressed one.
199
+ */
200
+ before: string[];
201
+ private readonly maxBodySize;
202
+ constructor(options: RequestLimitHandlerPluginOptions);
203
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
128
204
  }
129
205
 
130
- interface SimpleCsrfProtectionHandlerPluginOptions<T extends Context> {
206
+ interface ResponseCompressionHandlerPluginOptions<_T extends Context> {
131
207
  /**
132
- * The name of the header to check.
208
+ * The compression schemes to use for response compression.
209
+ * Schemes are prioritized by their order in this array and
210
+ * only applied if the client supports them (via Accept-Encoding).
133
211
  *
134
- * @default 'x-csrf-token'
212
+ * @default ['gzip', 'deflate']
135
213
  */
136
- headerName?: Value<Promisable<string>, [options: StandardHandlerInterceptorOptions<T>]>;
214
+ encodings?: readonly ('gzip' | 'deflate' | 'deflate-raw')[];
137
215
  /**
138
- * The value of the header to check.
139
- *
140
- * @default 'orpc'
216
+ * The minimum response size in bytes required to trigger compression.
217
+ * Responses smaller than this threshold will not be compressed to avoid overhead.
218
+ * If the response size cannot be determined, compression will still be applied.
141
219
  *
220
+ * @default 1024 (1KB)
142
221
  */
143
- headerValue?: Value<Promisable<string>, [options: StandardHandlerInterceptorOptions<T>]>;
222
+ threshold?: number;
223
+ }
224
+ /**
225
+ * Compresses response bodies based on the client's Accept-Encoding header.
226
+ * Works at the standard handler level, so it supports all adapters.
227
+ *
228
+ * @see {@link https://orpc.dev/docs/plugins/response-compression Response Compression Plugin Docs}
229
+ */
230
+ declare class ResponseCompressionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
231
+ name: string;
144
232
  /**
145
- * Exclude a procedure from the plugin.
146
- *
147
- * @default false
148
- *
233
+ * Compression should be done after batching, to compress the final response.
234
+ * Compression should also be done after response headers are set, to access final headers like Content-Type and Cache-Control.
149
235
  */
150
- exclude?: Value<Promisable<boolean>, [options: ProcedureClientInterceptorOptions<T, Record<never, never>, Meta>]>;
236
+ after: string[];
237
+ private readonly encodings;
238
+ private readonly threshold;
239
+ constructor(options?: ResponseCompressionHandlerPluginOptions<T>);
240
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
241
+ }
242
+
243
+ interface ResponseHeadersHandlerPluginContext {
151
244
  /**
152
- * The error thrown when the CSRF token is invalid.
153
- *
154
- * @default new ORPCError('CSRF_TOKEN_MISMATCH', {
155
- * status: 403,
156
- * message: 'Invalid CSRF token',
157
- * })
245
+ * Response headers as a Headers instance. This is injected by the Response Headers Plugin.
246
+ * When set before the response is sent, these headers will be included in the response. If not set, no additional headers will be added.
158
247
  */
159
- error?: InstanceType<typeof ORPCError>;
248
+ resHeaders?: Headers | undefined;
160
249
  }
161
250
  /**
162
- * This plugin adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
163
- * It helps ensure that requests to your procedures originate from JavaScript code,
164
- * not from other sources like standard HTML forms or direct browser navigation.
251
+ * The Response Headers Plugin allows you to set response headers in oRPC.
252
+ * It injects a resHeaders instance into the context, enabling you to modify response headers easily.
165
253
  *
166
- * @see {@link https://orpc.dev/docs/plugins/simple-csrf-protection Simple CSRF Protection Plugin Docs}
254
+ * @see {@link https://orpc.dev/docs/plugins/response-headers Response Headers Plugin Docs}
167
255
  */
168
- declare class SimpleCsrfProtectionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
169
- private readonly headerName;
170
- private readonly headerValue;
171
- private readonly exclude;
172
- private readonly error;
173
- constructor(options?: SimpleCsrfProtectionHandlerPluginOptions<T>);
174
- order: number;
175
- init(options: StandardHandlerOptions<T>): void;
256
+ declare class ResponseHeadersHandlerPlugin<T extends ResponseHeadersHandlerPluginContext> implements StandardHandlerPlugin<T> {
257
+ name: string;
258
+ /**
259
+ * Interceptors should run after batch interceptors so headers are applied to each sub-response.
260
+ */
261
+ before: string[];
262
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
176
263
  }
177
264
 
178
- interface StrictGetMethodPluginOptions {
265
+ interface RethrowHandlerPluginOptions<T extends Context> {
179
266
  /**
180
- * The error thrown when a GET request is made to a procedure that doesn't allow GET.
267
+ * Decide which errors should be rethrown.
181
268
  *
182
- * @default new ORPCError('METHOD_NOT_SUPPORTED')
269
+ * @example
270
+ * ```ts
271
+ * const rethrowPlugin = new RethrowHandlerPlugin({
272
+ * filter: (error) => {
273
+ * // Rethrow all non-ORPCError errors
274
+ * return !(error instanceof ORPCError)
275
+ * }
276
+ * })
277
+ * ```
183
278
  */
184
- error?: InstanceType<typeof ORPCError$1>;
279
+ filter: (error: ThrowableError, options: StandardHandlerInterceptorOptions<T>) => boolean;
185
280
  }
186
281
  /**
187
- * This plugin enhances security by ensuring only procedures explicitly marked to accept GET requests
188
- * can be called using the HTTP GET method for RPC Protocol. This helps prevent certain types of
189
- * Cross-Site Request Forgery (CSRF) attacks.
282
+ * The plugin can bypass oRPC's built-in error handling
283
+ * and rethrow matching errors directly to your framework's error handling mechanism
284
+ * (e.g., NestJS exception filters, Express error middleware).
190
285
  *
191
- * @see {@link https://orpc.dev/docs/plugins/strict-get-method Strict Get Method Plugin Docs}
286
+ * @see {@link https://orpc.dev/docs/plugins/rethrow Rethrow Plugin Documentation}
192
287
  */
193
- declare class StrictGetMethodPlugin<T extends Context> implements StandardHandlerPlugin<T> {
194
- private readonly error;
195
- /**
196
- * make sure execute before batch plugin to get real method
197
- */
198
- order: number;
199
- constructor(options?: StrictGetMethodPluginOptions);
200
- init(options: StandardHandlerOptions<T>): void;
288
+ declare class RethrowHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
289
+ name: string;
290
+ private readonly filter;
291
+ private readonly CONTEXT_SYMBOL;
292
+ constructor(options: RethrowHandlerPluginOptions<T>);
293
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
201
294
  }
202
295
 
203
- export { BatchHandlerPlugin, CORSPlugin, RequestHeadersPlugin, ResponseHeadersPlugin, SimpleCsrfProtectionHandlerPlugin, StrictGetMethodPlugin, experimental_RethrowHandlerPlugin };
204
- export type { BatchHandlerOptions, CORSOptions, RequestHeadersPluginContext, ResponseHeadersPluginContext, SimpleCsrfProtectionHandlerPluginOptions, StrictGetMethodPluginOptions, experimental_RethrowHandlerPluginOptions };
296
+ export { BatchHandlerPlugin, CORSHandlerPlugin, CSRFGuardHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestLimitHandlerPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, RethrowHandlerPlugin };
297
+ export type { BatchHandlerPluginOptions, CORSHandlerPluginOptions, RequestHeadersHandlerPluginContext, RequestLimitHandlerPluginOptions, ResponseCompressionHandlerPluginOptions, ResponseHeadersHandlerPluginContext, RethrowHandlerPluginOptions };