@ckeditor/ckeditor-cloud-services-collaboration 52.1.4 → 52.1.6
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/package.json +1 -1
- package/src/ckeditorcloudserviceserror.d.ts +8 -0
- package/src/ckeditorcloudserviceserror.js +1 -1
- package/src/ckeditorcloudservicesservererror.d.ts +15 -0
- package/src/ckeditorcloudservicesservererror.js +1 -1
- package/src/collaborativeeditingservice/collaborativeeditingservice.d.ts +127 -0
- package/src/collaborativeeditingservice/collaborativeeditingservice.js +1 -1
- package/src/collaborativeeditingservice/descriptors/operationmetadatadescriptor.d.ts +18 -0
- package/src/collaborativeeditingservice/descriptors/operationmetadatadescriptor.js +1 -1
- package/src/collaborativeeditingservice/helpers/operationmetadatahelpers.d.ts +11 -0
- package/src/collaborativeeditingservice/helpers/operationmetadatahelpers.js +1 -1
- package/src/collaborativeeditingservice/messages/collaborativeeditingconnectmessage.d.ts +24 -0
- package/src/collaborativeeditingservice/messages/collaborativeeditingconnectmessage.js +1 -1
- package/src/collaborativeeditingservice/messages/collaborativeeditingreconnectmessage.d.ts +19 -0
- package/src/collaborativeeditingservice/messages/collaborativeeditingreconnectmessage.js +1 -1
- package/src/collaborativeeditingservice/messages/collaborativeeditingupdatemessage.d.ts +38 -0
- package/src/collaborativeeditingservice/messages/collaborativeeditingupdatemessage.js +1 -1
- package/src/collaborativeeditingservice/messages/getdocumentdetailsmessage.d.ts +16 -0
- package/src/collaborativeeditingservice/messages/getdocumentdetailsmessage.js +1 -1
- package/src/collaborativeeditingservice/responses/collaborativeeditingconnectresponse.d.ts +68 -0
- package/src/collaborativeeditingservice/responses/collaborativeeditingconnectresponse.js +1 -1
- package/src/collaborativeeditingservice/responses/collaborativeeditingresponse.d.ts +51 -0
- package/src/collaborativeeditingservice/responses/collaborativeeditingresponse.js +1 -1
- package/src/collaborativeeditingservice/responses/getdocumentdetailsresponse.d.ts +28 -0
- package/src/collaborativeeditingservice/responses/getdocumentdetailsresponse.js +1 -1
- package/src/comments-v2/commentsservice.d.ts +72 -0
- package/src/comments-v2/commentsservice.js +1 -1
- package/src/comments-v2/descriptors/commentdescriptor.d.ts +23 -0
- package/src/comments-v2/descriptors/commentdescriptor.js +1 -1
- package/src/comments-v2/descriptors/commentsthreaddescriptor.d.ts +31 -0
- package/src/comments-v2/descriptors/commentsthreaddescriptor.js +1 -1
- package/src/comments-v2/descriptors/commentthreadaddedcomment.d.ts +15 -0
- package/src/comments-v2/descriptors/commentthreadaddedcomment.js +1 -1
- package/src/comments-v2/messages/addcommentmessage.d.ts +30 -0
- package/src/comments-v2/messages/addcommentmessage.js +1 -1
- package/src/comments-v2/messages/comment-threads/addcommentthreadmessage.d.ts +32 -0
- package/src/comments-v2/messages/comment-threads/addcommentthreadmessage.js +1 -1
- package/src/comments-v2/messages/comment-threads/reopencommentthreadmessage.d.ts +17 -0
- package/src/comments-v2/messages/comment-threads/reopencommentthreadmessage.js +1 -1
- package/src/comments-v2/messages/comment-threads/resolvecommentthreadmessage.d.ts +21 -0
- package/src/comments-v2/messages/comment-threads/resolvecommentthreadmessage.js +1 -1
- package/src/comments-v2/messages/comment-threads/updatecommentthreadmessage.d.ts +23 -0
- package/src/comments-v2/messages/comment-threads/updatecommentthreadmessage.js +1 -1
- package/src/comments-v2/messages/connectmessage.d.ts +15 -0
- package/src/comments-v2/messages/connectmessage.js +1 -1
- package/src/comments-v2/messages/getcommentthreadmessage.d.ts +17 -0
- package/src/comments-v2/messages/getcommentthreadmessage.js +1 -1
- package/src/comments-v2/messages/getdocumentthreadsmessage.d.ts +15 -0
- package/src/comments-v2/messages/getdocumentthreadsmessage.js +1 -1
- package/src/comments-v2/messages/removecommentmessage.d.ts +19 -0
- package/src/comments-v2/messages/removecommentmessage.js +1 -1
- package/src/comments-v2/messages/removecommentthreadmessage.d.ts +17 -0
- package/src/comments-v2/messages/removecommentthreadmessage.js +1 -1
- package/src/comments-v2/messages/updatecommentmessage.d.ts +28 -0
- package/src/comments-v2/messages/updatecommentmessage.js +1 -1
- package/src/comments-v2/responses/addcommentresponse.d.ts +17 -0
- package/src/comments-v2/responses/addcommentresponse.js +1 -1
- package/src/comments-v2/responses/comment-threads/addcommentthreadresponse.d.ts +22 -0
- package/src/comments-v2/responses/comment-threads/addcommentthreadresponse.js +1 -1
- package/src/comments-v2/responses/comment-threads/resolvecommentthreadresponse.d.ts +19 -0
- package/src/comments-v2/responses/comment-threads/resolvecommentthreadresponse.js +1 -1
- package/src/comments-v2/responses/connectresponse.d.ts +19 -0
- package/src/comments-v2/responses/connectresponse.js +1 -1
- package/src/comments-v2/responses/getcommentthreadresponse.d.ts +33 -0
- package/src/comments-v2/responses/getcommentthreadresponse.js +1 -1
- package/src/comments-v2/responses/getdocumentthreadsresponse.d.ts +17 -0
- package/src/comments-v2/responses/getdocumentthreadsresponse.js +1 -1
- package/src/compiledmessages.js +1 -1
- package/src/descriptor.d.ts +13 -0
- package/src/descriptor.js +1 -1
- package/src/descriptors/keyvaluedescriptor.d.ts +5 -0
- package/src/descriptors/keyvaluedescriptor.js +1 -1
- package/src/editor/editorservice.d.ts +11 -0
- package/src/editor/editorservice.js +1 -1
- package/src/editor/messages/iseditorbundleuploadedmessage.d.ts +15 -0
- package/src/editor/messages/iseditorbundleuploadedmessage.js +1 -1
- package/src/editor/responses/iseditorbundleuploadedresponse.d.ts +13 -0
- package/src/editor/responses/iseditorbundleuploadedresponse.js +1 -1
- package/src/errors/ServiceNotConnectedError.d.ts +4 -0
- package/src/errors/ServiceNotConnectedError.js +1 -1
- package/src/index.d.ts +66 -0
- package/src/index.js +1 -1
- package/src/message.d.ts +17 -0
- package/src/message.js +1 -1
- package/src/messagescompressor.d.ts +15 -0
- package/src/messagescompressor.js +1 -1
- package/src/messagesmapper.d.ts +9 -0
- package/src/messagesmapper.js +1 -1
- package/src/revision-history/descriptors/revisiondescriptor.d.ts +42 -0
- package/src/revision-history/descriptors/revisiondescriptor.js +1 -1
- package/src/revision-history/messages/revisionhistoryconnectmessage.d.ts +15 -0
- package/src/revision-history/messages/revisionhistoryconnectmessage.js +1 -1
- package/src/revision-history/messages/revisionhistorygetrevisionmessage.d.ts +17 -0
- package/src/revision-history/messages/revisionhistorygetrevisionmessage.js +1 -1
- package/src/revision-history/messages/revisionhistoryreconnectmessage.d.ts +17 -0
- package/src/revision-history/messages/revisionhistoryreconnectmessage.js +1 -1
- package/src/revision-history/messages/revisionhistoryupdaterevisionsmessage.d.ts +41 -0
- package/src/revision-history/messages/revisionhistoryupdaterevisionsmessage.js +1 -1
- package/src/revision-history/responses/revisionhistoryconnectresponse.d.ts +30 -0
- package/src/revision-history/responses/revisionhistoryconnectresponse.js +1 -1
- package/src/revision-history/responses/revisionhistorygetrevisionresponse.d.ts +30 -0
- package/src/revision-history/responses/revisionhistorygetrevisionresponse.js +1 -1
- package/src/revision-history/responses/revisionhistoryupdaterevisionsresponse.d.ts +13 -0
- package/src/revision-history/responses/revisionhistoryupdaterevisionsresponse.js +1 -1
- package/src/revision-history/revision.d.ts +15 -0
- package/src/revision-history/revisionhistoryservice.d.ts +75 -0
- package/src/revision-history/revisionhistoryservice.js +1 -1
- package/src/services.d.ts +8 -0
- package/src/services.js +1 -1
- package/src/sessions/descriptors/sessiondescriptor.d.ts +5 -0
- package/src/sessions/descriptors/sessiondescriptor.js +1 -1
- package/src/sessions/messages/sessionsconnectmessage.d.ts +17 -0
- package/src/sessions/messages/sessionsconnectmessage.js +1 -1
- package/src/sessions/messages/socketconnectmessage.d.ts +21 -0
- package/src/sessions/messages/socketconnectmessage.js +1 -1
- package/src/sessions/messages/socketdisconnectmessage.d.ts +15 -0
- package/src/sessions/messages/socketdisconnectmessage.js +1 -1
- package/src/sessions/responses/sessionsconnectresponse.d.ts +21 -0
- package/src/sessions/responses/sessionsconnectresponse.js +1 -1
- package/src/sessions/sessioncollection.d.ts +40 -0
- package/src/sessions/sessioncollection.js +1 -1
- package/src/sessions/sessions.d.ts +13 -0
- package/src/sessions/sessions.js +1 -1
- package/src/track-changes/descriptors/suggestiondescriptor.d.ts +25 -0
- package/src/track-changes/descriptors/suggestiondescriptor.js +1 -1
- package/src/track-changes/messages/addsuggestionmessage.d.ts +25 -0
- package/src/track-changes/messages/addsuggestionmessage.js +1 -1
- package/src/track-changes/messages/batchUpdateSuggestionsStateMessage.d.ts +19 -0
- package/src/track-changes/messages/batchUpdateSuggestionsStateMessage.js +1 -1
- package/src/track-changes/messages/connectmessage.d.ts +15 -0
- package/src/track-changes/messages/connectmessage.js +1 -1
- package/src/track-changes/messages/getallsuggestionsmessage.d.ts +15 -0
- package/src/track-changes/messages/getallsuggestionsmessage.js +1 -1
- package/src/track-changes/messages/getsuggestionmessage.d.ts +17 -0
- package/src/track-changes/messages/getsuggestionmessage.js +1 -1
- package/src/track-changes/messages/updatesuggestionmessage.d.ts +25 -0
- package/src/track-changes/messages/updatesuggestionmessage.js +1 -1
- package/src/track-changes/responses/addsuggestionresponse.d.ts +27 -0
- package/src/track-changes/responses/addsuggestionresponse.js +1 -1
- package/src/track-changes/responses/connectresponse.d.ts +19 -0
- package/src/track-changes/responses/connectresponse.js +1 -1
- package/src/track-changes/responses/getallsuggestionsresponse.d.ts +17 -0
- package/src/track-changes/responses/getallsuggestionsresponse.js +1 -1
- package/src/track-changes/responses/getsuggestionresponse.d.ts +27 -0
- package/src/track-changes/responses/getsuggestionresponse.js +1 -1
- package/src/track-changes/trackchangesservice.d.ts +62 -0
- package/src/track-changes/trackchangesservice.js +1 -1
- package/src/types.d.ts +7 -0
- package/src/users/descriptors/userdescriptor.d.ts +5 -0
- package/src/users/descriptors/userdescriptor.js +1 -1
- package/src/users/messages/getmanyusersmessage.d.ts +15 -0
- package/src/users/messages/getmanyusersmessage.js +1 -1
- package/src/users/messages/getusermessage.d.ts +15 -0
- package/src/users/messages/getusermessage.js +1 -1
- package/src/users/responses/getmanyusersresponse.d.ts +13 -0
- package/src/users/responses/getmanyusersresponse.js +1 -1
- package/src/users/responses/getuserresponse.d.ts +13 -0
- package/src/users/responses/getuserresponse.js +1 -1
- package/src/users/user.d.ts +41 -0
- package/src/users/user.js +1 -1
- package/src/version.d.ts +2 -0
- package/src/version.js +1 -1
- package/src/websocketgateway/channel.d.ts +31 -0
- package/src/websocketgateway/channel.js +1 -1
- package/src/websocketgateway/messages/channelmessage.d.ts +21 -0
- package/src/websocketgateway/messages/channelmessage.js +1 -1
- package/src/websocketgateway/parser/packetparser.d.ts +15 -0
- package/src/websocketgateway/parser/packetparser.js +1 -1
- package/src/websocketgateway/parser/packets/bytesbytespacketdatamessage.d.ts +18 -0
- package/src/websocketgateway/parser/packets/bytesbytespacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/numberbytespacketdatamessage.d.ts +18 -0
- package/src/websocketgateway/parser/packets/numberbytespacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/numbernumberpacketdatamessag.d.ts +17 -0
- package/src/websocketgateway/parser/packets/numbernumberpacketdatamessag.js +1 -1
- package/src/websocketgateway/parser/packets/numberobjectpacketdatamessage.d.ts +17 -0
- package/src/websocketgateway/parser/packets/numberobjectpacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/numberstringpacketdatamessag.d.ts +17 -0
- package/src/websocketgateway/parser/packets/numberstringpacketdatamessag.js +1 -1
- package/src/websocketgateway/parser/packets/objectbufferpacketdatamessage.d.ts +18 -0
- package/src/websocketgateway/parser/packets/objectbufferpacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/objectobjectpacketdatamessage.d.ts +17 -0
- package/src/websocketgateway/parser/packets/objectobjectpacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/packagedatamessage.d.ts +16 -0
- package/src/websocketgateway/parser/packets/packagedatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/packetmessage.d.ts +31 -0
- package/src/websocketgateway/parser/packets/packetmessage.js +1 -1
- package/src/websocketgateway/parser/packets/packetoptionsmessage.d.ts +18 -0
- package/src/websocketgateway/parser/packets/packetoptionsmessage.js +1 -1
- package/src/websocketgateway/parser/packets/stringbytespacketdatamessage.d.ts +18 -0
- package/src/websocketgateway/parser/packets/stringbytespacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/stringnumberpacketdatamessage.d.ts +17 -0
- package/src/websocketgateway/parser/packets/stringnumberpacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/stringobjectpacketdatamessage.d.ts +17 -0
- package/src/websocketgateway/parser/packets/stringobjectpacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/packets/stringstringpacketdatamessage.d.ts +17 -0
- package/src/websocketgateway/parser/packets/stringstringpacketdatamessage.js +1 -1
- package/src/websocketgateway/parser/parser.d.ts +14 -0
- package/src/websocketgateway/parser/parser.js +1 -1
- package/src/websocketgateway/parser/parserutils.d.ts +27 -0
- package/src/websocketgateway/parser/parserutils.js +1 -1
- package/src/websocketgateway/requestsmanager.d.ts +20 -0
- package/src/websocketgateway/requestsmanager.js +1 -1
- package/src/websocketgateway/websocketgateway.d.ts +164 -0
- package/src/websocketgateway/websocketgateway.js +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetAllSuggestionsMessage extends IMessage {
|
|
4
|
+
documentId: string;
|
|
5
|
+
}
|
|
6
|
+
export default class GetAllSuggestionsMessage extends Message {
|
|
7
|
+
readonly documentId: string;
|
|
8
|
+
static readonly TYPE: string;
|
|
9
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
10
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
11
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
12
|
+
constructor(documentId: string);
|
|
13
|
+
toJSON(): IGetAllSuggestionsMessage;
|
|
14
|
+
static fromJSON(object: IGetAllSuggestionsMessage): GetAllSuggestionsMessage;
|
|
15
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x55968e from'./../../message.js';export default class GetAllSuggestionsMessage extends _0x55968e{constructor(_0x4b7184){super(),this['documentId']=_0x4b7184;}['toJSON'](){return{'documentId':this['documentId']};}static['fromJSON'](_0x514d51){return new GetAllSuggestionsMessage(_0x514d51['documentId']);}}GetAllSuggestionsMessage['TYPE']='102',GetAllSuggestionsMessage['READABLE_TYPE_NAME']='getAllSuggestions',GetAllSuggestionsMessage['DESCRIPTOR_NAME']='TrackChangesGetAllSuggestionMessage',GetAllSuggestionsMessage['DESCRIPTOR']={'fields':{'documentId':{'type':'string','id':0x1}}};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetSuggestionMessage extends IMessage {
|
|
4
|
+
id: string;
|
|
5
|
+
documentId: string;
|
|
6
|
+
}
|
|
7
|
+
export default class GetSuggestionMessage extends Message {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly documentId: string;
|
|
10
|
+
static readonly TYPE: string;
|
|
11
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
12
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
13
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
14
|
+
constructor(id: string, documentId: string);
|
|
15
|
+
toJSON(): IGetSuggestionMessage;
|
|
16
|
+
static fromJSON(object: IGetSuggestionMessage): GetSuggestionMessage;
|
|
17
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x400a0f from'./../../message.js';export default class GetSuggestionMessage extends _0x400a0f{constructor(_0x53d901,_0x18a7df){super(),this['id']=_0x53d901,this['documentId']=_0x18a7df;}['toJSON'](){return{'id':this['id'],'documentId':this['documentId']};}static['fromJSON'](_0x11c00f){return new GetSuggestionMessage(_0x11c00f['id'],_0x11c00f['documentId']);}}GetSuggestionMessage['TYPE']='103',GetSuggestionMessage['READABLE_TYPE_NAME']='getSuggestion',GetSuggestionMessage['DESCRIPTOR_NAME']='TrackChangesGetSuggestionMessage',GetSuggestionMessage['DESCRIPTOR']={'fields':{'id':{'type':'string','id':0x1},'documentId':{'type':'string','id':0x2}}};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IUpdateSuggestionMessage extends IMessage {
|
|
4
|
+
id: string;
|
|
5
|
+
documentId: string;
|
|
6
|
+
hasComments?: boolean;
|
|
7
|
+
isHasCommentsModified: boolean;
|
|
8
|
+
state?: string;
|
|
9
|
+
attributes: string;
|
|
10
|
+
}
|
|
11
|
+
export default class UpdateSuggestionMessage extends Message {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly documentId: string;
|
|
14
|
+
readonly hasComments: boolean | undefined;
|
|
15
|
+
readonly isHasCommentsModified: boolean;
|
|
16
|
+
readonly state?: string | undefined;
|
|
17
|
+
readonly attributes: Record<string, unknown> | null;
|
|
18
|
+
static readonly TYPE: string;
|
|
19
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
20
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
21
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
22
|
+
constructor(id: string, documentId: string, hasComments: boolean | undefined, isHasCommentsModified: boolean, state?: string | undefined, attributes?: Record<string, unknown> | null);
|
|
23
|
+
toJSON(): IUpdateSuggestionMessage;
|
|
24
|
+
static fromJSON(object: IUpdateSuggestionMessage): UpdateSuggestionMessage;
|
|
25
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x1ff5f2 from'./../../message.js';export default class UpdateSuggestionMessage extends _0x1ff5f2{constructor(_0x4964b9,_0x924e68,_0x4fd641,_0x32362e,_0x54fe18,_0x99f64=null){super(),this['id']=_0x4964b9,this['documentId']=_0x924e68,this['hasComments']=_0x4fd641,this['isHasCommentsModified']=_0x32362e,this['state']=_0x54fe18,this['attributes']=_0x99f64;}['toJSON'](){return{'id':this['id'],'documentId':this['documentId'],'hasComments':this['hasComments'],'isHasCommentsModified':this['isHasCommentsModified'],'state':this['state'],'attributes':JSON['stringify'](this['attributes'])};}static['fromJSON'](_0x3ac657){return new UpdateSuggestionMessage(_0x3ac657['id'],_0x3ac657['documentId'],_0x3ac657['hasComments'],_0x3ac657['isHasCommentsModified'],_0x3ac657['state'],_0x3ac657['attributes']?JSON['parse'](_0x3ac657['attributes']):null);}}UpdateSuggestionMessage['TYPE']='104',UpdateSuggestionMessage['READABLE_TYPE_NAME']='updateSuggestion',UpdateSuggestionMessage['DESCRIPTOR_NAME']='TrackChangesUpdateSuggestionMessage',UpdateSuggestionMessage['DESCRIPTOR']={'fields':{'id':{'type':'string','id':0x1},'documentId':{'type':'string','id':0x2},'hasComments':{'type':'bool','id':0x3},'isHasCommentsModified':{'type':'bool','id':0x4},'state':{'type':'string','id':0x5},'attributes':{'type':'string','id':0x6}}};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IAddSuggestionResponse extends IMessage {
|
|
4
|
+
id: string;
|
|
5
|
+
authorId: string;
|
|
6
|
+
type: string;
|
|
7
|
+
createdAt?: string;
|
|
8
|
+
data: string;
|
|
9
|
+
hasComments?: boolean;
|
|
10
|
+
state?: string;
|
|
11
|
+
attributes: string | null;
|
|
12
|
+
}
|
|
13
|
+
export default class AddSuggestionResponse extends Message {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly authorId: string;
|
|
16
|
+
readonly type: string;
|
|
17
|
+
readonly hasComments?: boolean | undefined;
|
|
18
|
+
readonly state?: string | undefined;
|
|
19
|
+
readonly data: Record<string, unknown> | null;
|
|
20
|
+
readonly attributes: Record<string, unknown> | null;
|
|
21
|
+
readonly createdAt?: Date;
|
|
22
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
23
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
24
|
+
constructor(id: string, authorId: string, type: string, createdAt?: string, hasComments?: boolean | undefined, state?: string | undefined, data?: Record<string, unknown> | null, attributes?: Record<string, unknown> | null);
|
|
25
|
+
toJSON(): IAddSuggestionResponse;
|
|
26
|
+
static fromJSON(data: IAddSuggestionResponse): AddSuggestionResponse;
|
|
27
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x2806dd from'./../../message.js';export default class AddSuggestionResponse extends _0x2806dd{constructor(_0x40e53b,_0x313d71,_0x2b6a43,_0x3011b2,_0x28b1fc,_0x9a8c77,_0x1e96b5={},_0x48d05d=null){super(),this['id']=_0x40e53b,this['authorId']=_0x313d71,this['type']=_0x2b6a43,this['hasComments']=_0x28b1fc,this['state']=_0x9a8c77,this['data']=_0x1e96b5,this['attributes']=_0x48d05d,this['createdAt']=_0x3011b2?new Date(_0x3011b2):void 0x0;}['toJSON'](){var _0x53e3af;return{'id':this['id'],'authorId':this['authorId'],'type':this['type'],'createdAt':null===(_0x53e3af=this['createdAt'])||void 0x0===_0x53e3af?void 0x0:_0x53e3af['toISOString'](),'data':JSON['stringify'](this['data']),'hasComments':this['hasComments'],'state':this['state'],'attributes':JSON['stringify'](this['attributes'])};}static['fromJSON'](_0x5c8514){return new AddSuggestionResponse(_0x5c8514['id'],_0x5c8514['authorId'],_0x5c8514['type'],_0x5c8514['createdAt'],_0x5c8514['hasComments'],_0x5c8514['state'],JSON['parse'](_0x5c8514['data']),_0x5c8514['attributes']?JSON['parse'](_0x5c8514['attributes']):null);}}AddSuggestionResponse['DESCRIPTOR_NAME']='TrackChangesAddSuggestionResponse',AddSuggestionResponse['DESCRIPTOR']={'fields':{'id':{'type':'string','id':0x1},'authorId':{'type':'string','id':0x2},'type':{'type':'string','id':0x3},'createdAt':{'type':'string','id':0x4},'data':{'type':'string','id':0x5},'hasComments':{'type':'bool','id':0x6},'state':{'type':'string','id':0x7},'attributes':{'type':'string','id':0x8}}};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
import { ISuggestion, ISuggestionJSON } from '../descriptors/suggestiondescriptor.js';
|
|
4
|
+
export interface IConnectResponse extends IMessage {
|
|
5
|
+
channel: string;
|
|
6
|
+
suggestions?: string[];
|
|
7
|
+
suggestionsV2?: ISuggestionJSON[];
|
|
8
|
+
}
|
|
9
|
+
export default class ConnectResponse extends Message {
|
|
10
|
+
readonly channel: string;
|
|
11
|
+
private readonly _suggestions?;
|
|
12
|
+
private readonly _suggestionsV2?;
|
|
13
|
+
readonly suggestions: ISuggestion[];
|
|
14
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
15
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
16
|
+
constructor(channel: string, _suggestions?: ISuggestion[] | undefined, _suggestionsV2?: ISuggestion[] | undefined);
|
|
17
|
+
toJSON(): IConnectResponse;
|
|
18
|
+
static fromJSON(object: IConnectResponse): ConnectResponse;
|
|
19
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x1a4849 from'./../../message.js';import _0x283e84 from'../descriptors/suggestiondescriptor.js';export default class ConnectResponse extends _0x1a4849{constructor(_0x26ff4e,_0x16826f,_0x5f1ac6){super(),this['channel']=_0x26ff4e,this['_suggestions']=_0x16826f,this['_suggestionsV2']=_0x5f1ac6,this['suggestions']=(null==_0x5f1ac6?void 0x0:_0x5f1ac6['length'])?_0x5f1ac6:_0x16826f;}['toJSON'](){var _0xec307f,_0x39c699;return{'channel':this['channel'],'suggestions':null===(_0xec307f=this['_suggestions'])||void 0x0===_0xec307f?void 0x0:_0xec307f['map'](_0x30c4af=>JSON['stringify'](_0x30c4af)),'suggestionsV2':null===(_0x39c699=this['_suggestionsV2'])||void 0x0===_0x39c699?void 0x0:_0x39c699['map'](_0x283e84['toJSON'])};}static['fromJSON'](_0x3e83ba){var _0x428b86,_0x1496f0;return new ConnectResponse(_0x3e83ba['channel'],null===(_0x428b86=_0x3e83ba['suggestions'])||void 0x0===_0x428b86?void 0x0:_0x428b86['map'](_0x4ff975=>JSON['parse'](_0x4ff975)),null===(_0x1496f0=_0x3e83ba['suggestionsV2'])||void 0x0===_0x1496f0?void 0x0:_0x1496f0['map'](_0x283e84['fromJSON']));}}ConnectResponse['DESCRIPTOR_NAME']='TrackChangesConnectResponse',ConnectResponse['DESCRIPTOR']={'fields':{'channel':{'type':'string','id':0x1},'suggestions':{'type':'string','rule':'repeated','id':0x2},'suggestionsV2':{'type':'SuggestionDescriptor','rule':'repeated','id':0x3}}};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
import { ISuggestion, ISuggestionJSON } from '../descriptors/suggestiondescriptor.js';
|
|
4
|
+
export interface IGetAllSuggestionResponse extends IMessage {
|
|
5
|
+
suggestions?: string[];
|
|
6
|
+
suggestionsV2?: ISuggestionJSON[];
|
|
7
|
+
}
|
|
8
|
+
export default class GetAllSuggestionResponse extends Message {
|
|
9
|
+
private readonly _suggestions?;
|
|
10
|
+
private readonly _suggestionsV2?;
|
|
11
|
+
readonly suggestions: ISuggestion[];
|
|
12
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
13
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
14
|
+
constructor(_suggestions?: ISuggestion[] | undefined, _suggestionsV2?: ISuggestion[] | undefined);
|
|
15
|
+
toJSON(): IGetAllSuggestionResponse;
|
|
16
|
+
static fromJSON(data: IGetAllSuggestionResponse): GetAllSuggestionResponse;
|
|
17
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x3025b3 from'./../../message.js';import _0x32a961 from'../descriptors/suggestiondescriptor.js';export default class GetAllSuggestionResponse extends _0x3025b3{constructor(_0x151a72,_0x594f16){super(),this['_suggestions']=_0x151a72,this['_suggestionsV2']=_0x594f16,this['suggestions']=(null==_0x594f16?void 0x0:_0x594f16['length'])?_0x594f16:_0x151a72;}['toJSON'](){var _0x442e45,_0x2d22ce;return{'suggestions':null===(_0x442e45=this['_suggestions'])||void 0x0===_0x442e45?void 0x0:_0x442e45['map'](_0x2622da=>JSON['stringify'](_0x2622da)),'suggestionsV2':null===(_0x2d22ce=this['_suggestionsV2'])||void 0x0===_0x2d22ce?void 0x0:_0x2d22ce['map'](_0x32a961['toJSON'])};}static['fromJSON'](_0x2114f3){var _0x493124,_0x5eed09;return new GetAllSuggestionResponse(null===(_0x493124=_0x2114f3['suggestions'])||void 0x0===_0x493124?void 0x0:_0x493124['map'](_suggestionFromString),null===(_0x5eed09=_0x2114f3['suggestionsV2'])||void 0x0===_0x5eed09?void 0x0:_0x5eed09['map'](_0x32a961['fromJSON']));}}function _suggestionFromString(_0x274410){const _0x5eb903=JSON['parse'](_0x274410);return _0x5eb903['createdAt']=_0x5eb903['createdAt']?new Date(_0x5eb903['createdAt']):void 0x0,_0x5eb903;}GetAllSuggestionResponse['DESCRIPTOR_NAME']='TrackChangesGetAllSuggestionsResponse',GetAllSuggestionResponse['DESCRIPTOR']={'fields':{'suggestions':{'type':'string','rule':'repeated','id':0x1},'suggestionsV2':{'type':'SuggestionDescriptor','rule':'repeated','id':0x2}}};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetSuggestionResponse extends IMessage {
|
|
4
|
+
id: string;
|
|
5
|
+
authorId: string;
|
|
6
|
+
type: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
data: string;
|
|
9
|
+
hasComments: boolean;
|
|
10
|
+
state: string;
|
|
11
|
+
attributes: string | null;
|
|
12
|
+
}
|
|
13
|
+
export default class GetSuggestionResponse extends Message {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly authorId: string;
|
|
16
|
+
readonly type: string;
|
|
17
|
+
readonly hasComments: boolean;
|
|
18
|
+
readonly state: string;
|
|
19
|
+
readonly data: Record<string, unknown>;
|
|
20
|
+
readonly attributes: Record<string, unknown> | null;
|
|
21
|
+
readonly createdAt: Date;
|
|
22
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
23
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
24
|
+
constructor(id: string, authorId: string, type: string, createdAt: string, hasComments: boolean, state: string, data?: Record<string, unknown>, attributes?: Record<string, unknown> | null);
|
|
25
|
+
toJSON(): IGetSuggestionResponse;
|
|
26
|
+
static fromJSON(data: IGetSuggestionResponse): GetSuggestionResponse;
|
|
27
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x21d787 from'./../../message.js';export default class GetSuggestionResponse extends _0x21d787{constructor(_0x4ddd34,_0x41436e,_0x39ec16,_0x508384,_0x21a663,_0x5b7b19,_0x240417={},_0x36f147=null){super(),this['id']=_0x4ddd34,this['authorId']=_0x41436e,this['type']=_0x39ec16,this['hasComments']=_0x21a663,this['state']=_0x5b7b19,this['data']=_0x240417,this['attributes']=_0x36f147,this['createdAt']=new Date(_0x508384);}['toJSON'](){return{'id':this['id'],'authorId':this['authorId'],'type':this['type'],'createdAt':this['createdAt']['toISOString'](),'data':JSON['stringify'](this['data']),'hasComments':this['hasComments'],'state':this['state'],'attributes':JSON['stringify'](this['attributes'])};}static['fromJSON'](_0x145dff){return new GetSuggestionResponse(_0x145dff['id'],_0x145dff['authorId'],_0x145dff['type'],_0x145dff['createdAt'],_0x145dff['hasComments'],_0x145dff['state'],JSON['parse'](_0x145dff['data']),_0x145dff['attributes']?JSON['parse'](_0x145dff['attributes']):null);}}GetSuggestionResponse['DESCRIPTOR_NAME']='TrackChangesGetSuggestionResponse',GetSuggestionResponse['DESCRIPTOR']={'fields':{'id':{'type':'string','id':0x1},'authorId':{'type':'string','id':0x2},'type':{'type':'string','id':0x3},'createdAt':{'type':'string','id':0x4},'data':{'type':'string','id':0x5},'hasComments':{'type':'bool','id':0x6},'state':{'type':'string','id':0x7},'attributes':{'type':'string','id':0x8}}};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import AddSuggestionResponse from './responses/addsuggestionresponse.js';
|
|
2
|
+
import GetSuggestionResponse from './responses/getsuggestionresponse.js';
|
|
3
|
+
import { IWebSocketGateway } from '../websocketgateway/websocketgateway.js';
|
|
4
|
+
import { ISuggestion } from './descriptors/suggestiondescriptor.js';
|
|
5
|
+
export declare const _SERVICE: number;
|
|
6
|
+
interface ISuggestionUpdateProps {
|
|
7
|
+
hasComments?: boolean;
|
|
8
|
+
state?: string;
|
|
9
|
+
attributes?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface IBatchUpdateSuggestionsStateParams {
|
|
12
|
+
ids: string[];
|
|
13
|
+
state: string;
|
|
14
|
+
}
|
|
15
|
+
declare const TrackChangesService_base: {
|
|
16
|
+
new (): import("ckeditor5/src/utils.js").Emitter;
|
|
17
|
+
prototype: import("ckeditor5/src/utils.js").Emitter;
|
|
18
|
+
};
|
|
19
|
+
declare class TrackChangesService extends TrackChangesService_base {
|
|
20
|
+
private readonly _documentId;
|
|
21
|
+
private _isConnected;
|
|
22
|
+
private _wsGateway?;
|
|
23
|
+
private _channel?;
|
|
24
|
+
private static readonly _SERVICE;
|
|
25
|
+
constructor(_documentId: string);
|
|
26
|
+
get isConnected(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Connects to WebSocketGateway and starts listening on channel.
|
|
29
|
+
*/
|
|
30
|
+
connect(wsGateway: IWebSocketGateway): Promise<ISuggestion[] | void>;
|
|
31
|
+
/**
|
|
32
|
+
* Disconnects TrackChangesService from CKEditor Cloud Services.
|
|
33
|
+
*/
|
|
34
|
+
disconnect(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Adds suggestion and returns AddSuggestionResponse.
|
|
37
|
+
*/
|
|
38
|
+
add(id: string, type: string, data: Record<string, unknown>, originalSuggestionId?: string | null, attributes?: Record<string, unknown>): Promise<AddSuggestionResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns suggestion with given id.
|
|
41
|
+
*/
|
|
42
|
+
get(id: string, attempt?: number): Promise<GetSuggestionResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Returns suggestions from given documentId.
|
|
45
|
+
*/
|
|
46
|
+
getAll(): Promise<ISuggestion[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Updates suggestion.
|
|
49
|
+
*/
|
|
50
|
+
update(id: string, props?: ISuggestionUpdateProps): Promise<void>;
|
|
51
|
+
batchUpdateState(params: IBatchUpdateSuggestionsStateParams): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Starts to listen on a given channel.
|
|
54
|
+
*/
|
|
55
|
+
private _connectToChannel;
|
|
56
|
+
/**
|
|
57
|
+
* Processes websocket gateway state changes.
|
|
58
|
+
*/
|
|
59
|
+
private _onWsGatewayStateChange;
|
|
60
|
+
private _sendRequest;
|
|
61
|
+
}
|
|
62
|
+
export default TrackChangesService;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{EmitterMixin}from'ckeditor5/src/utils.js';import
|
|
23
|
+
import{EmitterMixin}from'ckeditor5/src/utils.js';import _0x2859a8 from'./../messagescompressor.js';import _0x12382f from'./messages/addsuggestionmessage.js';import _0x50bc03 from'./responses/addsuggestionresponse.js';import _0x1d64e6 from'./messages/getsuggestionmessage.js';import _0x44c63e from'./responses/getsuggestionresponse.js';import _0x42b28b from'./messages/getallsuggestionsmessage.js';import _0x5b150b from'./responses/getallsuggestionsresponse.js';import _0x20db41 from'./messages/updatesuggestionmessage.js';import _0x383d29 from'./messages/connectmessage.js';import _0x135b3b from'./responses/connectresponse.js';import _0x55455e from'../ckeditorcloudserviceserror.js';import _0x9f3653,{WEB_SOCKET_GATEWAY_STATES}from'../websocketgateway/websocketgateway.js';import _0x5a25fc from'../errors/ServiceNotConnectedError.js';import _0x588e9b from'../ckeditorcloudservicesservererror.js';import _0x36a0fc from'./messages/batchUpdateSuggestionsStateMessage.js';export const _SERVICE=0xa;class TrackChangesService extends EmitterMixin(){constructor(_0x369cdd){super(),this['_documentId']=_0x369cdd,this['_isConnected']=!0x1;}get['isConnected'](){return this['_isConnected'];}async['connect'](_0x136c4d){if(this['_isConnected'])return;if(_0x136c4d['state']!==WEB_SOCKET_GATEWAY_STATES['CONNECTED'])throw new _0x55455e('WebSocket\x20Gateway\x20is\x20not\x20connected.',_0x136c4d);const _0x5684a3=new _0x383d29(this['_documentId']);this['_wsGateway']=_0x136c4d,this['stopListening'](_0x136c4d,'change:state');const _0x1f93f3=await _0x136c4d['_sendRequest'](0xa,_0x383d29['TYPE'],_0x2859a8['encode'](_0x5684a3)),_0x1c8dad=_0x2859a8['decode'](_0x1f93f3,_0x135b3b);return this['listenTo'](_0x136c4d,'change:state',(_0x590db8,_0x1393f0,_0x186f7d)=>this['_onWsGatewayStateChange'](_0x186f7d),{'priority':_0x9f3653['_CHANGE_STATE_EVENT_PRIORITY']}),this['_connectToChannel'](_0x136c4d,_0x1c8dad['channel']),this['_isConnected']=!0x0,this['fire']('connected'),_0x1c8dad['suggestions'];}['disconnect'](){this['_isConnected']&&(this['_isConnected']=!0x1,this['_wsGateway']&&(this['stopListening'](this['_wsGateway']),this['_wsGateway']=void 0x0),this['_channel']&&(this['stopListening'](this['_channel']),this['_channel']=void 0x0),this['fire']('disconnected'),this['stopListening']());}async['add'](_0x3ce89f,_0xb4f258,_0x5e9b76,_0x19b240=null,_0x5b70c3){const _0x597087=new _0x12382f(_0x3ce89f,this['_documentId'],_0xb4f258,_0x5e9b76,_0x19b240,_0x5b70c3),_0x2f45d4=await this['_sendRequest'](_0x12382f['TYPE'],_0x597087);return _0x2859a8['decode'](_0x2f45d4,_0x50bc03);}async['get'](_0xffacc1,_0x229d83=0x1){const _0x2f9029=new _0x1d64e6(_0xffacc1,this['_documentId']);try{const _0xd2ab0e=await this['_sendRequest'](_0x1d64e6['TYPE'],_0x2f9029);return _0x2859a8['decode'](_0xd2ab0e,_0x44c63e);}catch(_0x53846d){if('CKEditorCloudServicesServerError'===_0x53846d['name']&&'404'===_0x53846d['code']&&_0x229d83<0x5)return await(_0x30b557=0x64*_0x229d83,new Promise(_0x51a091=>{setTimeout(_0x51a091,_0x30b557);})),this['get'](_0xffacc1,_0x229d83+0x1);if('CKEditorCloudServicesServerError'===_0x53846d['name'])throw _0x53846d;throw _0x588e9b['fromPublicError'](_0x53846d);}var _0x30b557;}async['getAll'](){const _0xba7ed9=new _0x42b28b(this['_documentId']),_0x33dd05=await this['_sendRequest'](_0x42b28b['TYPE'],_0xba7ed9),{suggestions:_0x3d9352}=_0x2859a8['decode'](_0x33dd05,_0x5b150b);return _0x3d9352;}async['update'](_0x137d07,_0x352ecc={}){const {hasComments:_0x3fce65,state:_0x5e6fca,attributes:_0x28bbd2}=_0x352ecc,_0x1be30a=void 0x0!==_0x3fce65,_0x44a3a5=new _0x20db41(_0x137d07,this['_documentId'],_0x3fce65,_0x1be30a,_0x5e6fca,_0x28bbd2);await this['_sendRequest'](_0x20db41['TYPE'],_0x44a3a5);}async['batchUpdateState'](_0x212cae){const _0x52540d=new _0x36a0fc(_0x212cae['ids'],this['_documentId'],_0x212cae['state']);await this['_sendRequest'](_0x36a0fc['TYPE'],_0x52540d);}['_connectToChannel'](_0x57833a,_0x45de54){this['_channel']=_0x57833a['_getChannel'](TrackChangesService['_SERVICE'],_0x45de54),this['_channel']&&this['listenTo'](this['_channel'],this['_channel']['getEventName'](_0x20db41['TYPE']),(_0x4170eb,_0x2f79ce)=>{const _0x4e5d23=_0x2859a8['decode'](_0x2f79ce,_0x20db41);this['fire']('suggestionUpdated',_0x4e5d23);});}['_onWsGatewayStateChange'](_0x4cb2ce){_0x4cb2ce===WEB_SOCKET_GATEWAY_STATES['DISCONNECTED']&&this['disconnect']();}['_sendRequest'](_0x1e3608,_0x17a440){if(!this['_wsGateway']||!this['_isConnected'])throw new _0x5a25fc('Track\x20Changes',this);return this['_wsGateway']['_sendRequest'](0xa,_0x1e3608,_0x2859a8['encode'](_0x17a440));}}TrackChangesService['_SERVICE']=0xa;export default TrackChangesService;
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type TokenChangeValueEventCallback = (event: Record<string, unknown>, name: string, value: ArrayBuffer) => void | Promise<void>;
|
|
2
|
+
export interface IToken {
|
|
3
|
+
value: string | ArrayBuffer;
|
|
4
|
+
refreshToken(): Promise<void> | void;
|
|
5
|
+
on(event: string, handler: TokenChangeValueEventCallback): void;
|
|
6
|
+
off(event: string, handler: TokenChangeValueEventCallback): void;
|
|
7
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x4ce4d3 from'./../../descriptor.js';export default class UserDescriptor extends _0x4ce4d3{}UserDescriptor['DESCRIPTOR_NAME']='UserDescriptor',UserDescriptor['DESCRIPTOR']={'fields':{'attributes':{'rule':'repeated','type':'KeyValueDescriptor','id':0x1}}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetManyUsersMessage extends IMessage {
|
|
4
|
+
ids: string[];
|
|
5
|
+
}
|
|
6
|
+
export default class GetManyUsersMessage extends Message {
|
|
7
|
+
readonly ids: string[];
|
|
8
|
+
static readonly TYPE: string;
|
|
9
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
10
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
11
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
12
|
+
constructor(ids: string[]);
|
|
13
|
+
toJSON(): IGetManyUsersMessage;
|
|
14
|
+
static fromJSON(data: IGetManyUsersMessage): GetManyUsersMessage;
|
|
15
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0xb5c637 from'./../../message.js';export default class GetManyUsersMessage extends _0xb5c637{constructor(_0x27a31f){super(),this['ids']=_0x27a31f;}['toJSON'](){return{'ids':this['ids']};}static['fromJSON'](_0x18b334){return new GetManyUsersMessage(_0x18b334['ids']);}}GetManyUsersMessage['TYPE']='22',GetManyUsersMessage['READABLE_TYPE_NAME']='getManyUsers',GetManyUsersMessage['DESCRIPTOR_NAME']='GetManyUsersMessage',GetManyUsersMessage['DESCRIPTOR']={'fields':{'ids':{'id':0x1,'type':'string','rule':'repeated'}}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetUserMessage extends IMessage {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export default class GetUserMessage extends Message {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
static readonly TYPE: string;
|
|
9
|
+
static readonly READABLE_TYPE_NAME: string;
|
|
10
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
11
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
12
|
+
constructor(id: string);
|
|
13
|
+
toJSON(): IGetUserMessage;
|
|
14
|
+
static fromJSON(data: IGetUserMessage): GetUserMessage;
|
|
15
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x45ad58 from'./../../message.js';export default class GetUserMessage extends _0x45ad58{constructor(_0x502c14){super(),this['id']=_0x502c14;}['toJSON'](){return{'id':this['id']};}static['fromJSON'](_0x335eb0){return new GetUserMessage(_0x335eb0['id']);}}GetUserMessage['TYPE']='21',GetUserMessage['READABLE_TYPE_NAME']='getUser',GetUserMessage['DESCRIPTOR_NAME']='GetUserMessage',GetUserMessage['DESCRIPTOR']={'fields':{'id':{'type':'string','id':0x1}}};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetManyUsersResponse extends IMessage {
|
|
4
|
+
users: Record<string, unknown>[];
|
|
5
|
+
}
|
|
6
|
+
export default class GetManyUsersResponse extends Message {
|
|
7
|
+
readonly users: Record<string, unknown>[];
|
|
8
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
9
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
10
|
+
constructor(users: Record<string, unknown>[]);
|
|
11
|
+
toJSON(): IGetManyUsersResponse;
|
|
12
|
+
static fromJSON(data: IGetManyUsersResponse): GetManyUsersResponse;
|
|
13
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x2c698d from'./../../message.js';export default class GetManyUsersResponse extends _0x2c698d{constructor(_0x5b55ba){super(),this['users']=_0x5b55ba;}['toJSON'](){return{'users':this['users']['map'](_userToJson)};}static['fromJSON'](_0x9f7998){return new GetManyUsersResponse(_0x9f7998['users']['map'](_userFromJson));}}function _userToJson(_0x4ff016){return{'attributes':Object['keys'](_0x4ff016)['map'](_0x36d467=>({'key':_0x36d467,'value':JSON['stringify'](_0x4ff016[_0x36d467])}))};}function _userFromJson(_0x46890d){return _0x46890d['attributes']['reduce']((_0x225af1,_0x44ddbe)=>(_0x225af1[_0x44ddbe['key']]=_0x44ddbe['value']?JSON['parse'](_0x44ddbe['value']):null,_0x225af1),{});}GetManyUsersResponse['DESCRIPTOR_NAME']='GetManyUsersResponse',GetManyUsersResponse['DESCRIPTOR']={'fields':{'users':{'rule':'repeated','type':'UserDescriptor','id':0x1}}};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Message, { IMessage } from './../../message.js';
|
|
2
|
+
import { IDescriptorBody } from '../../descriptor.js';
|
|
3
|
+
export interface IGetUserResponse extends IMessage {
|
|
4
|
+
attributes: Record<string, string>[];
|
|
5
|
+
}
|
|
6
|
+
export default class GetUserResponse extends Message {
|
|
7
|
+
readonly attributes: Record<string, unknown>;
|
|
8
|
+
static readonly DESCRIPTOR_NAME: string;
|
|
9
|
+
static readonly DESCRIPTOR: IDescriptorBody;
|
|
10
|
+
constructor(attributes: Record<string, unknown>);
|
|
11
|
+
toJSON(): IGetUserResponse;
|
|
12
|
+
static fromJSON(data: IGetUserResponse): GetUserResponse;
|
|
13
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0x51690b from'./../../message.js';export default class GetUserResponse extends _0x51690b{constructor(_0x2c3d38){super(),this['attributes']=_0x2c3d38;}['toJSON'](){return{'attributes':Object['keys'](this['attributes'])['map'](_0x3baf5b=>({'key':_0x3baf5b,'value':JSON['stringify'](this['attributes'][_0x3baf5b])}))};}static['fromJSON'](_0xdabbfe){const _0x2444a1=_0xdabbfe['attributes']['reduce']((_0x20ee49,_0x45e6a3)=>(_0x20ee49[_0x45e6a3['key']]=_0x45e6a3['value']?JSON['parse'](_0x45e6a3['value']):null,_0x20ee49),{});return new GetUserResponse(_0x2444a1);}}GetUserResponse['DESCRIPTOR_NAME']='GetUserResponse',GetUserResponse['DESCRIPTOR']={'fields':{'attributes':{'rule':'repeated','type':'KeyValueDescriptor','id':0x1}}};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IWebSocketGateway } from '../websocketgateway/websocketgateway.js';
|
|
2
|
+
interface IUserData extends Record<string, unknown> {
|
|
3
|
+
id?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Represents User entity.
|
|
7
|
+
*/
|
|
8
|
+
declare class User {
|
|
9
|
+
static readonly _SERVICE: number;
|
|
10
|
+
readonly id?: string;
|
|
11
|
+
private readonly _attributes;
|
|
12
|
+
/**
|
|
13
|
+
* Creates User object. Passed attributes will be set on instance as a read-only attributes.
|
|
14
|
+
* Passing undefined or empty object will create "Anonymous" object.
|
|
15
|
+
*/
|
|
16
|
+
constructor(attributes?: IUserData);
|
|
17
|
+
/**
|
|
18
|
+
* Creates User from data object, ie. from token data.
|
|
19
|
+
*
|
|
20
|
+
* const user = User.fromData( { id: '1234', name: 'Bob' } );
|
|
21
|
+
*
|
|
22
|
+
* // Anonymous user will have no attributes.
|
|
23
|
+
* const anonymous = User.fromData();
|
|
24
|
+
*/
|
|
25
|
+
static fromData(data: IUserData): User;
|
|
26
|
+
/**
|
|
27
|
+
* Returns existing User from server or create a User object.
|
|
28
|
+
*
|
|
29
|
+
* const user = await User.get( wsGateway, '1234' );
|
|
30
|
+
*/
|
|
31
|
+
static get(wsGateway: IWebSocketGateway, id: string): Promise<User>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns existing Users from server or create a User objects.
|
|
34
|
+
*
|
|
35
|
+
* const users = await User.getMany( wsGateway, ['1234', '5678'] );
|
|
36
|
+
*/
|
|
37
|
+
static getMany(wsGateway: IWebSocketGateway, ids: string[]): Promise<User[]>;
|
|
38
|
+
}
|
|
39
|
+
declare interface User extends Record<string, unknown> {
|
|
40
|
+
}
|
|
41
|
+
export default User;
|
package/src/users/user.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import _0xafece4 from'./messages/getusermessage.js';import _0x177a73 from'./responses/getuserresponse.js';import _0x1fc8e6 from'./../messagescompressor.js';import _0x253e65 from'./messages/getmanyusersmessage.js';import _0x5d7ec7 from'./responses/getmanyusersresponse.js';class User{constructor(_0x42d2e2={}){this['_attributes']=new Map();for(const _0x22cd6a of Object['keys'](_0x42d2e2))'id'!==_0x22cd6a?(this['_attributes']['set'](_0x22cd6a,_0x42d2e2[_0x22cd6a]),Object['defineProperty'](this,_0x22cd6a,{'enumerable':!0x0,'configurable':!0x1,'get':()=>this['_attributes']['get'](_0x22cd6a)})):this['id']=_0x42d2e2['id'];}static['fromData'](_0x3631fb){return new User(_0x3631fb);}static async['get'](_0xec48f,_0x45e654){const _0x52a826=new _0xafece4(_0x45e654);try{const _0x5f3421=await _0xec48f['_sendRequest'](User['_SERVICE'],_0xafece4['TYPE'],_0x1fc8e6['encode'](_0x52a826)),_0x45dcaa=_0x1fc8e6['decode'](_0x5f3421,_0x177a73);return new User(_0x45dcaa['attributes']);}catch(_0x15e9b8){return new User({'id':_0x45e654});}}static async['getMany'](_0x591101,_0x5d4b18){const _0x535f68=new _0x253e65(_0x5d4b18);try{const _0x272acb=await _0x591101['_sendRequest'](User['_SERVICE'],_0x253e65['TYPE'],_0x1fc8e6['encode'](_0x535f68));return _0x1fc8e6['decode'](_0x272acb,_0x5d7ec7)['users']['map'](_0xc919cf=>new User(_0xc919cf));}catch(_0x24232d){return _0x5d4b18['map'](_0x23bc48=>new User({'id':_0x23bc48}));}}}User['_SERVICE']=0x2;export default User;
|
package/src/version.d.ts
ADDED
package/src/version.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Emitter } from 'ckeditor5/src/utils.js';
|
|
2
|
+
import { ISocket, IWebSocketGateway } from './websocketgateway.js';
|
|
3
|
+
declare const Channel_base: {
|
|
4
|
+
new (): Emitter;
|
|
5
|
+
prototype: Emitter;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Abstracts Socket.io channels event generation as general Emitter that will fire events for all service events.
|
|
9
|
+
*
|
|
10
|
+
* Fires two events for each channel message:
|
|
11
|
+
* 1. 'all:event:event-name'
|
|
12
|
+
* 2. 'event:event-name'
|
|
13
|
+
*
|
|
14
|
+
* Event without 'all' prefix is not fired for messages that socketIdated from this WebSocket.sessionId.
|
|
15
|
+
*/
|
|
16
|
+
declare class Channel extends Channel_base implements Emitter {
|
|
17
|
+
private readonly _channelName;
|
|
18
|
+
private readonly _wsGateway;
|
|
19
|
+
private readonly _socket;
|
|
20
|
+
constructor(_channelName: string, _wsGateway: IWebSocketGateway, _socket: ISocket);
|
|
21
|
+
/**
|
|
22
|
+
* Removes handlers from socket.
|
|
23
|
+
*/
|
|
24
|
+
remove(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Returns normalized event name.
|
|
27
|
+
*/
|
|
28
|
+
getEventName(eventName?: string | number, all?: boolean): string;
|
|
29
|
+
private _subscribeToChannel;
|
|
30
|
+
}
|
|
31
|
+
export default Channel;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{EmitterMixin}from'ckeditor5/src/utils.js';import
|
|
23
|
+
import{EmitterMixin}from'ckeditor5/src/utils.js';import _0x3f68f4 from'./../websocketgateway/messages/channelmessage.js';import _0x50182d from'./../messagescompressor.js';class Channel extends EmitterMixin(){constructor(_0x193243,_0x55afc7,_0x52de6b){super(),this['_channelName']=_0x193243,this['_wsGateway']=_0x55afc7,this['_socket']=_0x52de6b,this['_subscribeToChannel']();}['remove'](){this['_socket']['off'](this['_channelName']);}['getEventName'](_0x6dbe1,_0x16584=!0x1){let _0x446323='';return _0x16584&&(_0x446323+='all:'),_0x446323+='event',_0x6dbe1&&(_0x446323+=':'+_0x6dbe1),_0x446323;}['_subscribeToChannel'](){this['_socket']['on'](this['_channelName'],_0x5dec00=>{const _0x57b59b=_0x50182d['decode'](_0x5dec00,_0x3f68f4);this['fire'](this['getEventName'](_0x57b59b['type'],!0x0),_0x57b59b['data'],_0x57b59b['socketId']),_0x57b59b['socketId']!==this['_wsGateway']['socketId']&&this['fire'](this['getEventName'](_0x57b59b['type']),_0x57b59b['data'],_0x57b59b['socketId']);});}}export default Channel;
|