-
Notifications
You must be signed in to change notification settings - Fork 56
/
protocol.yaml
85 lines (76 loc) · 2.07 KB
/
protocol.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# topic: realtime/store
--- # Fetch document
action: get
id: docType/docId
v: 1 # optional
--- &snapshotData # reply
v: 0
snapshot: []
root: {}
collaborators: [*collaborator]
--- # Fetch version
action: head
id: docType/docId
--- # reply
0
--- # Submit Operations
action: post
id: docType/docId
opData: &opData
v: 1
op: []
sid: sid
seq: 3 # optional, seq and sid uniquely globally identify an operation
uid: userId
--- # reply
v: 2 # the version at which this operation was applied
ops: # operations by which this operation was transformed, if someone else's operation reaches the server before this
- *opData
...
# topic: realtime/store/_ops
--- # Get ops
id: docType/docId
from: 10
to: 11 # noninclusively
--- # reply
- *opData
# topic: realtime/store/docType/docId/_watch
--- # Anyone subscribed to this topic will be notified as document changes
--- # document change notifications
<<: *opData
...
# topic: realtime/store/docType/docId/_presence/_watch
--- # Anyone subscribed to this topic will be notified as clients come and go
--- &collaborator # user presence notifications
isJoined: false
sessionId: sid
userId: ANONYMOUS_uid
displayName: Anonymous Slow loris
color: "#58B442"
isAnonymous: true
photoUrl: https://ssl.gstatic.com/docs/common/profile/slowloris_lg.png
...
# topic: realtime/store/_presence
--- # Get a complete list of online collaborators
id: docType/docId
--- # reply
- *collaborator
...
--- # topic: @realtime/store/docType/docId/document_error Document error event publish
!realtime.store.Error {}
...
--- # topic: @realtime/store/docType/docId/document_save_state_changed
!realtime.store.DocumentSaveStateChangedEvent {}
...
--- # topic: @realtime/store/docType/docId/collaborator_joined
!realtime.store.CollaboratorJoinedEvent {}
...
--- # topic: @realtime/store/docType/docId/collaborator_left
!realtime.store.CollaboratorLeftEvent {}
...
--- # topic: @realtime/store/docType/docId/undo_redo_state_changed
!realtime.store.UndoRedoStateChangedEvent {}
...
--- # topic: @realtime/store/docType/docId/objectId/event_type Event publish
!realtime.store.BaseModelEvent {}
...