exisjs 0.7.6 → 0.7.8
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/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +12 -0
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +5 -0
- package/dist/cli/commands/clean.d.ts.map +1 -0
- package/dist/cli/commands/clean.js +30 -0
- package/dist/cli/commands/clean.js.map +1 -0
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +15 -1
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +6 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +57 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/index.js +16 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/manifest.d.ts +1 -0
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +161 -23
- package/dist/cli/manifest.js.map +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +9 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +4 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/cron/expressions.d.ts +45 -0
- package/dist/cron/expressions.d.ts.map +1 -0
- package/dist/cron/expressions.js +87 -0
- package/dist/cron/expressions.js.map +1 -0
- package/dist/cron/index.d.ts +6 -0
- package/dist/cron/index.d.ts.map +1 -0
- package/dist/cron/index.js +22 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/job.d.ts +50 -0
- package/dist/cron/job.d.ts.map +1 -0
- package/dist/cron/job.js +247 -0
- package/dist/cron/job.js.map +1 -0
- package/dist/cron/manager.d.ts +105 -0
- package/dist/cron/manager.d.ts.map +1 -0
- package/dist/cron/manager.js +245 -0
- package/dist/cron/manager.js.map +1 -0
- package/dist/cron/parser.d.ts +22 -0
- package/dist/cron/parser.d.ts.map +1 -0
- package/dist/cron/parser.js +269 -0
- package/dist/cron/parser.js.map +1 -0
- package/dist/cron/types.d.ts +76 -0
- package/dist/cron/types.d.ts.map +1 -0
- package/dist/cron/types.js +3 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/decorators/constants.d.ts +2 -0
- package/dist/decorators/constants.d.ts.map +1 -1
- package/dist/decorators/constants.js +3 -1
- package/dist/decorators/constants.js.map +1 -1
- package/dist/decorators/core.d.ts +29 -11
- package/dist/decorators/core.d.ts.map +1 -1
- package/dist/decorators/core.js +49 -11
- package/dist/decorators/core.js.map +1 -1
- package/dist/decorators/cron.d.ts +57 -0
- package/dist/decorators/cron.d.ts.map +1 -0
- package/dist/decorators/cron.js +143 -0
- package/dist/decorators/cron.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +2 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/params.d.ts +97 -2
- package/dist/decorators/params.d.ts.map +1 -1
- package/dist/decorators/params.js +94 -2
- package/dist/decorators/params.js.map +1 -1
- package/dist/decorators/routing.d.ts +81 -16
- package/dist/decorators/routing.d.ts.map +1 -1
- package/dist/decorators/routing.js +81 -16
- package/dist/decorators/routing.js.map +1 -1
- package/dist/docs/content/cron.mdx +196 -0
- package/dist/docs/content/errors.mdx +58 -9
- package/dist/docs/content/structure.mdx +1 -1
- package/dist/docs/content/swagger.mdx +289 -0
- package/dist/docs/reference/cron.mdx +300 -0
- package/dist/docs/reference/decorators.mdx +8 -0
- package/dist/docs/reference/error.mdx +44 -0
- package/dist/docs/reference/swagger.mdx +226 -0
- package/dist/docs/reference/validator.mdx +1 -1
- package/dist/router/boundary.d.ts +24 -2
- package/dist/router/boundary.d.ts.map +1 -1
- package/dist/router/boundary.js +24 -2
- package/dist/router/boundary.js.map +1 -1
- package/dist/router/controller-registrar.d.ts.map +1 -1
- package/dist/router/controller-registrar.js +52 -3
- package/dist/router/controller-registrar.js.map +1 -1
- package/dist/router/route-builder.d.ts +196 -33
- package/dist/router/route-builder.d.ts.map +1 -1
- package/dist/router/route-builder.js +171 -11
- package/dist/router/route-builder.js.map +1 -1
- package/dist/router/route-scanner.d.ts +6 -0
- package/dist/router/route-scanner.d.ts.map +1 -1
- package/dist/router/route-scanner.js +69 -812
- package/dist/router/route-scanner.js.map +1 -1
- package/dist/router/router.d.ts.map +1 -1
- package/dist/router/router.js +27 -0
- package/dist/router/router.js.map +1 -1
- package/dist/router/scanner/boundary-loader.d.ts +18 -0
- package/dist/router/scanner/boundary-loader.d.ts.map +1 -0
- package/dist/router/scanner/boundary-loader.js +539 -0
- package/dist/router/scanner/boundary-loader.js.map +1 -0
- package/dist/router/scanner/cron-mounter.d.ts +15 -0
- package/dist/router/scanner/cron-mounter.d.ts.map +1 -0
- package/dist/router/scanner/cron-mounter.js +216 -0
- package/dist/router/scanner/cron-mounter.js.map +1 -0
- package/dist/router/scanner/error-mounter.d.ts +14 -0
- package/dist/router/scanner/error-mounter.d.ts.map +1 -0
- package/dist/router/scanner/error-mounter.js +200 -0
- package/dist/router/scanner/error-mounter.js.map +1 -0
- package/dist/router/scanner/fs-scanner.d.ts +25 -0
- package/dist/router/scanner/fs-scanner.d.ts.map +1 -0
- package/dist/router/scanner/fs-scanner.js +115 -0
- package/dist/router/scanner/fs-scanner.js.map +1 -0
- package/dist/router/scanner/functional-compiler.d.ts +9 -0
- package/dist/router/scanner/functional-compiler.d.ts.map +1 -0
- package/dist/router/scanner/functional-compiler.js +233 -0
- package/dist/router/scanner/functional-compiler.js.map +1 -0
- package/dist/router/scanner/index.d.ts +9 -0
- package/dist/router/scanner/index.d.ts.map +1 -0
- package/dist/router/scanner/index.js +19 -0
- package/dist/router/scanner/index.js.map +1 -0
- package/dist/router/types.d.ts +15 -0
- package/dist/router/types.d.ts.map +1 -1
- package/dist/server/app.d.ts +2 -0
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +3 -0
- package/dist/server/app.js.map +1 -1
- package/dist/server/helpers/body-parser.d.ts +18 -0
- package/dist/server/helpers/body-parser.d.ts.map +1 -0
- package/dist/server/helpers/body-parser.js +246 -0
- package/dist/server/helpers/body-parser.js.map +1 -0
- package/dist/server/helpers/cookie.d.ts +4 -0
- package/dist/server/helpers/cookie.d.ts.map +1 -0
- package/dist/server/helpers/cookie.js +61 -0
- package/dist/server/helpers/cookie.js.map +1 -0
- package/dist/server/helpers/etag.d.ts +3 -0
- package/dist/server/helpers/etag.d.ts.map +1 -0
- package/dist/server/helpers/etag.js +25 -0
- package/dist/server/helpers/etag.js.map +1 -0
- package/dist/server/helpers/index.d.ts +6 -0
- package/dist/server/helpers/index.d.ts.map +1 -0
- package/dist/server/helpers/index.js +21 -0
- package/dist/server/helpers/index.js.map +1 -0
- package/dist/server/helpers/ip.d.ts +9 -0
- package/dist/server/helpers/ip.d.ts.map +1 -0
- package/dist/server/helpers/ip.js +62 -0
- package/dist/server/helpers/ip.js.map +1 -0
- package/dist/server/helpers/stream.d.ts +4 -0
- package/dist/server/helpers/stream.d.ts.map +1 -0
- package/dist/server/helpers/stream.js +193 -0
- package/dist/server/helpers/stream.js.map +1 -0
- package/dist/server/request.d.ts +1 -139
- package/dist/server/request.d.ts.map +1 -1
- package/dist/server/request.js +19 -433
- package/dist/server/request.js.map +1 -1
- package/dist/server/response.d.ts +105 -158
- package/dist/server/response.d.ts.map +1 -1
- package/dist/server/response.js +121 -423
- package/dist/server/response.js.map +1 -1
- package/dist/swagger/decorators.d.ts +81 -0
- package/dist/swagger/decorators.d.ts.map +1 -0
- package/dist/swagger/decorators.js +172 -0
- package/dist/swagger/decorators.js.map +1 -0
- package/dist/swagger/generator.d.ts +19 -0
- package/dist/swagger/generator.d.ts.map +1 -0
- package/dist/swagger/generator.js +344 -0
- package/dist/swagger/generator.js.map +1 -0
- package/dist/swagger/index.d.ts +31 -0
- package/dist/swagger/index.d.ts.map +1 -0
- package/dist/swagger/index.js +53 -0
- package/dist/swagger/index.js.map +1 -0
- package/dist/swagger/mounter.d.ts +7 -0
- package/dist/swagger/mounter.d.ts.map +1 -0
- package/dist/swagger/mounter.js +56 -0
- package/dist/swagger/mounter.js.map +1 -0
- package/dist/swagger/types.d.ts +190 -0
- package/dist/swagger/types.d.ts.map +1 -0
- package/dist/swagger/types.js +3 -0
- package/dist/swagger/types.js.map +1 -0
- package/dist/swagger/ui.d.ts +6 -0
- package/dist/swagger/ui.d.ts.map +1 -0
- package/dist/swagger/ui.js +118 -0
- package/dist/swagger/ui.js.map +1 -0
- package/dist/validator/builder.d.ts +223 -0
- package/dist/validator/builder.d.ts.map +1 -0
- package/dist/validator/builder.js +517 -0
- package/dist/validator/builder.js.map +1 -0
- package/dist/validator/engine.d.ts +19 -0
- package/dist/validator/engine.d.ts.map +1 -0
- package/dist/validator/engine.js +568 -0
- package/dist/validator/engine.js.map +1 -0
- package/dist/validator/error.d.ts +12 -0
- package/dist/validator/error.d.ts.map +1 -0
- package/dist/validator/error.js +63 -0
- package/dist/validator/error.js.map +1 -0
- package/dist/validator/pagination.d.ts +40 -0
- package/dist/validator/pagination.d.ts.map +1 -0
- package/dist/validator/pagination.js +60 -0
- package/dist/validator/pagination.js.map +1 -0
- package/dist/validator/tex.d.ts +6 -158
- package/dist/validator/tex.d.ts.map +1 -1
- package/dist/validator/tex.js +14 -971
- package/dist/validator/tex.js.map +1 -1
- package/dist/validator/types.d.ts +83 -0
- package/dist/validator/types.d.ts.map +1 -0
- package/dist/validator/types.js +3 -0
- package/dist/validator/types.js.map +1 -0
- package/package.json +9 -1
|
@@ -19,128 +19,95 @@ export declare class ExisResponse<TResponse = any> {
|
|
|
19
19
|
hasHeader(name: string): boolean;
|
|
20
20
|
end(data?: unknown): void;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Sets the HTTP response status code.
|
|
23
23
|
*
|
|
24
|
-
* @param
|
|
25
|
-
* @
|
|
26
|
-
*
|
|
24
|
+
* @param code HTTP status code (e.g. `200`, `201`, `400`, `404`, `500`)
|
|
25
|
+
* @returns Response instance for chaining
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* res.status(201).json({ created: true })
|
|
30
|
+
* ```
|
|
27
31
|
*/
|
|
28
32
|
status(code: number): this;
|
|
29
33
|
/**
|
|
30
|
-
*
|
|
31
|
-
* an object of header fields.
|
|
32
|
-
*
|
|
33
|
-
* Examples:
|
|
34
|
-
*
|
|
35
|
-
* res.set('Foo', ['bar', 'baz']);
|
|
36
|
-
* res.set('Accept', 'application/json');
|
|
37
|
-
*
|
|
38
|
-
* Aliased as `res.header()`.
|
|
34
|
+
* Sets a response header field to a specific value.
|
|
39
35
|
*
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @
|
|
43
|
-
* @public
|
|
36
|
+
* @param header Header name
|
|
37
|
+
* @param value Header value or array of values
|
|
38
|
+
* @returns Response instance for chaining
|
|
44
39
|
*/
|
|
45
40
|
set(header: string, value: string | string[]): this;
|
|
46
41
|
/**
|
|
47
|
-
*
|
|
48
|
-
* an object of header fields.
|
|
49
|
-
*
|
|
50
|
-
* Alias for `res.set()`.
|
|
51
|
-
*
|
|
52
|
-
* @param {string} name
|
|
53
|
-
* @param {string | string[]} value
|
|
54
|
-
* @return {this}
|
|
55
|
-
* @public
|
|
42
|
+
* Sets a response header field (alias for `res.set()`).
|
|
56
43
|
*/
|
|
57
44
|
header(name: string, value: string | string[]): this;
|
|
58
45
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* Sets the response status to `code` and the body
|
|
62
|
-
* to the string representation of the `code`.
|
|
63
|
-
*
|
|
64
|
-
* Examples:
|
|
65
|
-
*
|
|
66
|
-
* res.sendStatus(200);
|
|
67
|
-
*
|
|
68
|
-
* @param {number} code
|
|
69
|
-
* @public
|
|
46
|
+
* Sets status code and sends its numeric string representation.
|
|
70
47
|
*/
|
|
71
48
|
sendStatus(code: number): void;
|
|
72
49
|
removeHeader(name: string): this;
|
|
73
50
|
setStrHeaders(headers: Record<string, string>): this;
|
|
74
51
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* Example:
|
|
78
|
-
*
|
|
79
|
-
* res.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']);
|
|
80
|
-
* res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');
|
|
81
|
-
* res.append('Warning', '199 Miscellaneous warning');
|
|
82
|
-
*
|
|
83
|
-
* @param {string} field
|
|
84
|
-
* @param {string | string[]} value
|
|
85
|
-
* @return {this}
|
|
86
|
-
* @public
|
|
52
|
+
* Appends an additional value to an existing header field (e.g. `Set-Cookie`, `Link`, `Warning`).
|
|
87
53
|
*/
|
|
88
54
|
append(field: string, value: string | string[]): this;
|
|
89
55
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* Examples:
|
|
56
|
+
* Sends a string, Buffer, or object response to the client.
|
|
93
57
|
*
|
|
94
|
-
*
|
|
95
|
-
* res.send({ some: 'json' });
|
|
96
|
-
* res.send('<p>some html</p>');
|
|
58
|
+
* @param body Response payload (string, Buffer, or object)
|
|
97
59
|
*
|
|
98
|
-
* @
|
|
99
|
-
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* res.send('Hello World')
|
|
63
|
+
* ```
|
|
100
64
|
*/
|
|
101
65
|
send(body: string | Buffer | object): void;
|
|
102
66
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* Examples:
|
|
67
|
+
* Sends a JSON response with automatic native serialization and fast ETag support.
|
|
106
68
|
*
|
|
107
|
-
*
|
|
108
|
-
* res.json({ user: 'tj' });
|
|
69
|
+
* @param data JSON-serializable data payload
|
|
109
70
|
*
|
|
110
|
-
* @
|
|
111
|
-
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* res.json({ success: true, users: ['Alice', 'Bob'] })
|
|
74
|
+
* ```
|
|
112
75
|
*/
|
|
113
76
|
json(data: unknown extends TResponse ? any : TResponse): void;
|
|
114
77
|
/**
|
|
115
|
-
*
|
|
78
|
+
* Sends an HTML response with `Content-Type: text/html; charset=utf-8`.
|
|
116
79
|
*
|
|
117
|
-
*
|
|
80
|
+
* @param content HTML string
|
|
118
81
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* res.html('<h1>Welcome to ExisJS</h1>')
|
|
85
|
+
* ```
|
|
123
86
|
*/
|
|
124
87
|
html(content: string): void;
|
|
125
88
|
/**
|
|
126
|
-
*
|
|
127
|
-
* defaulting to 302.
|
|
89
|
+
* Performs an HTTP redirect to a given URL with an optional status code (defaults to 302).
|
|
128
90
|
*
|
|
129
|
-
*
|
|
91
|
+
* @param url Target destination URL
|
|
92
|
+
* @param code HTTP status code (`301` Moved Permanently, `302` Found, `307` Temporary Redirect, `308` Permanent Redirect)
|
|
130
93
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* @param {string} url
|
|
136
|
-
* @param {number} [code=302]
|
|
137
|
-
* @public
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* res.redirect('/login')
|
|
97
|
+
* ```
|
|
138
98
|
*/
|
|
139
99
|
redirect(url: string, code?: number): void;
|
|
140
100
|
/**
|
|
141
|
-
*
|
|
142
|
-
* to the client with native
|
|
143
|
-
*
|
|
101
|
+
* Streams a Node.js Readable stream, Web standard `ReadableStream`, or `AsyncIterable` generator
|
|
102
|
+
* to the client with native backpressure handling and client disconnect auto-cancellation.
|
|
103
|
+
*
|
|
104
|
+
* @param readable Stream or async generator instance
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* // Streaming from an AI SDK or Web stream:
|
|
109
|
+
* res.sendStream(aiResponse.toReadableStream())
|
|
110
|
+
* ```
|
|
144
111
|
*/
|
|
145
112
|
sendStream(readable: NodeJS.ReadableStream | ReadableStream | AsyncIterable<any>): void;
|
|
146
113
|
/**
|
|
@@ -148,114 +115,94 @@ export declare class ExisResponse<TResponse = any> {
|
|
|
148
115
|
*/
|
|
149
116
|
stream(readable: NodeJS.ReadableStream | ReadableStream | AsyncIterable<any>): void;
|
|
150
117
|
/**
|
|
151
|
-
*
|
|
118
|
+
* Initializes a Server-Sent Events (SSE) stream for real-time data and AI token streaming.
|
|
152
119
|
*
|
|
153
|
-
*
|
|
120
|
+
* Sets standard SSE headers automatically:
|
|
154
121
|
* - `Content-Type: text/event-stream; charset=utf-8`
|
|
155
122
|
* - `Cache-Control: no-cache, no-transform`
|
|
156
123
|
* - `Connection: keep-alive`
|
|
157
|
-
* - `X-Accel-Buffering: no`
|
|
124
|
+
* - `X-Accel-Buffering: no`
|
|
158
125
|
*
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
126
|
+
* @param optionsOrHandler Optional SSE configuration or callback handler
|
|
127
|
+
* @param maybeHandler Callback handler when options object is provided
|
|
161
128
|
* @returns Active `SSEStream` instance
|
|
162
129
|
*
|
|
163
130
|
* @example
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
131
|
+
* ```ts
|
|
132
|
+
* // In route.ts
|
|
133
|
+
* export default controller({
|
|
134
|
+
* events: route.get('/events', {
|
|
135
|
+
* async handle({ res }) {
|
|
136
|
+
* res.sse(async (sse) => {
|
|
137
|
+
* sse.send({ event: 'ping', data: { time: Date.now() } })
|
|
138
|
+
* await sse.pipeFrom(openAiStream)
|
|
139
|
+
* sse.close()
|
|
140
|
+
* })
|
|
141
|
+
* }
|
|
142
|
+
* })
|
|
169
143
|
* })
|
|
170
|
-
*
|
|
171
|
-
* // Or assigning to variable:
|
|
172
|
-
* const sse = res.sse()
|
|
173
|
-
* sse.send({ event: 'connected', data: { time: Date.now() } })
|
|
144
|
+
* ```
|
|
174
145
|
*/
|
|
175
146
|
sse(optionsOrHandler?: SSEOptions | ((sse: SSEStream) => void | Promise<void>), maybeHandler?: (sse: SSEStream) => void | Promise<void>): SSEStream;
|
|
176
147
|
/**
|
|
177
|
-
*
|
|
148
|
+
* Transfers a file on disk as an attachment with automatic Content-Disposition and MIME lookup.
|
|
178
149
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
150
|
+
* @param filePath Absolute path to file on disk
|
|
151
|
+
* @param filename Optional override for downloaded filename
|
|
152
|
+
* @param options File stream options
|
|
181
153
|
*
|
|
182
|
-
* @
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* res.download('/data/reports/report.pdf', 'monthly-report.pdf')
|
|
157
|
+
* ```
|
|
186
158
|
*/
|
|
187
159
|
download(filePath: string, filename?: string, options?: unknown): void;
|
|
188
160
|
/**
|
|
189
|
-
*
|
|
190
|
-
* when it does not contain "/", or set the Content-Type to `type` otherwise.
|
|
191
|
-
*
|
|
192
|
-
* Examples:
|
|
161
|
+
* Sets Content-Type header using file extension or MIME type string.
|
|
193
162
|
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* @param {string} type
|
|
201
|
-
* @return {this}
|
|
202
|
-
* @public
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* res.type('json') // sets 'application/json; charset=utf-8'
|
|
166
|
+
* res.type('png') // sets 'image/png'
|
|
167
|
+
* ```
|
|
203
168
|
*/
|
|
204
169
|
type(type: string): this;
|
|
205
170
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* Examples:
|
|
209
|
-
*
|
|
210
|
-
* res.links({
|
|
211
|
-
* next: 'http://api.example.com/users?page=2',
|
|
212
|
-
* last: 'http://api.example.com/users?page=5'
|
|
213
|
-
* });
|
|
214
|
-
*
|
|
215
|
-
* @param {Record<string, string>} links
|
|
216
|
-
* @return {this}
|
|
217
|
-
* @public
|
|
171
|
+
* Sets Link header field with pagination or resource relations.
|
|
218
172
|
*/
|
|
219
173
|
links(links: Record<string, string>): this;
|
|
220
174
|
/**
|
|
221
|
-
*
|
|
222
|
-
* this call is simply ignored.
|
|
223
|
-
*
|
|
224
|
-
* @param {string} field
|
|
225
|
-
* @return {this}
|
|
226
|
-
* @public
|
|
175
|
+
* Adds a field to the Vary header if not already present.
|
|
227
176
|
*/
|
|
228
177
|
vary(field: string): this;
|
|
229
178
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* Options:
|
|
233
|
-
* - `maxAge` max-age in milliseconds, converted to `expires`
|
|
234
|
-
* - `path` cookie path, defaults to '/'
|
|
235
|
-
* - `domain` cookie domain
|
|
236
|
-
* - `secure` secure cookie
|
|
237
|
-
* - `httpOnly` httponly cookie
|
|
238
|
-
* - `sameSite` samesite cookie
|
|
179
|
+
* Sets a cookie with specified security options.
|
|
239
180
|
*
|
|
240
|
-
*
|
|
181
|
+
* @param name Cookie name
|
|
182
|
+
* @param value Cookie value
|
|
183
|
+
* @param options Cookie options (httpOnly, secure, sameSite, maxAge, path, domain)
|
|
241
184
|
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* res.cookie('session_token', token, {
|
|
188
|
+
* httpOnly: true,
|
|
189
|
+
* secure: true,
|
|
190
|
+
* sameSite: 'lax',
|
|
191
|
+
* maxAge: 86400000 // 1 day
|
|
192
|
+
* })
|
|
193
|
+
* ```
|
|
250
194
|
*/
|
|
251
195
|
cookie(name: string, value: string, options?: CookieOptions): this;
|
|
252
196
|
/**
|
|
253
|
-
*
|
|
197
|
+
* Clears a cookie by setting its expiration to the past.
|
|
254
198
|
*
|
|
255
|
-
* @param
|
|
256
|
-
* @param
|
|
257
|
-
*
|
|
258
|
-
* @
|
|
199
|
+
* @param name Cookie name
|
|
200
|
+
* @param options Cookie options (path, domain)
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* res.clearCookie('session_token')
|
|
205
|
+
* ```
|
|
259
206
|
*/
|
|
260
207
|
clearCookie(name: string, options?: CookieOptions): this;
|
|
261
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/server/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAG1C,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAA;AAElE,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/server/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAG1C,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAA;AAElE,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAA;AAclD,qBAAa,YAAY,CAAC,SAAS,GAAG,GAAG;IAOpB,GAAG,EAAE,cAAc;IAL/B,GAAG,CAAC,EAAE,QAAQ,CAAA;IACd,WAAW,UAAQ;IACnB,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAK;IAC9B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAA;gBAE3B,GAAG,EAAE,cAAc;IAE/B,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAStC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,UAA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