document-drive 1.0.0-experimental.8 → 1.0.0-websockets

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.
@@ -3,13 +3,14 @@ import type {
3
3
  DocumentDriveDocument,
4
4
  } from 'document-model-libs/document-drive';
5
5
  import type {
6
+ Action,
6
7
  BaseAction,
7
8
  Document,
8
9
  DocumentHeader,
9
- ExtendedState,
10
+ DocumentOperations,
10
11
  Operation,
11
- State
12
12
  } from 'document-model/document';
13
+ import type { SynchronizationUnitQuery } from '../server/types';
13
14
 
14
15
  export type DocumentStorage<D extends Document = Document> = Omit<
15
16
  D,
@@ -18,6 +19,10 @@ export type DocumentStorage<D extends Document = Document> = Omit<
18
19
 
19
20
  export type DocumentDriveStorage = DocumentStorage<DocumentDriveDocument>;
20
21
 
22
+ export interface IStorageDelegate {
23
+ getCachedOperations(drive: string, id: string): Promise<DocumentOperations<Action> | undefined>;
24
+ }
25
+
21
26
  export interface IStorage {
22
27
  checkDocumentExists(drive: string, id: string): Promise<boolean>;
23
28
  getDocuments: (drive: string) => Promise<string[]>;
@@ -39,12 +44,20 @@ export interface IStorage {
39
44
  callback: (document: DocumentStorage) => Promise<{
40
45
  operations: Operation[];
41
46
  header: DocumentHeader;
42
- newState: State<any, any> | undefined
43
47
  }>
44
48
  ): Promise<void>;
45
49
  deleteDocument(drive: string, id: string): Promise<void>;
50
+ getOperationResultingState?(drive: string, id: string, index: number, scope: string, branch: string): Promise<unknown>;
51
+ setStorageDelegate?(delegate: IStorageDelegate): void;
52
+ getSynchronizationUnitsRevision(units: SynchronizationUnitQuery[]): Promise<{
53
+ driveId: string;
54
+ documentId: string;
55
+ scope: string;
56
+ branch: string;
57
+ lastUpdated: string;
58
+ revision: number;
59
+ }[]>
46
60
  }
47
-
48
61
  export interface IDriveStorage extends IStorage {
49
62
  getDrives(): Promise<string[]>;
50
63
  getDrive(id: string): Promise<DocumentDriveStorage>;
@@ -64,4 +77,5 @@ export interface IDriveStorage extends IStorage {
64
77
  header: DocumentHeader;
65
78
  }>
66
79
  ): Promise<void>;
67
- }
80
+ getDriveOperationResultingState?(drive: string, index: number, scope: string, branch: string): Promise<unknown>;
81
+ }
@@ -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
- }