@autoweb/domain-models 1.0.3 → 1.0.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoweb/domain-models",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Domain models for AutoWeb Desktop - centralized type definitions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -7,6 +7,8 @@ from __future__ import annotations
7
7
  from enum import StrEnum
8
8
  from typing import Annotated, Any
9
9
 
10
+ from aiohttp.web_routedef import view
11
+ from black.debug import T
10
12
  from pydantic import AnyUrl, BaseModel, ConfigDict, Field
11
13
 
12
14
 
@@ -37,35 +39,35 @@ class ClickConfig(BaseActionConfig):
37
39
  """
38
40
  CSS selector for element to click
39
41
  """
40
- waitTime: int | None = 1000
42
+ waitTime: int = 1000
41
43
  """
42
44
  Wait time in milliseconds
43
45
  """
44
- forceClick: bool | None = False
46
+ forceClick: bool = False
45
47
  """
46
48
  Force click even if element not clickable
47
49
  """
48
- scrollIntoView: bool | None = True
50
+ scrollIntoView: bool = True
49
51
  """
50
52
  Scroll element into view before clicking
51
53
  """
52
- waitForElement: bool | None = True
54
+ waitForElement: bool = True
53
55
  """
54
56
  Wait for element to be present
55
57
  """
56
- clickType: ClickType | None = 'left'
58
+ clickType: ClickType = ClickType.left
57
59
  """
58
60
  Type of click to perform
59
61
  """
60
- clickCount: Annotated[int | None, Field(ge=1)] = 1
62
+ clickCount: Annotated[int, Field(ge=1)] = 1
61
63
  """
62
64
  Number of clicks to perform
63
65
  """
64
- clickAndHold: bool | None = False
66
+ clickAndHold: bool = False
65
67
  """
66
68
  Whether to click and hold
67
69
  """
68
- holdDuration: int | None = 1000
70
+ holdDuration: int = 1000
69
71
  """
70
72
  Duration to hold click in milliseconds
71
73
  """
@@ -83,15 +85,15 @@ class InputConfig(BaseActionConfig):
83
85
  """
84
86
  Text to input
85
87
  """
86
- clearFirst: bool | None = True
88
+ clearFirst: bool = True
87
89
  """
88
90
  Clear field before typing
89
91
  """
90
- waitForElement: bool | None = True
92
+ waitForElement: bool = True
91
93
  """
92
94
  Wait for element to be present
93
95
  """
94
- scrollIntoView: bool | None = True
96
+ scrollIntoView: bool = True
95
97
  """
96
98
  Scroll element into view
97
99
  """
@@ -105,11 +107,11 @@ class NavigateConfig(BaseActionConfig):
105
107
  """
106
108
  URL to navigate to
107
109
  """
108
- waitForLoad: bool | None = True
110
+ waitForLoad: bool = True
109
111
  """
110
112
  Wait for page to load
111
113
  """
112
- takeScreenshot: bool | None = False
114
+ takeScreenshot: bool = False
113
115
  """
114
116
  Take screenshot after navigation
115
117
  """
@@ -129,31 +131,31 @@ class WaitConfig(BaseActionConfig):
129
131
  model_config = ConfigDict(
130
132
  populate_by_name=True,
131
133
  )
132
- waitType: WaitType | None = 'duration'
134
+ waitType: WaitType = WaitType.duration
133
135
  """
134
136
  Type of wait to perform
135
137
  """
136
- duration: int | None = 3000
138
+ duration: int = 3000
137
139
  """
138
140
  Duration to wait in milliseconds
139
141
  """
140
- selector: str | None = None
142
+ selector: str
141
143
  """
142
144
  CSS selector for element to wait for
143
145
  """
144
- timeout: int | None = 10000
146
+ timeout: int = 10000
145
147
  """
146
148
  Maximum time to wait in milliseconds
147
149
  """
148
- waitForInteractable: bool | None = False
150
+ waitForInteractable: bool = False
149
151
  """
150
152
  Wait for element to be interactable
151
153
  """
152
- fallbackToDuration: bool | None = True
154
+ fallbackToDuration: bool = True
153
155
  """
154
156
  Fallback to duration wait if element wait fails
155
157
  """
156
- fallbackDuration: int | None = 2000
158
+ fallbackDuration: int = 2000
157
159
  """
158
160
  Duration to wait if fallback triggered
159
161
  """
