@ckeditor/ckeditor-cloud-services-collaboration 54.3.1 → 55.1.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.
Files changed (26) hide show
  1. package/dist/channelservices.d.ts +0 -20
  2. package/dist/comments-v2/commentsservice.d.ts +1 -12
  3. package/dist/comments-v2/descriptors/connectdetailsdescriptor.d.ts +14 -0
  4. package/dist/comments-v2/messages/connectmessage.d.ts +4 -1
  5. package/dist/comments-v2/responses/connectresponse.d.ts +4 -1
  6. package/dist/index.d.ts +1 -3
  7. package/dist/revision-history/descriptors/connectdetailsdescriptor.d.ts +18 -0
  8. package/dist/revision-history/messages/revisionhistoryconnectmessage.d.ts +4 -1
  9. package/dist/revision-history/responses/revisionhistoryconnectresponse.d.ts +15 -1
  10. package/dist/revision-history/revisionhistoryservice.d.ts +1 -19
  11. package/dist/services.d.ts +0 -1
  12. package/dist/services.js +20 -24
  13. package/dist/track-changes/descriptors/connectdetailsdescriptor.d.ts +14 -0
  14. package/dist/track-changes/messages/connectmessage.d.ts +4 -1
  15. package/dist/track-changes/responses/connectresponse.d.ts +4 -1
  16. package/dist/track-changes/trackchangesservice.d.ts +1 -12
  17. package/dist/users/descriptors/userdescriptor.d.ts +5 -0
  18. package/dist/users/responses/getmanyusersresponse.d.ts +2 -1
  19. package/dist/version.d.ts +1 -1
  20. package/dist/websocketgateway/websocketgateway.d.ts +0 -28
  21. package/package.json +1 -1
  22. package/dist/servicesconnector/servicesconnector.d.ts +0 -34
  23. package/dist/websocketgateway/descriptors/batchrequestpartdescriptor.d.ts +0 -23
  24. package/dist/websocketgateway/descriptors/batchresponsepartdescriptor.d.ts +0 -25
  25. package/dist/websocketgateway/messages/batchrequestmessage.d.ts +0 -20
  26. package/dist/websocketgateway/messages/batchresponsemessage.d.ts +0 -20
@@ -23,23 +23,3 @@ export declare const REVISION_HISTORY_SERVICE_ID: number;
23
23
  * When adding a new channel-based service, add its id here.
24
24
  */
25
25
  export declare const CHANNEL_SERVICES: ReadonlyArray<number>;
26
- /**
27
- * Byte 0 of a request envelope that marks it as a batch of requests instead of a request to a single service.
28
- *
29
- * The gateway's `servicesMap` must never map this id, on SaaS or on-premises: that would turn every batch
30
- * into a request to the mapped service. Gateways that do not support batches fail fast on it with
31
- * `Service not found`, which reaches the client as a generic `500` server error. That `500` is what lets the client
32
- * fall back to single requests.
33
- */
34
- export declare const BATCH_SERVICE_ID: number;
35
- /**
36
- * Byte 1 of a batch request envelope: the type of the batch, as byte 1 of a single request is its method.
37
- *
38
- * Type 1 is the only one: the parts run in parallel and their responses come back in the order of the requests.
39
- */
40
- export declare const BATCH_REQUEST_TYPE: number;
41
- /**
42
- * The highest number of requests a single batch request may carry. The gateway rejects a larger batch, so the client
43
- * sends the requests of a larger batch one by one.
44
- */
45
- export declare const BATCH_MAX_PARTS: number;
@@ -2,7 +2,7 @@
2
2
  Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
3
3
  */
4
4
  import AddCommentResponse from './responses/addcommentresponse';
5
- import { type IServiceRequest, type IWebSocketGateway } from './../websocketgateway/websocketgateway';
5
+ import { type IWebSocketGateway } from './../websocketgateway/websocketgateway';
6
6
  import type { IThread } from './descriptors/commentsthreaddescriptor';
7
7
  import type SessionCollection from '../sessions/sessioncollection';
8
8
  import type { IComment } from './descriptors/commentdescriptor';
