@orpc/client 1.14.11 → 1.14.12

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 (38) hide show
  1. package/README.md +68 -52
  2. package/dist/adapters/fetch/index.d.mts +35 -54
  3. package/dist/adapters/fetch/index.d.ts +35 -54
  4. package/dist/adapters/fetch/index.mjs +27 -74
  5. package/dist/adapters/message-port/index.d.mts +30 -25
  6. package/dist/adapters/message-port/index.d.ts +30 -25
  7. package/dist/adapters/message-port/index.mjs +30 -39
  8. package/dist/adapters/standard/index.d.mts +9 -59
  9. package/dist/adapters/standard/index.d.ts +9 -59
  10. package/dist/adapters/standard/index.mjs +5 -5
  11. package/dist/adapters/websocket/index.d.mts +21 -113
  12. package/dist/adapters/websocket/index.d.ts +21 -113
  13. package/dist/adapters/websocket/index.mjs +37 -95
  14. package/dist/index.d.mts +184 -75
  15. package/dist/index.d.ts +184 -75
  16. package/dist/index.mjs +63 -74
  17. package/dist/plugins/index.d.mts +122 -191
  18. package/dist/plugins/index.d.ts +122 -191
  19. package/dist/plugins/index.mjs +281 -627
  20. package/dist/shared/client.2jUAqzYU.d.ts +45 -0
  21. package/dist/shared/client.B3pNRBih.d.ts +91 -0
  22. package/dist/shared/client.BFAVy68H.d.mts +91 -0
  23. package/dist/shared/client.BLtwTQUg.mjs +40 -0
  24. package/dist/shared/client.C1VUaWTu.mjs +404 -0
  25. package/dist/shared/client.CpCa3si8.d.mts +45 -0
  26. package/dist/shared/client.DrCRv_sG.mjs +174 -0
  27. package/dist/shared/client.i2uoJbEp.d.mts +83 -0
  28. package/dist/shared/client.i2uoJbEp.d.ts +83 -0
  29. package/package.json +7 -7
  30. package/dist/shared/client.8f4DNmdE.d.mts +0 -96
  31. package/dist/shared/client.BBZBQID8.d.mts +0 -167
  32. package/dist/shared/client.BBZBQID8.d.ts +0 -167
  33. package/dist/shared/client.BMKYqpdy.d.ts +0 -96
  34. package/dist/shared/client.BRJnOJ0R.mjs +0 -174
  35. package/dist/shared/client.BdItY5DT.d.mts +0 -111
  36. package/dist/shared/client.BdItY5DT.d.ts +0 -111
  37. package/dist/shared/client.Dnfj8jnT.mjs +0 -92
  38. package/dist/shared/client.DqYwRDUO.mjs +0 -343
@@ -1,253 +1,168 @@
1
1
  import { Value, Promisable } from '@orpc/shared';
2
- import { StandardUrl, StandardHeaders, StandardRequest, StandardLazyResponse } from '@standardserver/core';
3
- import { C as ClientContext } from '../shared/client.BBZBQID8.js';
4
- import { c as StandardLinkPlugin, d as StandardLinkTransportInterceptorOptions, b as StandardLinkOptions, e as StandardLinkInterceptorOptions } from '../shared/client.BMKYqpdy.js';
2
+ import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
3
+ import { BatchResponseMode } from '@orpc/standard-server/batch';
4
+ import { b as ClientContext } from '../shared/client.i2uoJbEp.js';
5
+ import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.2jUAqzYU.js';
5
6
 
