@loro-dev/streams-crdt 0.6.1 → 0.7.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/README.md CHANGED
@@ -20,7 +20,7 @@ Transport layer for synchronizing CRDT state over
20
20
  | `deleteStream()` | Deletes the stream. Closes any active `join()` first. |
21
21
  | `sync()` | One-shot bootstrap/catch-up cycle. Syncs remote state into local CRDT and pushes any local changes to the server. Does **not** enter live mode. |
22
22
  | `join()` | Initial sync **plus** live subscription. Internally performs the same sync as `sync()`, then enters a persistent SSE/long-poll read loop and starts forwarding local writes. No need to call `sync()` before `join()`. |
23
- | `close()` | Closes any active join and releases resources. |
23
+ | `close()` | Closes any active join and releases resources. If this instance was using `appendWriteOnly()`, that write-only path is also torn down and cannot be used again on the same instance. |
24
24
 
25
25
  > **`join()` includes an initial sync.** You do not need to call `sync()` before
26
26
  > `join()`. When `join()` resolves, the local CRDT is already caught up with
@@ -210,6 +210,303 @@ const transport = new StreamsCrdt({
210
210
  If your callback already returns a fresh token every time, you can ignore the
211
211
  `context` argument.
212
212
 
213
+ ## End-to-End Encryption (E2EE)
214
+
215
+ `e2ee` enables end-to-end encryption for CRDT update batches and snapshots
216
+ before their bytes are appended to Durable Streams. Auth stays separate:
217
+ gateway tokens authorize HTTP requests, while document keys protect document
218
+ bytes from the server and unauthorized readers.
219
+
220
+ `payloadProtection` remains available as a deprecated alias for compatibility.
221
+ Do not pass both `e2ee` and `payloadProtection` on the same `StreamsCrdt`
222
+ instance.
223
+
224
+ When `e2ee` is omitted, streams-crdt keeps the current plaintext
225
+ wire format. When it is present, the transport still uses
226
+ `application/octet-stream`, but update batches and snapshots may carry an
227
+ encrypted envelope inside the existing length-prefixed framing.
228
+
229
+ For the design rationale and wire format, see
230
+ [`docs/plans/2026-04-09-streams-crdt-payload-protection-design.md`](../../docs/plans/2026-04-09-streams-crdt-payload-protection-design.md).
231
+
232
+ ```ts
233
+ const roomKey = new Uint8Array(32); // Load this from your own key store.
234
+ crypto.getRandomValues(roomKey);
235
+
236
+ const transport = new StreamsCrdt({
237
+ streamUrl,
238
+ adapter: createLoroDocAdapter(doc),
239
+ e2ee: {
240
+ // Defaults when e2ee is present:
241
+ readPolicy: "encrypted-only",
242
+ writePolicy: "encrypt",
243
+ encryption: {
244
+ // Stable application identity. Prefer bucket/stream identity over a full
245
+ // gateway URL so proxy/host changes do not break decryption.
246
+ scope: { bucketId: "my-bucket", streamId: "doc-1" },
247
+ writeKey: { id: "room-key-v1", key: roomKey },
248
+ // Optional. When omitted, writeKey is also the only read key.
249
+ readKeys: async () => [{ id: "room-key-v1", key: roomKey }],
250
+ },
251
+ },
252
+ });
253
+ ```
254
+
255
+ Encrypted streams still use `application/octet-stream`. The transport keeps a
256
+ plaintext length-prefix frame around each encrypted envelope, so catch-up reads
257
+ can concatenate several appends and clients can still recover payload
258
+ boundaries.
259
+
260
+ ### E2EE Protocol Summary
261
+
262
+ E2EE wraps the existing transport framing; it does not replace it.
263
+
264
+ Encrypted update appends use this pipeline:
265
+
266
+ ```text
267
+ adapter.exportUpdates()
268
+ -> encodeItems(clearUpdates)
269
+ -> encrypt(kind = "update_batch")
270
+ -> encodeItems([encryptedEnvelope])
271
+ -> POST body
272
+ ```
273
+
274
+ Encrypted snapshots use:
275
+
276
+ ```text
277
+ exportSnapshot -> snapshotCodec.compress -> encrypt(kind = "snapshot")
278
+ decrypt(kind = "snapshot") -> snapshotCodec.decompress -> applySnapshot
279
+ ```
280
+
281
+ Envelope v1 is:
282
+
283
+ ```text
284
+ magic 4 bytes "LSCE"
285
+ version 1 byte 0x01
286
+ kind 1 byte 0x01 update_batch, 0x02 snapshot
287
+ suite 1 byte 0x01 aes_256_gcm
288
+ key_id_len 1 byte
289
+ nonce_len 1 byte expected 12
290
+ reserved 1 byte 0
291
+ key_id key_id_len bytes, UTF-8
292
+ nonce nonce_len bytes
293
+ ciphertext_and_tag remaining bytes
294
+ ```
295
+
296
+ AEAD additional authenticated data (AAD) is constructed from stable local
297
+ context:
298
+
299
+ ```json
300
+ {
301
+ "protocol": "loro-streams-crdt-payload-protection",
302
+ "version": 1,
303
+ "kind": "update_batch",
304
+ "suite": "aes_256_gcm",
305
+ "keyId": "room-key-v1",
306
+ "scope": { "bucketId": "my-bucket", "streamId": "doc-1" }
307
+ }
308
+ ```
309
+
310
+ AAD is not stored as a separate field on the wire. Parts of it live in the
311
+ envelope header; `scope` comes from the local `e2ee.encryption.scope`
312
+ config. Keep `scope` stable and avoid full gateway URLs, otherwise old encrypted
313
+ history may become unreadable after host or proxy changes.
314
+
315
+ ### Mode Matrix
316
+
317
+ `e2ee` supports a few distinct shapes. Choose one explicitly:
318
+
319
+ | Use case | `readPolicy` | `writePolicy` | Required encryption config | Remote plaintext accepted? | Local writes sent as |
320
+ | --- | --- | --- | --- | --- | --- |
321
+ | Existing plaintext stream | omitted | omitted | none | Yes | plaintext |
322
+ | Private reader/writer | `encrypted-only` (default) | `encrypt` (default) | `scope` + `writeKey` | No | encrypted |
323
+ | Mixed private reader/writer | `allow-plaintext` | `encrypt` | `scope` + `writeKey` | Yes | encrypted |
324
+ | Public write-only writer | `allow-plaintext` | `plaintext` | none | Yes | plaintext via `appendWriteOnly()` |
325
+ | Encrypted reader without a write key | `encrypted-only` | `plaintext` | `scope` + `readKeys` | No | plaintext if local writes are exported |
326
+
327
+ There is no separate transport-level "read-only mode" in v1. The last row is
328
+ only appropriate when the local CRDT is treated as read-only or the caller's
329
+ auth rejects writes. `writePolicy: "plaintext"` avoids requiring a write key; it
330
+ does not suppress local export attempts by itself.
331
+
332
+ ### Adapter Compatibility: Loro and Flock
333
+
334
+ `e2ee` is adapter-agnostic at the transport layer: the same
335
+ options shape works with `createLoroDocAdapter(doc)` and `createFlockAdapter(flock)`.
336
+ Encryption wraps the CRDT payload bytes that the adapter already exports.
337
+
338
+ That also means one stream must use exactly one CRDT family:
339
+
340
+ - A stream written with the Loro adapter must be read with the Loro adapter.
341
+ - A stream written with the Flock adapter must be read with the Flock adapter.
342
+ - Do not mix Loro and Flock replicas against the same stream, whether payload
343
+ protection is enabled or not. The decrypted inner update bytes and snapshots
344
+ are CRDT-specific and are not cross-compatible.
345
+
346
+ Protected Loro room:
347
+
348
+ ```ts
349
+ import { LoroDoc } from "loro-crdt";
350
+ import {
351
+ createLoroDocAdapter,
352
+ StreamsCrdt,
353
+ } from "@loro-dev/streams-crdt/loro";
354
+
355
+ const doc = new LoroDoc();
356
+ const loroTransport = new StreamsCrdt({
357
+ streamUrl,
358
+ adapter: createLoroDocAdapter(doc),
359
+ e2ee: {
360
+ encryption: {
361
+ scope: { bucketId: "my-bucket", streamId: "doc-1" },
362
+ writeKey: { id: "room-key-v1", key: roomKey },
363
+ },
364
+ },
365
+ });
366
+ ```
367
+
368
+ Protected Flock room:
369
+
370
+ ```ts
371
+ import { Flock } from "@loro-dev/flock-wasm";
372
+ import {
373
+ createFlockAdapter,
374
+ StreamsCrdt,
375
+ } from "@loro-dev/streams-crdt/flock";
376
+
377
+ const flock = new Flock();
378
+ const flockTransport = new StreamsCrdt({
379
+ streamUrl,
380
+ adapter: createFlockAdapter(flock),
381
+ e2ee: {
382
+ encryption: {
383
+ scope: { bucketId: "my-bucket", streamId: "room-1" },
384
+ writeKey: { id: "room-key-v1", key: roomKey },
385
+ },
386
+ },
387
+ });
388
+ ```
389
+
390
+ If one application stack uses Loro and another uses Flock, give them separate
391
+ streams. Reusing the same key material across those streams is an application
392
+ decision; it does not make the CRDT payloads interoperable.
393
+
394
+ ### Private E2EE Room
395
+
396
+ This is the default protected mode: all retained updates and snapshots are
397
+ encrypted, and readers reject any plaintext payload that appears in the stream.
398
+
399
+ ```ts
400
+ const privateReaderWriter = new StreamsCrdt({
401
+ streamUrl,
402
+ adapter: createLoroDocAdapter(doc),
403
+ e2ee: {
404
+ encryption: {
405
+ scope: { bucketId: "my-bucket", streamId: "doc-1" },
406
+ writeKey: { id: "private-v1", key: roomKey },
407
+ // Optional. Keep old keys here during rotation.
408
+ readKeys: async () => [{ id: "private-v1", key: roomKey }],
409
+ },
410
+ },
411
+ });
412
+ ```
413
+
414
+ ### Mixed Plaintext and Encrypted Updates
415
+
416
+ Some applications intentionally allow public writers to append CRDT updates but
417
+ not read private history. Configure readers explicitly before accepting those
418
+ plaintext updates:
419
+
420
+ ```ts
421
+ const privateReaderWriter = new StreamsCrdt({
422
+ streamUrl,
423
+ adapter: createLoroDocAdapter(doc),
424
+ e2ee: {
425
+ readPolicy: "allow-plaintext",
426
+ writePolicy: "encrypt",
427
+ encryption: {
428
+ scope: { bucketId: "my-bucket", streamId: "doc-1" },
429
+ writeKey: { id: "private-v1", key: roomKey },
430
+ },
431
+ },
432
+ });
433
+ ```
434
+
435
+ Plaintext writers should opt in just as explicitly:
436
+
437
+ ```ts
438
+ const publicWriter = new StreamsCrdt({
439
+ streamUrl,
440
+ adapter: createLoroDocAdapter(publicDoc),
441
+ auth: async () => getWriteOnlyToken(),
442
+ e2ee: {
443
+ readPolicy: "allow-plaintext",
444
+ writePolicy: "plaintext",
445
+ },
446
+ });
447
+
448
+ publicDoc.getText("comments").insert(0, "public note");
449
+ const appended = await publicWriter.appendWriteOnly();
450
+ ```
451
+
452
+ ### Behavior and Validation Rules
453
+
454
+ - If `e2ee` is present and no policies are specified, the defaults
455
+ are `readPolicy: "encrypted-only"` and `writePolicy: "encrypt"`.
456
+ - `writePolicy: "encrypt"` requires `e2ee.encryption.scope` and
457
+ `e2ee.encryption.writeKey`.
458
+ - Any client that needs to decrypt encrypted payloads must provide
459
+ `e2ee.encryption.scope` plus at least one read key. If
460
+ `readKeys` is omitted, the current `writeKey` is also used as the only read
461
+ key.
462
+ - `payloadProtection` is a deprecated alias for `e2ee`. Passing both is an
463
+ error.
464
+ - `appendWriteOnly()` is the write-only path. It only posts local CRDT batches
465
+ that this transport observed after construction. It does not bootstrap, catch
466
+ up, join SSE, upload snapshots, apply remote updates, or persist a remote
467
+ cursor.
468
+ - `appendWriteOnly()` must not be mixed with `sync()` or `join()` on the same
469
+ transport instance.
470
+ - After `close()`, `appendWriteOnly()` is permanently unavailable on that
471
+ instance because the write-only subscription has been released. Create a new
472
+ `StreamsCrdt` instance for later write-only use.
473
+ - Snapshot uploads are encrypted when `writePolicy` is `"encrypt"`. Snapshot
474
+ upload is rejected when `writePolicy` is `"plaintext"`; a public writer that
475
+ cannot read private state should not publish full-document snapshots.
476
+ - Protected read failures stop before `applySnapshot()`,
477
+ `applyRemoteUpdates()`, local durability hooks, or remote cursor persistence.
478
+ - Writers always encrypt with the current `writeKey`. Keep old keys in
479
+ `readKeys` until retained encrypted history and encrypted snapshots no longer
480
+ reference them.
481
+ - Encryption adds envelope overhead. The transport enforces the 256 KB batch
482
+ cap against the encoded on-wire bytes, so a batch near the limit may split
483
+ earlier under encryption than it would in plaintext mode.
484
+
485
+ If `e2ee` is configured and `readPolicy` is left at the default
486
+ `"encrypted-only"`, remote plaintext updates fail with
487
+ `code: "payload_protection_error"` and `reason: "plaintext_forbidden"`.
488
+
489
+ ### E2EE Errors
490
+
491
+ E2EE-related transport failures surface as
492
+ `code: "payload_protection_error"` with one of these reasons:
493
+
494
+ | Reason | Meaning |
495
+ | --- | --- |
496
+ | `plaintext_forbidden` | A reader configured as `encrypted-only` saw plaintext data in the stream. |
497
+ | `missing_read_key` | The envelope `keyId` does not exist in the configured `readKeys`. |
498
+ | `decrypt_failed` | AES-GCM authentication failed. This usually means the wrong key, wrong scope, or tampered/corrupted bytes. |
499
+ | `invalid_envelope` | The payload was not a supported streams-crdt encrypted envelope. |
500
+ | `wrong_payload_kind` | An encrypted snapshot was used where an update batch was expected, or the reverse. |
501
+ | `encrypt_failed` | Local write-side encryption could not proceed because the key/config/input was invalid. |
502
+
503
+ Callers usually treat these as operator or configuration errors, not transient
504
+ network failures. They are always returned as `retryable: false`.
505
+
506
+ E2EE does **not** hide stream URLs, offsets, payload sizes, timing
507
+ or auth metadata, and it does not detect a malicious server rolling back or
508
+ forking history.
509
+
213
510
  ## Remote Cursor Store
214
511
 
215
512
  The `RemoteCursorStore` persists **replay progress metadata only** — it does
@@ -473,6 +770,13 @@ const transport = new StreamsCrdt({
473
770
  - `TransportSubscription` — active live subscription handle
474
771
  - `TransportRoomStatus` — `"joined" | "reconnecting" | "disconnected" | "error"`
475
772
  - `SnapshotCodec`, `SnapshotTransformHook` — full snapshot encode/decode hooks
773
+ - `WriteOnlyAppendResult` — result returned by `appendWriteOnly()`
774
+ - `E2eeError` — local error class thrown by low-level E2EE helpers before
775
+ conversion into `TransportError`
776
+ - `E2eeOptions`, `E2eeKey`, `E2eeScope`, `E2eeEncryptionOptions`
777
+ — E2EE configuration types
778
+ - `PayloadProtectionError`, `PayloadProtectionOptions`, `PayloadProtectionKey`,
779
+ `PayloadProtectionScope` — deprecated compatibility aliases
476
780
  - `SnapshotUploadOptions` — snapshot upload configuration
477
781
  - `RemoteCursor` — replay progress metadata
478
782
  - `RemoteCursorStore` — abstract cursor storage interface
package/dist/flock.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as RemoteCursorSaveSource, C as TransportSyncSuccess, D as IndexedDbRemoteCursorStore, E as InMemoryRemoteCursorStore, M as createInitialRemoteCursor, O as IndexedDbRemoteCursorStoreOptions, S as TransportSubscription, T as BeforeRemoteCursorSaveHook, _ as TransportCreateStreamSuccess, a as CrdtAdapter, b as TransportJoinParams, c as JsonObject, d as SnapshotCodec, f as SnapshotTransformHook, g as StreamsCrdtOptions, h as StreamsAuthProvider, i as StreamsCrdt, j as RemoteCursorStore, k as RemoteCursor, l as JsonValue, m as StreamsAuthContext, n as isValidBucketId, o as CrdtUpdateBatch, p as SnapshotUploadOptions, r as isValidRillId, s as IsolatedCrdtAdapter, t as createStreamUrl, u as Result, v as TransportDeleteStreamSuccess, w as BeforeRemoteCursorSaveContext, x as TransportRoomStatus, y as TransportError } from "./stream-id-Dr8ZBpUQ.js";
1
+ import { A as StreamsAuthProvider, B as WriteOnlyAppendResult, C as PayloadProtectionScope, D as SnapshotTransformHook, E as SnapshotCodec, F as TransportJoinParams, G as IndexedDbRemoteCursorStoreOptions, H as BeforeRemoteCursorSaveHook, I as TransportRoomStatus, J as RemoteCursorStore, K as RemoteCursor, L as TransportSnapshotUploadSuccess, M as TransportCreateStreamSuccess, N as TransportDeleteStreamSuccess, O as SnapshotUploadOptions, P as TransportError, R as TransportSubscription, S as PayloadProtectionReadPolicy, T as Result, U as InMemoryRemoteCursorStore, V as BeforeRemoteCursorSaveContext, W as IndexedDbRemoteCursorStore, Y as createInitialRemoteCursor, _ as JsonValue, a as StreamsCrdt, b as PayloadProtectionKeyProvider, c as E2eeEncryptionOptions, d as E2eeOptions, f as E2eeReadPolicy, g as JsonObject, h as IsolatedCrdtAdapter, i as PayloadProtectionError, j as StreamsCrdtOptions, k as StreamsAuthContext, l as E2eeKey, m as E2eeWritePolicy, n as isValidBucketId, o as CrdtAdapter, p as E2eeScope, q as RemoteCursorSaveSource, r as isValidRillId, s as CrdtUpdateBatch, t as createStreamUrl, u as E2eeKeyProvider, v as PayloadProtectionEncryptionOptions, w as PayloadProtectionWritePolicy, x as PayloadProtectionOptions, y as PayloadProtectionKey, z as TransportSyncSuccess } from "./stream-id-CS7SzuLW.js";
2
2
  import { ExportBundle, Flock, VersionVector, VersionVector as VersionVector$1 } from "@loro-dev/flock-wasm";
3
3
 
4
4
  //#region src/flock.d.ts
@@ -7,5 +7,5 @@ import { ExportBundle, Flock, VersionVector, VersionVector as VersionVector$1 }
7
7
  */
8
8
  declare function createFlockAdapter(flock: Flock): CrdtAdapter<VersionVector$1>;
9
9
  //#endregion
10
- export { BeforeRemoteCursorSaveContext, BeforeRemoteCursorSaveHook, CrdtAdapter, CrdtUpdateBatch, type ExportBundle, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, IndexedDbRemoteCursorStoreOptions, IsolatedCrdtAdapter, JsonObject, JsonValue, RemoteCursor, RemoteCursorSaveSource, RemoteCursorStore, Result, SnapshotCodec, SnapshotTransformHook, SnapshotUploadOptions, StreamsAuthContext, StreamsAuthProvider, StreamsCrdt, StreamsCrdtOptions, TransportCreateStreamSuccess, TransportDeleteStreamSuccess, TransportError, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncSuccess, type VersionVector, createFlockAdapter, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
10
+ export { BeforeRemoteCursorSaveContext, BeforeRemoteCursorSaveHook, CrdtAdapter, CrdtUpdateBatch, E2eeEncryptionOptions, PayloadProtectionError as E2eeError, PayloadProtectionError, E2eeKey, E2eeKeyProvider, E2eeOptions, E2eeReadPolicy, E2eeScope, E2eeWritePolicy, type ExportBundle, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, IndexedDbRemoteCursorStoreOptions, IsolatedCrdtAdapter, JsonObject, JsonValue, PayloadProtectionEncryptionOptions, PayloadProtectionKey, PayloadProtectionKeyProvider, PayloadProtectionOptions, PayloadProtectionReadPolicy, PayloadProtectionScope, PayloadProtectionWritePolicy, RemoteCursor, RemoteCursorSaveSource, RemoteCursorStore, Result, SnapshotCodec, SnapshotTransformHook, SnapshotUploadOptions, StreamsAuthContext, StreamsAuthProvider, StreamsCrdt, StreamsCrdtOptions, TransportCreateStreamSuccess, TransportDeleteStreamSuccess, TransportError, TransportJoinParams, TransportRoomStatus, TransportSnapshotUploadSuccess, TransportSubscription, TransportSyncSuccess, type VersionVector, WriteOnlyAppendResult, createFlockAdapter, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
11
11
  //# sourceMappingURL=flock.d.ts.map
package/dist/flock.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as InMemoryRemoteCursorStore, i as StreamsCrdt, n as isValidBucketId, o as IndexedDbRemoteCursorStore, r as isValidRillId, s as createInitialRemoteCursor, t as createStreamUrl } from "./stream-id-0dTFsiaO.js";
1
+ import { a as PayloadProtectionError, c as createInitialRemoteCursor, i as StreamsCrdt, n as isValidBucketId, o as InMemoryRemoteCursorStore, r as isValidRillId, s as IndexedDbRemoteCursorStore, t as createStreamUrl } from "./stream-id-CbVwCS3g.js";
2
2
  import { Flock } from "@loro-dev/flock-wasm";
3
3
  //#region src/flock.ts
4
4
  function isAfter(entry, current) {
@@ -149,6 +149,6 @@ function createFlockAdapter(flock) {
149
149
  };
150
150
  }
151
151
  //#endregion
152
- export { InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, StreamsCrdt, createFlockAdapter, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
152
+ export { PayloadProtectionError as E2eeError, PayloadProtectionError, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, StreamsCrdt, createFlockAdapter, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
153
153
 
154
154
  //# sourceMappingURL=flock.js.map
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as RemoteCursorSaveSource, C as TransportSyncSuccess, D as IndexedDbRemoteCursorStore, E as InMemoryRemoteCursorStore, M as createInitialRemoteCursor, O as IndexedDbRemoteCursorStoreOptions, S as TransportSubscription, T as BeforeRemoteCursorSaveHook, _ as TransportCreateStreamSuccess, a as CrdtAdapter, b as TransportJoinParams, c as JsonObject, d as SnapshotCodec, f as SnapshotTransformHook, g as StreamsCrdtOptions, h as StreamsAuthProvider, i as StreamsCrdt, j as RemoteCursorStore, k as RemoteCursor, l as JsonValue, m as StreamsAuthContext, n as isValidBucketId, o as CrdtUpdateBatch, p as SnapshotUploadOptions, r as isValidRillId, s as IsolatedCrdtAdapter, t as createStreamUrl, u as Result, v as TransportDeleteStreamSuccess, w as BeforeRemoteCursorSaveContext, x as TransportRoomStatus, y as TransportError } from "./stream-id-Dr8ZBpUQ.js";
2
- export { BeforeRemoteCursorSaveContext, BeforeRemoteCursorSaveHook, CrdtAdapter, CrdtUpdateBatch, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, IndexedDbRemoteCursorStoreOptions, IsolatedCrdtAdapter, JsonObject, JsonValue, RemoteCursor, RemoteCursorSaveSource, RemoteCursorStore, Result, SnapshotCodec, SnapshotTransformHook, SnapshotUploadOptions, StreamsAuthContext, StreamsAuthProvider, StreamsCrdt, StreamsCrdtOptions, TransportCreateStreamSuccess, TransportDeleteStreamSuccess, TransportError, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncSuccess, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
1
+ import { A as StreamsAuthProvider, B as WriteOnlyAppendResult, C as PayloadProtectionScope, D as SnapshotTransformHook, E as SnapshotCodec, F as TransportJoinParams, G as IndexedDbRemoteCursorStoreOptions, H as BeforeRemoteCursorSaveHook, I as TransportRoomStatus, J as RemoteCursorStore, K as RemoteCursor, L as TransportSnapshotUploadSuccess, M as TransportCreateStreamSuccess, N as TransportDeleteStreamSuccess, O as SnapshotUploadOptions, P as TransportError, R as TransportSubscription, S as PayloadProtectionReadPolicy, T as Result, U as InMemoryRemoteCursorStore, V as BeforeRemoteCursorSaveContext, W as IndexedDbRemoteCursorStore, Y as createInitialRemoteCursor, _ as JsonValue, a as StreamsCrdt, b as PayloadProtectionKeyProvider, c as E2eeEncryptionOptions, d as E2eeOptions, f as E2eeReadPolicy, g as JsonObject, h as IsolatedCrdtAdapter, i as PayloadProtectionError, j as StreamsCrdtOptions, k as StreamsAuthContext, l as E2eeKey, m as E2eeWritePolicy, n as isValidBucketId, o as CrdtAdapter, p as E2eeScope, q as RemoteCursorSaveSource, r as isValidRillId, s as CrdtUpdateBatch, t as createStreamUrl, u as E2eeKeyProvider, v as PayloadProtectionEncryptionOptions, w as PayloadProtectionWritePolicy, x as PayloadProtectionOptions, y as PayloadProtectionKey, z as TransportSyncSuccess } from "./stream-id-CS7SzuLW.js";
2
+ export { BeforeRemoteCursorSaveContext, BeforeRemoteCursorSaveHook, CrdtAdapter, CrdtUpdateBatch, E2eeEncryptionOptions, PayloadProtectionError as E2eeError, PayloadProtectionError, E2eeKey, E2eeKeyProvider, E2eeOptions, E2eeReadPolicy, E2eeScope, E2eeWritePolicy, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, IndexedDbRemoteCursorStoreOptions, IsolatedCrdtAdapter, JsonObject, JsonValue, PayloadProtectionEncryptionOptions, PayloadProtectionKey, PayloadProtectionKeyProvider, PayloadProtectionOptions, PayloadProtectionReadPolicy, PayloadProtectionScope, PayloadProtectionWritePolicy, RemoteCursor, RemoteCursorSaveSource, RemoteCursorStore, Result, SnapshotCodec, SnapshotTransformHook, SnapshotUploadOptions, StreamsAuthContext, StreamsAuthProvider, StreamsCrdt, StreamsCrdtOptions, TransportCreateStreamSuccess, TransportDeleteStreamSuccess, TransportError, TransportJoinParams, TransportRoomStatus, TransportSnapshotUploadSuccess, TransportSubscription, TransportSyncSuccess, WriteOnlyAppendResult, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as InMemoryRemoteCursorStore, i as StreamsCrdt, n as isValidBucketId, o as IndexedDbRemoteCursorStore, r as isValidRillId, s as createInitialRemoteCursor, t as createStreamUrl } from "./stream-id-0dTFsiaO.js";
2
- export { InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, StreamsCrdt, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
1
+ import { a as PayloadProtectionError, c as createInitialRemoteCursor, i as StreamsCrdt, n as isValidBucketId, o as InMemoryRemoteCursorStore, r as isValidRillId, s as IndexedDbRemoteCursorStore, t as createStreamUrl } from "./stream-id-CbVwCS3g.js";
2
+ export { PayloadProtectionError as E2eeError, PayloadProtectionError, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, StreamsCrdt, createInitialRemoteCursor, createStreamUrl, isValidBucketId, isValidRillId };
package/dist/loro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as RemoteCursorSaveSource, C as TransportSyncSuccess, D as IndexedDbRemoteCursorStore, E as InMemoryRemoteCursorStore, M as createInitialRemoteCursor, O as IndexedDbRemoteCursorStoreOptions, S as TransportSubscription, T as BeforeRemoteCursorSaveHook, _ as TransportCreateStreamSuccess, a as CrdtAdapter, b as TransportJoinParams, c as JsonObject, d as SnapshotCodec, f as SnapshotTransformHook, g as StreamsCrdtOptions, h as StreamsAuthProvider, i as StreamsCrdt, j as RemoteCursorStore, k as RemoteCursor, l as JsonValue, m as StreamsAuthContext, n as isValidBucketId, o as CrdtUpdateBatch, p as SnapshotUploadOptions, r as isValidRillId, s as IsolatedCrdtAdapter, t as createStreamUrl, u as Result, v as TransportDeleteStreamSuccess, w as BeforeRemoteCursorSaveContext, x as TransportRoomStatus, y as TransportError } from "./stream-id-Dr8ZBpUQ.js";
1
+ import { A as StreamsAuthProvider, B as WriteOnlyAppendResult, C as PayloadProtectionScope, D as SnapshotTransformHook, E as SnapshotCodec, F as TransportJoinParams, G as IndexedDbRemoteCursorStoreOptions, H as BeforeRemoteCursorSaveHook, I as TransportRoomStatus, J as RemoteCursorStore, K as RemoteCursor, L as TransportSnapshotUploadSuccess, M as TransportCreateStreamSuccess, N as TransportDeleteStreamSuccess, O as SnapshotUploadOptions, P as TransportError, R as TransportSubscription, S as PayloadProtectionReadPolicy, T as Result, U as InMemoryRemoteCursorStore, V as BeforeRemoteCursorSaveContext, W as IndexedDbRemoteCursorStore, Y as createInitialRemoteCursor, _ as JsonValue, a as StreamsCrdt, b as PayloadProtectionKeyProvider, c as E2eeEncryptionOptions, d as E2eeOptions, f as E2eeReadPolicy, g as JsonObject, h as IsolatedCrdtAdapter, i as PayloadProtectionError, j as StreamsCrdtOptions, k as StreamsAuthContext, l as E2eeKey, m as E2eeWritePolicy, n as isValidBucketId, o as CrdtAdapter, p as E2eeScope, q as RemoteCursorSaveSource, r as isValidRillId, s as CrdtUpdateBatch, t as createStreamUrl, u as E2eeKeyProvider, v as PayloadProtectionEncryptionOptions, w as PayloadProtectionWritePolicy, x as PayloadProtectionOptions, y as PayloadProtectionKey, z as TransportSyncSuccess } from "./stream-id-CS7SzuLW.js";
2
2
  import { LoroDoc } from "loro-crdt";
3
3
 
4
4
  //#region src/loro.d.ts
@@ -18,5 +18,5 @@ import { LoroDoc } from "loro-crdt";
18
18
  */
19
19
  declare function createLoroDocAdapter(doc: LoroDoc): CrdtAdapter<JsonObject>;
20
20
  //#endregion
21
- export { BeforeRemoteCursorSaveContext, BeforeRemoteCursorSaveHook, CrdtAdapter, CrdtUpdateBatch, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, IndexedDbRemoteCursorStoreOptions, IsolatedCrdtAdapter, JsonObject, JsonValue, RemoteCursor, RemoteCursorSaveSource, RemoteCursorStore, Result, SnapshotCodec, SnapshotTransformHook, SnapshotUploadOptions, StreamsAuthContext, StreamsAuthProvider, StreamsCrdt, StreamsCrdtOptions, TransportCreateStreamSuccess, TransportDeleteStreamSuccess, TransportError, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncSuccess, createInitialRemoteCursor, createLoroDocAdapter, createStreamUrl, isValidBucketId, isValidRillId };
21
+ export { BeforeRemoteCursorSaveContext, BeforeRemoteCursorSaveHook, CrdtAdapter, CrdtUpdateBatch, E2eeEncryptionOptions, PayloadProtectionError as E2eeError, PayloadProtectionError, E2eeKey, E2eeKeyProvider, E2eeOptions, E2eeReadPolicy, E2eeScope, E2eeWritePolicy, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, IndexedDbRemoteCursorStoreOptions, IsolatedCrdtAdapter, JsonObject, JsonValue, PayloadProtectionEncryptionOptions, PayloadProtectionKey, PayloadProtectionKeyProvider, PayloadProtectionOptions, PayloadProtectionReadPolicy, PayloadProtectionScope, PayloadProtectionWritePolicy, RemoteCursor, RemoteCursorSaveSource, RemoteCursorStore, Result, SnapshotCodec, SnapshotTransformHook, SnapshotUploadOptions, StreamsAuthContext, StreamsAuthProvider, StreamsCrdt, StreamsCrdtOptions, TransportCreateStreamSuccess, TransportDeleteStreamSuccess, TransportError, TransportJoinParams, TransportRoomStatus, TransportSnapshotUploadSuccess, TransportSubscription, TransportSyncSuccess, WriteOnlyAppendResult, createInitialRemoteCursor, createLoroDocAdapter, createStreamUrl, isValidBucketId, isValidRillId };
22
22
  //# sourceMappingURL=loro.d.ts.map
package/dist/loro.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as InMemoryRemoteCursorStore, i as StreamsCrdt, n as isValidBucketId, o as IndexedDbRemoteCursorStore, r as isValidRillId, s as createInitialRemoteCursor, t as createStreamUrl } from "./stream-id-0dTFsiaO.js";
1
+ import { a as PayloadProtectionError, c as createInitialRemoteCursor, i as StreamsCrdt, n as isValidBucketId, o as InMemoryRemoteCursorStore, r as isValidRillId, s as IndexedDbRemoteCursorStore, t as createStreamUrl } from "./stream-id-CbVwCS3g.js";
2
2
  import { LoroDoc, VersionVector, decodeImportBlobMeta } from "loro-crdt";
3
3
  //#region src/loro.ts
4
4
  function batchImportUpdates(doc, updates) {
@@ -126,6 +126,6 @@ function createLoroDocAdapter(doc) {
126
126
  };
127
127
  }
128
128
  //#endregion
129
- export { InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, StreamsCrdt, createInitialRemoteCursor, createLoroDocAdapter, createStreamUrl, isValidBucketId, isValidRillId };
129
+ export { PayloadProtectionError as E2eeError, PayloadProtectionError, InMemoryRemoteCursorStore, IndexedDbRemoteCursorStore, StreamsCrdt, createInitialRemoteCursor, createLoroDocAdapter, createStreamUrl, isValidBucketId, isValidRillId };
130
130
 
131
131
  //# sourceMappingURL=loro.js.map