@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.
@@ -1,5 +1,5 @@
1
1
  import type * as plugins from '../plugins.js';
2
- import type { ICoreMailEnvelope, ICoreMailDownloadGrant, ICoreMailGatewayMessageDescriptor, ICoreMailGatewayOutboundStatus, ICoreMailInboundDelivery, ICoreMailOutboundMessageDescriptor, ICoreMailRecipientResolution, ICoreMailReconciliationStatus, ICoreMailReplicaIdentity, ICoreMailSubmission, ICoreMailUploadGrant, TCoreMailInboundAckOutcome, TCoreMailSha256 } from '../data/coremail.js';
2
+ import type { ICoreMailEnvelope, ICoreMailInboundDeliveryPage, ICoreMailDownloadGrant, ICoreMailGatewayMessageDescriptor, ICoreMailGatewayOutboundStatus, ICoreMailInboundDelivery, ICoreMailOutboundMessageDescriptor, ICoreMailRecipientResolution, ICoreMailReconciliationStatus, ICoreMailReplicaIdentity, ICoreMailSubmission, ICoreMailUploadGrant, TCoreMailInboundAckOutcome, TCoreMailSha256, TCoreMailWorkloadOperation } from '../data/coremail.js';
3
3
  import type { IMailConnectionInfo } from '../data/mail.js';
4
4
  export interface IReq_CoreMailAuthenticateWorkload extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_CoreMailAuthenticateWorkload> {
5
5
  method: 'coreMailAuthenticateWorkload';
@@ -11,8 +11,13 @@ export interface IReq_CoreMailAuthenticateWorkload extends plugins.typedrequestI
11
11
  };
12
12
  response: {
13
13
  authenticated: true;
14
+ credentialId: string;
14
15
  credentialVersion: number;
16
+ bindingState: 'active' | 'draining';
15
17
  capabilities: Array<'outbound' | 'inbound'>;
18
+ allowedOperations: TCoreMailWorkloadOperation[];
19
+ /** Authenticated CoreMail HTTPS origin for path-only transfer grants. */
20
+ coreMailTransferOrigin: string;
16
21
  };
17
22
  }
18
23
  export interface IReq_CoreMailPrepareOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_CoreMailPrepareOutboundSubmission> {
@@ -71,12 +76,11 @@ export interface IReq_CoreMailGetOutboundSubmission extends plugins.typedrequest
71
76
  export interface IReq_CoreMailListInboundDeliveries extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_CoreMailListInboundDeliveries> {
72
77
  method: 'coreMailListInboundDeliveries';
73
78
  request: {
74
- afterDeliveryId?: string;
79
+ /** Opaque CoreMail-owned composite cursor. */
80
+ cursor?: string;
75
81
  limit: number;
76
82
  };
77
- response: {
78
- deliveries: ICoreMailInboundDelivery[];
79
- };
83
+ response: ICoreMailInboundDeliveryPage;
80
84
  }
81
85
  export interface IReq_CoreMailPrepareInboundFetch extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_CoreMailPrepareInboundFetch> {
82
86
  method: 'coreMailPrepareInboundFetch';
@@ -119,6 +123,8 @@ export interface IReq_CoreMailAuthenticateControl extends plugins.typedrequestIn
119
123
  };
120
124
  response: {
121
125
  authenticated: true;
126
+ credentialId: string;
127
+ credentialVersion: number;
122
128
  replica: ICoreMailReplicaIdentity;
123
129
  };
124
130
  }
@@ -167,6 +173,7 @@ export interface IReq_CoreMailGatewayAuthenticate extends plugins.typedrequestIn
167
173
  };
