6a777268ef6eb24c19bbb33ca3bc66968156a476
[WebKit-https.git] / Source / WebCore / inspector / protocol / Replay.json
1 {
2     "domain": "Replay",
3     "description": "Controls web replay, and manages recording sessions and segments.",
4     "types": [
5         {
6             "id": "SessionIdentifier", "description": "Unique replay session identifier.",
7             "type": "integer"
8         },
9         {
10             "id": "SegmentIdentifier", "description": "Unique session segment identifier.",
11             "type": "integer"
12         },
13         {
14             "id": "SessionState", "description": "State machine's state for the session.",
15             "type": "string",
16             "enum": ["Capturing", "Inactive", "Replaying"]
17         },
18         {
19             "id": "SegmentState", "description": "State machine's state for the session segment.",
20             "type": "string",
21             "enum": ["Appending", "Unloaded", "Loaded", "Dispatching"]
22         },
23         {
24             "id": "ReplayPosition",
25             "type": "object",
26             "properties": [
27                { "name": "segmentOffset", "type": "integer", "description": "Offset for a segment within the currently-loaded replay session." },
28                { "name": "inputOffset", "type": "integer", "description": "Offset for an event loop input within the specified session segment." }
29             ]
30         },
31         {
32             "id": "ReplayInput",
33             "type": "object",
34             "properties": [
35                 { "name": "type", "type": "string", "description": "Input type." },
36                 { "name": "offset", "type": "integer", "description": "Offset of this input in its respective queue."},
37                 { "name": "timestamp", "type": "number", "optional": true, "description": "The timestamp of this input." },
38                 { "name": "data", "type": "object", "description": "Per-input payload." }
39             ]
40         },
41         {
42             "id": "ReplayInputQueue",
43             "type": "object",
44             "properties": [
45                 { "name": "type", "type": "string", "description": "Queue type" },
46                 { "name": "inputs", "type": "array", "items": { "$ref": "ReplayInput"}, "description": "Inputs belonging to this queue." }
47             ]
48         },
49         {
50             "id": "SessionSegment", "description": "A standalone segment of a replay session that corresponds to a single main frame navigation and execution.",
51             "type": "object",
52             "properties": [
53                 { "name": "id", "$ref": "SegmentIdentifier", "description": "Unique session segment identifier." },
54                 { "name": "timestamp", "type": "number", "description": "Start time of the segment, in milliseconds since the epoch." },
55                 { "name": "queues", "type": "array", "items": { "$ref": "ReplayInputQueue"} }
56             ]
57         },
58         {
59             "id": "ReplaySession", "description": "An ordered collection of replay session segments.",
60             "type": "object",
61             "properties": [
62                 { "name": "id", "$ref": "SessionIdentifier", "description": "Unique replay session identifier." },
63                 { "name": "timestamp", "type": "number", "description": "Creation time of session, in milliseconds since the epoch." },
64                 { "name": "segments", "type": "array", "items": { "$ref": "SegmentIdentifier" }, "description": "An ordered list identifiers for the segments that comprise this replay session." }
65             ]
66         }
67     ],
68     "commands": [
69         {
70             "name": "startCapturing",
71             "description": "Starts capture of a new replay session."
72         },
73         {
74             "name": "stopCapturing",
75             "description": "Stops capture of the currently recording replay session."
76         },
77         {
78             "name": "replayToPosition",
79             "description": "Seek execution to a specific position within the replay session.",
80             "parameters": [
81                 { "name": "position", "$ref": "ReplayPosition" },
82                 { "name": "shouldFastForward", "type": "boolean" }
83             ]
84         },
85         {
86             "name": "replayToCompletion",
87             "description": "Replay all session segments completely.",
88             "parameters": [
89                 { "name": "shouldFastForward", "type": "boolean" }
90             ]
91         },
92         {
93             "name": "pausePlayback",
94             "description": "Pauses playback in the current segment. Can be resumed by using a replay command."
95         },
96         {
97             "name": "cancelPlayback",
98             "description": "Cancels playback of the current segment. Further replaying will start from the beginning of the current segment."
99         },
100         {
101             "name": "switchSession",
102             "description": "Unloads the current replay session and loads the specified session",
103             "parameters": [
104                 { "name": "sessionIdentifier", "$ref": "SessionIdentifier" }
105             ]
106         },
107         {
108             "name": "insertSessionSegment",
109             "description": "Splices the specified session segment into the session at the specified index.",
110             "parameters": [
111                 { "name": "sessionIdentifier", "$ref": "SessionIdentifier" },
112                 { "name": "segmentIdentifier", "$ref": "SegmentIdentifier" },
113                 { "name": "segmentIndex", "type": "integer" }
114             ]
115         },
116         {
117             "name": "removeSessionSegment",
118             "description": "Removes the session segment at the specified position from the session.",
119             "parameters": [
120                 { "name": "sessionIdentifier", "$ref": "SessionIdentifier" },
121                 { "name": "segmentIndex", "type": "integer" }
122             ]
123         },
124         {
125             "name": "currentReplayState",
126             "description": "Returns the identifier, position, session state and segment state of the currently loaded session. This is necessary because the inspector may be closed and reopened in the middle of replay.",
127             "returns": [
128                 { "name": "sessionIdentifier", "$ref": "SessionIdentifier" },
129                 { "name": "segmentIdentifier", "$ref": "SegmentIdentifier", "optional": true, "description": "If no segment is currently loaded, then there is no valid segment identifier." },
130                 { "name": "sessionState", "$ref": "SessionState" },
131                 { "name": "segmentState", "$ref": "SegmentState" },
132                 { "name": "replayPosition", "$ref": "ReplayPosition" }
133             ]
134         },
135         {
136             "name": "getAvailableSessions",
137             "description": "Returns identifiers of all available sessions.",
138             "returns": [
139                 { "name": "ids", "type": "array", "items": { "$ref": "SessionIdentifier" } }
140             ]
141         },
142         {
143             "name": "getSessionData",
144             "description": "Returns an object for the specified session.",
145             "parameters": [
146                 { "name": "sessionIdentifier", "$ref": "SessionIdentifier" }
147             ],
148             "returns": [
149                 { "name": "session", "$ref": "ReplaySession", "optional": true, "description": "The requested serialized replay session." }
150             ]
151         },
152         {
153             "name": "getSegmentData",
154             "description": "Returns an object for the specified session segment.",
155             "parameters": [
156                 { "name": "id", "$ref": "SegmentIdentifier" }
157             ],
158             "returns": [
159                 { "name": "segment", "$ref": "SessionSegment",  "optional": true, "description": "The requested serialized session segment." }
160             ]
161         }
162     ],
163     "events": [
164         {
165             "name": "captureStarted",
166             "description": "Fired when capture has started."
167         },
168         {
169             "name": "captureStopped",
170             "description": "Fired when capture has stopped."
171         },
172         {
173             "name": "playbackHitPosition",
174             "description": "A position was reached during playback of the session.",
175             "parameters": [
176                 { "name": "position", "$ref": "ReplayPosition", "description": "The playback position that was hit." },
177                 { "name": "timestamp", "type": "number", "description": "A timestamp for the event." }
178             ]
179         },
180         {
181             "name": "playbackStarted",
182             "description": "Fired when session playback has started."
183         },
184         {
185             "name": "playbackPaused",
186             "description": "Fired when session playback has paused, but not finished.",
187             "parameters": [
188                 { "name": "position", "$ref": "ReplayPosition", "description": "The playback position immediately prior to where playback is paused." }
189             ]
190         },
191         {
192             "name": "playbackFinished",
193             "description": "Fired when session playback has stopped."
194         },
195         {
196             "name": "inputSuppressionChanged",
197             "description": "Fired when the replay controller starts or stops suppressing user inputs.",
198             "parameters": [
199                 { "name": "willSuppress", "type": "boolean", "description": "Whether user inputs will be suppressed during playback." }
200             ]
201         },
202         {
203             "name": "sessionCreated",
204             "description": "Fired when a new replay session is created",
205             "parameters": [
206                 { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the created session." }
207             ]
208         },
209         {
210             "name": "sessionModified",
211             "description": "Fired when a session's segments have changed.",
212             "parameters": [
213                 { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the session the segment was added to." }
214             ]
215         },
216         {
217             "name": "sessionRemoved",
218             "description": "Fired when a replay session is removed and can no longer be loaded.",
219             "parameters": [
220                 { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the removed session." }
221             ]
222         },
223         {
224             "name": "sessionLoaded",
225             "description": "Fired when a replay session is loaded.",
226             "parameters": [
227                 { "name": "id", "$ref": "SessionIdentifier", "description": "Identifier for the loaded session." }
228             ]
229         },
230         {
231             "name": "segmentCreated",
232             "description": "Fired when a new session segment is created.",
233             "parameters": [
234                 { "name": "id", "$ref": "SegmentIdentifier", "description": "Identifier for the created session segment." }
235             ]
236         },
237         {
238             "name": "segmentRemoved",
239             "description": "Fired when a session segment is removed and can no longer be replayed as part of a session.",
240             "parameters": [
241                 { "name": "id", "$ref": "SegmentIdentifier", "description": "Identifier for the removed session segment." }
242             ]
243         },
244         {
245             "name": "segmentCompleted",
246             "description": "Fired when a session segment is completed and can no longer have inputs added to it.",
247             "parameters": [
248                 { "name": "id", "$ref": "SegmentIdentifier", "description": "Identifier for the completed session segment." }
249             ]
250         },
251         {
252             "name": "segmentLoaded",
253             "description": "Fired when a segment is loaded.",
254             "parameters": [
255                 { "name": "segmentIdentifier", "$ref": "SegmentIdentifier", "description": "Id for the loaded segment." }
256             ]
257         },
258         {
259             "name": "segmentUnloaded",
260             "description": "Fired when a segment is unloaded."
261         }
262     ]
263 }