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