@orpc/client 0.0.0-next.d16a1b6 → 0.0.0-next.d177d36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -17
- package/dist/adapters/fetch/index.d.mts +20 -16
- package/dist/adapters/fetch/index.d.ts +20 -16
- package/dist/adapters/fetch/index.mjs +11 -14
- package/dist/adapters/message-port/index.d.mts +59 -0
- package/dist/adapters/message-port/index.d.ts +59 -0
- package/dist/adapters/message-port/index.mjs +71 -0
- package/dist/adapters/standard/index.d.mts +8 -147
- package/dist/adapters/standard/index.d.ts +8 -147
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/adapters/websocket/index.d.mts +29 -0
- package/dist/adapters/websocket/index.d.ts +29 -0
- package/dist/adapters/websocket/index.mjs +31 -0
- package/dist/index.d.mts +36 -20
- package/dist/index.d.ts +36 -20
- package/dist/index.mjs +35 -33
- package/dist/plugins/index.d.mts +202 -0
- package/dist/plugins/index.d.ts +202 -0
- package/dist/plugins/index.mjs +389 -0
- package/dist/shared/client.4TS_0JaO.d.mts +29 -0
- package/dist/shared/client.4TS_0JaO.d.ts +29 -0
- package/dist/shared/client.7UM0t5o-.d.ts +91 -0
- package/dist/shared/client.BMoG_EdN.d.mts +46 -0
- package/dist/shared/client.BdD8cpjs.d.mts +91 -0
- package/dist/shared/client.C0KbSWlC.d.ts +46 -0
- package/dist/shared/client.CRWEpqLB.mjs +175 -0
- package/dist/shared/{client.MkoaGU3v.mjs → client.DpICn1BD.mjs} +174 -140
- package/package.json +21 -5
- package/dist/shared/client.D_CzLDyB.d.mts +0 -42
- package/dist/shared/client.D_CzLDyB.d.ts +0 -42
- package/dist/shared/client.DcaJQZfy.mjs +0 -265
@@ -0,0 +1,202 @@
|
|
1
|
+
import { Value, Promisable } from '@orpc/shared';
|
2
|
+
import { StandardHeaders, StandardRequest } from '@orpc/standard-server';
|
3
|
+
import { BatchResponseMode } from '@orpc/standard-server/batch';
|
4
|
+
import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.BMoG_EdN.mjs';
|
5
|
+
import { a as ClientContext } from '../shared/client.4TS_0JaO.mjs';
|
6
|
+
|
7
|
+
interface BatchLinkPluginGroup<T extends ClientContext> {
|
8
|
+
condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
|
9
|
+
context: T;
|
10
|
+
path?: readonly string[];
|
11
|
+
input?: unknown;
|
12
|
+
}
|
13
|
+
interface BatchLinkPluginOptions<T extends ClientContext> {
|
14
|
+
groups: readonly [BatchLinkPluginGroup<T>, ...BatchLinkPluginGroup<T>[]];
|
15
|
+
/**
|
16
|
+
* The maximum number of requests in the batch.
|
17
|
+
*
|
18
|
+
* @default 10
|
19
|
+
*/
|
20
|
+
maxSize?: Value<Promisable<number>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
21
|
+
/**
|
22
|
+
* The batch response mode.
|
23
|
+
*
|
24
|
+
* @default 'streaming'
|
25
|
+
*/
|
26
|
+
mode?: Value<BatchResponseMode, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
27
|
+
/**
|
28
|
+
* Defines the URL to use for the batch request.
|
29
|
+
*
|
30
|
+
* @default the URL of the first request in the batch + '/__batch__'
|
31
|
+
*/
|
32
|
+
url?: Value<Promisable<string | URL>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
33
|
+
/**
|
34
|
+
* The maximum length of the URL.
|
35
|
+
*
|
36
|
+
* @default 2083
|
37
|
+
*/
|
38
|
+
maxUrlLength?: Value<Promisable<number>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
39
|
+
/**
|
40
|
+
* Defines the HTTP headers to use for the batch request.
|
41
|
+
*
|
42
|
+
* @default The same headers of all requests in the batch
|
43
|
+
*/
|
44
|
+
headers?: Value<Promisable<StandardHeaders>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
45
|
+
/**
|
46
|
+
* Map the batch request items before sending them.
|
47
|
+
*
|
48
|
+
* @default Removes headers that are duplicated in the batch headers.
|
49
|
+
*/
|
50
|
+
mapRequestItem?: (options: StandardLinkClientInterceptorOptions<T> & {
|
51
|
+
batchUrl: URL;
|
52
|
+
batchHeaders: StandardHeaders;
|
53
|
+
}) => StandardRequest;
|
54
|
+
/**
|
55
|
+
* Exclude a request from the batch.
|
56
|
+
*
|
57
|
+
* @default () => false
|
58
|
+
*/
|
59
|
+
exclude?: (options: StandardLinkClientInterceptorOptions<T>) => boolean;
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
|
63
|
+
* reducing the overhead of sending each one separately.
|
64
|
+
*
|
65
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/batch-requests Batch Requests Plugin Docs}
|
66
|
+
*/
|
67
|
+
declare class BatchLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
|
68
|
+
#private;
|
69
|
+
private readonly groups;
|
70
|
+
private readonly maxSize;
|
71
|
+
private readonly batchUrl;
|
72
|
+
private readonly maxUrlLength;
|
73
|
+
private readonly batchHeaders;
|
74
|
+
private readonly mapRequestItem;
|
75
|
+
private readonly exclude;
|
76
|
+
private readonly mode;
|
77
|
+
private pending;
|
78
|
+
order: number;
|
79
|
+
constructor(options: NoInfer<BatchLinkPluginOptions<T>>);
|
80
|
+
init(options: StandardLinkOptions<T>): void;
|
81
|
+
}
|
82
|
+
|
83
|
+
interface DedupeRequestsPluginGroup<T extends ClientContext> {
|
84
|
+
condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
|
85
|
+
/**
|
86
|
+
* The context used for the rest of the request lifecycle.
|
87
|
+
*/
|
88
|
+
context: T;
|
89
|
+
}
|
90
|
+
interface DedupeRequestsPluginOptions<T extends ClientContext> {
|
91
|
+
/**
|
92
|
+
* To enable deduplication, a request must match at least one defined group.
|
93
|
+
* Requests that fall into the same group are considered for deduplication together.
|
94
|
+
*/
|
95
|
+
groups: readonly [DedupeRequestsPluginGroup<T>, ...DedupeRequestsPluginGroup<T>[]];
|
96
|
+
/**
|
97
|
+
* Filters requests to dedupe
|
98
|
+
*
|
99
|
+
* @default (({ request }) => request.method === 'GET')
|
100
|
+
*/
|
101
|
+
filter?: (options: StandardLinkClientInterceptorOptions<T>) => boolean;
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* Prevents duplicate requests by deduplicating similar ones to reduce server load.
|
105
|
+
*
|
106
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/dedupe-requests Dedupe Requests Plugin}
|
107
|
+
*/
|
108
|
+
declare class DedupeRequestsPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
|
109
|
+
#private;
|
110
|
+
order: number;
|
111
|
+
constructor(options: NoInfer<DedupeRequestsPluginOptions<T>>);
|
112
|
+
init(options: StandardLinkOptions<T>): void;
|
113
|
+
}
|
114
|
+
|
115
|
+
interface ClientRetryPluginAttemptOptions<T extends ClientContext> extends StandardLinkInterceptorOptions<T> {
|
116
|
+
lastEventRetry: number | undefined;
|
117
|
+
attemptIndex: number;
|
118
|
+
error: unknown;
|
119
|
+
}
|
120
|
+
interface ClientRetryPluginContext {
|
121
|
+
/**
|
122
|
+
* Maximum retry attempts before throwing
|
123
|
+
* Use `Number.POSITIVE_INFINITY` for infinite retries (e.g., when handling Server-Sent Events).
|
124
|
+
*
|
125
|
+
* @default 0
|
126
|
+
*/
|
127
|
+
retry?: Value<Promisable<number>, [StandardLinkInterceptorOptions<ClientRetryPluginContext>]>;
|
128
|
+
/**
|
129
|
+
* Delay (in ms) before retrying.
|
130
|
+
*
|
131
|
+
* @default (o) => o.lastEventRetry ?? 2000
|
132
|
+
*/
|
133
|
+
retryDelay?: Value<Promisable<number>, [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>]>;
|
134
|
+
/**
|
135
|
+
* Determine should retry or not.
|
136
|
+
*
|
137
|
+
* @default true
|
138
|
+
*/
|
139
|
+
shouldRetry?: Value<Promisable<boolean>, [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>]>;
|
140
|
+
/**
|
141
|
+
* The hook called when retrying, and return the unsubscribe function.
|
142
|
+
*/
|
143
|
+
onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | ((isSuccess: boolean) => void);
|
144
|
+
}
|
145
|
+
declare class ClientRetryPluginInvalidEventIteratorRetryResponse extends Error {
|
146
|
+
}
|
147
|
+
interface ClientRetryPluginOptions {
|
148
|
+
default?: ClientRetryPluginContext;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* The Client Retry Plugin enables retrying client calls when errors occur.
|
152
|
+
*
|
153
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/client-retry Client Retry Plugin Docs}
|
154
|
+
*/
|
155
|
+
declare class ClientRetryPlugin<T extends ClientRetryPluginContext> implements StandardLinkPlugin<T> {
|
156
|
+
private readonly defaultRetry;
|
157
|
+
private readonly defaultRetryDelay;
|
158
|
+
private readonly defaultShouldRetry;
|
159
|
+
private readonly defaultOnRetry;
|
160
|
+
constructor(options?: ClientRetryPluginOptions);
|
161
|
+
init(options: StandardLinkOptions<T>): void;
|
162
|
+
}
|
163
|
+
|
164
|
+
interface SimpleCsrfProtectionLinkPluginOptions<T extends ClientContext> {
|
165
|
+
/**
|
166
|
+
* The name of the header to check.
|
167
|
+
*
|
168
|
+
* @default 'x-csrf-token'
|
169
|
+
*/
|
170
|
+
headerName?: Value<Promisable<string>, [options: StandardLinkClientInterceptorOptions<T>]>;
|
171
|
+
/**
|
172
|
+
* The value of the header to check.
|
173
|
+
*
|
174
|
+
* @default 'orpc'
|
175
|
+
*
|
176
|
+
*/
|
177
|
+
headerValue?: Value<Promisable<string>, [options: StandardLinkClientInterceptorOptions<T>]>;
|
178
|
+
/**
|
179
|
+
* Exclude a procedure from the plugin.
|
180
|
+
*
|
181
|
+
* @default false
|
182
|
+
*/
|
183
|
+
exclude?: Value<Promisable<boolean>, [options: StandardLinkClientInterceptorOptions<T>]>;
|
184
|
+
}
|
185
|
+
/**
|
186
|
+
* This plugin adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
|
187
|
+
* It helps ensure that requests to your procedures originate from JavaScript code,
|
188
|
+
* not from other sources like standard HTML forms or direct browser navigation.
|
189
|
+
*
|
190
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/simple-csrf-protection Simple CSRF Protection Plugin Docs}
|
191
|
+
*/
|
192
|
+
declare class SimpleCsrfProtectionLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
|
193
|
+
private readonly headerName;
|
194
|
+
private readonly headerValue;
|
195
|
+
private readonly exclude;
|
196
|
+
constructor(options?: SimpleCsrfProtectionLinkPluginOptions<T>);
|
197
|
+
order: number;
|
198
|
+
init(options: StandardLinkOptions<T>): void;
|
199
|
+
}
|
200
|
+
|
201
|
+
export { BatchLinkPlugin, ClientRetryPlugin, ClientRetryPluginInvalidEventIteratorRetryResponse, DedupeRequestsPlugin, SimpleCsrfProtectionLinkPlugin };
|
202
|
+
export type { BatchLinkPluginGroup, BatchLinkPluginOptions, ClientRetryPluginAttemptOptions, ClientRetryPluginContext, ClientRetryPluginOptions, DedupeRequestsPluginGroup, DedupeRequestsPluginOptions, SimpleCsrfProtectionLinkPluginOptions };
|
@@ -0,0 +1,202 @@
|
|
1
|
+
import { Value, Promisable } from '@orpc/shared';
|
2
|
+
import { StandardHeaders, StandardRequest } from '@orpc/standard-server';
|
3
|
+
import { BatchResponseMode } from '@orpc/standard-server/batch';
|
4
|
+
import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.C0KbSWlC.js';
|
5
|
+
import { a as ClientContext } from '../shared/client.4TS_0JaO.js';
|
6
|
+
|
7
|
+
interface BatchLinkPluginGroup<T extends ClientContext> {
|
8
|
+
condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
|
9
|
+
context: T;
|
10
|
+
path?: readonly string[];
|
11
|
+
input?: unknown;
|
12
|
+
}
|
13
|
+
interface BatchLinkPluginOptions<T extends ClientContext> {
|
14
|
+
groups: readonly [BatchLinkPluginGroup<T>, ...BatchLinkPluginGroup<T>[]];
|
15
|
+
/**
|
16
|
+
* The maximum number of requests in the batch.
|
17
|
+
*
|
18
|
+
* @default 10
|
19
|
+
*/
|
20
|
+
maxSize?: Value<Promisable<number>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
21
|
+
/**
|
22
|
+
* The batch response mode.
|
23
|
+
*
|
24
|
+
* @default 'streaming'
|
25
|
+
*/
|
26
|
+
mode?: Value<BatchResponseMode, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
27
|
+
/**
|
28
|
+
* Defines the URL to use for the batch request.
|
29
|
+
*
|
30
|
+
* @default the URL of the first request in the batch + '/__batch__'
|
31
|
+
*/
|
32
|
+
url?: Value<Promisable<string | URL>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
33
|
+
/**
|
34
|
+
* The maximum length of the URL.
|
35
|
+
*
|
36
|
+
* @default 2083
|
37
|
+
*/
|
38
|
+
maxUrlLength?: Value<Promisable<number>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
39
|
+
/**
|
40
|
+
* Defines the HTTP headers to use for the batch request.
|
41
|
+
*
|
42
|
+
* @default The same headers of all requests in the batch
|
43
|
+
*/
|
44
|
+
headers?: Value<Promisable<StandardHeaders>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
|
45
|
+
/**
|
46
|
+
* Map the batch request items before sending them.
|
47
|
+
*
|
48
|
+
* @default Removes headers that are duplicated in the batch headers.
|
49
|
+
*/
|
50
|
+
mapRequestItem?: (options: StandardLinkClientInterceptorOptions<T> & {
|
51
|
+
batchUrl: URL;
|
52
|
+
batchHeaders: StandardHeaders;
|
53
|
+
}) => StandardRequest;
|
54
|
+
/**
|
55
|
+
* Exclude a request from the batch.
|
56
|
+
*
|
57
|
+
* @default () => false
|
58
|
+
*/
|
59
|
+
exclude?: (options: StandardLinkClientInterceptorOptions<T>) => boolean;
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* The Batch Requests Plugin allows you to combine multiple requests and responses into a single batch,
|
63
|
+
* reducing the overhead of sending each one separately.
|
64
|
+
*
|
65
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/batch-requests Batch Requests Plugin Docs}
|
66
|
+
*/
|
67
|
+
declare class BatchLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
|
68
|
+
#private;
|
69
|
+
private readonly groups;
|
70
|
+
private readonly maxSize;
|
71
|
+
private readonly batchUrl;
|
72
|
+
private readonly maxUrlLength;
|
73
|
+
private readonly batchHeaders;
|
74
|
+
private readonly mapRequestItem;
|
75
|
+
private readonly exclude;
|
76
|
+
private readonly mode;
|
77
|
+
private pending;
|
78
|
+
order: number;
|
79
|
+
constructor(options: NoInfer<BatchLinkPluginOptions<T>>);
|
80
|
+
init(options: StandardLinkOptions<T>): void;
|
81
|
+
}
|
82
|
+
|
83
|
+
interface DedupeRequestsPluginGroup<T extends ClientContext> {
|
84
|
+
condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
|
85
|
+
/**
|
86
|
+
* The context used for the rest of the request lifecycle.
|
87
|
+
*/
|
88
|
+
context: T;
|
89
|
+
}
|
90
|
+
interface DedupeRequestsPluginOptions<T extends ClientContext> {
|
91
|
+
/**
|
92
|
+
* To enable deduplication, a request must match at least one defined group.
|
93
|
+
* Requests that fall into the same group are considered for deduplication together.
|
94
|
+
*/
|
95
|
+
groups: readonly [DedupeRequestsPluginGroup<T>, ...DedupeRequestsPluginGroup<T>[]];
|
96
|
+
/**
|
97
|
+
* Filters requests to dedupe
|
98
|
+
*
|
99
|
+
* @default (({ request }) => request.method === 'GET')
|
100
|
+
*/
|
101
|
+
filter?: (options: StandardLinkClientInterceptorOptions<T>) => boolean;
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* Prevents duplicate requests by deduplicating similar ones to reduce server load.
|
105
|
+
*
|
106
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/dedupe-requests Dedupe Requests Plugin}
|
107
|
+
*/
|
108
|
+
declare class DedupeRequestsPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
|
109
|
+
#private;
|
110
|
+
order: number;
|
111
|
+
constructor(options: NoInfer<DedupeRequestsPluginOptions<T>>);
|
112
|
+
init(options: StandardLinkOptions<T>): void;
|
113
|
+
}
|
114
|
+
|
115
|
+
interface ClientRetryPluginAttemptOptions<T extends ClientContext> extends StandardLinkInterceptorOptions<T> {
|
116
|
+
lastEventRetry: number | undefined;
|
117
|
+
attemptIndex: number;
|
118
|
+
error: unknown;
|
119
|
+
}
|
120
|
+
interface ClientRetryPluginContext {
|
121
|
+
/**
|
122
|
+
* Maximum retry attempts before throwing
|
123
|
+
* Use `Number.POSITIVE_INFINITY` for infinite retries (e.g., when handling Server-Sent Events).
|
124
|
+
*
|
125
|
+
* @default 0
|
126
|
+
*/
|
127
|
+
retry?: Value<Promisable<number>, [StandardLinkInterceptorOptions<ClientRetryPluginContext>]>;
|
128
|
+
/**
|
129
|
+
* Delay (in ms) before retrying.
|
130
|
+
*
|
131
|
+
* @default (o) => o.lastEventRetry ?? 2000
|
132
|
+
*/
|
133
|
+
retryDelay?: Value<Promisable<number>, [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>]>;
|
134
|
+
/**
|
135
|
+
* Determine should retry or not.
|
136
|
+
*
|
137
|
+
* @default true
|
138
|
+
*/
|
139
|
+
shouldRetry?: Value<Promisable<boolean>, [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>]>;
|
140
|
+
/**
|
141
|
+
* The hook called when retrying, and return the unsubscribe function.
|
142
|
+
*/
|
143
|
+
onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | ((isSuccess: boolean) => void);
|
144
|
+
}
|
145
|
+
declare class ClientRetryPluginInvalidEventIteratorRetryResponse extends Error {
|
146
|
+
}
|
147
|
+
interface ClientRetryPluginOptions {
|
148
|
+
default?: ClientRetryPluginContext;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* The Client Retry Plugin enables retrying client calls when errors occur.
|
152
|
+
*
|
153
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/client-retry Client Retry Plugin Docs}
|
154
|
+
*/
|
155
|
+
declare class ClientRetryPlugin<T extends ClientRetryPluginContext> implements StandardLinkPlugin<T> {
|
156
|
+
private readonly defaultRetry;
|
157
|
+
private readonly defaultRetryDelay;
|
158
|
+
private readonly defaultShouldRetry;
|
159
|
+
private readonly defaultOnRetry;
|
160
|
+
constructor(options?: ClientRetryPluginOptions);
|
161
|
+
init(options: StandardLinkOptions<T>): void;
|
162
|
+
}
|
163
|
+
|
164
|
+
interface SimpleCsrfProtectionLinkPluginOptions<T extends ClientContext> {
|
165
|
+
/**
|
166
|
+
* The name of the header to check.
|
167
|
+
*
|
168
|
+
* @default 'x-csrf-token'
|
169
|
+
*/
|
170
|
+
headerName?: Value<Promisable<string>, [options: StandardLinkClientInterceptorOptions<T>]>;
|
171
|
+
/**
|
172
|
+
* The value of the header to check.
|
173
|
+
*
|
174
|
+
* @default 'orpc'
|
175
|
+
*
|
176
|
+
*/
|
177
|
+
headerValue?: Value<Promisable<string>, [options: StandardLinkClientInterceptorOptions<T>]>;
|
178
|
+
/**
|
179
|
+
* Exclude a procedure from the plugin.
|
180
|
+
*
|
181
|
+
* @default false
|
182
|
+
*/
|
183
|
+
exclude?: Value<Promisable<boolean>, [options: StandardLinkClientInterceptorOptions<T>]>;
|
184
|
+
}
|
185
|
+
/**
|
186
|
+
* This plugin adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
|
187
|
+
* It helps ensure that requests to your procedures originate from JavaScript code,
|
188
|
+
* not from other sources like standard HTML forms or direct browser navigation.
|
189
|
+
*
|
190
|
+
* @see {@link https://orpc.unnoq.com/docs/plugins/simple-csrf-protection Simple CSRF Protection Plugin Docs}
|
191
|
+
*/
|
192
|
+
declare class SimpleCsrfProtectionLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
|
193
|
+
private readonly headerName;
|
194
|
+
private readonly headerValue;
|
195
|
+
private readonly exclude;
|
196
|
+
constructor(options?: SimpleCsrfProtectionLinkPluginOptions<T>);
|
197
|
+
order: number;
|
198
|
+
init(options: StandardLinkOptions<T>): void;
|
199
|
+
}
|
200
|
+
|
201
|
+
export { BatchLinkPlugin, ClientRetryPlugin, ClientRetryPluginInvalidEventIteratorRetryResponse, DedupeRequestsPlugin, SimpleCsrfProtectionLinkPlugin };
|
202
|
+
export type { BatchLinkPluginGroup, BatchLinkPluginOptions, ClientRetryPluginAttemptOptions, ClientRetryPluginContext, ClientRetryPluginOptions, DedupeRequestsPluginGroup, DedupeRequestsPluginOptions, SimpleCsrfProtectionLinkPluginOptions };
|