@@ -42,17 +42,6 @@ declare class CommentsService extends /* #__PURE__ -- @preserve */ CommentsServi
42
42
  * Connects to WebSocketGateway and starts listening on channel.
43
43
  */
44
44
  connect(wsGateway: IWebSocketGateway): Promise<IThread[] | void>;
45
- /**
46
- * Prepares the service for connecting and returns its connect request, or `undefined` when it is already connected.
47
- *
48
- * @throws {@link CKEditorCloudServicesError}
49
- * Thrown when the WebSocket Gateway is not connected.
50
- */
51
- beforeConnect(wsGateway: IWebSocketGateway): IServiceRequest | undefined;
52
- /**
53
- * Applies the response of the connect request: starts listening on the channel and on the gateway state.
54
- */
55
- afterConnect(wsGateway: IWebSocketGateway, response: Buffer): IThread[];
56
45
  /**
57
46
  * Disconnects CommentsService from CKEditor Cloud Services.
58
47
  */
@@ -0,0 +1,14 @@
1
+ /*
2
+ Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
3
+ */
4
+ import Descriptor, { type IDescriptorBody } from './../../descriptor';
5
+ export interface ICommentsConnectDetails {
6
+ /**
7
+ * Requests the authors of the comments.
8
+ */
9
+ includeUsers?: boolean;
10
+ }
11
+ export default class ConnectDetailsDescriptor extends Descriptor {
12
+ static readonly DESCRIPTOR_NAME: string;
13
+ static readonly DESCRIPTOR: IDescriptorBody;
14
+ }
@@ -3,16 +3,19 @@
3
3
  */
4
4
  import Message, { type IMessage } from './../../message';
5
5
  import type { IDescriptorBody } from '../../descriptor';
6
+ import type { ICommentsConnectDetails } from '../descriptors/connectdetailsdescriptor';
6
7
  export interface IConnectMessage extends IMessage {
7
8
  documentId: string;
9
+ details?: ICommentsConnectDetails;
8
10
  }
9
11
  export default class ConnectMessage extends Message {
10
12
  readonly documentId: string;
13
+ readonly details?: ICommentsConnectDetails | undefined;
11
14
  static readonly TYPE: string;
12
15
  static readonly READABLE_TYPE_NAME: string;
13
16
  static readonly DESCRIPTOR_NAME: string;
14
17
  static readonly DESCRIPTOR: IDescriptorBody;
15
- constructor(documentId: string);
18
+ constructor(documentId: string, details?: ICommentsConnectDetails | undefined);
16
19
  toJSON(): IConnectMessage;
17
20
  static fromJSON(object: IConnectMessage): ConnectMessage;
18
21
  }
@@ -4,19 +4,22 @@
4
4
  import Message, { type IMessage } from './../../message';
5
5
  import type { IDescriptorBody } from '../../descriptor';
6
6
  import { type IThread, type IThreadJSON } from '../descriptors/commentsthreaddescriptor';
7
+ import { type IUserJSON } from '../../users/descriptors/userdescriptor';
7
8
  export interface IConnectResponse extends IMessage {
8
9
  channel: string;
9
10
  threads?: string[];
10
11
  threadsV2?: IThreadJSON[];
12
+ users?: IUserJSON[];
11
13
  }
12
14
  export default class ConnectResponse extends Message {
13
15
  readonly channel: string;
14
16
  private readonly _threads?;
15
17
  private readonly _threadsV2?;
18
+ readonly users?: Record<string, unknown>[] | undefined;
16
19
  readonly threads: IThread[];
17
20
  static readonly DESCRIPTOR_NAME: string;
18
21
  static readonly DESCRIPTOR: IDescriptorBody;
19
- constructor(channel: string, _threads?: IThread[] | undefined, _threadsV2?: IThread[] | undefined);
22
+ constructor(channel: string, _threads?: IThread[] | undefined, _threadsV2?: IThread[] | undefined, users?: Record<string, unknown>[] | undefined);
20
23
  toJSON(): IConnectResponse;
21
24
  static fromJSON(object: IConnectResponse): ConnectResponse;
22
25
  }
package/dist/index.d.ts CHANGED
@@ -41,7 +41,7 @@ export { default as SessionsConnectResponse } from './sessions/responses/session
41
41
  export { default as SocketConnectMessage } from './sessions/messages/socketconnectmessage';
