@wooksjs/event-http 0.4.11 → 0.4.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.
- package/dist/index.cjs +3 -58
- package/dist/index.d.ts +519 -559
- package/dist/index.mjs +3 -58
- package/package.json +12 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,559 +1,519 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
declare
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
* Returns http(s) server that was attached to Wooks
|
|
521
|
-
*
|
|
522
|
-
* See attachServer method docs
|
|
523
|
-
* @returns Server
|
|
524
|
-
*/
|
|
525
|
-
getServer(): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse> | undefined;
|
|
526
|
-
/**
|
|
527
|
-
* Attaches http(s) server instance
|
|
528
|
-
* to Wooks.
|
|
529
|
-
*
|
|
530
|
-
* Use it only if you want to `close` method to stop the server.
|
|
531
|
-
* @param server Server
|
|
532
|
-
*/
|
|
533
|
-
attachServer(server?: Server): void;
|
|
534
|
-
protected responder: {
|
|
535
|
-
createResponse: <T = unknown>(data: T) => BaseHttpResponse<T | TWooksErrorBodyExt> | null;
|
|
536
|
-
respond: (data: unknown) => Promise<unknown> | undefined;
|
|
537
|
-
};
|
|
538
|
-
protected respond(data: unknown): void;
|
|
539
|
-
/**
|
|
540
|
-
* Returns server callback function
|
|
541
|
-
* that can be passed to any node server:
|
|
542
|
-
* ```js
|
|
543
|
-
* import { createHttpApp } from '@wooksjs/event-http'
|
|
544
|
-
* import http from 'http'
|
|
545
|
-
*
|
|
546
|
-
* const app = createHttpApp()
|
|
547
|
-
* const server = http.createServer(app.getServerCb())
|
|
548
|
-
* server.listen(3000)
|
|
549
|
-
* ```
|
|
550
|
-
*/
|
|
551
|
-
getServerCb(): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
552
|
-
protected processHandlers(handlers: TWooksHandler<unknown>[]): Promise<void>;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
export declare class WooksURLSearchParams extends URLSearchParams_2 {
|
|
556
|
-
toJson<T = unknown>(): T;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
export { }
|
|
1
|
+
import * as http from 'http';
|
|
2
|
+
import http__default, { IncomingHttpHeaders, IncomingMessage, ServerResponse, Server } from 'http';
|
|
3
|
+
import * as _wooksjs_event_core from '@wooksjs/event-core';
|
|
4
|
+
import { TEventOptions, TEmpty } from '@wooksjs/event-core';
|
|
5
|
+
import { URLSearchParams } from 'url';
|
|
6
|
+
import { TConsoleBase } from '@prostojs/logger';
|
|
7
|
+
import * as _prostojs_router from '@prostojs/router';
|
|
8
|
+
import { TWooksHandler, TWooksOptions, WooksAdapterBase, Wooks } from 'wooks';
|
|
9
|
+
|
|
10
|
+
declare function useHeaders(): IncomingHttpHeaders;
|
|
11
|
+
declare function useSetHeaders(): {
|
|
12
|
+
setHeader: (name: string, value: string | number) => void;
|
|
13
|
+
getHeader: <K2 extends string | number>(key2: K2) => {
|
|
14
|
+
[name: string]: string | string[];
|
|
15
|
+
}[K2];
|
|
16
|
+
removeHeader: <K2_1 extends string | number>(key2: K2_1) => void;
|
|
17
|
+
setContentType: (value: string) => void;
|
|
18
|
+
headers: () => {
|
|
19
|
+
[name: string]: string | string[];
|
|
20
|
+
};
|
|
21
|
+
enableCors: (origin?: string) => void;
|
|
22
|
+
};
|
|
23
|
+
declare function useSetHeader(name: string): {
|
|
24
|
+
value: string | string[];
|
|
25
|
+
isDefined: boolean;
|
|
26
|
+
};
|
|
27
|
+
type THeaderHook = ReturnType<typeof useSetHeader>;
|
|
28
|
+
|
|
29
|
+
declare function useAccept(): {
|
|
30
|
+
accept: string | undefined;
|
|
31
|
+
accepts: (mime: string) => unknown;
|
|
32
|
+
acceptsJson: () => unknown;
|
|
33
|
+
acceptsXml: () => unknown;
|
|
34
|
+
acceptsText: () => unknown;
|
|
35
|
+
acceptsHtml: () => unknown;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare function useAuthorization(): {
|
|
39
|
+
authorization: string | undefined;
|
|
40
|
+
authType: () => string | null;
|
|
41
|
+
authRawCredentials: () => string | null;
|
|
42
|
+
isBasic: () => boolean;
|
|
43
|
+
isBearer: () => boolean;
|
|
44
|
+
basicCredentials: () => {
|
|
45
|
+
username: string;
|
|
46
|
+
password: string;
|
|
47
|
+
} | null;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type TTimeUnit = 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'Y';
|
|
51
|
+
type TTimeSingleString = `${number}${TTimeUnit}`;
|
|
52
|
+
type TTimeMultiString = `${TTimeSingleString}${TTimeSingleString | ''}${TTimeSingleString | ''}${TTimeSingleString | ''}`;
|
|
53
|
+
|
|
54
|
+
type TCacheControl = {
|
|
55
|
+
mustRevalidate?: boolean;
|
|
56
|
+
noCache?: boolean | string;
|
|
57
|
+
noStore?: boolean;
|
|
58
|
+
noTransform?: boolean;
|
|
59
|
+
public?: boolean;
|
|
60
|
+
private?: boolean | string;
|
|
61
|
+
proxyRevalidate?: boolean;
|
|
62
|
+
maxAge?: number | TTimeMultiString;
|
|
63
|
+
sMaxage?: number | TTimeMultiString;
|
|
64
|
+
};
|
|
65
|
+
declare function renderCacheControl(data: TCacheControl): string;
|
|
66
|
+
|
|
67
|
+
declare function useSetCacheControl(): {
|
|
68
|
+
setExpires: (value: Date | string | number) => void;
|
|
69
|
+
setAge: (value: number | TTimeMultiString) => void;
|
|
70
|
+
setPragmaNoCache: (value?: boolean) => void;
|
|
71
|
+
setCacheControl: (data: TCacheControl) => void;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
declare function useRequest(): {
|
|
75
|
+
rawRequest: http.IncomingMessage;
|
|
76
|
+
url: string | undefined;
|
|
77
|
+
method: string | undefined;
|
|
78
|
+
headers: http.IncomingHttpHeaders;
|
|
79
|
+
rawBody: () => Promise<Buffer>;
|
|
80
|
+
reqId: () => string;
|
|
81
|
+
getIp: (options?: {
|
|
82
|
+
trustProxy: boolean;
|
|
83
|
+
}) => string;
|
|
84
|
+
getIpList: () => {
|
|
85
|
+
remoteIp: string;
|
|
86
|
+
forwarded: string[];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
declare const httpStatusCodes: {
|
|
91
|
+
100: string;
|
|
92
|
+
101: string;
|
|
93
|
+
102: string;
|
|
94
|
+
103: string;
|
|
95
|
+
200: string;
|
|
96
|
+
201: string;
|
|
97
|
+
202: string;
|
|
98
|
+
203: string;
|
|
99
|
+
204: string;
|
|
100
|
+
205: string;
|
|
101
|
+
206: string;
|
|
102
|
+
207: string;
|
|
103
|
+
208: string;
|
|
104
|
+
226: string;
|
|
105
|
+
300: string;
|
|
106
|
+
301: string;
|
|
107
|
+
302: string;
|
|
108
|
+
303: string;
|
|
109
|
+
304: string;
|
|
110
|
+
305: string;
|
|
111
|
+
306: string;
|
|
112
|
+
307: string;
|
|
113
|
+
308: string;
|
|
114
|
+
400: string;
|
|
115
|
+
401: string;
|
|
116
|
+
402: string;
|
|
117
|
+
403: string;
|
|
118
|
+
404: string;
|
|
119
|
+
405: string;
|
|
120
|
+
406: string;
|
|
121
|
+
407: string;
|
|
122
|
+
408: string;
|
|
123
|
+
409: string;
|
|
124
|
+
410: string;
|
|
125
|
+
411: string;
|
|
126
|
+
412: string;
|
|
127
|
+
413: string;
|
|
128
|
+
414: string;
|
|
129
|
+
415: string;
|
|
130
|
+
416: string;
|
|
131
|
+
417: string;
|
|
132
|
+
418: string;
|
|
133
|
+
421: string;
|
|
134
|
+
422: string;
|
|
135
|
+
423: string;
|
|
136
|
+
424: string;
|
|
137
|
+
425: string;
|
|
138
|
+
426: string;
|
|
139
|
+
428: string;
|
|
140
|
+
429: string;
|
|
141
|
+
431: string;
|
|
142
|
+
451: string;
|
|
143
|
+
500: string;
|
|
144
|
+
501: string;
|
|
145
|
+
502: string;
|
|
146
|
+
503: string;
|
|
147
|
+
504: string;
|
|
148
|
+
505: string;
|
|
149
|
+
506: string;
|
|
150
|
+
507: string;
|
|
151
|
+
508: string;
|
|
152
|
+
510: string;
|
|
153
|
+
511: string;
|
|
154
|
+
};
|
|
155
|
+
declare enum EHttpStatusCode {
|
|
156
|
+
Continue = 100,
|
|
157
|
+
SwitchingProtocols = 101,
|
|
158
|
+
Processing = 102,
|
|
159
|
+
EarlyHints = 103,
|
|
160
|
+
OK = 200,
|
|
161
|
+
Created = 201,
|
|
162
|
+
Accepted = 202,
|
|
163
|
+
NonAuthoritativeInformation = 203,
|
|
164
|
+
NoContent = 204,
|
|
165
|
+
ResetContent = 205,
|
|
166
|
+
PartialContent = 206,
|
|
167
|
+
MultiStatus = 207,
|
|
168
|
+
AlreadyReported = 208,
|
|
169
|
+
IMUsed = 226,
|
|
170
|
+
MultipleChoices = 300,
|
|
171
|
+
MovedPermanently = 301,
|
|
172
|
+
Found = 302,
|
|
173
|
+
SeeOther = 303,
|
|
174
|
+
NotModified = 304,
|
|
175
|
+
UseProxy = 305,
|
|
176
|
+
SwitchProxy = 306,
|
|
177
|
+
TemporaryRedirect = 307,
|
|
178
|
+
PermanentRedirect = 308,
|
|
179
|
+
BadRequest = 400,
|
|
180
|
+
Unauthorized = 401,
|
|
181
|
+
PaymentRequired = 402,
|
|
182
|
+
Forbidden = 403,
|
|
183
|
+
NotFound = 404,
|
|
184
|
+
MethodNotAllowed = 405,
|
|
185
|
+
NotAcceptable = 406,
|
|
186
|
+
ProxyAuthenticationRequired = 407,
|
|
187
|
+
RequestTimeout = 408,
|
|
188
|
+
Conflict = 409,
|
|
189
|
+
Gone = 410,
|
|
190
|
+
LengthRequired = 411,
|
|
191
|
+
PreconditionFailed = 412,
|
|
192
|
+
PayloadTooLarge = 413,
|
|
193
|
+
URITooLong = 414,
|
|
194
|
+
UnsupportedMediaType = 415,
|
|
195
|
+
RangeNotSatisfiable = 416,
|
|
196
|
+
ExpectationFailed = 417,
|
|
197
|
+
ImATeapot = 418,
|
|
198
|
+
MisdirectedRequest = 421,
|
|
199
|
+
UnprocessableEntity = 422,
|
|
200
|
+
Locked = 423,
|
|
201
|
+
FailedDependency = 424,
|
|
202
|
+
TooEarly = 425,
|
|
203
|
+
UpgradeRequired = 426,
|
|
204
|
+
PreconditionRequired = 428,
|
|
205
|
+
TooManyRequests = 429,
|
|
206
|
+
RequestHeaderFieldsTooLarge = 431,
|
|
207
|
+
UnavailableForLegalReasons = 451,
|
|
208
|
+
InternalServerError = 500,
|
|
209
|
+
NotImplemented = 501,
|
|
210
|
+
BadGateway = 502,
|
|
211
|
+
ServiceUnavailable = 503,
|
|
212
|
+
GatewayTimeout = 504,
|
|
213
|
+
HTTPVersionNotSupported = 505,
|
|
214
|
+
VariantAlsoNegotiates = 506,
|
|
215
|
+
InsufficientStorage = 507,
|
|
216
|
+
LoopDetected = 508,
|
|
217
|
+
NotExtended = 510,
|
|
218
|
+
NetworkAuthenticationRequired = 511
|
|
219
|
+
}
|
|
220
|
+
type THttpBadRequestCodes = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
221
|
+
type THttpServerErrorCodes = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
222
|
+
type THttpErrorCodes = THttpBadRequestCodes | THttpServerErrorCodes;
|
|
223
|
+
|
|
224
|
+
type TUseResponseOptions = {
|
|
225
|
+
passthrough: boolean;
|
|
226
|
+
};
|
|
227
|
+
declare function useResponse(): {
|
|
228
|
+
rawResponse: (options?: TUseResponseOptions) => http.ServerResponse<http.IncomingMessage>;
|
|
229
|
+
hasResponded: () => boolean;
|
|
230
|
+
status: ((code?: EHttpStatusCode) => EHttpStatusCode) & _wooksjs_event_core.THook<EHttpStatusCode, "value">;
|
|
231
|
+
};
|
|
232
|
+
declare function useStatus(): {
|
|
233
|
+
value: EHttpStatusCode;
|
|
234
|
+
isDefined: boolean;
|
|
235
|
+
};
|
|
236
|
+
type TStatusHook = ReturnType<typeof useStatus>;
|
|
237
|
+
|
|
238
|
+
declare class WooksURLSearchParams extends URLSearchParams {
|
|
239
|
+
toJson<T = unknown>(): T;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface THttpEventData {
|
|
243
|
+
req: IncomingMessage;
|
|
244
|
+
res: ServerResponse;
|
|
245
|
+
}
|
|
246
|
+
interface THttpEvent {
|
|
247
|
+
type: 'HTTP';
|
|
248
|
+
}
|
|
249
|
+
interface THttpContextStore {
|
|
250
|
+
searchParams?: TSearchParamsCache;
|
|
251
|
+
cookies?: {
|
|
252
|
+
[name: string]: string | null;
|
|
253
|
+
};
|
|
254
|
+
setCookies?: {
|
|
255
|
+
[name: string]: TSetCookieData;
|
|
256
|
+
};
|
|
257
|
+
accept?: {
|
|
258
|
+
[name: string]: boolean;
|
|
259
|
+
};
|
|
260
|
+
authorization?: TAuthCache;
|
|
261
|
+
setHeader?: {
|
|
262
|
+
[name: string]: string | string[];
|
|
263
|
+
};
|
|
264
|
+
request?: TRequestCache;
|
|
265
|
+
response?: {
|
|
266
|
+
responded: boolean;
|
|
267
|
+
};
|
|
268
|
+
status?: {
|
|
269
|
+
code: EHttpStatusCode;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
type TSetCookieData = {
|
|
273
|
+
value: string;
|
|
274
|
+
attrs: TCookieAttributesInput;
|
|
275
|
+
};
|
|
276
|
+
type TCookieAttributesInput = Partial<TCookieAttributes>;
|
|
277
|
+
interface TCookieAttributes {
|
|
278
|
+
expires: Date | string | number;
|
|
279
|
+
maxAge: number | TTimeMultiString;
|
|
280
|
+
domain: string;
|
|
281
|
+
path: string;
|
|
282
|
+
secure: boolean;
|
|
283
|
+
httpOnly: boolean;
|
|
284
|
+
sameSite: boolean | 'Lax' | 'None' | 'Strict';
|
|
285
|
+
}
|
|
286
|
+
type TAuthCache = {
|
|
287
|
+
type: string | null;
|
|
288
|
+
credentials: string | null;
|
|
289
|
+
basicCredentials: {
|
|
290
|
+
username: string;
|
|
291
|
+
password: string;
|
|
292
|
+
} | null;
|
|
293
|
+
};
|
|
294
|
+
type TRequestCache = {
|
|
295
|
+
rawBody: Promise<Buffer>;
|
|
296
|
+
parsed: unknown;
|
|
297
|
+
forwardedIp?: string;
|
|
298
|
+
remoteIp?: string;
|
|
299
|
+
ipList?: {
|
|
300
|
+
remoteIp: string;
|
|
301
|
+
forwarded: string[];
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
type TSearchParamsCache = {
|
|
305
|
+
raw?: string;
|
|
306
|
+
urlSearchParams?: WooksURLSearchParams;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
declare function useCookies(): {
|
|
310
|
+
rawCookies: string | undefined;
|
|
311
|
+
getCookie: (name: string) => string | null;
|
|
312
|
+
};
|
|
313
|
+
declare function useSetCookies(): {
|
|
314
|
+
setCookie: (name: string, value: string, attrs?: Partial<TCookieAttributes>) => void;
|
|
315
|
+
getCookie: <K2 extends string | number>(key2: K2) => {
|
|
316
|
+
[name: string]: TSetCookieData;
|
|
317
|
+
}[K2];
|
|
318
|
+
removeCookie: <K2_1 extends string | number>(key2: K2_1) => void;
|
|
319
|
+
clearCookies: () => void;
|
|
320
|
+
cookies: () => string[];
|
|
321
|
+
};
|
|
322
|
+
declare function useSetCookie(name: string): {
|
|
323
|
+
name: string;
|
|
324
|
+
type: string;
|
|
325
|
+
} & _wooksjs_event_core.THook<string, "value"> & _wooksjs_event_core.THook<TCookieAttributes, "attrs">;
|
|
326
|
+
type TCookieHook = ReturnType<typeof useSetCookie>;
|
|
327
|
+
|
|
328
|
+
declare function useSearchParams(): {
|
|
329
|
+
rawSearchParams: () => string;
|
|
330
|
+
urlSearchParams: () => WooksURLSearchParams;
|
|
331
|
+
jsonSearchParams: () => unknown;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
declare class BaseHttpResponseRenderer<T = unknown> implements TWooksResponseRenderer<T> {
|
|
335
|
+
render(response: BaseHttpResponse<T>): string | Uint8Array;
|
|
336
|
+
}
|
|
337
|
+
interface TWooksResponseRenderer<T = unknown> {
|
|
338
|
+
render: (response: BaseHttpResponse<T>) => string | Uint8Array;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
declare class BaseHttpResponse<BodyType = unknown> {
|
|
342
|
+
protected renderer: BaseHttpResponseRenderer;
|
|
343
|
+
constructor(renderer?: BaseHttpResponseRenderer);
|
|
344
|
+
protected _status: EHttpStatusCode;
|
|
345
|
+
protected _body?: BodyType;
|
|
346
|
+
protected _headers: Record<string, string | string[]>;
|
|
347
|
+
get status(): EHttpStatusCode;
|
|
348
|
+
set status(value: EHttpStatusCode);
|
|
349
|
+
get body(): BodyType | undefined;
|
|
350
|
+
set body(value: BodyType | undefined);
|
|
351
|
+
setStatus(value: EHttpStatusCode): this;
|
|
352
|
+
setBody(value: BodyType): this;
|
|
353
|
+
getContentType(): string | string[];
|
|
354
|
+
setContentType(value: string): this;
|
|
355
|
+
enableCors(origin?: string): this;
|
|
356
|
+
setCookie(name: string, value: string, attrs?: Partial<TCookieAttributes>): this;
|
|
357
|
+
setCacheControl(data: TCacheControl): void;
|
|
358
|
+
setCookieRaw(rawValue: string): this;
|
|
359
|
+
header(name: string, value: string): this;
|
|
360
|
+
setHeader(name: string, value: string): this;
|
|
361
|
+
getHeader(name: string): string | string[];
|
|
362
|
+
protected mergeHeaders(): this;
|
|
363
|
+
protected mergeStatus(renderedBody: string | Uint8Array): this;
|
|
364
|
+
protected mergeFetchStatus(fetchStatus: number): void;
|
|
365
|
+
protected panic(text: string, logger: TConsoleBase): void;
|
|
366
|
+
respond(): Promise<unknown>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare class HttpErrorRenderer extends BaseHttpResponseRenderer<TWooksErrorBodyExt> {
|
|
370
|
+
renderHtml(response: BaseHttpResponse<TWooksErrorBodyExt>): string;
|
|
371
|
+
renderText(response: BaseHttpResponse<TWooksErrorBodyExt>): string;
|
|
372
|
+
renderJson(response: BaseHttpResponse<TWooksErrorBodyExt>): string;
|
|
373
|
+
render(response: BaseHttpResponse<TWooksErrorBodyExt>): string;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
declare class HttpError<T extends TWooksErrorBody = TWooksErrorBody> extends Error {
|
|
377
|
+
protected code: THttpErrorCodes;
|
|
378
|
+
protected _body: string | T;
|
|
379
|
+
constructor(code?: THttpErrorCodes, _body?: string | T);
|
|
380
|
+
get body(): TWooksErrorBodyExt;
|
|
381
|
+
protected renderer?: HttpErrorRenderer;
|
|
382
|
+
attachRenderer(renderer: HttpErrorRenderer): void;
|
|
383
|
+
getRenderer(): HttpErrorRenderer | undefined;
|
|
384
|
+
}
|
|
385
|
+
interface TWooksErrorBody {
|
|
386
|
+
message: string;
|
|
387
|
+
statusCode: EHttpStatusCode;
|
|
388
|
+
error?: string;
|
|
389
|
+
}
|
|
390
|
+
interface TWooksErrorBodyExt extends TWooksErrorBody {
|
|
391
|
+
error: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare function createWooksResponder(renderer?: TWooksResponseRenderer<any>, errorRenderer?: TWooksResponseRenderer<any>): {
|
|
395
|
+
createResponse: <T = unknown>(data: T) => BaseHttpResponse<TWooksErrorBodyExt | T> | null;
|
|
396
|
+
respond: (data: unknown) => Promise<unknown> | undefined;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
declare function createHttpContext(data: THttpEventData, options: TEventOptions): {
|
|
400
|
+
getCtx: () => THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>;
|
|
401
|
+
restoreCtx: () => _wooksjs_event_core.TGenericContextStore<TEmpty>;
|
|
402
|
+
clearCtx: () => null;
|
|
403
|
+
store: <K extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData>>(key: K) => {
|
|
404
|
+
value: (THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K];
|
|
405
|
+
hook: <K2 extends keyof Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2) => {
|
|
406
|
+
value: Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K][K2];
|
|
407
|
+
isDefined: boolean;
|
|
408
|
+
};
|
|
409
|
+
init: <K2_1 extends keyof Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_1, getter: () => Required<Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>[K2_1]) => Required<Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>[K2_1];
|
|
410
|
+
set: <K2_2 extends keyof Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_2, v: Required<(THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K]>[K2_2]) => Required<(THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K]>[K2_2];
|
|
411
|
+
get: <K2_3 extends keyof Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_3) => Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K][K2_3];
|
|
412
|
+
has: <K2_4 extends keyof Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_4) => boolean;
|
|
413
|
+
del: <K2_5 extends keyof Required<THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_5) => void;
|
|
414
|
+
entries: () => [string, unknown][];
|
|
415
|
+
clear: () => void;
|
|
416
|
+
};
|
|
417
|
+
getStore: <K_1 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData>>(key: K_1) => (THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_1];
|
|
418
|
+
setStore: <K_2 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData>>(key: K_2, v: (THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_2]) => void;
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* Wrapper on useEventContext with HTTP event types
|
|
422
|
+
* @returns set of hooks { getCtx, restoreCtx, clearCtx, hookStore, getStore, setStore }
|
|
423
|
+
*/
|
|
424
|
+
declare function useHttpContext<T extends TEmpty>(): {
|
|
425
|
+
getCtx: () => THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>;
|
|
426
|
+
restoreCtx: () => _wooksjs_event_core.TGenericContextStore<TEmpty>;
|
|
427
|
+
clearCtx: () => null;
|
|
428
|
+
store: <K extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData> | keyof T>(key: K) => {
|
|
429
|
+
value: (THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K];
|
|
430
|
+
hook: <K2 extends keyof Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2) => {
|
|
431
|
+
value: Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K][K2];
|
|
432
|
+
isDefined: boolean;
|
|
433
|
+
};
|
|
434
|
+
init: <K2_1 extends keyof Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_1, getter: () => Required<Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>[K2_1]) => Required<Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>[K2_1];
|
|
435
|
+
set: <K2_2 extends keyof Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_2, v: Required<(THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K]>[K2_2]) => Required<(THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K]>[K2_2];
|
|
436
|
+
get: <K2_3 extends keyof Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_3) => Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K][K2_3];
|
|
437
|
+
has: <K2_4 extends keyof Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_4) => boolean;
|
|
438
|
+
del: <K2_5 extends keyof Required<THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>>[K]>(key2: K2_5) => void;
|
|
439
|
+
entries: () => [string, unknown][];
|
|
440
|
+
clear: () => void;
|
|
441
|
+
};
|
|
442
|
+
getStore: <K_1 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData> | keyof T>(key: K_1) => (THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_1];
|
|
443
|
+
setStore: <K_2 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData> | keyof T>(key: K_2, v: (THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_2]) => void;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
interface TWooksHttpOptions {
|
|
447
|
+
logger?: TConsoleBase;
|
|
448
|
+
eventOptions?: TEventOptions;
|
|
449
|
+
onNotFound?: TWooksHandler<unknown>;
|
|
450
|
+
router?: TWooksOptions['router'];
|
|
451
|
+
}
|
|
452
|
+
declare class WooksHttp extends WooksAdapterBase {
|
|
453
|
+
protected opts?: TWooksHttpOptions | undefined;
|
|
454
|
+
protected logger: TConsoleBase;
|
|
455
|
+
constructor(opts?: TWooksHttpOptions | undefined, wooks?: Wooks | WooksAdapterBase);
|
|
456
|
+
all<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
457
|
+
get<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
458
|
+
post<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
459
|
+
put<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
460
|
+
patch<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
461
|
+
delete<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
462
|
+
head<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
463
|
+
options<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
464
|
+
protected server?: Server;
|
|
465
|
+
/**
|
|
466
|
+
* Starts the http(s) server.
|
|
467
|
+
*
|
|
468
|
+
* Use this only if you rely on Wooks server.
|
|
469
|
+
*/
|
|
470
|
+
listen(...args: Parameters<Server['listen']>): Promise<unknown>;
|
|
471
|
+
/**
|
|
472
|
+
* Stops the server if it was attached or passed via argument
|
|
473
|
+
* @param server
|
|
474
|
+
*/
|
|
475
|
+
close(server?: Server): Promise<unknown>;
|
|
476
|
+
/**
|
|
477
|
+
* Returns http(s) server that was attached to Wooks
|
|
478
|
+
*
|
|
479
|
+
* See attachServer method docs
|
|
480
|
+
* @returns Server
|
|
481
|
+
*/
|
|
482
|
+
getServer(): http__default.Server<typeof http__default.IncomingMessage, typeof http__default.ServerResponse> | undefined;
|
|
483
|
+
/**
|
|
484
|
+
* Attaches http(s) server instance
|
|
485
|
+
* to Wooks.
|
|
486
|
+
*
|
|
487
|
+
* Use it only if you want to `close` method to stop the server.
|
|
488
|
+
* @param server Server
|
|
489
|
+
*/
|
|
490
|
+
attachServer(server?: Server): void;
|
|
491
|
+
protected responder: {
|
|
492
|
+
createResponse: <T = unknown>(data: T) => BaseHttpResponse<TWooksErrorBodyExt | T> | null;
|
|
493
|
+
respond: (data: unknown) => Promise<unknown> | undefined;
|
|
494
|
+
};
|
|
495
|
+
protected respond(data: unknown): void;
|
|
496
|
+
/**
|
|
497
|
+
* Returns server callback function
|
|
498
|
+
* that can be passed to any node server:
|
|
499
|
+
* ```js
|
|
500
|
+
* import { createHttpApp } from '@wooksjs/event-http'
|
|
501
|
+
* import http from 'http'
|
|
502
|
+
*
|
|
503
|
+
* const app = createHttpApp()
|
|
504
|
+
* const server = http.createServer(app.getServerCb())
|
|
505
|
+
* server.listen(3000)
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
getServerCb(): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
509
|
+
protected processHandlers(handlers: TWooksHandler<unknown>[]): Promise<void>;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Factory for WooksHttp App
|
|
513
|
+
* @param opts TWooksHttpOptions
|
|
514
|
+
* @param wooks Wooks | WooksAdapterBase
|
|
515
|
+
* @returns WooksHttp
|
|
516
|
+
*/
|
|
517
|
+
declare function createHttpApp(opts?: TWooksHttpOptions, wooks?: Wooks | WooksAdapterBase): WooksHttp;
|
|
518
|
+
|
|
519
|
+
export { BaseHttpResponse, BaseHttpResponseRenderer, EHttpStatusCode, HttpError, HttpErrorRenderer, type TAuthCache, type TCacheControl, type TCookieAttributes, type TCookieAttributesInput, type TCookieHook, type THeaderHook, type THttpContextStore, type THttpEvent, type THttpEventData, type TRequestCache, type TSearchParamsCache, type TSetCookieData, type TStatusHook, type TWooksErrorBody, type TWooksErrorBodyExt, type TWooksHttpOptions, type TWooksResponseRenderer, WooksHttp, WooksURLSearchParams, createHttpApp, createHttpContext, createWooksResponder, httpStatusCodes, renderCacheControl, useAccept, useAuthorization, useCookies, useHeaders, useHttpContext, useRequest, useResponse, useSearchParams, useSetCacheControl, useSetCookie, useSetCookies, useSetHeader, useSetHeaders, useStatus };
|