forked from goodow/realtime-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol.yaml
63 lines (55 loc) · 1.21 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
# address: realtime.store
--- # Fetch document
action: get
id: docType/docId
accessToken: token
--- &snapshotData # reply
v: 0
snapshot: []
root: {}
--- # 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
...
# address: realtime.store.ops
--- # Get ops
id: docType/docId
from: 10
to: 11 # noninclusively
--- # reply
- *opData
# address: realtime.store:docType/docId
--- # publish channel
<<: *opData
...
# address: realtime.store.presence:docType/docId
--- &collaborator # Presence publish channel
isJoined: false
sessionId: sid
userId: uid
displayName: name
color: #58B442
isMe: true
isAnonymous: false
photoUrl: http://xx
...
--- # address: @realtime.store.event.EventType:docType/docId:objectId Event publish
*Event
--- # address: @realtime.store.event.document_error:docType/docId Document error event publish
*com.goodow.realtime.Error
...