@autoweb/domain-models 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +100 -0
  2. package/index.d.ts +594 -0
  3. package/index.js +3 -0
  4. package/package.json +55 -0
  5. package/python-models/__init__.py +68 -0
  6. package/python-models/action-configs.py +1112 -0
  7. package/python-models/build/lib/floweb_models/__init__.py +194 -0
  8. package/python-models/build/lib/floweb_models/action_configs.py +783 -0
  9. package/python-models/build/lib/floweb_models/debug.py +209 -0
  10. package/python-models/build/lib/floweb_models/debug_models.py +141 -0
  11. package/python-models/build/lib/floweb_models/environment.py +158 -0
  12. package/python-models/build/lib/floweb_models/execution_results.py +208 -0
  13. package/python-models/build/lib/floweb_models/flow.py +345 -0
  14. package/python-models/build/lib/floweb_models/flow_validation.py +316 -0
  15. package/python-models/build/lib/floweb_models/parallel_execution.py +258 -0
  16. package/python-models/build/lib/floweb_models/performance_test.py +605 -0
  17. package/python-models/build/lib/floweb_models/websocket_communication.py +697 -0
  18. package/python-models/debug.py +209 -0
  19. package/python-models/dist/floweb_domain_models-1.0.0-py3-none-any.whl +0 -0
  20. package/python-models/environment.py +158 -0
  21. package/python-models/execution-results.py +208 -0
  22. package/python-models/flow-validation.py +316 -0
  23. package/python-models/flow.py +369 -0
  24. package/python-models/floweb_domain_models.egg-info/PKG-INFO +9 -0
  25. package/python-models/floweb_domain_models.egg-info/SOURCES.txt +16 -0
  26. package/python-models/floweb_domain_models.egg-info/dependency_links.txt +1 -0
  27. package/python-models/floweb_domain_models.egg-info/requires.txt +1 -0
  28. package/python-models/floweb_domain_models.egg-info/top_level.txt +1 -0
  29. package/python-models/floweb_models/__init__.py +194 -0
  30. package/python-models/floweb_models/__pycache__/__init__.cpython-312.pyc +0 -0
  31. package/python-models/floweb_models/__pycache__/action_configs.cpython-312.pyc +0 -0
  32. package/python-models/floweb_models/__pycache__/debug.cpython-312.pyc +0 -0
  33. package/python-models/floweb_models/__pycache__/debug_models.cpython-312.pyc +0 -0
  34. package/python-models/floweb_models/__pycache__/environment.cpython-312.pyc +0 -0
  35. package/python-models/floweb_models/__pycache__/execution_results.cpython-312.pyc +0 -0
  36. package/python-models/floweb_models/__pycache__/flow.cpython-312.pyc +0 -0
  37. package/python-models/floweb_models/__pycache__/flow_validation.cpython-312.pyc +0 -0
  38. package/python-models/floweb_models/__pycache__/parallel_execution.cpython-312.pyc +0 -0
  39. package/python-models/floweb_models/__pycache__/performance_test.cpython-312.pyc +0 -0
  40. package/python-models/floweb_models/__pycache__/websocket_communication.cpython-312.pyc +0 -0
  41. package/python-models/floweb_models/action_configs.py +1062 -0
  42. package/python-models/floweb_models/debug.py +209 -0
  43. package/python-models/floweb_models/debug_models.py +141 -0
  44. package/python-models/floweb_models/environment.py +158 -0
  45. package/python-models/floweb_models/execution_results.py +208 -0
  46. package/python-models/floweb_models/flow.py +345 -0
  47. package/python-models/floweb_models/flow_validation.py +316 -0
  48. package/python-models/floweb_models/parallel_execution.py +229 -0
  49. package/python-models/floweb_models/performance_test.py +605 -0
  50. package/python-models/floweb_models/websocket_communication.py +697 -0
  51. package/python-models/floweb_models.egg-info/PKG-INFO +9 -0
  52. package/python-models/floweb_models.egg-info/SOURCES.txt +16 -0
  53. package/python-models/floweb_models.egg-info/dependency_links.txt +1 -0
  54. package/python-models/floweb_models.egg-info/requires.txt +1 -0
  55. package/python-models/floweb_models.egg-info/top_level.txt +1 -0
  56. package/python-models/parallel-execution.py +475 -0
  57. package/python-models/performance-test.py +605 -0
  58. package/python-models/setup.py +13 -0
  59. package/python-models/websocket-communication.py +697 -0
  60. package/schemas/action-configs.json +1501 -0
  61. package/schemas/debug.json +203 -0
  62. package/schemas/environment.json +165 -0
  63. package/schemas/execution-results.json +209 -0
  64. package/schemas/flow-validation.json +311 -0
  65. package/schemas/flow.json +381 -0
  66. package/schemas/parallel-execution.json +219 -0
  67. package/schemas/performance-test.json +600 -0
  68. package/schemas/websocket-communication.json +1118 -0
