MCPcopy Create free account
hub / github.com/apitable/apitable / ops2Changeset

Method ops2Changeset

packages/core/src/engine/buffer_storage.ts:196–210  ·  view source on GitHub ↗
(ops: IOperation[], revision: number, resourceId: string, resourceType: ResourceType)

Source from the content-addressed store, hash-verified

194 }
195
196 static ops2Changeset(ops: IOperation[], revision: number, resourceId: string, resourceType: ResourceType): ILocalChangeset {
197 const messageId = generateRandomString();
198 if (isClient()) {
199 // register the messageId to event manager
200 new CustomEvent(messageId);
201 localStorage.setItem('doing_op_messageId', messageId);
202 }
203 return {
204 messageId,
205 baseRevision: revision,
206 resourceId,
207 resourceType,
208 operations: composeOperations(ops),
209 };
210 }
211
212 // Clearing the opBuffer will lose unsynchronized data
213 clearOpBuffer() {

Callers 2

deOpBufferMethod · 0.80
applyLocalDataMethod · 0.80

Calls 4

generateRandomStringFunction · 0.90
isClientFunction · 0.90
composeOperationsFunction · 0.90
setItemMethod · 0.80

Tested by

no test coverage detected