42
42
  export { default as SocketDisconnectMessage } from './sessions/messages/socketdisconnectmessage';
43
43
  export { default as ChannelDisconnectedMessage } from './websocketgateway/messages/channeldisconnectedmessage';
44
- export { CHANNEL_SERVICES, BATCH_SERVICE_ID, BATCH_REQUEST_TYPE, BATCH_MAX_PARTS } from './channelservices';
44
+ export { CHANNEL_SERVICES } from './channelservices';
45
45
  export { default as AddSuggestionMessage } from './track-changes/messages/addsuggestionmessage';
46
46
  export { default as AddSuggestionResponse } from './track-changes/responses/addsuggestionresponse';
47
47
  export { default as GetAllSuggestionsResponse } from './track-changes/responses/getallsuggestionsresponse';
@@ -68,5 +68,3 @@ export * as Parser from './websocketgateway/parser/parser';
68
68
  export { Encoder, Decoder } from './websocketgateway/parser/parser';
69
69
  export { default as PacketParser, type IPacketParserOptions, type Packet } from './websocketgateway/parser/packetparser';
70
70
  export { default as ChannelMessage } from './websocketgateway/messages/channelmessage';
71
- export { default as BatchRequestMessage } from './websocketgateway/messages/batchrequestmessage';
72
- export { default as BatchResponseMessage } from './websocketgateway/messages/batchresponsemessage';
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
3
+ */
4
+ import Descriptor, { type IDescriptorBody } from './../../descriptor';
5
+ export interface IRevisionHistoryConnectDetails {
6
+ /**
7
+ * Requests the users of the `creatorId` and `authorsIds` of all revisions.
8
+ */
9
+ includeUsers?: boolean;
10
+ /**
11
+ * Requests the latest revision with its `diffData`.
12
+ */
13
+ includeLatestRevision?: boolean;
14
+ }
15
+ export default class ConnectDetailsDescriptor extends Descriptor {
16
+ static readonly DESCRIPTOR_NAME: string;
17
+ static readonly DESCRIPTOR: IDescriptorBody;
18
+ }
@@ -3,16 +3,19 @@
3
3
  */
4
4
  import Message, { type IMessage } from './../../message';
5
5
  import type { IDescriptorBody } from '../../descriptor';
6
+ import type { IRevisionHistoryConnectDetails } from '../descriptors/connectdetailsdescriptor';
6
7
  export interface IRevisionHistoryConnectMessage extends IMessage {
7
8
  documentId: string;
9
+ details?: IRevisionHistoryConnectDetails;
8
10
  }
9
11
  export default class RevisionHistoryConnectMessage extends Message {
10
12
  readonly documentId: string;
13
+ readonly details?: IRevisionHistoryConnectDetails | undefined;
11
14
  static readonly TYPE: string;
12
15
  static readonly READABLE_TYPE_NAME: string;
13
16
  static readonly DESCRIPTOR_NAME: string;
14
17
  static readonly DESCRIPTOR: IDescriptorBody;
15
- constructor(documentId: string);
18
+ constructor(documentId: string, details?: IRevisionHistoryConnectDetails | undefined);
16
19
  toJSON(): IRevisionHistoryConnectMessage;
17
20
  static fromJSON(object: IRevisionHistoryConnectMessage): RevisionHistoryConnectMessage;
18
21
  }
@@ -5,23 +5,37 @@ import Message, { type IMessage } from './../../message';
5
5
  import type { IDescriptorBody } from '../../descriptor';
6
6
  import { type IRevision, type IRevisionJSON } from '../descriptors/revisiondescriptor';
7
7
  import type { IRevisionObject } from '../revision';
8
+ import { type IUserJSON } from '../../users/descriptors/userdescriptor';
8
9
  export interface IRevisionHistoryConnectResponseJSON extends IMessage {
9
10
  channel: string;
10
11
  requestId: number;
11
12
  revisions: IRevisionJSON[];
13
+ users?: IUserJSON[];
14
+ latestRevision?: IRevisionJSON;
12
15
  }