@@ -167,7 +169,7 @@ class AssertType(StrEnum):
167
169
  exists = 'exists'
168
170
  visible = 'visible'
169
171
  text = 'text'
170
- value = 'value'
172
+ value_ = 'value'
171
173
  attribute = 'attribute'
172
174
 
173
175
 
@@ -179,7 +181,7 @@ class AssertionConfig(BaseActionConfig):
179
181
  """
180
182
  CSS selector for element
181
183
  """
182
- assertType: AssertType | None = 'exists'
184
+ assertType: AssertType = AssertType.exists
183
185
  """
184
186
  Type of assertion
185
187
  """
@@ -224,7 +226,7 @@ class ScreenshotConfig(BaseActionConfig):
224
226
  model_config = ConfigDict(
225
227
  populate_by_name=True,
226
228
  )
227
- screenshotType: ScreenshotType | None = 'viewport'
229
+ screenshotType: ScreenshotType = ScreenshotType.viewport
228
230
  """
229
231
  Type of screenshot to capture
230
232
  """
@@ -244,7 +246,7 @@ class ScreenshotConfig(BaseActionConfig):
244
246
  """
245
247
  Include timestamp in filename
246
248
  """
247
- format: Format | None = 'png'
249
+ format: Format = Format.png
248
250
  """
249
251
  Output format
250
252
  """
@@ -312,7 +314,7 @@ class ApiCallConfig(BaseActionConfig):
312
314
  model_config = ConfigDict(
313
315
  populate_by_name=True,
314
316
  )
315
- method: Method | None = 'GET'
317
+ method: Method = Method.GET
316
318
  """
317
319
  HTTP method
318
320
  """
@@ -386,11 +388,11 @@ class DatabaseQueryConfig(BaseActionConfig):
386
388
  """
387
389
  Log the query being executed
388
390
  """
389
- validateConnection: bool | None = True
391
+ validateConnection: bool = True
390
392
  """
391
393
  Validate database connection
392
394
  """
393
- timeout: int | None = 30000
395
+ timeout: int = 30000
394
396
  """
395
397
  Query timeout in milliseconds
396
398
  """
@@ -416,11 +418,11 @@ class DatabaseInsertConfig(BaseActionConfig):
416
418
  """
417
419
  Log the insert operation
418
420
  """
419
- validateConnection: bool | None = True
421
+ validateConnection: bool = True
420
422
  """
421
423
  Validate database connection
422
424
  """
423
- rollbackOnError: bool | None = True
425
+ rollbackOnError: bool = True
424
426
  """
425
427
  Rollback transaction on error
426
428
  """
@@ -442,7 +444,7 @@ class FileUploadConfig(BaseActionConfig):
442
444
  """
443
445
  Wait for element to be present
444
446
  """
445
- scrollIntoView: bool | None = True
447
+ scrollIntoView: bool = True
446
448
  """
447
449
  Scroll element into view
448
450
  """
@@ -498,7 +500,7 @@ class CustomCodeConfig(BaseActionConfig):
498
500
  """
499
501
  Catch and handle errors
500
502
  """
501
- timeout: int | None = 30000
503
+ timeout: int = 30000
502
504
  """
503
505
  Execution timeout in milliseconds
504
506
  """
@@ -579,7 +581,7 @@ class ScrollConfig(BaseActionConfig):
579
581
  model_config = ConfigDict(
580
582
  populate_by_name=True,
581
583
  )
582
- direction: Direction | None = 'down'
584
+ direction: Direction = Direction.down
583
585
  """
584
586
  Scroll direction
585
587
  """
@@ -619,6 +621,14 @@ class ClearInputConfig(BaseActionConfig):
619
621
  """
620
622
  CSS selector for input element
621
623
  """
624
+ scrollIntoView: bool
625
+ """
626
+ Scroll element into view before clearing
627
+ """
628
+ maintainFocus: bool
629
+ """
630
+ Whether to keep focus on element after clearing
631
+ """
622
632
  waitForElement: bool | None = True
623
633
  """
624
634
  Wait for element to be present
@@ -643,6 +653,14 @@ class SwitchTabConfig(BaseActionConfig):
643
653
  """
644
654
  Tab index to switch to
