@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.
- package/.smartconfig.json +1 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.jmapclient.d.ts +22 -13
- package/dist_ts/classes.jmapclient.js +294 -153
- package/dist_ts/classes.jmapserver.d.ts +49 -4
- package/dist_ts/classes.jmapserver.js +852 -330
- package/dist_ts/interfaces.backend.d.ts +19 -0
- package/dist_ts/interfaces.backend.js +1 -1
- package/package.json +5 -6
- package/readme.md +36 -5
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.jmapclient.ts +360 -157
- package/ts/classes.jmapserver.ts +1271 -439
- package/ts/interfaces.backend.ts +21 -0
package/ts/interfaces.backend.ts
CHANGED
|
@@ -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
|
|