@serve.zone/interfaces 20.1.0 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,318 @@
1
+ /**
2
+ * Shared CoreMail contracts.
3
+ *
4
+ * Workload authority is always derived from an authenticated transport
5
+ * session. Application-facing request DTOs therefore carry message or
6
+ * delivery identifiers only and never caller-selected tenant, service, or
7
+ * binding authority.
8
+ */
9
+
10
+ export type TCoreMailSha256 = `sha256:${string}`;
11
+
12
+ export type TCoreMailCapability = 'outbound' | 'inbound';
13
+ export type TCoreMailBindingState = 'active' | 'disabled';
14
+ export type TCoreMailCredentialState = 'current' | 'retiring';
15
+ export type TCoreMailCredentialVerifierFormat = 'argon2id-v1';
16
+ export type TCoreMailPartKind = 'text' | 'html' | 'attachment';
17
+ export type TCoreMailTransferMethod = 'PUT' | 'GET';
18
+ export type TCoreMailSubmissionState =
19
+ | 'preparing'
20
+ | 'uploading'
21
+ | 'ready'
22
+ | 'accepted'
23
+ | 'queued'
24
+ | 'delivering'
25
+ | 'delivered'
26
+ | 'deferred'
27
+ | 'failed'
28
+ | 'deadLettered';
29
+ export type TCoreMailInboundDeliveryState = 'pending' | 'fetching' | 'fetched' | 'acknowledged';
30
+ export type TCoreMailInboundAckOutcome = 'processed' | 'discarded';
31
+ export type TCoreMailRecipientAction = 'accept' | 'reject' | 'defer';
32
+ export type TCoreMailReconciliationState = 'applying' | 'ready' | 'failed';
33
+
34
+ export type TCoreMailErrorCode =
35
+ | 'AUTHENTICATION_FAILED'
36
+ | 'AUTHENTICATION_EXPIRED'
37
+ | 'AUTHORITY_REVOKED'
38
+ | 'CAPABILITY_DENIED'
39
+ | 'NOT_FOUND'
40
+ | 'INVALID_REQUEST'
41
+ | 'INVALID_MAILBOX'
42
+ | 'INVALID_SENDER'
43
+ | 'INVALID_RECIPIENT'
44
+ | 'INVALID_HEADER'
45
+ | 'PAYLOAD_LIMIT_EXCEEDED'
46
+ | 'IDEMPOTENCY_CONFLICT'
47
+ | 'STATE_CONFLICT'
48
+ | 'TRANSFER_GRANT_EXPIRED'
49
+ | 'TRANSFER_GRANT_REPLAYED'
50
+ | 'TRANSFER_LENGTH_MISMATCH'
51
+ | 'TRANSFER_DIGEST_MISMATCH'
52
+ | 'TRANSFER_ENCODING_UNSUPPORTED'
53
+ | 'OBJECT_INTEGRITY_CONFLICT'
54
+ | 'DELIVERY_NOT_FETCHED'
55
+ | 'GATEWAY_UNAVAILABLE'
56
+ | 'RECONCILIATION_FENCE_MISMATCH';
57
+
58
+ export interface ICoreMailErrorData {
59
+ code: TCoreMailErrorCode;
60
+ retryable: boolean;
61
+ retryAfterMs?: number;
62
+ }
63
+
64
+ export interface ICoreMailMailbox {
65
+ address: string;
66
+ displayName?: string;
67
+ }
68
+
69
+ export interface ICoreMailEnvelope {
70
+ mailFrom: string;
71
+ rcptTo: string[];
72
+ }
73
+
74
+ export interface ICoreMailHeader {
75
+ name: string;
76
+ value: string;
77
+ }
78
+
79
+ export interface ICoreMailContentDescriptor {
80
+ partId: string;
81
+ kind: TCoreMailPartKind;
82
+ contentType: string;
83
+ filename?: string;
84
+ contentId?: string;
85
+ sha256: TCoreMailSha256;
86
+ lengthBytes: number;
87
+ }
88
+
89
+ export interface ICoreMailOutboundMessageDescriptor {
90
+ sender: ICoreMailMailbox;
91
+ recipients: {
92
+ to: ICoreMailMailbox[];
93
+ cc?: ICoreMailMailbox[];
94
+ bcc?: ICoreMailMailbox[];
95
+ };
96
+ replyTo?: ICoreMailMailbox;
97
+ subject: string;
98
+ /** Ordered headers. Transport-owned MIME headers are not accepted here. */
99
+ headers?: ICoreMailHeader[];
100
+ /** Ordered body and attachment descriptors. Bytes move through bounded HTTP transfers. */
101
+ parts: ICoreMailContentDescriptor[];
102
+ }
103
+
104
+ export interface ICoreMailTransferGrant {
105
+ grantId: string;
106
+ method: TCoreMailTransferMethod;
107
+ /** Same-origin path. Callers use the authenticated CoreMail or gateway endpoint they already hold. */
108
+ path: string;
109
+ /** One-time bearer capability. It must never be logged or persisted by a consumer. */
110
+ bearerToken: string;
111
+ sha256: TCoreMailSha256;
112
+ lengthBytes: number;
113
+ contentType: string;
114
+ expiresAt: number;
115
+ }
116
+
117
+ export interface ICoreMailUploadGrant extends ICoreMailTransferGrant {
118
+ method: 'PUT';
119
+ }
120
+
121
+ export interface ICoreMailDownloadGrant extends ICoreMailTransferGrant {
122
+ method: 'GET';
123
+ }
124
+
125
+ export interface ICoreMailPartStatus {
126
+ partId: string;
127
+ state: 'missing' | 'uploading' | 'complete' | 'failed';
128
+ sha256: TCoreMailSha256;
129
+ lengthBytes: number;
130
+ }
131
+
132
+ export interface ICoreMailSubmission {
133
+ submissionId: string;
134
+ idempotencyKey: string;
135
+ submissionDigest: TCoreMailSha256;
136
+ state: TCoreMailSubmissionState;
137
+ parts: ICoreMailPartStatus[];
138
+ transportMessageId?: string;
139
+ attempts: number;
140
+ nextAttemptAt?: number;
141
+ acceptedAt?: number;
142
+ deliveredAt?: number;
143
+ createdAt: number;
144
+ updatedAt: number;
145
+ }
146
+
147
+ export interface ICoreMailInboundDelivery {
148
+ deliveryId: string;
149
+ transportDeliveryId: string;
150
+ state: TCoreMailInboundDeliveryState;
151
+ envelope: ICoreMailEnvelope;
152
+ rawMime: {
153
+ sha256: TCoreMailSha256;
154
+ lengthBytes: number;
155
+ contentType: 'message/rfc822';
156
+ };
157
+ messageId?: string;
158
+ subject?: string;
159
+ receivedAt: number;
160
+ updatedAt: number;
161
+ }
162
+
163
+ export interface ICoreMailBindingCredentialVerifier {
164
+ credentialId: string;
165
+ version: number;
166
+ state: TCoreMailCredentialState;
167
+ /** Versioned verifier contract. CoreMail currently accepts only argon2id-v1. */
168
+ format: TCoreMailCredentialVerifierFormat;
169
+ /** Password-verifier string only. Plaintext credential material is never part of desired state. */
170
+ verificationHash: string;
171
+ acceptUntil?: number;
172
+ }
173
+
174
+ export interface ICoreMailBindingDesiredState {
175
+ schemaVersion: 1;
176
+ bindingId: string;
177
+ serviceId: string;
178
+ tenantId: string;
179
+ revision: number;
180
+ state: TCoreMailBindingState;
181
+ capabilities: TCoreMailCapability[];
182
+ credentials: ICoreMailBindingCredentialVerifier[];
183
+ allowedSenders: string[];
184
+ inboundRecipients: string[];
185
+ defaultSender?: string;
186
+ limits?: {
187
+ messagesPerMinute?: number;
188
+ messagesPerDay?: number;
189
+ maxPendingInbound?: number;
190
+ };
191
+ }
192
+
193
+ export interface ICoreMailGatewayDesiredState {
194
+ endpointUrl: string;
195
+ credentialId: string;
196
+ credentialVersion: number;
197
+ /** Key in CoreMail's resolved runtime secret material, never a plaintext value. */
198
+ credentialSecretKey: string;
199
+ }
200
+
201
+ /**
202
+ * Bootstrap authority installed in CoreMail before Coreflow can reconcile
203
+ * ordinary desired state. The verifier payload is safe to deliver as runtime
204
+ * configuration; the matching plaintext is delivered only to Coreflow.
205
+ */
206
+ export interface ICoreMailControlBootstrap {
207
+ schemaVersion: 1;
208
+ coreMailServiceId: string;
209
+ credentials: ICoreMailBindingCredentialVerifier[];
210
+ }
211
+
212
+ /**
213
+ * dcrouter-owned desired state for one authenticated CoreMail gateway peer.
214
+ * transferOrigin is authoritative control-plane data, never peer supplied.
215
+ */
216
+ export interface ICoreMailGatewayPeerDesiredState {
217
+ schemaVersion: 1;
218
+ coreMailServiceId: string;
219
+ transferOrigin: string;
220
+ credentials: ICoreMailBindingCredentialVerifier[];
221
+ }
222
+
223
+ export interface ICoreMailDesiredState {
224
+ schemaVersion: 1;
225
+ configEpoch: number;
226
+ bindings: ICoreMailBindingDesiredState[];
227
+ gateway: ICoreMailGatewayDesiredState;
228
+ }
229
+
230
+ export interface ICoreMailReplicaIdentity {
231
+ taskId: string;
232
+ serviceId: string;
233
+ rolloutId: string;
234
+ rolloutGeneration: number;
235
+ imageDigest: TCoreMailSha256;
236
+ }
237
+
238
+ export interface ICoreMailBindingReconciliationStatus {
239
+ bindingId: string;
240
+ revision: number;
241
+ state: TCoreMailBindingState;
242
+ activeSessionsByCredentialVersion: Array<{
243
+ version: number;
244
+ count: number;
245
+ }>;
246
+ }
247
+
248
+ export interface ICoreMailReconciliationStatus {
249
+ replica: ICoreMailReplicaIdentity;
250
+ state: TCoreMailReconciliationState;
251
+ appliedConfigEpoch: number;
252
+ appliedDesiredStateDigest: TCoreMailSha256;
253
+ bindings: ICoreMailBindingReconciliationStatus[];
254
+ updatedAt: number;
255
+ errorCode?: TCoreMailErrorCode;
256
+ }
257
+
258
+ export interface ICoreMailRecipientResolution {
259
+ recipient: string;
260
+ action: TCoreMailRecipientAction;
261
+ /** Opaque, short-lived handle returned only for accepted recipients. */
262
+ routingHandle?: string;
263
+ smtpCode?: number;
264
+ message?: string;
265
+ }
266
+
267
+ export interface ICoreMailGatewayMessageDescriptor {
268
+ envelope: ICoreMailEnvelope;
269
+ rawMime: {
270
+ sha256: TCoreMailSha256;
271
+ lengthBytes: number;
272
+ contentType: 'message/rfc822';
273
+ };
274
+ }
275
+
276
+ export interface ICoreMailGatewayOutboundStatus {
277
+ transportMessageId: string;
278
+ state: Extract<
279
+ TCoreMailSubmissionState,
280
+ 'accepted' | 'queued' | 'delivering' | 'delivered' | 'deferred' | 'failed' | 'deadLettered'
281
+ >;
282
+ attempts: number;
283
+ nextAttemptAt?: number;
284
+ smtpCode?: number;
285
+ updatedAt: number;
286
+ }
287
+
288
+ export const coreMailLimits = Object.freeze({
289
+ controlMessageBytes: 64 * 1024,
290
+ desiredStateBytes: 8 * 1024 * 1024,
291
+ textPartBytes: 1 * 1024 * 1024,
292
+ htmlPartBytes: 2 * 1024 * 1024,
293
+ attachmentCount: 16,
294
+ attachmentBytes: 10 * 1024 * 1024,
295
+ aggregateAttachmentBytes: 17 * 1024 * 1024,
296
+ mimeFramingBytes: 512 * 1024,
297
+ serializedMimeBytes: 30 * 1024 * 1024,
298
+ transferGrantTtlMs: 5 * 60 * 1000,
299
+ transferHeaderTimeoutMs: 10 * 1000,
300
+ transferIdleTimeoutMs: 15 * 1000,
301
+ transferOverallTimeoutMs: 2 * 60 * 1000,
302
+ } as const);
303
+
304
+ export const coreMailCredentialVerifierPolicy = Object.freeze({
305
+ format: 'argon2id-v1' as const,
306
+ version: 19,
307
+ memoryCost: 65_536,
308
+ timeCost: 3,
309
+ parallelism: 1,
310
+ saltLengthBytes: 16,
311
+ hashLengthBytes: 32,
312
+ } as const);
313
+
314
+ export const coreMailRuntimeKeys = Object.freeze({
315
+ controlBootstrap: 'COREMAIL_CONTROL_BOOTSTRAP',
316
+ controlCredentialSecret: 'COREMAIL_CONTROL_CREDENTIAL_SECRET',
317
+ gatewayCredentialSecret: 'COREMAIL_GATEWAY_CREDENTIAL',
318
+ } as const);
package/ts/data/index.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './cloudlyconfig.js';
2
2
  export * from './cluster.js';