645
655
  """
656
+ tabUrl: str | None = None
657
+ """
658
+ URL of tab to switch to (alternative to index)
659
+ """
660
+ switchMethod: str | None = 'auto'
661
+ """
662
+ Explicit switch method (auto/index/url/title)
663
+ """
646
664
  tabTitle: str | None = None
647
665
  """
648
666
  Tab title to switch to (alternative to index)
@@ -703,11 +721,11 @@ class ConditionalConfig(BaseActionConfig):
703
721
  """
704
722
  JavaScript condition to evaluate
705
723
  """
706
- operator: str | None = None
724
+ operator: str
707
725
  """
708
726
  Optional comparison operator used by editor helpers.
709
727
  """
710
- value: Any | None = None
728
+ value: Any
711
729
  """
712
730
  Optional comparison value used by editor helpers.
713
731
  """
@@ -735,15 +753,15 @@ class LoopConfig(BaseActionConfig):
735
753
  model_config = ConfigDict(
736
754
  populate_by_name=True,
737
755
  )
738
- loopType: LoopType | None = 'count'
756
+ loopType: LoopType
739
757
  """
740
758
  Type of loop
741
759
  """
742
- count: Annotated[int | None, Field(ge=1)] = None
760
+ count: Annotated[int, Field(ge=1)]
743
761
  """
744
762
  Number of iterations (for count loops)
745
763
  """
746
- condition: str | None = None
764
+ condition: str
747
765
  """
748
766
  Condition to continue loop (for condition loops)
749
767
  """
@@ -791,19 +809,35 @@ class CallToFlowConfig(BaseActionConfig):
791
809
  """
792
810
  ID of flow to call
793
811
  """
794
- inputParameters: dict[str, Any] | None = None
812
+ flowName: str | None = None
795
813
  """
796
- Input parameters to pass to subflow
814
+ Name of flow to call
797
815
  """
798
816
  outputVariable: str | None = 'flowResult'
799
817
  """
800
818
  Variable to store result
801
819
  """
802
- waitForCompletion: bool | None = True
820
+ inputParameters: list[dict[str, Any]]
821
+ """
822
+ Input parameters to pass to subflow
823
+ """
824
+ outputParameters: list[dict[str, Any]]
825
+ """
826
+ Output parameters to store result
827
+ """
828
+ propagateErrors: bool
829
+ """
830
+ Whether to propagate errors from the subflow
831
+ """
832
+ logExecution: bool
833
+ """
834
+ Whether to log execution of the subflow
835
+ """
836
+ waitForCompletion: bool
803
837
  """
804
838
  Wait for subflow to complete
805
839
  """
806
- async_: Annotated[bool | None, Field(alias='async')] = False
840
+ async_: Annotated[bool, Field(alias='async')]
807
841
  """
808
842
  Execute subflow asynchronously
809
843
  """
@@ -873,6 +907,57 @@ class SetViewportConfig(BaseActionConfig):
873
907
  """
874
908
  Viewport width in pixels
875
909
  """
910
+ viewportType: str = 'desktop'
911
+ """
912
+ Type of viewport (desktop, mobile, tablet, custom)
913
+ """
914
+ waitAfterResize: int = 1000
915
+ """
916
+ Time to wait after resizing viewport in milliseconds
917
+ """
918
+ screenSizePreset: str = '1080p'
919
+ """
920
+ Optional preset screen size (e.g. 1080p, 720p) for quick configuration
921
+ """
922
+ deviceName: str | None = None
923
+ """Optional device name (e.g. iPhone 12) for device emulation mode
924
+ """
925
+ deviceScaleFactor: int | None = None
926
+ """
927
+ Device scale factor for high DPI emulation (e.g. 3 for iPhone Plus models)
928
+ """
929
+ isMobile: bool | None = None
930
+ """
931
+ Whether to emulate mobile device (affects user agent and viewport behavior)
932
+ """
933
+ hasTouch: bool | None = None
934
+ """
935
+ Whether to emulate touch screen (enables touch events)
936
+ """
937
+ isLandscape: bool | None = None
938
+ """
939
+ Whether to set landscape orientation (swaps width and height)
940
+ """
941
+ userAgent: str | None = None
942
+ """
943
+ Custom user agent string to use in mobile emulation mode
944
+ """
945
+ preserveCookies: bool = False
946
+ """
947
+ Whether to preserve cookies when changing viewport
948
+ """
949
+ preserveLocalStorage: bool = False
950
+ """
951
+ Whether to preserve local storage when changing viewport
952
+ """
953
+ preserveSessionStorage: bool = False
954
+ """
955
+ Whether to preserve session storage when changing viewport
956
+ """
957
+ takeScreenshot: bool = False
958
+ """
959
+ Whether to take screenshot after resizing viewport
960
+ """
876
961
  height: Annotated[int, Field(ge=1)] = 1080
