@mengine/medeo-client 2.0.1-alpha.5 → 2.0.1-alpha.7

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.
@@ -25,8 +25,13 @@ function newRelayDoc() {
25
25
  /** Load a detached relay doc from a stored snapshot. */
26
26
  function relayDocFromSnapshot(snapshot) {
27
27
  const doc = newRelayDoc();
28
- doc.import(snapshot);
29
- return doc;
28
+ try {
29
+ doc.import(snapshot);
30
+ return doc;
31
+ } catch (error) {
32
+ doc.free();
33
+ throw error;
34
+ }
30
35
  }
31
36
  /** A full-oplog clone (via snapshot round-trip) for non-destructive probing. */
32
37
  function cloneRelayDoc(doc) {
package/dist/relay.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as newRelayDoc, r as relayDocFromSnapshot, t as classifyUpdate } from "./loro-relay-doc-ssdYpuef.js";
1
+ import { n as newRelayDoc, r as relayDocFromSnapshot, t as classifyUpdate } from "./loro-relay-doc-cJSY-uau.js";
2
2
  export { classifyUpdate, newRelayDoc, relayDocFromSnapshot };
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { At as VideoDraft, c as MirrorVideoDocumentAdapter } from "./index-B31KeDzA.js";
1
+ import { c as MirrorVideoDocumentAdapter, jt as VideoDraft } from "./index-CDrPUhBH.js";
2
2
 
3
3
  //#region src/testing/in-memory-mengine-server.d.ts
4
4
  /**
@@ -55,7 +55,7 @@ interface SeedOptions {
55
55
  mainTrack?: string[];
56
56
  }
57
57
  declare function createTestDraft(): VideoDraft;
58
- declare function createSeededDoc(docId: string, opts?: SeedOptions, actor?: `${number}`): MirrorVideoDocumentAdapter;
58
+ declare function createSeededDoc(_docId: string, opts?: SeedOptions, actor?: `${number}`): MirrorVideoDocumentAdapter;
59
59
  declare function mainTrackPartIds(doc: MirrorVideoDocumentAdapter): string[];
60
60
  //#endregion
61
61
  export { ACTOR_TEST, InMemoryMengineServer, SeedOptions, createSeededDoc, createTestDraft, mainTrackPartIds };
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Ct as base64ToBytes, _t as VIDEO_DOCUMENT_SCHEMA_VERSION, s as createMirrorVideoDocumentAdapter, wt as bytesToBase64 } from "./document-Bzzcn3g7.js";
2
- import { t as classifyUpdate } from "./loro-relay-doc-ssdYpuef.js";
1
+ import { St as bytesToBase64, o as createMirrorVideoDocumentAdapter, xt as base64ToBytes } from "./document-Bnxm1p5E.js";
2
+ import { t as classifyUpdate } from "./loro-relay-doc-cJSY-uau.js";
3
3
  import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
4
4
  //#region src/testing/in-memory-mengine-server.ts
5
5
  /**
@@ -32,7 +32,7 @@ var InMemoryMengineServer = class {
32
32
  const method = (init?.method ?? "GET").toUpperCase();
33
33
  const path = this.parsePath(url);
34
34
  if (path === "snapshot" && method === "GET") return this.handleSnapshot();
35
- if (path.startsWith("bootstrap") && method === "POST") return this.handleBootstrap(init);
35
+ if (/^\/internal\/mengine\/v1\/docs\/[^/]+\/bootstrap$/.test(new URL(url).pathname) && method === "POST") return this.handleBootstrap(init);
36
36
  if (path.startsWith("sync") && method === "GET") return this.handleSync(url);
37
37
  if (path === "updates" && method === "POST") return this.handlePush(init);
38
38
  if (path === "events" && method === "GET") return this.handleEvents(init);
@@ -364,23 +364,8 @@ function createTestDraft() {
364
364
  version: 1
365
365
  };
366
366
  }
367
- function createSeededDoc(docId, opts = {}, actor = ACTOR_TEST) {
367
+ function createSeededDoc(_docId, opts = {}, actor = ACTOR_TEST) {
368
368
  return createMirrorVideoDocumentAdapter({
369
- meta: {
370
- schema_version: VIDEO_DOCUMENT_SCHEMA_VERSION,
371
- draft_id: docId,
372
- project_id: "project-test",
373
- owner_id: "owner-test",
374
- thumbnail_storage_key: "thumb-test",
375
- chat_session_id: "chat-test",
376
- video_creation_settings: {
377
- aspect_ratio: "16:9",
378
- voice_id: "test-voice",
379
- video_style_id: null,
380
- asset_sources: []
381
- },
382
- version: 1
383
- },
384
369
  timeline: { unit_time_ms: 33.33 },
385
370
  tracks: [{
386
371
  id: "main_track",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mengine/medeo-client",
3
- "version": "2.0.1-alpha.5",
3
+ "version": "2.0.1-alpha.7",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,25 +26,25 @@
26
26
  "dependencies": {
27
27
  "@noble/hashes": "^2.4.0",
28
28
  "immer": "^10.2.0",
29
- "loro-mirror": "^2.2.0",
29
+ "loro-mirror": "^2.3.3",
30
30
  "zod": "^4.4.3",
31
- "@mengine/sync": "2.0.1-alpha.5",
32
- "@mengine/storage": "2.0.1-alpha.5",
33
- "@mengine/utils": "2.0.1-alpha.5"
31
+ "@mengine/storage": "2.0.1-alpha.7",
32
+ "@mengine/sync": "2.0.1-alpha.7",
33
+ "@mengine/utils": "2.0.1-alpha.7"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^25.9.1",
37
37
  "@typescript/native-preview": "7.0.0-dev.20260521.1",
38
- "loro-crdt": "^1.13.6",
38
+ "loro-crdt": "^1.16.1",
39
39
  "tsx": "^4.22.3",
40
40
  "typescript": "^6.0.3",
41
41
  "vite-plugin-wasm": "^3.6.0",
42
42
  "vite-plus": "^0.1.23",
43
- "@mengine/medeo-dsl": "0.0.0",
44
- "@mengine/idl-codegen": "0.0.0"
43
+ "@mengine/idl-codegen": "0.0.0",
44
+ "@mengine/medeo-dsl": "0.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "loro-crdt": "^1.13.6"
47
+ "loro-crdt": "^1.16.1"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "vp pack",