3
3
  export * from './config.js';
4
+ export * from './coremail.js';
5
+ export * from './coremail.runtime.js';
4
6
  export * from './deployment.js';
5
7
  export * from './deploymentadoption.js';
6
8
  export * from './deploymentoperation.js';
@@ -0,0 +1,348 @@
1
+ import type * as plugins from '../plugins.js';
2
+ import type {
3
+ ICoreMailEnvelope,
4
+ ICoreMailDownloadGrant,
5
+ ICoreMailGatewayMessageDescriptor,
6
+ ICoreMailGatewayOutboundStatus,
7
+ ICoreMailInboundDelivery,
8
+ ICoreMailOutboundMessageDescriptor,
9
+ ICoreMailRecipientResolution,
10
+ ICoreMailReconciliationStatus,
11
+ ICoreMailReplicaIdentity,
12
+ ICoreMailSubmission,
13
+ ICoreMailUploadGrant,
14
+ TCoreMailInboundAckOutcome,
15
+ TCoreMailSha256,
16
+ } from '../data/coremail.js';
17
+ import type { IMailConnectionInfo } from '../data/mail.js';
18
+
19
+ export interface IReq_CoreMailAuthenticateWorkload extends plugins.typedrequestInterfaces.implementsTR<
20
+ plugins.typedrequestInterfaces.ITypedRequest,
21
+ IReq_CoreMailAuthenticateWorkload
22
+ > {
23
+ method: 'coreMailAuthenticateWorkload';
24
+ request: {
25
+ bindingId: string;
26
+ credentialId: string;
27
+ credentialVersion: number;
28
+ credentialSecret: string;
29
+ };
30
+ response: {
31
+ authenticated: true;
32
+ credentialVersion: number;
33
+ capabilities: Array<'outbound' | 'inbound'>;
34
+ };
35
+ }
36
+
37
+ export interface IReq_CoreMailPrepareOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<
38
+ plugins.typedrequestInterfaces.ITypedRequest,
39
+ IReq_CoreMailPrepareOutboundSubmission
40
+ > {
41
+ method: 'coreMailPrepareOutboundSubmission';
42
+ request: {
43
+ /** Required replay key. Authority is added by the authenticated server session. */
44
+ idempotencyKey: string;
45
+ message: ICoreMailOutboundMessageDescriptor;
46
+ };
47
+ response: {
48
+ submission: ICoreMailSubmission;
49
+ replayed: boolean;
50
+ };
51
+ }
52
+
53
+ export interface IReq_CoreMailPrepareOutboundPartUpload extends plugins.typedrequestInterfaces.implementsTR<
54
+ plugins.typedrequestInterfaces.ITypedRequest,
55
+ IReq_CoreMailPrepareOutboundPartUpload
56
+ > {
57
+ method: 'coreMailPrepareOutboundPartUpload';
58
+ request: {
59
+ submissionId: string;
60
+ partId: string;
61
+ };
62
+ response: {
63
+ grant: ICoreMailUploadGrant;
64
+ };
65
+ }
66
+
67
+ export interface IReq_CoreMailCompleteOutboundPartUpload extends plugins.typedrequestInterfaces.implementsTR<
68
+ plugins.typedrequestInterfaces.ITypedRequest,
69
+ IReq_CoreMailCompleteOutboundPartUpload
70
+ > {
71
+ method: 'coreMailCompleteOutboundPartUpload';
72
+ request: {
73
+ submissionId: string;
74
+ partId: string;
75
+ grantId: string;
76
+ sha256: TCoreMailSha256;
77
+ lengthBytes: number;
78
+ };
79
+ response: {
80
+ submission: ICoreMailSubmission;
81
+ };
82
+ }
83
+
84
+ export interface IReq_CoreMailFinalizeOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<
85
+ plugins.typedrequestInterfaces.ITypedRequest,
86
+ IReq_CoreMailFinalizeOutboundSubmission
87
+ > {
88
+ method: 'coreMailFinalizeOutboundSubmission';
89
+ request: {
90
+ submissionId: string;
91
+ };
92
+ response: {
93
+ submission: ICoreMailSubmission;
94
+ };
95
+ }
96
+
97
+ export interface IReq_CoreMailGetOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<
98
+ plugins.typedrequestInterfaces.ITypedRequest,
99
+ IReq_CoreMailGetOutboundSubmission
100
+ > {
101
+ method: 'coreMailGetOutboundSubmission';
102
+ request: {
103
+ submissionId: string;
104
+ };
105
+ response: {
106
+ submission: ICoreMailSubmission;
107
+ };
108
+ }
109
+
110
+ export interface IReq_CoreMailListInboundDeliveries extends plugins.typedrequestInterfaces.implementsTR<
111
+ plugins.typedrequestInterfaces.ITypedRequest,
112
+ IReq_CoreMailListInboundDeliveries
113
+ > {
114
+ method: 'coreMailListInboundDeliveries';
115
+ request: {
116
+ afterDeliveryId?: string;
117
+ limit: number;
118
+ };
119
+ response: {
120
+ deliveries: ICoreMailInboundDelivery[];
121
+ };
122
+ }
123
+
124
+ export interface IReq_CoreMailPrepareInboundFetch extends plugins.typedrequestInterfaces.implementsTR<
125
+ plugins.typedrequestInterfaces.ITypedRequest,
126
+ IReq_CoreMailPrepareInboundFetch
127
+ > {
128
+ method: 'coreMailPrepareInboundFetch';
129
+ request: {
130
+ deliveryId: string;
131
+ };
132
+ response: {
133
+ grant: ICoreMailDownloadGrant;
134
+ };
135
+ }
136
+
137
+ export interface IReq_CoreMailCompleteInboundFetch extends plugins.typedrequestInterfaces.implementsTR<
138
+ plugins.typedrequestInterfaces.ITypedRequest,
139
+ IReq_CoreMailCompleteInboundFetch
140
+ > {
141
+ method: 'coreMailCompleteInboundFetch';
142
+ request: {
143
+ deliveryId: string;
144
+ grantId: string;
145
+ sha256: TCoreMailSha256;
146
+ lengthBytes: number;
147
+ };
148
+ response: {
149
+ delivery: ICoreMailInboundDelivery;
150
+ };
151
+ }
152
+
153
+ export interface IReq_CoreMailAcknowledgeInboundDelivery extends plugins.typedrequestInterfaces.implementsTR<
154
+ plugins.typedrequestInterfaces.ITypedRequest,
155
+ IReq_CoreMailAcknowledgeInboundDelivery
156
+ > {
157
+ method: 'coreMailAcknowledgeInboundDelivery';
158
+ request: {
159
+ deliveryId: string;
160
+ outcome: TCoreMailInboundAckOutcome;
161
+ };
162
+ response: {
163
+ delivery: ICoreMailInboundDelivery;
164
+ replayed: boolean;
165
+ };
166
+ }
167
+
168
+ export interface IReq_CoreMailAuthenticateControl extends plugins.typedrequestInterfaces.implementsTR<
169
+ plugins.typedrequestInterfaces.ITypedRequest,
170
+ IReq_CoreMailAuthenticateControl
171
+ > {
172
+ method: 'coreMailAuthenticateControl';
173
+ request: {
174
+ credentialId: string;
175
+ credentialVersion: number;
176
+ credentialSecret: string;
177
+ };
178
+ response: {
179
+ authenticated: true;
180
+ replica: ICoreMailReplicaIdentity;
181
+ };
182
+ }
183
+
184
+ export interface IReq_CoreMailPrepareDesiredStateUpload extends plugins.typedrequestInterfaces.implementsTR<
185
+ plugins.typedrequestInterfaces.ITypedRequest,
186
+ IReq_CoreMailPrepareDesiredStateUpload
187
+ > {
188
+ method: 'coreMailPrepareDesiredStateUpload';
189
+ request: {
190
+ expectedAppliedConfigEpoch: number;
191
+ configEpoch: number;
192
+ desiredStateDigest: TCoreMailSha256;
193
+ lengthBytes: number;
194
+ };
195
+ response: {
196
+ reconciliationId: string;
197
+ grant: ICoreMailUploadGrant;
198
+ replayed: boolean;
199
+ };
200
+ }
201
+
202
+ export interface IReq_CoreMailApplyDesiredState extends plugins.typedrequestInterfaces.implementsTR<
203
+ plugins.typedrequestInterfaces.ITypedRequest,
204
+ IReq_CoreMailApplyDesiredState
205
+ > {
206
+ method: 'coreMailApplyDesiredState';
207
+ request: {
208
+ reconciliationId: string;
209
+ grantId: string;
210
+ desiredStateDigest: TCoreMailSha256;
211
+ lengthBytes: number;
212
+ };
213
+ response: {
214
+ status: ICoreMailReconciliationStatus;
215
+ };
216
+ }
217
+
218
+ export interface IReq_CoreMailGetReconciliationStatus extends plugins.typedrequestInterfaces.implementsTR<
219
+ plugins.typedrequestInterfaces.ITypedRequest,
220
+ IReq_CoreMailGetReconciliationStatus
221
+ > {
222
+ method: 'coreMailGetReconciliationStatus';
223
+ request: {
224
+ configEpoch: number;
225
+ desiredStateDigest: TCoreMailSha256;
226
+ };
227
+ response: {
228
+ status: ICoreMailReconciliationStatus;
229
+ };
230
+ }
231
+
232
+ export interface IReq_CoreMailGatewayAuthenticate extends plugins.typedrequestInterfaces.implementsTR<
233
+ plugins.typedrequestInterfaces.ITypedRequest,
234
+ IReq_CoreMailGatewayAuthenticate
235
+ > {
236
+ method: 'coreMailGatewayAuthenticate';
237
+ request: {
238
+ credentialId: string;
239
+ credentialVersion: number;
240
+ credentialSecret: string;
241
+ };
242
+ response: {
243
+ authenticated: true;
244
+ credentialVersion: number;
245
+ /** dcrouter's authoritative, control-plane-bound origin for CoreMail transfer paths. */
246
+ coreMailTransferOrigin: string;
247
+ };
248
+ }
249
+
250
+ export interface IReq_CoreMailGatewayResolveRecipients extends plugins.typedrequestInterfaces.implementsTR<
251
+ plugins.typedrequestInterfaces.ITypedRequest,
252
+ IReq_CoreMailGatewayResolveRecipients
253
+ > {
254
+ method: 'coreMailGatewayResolveRecipients';
255
+ request: {
256
+ envelope: ICoreMailEnvelope;
257
+ recipients: string[];
258
+ source: IMailConnectionInfo;
259
+ };
260
+ response: {
261
+ resolutions: ICoreMailRecipientResolution[];
262
+ };
263
+ }
264
+
265
+ export interface IReq_CoreMailGatewayPrepareInboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
266
+ plugins.typedrequestInterfaces.ITypedRequest,
267
+ IReq_CoreMailGatewayPrepareInboundHandoff
268
+ > {
269
+ method: 'coreMailGatewayPrepareInboundHandoff';
270
+ request: {
271
+ transportDeliveryId: string;
272
+ routingHandles: string[];
273
+ message: ICoreMailGatewayMessageDescriptor;
274
+ source: IMailConnectionInfo;
275
+ };
276
+ response: {
277
+ handoffId: string;
278
+ grant?: ICoreMailUploadGrant;
279
+ replayed: boolean;
280
+ };
281
+ }
282
+
283
+ export interface IReq_CoreMailGatewayCompleteInboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
284
+ plugins.typedrequestInterfaces.ITypedRequest,
285
+ IReq_CoreMailGatewayCompleteInboundHandoff
286
+ > {
287
+ method: 'coreMailGatewayCompleteInboundHandoff';
288
+ request: {
289
+ handoffId: string;
290
+ grantId: string;
291
+ sha256: TCoreMailSha256;
292
+ lengthBytes: number;
293
+ };
294
+ response: {
295
+ accepted: true;
296
+ deliveryIds: string[];
297
+ replayed: boolean;
298
+ };
299
+ }
300
+
301
+ export interface IReq_CoreMailGatewayPrepareOutboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
302
+ plugins.typedrequestInterfaces.ITypedRequest,
303
+ IReq_CoreMailGatewayPrepareOutboundHandoff
304
+ > {
305
+ method: 'coreMailGatewayPrepareOutboundHandoff';
306
+ request: {
307
+ transportSubmissionId: string;
308
+ submissionDigest: TCoreMailSha256;
309
+ message: ICoreMailGatewayMessageDescriptor;
310
+ /** CoreMail-issued GET grant. dcrouter resolves the path against the authenticated peer. */
311
+ grant: ICoreMailDownloadGrant;
312
+ };
313
+ response: {
314
+ transportMessageId: string;
315
+ status: ICoreMailGatewayOutboundStatus;
316
+ replayed: boolean;
317
+ };
318
+ }
319
+
320
+ export interface IReq_CoreMailGatewayCompleteOutboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
321
+ plugins.typedrequestInterfaces.ITypedRequest,
322
+ IReq_CoreMailGatewayCompleteOutboundHandoff
323
+ > {
324
+ method: 'coreMailGatewayCompleteOutboundHandoff';
325
+ request: {
326
+ transportMessageId: string;
327
+ grantId: string;
328
+ sha256: TCoreMailSha256;
329
+ lengthBytes: number;
330
+ };
331
+ response: {
332
+ status: ICoreMailGatewayOutboundStatus;
333
+ replayed: boolean;
334
+ };
335
+ }
336
+
337
+ export interface IReq_CoreMailGatewayGetOutboundStatus extends plugins.typedrequestInterfaces.implementsTR<
338
+ plugins.typedrequestInterfaces.ITypedRequest,
339
+ IReq_CoreMailGatewayGetOutboundStatus
340
+ > {
341
+ method: 'coreMailGatewayGetOutboundStatus';
342
+ request: {
343
+ transportMessageId: string;
344
+ };
345
+ response: {
346
+ status: ICoreMailGatewayOutboundStatus;
347
+ };
348
+ }
@@ -8,6 +8,7 @@ import * as backupRequests from './backup.js';
8
8
  import * as certificateRequests from './certificate.js';
9
9
  import * as clusterRequests from './cluster.js';
10
10
  import * as configRequests from './config.js';
11
+ import * as coreMailRequests from './coremail.js';
11
12
  import * as corestoreRequests from './corestore.js';
12
13
  import * as deploymentRequests from './deployment.js';
13
14
  import * as dnsRequests from './dns.js';
@@ -45,6 +46,7 @@ export {
45
46
  certificateRequests as certificate,
46
47
  clusterRequests as cluster,
47
48
  configRequests as config,
49
+ coreMailRequests as coremail,
48
50
  corestoreRequests as corestore,
49
51
  deploymentRequests as deployment,
50
52
  dnsRequests as dns,