document-drive 1.0.0-experimental.10 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-drive",
3
- "version": "1.0.0-experimental.10",
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,11 +34,11 @@
34
34
  "test:watch": "vitest watch"
35
35
  },
36
36
  "peerDependencies": {
37
- "document-model": "1.1.0-experimental.1",
38
- "document-model-libs": "^1.37.0"
37
+ "document-model": "1.1.0-experimental.4",
38
+ "document-model-libs": "^1.52.0"
39
39
  },
40
40
  "optionalDependencies": {
41
- "@prisma/client": "5.11.0",
41
+ "@prisma/client": "5.14.0",
42
42
  "localforage": "^1.10.0",
43
43
  "redis": "^4.6.13",
44
44
  "sequelize": "^6.35.2",
@@ -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.1",
69
- "document-model-libs": "1.50.0-arbitrum.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",
@@ -74,7 +74,7 @@
74
74
  "msw": "^2.2.13",
75
75
  "prettier": "^3.2.5",
76
76
  "prettier-plugin-organize-imports": "^3.2.4",
77
- "prisma": "^5.12.1",
77
+ "prisma": "^5.14.0",
78
78
  "semantic-release": "^23.0.8",
79
79
  "sequelize": "^6.37.2",
80
80
  "sqlite3": "^5.1.7",
@@ -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.grabageCollectDocumentOperations(revisionOperations);
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(
@@ -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) {
@@ -137,7 +138,6 @@ export class PrismaStorage implements IDriveStorage {
137
138
  lastModified: document.lastModified,
138
139
  revision: JSON.stringify(document.revision),
139
140
  id,
140
- state: JSON.stringify(document.state)
141
141
  }
142
142
  });
143
143
  }
@@ -168,7 +168,8 @@ export class PrismaStorage implements IDriveStorage {
168
168
  scope: op.scope,
169
169
  branch: 'main',
170
170
  skip: op.skip,
171
- context: op.context
171
+ context: op.context,
172
+ resultingState: op.resultingState ? JSON.stringify(op.resultingState) : undefined
172
173
  }))
173
174
  });
174
175
 
@@ -335,7 +336,7 @@ export class PrismaStorage implements IDriveStorage {
335
336
  DocumentDriveState,
336
337
  DocumentDriveLocalState
337
338
  >,
338
- state: JSON.parse(dbDoc.state) as State<unknown, unknown>,
339
+ state: JSON.parse(dbDoc.state!) as State<unknown, unknown>,
339
340
  lastModified: new Date(dbDoc.lastModified).toISOString(),
340
341
  operations: {
341
342
  global: dbDoc.operations
@@ -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
- }