@mengine/medeo-client 2.0.1-alpha.30 → 2.0.1-alpha.31
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.
|
@@ -3741,13 +3741,19 @@ function audioScriptAssetOf(rows, entityId) {
|
|
|
3741
3741
|
return boundAsset(rows, entityId, "to-asset");
|
|
3742
3742
|
}
|
|
3743
3743
|
/**
|
|
3744
|
-
*
|
|
3745
|
-
*
|
|
3746
|
-
* are already named, and rewriting them would contradict their source.
|
|
3744
|
+
* Read a host-owned source resource binding. Historical scripts may carry one;
|
|
3745
|
+
* new ASR input attaches the recognition resource only to its Captions.
|
|
3747
3746
|
*/
|
|
3748
3747
|
function scriptSourceAssetOf(rows, entityId) {
|
|
3749
3748
|
return boundAsset(rows, entityId, "from-asset");
|
|
3750
3749
|
}
|
|
3750
|
+
/** ASR text comes from sound; an authored rewrite instead names its previous AudioScript. */
|
|
3751
|
+
function isTranscribedAudioScript(rows, entityId) {
|
|
3752
|
+
if (!rows.entities.some((entity) => entity.entityId === entityId && entity.entityKind === "audio-script")) return false;
|
|
3753
|
+
const sources = rows.relations.filter((relation) => relation.relationKind === "derived-from" && relation.endpoint0EntityId === entityId).map((relation) => rows.entities.find((entity) => entity.entityId === relation.endpoint1EntityId));
|
|
3754
|
+
if (sources.some((source) => source?.entityKind === "audio" || source?.entityKind === "voiceover-recording")) return true;
|
|
3755
|
+
return sources.some((source) => source?.entityKind === "video") && rows.entities.some((entity) => entity.entityKind === "caption" && Array.isArray(entity.payload.baseEntityIds) && entity.payload.baseEntityIds.includes(entityId) && scriptSourceAssetOf(rows, entity.entityId) !== void 0);
|
|
3756
|
+
}
|
|
3751
3757
|
function boundAsset(rows, entityId, relationKind) {
|
|
3752
3758
|
const link = rows.relations.find((relation) => relation.relationKind === relationKind && (String(relation.endpoint0EntityId) === entityId || String(relation.endpoint1EntityId) === entityId));
|
|
3753
3759
|
if (link === void 0) return void 0;
|
|
@@ -4158,6 +4164,7 @@ var LoroEntityDocument = class LoroEntityDocument {
|
|
|
4158
4164
|
const key = family(this.doc, entityId);
|
|
4159
4165
|
const map = workspace(this.doc, key);
|
|
4160
4166
|
if (map.get("kind") !== "audio-script" || map.get("deleted") === true) throw new Error("Resource binding requires an active AudioScript");
|
|
4167
|
+
if (isTranscribedAudioScript(readEntityDocument(this.doc, true).rows, entityId)) throw new Error("ASR resources belong to Caption, not the transcribed AudioScript");
|
|
4161
4168
|
const payload = entityContent(this.doc, key);
|
|
4162
4169
|
if (audioScriptAssetHash(payload) !== expectedContentHash) throw new Error("AudioScript changed while saving its resource");
|
|
4163
4170
|
if (!assetId.trim()) throw new Error("AudioScript resource writer returned an empty asset ID");
|
|
@@ -4959,4 +4966,4 @@ function createPlainMemoryAdapter(document, options) {
|
|
|
4959
4966
|
return new PlainMemoryAdapter(document, options);
|
|
4960
4967
|
}
|
|
4961
4968
|
//#endregion
|
|
4962
|
-
export {
|
|
4969
|
+
export { buildSpeechHostMap as $, EntityProjectionGraph as A, recordEntries as At, assembleEntityContent as B, scriptSourceAssetOf as C, isEmptyVideoClip as Ct, assertFieldChanges as D, effectiveVideoClipDurationMs as Dt, applyFieldChanges as E, DEFAULT_UNIT_TIME_MS as Et, relationsFrom as F, updateEntityFields as G, assembleScriptText as H, relationsTo as I, createEntityId as J, variantBaseEntityIds as K, scriptContentHash as L, EntityTimelineProjectionError as M, base64ToBytes as Mt, validateEntityRelationTransition as N, bytesToBase64 as Nt, resolveFieldPath as O, speedOf as Ot, decodeEntityRelationRows as P, buildInitialVideoDocument as Q, ScriptCompositionError as R, phoneticScriptAssetOf as S, TIMELINE_SKELETON_DURATION_MS as St, equalJson as T, safeDurationMs as Tt, findComposedAudioScript as U, assemblePhoneticScriptContent as V, selectAudioScriptSegment as W, hasSequence as X, createRelationId as Y, isMediaAssetVariantKind as Z, audioScriptAssetHash as _, reassignSpeechesToVideoClipsByTime as _t, createMirrorVideoDocument as a, validateVideoDocument as at, phoneticScriptAssetContent as b, resolveSpeechOverlapByShiftingVideos as bt, DocumentMutationGuard as c, LANE_KINDS_IN_STACK_ORDER as ct, LoroEntityDraft as d, hasResolvedPlacement as dt, derivePositionFromAbs as et, readEntityDocument as f, laneTrackId as ft, audioScriptAssetFields as g, fillMainTrackTimeGaps as gt, audioScriptAssetContent as h, arrangeMainTrackSeamlessly as ht, MirrorVideoDocumentAdapter as i, assertValidVideoDocument as it, resolveEntityTimelineLayout as j, videoDocumentMirrorSchema as jt, projectEntityTimeline as k, partUnionToDraft as kt, LORO_ENTITY_SCHEMA as l, ensureLaneTrack as lt, entityOrderGroups as m, cascadeAfterVideoClipChanges as mt, createPlainMemoryAdapter as n, toVideoDocument as nt, createMirrorVideoDocumentAdapter as o, partUnionSchema as ot, readEntityRelationRecords as p, solveVideoDocument as pt, isJsonObject as q, generatePartId as r, VideoDocumentValidationError as rt, readVideoDocumentFromDraft as s, videoDocumentSchema as st, PlainMemoryAdapter as t, fromVideoDocument as tt, LoroEntityDocument as u, findLaneTrack as ut, audioScriptAssetOf as v, recalculateTimelineDuration as vt, canonicalJson as w, partDurationMs as wt, phoneticScriptAssetHash as x, syncAggregatedClipsTimePosition as xt, isTranscribedAudioScript as y, resolveAllSpeechOverlaps as yt, assembleCaptionContent as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1870,11 +1870,12 @@ declare function audioScriptAssetHash(payload: JsonObject): string;
|
|
|
1870
1870
|
*/
|
|
1871
1871
|
declare function audioScriptAssetOf(rows: EntityRelationRows, entityId: string): EntityRow | undefined;
|
|
1872
1872
|
/**
|
|
1873
|
-
*
|
|
1874
|
-
*
|
|
1875
|
-
* are already named, and rewriting them would contradict their source.
|
|
1873
|
+
* Read a host-owned source resource binding. Historical scripts may carry one;
|
|
1874
|
+
* new ASR input attaches the recognition resource only to its Captions.
|
|
1876
1875
|
*/
|
|
1877
1876
|
declare function scriptSourceAssetOf(rows: EntityRelationRows, entityId: string): EntityRow | undefined;
|
|
1877
|
+
/** ASR text comes from sound; an authored rewrite instead names its previous AudioScript. */
|
|
1878
|
+
declare function isTranscribedAudioScript(rows: EntityRelationRows, entityId: string): boolean;
|
|
1878
1879
|
/** Internal fingerprint prevents a resource from silently describing an older text revision. */
|
|
1879
1880
|
declare function audioScriptAssetFields(payload: JsonObject): JsonObject;
|
|
1880
1881
|
/**
|
|
@@ -1892,4 +1893,4 @@ declare function phoneticScriptAssetHash(rows: EntityRelationRows, entityId: str
|
|
|
1892
1893
|
/** The Asset a PhoneticScript was written out to, read from the graph. */
|
|
1893
1894
|
declare function phoneticScriptAssetOf(rows: EntityRelationRows, entityId: string): EntityRow | undefined;
|
|
1894
1895
|
//#endregion
|
|
1895
|
-
export { type Aggregation, ApplyEntityRowsOptions, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionDisplayCue, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, type DocumentAudioScriptState, type EditorFoundation, EntityDocumentState, type EntityGraphCommitOptions, EntityGraphHttpClient, EntityGraphRevisionConflictError, type EntityGraphRevisionConflictPayload, type EntityGraphState, EntityRelationRecord, EntityTimelineEditor, type EntityTimelineIdFactory, EntityTimelineProjectionError, type EntityTimelineTrackRole, type FieldChange, type FieldPath, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImageMediaAssetFact, type ImplementedSemanticOpKind, type ImportedMediaAsset, type InsertCaptionClipInput, type InsertClipInput, type InsertMediaClipInput, type InsertMediaClipsInput, type InsertPlacedClipInput, type JournalEntry, LANE_KINDS_IN_STACK_ORDER, LORO_ENTITY_SCHEMA, type LaneKind, type LinearClipSpeed, LoroEntityDocument, LoroEntityDraft, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type MediaAssetFact, type MediaClipInsertion, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, MirrorVideoDocumentAdapter, type MirrorVideoDocumentOptions, type MoveClipInput, type MoveClipsToStartsInput, type MoveSequentialClipsInput, type MoveVoiceoverInput, type OpActor, type PartAggregation, type PartIdFactory, type PartKind, type PartUnion, type PatchCaptionStyleInput, PlainMemoryAdapter, type PlainMemoryAdapterOptions, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type ReplaceClipContentInput, type ReplaceMediaClipInput, type ReplaceSequentialClipsInput, type ReplacementMediaClipInput, type ResolvedEntityClipPlacement, type ResolvedEntityTimelineLayout, type ResolvedEntityTrack, type ReviseAudioScriptInput, type ReviseAudioScriptResult, SchemaValidator, ScriptCompositionError, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SequentialClipAnchor, type SetBgmInput, type SetCaptionVisibilityInput, type SetClipPlacementInput, type SetClipSpeedInput, type SetClipVolumeInput, type SnapshotReadable, type SolvedVideoDocument, type SpeechHostMap, type SpeechPart, type SpeedShift, TIMELINE_SKELETON_DURATION_MS, type Timeline, type TimelineDoc, type TimelineItem, type Track, type TrackDraft, type TrackItem, type TrackItemDraft, type TrackItemTimePosition, type TransactAudit, type TrimClipInput, type UpdateClipInput, type UpdateClipMarkerInput, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftContent, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type VideoMediaAssetFact, type VisualAssetsEffectInput, type VisualMediaAssetFact, type VoiceoverCaptionFact, type VoiceoverMediaAssetFact, type VoiceoverTakeInput, type VoiceoverTakeResult, type WaitForServerAckOptions, applyEntityRows, applyFieldChanges, applyVisualAssetsEffect, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertFieldChanges, assertMediaAssetWritePolicy, assertValidVideoDocument, audioScriptAssetContent, audioScriptAssetFields, audioScriptAssetHash, audioScriptAssetOf, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hasVisualAssetsEffect, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, migrateAlpha23EntityDocument, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, phoneticScriptAssetContent, phoneticScriptAssetHash, phoneticScriptAssetOf, prepareCaptionContent, projectEntityTimeline, publishEntityRows, readDocumentAudioScript, readEntityDocument, readEntityRelationRecords, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveFieldPath, resolveSpeechOverlapByShiftingVideos, reviseAudioScript, safeDurationMs, index_d_exports as schemas, scriptSourceAssetOf, selectAudioScriptSegment, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|
|
1896
|
+
export { type Aggregation, ApplyEntityRowsOptions, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionDisplayCue, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, type DocumentAudioScriptState, type EditorFoundation, EntityDocumentState, type EntityGraphCommitOptions, EntityGraphHttpClient, EntityGraphRevisionConflictError, type EntityGraphRevisionConflictPayload, type EntityGraphState, EntityRelationRecord, EntityTimelineEditor, type EntityTimelineIdFactory, EntityTimelineProjectionError, type EntityTimelineTrackRole, type FieldChange, type FieldPath, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImageMediaAssetFact, type ImplementedSemanticOpKind, type ImportedMediaAsset, type InsertCaptionClipInput, type InsertClipInput, type InsertMediaClipInput, type InsertMediaClipsInput, type InsertPlacedClipInput, type JournalEntry, LANE_KINDS_IN_STACK_ORDER, LORO_ENTITY_SCHEMA, type LaneKind, type LinearClipSpeed, LoroEntityDocument, LoroEntityDraft, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type MediaAssetFact, type MediaClipInsertion, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, MirrorVideoDocumentAdapter, type MirrorVideoDocumentOptions, type MoveClipInput, type MoveClipsToStartsInput, type MoveSequentialClipsInput, type MoveVoiceoverInput, type OpActor, type PartAggregation, type PartIdFactory, type PartKind, type PartUnion, type PatchCaptionStyleInput, PlainMemoryAdapter, type PlainMemoryAdapterOptions, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type ReplaceClipContentInput, type ReplaceMediaClipInput, type ReplaceSequentialClipsInput, type ReplacementMediaClipInput, type ResolvedEntityClipPlacement, type ResolvedEntityTimelineLayout, type ResolvedEntityTrack, type ReviseAudioScriptInput, type ReviseAudioScriptResult, SchemaValidator, ScriptCompositionError, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SequentialClipAnchor, type SetBgmInput, type SetCaptionVisibilityInput, type SetClipPlacementInput, type SetClipSpeedInput, type SetClipVolumeInput, type SnapshotReadable, type SolvedVideoDocument, type SpeechHostMap, type SpeechPart, type SpeedShift, TIMELINE_SKELETON_DURATION_MS, type Timeline, type TimelineDoc, type TimelineItem, type Track, type TrackDraft, type TrackItem, type TrackItemDraft, type TrackItemTimePosition, type TransactAudit, type TrimClipInput, type UpdateClipInput, type UpdateClipMarkerInput, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftContent, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type VideoMediaAssetFact, type VisualAssetsEffectInput, type VisualMediaAssetFact, type VoiceoverCaptionFact, type VoiceoverMediaAssetFact, type VoiceoverTakeInput, type VoiceoverTakeResult, type WaitForServerAckOptions, applyEntityRows, applyFieldChanges, applyVisualAssetsEffect, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertFieldChanges, assertMediaAssetWritePolicy, assertValidVideoDocument, audioScriptAssetContent, audioScriptAssetFields, audioScriptAssetHash, audioScriptAssetOf, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hasVisualAssetsEffect, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, isTranscribedAudioScript, laneTrackId, mainTrackRanges, migrateAlpha23EntityDocument, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, phoneticScriptAssetContent, phoneticScriptAssetHash, phoneticScriptAssetOf, prepareCaptionContent, projectEntityTimeline, publishEntityRows, readDocumentAudioScript, readEntityDocument, readEntityRelationRecords, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveFieldPath, resolveSpeechOverlapByShiftingVideos, reviseAudioScript, safeDurationMs, index_d_exports as schemas, scriptSourceAssetOf, selectAudioScriptSegment, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as buildSpeechHostMap, A as EntityProjectionGraph, At as recordEntries, B as assembleEntityContent, C as scriptSourceAssetOf, Ct as isEmptyVideoClip, D as assertFieldChanges, Dt as effectiveVideoClipDurationMs, E as applyFieldChanges, Et as DEFAULT_UNIT_TIME_MS, F as relationsFrom, G as updateEntityFields, H as assembleScriptText, I as relationsTo, J as createEntityId, K as variantBaseEntityIds, L as scriptContentHash, M as EntityTimelineProjectionError, Mt as base64ToBytes, N as validateEntityRelationTransition, Nt as bytesToBase64, O as resolveFieldPath, Ot as speedOf, P as decodeEntityRelationRows, Q as buildInitialVideoDocument, R as ScriptCompositionError, S as phoneticScriptAssetOf, St as TIMELINE_SKELETON_DURATION_MS, T as equalJson, Tt as safeDurationMs, U as findComposedAudioScript, V as assemblePhoneticScriptContent, W as selectAudioScriptSegment, X as hasSequence, Y as createRelationId, Z as isMediaAssetVariantKind, _ as audioScriptAssetHash, _t as reassignSpeechesToVideoClipsByTime, a as createMirrorVideoDocument, at as validateVideoDocument, b as phoneticScriptAssetContent, bt as resolveSpeechOverlapByShiftingVideos, c as DocumentMutationGuard, ct as LANE_KINDS_IN_STACK_ORDER, d as LoroEntityDraft, dt as hasResolvedPlacement, et as derivePositionFromAbs, f as readEntityDocument, ft as laneTrackId, g as audioScriptAssetFields, gt as fillMainTrackTimeGaps, h as audioScriptAssetContent, ht as arrangeMainTrackSeamlessly, i as MirrorVideoDocumentAdapter, it as assertValidVideoDocument, j as resolveEntityTimelineLayout, jt as videoDocumentMirrorSchema, k as projectEntityTimeline, kt as partUnionToDraft, l as LORO_ENTITY_SCHEMA, lt as ensureLaneTrack, m as entityOrderGroups, mt as cascadeAfterVideoClipChanges, n as createPlainMemoryAdapter, nt as toVideoDocument, o as createMirrorVideoDocumentAdapter, ot as partUnionSchema, p as readEntityRelationRecords, pt as solveVideoDocument, q as isJsonObject, r as generatePartId, rt as VideoDocumentValidationError, s as readVideoDocumentFromDraft, st as videoDocumentSchema, t as PlainMemoryAdapter, tt as fromVideoDocument, u as LoroEntityDocument, ut as findLaneTrack, v as audioScriptAssetOf, vt as recalculateTimelineDuration, w as canonicalJson, wt as partDurationMs, x as phoneticScriptAssetHash, xt as syncAggregatedClipsTimePosition, y as isTranscribedAudioScript, yt as resolveAllSpeechOverlaps, z as assembleCaptionContent } from "./document-BCQE5ofl.js";
|
|
2
2
|
import { addSpeechesInputSchema, addVideoClipsInputSchema, adjustBgmVolumeInputSchema, adjustSpeechVolumeInputSchema, adjustVideoClipDurationInputSchema, adjustVideoClipVolumeInputSchema, changeSpeechScriptInputSchema, changeSpeechVoiceInputSchema, deleteBgmInputSchema, deleteSpeechesInputSchema, deleteVideoClipsInputSchema, moveSpeechesInputSchema, moveVideoClipsByAnchorInputSchema, moveVideoClipsInputSchema, replaceVideoClipContentInputSchema, replaceVideoClipSequenceInputSchema, setBgmInputSchema, setCaptionStyleInputSchema, setCaptionVisibilityInputSchema, setVideoClipSpeedShiftInputSchema, t as schemas_exports } from "./schemas.js";
|
|
3
3
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
4
4
|
import { bytesToHex } from "@noble/hashes/utils.js";
|
|
@@ -358,6 +358,12 @@ function assetIdsOf(rows, entityId) {
|
|
|
358
358
|
function assertMediaAssetWritePolicy(before, after) {
|
|
359
359
|
const beforeEntities = new Map(before.entities.map((row) => [String(row.entityId), row]));
|
|
360
360
|
assertCanonicalEditorResources(after);
|
|
361
|
+
for (const relation of after.relations) {
|
|
362
|
+
if (relation.relationKind !== "from-asset" && relation.relationKind !== "to-asset") continue;
|
|
363
|
+
if (!isTranscribedAudioScript(after, relation.endpoint0EntityId)) continue;
|
|
364
|
+
if (before.relations.some((prior) => prior.relationKind === relation.relationKind && prior.endpoint0EntityId === relation.endpoint0EntityId && prior.endpoint1EntityId === relation.endpoint1EntityId)) continue;
|
|
365
|
+
throw new EntityTimelineProjectionError("ASR resources belong to Caption, not the transcribed AudioScript");
|
|
366
|
+
}
|
|
361
367
|
for (const row of after.entities) {
|
|
362
368
|
if (row.entityKind !== "asset") continue;
|
|
363
369
|
const prior = memotaLocator(beforeEntities.get(String(row.entityId))?.payload);
|
|
@@ -5590,4 +5596,4 @@ function serverCovers(serverVV, target) {
|
|
|
5590
5596
|
return covers(server, target);
|
|
5591
5597
|
}
|
|
5592
5598
|
//#endregion
|
|
5593
|
-
export { DEFAULT_UNIT_TIME_MS, EntityGraphHttpClient, EntityGraphRevisionConflictError, EntityTimelineEditor, EntityTimelineProjectionError, IMPLEMENTED_SEMANTIC_OP_KINDS, LANE_KINDS_IN_STACK_ORDER, LORO_ENTITY_SCHEMA, LoroEntityDocument, LoroEntityDraft, ManualSyncDoc, MedeoHttpDocStorage, MemoryDocStorage, MengineAckFailedError, MengineDocSession, MengineHttpClient, MengineHttpRequestError, MenginePushRejectedError, MirrorVideoDocumentAdapter, PlainMemoryAdapter, SchemaValidator, ScriptCompositionError, SemanticEditor, TIMELINE_SKELETON_DURATION_MS, ValidationError, VideoDocumentValidationError, applyEntityRows, applyFieldChanges, applyVisualAssetsEffect, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertFieldChanges, assertMediaAssetWritePolicy, assertValidVideoDocument, audioScriptAssetContent, audioScriptAssetFields, audioScriptAssetHash, audioScriptAssetOf, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hasVisualAssetsEffect, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, migrateAlpha23EntityDocument, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, phoneticScriptAssetContent, phoneticScriptAssetHash, phoneticScriptAssetOf, prepareCaptionContent, projectEntityTimeline, publishEntityRows, readDocumentAudioScript, readEntityDocument, readEntityRelationRecords, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveFieldPath, resolveSpeechOverlapByShiftingVideos, reviseAudioScript, safeDurationMs, schemas_exports as schemas, scriptSourceAssetOf, selectAudioScriptSegment, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|
|
5599
|
+
export { DEFAULT_UNIT_TIME_MS, EntityGraphHttpClient, EntityGraphRevisionConflictError, EntityTimelineEditor, EntityTimelineProjectionError, IMPLEMENTED_SEMANTIC_OP_KINDS, LANE_KINDS_IN_STACK_ORDER, LORO_ENTITY_SCHEMA, LoroEntityDocument, LoroEntityDraft, ManualSyncDoc, MedeoHttpDocStorage, MemoryDocStorage, MengineAckFailedError, MengineDocSession, MengineHttpClient, MengineHttpRequestError, MenginePushRejectedError, MirrorVideoDocumentAdapter, PlainMemoryAdapter, SchemaValidator, ScriptCompositionError, SemanticEditor, TIMELINE_SKELETON_DURATION_MS, ValidationError, VideoDocumentValidationError, applyEntityRows, applyFieldChanges, applyVisualAssetsEffect, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertFieldChanges, assertMediaAssetWritePolicy, assertValidVideoDocument, audioScriptAssetContent, audioScriptAssetFields, audioScriptAssetHash, audioScriptAssetOf, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hasVisualAssetsEffect, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, isTranscribedAudioScript, laneTrackId, mainTrackRanges, migrateAlpha23EntityDocument, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, phoneticScriptAssetContent, phoneticScriptAssetHash, phoneticScriptAssetOf, prepareCaptionContent, projectEntityTimeline, publishEntityRows, readDocumentAudioScript, readEntityDocument, readEntityRelationRecords, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveFieldPath, resolveSpeechOverlapByShiftingVideos, reviseAudioScript, safeDurationMs, schemas_exports as schemas, scriptSourceAssetOf, selectAudioScriptSegment, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|
package/dist/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as
|
|
1
|
+
import { Mt as base64ToBytes, Nt as bytesToBase64, o as createMirrorVideoDocumentAdapter } from "./document-BCQE5ofl.js";
|
|
2
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengine/medeo-client",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.31",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"immer": "^10.2.0",
|
|
29
29
|
"loro-mirror": "^2.3.3",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@mengine/storage": "2.0.1-alpha.
|
|
32
|
-
"@mengine/sync": "2.0.1-alpha.
|
|
33
|
-
"@mengine/utils": "2.0.1-alpha.
|
|
31
|
+
"@mengine/storage": "2.0.1-alpha.31",
|
|
32
|
+
"@mengine/sync": "2.0.1-alpha.31",
|
|
33
|
+
"@mengine/utils": "2.0.1-alpha.31"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^25.9.1",
|