@forinda/kickjs-http 0.7.0 → 1.1.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/application.d.ts +2 -0
- package/dist/application.js +1 -1
- package/dist/bootstrap.js +2 -2
- package/dist/{chunk-E552HYEB.js → chunk-2OSVROBK.js} +2 -2
- package/dist/{chunk-YRCR6Z5C.js → chunk-7ZBIJ6IK.js} +5 -1
- package/dist/chunk-7ZBIJ6IK.js.map +1 -0
- package/dist/{chunk-Y5ZSC2FB.js → chunk-IUT42U72.js} +17 -1
- package/dist/chunk-IUT42U72.js.map +1 -0
- package/dist/{chunk-W35YEQOE.js → chunk-KSPABTU5.js} +6 -2
- package/dist/{chunk-W35YEQOE.js.map → chunk-KSPABTU5.js.map} +1 -1
- package/dist/context.d.ts +14 -0
- package/dist/context.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +7 -11
- package/dist/middleware/spa.d.ts +95 -0
- package/dist/middleware/spa.js +86 -0
- package/dist/middleware/spa.js.map +1 -0
- package/dist/middleware/views.d.ts +58 -0
- package/dist/middleware/views.js +40 -0
- package/dist/middleware/views.js.map +1 -0
- package/dist/router-builder.js +2 -2
- package/package.json +10 -6
- package/dist/chunk-PLKCXCBN.js +0 -429
- package/dist/chunk-PLKCXCBN.js.map +0 -1
- package/dist/chunk-Y5ZSC2FB.js.map +0 -1
- package/dist/chunk-YRCR6Z5C.js.map +0 -1
- package/dist/devtools.d.ts +0 -87
- package/dist/devtools.js +0 -8
- package/dist/devtools.js.map +0 -1
- /package/dist/{chunk-E552HYEB.js.map → chunk-2OSVROBK.js.map} +0 -0
package/dist/devtools.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { AppAdapter, Ref, ComputedRef, Container, AdapterMiddleware } from '@forinda/kickjs-core';
|
|
2
|
-
|
|
3
|
-
/** Per-route latency stats */
|
|
4
|
-
interface RouteStats {
|
|
5
|
-
count: number;
|
|
6
|
-
totalMs: number;
|
|
7
|
-
minMs: number;
|
|
8
|
-
maxMs: number;
|
|
9
|
-
}
|
|
10
|
-
interface DevToolsOptions {
|
|
11
|
-
/** Base path for debug endpoints (default: '/_debug') */
|
|
12
|
-
basePath?: string;
|
|
13
|
-
/** Only enable when this is true (default: process.env.NODE_ENV !== 'production') */
|
|
14
|
-
enabled?: boolean;
|
|
15
|
-
/** Include environment variables (sanitized) at /_debug/config (default: false) */
|
|
16
|
-
exposeConfig?: boolean;
|
|
17
|
-
/** Env var prefixes to expose (default: ['APP_', 'NODE_ENV']). Others are redacted. */
|
|
18
|
-
configPrefixes?: string[];
|
|
19
|
-
/** Callback when error rate exceeds threshold */
|
|
20
|
-
onErrorRateExceeded?: (rate: number) => void;
|
|
21
|
-
/** Error rate threshold (default: 0.5 = 50%) */
|
|
22
|
-
errorRateThreshold?: number;
|
|
23
|
-
/** Other adapters to discover stats from (e.g., WsAdapter) */
|
|
24
|
-
adapters?: any[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* DevToolsAdapter — Vue-style reactive introspection for KickJS applications.
|
|
28
|
-
*
|
|
29
|
-
* Exposes debug endpoints powered by reactive state (ref, computed, watch):
|
|
30
|
-
* - `GET /_debug/routes` — all registered routes with middleware
|
|
31
|
-
* - `GET /_debug/container` — DI registry with scopes and instantiation status
|
|
32
|
-
* - `GET /_debug/metrics` — live request/error counts, error rate, uptime
|
|
33
|
-
* - `GET /_debug/health` — deep health check with adapter status
|
|
34
|
-
* - `GET /_debug/config` — sanitized environment variables (opt-in)
|
|
35
|
-
* - `GET /_debug/state` — full reactive state snapshot
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* import { DevToolsAdapter } from '@forinda/kickjs-http/devtools'
|
|
40
|
-
*
|
|
41
|
-
* bootstrap({
|
|
42
|
-
* modules: [UserModule],
|
|
43
|
-
* adapters: [
|
|
44
|
-
* new DevToolsAdapter({
|
|
45
|
-
* enabled: process.env.NODE_ENV !== 'production',
|
|
46
|
-
* exposeConfig: true,
|
|
47
|
-
* configPrefixes: ['APP_', 'DATABASE_'],
|
|
48
|
-
* }),
|
|
49
|
-
* ],
|
|
50
|
-
* })
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
declare class DevToolsAdapter implements AppAdapter {
|
|
54
|
-
readonly name = "DevToolsAdapter";
|
|
55
|
-
private basePath;
|
|
56
|
-
private enabled;
|
|
57
|
-
private exposeConfig;
|
|
58
|
-
private configPrefixes;
|
|
59
|
-
private errorRateThreshold;
|
|
60
|
-
/** Total requests received */
|
|
61
|
-
readonly requestCount: Ref<number>;
|
|
62
|
-
/** Total responses with status >= 500 */
|
|
63
|
-
readonly errorCount: Ref<number>;
|
|
64
|
-
/** Total responses with status >= 400 and < 500 */
|
|
65
|
-
readonly clientErrorCount: Ref<number>;
|
|
66
|
-
/** Server start time */
|
|
67
|
-
readonly startedAt: Ref<number>;
|
|
68
|
-
/** Computed error rate (server errors / total requests) */
|
|
69
|
-
readonly errorRate: ComputedRef<number>;
|
|
70
|
-
/** Computed uptime in seconds */
|
|
71
|
-
readonly uptimeSeconds: ComputedRef<number>;
|
|
72
|
-
/** Per-route latency tracking */
|
|
73
|
-
readonly routeLatency: Record<string, RouteStats>;
|
|
74
|
-
private routes;
|
|
75
|
-
private container;
|
|
76
|
-
private adapterStatuses;
|
|
77
|
-
private stopErrorWatch;
|
|
78
|
-
private peerAdapters;
|
|
79
|
-
constructor(options?: DevToolsOptions);
|
|
80
|
-
beforeMount(app: any, container: Container): void;
|
|
81
|
-
middleware(): AdapterMiddleware[];
|
|
82
|
-
onRouteMount(controllerClass: any, mountPath: string): void;
|
|
83
|
-
afterStart(_server: any, _container: Container): void;
|
|
84
|
-
shutdown(): void;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { DevToolsAdapter, type DevToolsOptions };
|
package/dist/devtools.js
DELETED
package/dist/devtools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
File without changes
|