168
174
  response: {
169
175
  authenticated: true;
176
+ credentialId: string;
170
177
  credentialVersion: number;
171
178
  /** dcrouter's authoritative, control-plane-bound origin for CoreMail transfer paths. */
172
179
  coreMailTransferOrigin: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/interfaces",
3
- "version": "21.1.0",
3
+ "version": "22.0.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
6
6
  "exports": {
package/readme.md CHANGED
@@ -487,8 +487,12 @@ sessions, Coreflow reconciliation, and the CoreMail-to-dcrouter gateway
487
487
  session. Only the three authentication handshakes carry reusable peer
488
488
  credentials. Subsequent transfer operations may carry a scoped, short-lived,
489
489
  one-time bearer capability, while every subsequent workload request derives
490
- tenant, service, binding, capabilities, allowed senders, and credential version
491
- from the server-owned TypedSocket peer.
490
+ tenant, service, binding, capabilities, allowed senders, and the composite
491
+ credential ID/version identity from the server-owned TypedSocket peer.
492
+ Successful workload authentication also returns the effective binding state and
493
+ the exact `allowedOperations` derived from
494
+ `data.coreMailWorkloadOperationPolicy`. Disabled bindings never authenticate;
495
+ draining bindings permit outbound status plus inbound list/fetch/ack only.
492
496
 
493
497
  Large content never travels inside TypedRequest JSON. Outbound body parts and
494
498
  attachments use prepare/upload/complete operations with short-lived one-time
@@ -496,8 +500,8 @@ HTTP transfer grants. Inbound delivery uses bounded delivery listing followed
496
500
  by prepare/fetch/complete and an explicit acknowledgement after the workload
497
501
  has processed the exact byte count and SHA-256 digest. `data.coreMailLimits`
498
502
  defines the 64 KiB control-frame boundary, bounded structured content, the
499
- 30 MiB serialized MIME ceiling, transfer deadlines, and five-minute grant
500
- lifetime.
503
+ 30 MiB serialized MIME ceiling, a 56 KiB inbound page budget, bounded opaque
504
+ cursors, transfer deadlines, and five-minute grant lifetime.
501
505
 
502
506
  Coreflow applies `data.ICoreMailDesiredState` with a config-epoch
503
507
  compare-and-set fence. It stages the digest-fenced JSON snapshot through a
@@ -526,22 +530,65 @@ canonical environment keys for the verifier-only bootstrap payload and the
526
530
  separate control and gateway secret values; no consumer may derive or embed
527
531
  plaintext material in desired state.
528
532
 
533
+ CoreMail schema v2 keeps durable authority at the stable tenant, service, and
534
+ binding identity while revisions, config epochs, and composite
535
+ `credentialId`/`version` values fence sessions and new actions. Credential
536
+ versions are authority-wide monotonic and unique even when rotation changes the
537
+ credential ID. `active`
538
+ bindings accept new mail, `draining` bindings permit existing status and
539
+ inbound fetch/ack work without accepting new mail, and `disabled` bindings
540
+ reject authentication. Cloudly retains a draining binding until pending
541
+ inbound delivery reaches zero as reported by
542
+ `ICoreMailBindingReconciliationStatus.pendingInboundCount`.
543
+
529
544
  `data.ICoreMailGatewayPeerDesiredState` gives dcrouter the authoritative HTTPS
530
545
  CoreMail transfer origin associated with an authenticated CoreMail service.
531
- The origin is control-plane state and must never be inferred from a socket,
532
- Host header, TypedSocket tag, or unrestricted peer input. The gateway
533
- authentication response repeats dcrouter's bound origin so CoreMail can reject
534
- configuration drift before handing over a path-only transfer grant.
546
+ The same origin is carried in CoreMail desired state and returned by workload
547
+ and gateway authentication. It must never be inferred from a socket, Host
548
+ header, TypedSocket tag, or unrestricted peer input. CoreMail compares both
549
+ authoritative views before handing over a path-only transfer grant.
550
+
551
+ Inbound delivery pagination uses an opaque CoreMail-owned `cursor`, is bounded
552
+ by `data.coreMailLimits.inboundPageSize`, and returns `nextCursor` only when
553
+ another page may exist. Consumers must not construct or parse cursor contents.
554
+ Cursor signing keys are value-free runtime references with one current and bounded
555
+ retiring versions; plaintext remains in resolved runtime secrets.
556
+
557
+ Quota windows are fixed UTC minute/day buckets. A new outbound quota unit is
558
+ consumed only by the first durable insertion of an idempotency identity, while
559
+ replays consume none. Pending inbound includes every state except
560
+ `acknowledged`. These semantics are exported as `data.coreMailQuotaPolicy`.
561
+ Every binding carries finite `messagesPerMinute`, `messagesPerDay`, and
562
+ `maxPendingInbound` values; omitted or unlimited quotas are not valid schema-v2
563
+ desired state.
564
+ `data.coreMailRetentionPolicy` retains terminal outbound,
565
+ acknowledged inbound, and idempotency receipts for 30 days and expired
566
+ capabilities for 24 hours. Pending inbound is never age-purged.
567
+
568
+ HTTP transfers use canonical `/transfers/<uuid>` paths and one-time Bearer
569
+ tokens. `data.coreMailTransferTokenPolicy` requires canonical 256-bit
570
+ base64url token material, while `issuedAt` and `expiresAt` prove the exact
571
+ five-minute lifetime. PUT succeeds with 204 and GET with 200. Content length
572
+ and type must match the grant; digest integrity is bound by grant metadata and repeated in
573
+ the completion RPC rather than an optional HTTP digest header. Apply the
574
+ exported strict normalizers for outbound message descriptors, envelopes,
575
+ method-specific upload/download grants, submissions, gateway outbound
576
+ statuses, inbound deliveries,
577
+ desired state, bootstrap state, and gateway-peer state at their corresponding
578
+ untrusted request and response boundaries.
535
579
 
536
580
  Control and gateway credential rotation is ordered: provision the candidate
537
581
  plaintext through resolved runtime secrets, publish and activate the matching
538
582
  `argon2id-v1` verifier, roll or reconnect every affected replica, observe
539
583
  per-task authentication and readiness, then mark the previous verifier
540
584
  `retiring` with `acceptUntil`. Remove the previous verifier and secret only
541
- after its acceptance window has elapsed and no session uses that version.
585
+ after its acceptance window has elapsed and no session uses that composite
586
+ credential identity.
542
587
  Reconciliation status carries the exact CoreMail task, rollout generation, and
543
588
  image digest so Coreflow can correlate every response with its authoritative
544
- current task roster.
589
+ current task roster. Apply `data.normalizeCoreMailReconciliationStatus` before
590
+ using pending-inbound or composite active-session counts for drain and rotation
591
+ decisions.
545
592
 
546
593
  Request groups are exported by product area:
547
594
 
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '21.1.0',
6
+ version: '22.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  }