@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
package/LICENSE.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Software License Agreement
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
**CKEditor Cloud Services Collaboration low-level API**<br>
|
|
5
|
+
Copyright (c) 2003–2022, [CKSource Holding sp. z o.o.](http://cksource.com) All rights reserved.
|
|
6
|
+
|
|
7
|
+
CKEditor Cloud Services Collaboration low-level API is licensed under a commercial license and protected by copyright law.
|
|
8
|
+
For more details about available licensing options please contact us at sales@cksource.com.
|
|
9
|
+
|
|
10
|
+
Sources of Intellectual Property Included in CKEditor Cloud Services Collaboration low-level API
|
|
11
|
+
-----------------------------------------------------
|
|
12
|
+
|
|
13
|
+
Where not otherwise indicated, all CKEditor Cloud Services Collaboration low-level API content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
|
|
14
|
+
|
|
15
|
+
The following libraries are included in CKEditor Cloud Services Collaboration low-level API under the [MIT license](https://opensource.org/licenses/MIT):
|
|
16
|
+
|
|
17
|
+
* Lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
|
|
18
|
+
* socket.io-client - Copyright (c) 2014 Guillermo Rauch <guillermo@learnboost.com>.
|
|
19
|
+
* socket.io-parser - Copyright (c) 2014 Guillermo Rauch <guillermo@learnboost.com>.
|
|
20
|
+
* uuid - Copyright (c) 2010–2020 Robert Kieffer and other contributors.
|
|
21
|
+
* url-parse - Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors.
|
|
22
|
+
|
|
23
|
+
The following libraries are included in CKEditor Cloud Services Collaboration low-level API under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause):
|
|
24
|
+
|
|
25
|
+
* protobuf.js - Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
|
26
|
+
|
|
27
|
+
Trademarks
|
|
28
|
+
----------
|
|
29
|
+
|
|
30
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](http://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# CKEditor Cloud Services Collaboration low-level API
|
|
2
|
+
CKEditor Cloud Services Collaboration low-level API is required by [CKEditor 5 Collaboration features](https://ckeditor.com/collaboration/) to enable real-time collaborative editing within the CKEditor 5.
|
|
3
|
+
|
|
4
|
+
For more info go to [CKEditor 5 collaboration documentation](https://ckeditor.com/docs/ckeditor5/latest/features/collaboration/real-time-collaboration/real-time-collaboration.html) website.
|
|
5
|
+
|
|
6
|
+
## Getting support
|
|
7
|
+
CKEditor 5 collaboration features come with outstanding support from a dedicated team of customer care specialists, QA engineers and CKEditor 5 developers. The team will gladly assist you in all aspects from setting up your account to integrating CKEditor 5 collaboration features with your application.
|
|
8
|
+
|
|
9
|
+
As a licensed CKEditor 5 collaboration features user you can report bugs and request features directly through the CKEditor Ecosystem customer dashboard.
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
|
|
13
|
+
**CKEditor Cloud Services Collaboration low-level API**<br>
|
|
14
|
+
Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](http://cksource.com) All rights reserved.
|
|
15
|
+
|
|
16
|
+
CKEditor Cloud Services Collaboration low-level API is licensed under a commercial license and protected by copyright law.
|
|
17
|
+
For more details about available licensing options please contact us at sales@cksource.com.
|
|
18
|
+
|
|
19
|
+
### Trademarks
|
|
20
|
+
|
|
21
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](http://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { IPublicError } from './ckeditorcloudservicesservererror';
|
|
5
|
+
export default class CKEditorCloudServicesError extends Error {
|
|
6
|
+
readonly context?: unknown;
|
|
7
|
+
readonly code: string | null;
|
|
8
|
+
readonly data: Record<string, unknown>;
|
|
9
|
+
constructor(message: string, context?: unknown, code?: string | null, data?: Record<string, unknown>);
|
|
10
|
+
static fromPublicError(publicError: IPublicError): CKEditorCloudServicesError;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
export interface IPublicError {
|
|
5
|
+
message: string;
|
|
6
|
+
traceId?: string;
|
|
7
|
+
data?: Record<string, unknown>;
|
|
8
|
+
code?: string;
|
|
9
|
+
explanation?: string;
|
|
10
|
+
action?: string;
|
|
11
|
+
}
|
|
12
|
+
export default class CKEditorCloudServicesServerError extends Error {
|
|
13
|
+
readonly code?: string;
|
|
14
|
+
readonly traceId?: string;
|
|
15
|
+
readonly data?: Record<string, unknown>;
|
|
16
|
+
private constructor();
|
|
17
|
+
static fromPublicError(publicError: IPublicError): CKEditorCloudServicesServerError;
|
|
18
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
import CollaborativeEditingConnectMessage from './messages/collaborativeeditingconnectmessage';
|
|
7
|
+
import CollaborativeEditingReconnectMessage from './messages/collaborativeeditingreconnectmessage';
|
|
8
|
+
import CollaborativeEditingResponse from './responses/collaborativeeditingresponse';
|
|
9
|
+
import CollaborativeEditingConnectResponse from './responses/collaborativeeditingconnectresponse';
|
|
10
|
+
import { IWebSocketGateway } from './../websocketgateway/websocketgateway';
|
|
11
|
+
import SessionCollection from '../sessions/sessioncollection';
|
|
12
|
+
import GetDocumentDetailsResponse from './responses/getdocumentdetailsresponse';
|
|
13
|
+
export declare const _SERVICE: number;
|
|
14
|
+
export interface IOperationsData {
|
|
15
|
+
buffers: (Buffer | Uint8Array)[];
|
|
16
|
+
types: number[];
|
|
17
|
+
}
|
|
18
|
+
declare const CollaborativeEditingService_base: {
|
|
19
|
+
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
20
|
+
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* General purpose CollaborativeEditingService used to synchronize data store values with other collaborative nodes.
|
|
24
|
+
*/
|
|
25
|
+
declare class CollaborativeEditingService extends /* #__PURE__ -- @preserve */ CollaborativeEditingService_base {
|
|
26
|
+
static _SERVICE: number;
|
|
27
|
+
private readonly _bundleVersion;
|
|
28
|
+
private readonly _id;
|
|
29
|
+
private _isConnected;
|
|
30
|
+
private _wsGateway?;
|
|
31
|
+
private _channel?;
|
|
32
|
+
private _connectedSessions?;
|
|
33
|
+
/**
|
|
34
|
+
* Create CollaborativeEditingService instance.
|
|
35
|
+
*
|
|
36
|
+
* const collabWritingService = new CollaborativeEditingService( '0.9.0', 'post-456-text' );
|
|
37
|
+
*
|
|
38
|
+
* @throws {TypeError}
|
|
39
|
+
* Throws when bundleVersion param is not provided.
|
|
40
|
+
*/
|
|
41
|
+
constructor(bundleVersion: string, serviceId?: string);
|
|
42
|
+
getId(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Indicates that CollaborativeEditingService is connected to CKEditor Cloud Services.
|
|
45
|
+
*/
|
|
46
|
+
isConnected(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Connects CollaborativeEditingService to CKEditor Cloud Services.
|
|
49
|
+
*
|
|
50
|
+
* const myDocument = new CollaborativeEditingService( '0.9.0', 'article-1234' );
|
|
51
|
+
*
|
|
52
|
+
* await myDocument.connect( wsGateway );
|
|
53
|
+
*
|
|
54
|
+
* @throws {CKEditorCloudServicesError}
|
|
55
|
+
* Thrown in the case of errors on the backend side.
|
|
56
|
+
*/
|
|
57
|
+
connect(wsGateway: IWebSocketGateway, data?: {
|
|
58
|
+
buffers: Buffer[];
|
|
59
|
+
types: number[];
|
|
60
|
+
}, lastOperationId?: string): Promise<CollaborativeEditingConnectResponse | void>;
|
|
61
|
+
/**
|
|
62
|
+
* Reconnects CollaborativeEditingService to CKEditor Cloud Services.
|
|
63
|
+
*
|
|
64
|
+
* const myDocument = new CollaborativeEditingService( '0.9.0', 'article-1234' );
|
|
65
|
+
*
|
|
66
|
+
* await myDocument.connect( wsGateway );
|
|
67
|
+
*
|
|
68
|
+
* wsGateway.on( 'change:state', ( event, property, value ) => {
|
|
69
|
+
* if( value === 'disconnected' ) {
|
|
70
|
+
* await myDocument.reconnect( wsGateway, 123 );
|
|
71
|
+
* }
|
|
72
|
+
* } );
|
|
73
|
+
*
|
|
74
|
+
* @throws {CKEditorCloudServicesError}
|
|
75
|
+
* Thrown when connection already exists or in the case of errors on the backend side.
|
|
76
|
+
*/
|
|
77
|
+
reconnect(wsGateway: IWebSocketGateway, lastKnowVersion: number): Promise<CollaborativeEditingConnectResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Disconnects CollaborativeEditingService from CKEditor Cloud Services.
|
|
80
|
+
*
|
|
81
|
+
* @throws {CKEditorCloudServicesError}
|
|
82
|
+
* Thrown in the case of errors on the backend side.
|
|
83
|
+
*/
|
|
84
|
+
disconnect(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Gets document details from CKEditor Cloud Services.
|
|
87
|
+
*
|
|
88
|
+
* @throws {CKEditorCloudServicesError}
|
|
89
|
+
* Thrown in the case of errors on the backend side.
|
|
90
|
+
*/
|
|
91
|
+
getDocumentDetails(): Promise<GetDocumentDetailsResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Sends update to connected service. This will propagate update to other connected CollaborativeEditingService.
|
|
94
|
+
* Data update will not be stored on CollaborativeEditingService server instance.
|
|
95
|
+
*
|
|
96
|
+
* @throws {CKEditorCloudServicesError}
|
|
97
|
+
* Throws when baseVersion or data is not provided, data is empty, or in the case of errors on the backend side.
|
|
98
|
+
*
|
|
99
|
+
* @throws {ServiceNotConnectedError}
|
|
100
|
+
* Throws when collaborative editing service is not connected.
|
|
101
|
+
*/
|
|
102
|
+
sendOperations(data: IOperationsData, baseVersion: number | string, lastOperationId: string): Promise<CollaborativeEditingResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* Returns read-only observable collection with EndUsers Sessions for collaborative editing service.
|
|
105
|
+
*
|
|
106
|
+
* @throws {CKEditorCloudServicesError}
|
|
107
|
+
* Thrown in the case of errors on the backend side.
|
|
108
|
+
*/
|
|
109
|
+
getConnectedSessions(): Promise<SessionCollection>;
|
|
110
|
+
/**
|
|
111
|
+
* Returns a Promise that resolves with read-only observable collection with EndUsers Sessions for given id.
|
|
112
|
+
*
|
|
113
|
+
* const sessions = await CollaborativeEditingService.getConnectedSessions( 'my-document-id' );
|
|
114
|
+
*
|
|
115
|
+
* @deprecated Use not static version of getConnectedSessions method.
|
|
116
|
+
*
|
|
117
|
+
* @throws {CKEditorCloudServicesError}
|
|
118
|
+
* Throws in the case of errors on the backend side.
|
|
119
|
+
*/
|
|
120
|
+
static getConnectedSessions(wsGateway: IWebSocketGateway, id: string): Promise<SessionCollection>;
|
|
121
|
+
_connect(wsGateway: IWebSocketGateway, message: CollaborativeEditingConnectMessage | CollaborativeEditingReconnectMessage): Promise<CollaborativeEditingConnectResponse | void>;
|
|
122
|
+
/**
|
|
123
|
+
* Connects given CollaborativeEditingService to channel.
|
|
124
|
+
*/
|
|
125
|
+
protected _connectToChannel(wsGateway: IWebSocketGateway, channelName: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* WebSocketGateway "change:state" events handler.
|
|
128
|
+
*/
|
|
129
|
+
private _onWsGatewayStateChange;
|
|
130
|
+
}
|
|
131
|
+
export default CollaborativeEditingService;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Descriptor, { IDescriptorBody } from './../../descriptor';
|
|
5
|
+
interface IBaseOperationMetadata {
|
|
6
|
+
userId: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IOperationMetadata extends IBaseOperationMetadata {
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
}
|
|
12
|
+
export interface IOperationMetadataJSON extends IBaseOperationMetadata {
|
|
13
|
+
createdAt?: string;
|
|
14
|
+
}
|
|
15
|
+
export default class OperationMetadataDescriptor extends Descriptor {
|
|
16
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
17
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
18
|
+
static toJSON({ createdAt, ...metadata }: IOperationMetadata): IOperationMetadataJSON;
|
|
19
|
+
static fromJSON({ createdAt, ...metadata }: IOperationMetadataJSON): IOperationMetadata;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { IOperationMetadata, IOperationMetadataJSON } from '../descriptors/operationmetadatadescriptor';
|
|
5
|
+
export default class OperationMetadataHelpers {
|
|
6
|
+
/**
|
|
7
|
+
* Prepares metadata data for all operations. Adds metadata to operations with type 0.
|
|
8
|
+
*/
|
|
9
|
+
static prepareMetadataForOperations(types: number[], metadata: IOperationMetadataJSON[]): IOperationMetadataJSON[];
|
|
10
|
+
/**
|
|
11
|
+
* Removes unnecessary metadata for operations with type 0.
|
|
12
|
+
*/
|
|
13
|
+
static removeUnnecessaryMetadata(types: number[], metadata: IOperationMetadata[]): IOperationMetadata[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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, { IMessage } from './../../message';
|
|
7
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
8
|
+
export interface ICollaborativeEditingConnectMessage extends IMessage {
|
|
9
|
+
id: string;
|
|
10
|
+
bundleVersion: string;
|
|
11
|
+
buffers: Buffer[];
|
|
12
|
+
types: number[];
|
|
13
|
+
lastOperationId?: string;
|
|
14
|
+
}
|
|
15
|
+
export default class CollaborativeEditingConnectMessage extends Message {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly buffers: Buffer[];
|
|
18
|
+
readonly types: number[];
|
|
19
|
+
readonly bundleVersion: string;
|
|
20
|
+
readonly lastOperationId: string;
|
|
21
|
+
static readonly TYPE: string;
|
|
22
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
23
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
24
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
25
|
+
constructor(id: string, buffers: Buffer[], types: number[], bundleVersion: string, lastOperationId?: string);
|
|
26
|
+
toJSON(): ICollaborativeEditingConnectMessage;
|
|
27
|
+
static fromJSON(data: ICollaborativeEditingConnectMessage): CollaborativeEditingConnectMessage;
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 ICollaborativeEditingReconnectMessage extends IMessage {
|
|
7
|
+
id: string;
|
|
8
|
+
lastKnowVersion: number;
|
|
9
|
+
bundleVersion: string;
|
|
10
|
+
}
|
|
11
|
+
export default class CollaborativeEditingReconnectMessage extends Message {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly lastKnowVersion: number;
|
|
14
|
+
readonly bundleVersion: string;
|
|
15
|
+
static readonly TYPE: string;
|
|
16
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
17
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
18
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
19
|
+
constructor(id: string, lastKnowVersion: number, bundleVersion: string);
|
|
20
|
+
toJSON(): ICollaborativeEditingReconnectMessage;
|
|
21
|
+
static fromJSON(data: ICollaborativeEditingReconnectMessage): CollaborativeEditingReconnectMessage;
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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, { IMessage } from './../../message';
|
|
7
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
8
|
+
import { IOperationMetadata, IOperationMetadataJSON } from '../descriptors/operationmetadatadescriptor';
|
|
9
|
+
export interface ICollaborativeEditingUpdateMessage extends IMessage {
|
|
10
|
+
id: string;
|
|
11
|
+
buffers: Buffer[] | Uint8Array[];
|
|
12
|
+
types: number[];
|
|
13
|
+
baseVersion: number;
|
|
14
|
+
metadata: IOperationMetadataJSON[];
|
|
15
|
+
lastOperationId?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ICollaborativeEditingUpdateData {
|
|
18
|
+
buffers: Buffer[] | Uint8Array[];
|
|
19
|
+
types: number[];
|
|
20
|
+
baseVersion: number;
|
|
21
|
+
lastOperationId?: string;
|
|
22
|
+
}
|
|
23
|
+
export default class CollaborativeEditingUpdateMessage extends Message {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly buffers: Buffer[] | Uint8Array[];
|
|
26
|
+
readonly types: number[];
|
|
27
|
+
readonly baseVersion: number;
|
|
28
|
+
readonly metadata: IOperationMetadata[];
|
|
29
|
+
readonly lastOperationId: string;
|
|
30
|
+
static readonly TYPE: string;
|
|
31
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
32
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
33
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
34
|
+
constructor(id: string, buffers: Buffer[] | Uint8Array[], types: number[], baseVersion: number, metadata?: IOperationMetadata[], lastOperationId?: string);
|
|
35
|
+
/**
|
|
36
|
+
* Returns compressed data of the operations.
|
|
37
|
+
*/
|
|
38
|
+
get data(): ICollaborativeEditingUpdateData;
|
|
39
|
+
toJSON(): ICollaborativeEditingUpdateMessage;
|
|
40
|
+
static fromJSON(data: ICollaborativeEditingUpdateMessage): CollaborativeEditingUpdateMessage;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Message from '../../message';
|
|
5
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
6
|
+
export interface IGetDocumentDetailsMessage {
|
|
7
|
+
documentId: string;
|
|
8
|
+
}
|
|
9
|
+
export default class GetDocumentDetailsMessage 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
|
+
get data(): IGetDocumentDetailsMessage;
|
|
17
|
+
toJSON(): IGetDocumentDetailsMessage;
|
|
18
|
+
static fromJSON(data: IGetDocumentDetailsMessage): GetDocumentDetailsMessage;
|
|
19
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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, { IMessage } from './../../message';
|
|
7
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
8
|
+
import { IOperationMetadata, IOperationMetadataJSON } from '../descriptors/operationmetadatadescriptor';
|
|
9
|
+
export interface ICollaborativeEditingConnectResponse extends IMessage {
|
|
10
|
+
channel: string;
|
|
11
|
+
offset: number;
|
|
12
|
+
version: number;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
buffers: Buffer[] | Uint8Array[];
|
|
15
|
+
types: number[];
|
|
16
|
+
metadata: IOperationMetadataJSON[];
|
|
17
|
+
initData: string;
|
|
18
|
+
isInitialized: boolean;
|
|
19
|
+
lastOperationId?: string;
|
|
20
|
+
sessionCreatedAt: string | null;
|
|
21
|
+
}
|
|
22
|
+
interface ICollaborativeEditingConnectResponseParams {
|
|
23
|
+
channel: string;
|
|
24
|
+
version: number;
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
buffers?: Buffer[] | Uint8Array[];
|
|
27
|
+
types?: number[];
|
|
28
|
+
offset?: number;
|
|
29
|
+
metadata?: IOperationMetadata[];
|
|
30
|
+
initData?: string | null;
|
|
31
|
+
lastOperationId?: string;
|
|
32
|
+
sessionCreatedAt: Date | null;
|
|
33
|
+
}
|
|
34
|
+
interface ICollaborativeEditingConnectResponseData {
|
|
35
|
+
buffers: Buffer[] | Uint8Array[];
|
|
36
|
+
types: number[];
|
|
37
|
+
baseVersion: number;
|
|
38
|
+
lastOperationId?: string;
|
|
39
|
+
sessionCreatedAt: Date | null;
|
|
40
|
+
}
|
|
41
|
+
export default class CollaborativeEditingConnectResponse extends Message {
|
|
42
|
+
readonly channel: string;
|
|
43
|
+
readonly version: number;
|
|
44
|
+
readonly buffers: Buffer[] | Uint8Array[];
|
|
45
|
+
readonly types: number[];
|
|
46
|
+
readonly offset: number;
|
|
47
|
+
readonly metadata: IOperationMetadata[];
|
|
48
|
+
readonly initData: string | null;
|
|
49
|
+
readonly sessionId: string;
|
|
50
|
+
readonly lastOperationId: string;
|
|
51
|
+
readonly sessionCreatedAt: Date | null;
|
|
52
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
53
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated - Use CollaborativeEditingConnectResponse.create factory method instead.
|
|
56
|
+
*
|
|
57
|
+
* @param channel - Name of channel on which messages will be published.
|
|
58
|
+
* @param version - Version of the document.
|
|
59
|
+
* @param buffers - List of operations compressed to the binary format.
|
|
60
|
+
* @param types - List of compressor identifiers.
|
|
61
|
+
* @param offset - Number of changes in previous editing sessions.
|
|
62
|
+
* @param metadata - Metadata of changes.
|
|
63
|
+
* @param initData - Initialization data of the document.
|
|
64
|
+
*/
|
|
65
|
+
constructor(channel: string, version: number, buffers?: Buffer[] | Uint8Array[], types?: number[], offset?: number, metadata?: IOperationMetadata[], initData?: string | null, sessionId?: string, lastOperationId?: string, sessionCreatedAt?: Date | null);
|
|
66
|
+
get data(): ICollaborativeEditingConnectResponseData;
|
|
67
|
+
get wereChangesApplied(): boolean;
|
|
68
|
+
toJSON(): ICollaborativeEditingConnectResponse;
|
|
69
|
+
static create(params: ICollaborativeEditingConnectResponseParams): CollaborativeEditingConnectResponse;
|
|
70
|
+
static fromJSON(data: ICollaborativeEditingConnectResponse): CollaborativeEditingConnectResponse;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
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, { IMessage } from './../../message';
|
|
7
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
8
|
+
import { IOperationMetadata, IOperationMetadataJSON } from '../descriptors/operationmetadatadescriptor';
|
|
9
|
+
export interface ICollaborativeEditingResponse extends IMessage {
|
|
10
|
+
version: number;
|
|
11
|
+
buffers: Buffer[];
|
|
12
|
+
types: number[];
|
|
13
|
+
metadata: IOperationMetadataJSON[];
|
|
14
|
+
lastOperationId: string;
|
|
15
|
+
lastOperationAcceptedAt: string | null;
|
|
16
|
+
}
|
|
17
|
+
interface ICollaborativeEditingResponseParams {
|
|
18
|
+
version: number;
|
|
19
|
+
buffers?: Buffer[];
|
|
20
|
+
types?: number[];
|
|
21
|
+
metadata?: IOperationMetadata[];
|
|
22
|
+
lastOperationId?: string;
|
|
23
|
+
lastOperationAcceptedAt?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface ICollaborativeEditingResponseData {
|
|
26
|
+
buffers: Buffer[];
|
|
27
|
+
types: number[];
|
|
28
|
+
baseVersion: number;
|
|
29
|
+
lastOperationId: string;
|
|
30
|
+
lastOperationAcceptedAt: Date | null;
|
|
31
|
+
}
|
|
32
|
+
export default class CollaborativeEditingResponse extends Message {
|
|
33
|
+
readonly version: number;
|
|
34
|
+
readonly buffers: Buffer[];
|
|
35
|
+
readonly types: number[];
|
|
36
|
+
readonly metadata: IOperationMetadata[];
|
|
37
|
+
readonly lastOperationId: string;
|
|
38
|
+
readonly lastOperationAcceptedAt: Date | null;
|
|
39
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
40
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated - Use CollaborativeEditingResponse.create factory method instead.
|
|
43
|
+
* @param version - Version of the document.
|
|
44
|
+
* @param buffers - List of operations compressed to the binary format.
|
|
45
|
+
* @param types - List of compressor identifiers.
|
|
46
|
+
* @param metadata - Metadata of changes.
|
|
47
|
+
*/
|
|
48
|
+
constructor(version: number, buffers?: Buffer[], types?: number[], metadata?: IOperationMetadata[], lastOperationId?: string, lastOperationAcceptedAt?: Date | null);
|
|
49
|
+
get data(): ICollaborativeEditingResponseData;
|
|
50
|
+
get wereChangesApplied(): boolean;
|
|
51
|
+
toJSON(): ICollaborativeEditingResponse;
|
|
52
|
+
static fromJSON(data: ICollaborativeEditingResponse): CollaborativeEditingResponse;
|
|
53
|
+
static create(data: ICollaborativeEditingResponseParams): CollaborativeEditingResponse;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { IDescriptorBody } from '../../descriptor';
|
|
5
|
+
import Message, { IMessage } from './../../message';
|
|
6
|
+
export interface IGetDocumentDetailsResponse extends IMessage {
|
|
7
|
+
lastDocumentSessionId?: string;
|
|
8
|
+
lastDocumentSessionOperationId?: string;
|
|
9
|
+
currentDocumentSessionId?: string;
|
|
10
|
+
currentDocumentSessionVersion?: number;
|
|
11
|
+
currentDocumentSessionOperationId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ICurrentDocumentSession {
|
|
14
|
+
lastOperationId?: string;
|
|
15
|
+
version?: number;
|
|
16
|
+
id?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ILastDocumentSession {
|
|
19
|
+
id?: string;
|
|
20
|
+
lastOperationId?: string;
|
|
21
|
+
}
|
|
22
|
+
export default class GetDocumentDetailsResponse extends Message {
|
|
23
|
+
readonly lastDocumentSession?: ILastDocumentSession | undefined;
|
|
24
|
+
readonly currentDocumentSession?: ICurrentDocumentSession | undefined;
|
|
25
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
26
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
27
|
+
constructor(lastDocumentSession?: ILastDocumentSession | undefined, currentDocumentSession?: ICurrentDocumentSession | undefined);
|
|
28
|
+
get data(): IGetDocumentDetailsResponse;
|
|
29
|
+
toJSON(): IGetDocumentDetailsResponse;
|
|
30
|
+
static fromJSON(data: IGetDocumentDetailsResponse): GetDocumentDetailsResponse;
|
|
31
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import AddCommentResponse from './responses/addcommentresponse';
|
|
5
|
+
import { IWebSocketGateway } from './../websocketgateway/websocketgateway';
|
|
6
|
+
import { IThread } from './descriptors/commentsthreaddescriptor';
|
|
7
|
+
import SessionCollection from '../sessions/sessioncollection';
|
|
8
|
+
import { IComment } from './descriptors/commentdescriptor';
|
|
9
|
+
import AddCommentThreadResponse from './responses/comment-threads/addcommentthreadresponse';
|
|
10
|
+
import ResolveCommentThreadResponse from './responses/comment-threads/resolvecommentthreadresponse';
|
|
11
|
+
export declare const _SERVICE: number;
|
|
12
|
+
export interface IAddCommentThreadParams {
|
|
13
|
+
commentThreadId: string;
|
|
14
|
+
context?: Record<string, unknown> | null;
|
|
15
|
+
comments?: IComment[];
|
|
16
|
+
resolvedAt?: Date | string | null;
|
|
17
|
+
createdAt?: Date | string | null;
|
|
18
|
+
resolvedBy?: string | null;
|
|
19
|
+
deletedAt?: Date | null | string;
|
|
20
|
+
attributes?: Record<string, unknown> | null;
|
|
21
|
+
}
|
|
22
|
+
export interface IUpdateCommentThreadParams {
|
|
23
|
+
commentThreadId: string;
|
|
24
|
+
context?: Record<string, unknown> | null;
|
|
25
|
+
attributes?: Record<string, unknown> | null;
|
|
26
|
+
unlinkedAt?: Date | null | string;
|
|
27
|
+
}
|
|
28
|
+
declare const CommentsService_base: {
|
|
29
|
+
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
30
|
+
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
31
|
+
};
|
|
32
|
+
declare class CommentsService extends /* #__PURE__ -- @preserve */ CommentsService_base {
|
|
33
|
+
private readonly _documentId;
|
|
34
|
+
private _isConnected;
|
|
35
|
+
private _wsGateway?;
|
|
36
|
+
private _channel?;
|
|
37
|
+
private _connectedSessions?;
|
|
38
|
+
private static readonly _SERVICE;
|
|
39
|
+
constructor(_documentId: string);
|
|
40
|
+
get isConnected(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Connects to WebSocketGateway and starts listening on channel.
|
|
43
|
+
*/
|
|
44
|
+
connect(wsGateway: IWebSocketGateway): Promise<IThread[] | void>;
|
|
45
|
+
/**
|
|
46
|
+
* Disconnects CommentsService from CKEditor Cloud Services.
|
|
47
|
+
*/
|
|
48
|
+
disconnect(): void;
|
|
49
|
+
addComment(commentThreadId: string, commentId: string, content: string, attributes?: Record<string, unknown>): Promise<AddCommentResponse>;
|
|
50
|
+
updateComment(commentThreadId: string, commentId: string, content: string, attributes?: Record<string, unknown>): Promise<void>;
|
|
51
|
+
removeComment(commentThreadId: string, commentId: string): Promise<void>;
|
|
52
|
+
removeCommentThread(commentThreadId: string): Promise<void>;
|
|
53
|
+
addCommentThread(addCommentThreadParams: IAddCommentThreadParams): Promise<AddCommentThreadResponse>;
|
|
54
|
+
resolveCommentThread(commentThreadId: string): Promise<ResolveCommentThreadResponse>;
|
|
55
|
+
reopenCommentThread(commentThreadId: string): Promise<void>;
|
|
56
|
+
updateCommentThread(params: IUpdateCommentThreadParams): Promise<void>;
|
|
57
|
+
getCommentThread(commentThreadId: string, attempt?: number): Promise<IThread>;
|
|
58
|
+
getDocumentThreads(): Promise<{
|
|
59
|
+
threads: IThread[];
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Returns read-only observable collection with EndUsers Sessions for comments service.
|
|
63
|
+
*/
|
|
64
|
+
getConnectedSessions(): Promise<SessionCollection>;
|
|
65
|
+
/**
|
|
66
|
+
* Starts to listen on a given channel.
|
|
67
|
+
*/
|
|
68
|
+
private _connectToChannel;
|
|
69
|
+
/**
|
|
70
|
+
* Processes websocket gateway state changes.
|
|
71
|
+
*/
|
|
72
|
+
private _onWsGatewayStateChange;
|
|
73
|
+
private _sendRequest;
|
|
74
|
+
}
|
|
75
|
+
export default CommentsService;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Descriptor, { IDescriptorBody } from './../../descriptor';
|
|
5
|
+
interface ICommonComment {
|
|
6
|
+
commentId: string;
|
|
7
|
+
commentThreadId: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
content: string;
|
|
10
|
+
documentId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ICommentJSON extends ICommonComment {
|
|
13
|
+
createdAt: string;
|
|
14
|
+
attributes: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface IComment extends ICommonComment {
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
attributes: Record<string, unknown> | null;
|
|
19
|
+
}
|
|
20
|
+
export default class CommentDescriptor extends Descriptor {
|
|
21
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
22
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
23
|
+
static toJSON(comment: IComment): ICommentJSON;
|
|
24
|
+
static fromJSON(comment: ICommentJSON): IComment;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import Descriptor, { IDescriptorBody } from './../../descriptor';
|
|
5
|
+
import { IComment, ICommentJSON } from './commentdescriptor';
|
|
6
|
+
interface ICommonThread {
|
|
7
|
+
commentThreadId: string;
|
|
8
|
+
resolvedBy?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface IThreadJSON extends ICommonThread {
|
|
11
|
+
comments?: ICommentJSON[];
|
|
12
|
+
attributes?: string | null;
|
|
13
|
+
createdAt?: string;
|
|
14
|
+
deletedAt?: string | null;
|
|
15
|
+
resolvedAt?: string | null;
|
|
16
|
+
context?: string | null;
|
|
17
|
+
unlinkedAt?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface IThread extends ICommonThread {
|
|
20
|
+
comments?: IComment[];
|
|
21
|
+
createdAt?: Date;
|
|
22
|
+
deletedAt?: Date | null;
|
|
23
|
+
resolvedAt?: Date | null;
|
|
24
|
+
attributes?: Record<string, unknown> | null;
|
|
25
|
+
context?: Record<string, unknown> | null;
|
|
26
|
+
unlinkedAt?: Date | null;
|
|
27
|
+
}
|
|
28
|
+
export default class CommentsThreadDescriptor extends Descriptor {
|
|
29
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
30
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
31
|
+
static toJSON(thread: IThread): IThreadJSON;
|
|
32
|
+
static fromJSON(thread: IThreadJSON): IThread;
|
|
33
|
+
}
|
|
34
|
+
export {};
|