@cfworker/web 2.1.0 → 3.0.0
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/cjs/accepts.js +81 -0
- package/dist/{application.d.ts → cjs/application.d.ts} +1 -1
- package/dist/cjs/application.js +46 -0
- package/dist/cjs/context.js +26 -0
- package/dist/cjs/cookies.js +21 -0
- package/dist/cjs/http-error.js +38 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/middleware.js +31 -0
- package/dist/cjs/normalize-pathname.js +22 -0
- package/dist/cjs/req.js +59 -0
- package/dist/cjs/response-builder.js +138 -0
- package/dist/cjs/router.d.ts +39 -0
- package/dist/cjs/router.js +105 -0
- package/dist/{validate.d.ts → cjs/validate.d.ts} +1 -1
- package/dist/cjs/validate.js +76 -0
- package/dist/esm/accepts.d.ts +12 -0
- package/dist/esm/application.d.ts +11 -0
- package/dist/esm/context.d.ts +15 -0
- package/dist/esm/cookies.d.ts +8 -0
- package/dist/esm/http-error.d.ts +7 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/middleware.d.ts +3 -0
- package/dist/esm/normalize-pathname.d.ts +3 -0
- package/dist/esm/req.d.ts +24 -0
- package/dist/esm/response-builder.d.ts +22 -0
- package/dist/esm/router.d.ts +39 -0
- package/dist/{router.js → esm/router.js} +0 -1
- package/dist/esm/validate.d.ts +21 -0
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +11 -7
- package/src/application.ts +1 -1
- package/src/context.ts +1 -1
- package/src/cookies.ts +5 -1
- package/src/normalize-pathname.ts +1 -1
- package/src/req.ts +4 -4
- package/src/response-builder.ts +7 -7
- package/src/router.ts +33 -22
- package/src/validate.ts +2 -2
- package/dist/router.d.ts +0 -39
- /package/dist/{accepts.d.ts → cjs/accepts.d.ts} +0 -0
- /package/dist/{context.d.ts → cjs/context.d.ts} +0 -0
- /package/dist/{cookies.d.ts → cjs/cookies.d.ts} +0 -0
- /package/dist/{http-error.d.ts → cjs/http-error.d.ts} +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{middleware.d.ts → cjs/middleware.d.ts} +0 -0
- /package/dist/{normalize-pathname.d.ts → cjs/normalize-pathname.d.ts} +0 -0
- /package/dist/{req.d.ts → cjs/req.d.ts} +0 -0
- /package/dist/{response-builder.d.ts → cjs/response-builder.d.ts} +0 -0
- /package/dist/{accepts.js → esm/accepts.js} +0 -0
- /package/dist/{application.js → esm/application.js} +0 -0
- /package/dist/{context.js → esm/context.js} +0 -0
- /package/dist/{cookies.js → esm/cookies.js} +0 -0
- /package/dist/{http-error.js → esm/http-error.js} +0 -0
- /package/dist/{index.js → esm/index.d.ts} +0 -0
- /package/dist/{middleware.js → esm/middleware.js} +0 -0
- /package/dist/{normalize-pathname.js → esm/normalize-pathname.js} +0 -0
- /package/dist/{req.js → esm/req.js} +0 -0
- /package/dist/{response-builder.js → esm/response-builder.js} +0 -0
- /package/dist/{validate.js → esm/validate.js} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validate = exports.messages = void 0;
|
|
4
|
+
const json_schema_1 = require("@cfworker/json-schema");
|
|
5
|
+
const http_error_js_1 = require("./http-error.js");
|
|
6
|
+
const draft = '2019-09';
|
|
7
|
+
const hasBody = {
|
|
8
|
+
POST: true,
|
|
9
|
+
PUT: true,
|
|
10
|
+
DELETE: true,
|
|
11
|
+
PATCH: true
|
|
12
|
+
};
|
|
13
|
+
function middlewareFactory(schemas, parser = Object.fromEntries, lookup = Object.create(null)) {
|
|
14
|
+
const { headers: $headers, search: $search, params: $params, body: $body } = schemas;
|
|
15
|
+
if ($headers) {
|
|
16
|
+
(0, json_schema_1.dereference)($headers, { ...lookup });
|
|
17
|
+
}
|
|
18
|
+
if ($search) {
|
|
19
|
+
(0, json_schema_1.dereference)($search, { ...lookup });
|
|
20
|
+
}
|
|
21
|
+
if ($params) {
|
|
22
|
+
(0, json_schema_1.dereference)($params, { ...lookup });
|
|
23
|
+
}
|
|
24
|
+
if ($body) {
|
|
25
|
+
(0, json_schema_1.dereference)($body, { ...lookup });
|
|
26
|
+
}
|
|
27
|
+
return async ({ req }, next) => {
|
|
28
|
+
if ($params) {
|
|
29
|
+
validateRequestPart('params', req.params, $params, lookup);
|
|
30
|
+
}
|
|
31
|
+
if ($headers) {
|
|
32
|
+
const headers = Object.fromEntries(req.headers);
|
|
33
|
+
validateRequestPart('headers', headers, $headers, lookup);
|
|
34
|
+
}
|
|
35
|
+
if ($search) {
|
|
36
|
+
const search = parser(req.url.searchParams);
|
|
37
|
+
validateRequestPart('search', search, $search, lookup);
|
|
38
|
+
}
|
|
39
|
+
if ($body && hasBody[req.method]) {
|
|
40
|
+
let body;
|
|
41
|
+
const contentType = req.headers.get('content-type') || '';
|
|
42
|
+
if (contentType === 'application/x-www-form-urlencoded' ||
|
|
43
|
+
contentType.startsWith('application/x-www-form-urlencoded;') ||
|
|
44
|
+
contentType.startsWith('multipart/form-data;')) {
|
|
45
|
+
const form = await req.body.formData();
|
|
46
|
+
body = parser(form);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
body = await req.body.json();
|
|
50
|
+
}
|
|
51
|
+
validateRequestPart('body', body, $body, lookup);
|
|
52
|
+
}
|
|
53
|
+
await next();
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.messages = {
|
|
57
|
+
params: 'Parameters in request path are invalid.',
|
|
58
|
+
headers: 'Headers are invalid.',
|
|
59
|
+
search: 'Query string parameters are invalid.',
|
|
60
|
+
body: 'Body is invalid.'
|
|
61
|
+
};
|
|
62
|
+
function validateRequestPart(part, instance, schema, lookup) {
|
|
63
|
+
const result = (0, json_schema_1.validate)(instance, schema, draft, lookup);
|
|
64
|
+
if (result.valid) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const errorBody = {
|
|
68
|
+
status: 400,
|
|
69
|
+
part,
|
|
70
|
+
message: exports.messages[part],
|
|
71
|
+
errors: result.errors,
|
|
72
|
+
schema
|
|
73
|
+
};
|
|
74
|
+
throw new http_error_js_1.HttpError(400, errorBody);
|
|
75
|
+
}
|
|
76
|
+
exports.validate = middlewareFactory;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class Accepts {
|
|
2
|
+
private readonly headers;
|
|
3
|
+
private _type;
|
|
4
|
+
private _language;
|
|
5
|
+
private _encoding;
|
|
6
|
+
private _charset;
|
|
7
|
+
constructor(headers: Headers);
|
|
8
|
+
type<T extends string>(...values: T[]): T | false;
|
|
9
|
+
language<T extends string>(...values: T[]): T | false;
|
|
10
|
+
encoding<T extends string>(...values: T[]): T | false;
|
|
11
|
+
charset<T extends string>(...values: T[]): T | false;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Middleware } from './middleware.js';
|
|
2
|
+
export declare class Application {
|
|
3
|
+
private readonly middleware;
|
|
4
|
+
private _composedMiddleware?;
|
|
5
|
+
private get composedMiddleware();
|
|
6
|
+
use(middleware: Middleware): Application;
|
|
7
|
+
handleRequest(request: Request, env: any, context: {
|
|
8
|
+
waitUntil(promise: Promise<any>): void;
|
|
9
|
+
}): Promise<Response>;
|
|
10
|
+
private invokeMiddleware;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Cookies } from './cookies.js';
|
|
2
|
+
import { Req } from './req.js';
|
|
3
|
+
import { ResponseBuilder } from './response-builder.js';
|
|
4
|
+
export declare class Context {
|
|
5
|
+
readonly environmentBindings: any;
|
|
6
|
+
private readonly _context;
|
|
7
|
+
readonly req: Req;
|
|
8
|
+
readonly res: ResponseBuilder;
|
|
9
|
+
readonly cookies: Cookies;
|
|
10
|
+
readonly state: any;
|
|
11
|
+
constructor(request: Request, environmentBindings: any, _context: {
|
|
12
|
+
waitUntil(promise: Promise<any>): void;
|
|
13
|
+
});
|
|
14
|
+
waitUntil(promise: Promise<any>): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CookieSerializeOptions } from 'cookie';
|
|
2
|
+
export declare class Cookies {
|
|
3
|
+
private readonly responseHeaders;
|
|
4
|
+
private readonly requestCookies;
|
|
5
|
+
constructor(requestHeaders: Headers, responseHeaders: Headers);
|
|
6
|
+
get(name: string): string | null;
|
|
7
|
+
set(name: string, val: string, options?: CookieSerializeOptions): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { escape as htmlEncode } from 'html-escaper';
|
|
2
|
+
export * from './accepts.js';
|
|
3
|
+
export * from './application.js';
|
|
4
|
+
export * from './context.js';
|
|
5
|
+
export * from './cookies.js';
|
|
6
|
+
export * from './http-error.js';
|
|
7
|
+
export * from './middleware.js';
|
|
8
|
+
export * from './normalize-pathname.js';
|
|
9
|
+
export * from './req.js';
|
|
10
|
+
export * from './response-builder.js';
|
|
11
|
+
export * from './router.js';
|
|
12
|
+
export * from './validate.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Reviver } from 'secure-json-parse';
|
|
2
|
+
import { Accepts } from './accepts.js';
|
|
3
|
+
export declare class Req {
|
|
4
|
+
readonly raw: Request;
|
|
5
|
+
readonly method: string;
|
|
6
|
+
readonly url: URL;
|
|
7
|
+
readonly headers: Headers;
|
|
8
|
+
readonly params: Record<string, string>;
|
|
9
|
+
readonly accepts: Accepts;
|
|
10
|
+
readonly body: ReqBody;
|
|
11
|
+
constructor(request: Request);
|
|
12
|
+
}
|
|
13
|
+
export declare class ReqBody {
|
|
14
|
+
private readonly request;
|
|
15
|
+
private _arrayBuffer;
|
|
16
|
+
private _formData;
|
|
17
|
+
private _json;
|
|
18
|
+
private _text;
|
|
19
|
+
constructor(request: Request);
|
|
20
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
21
|
+
formData(): Promise<FormData>;
|
|
22
|
+
json(reviver?: Reviver): Promise<any>;
|
|
23
|
+
text(): Promise<string>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ExtendedBodyInit = BodyInit | boolean | Date | number | object | null;
|
|
2
|
+
export declare class ResponseBuilder {
|
|
3
|
+
readonly headers: Headers;
|
|
4
|
+
private _status;
|
|
5
|
+
private _explicitStatus;
|
|
6
|
+
private _implicitType;
|
|
7
|
+
private _body;
|
|
8
|
+
private _stringifyBody;
|
|
9
|
+
get status(): number;
|
|
10
|
+
set status(value: number);
|
|
11
|
+
get statusText(): string;
|
|
12
|
+
get body(): ExtendedBodyInit | null;
|
|
13
|
+
set body(value: ExtendedBodyInit | null);
|
|
14
|
+
redirect(url: string | URL): void;
|
|
15
|
+
get type(): string;
|
|
16
|
+
set type(value: string);
|
|
17
|
+
get lastModified(): string | Date | null;
|
|
18
|
+
set lastModified(value: string | Date | null);
|
|
19
|
+
get etag(): string | null;
|
|
20
|
+
set etag(value: string | null);
|
|
21
|
+
create(): Response;
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PathToRegexpOptions } from 'path-to-regexp';
|
|
2
|
+
import { Context } from './context.js';
|
|
3
|
+
import { Middleware } from './middleware.js';
|
|
4
|
+
export type Predicate = (context: Context) => boolean;
|
|
5
|
+
export declare const Method: (method: string) => Predicate;
|
|
6
|
+
export declare const Get: Predicate;
|
|
7
|
+
export declare const Post: Predicate;
|
|
8
|
+
export declare const Put: Predicate;
|
|
9
|
+
export declare const Patch: Predicate;
|
|
10
|
+
export declare const Delete: Predicate;
|
|
11
|
+
export declare const Head: Predicate;
|
|
12
|
+
export declare const Options: Predicate;
|
|
13
|
+
export declare const Header: (header: string, value: string) => Predicate;
|
|
14
|
+
export declare const Host: (host: string) => Predicate;
|
|
15
|
+
export declare const Path: (pattern: string, options?: PathToRegexpOptions) => Predicate;
|
|
16
|
+
export type RouteCondition = (context: Context) => boolean;
|
|
17
|
+
export interface Route {
|
|
18
|
+
conditions: RouteCondition[];
|
|
19
|
+
middleware: Middleware;
|
|
20
|
+
}
|
|
21
|
+
export interface RouterOptions {
|
|
22
|
+
pathToRegExpOptions?: PathToRegexpOptions;
|
|
23
|
+
}
|
|
24
|
+
export declare const defaultRouterOptions: RouterOptions;
|
|
25
|
+
export declare class Router {
|
|
26
|
+
private readonly options;
|
|
27
|
+
private readonly routes;
|
|
28
|
+
constructor(options?: RouterOptions);
|
|
29
|
+
get(pathname: string, ...middleware: Middleware[]): Router;
|
|
30
|
+
post(pathname: string, ...middleware: Middleware[]): Router;
|
|
31
|
+
put(pathname: string, ...middleware: Middleware[]): Router;
|
|
32
|
+
patch(pathname: string, ...middleware: Middleware[]): Router;
|
|
33
|
+
delete(pathname: string, ...middleware: Middleware[]): Router;
|
|
34
|
+
head(pathname: string, ...middleware: Middleware[]): Router;
|
|
35
|
+
all(pathname: string, ...middleware: Middleware[]): Router;
|
|
36
|
+
middleware: Middleware;
|
|
37
|
+
compose(conditions: RouteCondition[], ...middleware: Middleware[]): Router;
|
|
38
|
+
resolve(ctx: Context): Route | undefined;
|
|
39
|
+
}
|
|
@@ -16,7 +16,6 @@ export const Header = (header, value) => {
|
|
|
16
16
|
return ({ req }) => req.headers.get(header) === value;
|
|
17
17
|
};
|
|
18
18
|
export const Host = (host) => Header('host', host);
|
|
19
|
-
export const Referer = (host) => Header('referer', host);
|
|
20
19
|
export const Path = (pattern, options) => {
|
|
21
20
|
const regExp = pathToRegexp(pattern, options);
|
|
22
21
|
return ({ req: { url, params } }) => {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OutputUnit, Schema } from '@cfworker/json-schema';
|
|
2
|
+
import { Middleware } from './middleware.js';
|
|
3
|
+
export interface RequestSchemas {
|
|
4
|
+
body?: Schema;
|
|
5
|
+
headers?: Schema;
|
|
6
|
+
params?: Schema;
|
|
7
|
+
search?: Schema;
|
|
8
|
+
}
|
|
9
|
+
export type RequestPart = keyof RequestSchemas;
|
|
10
|
+
export type RequestParser = (data: URLSearchParams | FormData) => any;
|
|
11
|
+
declare function middlewareFactory(schemas: RequestSchemas, parser?: RequestParser, lookup?: Record<string, Schema | boolean>): Middleware;
|
|
12
|
+
export declare const messages: Record<RequestPart, string>;
|
|
13
|
+
export interface RequestValidationErrorBody {
|
|
14
|
+
status: 400;
|
|
15
|
+
part: RequestPart;
|
|
16
|
+
message: string;
|
|
17
|
+
errors: OutputUnit[];
|
|
18
|
+
schema: Schema;
|
|
19
|
+
}
|
|
20
|
+
export declare const validate: typeof middlewareFactory;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.webworker.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/accepts.ts","../../../node_modules/@types/statuses/index.d.ts","../../../node_modules/@types/cookie/index.d.ts","../src/cookies.ts","../../../node_modules/secure-json-parse/types/index.d.ts","../src/req.ts","../src/response-builder.ts","../src/context.ts","../src/http-error.ts","../src/middleware.ts","../src/application.ts","../src/declarations.d.ts","../../../node_modules/@types/html-escaper/index.d.ts","../src/normalize-pathname.ts","../../../node_modules/path-to-regexp/dist/index.d.ts","../src/router.ts","../../json-schema/dist/esm/deep-compare-strict.d.ts","../../json-schema/dist/esm/types.d.ts","../../json-schema/dist/esm/dereference.d.ts","../../json-schema/dist/esm/format.d.ts","../../json-schema/dist/esm/pointer.d.ts","../../json-schema/dist/esm/ucs2-length.d.ts","../../json-schema/dist/esm/validate.d.ts","../../json-schema/dist/esm/validator.d.ts","../../json-schema/dist/esm/index.d.ts","../src/validate.ts","../src/index.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"7ad342d4d126c62920de283dffe88f5c06f81b496bb47613df59f4506a1ef074","affectsGlobalScope":true},{"version":"3c01508aed780c01c623a8015b1668744f573b7ba3153f4431cf67b9a4e026ac","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"95843649a529090b4fdc5d67217978d74c8dab4717f3a5f5df3548265af7a160","signature":"69bb8b89892892fa35ccbe23bceb035223c62e095a48ccca757f0097647e552d"},"1f4ae755492a669b317903a6b1664cb7af3fe0c3d1eec6447f4e95a80616d15a","1748c03e7a7d118f7f6648c709507971eb0d416f489958492c5ae625de445184",{"version":"774ad4f17ef4511e5fdd0bacb876ffac1a189d193014a18788917c19cb9af581","signature":"6607d326b72eaf61da75f75785aef74ea03c2c5d3b392f24c0fbf898c6bc43bf"},"453740a49328721fb8cb3ee3a8422eab92f78fab88f31b79508a801634fec1e2",{"version":"b2c8a481cfc150d85ea00831d3fdf4aaed77008ae7b4b4207276b08e267f7624","signature":"6e05f2be5d58e5f8d94c62f4013f7d0533dbaec53d1deff9c383c4406f011084"},{"version":"b60928670b1755f3e102c189619ea2e9e2237ecb40e010c52480bf26840b741a","signature":"c4c84dffaa3f00b75f89dbc3eb8f31a752383436b039264f42df063bdad679cf"},{"version":"a5536381b154ed8bc3a4f39b1bdb815bcec1be1e4886607b52486f589b2fa5c5","signature":"e9eb86a27ee96f3a99aa5631f8b6de3848cd351f721f58032cf6d7ed864a78b6"},{"version":"2a1f08253ff84ee25efd34d7948dd0c73a5ecefc86bb9958b537153bb86f061a","signature":"5241793d5d6e0ef3537b74cdec0c0c49fa171885f220e0497ea9801c85141936"},{"version":"1c04e253c9e3c14ac5cbc81572a6e36f132deaf90c4a069d8cfa5affa7205277","signature":"cd00628b29ccca0cbde6bf22559a0d5e7210520f8bb45a5e1dcbaa8a2da80e7f"},{"version":"90bb8934ea69c1a1dbe83b55efbc8a7793484b6ec4ff14c25c4104ce12515f08","signature":"3532abc970b751a18a40eabdaa29e837ca9e6ae8b37929fc6022be1e3e064af1"},{"version":"b8ff6faf6bf647032e3cee5f7e4b2e0f2e668f930d6e5beb894cfee4c6c26936","affectsGlobalScope":true},"2cbbade4eaf0c1e4718ad4961979488f0fb74c38392d7cf705358950e913943d",{"version":"c7fb7af1dbdfb292379b22678566bc719dedee6888741cbcdb3f4f05bd1fb82c","signature":"834bee2451101fde1d9f0062068488cfba4c9bd843b9fef4b2b0f0a315954024"},"02dfc937dce0da28fe4bc500a32b7d645acedd00609a762a5426feebb575431b",{"version":"65a1057eb4514733810cc7a120977b67b140786ca49a43efa0ced89f58093edc","signature":"7e135c8a81e6a046ee90e6afa1b74a6c18c8076e7dfe2080f46125eddb9f4d73"},"61d6c43861d171f1129a3179983d8af80995d3e86f90bdeaad9415756022d4b3","33bb7966e2c859326207e0bda17423fbf1bd81dbc8e6ba54fa143f950566e9da","4ae63b19255579a897918c94e928c4351c6bb6de552d50f14f41c6f175f4d282","4114c8edf09acaa907aa1293c6fbfc71d26b7ae9ecf0e3dbf4ec47302bc51444","4276e358bf27203613ebe2f917706385875fa02481ed2829a96611eecc8c4255","c223c62757304681e71494f26e78e828c83f9612b76c1181b2e9a7cf6f853fec","d0f4d6c857e665d4163074039b1fbd996d67b8ef233117412adf4748b33689f5","e25f0e3f148d4fb60ad91dc4ac77886119d2ff74f408596477c62f7bda54cb9b","a204e4f8f148eacfce004a47fb7920ffce1e7744323c2018731d288bf805c590",{"version":"9e97a42f468e93a544cbb6af8b73ecd2894f7b18ea07c89b5feadc983d23c832","signature":"6b01ba5f8086cd87ab8047414f6eec54a9fe8aafb620f0f31daf7f8ae44ddc8c"},"be3c1a1c10970723dca8fda3f3d3e47fbac3ead8fd347e47f726ad257141420b"],"root":[74,77,[79,85],87,89,99,100],"options":{"composite":true,"esModuleInterop":true,"isolatedDeclarations":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","removeComments":true,"rootDir":"../src","strict":true,"target":99},"fileIdsList":[[91],[90,91,92,93,94,95,96,97],[75,81,82,83],[77,79,80],[76],[75],[74,77,79,80,81,82,83,84,86,87,89,99],[81],[82,83],[74,78],[81,83,88],[82,83,98]],"referencedMap":[[92,1],[98,2],[96,1],[97,1],[84,3],[81,4],[77,5],[82,6],[100,7],[83,8],[87,9],[79,10],[80,6],[89,11],[99,12]],"latestChangedDtsFile":"./cjs/index.d.ts"},"version":"5.5.4"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.webworker.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/accepts.ts","../../../node_modules/@types/statuses/index.d.ts","../../../node_modules/@types/cookie/index.d.ts","../src/cookies.ts","../../../node_modules/secure-json-parse/types/index.d.ts","../src/req.ts","../src/response-builder.ts","../src/context.ts","../src/http-error.ts","../src/middleware.ts","../src/application.ts","../src/declarations.d.ts","../../../node_modules/@types/html-escaper/index.d.ts","../src/normalize-pathname.ts","../../../node_modules/path-to-regexp/dist/index.d.ts","../src/router.ts","../../json-schema/dist/esm/deep-compare-strict.d.ts","../../json-schema/dist/esm/types.d.ts","../../json-schema/dist/esm/dereference.d.ts","../../json-schema/dist/esm/format.d.ts","../../json-schema/dist/esm/pointer.d.ts","../../json-schema/dist/esm/ucs2-length.d.ts","../../json-schema/dist/esm/validate.d.ts","../../json-schema/dist/esm/validator.d.ts","../../json-schema/dist/esm/index.d.ts","../src/validate.ts","../src/index.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"7ad342d4d126c62920de283dffe88f5c06f81b496bb47613df59f4506a1ef074","affectsGlobalScope":true},{"version":"3c01508aed780c01c623a8015b1668744f573b7ba3153f4431cf67b9a4e026ac","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"95843649a529090b4fdc5d67217978d74c8dab4717f3a5f5df3548265af7a160","signature":"69bb8b89892892fa35ccbe23bceb035223c62e095a48ccca757f0097647e552d"},"1f4ae755492a669b317903a6b1664cb7af3fe0c3d1eec6447f4e95a80616d15a","1748c03e7a7d118f7f6648c709507971eb0d416f489958492c5ae625de445184",{"version":"774ad4f17ef4511e5fdd0bacb876ffac1a189d193014a18788917c19cb9af581","signature":"6607d326b72eaf61da75f75785aef74ea03c2c5d3b392f24c0fbf898c6bc43bf"},"453740a49328721fb8cb3ee3a8422eab92f78fab88f31b79508a801634fec1e2",{"version":"b2c8a481cfc150d85ea00831d3fdf4aaed77008ae7b4b4207276b08e267f7624","signature":"6e05f2be5d58e5f8d94c62f4013f7d0533dbaec53d1deff9c383c4406f011084"},{"version":"b60928670b1755f3e102c189619ea2e9e2237ecb40e010c52480bf26840b741a","signature":"c4c84dffaa3f00b75f89dbc3eb8f31a752383436b039264f42df063bdad679cf"},{"version":"a5536381b154ed8bc3a4f39b1bdb815bcec1be1e4886607b52486f589b2fa5c5","signature":"e9eb86a27ee96f3a99aa5631f8b6de3848cd351f721f58032cf6d7ed864a78b6"},{"version":"2a1f08253ff84ee25efd34d7948dd0c73a5ecefc86bb9958b537153bb86f061a","signature":"5241793d5d6e0ef3537b74cdec0c0c49fa171885f220e0497ea9801c85141936"},{"version":"1c04e253c9e3c14ac5cbc81572a6e36f132deaf90c4a069d8cfa5affa7205277","signature":"cd00628b29ccca0cbde6bf22559a0d5e7210520f8bb45a5e1dcbaa8a2da80e7f"},{"version":"90bb8934ea69c1a1dbe83b55efbc8a7793484b6ec4ff14c25c4104ce12515f08","signature":"3532abc970b751a18a40eabdaa29e837ca9e6ae8b37929fc6022be1e3e064af1"},{"version":"b8ff6faf6bf647032e3cee5f7e4b2e0f2e668f930d6e5beb894cfee4c6c26936","affectsGlobalScope":true},"2cbbade4eaf0c1e4718ad4961979488f0fb74c38392d7cf705358950e913943d",{"version":"c7fb7af1dbdfb292379b22678566bc719dedee6888741cbcdb3f4f05bd1fb82c","signature":"834bee2451101fde1d9f0062068488cfba4c9bd843b9fef4b2b0f0a315954024"},"02dfc937dce0da28fe4bc500a32b7d645acedd00609a762a5426feebb575431b",{"version":"65a1057eb4514733810cc7a120977b67b140786ca49a43efa0ced89f58093edc","signature":"7e135c8a81e6a046ee90e6afa1b74a6c18c8076e7dfe2080f46125eddb9f4d73"},"61d6c43861d171f1129a3179983d8af80995d3e86f90bdeaad9415756022d4b3","33bb7966e2c859326207e0bda17423fbf1bd81dbc8e6ba54fa143f950566e9da","4ae63b19255579a897918c94e928c4351c6bb6de552d50f14f41c6f175f4d282","4114c8edf09acaa907aa1293c6fbfc71d26b7ae9ecf0e3dbf4ec47302bc51444","4276e358bf27203613ebe2f917706385875fa02481ed2829a96611eecc8c4255","c223c62757304681e71494f26e78e828c83f9612b76c1181b2e9a7cf6f853fec","d0f4d6c857e665d4163074039b1fbd996d67b8ef233117412adf4748b33689f5","e25f0e3f148d4fb60ad91dc4ac77886119d2ff74f408596477c62f7bda54cb9b","a204e4f8f148eacfce004a47fb7920ffce1e7744323c2018731d288bf805c590",{"version":"9e97a42f468e93a544cbb6af8b73ecd2894f7b18ea07c89b5feadc983d23c832","signature":"6b01ba5f8086cd87ab8047414f6eec54a9fe8aafb620f0f31daf7f8ae44ddc8c"},"be3c1a1c10970723dca8fda3f3d3e47fbac3ead8fd347e47f726ad257141420b"],"root":[74,77,[79,85],87,89,99,100],"options":{"composite":true,"esModuleInterop":true,"isolatedDeclarations":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","removeComments":true,"rootDir":"../src","strict":true,"target":99},"fileIdsList":[[91],[90,91,92,93,94,95,96,97],[75,81,82,83],[77,79,80],[76],[75],[74,77,79,80,81,82,83,84,86,87,89,99],[81],[82,83],[74,78],[81,83,88],[82,83,98]],"referencedMap":[[92,1],[98,2],[96,1],[97,1],[84,3],[81,4],[77,5],[82,6],[100,7],[83,8],[87,9],[79,10],[80,6],[89,11],[99,12]],"latestChangedDtsFile":"./esm/index.d.ts"},"version":"5.5.4"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfworker/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Web framework for Cloudflare Workers and service workers, inspired by Koa and fastify",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"middleware",
|
|
@@ -11,16 +11,20 @@
|
|
|
11
11
|
"service-worker"
|
|
12
12
|
],
|
|
13
13
|
"sideEffects": false,
|
|
14
|
-
"main": "dist/index.js",
|
|
15
|
-
"module": "dist/index.js",
|
|
14
|
+
"main": "dist/cjs/index.js",
|
|
15
|
+
"module": "dist/esm/index.js",
|
|
16
16
|
"source": "src/index.ts",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
17
|
+
"types": "dist/esm/index.d.ts",
|
|
18
18
|
"files": [
|
|
19
19
|
"dist/**/*",
|
|
20
20
|
"src/**/*",
|
|
21
21
|
"README.md",
|
|
22
22
|
"package.json"
|
|
23
23
|
],
|
|
24
|
+
"exports": {
|
|
25
|
+
"import": "./dist/esm/index.js",
|
|
26
|
+
"require": "./dist/cjs/index.js"
|
|
27
|
+
},
|
|
24
28
|
"repository": "https://github.com/cfworker/cfworker",
|
|
25
29
|
"author": "Jeremy Danyow <jdanyow@gmail.com>",
|
|
26
30
|
"homepage": "https://github.com/cfworker/cfworker/tree/master/packages/web/README.md",
|
|
@@ -29,13 +33,13 @@
|
|
|
29
33
|
"access": "public"
|
|
30
34
|
},
|
|
31
35
|
"scripts": {
|
|
32
|
-
"build": "tsc --build",
|
|
36
|
+
"build": "tsc --build & tsc --build tsconfig-cjs.json",
|
|
33
37
|
"clean": "tsc --build --clean",
|
|
34
38
|
"pretest": "esbuild test/test.ts --target=esnext --bundle --format=esm --conditions=worker,browser --outdir=dist-test --ignore-annotations",
|
|
35
39
|
"test": "node ../../test.mjs"
|
|
36
40
|
},
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"@cfworker/json-schema": "^
|
|
42
|
+
"@cfworker/json-schema": "^3.0.0",
|
|
39
43
|
"@types/cookie": "^0.6.0",
|
|
40
44
|
"@types/html-escaper": "^3.0.2",
|
|
41
45
|
"@types/statuses": "^2.0.5",
|
|
@@ -54,6 +58,6 @@
|
|
|
54
58
|
"jsonpointer": "^5.0.1",
|
|
55
59
|
"mocha": "^10.7.3",
|
|
56
60
|
"typescript": "^5.5.4",
|
|
57
|
-
"wrangler": "^3.72.
|
|
61
|
+
"wrangler": "^3.72.1"
|
|
58
62
|
}
|
|
59
63
|
}
|
package/src/application.ts
CHANGED
package/src/context.ts
CHANGED
package/src/cookies.ts
CHANGED
|
@@ -21,7 +21,11 @@ export class Cookies {
|
|
|
21
21
|
return this.requestCookies[name] || null;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
public set(
|
|
24
|
+
public set(
|
|
25
|
+
name: string,
|
|
26
|
+
val: string,
|
|
27
|
+
options?: CookieSerializeOptions
|
|
28
|
+
): void {
|
|
25
29
|
this.responseHeaders.append(
|
|
26
30
|
'Set-Cookie',
|
|
27
31
|
serializeCookie(name, val, options)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpError } from './http-error';
|
|
2
2
|
import { Middleware } from './middleware';
|
|
3
3
|
|
|
4
|
-
export function normalizePathname(pathname: string) {
|
|
4
|
+
export function normalizePathname(pathname: string): string {
|
|
5
5
|
return decodeURIComponent(pathname).replace(/\/\/+/g, '/').normalize();
|
|
6
6
|
}
|
|
7
7
|
|
package/src/req.ts
CHANGED
|
@@ -29,28 +29,28 @@ export class ReqBody {
|
|
|
29
29
|
|
|
30
30
|
constructor(private readonly request: Request) {}
|
|
31
31
|
|
|
32
|
-
public arrayBuffer() {
|
|
32
|
+
public arrayBuffer(): Promise<ArrayBuffer> {
|
|
33
33
|
if (!this._arrayBuffer) {
|
|
34
34
|
this._arrayBuffer = this.request.arrayBuffer();
|
|
35
35
|
}
|
|
36
36
|
return this._arrayBuffer;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
public formData() {
|
|
39
|
+
public formData(): Promise<FormData> {
|
|
40
40
|
if (!this._formData) {
|
|
41
41
|
this._formData = this.request.formData();
|
|
42
42
|
}
|
|
43
43
|
return this._formData;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
public json(reviver?: Reviver) {
|
|
46
|
+
public json(reviver?: Reviver): Promise<any> {
|
|
47
47
|
if (!this._json) {
|
|
48
48
|
this._json = this.text().then(text => safeParse(text, reviver));
|
|
49
49
|
}
|
|
50
50
|
return this._json;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
public text() {
|
|
53
|
+
public text(): Promise<string> {
|
|
54
54
|
if (!this._text) {
|
|
55
55
|
this._text = this.request.text();
|
|
56
56
|
}
|
package/src/response-builder.ts
CHANGED
|
@@ -9,14 +9,14 @@ export type ExtendedBodyInit =
|
|
|
9
9
|
| null;
|
|
10
10
|
|
|
11
11
|
export class ResponseBuilder {
|
|
12
|
-
public readonly headers = new Headers();
|
|
12
|
+
public readonly headers: Headers = new Headers();
|
|
13
13
|
private _status = 404;
|
|
14
14
|
private _explicitStatus = false;
|
|
15
15
|
private _implicitType = false;
|
|
16
16
|
private _body: ExtendedBodyInit = null;
|
|
17
17
|
private _stringifyBody = false;
|
|
18
18
|
|
|
19
|
-
get status() {
|
|
19
|
+
get status(): number {
|
|
20
20
|
return this._status;
|
|
21
21
|
}
|
|
22
22
|
set status(value) {
|
|
@@ -27,7 +27,7 @@ export class ResponseBuilder {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
get statusText() {
|
|
30
|
+
get statusText(): string {
|
|
31
31
|
return statuses.message[this._status]!;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -88,7 +88,7 @@ export class ResponseBuilder {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
redirect(url: string | URL) {
|
|
91
|
+
redirect(url: string | URL): void {
|
|
92
92
|
if (url instanceof URL) {
|
|
93
93
|
url = url.href;
|
|
94
94
|
}
|
|
@@ -103,7 +103,7 @@ export class ResponseBuilder {
|
|
|
103
103
|
this.body = `Redirecting to ${url}.`;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
get type() {
|
|
106
|
+
get type(): string {
|
|
107
107
|
const type = this.headers.get('content-type');
|
|
108
108
|
if (!type) {
|
|
109
109
|
return '';
|
|
@@ -134,7 +134,7 @@ export class ResponseBuilder {
|
|
|
134
134
|
this.headers.set('last-modified', value.toUTCString());
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
get etag() {
|
|
137
|
+
get etag(): string | null {
|
|
138
138
|
return this.headers.get('etag');
|
|
139
139
|
}
|
|
140
140
|
set etag(value) {
|
|
@@ -148,7 +148,7 @@ export class ResponseBuilder {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
create() {
|
|
151
|
+
create(): Response {
|
|
152
152
|
const { body: rawBody, status, statusText, headers } = this;
|
|
153
153
|
const body = this._stringifyBody
|
|
154
154
|
? JSON.stringify(rawBody)
|