document-drive 1.0.0-experimental.11 → 1.0.0-experimental.15
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 +5 -5
- package/src/server/index.ts +2 -2
- package/src/storage/prisma.ts +4 -2
- package/src/queue/manager.ts +0 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-drive",
|
|
3
|
-
"version": "1.0.0-experimental.
|
|
3
|
+
"version": "1.0.0-experimental.15",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./src/index.ts",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"test:watch": "vitest watch"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"document-model": "1.1.0-experimental.
|
|
38
|
-
"document-model-libs": "^1.
|
|
37
|
+
"document-model": "1.1.0-experimental.4",
|
|
38
|
+
"document-model-libs": "^1.52.0"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
41
|
"@prisma/client": "5.14.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
66
66
|
"@typescript-eslint/parser": "^6.21.0",
|
|
67
67
|
"@vitest/coverage-v8": "^1.4.0",
|
|
68
|
-
"document-model": "1.1.0-experimental.
|
|
69
|
-
"document-model-libs": "1.
|
|
68
|
+
"document-model": "1.1.0-experimental.4",
|
|
69
|
+
"document-model-libs": "1.53.0",
|
|
70
70
|
"eslint": "^8.57.0",
|
|
71
71
|
"eslint-config-prettier": "^9.1.0",
|
|
72
72
|
"fake-indexeddb": "^5.0.2",
|
package/src/server/index.ts
CHANGED
|
@@ -728,7 +728,7 @@ export class DocumentDriveServer extends BaseDocumentDriveServer {
|
|
|
728
728
|
documentStorage.operations,
|
|
729
729
|
options.revisions
|
|
730
730
|
) : documentStorage.operations;
|
|
731
|
-
const operations = baseUtils.documentHelpers.
|
|
731
|
+
const operations = baseUtils.documentHelpers.garbageCollectDocumentOperations(revisionOperations);
|
|
732
732
|
|
|
733
733
|
if (documentStorage.state && (!options || options.checkHashes === false)) {
|
|
734
734
|
return documentStorage as T;
|
|
@@ -792,7 +792,7 @@ export class DocumentDriveServer extends BaseDocumentDriveServer {
|
|
|
792
792
|
);
|
|
793
793
|
}
|
|
794
794
|
},
|
|
795
|
-
{ skip: operation.skip }
|
|
795
|
+
{ skip: operation.skip, reuseOperationResultingState: true, storeOperationResultingState: true }
|
|
796
796
|
) as T;
|
|
797
797
|
|
|
798
798
|
const appliedOperation = newDocument.operations[operation.scope].filter(
|
package/src/storage/prisma.ts
CHANGED
|
@@ -34,6 +34,7 @@ function storageToOperation(
|
|
|
34
34
|
input: JSON.parse(op.input),
|
|
35
35
|
type: op.type,
|
|
36
36
|
scope: op.scope as OperationScope,
|
|
37
|
+
resultingState: op.resultingState ? JSON.parse(op.resultingState) : undefined
|
|
37
38
|
// attachments: fileRegistry
|
|
38
39
|
};
|
|
39
40
|
if (op.context) {
|
|
@@ -167,7 +168,8 @@ export class PrismaStorage implements IDriveStorage {
|
|
|
167
168
|
scope: op.scope,
|
|
168
169
|
branch: 'main',
|
|
169
170
|
skip: op.skip,
|
|
170
|
-
context: op.context
|
|
171
|
+
context: op.context,
|
|
172
|
+
resultingState: op.resultingState ? JSON.stringify(op.resultingState) : undefined
|
|
171
173
|
}))
|
|
172
174
|
});
|
|
173
175
|
|
|
@@ -334,7 +336,7 @@ export class PrismaStorage implements IDriveStorage {
|
|
|
334
336
|
DocumentDriveState,
|
|
335
337
|
DocumentDriveLocalState
|
|
336
338
|
>,
|
|
337
|
-
state: JSON.parse(dbDoc.state) as State<unknown, unknown>,
|
|
339
|
+
state: JSON.parse(dbDoc.state!) as State<unknown, unknown>,
|
|
338
340
|
lastModified: new Date(dbDoc.lastModified).toISOString(),
|
|
339
341
|
operations: {
|
|
340
342
|
global: dbDoc.operations
|
package/src/queue/manager.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Unsubscribe } from "nanoevents";
|
|
2
|
-
import { IOperationResult } from "../server";
|
|
3
|
-
import { IQueueManager, QueueEvents } from "./types";
|
|
4
|
-
|
|
5
|
-
export class BaseQueueManager implements IQueueManager {
|
|
6
|
-
|
|
7
|
-
constructor() {
|
|
8
|
-
}
|
|
9
|
-
addJob(job: OperationJob): Promise<string> {
|
|
10
|
-
throw new Error("Method not implemented.");
|
|
11
|
-
}
|
|
12
|
-
getResult(driveId: string, documentId: string, jobId: JobId): Promise<IOperationResult | undefined> {
|
|
13
|
-
throw new Error("Method not implemented.");
|
|
14
|
-
}
|
|
15
|
-
init(processor: OperationJobProcessor, onError: (error: Error) => void): Promise<void> {
|
|
16
|
-
throw new Error("Method not implemented.");
|
|
17
|
-
}
|
|
18
|
-
on<K extends keyof QueueEvents>(this: this, event: K, cb: QueueEvents[K]): Unsubscribe {
|
|
19
|
-
throw new Error("Method not implemented.");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|