fix(docs): refresh package readmes with clearer runtime, API client, interfaces, migrations, and dashboard guidance

This commit is contained in:
2026-04-17 13:43:13 +00:00
parent 1f25ca4095
commit c5ca95b6f5
9 changed files with 321 additions and 430 deletions

View File

@@ -1,8 +1,6 @@
# @serve.zone/dcrouter-interfaces
Shared TypeScript request and data interfaces for dcrouter's OpsServer API. 📡
This package is the contract layer for typed clients, frontend code, tests, or automation that talks to a running dcrouter instance through TypedRequest.
Shared TypeScript contracts for dcrouter's TypedRequest API. Use this package when you want compile-time request/response types and shared data models without pulling in the higher-level client SDK.
## Issue Reporting and Security
@@ -14,7 +12,7 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
pnpm add @serve.zone/dcrouter-interfaces
```
Or consume the same interfaces through the main package:
You can also consume the same contracts through the main package subpath:
```typescript
import { data, requests } from '@serve.zone/dcrouter/interfaces';
@@ -22,17 +20,28 @@ import { data, requests } from '@serve.zone/dcrouter/interfaces';
## What It Exports
The package exposes two namespaces from `index.ts`:
| Export | Purpose |
| --- | --- |
| `data` | Shared runtime-shaped types such as route data, auth identity, stats, domains, certificates, VPN, DNS, and email-domain data |
| `requests` | TypedRequest request and response contracts for every OpsServer endpoint |
| `data` | Shared runtime-shaped data such as identities, routes, stats, domains, DNS records, VPN data, remote ingress data, and email-domain data |
| `requests` | TypedRequest request/response contracts for OpsServer endpoints |
| `typedrequestInterfaces` | Re-exported helper types from `@api.global/typedrequest-interfaces` |
## Example
## API Surface Covered
| Domain | Examples |
| --- | --- |
| Auth | login, logout, identity verification |
| Routes | list merged routes, create, update, delete, toggle |
| Access | API tokens, source profiles, target profiles, network targets, users |
| DNS and domains | providers, domains, DNS records, ACME config |
| Email | email operations and email-domain management |
| Edge services | remote ingress, VPN, RADIUS |
| Observability | stats, health, logs, configuration |
## Quick Example
```typescript
import * as typedrequest from '@api.global/typedrequest';
import { TypedRequest } from '@api.global/typedrequest';
import { data, requests } from '@serve.zone/dcrouter-interfaces';
const identity: data.IIdentity = {
@@ -41,9 +50,10 @@ const identity: data.IIdentity = {
name: 'Admin',
expiresAt: Date.now() + 60_000,
role: 'admin',
type: 'user',
};
const request = new typedrequest.TypedRequest<requests.IReq_GetMergedRoutes>(
const request = new TypedRequest<requests.IReq_GetMergedRoutes>(
'https://dcrouter.example.com/typedrequest',
'getMergedRoutes',
);
@@ -55,42 +65,17 @@ for (const route of response.routes) {
}
```
## API Domains Covered
| Domain | Examples |
| --- | --- |
| Auth | admin login, logout, identity verification |
| Routes | merged routes, create, update, delete, toggle |
| Access | API tokens, source profiles, target profiles, network targets |
| DNS and domains | providers, domains, DNS records |
| Certificates | overview, reprovision, import, export, delete, ACME config |
| Email | email operations, email domains |
| Remote ingress | edge registrations, status, connection tokens |
| VPN | clients, status, telemetry, lifecycle |
| RADIUS | clients, VLANs, sessions, accounting |
| Observability | stats, logs, health, configuration |
## Notable Data Types
| Type | Description |
| --- | --- |
| `data.IMergedRoute` | Route entry returned by route management, including `origin`, `enabled`, and optional `systemKey` |
| `data.IDcRouterRouteConfig` | dcrouter-flavored route config used across the stack |
| `data.IRouteMetadata` | Reference metadata connecting routes to source profiles or network targets |
| `data.IIdentity` | Admin identity used for authenticated requests |
| `data.IApiTokenInfo` | Public token metadata without the secret |
## When To Use This Package
- Use it in custom dashboards or CLIs that call TypedRequest directly.
- Use it in tests that need strongly typed request payloads or response assertions.
- Use it when you want the API contract without pulling in the OO client.
- Use it in tests that need strong request/response typing.
- Use it in custom CLIs or dashboards that call TypedRequest directly.
- Use it in shared code where both client and server need the same data shapes.
If you want a higher-level client with managers and resource classes, use `@serve.zone/dcrouter-apiclient` instead.
If you want managers, builders, and resource classes instead of raw contracts, use `@serve.zone/dcrouter-apiclient`.
## License and Legal Information
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](../license) file.
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](../license) file.
**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.