@push.rocks/smartjmap 2.0.0 → 2.1.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.
@@ -122,6 +122,18 @@ export interface IJmapSubmissionInput {
122
122
  message: Uint8Array;
123
123
  }
124
124
 
125
+ /**
126
+ * Authenticated, admitted upload handed to a streaming backend. The backend
127
+ * must reserve quota before reading `stream`, consume it through EOF, and
128
+ * abort its storage operation when `signal` fires.
129
+ */
130
+ export interface IJmapBlobUploadStream {
131
+ stream: ReadableStream<Uint8Array>;
132
+ size: number;
133
+ type: string;
134
+ signal: AbortSignal;
135
+ }
136
+
125
137
  /** Standard result shape for the /get-style backend reads. */
126
138
  export interface IJmapGetResult<T> {
127
139
  /** Backend-owned opaque state string for the collection at read time. */
@@ -367,6 +379,15 @@ export interface IJmapMailBackend {
367
379
  type: string
368
380
  ): Promise<{ blobId: string; size: number }>;
369
381
 
382
+ /**
383
+ * Optional streaming upload path. When present, JmapServer requires a valid
384
+ * Content-Length and never buffers the request before invoking this method.
385
+ */
386
+ uploadBlobStream?(
387
+ accountId: string,
388
+ upload: IJmapBlobUploadStream
389
+ ): Promise<{ blobId: string; size: number }>;
390
+
370
391
  /** Returns a blob's bytes and metadata, or null when unknown. */
371
392
  getBlob(accountId: string, blobId: string): Promise<IJmapBlobRecord | null>;
372
393