@temporary-name/server 1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2 → 1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e

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/adapters/aws-lambda/index.d.mts +5 -7
  2. package/dist/adapters/aws-lambda/index.d.ts +5 -7
  3. package/dist/adapters/aws-lambda/index.mjs +5 -6
  4. package/dist/adapters/fetch/index.d.mts +8 -86
  5. package/dist/adapters/fetch/index.d.ts +8 -86
  6. package/dist/adapters/fetch/index.mjs +17 -157
  7. package/dist/adapters/node/index.d.mts +9 -64
  8. package/dist/adapters/node/index.d.ts +9 -64
  9. package/dist/adapters/node/index.mjs +15 -122
  10. package/dist/handler/index.d.mts +28 -0
  11. package/dist/handler/index.d.ts +28 -0
  12. package/dist/handler/index.mjs +8 -0
  13. package/dist/helpers/index.mjs +3 -29
  14. package/dist/index.d.mts +366 -213
  15. package/dist/index.d.ts +366 -213
  16. package/dist/index.mjs +484 -178
  17. package/dist/openapi/index.d.mts +18 -53
  18. package/dist/openapi/index.d.ts +18 -53
  19. package/dist/openapi/index.mjs +391 -368
  20. package/dist/shared/server.B5ntjz_x.d.mts +800 -0
  21. package/dist/shared/server.B5ntjz_x.d.ts +800 -0
  22. package/dist/shared/server.BGG3eatg.mjs +315 -0
  23. package/dist/shared/server.BM9lK_Yv.mjs +523 -0
  24. package/dist/shared/server.BxyeakF-.d.mts +39 -0
  25. package/dist/shared/server.C1RJffw4.mjs +30 -0
  26. package/dist/shared/server.CjPiuQYH.d.mts +51 -0
  27. package/dist/shared/server.CjPiuQYH.d.ts +51 -0
  28. package/dist/shared/server.CmNVzZVe.mjs +156 -0
  29. package/dist/shared/server.Coz0LFSE.d.ts +39 -0
  30. package/dist/shared/server.X8F6e8eV.mjs +499 -0
  31. package/package.json +13 -31
  32. package/dist/adapters/standard/index.d.mts +0 -31
  33. package/dist/adapters/standard/index.d.ts +0 -31
  34. package/dist/adapters/standard/index.mjs +0 -9
  35. package/dist/plugins/index.d.mts +0 -160
  36. package/dist/plugins/index.d.ts +0 -160
  37. package/dist/plugins/index.mjs +0 -288
  38. package/dist/shared/server.B--sAUhn.mjs +0 -254
  39. package/dist/shared/server.BCcLYvdF.d.mts +0 -56
  40. package/dist/shared/server.CHV9AQHl.mjs +0 -412
  41. package/dist/shared/server.CdeqmULw.d.ts +0 -56
  42. package/dist/shared/server.DHezmW6C.d.mts +0 -23
  43. package/dist/shared/server.Da-qLzdU.d.ts +0 -23
  44. package/dist/shared/server.DecvGKtb.d.mts +0 -242
  45. package/dist/shared/server.DecvGKtb.d.ts +0 -242
  46. package/dist/shared/server.Kxw442A9.mjs +0 -247
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@temporary-name/server",
3
3
  "type": "module",
4
- "version": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
4
+ "version": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.stainless.com/",
7
7
  "repository": {
@@ -23,15 +23,10 @@
23
23
  "import": "./dist/helpers/index.mjs",
24
24
  "default": "./dist/helpers/index.mjs"
25
25
  },
26
- "./plugins": {
27
- "types": "./dist/plugins/index.d.mts",
28
- "import": "./dist/plugins/index.mjs",
29
- "default": "./dist/plugins/index.mjs"
30
- },
31
26
  "./standard": {
32
- "types": "./dist/adapters/standard/index.d.mts",
33
- "import": "./dist/adapters/standard/index.mjs",
34
- "default": "./dist/adapters/standard/index.mjs"
27
+ "types": "./dist/handler/index.d.mts",
28
+ "import": "./dist/handler/index.mjs",
29
+ "default": "./dist/handler/index.mjs"
35
30
  },
