routup 5.0.0-beta.3 → 5.0.0-beta.4
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/bun.d.mts +2 -2
- package/dist/bun.mjs +2 -2
- package/dist/cloudflare.d.mts +2 -2
- package/dist/cloudflare.mjs +2 -2
- package/dist/deno.d.mts +2 -2
- package/dist/deno.mjs +2 -2
- package/dist/generic.d.mts +2 -2
- package/dist/generic.mjs +2 -2
- package/dist/{index-DCtnUoGL.d.mts → index-doDmTYzg.d.mts} +190 -107
- package/dist/node.d.mts +2 -2
- package/dist/node.mjs +2 -2
- package/dist/service-worker.d.mts +2 -2
- package/dist/service-worker.mjs +2 -2
- package/dist/{src-Tr9cHQaV.mjs → src-Ck8GklBr.mjs} +344 -222
- package/dist/src-Ck8GklBr.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/src-Tr9cHQaV.mjs.map +0 -1
|
@@ -5,51 +5,55 @@ import { Key, ParseOptions, PathToRegexpOptions } from "path-to-regexp";
|
|
|
5
5
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
6
|
|
|
7
7
|
//#region src/constants.d.ts
|
|
8
|
-
declare
|
|
9
|
-
GET
|
|
10
|
-
POST
|
|
11
|
-
PUT
|
|
12
|
-
PATCH
|
|
13
|
-
DELETE
|
|
14
|
-
OPTIONS
|
|
15
|
-
HEAD
|
|
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
|
-
|
|
8
|
+
declare const MethodName: {
|
|
9
|
+
readonly GET: "GET";
|
|
10
|
+
readonly POST: "POST";
|
|
11
|
+
readonly PUT: "PUT";
|
|
12
|
+
readonly PATCH: "PATCH";
|
|
13
|
+
readonly DELETE: "DELETE";
|
|
14
|
+
readonly OPTIONS: "OPTIONS";
|
|
15
|
+
readonly HEAD: "HEAD";
|
|
16
|
+
};
|
|
17
|
+
type MethodName = typeof MethodName[keyof typeof MethodName];
|
|
18
|
+
declare const HeaderName: {
|
|
19
|
+
readonly ACCEPT: "accept";
|
|
20
|
+
readonly ACCEPT_CHARSET: "accept-charset";
|
|
21
|
+
readonly ACCEPT_ENCODING: "accept-encoding";
|
|
22
|
+
readonly ACCEPT_LANGUAGE: "accept-language";
|
|
23
|
+
readonly ACCEPT_RANGES: "accept-ranges";
|
|
24
|
+
readonly ALLOW: "allow";
|
|
25
|
+
readonly CACHE_CONTROL: "cache-control";
|
|
26
|
+
readonly CONTENT_DISPOSITION: "content-disposition";
|
|
27
|
+
readonly CONTENT_ENCODING: "content-encoding";
|
|
28
|
+
readonly CONTENT_LENGTH: "content-length";
|
|
29
|
+
readonly CONTENT_RANGE: "content-range";
|
|
30
|
+
readonly CONTENT_TYPE: "content-type";
|
|
31
|
+
readonly CONNECTION: "connection";
|
|
32
|
+
readonly COOKIE: "cookie";
|
|
33
|
+
readonly ETag: "etag";
|
|
34
|
+
readonly HOST: "host";
|
|
35
|
+
readonly IF_MODIFIED_SINCE: "if-modified-since";
|
|
36
|
+
readonly IF_NONE_MATCH: "if-none-match";
|
|
37
|
+
readonly LAST_MODIFIED: "last-modified";
|
|
38
|
+
readonly LOCATION: "location";
|
|
39
|
+
readonly RANGE: "range";
|
|
40
|
+
readonly RATE_LIMIT_LIMIT: "ratelimit-limit";
|
|
41
|
+
readonly RATE_LIMIT_REMAINING: "ratelimit-remaining";
|
|
42
|
+
readonly RATE_LIMIT_RESET: "ratelimit-reset";
|
|
43
|
+
readonly RETRY_AFTER: "retry-after";
|
|
44
|
+
readonly SET_COOKIE: "set-cookie";
|
|
45
|
+
readonly TRANSFER_ENCODING: "transfer-encoding";
|
|
46
|
+
readonly X_ACCEL_BUFFERING: "x-accel-buffering";
|
|
47
|
+
readonly X_FORWARDED_HOST: "x-forwarded-host";
|
|
48
|
+
readonly X_FORWARDED_FOR: "x-forwarded-for";
|
|
49
|
+
readonly X_FORWARDED_PROTO: "x-forwarded-proto";
|
|
50
|
+
};
|
|
51
|
+
type HeaderName = typeof HeaderName[keyof typeof HeaderName];
|
|
50
52
|
//#endregion
|
|
51
53
|
//#region src/error/module.d.ts
|
|
54
|
+
declare const ErrorSymbol: unique symbol;
|
|
52
55
|
declare class RoutupError extends HTTPError {
|
|
56
|
+
readonly '@instanceof': symbol;
|
|
53
57
|
constructor(input?: HTTPErrorInput$1);
|
|
54
58
|
}
|
|
55
59
|
//#endregion
|
|
@@ -57,7 +61,6 @@ declare class RoutupError extends HTTPError {
|
|
|
57
61
|
type RoutupResponse = {
|
|
58
62
|
status: number;
|
|
59
63
|
headers: Headers;
|
|
60
|
-
statusText?: string;
|
|
61
64
|
};
|
|
62
65
|
type RoutupRequest = ServerRequest;
|
|
63
66
|
type NextFn = (error?: Error) => unknown | Promise<unknown>;
|
|
@@ -113,6 +116,14 @@ interface IRoutupEvent {
|
|
|
113
116
|
* Contains merged options from the router path stack with defaults applied.
|
|
114
117
|
*/
|
|
115
118
|
readonly routerOptions: RouterOptions;
|
|
119
|
+
/**
|
|
120
|
+
* Abort signal tied to the request lifecycle.
|
|
121
|
+
*
|
|
122
|
+
* When a `timeout` router option is set, this signal aborts after the
|
|
123
|
+
* specified duration. Handlers performing long I/O (fetch, streams, DB queries)
|
|
124
|
+
* can pass this signal to those operations for cooperative cancellation.
|
|
125
|
+
*/
|
|
126
|
+
readonly signal: AbortSignal;
|
|
116
127
|
/**
|
|
117
128
|
* Call the next handler in the pipeline (onion model).
|
|
118
129
|
*
|
|
@@ -133,6 +144,7 @@ type RoutupEventCreateContext = {
|
|
|
133
144
|
searchParams: URLSearchParams;
|
|
134
145
|
response: RoutupResponse;
|
|
135
146
|
store: Record<string | symbol, unknown>;
|
|
147
|
+
signal: AbortSignal;
|
|
136
148
|
routerOptions: () => RouterOptions;
|
|
137
149
|
next: (event: IRoutupEvent, error?: Error) => Promise<Response | undefined>;
|
|
138
150
|
};
|
|
@@ -146,6 +158,7 @@ declare class RoutupEvent implements IRoutupEvent {
|
|
|
146
158
|
readonly searchParams: URLSearchParams;
|
|
147
159
|
readonly response: RoutupResponse;
|
|
148
160
|
readonly store: Record<string | symbol, unknown>;
|
|
161
|
+
readonly signal: AbortSignal;
|
|
149
162
|
protected _context: RoutupEventCreateContext;
|
|
150
163
|
protected _routerOptions?: RouterOptions;
|
|
151
164
|
constructor(context: RoutupEventCreateContext);
|
|
@@ -154,14 +167,15 @@ declare class RoutupEvent implements IRoutupEvent {
|
|
|
154
167
|
}
|
|
155
168
|
//#endregion
|
|
156
169
|
//#region src/hook/constants.d.ts
|
|
157
|
-
declare
|
|
158
|
-
REQUEST
|
|
159
|
-
RESPONSE
|
|
160
|
-
ERROR
|
|
161
|
-
CHILD_MATCH
|
|
162
|
-
CHILD_DISPATCH_BEFORE
|
|
163
|
-
CHILD_DISPATCH_AFTER
|
|
164
|
-
}
|
|
170
|
+
declare const HookName: {
|
|
171
|
+
readonly REQUEST: "request";
|
|
172
|
+
readonly RESPONSE: "response";
|
|
173
|
+
readonly ERROR: "error";
|
|
174
|
+
readonly CHILD_MATCH: "childMatch";
|
|
175
|
+
readonly CHILD_DISPATCH_BEFORE: "childDispatchBefore";
|
|
176
|
+
readonly CHILD_DISPATCH_AFTER: "childDispatchAfter";
|
|
177
|
+
};
|
|
178
|
+
type HookName = typeof HookName[keyof typeof HookName];
|
|
165
179
|
//#endregion
|
|
166
180
|
//#region src/dispatcher/types.d.ts
|
|
167
181
|
interface IDispatcherEvent {
|
|
@@ -202,10 +216,18 @@ interface IDispatcherEvent {
|
|
|
202
216
|
* Used internally by router options resolution.
|
|
203
217
|
*/
|
|
204
218
|
routerPath: RouterPathNode[];
|
|
219
|
+
/**
|
|
220
|
+
* Abort signal for cooperative cancellation.
|
|
221
|
+
*
|
|
222
|
+
* When a `timeout` router option is set, this signal aborts after the
|
|
223
|
+
* specified duration. Handlers can pass it to fetch(), streams, or other
|
|
224
|
+
* AbortSignal-aware APIs.
|
|
225
|
+
*/
|
|
226
|
+
signal: AbortSignal;
|
|
205
227
|
/**
|
|
206
228
|
* Collected allowed methods for the current path (used for OPTIONS / 405 responses).
|
|
207
229
|
*/
|
|
208
|
-
methodsAllowed: string
|
|
230
|
+
methodsAllowed: Set<string>;
|
|
209
231
|
/**
|
|
210
232
|
* Set the continuation function for this event.
|
|
211
233
|
*
|
|
@@ -221,8 +243,12 @@ interface IDispatcherEvent {
|
|
|
221
243
|
*
|
|
222
244
|
* Creates a lightweight snapshot with shared references (store, response, headers)
|
|
223
245
|
* and pre-resolved router options. This is the event passed to handler functions.
|
|
246
|
+
*
|
|
247
|
+
* @param signal - Optional AbortSignal override. When provided, the built event
|
|
248
|
+
* uses this signal instead of the dispatcher event's own signal.
|
|
249
|
+
* Used by per-handler timeout to provide a handler-scoped signal.
|
|
224
250
|
*/
|
|
225
|
-
build(): RoutupEvent;
|
|
251
|
+
build(signal?: AbortSignal): RoutupEvent;
|
|
226
252
|
}
|
|
227
253
|
interface IDispatcher {
|
|
228
254
|
dispatch(event: IDispatcherEvent): Promise<Response | undefined>;
|
|
@@ -235,13 +261,17 @@ type HookListener = HookErrorListener | HookDefaultListener;
|
|
|
235
261
|
type HookUnsubscribeFn = () => void;
|
|
236
262
|
//#endregion
|
|
237
263
|
//#region src/hook/module.d.ts
|
|
264
|
+
type HookEntry = {
|
|
265
|
+
fn: HookListener;
|
|
266
|
+
priority: number;
|
|
267
|
+
};
|
|
238
268
|
declare class HookManager {
|
|
239
|
-
protected items: Record<string,
|
|
269
|
+
protected items: Record<string, HookEntry[]>;
|
|
240
270
|
constructor();
|
|
241
|
-
addListener(name:
|
|
242
|
-
removeListener(name:
|
|
243
|
-
removeListener(name:
|
|
244
|
-
trigger(name:
|
|
271
|
+
addListener(name: HookName, fn: HookListener, priority?: number): HookUnsubscribeFn;
|
|
272
|
+
removeListener(name: HookName): void;
|
|
273
|
+
removeListener(name: HookName, fn: HookListener): void;
|
|
274
|
+
trigger(name: HookName, event: IDispatcherEvent): Promise<void>;
|
|
245
275
|
private triggerListener;
|
|
246
276
|
private isErrorListenerHook;
|
|
247
277
|
}
|
|
@@ -269,16 +299,25 @@ declare class PathMatcher {
|
|
|
269
299
|
declare function isPath(input: unknown): input is Path;
|
|
270
300
|
//#endregion
|
|
271
301
|
//#region src/handler/constants.d.ts
|
|
272
|
-
declare
|
|
273
|
-
CORE
|
|
274
|
-
ERROR
|
|
275
|
-
}
|
|
302
|
+
declare const HandlerType: {
|
|
303
|
+
readonly CORE: "core";
|
|
304
|
+
readonly ERROR: "error";
|
|
305
|
+
};
|
|
306
|
+
type HandlerType = typeof HandlerType[keyof typeof HandlerType];
|
|
276
307
|
declare const HandlerSymbol: unique symbol;
|
|
277
308
|
//#endregion
|
|
278
309
|
//#region src/handler/types-base.d.ts
|
|
279
310
|
type HandlerBaseOptions = {
|
|
280
311
|
method?: Uppercase<MethodName> | Lowercase<MethodName>;
|
|
281
312
|
path?: Path;
|
|
313
|
+
/**
|
|
314
|
+
* Per-handler timeout in milliseconds.
|
|
315
|
+
*
|
|
316
|
+
* Overrides the router's `handlerTimeout` default. Whether this value
|
|
317
|
+
* can extend or only narrow the default is controlled by the router's
|
|
318
|
+
* `handlerTimeoutOverridable` option.
|
|
319
|
+
*/
|
|
320
|
+
timeout?: number;
|
|
282
321
|
onError?: HookErrorListener;
|
|
283
322
|
onBefore?: HookDefaultListener;
|
|
284
323
|
onAfter?: HookDefaultListener;
|
|
@@ -287,7 +326,7 @@ type HandlerBaseOptions = {
|
|
|
287
326
|
//#region src/handler/error/types.d.ts
|
|
288
327
|
type ErrorHandler = (error: RoutupError, event: IRoutupEvent) => unknown | Promise<unknown>;
|
|
289
328
|
type ErrorHandlerOptions = HandlerBaseOptions & {
|
|
290
|
-
type:
|
|
329
|
+
type: typeof HandlerType.ERROR;
|
|
291
330
|
fn: ErrorHandler;
|
|
292
331
|
};
|
|
293
332
|
//#endregion
|
|
@@ -326,15 +365,17 @@ declare class Handler implements IDispatcher {
|
|
|
326
365
|
dispatch(event: IDispatcherEvent): Promise<Response | undefined>;
|
|
327
366
|
matchPath(path: string): boolean;
|
|
328
367
|
setPath(path?: Path): void;
|
|
329
|
-
matchMethod(method:
|
|
330
|
-
setMethod(input?:
|
|
368
|
+
matchMethod(method: MethodName): boolean;
|
|
369
|
+
setMethod(input?: MethodName): void;
|
|
370
|
+
protected executeWithTimeout(fn: () => unknown | Promise<unknown>, routerOptions: RouterOptions, controller?: AbortController): Promise<unknown>;
|
|
371
|
+
protected resolveTimeout(routerOptions: RouterOptions): number | undefined;
|
|
331
372
|
protected mountHooks(): void;
|
|
332
373
|
}
|
|
333
374
|
//#endregion
|
|
334
375
|
//#region src/handler/core/types.d.ts
|
|
335
376
|
type CoreHandler = (event: IRoutupEvent) => unknown | Promise<unknown>;
|
|
336
377
|
type CoreHandlerOptions = HandlerBaseOptions & {
|
|
337
|
-
type:
|
|
378
|
+
type: typeof HandlerType.CORE;
|
|
338
379
|
fn: CoreHandler;
|
|
339
380
|
};
|
|
340
381
|
//#endregion
|
|
@@ -437,6 +478,35 @@ declare function isWebHandler(input: unknown): input is WebHandler;
|
|
|
437
478
|
declare function isHandlerOptions(input: unknown): input is HandlerOptions;
|
|
438
479
|
declare function isHandler(input: unknown): input is Handler;
|
|
439
480
|
//#endregion
|
|
481
|
+
//#region src/plugin/error/constants.d.ts
|
|
482
|
+
declare const PluginErrorCode: {
|
|
483
|
+
readonly PLUGIN: "PLUGIN";
|
|
484
|
+
readonly NOT_INSTALLED: "PLUGIN_NOT_INSTALLED";
|
|
485
|
+
readonly INSTALL: "PLUGIN_INSTALL";
|
|
486
|
+
};
|
|
487
|
+
type PluginErrorCode = typeof PluginErrorCode[keyof typeof PluginErrorCode];
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/plugin/error/module.d.ts
|
|
490
|
+
declare class PluginError extends RoutupError {
|
|
491
|
+
constructor(input?: HTTPErrorInput);
|
|
492
|
+
}
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region src/plugin/error/is.d.ts
|
|
495
|
+
declare function isPluginError(input: unknown): input is PluginError;
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/plugin/error/sub/install.d.ts
|
|
498
|
+
declare class PluginInstallError extends PluginError {
|
|
499
|
+
readonly pluginName: string;
|
|
500
|
+
constructor(pluginName: string, cause?: Error);
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/plugin/error/sub/not-installed.d.ts
|
|
504
|
+
declare class PluginNotInstalledError extends PluginError {
|
|
505
|
+
readonly pluginName: string;
|
|
506
|
+
readonly helperName: string;
|
|
507
|
+
constructor(pluginName: string, helperName: string);
|
|
508
|
+
}
|
|
509
|
+
//#endregion
|
|
440
510
|
//#region src/plugin/types.d.ts
|
|
441
511
|
type PluginInstallFn = (router: IRouter) => any;
|
|
442
512
|
type Plugin = {
|
|
@@ -485,19 +555,45 @@ type TrustProxyFn = (address: string, hop: number) => boolean;
|
|
|
485
555
|
type TrustProxyInput = boolean | number | string | string[] | TrustProxyFn;
|
|
486
556
|
//#endregion
|
|
487
557
|
//#region src/router/constants.d.ts
|
|
488
|
-
declare
|
|
489
|
-
START
|
|
490
|
-
LOOKUP
|
|
491
|
-
CHILD_BEFORE
|
|
492
|
-
CHILD_DISPATCH
|
|
493
|
-
CHILD_AFTER
|
|
494
|
-
FINISH
|
|
495
|
-
}
|
|
558
|
+
declare const RouterPipelineStep: {
|
|
559
|
+
readonly START: 0;
|
|
560
|
+
readonly LOOKUP: 1;
|
|
561
|
+
readonly CHILD_BEFORE: 2;
|
|
562
|
+
readonly CHILD_DISPATCH: 3;
|
|
563
|
+
readonly CHILD_AFTER: 4;
|
|
564
|
+
readonly FINISH: 5;
|
|
565
|
+
};
|
|
566
|
+
type RouterPipelineStep = typeof RouterPipelineStep[keyof typeof RouterPipelineStep];
|
|
496
567
|
//#endregion
|
|
497
568
|
//#region src/router/types.d.ts
|
|
498
569
|
type RouterOptions = {
|
|
499
570
|
path?: Path;
|
|
500
571
|
name?: string;
|
|
572
|
+
/**
|
|
573
|
+
* Global request timeout in milliseconds.
|
|
574
|
+
*
|
|
575
|
+
* Applies to the entire dispatch pipeline in `fetch()`. When exceeded,
|
|
576
|
+
* the request is aborted and a 408 response is returned. The AbortSignal
|
|
577
|
+
* on the event is also aborted for cooperative cancellation.
|
|
578
|
+
*/
|
|
579
|
+
timeout?: number;
|
|
580
|
+
/**
|
|
581
|
+
* Default per-handler timeout in milliseconds.
|
|
582
|
+
*
|
|
583
|
+
* Applies individually to each handler's `fn()` execution. Handlers can
|
|
584
|
+
* override this value via their own `timeout` option — see
|
|
585
|
+
* `handlerTimeoutOverridable` to control whether overrides can extend
|
|
586
|
+
* or only narrow this default.
|
|
587
|
+
*/
|
|
588
|
+
handlerTimeout?: number;
|
|
589
|
+
/**
|
|
590
|
+
* Whether handlers can extend the `handlerTimeout` default.
|
|
591
|
+
*
|
|
592
|
+
* When `false` (default), a handler's `timeout` is clamped to
|
|
593
|
+
* `Math.min(handlerTimeout, handler.timeout)`. When `true`, the
|
|
594
|
+
* handler's `timeout` fully replaces the router default.
|
|
595
|
+
*/
|
|
596
|
+
handlerTimeoutOverridable?: boolean;
|
|
501
597
|
subdomainOffset: number;
|
|
502
598
|
proxyIpMax: number;
|
|
503
599
|
etag: EtagFn;
|
|
@@ -569,14 +665,14 @@ interface IRouter extends IDispatcher {
|
|
|
569
665
|
/**
|
|
570
666
|
* Add a hook listener.
|
|
571
667
|
*/
|
|
572
|
-
on(name:
|
|
573
|
-
on(name:
|
|
574
|
-
on(name:
|
|
668
|
+
on(name: typeof HookName.REQUEST | typeof HookName.RESPONSE | typeof HookName.CHILD_DISPATCH_BEFORE | typeof HookName.CHILD_DISPATCH_AFTER, fn: HookDefaultListener): HookUnsubscribeFn;
|
|
669
|
+
on(name: typeof HookName.CHILD_MATCH, fn: HookDefaultListener): HookUnsubscribeFn;
|
|
670
|
+
on(name: typeof HookName.ERROR, fn: HookErrorListener): HookUnsubscribeFn;
|
|
575
671
|
/**
|
|
576
672
|
* Remove a specific or all hook listeners for the given hook name.
|
|
577
673
|
*/
|
|
578
|
-
off(name:
|
|
579
|
-
off(name:
|
|
674
|
+
off(name: HookName): this;
|
|
675
|
+
off(name: HookName, fn: HookListener): this;
|
|
580
676
|
}
|
|
581
677
|
//#endregion
|
|
582
678
|
//#region src/dispatcher/module.d.ts
|
|
@@ -588,7 +684,7 @@ declare class DispatcherEvent implements IDispatcherEvent {
|
|
|
588
684
|
/**
|
|
589
685
|
* Collected allowed methods (for OPTIONS).
|
|
590
686
|
*/
|
|
591
|
-
methodsAllowed: string
|
|
687
|
+
methodsAllowed: Set<string>;
|
|
592
688
|
mountPath: string;
|
|
593
689
|
error?: RoutupError;
|
|
594
690
|
routerPath: RouterPathNode[];
|
|
@@ -603,6 +699,8 @@ declare class DispatcherEvent implements IDispatcherEvent {
|
|
|
603
699
|
* Continuation function for middleware onion model.
|
|
604
700
|
*/
|
|
605
701
|
protected _next?: (event: IRoutupEvent, error?: Error) => Promise<Response | undefined>;
|
|
702
|
+
protected _signal?: AbortSignal;
|
|
703
|
+
protected _signalCleanup?: () => void;
|
|
606
704
|
/**
|
|
607
705
|
* Whether _next has already been called (guard against double-invocation).
|
|
608
706
|
*/
|
|
@@ -613,11 +711,13 @@ declare class DispatcherEvent implements IDispatcherEvent {
|
|
|
613
711
|
protected _nextResult?: Promise<Response | undefined>;
|
|
614
712
|
constructor(request: RoutupRequest);
|
|
615
713
|
get response(): RoutupResponse;
|
|
714
|
+
get signal(): AbortSignal;
|
|
715
|
+
set signal(value: AbortSignal);
|
|
616
716
|
get dispatched(): boolean;
|
|
617
717
|
set dispatched(value: boolean);
|
|
618
718
|
protected next(event: IRoutupEvent, error?: Error): Promise<Response | undefined>;
|
|
619
719
|
setNext(fn?: NextFn): void;
|
|
620
|
-
build(): RoutupEvent;
|
|
720
|
+
build(signal?: AbortSignal): RoutupEvent;
|
|
621
721
|
protected get store(): Record<string | symbol, unknown>;
|
|
622
722
|
protected resolveOptions(): RouterOptions;
|
|
623
723
|
}
|
|
@@ -696,16 +796,16 @@ declare class Router implements IRouter {
|
|
|
696
796
|
* @param name
|
|
697
797
|
* @param fn
|
|
698
798
|
*/
|
|
699
|
-
on(name:
|
|
700
|
-
on(name:
|
|
701
|
-
on(name:
|
|
799
|
+
on(name: typeof HookName.REQUEST | typeof HookName.RESPONSE | typeof HookName.CHILD_DISPATCH_BEFORE | typeof HookName.CHILD_DISPATCH_AFTER, fn: HookDefaultListener, priority?: number): HookUnsubscribeFn;
|
|
800
|
+
on(name: typeof HookName.CHILD_MATCH, fn: HookDefaultListener, priority?: number): HookUnsubscribeFn;
|
|
801
|
+
on(name: typeof HookName.ERROR, fn: HookErrorListener, priority?: number): HookUnsubscribeFn;
|
|
702
802
|
/**
|
|
703
803
|
* Remove single or all hook listeners.
|
|
704
804
|
*
|
|
705
805
|
* @param name
|
|
706
806
|
*/
|
|
707
|
-
off(name:
|
|
708
|
-
off(name:
|
|
807
|
+
off(name: HookName): this;
|
|
808
|
+
off(name: HookName, fn: HookListener): this;
|
|
709
809
|
}
|
|
710
810
|
//#endregion
|
|
711
811
|
//#region src/error/create.d.ts
|
|
@@ -714,7 +814,7 @@ declare class Router implements IRouter {
|
|
|
714
814
|
* - an existing RoutupError (returned as-is)
|
|
715
815
|
* - an HTTPError (wrapped into a RoutupError preserving status)
|
|
716
816
|
* - an Error (wrapped preserving message and cause)
|
|
717
|
-
* - an options object (
|
|
817
|
+
* - an options object (status, message, etc.)
|
|
718
818
|
* - a message string
|
|
719
819
|
*
|
|
720
820
|
* @param input
|
|
@@ -763,7 +863,7 @@ type EventStreamOptions = {
|
|
|
763
863
|
maxMessageSize?: number;
|
|
764
864
|
};
|
|
765
865
|
type EventStreamHandle = {
|
|
766
|
-
write(message: string | EventStreamMessage):
|
|
866
|
+
write(message: string | EventStreamMessage): boolean;
|
|
767
867
|
end(): void;
|
|
768
868
|
response: Response;
|
|
769
869
|
};
|
|
@@ -826,23 +926,6 @@ declare function setResponseContentTypeByFileName(event: IRoutupEvent, fileName:
|
|
|
826
926
|
//#region src/response/to-response.d.ts
|
|
827
927
|
declare function toResponse(value: unknown, event: IRoutupEvent): Promise<Response | undefined>;
|
|
828
928
|
//#endregion
|
|
829
|
-
//#region src/request/helpers/body.d.ts
|
|
830
|
-
/**
|
|
831
|
-
* Read and parse the request body.
|
|
832
|
-
*
|
|
833
|
-
* - `application/x-www-form-urlencoded` → plain object (duplicate keys become arrays)
|
|
834
|
-
* - `application/json` or other → attempts JSON parse, returns undefined on failure
|
|
835
|
-
*
|
|
836
|
-
* The result is cached on the event store — calling `readBody()` multiple
|
|
837
|
-
* times returns the same parsed result.
|
|
838
|
-
*
|
|
839
|
-
* For binary or streaming access, use `event.request.arrayBuffer()`,
|
|
840
|
-
* `event.request.blob()`, or `event.request.body` directly.
|
|
841
|
-
*
|
|
842
|
-
* @experimental
|
|
843
|
-
*/
|
|
844
|
-
declare function readBody<T = unknown>(event: IRoutupEvent): Promise<T | undefined>;
|
|
845
|
-
//#endregion
|
|
846
929
|
//#region src/request/helpers/cache.d.ts
|
|
847
930
|
declare function isRequestCacheable(event: IRoutupEvent, modifiedTime: string | Date): boolean;
|
|
848
931
|
//#endregion
|
|
@@ -900,5 +983,5 @@ declare function getRequestProtocol(event: IRoutupEvent, options?: RequestProtoc
|
|
|
900
983
|
//#region src/router/options.d.ts
|
|
901
984
|
declare function normalizeRouterOptions(input: RouterOptionsInput): Partial<RouterOptions>;
|
|
902
985
|
//#endregion
|
|
903
|
-
export {
|
|
904
|
-
//# sourceMappingURL=index-
|
|
986
|
+
export { Plugin as $, sendAccepted as A, PathMatcher as At, EventStreamMessage as B, RoutupRequest as Bt, sendRedirect as C, defineErrorHandler as Ct, SendFileStats as D, HandlerSymbol as Dt, SendFileOptions as E, HandlerBaseOptions as Et, serializeEventStreamMessage as F, IDispatcherEvent as Ft, Router as G, HeaderName as Gt, setResponseCacheHeaders as H, ErrorSymbol as Ht, EventStreamHandle as I, RoutupEvent as It, RouterOptions as J, DispatcherEvent as K, MethodName as Kt, EventStreamOptions as L, RoutupEventCreateContext as Lt, setResponseHeaderAttachment as M, PathMatcherExecResult as Mt, appendResponseHeader as N, PathMatcherOptions as Nt, sendFile as O, HandlerType as Ot, appendResponseHeaderDirective as P, IDispatcher as Pt, isPlugin as Q, createEventStream as R, IRoutupEvent as Rt, sendStream as S, HandlerOptions as St, SendFileContentOptions as T, ErrorHandlerOptions as Tt, isError as U, HTTPErrorInput$1 as Ut, ResponseCacheHeadersOptions as V, RoutupResponse as Vt, createError as W, RoutupError as Wt, RouterPathNode as X, RouterOptionsInput as Y, RouterPipelineContext as Z, getRequestAcceptableContentTypes as _, NodeMiddleware as _t, RequestIpOptions as a, PluginError as at, toResponse as b, CoreHandlerOptions as bt, getRequestHostName as c, isHandlerOptions as ct, getRequestAcceptableLanguages as d, fromWebHandler as dt, PluginInstallContext as et, getRequestAcceptableEncoding as f, WebHandler as ft, getRequestAcceptableContentType as g, NodeHandler as gt, getRequestAcceptableCharsets as h, fromNodeMiddleware as ht, useRequestNegotiator as i, isPluginError as it, setResponseHeaderContentType as j, Path as jt, sendCreated as k, isPath as kt, matchRequestContentType as l, isWebHandler as lt, getRequestAcceptableCharset as m, fromNodeHandler as mt, RequestProtocolOptions as n, PluginNotInstalledError as nt, getRequestIP as o, PluginErrorCode as ot, getRequestAcceptableEncodings as p, WebHandlerProvider as pt, IRouter as q, getRequestProtocol as r, PluginInstallError as rt, RequestHostNameOptions as s, isHandler as st, normalizeRouterOptions as t, PluginInstallFn as tt, getRequestAcceptableLanguage as u, isWebHandlerProvider as ut, getRequestHeader as v, defineCoreHandler as vt, sendFormat as w, ErrorHandler as wt, setResponseContentTypeByFileName as x, Handler as xt, isRequestCacheable as y, CoreHandler as yt, EventStreamListener as z, NextFn as zt };
|
|
987
|
+
//# sourceMappingURL=index-doDmTYzg.d.mts.map
|
package/dist/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as Plugin, A as sendAccepted, At as PathMatcher, B as EventStreamMessage, Bt as RoutupRequest, C as sendRedirect, Ct as defineErrorHandler, D as SendFileStats, Dt as HandlerSymbol, E as SendFileOptions, Et as HandlerBaseOptions, F as serializeEventStreamMessage, Ft as IDispatcherEvent, G as Router, Gt as HeaderName, H as setResponseCacheHeaders, Ht as ErrorSymbol, I as EventStreamHandle, It as RoutupEvent, J as RouterOptions, K as DispatcherEvent, Kt as MethodName, L as EventStreamOptions, Lt as RoutupEventCreateContext, M as setResponseHeaderAttachment, Mt as PathMatcherExecResult, N as appendResponseHeader, Nt as PathMatcherOptions, O as sendFile, Ot as HandlerType, P as appendResponseHeaderDirective, Pt as IDispatcher, Q as isPlugin, R as createEventStream, Rt as IRoutupEvent, S as sendStream, St as HandlerOptions, T as SendFileContentOptions, Tt as ErrorHandlerOptions, U as isError, Ut as HTTPErrorInput, V as ResponseCacheHeadersOptions, Vt as RoutupResponse, W as createError, Wt as RoutupError, X as RouterPathNode, Y as RouterOptionsInput, Z as RouterPipelineContext, _ as getRequestAcceptableContentTypes, _t as NodeMiddleware, a as RequestIpOptions, at as PluginError, b as toResponse, bt as CoreHandlerOptions, c as getRequestHostName, ct as isHandlerOptions, d as getRequestAcceptableLanguages, dt as fromWebHandler, et as PluginInstallContext, f as getRequestAcceptableEncoding, ft as WebHandler, g as getRequestAcceptableContentType, gt as NodeHandler, h as getRequestAcceptableCharsets, ht as fromNodeMiddleware, i as useRequestNegotiator, it as isPluginError, j as setResponseHeaderContentType, jt as Path, k as sendCreated, kt as isPath, l as matchRequestContentType, lt as isWebHandler, m as getRequestAcceptableCharset, mt as fromNodeHandler, n as RequestProtocolOptions, nt as PluginNotInstalledError, o as getRequestIP, ot as PluginErrorCode, p as getRequestAcceptableEncodings, pt as WebHandlerProvider, q as IRouter, r as getRequestProtocol, rt as PluginInstallError, s as RequestHostNameOptions, st as isHandler, t as normalizeRouterOptions, tt as PluginInstallFn, u as getRequestAcceptableLanguage, ut as isWebHandlerProvider, v as getRequestHeader, vt as defineCoreHandler, w as sendFormat, wt as ErrorHandler, x as setResponseContentTypeByFileName, xt as Handler, y as isRequestCacheable, yt as CoreHandler, z as EventStreamListener, zt as NextFn } from "./index-doDmTYzg.mjs";
|
|
2
2
|
import * as _$srvx_node0 from "srvx/node";
|
|
3
3
|
import * as _$srvx from "srvx";
|
|
4
4
|
import { Server, ServerOptions } from "srvx";
|
|
@@ -7,5 +7,5 @@ import { Server, ServerOptions } from "srvx";
|
|
|
7
7
|
declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
|
|
8
8
|
declare function toNodeHandler(router: Router): _$srvx.NodeHttpHandler & _$srvx_node0.AdapterMeta;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions,
|
|
10
|
+
export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, toNodeHandler, toResponse, useRequestNegotiator };
|
|
11
11
|
//# sourceMappingURL=node.d.mts.map
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as appendResponseHeaderDirective, A as isPath, B as getRequestAcceptableContentTypes, C as isWebHandler, D as defineErrorHandler, E as fromNodeMiddleware, F as RoutupEvent, G as sendAccepted, H as getRequestHeader, I as sendStream, J as isError, K as toResponse, L as sendRedirect, M as HandlerSymbol, N as HandlerType, O as defineCoreHandler, P as DispatcherEvent, Q as appendResponseHeader, R as sendFormat, S as fromWebHandler, T as fromNodeHandler, U as sendFile, V as useRequestNegotiator, W as sendCreated, X as setResponseHeaderAttachment, Y as setResponseHeaderContentType, Z as setResponseContentTypeByFileName, _ as getRequestAcceptableCharset, a as PluginInstallError, at as HeaderName, b as isHandler, c as PluginErrorCode, d as getRequestHostName, et as createEventStream, f as matchRequestContentType, g as getRequestAcceptableEncodings, h as getRequestAcceptableEncoding, i as PluginNotInstalledError, it as setResponseCacheHeaders, j as PathMatcher, k as Handler, l as getRequestProtocol, m as getRequestAcceptableLanguages, n as normalizeRouterOptions, nt as ErrorSymbol, o as PluginError, ot as MethodName, p as getRequestAcceptableLanguage, q as createError, r as isPlugin, rt as RoutupError, s as isPluginError, t as Router, tt as serializeEventStreamMessage, u as getRequestIP, v as getRequestAcceptableCharsets, w as isWebHandlerProvider, x as isHandlerOptions, y as isRequestCacheable, z as getRequestAcceptableContentType } from "./src-Ck8GklBr.mjs";
|
|
2
2
|
import { serve as serve$1, toNodeHandler as toNodeHandler$1 } from "srvx/node";
|
|
3
3
|
//#region src/_entries/node.ts
|
|
4
4
|
function serve(router, options) {
|
|
@@ -11,6 +11,6 @@ function toNodeHandler(router) {
|
|
|
11
11
|
return toNodeHandler$1(router.fetch.bind(router));
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { DispatcherEvent, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions,
|
|
14
|
+
export { DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, toNodeHandler, toResponse, useRequestNegotiator };
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=node.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as Plugin, A as sendAccepted, At as PathMatcher, B as EventStreamMessage, Bt as RoutupRequest, C as sendRedirect, Ct as defineErrorHandler, D as SendFileStats, Dt as HandlerSymbol, E as SendFileOptions, Et as HandlerBaseOptions, F as serializeEventStreamMessage, Ft as IDispatcherEvent, G as Router, Gt as HeaderName, H as setResponseCacheHeaders, Ht as ErrorSymbol, I as EventStreamHandle, It as RoutupEvent, J as RouterOptions, K as DispatcherEvent, Kt as MethodName, L as EventStreamOptions, Lt as RoutupEventCreateContext, M as setResponseHeaderAttachment, Mt as PathMatcherExecResult, N as appendResponseHeader, Nt as PathMatcherOptions, O as sendFile, Ot as HandlerType, P as appendResponseHeaderDirective, Pt as IDispatcher, Q as isPlugin, R as createEventStream, Rt as IRoutupEvent, S as sendStream, St as HandlerOptions, T as SendFileContentOptions, Tt as ErrorHandlerOptions, U as isError, Ut as HTTPErrorInput, V as ResponseCacheHeadersOptions, Vt as RoutupResponse, W as createError, Wt as RoutupError, X as RouterPathNode, Y as RouterOptionsInput, Z as RouterPipelineContext, _ as getRequestAcceptableContentTypes, _t as NodeMiddleware, a as RequestIpOptions, at as PluginError, b as toResponse, bt as CoreHandlerOptions, c as getRequestHostName, ct as isHandlerOptions, d as getRequestAcceptableLanguages, dt as fromWebHandler, et as PluginInstallContext, f as getRequestAcceptableEncoding, ft as WebHandler, g as getRequestAcceptableContentType, gt as NodeHandler, h as getRequestAcceptableCharsets, ht as fromNodeMiddleware, i as useRequestNegotiator, it as isPluginError, j as setResponseHeaderContentType, jt as Path, k as sendCreated, kt as isPath, l as matchRequestContentType, lt as isWebHandler, m as getRequestAcceptableCharset, mt as fromNodeHandler, n as RequestProtocolOptions, nt as PluginNotInstalledError, o as getRequestIP, ot as PluginErrorCode, p as getRequestAcceptableEncodings, pt as WebHandlerProvider, q as IRouter, r as getRequestProtocol, rt as PluginInstallError, s as RequestHostNameOptions, st as isHandler, t as normalizeRouterOptions, tt as PluginInstallFn, u as getRequestAcceptableLanguage, ut as isWebHandlerProvider, v as getRequestHeader, vt as defineCoreHandler, w as sendFormat, wt as ErrorHandler, x as setResponseContentTypeByFileName, xt as Handler, y as isRequestCacheable, yt as CoreHandler, z as EventStreamListener, zt as NextFn } from "./index-doDmTYzg.mjs";
|
|
2
2
|
import * as _$srvx from "srvx";
|
|
3
3
|
import { ServerOptions } from "srvx";
|
|
4
4
|
import * as _$srvx_service_worker0 from "srvx/service-worker";
|
|
@@ -6,5 +6,5 @@ import * as _$srvx_service_worker0 from "srvx/service-worker";
|
|
|
6
6
|
//#region src/_entries/service-worker.d.ts
|
|
7
7
|
declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): _$srvx.Server<_$srvx_service_worker0.ServiceWorkerHandler>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions,
|
|
9
|
+
export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
10
10
|
//# sourceMappingURL=service-worker.d.mts.map
|
package/dist/service-worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as appendResponseHeaderDirective, A as isPath, B as getRequestAcceptableContentTypes, C as isWebHandler, D as defineErrorHandler, E as fromNodeMiddleware, F as RoutupEvent, G as sendAccepted, H as getRequestHeader, I as sendStream, J as isError, K as toResponse, L as sendRedirect, M as HandlerSymbol, N as HandlerType, O as defineCoreHandler, P as DispatcherEvent, Q as appendResponseHeader, R as sendFormat, S as fromWebHandler, T as fromNodeHandler, U as sendFile, V as useRequestNegotiator, W as sendCreated, X as setResponseHeaderAttachment, Y as setResponseHeaderContentType, Z as setResponseContentTypeByFileName, _ as getRequestAcceptableCharset, a as PluginInstallError, at as HeaderName, b as isHandler, c as PluginErrorCode, d as getRequestHostName, et as createEventStream, f as matchRequestContentType, g as getRequestAcceptableEncodings, h as getRequestAcceptableEncoding, i as PluginNotInstalledError, it as setResponseCacheHeaders, j as PathMatcher, k as Handler, l as getRequestProtocol, m as getRequestAcceptableLanguages, n as normalizeRouterOptions, nt as ErrorSymbol, o as PluginError, ot as MethodName, p as getRequestAcceptableLanguage, q as createError, r as isPlugin, rt as RoutupError, s as isPluginError, t as Router, tt as serializeEventStreamMessage, u as getRequestIP, v as getRequestAcceptableCharsets, w as isWebHandlerProvider, x as isHandlerOptions, y as isRequestCacheable, z as getRequestAcceptableContentType } from "./src-Ck8GklBr.mjs";
|
|
2
2
|
import { serve as serve$1 } from "srvx/service-worker";
|
|
3
3
|
//#region src/_entries/service-worker.ts
|
|
4
4
|
function serve(router, options) {
|
|
@@ -8,6 +8,6 @@ function serve(router, options) {
|
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export { DispatcherEvent, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions,
|
|
11
|
+
export { DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=service-worker.mjs.map
|