webhoster 0.3.4 → 0.3.6
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/data/custom-types.js +14 -14
- package/package.json +12 -1
- package/types/data/CookieObject.d.ts +34 -0
- package/types/data/CookieObject.d.ts.map +1 -0
- package/types/data/custom-types.d.ts +112 -0
- package/types/data/custom-types.d.ts.map +1 -0
- package/types/errata/socketio.d.ts +11 -0
- package/types/errata/socketio.d.ts.map +1 -0
- package/types/examples/starter.d.ts +2 -0
- package/types/examples/starter.d.ts.map +1 -0
- package/types/helpers/HeadersParser.d.ts +27 -0
- package/types/helpers/HeadersParser.d.ts.map +1 -0
- package/types/helpers/HttpListener.d.ts +84 -0
- package/types/helpers/HttpListener.d.ts.map +1 -0
- package/types/helpers/RequestHeaders.d.ts +25 -0
- package/types/helpers/RequestHeaders.d.ts.map +1 -0
- package/types/helpers/RequestReader.d.ts +52 -0
- package/types/helpers/RequestReader.d.ts.map +1 -0
- package/types/helpers/ResponseHeaders.d.ts +126 -0
- package/types/helpers/ResponseHeaders.d.ts.map +1 -0
- package/types/helpers/index.d.ts +6 -0
- package/types/helpers/index.d.ts.map +1 -0
- package/types/lib/HttpHandler.d.ts +79 -0
- package/types/lib/HttpHandler.d.ts.map +1 -0
- package/types/lib/HttpRequest.d.ts +175 -0
- package/types/lib/HttpRequest.d.ts.map +1 -0
- package/types/lib/HttpResponse.d.ts +117 -0
- package/types/lib/HttpResponse.d.ts.map +1 -0
- package/types/lib/HttpTransaction.d.ts +114 -0
- package/types/lib/HttpTransaction.d.ts.map +1 -0
- package/types/middleware/AutoHeadersMiddleware.d.ts +27 -0
- package/types/middleware/AutoHeadersMiddleware.d.ts.map +1 -0
- package/types/middleware/CORSMiddleware.d.ts +65 -0
- package/types/middleware/CORSMiddleware.d.ts.map +1 -0
- package/types/middleware/CaseInsensitiveHeadersMiddleware.d.ts +27 -0
- package/types/middleware/CaseInsensitiveHeadersMiddleware.d.ts.map +1 -0
- package/types/middleware/ContentDecoderMiddleware.d.ts +17 -0
- package/types/middleware/ContentDecoderMiddleware.d.ts.map +1 -0
- package/types/middleware/ContentEncoderMiddleware.d.ts +48 -0
- package/types/middleware/ContentEncoderMiddleware.d.ts.map +1 -0
- package/types/middleware/ContentLengthMiddleware.d.ts +38 -0
- package/types/middleware/ContentLengthMiddleware.d.ts.map +1 -0
- package/types/middleware/HashMiddleware.d.ts +28 -0
- package/types/middleware/HashMiddleware.d.ts.map +1 -0
- package/types/middleware/HeadMethodMiddleware.d.ts +12 -0
- package/types/middleware/HeadMethodMiddleware.d.ts.map +1 -0
- package/types/middleware/MethodMiddleware.d.ts +40 -0
- package/types/middleware/MethodMiddleware.d.ts.map +1 -0
- package/types/middleware/PathMiddleware.d.ts +81 -0
- package/types/middleware/PathMiddleware.d.ts.map +1 -0
- package/types/middleware/ReadFormData.d.ts +7 -0
- package/types/middleware/ReadFormData.d.ts.map +1 -0
- package/types/middleware/SendJsonMiddleware.d.ts +51 -0
- package/types/middleware/SendJsonMiddleware.d.ts.map +1 -0
- package/types/middleware/SendStringMiddleware.d.ts +35 -0
- package/types/middleware/SendStringMiddleware.d.ts.map +1 -0
- package/types/templates/starter.d.ts +15 -0
- package/types/templates/starter.d.ts.map +1 -0
- package/types/utils/AsyncObject.d.ts +38 -0
- package/types/utils/AsyncObject.d.ts.map +1 -0
- package/types/utils/CaseInsensitiveObject.d.ts +9 -0
- package/types/utils/CaseInsensitiveObject.d.ts.map +1 -0
- package/types/utils/function.d.ts +2 -0
- package/types/utils/function.d.ts.map +1 -0
- package/types/utils/headers.d.ts +7 -0
- package/types/utils/headers.d.ts.map +1 -0
- package/types/utils/qualityValues.d.ts +12 -0
- package/types/utils/qualityValues.d.ts.map +1 -0
- package/types/utils/stream.d.ts +6 -0
- package/types/utils/stream.d.ts.map +1 -0
- package/.eslintrc.json +0 -96
- package/.github/FUNDING.yml +0 -4
- package/.github/copilot-instructions.md +0 -100
- package/.github/workflows/publish.yml +0 -29
- package/.github/workflows/test-matrix.yml +0 -37
- package/.test/benchmark.js +0 -28
- package/.test/constants.js +0 -4
- package/.test/cookietester.js +0 -19
- package/.test/http2server.js +0 -35
- package/.test/httpserver.js +0 -32
- package/.test/index.js +0 -498
- package/.test/multipromise.js +0 -32
- package/.test/tls.js +0 -75
- package/.test/urlencoded.js +0 -54
- package/.vscode/launch.json +0 -35
- package/.vscode/settings.json +0 -5
- package/CHANGELOG.md +0 -10
- package/CODE_OF_CONDUCT.md +0 -76
- package/data/middleware.d.ts +0 -14
- package/examples/starter.js +0 -11
- package/jsconfig.json +0 -12
- package/polyfill/FormData.js +0 -164
- package/rollup.config.js +0 -8
- package/scripts/check-teapot.mjs +0 -40
- package/scripts/test-all-sync.sh +0 -6
- package/scripts/test-all.sh +0 -7
- package/test/fixtures/stream.js +0 -68
- package/test/helpers/HttpListener/construct.js +0 -18
- package/test/helpers/HttpListener/customOptions.js +0 -22
- package/test/helpers/HttpListener/doubleCreate.js +0 -40
- package/test/helpers/HttpListener/events.js +0 -77
- package/test/helpers/HttpListener/http.js +0 -31
- package/test/helpers/HttpListener/http2.js +0 -41
- package/test/helpers/HttpListener/https.js +0 -38
- package/test/helpers/HttpListener/startAll.js +0 -31
- package/test/helpers/HttpListener/stopNotStarted.js +0 -23
- package/test/lib/HttpHandler/class.js +0 -8
- package/test/lib/HttpHandler/handleRequest.js +0 -11
- package/test/lib/HttpHandler/middleware.js +0 -941
- package/test/lib/HttpHandler/parse.js +0 -41
- package/test/lib/HttpRequest/class.js +0 -8
- package/test/lib/HttpRequest/downstream.js +0 -171
- package/test/lib/HttpRequest/properties.js +0 -101
- package/test/lib/HttpRequest/read.js +0 -518
- package/test/lib/HttpResponse/async-iterable-middleware.js +0 -37
- package/test/lib/HttpResponse/async-iterable.js +0 -31
- package/test/lib/HttpResponse/class.js +0 -8
- package/test/lib/HttpResponse/properties.js +0 -59
- package/test/lib/HttpResponse/send.js +0 -275
- package/test/lib/HttpTransaction/class.js +0 -8
- package/test/lib/HttpTransaction/ping.js +0 -50
- package/test/lib/HttpTransaction/push.js +0 -89
- package/test/middleware/SendJsonMiddleware.js +0 -222
- package/test/sanity.js +0 -10
- package/test/templates/error-teapot.js +0 -47
- package/test/templates/starter.js +0 -93
- package/tsconfig.json +0 -29
package/data/custom-types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
/**
|
|
2
3
|
* @template {any} [T=any]
|
|
3
4
|
* @typedef {import('../lib/HttpTransaction.js').default<T>} HttpTransaction<T>
|
|
@@ -16,7 +17,19 @@
|
|
|
16
17
|
|
|
17
18
|
/** @typedef {import('node:stream').Duplex} Duplex */
|
|
18
19
|
|
|
19
|
-
/** @typedef {
|
|
20
|
+
/** @typedef {MiddlewareExecutor|MiddlewareStaticExecutor|MiddlewareErrorHandler|MiddlewareStaticErrorHandler|MiddlewareStaticExecutor} IMiddleware */
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @template {any} [T=any]
|
|
24
|
+
* @callback MiddlewareFunction
|
|
25
|
+
* @param {!HttpTransaction<T>} transaction
|
|
26
|
+
* @return {MiddlewareFunctionResult}
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** @typedef {Promise<Middleware>|Middleware} MiddlewareFunctionResult */
|
|
30
|
+
|
|
31
|
+
/** @typedef {IMiddleware|MiddlewareFunction|MiddlewareContent|MiddlewareFunctionResultType} MiddlewareBase */
|
|
32
|
+
/** @typedef {MiddlewareBase|MiddlewareBase[]|Set<MiddlewareBase>} Middleware */
|
|
20
33
|
|
|
21
34
|
/** @typedef {true|false|0} MiddlewareFlowInstruction */
|
|
22
35
|
|
|
@@ -24,17 +37,8 @@
|
|
|
24
37
|
|
|
25
38
|
/** @typedef {0|true|false|null|undefined|void} MiddlewareFunctionResultType */
|
|
26
39
|
|
|
27
|
-
/** @typedef {Promise<Middleware>|Middleware} MiddlewareFunctionResult */
|
|
28
|
-
|
|
29
40
|
/** @typedef {Record<string,any>|number|import('stream').Readable|Buffer|string} MiddlewareContent */
|
|
30
41
|
|
|
31
|
-
/**
|
|
32
|
-
* @template {any} [T=any]
|
|
33
|
-
* @callback MiddlewareFunction
|
|
34
|
-
* @param {!HttpTransaction<T>} transaction
|
|
35
|
-
* @return {MiddlewareFunctionResult}
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
42
|
/**
|
|
39
43
|
* @template {any} [T=any]
|
|
40
44
|
* @callback MiddlewareResponseFunction
|
|
@@ -75,10 +79,6 @@
|
|
|
75
79
|
* @prop {MiddlewareFunction} onError
|
|
76
80
|
*/
|
|
77
81
|
|
|
78
|
-
/**
|
|
79
|
-
* @typedef {MiddlewareExecutor|MiddlewareStaticExecutor|MiddlewareErrorHandler|MiddlewareStaticErrorHandler|MiddlewareStaticExecutor} IMiddleware
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
82
|
/**
|
|
83
83
|
* @typedef {Object} CookieDetails
|
|
84
84
|
* @prop {string} [name='']
|
package/package.json
CHANGED
|
@@ -46,6 +46,17 @@
|
|
|
46
46
|
"cors",
|
|
47
47
|
"gzip"
|
|
48
48
|
],
|
|
49
|
+
"files": [
|
|
50
|
+
"data",
|
|
51
|
+
"errata",
|
|
52
|
+
"helpers",
|
|
53
|
+
"lib",
|
|
54
|
+
"middleware",
|
|
55
|
+
"polyfills",
|
|
56
|
+
"templates",
|
|
57
|
+
"types",
|
|
58
|
+
"utils"
|
|
59
|
+
],
|
|
49
60
|
"license": "MIT",
|
|
50
61
|
"name": "webhoster",
|
|
51
62
|
"scripts": {
|
|
@@ -67,5 +78,5 @@
|
|
|
67
78
|
]
|
|
68
79
|
}
|
|
69
80
|
},
|
|
70
|
-
"version": "0.3.
|
|
81
|
+
"version": "0.3.6"
|
|
71
82
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @typedef {import('./custom-types.js').CookieDetails} CookieDetails */
|
|
2
|
+
/** @private */
|
|
3
|
+
export default class CookieObject {
|
|
4
|
+
/**
|
|
5
|
+
* @param {string} cookieString
|
|
6
|
+
* @return {CookieObject}
|
|
7
|
+
*/
|
|
8
|
+
static parse(cookieString: string): CookieObject;
|
|
9
|
+
/** @param {CookieDetails|string} options */
|
|
10
|
+
constructor(options: CookieDetails | string);
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
expires: Date;
|
|
14
|
+
maxAge: number;
|
|
15
|
+
domain: string;
|
|
16
|
+
path: string;
|
|
17
|
+
secure: boolean;
|
|
18
|
+
httpOnly: boolean;
|
|
19
|
+
sameSite: "Strict" | "Lax" | "None";
|
|
20
|
+
toString(): string;
|
|
21
|
+
toJSON(): {
|
|
22
|
+
name: string;
|
|
23
|
+
value: string;
|
|
24
|
+
expires: Date;
|
|
25
|
+
maxAge: number;
|
|
26
|
+
domain: string;
|
|
27
|
+
path: string;
|
|
28
|
+
secure: true;
|
|
29
|
+
httpOnly: true;
|
|
30
|
+
sameSite: "Strict" | "Lax" | "None";
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export type CookieDetails = import("./custom-types.js").CookieDetails;
|
|
34
|
+
//# sourceMappingURL=CookieObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CookieObject.d.ts","sourceRoot":"","sources":["../../data/CookieObject.js"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,eAAe;AACf;IAiBE;;;OAGG;IACH,2BAHW,MAAM,GACL,YAAY,CAuDvB;IAzED,4CAA4C;IAC5C,qBADY,aAAa,GAAC,MAAM,EAc/B;IATC,aAAwB;IACxB,cAA0B;IAC1B,cAA8B;IAC9B,eAA4B;IAC5B,eAA4B;IAC5B,aAAwB;IACxB,gBAA4B;IAC5B,kBAAgC;IAChC,oCAAgC;IA8DlC,mBAUC;IAED;;;;;;;;;;MAYC;CACF;4BAxGa,OAAO,mBAAmB,EAAE,aAAa"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
declare const _default: {};
|
|
2
|
+
export default _default;
|
|
3
|
+
/**
|
|
4
|
+
* <T>
|
|
5
|
+
*/
|
|
6
|
+
export type HttpTransaction<T extends unknown = any> = import("../lib/HttpTransaction.js").default<T>;
|
|
7
|
+
export type HttpRequest = import("../lib/HttpRequest.js").default;
|
|
8
|
+
export type HttpResponse = import("../lib/HttpResponse.js").default;
|
|
9
|
+
export type MediaType = {
|
|
10
|
+
type: string;
|
|
11
|
+
tree: string;
|
|
12
|
+
subtype: string;
|
|
13
|
+
suffix: string;
|
|
14
|
+
parameters: Record<string, string>;
|
|
15
|
+
};
|
|
16
|
+
export type Duplex = import("node:stream").Duplex;
|
|
17
|
+
export type IMiddleware = MiddlewareExecutor | MiddlewareStaticExecutor | MiddlewareErrorHandler | MiddlewareStaticErrorHandler | MiddlewareStaticExecutor;
|
|
18
|
+
export type MiddlewareFunction<T extends unknown = any> = (transaction: HttpTransaction<T>) => MiddlewareFunctionResult;
|
|
19
|
+
export type MiddlewareFunctionResult = Promise<Middleware> | Middleware;
|
|
20
|
+
export type MiddlewareBase = IMiddleware | MiddlewareFunction | MiddlewareContent | MiddlewareFunctionResultType;
|
|
21
|
+
export type Middleware = MiddlewareBase | MiddlewareBase[] | Set<MiddlewareBase>;
|
|
22
|
+
export type MiddlewareFlowInstruction = true | false | 0;
|
|
23
|
+
export type RequestMethod = "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE" | "PATCH";
|
|
24
|
+
export type MiddlewareFunctionResultType = 0 | true | false | null | undefined | void;
|
|
25
|
+
export type MiddlewareContent = Record<string, any> | number | import("stream").Readable | Buffer | string;
|
|
26
|
+
export type MiddlewareResponseFunction<T extends unknown = any> = (transaction: {
|
|
27
|
+
response: HttpTransaction<T>["response"];
|
|
28
|
+
}) => MiddlewareFunctionResult;
|
|
29
|
+
export type StaticMiddlewareFunction = (transaction: HttpTransaction) => MiddlewareFunctionResult;
|
|
30
|
+
export type ResponseFinalizer = (response: HttpResponse) => void | null | boolean | Promise<void | null | boolean>;
|
|
31
|
+
export type MiddlewareExecutor = {
|
|
32
|
+
execute: MiddlewareFunction;
|
|
33
|
+
};
|
|
34
|
+
export type MiddlewareStaticExecutor = {
|
|
35
|
+
Execute: StaticMiddlewareFunction;
|
|
36
|
+
};
|
|
37
|
+
export type MiddlewareStaticErrorHandler = {
|
|
38
|
+
OnError: StaticMiddlewareFunction;
|
|
39
|
+
};
|
|
40
|
+
export type MiddlewareErrorHandler = {
|
|
41
|
+
onError: MiddlewareFunction;
|
|
42
|
+
};
|
|
43
|
+
export type CookieDetails = {
|
|
44
|
+
/**
|
|
45
|
+
* A cookie name can be any US-ASCII characters, except control characters, spaces, or tabs.
|
|
46
|
+
* It also must not contain a separator character like the following:( ) < > @ , ; : \ " / [ ] ? = { }.
|
|
47
|
+
* - __Secure- prefix: Cookies names starting with __Secure- (dash is part of the prefix) must be set with the secure flag from a secure page (HTTPS).
|
|
48
|
+
* - __Host- prefix: Cookies with names starting with __Host- must be set with the secure flag, must be from a secure page (HTTPS), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /.
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
/**
|
|
52
|
+
* A cookie value can optionally be wrapped in double quotes and include any US-ASCII characters excluding
|
|
53
|
+
* control characters, Whitespace, double quotes, comma, semicolon, and backslash.
|
|
54
|
+
*
|
|
55
|
+
* Encoding: Many implementations perform URL encoding on cookie values,
|
|
56
|
+
* however it is not required per the RFC specification.
|
|
57
|
+
* It does help satisfying the requirements about which characters are allowed for cookie value though.
|
|
58
|
+
*/
|
|
59
|
+
value?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The maximum lifetime of the cookie as an HTTP-date timestamp.
|
|
62
|
+
*
|
|
63
|
+
* If unspecified, the cookie becomes a session cookie.
|
|
64
|
+
* A session finishes when the client shuts down, and session cookies will be removed.
|
|
65
|
+
*/
|
|
66
|
+
expires?: Date;
|
|
67
|
+
/**
|
|
68
|
+
* Number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately.
|
|
69
|
+
* If both Expires and Max-Age are set, Max-Age has precedence.
|
|
70
|
+
*/
|
|
71
|
+
maxAge?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Host to which the cookie will be sent.
|
|
74
|
+
* - If omitted, defaults to the host of the current document URL, not including subdomains.
|
|
75
|
+
* - Contrary to earlier specifications, leading dots in domain names (.example.com) are ignored.
|
|
76
|
+
* - Multiple host/domain values are not allowed, but if a domain is specified, then subdomains are always included.
|
|
77
|
+
*/
|
|
78
|
+
domain?: string;
|
|
79
|
+
/**
|
|
80
|
+
* A path that must exist in the requested URL, or the browser won't send the Cookie header.
|
|
81
|
+
*
|
|
82
|
+
* The forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well:
|
|
83
|
+
* for Path=/docs, /docs, /docs/Web/, and /docs/Web/HTTP will all match.
|
|
84
|
+
*/
|
|
85
|
+
path?: string;
|
|
86
|
+
/**
|
|
87
|
+
* A secure cookie is only sent to the server when a request is made with the https: scheme.
|
|
88
|
+
* (However, confidential information should never be stored in HTTP Cookies,
|
|
89
|
+
* as the entire mechanism is inherently insecure and doesn't encrypt any information.)
|
|
90
|
+
*/
|
|
91
|
+
secure?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Forbids JavaScript from accessing the cookie.
|
|
94
|
+
*
|
|
95
|
+
* For example, through the Document.cookie property, the XMLHttpRequest API, or the Request API.
|
|
96
|
+
* This mitigates attacks against cross-site scripting (XSS).
|
|
97
|
+
*/
|
|
98
|
+
httpOnly?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Asserts that a cookie must not be sent with cross-origin requests,
|
|
101
|
+
* providing some protection against cross-site request forgery attacks (CSRF).
|
|
102
|
+
* - Strict: The browser sends the cookie only for same-site requests
|
|
103
|
+
* (that is, requests originating from the same site that set the cookie).
|
|
104
|
+
* If the request originated from a different URL than the current one,
|
|
105
|
+
* no cookies with the SameSite=Strict attribute are sent.
|
|
106
|
+
* - Lax: The cookie is withheld on cross-site subrequests, such as calls to load images or frames,
|
|
107
|
+
* but is sent when a user navigates to the URL from an external site, such as by following a link.
|
|
108
|
+
* - None: The browser sends the cookie with both cross-site and same-site requests.
|
|
109
|
+
*/
|
|
110
|
+
sameSite?: "Strict" | "Lax" | "None";
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=custom-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-types.d.ts","sourceRoot":"","sources":["../../data/custom-types.js"],"names":[],"mappings":";;;;;4BAEoB,CAAC,0BACR,OAAO,2BAA2B,EAAE,OAAO,CAAC,CAAC,CAAC;0BAE7C,OAAO,uBAAuB,EAAE,OAAO;2BACvC,OAAO,wBAAwB,EAAE,OAAO;;UAI5C,MAAM;UACN,MAAM;aACN,MAAM;YACN,MAAM;gBACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;qBAGlB,OAAO,aAAa,EAAE,MAAM;0BAE5B,kBAAkB,GAAC,wBAAwB,GAAC,sBAAsB,GAAC,4BAA4B,GAAC,wBAAwB;+BAGlH,CAAC,wCAET,eAAe,CAAC,CAAC,CAAC,KAClB,wBAAwB;uCAGtB,OAAO,CAAC,UAAU,CAAC,GAAC,UAAU;6BAE9B,WAAW,GAAC,kBAAkB,GAAC,iBAAiB,GAAC,4BAA4B;yBAC7E,cAAc,GAAC,cAAc,EAAE,GAAC,GAAG,CAAC,cAAc,CAAC;wCAEnD,IAAI,GAAC,KAAK,GAAC,CAAC;4BAEZ,KAAK,GAAC,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,QAAQ,GAAC,SAAS,GAAC,SAAS,GAAC,OAAO,GAAC,OAAO;2CAEtE,CAAC,GAAC,IAAI,GAAC,KAAK,GAAC,IAAI,GAAC,SAAS,GAAC,IAAI;gCAEhC,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,GAAC,MAAM,GAAC,OAAO,QAAQ,EAAE,QAAQ,GAAC,MAAM,GAAC,MAAM;uCAG3D,CAAC,wCAEV;IAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CAAE,KAC3C,wBAAwB;qDAMxB,eAAe,KACf,wBAAwB;2CAKxB,YAAY,KACZ,IAAI,GAAC,IAAI,GAAC,OAAO,GAAC,OAAO,CAAC,IAAI,GAAC,IAAI,GAAC,OAAO,CAAC;;aAK9C,kBAAkB;;;aAKlB,wBAAwB;;;aAKxB,wBAAwB;;;aAKxB,kBAAkB;;;;;;;;;WAKlB,MAAM;;;;;;;;;YAKN,MAAM;;;;;;;cAON,IAAI;;;;;aAKJ,MAAM;;;;;;;aAGN,MAAM;;;;;;;WAKN,MAAM;;;;;;aAKN,OAAO;;;;;;;eAIP,OAAO;;;;;;;;;;;;eAKP,QAAQ,GAAC,KAAK,GAAC,MAAM"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @typedef {import('../lib/HttpHandler').default} HttpHandler */
|
|
2
|
+
/** @typedef {import('http2').Http2SecureServer} Http2SecureServer */
|
|
3
|
+
/**
|
|
4
|
+
* @param {HttpHandler} httpHandler
|
|
5
|
+
* @param {RegExp} [socketioPath] /^\/socket.io\//i
|
|
6
|
+
* @return {void}
|
|
7
|
+
*/
|
|
8
|
+
export function addHttp2Support(httpHandler: HttpHandler, socketioPath?: RegExp): void;
|
|
9
|
+
export type HttpHandler = import("../lib/HttpHandler").default;
|
|
10
|
+
export type Http2SecureServer = import("http2").Http2SecureServer;
|
|
11
|
+
//# sourceMappingURL=socketio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socketio.d.ts","sourceRoot":"","sources":["../../errata/socketio.js"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,qEAAqE;AAErE;;;;GAIG;AACH,6CAJW,WAAW,iBACX,MAAM,GACL,IAAI,CAYf;0BAlBa,OAAO,oBAAoB,EAAE,OAAO;gCACpC,OAAO,OAAO,EAAE,iBAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starter.d.ts","sourceRoot":"","sources":["../../examples/starter.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default class HeadersParser {
|
|
2
|
+
constructor(headers?: {});
|
|
3
|
+
/** @type {Object<string,any>} */
|
|
4
|
+
headers: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
};
|
|
7
|
+
/** @return {string} */
|
|
8
|
+
get contentType(): string;
|
|
9
|
+
/**
|
|
10
|
+
* The `media-type` directive of `Content-Type`.
|
|
11
|
+
* The MIME type of the resource or the data.
|
|
12
|
+
* (Always lowercase)
|
|
13
|
+
* @return {string}
|
|
14
|
+
*/
|
|
15
|
+
get mediaType(): string;
|
|
16
|
+
/**
|
|
17
|
+
* The `charset` direct of `Content-Type`.
|
|
18
|
+
* The character encoding standard.
|
|
19
|
+
* (Always lowercase)
|
|
20
|
+
@return {string} */
|
|
21
|
+
get charset(): string;
|
|
22
|
+
/** @return {string} */
|
|
23
|
+
get boundary(): string;
|
|
24
|
+
/** @return {?number} */
|
|
25
|
+
get contentLength(): number | null;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=HeadersParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadersParser.d.ts","sourceRoot":"","sources":["../../helpers/HeadersParser.js"],"names":[],"mappings":"AAAA;IACE,0BAGC;IAFC,iCAAiC;IACjC;;MAAsB;IAGxB,uBAAuB;IACvB,mBADa,MAAM,CAGlB;IAED;;;;;OAKG;IACH,iBAFY,MAAM,CAIjB;IAED;;;;yBAIqB;IACrB,eADW,MAAM,CAkBhB;IAED,uBAAuB;IACvB,gBADa,MAAM,CAkBlB;IAED,wBAAwB;IACxB,qBADc,MAAM,OAAA,CAGnB;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const SERVER_ALREADY_CREATED: "SERVER_ALREADY_CREATED";
|
|
2
|
+
export default class HttpListener {
|
|
3
|
+
/** @return {HttpListener} */
|
|
4
|
+
static get defaultInstance(): HttpListener;
|
|
5
|
+
/** @param {HttpListenerOptions} options */
|
|
6
|
+
constructor(options?: HttpListenerOptions);
|
|
7
|
+
/** @param {HttpListenerOptions} options */
|
|
8
|
+
configure(options?: HttpListenerOptions): void;
|
|
9
|
+
httpHandler: HttpHandler;
|
|
10
|
+
insecurePort: number;
|
|
11
|
+
insecureHost: string;
|
|
12
|
+
securePort: number;
|
|
13
|
+
secureHost: string;
|
|
14
|
+
useHttp: boolean;
|
|
15
|
+
useHttps: boolean;
|
|
16
|
+
useHttp2: boolean;
|
|
17
|
+
tlsOptions: import("tls").TlsOptions;
|
|
18
|
+
/**
|
|
19
|
+
* @param {import('node:http').ServerOptions} [options]
|
|
20
|
+
* @return {import('node:http').Server}
|
|
21
|
+
*/
|
|
22
|
+
createHttpServer(options?: import("node:http").ServerOptions): import("node:http").Server;
|
|
23
|
+
httpServer: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* @param {import('node:https').ServerOptions} [options]
|
|
26
|
+
* @return {import('node:https').Server}
|
|
27
|
+
*/
|
|
28
|
+
createHttpsServer(options?: import("node:https").ServerOptions): import("node:https").Server;
|
|
29
|
+
httpsServer: import("https").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* @param {import('node:http2').ServerOptions} [options]
|
|
32
|
+
* @return {import('node:http2').Http2SecureServer}
|
|
33
|
+
*/
|
|
34
|
+
createHttp2Server(options?: import("node:http2").ServerOptions): import("node:http2").Http2SecureServer;
|
|
35
|
+
http2Server: import("http2").Http2SecureServer<typeof import("http").IncomingMessage, typeof import("http").ServerResponse, typeof import("http2").Http2ServerRequest, typeof import("http2").Http2ServerResponse>;
|
|
36
|
+
/** @return {Promise<import('node:http').Server>} */
|
|
37
|
+
startHttpServer(): Promise<import("node:http").Server>;
|
|
38
|
+
/** @return {Promise<import('node:https').Server>} */
|
|
39
|
+
startHttpsServer(): Promise<import("node:https").Server>;
|
|
40
|
+
/** @return {Promise<import('node:http2').Http2SecureServer>} */
|
|
41
|
+
startHttp2Server(): Promise<import("node:http2").Http2SecureServer>;
|
|
42
|
+
/** @return {Promise<void>} */
|
|
43
|
+
stopHttpServer(): Promise<void>;
|
|
44
|
+
/** @return {Promise<void>} */
|
|
45
|
+
stopHttpsServer(): Promise<void>;
|
|
46
|
+
/** @return {Promise<void>} */
|
|
47
|
+
stopHttp2Server(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* @return {Promise<[
|
|
50
|
+
* import('node:http').Server,
|
|
51
|
+
* import('node:https').Server,
|
|
52
|
+
* import('node:http2').Http2SecureServer
|
|
53
|
+
* ]>
|
|
54
|
+
* }
|
|
55
|
+
*/
|
|
56
|
+
startAll(): Promise<[import("node:http").Server, import("node:https").Server, import("node:http2").Http2SecureServer]>;
|
|
57
|
+
/**
|
|
58
|
+
* @return {Promise<void>}
|
|
59
|
+
*/
|
|
60
|
+
stopAll(): Promise<void>;
|
|
61
|
+
#private;
|
|
62
|
+
}
|
|
63
|
+
export type TlsOptions = import("tls").TlsOptions;
|
|
64
|
+
export type Http2Session = import("http2").Http2Session;
|
|
65
|
+
export type Http2Stream = import("http2").Http2Stream;
|
|
66
|
+
export type HttpListenerOptions = {
|
|
67
|
+
httpHandler?: HttpHandler;
|
|
68
|
+
insecurePort?: number;
|
|
69
|
+
/**
|
|
70
|
+
* blank defaults to '::' or '0.0.0.0'
|
|
71
|
+
*/
|
|
72
|
+
insecureHost?: string;
|
|
73
|
+
securePort?: number;
|
|
74
|
+
/**
|
|
75
|
+
* blank defaults to '::' or '0.0.0.0'
|
|
76
|
+
*/
|
|
77
|
+
secureHost?: string;
|
|
78
|
+
useHttp?: boolean;
|
|
79
|
+
useHttps?: boolean;
|
|
80
|
+
useHttp2?: boolean;
|
|
81
|
+
tlsOptions?: TlsOptions;
|
|
82
|
+
};
|
|
83
|
+
import HttpHandler from '../lib/HttpHandler.js';
|
|
84
|
+
//# sourceMappingURL=HttpListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpListener.d.ts","sourceRoot":"","sources":["../../helpers/HttpListener.js"],"names":[],"mappings":"AAOA,qCAAsC,wBAAwB,CAAC;AAsB/D;IACE,6BAA6B;IAC7B,8BADa,YAAY,CAMxB;IAsCD,2CAA2C;IAC3C,sBADY,mBAAmB,EAG9B;IAED,2CAA2C;IAC3C,oBADY,mBAAmB,QAW9B;IATC,yBAAqE;IACrE,qBAAgD;IAChD,qBAAwC;IACxC,mBAA4C;IAC5C,mBAAoC;IACpC,iBAAwC;IACxC,kBAAyC;IACzC,kBAA0C;IAC1C,qCAA0C;IAG5C;;;OAGG;IACH,2BAHW,OAAO,WAAW,EAAE,aAAa,GAChC,OAAO,WAAW,EAAE,MAAM,CASrC;IALG,+GAA2C;IAO/C;;;OAGG;IACH,4BAHW,OAAO,YAAY,EAAE,aAAa,GACjC,OAAO,YAAY,EAAE,MAAM,CAYtC;IARG,iHAGE;IAON;;;OAGG;IACH,4BAHW,OAAO,YAAY,EAAE,aAAa,GACjC,OAAO,YAAY,EAAE,iBAAiB,CAajD;IATG,mNAIE;IAON,oDAAoD;IACpD,mBADa,OAAO,CAAC,OAAO,WAAW,EAAE,MAAM,CAAC,CA8C/C;IAED,qDAAqD;IACrD,oBADa,OAAO,CAAC,OAAO,YAAY,EAAE,MAAM,CAAC,CA8ChD;IAED,gEAAgE;IAChE,oBADa,OAAO,CAAC,OAAO,YAAY,EAAE,iBAAiB,CAAC,CA0I3D;IAED,8BAA8B;IAC9B,kBADa,OAAO,CAAC,IAAI,CAAC,CAwBzB;IAED,8BAA8B;IAC9B,mBADa,OAAO,CAAC,IAAI,CAAC,CAwBzB;IAED,8BAA8B;IAC9B,mBADa,OAAO,CAAC,IAAI,CAAC,CAmCzB;IAED;;;;;;;OAOG;IACH,YAPY,OAAO,CAAC,CACnB,OAAU,WAAW,EAAE,MAAM,EAC7B,OAAU,YAAY,EAAE,MAAM,EAC9B,OAAU,YAAY,EAAE,iBAAiB,CACtC,CAAC,CASJ;IAED;;OAEG;IACH,WAFY,OAAO,CAAC,IAAI,CAAC,CAQxB;;CACF;yBAhea,OAAO,KAAK,EAAE,UAAU;2BACxB,OAAO,OAAO,EAAE,YAAY;0BAC5B,OAAO,OAAO,EAAE,WAAW;;kBAI/B,WAAW;mBACX,MAAM;;;;mBACN,MAAM;iBACN,MAAM;;;;iBACN,MAAM;cACN,OAAO;eACP,OAAO;eACP,OAAO;iBACP,UAAU;;wBAlBI,uBAAuB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default class RequestHeaders extends HeadersHandler {
|
|
2
|
+
/**
|
|
3
|
+
* @param {HttpRequest} request
|
|
4
|
+
* @return {{get:(name:string)=>string,all:(name:string)=>string[]}}
|
|
5
|
+
*/
|
|
6
|
+
static cookies(request: HttpRequest): {
|
|
7
|
+
get: (name: string) => string;
|
|
8
|
+
all: (name: string) => string[];
|
|
9
|
+
};
|
|
10
|
+
/** @param {HttpRequest} request */
|
|
11
|
+
constructor(request: HttpRequest);
|
|
12
|
+
/** @return {{get:(name:string)=>string,all:(name:string)=>string[]}} */
|
|
13
|
+
get cookies(): {
|
|
14
|
+
get: (name: string) => string;
|
|
15
|
+
all: (name: string) => string[];
|
|
16
|
+
};
|
|
17
|
+
/** @return {Object<string,string[]>} */
|
|
18
|
+
get cookieEntries(): {
|
|
19
|
+
[x: string]: string[];
|
|
20
|
+
};
|
|
21
|
+
#private;
|
|
22
|
+
}
|
|
23
|
+
export type HttpRequest = import("../lib/HttpRequest.js").default;
|
|
24
|
+
import HeadersHandler from './HeadersParser.js';
|
|
25
|
+
//# sourceMappingURL=RequestHeaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestHeaders.d.ts","sourceRoot":"","sources":["../../helpers/RequestHeaders.js"],"names":[],"mappings":"AAgCA;IASE;;;OAGG;IACH,wBAHW,WAAW,GACV;QAAC,GAAG,EAAC,CAAC,IAAI,EAAC,MAAM,KAAG,MAAM,CAAC;QAAA,GAAG,EAAC,CAAC,IAAI,EAAC,MAAM,KAAG,MAAM,EAAE,CAAA;KAAC,CAKlE;IAfD,mCAAmC;IACnC,qBADY,WAAW,EAMtB;IAcD,wEAAwE;IACxE,eADa;QAAC,GAAG,EAAC,CAAC,IAAI,EAAC,MAAM,KAAG,MAAM,CAAC;QAAA,GAAG,EAAC,CAAC,IAAI,EAAC,MAAM,KAAG,MAAM,EAAE,CAAA;KAAC,CAYnE;IAED,wCAAwC;IACxC;;MAqFC;;CACF;0BAxJa,OAAO,uBAAuB,EAAE,OAAO;2BAF1B,oBAAoB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default class RequestReader {
|
|
2
|
+
/**
|
|
3
|
+
* @param {HttpRequest} request
|
|
4
|
+
* @param {RequestReaderOptions} [options]
|
|
5
|
+
*/
|
|
6
|
+
constructor(request: HttpRequest, options?: RequestReaderOptions);
|
|
7
|
+
request: import("../lib/HttpRequest.js").default;
|
|
8
|
+
/** @return {Promise<Buffer>} */
|
|
9
|
+
readBuffer(): Promise<Buffer>;
|
|
10
|
+
/** @return {Promise<string>} */
|
|
11
|
+
readString(): Promise<string>;
|
|
12
|
+
/** @return {Promise<Object<string,any>>} */
|
|
13
|
+
readJSON(): Promise<{
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* The application/x-www-form-urlencoded format is in many ways an aberrant monstrosity,
|
|
18
|
+
* the result of many years of implementation accidents and compromises leading to a set of
|
|
19
|
+
* requirements necessary for interoperability, but in no way representing good design practices.
|
|
20
|
+
* In particular, readers are cautioned to pay close attention to the twisted details
|
|
21
|
+
* involving repeated (and in some cases nested) conversions between character encodings and byte sequences.
|
|
22
|
+
* Unfortunately the format is in widespread use due to the prevalence of HTML forms. [HTML]
|
|
23
|
+
* @return {Promise<[string, string][]>}
|
|
24
|
+
*/
|
|
25
|
+
readUrlEncoded(): Promise<[string, string][]>;
|
|
26
|
+
/** @return {Promise<Map<string,string>>} */
|
|
27
|
+
readUrlEncodedAsMap(): Promise<Map<string, string>>;
|
|
28
|
+
/** @return {Promise<Object<string,string>>} */
|
|
29
|
+
readUrlEncodedAsObject(): Promise<{
|
|
30
|
+
[x: string]: string;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns `readJSON()`, `readUrlEncodedAsObject`, or `Promise<null>` based on Content-Type
|
|
34
|
+
* @return {Promise<Object<string, any>|null>}
|
|
35
|
+
*/
|
|
36
|
+
readObject(): Promise<{
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
} | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns `readJSON()`, `readUrlEncoded`, `readBuffer()`, or `readString()` based on Content-Type
|
|
41
|
+
* @return {Promise<Object<string,any>|string|Buffer>}
|
|
42
|
+
*/
|
|
43
|
+
read(): Promise<{
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
} | string | Buffer>;
|
|
46
|
+
#private;
|
|
47
|
+
}
|
|
48
|
+
export type HttpRequest = import("../data/custom-types.js").HttpRequest;
|
|
49
|
+
export type RequestReaderOptions = {
|
|
50
|
+
cache?: boolean;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=RequestReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestReader.d.ts","sourceRoot":"","sources":["../../helpers/RequestReader.js"],"names":[],"mappings":"AAgBA;IAIE;;;OAGG;IACH,qBAHW,WAAW,YACX,oBAAoB,EAc9B;IADC,iDAAsB;IAGxB,gCAAgC;IAChC,cADa,OAAO,CAAC,MAAM,CAAC,CA0C3B;IAED,gCAAgC;IAChC,cADa,OAAO,CAAC,MAAM,CAAC,CAQ3B;IAED,4CAA4C;IAC5C,YADa,OAAO,CAAC;YAAO,MAAM,GAAC,GAAG;KAAC,CAAC,CAGvC;IAED;;;;;;;;OAQG;IACH,kBAFY,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAuDtC;IAED,4CAA4C;IAC5C,uBADa,OAAO,CAAC,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAAC,CAGvC;IAED,+CAA+C;IAC/C,0BADa,OAAO,CAAC;YAAO,MAAM,GAAC,MAAM;KAAC,CAAC,CAG1C;IAED;;;OAGG;IACH,cAFY,OAAO,CAAC;YAAO,MAAM,GAAE,GAAG;KAAC,GAAC,IAAI,CAAC,CAa5C;IAED;;;OAGG;IACH,QAFY,OAAO,CAAC;YAAO,MAAM,GAAC,GAAG;KAAC,GAAC,MAAM,GAAC,MAAM,CAAC,CAmBpD;;CACF;0BAlNa,OAAO,yBAAyB,EAAE,WAAW;;YAQjD,OAAO"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export default class ResponseHeaders extends HeadersHandler {
|
|
2
|
+
/** @param {HttpResponse} response */
|
|
3
|
+
static cookies(response: HttpResponse): {
|
|
4
|
+
/**
|
|
5
|
+
* @param {string|CookieDetails|CookieObject} nameOrDetails
|
|
6
|
+
* @return {boolean}
|
|
7
|
+
*/
|
|
8
|
+
has(nameOrDetails: string | CookieDetails | CookieObject): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @param {string|CookieDetails} partial
|
|
11
|
+
* @return {CookieObject}
|
|
12
|
+
*/
|
|
13
|
+
get(partial: string | CookieDetails): CookieObject;
|
|
14
|
+
/**
|
|
15
|
+
* @param {string|CookieDetails} [partial]
|
|
16
|
+
* @return {CookieObject[]}
|
|
17
|
+
*/
|
|
18
|
+
getAll(partial?: string | CookieDetails): CookieObject[];
|
|
19
|
+
/**
|
|
20
|
+
* @param {CookieDetails} details
|
|
21
|
+
* @return {CookieObject}
|
|
22
|
+
*/
|
|
23
|
+
find(details: CookieDetails): CookieObject;
|
|
24
|
+
/**
|
|
25
|
+
* @param {CookieDetails} [details]
|
|
26
|
+
* @return {CookieObject[]}
|
|
27
|
+
*/
|
|
28
|
+
findAll(details?: CookieDetails): CookieObject[];
|
|
29
|
+
/**
|
|
30
|
+
* @param {string|CookieDetails} cookie
|
|
31
|
+
* @return {CookieObject}
|
|
32
|
+
*/
|
|
33
|
+
set(cookie: string | CookieDetails): CookieObject;
|
|
34
|
+
/**
|
|
35
|
+
* @param {string|CookieDetails} partial
|
|
36
|
+
* @return {number} count
|
|
37
|
+
*/
|
|
38
|
+
remove(partial: string | CookieDetails): number;
|
|
39
|
+
/**
|
|
40
|
+
* @param {string|CookieDetails} partial name or details
|
|
41
|
+
* @return {CookieObject}
|
|
42
|
+
*/
|
|
43
|
+
expire(partial: string | CookieDetails): CookieObject;
|
|
44
|
+
/**
|
|
45
|
+
* @param {string|CookieDetails} [partial]
|
|
46
|
+
* @return {CookieObject[]}
|
|
47
|
+
*/
|
|
48
|
+
expireAll(partial?: string | CookieDetails): CookieObject[];
|
|
49
|
+
};
|
|
50
|
+
/** @param {HttpResponse} response */
|
|
51
|
+
constructor(response: HttpResponse);
|
|
52
|
+
/** @param {string} contentType */
|
|
53
|
+
set contentType(contentType: string);
|
|
54
|
+
get contentType(): string;
|
|
55
|
+
/** @param {string} mediaType */
|
|
56
|
+
set mediaType(mediaType: string);
|
|
57
|
+
get mediaType(): string;
|
|
58
|
+
/** @param {string} charset */
|
|
59
|
+
set charset(charset: string);
|
|
60
|
+
get charset(): string;
|
|
61
|
+
/** @param {BufferEncoding} bufferEncoding */
|
|
62
|
+
set charsetAsBufferEncoding(bufferEncoding: BufferEncoding);
|
|
63
|
+
/** @return {BufferEncoding} */
|
|
64
|
+
get charsetAsBufferEncoding(): BufferEncoding;
|
|
65
|
+
/** @param {string} boundary */
|
|
66
|
+
set boundary(boundary: string);
|
|
67
|
+
get boundary(): string;
|
|
68
|
+
/** @param {number} value */
|
|
69
|
+
set contentLength(value: number);
|
|
70
|
+
get contentLength(): number;
|
|
71
|
+
get cookies(): {
|
|
72
|
+
/**
|
|
73
|
+
* @param {string|CookieDetails|CookieObject} nameOrDetails
|
|
74
|
+
* @return {boolean}
|
|
75
|
+
*/
|
|
76
|
+
has(nameOrDetails: string | CookieDetails | CookieObject): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* @param {string|CookieDetails} partial
|
|
79
|
+
* @return {CookieObject}
|
|
80
|
+
*/
|
|
81
|
+
get(partial: string | CookieDetails): CookieObject;
|
|
82
|
+
/**
|
|
83
|
+
* @param {string|CookieDetails} [partial]
|
|
84
|
+
* @return {CookieObject[]}
|
|
85
|
+
*/
|
|
86
|
+
getAll(partial?: string | CookieDetails): CookieObject[];
|
|
87
|
+
/**
|
|
88
|
+
* @param {CookieDetails} details
|
|
89
|
+
* @return {CookieObject}
|
|
90
|
+
*/
|
|
91
|
+
find(details: CookieDetails): CookieObject;
|
|
92
|
+
/**
|
|
93
|
+
* @param {CookieDetails} [details]
|
|
94
|
+
* @return {CookieObject[]}
|
|
95
|
+
*/
|
|
96
|
+
findAll(details?: CookieDetails): CookieObject[];
|
|
97
|
+
/**
|
|
98
|
+
* @param {string|CookieDetails} cookie
|
|
99
|
+
* @return {CookieObject}
|
|
100
|
+
*/
|
|
101
|
+
set(cookie: string | CookieDetails): CookieObject;
|
|
102
|
+
/**
|
|
103
|
+
* @param {string|CookieDetails} partial
|
|
104
|
+
* @return {number} count
|
|
105
|
+
*/
|
|
106
|
+
remove(partial: string | CookieDetails): number;
|
|
107
|
+
/**
|
|
108
|
+
* @param {string|CookieDetails} partial name or details
|
|
109
|
+
* @return {CookieObject}
|
|
110
|
+
*/
|
|
111
|
+
expire(partial: string | CookieDetails): CookieObject;
|
|
112
|
+
/**
|
|
113
|
+
* @param {string|CookieDetails} [partial]
|
|
114
|
+
* @return {CookieObject[]}
|
|
115
|
+
*/
|
|
116
|
+
expireAll(partial?: string | CookieDetails): CookieObject[];
|
|
117
|
+
};
|
|
118
|
+
/** @return {Array<CookieObject>} */
|
|
119
|
+
get cookieEntries(): Array<CookieObject>;
|
|
120
|
+
#private;
|
|
121
|
+
}
|
|
122
|
+
export type HttpResponse = import("../lib/HttpResponse.js").default;
|
|
123
|
+
export type CookieDetails = import("../data/custom-types.js").CookieDetails;
|
|
124
|
+
import HeadersHandler from './HeadersParser.js';
|
|
125
|
+
import CookieObject from '../data/CookieObject.js';
|
|
126
|
+
//# sourceMappingURL=ResponseHeaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponseHeaders.d.ts","sourceRoot":"","sources":["../../helpers/ResponseHeaders.js"],"names":[],"mappings":"AAuBA;IASE,qCAAqC;IACrC,yBADY,YAAY;QAsIpB;;;WAGG;2BAFQ,MAAM,GAAC,aAAa,GAAC,YAAY,GAChC,OAAO;QAKnB;;;WAGG;qBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY;QAKxB;;;WAGG;yBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY,EAAE;QAW1B;;;WAGG;sBAFQ,aAAa,GACZ,YAAY;QAKxB;;;WAGG;0BAFQ,aAAa,GACZ,YAAY,EAAE;QAmB1B;;;WAGG;oBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY;QAmBxB;;;WAGG;wBAFQ,MAAM,GAAC,aAAa,GACnB,MAAM;QAUlB;;;WAGG;wBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY;QAcxB;;;WAGG;4BAFQ,MAAM,GAAC,aAAa,GACnB,YAAY,EAAE;MA5O7B;IAZD,qCAAqC;IACrC,sBADY,YAAY,EAMvB;IA4BD,kCAAkC;IAClC,6BADY,MAAM,EAGjB;IAPD,mBAIY,MAAM,CAFjB;IAWD,gCAAgC;IAChC,yBADY,MAAM,EAQjB;IAZD,iBAIY,MAAM,CAFjB;IAgBD,8BAA8B;IAC9B,qBADY,MAAM,EAQjB;IAZD,eAIY,MAAM,CAFjB;IAoCD,6CAA6C;IAC7C,4CADY,cAAc,EAsBzB;IA9CD,+BAA+B;IAC/B,+BADa,cAAc,CAsB1B;IA8BD,+BAA+B;IAC/B,uBADY,MAAM,EAQjB;IAZD,gBAIY,MAAM,CAFjB;IAgBD,4BAA4B;IAC5B,yBADY,MAAM,EAGjB;IAPD,qBAIY,MAAM,CAFjB;IAOD;QAII;;;WAGG;2BAFQ,MAAM,GAAC,aAAa,GAAC,YAAY,GAChC,OAAO;QAKnB;;;WAGG;qBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY;QAKxB;;;WAGG;yBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY,EAAE;QAW1B;;;WAGG;sBAFQ,aAAa,GACZ,YAAY;QAKxB;;;WAGG;0BAFQ,aAAa,GACZ,YAAY,EAAE;QAmB1B;;;WAGG;oBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY;QAmBxB;;;WAGG;wBAFQ,MAAM,GAAC,aAAa,GACnB,MAAM;QAUlB;;;WAGG;wBAFQ,MAAM,GAAC,aAAa,GACnB,YAAY;QAcxB;;;WAGG;4BAFQ,MAAM,GAAC,aAAa,GACnB,YAAY,EAAE;MAY7B;IAED,oCAAoC;IACpC,qBADa,KAAK,CAAC,YAAY,CAAC,CAoD/B;;CACF;2BA/Ua,OAAO,wBAAwB,EAAE,OAAO;4BACxC,OAAO,yBAAyB,EAAE,aAAa;2BAHlC,oBAAoB;yBAFtB,yBAAyB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as HttpListener } from "./HttpListener.js";
|
|
2
|
+
export { default as HeadersParser } from "./HeadersParser.js";
|
|
3
|
+
export { default as RequestHeaders } from "./RequestHeaders.js";
|
|
4
|
+
export { default as RequestReader } from "./RequestReader.js";
|
|
5
|
+
export { default as ResponseHeaders } from "./ResponseHeaders.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../helpers/index.js"],"names":[],"mappings":""}
|