877
962
  """
878
963
  Viewport height in pixels
@@ -881,7 +966,7 @@ class SetViewportConfig(BaseActionConfig):
881
966
 
882
967
  class Property(StrEnum):
883
968
  text = 'text'
884
- value = 'value'
969
+ value_ = 'value'
885
970
  class_ = 'class'
886
971
  id = 'id'
887
972
  tagName = 'tagName'
@@ -930,7 +1015,7 @@ class HandlePopupConfig(BaseActionConfig):
930
1015
  model_config = ConfigDict(
931
1016
  populate_by_name=True,
932
1017
  )
933
- action: Action | None = 'accept'
1018
+ action: Action = Action.accept
934
1019
  """
935
1020
  Action to perform on popup
936
1021
  """
@@ -968,7 +1053,7 @@ class FormField(BaseModel):
968
1053
  """
969
1054
  Human-readable field name
970
1055
  """
971
- type: Type | None = 'text'
1056
+ type: Type = Type.text
972
1057
  """
973
1058
  Type of form field
974
1059
  """
@@ -980,7 +1065,7 @@ class FormField(BaseModel):
980
1065
  """
981
1066
  Whether checkbox is checked
982
1067
  """
983
- multiple: bool | None = False
1068
+ multiple: bool = False
984
1069
  """
985
1070
  Whether select allows multiple selections
986
1071
  """
@@ -994,19 +1079,19 @@ class FormFillConfig(BaseActionConfig):
994
1079
  """
995
1080
  Array of form field configurations
996
1081
  """
997
- waitForElements: bool | None = True
1082
+ waitForElements: bool = True
998
1083
  """
999
1084
  Wait for all form elements to be present
1000
1085
  """
1001
- clearFirst: bool | None = True
1086
+ clearFirst: bool = True
1002
1087
  """
1003
1088
  Clear existing values before filling
1004
1089
  """
1005
- submitAfterFill: bool | None = False
1090
+ submitAfterFill: bool = False
1006
1091
  """
1007
1092
  Automatically submit form after filling
1008
1093
  """
1009
- smartFieldDetection: bool | None = True
1094
+ smartFieldDetection: bool = True
1010
1095
  """
1011
1096
  Automatically detect field types
1012
1097
  """
@@ -179,6 +179,14 @@ class FlowParameters(BaseModel):
179
179
  """
180
180
  Input parameters
181
181
  """
182
+ parameterBefore: list[Variable]
183
+ """
184
+ Parameters to be set before execution
185
+ """
186
+ variableBefore: list[Variable]
187
+ """
188
+ Variables to be set before execution
189
+ """
182
190
  output: list[Variable]
183
191
  """
184
192
  Output parameters
@@ -223,7 +231,7 @@ class Environment(BaseModel):
223
231
  """
224
232
  Environment name
225
233
  """
226
- variables: list[EnvironmentVariable | Variable] | None = None
234
+ variables: list[EnvironmentVariable | Variable] = None
227
235
  """
228
236
  Environment variables
229
237
  """
@@ -231,10 +239,22 @@ class Environment(BaseModel):
231
239
  """
232
240
  Environment description
233
241
  """
242
+ isDefault: bool | None = None
243
+ """
244
+ Whether this is the default environment
245
+ """
234
246
  isActive: bool | None = None
235
247
  """
236
248
  Whether this environment is active
237
249
  """
250
+ createdAt: AwareDatetime | None = None
251
+ """
252
+ Creation timestamp
253
+ """
254
+ updatedAt: AwareDatetime | None = None
255
+ """
256
+ Last update timestamp
257
+ """
238
258
 
239
259
 
240
260
  class GlobalVariable(BaseModel):
@@ -315,11 +335,11 @@ class Flow(BaseModel):
315
335
  """
316
336
  Last update timestamp
317
337
  """