13
16
  export interface IRevisionHistoryConnectResponseObject {
14
17
  channel: string;
15
18
  requestId: number;
16
19
  revisions: IRevisionObject[];
20
+ users?: Record<string, unknown>[];
21
+ latestRevision?: IRevisionObject;
17
22
  }
18
23
  export default class RevisionHistoryConnectResponse extends Message {
19
24
  readonly channel: string;
20
25
  readonly requestId: number;
21
26
  readonly revisions: IRevision[];
27
+ readonly users?: Record<string, unknown>[] | undefined;
28
+ /**
29
+ * The last revision of {@link #revisions}, with its `diffData`.
30
+ */
31
+ readonly latestRevision?: IRevision | undefined;
22
32
  static readonly DESCRIPTOR_NAME: string;
23
33
  static readonly DESCRIPTOR: IDescriptorBody;
24
- constructor(channel: string, requestId: number, revisions: IRevision[]);
34
+ constructor(channel: string, requestId: number, revisions: IRevision[], users?: Record<string, unknown>[] | undefined,
35
+ /**
36
+ * The last revision of {@link #revisions}, with its `diffData`.
37
+ */
38
+ latestRevision?: IRevision | undefined);
25
39
  toJSON(): IRevisionHistoryConnectResponseJSON;
26
40
  /**
27
41
  * Creates frontend revision history model from message sent from the backend.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Copyright (c), CKSource Holding sp. z o.o. All rights reserved.
3
3
  */
4
- import { type IServiceRequest, type IWebSocketGateway } from '../websocketgateway/websocketgateway';
4
+ import { type IWebSocketGateway } from '../websocketgateway/websocketgateway';
5
5
  import type { IRevisionObject } from './revision';
6
6
  export declare const _SERVICE: number;
7
7
  interface IRevisionHistoryConnectResponse {
@@ -27,17 +27,6 @@ declare class RevisionHistoryService extends /* #__PURE__ -- @preserve */ Revisi
27
27
  * Thrown in the case of errors on the backend side.
28
28
  */
29
29
  connect(wsGateway: IWebSocketGateway): Promise<IRevisionHistoryConnectResponse | void>;
30
- /**
31
- * Prepares the service for connecting and returns its connect request, or `undefined` when it is already connected.
32
- *
33
- * @throws {@link CKEditorCloudServicesError}
34
- * Thrown when the WebSocket Gateway is not connected.
35
- */
36
- beforeConnect(wsGateway: IWebSocketGateway): IServiceRequest | undefined;
37
- /**
38
- * Applies the response of the connect or reconnect request: starts listening on the channel and on the gateway state.
39
- */
40
- afterConnect(wsGateway: IWebSocketGateway, response: Buffer): IRevisionHistoryConnectResponse;
41
30
  /**
42
31
  * Disconnects RevisionHistoryService from CKEditor Cloud Services.
43
32
  *
@@ -70,13 +59,6 @@ declare class RevisionHistoryService extends /* #__PURE__ -- @preserve */ Revisi
70
59
  * Connects or reconnects to WebSocketGateway and starts listening on channel.
71
60
  */
72
61
  private _connect;
73
- /**
74
- * Prepares the service for connecting or reconnecting and returns the request.
75
- *
76
- * @throws {@link CKEditorCloudServicesError}
77
- * Thrown when the WebSocket Gateway is not connected.
78
- */
79
- private _beforeConnect;
80
62
  /**
81
63
  * Starts to listen on a given channel.
82
64
  */
@@ -9,7 +9,6 @@ export { default as TrackChangesService } from './track-changes/trackchangesserv
9
9
  export { default as CollaborativeEditingService } from './collaborativeeditingservice/collaborativeeditingservice';
10
10
  export { default as CommentsService } from './comments-v2/commentsservice';
11
11
  export { default as CKEditorCloudServicesError } from './ckeditorcloudserviceserror';
12
- export { default as ServicesConnector, type IConnectableService, type ServicesConnectResults } from './servicesconnector/servicesconnector';
13
12
  export type { IPublicError } from './ckeditorcloudservicesservererror';
14
13
  export type { IComment } from './comments-v2/descriptors/commentdescriptor';
15
14
  export type { ISuggestion } from './track-changes/descriptors/suggestiondescriptor';