import type * as plugins from '../plugins.js'; import type { ICoreMailEnvelope, ICoreMailInboundDeliveryPage, ICoreMailDownloadGrant, ICoreMailGatewayMessageDescriptor, ICoreMailGatewayOutboundStatus, ICoreMailInboundDelivery, ICoreMailOutboundMessageDescriptor, ICoreMailRecipientResolution, ICoreMailReconciliationStatus, ICoreMailReplicaIdentity, ICoreMailSubmission, ICoreMailUploadGrant, TCoreMailInboundAckOutcome, TCoreMailSha256, TCoreMailWorkloadOperation } from '../data/coremail.js'; import type { IMailConnectionInfo } from '../data/mail.js'; export interface IReq_CoreMailAuthenticateWorkload extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailAuthenticateWorkload'; request: { bindingId: string; credentialId: string; credentialVersion: number; credentialSecret: string; }; response: { authenticated: true; credentialId: string; credentialVersion: number; bindingState: 'active' | 'draining'; capabilities: Array<'outbound' | 'inbound'>; allowedOperations: TCoreMailWorkloadOperation[]; /** Authenticated CoreMail HTTPS origin for path-only transfer grants. */ coreMailTransferOrigin: string; }; } export interface IReq_CoreMailPrepareOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailPrepareOutboundSubmission'; request: { /** Required replay key. Authority is added by the authenticated server session. */ idempotencyKey: string; message: ICoreMailOutboundMessageDescriptor; }; response: { submission: ICoreMailSubmission; replayed: boolean; }; } export interface IReq_CoreMailPrepareOutboundPartUpload extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailPrepareOutboundPartUpload'; request: { submissionId: string; partId: string; }; response: { grant: ICoreMailUploadGrant; }; } export interface IReq_CoreMailCompleteOutboundPartUpload extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailCompleteOutboundPartUpload'; request: { submissionId: string; partId: string; grantId: string; sha256: TCoreMailSha256; lengthBytes: number; }; response: { submission: ICoreMailSubmission; }; } export interface IReq_CoreMailFinalizeOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailFinalizeOutboundSubmission'; request: { submissionId: string; }; response: { submission: ICoreMailSubmission; }; } export interface IReq_CoreMailGetOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGetOutboundSubmission'; request: { submissionId: string; }; response: { submission: ICoreMailSubmission; }; } export interface IReq_CoreMailListInboundDeliveries extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailListInboundDeliveries'; request: { /** Opaque CoreMail-owned composite cursor. */ cursor?: string; limit: number; }; response: ICoreMailInboundDeliveryPage; } export interface IReq_CoreMailPrepareInboundFetch extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailPrepareInboundFetch'; request: { deliveryId: string; }; response: { grant: ICoreMailDownloadGrant; }; } export interface IReq_CoreMailCompleteInboundFetch extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailCompleteInboundFetch'; request: { deliveryId: string; grantId: string; sha256: TCoreMailSha256; lengthBytes: number; }; response: { delivery: ICoreMailInboundDelivery; }; } export interface IReq_CoreMailAcknowledgeInboundDelivery extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailAcknowledgeInboundDelivery'; request: { deliveryId: string; outcome: TCoreMailInboundAckOutcome; }; response: { delivery: ICoreMailInboundDelivery; replayed: boolean; }; } export interface IReq_CoreMailAuthenticateControl extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailAuthenticateControl'; request: { credentialId: string; credentialVersion: number; credentialSecret: string; }; response: { authenticated: true; credentialId: string; credentialVersion: number; replica: ICoreMailReplicaIdentity; }; } export interface IReq_CoreMailPrepareDesiredStateUpload extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailPrepareDesiredStateUpload'; request: { expectedAppliedConfigEpoch: number; configEpoch: number; desiredStateDigest: TCoreMailSha256; lengthBytes: number; }; response: { reconciliationId: string; grant: ICoreMailUploadGrant; replayed: boolean; }; } export interface IReq_CoreMailApplyDesiredState extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailApplyDesiredState'; request: { reconciliationId: string; grantId: string; desiredStateDigest: TCoreMailSha256; lengthBytes: number; }; response: { status: ICoreMailReconciliationStatus; }; } export interface IReq_CoreMailGetReconciliationStatus extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGetReconciliationStatus'; request: { configEpoch: number; desiredStateDigest: TCoreMailSha256; }; response: { status: ICoreMailReconciliationStatus; }; } export interface IReq_CoreMailGatewayAuthenticate extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayAuthenticate'; request: { credentialId: string; credentialVersion: number; credentialSecret: string; }; response: { authenticated: true; credentialId: string; credentialVersion: number; /** dcrouter's authoritative, control-plane-bound origin for CoreMail transfer paths. */ coreMailTransferOrigin: string; }; } export interface IReq_CoreMailGatewayResolveRecipients extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayResolveRecipients'; request: { envelope: ICoreMailEnvelope; recipients: string[]; source: IMailConnectionInfo; }; response: { resolutions: ICoreMailRecipientResolution[]; }; } export interface IReq_CoreMailGatewayPrepareInboundHandoff extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayPrepareInboundHandoff'; request: { transportDeliveryId: string; routingHandles: string[]; message: ICoreMailGatewayMessageDescriptor; source: IMailConnectionInfo; }; response: { handoffId: string; grant?: ICoreMailUploadGrant; replayed: boolean; }; } export interface IReq_CoreMailGatewayCompleteInboundHandoff extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayCompleteInboundHandoff'; request: { handoffId: string; grantId: string; sha256: TCoreMailSha256; lengthBytes: number; }; response: { accepted: true; deliveryIds: string[]; replayed: boolean; }; } export interface IReq_CoreMailGatewayPrepareOutboundHandoff extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayPrepareOutboundHandoff'; request: { transportSubmissionId: string; submissionDigest: TCoreMailSha256; message: ICoreMailGatewayMessageDescriptor; /** CoreMail-issued GET grant. dcrouter resolves the path against the authenticated peer. */ grant: ICoreMailDownloadGrant; }; response: { transportMessageId: string; status: ICoreMailGatewayOutboundStatus; replayed: boolean; }; } export interface IReq_CoreMailGatewayCompleteOutboundHandoff extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayCompleteOutboundHandoff'; request: { transportMessageId: string; grantId: string; sha256: TCoreMailSha256; lengthBytes: number; }; response: { status: ICoreMailGatewayOutboundStatus; replayed: boolean; }; } export interface IReq_CoreMailGatewayGetOutboundStatus extends plugins.typedrequestInterfaces.implementsTR { method: 'coreMailGatewayGetOutboundStatus'; request: { transportMessageId: string; }; response: { status: ICoreMailGatewayOutboundStatus; }; }