@mengine/medeo-client 3.1.0 → 3.1.1-dsl.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 +4 -0
- package/dist/{dsl-C0-G8JVT.js → dsl-Xm5NW58k.js} +327 -90
- package/dist/dsl.d.ts +2 -2
- package/dist/dsl.js +2 -2
- package/dist/{index-BOPcHqIj.d.ts → index-CQ8h3u9S.d.ts} +29 -19
- package/dist/{index-C_wwGt5k.d.ts → index-D48u9I25.d.ts} +7 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -3
- package/dist/schemas.d.ts +606 -0
- package/dist/schemas.js +478 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +35 -14
- package/package.json +6 -4
package/dist/dsl.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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 };
|
|
1
|
+
import { $ as ClipSource, A as DslEditor, At as Media, B as assertDslDocument, Bt as TextMark, C as VideoDraftTrackItem, Ct as DslMutation, D as DslProjectionError, Dt as EntityValues, E as DslLayout, Et as EntityTables, F as CreateMedeoDslOptions, Ft as ResourceSystem, G as timeAnchorCodec, Gt as TrackRole, H as InvalidAtomic, Ht as TextRun, I as MedeoDsl, It as RichTextSnapshot, J as medeoDslLoroShape, K as MedeoDslDraft, Kt as Voice, L as DslAudit, Lt as StoredFile, M as ApplyVoiceoverInput, Mt as RelationTable, N as VoiceoverCaptionInput, Nt as RelationTables, O as DslTrackLayout, Ot as FieldPatch, P as VoiceoverResult, Pt as RelationValues, Q as AddDslClipsInput, R as DslTransaction, Rt as TextDelta, S as VideoDraftTrack, St as DslDiagnostic, T as DslClipLayout, Tt as EntityTable, U as captionContentCodec, Ut as TimeAnchor, V as documentFormat, Vt as TextMutation, W as isInvalidAtomic, Wt as Track, X as OpActor, Y as CommitOptions, Z as AddDslClip, _ as VideoDraftContent, _t as CaptionText, a as fromVideoDraft, at as missingMediaPlaceholder, b as VideoDraftPartUnion, bt as ContainNode, c as spokenScripts, ct as defaultIdFactory, d as toVideoDraft, dt as tupleHash, et as DslClipUpdate, f as CaptionDisplayCue, ft as AudioScript, g as VideoDraftCaptionStyle, gt as CaptionStyle, h as VideoDraft, ht as CaptionSelection, i as ImportedVideoDraft, it as BLANK_PLACEHOLDER, j as UploadText, jt as RelationMutation, k as createInitialMedeoDsl, kt as MedeoDslSnapshot, l as toAudioScriptViews, lt as relationId, m as VideoCreationSettings, mt as CaptionContent, n as normalizeLegacyVideoDraft, nt as ReplaceDslClipsInput, o as AudioScriptView, ot as DslIdFactory, p as DEFAULT_UNIT_TIME_MS, pt as Caption, q as MedeoDslLoroState, r as FromVideoDraftOptions, rt as ClipPlacement, s as SpokenScript, st as EntityIdKind, t as NormalizedLegacyVideoDraft, tt as MoveDslClipsInput, u as VideoDraftProjection, ut as resourceId, v as VideoDraftContentPartUnion, vt as Clip, w as resolveDslLayout, wt as EntityMutation, x as VideoDraftTimeline, xt as DeepReadonly, y as VideoDraftInput, yt as ContainMutation, z as UnsupportedDocumentFormatError, zt as TextEdit } from "./index-CQ8h3u9S.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 SpokenScript, 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, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
package/dist/dsl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
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 };
|
|
1
|
+
import { C as relationId, S as defaultIdFactory, T as tupleHash, _ as timeAnchorCodec, a as createInitialMedeoDsl, b as BLANK_PLACEHOLDER, c as toAudioScriptViews, d as assertDslDocument, g as isInvalidAtomic, h as captionContentCodec, i as DEFAULT_UNIT_TIME_MS, l as MedeoDsl, m as medeoDslLoroShape, n as fromVideoDraft, o as DslEditor, p as documentFormat, r as toVideoDraft, s as spokenScripts, t as normalizeLegacyVideoDraft, u as UnsupportedDocumentFormatError, v as resolveDslLayout, w as resourceId, x as missingMediaPlaceholder, y as DslProjectionError } from "./dsl-Xm5NW58k.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, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
|
@@ -342,7 +342,7 @@ declare const defaultIdFactory: DslIdFactory;
|
|
|
342
342
|
//#region ../medeo-dsl/src/fields.d.ts
|
|
343
343
|
/**
|
|
344
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 (
|
|
345
|
+
* visual clip the old editor drew as a blank (D205). The blank one stands in for a clip placed
|
|
346
346
|
* without media (`origin_media_id: ''`); one keyed by a memota media id stands in for media the
|
|
347
347
|
* clip named but Director found missing, so the id survives. Importing keeps the clips' time on
|
|
348
348
|
* them instead of dropping them. Only migration authors them.
|
|
@@ -849,20 +849,12 @@ declare const medeoDslLoroShape: RootSchemaType<{
|
|
|
849
849
|
options: {};
|
|
850
850
|
};
|
|
851
851
|
'phonetic-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
|
|
852
|
-
|
|
853
|
-
system: /*elided*/any;
|
|
854
|
-
key: /*elided*/any;
|
|
855
|
-
storageKey: /*elided*/any;
|
|
856
|
-
digest: /*elided*/any;
|
|
852
|
+
binding: /*elided*/any;
|
|
857
853
|
}> & {
|
|
858
854
|
options: {};
|
|
859
855
|
} & {
|
|
860
856
|
catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
|
|
861
|
-
|
|
862
|
-
system: /*elided*/any;
|
|
863
|
-
key: /*elided*/any;
|
|
864
|
-
storageKey: /*elided*/any;
|
|
865
|
-
digest: /*elided*/any;
|
|
857
|
+
binding: /*elided*/any;
|
|
866
858
|
}, C>;
|
|
867
859
|
}> & {
|
|
868
860
|
options: {};
|
|
@@ -955,8 +947,9 @@ type ContainDraftNode = Omit<Input['contain-relations'][number], 'id' | 'childre
|
|
|
955
947
|
children: ContainDraftNode[];
|
|
956
948
|
};
|
|
957
949
|
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;
|
|
958
|
-
type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations'>> & {
|
|
950
|
+
type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations' | 'phonetic-script-entities'>> & {
|
|
959
951
|
'contain-relations': ContainDraftNode[];
|
|
952
|
+
'phonetic-script-entities': Record<string, PhoneticScript>;
|
|
960
953
|
};
|
|
961
954
|
//#endregion
|
|
962
955
|
//#region ../medeo-dsl/src/schema/codec.d.ts
|
|
@@ -980,7 +973,7 @@ declare const captionContentCodec: AtomicCodec<SegmentSelection>;
|
|
|
980
973
|
declare function documentFormat(doc: LoroDoc): 'dsl' | 'legacy' | 'mixed' | 'unknown';
|
|
981
974
|
declare class UnsupportedDocumentFormatError extends Error {
|
|
982
975
|
readonly code = "unsupported_document_format";
|
|
983
|
-
constructor();
|
|
976
|
+
constructor(message?: string);
|
|
984
977
|
}
|
|
985
978
|
/** Run after initial import, before opening an editable handle. Empty new documents still have one Timeline. */
|
|
986
979
|
declare function assertDslDocument(doc: LoroDoc): void;
|
|
@@ -1057,6 +1050,8 @@ declare class MedeoDsl {
|
|
|
1057
1050
|
applyMutations(mutations: readonly DslMutation[], audit: DslAudit): void;
|
|
1058
1051
|
editText(scriptId: string, segmentId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
|
|
1059
1052
|
editCaptionText(captionId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
|
|
1053
|
+
/** Check the session's write capability before an Action starts host-owned resource I/O. */
|
|
1054
|
+
assertWritable(): void;
|
|
1060
1055
|
/**
|
|
1061
1056
|
* A run inside one segment as native Cursors. Local ranges exclude insertions at their start and
|
|
1062
1057
|
* include insertions at their end. K01 remains deferred.
|
|
@@ -1064,6 +1059,7 @@ declare class MedeoDsl {
|
|
|
1064
1059
|
textRange(scriptId: string, segmentId: string, start: number, end: number): SegmentSelection;
|
|
1065
1060
|
dispose(): void;
|
|
1066
1061
|
private mutate;
|
|
1062
|
+
private assertReadyToWrite;
|
|
1067
1063
|
private notify;
|
|
1068
1064
|
private assertActive;
|
|
1069
1065
|
}
|
|
@@ -1092,9 +1088,9 @@ interface ApplyVoiceoverInput {
|
|
|
1092
1088
|
kind: 'voiceover-recording';
|
|
1093
1089
|
};
|
|
1094
1090
|
/**
|
|
1095
|
-
* What the recording says:
|
|
1096
|
-
*
|
|
1097
|
-
*
|
|
1091
|
+
* What the recording says: a PhoneticScript it was spoken from, or plain words from an existing
|
|
1092
|
+
* or new AudioScript. Plain words get selection-only PhoneticScripts (D190), one per segment;
|
|
1093
|
+
* no control content, file or digest is invented. Captions keep selecting the base script.
|
|
1098
1094
|
*/
|
|
1099
1095
|
script: {
|
|
1100
1096
|
audioScriptId: string;
|
|
@@ -1801,6 +1797,13 @@ interface VideoDraftProjection {
|
|
|
1801
1797
|
declare function toVideoDraft(snapshot: MedeoDslSnapshot): VideoDraftProjection;
|
|
1802
1798
|
//#endregion
|
|
1803
1799
|
//#region src/dsl/projection/audio-scripts.d.ts
|
|
1800
|
+
/** The script a recording says and its phonetic origins; old direct script origins remain readable. */
|
|
1801
|
+
interface SpokenScript {
|
|
1802
|
+
audioScriptId: string;
|
|
1803
|
+
phoneticScriptId?: string;
|
|
1804
|
+
/** Several plain selections of the same script; the singular summary is omitted. */
|
|
1805
|
+
phoneticScriptIds?: string[];
|
|
1806
|
+
}
|
|
1804
1807
|
/**
|
|
1805
1808
|
* An AudioScript with everything that says or shows it, read from the same snapshot as the
|
|
1806
1809
|
* VideoDraft. Speeches and captions come in playback order.
|
|
@@ -1836,8 +1839,9 @@ interface AudioScriptView {
|
|
|
1836
1839
|
/** Speech Clips playing a recording of these words. */
|
|
1837
1840
|
speeches: {
|
|
1838
1841
|
clipId: string;
|
|
1839
|
-
recordingId: string; /**
|
|
1840
|
-
phoneticScriptId?: string;
|
|
1842
|
+
recordingId: string; /** Its single phonetic origin; omitted for multiple origins or an old direct script origin. */
|
|
1843
|
+
phoneticScriptId?: string; /** Multiple segment selections used by one recording, without duplicating its Clip. */
|
|
1844
|
+
phoneticScriptIds?: string[];
|
|
1841
1845
|
voices: {
|
|
1842
1846
|
voiceId: string;
|
|
1843
1847
|
key: string;
|
|
@@ -1856,6 +1860,12 @@ interface AudioScriptView {
|
|
|
1856
1860
|
segment: number;
|
|
1857
1861
|
}[];
|
|
1858
1862
|
}
|
|
1863
|
+
/**
|
|
1864
|
+
* The scripts a recording says. It follows derived-from from the recording; a PhoneticScript is a
|
|
1865
|
+
* variant, so its words are the base its phoneme names, and derived-from is not followed past it.
|
|
1866
|
+
* When nothing is found that way, a script read off the recording itself is what it says.
|
|
1867
|
+
*/
|
|
1868
|
+
declare function spokenScripts(snapshot: MedeoDslSnapshot, recordingId: string): SpokenScript[];
|
|
1859
1869
|
/** Every AudioScript in the document with its PhoneticScripts, the Speech Clips saying it and the Caption Clips showing it. */
|
|
1860
1870
|
declare function toAudioScriptViews(snapshot: MedeoDslSnapshot): AudioScriptView[];
|
|
1861
1871
|
//#endregion
|
|
@@ -1880,4 +1890,4 @@ interface NormalizedLegacyVideoDraft {
|
|
|
1880
1890
|
}
|
|
1881
1891
|
declare function normalizeLegacyVideoDraft(input: VideoDraftInput, mediaFacts?: readonly Media[]): NormalizedLegacyVideoDraft;
|
|
1882
1892
|
//#endregion
|
|
1883
|
-
export {
|
|
1893
|
+
export { ClipSource as $, DslEditor as A, Media as At, assertDslDocument as B, TextMark as Bt, VideoDraftTrackItem as C, DslMutation as Ct, DslProjectionError as D, EntityValues as Dt, DslLayout as E, EntityTables as Et, CreateMedeoDslOptions as F, ResourceSystem as Ft, timeAnchorCodec as G, TrackRole as Gt, InvalidAtomic as H, TextRun as Ht, MedeoDsl as I, RichTextSnapshot as It, medeoDslLoroShape as J, MedeoDslDraft as K, Voice as Kt, DslAudit as L, StoredFile as Lt, ApplyVoiceoverInput as M, RelationTable as Mt, VoiceoverCaptionInput as N, RelationTables as Nt, DslTrackLayout as O, FieldPatch as Ot, VoiceoverResult as P, RelationValues as Pt, AddDslClipsInput as Q, DslTransaction as R, TextDelta as Rt, VideoDraftTrack as S, DslDiagnostic as St, DslClipLayout as T, EntityTable as Tt, captionContentCodec as U, TimeAnchor as Ut, documentFormat as V, TextMutation as Vt, isInvalidAtomic as W, Track$1 as Wt, OpActor as X, CommitOptions as Y, AddDslClip as Z, VideoDraftContent as _, CaptionText as _t, fromVideoDraft as a, missingMediaPlaceholder as at, VideoDraftPartUnion as b, ContainNode as bt, spokenScripts as c, defaultIdFactory as ct, toVideoDraft as d, tupleHash as dt, DslClipUpdate as et, CaptionDisplayCue as f, AudioScript as ft, VideoDraftCaptionStyle as g, CaptionStyle$1 as gt, VideoDraft as h, CaptionSelection as ht, ImportedVideoDraft as i, BLANK_PLACEHOLDER as it, UploadText as j, RelationMutation as jt, createInitialMedeoDsl as k, MedeoDslSnapshot as kt, toAudioScriptViews as l, relationId as lt, VideoCreationSettings as m, CaptionContent as mt, normalizeLegacyVideoDraft as n, ReplaceDslClipsInput as nt, AudioScriptView as o, DslIdFactory as ot, DEFAULT_UNIT_TIME_MS as p, Caption as pt, MedeoDslLoroState as q, FromVideoDraftOptions as r, ClipPlacement as rt, SpokenScript as s, EntityIdKind as st, NormalizedLegacyVideoDraft as t, MoveDslClipsInput as tt, VideoDraftProjection as u, resourceId as ut, VideoDraftContentPartUnion as v, Clip as vt, resolveDslLayout as w, EntityMutation as wt, VideoDraftTimeline as x, DeepReadonly as xt, VideoDraftInput as y, ContainMutation as yt, UnsupportedDocumentFormatError as z, TextEdit as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as DslEditor, Ft as ResourceSystem, Gt as TrackRole, I as MedeoDsl, St as DslDiagnostic, Y as CommitOptions, _ as VideoDraftContent, j as UploadText, kt as MedeoDslSnapshot, o as AudioScriptView, u as VideoDraftProjection } from "./index-CQ8h3u9S.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
|
|
258
|
+
/** Server sequence from an `ack`/`duplicate`, retained on an idle retry so its revision can be verified. */
|
|
259
259
|
mengineUpdateSeq?: number | undefined;
|
|
260
260
|
/** @deprecated Ack-only sequence retained until consumers adopt `mengineUpdateSeq`. */
|
|
261
261
|
updateSeq?: number | undefined;
|
|
@@ -301,10 +301,12 @@ interface ManualSyncDocOptions {
|
|
|
301
301
|
}
|
|
302
302
|
/** Shared explicit pull/push lifecycle; model-specific editors never implement transport. */
|
|
303
303
|
declare class ManualSyncTransport {
|
|
304
|
-
|
|
304
|
+
protected readonly client: MengineHttpClient;
|
|
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?;
|
|
308
310
|
protected constructor(client: MengineHttpClient, doc: LoroDoc, watermark: VersionVector);
|
|
309
311
|
editorPeerId(): PeerID;
|
|
310
312
|
protected assertActive(): void;
|
|
@@ -538,6 +540,8 @@ declare class ManualSyncDoc extends ManualSyncTransport {
|
|
|
538
540
|
}[];
|
|
539
541
|
};
|
|
540
542
|
projectVideoDraft(): VideoDraftProjection;
|
|
543
|
+
/** Read the acknowledged server revision; without a new push, confirm against the current server view. */
|
|
544
|
+
readPersistedDraft(updateSeq?: number): Promise<MengineDraftResponse>;
|
|
541
545
|
dispose(): void;
|
|
542
546
|
}
|
|
543
547
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ 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, 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 };
|
|
1
|
+
import { $ as ClipSource, A as DslEditor, At as Media, B as assertDslDocument, Bt as TextMark, C as VideoDraftTrackItem, Ct as DslMutation, D as DslProjectionError, Dt as EntityValues, E as DslLayout, Et as EntityTables, F as CreateMedeoDslOptions, Ft as ResourceSystem, G as timeAnchorCodec, Gt as TrackRole, H as InvalidAtomic, Ht as TextRun, I as MedeoDsl, It as RichTextSnapshot, J as medeoDslLoroShape, K as MedeoDslDraft, Kt as Voice, L as DslAudit, Lt as StoredFile, M as ApplyVoiceoverInput, Mt as RelationTable, N as VoiceoverCaptionInput, Nt as RelationTables, O as DslTrackLayout, Ot as FieldPatch, P as VoiceoverResult, Pt as RelationValues, Q as AddDslClipsInput, R as DslTransaction, Rt as TextDelta, S as VideoDraftTrack, St as DslDiagnostic, T as DslClipLayout, Tt as EntityTable, U as captionContentCodec, Ut as TimeAnchor, V as documentFormat, Vt as TextMutation, W as isInvalidAtomic, Wt as Track, X as OpActor, Y as CommitOptions, Z as AddDslClip, _ as VideoDraftContent, _t as CaptionText, a as fromVideoDraft, at as missingMediaPlaceholder, b as VideoDraftPartUnion, bt as ContainNode, c as spokenScripts, ct as defaultIdFactory, d as toVideoDraft, dt as tupleHash, et as DslClipUpdate, f as CaptionDisplayCue, ft as AudioScript, g as VideoDraftCaptionStyle, gt as CaptionStyle, h as VideoDraft, ht as CaptionSelection, i as ImportedVideoDraft, it as BLANK_PLACEHOLDER, j as UploadText, jt as RelationMutation, k as createInitialMedeoDsl, kt as MedeoDslSnapshot, l as toAudioScriptViews, lt as relationId, m as VideoCreationSettings, mt as CaptionContent, n as normalizeLegacyVideoDraft, nt as ReplaceDslClipsInput, o as AudioScriptView, ot as DslIdFactory, p as DEFAULT_UNIT_TIME_MS, pt as Caption, q as MedeoDslLoroState, r as FromVideoDraftOptions, rt as ClipPlacement, s as SpokenScript, st as EntityIdKind, t as NormalizedLegacyVideoDraft, tt as MoveDslClipsInput, u as VideoDraftProjection, ut as resourceId, v as VideoDraftContentPartUnion, vt as Clip, w as resolveDslLayout, wt as EntityMutation, x as VideoDraftTimeline, xt as DeepReadonly, y as VideoDraftInput, yt as ContainMutation, z as UnsupportedDocumentFormatError, zt as TextEdit } from "./index-CQ8h3u9S.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-D48u9I25.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 SpokenScript, 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, spokenScripts, 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 { C as
|
|
2
|
+
import { C as relationId, S as defaultIdFactory, T as tupleHash, _ as timeAnchorCodec, a as createInitialMedeoDsl, b as BLANK_PLACEHOLDER, c as toAudioScriptViews, d as assertDslDocument, g as isInvalidAtomic, h as captionContentCodec, i as DEFAULT_UNIT_TIME_MS, l as MedeoDsl, m as medeoDslLoroShape, n as fromVideoDraft, o as DslEditor, p as documentFormat, r as toVideoDraft, s as spokenScripts, t as normalizeLegacyVideoDraft, u as UnsupportedDocumentFormatError, v as resolveDslLayout, w as resourceId, x as missingMediaPlaceholder, y as DslProjectionError } from "./dsl-Xm5NW58k.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,6 +295,8 @@ 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;
|
|
298
300
|
constructor(client, doc, watermark) {
|
|
299
301
|
this.client = client;
|
|
300
302
|
this.doc = doc;
|
|
@@ -397,7 +399,8 @@ var ManualSyncTransport = class {
|
|
|
397
399
|
const localVersion = this.doc.oplogVersion();
|
|
398
400
|
if (covers(this.watermark, localVersion)) return {
|
|
399
401
|
kind: "nothing_to_push",
|
|
400
|
-
collaborated: false
|
|
402
|
+
collaborated: false,
|
|
403
|
+
...this.confirmedSequence === void 0 ? {} : { mengineUpdateSeq: this.confirmedSequence }
|
|
401
404
|
};
|
|
402
405
|
const update = this.doc.export({
|
|
403
406
|
mode: "update",
|
|
@@ -407,6 +410,7 @@ var ManualSyncTransport = class {
|
|
|
407
410
|
const response = await this.client.pushUpdate(update);
|
|
408
411
|
const serverVV = this.serverVVFrom(response.version?.server_vv);
|
|
409
412
|
if (serverVV != null) this.watermark = serverVV;
|
|
413
|
+
this.confirmedSequence = response.version?.update_seq ?? response.update_seq ?? void 0;
|
|
410
414
|
return {
|
|
411
415
|
kind: response.kind,
|
|
412
416
|
mengineUpdateSeq: response.version?.update_seq ?? response.update_seq ?? void 0,
|
|
@@ -473,6 +477,15 @@ var ManualSyncDoc = class ManualSyncDoc extends ManualSyncTransport {
|
|
|
473
477
|
projectVideoDraft() {
|
|
474
478
|
return toVideoDraft(this.snapshot());
|
|
475
479
|
}
|
|
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
|
+
}
|
|
476
489
|
dispose() {
|
|
477
490
|
this.dsl.dispose();
|
|
478
491
|
super.dispose();
|
|
@@ -1459,4 +1472,4 @@ var MengineDocSession = class extends DocumentSession {
|
|
|
1459
1472
|
}
|
|
1460
1473
|
};
|
|
1461
1474
|
//#endregion
|
|
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 };
|
|
1475
|
+
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, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|