36
31
  "./fetch": {
37
32
  "types": "./dist/adapters/fetch/index.d.mts",
@@ -57,31 +52,17 @@
57
52
  "files": [
58
53
  "dist"
59
54
  ],
60
- "peerDependencies": {
61
- "drizzle-orm": "^0.44.5",
62
- "drizzle-zod": "^0.8.3"
63
- },
64
- "peerDependenciesMeta": {
65
- "drizzle-orm": {
66
- "optional": true
67
- },
68
- "drizzle-zod": {
69
- "optional": true
70
- }
71
- },
72
55
  "dependencies": {
73
56
  "cookie": "^1.0.2",
74
57
  "rou3": "^0.7.7",
75
58
  "zod": "^4.1.12",
76
- "@temporary-name/contract": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
77
- "@temporary-name/interop": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
78
- "@temporary-name/json-schema": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
79
- "@temporary-name/shared": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
80
- "@temporary-name/standard-server": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
81
- "@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
82
- "@temporary-name/standard-server-fetch": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
83
- "@temporary-name/standard-server-node": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2",
84
- "@temporary-name/zod": "1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2"
59
+ "@temporary-name/interop": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
60
+ "@temporary-name/shared": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
61
+ "@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
62
+ "@temporary-name/standard-server": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
63
+ "@temporary-name/standard-server-fetch": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
64
+ "@temporary-name/zod": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e",
65
+ "@temporary-name/standard-server-node": "1.9.3-alpha.205fb2d0874fa3b8bbf83112a63016937380442e"
85
66
  },
86
67
  "devDependencies": {
87
68
  "@types/supertest": "^6.0.3",
@@ -91,6 +72,7 @@
91
72
  "scripts": {
92
73
  "build": "unbuild",
93
74
  "build:watch": "pnpm run build --watch",
94
- "type:check": "tsc -b"
75
+ "clean": "tsc -b --clean",
76
+ "lint:tsc": "tsc -b"
95
77
  }
96
78
  }
@@ -1,31 +0,0 @@
1
- export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.BCcLYvdF.mjs';
2
- import { AnyProcedure, AnyRouter } from '@temporary-name/server';
3
- import { ORPCError, HTTPPath } from '@temporary-name/shared';
4
- import { StandardLazyRequest, StandardHeaders, StandardResponse } from '@temporary-name/standard-server';
5
- export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.DHezmW6C.mjs';
6
- import '@temporary-name/contract';
7
- import '../../shared/server.DecvGKtb.mjs';
8
-
9
- declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
10
- path: unknown;
11
- query: unknown;
12
- headers: StandardHeaders;
13
- body: unknown;
14
- }>;
15
- declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
16
- declare function encodeError(error: ORPCError<any, any>): StandardResponse;
17
-
18
- type StandardMatchResult = {
19
- path: readonly string[];
20
- procedure: AnyProcedure;
21
- params?: Record<string, string>;
22
- } | undefined;
23
- declare class StandardOpenAPIMatcher {
24
- private readonly tree;
25
- private pendingRouters;
26
- init(router: AnyRouter, path?: readonly string[]): void;
27
- match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
28
- }
29
-
30
- export { StandardOpenAPIMatcher, decode, encode, encodeError };
31
- export type { StandardMatchResult };
@@ -1,31 +0,0 @@
1
- export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.CdeqmULw.js';
2
- import { AnyProcedure, AnyRouter } from '@temporary-name/server';
3
- import { ORPCError, HTTPPath } from '@temporary-name/shared';
4
- import { StandardLazyRequest, StandardHeaders, StandardResponse } from '@temporary-name/standard-server';
5
- export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.Da-qLzdU.js';
6
- import '@temporary-name/contract';
7
- import '../../shared/server.DecvGKtb.js';
8
-
9
- declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
10
- path: unknown;
11
- query: unknown;
12
- headers: StandardHeaders;
13
- body: unknown;
14
- }>;
15
- declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
16
- declare function encodeError(error: ORPCError<any, any>): StandardResponse;
17
-
18
- type StandardMatchResult = {
19
- path: readonly string[];
20
- procedure: AnyProcedure;
21
- params?: Record<string, string>;
22
- } | undefined;
23
- declare class StandardOpenAPIMatcher {
24
- private readonly tree;
25
- private pendingRouters;
26
- init(router: AnyRouter, path?: readonly string[]): void;
27
- match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
28
- }
29
-
30
- export { StandardOpenAPIMatcher, decode, encode, encodeError };
31
- export type { StandardMatchResult };
@@ -1,9 +0,0 @@
1
- export { C as CompositeStandardHandlerPlugin, S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.B--sAUhn.mjs';
2
- import '@temporary-name/shared';
3
- import '@temporary-name/standard-server';
4
- import '../../shared/server.CHV9AQHl.mjs';
5
- import '@temporary-name/contract';
6
- import '@temporary-name/zod';
7
- import '../../shared/server.Kxw442A9.mjs';
8
- import '@temporary-name/server';
9
- import 'rou3';
@@ -1,160 +0,0 @@
1
- import { Value, Promisable, ORPCError } from '@temporary-name/shared';
2
- import { StandardRequest, StandardHeaders } from '@temporary-name/standard-server';
3
- import { BatchResponseBodyItem } from '@temporary-name/standard-server/batch';
4
- import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.BCcLYvdF.mjs';
5
- import { C as Context, H as ProcedureClientInterceptorOptions } from '../shared/server.DecvGKtb.mjs';
6
- import { Meta } from '@temporary-name/contract';
7
-
8
- interface BatchHandlerOptions<T extends Context> {
9
- /**
10
- * The max size of the batch allowed.
11
- *
12
- * @default 10
13
- */
14
- maxSize?: Value<Promisable<number>, [StandardHandlerInterceptorOptions<T>]>;
15
- /**
16
- * Map the request before processing it.
17
- *
18
- * @default merged back batch request headers into the request
19
- */
20
- mapRequestItem?(request: StandardRequest, batchOptions: StandardHandlerInterceptorOptions<T>): StandardRequest;
21
- /**
22
- * Success batch response status code.
23
- *
24
- * @default 207
25
- */
26
- successStatus?: Value<Promisable<number>, [
27
- responses: Promise<BatchResponseBodyItem>[],
28
- batchOptions: StandardHandlerInterceptorOptions<T>
29
- ]>;
30
- /**
31
- * success batch response headers.
32
- *
33
- * @default {}
34
- */
35
- headers?: Value<Promisable<StandardHeaders>, [
36
- responses: Promise<BatchResponseBodyItem>[],
37
- batchOptions: StandardHandlerInterceptorOptions<T>
38
- ]>;
39
- }
40
- /**
41
- * The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
42
- * reducing the overhead of sending each one separately.
43
- *
44
- * @see {@link https://orpc.unnoq.com/docs/plugins/batch-requests Batch Requests Plugin Docs}
45
- */
46
- declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
47
- private readonly maxSize;
48
- private readonly mapRequestItem;
49
- private readonly successStatus;
50
- private readonly headers;
51
- order: number;
52
- constructor(options?: BatchHandlerOptions<T>);
53
- init(options: StandardHandlerOptions<T>): void;
54
- }
55
-
56
- interface CORSOptions<T extends Context> {
57
- origin?: Value<Promisable<string | readonly string[] | null | undefined>, [
58
- origin: string,
59
- options: StandardHandlerInterceptorOptions<T>
60
- ]>;
61
- timingOrigin?: Value<Promisable<string | readonly string[] | null | undefined>, [
62
- origin: string,
63
- options: StandardHandlerInterceptorOptions<T>
64
- ]>;
65
- allowMethods?: readonly string[];
66
- allowHeaders?: readonly string[];
67
- maxAge?: number;
68
- credentials?: boolean;
69
- exposeHeaders?: readonly string[];
70
- }
71
- /**
72
- * CORSPlugin is a plugin for oRPC that allows you to configure CORS for your API.
73
- *
74
- * @see {@link https://orpc.unnoq.com/docs/plugins/cors CORS Plugin Docs}
75
- */
76
- declare class CORSPlugin<T extends Context> implements StandardHandlerPlugin<T> {
77
- private readonly options;
78
- order: number;
79
- constructor(options?: CORSOptions<T>);
80
- init(options: StandardHandlerOptions<T>): void;
81
- }
82
-
83
- interface RequestHeadersPluginContext {
84
- reqHeaders?: Headers;
85
- }
86
- /**
87
- * The Request Headers Plugin injects a `reqHeaders` instance into the context,
88
- * allowing access to request headers in oRPC.
89
- *
90
- * @see {@link https://orpc.unnoq.com/docs/plugins/request-headers Request Headers Plugin Docs}
91
- */
92
- declare class RequestHeadersPlugin<T extends RequestHeadersPluginContext> implements StandardHandlerPlugin<T> {
93
- init(options: StandardHandlerOptions<T>): void;
94
- }
95
-
96
- interface ResponseHeadersPluginContext {
97
- resHeaders?: Headers;
98
- }
99
- /**
100
- * The Response Headers Plugin allows you to set response headers in oRPC.
101
- * It injects a resHeaders instance into the context, enabling you to modify response headers easily.
102
- *
103
- * @see {@link https://orpc.unnoq.com/docs/plugins/response-headers Response Headers Plugin Docs}
104
- */
105
- declare class ResponseHeadersPlugin<T extends ResponseHeadersPluginContext> implements StandardHandlerPlugin<T> {
106
- init(options: StandardHandlerOptions<T>): void;
107
- }
108
-
109
- interface SimpleCsrfProtectionHandlerPluginOptions<T extends Context> {
110
- /**
111
- * The name of the header to check.
112
- *
113
- * @default 'x-csrf-token'
114
- */
115
- headerName?: Value<Promisable<string>, [options: StandardHandlerInterceptorOptions<T>]>;
116
- /**
117
- * The value of the header to check.
118
- *
119
- * @default 'orpc'
120
- *
121
- */
122
- headerValue?: Value<Promisable<string>, [options: StandardHandlerInterceptorOptions<T>]>;
123
- /**
124
- * Exclude a procedure from the plugin.
125
- *
126
- * @default false
127
- *
128
- */
129
- exclude?: Value<Promisable<boolean>, [
130
- options: ProcedureClientInterceptorOptions<T, Record<never, never>, Meta>
131
- ]>;
132
- /**
133
- * The error thrown when the CSRF token is invalid.
134
- *
135
- * @default new ORPCError('CSRF_TOKEN_MISMATCH', {
136
- * status: 403,
137
- * message: 'Invalid CSRF token',
138
- * })
139
- */
140
- error?: InstanceType<typeof ORPCError>;
141
- }
142
- /**
143
- * This plugin adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
144
- * It helps ensure that requests to your procedures originate from JavaScript code,
145
- * not from other sources like standard HTML forms or direct browser navigation.
146
- *
147
- * @see {@link https://orpc.unnoq.com/docs/plugins/simple-csrf-protection Simple CSRF Protection Plugin Docs}
148
- */
149
- declare class SimpleCsrfProtectionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
150
- private readonly headerName;
151
- private readonly headerValue;
152
- private readonly exclude;
153
- private readonly error;
154
- constructor(options?: SimpleCsrfProtectionHandlerPluginOptions<T>);
155
- order: number;
156
- init(options: StandardHandlerOptions<T>): void;
157
- }
158
-
159
- export { BatchHandlerPlugin, CORSPlugin, RequestHeadersPlugin, ResponseHeadersPlugin, SimpleCsrfProtectionHandlerPlugin };
160
- export type { BatchHandlerOptions, CORSOptions, RequestHeadersPluginContext, ResponseHeadersPluginContext, SimpleCsrfProtectionHandlerPluginOptions };
@@ -1,160 +0,0 @@
1
- import { Value, Promisable, ORPCError } from '@temporary-name/shared';
2
- import { StandardRequest, StandardHeaders } from '@temporary-name/standard-server';
3
- import { BatchResponseBodyItem } from '@temporary-name/standard-server/batch';
4
- import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.CdeqmULw.js';
5
- import { C as Context, H as ProcedureClientInterceptorOptions } from '../shared/server.DecvGKtb.js';
6
- import { Meta } from '@temporary-name/contract';
7
-
8
- interface BatchHandlerOptions<T extends Context> {
9
- /**
10
- * The max size of the batch allowed.
11
- *
12
- * @default 10
13
- */
14
- maxSize?: Value<Promisable<number>, [StandardHandlerInterceptorOptions<T>]>;
15
- /**
16
- * Map the request before processing it.
17
- *
18
- * @default merged back batch request headers into the request
19
- */
20
- mapRequestItem?(request: StandardRequest, batchOptions: StandardHandlerInterceptorOptions<T>): StandardRequest;
21
- /**
22
- * Success batch response status code.
23
- *
24
- * @default 207
25
- */
26
- successStatus?: Value<Promisable<number>, [
27
- responses: Promise<BatchResponseBodyItem>[],
28
- batchOptions: StandardHandlerInterceptorOptions<T>
29
- ]>;
30
- /**
31
- * success batch response headers.
32
- *
33
- * @default {}
34
- */
35
- headers?: Value<Promisable<StandardHeaders>, [
36
- responses: Promise<BatchResponseBodyItem>[],
37
- batchOptions: StandardHandlerInterceptorOptions<T>
38
- ]>;
39
- }
40
- /**
41
- * The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
42
- * reducing the overhead of sending each one separately.
43
- *
44
- * @see {@link https://orpc.unnoq.com/docs/plugins/batch-requests Batch Requests Plugin Docs}
45
- */
46
- declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
47
- private readonly maxSize;
48
- private readonly mapRequestItem;
49
- private readonly successStatus;
50
- private readonly headers;
51
- order: number;
52
- constructor(options?: BatchHandlerOptions<T>);
53
- init(options: StandardHandlerOptions<T>): void;
54
- }
55
-
56
- interface CORSOptions<T extends Context> {
57
- origin?: Value<Promisable<string | readonly string[] | null | undefined>, [
58
- origin: string,
59
- options: StandardHandlerInterceptorOptions<T>
60
- ]>;
61
- timingOrigin?: Value<Promisable<string | readonly string[] | null | undefined>, [
62
- origin: string,
63
- options: StandardHandlerInterceptorOptions<T>
64
- ]>;
65
- allowMethods?: readonly string[];
66
- allowHeaders?: readonly string[];
67
- maxAge?: number;
68
- credentials?: boolean;
69
- exposeHeaders?: readonly string[];
70
- }
71
- /**
72
- * CORSPlugin is a plugin for oRPC that allows you to configure CORS for your API.
73
- *
74
- * @see {@link https://orpc.unnoq.com/docs/plugins/cors CORS Plugin Docs}
75
- */
76
- declare class CORSPlugin<T extends Context> implements StandardHandlerPlugin<T> {
77
- private readonly options;
78
- order: number;
79
- constructor(options?: CORSOptions<T>);
80
- init(options: StandardHandlerOptions<T>): void;
81
- }
82
-
83
- interface RequestHeadersPluginContext {
84
- reqHeaders?: Headers;
85
- }
86
- /**
87
- * The Request Headers Plugin injects a `reqHeaders` instance into the context,
88
- * allowing access to request headers in oRPC.
89
- *
90
- * @see {@link https://orpc.unnoq.com/docs/plugins/request-headers Request Headers Plugin Docs}
91
- */
92
- declare class RequestHeadersPlugin<T extends RequestHeadersPluginContext> implements StandardHandlerPlugin<T> {
93
- init(options: StandardHandlerOptions<T>): void;
94
- }
95
-
96
- interface ResponseHeadersPluginContext {
97
- resHeaders?: Headers;
98
- }
99
- /**
100
- * The Response Headers Plugin allows you to set response headers in oRPC.
101
- * It injects a resHeaders instance into the context, enabling you to modify response headers easily.
102
- *
103
- * @see {@link https://orpc.unnoq.com/docs/plugins/response-headers Response Headers Plugin Docs}
104
- */
105
- declare class ResponseHeadersPlugin<T extends ResponseHeadersPluginContext> implements StandardHandlerPlugin<T> {
106
- init(options: StandardHandlerOptions<T>): void;
107
- }
108
-
109
- interface SimpleCsrfProtectionHandlerPluginOptions<T extends Context> {
110
- /**
111
- * The name of the header to check.
112
- *
113
- * @default 'x-csrf-token'
114
- */
115
- headerName?: Value<Promisable<string>, [options: StandardHandlerInterceptorOptions<T>]>;
116
- /**
117
- * The value of the header to check.
118
- *
119
- * @default 'orpc'
120
- *
121
- */
122
- headerValue?: Value<Promisable<string>, [options: StandardHandlerInterceptorOptions<T>]>;
123
- /**
124
- * Exclude a procedure from the plugin.
125
- *
126
- * @default false
127
- *
128
- */
129
- exclude?: Value<Promisable<boolean>, [
130
- options: ProcedureClientInterceptorOptions<T, Record<never, never>, Meta>
131
- ]>;
132
- /**
133
- * The error thrown when the CSRF token is invalid.
134
- *
135
- * @default new ORPCError('CSRF_TOKEN_MISMATCH', {
136
- * status: 403,
137
- * message: 'Invalid CSRF token',
138
- * })
139
- */
140
- error?: InstanceType<typeof ORPCError>;
141
- }
142
- /**
143
- * This plugin adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
144
- * It helps ensure that requests to your procedures originate from JavaScript code,
145
- * not from other sources like standard HTML forms or direct browser navigation.
146
- *
147
- * @see {@link https://orpc.unnoq.com/docs/plugins/simple-csrf-protection Simple CSRF Protection Plugin Docs}
148
- */
149
- declare class SimpleCsrfProtectionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
150
- private readonly headerName;
151
- private readonly headerValue;
152
- private readonly exclude;
153
- private readonly error;
154
- constructor(options?: SimpleCsrfProtectionHandlerPluginOptions<T>);
155
- order: number;
156
- init(options: StandardHandlerOptions<T>): void;
157
- }
158
-
159
- export { BatchHandlerPlugin, CORSPlugin, RequestHeadersPlugin, ResponseHeadersPlugin, SimpleCsrfProtectionHandlerPlugin };
160
- export type { BatchHandlerOptions, CORSOptions, RequestHeadersPluginContext, ResponseHeadersPluginContext, SimpleCsrfProtectionHandlerPluginOptions };