@serve.zone/interfaces 21.1.0 → 22.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.
- package/changelog.md +11 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/coremail.d.ts +83 -9
- package/dist_ts/data/coremail.js +67 -1
- package/dist_ts/data/coremail.runtime.d.ts +27 -1
- package/dist_ts/data/coremail.runtime.js +800 -36
- package/dist_ts/requests/coremail.d.ts +12 -5
- package/package.json +1 -1
- package/readme.md +57 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/coremail.runtime.ts +1212 -38
- package/ts/data/coremail.ts +120 -8
- package/ts/requests/coremail.ts +13 -4
package/ts/data/coremail.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
export type TCoreMailSha256 = `sha256:${string}`;
|
|
11
11
|
|
|
12
12
|
export type TCoreMailCapability = 'outbound' | 'inbound';
|
|
13
|
-
export type TCoreMailBindingState = 'active' | 'disabled';
|
|
13
|
+
export type TCoreMailBindingState = 'active' | 'draining' | 'disabled';
|
|
14
14
|
export type TCoreMailCredentialState = 'current' | 'retiring';
|
|
15
15
|
export type TCoreMailCredentialVerifierFormat = 'argon2id-v1';
|
|
16
16
|
export type TCoreMailPartKind = 'text' | 'html' | 'attachment';
|
|
@@ -30,6 +30,16 @@ export type TCoreMailInboundDeliveryState = 'pending' | 'fetching' | 'fetched' |
|
|
|
30
30
|
export type TCoreMailInboundAckOutcome = 'processed' | 'discarded';
|
|
31
31
|
export type TCoreMailRecipientAction = 'accept' | 'reject' | 'defer';
|
|
32
32
|
export type TCoreMailReconciliationState = 'applying' | 'ready' | 'failed';
|
|
33
|
+
export type TCoreMailWorkloadOperation =
|
|
34
|
+
| 'coreMailPrepareOutboundSubmission'
|
|
35
|
+
| 'coreMailPrepareOutboundPartUpload'
|
|
36
|
+
| 'coreMailCompleteOutboundPartUpload'
|
|
37
|
+
| 'coreMailFinalizeOutboundSubmission'
|
|
38
|
+
| 'coreMailGetOutboundSubmission'
|
|
39
|
+
| 'coreMailListInboundDeliveries'
|
|
40
|
+
| 'coreMailPrepareInboundFetch'
|
|
41
|
+
| 'coreMailCompleteInboundFetch'
|
|
42
|
+
| 'coreMailAcknowledgeInboundDelivery';
|
|
33
43
|
|
|
34
44
|
export type TCoreMailErrorCode =
|
|
35
45
|
| 'AUTHENTICATION_FAILED'
|
|
@@ -43,6 +53,7 @@ export type TCoreMailErrorCode =
|
|
|
43
53
|
| 'INVALID_RECIPIENT'
|
|
44
54
|
| 'INVALID_HEADER'
|
|
45
55
|
| 'PAYLOAD_LIMIT_EXCEEDED'
|
|
56
|
+
| 'QUOTA_EXCEEDED'
|
|
46
57
|
| 'IDEMPOTENCY_CONFLICT'
|
|
47
58
|
| 'STATE_CONFLICT'
|
|
48
59
|
| 'TRANSFER_GRANT_EXPIRED'
|
|
@@ -52,6 +63,9 @@ export type TCoreMailErrorCode =
|
|
|
52
63
|
| 'TRANSFER_ENCODING_UNSUPPORTED'
|
|
53
64
|
| 'OBJECT_INTEGRITY_CONFLICT'
|
|
54
65
|
| 'DELIVERY_NOT_FETCHED'
|
|
66
|
+
| 'DELIVERY_DEFERRED'
|
|
67
|
+
| 'DELIVERY_FAILED'
|
|
68
|
+
| 'DELIVERY_DEAD_LETTERED'
|
|
55
69
|
| 'GATEWAY_UNAVAILABLE'
|
|
56
70
|
| 'RECONCILIATION_FENCE_MISMATCH';
|
|
57
71
|
|
|
@@ -111,6 +125,7 @@ export interface ICoreMailTransferGrant {
|
|
|
111
125
|
sha256: TCoreMailSha256;
|
|
112
126
|
lengthBytes: number;
|
|
113
127
|
contentType: string;
|
|
128
|
+
issuedAt: number;
|
|
114
129
|
expiresAt: number;
|
|
115
130
|
}
|
|
116
131
|
|
|
@@ -138,8 +153,10 @@ export interface ICoreMailSubmission {
|
|
|
138
153
|
transportMessageId?: string;
|
|
139
154
|
attempts: number;
|
|
140
155
|
nextAttemptAt?: number;
|
|
156
|
+
error?: ICoreMailErrorData;
|
|
141
157
|
acceptedAt?: number;
|
|
142
158
|
deliveredAt?: number;
|
|
159
|
+
terminalAt?: number;
|
|
143
160
|
createdAt: number;
|
|
144
161
|
updatedAt: number;
|
|
145
162
|
}
|
|
@@ -158,6 +175,13 @@ export interface ICoreMailInboundDelivery {
|
|
|
158
175
|
subject?: string;
|
|
159
176
|
receivedAt: number;
|
|
160
177
|
updatedAt: number;
|
|
178
|
+
acknowledgedAt?: number;
|
|
179
|
+
acknowledgedOutcome?: TCoreMailInboundAckOutcome;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface ICoreMailInboundDeliveryPage {
|
|
183
|
+
deliveries: ICoreMailInboundDelivery[];
|
|
184
|
+
nextCursor?: string;
|
|
161
185
|
}
|
|
162
186
|
|
|
163
187
|
export interface ICoreMailBindingCredentialVerifier {
|
|
@@ -172,7 +196,7 @@ export interface ICoreMailBindingCredentialVerifier {
|
|
|
172
196
|
}
|
|
173
197
|
|
|
174
198
|
export interface ICoreMailBindingDesiredState {
|
|
175
|
-
schemaVersion:
|
|
199
|
+
schemaVersion: 2;
|
|
176
200
|
bindingId: string;
|
|
177
201
|
serviceId: string;
|
|
178
202
|
tenantId: string;
|
|
@@ -183,15 +207,17 @@ export interface ICoreMailBindingDesiredState {
|
|
|
183
207
|
allowedSenders: string[];
|
|
184
208
|
inboundRecipients: string[];
|
|
185
209
|
defaultSender?: string;
|
|
186
|
-
limits
|
|
187
|
-
messagesPerMinute
|
|
188
|
-
messagesPerDay
|
|
189
|
-
maxPendingInbound
|
|
210
|
+
limits: {
|
|
211
|
+
messagesPerMinute: number;
|
|
212
|
+
messagesPerDay: number;
|
|
213
|
+
maxPendingInbound: number;
|
|
190
214
|
};
|
|
191
215
|
}
|
|
192
216
|
|
|
193
217
|
export interface ICoreMailGatewayDesiredState {
|
|
194
218
|
endpointUrl: string;
|
|
219
|
+
/** Canonical CoreMail HTTPS origin authorized for path-only transfer grants. */
|
|
220
|
+
coreMailTransferOrigin: string;
|
|
195
221
|
credentialId: string;
|
|
196
222
|
credentialVersion: number;
|
|
197
223
|
/** Key in CoreMail's resolved runtime secret material, never a plaintext value. */
|
|
@@ -220,11 +246,21 @@ export interface ICoreMailGatewayPeerDesiredState {
|
|
|
220
246
|
credentials: ICoreMailBindingCredentialVerifier[];
|
|
221
247
|
}
|
|
222
248
|
|
|
249
|
+
export interface ICoreMailRuntimeKeyReference {
|
|
250
|
+
keyId: string;
|
|
251
|
+
version: number;
|
|
252
|
+
state: TCoreMailCredentialState;
|
|
253
|
+
/** Key in CoreMail's resolved runtime secret material, never a plaintext value. */
|
|
254
|
+
secretKey: string;
|
|
255
|
+
acceptUntil?: number;
|
|
256
|
+
}
|
|
257
|
+
|
|
223
258
|
export interface ICoreMailDesiredState {
|
|
224
|
-
schemaVersion:
|
|
259
|
+
schemaVersion: 2;
|
|
225
260
|
configEpoch: number;
|
|
226
261
|
bindings: ICoreMailBindingDesiredState[];
|
|
227
262
|
gateway: ICoreMailGatewayDesiredState;
|
|
263
|
+
cursorKeys: ICoreMailRuntimeKeyReference[];
|
|
228
264
|
}
|
|
229
265
|
|
|
230
266
|
export interface ICoreMailReplicaIdentity {
|
|
@@ -239,7 +275,9 @@ export interface ICoreMailBindingReconciliationStatus {
|
|
|
239
275
|
bindingId: string;
|
|
240
276
|
revision: number;
|
|
241
277
|
state: TCoreMailBindingState;
|
|
242
|
-
|
|
278
|
+
pendingInboundCount: number;
|
|
279
|
+
activeSessionsByCredential: Array<{
|
|
280
|
+
credentialId: string;
|
|
243
281
|
version: number;
|
|
244
282
|
count: number;
|
|
245
283
|
}>;
|
|
@@ -281,7 +319,10 @@ export interface ICoreMailGatewayOutboundStatus {
|
|
|
281
319
|
>;
|
|
282
320
|
attempts: number;
|
|
283
321
|
nextAttemptAt?: number;
|
|
322
|
+
error?: ICoreMailErrorData;
|
|
284
323
|
smtpCode?: number;
|
|
324
|
+
deliveredAt?: number;
|
|
325
|
+
terminalAt?: number;
|
|
285
326
|
updatedAt: number;
|
|
286
327
|
}
|
|
287
328
|
|
|
@@ -295,12 +336,83 @@ export const coreMailLimits = Object.freeze({
|
|
|
295
336
|
aggregateAttachmentBytes: 17 * 1024 * 1024,
|
|
296
337
|
mimeFramingBytes: 512 * 1024,
|
|
297
338
|
serializedMimeBytes: 30 * 1024 * 1024,
|
|
339
|
+
recipientCount: 100,
|
|
340
|
+
inboundPageSize: 100,
|
|
341
|
+
inboundPageBytes: 56 * 1024,
|
|
342
|
+
cursorBytes: 1_024,
|
|
343
|
+
cursorMinimumDecodedBytes: 32,
|
|
344
|
+
routingHandleTtlMs: 5 * 60 * 1000,
|
|
298
345
|
transferGrantTtlMs: 5 * 60 * 1000,
|
|
299
346
|
transferHeaderTimeoutMs: 10 * 1000,
|
|
300
347
|
transferIdleTimeoutMs: 15 * 1000,
|
|
301
348
|
transferOverallTimeoutMs: 2 * 60 * 1000,
|
|
302
349
|
} as const);
|
|
303
350
|
|
|
351
|
+
export const coreMailTransferTokenPolicy = Object.freeze({
|
|
352
|
+
format: 'base64url-256' as const,
|
|
353
|
+
decodedBytes: 32,
|
|
354
|
+
encodedCharacters: 43,
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
export const coreMailWorkloadOperationPolicy = Object.freeze({
|
|
358
|
+
active: Object.freeze({
|
|
359
|
+
outbound: Object.freeze([
|
|
360
|
+
'coreMailPrepareOutboundSubmission',
|
|
361
|
+
'coreMailPrepareOutboundPartUpload',
|
|
362
|
+
'coreMailCompleteOutboundPartUpload',
|
|
363
|
+
'coreMailFinalizeOutboundSubmission',
|
|
364
|
+
'coreMailGetOutboundSubmission',
|
|
365
|
+
] satisfies TCoreMailWorkloadOperation[]),
|
|
366
|
+
inbound: Object.freeze([
|
|
367
|
+
'coreMailListInboundDeliveries',
|
|
368
|
+
'coreMailPrepareInboundFetch',
|
|
369
|
+
'coreMailCompleteInboundFetch',
|
|
370
|
+
'coreMailAcknowledgeInboundDelivery',
|
|
371
|
+
] satisfies TCoreMailWorkloadOperation[]),
|
|
372
|
+
}),
|
|
373
|
+
draining: Object.freeze({
|
|
374
|
+
outbound: Object.freeze([
|
|
375
|
+
'coreMailGetOutboundSubmission',
|
|
376
|
+
] satisfies TCoreMailWorkloadOperation[]),
|
|
377
|
+
inbound: Object.freeze([
|
|
378
|
+
'coreMailListInboundDeliveries',
|
|
379
|
+
'coreMailPrepareInboundFetch',
|
|
380
|
+
'coreMailCompleteInboundFetch',
|
|
381
|
+
'coreMailAcknowledgeInboundDelivery',
|
|
382
|
+
] satisfies TCoreMailWorkloadOperation[]),
|
|
383
|
+
}),
|
|
384
|
+
disabled: Object.freeze({
|
|
385
|
+
outbound: Object.freeze([] satisfies TCoreMailWorkloadOperation[]),
|
|
386
|
+
inbound: Object.freeze([] satisfies TCoreMailWorkloadOperation[]),
|
|
387
|
+
}),
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
export const coreMailRetentionPolicy = Object.freeze({
|
|
391
|
+
terminalOutboundMs: 30 * 24 * 60 * 60 * 1000,
|
|
392
|
+
acknowledgedInboundMs: 30 * 24 * 60 * 60 * 1000,
|
|
393
|
+
idempotencyReceiptMs: 30 * 24 * 60 * 60 * 1000,
|
|
394
|
+
expiredCapabilityMs: 24 * 60 * 60 * 1000,
|
|
395
|
+
pendingInboundAgePurge: false as const,
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
export const coreMailQuotaPolicy = Object.freeze({
|
|
399
|
+
windows: 'fixed-utc-minute-and-day' as const,
|
|
400
|
+
outboundUnit: 'first-durable-idempotency-insert' as const,
|
|
401
|
+
outboundReplayConsumesUnit: false as const,
|
|
402
|
+
pendingInboundStates: ['pending', 'fetching', 'fetched'] as const,
|
|
403
|
+
inboundAcknowledgementReleasesUnit: true as const,
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
export const coreMailTransferProtocol = Object.freeze({
|
|
407
|
+
pathPrefix: '/transfers/',
|
|
408
|
+
authorizationScheme: 'Bearer',
|
|
409
|
+
putSuccessStatus: 204,
|
|
410
|
+
getSuccessStatus: 200,
|
|
411
|
+
requireContentLength: true,
|
|
412
|
+
requireContentType: true,
|
|
413
|
+
integritySource: 'grant-metadata-and-completion' as const,
|
|
414
|
+
});
|
|
415
|
+
|
|
304
416
|
export const coreMailCredentialVerifierPolicy = Object.freeze({
|
|
305
417
|
format: 'argon2id-v1' as const,
|
|
306
418
|
version: 19,
|
package/ts/requests/coremail.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as plugins from '../plugins.js';
|
|
2
2
|
import type {
|
|
3
3
|
ICoreMailEnvelope,
|
|
4
|
+
ICoreMailInboundDeliveryPage,
|
|
4
5
|
ICoreMailDownloadGrant,
|
|
5
6
|
ICoreMailGatewayMessageDescriptor,
|
|
6
7
|
ICoreMailGatewayOutboundStatus,
|
|
@@ -13,6 +14,7 @@ import type {
|
|
|
13
14
|
ICoreMailUploadGrant,
|
|
14
15
|
TCoreMailInboundAckOutcome,
|
|
15
16
|
TCoreMailSha256,
|
|
17
|
+
TCoreMailWorkloadOperation,
|
|
16
18
|
} from '../data/coremail.js';
|
|
17
19
|
import type { IMailConnectionInfo } from '../data/mail.js';
|
|
18
20
|
|
|
@@ -29,8 +31,13 @@ export interface IReq_CoreMailAuthenticateWorkload extends plugins.typedrequestI
|
|
|
29
31
|
};
|
|
30
32
|
response: {
|
|
31
33
|
authenticated: true;
|
|
34
|
+
credentialId: string;
|
|
32
35
|
credentialVersion: number;
|
|
36
|
+
bindingState: 'active' | 'draining';
|
|
33
37
|
capabilities: Array<'outbound' | 'inbound'>;
|
|
38
|
+
allowedOperations: TCoreMailWorkloadOperation[];
|
|
39
|
+
/** Authenticated CoreMail HTTPS origin for path-only transfer grants. */
|
|
40
|
+
coreMailTransferOrigin: string;
|
|
34
41
|
};
|
|
35
42
|
}
|
|
36
43
|
|
|
@@ -113,12 +120,11 @@ export interface IReq_CoreMailListInboundDeliveries extends plugins.typedrequest
|
|
|
113
120
|
> {
|
|
114
121
|
method: 'coreMailListInboundDeliveries';
|
|
115
122
|
request: {
|
|
116
|
-
|
|
123
|
+
/** Opaque CoreMail-owned composite cursor. */
|
|
124
|
+
cursor?: string;
|
|
117
125
|
limit: number;
|
|
118
126
|
};
|
|
119
|
-
response:
|
|
120
|
-
deliveries: ICoreMailInboundDelivery[];
|
|
121
|
-
};
|
|
127
|
+
response: ICoreMailInboundDeliveryPage;
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
export interface IReq_CoreMailPrepareInboundFetch extends plugins.typedrequestInterfaces.implementsTR<
|
|
@@ -177,6 +183,8 @@ export interface IReq_CoreMailAuthenticateControl extends plugins.typedrequestIn
|
|
|
177
183
|
};
|
|
178
184
|
response: {
|
|
179
185
|
authenticated: true;
|
|
186
|
+
credentialId: string;
|
|
187
|
+
credentialVersion: number;
|
|
180
188
|
replica: ICoreMailReplicaIdentity;
|
|
181
189
|
};
|
|
182
190
|
}
|
|
@@ -241,6 +249,7 @@ export interface IReq_CoreMailGatewayAuthenticate extends plugins.typedrequestIn
|
|
|
241
249
|
};
|
|
242
250
|
response: {
|
|
243
251
|
authenticated: true;
|
|
252
|
+
credentialId: string;
|
|
244
253
|
credentialVersion: number;
|
|
245
254
|
/** dcrouter's authoritative, control-plane-bound origin for CoreMail transfer paths. */
|
|
246
255
|
coreMailTransferOrigin: string;
|