@@ -0,0 +1,783 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: action-configs.json
3
+ # timestamp: 2026-02-04T16:10:52+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import StrEnum
8
+ from typing import Any
9
+
10
+ from pydantic import AnyUrl, BaseModel, Field
11
+
12
+
13
+ class BaseActionConfig(BaseModel):
14
+ image: str | None = Field(None, description="Base64 encoded reference image")
15
+
16
+
17
+ class ClickType(StrEnum):
18
+ """
19
+ Type of click to perform
20
+ """
21
+
22
+ left = "left"
23
+ right = "right"
24
+
25
+
26
+ class ClickConfig(BaseActionConfig):
27
+ selector: str = Field(..., description="CSS selector for element to click")
28
+ wait_time: int | None = Field(
29
+ 1000, alias="waitTime", description="Wait time in milliseconds"
30
+ )
31
+ force_click: bool | None = Field(
32
+ False,
33
+ alias="forceClick",
34
+ description="Force click even if element not clickable",
35
+ )
36
+ scroll_into_view: bool | None = Field(
37
+ True,
38
+ alias="scrollIntoView",
39
+ description="Scroll element into view before clicking",
40
+ )
41
+ wait_for_element: bool | None = Field(
42
+ True, alias="waitForElement", description="Wait for element to be present"
43
+ )
44
+ click_type: ClickType | None = Field(
45
+ "left", alias="clickType", description="Type of click to perform"
46
+ )
47
+ click_count: int | None = Field(
48
+ 1, alias="clickCount", description="Number of clicks to perform", ge=1
49
+ )
50
+ click_and_hold: bool | None = Field(
51
+ False, alias="clickAndHold", description="Whether to click and hold"
52
+ )
53
+ hold_duration: int | None = Field(
54
+ 1000, alias="holdDuration", description="Duration to hold click in milliseconds"
55
+ )
56
+
57
+
58
+ class InputConfig(BaseActionConfig):
59
+ selector: str = Field(..., description="CSS selector for input element")
60
+ text: str = Field(..., description="Text to input")
61
+ clear_first: bool | None = Field(
62
+ True, alias="clearFirst", description="Clear field before typing"
63
+ )
64
+ wait_for_element: bool | None = Field(
65
+ True, alias="waitForElement", description="Wait for element to be present"
66
+ )
67
+ scroll_into_view: bool | None = Field(
68
+ True, alias="scrollIntoView", description="Scroll element into view"
69
+ )
70
+
71
+
72
+ class NavigateConfig(BaseActionConfig):
73
+ url: AnyUrl = Field(..., description="URL to navigate to")
74
+ wait_for_load: bool | None = Field(
75
+ True, alias="waitForLoad", description="Wait for page to load"
76
+ )
77
+ take_screenshot: bool | None = Field(
78
+ False, alias="takeScreenshot", description="Take screenshot after navigation"
79
+ )
80
+
81
+
82
+ class WaitType(StrEnum):
83
+ """
84
+ Type of wait to perform
85
+ """
86
+
87
+ duration = "duration"
88
+ element = "element"
89
+ interactable = "interactable"
90
+
91
+
92
+ class WaitConfig(BaseActionConfig):
93
+ wait_type: WaitType | None = Field(
94
+ "duration", alias="waitType", description="Type of wait to perform"
95
+ )
96
+ duration: int | None = Field(3000, description="Duration to wait in milliseconds")
97
+ selector: str | None = Field(
98
+ None, description="CSS selector for element to wait for"
99
+ )
100
+ timeout: int | None = Field(
101
+ 10000, description="Maximum time to wait in milliseconds"
102
+ )
103
+ wait_for_interactable: bool | None = Field(
104
+ False,
105
+ alias="waitForInteractable",
106
+ description="Wait for element to be interactable",
107
+ )
108
+ fallback_to_duration: bool | None = Field(
109
+ True,
110
+ alias="fallbackToDuration",
111
+ description="Fallback to duration wait if element wait fails",
112
+ )
113
+ fallback_duration: int | None = Field(
114
+ 2000,
115
+ alias="fallbackDuration",
116
+ description="Duration to wait if fallback triggered",
117
+ )
118
+
119
+
120
+ class AssertType(StrEnum):
121
+ """
122
+ Type of assertion
123
+ """
124
+
125
+ exists = "exists"
126
+ visible = "visible"
127
+ text = "text"
128
+ value = "value"
129
+ attribute = "attribute"
130
+
131
+
132
+ class AssertionConfig(BaseActionConfig):
133
+ selector: str = Field(..., description="CSS selector for element")
134
+ assert_type: AssertType | None = Field(
135
+ "exists", alias="assertType", description="Type of assertion"
136
+ )
137
+ expected_value: str = Field(
138
+ ..., alias="expectedValue", description="Expected value for assertion"
139
+ )
140
+ wait_for_element: bool | None = Field(
141
+ True, alias="waitForElement", description="Wait for element to be present"
142
+ )
143
+ case_sensitive: bool | None = Field(
144
+ False, alias="caseSensitive", description="Case sensitive comparison"
145
+ )
146
+ partial_match: bool | None = Field(
147
+ False, alias="partialMatch", description="Allow partial text matching"
148
+ )
149
+
150
+
151
+ class ScreenshotType(StrEnum):
152
+ """
153
+ Type of screenshot to capture
154
+ """
155
+
156
+ viewport = "viewport"
157
+ full_page = "fullPage"
158
+ element = "element"
159
+
160
+
161
+ class Format(StrEnum):
162
+ """
163
+ Output format
164
+ """
165
+
166
+ png = "png"
167
+ jpg = "jpg"
168
+
169
+
170
+ class ScreenshotConfig(BaseActionConfig):
171
+ screenshot_type: ScreenshotType | None = Field(
172
+ "viewport", alias="screenshotType", description="Type of screenshot to capture"
173
+ )
174
+ selector: str | None = Field(
175
+ None, description="CSS selector for element screenshots"
176
+ )
177
+ filename: str | None = Field("screenshot.png", description="Output filename")
178
+ save_to_file: bool | None = Field(
179
+ True, alias="saveToFile", description="Save screenshot to file system"
180
+ )
181
+ include_timestamp: bool | None = Field(
182
+ True, alias="includeTimestamp", description="Include timestamp in filename"
183
+ )
184
+ format: Format | None = Field("png", description="Output format")
185
+ wait_for_element: bool | None = Field(
186
+ True, alias="waitForElement", description="Wait for element to be present"
187
+ )
188
+ scroll_into_view: bool | None = Field(
189
+ True, alias="scrollIntoView", description="Scroll element into view"
190
+ )
191
+ full_page: bool | None = Field(
192
+ False, alias="fullPage", description="Take full page screenshot"
193
+ )
194
+
195
+
196
+ class Type(StrEnum):
197
+ """
198
+ Type of form field
199
+ """
200
+
201
+ text = "text"
202
+ password = "password"
203
+ email = "email"
204
+ number = "number"
205
+ tel = "tel"
206
+ textarea = "textarea"
207
+ date = "date"
208
+ time = "time"
209
+ datetime_local = "datetime-local"
210
+ checkbox = "checkbox"
211
+ radio = "radio"
212
+ select = "select"
213
+ file = "file"
214
+
215
+
216
+ class FormFieldOption(BaseModel):
217
+ value: str = Field(..., description="Option value")
218
+ label: str = Field(..., description="Option label")
219
+
220
+
221
+ class Method(StrEnum):
222
+ """
223
+ HTTP method
224
+ """
225
+
226
+ get = "GET"
227
+ post = "POST"
228
+ put = "PUT"
229
+ delete = "DELETE"
230
+ patch = "PATCH"
231
+
232
+
233
+ class ApiCallConfig(BaseActionConfig):
234
+ method: Method | None = Field("GET", description="HTTP method")
235
+ url: AnyUrl = Field(..., description="API endpoint URL")
236
+ headers: dict[str, str] | None = Field(None, description="HTTP headers")
237
+ body: str | None = Field(None, description="Request body")
238
+ output_variable: str | None = Field(
239
+ "apiResponse", alias="outputVariable", description="Variable to store response"
240
+ )
241
+ timeout: int | None = Field(30000, description="Request timeout in milliseconds")
242
+ retry_count: int | None = Field(
243
+ 0, alias="retryCount", description="Number of retries"
244
+ )
245
+ parse_json: bool | None = Field(
246
+ True, alias="parseJson", description="Parse response as JSON"
247
+ )
248
+ validate_status: bool | None = Field(
249
+ True, alias="validateStatus", description="Validate HTTP status code"
250
+ )
251
+ follow_redirects: bool | None = Field(
252
+ True, alias="followRedirects", description="Follow HTTP redirects"
253
+ )
254
+ verify_ssl: bool | None = Field(
255
+ True, alias="verifySSL", description="Verify SSL certificates"
256
+ )
257
+ basic_auth_username: str | None = Field(
258
+ None, alias="basicAuthUsername", description="Basic auth username"
259
+ )
260
+ basic_auth_password: str | None = Field(
261
+ None, alias="basicAuthPassword", description="Basic auth password"
262
+ )
263
+
264
+
265
+ class DatabaseQueryConfig(BaseActionConfig):
266
+ connection_string: str = Field(
267
+ ..., alias="connectionString", description="Database connection string"
268
+ )
269
+ query: str = Field(..., description="SQL query to execute")
270
+ output_variable: str | None = Field(
271
+ "queryResult", alias="outputVariable", description="Variable to store result"
272
+ )
273
+ log_query: bool | None = Field(
274
+ True, alias="logQuery", description="Log the query being executed"
275
+ )
276
+ validate_connection: bool | None = Field(
277
+ True, alias="validateConnection", description="Validate database connection"
278
+ )
279
+ timeout: int | None = Field(30000, description="Query timeout in milliseconds")
280
+
281
+
282
+ class DatabaseInsertConfig(BaseActionConfig):
283
+ connection_string: str = Field(
284
+ ..., alias="connectionString", description="Database connection string"
285
+ )
286
+ table: str = Field(..., description="Table name to insert into")
287
+ data: dict[str, Any] = Field(..., description="Data to insert (column-value pairs)")
288
+ log_operation: bool | None = Field(
289
+ True, alias="logOperation", description="Log the insert operation"
290
+ )
291
+ validate_connection: bool | None = Field(
292
+ True, alias="validateConnection", description="Validate database connection"
293
+ )
294
+ rollback_on_error: bool | None = Field(
295
+ True, alias="rollbackOnError", description="Rollback transaction on error"
296
+ )
297
+
298
+
299
+ class FileUploadConfig(BaseActionConfig):
300
+ selector: str = Field(..., description="CSS selector for file input")
301
+ file_path: str = Field(..., alias="filePath", description="Path to file to upload")
302
+ wait_for_element: bool | None = Field(
303
+ True, alias="waitForElement", description="Wait for element to be present"
304
+ )
305
+ scroll_into_view: bool | None = Field(
306
+ True, alias="scrollIntoView", description="Scroll element into view"
307
+ )
308
+ validate_file: bool | None = Field(
309
+ True, alias="validateFile", description="Validate file exists before upload"
310
+ )
311
+
312
+
313
+ class FileDownloadConfig(BaseActionConfig):
314
+ selector: str = Field(..., description="CSS selector for download link")
315
+ download_path: str = Field(
316
+ ..., alias="downloadPath", description="Path to save downloaded file"
317
+ )
318
+ wait_for_element: bool | None = Field(
319
+ True, alias="waitForElement", description="Wait for element to be present"
320
+ )
321
+ validate_download: bool | None = Field(
322
+ True, alias="validateDownload", description="Validate download completed"
323
+ )
324
+ overwrite_existing: bool | None = Field(
325
+ False, alias="overwriteExisting", description="Overwrite existing files"
326
+ )
327
+
328
+
329
+ class CustomCodeConfig(BaseActionConfig):
330
+ code: str = Field(..., description="JavaScript code to execute")
331
+ output_variable: str | None = Field(
332
+ "customResult", alias="outputVariable", description="Variable to store result"
333
+ )
334
+ log_execution: bool | None = Field(
335
+ True, alias="logExecution", description="Log code execution"
336
+ )
337
+ catch_errors: bool | None = Field(
338
+ True, alias="catchErrors", description="Catch and handle errors"
339
+ )
340
+ timeout: int | None = Field(30000, description="Execution timeout in milliseconds")
341
+
342
+
343
+ class SubflowConfig(BaseActionConfig):
344
+ flow_id: str = Field(..., alias="flowId", description="ID of flow to call")
345
+ flow_name: str | None = Field(
346
+ None, alias="flowName", description="Name of flow to call"
347
+ )
348
+ input_parameters: list[dict[str, Any]] | None = Field(
349
+ None, alias="inputParameters", description="Input parameters for subflow"
350
+ )
351
+ output_parameters: list[dict[str, Any]] | None = Field(
352
+ None, alias="outputParameters", description="Output parameters from subflow"
353
+ )
354
+ output_variable: str | None = Field(
355
+ "flowResult", alias="outputVariable", description="Variable to store result"
356
+ )
357
+ wait_for_completion: bool | None = Field(
358
+ True, alias="waitForCompletion", description="Wait for flow to complete"
359
+ )
360
+ log_execution: bool | None = Field(
361
+ True, alias="logExecution", description="Log flow execution"
362
+ )
363
+ propagate_errors: bool | None = Field(
364
+ True, alias="propagateErrors", description="Propagate errors from subflow"
365
+ )
366
+
367
+
368
+ class SendKeysConfig(BaseActionConfig):
369
+ selector: str | None = Field(
370
+ None, description="CSS selector for element to send keys to"
371
+ )
372
+ keys: str = Field(..., description="Keys to send")
373
+ wait_for_element: bool | None = Field(
374
+ True, alias="waitForElement", description="Wait for element to be present"
375
+ )
376
+
377
+
378
+ class Direction(StrEnum):
379
+ """
380
+ Scroll direction
381
+ """
382
+
383
+ up = "up"
384
+ down = "down"
385
+ left = "left"
386
+ right = "right"
387
+
388
+
389
+ class ScrollConfig(BaseActionConfig):
390
+ direction: Direction | None = Field("down", description="Scroll direction")
391
+ distance: int | None = Field(100, description="Scroll distance in pixels")
392
+ selector: str | None = Field(
393
+ None, description="Element to scroll (optional, defaults to window)"
394
+ )
395
+
396
+
397
+ class AssertVisibleConfig(BaseActionConfig):
398
+ selector: str = Field(..., description="CSS selector for element to check")
399
+ timeout: int | None = Field(5000, description="Timeout in milliseconds")
400
+ wait_for_element: bool | None = Field(
401
+ True, alias="waitForElement", description="Wait for element to be present"
402
+ )
403
+
404
+
405
+ class ClearInputConfig(BaseActionConfig):
406
+ selector: str = Field(..., description="CSS selector for input element")
407
+ wait_for_element: bool | None = Field(
408
+ True, alias="waitForElement", description="Wait for element to be present"
409
+ )
410
+
411
+
412
+ class OpenNewTabConfig(BaseActionConfig):
413
+ url: str = Field(..., description="URL to open in new tab")
414
+
415
+
416
+ class SwitchTabConfig(BaseActionConfig):
417
+ tab_index: int | None = Field(
418
+ None, alias="tabIndex", description="Tab index to switch to", ge=0
419
+ )
420
+ tab_title: str | None = Field(
421
+ None,
422
+ alias="tabTitle",
423
+ description="Tab title to switch to (alternative to index)",
424
+ )
425
+
426
+
427
+ class GoForwardConfig(BaseActionConfig):
428
+ pass
429
+
430
+
431
+ class GoBackConfig(BaseActionConfig):
432
+ pass
433
+
434
+
435
+ class RefreshConfig(BaseActionConfig):
436
+ pass
437
+
438
+
439
+ class GetPageInfoConfig(BaseActionConfig):
440
+ output_variable: str | None = Field(
441
+ "pageInfo",
442
+ alias="outputVariable",
443
+ description="Variable to store page information",
444
+ )
445
+
446
+
447
+ class JunctionConfig(BaseActionConfig):
448
+ condition: str | None = Field(None, description="Condition to evaluate")
449
+ true_path: str | None = Field(
450
+ None, alias="truePath", description="Path to take if condition is true"
451
+ )
452
+ false_path: str | None = Field(
453
+ None, alias="falsePath", description="Path to take if condition is false"
454
+ )
455
+
456
+
457
+ class Operator(StrEnum):
458
+ """
459
+ Comparison operator
460
+ """
461
+
462
+ equals = "equals"
463
+ not_equals = "not_equals"
464
+ greater_than = "greater_than"
465
+ less_than = "less_than"
466
+ greater_than_or_equal = "greater_than_or_equal"
467
+ less_than_or_equal = "less_than_or_equal"
468
+ contains = "contains"
469
+ not_contains = "not_contains"
470
+ starts_with = "starts_with"
471
+ ends_with = "ends_with"
472
+ exists = "exists"
473
+ not_exists = "not_exists"
474
+ is_empty = "is_empty"
475
+ not_empty = "not_empty"
476
+ is_true = "is_true"
477
+ is_false = "is_false"
478
+ in_ = "in"
479
+ not_in = "not_in"
480
+ matches = "matches"
481
+ not_matches = "not_matches"
482
+
483
+
484
+ class ConditionalConfig(BaseActionConfig):
485
+ condition: str = Field(
486
+ ..., description="Variable name or {{variable_id}} pattern to evaluate"
487
+ )
488
+ operator: Operator = Field(..., description="Comparison operator")
489
+ value: str = Field(
490
+ ...,
491
+ description="Value to compare against (can be plain text or {{variable_id}})",
492
+ )
493
+ true_action: str = Field(
494
+ ..., alias="trueAction", description="Action ID to execute if condition is true"
495
+ )
496
+ false_action: str | None = Field(
497
+ None,
498
+ alias="falseAction",
499
+ description="Action ID to execute if condition is false",
500
+ )
501
+
502
+
503
+ class LoopType(StrEnum):
504
+ """
505
+ Type of loop
506
+ """
507
+
508
+ count_ = "count"
509
+ condition = "condition"
510
+ foreach = "foreach"
511
+
512
+
513
+ class LoopConfig(BaseActionConfig):
514
+ loop_type: LoopType | None = Field(
515
+ "count", alias="loopType", description="Type of loop"
516
+ )
517
+ count: int | None = Field(
518
+ None, description="Number of iterations (for count loops)", ge=1
519
+ )
520
+ condition: str | None = Field(
521
+ None, description="Condition to continue loop (for condition loops)"
522
+ )
523
+ array_variable: str | None = Field(
524
+ None,
525
+ alias="arrayVariable",
526
+ description="Variable containing array to iterate (for foreach loops)",
527
+ )
528
+ item_variable: str | None = Field(
529
+ "item",
530
+ alias="itemVariable",
531
+ description="Variable name for current item (for foreach loops)",
532
+ )
533
+ actions: list[dict[str, Any]] = Field(
534
+ ..., description="Actions to execute in each iteration"
535
+ )
536
+ max_iterations: int | None = Field(
537
+ 100,
538
+ alias="maxIterations",
539
+ description="Maximum iterations to prevent infinite loops",
540
+ ge=1,
541
+ )
542
+
543
+
544
+ class DragAndDropConfig(BaseActionConfig):
545
+ source_selector: str = Field(
546
+ ..., alias="sourceSelector", description="CSS selector for element to drag"
547
+ )
548
+ target_selector: str = Field(
549
+ ..., alias="targetSelector", description="CSS selector for drop target"
550
+ )
551
+ wait_for_element: bool | None = Field(
552
+ True, alias="waitForElement", description="Wait for elements to be present"
553
+ )
554
+
555
+
556
+ class CallToFlowConfig(BaseActionConfig):
557
+ flow_id: str = Field(..., alias="flowId", description="ID of flow to call")
558
+ input_parameters: dict[str, Any] | None = Field(
559
+ None, alias="inputParameters", description="Input parameters to pass to subflow"
560
+ )
561
+ output_variable: str | None = Field(
562
+ "flowResult", alias="outputVariable", description="Variable to store result"
563
+ )
564
+ wait_for_completion: bool | None = Field(
565
+ True, alias="waitForCompletion", description="Wait for subflow to complete"
566
+ )
567
+ async_: bool | None = Field(
568
+ False, alias="async", description="Execute subflow asynchronously"
569
+ )
570
+
571
+
572
+ class SwitchToFrameConfig(BaseActionConfig):
573
+ frame_selector: str | None = Field(
574
+ None, alias="frameSelector", description="CSS selector or frame name/ID"
575
+ )
576
+ frame_index: int | None = Field(
577
+ None,
578
+ alias="frameIndex",
579
+ description="Frame index (alternative to selector)",
580
+ ge=0,
581
+ )
582
+
583
+
584
+ class ExitFrameConfig(BaseActionConfig):
585
+ pass
586
+
587
+
588
+ class ViewportType(StrEnum):
589
+ """
590
+ Type of viewport configuration
591
+ """
592
+
593
+ preset = "preset"
594
+ device = "device"
595
+ responsive = "responsive"
596
+ custom = "custom"
597
+
598
+
599
+ class SetViewportConfig(BaseActionConfig):
600
+ viewport_type: ViewportType | None = Field(
601
+ "custom", alias="viewportType", description="Type of viewport configuration"
602
+ )
603
+ width: int = Field(..., description="Viewport width in pixels", ge=1)
604
+ height: int = Field(..., description="Viewport height in pixels", ge=1)
605
+ screen_size_preset: str | None = Field(
606
+ None, alias="screenSizePreset", description="Preset screen size name"
607
+ )
608
+ device_name: str | None = Field(
609
+ None, alias="deviceName", description="Device name for emulation"
610
+ )
611
+ device_scale_factor: float | None = Field(
612
+ 1.0,
613
+ alias="deviceScaleFactor",
614
+ description="Device scale factor",
615
+ ge=0.1,
616
+ le=5.0,
617
+ )
618
+ is_mobile: bool | None = Field(
619
+ False, alias="isMobile", description="Emulate mobile device"
620
+ )
621
+ has_touch: bool | None = Field(
622
+ False, alias="hasTouch", description="Enable touch events"
623
+ )
624
+ is_landscape: bool | None = Field(
625
+ False, alias="isLandscape", description="Use landscape orientation"
626
+ )
627
+ user_agent: str | None = Field(
628
+ None, alias="userAgent", description="Custom user agent string"
629
+ )
630
+ wait_after_resize: bool | None = Field(
631
+ True, alias="waitAfterResize", description="Wait after viewport resize"
632
+ )
633
+ take_screenshot: bool | None = Field(
634
+ False, alias="takeScreenshot", description="Take screenshot after resize"
635
+ )
636
+ preserve_cookies: bool | None = Field(
637
+ False,
638
+ alias="preserveCookies",
639
+ description="Preserve cookies across viewport changes",
640
+ )
641
+ preserve_local_storage: bool | None = Field(
642
+ False,
643
+ alias="preserveLocalStorage",
644
+ description="Preserve local storage across viewport changes",
645
+ )
646
+ preserve_session_storage: bool | None = Field(
647
+ False,
648
+ alias="preserveSessionStorage",
649
+ description="Preserve session storage across viewport changes",
650
+ )
651
+
652
+
653
+ class Property(StrEnum):
654
+ text = "text"
655
+ value = "value"
656
+ class_ = "class"
657
+ id = "id"
658
+ tag_name = "tagName"
659
+ inner_html = "innerHTML"
660
+ outer_html = "outerHTML"
661
+ attributes = "attributes"
662
+ rect = "rect"
663
+ visible = "visible"
664
+ enabled = "enabled"
665
+ selected = "selected"
666
+
667
+
668
+ class GetElementPropertiesConfig(BaseActionConfig):
669
+ selector: str = Field(..., description="CSS selector for element")
670
+ properties: list[Property] = Field(..., description="Properties to retrieve")
671
+ output_variable: str | None = Field(
672
+ "elementProps",
673
+ alias="outputVariable",
674
+ description="Variable to store properties",
675
+ )
676
+ wait_for_element: bool | None = Field(
677
+ True, alias="waitForElement", description="Wait for element to be present"
678
+ )
679
+
680
+
681
+ class Action(StrEnum):
682
+ """
683
+ Action to perform on popup
684
+ """
685
+
686
+ accept = "accept"
687
+ dismiss = "dismiss"
688
+ text = "text"
689
+
690
+
691
+ class HandlePopupConfig(BaseActionConfig):
692
+ action: Action | None = Field("accept", description="Action to perform on popup")
693
+ text: str | None = Field(None, description="Text to enter in prompt popup")
694
+ wait_for_popup: bool | None = Field(
695
+ True, alias="waitForPopup", description="Wait for popup to appear"
696
+ )
697
+ timeout: int | None = Field(5000, description="Timeout in milliseconds")
698
+
699
+
700
+ class FormField(BaseModel):
701
+ selector: str = Field(..., description="CSS selector to target form field")
702
+ value: Any = Field(..., description="Value to fill")
703
+ image: str | None = Field(None, description="Optional screenshot path")
704
+ name: str | None = Field(None, description="Human-readable field name")
705
+ type: Type | None = Field("text", description="Type of form field")
706
+ options: list[FormFieldOption] | None = Field(
707
+ None, description="Options for select/radio fields"
708
+ )
709
+ checked: bool | None = Field(False, description="Whether checkbox is checked")
710
+ multiple: bool | None = Field(
711
+ False, description="Whether select allows multiple selections"
712
+ )
713
+
714
+
715
+ class FormFillConfig(BaseActionConfig):
716
+ fields: list[FormField] = Field(
717
+ ..., description="Array of form field configurations"
718
+ )
719
+ wait_for_elements: bool | None = Field(
720
+ True,
721
+ alias="waitForElements",
722
+ description="Wait for all form elements to be present",
723
+ )
724
+ clear_first: bool | None = Field(
725
+ True, alias="clearFirst", description="Clear existing values before filling"
726
+ )
727
+ submit_after_fill: bool | None = Field(
728
+ False,
729
+ alias="submitAfterFill",
730
+ description="Automatically submit form after filling",
731
+ )
732
+ smart_field_detection: bool | None = Field(
733
+ True,
734
+ alias="smartFieldDetection",
735
+ description="Automatically detect field types",
736
+ )
737
+
738
+
739
+ class ActionConfigurations(BaseModel):
740
+ """
741
+ Configuration schemas for all automation actions
742
+ """
743
+
744
+ action_configs: (
745
+ dict[
746
+ str,
747
+ ClickConfig
748
+ | InputConfig
749
+ | SendKeysConfig
750
+ | WaitConfig
751
+ | NavigateConfig
752
+ | ScrollConfig
753
+ | ScreenshotConfig
754
+ | AssertionConfig
755
+ | AssertVisibleConfig
756
+ | FormFillConfig
757
+ | ClearInputConfig
758
+ | OpenNewTabConfig
759
+ | SwitchTabConfig
760
+ | GoForwardConfig
761
+ | GoBackConfig
762
+ | RefreshConfig
763
+ | GetPageInfoConfig
764
+ | JunctionConfig
765
+ | ApiCallConfig
766
+ | ConditionalConfig
767
+ | LoopConfig
768
+ | DatabaseQueryConfig
769
+ | DatabaseInsertConfig
770
+ | CustomCodeConfig
771
+ | DragAndDropConfig
772
+ | CallToFlowConfig
773
+ | SwitchToFrameConfig
774
+ | ExitFrameConfig
775
+ | SetViewportConfig
776
+ | GetElementPropertiesConfig
777
+ | HandlePopupConfig
778
+ | FileUploadConfig
779
+ | FileDownloadConfig
780
+ | SubflowConfig,
781
+ ]
782
+ | None
783
+ ) = Field(None, alias="actionConfigs")