6
- type BatchLinkPluginMode = 'streaming' | 'buffered';
7
7
  interface BatchLinkPluginGroup<T extends ClientContext> {
8
- /**
9
- * Determines whether a request should be included in this batch group.
10
- * Requests will be evaluated against each group's condition in order,
11
- * and included in the first group whose condition returns true.
12
- * If no group's condition returns true, the request will not be batched.
13
- */
14
- condition: Value<boolean, [options: StandardLinkTransportInterceptorOptions<T>]>;
15
- /**
16
- * The client context applied to requests in this batch group for the remainder of the link chain.
17
- */
18
- context: Value<T, [items: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
19
- /**
20
- * The path segments applied to requests in this batch group for the remainder of the link chain.
21
- *
22
- * @default []
23
- */
24
- path?: Value<string[], [items: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
25
- }
26
- declare class BatchLinkPluginError extends TypeError {
8
+ condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
9
+ context: T;
10
+ path?: readonly string[];
11
+ input?: unknown;
27
12
  }
28
13
  interface BatchLinkPluginOptions<T extends ClientContext> {
29
- groups: [BatchLinkPluginGroup<T>, ...BatchLinkPluginGroup<T>[]];
30
- /**
31
- * Filters requests to batch.
32
- *
33
- * @default () => true
34
- */
35
- filter?: Value<boolean, [options: StandardLinkTransportInterceptorOptions<T>]>;
14
+ groups: readonly [BatchLinkPluginGroup<T>, ...BatchLinkPluginGroup<T>[]];
36
15
  /**
37
16
  * The maximum number of requests in the batch.
38
17
  *
39
18
  * @default 10
40
19
  */
41
- maxSize?: Value<Promisable<number>, [subOptionsList: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
20
+ maxSize?: Value<Promisable<number>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
42
21
  /**
43
22
  * The batch response mode.
44
23
  *
45
24
  * @default 'streaming'
46
25
  */
47
- mode?: Value<BatchLinkPluginMode, [subOptionsList: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
26
+ mode?: Value<BatchResponseMode, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
48
27
  /**
49
- * URL for the batch request.
28
+ * Defines the URL to use for the batch request.
50
29
  *
51
- * @default URL of the first subrequest in the batch + '/__batch__'
30
+ * @default the URL of the first request in the batch + '/__batch__'
52
31
  */
53
- url?: Value<Promisable<StandardUrl>, [subOptionsList: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
32
+ url?: Value<Promisable<string | URL>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
54
33
  /**
55
- * The maximum length of the URL that runtime supports,
56
- * if exceeded, the batch will be split into smaller batches and sent sequentially.
57
- *
58
- * This only applies to GET batch requests where the batch data is sent via URL query parameter.
34
+ * The maximum length of the URL.
59
35
  *
60
36
  * @default 2083
61
37
  */
62
- maxUrlLength?: Value<Promisable<number>, [subOptionsList: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
38
+ maxUrlLength?: Value<Promisable<number>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
63
39
  /**
64
- * Headers used for the batch request.
40
+ * Defines the HTTP headers to use for the batch request.
65
41
  *
66
- * @default Common headers among all subrequests in the batch.
42
+ * @default The same headers of all requests in the batch
67
43
  */
68
- headers?: Value<Promisable<StandardHeaders>, [subOptionsList: [StandardLinkTransportInterceptorOptions<T>, ...StandardLinkTransportInterceptorOptions<T>[]]]>;
44
+ headers?: Value<Promisable<StandardHeaders>, [readonly [StandardLinkClientInterceptorOptions<T>, ...StandardLinkClientInterceptorOptions<T>[]]]>;
69
45
  /**
70
- * Map each subrequest in the batch before it is sent.
46
+ * Map the batch request items before sending them.
71
47
  *
72
- * @default Removes headers that are duplicated with the batch headers
48
+ * @default Removes headers that are duplicated in the batch headers.
73
49
  */
74
- mapSubrequest?: (subOptions: StandardLinkTransportInterceptorOptions<T>, partialBatchRequest: Pick<StandardRequest, 'url' | 'headers'>) => StandardRequest;
50
+ mapRequestItem?: (options: StandardLinkClientInterceptorOptions<T> & {
51
+ batchUrl: URL;
52
+ batchHeaders: StandardHeaders;
53
+ }) => StandardRequest;
75
54
  /**
76
- * Maps each subresponse before returning the final response.
55
+ * Exclude a request from the batch.
77
56
  *
78
- * @default Low-priority merges headers from the batch response into each subresponse.
57
+ * @default () => false
79
58
  */
80
- mapSubresponse?: (subResponse: StandardLazyResponse, batchResponse: StandardLazyResponse, subOptions: StandardLinkTransportInterceptorOptions<T>) => StandardLazyResponse;
59
+ exclude?: (options: StandardLinkClientInterceptorOptions<T>) => boolean;
81
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.dev/docs/plugins/batch-requests Batch Requests Plugin Docs}
66
+ */
82
67
  declare class BatchLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
83
- name: string;
68
+ #private;
84
69
  private readonly groups;
85
- private readonly filter;
86
70
  private readonly maxSize;
87
- private readonly mode;
88
71
  private readonly batchUrl;
89
72
  private readonly maxUrlLength;
90
73
  private readonly batchHeaders;
91
- private readonly mapSubrequest;
92
- private readonly mapSubresponse;
93
- private readonly queue;
74
+ private readonly mapRequestItem;
75
+ private readonly exclude;
76
+ private readonly mode;
77
+ private pending;
78
+ order: number;
94
79
  constructor(options: NoInfer<BatchLinkPluginOptions<T>>);
95
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
96
- private processPendingBatches;
97
- private executeBatch;
80
+ init(options: StandardLinkOptions<T>): void;
98
81
  }
99
82
 
100
- interface DedupeLinkPluginGroup<T extends ClientContext> {
101
- condition: Value<boolean, [options: StandardLinkTransportInterceptorOptions<T>]>;
83
+ interface DedupeRequestsPluginGroup<T extends ClientContext> {
84
+ condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
102
85
  /**
103
86
  * The context used for the rest of the request lifecycle.
104
87
  */
105
- context: Value<T, [
106
- items: [
107
- StandardLinkTransportInterceptorOptions<T>,
108
- StandardLinkTransportInterceptorOptions<T>,
109
- ...StandardLinkTransportInterceptorOptions<T>[]
110
- ]
111
- ]>;
88
+ context: T;
112
89
  }
113
- interface DedupeLinkPluginOptions<T extends ClientContext> {
90
+ interface DedupeRequestsPluginOptions<T extends ClientContext> {
114
91
  /**
115
92
  * To enable deduplication, a request must match at least one defined group.
116
93
  * Requests that fall into the same group are considered for deduplication together.
117
94
  */
118
- groups: [DedupeLinkPluginGroup<T>, ...DedupeLinkPluginGroup<T>[]];
95
+ groups: readonly [DedupeRequestsPluginGroup<T>, ...DedupeRequestsPluginGroup<T>[]];
119
96
  /**
120
- * Filters requests to dedupe.
97
+ * Filters requests to dedupe
121
98
  *
122
- * @default ({ request }) => request.method === 'GET'
123
- */
124
- filter?: Value<boolean, [options: StandardLinkTransportInterceptorOptions<T>]>;
125
- }
126
- declare class DedupeLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
127
- name: string;
128
- before: string[];
129
- private readonly groups;
130
- private readonly filter;
131
- private readonly queue;
132
- constructor(options: NoInfer<DedupeLinkPluginOptions<T>>);
133
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
134
- private enqueue;
135
- private processPendingRequests;
136
- private execute;
137
- }
138
-
139
- interface RequestCompressionLinkPluginOptions<_T extends ClientContext> {
140
- /**
141
- * The compression scheme to use for request compression.
142
- *
143
- * @default 'gzip'
144
- */
145
- encoding?: 'gzip' | 'deflate' | 'deflate-raw';
146
- /**
147
- * The minimum request size in bytes required to trigger compression.
148
- * Requests smaller than this threshold will not be compressed to avoid overhead.
149
- * If the request size cannot be determined, compression will still be applied.
150
- *
151
- * @default 1024 (1KB)
152
- */
153
- threshold?: number;
154
- }
155
- declare class RequestCompressionLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
156
- name: string;
157
- /**
158
- * Compression should be done after batching, to compress the final request
99
+ * @default (({ request }) => request.method === 'GET')
159
100
  */
160
- after: string[];
161
- private readonly encoding;
162
- private readonly threshold;
163
- constructor(options?: RequestCompressionLinkPluginOptions<T>);
164
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
165
- }
166
-
167
- interface ResponseCompressionLinkPluginOptions<_T extends ClientContext> {
168
- /**
169
- * Compression schemes to advertise via Accept-Encoding, in preference order.
170
- * Only schemes that can be decompressed by this plugin should be listed.
171
- *
172
- * @default ['gzip', 'deflate']
173
- */
174
- encodings?: readonly ('gzip' | 'deflate' | 'deflate-raw')[];
101
+ filter?: (options: StandardLinkClientInterceptorOptions<T>) => boolean;
175
102
  }
176
103
  /**
177
- * Advertises Accept-Encoding on requests and decompresses response bodies
178
- * based on the Content-Encoding header. Works at the standard link level,
179
- * so it supports all adapters.
104
+ * Prevents duplicate requests by deduplicating similar ones to reduce server load.
180
105
  *
181
- * @see {@link https://orpc.dev/docs/plugins/response-compression Response Compression Plugin Docs}
106
+ * @see {@link https://orpc.dev/docs/plugins/dedupe-requests Dedupe Requests Plugin}
182
107
  */
183
- declare class ResponseCompressionLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
184
- name: string;
185
- /**
186
- * Decompression should wrap the final batch response instead of sub-responses.
187
- */
188
- after: string[];
189
- private readonly encodings;
190
- constructor(options?: ResponseCompressionLinkPluginOptions<T>);
191
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
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;
192
113
  }
193
114
 
194
- interface RetryLinkPluginAttemptOptions<T extends RetryLinkPluginContext> extends StandardLinkInterceptorOptions<T> {
195
- /**
196
- * Latest retry delay advertised by the server via event metadata.
197
- */
115
+ interface ClientRetryPluginAttemptOptions<T extends ClientContext> extends StandardLinkInterceptorOptions<T> {
198
116
  lastEventRetry: number | undefined;
199
- /**
200
- * Current retry attempt number, starting at 1.
201
- */
202
- attempt: number;
203
- /**
204
- * Error that triggered this retry attempt.
205
- */
117
+ attemptIndex: number;
206
118
  error: unknown;
207
119
  }
208
- interface RetryLinkPluginContext {
120
+ interface ClientRetryPluginContext {
209
121
  /**
210
- * Maximum retry attempts before throwing.
211
- * Use `Number.POSITIVE_INFINITY` for infinite retries (e.g. for AsyncIteratorObject).
122
+ * Maximum retry attempts before throwing
123
+ * Use `Number.POSITIVE_INFINITY` for infinite retries (e.g., when handling Server-Sent Events).
212
124
  *
213
125
  * @default 0
214
126
  */
215
- retry?: Value<Promisable<number>, [Omit<StandardLinkInterceptorOptions<RetryLinkPluginContext>, 'next'>]>;
127
+ retry?: Value<Promisable<number>, [StandardLinkInterceptorOptions<ClientRetryPluginContext>]>;
216
128
  /**
217
129
  * Delay (in ms) before retrying.
218
130
  *
219
- * @info Why 2000ms? The EventSource spec suggests a default retry delay of 2 seconds if it doesn't specify
220
131
  * @default (o) => o.lastEventRetry ?? 2000
221
132
  */
222
- retryDelay?: Value<Promisable<number>, [RetryLinkPluginAttemptOptions<RetryLinkPluginContext>]>;
133
+ retryDelay?: Value<Promisable<number>, [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>]>;
223
134
  /**
224
- * Determine whether to retry.
135
+ * Determine should retry or not.
225
136
  *
226
137
  * @default true
227
138
  */
228
- shouldRetry?: Value<Promisable<boolean>, [RetryLinkPluginAttemptOptions<RetryLinkPluginContext>]>;
139
+ shouldRetry?: Value<Promisable<boolean>, [ClientRetryPluginAttemptOptions<ClientRetryPluginContext>]>;
229
140
  /**
230
- * Hook called before each retry. Can return a cleanup callback.
141
+ * The hook called when retrying, and return the unsubscribe function.
231
142
  */
232
- onRetry?: (options: RetryLinkPluginAttemptOptions<RetryLinkPluginContext>) => void | ((isSuccess: boolean) => void);
143
+ onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | ((isSuccess: boolean) => void);
233
144
  }
234
- interface RetryLinkPluginOptions<_T extends RetryLinkPluginContext> {
235
- /**
236
- * Default retry options. Can be overridden by individual calls via the context.
237
- */
238
- default?: RetryLinkPluginContext | undefined;
145
+ declare class ClientRetryPluginInvalidEventIteratorRetryResponse extends Error {
239
146
  }
240
- declare class RetryLinkPlugin<T extends RetryLinkPluginContext & ClientContext> implements StandardLinkPlugin<T> {
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.dev/docs/plugins/client-retry Client Retry Plugin Docs}
154
+ */
155
+ declare class ClientRetryPlugin<T extends ClientRetryPluginContext> implements StandardLinkPlugin<T> {
241
156
  private readonly defaultRetry;
242
157
  private readonly defaultRetryDelay;
243
158
  private readonly defaultShouldRetry;
244
159
  private readonly defaultOnRetry;
245
- name: string;
246
- constructor(options?: RetryLinkPluginOptions<T>);
247
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
160
+ order: number;
161
+ constructor(options?: ClientRetryPluginOptions);
162
+ init(options: StandardLinkOptions<T>): void;
248
163
  }
249
164
 
250
- interface RetryAfterLinkPluginOptions<T extends ClientContext> {
165
+ interface RetryAfterPluginOptions<T extends ClientContext> {
251
166
  /**
252
167
  * Override condition to determine whether to retry or not.
253
168
  *
@@ -255,7 +170,7 @@ interface RetryAfterLinkPluginOptions<T extends ClientContext> {
255
170
  */
256
171
  condition?: Value<boolean, [
257
172
  response: StandardLazyResponse,
258
- options: StandardLinkTransportInterceptorOptions<T>
173
+ options: StandardLinkClientInterceptorOptions<T>
259
174
  ]>;
260
175
  /**
261
176
  * Maximum attempts before giving up retries.
@@ -264,7 +179,7 @@ interface RetryAfterLinkPluginOptions<T extends ClientContext> {
264
179
  */
265
180
  maxAttempts?: Value<number, [
266
181
  response: StandardLazyResponse,
267
- options: StandardLinkTransportInterceptorOptions<T>
182
+ options: StandardLinkClientInterceptorOptions<T>
268
183
  ]>;
269
184
  /**
270
185
  * Maximum timeout in milliseconds to wait before giving up retries.
@@ -273,46 +188,62 @@ interface RetryAfterLinkPluginOptions<T extends ClientContext> {
273
188
  */
274
189
  timeout?: Value<number, [
275
190
  response: StandardLazyResponse,
276
- options: StandardLinkTransportInterceptorOptions<T>
191
+ options: StandardLinkClientInterceptorOptions<T>
277
192
  ]>;
278
193
  }
279
194
  /**
280
- * The Retry After Link Plugin automatically retries requests based on server `retry-after` header.
195
+ * The Retry After Plugin automatically retries requests based on server `Retry-After` headers.
281
196
  * This is particularly useful for handling rate limiting and temporary server unavailability.
282
197
  *
283
198
  * @see {@link https://orpc.dev/docs/plugins/retry-after Retry After Plugin Docs}
284
199
  */
285
- declare class RetryAfterLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
200
+ declare class RetryAfterPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
286
201
  private readonly condition;
287
202
  private readonly maxAttempts;
288
203
  private readonly timeout;
289
- name: string;
290
- constructor(options?: RetryAfterLinkPluginOptions<T>);
291
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
204
+ order: number;
205
+ constructor(options?: RetryAfterPluginOptions<T>);
206
+ init(options: StandardLinkOptions<T>): void;
207
+ private parseRetryAfterHeader;
208
+ private delayExecution;
292
209
  }
293
210
 
294
- interface TimeoutLinkPluginOptions<T extends ClientContext> {
211
+ interface SimpleCsrfProtectionLinkPluginOptions<T extends ClientContext> {
295
212
  /**
296
- * Timeout in milliseconds before the request is aborted.
297
- * Use `null` or `undefined` to disable the timeout.
213
+ * The name of the header to check.
214
+ *
215
+ * @default 'x-csrf-token'
298
216
  */
299
- timeout: Value<number | null | undefined, [options: StandardLinkInterceptorOptions<T>]>;
217
+ headerName?: Value<Promisable<string>, [options: StandardLinkClientInterceptorOptions<T>]>;
218
+ /**
219
+ * The value of the header to check.
220
+ *
221
+ * @default 'orpc'
222
+ *
223
+ */
224
+ headerValue?: Value<Promisable<string>, [options: StandardLinkClientInterceptorOptions<T>]>;
225
+ /**
226
+ * Exclude a procedure from the plugin.
227
+ *
228
+ * @default false
229
+ */
230
+ exclude?: Value<Promisable<boolean>, [options: StandardLinkClientInterceptorOptions<T>]>;
300
231
  }
301
232
  /**
302
- * The Timeout Link Plugin aborts requests that exceed a configured timeout with an `AbortError`.
233
+ * This plugin adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
234
+ * It helps ensure that requests to your procedures originate from JavaScript code,
235
+ * not from other sources like standard HTML forms or direct browser navigation.
303
236
  *
304
- * @see {@link https://orpc.dev/docs/plugins/timeout Timeout Plugin Docs}
237
+ * @see {@link https://orpc.dev/docs/plugins/simple-csrf-protection Simple CSRF Protection Plugin Docs}
305
238
  */
306
- declare class TimeoutLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
307
- private readonly timeout;
308
- name: string;
309
- /**
310
- * Should abort if the total retry time exceeds the configured timeout
311
- */
312
- after: string[];
313
- constructor(options: NoInfer<TimeoutLinkPluginOptions<T>>);
314
- init(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
239
+ declare class SimpleCsrfProtectionLinkPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
240
+ private readonly headerName;
241
+ private readonly headerValue;
242
+ private readonly exclude;
243
+ constructor(options?: SimpleCsrfProtectionLinkPluginOptions<T>);
244
+ order: number;
245
+ init(options: StandardLinkOptions<T>): void;
315
246
  }
316
247
 
317
- export { BatchLinkPlugin, BatchLinkPluginError, DedupeLinkPlugin, RequestCompressionLinkPlugin, ResponseCompressionLinkPlugin, RetryAfterLinkPlugin, RetryLinkPlugin, TimeoutLinkPlugin };
318
- export type { BatchLinkPluginGroup, BatchLinkPluginMode, BatchLinkPluginOptions, DedupeLinkPluginGroup, DedupeLinkPluginOptions, RequestCompressionLinkPluginOptions, ResponseCompressionLinkPluginOptions, RetryAfterLinkPluginOptions, RetryLinkPluginAttemptOptions, RetryLinkPluginContext, RetryLinkPluginOptions, TimeoutLinkPluginOptions };
248
+ export { BatchLinkPlugin, ClientRetryPlugin, ClientRetryPluginInvalidEventIteratorRetryResponse, DedupeRequestsPlugin, RetryAfterPlugin, SimpleCsrfProtectionLinkPlugin };
249
+ export type { BatchLinkPluginGroup, BatchLinkPluginOptions, ClientRetryPluginAttemptOptions, ClientRetryPluginContext, ClientRetryPluginOptions, DedupeRequestsPluginGroup, DedupeRequestsPluginOptions, RetryAfterPluginOptions, SimpleCsrfProtectionLinkPluginOptions };