document-drive 0.0.26 → 0.0.28
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 +18 -10
- package/src/server/error.ts +18 -0
- package/src/server/index.ts +678 -82
- package/src/server/listener/index.ts +2 -0
- package/src/server/listener/manager.ts +382 -0
- package/src/server/listener/transmitter/index.ts +3 -0
- package/src/server/listener/transmitter/pull-responder.ts +308 -0
- package/src/server/listener/transmitter/switchboard-push.ts +63 -0
- package/src/server/listener/transmitter/types.ts +18 -0
- package/src/server/types.ts +209 -23
- package/src/storage/filesystem.ts +2 -2
- package/src/storage/index.ts +0 -4
- package/src/storage/memory.ts +5 -2
- package/src/storage/prisma.ts +65 -18
- package/src/utils/graphql.ts +46 -0
- package/src/{utils.ts → utils/index.ts} +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-drive",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./src/index.ts",
|
|
@@ -9,9 +9,12 @@
|
|
|
9
9
|
".": "./src/index.ts",
|
|
10
10
|
"./server": "./src/server/index.ts",
|
|
11
11
|
"./storage": "./src/storage/index.ts",
|
|
12
|
-
"./storage/filesystem": "./src/storage/filesystem.ts",
|
|
13
12
|
"./storage/browser": "./src/storage/browser.ts",
|
|
14
|
-
"./
|
|
13
|
+
"./storage/filesystem": "./src/storage/filesystem.ts",
|
|
14
|
+
"./storage/memory": "./src/storage/memory.ts",
|
|
15
|
+
"./storage/prisma": "./src/storage/prisma.ts",
|
|
16
|
+
"./utils": "./src/utils/index.ts",
|
|
17
|
+
"./utils/graphql": "./src/utils/graphql.ts"
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
17
20
|
"./src"
|
|
@@ -25,33 +28,38 @@
|
|
|
25
28
|
"test:watch": "vitest watch"
|
|
26
29
|
},
|
|
27
30
|
"peerDependencies": {
|
|
28
|
-
"@prisma/client": "5.
|
|
29
|
-
"document-model": "^1.0.
|
|
30
|
-
"document-model-libs": "^1.1.
|
|
31
|
+
"@prisma/client": "5.8.1",
|
|
32
|
+
"document-model": "^1.0.28",
|
|
33
|
+
"document-model-libs": "^1.1.44",
|
|
31
34
|
"localforage": "^1.10.0",
|
|
32
35
|
"sequelize": "^6.35.2",
|
|
33
36
|
"sqlite3": "^5.1.7"
|
|
34
37
|
},
|
|
35
38
|
"dependencies": {
|
|
39
|
+
"graphql": "^16.8.1",
|
|
40
|
+
"graphql-request": "^6.1.0",
|
|
41
|
+
"json-stringify-deterministic": "^1.0.12",
|
|
36
42
|
"sanitize-filename": "^1.6.3"
|
|
37
43
|
},
|
|
38
44
|
"devDependencies": {
|
|
39
|
-
"@prisma/client": "5.
|
|
45
|
+
"@prisma/client": "5.8.1",
|
|
40
46
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
47
|
+
"@types/node": "^20.11.16",
|
|
41
48
|
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
42
49
|
"@typescript-eslint/parser": "^6.18.1",
|
|
43
50
|
"@vitest/coverage-v8": "^0.34.6",
|
|
44
|
-
"document-model": "^1.0.
|
|
45
|
-
"document-model-libs": "^1.1.
|
|
51
|
+
"document-model": "^1.0.28",
|
|
52
|
+
"document-model-libs": "^1.1.44",
|
|
46
53
|
"eslint": "^8.56.0",
|
|
47
54
|
"eslint-config-prettier": "^9.1.0",
|
|
48
55
|
"fake-indexeddb": "^5.0.1",
|
|
49
56
|
"localforage": "^1.10.0",
|
|
57
|
+
"msw": "^2.1.2",
|
|
50
58
|
"prettier": "^3.1.1",
|
|
51
59
|
"prettier-plugin-organize-imports": "^3.2.4",
|
|
52
60
|
"sequelize": "^6.35.2",
|
|
53
61
|
"sqlite3": "^5.1.7",
|
|
54
62
|
"typescript": "^5.3.2",
|
|
55
|
-
"vitest": "^
|
|
63
|
+
"vitest": "^1.2.2"
|
|
56
64
|
}
|
|
57
65
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Operation } from 'document-model/document';
|
|
2
|
+
import type { ErrorStatus } from './types';
|
|
3
|
+
|
|
4
|
+
export class OperationError extends Error {
|
|
5
|
+
status: ErrorStatus;
|
|
6
|
+
operation: Operation | undefined;
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
status: ErrorStatus,
|
|
10
|
+
operation?: Operation,
|
|
11
|
+
message?: string,
|
|
12
|
+
cause?: unknown
|
|
13
|
+
) {
|
|
14
|
+
super(message, { cause: cause ?? operation });
|
|
15
|
+
this.status = status;
|
|
16
|
+
this.operation = operation;
|
|
17
|
+
}
|
|
18
|
+
}
|