1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct PingRequest {}
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PingResponse {
6 #[prost(string, tag = "1")]
7 pub message: ::prost::alloc::string::String,
8 #[prost(string, tag = "2")]
9 pub version: ::prost::alloc::string::String,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct CommandRetryOptions {
13 #[prost(uint32, optional, tag = "1")]
14 pub timeout_ms: ::core::option::Option<u32>,
15 #[prost(uint32, optional, tag = "2")]
16 pub retry_interval_ms: ::core::option::Option<u32>,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct ConnectMobileCommand {
20 #[prost(enumeration = "MobilePlatform", tag = "1")]
21 pub platform: i32,
22 #[prost(string, optional, tag = "2")]
23 pub device: ::core::option::Option<::prost::alloc::string::String>,
24 #[prost(string, optional, tag = "3")]
25 pub adb_endpoint: ::core::option::Option<::prost::alloc::string::String>,
26 #[prost(bool, tag = "4")]
27 pub preserve_app_state: bool,
28 #[prost(message, optional, tag = "5")]
29 pub retry_options: ::core::option::Option<CommandRetryOptions>,
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct MobileConnectedEvent {
33 #[prost(enumeration = "MobilePlatform", tag = "1")]
34 pub platform: i32,
35 #[prost(string, tag = "2")]
36 pub device_name: ::prost::alloc::string::String,
37 #[prost(string, tag = "3")]
38 pub note: ::prost::alloc::string::String,
39 #[prost(string, tag = "4")]
40 pub device_id: ::prost::alloc::string::String,
41 #[prost(enumeration = "DeviceConnectionKind", tag = "5")]
42 pub connection_kind: i32,
43 #[prost(string, tag = "6")]
44 pub backend: ::prost::alloc::string::String,
45 #[prost(string, tag = "7")]
46 pub device_session_id: ::prost::alloc::string::String,
47 #[prost(string, tag = "8")]
48 pub initial_app_session_id: ::prost::alloc::string::String,
49 #[prost(string, optional, tag = "9")]
50 pub package_name: ::core::option::Option<::prost::alloc::string::String>,
51 #[prost(string, optional, tag = "10")]
52 pub activity_name: ::core::option::Option<::prost::alloc::string::String>,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct LaunchAppCommand {
56 #[prost(string, optional, tag = "1")]
57 pub apk_path: ::core::option::Option<::prost::alloc::string::String>,
58 #[prost(string, optional, tag = "2")]
59 pub app_id: ::core::option::Option<::prost::alloc::string::String>,
60 #[prost(string, optional, tag = "3")]
61 pub launch_activity: ::core::option::Option<::prost::alloc::string::String>,
62 #[prost(bool, tag = "4")]
63 pub stop_before_launch: bool,
64 #[prost(message, optional, tag = "5")]
65 pub retry_options: ::core::option::Option<CommandRetryOptions>,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct AppLaunchedEvent {
69 #[prost(string, tag = "1")]
70 pub app_session_id: ::prost::alloc::string::String,
71 #[prost(string, tag = "2")]
72 pub note: ::prost::alloc::string::String,
73 #[prost(string, optional, tag = "3")]
74 pub package_name: ::core::option::Option<::prost::alloc::string::String>,
75 #[prost(string, optional, tag = "4")]
76 pub activity_name: ::core::option::Option<::prost::alloc::string::String>,
77 #[prost(string, optional, tag = "5")]
78 pub webview_context: ::core::option::Option<::prost::alloc::string::String>,
79}
80#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
81#[repr(i32)]
82pub enum MobilePlatform {
83 Unspecified = 0,
84 Android = 1,
85 Ios = 2,
86}
87impl MobilePlatform {
88 pub fn as_str_name(&self) -> &'static str {
93 match self {
94 Self::Unspecified => "MOBILE_PLATFORM_UNSPECIFIED",
95 Self::Android => "MOBILE_PLATFORM_ANDROID",
96 Self::Ios => "MOBILE_PLATFORM_IOS",
97 }
98 }
99 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
101 match value {
102 "MOBILE_PLATFORM_UNSPECIFIED" => Some(Self::Unspecified),
103 "MOBILE_PLATFORM_ANDROID" => Some(Self::Android),
104 "MOBILE_PLATFORM_IOS" => Some(Self::Ios),
105 _ => None,
106 }
107 }
108}
109#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
110#[repr(i32)]
111pub enum DeviceConnectionKind {
112 Unspecified = 0,
113 Usb = 1,
114 Emulator = 2,
115 RemoteAdb = 3,
116}
117impl DeviceConnectionKind {
118 pub fn as_str_name(&self) -> &'static str {
123 match self {
124 Self::Unspecified => "DEVICE_CONNECTION_KIND_UNSPECIFIED",
125 Self::Usb => "DEVICE_CONNECTION_KIND_USB",
126 Self::Emulator => "DEVICE_CONNECTION_KIND_EMULATOR",
127 Self::RemoteAdb => "DEVICE_CONNECTION_KIND_REMOTE_ADB",
128 }
129 }
130 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
132 match value {
133 "DEVICE_CONNECTION_KIND_UNSPECIFIED" => Some(Self::Unspecified),
134 "DEVICE_CONNECTION_KIND_USB" => Some(Self::Usb),
135 "DEVICE_CONNECTION_KIND_EMULATOR" => Some(Self::Emulator),
136 "DEVICE_CONNECTION_KIND_REMOTE_ADB" => Some(Self::RemoteAdb),
137 _ => None,
138 }
139 }
140}
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct LaunchBrowserCommand {
143 #[prost(enumeration = "BrowserKind", tag = "1")]
144 pub browser_kind: i32,
145 #[prost(string, optional, tag = "2")]
146 pub browser_binary: ::core::option::Option<::prost::alloc::string::String>,
147 #[prost(message, optional, tag = "3")]
148 pub retry_options: ::core::option::Option<CommandRetryOptions>,
149}
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct BrowserLaunchedEvent {
152 #[prost(enumeration = "BrowserKind", tag = "1")]
153 pub browser_kind: i32,
154 #[prost(string, tag = "2")]
155 pub browser: ::prost::alloc::string::String,
156 #[prost(string, tag = "3")]
157 pub note: ::prost::alloc::string::String,
158 #[prost(string, tag = "4")]
159 pub user_data_dir: ::prost::alloc::string::String,
160 #[prost(string, tag = "5")]
161 pub initial_page_session_id: ::prost::alloc::string::String,
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct LaunchChromeCommand {
165 #[prost(string, optional, tag = "1")]
166 pub chrome_binary: ::core::option::Option<::prost::alloc::string::String>,
167 #[prost(message, optional, tag = "2")]
168 pub retry_options: ::core::option::Option<CommandRetryOptions>,
169}
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct ChromeLaunchedEvent {
172 #[prost(string, tag = "1")]
173 pub browser: ::prost::alloc::string::String,
174 #[prost(string, tag = "2")]
175 pub note: ::prost::alloc::string::String,
176 #[prost(string, tag = "3")]
177 pub cdp_websocket_url: ::prost::alloc::string::String,
178 #[prost(string, tag = "4")]
179 pub user_data_dir: ::prost::alloc::string::String,
180 #[prost(string, tag = "5")]
181 pub initial_page_session_id: ::prost::alloc::string::String,
182}
183#[derive(Clone, Copy, PartialEq, ::prost::Message)]
184pub struct RegisterNewPageHook {}
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct NewPageHookResult {
187 #[prost(string, tag = "1")]
188 pub context_session_id: ::prost::alloc::string::String,
189 #[prost(string, tag = "2")]
190 pub note: ::prost::alloc::string::String,
191}
192#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
193#[repr(i32)]
194pub enum BrowserKind {
195 Unspecified = 0,
196 Chromium = 1,
197 Firefox = 2,
198}
199impl BrowserKind {
200 pub fn as_str_name(&self) -> &'static str {
205 match self {
206 Self::Unspecified => "BROWSER_KIND_UNSPECIFIED",
207 Self::Chromium => "BROWSER_KIND_CHROMIUM",
208 Self::Firefox => "BROWSER_KIND_FIREFOX",
209 }
210 }
211 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
213 match value {
214 "BROWSER_KIND_UNSPECIFIED" => Some(Self::Unspecified),
215 "BROWSER_KIND_CHROMIUM" => Some(Self::Chromium),
216 "BROWSER_KIND_FIREFOX" => Some(Self::Firefox),
217 _ => None,
218 }
219 }
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct SurfaceSessionCommand {
223 #[prost(oneof = "surface_session_command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
224 pub command: ::core::option::Option<surface_session_command::Command>,
225}
226pub mod surface_session_command {
228 #[derive(Clone, PartialEq, ::prost::Oneof)]
229 pub enum Command {
230 #[prost(message, tag = "1")]
231 LaunchChrome(super::LaunchChromeCommand),
232 #[prost(message, tag = "2")]
233 OpenContext(super::OpenContextCommand),
234 #[prost(message, tag = "3")]
235 Ping(super::SessionPingCommand),
236 #[prost(message, tag = "4")]
237 Close(super::CloseSurfaceSessionCommand),
238 #[prost(message, tag = "5")]
239 LaunchBrowser(super::LaunchBrowserCommand),
240 #[prost(message, tag = "6")]
241 ConnectMobile(super::ConnectMobileCommand),
242 #[prost(message, tag = "7")]
243 LaunchApp(super::LaunchAppCommand),
244 }
245}
246#[derive(Clone, Copy, PartialEq, ::prost::Message)]
247pub struct OpenContextCommand {
248 #[prost(message, optional, tag = "1")]
249 pub retry_options: ::core::option::Option<CommandRetryOptions>,
250}
251#[derive(Clone, PartialEq, ::prost::Message)]
252pub struct SessionPingCommand {
253 #[prost(string, tag = "1")]
254 pub message: ::prost::alloc::string::String,
255}
256#[derive(Clone, Copy, PartialEq, ::prost::Message)]
257pub struct CloseSurfaceSessionCommand {}
258#[derive(Clone, PartialEq, ::prost::Message)]
259pub struct SurfaceSessionEvent {
260 #[prost(string, tag = "1")]
261 pub session_id: ::prost::alloc::string::String,
262 #[prost(oneof = "surface_session_event::Event", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
263 pub event: ::core::option::Option<surface_session_event::Event>,
264}
265pub mod surface_session_event {
267 #[derive(Clone, PartialEq, ::prost::Oneof)]
268 pub enum Event {
269 #[prost(message, tag = "2")]
270 ChromeLaunched(super::ChromeLaunchedEvent),
271 #[prost(message, tag = "3")]
272 ContextOpened(super::ContextOpenedEvent),
273 #[prost(message, tag = "4")]
274 Pong(super::SessionPongEvent),
275 #[prost(message, tag = "5")]
276 Closed(super::SurfaceSessionClosedEvent),
277 #[prost(message, tag = "6")]
278 Error(super::SurfaceSessionErrorEvent),
279 #[prost(message, tag = "7")]
280 BrowserLaunched(super::BrowserLaunchedEvent),
281 #[prost(message, tag = "8")]
282 MobileConnected(super::MobileConnectedEvent),
283 #[prost(message, tag = "9")]
284 AppLaunched(super::AppLaunchedEvent),
285 }
286}
287#[derive(Clone, PartialEq, ::prost::Message)]
288pub struct ContextOpenedEvent {
289 #[prost(string, tag = "1")]
290 pub context_session_id: ::prost::alloc::string::String,
291 #[prost(string, tag = "2")]
292 pub note: ::prost::alloc::string::String,
293}
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct SessionPongEvent {
296 #[prost(string, tag = "1")]
297 pub message: ::prost::alloc::string::String,
298}
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct SurfaceSessionClosedEvent {
301 #[prost(string, tag = "1")]
302 pub reason: ::prost::alloc::string::String,
303}
304#[derive(Clone, PartialEq, ::prost::Message)]
305pub struct SurfaceSessionErrorEvent {
306 #[prost(string, tag = "1")]
307 pub message: ::prost::alloc::string::String,
308}
309#[derive(Clone, PartialEq, ::prost::Message)]
310pub struct ContextSessionCommand {
311 #[prost(string, tag = "1")]
312 pub surface_session_id: ::prost::alloc::string::String,
313 #[prost(string, tag = "2")]
314 pub context_session_id: ::prost::alloc::string::String,
315 #[prost(
316 oneof = "context_session_command::Command",
317 tags = "3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19"
318 )]
319 pub command: ::core::option::Option<context_session_command::Command>,
320}
321pub mod context_session_command {
323 #[derive(Clone, PartialEq, ::prost::Oneof)]
324 pub enum Command {
325 #[prost(message, tag = "3")]
326 Ping(super::ContextSessionPingCommand),
327 #[prost(message, tag = "4")]
328 Close(super::CloseContextSessionCommand),
329 #[prost(message, tag = "5")]
330 Navigate(super::NavigatePageCommand),
331 #[prost(message, tag = "6")]
332 ClickElement(super::ClickElementCommand),
333 #[prost(message, tag = "7")]
334 CountElements(super::CountElementsCommand),
335 #[prost(message, tag = "8")]
336 HighlightElements(super::HighlightElementsCommand),
337 #[prost(message, tag = "9")]
338 FocusElement(super::FocusElementCommand),
339 #[prost(message, tag = "10")]
340 FillElement(super::FillElementCommand),
341 #[prost(message, tag = "11")]
342 HoverElement(super::HoverElementCommand),
343 #[prost(message, tag = "12")]
344 PressKey(super::PressKeyCommand),
345 #[prost(message, tag = "13")]
346 GetTextContent(super::GetTextContentCommand),
347 #[prost(message, tag = "14")]
348 GetInnerText(super::GetInnerTextCommand),
349 #[prost(message, tag = "15")]
350 WaitForSelector(super::WaitForSelectorCommand),
351 #[prost(message, tag = "16")]
352 Screenshot(super::ScreenshotCommand),
353 #[prost(message, tag = "17")]
354 AccessibilitySnapshot(super::AccessibilitySnapshotCommand),
355 #[prost(message, tag = "18")]
356 RegisterHook(super::RegisterHookCommand),
357 #[prost(message, tag = "19")]
358 WaitForHook(super::WaitForHookCommand),
359 }
360}
361#[derive(Clone, PartialEq, ::prost::Message)]
362pub struct ContextSessionPingCommand {
363 #[prost(string, tag = "1")]
364 pub message: ::prost::alloc::string::String,
365}
366#[derive(Clone, Copy, PartialEq, ::prost::Message)]
367pub struct CloseContextSessionCommand {}
368#[derive(Clone, PartialEq, ::prost::Message)]
369pub struct ContextSessionEvent {
370 #[prost(string, tag = "1")]
371 pub context_session_id: ::prost::alloc::string::String,
372 #[prost(
373 oneof = "context_session_event::Event",
374 tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21"
375 )]
376 pub event: ::core::option::Option<context_session_event::Event>,
377}
378pub mod context_session_event {
380 #[derive(Clone, PartialEq, ::prost::Oneof)]
381 pub enum Event {
382 #[prost(message, tag = "2")]
383 Attached(super::ContextSessionAttachedEvent),
384 #[prost(message, tag = "3")]
385 Pong(super::ContextSessionPongEvent),
386 #[prost(message, tag = "4")]
387 Closed(super::ContextSessionClosedEvent),
388 #[prost(message, tag = "5")]
389 Error(super::ContextSessionErrorEvent),
390 #[prost(message, tag = "6")]
391 Navigated(super::PageNavigatedEvent),
392 #[prost(message, tag = "7")]
393 ChromiumBidiInjection(super::ChromiumBidiInjectionEvent),
394 #[prost(message, tag = "8")]
395 ElementClicked(super::ElementClickedEvent),
396 #[prost(message, tag = "9")]
397 ElementCounted(super::ElementCountedEvent),
398 #[prost(message, tag = "10")]
399 ElementsHighlighted(super::ElementsHighlightedEvent),
400 #[prost(message, tag = "11")]
401 ElementFocused(super::ElementFocusedEvent),
402 #[prost(message, tag = "12")]
403 ElementFilled(super::ElementFilledEvent),
404 #[prost(message, tag = "13")]
405 ElementHovered(super::ElementHoveredEvent),
406 #[prost(message, tag = "14")]
407 KeyPressed(super::KeyPressedEvent),
408 #[prost(message, tag = "15")]
409 TextContentResolved(super::TextContentResolvedEvent),
410 #[prost(message, tag = "16")]
411 InnerTextResolved(super::InnerTextResolvedEvent),
412 #[prost(message, tag = "17")]
413 SelectorWaitSatisfied(super::SelectorWaitSatisfiedEvent),
414 #[prost(message, tag = "18")]
415 ScreenshotCaptured(super::ScreenshotCapturedEvent),
416 #[prost(message, tag = "19")]
417 AccessibilitySnapshotCaptured(super::AccessibilitySnapshotCapturedEvent),
418 #[prost(message, tag = "20")]
419 HookRegistered(super::HookRegisteredEvent),
420 #[prost(message, tag = "21")]
421 HookCompleted(super::HookCompletedEvent),
422 }
423}
424#[derive(Clone, PartialEq, ::prost::Message)]
425pub struct ContextSessionAttachedEvent {
426 #[prost(string, tag = "1")]
427 pub note: ::prost::alloc::string::String,
428}
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct ContextSessionPongEvent {
431 #[prost(string, tag = "1")]
432 pub message: ::prost::alloc::string::String,
433}
434#[derive(Clone, PartialEq, ::prost::Message)]
435pub struct ContextSessionClosedEvent {
436 #[prost(string, tag = "1")]
437 pub reason: ::prost::alloc::string::String,
438}
439#[derive(Clone, PartialEq, ::prost::Message)]
440pub struct ContextSessionErrorEvent {
441 #[prost(string, tag = "1")]
442 pub message: ::prost::alloc::string::String,
443}
444#[derive(Clone, Copy, PartialEq, ::prost::Message)]
445pub struct RegisterHookCommand {
446 #[prost(oneof = "register_hook_command::Hook", tags = "1")]
447 pub hook: ::core::option::Option<register_hook_command::Hook>,
448}
449pub mod register_hook_command {
451 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
452 pub enum Hook {
453 #[prost(message, tag = "1")]
454 NewPage(super::RegisterNewPageHook),
455 }
456}
457#[derive(Clone, PartialEq, ::prost::Message)]
458pub struct WaitForHookCommand {
459 #[prost(string, tag = "1")]
460 pub hook_id: ::prost::alloc::string::String,
461 #[prost(message, optional, tag = "2")]
462 pub retry_options: ::core::option::Option<CommandRetryOptions>,
463}
464#[derive(Clone, PartialEq, ::prost::Message)]
465pub struct HookRegisteredEvent {
466 #[prost(string, tag = "1")]
467 pub hook_id: ::prost::alloc::string::String,
468}
469#[derive(Clone, PartialEq, ::prost::Message)]
470pub struct HookCompletedEvent {
471 #[prost(string, tag = "1")]
472 pub hook_id: ::prost::alloc::string::String,
473 #[prost(oneof = "hook_completed_event::Result", tags = "2")]
474 pub result: ::core::option::Option<hook_completed_event::Result>,
475}
476pub mod hook_completed_event {
478 #[derive(Clone, PartialEq, ::prost::Oneof)]
479 pub enum Result {
480 #[prost(message, tag = "2")]
481 NewPage(super::NewPageHookResult),
482 }
483}
484#[derive(Clone, PartialEq, ::prost::Message)]
485pub struct NavigatePageCommand {
486 #[prost(string, tag = "1")]
487 pub url: ::prost::alloc::string::String,
488 #[prost(message, optional, tag = "2")]
489 pub retry_options: ::core::option::Option<CommandRetryOptions>,
490}
491#[derive(Clone, PartialEq, ::prost::Message)]
492pub struct ClickElementCommand {
493 #[prost(string, tag = "1")]
494 pub css_selector: ::prost::alloc::string::String,
495 #[prost(message, optional, tag = "2")]
496 pub retry_options: ::core::option::Option<CommandRetryOptions>,
497}
498#[derive(Clone, PartialEq, ::prost::Message)]
499pub struct CountElementsCommand {
500 #[prost(string, tag = "1")]
501 pub css_selector: ::prost::alloc::string::String,
502 #[prost(message, optional, tag = "2")]
503 pub retry_options: ::core::option::Option<CommandRetryOptions>,
504}
505#[derive(Clone, PartialEq, ::prost::Message)]
506pub struct HighlightElementsCommand {
507 #[prost(string, tag = "1")]
508 pub css_selector: ::prost::alloc::string::String,
509 #[prost(uint32, optional, tag = "2")]
510 pub duration_ms: ::core::option::Option<u32>,
511 #[prost(message, optional, tag = "3")]
512 pub retry_options: ::core::option::Option<CommandRetryOptions>,
513}
514#[derive(Clone, PartialEq, ::prost::Message)]
515pub struct FocusElementCommand {
516 #[prost(string, tag = "1")]
517 pub css_selector: ::prost::alloc::string::String,
518 #[prost(message, optional, tag = "2")]
519 pub retry_options: ::core::option::Option<CommandRetryOptions>,
520}
521#[derive(Clone, PartialEq, ::prost::Message)]
522pub struct FillElementCommand {
523 #[prost(string, tag = "1")]
524 pub css_selector: ::prost::alloc::string::String,
525 #[prost(string, tag = "2")]
526 pub value: ::prost::alloc::string::String,
527 #[prost(message, optional, tag = "3")]
528 pub retry_options: ::core::option::Option<CommandRetryOptions>,
529}
530#[derive(Clone, PartialEq, ::prost::Message)]
531pub struct HoverElementCommand {
532 #[prost(string, tag = "1")]
533 pub css_selector: ::prost::alloc::string::String,
534 #[prost(message, optional, tag = "2")]
535 pub retry_options: ::core::option::Option<CommandRetryOptions>,
536}
537#[derive(Clone, PartialEq, ::prost::Message)]
538pub struct PressKeyCommand {
539 #[prost(string, tag = "1")]
540 pub css_selector: ::prost::alloc::string::String,
541 #[prost(string, tag = "2")]
542 pub key: ::prost::alloc::string::String,
543 #[prost(string, optional, tag = "3")]
544 pub text: ::core::option::Option<::prost::alloc::string::String>,
545 #[prost(message, optional, tag = "4")]
546 pub retry_options: ::core::option::Option<CommandRetryOptions>,
547}
548#[derive(Clone, PartialEq, ::prost::Message)]
549pub struct GetTextContentCommand {
550 #[prost(string, tag = "1")]
551 pub css_selector: ::prost::alloc::string::String,
552 #[prost(message, optional, tag = "2")]
553 pub retry_options: ::core::option::Option<CommandRetryOptions>,
554}
555#[derive(Clone, PartialEq, ::prost::Message)]
556pub struct GetInnerTextCommand {
557 #[prost(string, tag = "1")]
558 pub css_selector: ::prost::alloc::string::String,
559 #[prost(message, optional, tag = "2")]
560 pub retry_options: ::core::option::Option<CommandRetryOptions>,
561}
562#[derive(Clone, PartialEq, ::prost::Message)]
563pub struct WaitForSelectorCommand {
564 #[prost(string, tag = "1")]
565 pub css_selector: ::prost::alloc::string::String,
566 #[prost(bool, optional, tag = "2")]
567 pub visible: ::core::option::Option<bool>,
568 #[prost(message, optional, tag = "3")]
569 pub retry_options: ::core::option::Option<CommandRetryOptions>,
570}
571#[derive(Clone, Copy, PartialEq, ::prost::Message)]
572pub struct ScreenshotCommand {
573 #[prost(message, optional, tag = "1")]
574 pub retry_options: ::core::option::Option<CommandRetryOptions>,
575 #[prost(bool, optional, tag = "2")]
576 pub full_page: ::core::option::Option<bool>,
577}
578#[derive(Clone, PartialEq, ::prost::Message)]
579pub struct PageNavigatedEvent {
580 #[prost(string, tag = "1")]
581 pub url: ::prost::alloc::string::String,
582 #[prost(string, tag = "2")]
583 pub note: ::prost::alloc::string::String,
584}
585#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct ChromiumBidiInjectionEvent {
587 #[prost(string, tag = "1")]
588 pub note: ::prost::alloc::string::String,
589 #[prost(string, tag = "2")]
590 pub bidi_session_id: ::prost::alloc::string::String,
591 #[prost(string, tag = "3")]
592 pub mapper_target_id: ::prost::alloc::string::String,
593 #[prost(string, tag = "4")]
594 pub mapper_session_id: ::prost::alloc::string::String,
595 #[prost(string, tag = "5")]
596 pub package_version: ::prost::alloc::string::String,
597}
598#[derive(Clone, PartialEq, ::prost::Message)]
599pub struct ElementClickedEvent {
600 #[prost(string, tag = "1")]
601 pub css_selector: ::prost::alloc::string::String,
602 #[prost(string, tag = "2")]
603 pub note: ::prost::alloc::string::String,
604 #[prost(string, tag = "3")]
605 pub bidi_session_id: ::prost::alloc::string::String,
606}
607#[derive(Clone, PartialEq, ::prost::Message)]
608pub struct ElementCountedEvent {
609 #[prost(string, tag = "1")]
610 pub css_selector: ::prost::alloc::string::String,
611 #[prost(uint32, tag = "2")]
612 pub count: u32,
613 #[prost(string, tag = "3")]
614 pub note: ::prost::alloc::string::String,
615}
616#[derive(Clone, PartialEq, ::prost::Message)]
617pub struct ElementsHighlightedEvent {
618 #[prost(string, tag = "1")]
619 pub css_selector: ::prost::alloc::string::String,
620 #[prost(uint32, tag = "2")]
621 pub count: u32,
622 #[prost(string, tag = "3")]
623 pub note: ::prost::alloc::string::String,
624}
625#[derive(Clone, PartialEq, ::prost::Message)]
626pub struct ElementFocusedEvent {
627 #[prost(string, tag = "1")]
628 pub css_selector: ::prost::alloc::string::String,
629 #[prost(string, tag = "2")]
630 pub note: ::prost::alloc::string::String,
631}
632#[derive(Clone, PartialEq, ::prost::Message)]
633pub struct ElementFilledEvent {
634 #[prost(string, tag = "1")]
635 pub css_selector: ::prost::alloc::string::String,
636 #[prost(string, tag = "2")]
637 pub value: ::prost::alloc::string::String,
638 #[prost(string, tag = "3")]
639 pub note: ::prost::alloc::string::String,
640}
641#[derive(Clone, PartialEq, ::prost::Message)]
642pub struct ElementHoveredEvent {
643 #[prost(string, tag = "1")]
644 pub css_selector: ::prost::alloc::string::String,
645 #[prost(string, tag = "2")]
646 pub note: ::prost::alloc::string::String,
647}
648#[derive(Clone, PartialEq, ::prost::Message)]
649pub struct KeyPressedEvent {
650 #[prost(string, tag = "1")]
651 pub css_selector: ::prost::alloc::string::String,
652 #[prost(string, tag = "2")]
653 pub key: ::prost::alloc::string::String,
654 #[prost(string, tag = "3")]
655 pub note: ::prost::alloc::string::String,
656}
657#[derive(Clone, PartialEq, ::prost::Message)]
658pub struct TextContentResolvedEvent {
659 #[prost(string, tag = "1")]
660 pub css_selector: ::prost::alloc::string::String,
661 #[prost(string, tag = "2")]
662 pub text: ::prost::alloc::string::String,
663 #[prost(string, tag = "3")]
664 pub note: ::prost::alloc::string::String,
665}
666#[derive(Clone, PartialEq, ::prost::Message)]
667pub struct InnerTextResolvedEvent {
668 #[prost(string, tag = "1")]
669 pub css_selector: ::prost::alloc::string::String,
670 #[prost(string, tag = "2")]
671 pub text: ::prost::alloc::string::String,
672 #[prost(string, tag = "3")]
673 pub note: ::prost::alloc::string::String,
674}
675#[derive(Clone, PartialEq, ::prost::Message)]
676pub struct SelectorWaitSatisfiedEvent {
677 #[prost(string, tag = "1")]
678 pub css_selector: ::prost::alloc::string::String,
679 #[prost(bool, tag = "2")]
680 pub visible: bool,
681 #[prost(string, tag = "3")]
682 pub note: ::prost::alloc::string::String,
683}
684#[derive(Clone, PartialEq, ::prost::Message)]
685pub struct ScreenshotCapturedEvent {
686 #[prost(bytes = "vec", tag = "1")]
687 pub png_data: ::prost::alloc::vec::Vec<u8>,
688 #[prost(string, tag = "2")]
689 pub note: ::prost::alloc::string::String,
690}
691#[derive(Clone, PartialEq, ::prost::Message)]
693pub struct AccessibilitySnapshotCommand {
694 #[prost(string, tag = "3")]
697 pub mode: ::prost::alloc::string::String,
698 #[prost(string, tag = "1")]
699 pub format: ::prost::alloc::string::String,
700 #[prost(message, optional, tag = "2")]
701 pub retry_options: ::core::option::Option<CommandRetryOptions>,
702}
703#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct AccessibilitySnapshotCapturedEvent {
706 #[prost(string, tag = "1")]
707 pub snapshot: ::prost::alloc::string::String,
708 #[prost(string, tag = "2")]
709 pub format: ::prost::alloc::string::String,
710}
711pub mod engine_service_client {
713 #![allow(
714 unused_variables,
715 dead_code,
716 missing_docs,
717 clippy::wildcard_imports,
718 clippy::let_unit_value,
719 )]
720 use tonic::codegen::*;
721 use tonic::codegen::http::Uri;
722 #[derive(Debug, Clone)]
723 pub struct EngineServiceClient<T> {
724 inner: tonic::client::Grpc<T>,
725 }
726 impl EngineServiceClient<tonic::transport::Channel> {
727 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
729 where
730 D: TryInto<tonic::transport::Endpoint>,
731 D::Error: Into<StdError>,
732 {
733 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
734 Ok(Self::new(conn))
735 }
736 }
737 impl<T> EngineServiceClient<T>
738 where
739 T: tonic::client::GrpcService<tonic::body::BoxBody>,
740 T::Error: Into<StdError>,
741 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
742 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
743 {
744 pub fn new(inner: T) -> Self {
745 let inner = tonic::client::Grpc::new(inner);
746 Self { inner }
747 }
748 pub fn with_origin(inner: T, origin: Uri) -> Self {
749 let inner = tonic::client::Grpc::with_origin(inner, origin);
750 Self { inner }
751 }
752 pub fn with_interceptor<F>(
753 inner: T,
754 interceptor: F,
755 ) -> EngineServiceClient<InterceptedService<T, F>>
756 where
757 F: tonic::service::Interceptor,
758 T::ResponseBody: Default,
759 T: tonic::codegen::Service<
760 http::Request<tonic::body::BoxBody>,
761 Response = http::Response<
762 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
763 >,
764 >,
765 <T as tonic::codegen::Service<
766 http::Request<tonic::body::BoxBody>,
767 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
768 {
769 EngineServiceClient::new(InterceptedService::new(inner, interceptor))
770 }
771 #[must_use]
776 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
777 self.inner = self.inner.send_compressed(encoding);
778 self
779 }
780 #[must_use]
782 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
783 self.inner = self.inner.accept_compressed(encoding);
784 self
785 }
786 #[must_use]
790 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
791 self.inner = self.inner.max_decoding_message_size(limit);
792 self
793 }
794 #[must_use]
798 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
799 self.inner = self.inner.max_encoding_message_size(limit);
800 self
801 }
802 pub async fn ping(
803 &mut self,
804 request: impl tonic::IntoRequest<super::PingRequest>,
805 ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
806 self.inner
807 .ready()
808 .await
809 .map_err(|e| {
810 tonic::Status::unknown(
811 format!("Service was not ready: {}", e.into()),
812 )
813 })?;
814 let codec = tonic::codec::ProstCodec::default();
815 let path = http::uri::PathAndQuery::from_static(
816 "/allwright.engine.v1.EngineService/Ping",
817 );
818 let mut req = request.into_request();
819 req.extensions_mut()
820 .insert(GrpcMethod::new("allwright.engine.v1.EngineService", "Ping"));
821 self.inner.unary(req, path, codec).await
822 }
823 pub async fn surface_session(
824 &mut self,
825 request: impl tonic::IntoStreamingRequest<
826 Message = super::SurfaceSessionCommand,
827 >,
828 ) -> std::result::Result<
829 tonic::Response<tonic::codec::Streaming<super::SurfaceSessionEvent>>,
830 tonic::Status,
831 > {
832 self.inner
833 .ready()
834 .await
835 .map_err(|e| {
836 tonic::Status::unknown(
837 format!("Service was not ready: {}", e.into()),
838 )
839 })?;
840 let codec = tonic::codec::ProstCodec::default();
841 let path = http::uri::PathAndQuery::from_static(
842 "/allwright.engine.v1.EngineService/SurfaceSession",
843 );
844 let mut req = request.into_streaming_request();
845 req.extensions_mut()
846 .insert(
847 GrpcMethod::new(
848 "allwright.engine.v1.EngineService",
849 "SurfaceSession",
850 ),
851 );
852 self.inner.streaming(req, path, codec).await
853 }
854 pub async fn context_session(
855 &mut self,
856 request: impl tonic::IntoStreamingRequest<
857 Message = super::ContextSessionCommand,
858 >,
859 ) -> std::result::Result<
860 tonic::Response<tonic::codec::Streaming<super::ContextSessionEvent>>,
861 tonic::Status,
862 > {
863 self.inner
864 .ready()
865 .await
866 .map_err(|e| {
867 tonic::Status::unknown(
868 format!("Service was not ready: {}", e.into()),
869 )
870 })?;
871 let codec = tonic::codec::ProstCodec::default();
872 let path = http::uri::PathAndQuery::from_static(
873 "/allwright.engine.v1.EngineService/ContextSession",
874 );
875 let mut req = request.into_streaming_request();
876 req.extensions_mut()
877 .insert(
878 GrpcMethod::new(
879 "allwright.engine.v1.EngineService",
880 "ContextSession",
881 ),
882 );
883 self.inner.streaming(req, path, codec).await
884 }
885 }
886}
887pub mod engine_service_server {
889 #![allow(
890 unused_variables,
891 dead_code,
892 missing_docs,
893 clippy::wildcard_imports,
894 clippy::let_unit_value,
895 )]
896 use tonic::codegen::*;
897 #[async_trait]
899 pub trait EngineService: std::marker::Send + std::marker::Sync + 'static {
900 async fn ping(
901 &self,
902 request: tonic::Request<super::PingRequest>,
903 ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status>;
904 type SurfaceSessionStream: tonic::codegen::tokio_stream::Stream<
906 Item = std::result::Result<super::SurfaceSessionEvent, tonic::Status>,
907 >
908 + std::marker::Send
909 + 'static;
910 async fn surface_session(
911 &self,
912 request: tonic::Request<tonic::Streaming<super::SurfaceSessionCommand>>,
913 ) -> std::result::Result<
914 tonic::Response<Self::SurfaceSessionStream>,
915 tonic::Status,
916 >;
917 type ContextSessionStream: tonic::codegen::tokio_stream::Stream<
919 Item = std::result::Result<super::ContextSessionEvent, tonic::Status>,
920 >
921 + std::marker::Send
922 + 'static;
923 async fn context_session(
924 &self,
925 request: tonic::Request<tonic::Streaming<super::ContextSessionCommand>>,
926 ) -> std::result::Result<
927 tonic::Response<Self::ContextSessionStream>,
928 tonic::Status,
929 >;
930 }
931 #[derive(Debug)]
932 pub struct EngineServiceServer<T> {
933 inner: Arc<T>,
934 accept_compression_encodings: EnabledCompressionEncodings,
935 send_compression_encodings: EnabledCompressionEncodings,
936 max_decoding_message_size: Option<usize>,
937 max_encoding_message_size: Option<usize>,
938 }
939 impl<T> EngineServiceServer<T> {
940 pub fn new(inner: T) -> Self {
941 Self::from_arc(Arc::new(inner))
942 }
943 pub fn from_arc(inner: Arc<T>) -> Self {
944 Self {
945 inner,
946 accept_compression_encodings: Default::default(),
947 send_compression_encodings: Default::default(),
948 max_decoding_message_size: None,
949 max_encoding_message_size: None,
950 }
951 }
952 pub fn with_interceptor<F>(
953 inner: T,
954 interceptor: F,
955 ) -> InterceptedService<Self, F>
956 where
957 F: tonic::service::Interceptor,
958 {
959 InterceptedService::new(Self::new(inner), interceptor)
960 }
961 #[must_use]
963 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
964 self.accept_compression_encodings.enable(encoding);
965 self
966 }
967 #[must_use]
969 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
970 self.send_compression_encodings.enable(encoding);
971 self
972 }
973 #[must_use]
977 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
978 self.max_decoding_message_size = Some(limit);
979 self
980 }
981 #[must_use]
985 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
986 self.max_encoding_message_size = Some(limit);
987 self
988 }
989 }
990 impl<T, B> tonic::codegen::Service<http::Request<B>> for EngineServiceServer<T>
991 where
992 T: EngineService,
993 B: Body + std::marker::Send + 'static,
994 B::Error: Into<StdError> + std::marker::Send + 'static,
995 {
996 type Response = http::Response<tonic::body::BoxBody>;
997 type Error = std::convert::Infallible;
998 type Future = BoxFuture<Self::Response, Self::Error>;
999 fn poll_ready(
1000 &mut self,
1001 _cx: &mut Context<'_>,
1002 ) -> Poll<std::result::Result<(), Self::Error>> {
1003 Poll::Ready(Ok(()))
1004 }
1005 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1006 match req.uri().path() {
1007 "/allwright.engine.v1.EngineService/Ping" => {
1008 #[allow(non_camel_case_types)]
1009 struct PingSvc<T: EngineService>(pub Arc<T>);
1010 impl<
1011 T: EngineService,
1012 > tonic::server::UnaryService<super::PingRequest> for PingSvc<T> {
1013 type Response = super::PingResponse;
1014 type Future = BoxFuture<
1015 tonic::Response<Self::Response>,
1016 tonic::Status,
1017 >;
1018 fn call(
1019 &mut self,
1020 request: tonic::Request<super::PingRequest>,
1021 ) -> Self::Future {
1022 let inner = Arc::clone(&self.0);
1023 let fut = async move {
1024 <T as EngineService>::ping(&inner, request).await
1025 };
1026 Box::pin(fut)
1027 }
1028 }
1029 let accept_compression_encodings = self.accept_compression_encodings;
1030 let send_compression_encodings = self.send_compression_encodings;
1031 let max_decoding_message_size = self.max_decoding_message_size;
1032 let max_encoding_message_size = self.max_encoding_message_size;
1033 let inner = self.inner.clone();
1034 let fut = async move {
1035 let method = PingSvc(inner);
1036 let codec = tonic::codec::ProstCodec::default();
1037 let mut grpc = tonic::server::Grpc::new(codec)
1038 .apply_compression_config(
1039 accept_compression_encodings,
1040 send_compression_encodings,
1041 )
1042 .apply_max_message_size_config(
1043 max_decoding_message_size,
1044 max_encoding_message_size,
1045 );
1046 let res = grpc.unary(method, req).await;
1047 Ok(res)
1048 };
1049 Box::pin(fut)
1050 }
1051 "/allwright.engine.v1.EngineService/SurfaceSession" => {
1052 #[allow(non_camel_case_types)]
1053 struct SurfaceSessionSvc<T: EngineService>(pub Arc<T>);
1054 impl<
1055 T: EngineService,
1056 > tonic::server::StreamingService<super::SurfaceSessionCommand>
1057 for SurfaceSessionSvc<T> {
1058 type Response = super::SurfaceSessionEvent;
1059 type ResponseStream = T::SurfaceSessionStream;
1060 type Future = BoxFuture<
1061 tonic::Response<Self::ResponseStream>,
1062 tonic::Status,
1063 >;
1064 fn call(
1065 &mut self,
1066 request: tonic::Request<
1067 tonic::Streaming<super::SurfaceSessionCommand>,
1068 >,
1069 ) -> Self::Future {
1070 let inner = Arc::clone(&self.0);
1071 let fut = async move {
1072 <T as EngineService>::surface_session(&inner, request).await
1073 };
1074 Box::pin(fut)
1075 }
1076 }
1077 let accept_compression_encodings = self.accept_compression_encodings;
1078 let send_compression_encodings = self.send_compression_encodings;
1079 let max_decoding_message_size = self.max_decoding_message_size;
1080 let max_encoding_message_size = self.max_encoding_message_size;
1081 let inner = self.inner.clone();
1082 let fut = async move {
1083 let method = SurfaceSessionSvc(inner);
1084 let codec = tonic::codec::ProstCodec::default();
1085 let mut grpc = tonic::server::Grpc::new(codec)
1086 .apply_compression_config(
1087 accept_compression_encodings,
1088 send_compression_encodings,
1089 )
1090 .apply_max_message_size_config(
1091 max_decoding_message_size,
1092 max_encoding_message_size,
1093 );
1094 let res = grpc.streaming(method, req).await;
1095 Ok(res)
1096 };
1097 Box::pin(fut)
1098 }
1099 "/allwright.engine.v1.EngineService/ContextSession" => {
1100 #[allow(non_camel_case_types)]
1101 struct ContextSessionSvc<T: EngineService>(pub Arc<T>);
1102 impl<
1103 T: EngineService,
1104 > tonic::server::StreamingService<super::ContextSessionCommand>
1105 for ContextSessionSvc<T> {
1106 type Response = super::ContextSessionEvent;
1107 type ResponseStream = T::ContextSessionStream;
1108 type Future = BoxFuture<
1109 tonic::Response<Self::ResponseStream>,
1110 tonic::Status,
1111 >;
1112 fn call(
1113 &mut self,
1114 request: tonic::Request<
1115 tonic::Streaming<super::ContextSessionCommand>,
1116 >,
1117 ) -> Self::Future {
1118 let inner = Arc::clone(&self.0);
1119 let fut = async move {
1120 <T as EngineService>::context_session(&inner, request).await
1121 };
1122 Box::pin(fut)
1123 }
1124 }
1125 let accept_compression_encodings = self.accept_compression_encodings;
1126 let send_compression_encodings = self.send_compression_encodings;
1127 let max_decoding_message_size = self.max_decoding_message_size;
1128 let max_encoding_message_size = self.max_encoding_message_size;
1129 let inner = self.inner.clone();
1130 let fut = async move {
1131 let method = ContextSessionSvc(inner);
1132 let codec = tonic::codec::ProstCodec::default();
1133 let mut grpc = tonic::server::Grpc::new(codec)
1134 .apply_compression_config(
1135 accept_compression_encodings,
1136 send_compression_encodings,
1137 )
1138 .apply_max_message_size_config(
1139 max_decoding_message_size,
1140 max_encoding_message_size,
1141 );
1142 let res = grpc.streaming(method, req).await;
1143 Ok(res)
1144 };
1145 Box::pin(fut)
1146 }
1147 _ => {
1148 Box::pin(async move {
1149 let mut response = http::Response::new(empty_body());
1150 let headers = response.headers_mut();
1151 headers
1152 .insert(
1153 tonic::Status::GRPC_STATUS,
1154 (tonic::Code::Unimplemented as i32).into(),
1155 );
1156 headers
1157 .insert(
1158 http::header::CONTENT_TYPE,
1159 tonic::metadata::GRPC_CONTENT_TYPE,
1160 );
1161 Ok(response)
1162 })
1163 }
1164 }
1165 }
1166 }
1167 impl<T> Clone for EngineServiceServer<T> {
1168 fn clone(&self) -> Self {
1169 let inner = self.inner.clone();
1170 Self {
1171 inner,
1172 accept_compression_encodings: self.accept_compression_encodings,
1173 send_compression_encodings: self.send_compression_encodings,
1174 max_decoding_message_size: self.max_decoding_message_size,
1175 max_encoding_message_size: self.max_encoding_message_size,
1176 }
1177 }
1178 }
1179 pub const SERVICE_NAME: &str = "allwright.engine.v1.EngineService";
1181 impl<T> tonic::server::NamedService for EngineServiceServer<T> {
1182 const NAME: &'static str = SERVICE_NAME;
1183 }
1184}