feat: add workapp mail sync API
This commit is contained in:
@@ -54,3 +54,55 @@ export interface IWorkAppRouteSyncResult {
|
||||
routeId?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface IWorkAppMailOwnership {
|
||||
workHosterType: 'onebox' | 'cloudly' | 'custom';
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ import * as plugins from '../plugins.js';
|
||||
import type * as authInterfaces from '../data/auth.js';
|
||||
import type {
|
||||
IGatewayCapabilities,
|
||||
IWorkAppMailIdentity,
|
||||
IWorkAppMailIdentitySyncResult,
|
||||
IWorkAppMailInboundRoute,
|
||||
IWorkAppMailOwnership,
|
||||
IWorkAppRouteOwnership,
|
||||
IWorkAppRouteSyncResult,
|
||||
IWorkHosterDomain,
|
||||
@@ -51,3 +55,39 @@ export interface IReq_SyncWorkAppRoute extends plugins.typedrequestInterfaces.im
|
||||
};
|
||||
response: IWorkAppRouteSyncResult;
|
||||
}
|
||||
|
||||
export interface IReq_GetWorkAppMailIdentities extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetWorkAppMailIdentities
|
||||
> {
|
||||
method: 'getWorkAppMailIdentities';
|
||||
request: {
|
||||
identity?: authInterfaces.IIdentity;
|
||||
apiToken?: string;
|
||||
ownership?: Partial<IWorkAppMailOwnership>;
|
||||
};
|
||||
response: {
|
||||
identities: IWorkAppMailIdentity[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_SyncWorkAppMailIdentity extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_SyncWorkAppMailIdentity
|
||||
> {
|
||||
method: 'syncWorkAppMailIdentity';
|
||||
request: {
|
||||
identity?: authInterfaces.IIdentity;
|
||||
apiToken?: string;
|
||||
ownership: IWorkAppMailOwnership;
|
||||
localPart: string;
|
||||
domain: string;
|
||||
displayName?: string;
|
||||
inbound?: IWorkAppMailInboundRoute;
|
||||
enabled?: boolean;
|
||||
smtpEnabled?: boolean;
|
||||
resetSmtpPassword?: boolean;
|
||||
delete?: boolean;
|
||||
};
|
||||
response: IWorkAppMailIdentitySyncResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user