318
- variables: FlowVariables | None = None
338
+ variables: FlowVariables = None
319
339
  """
320
340
  Flow input and output variables
321
341
  """
322
- parameters: FlowParameters | None = None
342
+ parameters: FlowParameters = None
323
343
  """
324
344
  Flow parameters for configuration
325
345
  """
@@ -45,7 +45,7 @@ class FlowExecutionRequest(BaseModel):
45
45
  """
46
46
  Flow to execute (without environment/globalVariables)
47
47
  """
48
- mode: Mode | None = 'full'
48
+ mode: Mode = Mode.full
49
49
  """
50
50
  Execution mode
51
51
  """
@@ -53,7 +53,7 @@ class FlowExecutionRequest(BaseModel):
53
53
  """
54
54
  Recording configuration
55
55
  """
56
- metadata: dict[str, Any] | None = {}
56
+ metadata: dict[str, Any] = {}
57
57
  """
58
58
  Additional test metadata
59
59
  """
@@ -119,7 +119,7 @@ class FlowExecutionResult(BaseModel):
119
119
  """
120
120
  Error message if failed
121
121
  """
122
- metadata: dict[str, Any] | None = {}
122
+ metadata: dict[str, Any] = {}
123
123
  """
124
124
  Additional test metadata
125
125
  """
@@ -146,27 +146,35 @@ class ParallelTestsRequest(BaseModel):
146
146
  """
147
147
  List of tests to execute
148
148
  """
149
- data: dict[str, Any] | None = None
149
+ data: dict[str, Any]
150
150
  """
151
151
  Shared data containing environment and globalVariables for all tests
152
152
  """
153
- max_parallel: Annotated[int | None, Field(ge=1, le=50)] = 10
153
+ max_parallel: Annotated[int, Field(ge=1, le=50)] = 10
154
154
  """
155
155
  Maximum number of parallel executions
156
156
  """
157
- stop_on_failure: bool | None = False
157
+ stop_on_failure: bool = False
158
158
  """
159
159
  Stop all tests if one fails
160
160
  """
161
- cleanup_after: bool | None = True
161
+ cleanup_after: bool = True
162
162
  """
163
163
  Cleanup resources after execution
164
164
  """
165
- browser_mode: BrowserMode | None = 'headed'
165
+ browser_mode: BrowserMode = BrowserMode.headed
166
166
  """
167
167
  Browser mode
168
168
  """
169
- max_retries: Annotated[int | None, Field(ge=0, le=10)] = 3
169
+ incognito: bool = False
170
+ """
171
+ Whether to use incognito/private mode
172
+ """
173
+ browser: str = 'chrome'
174
+ """
175
+ Browser type (chrome, firefox, etc.)
176
+ """
177
+ max_retries: Annotated[int, Field(ge=0, le=10)] = 3
170
178
  """
171
179
  Maximum retries for transient failures
172
180
  """
@@ -148,7 +148,7 @@ class TokenRefreshConfig(BaseModel):
148
148
  """
149
149
  Token refresh endpoint URL
150
150
  """
151
- refresh_method: RefreshMethod | None = 'POST'
151
+ refresh_method: RefreshMethod = RefreshMethod.POST
152
152
  """
153
153
  HTTP method for refresh request
154
154
  """
@@ -209,7 +209,7 @@ class CredentialRotationConfig(BaseModel):
209
209
  """
210
210
  Array of credential sets
211
211
  """
212
- rotation_strategy: RotationStrategy | None = 'round_robin'
212
+ rotation_strategy: RotationStrategy = RotationStrategy.round_robin
213
213
  """
214
214
  Credential rotation strategy
215
215
  """
@@ -9,6 +9,8 @@ from typing import Any, Literal
9
9
 
10
10
  from pydantic import BaseModel, ConfigDict
11
11
 
12
+ from engine.server.ws.handlers import flow
13
+
12
14
 
13
15
  class WebSocketMessage(BaseModel):
14
16
  """
@@ -48,6 +50,10 @@ class SessionInfo(BaseModel):
48
50
  """
49
51
  Browser type
50
52
  """
53
+ flowName: str | None = None
54
+ """
55
+ Flow name
56
+ """
51
57
  startedAt: int
52
58
  """
53
59
  Start timestamp