@cool-office/collaboration-client 0.0.0-stage → 1.2.2
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/LICENSE +176 -0
- package/README.md +2 -2
- package/lib/cjs/chunk-4MGIQFAJ.js +40 -0
- package/lib/cjs/chunk-JHTS3PZO.js +1882 -0
- package/lib/cjs/facade.js +98 -0
- package/lib/cjs/index.js +209 -0
- package/lib/cjs/locale/ar-SA.js +25 -0
- package/lib/cjs/locale/ca-ES.js +25 -0
- package/lib/cjs/locale/de-DE.js +25 -0
- package/lib/cjs/locale/en-US.js +25 -0
- package/lib/cjs/locale/es-ES.js +25 -0
- package/lib/cjs/locale/fa-IR.js +25 -0
- package/lib/cjs/locale/fr-FR.js +25 -0
- package/lib/cjs/locale/id-ID.js +25 -0
- package/lib/cjs/locale/it-IT.js +25 -0
- package/lib/cjs/locale/ja-JP.js +25 -0
- package/lib/cjs/locale/ko-KR.js +25 -0
- package/lib/cjs/locale/pl-PL.js +25 -0
- package/lib/cjs/locale/pt-BR.js +25 -0
- package/lib/cjs/locale/ru-RU.js +25 -0
- package/lib/cjs/locale/sk-SK.js +25 -0
- package/lib/cjs/locale/vi-VN.js +25 -0
- package/lib/cjs/locale/zh-CN.js +25 -0
- package/lib/cjs/locale/zh-HK.js +25 -0
- package/lib/cjs/locale/zh-TW.js +25 -0
- package/lib/cjs/package.json +1 -0
- package/lib/es/chunk-4MGIQFAJ.js +16 -0
- package/lib/es/chunk-JHTS3PZO.js +1832 -0
- package/lib/es/facade.js +80 -0
- package/lib/es/index.js +186 -0
- package/lib/es/locale/ar-SA.js +7 -0
- package/lib/es/locale/ca-ES.js +7 -0
- package/lib/es/locale/de-DE.js +7 -0
- package/lib/es/locale/en-US.js +7 -0
- package/lib/es/locale/es-ES.js +7 -0
- package/lib/es/locale/fa-IR.js +7 -0
- package/lib/es/locale/fr-FR.js +7 -0
- package/lib/es/locale/id-ID.js +7 -0
- package/lib/es/locale/it-IT.js +7 -0
- package/lib/es/locale/ja-JP.js +7 -0
- package/lib/es/locale/ko-KR.js +7 -0
- package/lib/es/locale/pl-PL.js +7 -0
- package/lib/es/locale/pt-BR.js +7 -0
- package/lib/es/locale/ru-RU.js +7 -0
- package/lib/es/locale/sk-SK.js +7 -0
- package/lib/es/locale/vi-VN.js +7 -0
- package/lib/es/locale/zh-CN.js +7 -0
- package/lib/es/locale/zh-HK.js +7 -0
- package/lib/es/locale/zh-TW.js +7 -0
- package/lib/types/src/assets.d.ts +41 -0
- package/lib/types/src/authorization.d.ts +31 -0
- package/lib/types/src/changeset-submitter.d.ts +80 -0
- package/lib/types/src/document-object-resources.d.ts +4 -0
- package/lib/types/src/document-recovery.d.ts +82 -0
- package/lib/types/src/document-undo.d.ts +9 -0
- package/lib/types/src/facade/index.d.ts +46 -0
- package/lib/types/src/index.d.ts +14 -0
- package/lib/types/src/locale/ar-SA.d.ts +20 -0
- package/lib/types/src/locale/ca-ES.d.ts +20 -0
- package/lib/types/src/locale/de-DE.d.ts +20 -0
- package/lib/types/src/locale/en-US.d.ts +20 -0
- package/lib/types/src/locale/es-ES.d.ts +20 -0
- package/lib/types/src/locale/fa-IR.d.ts +20 -0
- package/lib/types/src/locale/fr-FR.d.ts +20 -0
- package/lib/types/src/locale/id-ID.d.ts +20 -0
- package/lib/types/src/locale/it-IT.d.ts +20 -0
- package/lib/types/src/locale/ja-JP.d.ts +20 -0
- package/lib/types/src/locale/ko-KR.d.ts +20 -0
- package/lib/types/src/locale/pl-PL.d.ts +20 -0
- package/lib/types/src/locale/pt-BR.d.ts +20 -0
- package/lib/types/src/locale/ru-RU.d.ts +20 -0
- package/lib/types/src/locale/sk-SK.d.ts +20 -0
- package/lib/types/src/locale/vi-VN.d.ts +20 -0
- package/lib/types/src/locale/zh-CN.d.ts +20 -0
- package/lib/types/src/locale/zh-HK.d.ts +20 -0
- package/lib/types/src/locale/zh-TW.d.ts +20 -0
- package/lib/types/src/revision-recovery.d.ts +93 -0
- package/lib/types/src/session.d.ts +85 -0
- package/lib/types/src/snapshot-server.d.ts +25 -0
- package/lib/types/src/socket.d.ts +46 -0
- package/lib/types/src/workspace.d.ts +100 -0
- package/package.json +160 -4
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { DocumentDataModel, ICommandService, IDocumentData, IResourceManagerService, JSONXActions } from '@cool-office/core';
|
|
2
|
+
import { Disposable } from '@cool-office/core';
|
|
3
|
+
import type { IRevisionRecoveryOptions, RecoveryStatus } from './revision-recovery.js';
|
|
4
|
+
import type { CollaborationSessionService } from './session.js';
|
|
5
|
+
import type { SnapshotServerOverHTTPService } from './snapshot-server.js';
|
|
6
|
+
export type DocumentAccess = 'write' | 'read' | 'none';
|
|
7
|
+
export interface DocumentConnectionOptions {
|
|
8
|
+
initialAccess: DocumentAccess;
|
|
9
|
+
access(): Promise<DocumentAccess>;
|
|
10
|
+
setAccess(access: DocumentAccess): void;
|
|
11
|
+
recoveryKey?: string;
|
|
12
|
+
resources?: IResourceManagerService;
|
|
13
|
+
beforeRemote?(operation: JSONXActions, before: IDocumentData): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class DocumentCollaborationRecovery extends Disposable {
|
|
16
|
+
readonly options: IRevisionRecoveryOptions;
|
|
17
|
+
private readonly _commands;
|
|
18
|
+
private readonly _snapshots;
|
|
19
|
+
private readonly _sessions;
|
|
20
|
+
private readonly _model;
|
|
21
|
+
private readonly _connection;
|
|
22
|
+
private readonly _remove;
|
|
23
|
+
private readonly _state;
|
|
24
|
+
readonly status$: import("rxjs").Observable<RecoveryStatus>;
|
|
25
|
+
private _confirmed;
|
|
26
|
+
private _queue;
|
|
27
|
+
private _sid;
|
|
28
|
+
private _next;
|
|
29
|
+
private _reason;
|
|
30
|
+
private _conflictBase?;
|
|
31
|
+
private _conflictRemote;
|
|
32
|
+
private _session?;
|
|
33
|
+
private _grant;
|
|
34
|
+
private _closed;
|
|
35
|
+
private _ready;
|
|
36
|
+
private _pulling;
|
|
37
|
+
private _accessPending;
|
|
38
|
+
private _generation;
|
|
39
|
+
private _sending;
|
|
40
|
+
private _ackTimer?;
|
|
41
|
+
private _buffer;
|
|
42
|
+
private _storageError;
|
|
43
|
+
private _batch?;
|
|
44
|
+
constructor(options: IRevisionRecoveryOptions, _commands: ICommandService, _snapshots: SnapshotServerOverHTTPService, _sessions: CollaborationSessionService, _model: DocumentDataModel, _connection: DocumentConnectionOptions, _remove: () => void);
|
|
45
|
+
get status(): RecoveryStatus;
|
|
46
|
+
get revision(): number;
|
|
47
|
+
get hasWritePending(): boolean;
|
|
48
|
+
get conflictReason(): string | null;
|
|
49
|
+
get canPublishConflict(): boolean;
|
|
50
|
+
getUnrecoverableDraft(): string | undefined;
|
|
51
|
+
getPendingEdits(): {
|
|
52
|
+
edits: {
|
|
53
|
+
id: string;
|
|
54
|
+
params: {
|
|
55
|
+
unitId: string;
|
|
56
|
+
actions: JSONXActions;
|
|
57
|
+
};
|
|
58
|
+
}[];
|
|
59
|
+
incomplete: boolean;
|
|
60
|
+
awaitingConfirmation: boolean;
|
|
61
|
+
};
|
|
62
|
+
getLocalDocument(): IDocumentData;
|
|
63
|
+
getConfirmedDocument(): IDocumentData;
|
|
64
|
+
getProposedDocument(): IDocumentData;
|
|
65
|
+
markUnitUnavailable(): void;
|
|
66
|
+
start(): Promise<void>;
|
|
67
|
+
/** The caller shows the two snapshots and supplies the revision the user actually reviewed. */
|
|
68
|
+
resolveDocumentConflict(choice: 'remote' | 'local', reviewedRevision: number): Promise<boolean>;
|
|
69
|
+
private _refreshAccess;
|
|
70
|
+
private _pull;
|
|
71
|
+
private _drain;
|
|
72
|
+
private _apply;
|
|
73
|
+
private _finishObjectCommand;
|
|
74
|
+
private _enqueue;
|
|
75
|
+
private _submit;
|
|
76
|
+
private _clearSend;
|
|
77
|
+
private _update;
|
|
78
|
+
private _conflict;
|
|
79
|
+
private _save;
|
|
80
|
+
private _restore;
|
|
81
|
+
dispose(): void;
|
|
82
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IDocumentData, IMutationInfo, JSONXActions } from '@cool-office/core';
|
|
2
|
+
import { LocalUndoRedoService } from '@cool-office/core';
|
|
3
|
+
/** Keep each user's undo and redo operations in the coordinate system of the current document. */
|
|
4
|
+
export declare class DocumentCollaborationUndoService extends LocalUndoRedoService {
|
|
5
|
+
/** A later write to the same cell belongs to its author and must survive local undo. */
|
|
6
|
+
transformSheetHistory(unitID: string, changes: readonly IMutationInfo[]): void;
|
|
7
|
+
transformDocumentHistory(unitID: string, remote: JSONXActions, before: IDocumentData): void;
|
|
8
|
+
private _transformStack;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ILogContext } from '@cool-office/collaboration';
|
|
2
|
+
import type { Injector, UnitModel } from '@cool-office/core';
|
|
3
|
+
import type { IEventBase } from '@cool-office/core/facade';
|
|
4
|
+
import { FUniver } from '@cool-office/core/facade';
|
|
5
|
+
import type { IMember } from '@cool-office/protocol';
|
|
6
|
+
import { CollaborationStatus } from '../workspace.js';
|
|
7
|
+
type UnitGetter = 'getWorkbook' | 'getDocument' | 'getPresentation' | 'getBoard' | 'getBase';
|
|
8
|
+
type Loaded<T, K extends UnitGetter> = T extends Record<K, (id: string) => infer R> ? R : UnitModel | null;
|
|
9
|
+
export interface ICollaborationFlushOptions {
|
|
10
|
+
timeout?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ICollaborationStatusChangedEventParams extends IEventBase {
|
|
13
|
+
unitId: string;
|
|
14
|
+
status: CollaborationStatus;
|
|
15
|
+
}
|
|
16
|
+
/** Loads the same native model that is attached to the collaboration room. */
|
|
17
|
+
export declare class FCollaboration<T extends FUniver = FUniver> {
|
|
18
|
+
private readonly api;
|
|
19
|
+
private readonly injector;
|
|
20
|
+
constructor(api: T, injector: Injector);
|
|
21
|
+
private load;
|
|
22
|
+
loadSheetAsync(id: string, context?: ILogContext): Promise<Loaded<T, "getWorkbook">>;
|
|
23
|
+
loadDocAsync(id: string, context?: ILogContext): Promise<Loaded<T, "getDocument">>;
|
|
24
|
+
loadSlideAsync(id: string, context?: ILogContext): Promise<Loaded<T, "getPresentation">>;
|
|
25
|
+
loadBoardAsync(id: string, context?: ILogContext): Promise<Loaded<T, "getBoard">>;
|
|
26
|
+
loadBaseAsync(id: string, context?: ILogContext): Promise<Loaded<T, "getBase">>;
|
|
27
|
+
private focusedId;
|
|
28
|
+
getCollaborationStatus(id?: string | undefined): CollaborationStatus;
|
|
29
|
+
flush(id?: string | undefined, options?: ICollaborationFlushOptions): Promise<void>;
|
|
30
|
+
subscribeCollaborators(id: string, callback: (members: IMember[]) => void): import("@wendellhu/redi").IDisposable;
|
|
31
|
+
}
|
|
32
|
+
declare module '@cool-office/core/facade' {
|
|
33
|
+
interface FUniver {
|
|
34
|
+
getCollaboration(): FCollaboration<this>;
|
|
35
|
+
}
|
|
36
|
+
interface FEventName {
|
|
37
|
+
readonly CollaborationStatusChanged: 'CollaborationStatusChanged';
|
|
38
|
+
}
|
|
39
|
+
interface IEventParamConfig {
|
|
40
|
+
CollaborationStatusChanged: ICollaborationStatusChangedEventParams;
|
|
41
|
+
}
|
|
42
|
+
interface FEnum {
|
|
43
|
+
readonly CollaborationStatus: typeof CollaborationStatus;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ChangesetSubmitter, DEFAULT_ACK_TIMEOUT, MAX_ACK_TIMEOUT } from './changeset-submitter.js';
|
|
2
|
+
export type { ChangesetResendReason, IChangesetResendEvent, IChangesetSubmitterOptions, IChangesetSubmitterSource, SendChangeset } from './changeset-submitter.js';
|
|
3
|
+
export { DocumentCollaborationRecovery } from './document-recovery.js';
|
|
4
|
+
export type { DocumentAccess, DocumentConnectionOptions } from './document-recovery.js';
|
|
5
|
+
export { DocumentCollaborationUndoService } from './document-undo.js';
|
|
6
|
+
export { CollaborationRevisionRecovery, CollaborationRevisionRecoveryService } from './revision-recovery.js';
|
|
7
|
+
export type { EditorRevisionRecovery, IRevisionRecoveryOptions, RecoveryStatus } from './revision-recovery.js';
|
|
8
|
+
export { CollaborationSession, CollaborationSessionService, SessionStatus } from './session.js';
|
|
9
|
+
export type { ICollaborationEvent } from './session.js';
|
|
10
|
+
export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY, DEFAULT_SNAPSHOT_SERVER_URL, SNAPSHOT_URL_KEY, SnapshotServerOverHTTPService } from './snapshot-server.js';
|
|
11
|
+
export { CollaborationSocketService, deserializeToCombResponse, ICollaborationSocketService, serializeCombRequest } from './socket.js';
|
|
12
|
+
export type { ICollaborationSocket, ICombEvent } from './socket.js';
|
|
13
|
+
export * from './workspace.js';
|
|
14
|
+
export * from './assets.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
collaborationClient: {
|
|
3
|
+
status: {
|
|
4
|
+
synced: string;
|
|
5
|
+
connecting: string;
|
|
6
|
+
pending: string;
|
|
7
|
+
offline: string;
|
|
8
|
+
conflict: string;
|
|
9
|
+
conflictDetail: string;
|
|
10
|
+
readonly: string;
|
|
11
|
+
denied: string;
|
|
12
|
+
localVersion: string;
|
|
13
|
+
remoteVersion: string;
|
|
14
|
+
useRemote: string;
|
|
15
|
+
useLocal: string;
|
|
16
|
+
reviewAgain: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { IDocumentData, JSONXActions } from '@cool-office/core';
|
|
2
|
+
import type { UniverType } from '@cool-office/protocol';
|
|
3
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@cool-office/core';
|
|
4
|
+
import type { DocumentConnectionOptions } from './document-recovery.js';
|
|
5
|
+
import { DocumentCollaborationRecovery } from './document-recovery.js';
|
|
6
|
+
import { CollaborationSessionService } from './session.js';
|
|
7
|
+
import { SnapshotServerOverHTTPService } from './snapshot-server.js';
|
|
8
|
+
export type RecoveryStatus = 'connecting' | 'recovering' | 'synced' | 'pending' | 'offline' | 'conflict' | 'readonly' | 'denied';
|
|
9
|
+
export interface IRevisionRecoveryOptions {
|
|
10
|
+
unitID: string;
|
|
11
|
+
unitType: UniverType;
|
|
12
|
+
revision: number;
|
|
13
|
+
userID?: string;
|
|
14
|
+
document?: DocumentConnectionOptions;
|
|
15
|
+
sheetObjects?: boolean;
|
|
16
|
+
nativeMutations?: boolean;
|
|
17
|
+
onRemoteRestore?: () => void;
|
|
18
|
+
beforeRemoteDocument?(action: JSONXActions, before: IDocumentData): void;
|
|
19
|
+
beforeRemoteSheet?(batch: LocalEdit[]): void;
|
|
20
|
+
}
|
|
21
|
+
interface LocalEdit {
|
|
22
|
+
id: string;
|
|
23
|
+
params: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Synchronizes a restricted set of cell edits and contiguous remote revisions.
|
|
27
|
+
* It stops on concurrent changes, unsupported mutations or uncertain application.
|
|
28
|
+
*/
|
|
29
|
+
export declare class CollaborationRevisionRecovery extends Disposable {
|
|
30
|
+
readonly options: IRevisionRecoveryOptions;
|
|
31
|
+
private readonly _commands;
|
|
32
|
+
private readonly _snapshots;
|
|
33
|
+
private readonly _sessions;
|
|
34
|
+
private readonly _instances;
|
|
35
|
+
private readonly _onDispose?;
|
|
36
|
+
private readonly _status;
|
|
37
|
+
readonly status$: import("rxjs").Observable<RecoveryStatus>;
|
|
38
|
+
private readonly _subscriptions;
|
|
39
|
+
private readonly _pending;
|
|
40
|
+
private _session;
|
|
41
|
+
private _revision;
|
|
42
|
+
private _generation;
|
|
43
|
+
private _localDirty;
|
|
44
|
+
private _closed;
|
|
45
|
+
private _reason;
|
|
46
|
+
private readonly _localEdits;
|
|
47
|
+
private _inflight;
|
|
48
|
+
private _ackTimer;
|
|
49
|
+
private _nextRequest;
|
|
50
|
+
private readonly _sid;
|
|
51
|
+
private _untrackedLocalEdit;
|
|
52
|
+
constructor(options: IRevisionRecoveryOptions, _commands: ICommandService, _snapshots: SnapshotServerOverHTTPService, _sessions: CollaborationSessionService, _instances: IUniverInstanceService, _onDispose?: (() => void) | undefined);
|
|
53
|
+
get revision(): number;
|
|
54
|
+
get status(): RecoveryStatus;
|
|
55
|
+
get conflictReason(): string | null;
|
|
56
|
+
get hasWritePending(): boolean;
|
|
57
|
+
/** Retains in-memory pending edits when the editor closes the bound unit. */
|
|
58
|
+
markUnitUnavailable(): void;
|
|
59
|
+
/** Memory-only copy for the caller to preserve or inspect before disposing the unit. */
|
|
60
|
+
getPendingEdits(): {
|
|
61
|
+
edits: LocalEdit[];
|
|
62
|
+
incomplete: boolean;
|
|
63
|
+
awaitingConfirmation: boolean;
|
|
64
|
+
};
|
|
65
|
+
start(): Promise<void>;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
private _localMutation;
|
|
68
|
+
private _withinSheet;
|
|
69
|
+
private _acceptsLocal;
|
|
70
|
+
private _submitNext;
|
|
71
|
+
private _send;
|
|
72
|
+
private _ack;
|
|
73
|
+
private _clearAckTimer;
|
|
74
|
+
private _recover;
|
|
75
|
+
private _finishNative;
|
|
76
|
+
private _applyNativeBatch;
|
|
77
|
+
private _drain;
|
|
78
|
+
private _conflict;
|
|
79
|
+
private _isConflict;
|
|
80
|
+
}
|
|
81
|
+
export type EditorRevisionRecovery = CollaborationRevisionRecovery | DocumentCollaborationRecovery;
|
|
82
|
+
export declare class CollaborationRevisionRecoveryService {
|
|
83
|
+
private readonly _commands;
|
|
84
|
+
private readonly _snapshots;
|
|
85
|
+
private readonly _sessions;
|
|
86
|
+
private readonly _instances;
|
|
87
|
+
private readonly _active;
|
|
88
|
+
readonly active$: import("rxjs").Observable<ReadonlyMap<string, EditorRevisionRecovery>>;
|
|
89
|
+
get(unitID: string): EditorRevisionRecovery | undefined;
|
|
90
|
+
constructor(_commands: ICommandService, _snapshots: SnapshotServerOverHTTPService, _sessions: CollaborationSessionService, _instances: IUniverInstanceService);
|
|
91
|
+
attach(options: IRevisionRecoveryOptions): Promise<EditorRevisionRecovery>;
|
|
92
|
+
}
|
|
93
|
+
export {};
|