Files
dcrouter/ts_interfaces/data/workhoster.ts
T

146 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-04-29 15:18:14 +00:00
import type { IDomain } from './domain.js';
import type { IDnsRecord, TDnsRecordType } from './dns-record.js';
import type { TGatewayClientType } from './route-management.js';
2026-04-29 15:18:14 +00:00
export interface IGatewayCapabilities {
routes: {
read: boolean;
write: boolean;
idempotentSync: boolean;
};
domains: {
read: boolean;
write: boolean;
};
certificates: {
read: boolean;
export: boolean;
forceRenew: boolean;
};
email: {
domains: boolean;
inbound: boolean;
outbound: boolean;
};
remoteIngress: {
enabled: boolean;
};
dns: {
authoritative: boolean;
providerManaged: boolean;
};
http3: {
enabled: boolean;
};
}
export interface IGatewayClientDomain extends IDomain {
2026-04-29 15:18:14 +00:00
capabilities: {
canCreateSubdomains: boolean;
canManageDnsRecords: boolean;
canIssueCertificates: boolean;
canHostEmail: boolean;
};
serviceCount?: number;
managePath?: string;
2026-04-29 15:18:14 +00:00
}
/** @deprecated Use IGatewayClientDomain. */
export type IWorkHosterDomain = IGatewayClientDomain;
export interface IGatewayClientOwnership {
gatewayClientType: TGatewayClientType;
gatewayClientId: string;
appId: string;
hostname: string;
}
/** @deprecated Use IGatewayClientOwnership. */
2026-04-29 15:18:14 +00:00
export interface IWorkAppRouteOwnership {
workHosterType: TGatewayClientType;
2026-04-29 15:18:14 +00:00
workHosterId: string;
workAppId: string;
hostname: string;
}
export interface IGatewayClientRouteSyncResult {
2026-04-29 15:18:14 +00:00
success: boolean;
action?: 'created' | 'updated' | 'deleted' | 'unchanged';
routeId?: string;
message?: string;
}
2026-04-29 16:29:38 +00:00
/** @deprecated Use IGatewayClientRouteSyncResult. */
export type IWorkAppRouteSyncResult = IGatewayClientRouteSyncResult;
export interface IGatewayClientDnsRecord extends Omit<IDnsRecord, 'type'> {
type: TDnsRecordType | 'MISSING';
domainName?: string;
status: 'active' | 'missing';
gatewayClientType: TGatewayClientType;
gatewayClientId: string;
appId: string;
hostname: string;
routeId?: string;
serviceName?: string;
managePath?: string;
}
export interface IGatewayClientMailOwnership {
gatewayClientType: TGatewayClientType;
gatewayClientId: string;
appId: string;
}
2026-04-29 16:29:38 +00:00
export interface IWorkAppMailOwnership {
workHosterType: TGatewayClientType;
2026-04-29 16:29:38 +00:00
workHosterId: string;
workAppId: string;
}
export interface IWorkAppMailInboundRoute {
enabled: boolean;
targetHost: string;
targetPort: number;
preserveHeaders?: boolean;
addHeaders?: Record<string, string>;
}
export interface IWorkAppMailIdentity {
id: string;
externalKey: string;
ownership: IWorkAppMailOwnership;
address: string;
localPart: string;
domain: string;
enabled: boolean;
displayName?: string;
inbound?: IWorkAppMailInboundRoute;
smtp: {
enabled: boolean;
username: string;
};
createdAt: number;
updatedAt: number;
createdBy: string;
}
export interface IWorkAppMailCredentials {
username: string;
password: string;
host?: string;
ports?: {
smtp?: number;
submission?: number;
smtps?: number;
};
}
export interface IWorkAppMailIdentitySyncResult {
success: boolean;
action?: 'created' | 'updated' | 'deleted' | 'unchanged';
identity?: IWorkAppMailIdentity;
smtpCredentials?: IWorkAppMailCredentials;
message?: string;
}