@serve.zone/dcrouter 5.0.2 → 5.0.3
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_serve/bundle.js +30539 -0
- package/dist_serve/bundle.js.map +7 -0
- package/dist_serve/index.html +1 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/cache/classes.cache.cleaner.d.ts +47 -0
- package/dist_ts/cache/classes.cache.cleaner.js +130 -0
- package/dist_ts/cache/classes.cached.document.d.ts +76 -0
- package/dist_ts/cache/classes.cached.document.js +100 -0
- package/dist_ts/cache/classes.cachedb.d.ts +60 -0
- package/dist_ts/cache/classes.cachedb.js +125 -0
- package/dist_ts/cache/documents/classes.cached.email.d.ts +125 -0
- package/dist_ts/cache/documents/classes.cached.email.js +337 -0
- package/dist_ts/cache/documents/classes.cached.ip.reputation.d.ts +119 -0
- package/dist_ts/cache/documents/classes.cached.ip.reputation.js +323 -0
- package/dist_ts/cache/documents/index.d.ts +2 -0
- package/dist_ts/cache/documents/index.js +3 -0
- package/dist_ts/cache/index.d.ts +4 -0
- package/dist_ts/cache/index.js +7 -0
- package/dist_ts/classes.dcrouter.d.ts +276 -0
- package/dist_ts/classes.dcrouter.js +1033 -0
- package/dist_ts/config/index.d.ts +1 -0
- package/dist_ts/config/index.js +3 -0
- package/dist_ts/config/validator.d.ts +104 -0
- package/dist_ts/config/validator.js +152 -0
- package/dist_ts/errors/base.errors.d.ts +224 -0
- package/dist_ts/errors/base.errors.js +320 -0
- package/dist_ts/errors/error-handler.d.ts +98 -0
- package/dist_ts/errors/error-handler.js +282 -0
- package/dist_ts/errors/error.codes.d.ts +115 -0
- package/dist_ts/errors/error.codes.js +136 -0
- package/dist_ts/errors/index.d.ts +54 -0
- package/dist_ts/errors/index.js +136 -0
- package/dist_ts/errors/reputation.errors.d.ts +183 -0
- package/dist_ts/errors/reputation.errors.js +292 -0
- package/dist_ts/index.d.ts +6 -0
- package/dist_ts/index.js +9 -0
- package/dist_ts/logger.d.ts +17 -0
- package/dist_ts/logger.js +76 -0
- package/dist_ts/monitoring/classes.metricscache.d.ts +32 -0
- package/dist_ts/monitoring/classes.metricscache.js +63 -0
- package/dist_ts/monitoring/classes.metricsmanager.d.ts +112 -0
- package/dist_ts/monitoring/classes.metricsmanager.js +446 -0
- package/dist_ts/monitoring/index.d.ts +1 -0
- package/dist_ts/monitoring/index.js +2 -0
- package/dist_ts/opsserver/classes.opsserver.d.ts +22 -0
- package/dist_ts/opsserver/classes.opsserver.js +56 -0
- package/dist_ts/opsserver/handlers/admin.handler.d.ts +31 -0
- package/dist_ts/opsserver/handlers/admin.handler.js +180 -0
- package/dist_ts/opsserver/handlers/config.handler.d.ts +9 -0
- package/dist_ts/opsserver/handlers/config.handler.js +67 -0
- package/dist_ts/opsserver/handlers/email-ops.handler.d.ts +12 -0
- package/dist_ts/opsserver/handlers/email-ops.handler.js +219 -0
- package/dist_ts/opsserver/handlers/index.d.ts +7 -0
- package/dist_ts/opsserver/handlers/index.js +8 -0
- package/dist_ts/opsserver/handlers/logs.handler.d.ts +10 -0
- package/dist_ts/opsserver/handlers/logs.handler.js +122 -0
- package/dist_ts/opsserver/handlers/radius.handler.d.ts +8 -0
- package/dist_ts/opsserver/handlers/radius.handler.js +296 -0
- package/dist_ts/opsserver/handlers/security.handler.d.ts +11 -0
- package/dist_ts/opsserver/handlers/security.handler.js +217 -0
- package/dist_ts/opsserver/handlers/stats.handler.d.ts +13 -0
- package/dist_ts/opsserver/handlers/stats.handler.js +366 -0
- package/dist_ts/opsserver/helpers/guards.d.ts +25 -0
- package/dist_ts/opsserver/helpers/guards.js +41 -0
- package/dist_ts/opsserver/index.d.ts +1 -0
- package/dist_ts/opsserver/index.js +2 -0
- package/dist_ts/paths.d.ts +14 -0
- package/dist_ts/paths.js +39 -0
- package/dist_ts/plugins.d.ts +78 -0
- package/dist_ts/plugins.js +112 -0
- package/dist_ts/radius/classes.accounting.manager.d.ts +218 -0
- package/dist_ts/radius/classes.accounting.manager.js +417 -0
- package/dist_ts/radius/classes.radius.server.d.ts +171 -0
- package/dist_ts/radius/classes.radius.server.js +385 -0
- package/dist_ts/radius/classes.vlan.manager.d.ts +128 -0
- package/dist_ts/radius/classes.vlan.manager.js +272 -0
- package/dist_ts/radius/index.d.ts +13 -0
- package/dist_ts/radius/index.js +14 -0
- package/dist_ts/security/classes.contentscanner.d.ts +160 -0
- package/dist_ts/security/classes.contentscanner.js +637 -0
- package/dist_ts/security/classes.ipreputationchecker.d.ts +150 -0
- package/dist_ts/security/classes.ipreputationchecker.js +512 -0
- package/dist_ts/security/classes.securitylogger.d.ts +140 -0
- package/dist_ts/security/classes.securitylogger.js +235 -0
- package/dist_ts/security/index.d.ts +3 -0
- package/dist_ts/security/index.js +4 -0
- package/dist_ts/sms/classes.smsservice.d.ts +15 -0
- package/dist_ts/sms/classes.smsservice.js +72 -0
- package/dist_ts/sms/config/sms.config.d.ts +93 -0
- package/dist_ts/sms/config/sms.config.js +2 -0
- package/dist_ts/sms/config/sms.schema.d.ts +5 -0
- package/dist_ts/sms/config/sms.schema.js +121 -0
- package/dist_ts/sms/index.d.ts +1 -0
- package/dist_ts/sms/index.js +2 -0
- package/dist_ts/storage/classes.storagemanager.d.ts +82 -0
- package/dist_ts/storage/classes.storagemanager.js +344 -0
- package/dist_ts/storage/index.d.ts +1 -0
- package/dist_ts/storage/index.js +3 -0
- package/dist_ts_interfaces/data/auth.d.ts +8 -0
- package/dist_ts_interfaces/data/auth.js +2 -0
- package/dist_ts_interfaces/data/index.d.ts +2 -0
- package/dist_ts_interfaces/data/index.js +3 -0
- package/dist_ts_interfaces/data/stats.d.ts +120 -0
- package/dist_ts_interfaces/data/stats.js +2 -0
- package/{ts_interfaces/index.ts → dist_ts_interfaces/index.d.ts} +1 -5
- package/dist_ts_interfaces/index.js +8 -0
- package/{ts_interfaces/plugins.ts → dist_ts_interfaces/plugins.d.ts} +1 -5
- package/dist_ts_interfaces/plugins.js +4 -0
- package/dist_ts_interfaces/requests/admin.d.ts +31 -0
- package/dist_ts_interfaces/requests/admin.js +3 -0
- package/dist_ts_interfaces/requests/combined.stats.d.ts +24 -0
- package/dist_ts_interfaces/requests/combined.stats.js +2 -0
- package/dist_ts_interfaces/requests/config.d.ts +13 -0
- package/dist_ts_interfaces/requests/config.js +3 -0
- package/dist_ts_interfaces/requests/email-ops.d.ts +139 -0
- package/dist_ts_interfaces/requests/email-ops.js +3 -0
- package/{ts_interfaces/requests/index.ts → dist_ts_interfaces/requests/index.d.ts} +1 -1
- package/dist_ts_interfaces/requests/index.js +8 -0
- package/dist_ts_interfaces/requests/logs.d.ts +34 -0
- package/dist_ts_interfaces/requests/logs.js +4 -0
- package/dist_ts_interfaces/requests/radius.d.ts +268 -0
- package/dist_ts_interfaces/requests/radius.js +3 -0
- package/dist_ts_interfaces/requests/stats.d.ts +131 -0
- package/dist_ts_interfaces/requests/stats.js +4 -0
- package/dist_ts_web/00_commitinfo_data.d.ts +8 -0
- package/dist_ts_web/00_commitinfo_data.js +9 -0
- package/dist_ts_web/appstate.d.ts +96 -0
- package/dist_ts_web/appstate.js +587 -0
- package/dist_ts_web/elements/index.d.ts +8 -0
- package/dist_ts_web/elements/index.js +9 -0
- package/dist_ts_web/elements/ops-dashboard.d.ts +23 -0
- package/dist_ts_web/elements/ops-dashboard.js +271 -0
- package/dist_ts_web/elements/ops-view-config.d.ts +17 -0
- package/dist_ts_web/elements/ops-view-config.js +414 -0
- package/dist_ts_web/elements/ops-view-emails.d.ts +44 -0
- package/dist_ts_web/elements/ops-view-emails.js +880 -0
- package/dist_ts_web/elements/ops-view-logs.d.ts +13 -0
- package/dist_ts_web/elements/ops-view-logs.js +249 -0
- package/dist_ts_web/elements/ops-view-network.d.ts +65 -0
- package/dist_ts_web/elements/ops-view-network.js +579 -0
- package/dist_ts_web/elements/ops-view-overview.d.ts +14 -0
- package/dist_ts_web/elements/ops-view-overview.js +344 -0
- package/dist_ts_web/elements/ops-view-security.d.ts +21 -0
- package/dist_ts_web/elements/ops-view-security.js +568 -0
- package/dist_ts_web/elements/shared/css.d.ts +1 -0
- package/dist_ts_web/elements/shared/css.js +10 -0
- package/dist_ts_web/elements/shared/index.d.ts +2 -0
- package/dist_ts_web/elements/shared/index.js +3 -0
- package/dist_ts_web/elements/shared/ops-sectionheading.d.ts +5 -0
- package/dist_ts_web/elements/shared/ops-sectionheading.js +82 -0
- package/dist_ts_web/index.d.ts +1 -0
- package/dist_ts_web/index.js +10 -0
- package/dist_ts_web/plugins.d.ts +4 -0
- package/dist_ts_web/plugins.js +7 -0
- package/dist_ts_web/router.d.ts +25 -0
- package/dist_ts_web/router.js +165 -0
- package/package.json +14 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/.dockerignore +0 -1
- package/.gitea/workflows/docker_nottags.yaml +0 -71
- package/.gitea/workflows/docker_tags.yaml +0 -106
- package/.playwright-mcp/dcrouter-scrollbar-issue.png +0 -0
- package/.playwright-mcp/page-2026-02-01T23-10-23-737Z.png +0 -0
- package/.playwright-mcp/page-2026-02-01T23-11-19-449Z.png +0 -0
- package/.playwright-mcp/page-2026-02-01T23-12-03-126Z.png +0 -0
- package/.playwright-mcp/page-2026-02-01T23-12-15-576Z.png +0 -0
- package/.vscode/launch.json +0 -11
- package/.vscode/settings.json +0 -26
- package/Dockerfile +0 -46
- package/changelog.md +0 -350
- package/cli.child.js +0 -4
- package/cli.child.ts +0 -4
- package/cli.ts.js +0 -5
- package/html/index.html +0 -121
- package/test/readme.md +0 -443
- package/test/test.config.md +0 -175
- package/test/test.contentscanner.ts +0 -265
- package/test/test.dcrouter.email.ts +0 -159
- package/test/test.dns-server-config.ts +0 -140
- package/test/test.dns-socket-handler.ts +0 -148
- package/test/test.errors.ts +0 -274
- package/test/test.ipreputationchecker.ts +0 -179
- package/test/test.jwt-auth.ts +0 -131
- package/test/test.opsserver-api.ts +0 -84
- package/test/test.protected-endpoint.ts +0 -120
- package/test/test.storagemanager.ts +0 -289
- package/test_watch/devserver.ts +0 -35
- package/ts_interfaces/data/auth.ts +0 -8
- package/ts_interfaces/data/index.ts +0 -2
- package/ts_interfaces/data/stats.ts +0 -131
- package/ts_interfaces/readme.md +0 -205
- package/ts_interfaces/requests/admin.ts +0 -46
- package/ts_interfaces/requests/combined.stats.ts +0 -25
- package/ts_interfaces/requests/config.ts +0 -18
- package/ts_interfaces/requests/email-ops.ts +0 -239
- package/ts_interfaces/requests/logs.ts +0 -44
- package/ts_interfaces/requests/radius.ts +0 -329
- package/ts_interfaces/requests/stats.ts +0 -162
- package/ts_interfaces/tspublish.json +0 -3
- package/tsconfig.json +0 -12
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
export interface IServerStats {
|
|
2
|
-
uptime: number;
|
|
3
|
-
startTime: number;
|
|
4
|
-
memoryUsage: {
|
|
5
|
-
heapUsed: number;
|
|
6
|
-
heapTotal: number;
|
|
7
|
-
external: number;
|
|
8
|
-
rss: number;
|
|
9
|
-
// SmartMetrics memory data
|
|
10
|
-
maxMemoryMB?: number;
|
|
11
|
-
actualUsageBytes?: number;
|
|
12
|
-
actualUsagePercentage?: number;
|
|
13
|
-
};
|
|
14
|
-
cpuUsage: {
|
|
15
|
-
user: number;
|
|
16
|
-
system: number;
|
|
17
|
-
};
|
|
18
|
-
activeConnections: number;
|
|
19
|
-
totalConnections: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface IEmailStats {
|
|
23
|
-
sent: number;
|
|
24
|
-
received: number;
|
|
25
|
-
bounced: number;
|
|
26
|
-
queued: number;
|
|
27
|
-
failed: number;
|
|
28
|
-
averageDeliveryTime: number;
|
|
29
|
-
deliveryRate: number;
|
|
30
|
-
bounceRate: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface IDnsStats {
|
|
34
|
-
totalQueries: number;
|
|
35
|
-
cacheHits: number;
|
|
36
|
-
cacheMisses: number;
|
|
37
|
-
cacheHitRate: number;
|
|
38
|
-
activeDomains: number;
|
|
39
|
-
averageResponseTime: number;
|
|
40
|
-
queryTypes: {
|
|
41
|
-
[key: string]: number;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface IRateLimitInfo {
|
|
46
|
-
domain: string;
|
|
47
|
-
currentRate: number;
|
|
48
|
-
limit: number;
|
|
49
|
-
remaining: number;
|
|
50
|
-
resetTime: number;
|
|
51
|
-
blocked: boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface ISecurityMetrics {
|
|
55
|
-
blockedIPs: string[];
|
|
56
|
-
reputationScores: {
|
|
57
|
-
[domain: string]: number;
|
|
58
|
-
};
|
|
59
|
-
spamDetected: number;
|
|
60
|
-
malwareDetected: number;
|
|
61
|
-
phishingDetected: number;
|
|
62
|
-
authenticationFailures: number;
|
|
63
|
-
suspiciousActivities: number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ILogEntry {
|
|
67
|
-
timestamp: number;
|
|
68
|
-
level: 'debug' | 'info' | 'warn' | 'error';
|
|
69
|
-
category: 'smtp' | 'dns' | 'security' | 'system' | 'email';
|
|
70
|
-
message: string;
|
|
71
|
-
metadata?: any;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface IConnectionInfo {
|
|
75
|
-
id: string;
|
|
76
|
-
remoteAddress: string;
|
|
77
|
-
localAddress: string;
|
|
78
|
-
startTime: number;
|
|
79
|
-
protocol: 'smtp' | 'smtps' | 'http' | 'https';
|
|
80
|
-
state: 'connecting' | 'connected' | 'authenticated' | 'transmitting' | 'closing';
|
|
81
|
-
bytesReceived: number;
|
|
82
|
-
bytesSent: number;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface IQueueStatus {
|
|
86
|
-
name: string;
|
|
87
|
-
size: number;
|
|
88
|
-
processing: number;
|
|
89
|
-
failed: number;
|
|
90
|
-
retrying: number;
|
|
91
|
-
averageProcessingTime: number;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface IHealthStatus {
|
|
95
|
-
healthy: boolean;
|
|
96
|
-
uptime: number;
|
|
97
|
-
services: {
|
|
98
|
-
[service: string]: {
|
|
99
|
-
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
100
|
-
message?: string;
|
|
101
|
-
lastCheck: number;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
version?: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface INetworkMetrics {
|
|
108
|
-
totalBandwidth: {
|
|
109
|
-
in: number;
|
|
110
|
-
out: number;
|
|
111
|
-
};
|
|
112
|
-
activeConnections: number;
|
|
113
|
-
connectionDetails: IConnectionDetails[];
|
|
114
|
-
topEndpoints: Array<{
|
|
115
|
-
endpoint: string;
|
|
116
|
-
requests: number;
|
|
117
|
-
bandwidth: {
|
|
118
|
-
in: number;
|
|
119
|
-
out: number;
|
|
120
|
-
};
|
|
121
|
-
}>;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface IConnectionDetails {
|
|
125
|
-
remoteAddress: string;
|
|
126
|
-
protocol: 'http' | 'https' | 'smtp' | 'smtps';
|
|
127
|
-
state: 'connecting' | 'connected' | 'established' | 'closing';
|
|
128
|
-
startTime: number;
|
|
129
|
-
bytesIn: number;
|
|
130
|
-
bytesOut: number;
|
|
131
|
-
}
|
package/ts_interfaces/readme.md
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
# @serve.zone/dcrouter-interfaces
|
|
2
|
-
|
|
3
|
-
TypeScript interfaces and type definitions for the DcRouter OpsServer API. 📡
|
|
4
|
-
|
|
5
|
-
This module provides strongly-typed interfaces for communicating with the DcRouter OpsServer via [TypedRequest](https://code.foss.global/api.global/typedrequest). Use these interfaces for type-safe API interactions in your frontend applications or integration code.
|
|
6
|
-
|
|
7
|
-
## Issue Reporting and Security
|
|
8
|
-
|
|
9
|
-
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pnpm add @serve.zone/dcrouter-interfaces
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Or import directly from the main package:
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
import { data, requests } from '@serve.zone/dcrouter/interfaces';
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import { data, requests } from '@serve.zone/dcrouter-interfaces';
|
|
27
|
-
|
|
28
|
-
// Use data interfaces for type definitions
|
|
29
|
-
const identity: data.IIdentity = {
|
|
30
|
-
jwt: 'your-jwt-token',
|
|
31
|
-
userId: 'user-123',
|
|
32
|
-
name: 'Admin User',
|
|
33
|
-
expiresAt: Date.now() + 3600000,
|
|
34
|
-
role: 'admin'
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Use request interfaces for API calls
|
|
38
|
-
import * as typedrequest from '@api.global/typedrequest';
|
|
39
|
-
|
|
40
|
-
const statsClient = new typedrequest.TypedRequest<requests.IReq_GetServerStatistics>(
|
|
41
|
-
'https://your-dcrouter:3000/typedrequest',
|
|
42
|
-
'getServerStatistics'
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
const stats = await statsClient.fire({
|
|
46
|
-
identity,
|
|
47
|
-
includeHistory: true,
|
|
48
|
-
timeRange: '24h'
|
|
49
|
-
});
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Module Structure
|
|
53
|
-
|
|
54
|
-
### Data Interfaces (`data`)
|
|
55
|
-
|
|
56
|
-
Core data types used throughout the DcRouter system:
|
|
57
|
-
|
|
58
|
-
#### `IIdentity`
|
|
59
|
-
Authentication identity for API requests:
|
|
60
|
-
```typescript
|
|
61
|
-
interface IIdentity {
|
|
62
|
-
jwt: string; // JWT token
|
|
63
|
-
userId: string; // Unique user ID
|
|
64
|
-
name: string; // Display name
|
|
65
|
-
expiresAt: number; // Token expiration timestamp
|
|
66
|
-
role?: string; // User role (e.g., 'admin')
|
|
67
|
-
type?: string; // Identity type
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
#### Statistics Interfaces
|
|
72
|
-
| Interface | Description |
|
|
73
|
-
|-----------|-------------|
|
|
74
|
-
| `IServerStats` | Uptime, memory, CPU, connection counts |
|
|
75
|
-
| `IEmailStats` | Sent/received/bounced/queued/failed, delivery & bounce rates |
|
|
76
|
-
| `IDnsStats` | Total queries, cache hits/misses, query types |
|
|
77
|
-
| `IRateLimitInfo` | Domain rate limit status (current rate, limit, remaining) |
|
|
78
|
-
| `ISecurityMetrics` | Blocked IPs, spam/malware/phishing counts |
|
|
79
|
-
| `IConnectionInfo` | Connection ID, remote address, protocol, state, bytes |
|
|
80
|
-
| `IQueueStatus` | Queue name, size, processing/failed/retrying counts |
|
|
81
|
-
| `IHealthStatus` | Healthy flag, uptime, per-service status map |
|
|
82
|
-
| `INetworkMetrics` | Bandwidth, connection counts, top endpoints |
|
|
83
|
-
| `ILogEntry` | Timestamp, level, category, message, metadata |
|
|
84
|
-
|
|
85
|
-
### Request Interfaces (`requests`)
|
|
86
|
-
|
|
87
|
-
TypedRequest interfaces for the OpsServer API, organized by domain:
|
|
88
|
-
|
|
89
|
-
#### 🔐 Authentication
|
|
90
|
-
| Interface | Method | Description |
|
|
91
|
-
|-----------|--------|-------------|
|
|
92
|
-
| `IReq_AdminLoginWithUsernameAndPassword` | `adminLoginWithUsernameAndPassword` | Authenticate as admin |
|
|
93
|
-
| `IReq_AdminLogout` | `adminLogout` | End admin session |
|
|
94
|
-
| `IReq_VerifyIdentity` | `verifyIdentity` | Verify JWT token validity |
|
|
95
|
-
|
|
96
|
-
#### 📊 Statistics
|
|
97
|
-
| Interface | Method | Description |
|
|
98
|
-
|-----------|--------|-------------|
|
|
99
|
-
| `IReq_GetServerStatistics` | `getServerStatistics` | Overall server stats |
|
|
100
|
-
| `IReq_GetEmailStatistics` | `getEmailStatistics` | Email throughput metrics |
|
|
101
|
-
| `IReq_GetDnsStatistics` | `getDnsStatistics` | DNS query stats |
|
|
102
|
-
| `IReq_GetRateLimitStatus` | `getRateLimitStatus` | Rate limit status |
|
|
103
|
-
| `IReq_GetSecurityMetrics` | `getSecurityMetrics` | Security event metrics |
|
|
104
|
-
| `IReq_GetActiveConnections` | `getActiveConnections` | Active connection list |
|
|
105
|
-
| `IReq_GetQueueStatus` | `getQueueStatus` | Email queue status |
|
|
106
|
-
| `IReq_GetHealthStatus` | `getHealthStatus` | System health check |
|
|
107
|
-
| `IReq_GetCombinedMetrics` | `getCombinedMetrics` | All metrics in one request |
|
|
108
|
-
|
|
109
|
-
#### ⚙️ Configuration
|
|
110
|
-
| Interface | Method | Description |
|
|
111
|
-
|-----------|--------|-------------|
|
|
112
|
-
| `IReq_GetConfiguration` | `getConfiguration` | Current config (read-only) |
|
|
113
|
-
|
|
114
|
-
#### 📜 Logs
|
|
115
|
-
| Interface | Method | Description |
|
|
116
|
-
|-----------|--------|-------------|
|
|
117
|
-
| `IReq_GetRecentLogs` | `getLogs` | Retrieve system logs |
|
|
118
|
-
| `IReq_GetLogStream` | `getLogStream` | Stream live logs |
|
|
119
|
-
|
|
120
|
-
#### 📧 Email Operations
|
|
121
|
-
| Interface | Method | Description |
|
|
122
|
-
|-----------|--------|-------------|
|
|
123
|
-
| `IReq_GetQueuedEmails` | `getQueuedEmails` | List queued emails |
|
|
124
|
-
| `IReq_GetSentEmails` | `getSentEmails` | List delivered emails |
|
|
125
|
-
| `IReq_GetFailedEmails` | `getFailedEmails` | List failed emails |
|
|
126
|
-
| `IReq_ResendEmail` | `resendEmail` | Re-queue a failed email |
|
|
127
|
-
| `IReq_GetSecurityIncidents` | `getSecurityIncidents` | Security events |
|
|
128
|
-
| `IReq_GetBounceRecords` | `getBounceRecords` | Bounce records |
|
|
129
|
-
| `IReq_RemoveFromSuppressionList` | `removeFromSuppressionList` | Unsuppress an address |
|
|
130
|
-
|
|
131
|
-
#### 📡 RADIUS
|
|
132
|
-
| Interface | Method | Description |
|
|
133
|
-
|-----------|--------|-------------|
|
|
134
|
-
| `IReq_GetRadiusClients` | `getRadiusClients` | List NAS clients |
|
|
135
|
-
| `IReq_SetRadiusClient` | `setRadiusClient` | Add/update a NAS client |
|
|
136
|
-
| `IReq_RemoveRadiusClient` | `removeRadiusClient` | Remove a NAS client |
|
|
137
|
-
| `IReq_GetVlanMappings` | `getVlanMappings` | List VLAN mappings |
|
|
138
|
-
| `IReq_SetVlanMapping` | `setVlanMapping` | Add/update VLAN mapping |
|
|
139
|
-
| `IReq_RemoveVlanMapping` | `removeVlanMapping` | Remove VLAN mapping |
|
|
140
|
-
| `IReq_TestVlanAssignment` | `testVlanAssignment` | Test what VLAN a MAC gets |
|
|
141
|
-
| `IReq_GetRadiusSessions` | `getRadiusSessions` | List active sessions |
|
|
142
|
-
| `IReq_DisconnectRadiusSession` | `disconnectRadiusSession` | Force disconnect |
|
|
143
|
-
| `IReq_GetRadiusStatistics` | `getRadiusStatistics` | RADIUS stats |
|
|
144
|
-
| `IReq_GetRadiusAccountingSummary` | `getRadiusAccountingSummary` | Accounting summary |
|
|
145
|
-
|
|
146
|
-
## Example: Full API Integration
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
import * as typedrequest from '@api.global/typedrequest';
|
|
150
|
-
import { data, requests } from '@serve.zone/dcrouter-interfaces';
|
|
151
|
-
|
|
152
|
-
// 1. Login
|
|
153
|
-
const loginClient = new typedrequest.TypedRequest<requests.IReq_AdminLoginWithUsernameAndPassword>(
|
|
154
|
-
'https://your-dcrouter:3000/typedrequest',
|
|
155
|
-
'adminLogin'
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
const loginResponse = await loginClient.fire({
|
|
159
|
-
username: 'admin',
|
|
160
|
-
password: 'your-password'
|
|
161
|
-
});
|
|
162
|
-
const identity = loginResponse.identity;
|
|
163
|
-
|
|
164
|
-
// 2. Fetch combined metrics
|
|
165
|
-
const metricsClient = new typedrequest.TypedRequest<requests.IReq_GetCombinedMetrics>(
|
|
166
|
-
'https://your-dcrouter:3000/typedrequest',
|
|
167
|
-
'getCombinedMetrics'
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
const metrics = await metricsClient.fire({ identity });
|
|
171
|
-
console.log('Server:', metrics.serverStats);
|
|
172
|
-
console.log('Email:', metrics.emailStats);
|
|
173
|
-
console.log('DNS:', metrics.dnsStats);
|
|
174
|
-
console.log('Security:', metrics.securityMetrics);
|
|
175
|
-
|
|
176
|
-
// 3. Check email queues
|
|
177
|
-
const queueClient = new typedrequest.TypedRequest<requests.IReq_GetQueuedEmails>(
|
|
178
|
-
'https://your-dcrouter:3000/typedrequest',
|
|
179
|
-
'getQueuedEmails'
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
const queued = await queueClient.fire({ identity });
|
|
183
|
-
console.log('Queued emails:', queued.emails.length);
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## License and Legal Information
|
|
187
|
-
|
|
188
|
-
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](../LICENSE) file.
|
|
189
|
-
|
|
190
|
-
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
191
|
-
|
|
192
|
-
### Trademarks
|
|
193
|
-
|
|
194
|
-
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
|
195
|
-
|
|
196
|
-
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
|
197
|
-
|
|
198
|
-
### Company Information
|
|
199
|
-
|
|
200
|
-
Task Venture Capital GmbH
|
|
201
|
-
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
202
|
-
|
|
203
|
-
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
|
204
|
-
|
|
205
|
-
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as plugins from '../plugins.js';
|
|
2
|
-
import * as authInterfaces from '../data/auth.js';
|
|
3
|
-
|
|
4
|
-
// Admin Login
|
|
5
|
-
export interface IReq_AdminLoginWithUsernameAndPassword extends plugins.typedrequestInterfaces.implementsTR<
|
|
6
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
7
|
-
IReq_AdminLoginWithUsernameAndPassword
|
|
8
|
-
> {
|
|
9
|
-
method: 'adminLoginWithUsernameAndPassword';
|
|
10
|
-
request: {
|
|
11
|
-
username: string;
|
|
12
|
-
password: string;
|
|
13
|
-
};
|
|
14
|
-
response: {
|
|
15
|
-
identity?: authInterfaces.IIdentity;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Admin Logout
|
|
20
|
-
export interface IReq_AdminLogout extends plugins.typedrequestInterfaces.implementsTR<
|
|
21
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
22
|
-
IReq_AdminLogout
|
|
23
|
-
> {
|
|
24
|
-
method: 'adminLogout';
|
|
25
|
-
request: {
|
|
26
|
-
identity: authInterfaces.IIdentity;
|
|
27
|
-
};
|
|
28
|
-
response: {
|
|
29
|
-
success: boolean;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Verify Identity
|
|
34
|
-
export interface IReq_VerifyIdentity extends plugins.typedrequestInterfaces.implementsTR<
|
|
35
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
36
|
-
IReq_VerifyIdentity
|
|
37
|
-
> {
|
|
38
|
-
method: 'verifyIdentity';
|
|
39
|
-
request: {
|
|
40
|
-
identity: authInterfaces.IIdentity;
|
|
41
|
-
};
|
|
42
|
-
response: {
|
|
43
|
-
valid: boolean;
|
|
44
|
-
identity?: authInterfaces.IIdentity;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type * as data from '../data/index.js';
|
|
2
|
-
|
|
3
|
-
export interface IReq_GetCombinedMetrics {
|
|
4
|
-
method: 'getCombinedMetrics';
|
|
5
|
-
request: {
|
|
6
|
-
identity: data.IIdentity;
|
|
7
|
-
sections?: {
|
|
8
|
-
server?: boolean;
|
|
9
|
-
email?: boolean;
|
|
10
|
-
dns?: boolean;
|
|
11
|
-
security?: boolean;
|
|
12
|
-
network?: boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
response: {
|
|
16
|
-
metrics: {
|
|
17
|
-
server?: data.IServerStats;
|
|
18
|
-
email?: data.IEmailStats;
|
|
19
|
-
dns?: data.IDnsStats;
|
|
20
|
-
security?: data.ISecurityMetrics;
|
|
21
|
-
network?: data.INetworkMetrics;
|
|
22
|
-
};
|
|
23
|
-
timestamp: number;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as plugins from '../plugins.js';
|
|
2
|
-
import * as authInterfaces from '../data/auth.js';
|
|
3
|
-
|
|
4
|
-
// Get Configuration (read-only)
|
|
5
|
-
export interface IReq_GetConfiguration extends plugins.typedrequestInterfaces.implementsTR<
|
|
6
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
7
|
-
IReq_GetConfiguration
|
|
8
|
-
> {
|
|
9
|
-
method: 'getConfiguration';
|
|
10
|
-
request: {
|
|
11
|
-
identity?: authInterfaces.IIdentity;
|
|
12
|
-
section?: string;
|
|
13
|
-
};
|
|
14
|
-
response: {
|
|
15
|
-
config: any;
|
|
16
|
-
section?: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import * as plugins from '../plugins.js';
|
|
2
|
-
import * as authInterfaces from '../data/auth.js';
|
|
3
|
-
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// Email Queue Item Interface (matches backend IQueueItem)
|
|
6
|
-
// ============================================================================
|
|
7
|
-
export type TEmailQueueStatus = 'pending' | 'processing' | 'delivered' | 'failed' | 'deferred';
|
|
8
|
-
|
|
9
|
-
export interface IEmailQueueItem {
|
|
10
|
-
id: string;
|
|
11
|
-
processingMode: 'forward' | 'mta' | 'process';
|
|
12
|
-
status: TEmailQueueStatus;
|
|
13
|
-
attempts: number;
|
|
14
|
-
nextAttempt: number; // timestamp
|
|
15
|
-
lastError?: string;
|
|
16
|
-
createdAt: number; // timestamp
|
|
17
|
-
updatedAt: number; // timestamp
|
|
18
|
-
deliveredAt?: number; // timestamp
|
|
19
|
-
// Email details extracted from processingResult
|
|
20
|
-
from?: string;
|
|
21
|
-
to?: string[];
|
|
22
|
-
subject?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// Bounce Record Interface (matches backend BounceRecord)
|
|
27
|
-
// ============================================================================
|
|
28
|
-
export type TBounceType =
|
|
29
|
-
| 'invalid_recipient'
|
|
30
|
-
| 'domain_not_found'
|
|
31
|
-
| 'mailbox_full'
|
|
32
|
-
| 'mailbox_inactive'
|
|
33
|
-
| 'blocked'
|
|
34
|
-
| 'spam_related'
|
|
35
|
-
| 'policy_related'
|
|
36
|
-
| 'server_unavailable'
|
|
37
|
-
| 'temporary_failure'
|
|
38
|
-
| 'quota_exceeded'
|
|
39
|
-
| 'network_error'
|
|
40
|
-
| 'timeout'
|
|
41
|
-
| 'auto_response'
|
|
42
|
-
| 'challenge_response'
|
|
43
|
-
| 'unknown';
|
|
44
|
-
|
|
45
|
-
export type TBounceCategory = 'hard' | 'soft' | 'auto_response' | 'unknown';
|
|
46
|
-
|
|
47
|
-
export interface IBounceRecord {
|
|
48
|
-
id: string;
|
|
49
|
-
originalEmailId?: string;
|
|
50
|
-
recipient: string;
|
|
51
|
-
sender: string;
|
|
52
|
-
domain: string;
|
|
53
|
-
subject?: string;
|
|
54
|
-
bounceType: TBounceType;
|
|
55
|
-
bounceCategory: TBounceCategory;
|
|
56
|
-
timestamp: number;
|
|
57
|
-
smtpResponse?: string;
|
|
58
|
-
diagnosticCode?: string;
|
|
59
|
-
statusCode?: string;
|
|
60
|
-
processed: boolean;
|
|
61
|
-
retryCount?: number;
|
|
62
|
-
nextRetryTime?: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ============================================================================
|
|
66
|
-
// Security Incident Interface (matches backend ISecurityEvent)
|
|
67
|
-
// ============================================================================
|
|
68
|
-
export type TSecurityLogLevel = 'info' | 'warn' | 'error' | 'critical';
|
|
69
|
-
|
|
70
|
-
export type TSecurityEventType =
|
|
71
|
-
| 'authentication'
|
|
72
|
-
| 'access_control'
|
|
73
|
-
| 'email_validation'
|
|
74
|
-
| 'email_processing'
|
|
75
|
-
| 'email_forwarding'
|
|
76
|
-
| 'email_delivery'
|
|
77
|
-
| 'dkim'
|
|
78
|
-
| 'spf'
|
|
79
|
-
| 'dmarc'
|
|
80
|
-
| 'rate_limit'
|
|
81
|
-
| 'rate_limiting'
|
|
82
|
-
| 'spam'
|
|
83
|
-
| 'malware'
|
|
84
|
-
| 'connection'
|
|
85
|
-
| 'data_exposure'
|
|
86
|
-
| 'configuration'
|
|
87
|
-
| 'ip_reputation'
|
|
88
|
-
| 'rejected_connection';
|
|
89
|
-
|
|
90
|
-
export interface ISecurityIncident {
|
|
91
|
-
timestamp: number;
|
|
92
|
-
level: TSecurityLogLevel;
|
|
93
|
-
type: TSecurityEventType;
|
|
94
|
-
message: string;
|
|
95
|
-
details?: any;
|
|
96
|
-
ipAddress?: string;
|
|
97
|
-
userId?: string;
|
|
98
|
-
sessionId?: string;
|
|
99
|
-
emailId?: string;
|
|
100
|
-
domain?: string;
|
|
101
|
-
action?: string;
|
|
102
|
-
result?: string;
|
|
103
|
-
success?: boolean;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ============================================================================
|
|
107
|
-
// Get Queued Emails Request
|
|
108
|
-
// ============================================================================
|
|
109
|
-
export interface IReq_GetQueuedEmails extends plugins.typedrequestInterfaces.implementsTR<
|
|
110
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
111
|
-
IReq_GetQueuedEmails
|
|
112
|
-
> {
|
|
113
|
-
method: 'getQueuedEmails';
|
|
114
|
-
request: {
|
|
115
|
-
identity?: authInterfaces.IIdentity;
|
|
116
|
-
status?: TEmailQueueStatus;
|
|
117
|
-
limit?: number;
|
|
118
|
-
offset?: number;
|
|
119
|
-
};
|
|
120
|
-
response: {
|
|
121
|
-
items: IEmailQueueItem[];
|
|
122
|
-
total: number;
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// ============================================================================
|
|
127
|
-
// Get Sent Emails Request
|
|
128
|
-
// ============================================================================
|
|
129
|
-
export interface IReq_GetSentEmails extends plugins.typedrequestInterfaces.implementsTR<
|
|
130
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
131
|
-
IReq_GetSentEmails
|
|
132
|
-
> {
|
|
133
|
-
method: 'getSentEmails';
|
|
134
|
-
request: {
|
|
135
|
-
identity?: authInterfaces.IIdentity;
|
|
136
|
-
limit?: number;
|
|
137
|
-
offset?: number;
|
|
138
|
-
};
|
|
139
|
-
response: {
|
|
140
|
-
items: IEmailQueueItem[];
|
|
141
|
-
total: number;
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// ============================================================================
|
|
146
|
-
// Get Failed Emails Request
|
|
147
|
-
// ============================================================================
|
|
148
|
-
export interface IReq_GetFailedEmails extends plugins.typedrequestInterfaces.implementsTR<
|
|
149
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
150
|
-
IReq_GetFailedEmails
|
|
151
|
-
> {
|
|
152
|
-
method: 'getFailedEmails';
|
|
153
|
-
request: {
|
|
154
|
-
identity?: authInterfaces.IIdentity;
|
|
155
|
-
limit?: number;
|
|
156
|
-
offset?: number;
|
|
157
|
-
};
|
|
158
|
-
response: {
|
|
159
|
-
items: IEmailQueueItem[];
|
|
160
|
-
total: number;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// ============================================================================
|
|
165
|
-
// Resend Failed Email Request
|
|
166
|
-
// ============================================================================
|
|
167
|
-
export interface IReq_ResendEmail extends plugins.typedrequestInterfaces.implementsTR<
|
|
168
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
169
|
-
IReq_ResendEmail
|
|
170
|
-
> {
|
|
171
|
-
method: 'resendEmail';
|
|
172
|
-
request: {
|
|
173
|
-
identity?: authInterfaces.IIdentity;
|
|
174
|
-
emailId: string;
|
|
175
|
-
};
|
|
176
|
-
response: {
|
|
177
|
-
success: boolean;
|
|
178
|
-
newQueueId?: string;
|
|
179
|
-
error?: string;
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// ============================================================================
|
|
184
|
-
// Get Security Incidents Request
|
|
185
|
-
// ============================================================================
|
|
186
|
-
export interface IReq_GetSecurityIncidents extends plugins.typedrequestInterfaces.implementsTR<
|
|
187
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
188
|
-
IReq_GetSecurityIncidents
|
|
189
|
-
> {
|
|
190
|
-
method: 'getSecurityIncidents';
|
|
191
|
-
request: {
|
|
192
|
-
identity?: authInterfaces.IIdentity;
|
|
193
|
-
type?: TSecurityEventType;
|
|
194
|
-
level?: TSecurityLogLevel;
|
|
195
|
-
limit?: number;
|
|
196
|
-
};
|
|
197
|
-
response: {
|
|
198
|
-
incidents: ISecurityIncident[];
|
|
199
|
-
total: number;
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// ============================================================================
|
|
204
|
-
// Get Bounce Records Request
|
|
205
|
-
// ============================================================================
|
|
206
|
-
export interface IReq_GetBounceRecords extends plugins.typedrequestInterfaces.implementsTR<
|
|
207
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
208
|
-
IReq_GetBounceRecords
|
|
209
|
-
> {
|
|
210
|
-
method: 'getBounceRecords';
|
|
211
|
-
request: {
|
|
212
|
-
identity?: authInterfaces.IIdentity;
|
|
213
|
-
limit?: number;
|
|
214
|
-
offset?: number;
|
|
215
|
-
};
|
|
216
|
-
response: {
|
|
217
|
-
records: IBounceRecord[];
|
|
218
|
-
suppressionList: string[];
|
|
219
|
-
total: number;
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// ============================================================================
|
|
224
|
-
// Remove from Suppression List Request
|
|
225
|
-
// ============================================================================
|
|
226
|
-
export interface IReq_RemoveFromSuppressionList extends plugins.typedrequestInterfaces.implementsTR<
|
|
227
|
-
plugins.typedrequestInterfaces.ITypedRequest,
|
|
228
|
-
IReq_RemoveFromSuppressionList
|
|
229
|
-
> {
|
|
230
|
-
method: 'removeFromSuppressionList';
|
|
231
|
-
request: {
|
|
232
|
-
identity?: authInterfaces.IIdentity;
|
|
233
|
-
email: string;
|
|
234
|
-
};
|
|
235
|
-
response: {
|
|
236
|
-
success: boolean;
|
|
237
|
-
error?: string;
|
|
238
|
-
};
|
|
239
|
-
}
|