feat(apiclient): add typed, object-oriented API client documentation and interfaces; document builders, resource managers, and new programmatic endpoints
This commit is contained in:
@@ -82,6 +82,14 @@ interface IIdentity {
|
||||
| `INetworkMetrics` | Bandwidth, connection counts, top endpoints |
|
||||
| `ILogEntry` | Timestamp, level, category, message, metadata |
|
||||
|
||||
#### Route Management Interfaces
|
||||
| Interface | Description |
|
||||
|-----------|-------------|
|
||||
| `IMergedRoute` | Combined route: routeConfig, source (hardcoded/programmatic), enabled, overridden |
|
||||
| `IRouteWarning` | Merge warning: disabled-hardcoded, disabled-programmatic, orphaned-override |
|
||||
| `IApiTokenInfo` | Token info: id, name, scopes, createdAt, expiresAt, enabled |
|
||||
| `TApiTokenScope` | Token scopes: `routes:read`, `routes:write`, `config:read`, `tokens:read`, `tokens:manage` |
|
||||
|
||||
#### Remote Ingress Interfaces
|
||||
| Interface | Description |
|
||||
|-----------|-------------|
|
||||
@@ -128,13 +136,29 @@ TypedRequest interfaces for the OpsServer API, organized by domain:
|
||||
#### 📧 Email Operations
|
||||
| Interface | Method | Description |
|
||||
|-----------|--------|-------------|
|
||||
| `IReq_GetQueuedEmails` | `getQueuedEmails` | List queued emails |
|
||||
| `IReq_GetSentEmails` | `getSentEmails` | List delivered emails |
|
||||
| `IReq_GetFailedEmails` | `getFailedEmails` | List failed emails |
|
||||
| `IReq_GetAllEmails` | `getAllEmails` | List all emails |
|
||||
| `IReq_GetEmailDetail` | `getEmailDetail` | Full detail for a specific email |
|
||||
| `IReq_ResendEmail` | `resendEmail` | Re-queue a failed email |
|
||||
| `IReq_GetSecurityIncidents` | `getSecurityIncidents` | Security events |
|
||||
| `IReq_GetBounceRecords` | `getBounceRecords` | Bounce records |
|
||||
| `IReq_RemoveFromSuppressionList` | `removeFromSuppressionList` | Unsuppress an address |
|
||||
|
||||
#### 🛣️ Route Management
|
||||
| Interface | Method | Description |
|
||||
|-----------|--------|-------------|
|
||||
| `IReq_GetMergedRoutes` | `getMergedRoutes` | List all routes (hardcoded + programmatic) |
|
||||
| `IReq_CreateRoute` | `createRoute` | Create a new programmatic route |
|
||||
| `IReq_UpdateRoute` | `updateRoute` | Update a programmatic route |
|
||||
| `IReq_DeleteRoute` | `deleteRoute` | Delete a programmatic route |
|
||||
| `IReq_ToggleRoute` | `toggleRoute` | Enable/disable a programmatic route |
|
||||
| `IReq_SetRouteOverride` | `setRouteOverride` | Override a hardcoded route |
|
||||
| `IReq_RemoveRouteOverride` | `removeRouteOverride` | Remove a route override |
|
||||
|
||||
#### 🔑 API Token Management
|
||||
| Interface | Method | Description |
|
||||
|-----------|--------|-------------|
|
||||
| `IReq_CreateApiToken` | `createApiToken` | Create a new API token |
|
||||
| `IReq_ListApiTokens` | `listApiTokens` | List all tokens |
|
||||
| `IReq_RevokeApiToken` | `revokeApiToken` | Revoke (delete) a token |
|
||||
| `IReq_RollApiToken` | `rollApiToken` | Regenerate token secret |
|
||||
| `IReq_ToggleApiToken` | `toggleApiToken` | Enable/disable a token |
|
||||
|
||||
#### 🔐 Certificates
|
||||
| Interface | Method | Description |
|
||||
@@ -198,6 +222,8 @@ interface ICertificateInfo {
|
||||
|
||||
## Example: Full API Integration
|
||||
|
||||
> 💡 **Tip:** For a higher-level, object-oriented API, use [`@serve.zone/dcrouter-apiclient`](https://www.npmjs.com/package/@serve.zone/dcrouter-apiclient) which wraps these interfaces with resource classes and builder patterns.
|
||||
|
||||
```typescript
|
||||
import * as typedrequest from '@api.global/typedrequest';
|
||||
import { data, requests } from '@serve.zone/dcrouter-interfaces';
|
||||
|
||||
Reference in New Issue
Block a user