qhttpx 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/package.json +1 -1
- package/dist/src/core/types.d.ts +24 -0
- package/dist/src/index.js +2 -0
- package/dist/src/middleware/presets.d.ts +1 -2
- package/dist/src/middleware/presets.js +1 -1
- package/dist/src/middleware/security.d.ts +2 -13
- package/dist/src/utils/logger.d.ts +1 -11
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/qhttpx.node +0 -0
- package/prebuilds/win32-x64/qhttpx.node +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.9.4] - 2026-01-20
|
|
6
|
+
**"The Silent Performance Update"**
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- **Performance**: Disabled logging by default in standard presets to reduce I/O overhead and improve throughput in production environments.
|
|
10
|
+
|
|
5
11
|
## [1.9.3] - 2026-01-20
|
|
6
12
|
**"The Distribution Fix"**
|
|
7
13
|
|
package/dist/package.json
CHANGED
package/dist/src/core/types.d.ts
CHANGED
|
@@ -151,6 +151,30 @@ export type QHTTPXOptions = {
|
|
|
151
151
|
rateLimit?: RateLimitOptions;
|
|
152
152
|
cors?: CorsOptions | boolean;
|
|
153
153
|
compression?: CompressionOptions | boolean;
|
|
154
|
+
logging?: LoggerOptions | boolean;
|
|
155
|
+
security?: SecureDefaultsOptions;
|
|
156
|
+
};
|
|
157
|
+
export type LogEntry = {
|
|
158
|
+
method: string;
|
|
159
|
+
path: string;
|
|
160
|
+
status: number;
|
|
161
|
+
durationMs: number;
|
|
162
|
+
requestId?: string;
|
|
163
|
+
};
|
|
164
|
+
export type LoggerOptions = {
|
|
165
|
+
sink?: (entry: LogEntry, ctx: QHTTPXContext) => void;
|
|
166
|
+
};
|
|
167
|
+
export type SecurityHeadersOptions = {
|
|
168
|
+
contentSecurityPolicy?: string | null;
|
|
169
|
+
referrerPolicy?: string | null;
|
|
170
|
+
xFrameOptions?: 'DENY' | 'SAMEORIGIN' | null;
|
|
171
|
+
xContentTypeOptions?: 'nosniff' | null;
|
|
172
|
+
xXssProtection?: '0' | '1; mode=block' | null;
|
|
173
|
+
strictTransportSecurity?: string | null;
|
|
174
|
+
};
|
|
175
|
+
export type SecureDefaultsOptions = {
|
|
176
|
+
cors?: CorsOptions;
|
|
177
|
+
securityHeaders?: SecurityHeadersOptions;
|
|
154
178
|
};
|
|
155
179
|
export type CorsOrigin = string | string[] | ((origin: string | undefined) => string | null | undefined);
|
|
156
180
|
export type CorsOptions = {
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { QHTTPXMiddleware, RateLimitOptions, CorsOptions, CompressionOptions } from '../core/types';
|
|
1
|
+
import { QHTTPXMiddleware, RateLimitOptions, CorsOptions, CompressionOptions, LoggerOptions } from '../core/types';
|
|
2
2
|
import { SecureDefaultsOptions } from './security';
|
|
3
|
-
import { LoggerOptions } from '../utils/logger';
|
|
4
3
|
import { StaticOptions } from './static';
|
|
5
4
|
export type ApiPresetOptions = {
|
|
6
5
|
security?: SecureDefaultsOptions;
|
|
@@ -25,7 +25,7 @@ function createApiPreset(options = {}) {
|
|
|
25
25
|
middlewares.push((0, compression_1.createCompressionMiddleware)(opts));
|
|
26
26
|
}
|
|
27
27
|
// 4. Logging
|
|
28
|
-
if (options.logging
|
|
28
|
+
if (options.logging) {
|
|
29
29
|
const loggerOptions = typeof options.logging === 'object' ? options.logging : {};
|
|
30
30
|
middlewares.push((0, logger_1.createLoggerMiddleware)(loggerOptions));
|
|
31
31
|
}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import { QHTTPXContext, QHTTPXMiddleware,
|
|
2
|
-
export
|
|
3
|
-
contentSecurityPolicy?: string | null;
|
|
4
|
-
referrerPolicy?: string | null;
|
|
5
|
-
xFrameOptions?: 'DENY' | 'SAMEORIGIN' | null;
|
|
6
|
-
xContentTypeOptions?: 'nosniff' | null;
|
|
7
|
-
xXssProtection?: '0' | '1; mode=block' | null;
|
|
8
|
-
strictTransportSecurity?: string | null;
|
|
9
|
-
};
|
|
1
|
+
import { QHTTPXContext, QHTTPXMiddleware, SecurityHeadersOptions, SecureDefaultsOptions } from '../core/types';
|
|
2
|
+
export { SecurityHeadersOptions, SecureDefaultsOptions };
|
|
10
3
|
export declare function createSecurityHeadersMiddleware(options?: SecurityHeadersOptions): QHTTPXMiddleware;
|
|
11
|
-
export type SecureDefaultsOptions = {
|
|
12
|
-
cors?: CorsOptions;
|
|
13
|
-
securityHeaders?: SecurityHeadersOptions;
|
|
14
|
-
};
|
|
15
4
|
export declare function createSecureDefaults(options?: SecureDefaultsOptions): QHTTPXMiddleware[];
|
|
16
5
|
export type RateLimitOptions = {
|
|
17
6
|
maxRequests: number;
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type LogEntry = {
|
|
3
|
-
method: string;
|
|
4
|
-
path: string;
|
|
5
|
-
status: number;
|
|
6
|
-
durationMs: number;
|
|
7
|
-
requestId?: string;
|
|
8
|
-
};
|
|
9
|
-
export type LoggerOptions = {
|
|
10
|
-
sink?: (entry: LogEntry, ctx: QHTTPXContext) => void;
|
|
11
|
-
};
|
|
1
|
+
import { QHTTPXMiddleware, LoggerOptions } from '../core/types';
|
|
12
2
|
export declare function createLoggerMiddleware(options?: LoggerOptions): QHTTPXMiddleware;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|