document-drive 1.0.0-alpha.6 → 1.0.0-alpha.8
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/package.json
CHANGED
package/src/server/index.ts
CHANGED
|
@@ -19,7 +19,12 @@ import {
|
|
|
19
19
|
import { createNanoEvents, Unsubscribe } from 'nanoevents';
|
|
20
20
|
import { MemoryStorage } from '../storage/memory';
|
|
21
21
|
import type { DocumentStorage, IDriveStorage } from '../storage/types';
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
generateUUID,
|
|
24
|
+
isBefore,
|
|
25
|
+
isDocumentDrive,
|
|
26
|
+
isNoopUpdate
|
|
27
|
+
} from '../utils';
|
|
23
28
|
import { requestPublicDrive } from '../utils/graphql';
|
|
24
29
|
import { OperationError } from './error';
|
|
25
30
|
import { ListenerManager } from './listener/manager';
|
|
@@ -305,10 +310,10 @@ export class DocumentDriveServer extends BaseDocumentDriveServer {
|
|
|
305
310
|
const filteredOperations = operations.filter(
|
|
306
311
|
operation =>
|
|
307
312
|
Object.keys(filter).length === 0 ||
|
|
308
|
-
(filter.since
|
|
309
|
-
filter.since
|
|
310
|
-
|
|
311
|
-
|
|
313
|
+
((filter.since === undefined ||
|
|
314
|
+
isBefore(filter.since, operation.timestamp)) &&
|
|
315
|
+
(filter.fromRevision === undefined ||
|
|
316
|
+
operation.index > filter.fromRevision))
|
|
312
317
|
);
|
|
313
318
|
|
|
314
319
|
return filteredOperations.map(operation => ({
|
package/src/utils/index.ts
CHANGED