routup 5.0.0-beta.2 → 5.0.0-beta.3
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-BBvBVzPm.d.mts → index-DCtnUoGL.d.mts} +211 -155
- 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-CNoRH9eg.mjs → src-Tr9cHQaV.mjs} +574 -551
- package/dist/src-Tr9cHQaV.mjs.map +1 -0
- package/package.json +10 -15
- package/dist/bun.cjs +0 -69
- package/dist/bun.cjs.map +0 -1
- package/dist/bun.d.cts +0 -8
- package/dist/cloudflare.cjs +0 -69
- package/dist/cloudflare.cjs.map +0 -1
- package/dist/cloudflare.d.cts +0 -8
- package/dist/deno.cjs +0 -69
- package/dist/deno.cjs.map +0 -1
- package/dist/deno.d.cts +0 -8
- package/dist/generic.cjs +0 -69
- package/dist/generic.cjs.map +0 -1
- package/dist/generic.d.cts +0 -8
- package/dist/index-eUBZJk6a.d.cts +0 -848
- package/dist/node.cjs +0 -73
- package/dist/node.cjs.map +0 -1
- package/dist/node.d.cts +0 -11
- package/dist/service-worker.cjs +0 -69
- package/dist/service-worker.cjs.map +0 -1
- package/dist/service-worker.d.cts +0 -10
- package/dist/src-BTv-fDqY.cjs +0 -1974
- package/dist/src-BTv-fDqY.cjs.map +0 -1
- package/dist/src-CNoRH9eg.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HTTPError, HTTPErrorInput, HTTPErrorInput as HTTPErrorInput$1 } from "@ebec/http";
|
|
2
1
|
import { FastURL, ServerRequest } from "srvx";
|
|
3
|
-
import {
|
|
2
|
+
import { HTTPError, HTTPErrorInput, HTTPErrorInput as HTTPErrorInput$1 } from "@ebec/http";
|
|
4
3
|
import Negotiator from "negotiator";
|
|
4
|
+
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
|
|
@@ -60,6 +60,7 @@ type RoutupResponse = {
|
|
|
60
60
|
statusText?: string;
|
|
61
61
|
};
|
|
62
62
|
type RoutupRequest = ServerRequest;
|
|
63
|
+
type NextFn = (error?: Error) => unknown | Promise<unknown>;
|
|
63
64
|
interface IRoutupEvent {
|
|
64
65
|
/**
|
|
65
66
|
* The srvx ServerRequest (extends Web Standard Request).
|
|
@@ -68,11 +69,11 @@ interface IRoutupEvent {
|
|
|
68
69
|
/**
|
|
69
70
|
* Route parameters extracted from the URL path pattern.
|
|
70
71
|
*/
|
|
71
|
-
params: Record<string, any>;
|
|
72
|
+
readonly params: Record<string, any>;
|
|
72
73
|
/**
|
|
73
74
|
* Current request path, adjusted relative to the mount point during router nesting.
|
|
74
75
|
*/
|
|
75
|
-
path: string;
|
|
76
|
+
readonly path: string;
|
|
76
77
|
/**
|
|
77
78
|
* HTTP method (GET, POST, PUT, etc.).
|
|
78
79
|
*/
|
|
@@ -80,16 +81,7 @@ interface IRoutupEvent {
|
|
|
80
81
|
/**
|
|
81
82
|
* Accumulated mount path from nested routers.
|
|
82
83
|
*/
|
|
83
|
-
mountPath: string;
|
|
84
|
-
/**
|
|
85
|
-
* Error that occurred during dispatch, if any.
|
|
86
|
-
*/
|
|
87
|
-
error?: RoutupError;
|
|
88
|
-
/**
|
|
89
|
-
* Router ID stack for nesting tracking.
|
|
90
|
-
* Used internally by router options resolution.
|
|
91
|
-
*/
|
|
92
|
-
routerPath: number[];
|
|
84
|
+
readonly mountPath: string;
|
|
93
85
|
/**
|
|
94
86
|
* Web Standard Headers from the request.
|
|
95
87
|
*/
|
|
@@ -108,10 +100,6 @@ interface IRoutupEvent {
|
|
|
108
100
|
* that go through `toResponse()`.
|
|
109
101
|
*/
|
|
110
102
|
readonly response: RoutupResponse;
|
|
111
|
-
/**
|
|
112
|
-
* Whether a response has been produced.
|
|
113
|
-
*/
|
|
114
|
-
dispatched: boolean;
|
|
115
103
|
/**
|
|
116
104
|
* Per-request store for caching and plugin state.
|
|
117
105
|
*
|
|
@@ -119,75 +107,130 @@ interface IRoutupEvent {
|
|
|
119
107
|
* Data is garbage collected with the event when the request completes.
|
|
120
108
|
*/
|
|
121
109
|
readonly store: Record<string | symbol, unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* Pre-resolved router options for the current dispatch context.
|
|
112
|
+
*
|
|
113
|
+
* Contains merged options from the router path stack with defaults applied.
|
|
114
|
+
*/
|
|
115
|
+
readonly routerOptions: RouterOptions;
|
|
122
116
|
/**
|
|
123
117
|
* Call the next handler in the pipeline (onion model).
|
|
124
118
|
*
|
|
125
119
|
* The result is cached — calling `next()` multiple times returns the same response.
|
|
126
120
|
* Returns the downstream `Response`, or `undefined` if no handler matched.
|
|
127
121
|
*/
|
|
128
|
-
next(): Promise<Response | undefined>;
|
|
122
|
+
next(error?: Error): Promise<Response | undefined>;
|
|
129
123
|
}
|
|
130
124
|
//#endregion
|
|
131
125
|
//#region src/event/module.d.ts
|
|
126
|
+
type RoutupEventCreateContext = {
|
|
127
|
+
request: RoutupRequest;
|
|
128
|
+
params: Record<string, any>;
|
|
129
|
+
path: string;
|
|
130
|
+
method: string;
|
|
131
|
+
mountPath: string;
|
|
132
|
+
headers: Headers;
|
|
133
|
+
searchParams: URLSearchParams;
|
|
134
|
+
response: RoutupResponse;
|
|
135
|
+
store: Record<string | symbol, unknown>;
|
|
136
|
+
routerOptions: () => RouterOptions;
|
|
137
|
+
next: (event: IRoutupEvent, error?: Error) => Promise<Response | undefined>;
|
|
138
|
+
};
|
|
132
139
|
declare class RoutupEvent implements IRoutupEvent {
|
|
133
140
|
readonly request: RoutupRequest;
|
|
141
|
+
readonly params: Record<string, any>;
|
|
142
|
+
readonly path: string;
|
|
143
|
+
readonly method: string;
|
|
144
|
+
readonly mountPath: string;
|
|
145
|
+
readonly headers: Headers;
|
|
146
|
+
readonly searchParams: URLSearchParams;
|
|
147
|
+
readonly response: RoutupResponse;
|
|
148
|
+
readonly store: Record<string | symbol, unknown>;
|
|
149
|
+
protected _context: RoutupEventCreateContext;
|
|
150
|
+
protected _routerOptions?: RouterOptions;
|
|
151
|
+
constructor(context: RoutupEventCreateContext);
|
|
152
|
+
get routerOptions(): RouterOptions;
|
|
153
|
+
next(error?: Error): Promise<Response | undefined>;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/hook/constants.d.ts
|
|
157
|
+
declare enum HookName {
|
|
158
|
+
REQUEST = "request",
|
|
159
|
+
RESPONSE = "response",
|
|
160
|
+
ERROR = "error",
|
|
161
|
+
CHILD_MATCH = "childMatch",
|
|
162
|
+
CHILD_DISPATCH_BEFORE = "childDispatchBefore",
|
|
163
|
+
CHILD_DISPATCH_AFTER = "childDispatchAfter"
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/dispatcher/types.d.ts
|
|
167
|
+
interface IDispatcherEvent {
|
|
168
|
+
/**
|
|
169
|
+
* The srvx ServerRequest (extends Web Standard Request).
|
|
170
|
+
*/
|
|
171
|
+
readonly request: RoutupRequest;
|
|
172
|
+
/**
|
|
173
|
+
* Route parameters extracted from the URL path pattern.
|
|
174
|
+
*/
|
|
134
175
|
params: Record<string, any>;
|
|
176
|
+
/**
|
|
177
|
+
* Current request path, adjusted relative to the mount point during router nesting.
|
|
178
|
+
*/
|
|
135
179
|
path: string;
|
|
180
|
+
/**
|
|
181
|
+
* HTTP method (GET, POST, PUT, etc.).
|
|
182
|
+
*/
|
|
136
183
|
readonly method: string;
|
|
184
|
+
/**
|
|
185
|
+
* Accumulated mount path from nested routers.
|
|
186
|
+
*/
|
|
137
187
|
mountPath: string;
|
|
138
|
-
error?: RoutupError;
|
|
139
|
-
routerPath: number[];
|
|
140
188
|
/**
|
|
141
|
-
*
|
|
189
|
+
* Response accumulator — set status/headers before returning a plain value.
|
|
142
190
|
*/
|
|
143
|
-
|
|
144
|
-
readonly store: Record<string | symbol, unknown>;
|
|
145
|
-
protected _dispatched: boolean;
|
|
146
|
-
protected _response?: RoutupResponse;
|
|
191
|
+
readonly response: RoutupResponse;
|
|
147
192
|
/**
|
|
148
|
-
*
|
|
193
|
+
* Whether a response has been produced.
|
|
149
194
|
*/
|
|
150
|
-
|
|
151
|
-
protected _searchParams?: URLSearchParams;
|
|
195
|
+
dispatched: boolean;
|
|
152
196
|
/**
|
|
153
|
-
*
|
|
197
|
+
* Error that occurred during dispatch, if any.
|
|
154
198
|
*/
|
|
155
|
-
|
|
199
|
+
error?: RoutupError;
|
|
156
200
|
/**
|
|
157
|
-
*
|
|
201
|
+
* Router stack for nesting tracking.
|
|
202
|
+
* Used internally by router options resolution.
|
|
158
203
|
*/
|
|
159
|
-
|
|
204
|
+
routerPath: RouterPathNode[];
|
|
160
205
|
/**
|
|
161
|
-
*
|
|
206
|
+
* Collected allowed methods for the current path (used for OPTIONS / 405 responses).
|
|
162
207
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
208
|
+
methodsAllowed: string[];
|
|
209
|
+
/**
|
|
210
|
+
* Set the continuation function for this event.
|
|
211
|
+
*
|
|
212
|
+
* Replaces the current continuation. The provided function receives
|
|
213
|
+
* an optional error and may return any value — it will be converted
|
|
214
|
+
* to a `Response` via `toResponse()`.
|
|
215
|
+
*
|
|
216
|
+
* Passing `undefined` clears the continuation function.
|
|
217
|
+
*/
|
|
218
|
+
setNext(fn?: NextFn): void;
|
|
219
|
+
/**
|
|
220
|
+
* Build a public RoutupEvent from the current dispatch state.
|
|
221
|
+
*
|
|
222
|
+
* Creates a lightweight snapshot with shared references (store, response, headers)
|
|
223
|
+
* and pre-resolved router options. This is the event passed to handler functions.
|
|
224
|
+
*/
|
|
225
|
+
build(): RoutupEvent;
|
|
171
226
|
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/dispatcher/types.d.ts
|
|
174
227
|
interface IDispatcher {
|
|
175
|
-
dispatch(event:
|
|
176
|
-
}
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region src/hook/constants.d.ts
|
|
179
|
-
declare enum HookName {
|
|
180
|
-
REQUEST = "request",
|
|
181
|
-
RESPONSE = "response",
|
|
182
|
-
ERROR = "error",
|
|
183
|
-
CHILD_MATCH = "childMatch",
|
|
184
|
-
CHILD_DISPATCH_BEFORE = "childDispatchBefore",
|
|
185
|
-
CHILD_DISPATCH_AFTER = "childDispatchAfter"
|
|
228
|
+
dispatch(event: IDispatcherEvent): Promise<Response | undefined>;
|
|
186
229
|
}
|
|
187
230
|
//#endregion
|
|
188
231
|
//#region src/hook/types.d.ts
|
|
189
|
-
type HookErrorListener = (event:
|
|
190
|
-
type HookDefaultListener = (event:
|
|
232
|
+
type HookErrorListener = (event: IDispatcherEvent) => Promise<unknown> | unknown;
|
|
233
|
+
type HookDefaultListener = (event: IDispatcherEvent) => Promise<unknown> | unknown;
|
|
191
234
|
type HookListener = HookErrorListener | HookDefaultListener;
|
|
192
235
|
type HookUnsubscribeFn = () => void;
|
|
193
236
|
//#endregion
|
|
@@ -198,7 +241,7 @@ declare class HookManager {
|
|
|
198
241
|
addListener(name: `${HookName}`, fn: HookListener): HookUnsubscribeFn;
|
|
199
242
|
removeListener(name: `${HookName}`): void;
|
|
200
243
|
removeListener(name: `${HookName}`, fn: HookListener): void;
|
|
201
|
-
trigger(name: `${HookName}`, event:
|
|
244
|
+
trigger(name: `${HookName}`, event: IDispatcherEvent): Promise<void>;
|
|
202
245
|
private triggerListener;
|
|
203
246
|
private isErrorListenerHook;
|
|
204
247
|
}
|
|
@@ -280,7 +323,7 @@ declare class Handler implements IDispatcher {
|
|
|
280
323
|
get type(): "error" | "core";
|
|
281
324
|
get path(): string | undefined;
|
|
282
325
|
get method(): MethodName | undefined;
|
|
283
|
-
dispatch(event:
|
|
326
|
+
dispatch(event: IDispatcherEvent): Promise<Response | undefined>;
|
|
284
327
|
matchPath(path: string): boolean;
|
|
285
328
|
setPath(path?: Path): void;
|
|
286
329
|
matchMethod(method: `${MethodName}`): boolean;
|
|
@@ -394,6 +437,53 @@ declare function isWebHandler(input: unknown): input is WebHandler;
|
|
|
394
437
|
declare function isHandlerOptions(input: unknown): input is HandlerOptions;
|
|
395
438
|
declare function isHandler(input: unknown): input is Handler;
|
|
396
439
|
//#endregion
|
|
440
|
+
//#region src/plugin/types.d.ts
|
|
441
|
+
type PluginInstallFn = (router: IRouter) => any;
|
|
442
|
+
type Plugin = {
|
|
443
|
+
/**
|
|
444
|
+
* The name of the plugin.
|
|
445
|
+
*/
|
|
446
|
+
name: string;
|
|
447
|
+
/**
|
|
448
|
+
* The installation function called on registration.
|
|
449
|
+
*/
|
|
450
|
+
install: PluginInstallFn;
|
|
451
|
+
};
|
|
452
|
+
type PluginInstallContext = {
|
|
453
|
+
/**
|
|
454
|
+
* The name property overwrites the name defined by the plugin.
|
|
455
|
+
*/
|
|
456
|
+
name?: string;
|
|
457
|
+
/**
|
|
458
|
+
* By specifying a path, the plugin will be installed as a child router.
|
|
459
|
+
*/
|
|
460
|
+
path?: Path;
|
|
461
|
+
};
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region src/plugin/is.d.ts
|
|
464
|
+
declare function isPlugin(input: unknown): input is Plugin;
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region src/utils/etag/type.d.ts
|
|
467
|
+
type EtagOptions = {
|
|
468
|
+
/**
|
|
469
|
+
* Create a weak ETag?
|
|
470
|
+
* Output is prefixed with: /W
|
|
471
|
+
*/
|
|
472
|
+
weak?: boolean;
|
|
473
|
+
/**
|
|
474
|
+
* Threshold of bytes from which an etag is generated.
|
|
475
|
+
*
|
|
476
|
+
* default: undefined
|
|
477
|
+
*/
|
|
478
|
+
threshold?: number;
|
|
479
|
+
};
|
|
480
|
+
type EtagFn = (body: any, encoding?: BufferEncoding, size?: number) => Promise<string | undefined>;
|
|
481
|
+
type EtagInput = boolean | EtagOptions | EtagFn;
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/utils/trust-proxy/type.d.ts
|
|
484
|
+
type TrustProxyFn = (address: string, hop: number) => boolean;
|
|
485
|
+
type TrustProxyInput = boolean | number | string | string[] | TrustProxyFn;
|
|
486
|
+
//#endregion
|
|
397
487
|
//#region src/router/constants.d.ts
|
|
398
488
|
declare enum RouterPipelineStep {
|
|
399
489
|
START = 0,
|
|
@@ -405,17 +495,29 @@ declare enum RouterPipelineStep {
|
|
|
405
495
|
}
|
|
406
496
|
//#endregion
|
|
407
497
|
//#region src/router/types.d.ts
|
|
498
|
+
type RouterOptions = {
|
|
499
|
+
path?: Path;
|
|
500
|
+
name?: string;
|
|
501
|
+
subdomainOffset: number;
|
|
502
|
+
proxyIpMax: number;
|
|
503
|
+
etag: EtagFn;
|
|
504
|
+
trustProxy: TrustProxyFn;
|
|
505
|
+
};
|
|
506
|
+
type RouterOptionsInput = Omit<Partial<RouterOptions>, 'etag' | 'trustProxy'> & {
|
|
507
|
+
etag?: EtagInput;
|
|
508
|
+
trustProxy?: TrustProxyInput;
|
|
509
|
+
};
|
|
510
|
+
type RouterPathNode = {
|
|
511
|
+
readonly name?: string;
|
|
512
|
+
readonly options: Partial<RouterOptions>;
|
|
513
|
+
};
|
|
408
514
|
type RouterPipelineContext = {
|
|
409
515
|
step: RouterPipelineStep;
|
|
410
|
-
event:
|
|
516
|
+
event: IDispatcherEvent;
|
|
411
517
|
stackIndex: number;
|
|
412
518
|
response?: Response;
|
|
413
519
|
};
|
|
414
520
|
interface IRouter extends IDispatcher {
|
|
415
|
-
/**
|
|
416
|
-
* Unique identifier for this router instance.
|
|
417
|
-
*/
|
|
418
|
-
readonly id: number;
|
|
419
521
|
/**
|
|
420
522
|
* Optional label for the router instance.
|
|
421
523
|
*/
|
|
@@ -477,101 +579,52 @@ interface IRouter extends IDispatcher {
|
|
|
477
579
|
off(name: `${HookName}`, fn: HookListener): this;
|
|
478
580
|
}
|
|
479
581
|
//#endregion
|
|
480
|
-
//#region src/
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
name: string;
|
|
487
|
-
/**
|
|
488
|
-
* The installation function called on registration.
|
|
489
|
-
*/
|
|
490
|
-
install: PluginInstallFn;
|
|
491
|
-
};
|
|
492
|
-
type PluginInstallContext = {
|
|
493
|
-
/**
|
|
494
|
-
* The name property overwrites the name defined by the plugin.
|
|
495
|
-
*/
|
|
496
|
-
name?: string;
|
|
497
|
-
/**
|
|
498
|
-
* By specifying a path, the plugin will be installed as a child router.
|
|
499
|
-
*/
|
|
500
|
-
path?: Path;
|
|
501
|
-
};
|
|
502
|
-
//#endregion
|
|
503
|
-
//#region src/plugin/is.d.ts
|
|
504
|
-
declare function isPlugin(input: unknown): input is Plugin;
|
|
505
|
-
//#endregion
|
|
506
|
-
//#region src/utils/etag/type.d.ts
|
|
507
|
-
type EtagOptions = {
|
|
508
|
-
/**
|
|
509
|
-
* Create a weak ETag?
|
|
510
|
-
* Output is prefixed with: /W
|
|
511
|
-
*/
|
|
512
|
-
weak?: boolean;
|
|
513
|
-
/**
|
|
514
|
-
* Threshold of bytes from which an etag is generated.
|
|
515
|
-
*
|
|
516
|
-
* default: undefined
|
|
517
|
-
*/
|
|
518
|
-
threshold?: number;
|
|
519
|
-
};
|
|
520
|
-
type EtagFn = (body: any, encoding?: BufferEncoding, size?: number) => Promise<string | undefined>;
|
|
521
|
-
type EtagInput = boolean | EtagOptions | EtagFn;
|
|
522
|
-
//#endregion
|
|
523
|
-
//#region src/utils/trust-proxy/type.d.ts
|
|
524
|
-
type TrustProxyFn = (address: string, hop: number) => boolean;
|
|
525
|
-
type TrustProxyInput = boolean | number | string | string[] | TrustProxyFn;
|
|
526
|
-
//#endregion
|
|
527
|
-
//#region src/router-options/type.d.ts
|
|
528
|
-
type RouterOptions = {
|
|
529
|
-
/**
|
|
530
|
-
* The path the router is mounted on.
|
|
531
|
-
*
|
|
532
|
-
* @type string
|
|
533
|
-
* @default '/'
|
|
534
|
-
*/
|
|
535
|
-
path?: Path;
|
|
536
|
-
/**
|
|
537
|
-
* Name of the router.
|
|
538
|
-
*/
|
|
539
|
-
name?: string;
|
|
540
|
-
/**
|
|
541
|
-
* default: 2
|
|
542
|
-
*/
|
|
543
|
-
subdomainOffset: number;
|
|
582
|
+
//#region src/dispatcher/module.d.ts
|
|
583
|
+
declare class DispatcherEvent implements IDispatcherEvent {
|
|
584
|
+
readonly request: RoutupRequest;
|
|
585
|
+
params: Record<string, any>;
|
|
586
|
+
path: string;
|
|
587
|
+
readonly method: string;
|
|
544
588
|
/**
|
|
545
|
-
*
|
|
589
|
+
* Collected allowed methods (for OPTIONS).
|
|
546
590
|
*/
|
|
547
|
-
|
|
591
|
+
methodsAllowed: string[];
|
|
592
|
+
mountPath: string;
|
|
593
|
+
error?: RoutupError;
|
|
594
|
+
routerPath: RouterPathNode[];
|
|
595
|
+
protected _dispatched: boolean;
|
|
596
|
+
protected _response?: RoutupResponse;
|
|
597
|
+
protected _store?: Record<string | symbol, unknown>;
|
|
548
598
|
/**
|
|
549
|
-
*
|
|
599
|
+
* Cached parsed URL (avoids double-parsing).
|
|
550
600
|
*/
|
|
551
|
-
|
|
601
|
+
protected _url: InstanceType<typeof FastURL>;
|
|
552
602
|
/**
|
|
553
|
-
*
|
|
603
|
+
* Continuation function for middleware onion model.
|
|
554
604
|
*/
|
|
555
|
-
|
|
556
|
-
};
|
|
557
|
-
type RouterOptionsInput = Omit<Partial<RouterOptions>, 'etag' | 'trustProxy'> & {
|
|
605
|
+
protected _next?: (event: IRoutupEvent, error?: Error) => Promise<Response | undefined>;
|
|
558
606
|
/**
|
|
559
|
-
*
|
|
607
|
+
* Whether _next has already been called (guard against double-invocation).
|
|
560
608
|
*/
|
|
561
|
-
|
|
609
|
+
protected _nextCalled: boolean;
|
|
562
610
|
/**
|
|
563
|
-
*
|
|
611
|
+
* The cached result of the next handler.
|
|
564
612
|
*/
|
|
565
|
-
|
|
566
|
-
|
|
613
|
+
protected _nextResult?: Promise<Response | undefined>;
|
|
614
|
+
constructor(request: RoutupRequest);
|
|
615
|
+
get response(): RoutupResponse;
|
|
616
|
+
get dispatched(): boolean;
|
|
617
|
+
set dispatched(value: boolean);
|
|
618
|
+
protected next(event: IRoutupEvent, error?: Error): Promise<Response | undefined>;
|
|
619
|
+
setNext(fn?: NextFn): void;
|
|
620
|
+
build(): RoutupEvent;
|
|
621
|
+
protected get store(): Record<string | symbol, unknown>;
|
|
622
|
+
protected resolveOptions(): RouterOptions;
|
|
623
|
+
}
|
|
567
624
|
//#endregion
|
|
568
625
|
//#region src/router/module.d.ts
|
|
569
626
|
declare class Router implements IRouter {
|
|
570
627
|
readonly '@instanceof': symbol;
|
|
571
|
-
/**
|
|
572
|
-
* An identifier for the router instance.
|
|
573
|
-
*/
|
|
574
|
-
readonly id: number;
|
|
575
628
|
/**
|
|
576
629
|
* A label for the router instance.
|
|
577
630
|
*/
|
|
@@ -594,15 +647,19 @@ declare class Router implements IRouter {
|
|
|
594
647
|
* @protected
|
|
595
648
|
*/
|
|
596
649
|
protected hookManager: HookManager;
|
|
597
|
-
|
|
650
|
+
/**
|
|
651
|
+
* Normalized options for this router instance.
|
|
652
|
+
*/
|
|
653
|
+
protected _options: Partial<RouterOptions>;
|
|
654
|
+
constructor(input?: RouterOptionsInput);
|
|
598
655
|
matchPath(path: string): boolean;
|
|
599
656
|
setPath(value?: Path): void;
|
|
600
657
|
/**
|
|
601
|
-
* Public entry point — creates a
|
|
658
|
+
* Public entry point — creates a DispatcherEvent from the request,
|
|
602
659
|
* runs the pipeline, and returns a Response (with 404/500 fallbacks).
|
|
603
660
|
*/
|
|
604
661
|
fetch(request: RoutupRequest): Promise<Response>;
|
|
605
|
-
protected buildFallbackResponse(request: RoutupRequest, event:
|
|
662
|
+
protected buildFallbackResponse(request: RoutupRequest, event: IDispatcherEvent, status: number, message: string): Response;
|
|
606
663
|
protected executePipelineStep(context: RouterPipelineContext): Promise<void>;
|
|
607
664
|
protected executePipelineStepStart(context: RouterPipelineContext): Promise<void>;
|
|
608
665
|
protected executePipelineStepLookup(context: RouterPipelineContext): Promise<void>;
|
|
@@ -610,7 +667,7 @@ declare class Router implements IRouter {
|
|
|
610
667
|
protected executePipelineStepChildAfter(context: RouterPipelineContext): Promise<void>;
|
|
611
668
|
protected executePipelineStepChildDispatch(context: RouterPipelineContext): Promise<void>;
|
|
612
669
|
protected executePipelineStepFinish(context: RouterPipelineContext): Promise<void>;
|
|
613
|
-
dispatch(event:
|
|
670
|
+
dispatch(event: IDispatcherEvent): Promise<Response | undefined>;
|
|
614
671
|
delete(...handlers: (Handler | HandlerOptions)[]): this;
|
|
615
672
|
delete(path: Path, ...handlers: (Handler | HandlerOptions)[]): this;
|
|
616
673
|
get(...handlers: (Handler | HandlerOptions)[]): this;
|
|
@@ -715,10 +772,6 @@ declare function createEventStream(event: IRoutupEvent, options?: EventStreamOpt
|
|
|
715
772
|
//#region src/response/helpers/event-stream/utils.d.ts
|
|
716
773
|
declare function serializeEventStreamMessage(message: EventStreamMessage): string;
|
|
717
774
|
//#endregion
|
|
718
|
-
//#region src/response/helpers/gone.d.ts
|
|
719
|
-
declare function isResponseGone(event: IRoutupEvent): boolean;
|
|
720
|
-
declare function setResponseGone(event: IRoutupEvent): void;
|
|
721
|
-
//#endregion
|
|
722
775
|
//#region src/response/helpers/header.d.ts
|
|
723
776
|
declare function appendResponseHeader(event: IRoutupEvent, name: string, value: string | string[]): void;
|
|
724
777
|
declare function appendResponseHeaderDirective(event: IRoutupEvent, name: string, value: string | string[]): void;
|
|
@@ -844,5 +897,8 @@ type RequestProtocolOptions = {
|
|
|
844
897
|
};
|
|
845
898
|
declare function getRequestProtocol(event: IRoutupEvent, options?: RequestProtocolOptions): string;
|
|
846
899
|
//#endregion
|
|
847
|
-
|
|
848
|
-
|
|
900
|
+
//#region src/router/options.d.ts
|
|
901
|
+
declare function normalizeRouterOptions(input: RouterOptionsInput): Partial<RouterOptions>;
|
|
902
|
+
//#endregion
|
|
903
|
+
export { isPlugin as $, sendCreated as A, IDispatcher as At, EventStreamListener as B, HeaderName as Bt, sendStream as C, HandlerSymbol as Ct, SendFileOptions as D, Path as Dt, SendFileContentOptions as E, PathMatcher as Et, appendResponseHeaderDirective as F, NextFn as Ft, createError as G, ResponseCacheHeadersOptions as H, serializeEventStreamMessage as I, RoutupRequest as It, IRouter as J, Router as K, EventStreamHandle as L, RoutupResponse as Lt, setResponseHeaderContentType as M, RoutupEvent as Mt, setResponseHeaderAttachment as N, RoutupEventCreateContext as Nt, SendFileStats as O, PathMatcherExecResult as Ot, appendResponseHeader as P, IRoutupEvent as Pt, RouterPipelineContext as Q, EventStreamOptions as R, HTTPErrorInput$1 as Rt, setResponseContentTypeByFileName as S, HandlerBaseOptions as St, sendFormat as T, isPath as Tt, setResponseCacheHeaders as U, EventStreamMessage as V, MethodName as Vt, isError as W, RouterOptionsInput as X, RouterOptions as Y, RouterPathNode as Z, getRequestAcceptableContentTypes as _, Handler as _t, RequestIpOptions as a, isWebHandler as at, readBody as b, ErrorHandler as bt, getRequestHostName as c, WebHandler as ct, getRequestAcceptableLanguages as d, fromNodeMiddleware as dt, Plugin as et, getRequestAcceptableEncoding as f, NodeHandler as ft, getRequestAcceptableContentType as g, CoreHandlerOptions as gt, getRequestAcceptableCharsets as h, CoreHandler as ht, useRequestNegotiator as i, isHandlerOptions as it, sendAccepted as j, IDispatcherEvent as jt, sendFile as k, PathMatcherOptions as kt, matchRequestContentType as l, WebHandlerProvider as lt, getRequestAcceptableCharset as m, defineCoreHandler as mt, RequestProtocolOptions as n, PluginInstallFn as nt, getRequestIP as o, isWebHandlerProvider as ot, getRequestAcceptableEncodings as p, NodeMiddleware as pt, DispatcherEvent as q, getRequestProtocol as r, isHandler as rt, RequestHostNameOptions as s, fromWebHandler as st, normalizeRouterOptions as t, PluginInstallContext as tt, getRequestAcceptableLanguage as u, fromNodeHandler as ut, getRequestHeader as v, HandlerOptions as vt, sendRedirect as w, HandlerType as wt, toResponse as x, ErrorHandlerOptions as xt, isRequestCacheable as y, defineErrorHandler as yt, createEventStream as z, RoutupError as zt };
|
|
904
|
+
//# sourceMappingURL=index-DCtnUoGL.d.mts.map
|
package/dist/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isPlugin, A as sendCreated, At as IDispatcher, B as EventStreamListener, Bt as HeaderName, C as sendStream, Ct as HandlerSymbol, D as SendFileOptions, Dt as Path, E as SendFileContentOptions, Et as PathMatcher, F as appendResponseHeaderDirective, Ft as NextFn, G as createError, H as ResponseCacheHeadersOptions, I as serializeEventStreamMessage, It as RoutupRequest, J as IRouter, K as Router, L as EventStreamHandle, Lt as RoutupResponse, M as setResponseHeaderContentType, Mt as RoutupEvent, N as setResponseHeaderAttachment, Nt as RoutupEventCreateContext, O as SendFileStats, Ot as PathMatcherExecResult, P as appendResponseHeader, Pt as IRoutupEvent, Q as RouterPipelineContext, R as EventStreamOptions, Rt as HTTPErrorInput, S as setResponseContentTypeByFileName, St as HandlerBaseOptions, T as sendFormat, Tt as isPath, U as setResponseCacheHeaders, V as EventStreamMessage, Vt as MethodName, W as isError, X as RouterOptionsInput, Y as RouterOptions, Z as RouterPathNode, _ as getRequestAcceptableContentTypes, _t as Handler, a as RequestIpOptions, at as isWebHandler, b as readBody, bt as ErrorHandler, c as getRequestHostName, ct as WebHandler, d as getRequestAcceptableLanguages, dt as fromNodeMiddleware, et as Plugin, f as getRequestAcceptableEncoding, ft as NodeHandler, g as getRequestAcceptableContentType, gt as CoreHandlerOptions, h as getRequestAcceptableCharsets, ht as CoreHandler, i as useRequestNegotiator, it as isHandlerOptions, j as sendAccepted, jt as IDispatcherEvent, k as sendFile, kt as PathMatcherOptions, l as matchRequestContentType, lt as WebHandlerProvider, m as getRequestAcceptableCharset, mt as defineCoreHandler, n as RequestProtocolOptions, nt as PluginInstallFn, o as getRequestIP, ot as isWebHandlerProvider, p as getRequestAcceptableEncodings, pt as NodeMiddleware, q as DispatcherEvent, r as getRequestProtocol, rt as isHandler, s as RequestHostNameOptions, st as fromWebHandler, t as normalizeRouterOptions, tt as PluginInstallContext, u as getRequestAcceptableLanguage, ut as fromNodeHandler, v as getRequestHeader, vt as HandlerOptions, w as sendRedirect, wt as HandlerType, x as toResponse, xt as ErrorHandlerOptions, y as isRequestCacheable, yt as defineErrorHandler, z as createEventStream, zt as RoutupError } from "./index-DCtnUoGL.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, ErrorHandler, ErrorHandlerOptions, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IRouter, IRoutupEvent, MethodName, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterPipelineContext, RoutupError, RoutupEvent, 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,
|
|
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, readBody, 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 setResponseCacheHeaders, A as createError, B as getRequestHeader, C as defineErrorHandler, D as PathMatcher, E as isPath, F as sendRedirect, G as setResponseHeaderContentType, H as sendCreated, I as sendFormat, J as appendResponseHeader, K as setResponseHeaderAttachment, L as getRequestAcceptableContentType, M as DispatcherEvent, N as RoutupEvent, O as HandlerSymbol, P as sendStream, Q as RoutupError, R as getRequestAcceptableContentTypes, S as fromNodeMiddleware, T as Handler, U as sendAccepted, V as sendFile, W as toResponse, X as createEventStream, Y as appendResponseHeaderDirective, Z as serializeEventStreamMessage, _ as isHandlerOptions, a as getRequestIP, b as isWebHandlerProvider, c as getRequestAcceptableLanguage, d as getRequestAcceptableEncodings, et as HeaderName, f as getRequestAcceptableCharset, g as isHandler, h as readBody, i as getRequestProtocol, j as isError, k as HandlerType, l as getRequestAcceptableLanguages, m as isRequestCacheable, n as normalizeRouterOptions, o as getRequestHostName, p as getRequestAcceptableCharsets, q as setResponseContentTypeByFileName, r as isPlugin, s as matchRequestContentType, t as Router, tt as MethodName, u as getRequestAcceptableEncoding, v as fromWebHandler, w as defineCoreHandler, x as fromNodeHandler, y as isWebHandler, z as useRequestNegotiator } from "./src-Tr9cHQaV.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 { 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,
|
|
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, readBody, 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 isPlugin, A as sendCreated, At as IDispatcher, B as EventStreamListener, Bt as HeaderName, C as sendStream, Ct as HandlerSymbol, D as SendFileOptions, Dt as Path, E as SendFileContentOptions, Et as PathMatcher, F as appendResponseHeaderDirective, Ft as NextFn, G as createError, H as ResponseCacheHeadersOptions, I as serializeEventStreamMessage, It as RoutupRequest, J as IRouter, K as Router, L as EventStreamHandle, Lt as RoutupResponse, M as setResponseHeaderContentType, Mt as RoutupEvent, N as setResponseHeaderAttachment, Nt as RoutupEventCreateContext, O as SendFileStats, Ot as PathMatcherExecResult, P as appendResponseHeader, Pt as IRoutupEvent, Q as RouterPipelineContext, R as EventStreamOptions, Rt as HTTPErrorInput, S as setResponseContentTypeByFileName, St as HandlerBaseOptions, T as sendFormat, Tt as isPath, U as setResponseCacheHeaders, V as EventStreamMessage, Vt as MethodName, W as isError, X as RouterOptionsInput, Y as RouterOptions, Z as RouterPathNode, _ as getRequestAcceptableContentTypes, _t as Handler, a as RequestIpOptions, at as isWebHandler, b as readBody, bt as ErrorHandler, c as getRequestHostName, ct as WebHandler, d as getRequestAcceptableLanguages, dt as fromNodeMiddleware, et as Plugin, f as getRequestAcceptableEncoding, ft as NodeHandler, g as getRequestAcceptableContentType, gt as CoreHandlerOptions, h as getRequestAcceptableCharsets, ht as CoreHandler, i as useRequestNegotiator, it as isHandlerOptions, j as sendAccepted, jt as IDispatcherEvent, k as sendFile, kt as PathMatcherOptions, l as matchRequestContentType, lt as WebHandlerProvider, m as getRequestAcceptableCharset, mt as defineCoreHandler, n as RequestProtocolOptions, nt as PluginInstallFn, o as getRequestIP, ot as isWebHandlerProvider, p as getRequestAcceptableEncodings, pt as NodeMiddleware, q as DispatcherEvent, r as getRequestProtocol, rt as isHandler, s as RequestHostNameOptions, st as fromWebHandler, t as normalizeRouterOptions, tt as PluginInstallContext, u as getRequestAcceptableLanguage, ut as fromNodeHandler, v as getRequestHeader, vt as HandlerOptions, w as sendRedirect, wt as HandlerType, x as toResponse, xt as ErrorHandlerOptions, y as isRequestCacheable, yt as defineErrorHandler, z as createEventStream, zt as RoutupError } from "./index-DCtnUoGL.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, ErrorHandler, ErrorHandlerOptions, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IRouter, IRoutupEvent, MethodName, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterPipelineContext, RoutupError, RoutupEvent, 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,
|
|
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, readBody, 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 setResponseCacheHeaders, A as createError, B as getRequestHeader, C as defineErrorHandler, D as PathMatcher, E as isPath, F as sendRedirect, G as setResponseHeaderContentType, H as sendCreated, I as sendFormat, J as appendResponseHeader, K as setResponseHeaderAttachment, L as getRequestAcceptableContentType, M as DispatcherEvent, N as RoutupEvent, O as HandlerSymbol, P as sendStream, Q as RoutupError, R as getRequestAcceptableContentTypes, S as fromNodeMiddleware, T as Handler, U as sendAccepted, V as sendFile, W as toResponse, X as createEventStream, Y as appendResponseHeaderDirective, Z as serializeEventStreamMessage, _ as isHandlerOptions, a as getRequestIP, b as isWebHandlerProvider, c as getRequestAcceptableLanguage, d as getRequestAcceptableEncodings, et as HeaderName, f as getRequestAcceptableCharset, g as isHandler, h as readBody, i as getRequestProtocol, j as isError, k as HandlerType, l as getRequestAcceptableLanguages, m as isRequestCacheable, n as normalizeRouterOptions, o as getRequestHostName, p as getRequestAcceptableCharsets, q as setResponseContentTypeByFileName, r as isPlugin, s as matchRequestContentType, t as Router, tt as MethodName, u as getRequestAcceptableEncoding, v as fromWebHandler, w as defineCoreHandler, x as fromNodeHandler, y as isWebHandler, z as useRequestNegotiator } from "./src-Tr9cHQaV.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 { 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,
|
|
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, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=service-worker.mjs.map
|