@mengine/medeo-client 3.0.1-dsl.4 → 3.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/README.md +1 -5
- package/dist/{dsl-DgUxcAg3.js → dsl-C0-G8JVT.js} +251 -333
- package/dist/dsl.d.ts +2 -2
- package/dist/dsl.js +2 -2
- package/dist/{index-D1EvUTdG.d.ts → index-BOPcHqIj.d.ts} +48 -30
- package/dist/{index-iEPbMfoP.d.ts → index-C_wwGt5k.d.ts} +3 -7
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -16
- package/dist/testing.d.ts +1 -2
- package/dist/testing.js +14 -35
- package/package.json +6 -8
- package/dist/schemas.d.ts +0 -606
- package/dist/schemas.js +0 -478
package/dist/dsl.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as
|
|
2
|
-
export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type
|
|
1
|
+
import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as RelationTable, B as InvalidAtomic, Bt as TextRun, C as DslClipLayout, Ct as EntityTable, D as createInitialMedeoDsl, Dt as MedeoDslSnapshot, E as DslTrackLayout, Et as FieldPatch, F as DslAudit, Ft as StoredFile, G as MedeoDslLoroState, H as isInvalidAtomic, Ht as Track, I as DslTransaction, It as TextDelta, J as OpActor, K as medeoDslLoroShape, L as UnsupportedDocumentFormatError, Lt as TextEdit, M as VoiceoverResult, Mt as RelationValues, N as CreateMedeoDslOptions, Nt as ResourceSystem, O as DslEditor, Ot as Media, P as MedeoDsl, Pt as RichTextSnapshot, Q as DslClipUpdate, R as assertDslDocument, Rt as TextMark, S as resolveDslLayout, St as EntityMutation, T as DslProjectionError, Tt as EntityValues, U as timeAnchorCodec, Ut as TrackRole, V as captionContentCodec, Vt as TimeAnchor, W as MedeoDslDraft, Wt as Voice, X as AddDslClipsInput, Y as AddDslClip, Z as ClipSource, _ as VideoDraftInput, _t as ContainMutation, a as fromVideoDraft, at as EntityIdKind, b as VideoDraftTrack, bt as DslDiagnostic, c as VideoDraftProjection, ct as resourceId, d as DEFAULT_UNIT_TIME_MS, dt as Caption, et as ReplaceDslClipsInput, f as VideoCreationSettings, ft as CaptionContent, g as VideoDraftContentPartUnion, gt as Clip, h as VideoDraftContent, ht as CaptionText, i as ImportedVideoDraft, it as DslIdFactory, j as VoiceoverCaptionInput, jt as RelationTables, k as UploadText, kt as RelationMutation, l as toVideoDraft, lt as tupleHash, m as VideoDraftCaptionStyle, mt as CaptionStyle, n as normalizeLegacyVideoDraft, nt as BLANK_PLACEHOLDER, o as AudioScriptView, ot as defaultIdFactory, p as VideoDraft, pt as CaptionSelection, q as CommitOptions, r as FromVideoDraftOptions, rt as missingMediaPlaceholder, s as toAudioScriptViews, st as relationId, t as NormalizedLegacyVideoDraft, tt as ClipPlacement, u as CaptionDisplayCue, ut as AudioScript, v as VideoDraftPartUnion, vt as ContainNode, w as DslLayout, wt as EntityTables, x as VideoDraftTrackItem, xt as DslMutation, y as VideoDraftTimeline, yt as DeepReadonly, z as documentFormat, zt as TextMutation } from "./index-BOPcHqIj.js";
|
|
2
|
+
export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, BLANK_PLACEHOLDER, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type NormalizedLegacyVideoDraft, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
package/dist/dsl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId,
|
|
1
|
+
import { C as tupleHash, S as resourceId, _ as DslProjectionError, a as createInitialMedeoDsl, b as defaultIdFactory, c as MedeoDsl, d as documentFormat, f as medeoDslLoroShape, g as resolveDslLayout, h as timeAnchorCodec, i as DEFAULT_UNIT_TIME_MS, l as UnsupportedDocumentFormatError, m as isInvalidAtomic, n as fromVideoDraft, o as DslEditor, p as captionContentCodec, r as toVideoDraft, s as toAudioScriptViews, t as normalizeLegacyVideoDraft, u as assertDslDocument, v as BLANK_PLACEHOLDER, x as relationId, y as missingMediaPlaceholder } from "./dsl-C0-G8JVT.js";
|
|
2
|
+
export { BLANK_PLACEHOLDER, DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
|
@@ -2,7 +2,11 @@ import { ContainerType, Cursor, LoroDoc, PeerID, TreeID } from "loro-crdt";
|
|
|
2
2
|
|
|
3
3
|
//#region ../medeo-dsl/src/types.d.ts
|
|
4
4
|
type TrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Where a resource's bytes live. `placeholder` is no store: its Images stand in for a visual Clip a
|
|
7
|
+
* legacy VideoDraft placed without media ({@link BLANK_PLACEHOLDER}) or with media found missing.
|
|
8
|
+
*/
|
|
9
|
+
type ResourceSystem = 'memota' | 'memota-speech' | 'placeholder';
|
|
6
10
|
interface Track$1 {
|
|
7
11
|
role: TrackRole;
|
|
8
12
|
hidden?: boolean;
|
|
@@ -335,6 +339,22 @@ type EntityIdKind = 'timeline' | 'track' | 'clip' | 'audio-script' | 'segment' |
|
|
|
335
339
|
type DslIdFactory = (kind: EntityIdKind) => string;
|
|
336
340
|
declare const defaultIdFactory: DslIdFactory;
|
|
337
341
|
//#endregion
|
|
342
|
+
//#region ../medeo-dsl/src/fields.d.ts
|
|
343
|
+
/**
|
|
344
|
+
* A placeholder medium is an Image with no file, standing in where a legacy VideoDraft placed a
|
|
345
|
+
* visual clip the old editor drew as a blank (D196). The blank one stands in for a clip placed
|
|
346
|
+
* without media (`origin_media_id: ''`); one keyed by a memota media id stands in for media the
|
|
347
|
+
* clip named but Director found missing, so the id survives. Importing keeps the clips' time on
|
|
348
|
+
* them instead of dropping them. Only migration authors them.
|
|
349
|
+
*/
|
|
350
|
+
declare const BLANK_PLACEHOLDER: {
|
|
351
|
+
readonly system: "placeholder";
|
|
352
|
+
readonly key: "blank";
|
|
353
|
+
readonly kind: "image";
|
|
354
|
+
};
|
|
355
|
+
/** The placeholder for a memota media id Director found missing. */
|
|
356
|
+
declare function missingMediaPlaceholder(mediaId: string): Media;
|
|
357
|
+
//#endregion
|
|
338
358
|
//#region src/dsl/action-context.d.ts
|
|
339
359
|
type ClipPlacement = {
|
|
340
360
|
kind: 'sequential';
|
|
@@ -404,7 +424,7 @@ interface CommitOptions {
|
|
|
404
424
|
actor?: OpActor;
|
|
405
425
|
}
|
|
406
426
|
//#endregion
|
|
407
|
-
//#region ../../node_modules/.pnpm/loro-mirror@2.3.3_patch_hash=a551a0e4aa4f61ec88b0d9e970a183b5ee2955107a2e0bb03b378bc510c2f395_loro-crdt@1.16.
|
|
427
|
+
//#region ../../node_modules/.pnpm/loro-mirror@2.3.3_patch_hash=a551a0e4aa4f61ec88b0d9e970a183b5ee2955107a2e0bb03b378bc510c2f395_loro-crdt@1.16.4/node_modules/loro-mirror/dist/schema/types.d.ts
|
|
408
428
|
/**
|
|
409
429
|
* Options for schema definitions
|
|
410
430
|
*/
|
|
@@ -829,12 +849,20 @@ declare const medeoDslLoroShape: RootSchemaType<{
|
|
|
829
849
|
options: {};
|
|
830
850
|
};
|
|
831
851
|
'phonetic-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
|
|
832
|
-
|
|
852
|
+
phoneme: /*elided*/any;
|
|
853
|
+
system: /*elided*/any;
|
|
854
|
+
key: /*elided*/any;
|
|
855
|
+
storageKey: /*elided*/any;
|
|
856
|
+
digest: /*elided*/any;
|
|
833
857
|
}> & {
|
|
834
858
|
options: {};
|
|
835
859
|
} & {
|
|
836
860
|
catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
|
|
837
|
-
|
|
861
|
+
phoneme: /*elided*/any;
|
|
862
|
+
system: /*elided*/any;
|
|
863
|
+
key: /*elided*/any;
|
|
864
|
+
storageKey: /*elided*/any;
|
|
865
|
+
digest: /*elided*/any;
|
|
838
866
|
}, C>;
|
|
839
867
|
}> & {
|
|
840
868
|
options: {};
|
|
@@ -927,9 +955,8 @@ type ContainDraftNode = Omit<Input['contain-relations'][number], 'id' | 'childre
|
|
|
927
955
|
children: ContainDraftNode[];
|
|
928
956
|
};
|
|
929
957
|
type DraftFields<T> = T extends Cursor ? T : T extends (infer Item)[] ? DraftFields<Item>[] : T extends object ? { [K in keyof T as undefined extends T[K] ? never : K]: DraftFields<T[K]> } & { [K in keyof T as undefined extends T[K] ? K : never]?: DraftFields<T[K]> } : T;
|
|
930
|
-
type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations'
|
|
958
|
+
type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations'>> & {
|
|
931
959
|
'contain-relations': ContainDraftNode[];
|
|
932
|
-
'phonetic-script-entities': Record<string, PhoneticScript>;
|
|
933
960
|
};
|
|
934
961
|
//#endregion
|
|
935
962
|
//#region ../medeo-dsl/src/schema/codec.d.ts
|
|
@@ -953,7 +980,7 @@ declare const captionContentCodec: AtomicCodec<SegmentSelection>;
|
|
|
953
980
|
declare function documentFormat(doc: LoroDoc): 'dsl' | 'legacy' | 'mixed' | 'unknown';
|
|
954
981
|
declare class UnsupportedDocumentFormatError extends Error {
|
|
955
982
|
readonly code = "unsupported_document_format";
|
|
956
|
-
constructor(
|
|
983
|
+
constructor();
|
|
957
984
|
}
|
|
958
985
|
/** Run after initial import, before opening an editable handle. Empty new documents still have one Timeline. */
|
|
959
986
|
declare function assertDslDocument(doc: LoroDoc): void;
|
|
@@ -1030,8 +1057,6 @@ declare class MedeoDsl {
|
|
|
1030
1057
|
applyMutations(mutations: readonly DslMutation[], audit: DslAudit): void;
|
|
1031
1058
|
editText(scriptId: string, segmentId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
|
|
1032
1059
|
editCaptionText(captionId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
|
|
1033
|
-
/** Check the session's write capability before an Action starts host-owned resource I/O. */
|
|
1034
|
-
assertWritable(): void;
|
|
1035
1060
|
/**
|
|
1036
1061
|
* A run inside one segment as native Cursors. Local ranges exclude insertions at their start and
|
|
1037
1062
|
* include insertions at their end. K01 remains deferred.
|
|
@@ -1039,7 +1064,6 @@ declare class MedeoDsl {
|
|
|
1039
1064
|
textRange(scriptId: string, segmentId: string, start: number, end: number): SegmentSelection;
|
|
1040
1065
|
dispose(): void;
|
|
1041
1066
|
private mutate;
|
|
1042
|
-
private assertReadyToWrite;
|
|
1043
1067
|
private notify;
|
|
1044
1068
|
private assertActive;
|
|
1045
1069
|
}
|
|
@@ -1068,9 +1092,9 @@ interface ApplyVoiceoverInput {
|
|
|
1068
1092
|
kind: 'voiceover-recording';
|
|
1069
1093
|
};
|
|
1070
1094
|
/**
|
|
1071
|
-
* What the recording says:
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1095
|
+
* What the recording says: an existing AudioScript, a new one of these `segments`, or a
|
|
1096
|
+
* PhoneticScript it was spoken from. A recording spoken from a PhoneticScript is derived-from it,
|
|
1097
|
+
* and its captions select segments of that variant's base script.
|
|
1074
1098
|
*/
|
|
1075
1099
|
script: {
|
|
1076
1100
|
audioScriptId: string;
|
|
@@ -1777,13 +1801,6 @@ interface VideoDraftProjection {
|
|
|
1777
1801
|
declare function toVideoDraft(snapshot: MedeoDslSnapshot): VideoDraftProjection;
|
|
1778
1802
|
//#endregion
|
|
1779
1803
|
//#region src/dsl/projection/audio-scripts.d.ts
|
|
1780
|
-
/** The script a recording says and its phonetic origins; old direct script origins remain readable. */
|
|
1781
|
-
interface SpokenScript {
|
|
1782
|
-
audioScriptId: string;
|
|
1783
|
-
phoneticScriptId?: string;
|
|
1784
|
-
/** Several plain selections of the same script; the singular summary is omitted. */
|
|
1785
|
-
phoneticScriptIds?: string[];
|
|
1786
|
-
}
|
|
1787
1804
|
/**
|
|
1788
1805
|
* An AudioScript with everything that says or shows it, read from the same snapshot as the
|
|
1789
1806
|
* VideoDraft. Speeches and captions come in playback order.
|
|
@@ -1819,9 +1836,8 @@ interface AudioScriptView {
|
|
|
1819
1836
|
/** Speech Clips playing a recording of these words. */
|
|
1820
1837
|
speeches: {
|
|
1821
1838
|
clipId: string;
|
|
1822
|
-
recordingId: string; /**
|
|
1823
|
-
phoneticScriptId?: string;
|
|
1824
|
-
phoneticScriptIds?: string[];
|
|
1839
|
+
recordingId: string; /** The PhoneticScript the recording was spoken from; absent when it derives from the script directly. */
|
|
1840
|
+
phoneticScriptId?: string;
|
|
1825
1841
|
voices: {
|
|
1826
1842
|
voiceId: string;
|
|
1827
1843
|
key: string;
|
|
@@ -1840,12 +1856,6 @@ interface AudioScriptView {
|
|
|
1840
1856
|
segment: number;
|
|
1841
1857
|
}[];
|
|
1842
1858
|
}
|
|
1843
|
-
/**
|
|
1844
|
-
* The scripts a recording says. It follows derived-from from the recording; a PhoneticScript is a
|
|
1845
|
-
* variant, so its words are the base its phoneme names, and derived-from is not followed past it.
|
|
1846
|
-
* When nothing is found that way, a script read off the recording itself is what it says.
|
|
1847
|
-
*/
|
|
1848
|
-
declare function spokenScripts(snapshot: MedeoDslSnapshot, recordingId: string): SpokenScript[];
|
|
1849
1859
|
/** Every AudioScript in the document with its PhoneticScripts, the Speech Clips saying it and the Caption Clips showing it. */
|
|
1850
1860
|
declare function toAudioScriptViews(snapshot: MedeoDslSnapshot): AudioScriptView[];
|
|
1851
1861
|
//#endregion
|
|
@@ -1862,4 +1872,12 @@ interface ImportedVideoDraft {
|
|
|
1862
1872
|
/** One-time import into a newly owned document; never reverse-diff a live collaborative document. */
|
|
1863
1873
|
declare function fromVideoDraft(input: VideoDraftInput, options: FromVideoDraftOptions): ImportedVideoDraft;
|
|
1864
1874
|
//#endregion
|
|
1865
|
-
|
|
1875
|
+
//#region src/dsl/projection/normalize-legacy-video-draft.d.ts
|
|
1876
|
+
interface NormalizedLegacyVideoDraft {
|
|
1877
|
+
draft: VideoDraftInput;
|
|
1878
|
+
/** One entry per repair, naming the part or field and its value before and after. */
|
|
1879
|
+
diagnostics: DslDiagnostic[];
|
|
1880
|
+
}
|
|
1881
|
+
declare function normalizeLegacyVideoDraft(input: VideoDraftInput, mediaFacts?: readonly Media[]): NormalizedLegacyVideoDraft;
|
|
1882
|
+
//#endregion
|
|
1883
|
+
export { MoveDslClipsInput as $, ApplyVoiceoverInput as A, RelationTable as At, InvalidAtomic as B, TextRun as Bt, DslClipLayout as C, EntityTable as Ct, createInitialMedeoDsl as D, MedeoDslSnapshot as Dt, DslTrackLayout as E, FieldPatch as Et, DslAudit as F, StoredFile as Ft, MedeoDslLoroState as G, isInvalidAtomic as H, Track$1 as Ht, DslTransaction as I, TextDelta as It, OpActor as J, medeoDslLoroShape as K, UnsupportedDocumentFormatError as L, TextEdit as Lt, VoiceoverResult as M, RelationValues as Mt, CreateMedeoDslOptions as N, ResourceSystem as Nt, DslEditor as O, Media as Ot, MedeoDsl as P, RichTextSnapshot as Pt, DslClipUpdate as Q, assertDslDocument as R, TextMark as Rt, resolveDslLayout as S, EntityMutation as St, DslProjectionError as T, EntityValues as Tt, timeAnchorCodec as U, TrackRole as Ut, captionContentCodec as V, TimeAnchor as Vt, MedeoDslDraft as W, Voice as Wt, AddDslClipsInput as X, AddDslClip as Y, ClipSource as Z, VideoDraftInput as _, ContainMutation as _t, fromVideoDraft as a, EntityIdKind as at, VideoDraftTrack as b, DslDiagnostic as bt, VideoDraftProjection as c, resourceId as ct, DEFAULT_UNIT_TIME_MS as d, Caption as dt, ReplaceDslClipsInput as et, VideoCreationSettings as f, CaptionContent as ft, VideoDraftContentPartUnion as g, Clip as gt, VideoDraftContent as h, CaptionText as ht, ImportedVideoDraft as i, DslIdFactory as it, VoiceoverCaptionInput as j, RelationTables as jt, UploadText as k, RelationMutation as kt, toVideoDraft as l, tupleHash as lt, VideoDraftCaptionStyle as m, CaptionStyle$1 as mt, normalizeLegacyVideoDraft as n, BLANK_PLACEHOLDER as nt, AudioScriptView as o, defaultIdFactory as ot, VideoDraft as p, CaptionSelection as pt, CommitOptions as q, FromVideoDraftOptions as r, missingMediaPlaceholder as rt, toAudioScriptViews as s, relationId as st, NormalizedLegacyVideoDraft as t, ClipPlacement as tt, CaptionDisplayCue as u, AudioScript as ut, VideoDraftPartUnion as v, ContainNode as vt, DslLayout as w, EntityTables as wt, VideoDraftTrackItem as x, DslMutation as xt, VideoDraftTimeline as y, DeepReadonly as yt, documentFormat as z, TextMutation as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as MedeoDslSnapshot, Nt as ResourceSystem, O as DslEditor, P as MedeoDsl, Ut as TrackRole, bt as DslDiagnostic, c as VideoDraftProjection, h as VideoDraftContent, k as UploadText, o as AudioScriptView, q as CommitOptions } from "./index-BOPcHqIj.js";
|
|
2
2
|
import { LoroDoc, PeerID, VersionVector } from "loro-crdt";
|
|
3
3
|
import { DocState, LocalSaveState } from "@mengine/sync";
|
|
4
4
|
import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
|
|
@@ -255,7 +255,7 @@ type PushResultKind = 'ack' | 'duplicate' | 'rejected' | 'failed' | 'nothing_to_
|
|
|
255
255
|
*/
|
|
256
256
|
interface PushResult {
|
|
257
257
|
kind: PushResultKind;
|
|
258
|
-
/** Server sequence
|
|
258
|
+
/** Server document sequence observed after a successful `ack` or `duplicate`. */
|
|
259
259
|
mengineUpdateSeq?: number | undefined;
|
|
260
260
|
/** @deprecated Ack-only sequence retained until consumers adopt `mengineUpdateSeq`. */
|
|
261
261
|
updateSeq?: number | undefined;
|
|
@@ -301,12 +301,10 @@ interface ManualSyncDocOptions {
|
|
|
301
301
|
}
|
|
302
302
|
/** Shared explicit pull/push lifecycle; model-specific editors never implement transport. */
|
|
303
303
|
declare class ManualSyncTransport {
|
|
304
|
-
|
|
304
|
+
private readonly client;
|
|
305
305
|
protected readonly doc: LoroDoc;
|
|
306
306
|
private watermark;
|
|
307
307
|
private disposed;
|
|
308
|
-
/** A retry with no new bytes still verifies the revision from its last durable receipt. */
|
|
309
|
-
private confirmedSequence?;
|
|
310
308
|
protected constructor(client: MengineHttpClient, doc: LoroDoc, watermark: VersionVector);
|
|
311
309
|
editorPeerId(): PeerID;
|
|
312
310
|
protected assertActive(): void;
|
|
@@ -540,8 +538,6 @@ declare class ManualSyncDoc extends ManualSyncTransport {
|
|
|
540
538
|
}[];
|
|
541
539
|
};
|
|
542
540
|
projectVideoDraft(): VideoDraftProjection;
|
|
543
|
-
/** Read the acknowledged server revision; without a new push, confirm against the current server view. */
|
|
544
|
-
readPersistedDraft(updateSeq?: number): Promise<MengineDraftResponse>;
|
|
545
541
|
dispose(): void;
|
|
546
542
|
}
|
|
547
543
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as
|
|
2
|
-
import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, _ as ManualSyncDocOptions, a as MengineDocSessionOptions, b as DocVersionMark, c as WaitForLocalSaveOptions, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDoc, h as PushOutcomeKind, i as MengineAckFailedError, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, n as MengineDocSession, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, r as MengineDocSessionUpdateEvent, s as MengineLocalSaveState, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-
|
|
3
|
-
export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DocStorageLike, type DocVersionMark, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, ManualSyncDoc, type ManualSyncDocOptions, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type Media, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineDraftResponse, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, type MengineLocalSaveState, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, type MoveDslClipsInput, type OpActor, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type
|
|
1
|
+
import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as RelationTable, B as InvalidAtomic, Bt as TextRun, C as DslClipLayout, Ct as EntityTable, D as createInitialMedeoDsl, Dt as MedeoDslSnapshot, E as DslTrackLayout, Et as FieldPatch, F as DslAudit, Ft as StoredFile, G as MedeoDslLoroState, H as isInvalidAtomic, Ht as Track, I as DslTransaction, It as TextDelta, J as OpActor, K as medeoDslLoroShape, L as UnsupportedDocumentFormatError, Lt as TextEdit, M as VoiceoverResult, Mt as RelationValues, N as CreateMedeoDslOptions, Nt as ResourceSystem, O as DslEditor, Ot as Media, P as MedeoDsl, Pt as RichTextSnapshot, Q as DslClipUpdate, R as assertDslDocument, Rt as TextMark, S as resolveDslLayout, St as EntityMutation, T as DslProjectionError, Tt as EntityValues, U as timeAnchorCodec, Ut as TrackRole, V as captionContentCodec, Vt as TimeAnchor, W as MedeoDslDraft, Wt as Voice, X as AddDslClipsInput, Y as AddDslClip, Z as ClipSource, _ as VideoDraftInput, _t as ContainMutation, a as fromVideoDraft, at as EntityIdKind, b as VideoDraftTrack, bt as DslDiagnostic, c as VideoDraftProjection, ct as resourceId, d as DEFAULT_UNIT_TIME_MS, dt as Caption, et as ReplaceDslClipsInput, f as VideoCreationSettings, ft as CaptionContent, g as VideoDraftContentPartUnion, gt as Clip, h as VideoDraftContent, ht as CaptionText, i as ImportedVideoDraft, it as DslIdFactory, j as VoiceoverCaptionInput, jt as RelationTables, k as UploadText, kt as RelationMutation, l as toVideoDraft, lt as tupleHash, m as VideoDraftCaptionStyle, mt as CaptionStyle, n as normalizeLegacyVideoDraft, nt as BLANK_PLACEHOLDER, o as AudioScriptView, ot as defaultIdFactory, p as VideoDraft, pt as CaptionSelection, q as CommitOptions, r as FromVideoDraftOptions, rt as missingMediaPlaceholder, s as toAudioScriptViews, st as relationId, t as NormalizedLegacyVideoDraft, tt as ClipPlacement, u as CaptionDisplayCue, ut as AudioScript, v as VideoDraftPartUnion, vt as ContainNode, w as DslLayout, wt as EntityTables, x as VideoDraftTrackItem, xt as DslMutation, y as VideoDraftTimeline, yt as DeepReadonly, z as documentFormat, zt as TextMutation } from "./index-BOPcHqIj.js";
|
|
2
|
+
import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, _ as ManualSyncDocOptions, a as MengineDocSessionOptions, b as DocVersionMark, c as WaitForLocalSaveOptions, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDoc, h as PushOutcomeKind, i as MengineAckFailedError, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, n as MengineDocSession, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, r as MengineDocSessionUpdateEvent, s as MengineLocalSaveState, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-C_wwGt5k.js";
|
|
3
|
+
export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, BLANK_PLACEHOLDER, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DocStorageLike, type DocVersionMark, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, ManualSyncDoc, type ManualSyncDocOptions, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type Media, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineDraftResponse, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, type MengineLocalSaveState, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, type MoveDslClipsInput, type NormalizedLegacyVideoDraft, type OpActor, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, type WaitForLocalSaveOptions, type WaitForServerAckOptions, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, readMengineEventStream, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
|
|
2
|
-
import {
|
|
2
|
+
import { C as tupleHash, S as resourceId, _ as DslProjectionError, a as createInitialMedeoDsl, b as defaultIdFactory, c as MedeoDsl, d as documentFormat, f as medeoDslLoroShape, g as resolveDslLayout, h as timeAnchorCodec, i as DEFAULT_UNIT_TIME_MS, l as UnsupportedDocumentFormatError, m as isInvalidAtomic, n as fromVideoDraft, o as DslEditor, p as captionContentCodec, r as toVideoDraft, s as toAudioScriptViews, t as normalizeLegacyVideoDraft, u as assertDslDocument, v as BLANK_PLACEHOLDER, x as relationId, y as missingMediaPlaceholder } from "./dsl-C0-G8JVT.js";
|
|
3
3
|
import { LoroDoc, UndoManager, VersionVector, decodeImportBlobMeta } from "loro-crdt";
|
|
4
4
|
import { ClientServerSynchronizer, DocManager } from "@mengine/sync";
|
|
5
5
|
import { DisposableSet, EventBus, Task } from "@mengine/utils";
|
|
@@ -295,8 +295,6 @@ var ManualSyncTransport = class {
|
|
|
295
295
|
doc;
|
|
296
296
|
watermark;
|
|
297
297
|
disposed = false;
|
|
298
|
-
/** A retry with no new bytes still verifies the revision from its last durable receipt. */
|
|
299
|
-
confirmedSequence;
|
|
300
298
|
constructor(client, doc, watermark) {
|
|
301
299
|
this.client = client;
|
|
302
300
|
this.doc = doc;
|
|
@@ -399,8 +397,7 @@ var ManualSyncTransport = class {
|
|
|
399
397
|
const localVersion = this.doc.oplogVersion();
|
|
400
398
|
if (covers(this.watermark, localVersion)) return {
|
|
401
399
|
kind: "nothing_to_push",
|
|
402
|
-
collaborated: false
|
|
403
|
-
...this.confirmedSequence === void 0 ? {} : { mengineUpdateSeq: this.confirmedSequence }
|
|
400
|
+
collaborated: false
|
|
404
401
|
};
|
|
405
402
|
const update = this.doc.export({
|
|
406
403
|
mode: "update",
|
|
@@ -410,7 +407,6 @@ var ManualSyncTransport = class {
|
|
|
410
407
|
const response = await this.client.pushUpdate(update);
|
|
411
408
|
const serverVV = this.serverVVFrom(response.version?.server_vv);
|
|
412
409
|
if (serverVV != null) this.watermark = serverVV;
|
|
413
|
-
this.confirmedSequence = response.version?.update_seq ?? response.update_seq ?? void 0;
|
|
414
410
|
return {
|
|
415
411
|
kind: response.kind,
|
|
416
412
|
mengineUpdateSeq: response.version?.update_seq ?? response.update_seq ?? void 0,
|
|
@@ -477,15 +473,6 @@ var ManualSyncDoc = class ManualSyncDoc extends ManualSyncTransport {
|
|
|
477
473
|
projectVideoDraft() {
|
|
478
474
|
return toVideoDraft(this.snapshot());
|
|
479
475
|
}
|
|
480
|
-
/** Read the acknowledged server revision; without a new push, confirm against the current server view. */
|
|
481
|
-
async readPersistedDraft(updateSeq) {
|
|
482
|
-
this.assertActive();
|
|
483
|
-
const result = updateSeq === void 0 ? await this.client.fetchDraft() : await this.client.fetchDraftAt(updateSeq);
|
|
484
|
-
this.assertActive();
|
|
485
|
-
if (updateSeq !== void 0 && result.version.update_seq !== updateSeq) throw new Error("The projected revision does not match the push receipt");
|
|
486
|
-
if (!covers(VersionVector.decode(base64ToBytes(result.version.server_vv)), this.doc.oplogVersion())) throw new Error("The projected server revision does not hold the local update");
|
|
487
|
-
return result;
|
|
488
|
-
}
|
|
489
476
|
dispose() {
|
|
490
477
|
this.dsl.dispose();
|
|
491
478
|
super.dispose();
|
|
@@ -1472,4 +1459,4 @@ var MengineDocSession = class extends DocumentSession {
|
|
|
1472
1459
|
}
|
|
1473
1460
|
};
|
|
1474
1461
|
//#endregion
|
|
1475
|
-
export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, ManualSyncDoc, MedeoDsl, MedeoHttpDocStorage, MemoryDocStorage, MengineAckFailedError, MengineDocSession, MengineHttpClient, MengineHttpRequestError, MenginePushRejectedError, UnsupportedDocumentFormatError, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, readMengineEventStream, relationId, resolveDslLayout, resourceId,
|
|
1462
|
+
export { BLANK_PLACEHOLDER, DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, ManualSyncDoc, MedeoDsl, MedeoHttpDocStorage, MemoryDocStorage, MengineAckFailedError, MengineDocSession, MengineHttpClient, MengineHttpRequestError, MenginePushRejectedError, UnsupportedDocumentFormatError, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, readMengineEventStream, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as MedeoDsl, p as VideoDraft } from "./index-
|
|
1
|
+
import { P as MedeoDsl, p as VideoDraft } from "./index-BOPcHqIj.js";
|
|
2
2
|
import { LoroDoc } from "loro-crdt";
|
|
3
3
|
|
|
4
4
|
//#region src/testing/in-memory-mengine-server.d.ts
|
|
@@ -18,7 +18,6 @@ declare class InMemoryMengineServer {
|
|
|
18
18
|
private readonly subscribers;
|
|
19
19
|
private seq;
|
|
20
20
|
private hasSnapshot;
|
|
21
|
-
private readonly revisions;
|
|
22
21
|
/**
|
|
23
22
|
* Close every open SSE stream, simulating a network drop. Clients reconnect
|
|
24
23
|
* (a fresh `/events`) and catch up via their next sync — used to exercise
|
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as createInitialMedeoDsl, c as MedeoDsl, d as documentFormat, o as DslEditor, r as toVideoDraft, u as assertDslDocument } from "./dsl-C0-G8JVT.js";
|
|
3
3
|
import { t as classifyUpdate } from "./loro-relay-doc-Bi6JKqtQ.js";
|
|
4
4
|
import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
|
|
5
5
|
//#region src/testing/in-memory-mengine-server.ts
|
|
@@ -19,7 +19,6 @@ var InMemoryMengineServer = class {
|
|
|
19
19
|
subscribers = /* @__PURE__ */ new Set();
|
|
20
20
|
seq = 0;
|
|
21
21
|
hasSnapshot = false;
|
|
22
|
-
revisions = /* @__PURE__ */ new Map();
|
|
23
22
|
/**
|
|
24
23
|
* Close every open SSE stream, simulating a network drop. Clients reconnect
|
|
25
24
|
* (a fresh `/events`) and catch up via their next sync — used to exercise
|
|
@@ -40,7 +39,6 @@ var InMemoryMengineServer = class {
|
|
|
40
39
|
try {
|
|
41
40
|
this.doc.import(dsl.doc.export({ mode: "snapshot" }));
|
|
42
41
|
this.hasSnapshot = true;
|
|
43
|
-
this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
|
|
44
42
|
return new Response(await this.handleSnapshot().text(), {
|
|
45
43
|
status: 201,
|
|
46
44
|
headers: { "content-type": "application/json" }
|
|
@@ -49,33 +47,22 @@ var InMemoryMengineServer = class {
|
|
|
49
47
|
dsl.dispose();
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
|
-
|
|
53
|
-
if ((path === "draft" || revision) && method === "GET") {
|
|
50
|
+
if (path === "draft" && method === "GET") {
|
|
54
51
|
if (!this.hasSnapshot) return this.handleSnapshot();
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
if (!snapshot) return Response.json({
|
|
58
|
-
code: "not_found",
|
|
59
|
-
message: "revision not found"
|
|
60
|
-
}, { status: 404 });
|
|
61
|
-
const attached = new LoroDoc();
|
|
62
|
-
attached.import(snapshot);
|
|
63
|
-
const dsl = new MedeoDsl(attached);
|
|
52
|
+
assertDslDocument(this.doc);
|
|
53
|
+
const dsl = new MedeoDsl(this.doc);
|
|
64
54
|
try {
|
|
65
|
-
assertDslDocument(attached);
|
|
66
55
|
return Response.json({
|
|
67
56
|
...toVideoDraft(dsl.getSnapshot()),
|
|
68
|
-
version: this.version(
|
|
57
|
+
version: this.version()
|
|
69
58
|
});
|
|
70
59
|
} catch (error) {
|
|
71
|
-
return Response.json({
|
|
72
|
-
code:
|
|
73
|
-
message: String(error)
|
|
74
|
-
|
|
75
|
-
}, { status: 422 });
|
|
60
|
+
return Response.json({ error: {
|
|
61
|
+
code: "projection_unsupported",
|
|
62
|
+
message: String(error)
|
|
63
|
+
} }, { status: 422 });
|
|
76
64
|
} finally {
|
|
77
65
|
dsl.dispose();
|
|
78
|
-
attached.free();
|
|
79
66
|
}
|
|
80
67
|
}
|
|
81
68
|
if (/^\/internal\/mengine\/v1\/docs\/[^/]+\/bootstrap$/.test(new URL(url).pathname) && method === "POST") return this.handleBootstrap(init);
|
|
@@ -94,11 +81,11 @@ var InMemoryMengineServer = class {
|
|
|
94
81
|
const afterDocId = url.slice(start + 21);
|
|
95
82
|
return afterDocId.slice(afterDocId.indexOf("/") + 1);
|
|
96
83
|
}
|
|
97
|
-
version(
|
|
84
|
+
version() {
|
|
98
85
|
return {
|
|
99
|
-
update_seq: seq,
|
|
100
|
-
server_vv: bytesToBase64(doc.oplogVersion().encode()),
|
|
101
|
-
frontiers: bytesToBase64(encodeFrontiers(doc.oplogFrontiers()))
|
|
86
|
+
update_seq: this.seq,
|
|
87
|
+
server_vv: bytesToBase64(this.doc.oplogVersion().encode()),
|
|
88
|
+
frontiers: bytesToBase64(encodeFrontiers(this.doc.oplogFrontiers()))
|
|
102
89
|
};
|
|
103
90
|
}
|
|
104
91
|
handleSnapshot() {
|
|
@@ -117,7 +104,6 @@ var InMemoryMengineServer = class {
|
|
|
117
104
|
if (body.snapshot != null && !this.hasSnapshot) {
|
|
118
105
|
this.doc.import(base64ToBytes(body.snapshot));
|
|
119
106
|
this.hasSnapshot = true;
|
|
120
|
-
this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
|
|
121
107
|
}
|
|
122
108
|
return this.handleSnapshot();
|
|
123
109
|
}
|
|
@@ -181,13 +167,7 @@ var InMemoryMengineServer = class {
|
|
|
181
167
|
probe.import(this.doc.export({ mode: "snapshot" }));
|
|
182
168
|
probe.import(data);
|
|
183
169
|
const format = documentFormat(probe);
|
|
184
|
-
|
|
185
|
-
if (format === "dsl") try {
|
|
186
|
-
assertPhoneticBindingFormat(probe);
|
|
187
|
-
} catch {
|
|
188
|
-
unsupported = true;
|
|
189
|
-
}
|
|
190
|
-
if (unsupported) return Response.json({
|
|
170
|
+
if (format === "legacy" || format === "mixed") return Response.json({
|
|
191
171
|
kind: "rejected",
|
|
192
172
|
code: "unsupported_document_format",
|
|
193
173
|
message: "Retired document content roots are not supported",
|
|
@@ -199,7 +179,6 @@ var InMemoryMengineServer = class {
|
|
|
199
179
|
this.doc.import(data);
|
|
200
180
|
this.hasSnapshot = true;
|
|
201
181
|
this.seq += 1;
|
|
202
|
-
this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
|
|
203
182
|
const meta = extractMeta(this.doc, baseVV);
|
|
204
183
|
const stored = {
|
|
205
184
|
updateSeq: this.seq,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengine/medeo-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
".": "./dist/index.js",
|
|
17
17
|
"./dsl": "./dist/dsl.js",
|
|
18
18
|
"./relay": "./dist/relay.js",
|
|
19
|
-
"./schemas": "./dist/schemas.js",
|
|
20
19
|
"./testing": "./dist/testing.js",
|
|
21
20
|
"./package.json": "./package.json"
|
|
22
21
|
},
|
|
@@ -26,15 +25,14 @@
|
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
27
|
"@noble/hashes": "^2.4.0",
|
|
29
|
-
"
|
|
30
|
-
"@mengine/
|
|
31
|
-
"@mengine/
|
|
32
|
-
"@mengine/utils": "3.0.1-dsl.4"
|
|
28
|
+
"@mengine/storage": "3.1.0",
|
|
29
|
+
"@mengine/sync": "3.1.0",
|
|
30
|
+
"@mengine/utils": "3.1.0"
|
|
33
31
|
},
|
|
34
32
|
"devDependencies": {
|
|
35
33
|
"@types/node": "^25.9.1",
|
|
36
34
|
"@typescript/native-preview": "7.0.0-dev.20260521.1",
|
|
37
|
-
"loro-crdt": "^1.16.
|
|
35
|
+
"loro-crdt": "^1.16.4",
|
|
38
36
|
"loro-mirror": "2.3.3",
|
|
39
37
|
"tsx": "^4.22.3",
|
|
40
38
|
"typescript": "^6.0.3",
|
|
@@ -44,7 +42,7 @@
|
|
|
44
42
|
"@mengine/medeo-dsl": "0.0.0"
|
|
45
43
|
},
|
|
46
44
|
"peerDependencies": {
|
|
47
|
-
"loro-crdt": "^1.16.
|
|
45
|
+
"loro-crdt": "^1.16.4"
|
|
48
46
|
},
|
|
49
47
|
"inlinedDependencies": {
|
|
50
48
|
"immer": "10.2.0",
|