@ckeditor/ckeditor-cloud-services-collaboration 0.0.0-internal-20251222.0
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.md +30 -0
- package/README.md +21 -0
- package/dist/ckeditorcloudserviceserror.d.ts +11 -0
- package/dist/ckeditorcloudservicesservererror.d.ts +18 -0
- package/dist/collaborativeeditingservice/collaborativeeditingservice.d.ts +131 -0
- package/dist/collaborativeeditingservice/descriptors/operationmetadatadescriptor.d.ts +21 -0
- package/dist/collaborativeeditingservice/helpers/operationmetadatahelpers.d.ts +14 -0
- package/dist/collaborativeeditingservice/messages/collaborativeeditingconnectmessage.d.ts +28 -0
- package/dist/collaborativeeditingservice/messages/collaborativeeditingreconnectmessage.d.ts +22 -0
- package/dist/collaborativeeditingservice/messages/collaborativeeditingupdatemessage.d.ts +42 -0
- package/dist/collaborativeeditingservice/messages/getdocumentdetailsmessage.d.ts +19 -0
- package/dist/collaborativeeditingservice/responses/collaborativeeditingconnectresponse.d.ts +72 -0
- package/dist/collaborativeeditingservice/responses/collaborativeeditingresponse.d.ts +55 -0
- package/dist/collaborativeeditingservice/responses/getdocumentdetailsresponse.d.ts +31 -0
- package/dist/comments-v2/commentsservice.d.ts +75 -0
- package/dist/comments-v2/descriptors/commentdescriptor.d.ts +26 -0
- package/dist/comments-v2/descriptors/commentsthreaddescriptor.d.ts +34 -0
- package/dist/comments-v2/descriptors/commentthreadaddedcomment.d.ts +18 -0
- package/dist/comments-v2/messages/addcommentmessage.d.ts +33 -0
- package/dist/comments-v2/messages/comment-threads/addcommentthreadmessage.d.ts +35 -0
- package/dist/comments-v2/messages/comment-threads/reopencommentthreadmessage.d.ts +20 -0
- package/dist/comments-v2/messages/comment-threads/resolvecommentthreadmessage.d.ts +24 -0
- package/dist/comments-v2/messages/comment-threads/updatecommentthreadmessage.d.ts +26 -0
- package/dist/comments-v2/messages/connectmessage.d.ts +18 -0
- package/dist/comments-v2/messages/getcommentthreadmessage.d.ts +20 -0
- package/dist/comments-v2/messages/getdocumentthreadsmessage.d.ts +18 -0
- package/dist/comments-v2/messages/removecommentmessage.d.ts +22 -0
- package/dist/comments-v2/messages/removecommentthreadmessage.d.ts +20 -0
- package/dist/comments-v2/messages/updatecommentmessage.d.ts +31 -0
- package/dist/comments-v2/responses/addcommentresponse.d.ts +20 -0
- package/dist/comments-v2/responses/comment-threads/addcommentthreadresponse.d.ts +25 -0
- package/dist/comments-v2/responses/comment-threads/resolvecommentthreadresponse.d.ts +22 -0
- package/dist/comments-v2/responses/connectresponse.d.ts +22 -0
- package/dist/comments-v2/responses/getcommentthreadresponse.d.ts +36 -0
- package/dist/comments-v2/responses/getdocumentthreadsresponse.d.ts +20 -0
- package/dist/compiledmessages.d.ts +6 -0
- package/dist/descriptor.d.ts +16 -0
- package/dist/descriptors/keyvaluedescriptor.d.ts +8 -0
- package/dist/editor/editorservice.d.ts +14 -0
- package/dist/editor/messages/iseditorbundleuploadedmessage.d.ts +18 -0
- package/dist/editor/responses/iseditorbundleuploadedresponse.d.ts +16 -0
- package/dist/errors/ServiceNotConnectedError.d.ts +7 -0
- package/dist/index.d.ts +68 -0
- package/dist/message.d.ts +20 -0
- package/dist/messagescompressor.d.ts +19 -0
- package/dist/messagesmapper.d.ts +12 -0
- package/dist/revision-history/descriptors/revisiondescriptor.d.ts +45 -0
- package/dist/revision-history/messages/revisionhistoryconnectmessage.d.ts +18 -0
- package/dist/revision-history/messages/revisionhistorygetrevisionmessage.d.ts +20 -0
- package/dist/revision-history/messages/revisionhistoryreconnectmessage.d.ts +20 -0
- package/dist/revision-history/messages/revisionhistoryupdaterevisionsmessage.d.ts +44 -0
- package/dist/revision-history/responses/revisionhistoryconnectresponse.d.ts +33 -0
- package/dist/revision-history/responses/revisionhistorygetrevisionresponse.d.ts +33 -0
- package/dist/revision-history/responses/revisionhistoryupdaterevisionsresponse.d.ts +16 -0
- package/dist/revision-history/revision.d.ts +18 -0
- package/dist/revision-history/revisionhistoryservice.d.ts +78 -0
- package/dist/services-content.css +3 -0
- package/dist/services-editor.css +3 -0
- package/dist/services.css +3 -0
- package/dist/services.d.ts +19 -0
- package/dist/services.js +67 -0
- package/dist/services.js.map +1 -0
- package/dist/sessions/descriptors/sessiondescriptor.d.ts +8 -0
- package/dist/sessions/messages/sessionsconnectmessage.d.ts +20 -0
- package/dist/sessions/messages/socketconnectmessage.d.ts +24 -0
- package/dist/sessions/messages/socketdisconnectmessage.d.ts +18 -0
- package/dist/sessions/responses/sessionsconnectresponse.d.ts +24 -0
- package/dist/sessions/sessioncollection.d.ts +43 -0
- package/dist/sessions/sessions.d.ts +16 -0
- package/dist/track-changes/descriptors/suggestiondescriptor.d.ts +28 -0
- package/dist/track-changes/messages/addsuggestionmessage.d.ts +28 -0
- package/dist/track-changes/messages/batchUpdateSuggestionsStateMessage.d.ts +22 -0
- package/dist/track-changes/messages/connectmessage.d.ts +18 -0
- package/dist/track-changes/messages/getallsuggestionsmessage.d.ts +18 -0
- package/dist/track-changes/messages/getsuggestionmessage.d.ts +20 -0
- package/dist/track-changes/messages/updatesuggestionmessage.d.ts +28 -0
- package/dist/track-changes/responses/addsuggestionresponse.d.ts +30 -0
- package/dist/track-changes/responses/connectresponse.d.ts +22 -0
- package/dist/track-changes/responses/getallsuggestionsresponse.d.ts +20 -0
- package/dist/track-changes/responses/getsuggestionresponse.d.ts +30 -0
- package/dist/track-changes/trackchangesservice.d.ts +65 -0
- package/dist/types.d.ts +10 -0
- package/dist/users/descriptors/userdescriptor.d.ts +8 -0
- package/dist/users/messages/getmanyusersmessage.d.ts +18 -0
- package/dist/users/messages/getusermessage.d.ts +18 -0
- package/dist/users/responses/getmanyusersresponse.d.ts +16 -0
- package/dist/users/responses/getuserresponse.d.ts +16 -0
- package/dist/users/user.d.ts +44 -0
- package/dist/version.d.ts +5 -0
- package/dist/websocketgateway/channel.d.ts +34 -0
- package/dist/websocketgateway/messages/channelmessage.d.ts +25 -0
- package/dist/websocketgateway/parser/packetparser.d.ts +19 -0
- package/dist/websocketgateway/parser/packets/bytesbytespacketdatamessage.d.ts +22 -0
- package/dist/websocketgateway/parser/packets/numberbytespacketdatamessage.d.ts +22 -0
- package/dist/websocketgateway/parser/packets/numbernumberpacketdatamessag.d.ts +20 -0
- package/dist/websocketgateway/parser/packets/numberobjectpacketdatamessage.d.ts +20 -0
- package/dist/websocketgateway/parser/packets/numberstringpacketdatamessag.d.ts +20 -0
- package/dist/websocketgateway/parser/packets/objectbufferpacketdatamessage.d.ts +22 -0
- package/dist/websocketgateway/parser/packets/objectobjectpacketdatamessage.d.ts +20 -0
- package/dist/websocketgateway/parser/packets/packagedatamessage.d.ts +19 -0
- package/dist/websocketgateway/parser/packets/packetmessage.d.ts +35 -0
- package/dist/websocketgateway/parser/packets/packetoptionsmessage.d.ts +21 -0
- package/dist/websocketgateway/parser/packets/stringbytespacketdatamessage.d.ts +22 -0
- package/dist/websocketgateway/parser/packets/stringnumberpacketdatamessage.d.ts +20 -0
- package/dist/websocketgateway/parser/packets/stringobjectpacketdatamessage.d.ts +20 -0
- package/dist/websocketgateway/parser/packets/stringstringpacketdatamessage.d.ts +20 -0
- package/dist/websocketgateway/parser/parser.d.ts +18 -0
- package/dist/websocketgateway/parser/parserutils.d.ts +33 -0
- package/dist/websocketgateway/requestsmanager.d.ts +23 -0
- package/dist/websocketgateway/websocketgateway.d.ts +169 -0
- package/package.json +42 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
import Message, { IMessageConstructor } from './message';
|
|
7
|
+
/**
|
|
8
|
+
* Compresses and decompresses given message to/from the binary format using `Protocol Buffers`.
|
|
9
|
+
*/
|
|
10
|
+
export default class MessagesCompressor {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of a specific class from encoded buffer.
|
|
13
|
+
*/
|
|
14
|
+
static decode<T extends IMessageConstructor>(buffer: Buffer, messageClass: T): unknown | InstanceType<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Compress given message to buffer.
|
|
17
|
+
*/
|
|
18
|
+
static encode(message: Message): Buffer;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Mapper class used to convert messages types to readable names for metrics purposes.
|
|
6
|
+
*/
|
|
7
|
+
export default class MessagesMapper {
|
|
8
|
+
/**
|
|
9
|
+
* Maps message type (number) to string name.
|
|
10
|
+
*/
|
|
11
|
+
static typeToStringName(messageType: number): string | number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Descriptor, { IDescriptorBody } from './../../descriptor';
|
|
5
|
+
import { IRevisionObject } from '../revision';
|
|
6
|
+
interface IBaseRevision {
|
|
7
|
+
/**
|
|
8
|
+
* As diffData property contains large size document data so this property is stringified and parsed only on the frontend side.
|
|
9
|
+
*
|
|
10
|
+
* Explanation:
|
|
11
|
+
* This is some kind of optimization for the backend. Usually, we did that the properties that was passed into some Message constructor,
|
|
12
|
+
* after serialization and deserialization were in the same format. Currently, as the diffData that goes into the message is large
|
|
13
|
+
* object and we do not need to do any logic operations on that property on the backend side after receiving the Message (we will just
|
|
14
|
+
* push them to the database), there is no need to do JSON.parse() when deserializing the message and again JSON.stringify() before
|
|
15
|
+
* pushing them into the database.
|
|
16
|
+
*
|
|
17
|
+
* That is why JSON.parse() and JSON.stringify() was not used in toJson() and fromJSON() methods.
|
|
18
|
+
*/
|
|
19
|
+
diffData?: string;
|
|
20
|
+
revisionId: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
creatorId?: string;
|
|
23
|
+
fromVersion?: number;
|
|
24
|
+
toVersion?: number;
|
|
25
|
+
isEmptyCurrent?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface IRevisionJSON extends IBaseRevision {
|
|
28
|
+
createdAt?: string;
|
|
29
|
+
attributes?: string;
|
|
30
|
+
authorsIds?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IRevision extends IBaseRevision {
|
|
33
|
+
createdAt?: Date;
|
|
34
|
+
attributes?: Record<string, unknown>;
|
|
35
|
+
authorsIds?: string[];
|
|
36
|
+
}
|
|
37
|
+
export default class RevisionDescriptor extends Descriptor {
|
|
38
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
39
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
40
|
+
static create(object: IRevisionObject): IRevision;
|
|
41
|
+
static toJSON(revision: IRevision): IRevisionJSON;
|
|
42
|
+
static fromJSON(json: IRevisionJSON): IRevision;
|
|
43
|
+
static toObject(revision: IRevision): IRevisionObject;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
export interface IRevisionHistoryConnectMessage extends IMessage {
|
|
7
|
+
documentId: string;
|
|
8
|
+
}
|
|
9
|
+
export default class RevisionHistoryConnectMessage extends Message {
|
|
10
|
+
readonly documentId: string;
|
|
11
|
+
static readonly TYPE: string;
|
|
12
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
13
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
14
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
15
|
+
constructor(documentId: string);
|
|
16
|
+
toJSON(): IRevisionHistoryConnectMessage;
|
|
17
|
+
static fromJSON(object: IRevisionHistoryConnectMessage): RevisionHistoryConnectMessage;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
export interface IRevisionHistoryGetRevisionMessage extends IMessage {
|
|
7
|
+
documentId: string;
|
|
8
|
+
revisionId: string;
|
|
9
|
+
}
|
|
10
|
+
export default class RevisionHistoryGetRevisionMessage extends Message {
|
|
11
|
+
readonly documentId: string;
|
|
12
|
+
readonly revisionId: string;
|
|
13
|
+
static readonly TYPE: string;
|
|
14
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
15
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
16
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
17
|
+
constructor(documentId: string, revisionId: string);
|
|
18
|
+
toJSON(): IRevisionHistoryGetRevisionMessage;
|
|
19
|
+
static fromJSON(object: IRevisionHistoryGetRevisionMessage): RevisionHistoryGetRevisionMessage;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
export interface IRevisionHistoryReconnectMessage extends IMessage {
|
|
7
|
+
documentId: string;
|
|
8
|
+
requestId: number;
|
|
9
|
+
}
|
|
10
|
+
export default class RevisionHistoryReconnectMessage extends Message {
|
|
11
|
+
readonly documentId: string;
|
|
12
|
+
readonly requestId: number;
|
|
13
|
+
static readonly TYPE: string;
|
|
14
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
15
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
16
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
17
|
+
constructor(documentId: string, requestId: number);
|
|
18
|
+
toJSON(): IRevisionHistoryReconnectMessage;
|
|
19
|
+
static fromJSON(object: IRevisionHistoryReconnectMessage): RevisionHistoryReconnectMessage;
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
import { IRevisionObject } from '../revision';
|
|
7
|
+
import { IRevisionJSON, IRevision } from '../descriptors/revisiondescriptor';
|
|
8
|
+
export interface IRevisionHistoryUpdateRevisions {
|
|
9
|
+
documentId: string;
|
|
10
|
+
requestId: number;
|
|
11
|
+
revisions: IRevisionObject[];
|
|
12
|
+
}
|
|
13
|
+
export interface IRevisionHistoryUpdateRevisionsMessageJSON extends IMessage {
|
|
14
|
+
documentId: string;
|
|
15
|
+
requestId: number;
|
|
16
|
+
revisions: IRevisionJSON[];
|
|
17
|
+
}
|
|
18
|
+
export default class RevisionHistoryUpdateRevisionsMessage extends Message {
|
|
19
|
+
readonly documentId: string;
|
|
20
|
+
readonly requestId: number;
|
|
21
|
+
readonly revisions: IRevision[];
|
|
22
|
+
static readonly TYPE: string;
|
|
23
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
24
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
25
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
26
|
+
constructor(documentId: string, requestId: number, revisions: IRevision[]);
|
|
27
|
+
toJSON(): IRevisionHistoryUpdateRevisionsMessageJSON;
|
|
28
|
+
/**
|
|
29
|
+
* Creates frontend revision history model array from message sent from the backend.
|
|
30
|
+
*
|
|
31
|
+
* This method is intended to be used on the frontend side after receiving the broadcast message from the backend.
|
|
32
|
+
*/
|
|
33
|
+
toObject(): IRevisionHistoryUpdateRevisions;
|
|
34
|
+
/**
|
|
35
|
+
* Creates RevisionHistoryUpdateRevisionsMessage from frontend revision model array.
|
|
36
|
+
*
|
|
37
|
+
* This method is intended to be used on the frontend to create RevisionHistoryUpdateRevisionsMessage.
|
|
38
|
+
*
|
|
39
|
+
* This is optimization to prevent recreating the same revision models on the backend side
|
|
40
|
+
* as we just save these data in the database without need to parse them.
|
|
41
|
+
*/
|
|
42
|
+
static create(params: IRevisionHistoryUpdateRevisions): RevisionHistoryUpdateRevisionsMessage;
|
|
43
|
+
static fromJSON(json: IRevisionHistoryUpdateRevisionsMessageJSON): RevisionHistoryUpdateRevisionsMessage;
|
|
44
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
import { IRevision, IRevisionJSON } from '../descriptors/revisiondescriptor';
|
|
7
|
+
import { IRevisionObject } from '../revision';
|
|
8
|
+
export interface IRevisionHistoryConnectResponseJSON extends IMessage {
|
|
9
|
+
channel: string;
|
|
10
|
+
requestId: number;
|
|
11
|
+
revisions: IRevisionJSON[];
|
|
12
|
+
}
|
|
13
|
+
export interface IRevisionHistoryConnectResponseObject {
|
|
14
|
+
channel: string;
|
|
15
|
+
requestId: number;
|
|
16
|
+
revisions: IRevisionObject[];
|
|
17
|
+
}
|
|
18
|
+
export default class RevisionHistoryConnectResponse extends Message {
|
|
19
|
+
readonly channel: string;
|
|
20
|
+
readonly requestId: number;
|
|
21
|
+
readonly revisions: IRevision[];
|
|
22
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
23
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
24
|
+
constructor(channel: string, requestId: number, revisions: IRevision[]);
|
|
25
|
+
toJSON(): IRevisionHistoryConnectResponseJSON;
|
|
26
|
+
/**
|
|
27
|
+
* Creates frontend revision history model from message sent from the backend.
|
|
28
|
+
*
|
|
29
|
+
* This method is intended to be used on the frontend side after receiving the response from the backend.
|
|
30
|
+
*/
|
|
31
|
+
toObject(): IRevisionHistoryConnectResponseObject;
|
|
32
|
+
static fromJSON(json: IRevisionHistoryConnectResponseJSON): RevisionHistoryConnectResponse;
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
import { IRevisionObject } from '../revision';
|
|
7
|
+
import { IRevisionJSON, IRevision } from '../descriptors/revisiondescriptor';
|
|
8
|
+
export interface IRevisionHistoryGetRevisionResponseJSON extends IRevisionJSON, IMessage {
|
|
9
|
+
}
|
|
10
|
+
export default class RevisionHistoryGetRevisionResponse extends Message implements IRevision {
|
|
11
|
+
readonly revisionId: string;
|
|
12
|
+
readonly name?: string | undefined;
|
|
13
|
+
readonly creatorId?: string | undefined;
|
|
14
|
+
readonly authorsIds?: string[] | undefined;
|
|
15
|
+
readonly createdAt?: Date | undefined;
|
|
16
|
+
readonly diffData?: string | undefined;
|
|
17
|
+
readonly attributes?: Record<string, unknown> | undefined;
|
|
18
|
+
readonly fromVersion?: number | undefined;
|
|
19
|
+
readonly toVersion?: number | undefined;
|
|
20
|
+
readonly isEmptyCurrent?: boolean | undefined;
|
|
21
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
22
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
23
|
+
constructor(revisionId: string, name?: string | undefined, creatorId?: string | undefined, authorsIds?: string[] | undefined, createdAt?: Date | undefined, diffData?: string | undefined, attributes?: Record<string, unknown> | undefined, fromVersion?: number | undefined, toVersion?: number | undefined, isEmptyCurrent?: boolean | undefined);
|
|
24
|
+
toJSON(): IRevisionHistoryGetRevisionResponseJSON;
|
|
25
|
+
/**
|
|
26
|
+
* Creates frontend revision model from message sent from the backend.
|
|
27
|
+
*
|
|
28
|
+
* This method is intended to be used on the frontend side after receiving the response from the backend.
|
|
29
|
+
*/
|
|
30
|
+
toObject(): IRevisionObject;
|
|
31
|
+
static create(params: IRevision): RevisionHistoryGetRevisionResponse;
|
|
32
|
+
static fromJSON(json: IRevisionHistoryGetRevisionResponseJSON): RevisionHistoryGetRevisionResponse;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message, { IMessage } from './../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
export interface IRevisionHistoryUpdateRevisionsResponse extends IMessage {
|
|
7
|
+
requestId: number;
|
|
8
|
+
}
|
|
9
|
+
export default class RevisionHistoryUpdateRevisionsResponse extends Message {
|
|
10
|
+
readonly requestId: number;
|
|
11
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
12
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
13
|
+
constructor(requestId: number);
|
|
14
|
+
toJSON(): IRevisionHistoryUpdateRevisionsResponse;
|
|
15
|
+
static fromJSON(json: IRevisionHistoryUpdateRevisionsResponse): RevisionHistoryUpdateRevisionsResponse;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Revision History model used on the frontend side.
|
|
6
|
+
*/
|
|
7
|
+
export interface IRevisionObject {
|
|
8
|
+
id: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
creatorId?: string;
|
|
11
|
+
authorsIds?: string[];
|
|
12
|
+
fromVersion?: number;
|
|
13
|
+
toVersion?: number;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
isEmptyCurrent?: boolean;
|
|
16
|
+
diffData?: Record<string, unknown>;
|
|
17
|
+
attributes?: Record<string, unknown>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { IWebSocketGateway } from '../websocketgateway/websocketgateway';
|
|
5
|
+
import { IRevisionObject } from './revision';
|
|
6
|
+
export declare const _SERVICE: number;
|
|
7
|
+
interface IRevisionHistoryConnectResponse {
|
|
8
|
+
revisions: IRevisionObject[];
|
|
9
|
+
requestId: number;
|
|
10
|
+
}
|
|
11
|
+
declare const RevisionHistoryService_base: {
|
|
12
|
+
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
13
|
+
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
14
|
+
};
|
|
15
|
+
declare class RevisionHistoryService extends /* #__PURE__ -- @preserve */ RevisionHistoryService_base {
|
|
16
|
+
private readonly _documentId;
|
|
17
|
+
private _isConnected;
|
|
18
|
+
private _wsGateway?;
|
|
19
|
+
private _channel?;
|
|
20
|
+
private static readonly _SERVICE;
|
|
21
|
+
constructor(_documentId: string);
|
|
22
|
+
get isConnected(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Connects RevisionHistoryService to CKEditor Cloud Services.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link CKEditorCloudServicesError} error
|
|
27
|
+
* Thrown in the case of errors on the backend side.
|
|
28
|
+
*/
|
|
29
|
+
connect(wsGateway: IWebSocketGateway): Promise<IRevisionHistoryConnectResponse | void>;
|
|
30
|
+
/**
|
|
31
|
+
* Disconnects RevisionHistoryService from CKEditor Cloud Services.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link CKEditorCloudServicesError}
|
|
34
|
+
* Thrown in the case of errors on the backend side.
|
|
35
|
+
*/
|
|
36
|
+
disconnect(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Reconnects RevisionHistoryService to CKEditor Cloud Services.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link CKEditorCloudServicesError}
|
|
41
|
+
* Thrown when connection already exists or in the case of errors on the backend side.
|
|
42
|
+
*/
|
|
43
|
+
reconnect(wsGateway: IWebSocketGateway, lastRequestId: number): Promise<IRevisionHistoryConnectResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Updates revisions.
|
|
46
|
+
*
|
|
47
|
+
* @throws {@link CKEditorCloudServicesError}
|
|
48
|
+
* Thrown in the case of errors on the backend side.
|
|
49
|
+
*/
|
|
50
|
+
updateRevisions(revisions: IRevisionObject[], lastRequestId: number): Promise<number>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns revision with given id.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link CKEditorCloudServicesError}
|
|
55
|
+
* Thrown in the case of errors on the backend side.
|
|
56
|
+
*/
|
|
57
|
+
getRevision(revisionId: string): Promise<IRevisionObject>;
|
|
58
|
+
/**
|
|
59
|
+
* Connects or reconnects to WebSocketGateway and starts listening on channel.
|
|
60
|
+
*/
|
|
61
|
+
private _connect;
|
|
62
|
+
/**
|
|
63
|
+
* Starts to listen on a given channel.
|
|
64
|
+
*/
|
|
65
|
+
private _connectToChannel;
|
|
66
|
+
/**
|
|
67
|
+
* Processes websocket gateway state changes.
|
|
68
|
+
*/
|
|
69
|
+
private _onWsGatewayStateChange;
|
|
70
|
+
/**
|
|
71
|
+
* Sends request to RevisionHistory service.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link ServiceNotConnectedError}
|
|
74
|
+
* Thrown in the case of missing service connection.
|
|
75
|
+
*/
|
|
76
|
+
private _sendRequest;
|
|
77
|
+
}
|
|
78
|
+
export default RevisionHistoryService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
export { default as User } from './users/user';
|
|
5
|
+
export { default as WebSocketGateway, WEB_SOCKET_GATEWAY_STATES, type WebSocketGatewayState, type IWebSocketGatewayStates } from './websocketgateway/websocketgateway';
|
|
6
|
+
export { default as EditorService } from './editor/editorservice';
|
|
7
|
+
export { default as RevisionHistoryService } from './revision-history/revisionhistoryservice';
|
|
8
|
+
export { default as TrackChangesService } from './track-changes/trackchangesservice';
|
|
9
|
+
export { default as CollaborativeEditingService } from './collaborativeeditingservice/collaborativeeditingservice';
|
|
10
|
+
export { default as CommentsService } from './comments-v2/commentsservice';
|
|
11
|
+
export { default as CKEditorCloudServicesError } from './ckeditorcloudserviceserror';
|
|
12
|
+
export type { IPublicError } from './ckeditorcloudservicesservererror';
|
|
13
|
+
export type { IComment } from './comments-v2/descriptors/commentdescriptor';
|
|
14
|
+
export type { ISuggestion } from './track-changes/descriptors/suggestiondescriptor';
|
|
15
|
+
export type { IRevisionObject } from './revision-history/revision';
|
|
16
|
+
export type { default as SessionCollection, ISocket } from './sessions/sessioncollection';
|
|
17
|
+
export type { default as CollaborativeEditingConnectResponse } from './collaborativeeditingservice/responses/collaborativeeditingconnectresponse';
|
|
18
|
+
export type { default as CollaborativeEditingResponse } from './collaborativeeditingservice/responses/collaborativeeditingresponse';
|
|
19
|
+
export type { IOperationMetadata } from './collaborativeeditingservice/descriptors/operationmetadatadescriptor';
|