appium-desktop-driver 1.2.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 (208) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +609 -0
  3. package/ROADMAP.md +175 -0
  4. package/build/lib/commands/actions.d.ts +12 -0
  5. package/build/lib/commands/actions.d.ts.map +1 -0
  6. package/build/lib/commands/actions.js +242 -0
  7. package/build/lib/commands/actions.js.map +1 -0
  8. package/build/lib/commands/app.d.ts +18 -0
  9. package/build/lib/commands/app.d.ts.map +1 -0
  10. package/build/lib/commands/app.js +280 -0
  11. package/build/lib/commands/app.js.map +1 -0
  12. package/build/lib/commands/device.d.ts +11 -0
  13. package/build/lib/commands/device.d.ts.map +1 -0
  14. package/build/lib/commands/device.js +236 -0
  15. package/build/lib/commands/device.js.map +1 -0
  16. package/build/lib/commands/element.d.ts +16 -0
  17. package/build/lib/commands/element.d.ts.map +1 -0
  18. package/build/lib/commands/element.js +233 -0
  19. package/build/lib/commands/element.js.map +1 -0
  20. package/build/lib/commands/extension.d.ts +124 -0
  21. package/build/lib/commands/extension.d.ts.map +1 -0
  22. package/build/lib/commands/extension.js +715 -0
  23. package/build/lib/commands/extension.js.map +1 -0
  24. package/build/lib/commands/functions.d.ts +3 -0
  25. package/build/lib/commands/functions.d.ts.map +1 -0
  26. package/build/lib/commands/functions.js +194 -0
  27. package/build/lib/commands/functions.js.map +1 -0
  28. package/build/lib/commands/index.d.ts +178 -0
  29. package/build/lib/commands/index.d.ts.map +1 -0
  30. package/build/lib/commands/index.js +54 -0
  31. package/build/lib/commands/index.js.map +1 -0
  32. package/build/lib/commands/powershell.d.ts +6 -0
  33. package/build/lib/commands/powershell.d.ts.map +1 -0
  34. package/build/lib/commands/powershell.js +202 -0
  35. package/build/lib/commands/powershell.js.map +1 -0
  36. package/build/lib/commands/screen-recorder.d.ts +40 -0
  37. package/build/lib/commands/screen-recorder.d.ts.map +1 -0
  38. package/build/lib/commands/screen-recorder.js +183 -0
  39. package/build/lib/commands/screen-recorder.js.map +1 -0
  40. package/build/lib/commands/system.d.ts +4 -0
  41. package/build/lib/commands/system.d.ts.map +1 -0
  42. package/build/lib/commands/system.js +8 -0
  43. package/build/lib/commands/system.js.map +1 -0
  44. package/build/lib/constants.d.ts +3 -0
  45. package/build/lib/constants.d.ts.map +1 -0
  46. package/build/lib/constants.js +6 -0
  47. package/build/lib/constants.js.map +1 -0
  48. package/build/lib/constraints.d.ts +58 -0
  49. package/build/lib/constraints.d.ts.map +1 -0
  50. package/build/lib/constraints.js +60 -0
  51. package/build/lib/constraints.js.map +1 -0
  52. package/build/lib/driver.d.ts +36 -0
  53. package/build/lib/driver.d.ts.map +1 -0
  54. package/build/lib/driver.js +209 -0
  55. package/build/lib/driver.js.map +1 -0
  56. package/build/lib/enums.d.ts +89 -0
  57. package/build/lib/enums.d.ts.map +1 -0
  58. package/build/lib/enums.js +83 -0
  59. package/build/lib/enums.js.map +1 -0
  60. package/build/lib/mcp/appium-manager.d.ts +8 -0
  61. package/build/lib/mcp/appium-manager.d.ts.map +1 -0
  62. package/build/lib/mcp/appium-manager.js +160 -0
  63. package/build/lib/mcp/appium-manager.js.map +1 -0
  64. package/build/lib/mcp/config.d.ts +7 -0
  65. package/build/lib/mcp/config.d.ts.map +1 -0
  66. package/build/lib/mcp/config.js +14 -0
  67. package/build/lib/mcp/config.js.map +1 -0
  68. package/build/lib/mcp/constants.d.ts +3 -0
  69. package/build/lib/mcp/constants.d.ts.map +1 -0
  70. package/build/lib/mcp/constants.js +6 -0
  71. package/build/lib/mcp/constants.js.map +1 -0
  72. package/build/lib/mcp/errors.d.ts +2 -0
  73. package/build/lib/mcp/errors.d.ts.map +1 -0
  74. package/build/lib/mcp/errors.js +10 -0
  75. package/build/lib/mcp/errors.js.map +1 -0
  76. package/build/lib/mcp/index.d.ts +3 -0
  77. package/build/lib/mcp/index.d.ts.map +1 -0
  78. package/build/lib/mcp/index.js +113 -0
  79. package/build/lib/mcp/index.js.map +1 -0
  80. package/build/lib/mcp/session.d.ts +24 -0
  81. package/build/lib/mcp/session.d.ts.map +1 -0
  82. package/build/lib/mcp/session.js +77 -0
  83. package/build/lib/mcp/session.js.map +1 -0
  84. package/build/lib/mcp/tools/advanced.d.ts +4 -0
  85. package/build/lib/mcp/tools/advanced.d.ts.map +1 -0
  86. package/build/lib/mcp/tools/advanced.js +119 -0
  87. package/build/lib/mcp/tools/advanced.js.map +1 -0
  88. package/build/lib/mcp/tools/app.d.ts +4 -0
  89. package/build/lib/mcp/tools/app.d.ts.map +1 -0
  90. package/build/lib/mcp/tools/app.js +64 -0
  91. package/build/lib/mcp/tools/app.js.map +1 -0
  92. package/build/lib/mcp/tools/clipboard.d.ts +4 -0
  93. package/build/lib/mcp/tools/clipboard.d.ts.map +1 -0
  94. package/build/lib/mcp/tools/clipboard.js +41 -0
  95. package/build/lib/mcp/tools/clipboard.js.map +1 -0
  96. package/build/lib/mcp/tools/find.d.ts +4 -0
  97. package/build/lib/mcp/tools/find.d.ts.map +1 -0
  98. package/build/lib/mcp/tools/find.js +119 -0
  99. package/build/lib/mcp/tools/find.js.map +1 -0
  100. package/build/lib/mcp/tools/index.d.ts +4 -0
  101. package/build/lib/mcp/tools/index.d.ts.map +1 -0
  102. package/build/lib/mcp/tools/index.js +24 -0
  103. package/build/lib/mcp/tools/index.js.map +1 -0
  104. package/build/lib/mcp/tools/inspect.d.ts +4 -0
  105. package/build/lib/mcp/tools/inspect.d.ts.map +1 -0
  106. package/build/lib/mcp/tools/inspect.js +106 -0
  107. package/build/lib/mcp/tools/inspect.js.map +1 -0
  108. package/build/lib/mcp/tools/interact.d.ts +4 -0
  109. package/build/lib/mcp/tools/interact.d.ts.map +1 -0
  110. package/build/lib/mcp/tools/interact.js +121 -0
  111. package/build/lib/mcp/tools/interact.js.map +1 -0
  112. package/build/lib/mcp/tools/patterns.d.ts +4 -0
  113. package/build/lib/mcp/tools/patterns.d.ts.map +1 -0
  114. package/build/lib/mcp/tools/patterns.js +136 -0
  115. package/build/lib/mcp/tools/patterns.js.map +1 -0
  116. package/build/lib/mcp/tools/session.d.ts +4 -0
  117. package/build/lib/mcp/tools/session.d.ts.map +1 -0
  118. package/build/lib/mcp/tools/session.js +55 -0
  119. package/build/lib/mcp/tools/session.js.map +1 -0
  120. package/build/lib/mcp/tools/window.d.ts +4 -0
  121. package/build/lib/mcp/tools/window.d.ts.map +1 -0
  122. package/build/lib/mcp/tools/window.js +134 -0
  123. package/build/lib/mcp/tools/window.js.map +1 -0
  124. package/build/lib/powershell/common.d.ts +39 -0
  125. package/build/lib/powershell/common.d.ts.map +1 -0
  126. package/build/lib/powershell/common.js +121 -0
  127. package/build/lib/powershell/common.js.map +1 -0
  128. package/build/lib/powershell/conditions.d.ts +24 -0
  129. package/build/lib/powershell/conditions.d.ts.map +1 -0
  130. package/build/lib/powershell/conditions.js +131 -0
  131. package/build/lib/powershell/conditions.js.map +1 -0
  132. package/build/lib/powershell/converter.d.ts +3 -0
  133. package/build/lib/powershell/converter.d.ts.map +1 -0
  134. package/build/lib/powershell/converter.js +273 -0
  135. package/build/lib/powershell/converter.js.map +1 -0
  136. package/build/lib/powershell/core.d.ts +8 -0
  137. package/build/lib/powershell/core.d.ts.map +1 -0
  138. package/build/lib/powershell/core.js +30 -0
  139. package/build/lib/powershell/core.js.map +1 -0
  140. package/build/lib/powershell/elements.d.ts +70 -0
  141. package/build/lib/powershell/elements.d.ts.map +1 -0
  142. package/build/lib/powershell/elements.js +523 -0
  143. package/build/lib/powershell/elements.js.map +1 -0
  144. package/build/lib/powershell/index.d.ts +8 -0
  145. package/build/lib/powershell/index.d.ts.map +1 -0
  146. package/build/lib/powershell/index.js +24 -0
  147. package/build/lib/powershell/index.js.map +1 -0
  148. package/build/lib/powershell/regex.d.ts +19 -0
  149. package/build/lib/powershell/regex.d.ts.map +1 -0
  150. package/build/lib/powershell/regex.js +68 -0
  151. package/build/lib/powershell/regex.js.map +1 -0
  152. package/build/lib/powershell/types.d.ts +155 -0
  153. package/build/lib/powershell/types.d.ts.map +1 -0
  154. package/build/lib/powershell/types.js +141 -0
  155. package/build/lib/powershell/types.js.map +1 -0
  156. package/build/lib/util.d.ts +17 -0
  157. package/build/lib/util.d.ts.map +1 -0
  158. package/build/lib/util.js +76 -0
  159. package/build/lib/util.js.map +1 -0
  160. package/build/lib/winapi/types/index.d.ts +8 -0
  161. package/build/lib/winapi/types/index.d.ts.map +1 -0
  162. package/build/lib/winapi/types/index.js +24 -0
  163. package/build/lib/winapi/types/index.js.map +1 -0
  164. package/build/lib/winapi/types/input.d.ts +11 -0
  165. package/build/lib/winapi/types/input.d.ts.map +1 -0
  166. package/build/lib/winapi/types/input.js +12 -0
  167. package/build/lib/winapi/types/input.js.map +1 -0
  168. package/build/lib/winapi/types/keyeventf.d.ts +13 -0
  169. package/build/lib/winapi/types/keyeventf.d.ts.map +1 -0
  170. package/build/lib/winapi/types/keyeventf.js +14 -0
  171. package/build/lib/winapi/types/keyeventf.js.map +1 -0
  172. package/build/lib/winapi/types/mouseeventf.d.ts +34 -0
  173. package/build/lib/winapi/types/mouseeventf.d.ts.map +1 -0
  174. package/build/lib/winapi/types/mouseeventf.js +37 -0
  175. package/build/lib/winapi/types/mouseeventf.js.map +1 -0
  176. package/build/lib/winapi/types/scancode.d.ts +95 -0
  177. package/build/lib/winapi/types/scancode.d.ts.map +1 -0
  178. package/build/lib/winapi/types/scancode.js +96 -0
  179. package/build/lib/winapi/types/scancode.js.map +1 -0
  180. package/build/lib/winapi/types/systemmetric.d.ts +214 -0
  181. package/build/lib/winapi/types/systemmetric.d.ts.map +1 -0
  182. package/build/lib/winapi/types/systemmetric.js +215 -0
  183. package/build/lib/winapi/types/systemmetric.js.map +1 -0
  184. package/build/lib/winapi/types/virtualkey.d.ts +353 -0
  185. package/build/lib/winapi/types/virtualkey.d.ts.map +1 -0
  186. package/build/lib/winapi/types/virtualkey.js +354 -0
  187. package/build/lib/winapi/types/virtualkey.js.map +1 -0
  188. package/build/lib/winapi/types/xmousebutton.d.ts +7 -0
  189. package/build/lib/winapi/types/xmousebutton.d.ts.map +1 -0
  190. package/build/lib/winapi/types/xmousebutton.js +8 -0
  191. package/build/lib/winapi/types/xmousebutton.js.map +1 -0
  192. package/build/lib/winapi/user32.d.ts +56 -0
  193. package/build/lib/winapi/user32.d.ts.map +1 -0
  194. package/build/lib/winapi/user32.js +592 -0
  195. package/build/lib/winapi/user32.js.map +1 -0
  196. package/build/lib/xpath/core.d.ts +8 -0
  197. package/build/lib/xpath/core.d.ts.map +1 -0
  198. package/build/lib/xpath/core.js +593 -0
  199. package/build/lib/xpath/core.js.map +1 -0
  200. package/build/lib/xpath/functions.d.ts +4 -0
  201. package/build/lib/xpath/functions.d.ts.map +1 -0
  202. package/build/lib/xpath/functions.js +271 -0
  203. package/build/lib/xpath/functions.js.map +1 -0
  204. package/build/lib/xpath/index.d.ts +3 -0
  205. package/build/lib/xpath/index.d.ts.map +1 -0
  206. package/build/lib/xpath/index.js +19 -0
  207. package/build/lib/xpath/index.js.map +1 -0
  208. package/package.json +71 -0
@@ -0,0 +1,523 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FoundAutomationElement = exports.AutomationElementGroup = exports.AutomationElement = exports.AutomationElementMode = exports.TreeScope = void 0;
4
+ const core_1 = require("./core");
5
+ const common_1 = require("./common");
6
+ // TODO: Move the methods to a separate file, some of them are too complicated and are not easy to maintain
7
+ const FIND_ALL_ANCESTOR = (0, core_1.pwsh$ /* ps1 */) `
8
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
9
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
10
+
11
+ ${0} | ForEach-Object {
12
+ $el = $_
13
+ while ($null -ne ($parent = $treeWalker.GetParent($el))) {
14
+ $el = $parent
15
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
16
+
17
+ if ($null -ne $validEl) {
18
+ $els.Add($validEl)
19
+ }
20
+ }
21
+ }
22
+
23
+ Write-Output $els
24
+ `;
25
+ const FIND_FIRST_ANCESTOR = (0, core_1.pwsh$ /* ps1 */) `
26
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
27
+
28
+ ${0} | ForEach-Object {
29
+ $el = $_
30
+ while ($null -ne ($parent = $treeWalker.GetParent($el))) {
31
+ $el = $parent
32
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
33
+
34
+ if ($null -ne $validEl) {
35
+ Write-Output $el
36
+ break
37
+ }
38
+ }
39
+ }
40
+ `;
41
+ const FIND_ALL_ANCESTOR_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
42
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
43
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
44
+
45
+ ${0} | ForEach-Object {
46
+ $el = $_
47
+ while ($null -ne $el) {
48
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
49
+
50
+ if ($null -ne $validEl) {
51
+ $els.Add($validEl)
52
+ }
53
+
54
+ $el = $treeWalker.GetParent($el)
55
+ }
56
+ }
57
+
58
+ Write-Output $els
59
+ `;
60
+ const FIND_FIRST_ANCESTOR_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
61
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
62
+
63
+ ${0} | ForEach-Object {
64
+ $el = $_
65
+ while ($null -ne $el) {
66
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
67
+
68
+ if ($null -ne $validEl) {
69
+ Write-Output $el
70
+ break
71
+ }
72
+
73
+ $el = $treeWalker.GetParent($el)
74
+ }
75
+ }
76
+ `;
77
+ const FIND_PARENT = (0, core_1.pwsh$ /* ps1 */) `
78
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
79
+
80
+ ${0} | ForEach-Object {
81
+ $el = $_
82
+ $el = $treeWalker.GetParent($el).FindFirst([TreeScope]::Element, ${1})
83
+ Write-Output $el
84
+ }
85
+ `;
86
+ const FIND_FOLLOWING = (0, core_1.pwsh$ /* ps1 */) `
87
+ $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
88
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
89
+
90
+ ${0} | ForEach-Object {
91
+ $el = $_
92
+ while ($null -ne $el) {
93
+ if ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
94
+ $el = $nextSibling
95
+
96
+ Write-Output $el
97
+ break
98
+ }
99
+
100
+ $el = $treeWalker.GetParent($el)
101
+ }
102
+ }
103
+ `;
104
+ const FIND_ALL_FOLLOWING = (0, core_1.pwsh$ /* ps1 */) `
105
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
106
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
107
+
108
+ ${0} | ForEach-Object {
109
+ $el = $_
110
+ while ($null -ne $el) {
111
+ if ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
112
+ $el = $nextSibling
113
+ $els.Add($el)
114
+ $els.AddRange($el.FindAll([TreeScope]::Children, ${1}))
115
+ }
116
+
117
+ $el = $treeWalker.GetParent($el)
118
+ }
119
+ }
120
+
121
+ Write-Output $els
122
+ `;
123
+ const FIND_FOLLOWING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
124
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
125
+
126
+ ${0} | ForEach-Object {
127
+ $el = $_
128
+ while ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
129
+ $el = $nextSibling
130
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
131
+
132
+ if ($null -ne $validEl) {
133
+ Write-Output $el
134
+ break
135
+ }
136
+ }
137
+ }
138
+ `;
139
+ const FIND_ALL_FOLLOWING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
140
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
141
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
142
+
143
+ ${0} | ForEach-Object {
144
+ $el = $_
145
+ while ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
146
+ $el = $nextSibling
147
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
148
+
149
+ if ($null -ne $validEl) {
150
+ $els.Add($validEl)
151
+ }
152
+ }
153
+ }
154
+
155
+ Write-Output $els
156
+ `;
157
+ const FIND_PRECEDING = (0, core_1.pwsh$ /* ps1 */) `
158
+ $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
159
+
160
+ ${0} | ForEach-Object {
161
+ $el = $_
162
+ while ($null -ne $el) {
163
+ if ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
164
+ $el = $previousSibling
165
+
166
+ Write-Output $el
167
+ break
168
+ }
169
+
170
+ $el = $treeWalker.GetParent($el)
171
+ }
172
+ }
173
+ `;
174
+ const FIND_ALL_PRECEDING = (0, core_1.pwsh$ /* ps1 */) `
175
+ $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
176
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
177
+
178
+ ${0} | ForEach-Object {
179
+ $el = $_
180
+ while ($null -ne $el) {
181
+ if ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
182
+ $el = $previousSibling
183
+ $els.Add($el)
184
+ $els.AddRange($el.FindAll([TreeScope]::Children, ${1}))
185
+ }
186
+
187
+ $el = $treeWalker.GetParent($el)
188
+ }
189
+ }
190
+
191
+ Write-Output $els
192
+ `;
193
+ const FIND_PRECEDING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
194
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
195
+
196
+ ${0} | ForEach-Object {
197
+ $el = $_
198
+ while ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
199
+ $el = $previousSibling
200
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
201
+
202
+ if ($null -ne $validEl) {
203
+ Write-Output $el
204
+ break
205
+ }
206
+ }
207
+ }
208
+ `;
209
+ const FIND_ALL_PRECEDING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
210
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
211
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
212
+
213
+ ${0} | ForEach-Object {
214
+ $el = $_
215
+ while ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
216
+ $el = $previousSibling
217
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
218
+
219
+ if ($null -ne $validEl) {
220
+ $els.Add($validEl)
221
+ }
222
+ }
223
+ }
224
+
225
+ Write-Output $els
226
+ `;
227
+ const FIND_CHILDREN_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
228
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
229
+
230
+ ${0} | ForEach-Object {
231
+ $el = $_
232
+ $validEl = $el.FindFirst([TreeScope]::Element -bor [TreeScope]::Children, ${1});
233
+
234
+ if ($null -ne $validEl) {
235
+ $els.Add($validEl)
236
+ }
237
+ }
238
+
239
+ Write-Output $els
240
+ `;
241
+ const FIND_ALL_CHILDREN_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
242
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
243
+
244
+ ${0} | ForEach-Object {
245
+ $el = $_
246
+ $validEl = $el.FindAll([TreeScope]::Element -bor [TreeScope]::Children, ${1});
247
+
248
+ if ($null -ne $validEl) {
249
+ $els.Add($validEl)
250
+ }
251
+ }
252
+
253
+ Write-Output $els
254
+ `;
255
+ const FIND_DESCENDANTS = (0, core_1.pwsh$ /* ps1 */) `Find-ChildrenRecursively -element (${0}) -condition (${1})`;
256
+ const FIND_ALL_DESCENDANTS = (0, core_1.pwsh$ /* ps1 */) `Find-AllChildrenRecursively -element (${0}) -condition (${1})`;
257
+ const FIND_DESCENDANTS_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `Find-ChildrenRecursively -element (${0}) -condition (${1}) -includeSelf $true`;
258
+ const FIND_ALL_DESCENDANTS_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `Find-AllChildrenRecursively -element (${0}) -condition (${1}) -includeSelf $true`;
259
+ const FIND_FIRST = (0, core_1.pwsh$ /* ps1 */) `${0}.FindFirst([TreeScope]::${1}, ${2})`;
260
+ const FIND_ALL = (0, core_1.pwsh$ /* ps1 */) `${0}.FindAll([TreeScope]::${1}, ${2})`;
261
+ const AUTOMATION_ROOT = /* ps1 */ `$rootElement`;
262
+ const FOCUSED_ELEMENT = /* ps1 */ `[AutomationElement]::FocusedElement`;
263
+ const ROOT_ELEMENT = /* ps1 */ `[AutomationElement]::RootElement`;
264
+ const SAVE_TO_ELEMENT_TABLE_AND_RETURN_ID = (0, core_1.pwsh$ /* ps1 */) `
265
+ ${0} | Where-Object { $null -ne $_ } | ForEach-Object {
266
+ $runtimeId = $_.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.';
267
+
268
+ if (-not $elementTable.ContainsKey($runtimeId)) {
269
+ $elementTable.Add($runtimeId, $_)
270
+ };
271
+
272
+ $runtimeId
273
+ }
274
+ `;
275
+ const ELEMENT_TABLE_GET = (0, core_1.pwsh$ /* ps1 */) `$elementTable['${0}']`;
276
+ // TODO: maybe encode the result first? Some properties may be on multiple lines, it may cause a problem when returning multiple element results at once
277
+ const GET_ELEMENT_PROPERTY = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPropertyValue([AutomationElement]::${1}Property)`;
278
+ const GET_ELEMENT_RUNTIME_ID = (0, core_1.pwsh$ /* ps1 */) `
279
+ ${0} | ForEach-Object {
280
+ $_.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.'
281
+ }
282
+ `;
283
+ const GET_ELEMENT_RECT = (0, core_1.pwsh$ /* ps1 */) `
284
+ ${0}.Current.BoundingRectangle |
285
+ Select-Object X, Y, Width, Height |
286
+ ForEach-Object { $_ | ConvertTo-Json -Compress } |
287
+ ForEach-Object { if ($null -ne $_) { $_.ToLower() } }
288
+ `;
289
+ const GET_ELEMENT_TAG_NAME = (0, core_1.pwsh$ /* ps1 */) `
290
+ ${0}.Current.ControlType.ProgrammaticName |
291
+ ForEach-Object { $_.Split('.')[-1] }
292
+ `;
293
+ const SET_FOCUS_TO_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.SetFocus()`;
294
+ const GET_ELEMENT_TEXT = (0, core_1.pwsh$ /* ps1 */) `
295
+ try {
296
+ ${0}.GetCurrentPattern([TextPattern]::Pattern).DocumentRange.GetText(-1)
297
+ } catch {
298
+ try {
299
+ ${0}.GetCurrentPattern([SelectionPattern]::Pattern).Current.GetSelection().Current.Name
300
+ } catch {
301
+ ${0}.Current.Name
302
+ }
303
+ }
304
+ `;
305
+ const INVOKE_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([InvokePattern]::Pattern).Invoke()`;
306
+ const EXPAND_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([ExpandCollapsePattern]::Pattern).Expand()`;
307
+ const COLLAPSE_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([ExpandCollapsePattern]::Pattern).Collapse()`;
308
+ const SCROLL_ELEMENT_INTO_VIEW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([ScrollItemPattern]::Pattern).ScrollIntoView()`;
309
+ const IS_MULTIPLE_SELECT_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([SelectionPattern]::Pattern).Current.CanSelectMultiple`;
310
+ const GET_SELECTED_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([SelectionPattern]::Pattern).Current.GetSelection()`;
311
+ const IS_ELEMENT_SELECTED = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([SelectionItemPattern]::Pattern).Current.IsSelected`;
312
+ const ADD_ELEMENT_TO_SELECTION = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([SelectionItemPattern]::Pattern).AddToSelection()`;
313
+ const REMOVE_ELEMENT_FROM_SELECTION = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([SelectionItemPattern]::Pattern).RemoveFromSelection()`;
314
+ const SELECT_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([SelectionItemPattern]::Pattern).Select()`;
315
+ const TOGGLE_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([TogglePattern]::Pattern).Toggle()`;
316
+ const SET_ELEMENT_VALUE = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([ValuePattern]::Pattern).SetValue(${1})`;
317
+ const SET_ELEMENT_RANGE_VALUE = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([RangeValuePattern]::Pattern).SetValue(${1})`;
318
+ const GET_ELEMENT_VALUE = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([ValuePattern]::Pattern).Current.Value`;
319
+ const GET_ELEMENT_TOGGLE_STATE = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([TogglePattern]::Pattern).Current.ToggleState`;
320
+ const MAXIMIZE_WINDOW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([WindowPattern]::Pattern).SetWindowVisualState([WindowVisualState]::Maximized)`;
321
+ const MINIMIZE_WINDOW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([WindowPattern]::Pattern).SetWindowVisualState([WindowVisualState]::Minimized)`;
322
+ const RESTORE_WINDOW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([WindowPattern]::Pattern).SetWindowVisualState([WindowVisualState]::Normal)`;
323
+ const CLOSE_WINDOW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([WindowPattern]::Pattern).Close()`;
324
+ const MOVE_WINDOW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([TransformPattern]::Pattern).Move(${1}, ${2})`;
325
+ const RESIZE_WINDOW = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([TransformPattern]::Pattern).Resize(${1}, ${2})`;
326
+ exports.TreeScope = Object.freeze({
327
+ ANCESTORS_OR_SELF: 'ancestors-or-self',
328
+ FOLLOWING: 'following',
329
+ FOLLOWING_SIBLING: 'following-sibling',
330
+ PRECEDING: 'preceding',
331
+ PRECEDING_SIBLING: 'preceding-sibling',
332
+ ANCESTORS: 'ancestors',
333
+ CHILDREN_OR_SELF: 'child-or-self',
334
+ CHILDREN: 'children',
335
+ DESCENDANTS: 'descendants',
336
+ ELEMENT: 'element',
337
+ SUBTREE: 'subtree',
338
+ PARENT: 'parent',
339
+ });
340
+ exports.AutomationElementMode = Object.freeze({
341
+ NONE: 'none',
342
+ FULL: 'full',
343
+ });
344
+ class AutomationElement extends core_1.PSObject {
345
+ constructor(command) {
346
+ super(command);
347
+ }
348
+ static get automationRoot() {
349
+ return new AutomationElement(AUTOMATION_ROOT);
350
+ }
351
+ static get rootElement() {
352
+ return new AutomationElement(ROOT_ELEMENT);
353
+ }
354
+ static get focusedElement() {
355
+ return new AutomationElement(FOCUSED_ELEMENT);
356
+ }
357
+ findFirst(scope, condition) {
358
+ switch (scope) {
359
+ case exports.TreeScope.ANCESTORS_OR_SELF:
360
+ return new AutomationElement(FIND_FIRST_ANCESTOR_OR_SELF.format(this, condition));
361
+ case exports.TreeScope.ANCESTORS:
362
+ return new AutomationElement(FIND_FIRST_ANCESTOR.format(this, condition));
363
+ case exports.TreeScope.PARENT:
364
+ return new AutomationElement(FIND_PARENT.format(this, condition));
365
+ case exports.TreeScope.FOLLOWING:
366
+ return new AutomationElement(FIND_FOLLOWING.format(this, condition));
367
+ case exports.TreeScope.FOLLOWING_SIBLING:
368
+ return new AutomationElement(FIND_FOLLOWING_SIBLING.format(this, condition));
369
+ case exports.TreeScope.PRECEDING:
370
+ return new AutomationElement(FIND_PRECEDING.format(this, condition));
371
+ case exports.TreeScope.PRECEDING_SIBLING:
372
+ return new AutomationElement(FIND_PRECEDING_SIBLING.format(this, condition));
373
+ case exports.TreeScope.CHILDREN_OR_SELF:
374
+ return new AutomationElement(FIND_CHILDREN_OR_SELF.format(this, condition));
375
+ case exports.TreeScope.DESCENDANTS:
376
+ return new AutomationElement(FIND_DESCENDANTS.format(this, condition));
377
+ case exports.TreeScope.SUBTREE:
378
+ return new AutomationElement(FIND_DESCENDANTS_OR_SELF.format(this, condition));
379
+ default:
380
+ return new AutomationElement(FIND_FIRST.format(this, scope, condition));
381
+ }
382
+ }
383
+ findAll(scope, condition) {
384
+ switch (scope) {
385
+ case exports.TreeScope.ANCESTORS_OR_SELF:
386
+ return new AutomationElement(FIND_ALL_ANCESTOR_OR_SELF.format(this, condition));
387
+ case exports.TreeScope.ANCESTORS:
388
+ return new AutomationElement(FIND_ALL_ANCESTOR.format(this, condition));
389
+ case exports.TreeScope.PARENT:
390
+ return new AutomationElement(FIND_PARENT.format(this, condition));
391
+ case exports.TreeScope.FOLLOWING:
392
+ return new AutomationElement(FIND_ALL_FOLLOWING.format(this, condition));
393
+ case exports.TreeScope.FOLLOWING_SIBLING:
394
+ return new AutomationElement(FIND_ALL_FOLLOWING_SIBLING.format(this, condition));
395
+ case exports.TreeScope.PRECEDING:
396
+ return new AutomationElement(FIND_ALL_PRECEDING.format(this, condition));
397
+ case exports.TreeScope.PRECEDING_SIBLING:
398
+ return new AutomationElement(FIND_ALL_PRECEDING_SIBLING.format(this, condition));
399
+ case exports.TreeScope.CHILDREN_OR_SELF:
400
+ return new AutomationElement(FIND_ALL_CHILDREN_OR_SELF.format(this, condition));
401
+ case exports.TreeScope.DESCENDANTS:
402
+ return new AutomationElement(FIND_ALL_DESCENDANTS.format(this, condition));
403
+ case exports.TreeScope.SUBTREE:
404
+ return new AutomationElement(FIND_ALL_DESCENDANTS_OR_SELF.format(this, condition));
405
+ default:
406
+ return new AutomationElement(FIND_ALL.format(this, scope, condition));
407
+ }
408
+ }
409
+ buildGetTagNameCommand() {
410
+ return GET_ELEMENT_TAG_NAME.format(this);
411
+ }
412
+ buildGetPropertyCommand(property) {
413
+ if (property.toLowerCase() === 'runtimeid') {
414
+ return GET_ELEMENT_RUNTIME_ID.format(this);
415
+ }
416
+ if (property.toLowerCase() === 'controltype') {
417
+ return GET_ELEMENT_TAG_NAME.format(this);
418
+ }
419
+ return GET_ELEMENT_PROPERTY.format(this, property);
420
+ }
421
+ buildGetElementRectCommand() {
422
+ return GET_ELEMENT_RECT.format(this);
423
+ }
424
+ buildSetFocusCommand() {
425
+ return SET_FOCUS_TO_ELEMENT.format(this);
426
+ }
427
+ buildCommand() {
428
+ return SAVE_TO_ELEMENT_TABLE_AND_RETURN_ID.format(this);
429
+ }
430
+ }
431
+ exports.AutomationElement = AutomationElement;
432
+ class AutomationElementGroup extends AutomationElement {
433
+ groups;
434
+ constructor(...automationElements) {
435
+ super(`@( ${automationElements.map((el) => `(${el.buildCommand()})`).join(', ')} )`);
436
+ this.groups = automationElements;
437
+ }
438
+ findAllGroups(scope, condition) {
439
+ return this.groups.map((el) => el.findAll(scope, condition));
440
+ }
441
+ findFirstGroups(scope, condition) {
442
+ return this.groups.map((el) => el.findFirst(scope, condition));
443
+ }
444
+ }
445
+ exports.AutomationElementGroup = AutomationElementGroup;
446
+ class FoundAutomationElement extends AutomationElement {
447
+ runtimeId;
448
+ constructor(runtimeId) {
449
+ super(ELEMENT_TABLE_GET.format(runtimeId));
450
+ this.runtimeId = runtimeId;
451
+ }
452
+ buildGetTextCommand() {
453
+ return GET_ELEMENT_TEXT.format(this);
454
+ }
455
+ buildInvokeCommand() {
456
+ return INVOKE_ELEMENT.format(this);
457
+ }
458
+ buildExpandCommand() {
459
+ return EXPAND_ELEMENT.format(this);
460
+ }
461
+ buildCollapseCommand() {
462
+ return COLLAPSE_ELEMENT.format(this);
463
+ }
464
+ buildScrollIntoViewCommand() {
465
+ return SCROLL_ELEMENT_INTO_VIEW.format(this);
466
+ }
467
+ buildIsMultipleSelectCommand() {
468
+ return IS_MULTIPLE_SELECT_ELEMENT.format(this);
469
+ }
470
+ buildGetSelectionCommand() {
471
+ return SAVE_TO_ELEMENT_TABLE_AND_RETURN_ID.format(GET_SELECTED_ELEMENT.format(this));
472
+ }
473
+ buildIsSelectedCommand() {
474
+ return IS_ELEMENT_SELECTED.format(this);
475
+ }
476
+ buildAddToSelectionCommand() {
477
+ return ADD_ELEMENT_TO_SELECTION.format(this);
478
+ }
479
+ buildRemoveFromSelectionCommand() {
480
+ return REMOVE_ELEMENT_FROM_SELECTION.format(this);
481
+ }
482
+ buildSelectCommand() {
483
+ return SELECT_ELEMENT.format(this);
484
+ }
485
+ buildToggleCommand() {
486
+ return TOGGLE_ELEMENT.format(this);
487
+ }
488
+ buildSetValueCommand(value) {
489
+ return SET_ELEMENT_VALUE.format(this, new common_1.PSString(value).toString());
490
+ }
491
+ buildSetRangeValueCommand(value) {
492
+ return SET_ELEMENT_RANGE_VALUE.format(this, Number(value).toString());
493
+ }
494
+ buildGetValueCommand() {
495
+ return GET_ELEMENT_VALUE.format(this);
496
+ }
497
+ buildGetToggleStateCommand() {
498
+ return GET_ELEMENT_TOGGLE_STATE.format(this);
499
+ }
500
+ buildMaximizeCommand() {
501
+ return MAXIMIZE_WINDOW.format(this);
502
+ }
503
+ buildMinimizeCommand() {
504
+ return MINIMIZE_WINDOW.format(this);
505
+ }
506
+ buildRestoreCommand() {
507
+ return RESTORE_WINDOW.format(this);
508
+ }
509
+ buildCloseCommand() {
510
+ return CLOSE_WINDOW.format(this);
511
+ }
512
+ buildMoveCommand(x, y) {
513
+ return MOVE_WINDOW.format(this, x, y);
514
+ }
515
+ buildResizeCommand(width, height) {
516
+ return RESIZE_WINDOW.format(this, width, height);
517
+ }
518
+ buildCommand() {
519
+ return this.toString();
520
+ }
521
+ }
522
+ exports.FoundAutomationElement = FoundAutomationElement;
523
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sourceRoot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gB,CAAC,CAAS,EAAE,CAAS;QACjC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,kBAAkB,CAAC,KAAa,EAAE,MAAc;QAC5C,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAEQ,YAAY;QACjB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;CACJ;AAnGD,wDAmGC"}
@@ -0,0 +1,8 @@
1
+ export * from './core';
2
+ export * from './common';
3
+ export * from './conditions';
4
+ export * from './elements';
5
+ export * from './converter';
6
+ export * from './regex';
7
+ export * from './types';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/powershell/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./core"), exports);
18
+ __exportStar(require("./common"), exports);
19
+ __exportStar(require("./conditions"), exports);
20
+ __exportStar(require("./elements"), exports);
21
+ __exportStar(require("./converter"), exports);
22
+ __exportStar(require("./regex"), exports);
23
+ __exportStar(require("./types"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/powershell/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAwB"}
@@ -0,0 +1,19 @@
1
+ export declare class RegexItem {
2
+ private value;
3
+ constructor(value: string);
4
+ build(): string;
5
+ toRegex(flags?: string): RegExp;
6
+ }
7
+ export declare class VarArgsRegexMatcher extends RegexItem {
8
+ constructor(value: RegexItem);
9
+ }
10
+ export declare class ConstructorRegexMatcher extends RegexItem {
11
+ constructor(fullyQualifiedName: string, ...params: RegexItem[]);
12
+ }
13
+ export declare class PropertyRegexMatcher extends RegexItem {
14
+ constructor(namespace: string, ...properties: string[]);
15
+ }
16
+ export declare class StringRegexMatcher extends RegexItem {
17
+ constructor();
18
+ }
19
+ //# sourceMappingURL=regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../lib/powershell/regex.ts"],"names":[],"mappings":"AAKA,qBAAa,SAAS;IAClB,OAAO,CAAC,KAAK,CAAS;gBAEV,KAAK,EAAE,MAAM;IAIzB,KAAK,IAAI,MAAM;IAQf,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;CAGlC;AAED,qBAAa,mBAAoB,SAAQ,SAAS;gBAClC,KAAK,EAAE,SAAS;CAG/B;AAED,qBAAa,uBAAwB,SAAQ,SAAS;gBACtC,kBAAkB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE;CAiBjE;AAED,qBAAa,oBAAqB,SAAQ,SAAS;gBACnC,SAAS,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE;CAYzD;AAED,qBAAa,kBAAmB,SAAQ,SAAS;;CAIhD"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StringRegexMatcher = exports.PropertyRegexMatcher = exports.ConstructorRegexMatcher = exports.VarArgsRegexMatcher = exports.RegexItem = void 0;
4
+ const base_driver_1 = require("@appium/base-driver");
5
+ const MAGIC_UNICODE_REPLACEMENT_CHAR = '\uF000';
6
+ const BEGIN_OF_STATEMENT_REGEX = '(?<![.:-])';
7
+ class RegexItem {
8
+ value;
9
+ constructor(value) {
10
+ this.value = value;
11
+ }
12
+ build() {
13
+ if (this.value.includes(MAGIC_UNICODE_REPLACEMENT_CHAR)) {
14
+ throw new Error(`There are missing parameters in the regex.`);
15
+ }
16
+ return this.value;
17
+ }
18
+ toRegex(flags) {
19
+ return RegExp(this.build(), flags);
20
+ }
21
+ }
22
+ exports.RegexItem = RegexItem;
23
+ class VarArgsRegexMatcher extends RegexItem {
24
+ constructor(value) {
25
+ super(`((?:${value.build()})(?:\\s*,\\s*${value.build()})*)`);
26
+ }
27
+ }
28
+ exports.VarArgsRegexMatcher = VarArgsRegexMatcher;
29
+ class ConstructorRegexMatcher extends RegexItem {
30
+ constructor(fullyQualifiedName, ...params) {
31
+ assertCorrectNamespace(fullyQualifiedName);
32
+ const sections = fullyQualifiedName.toLowerCase().split('.');
33
+ const mainClass = sections.pop() ?? '';
34
+ const parentClass = sections.pop() ?? '';
35
+ sections.reverse(); // mutates the actual array
36
+ let regexString = BEGIN_OF_STATEMENT_REGEX +
37
+ `(?:(?:(?:(?:\\bnew\\s*)?)(?:(?:\\b${MAGIC_UNICODE_REPLACEMENT_CHAR}${parentClass}\\.)?(?:${mainClass})))` +
38
+ `|(?:(?:(?:\\bnew-object\\s*)?)(?:\\[(?:${MAGIC_UNICODE_REPLACEMENT_CHAR}${parentClass}\\]::)?(?:${mainClass})))` +
39
+ `|(?:(?:(?:\\[(?:(?:${MAGIC_UNICODE_REPLACEMENT_CHAR}${parentClass}\\.)?${mainClass}\\]::new)))))`;
40
+ sections.forEach((section) => regexString = regexString.replaceAll(MAGIC_UNICODE_REPLACEMENT_CHAR, `(?:${MAGIC_UNICODE_REPLACEMENT_CHAR}${section}\\.)?`));
41
+ super(`${regexString.replaceAll(MAGIC_UNICODE_REPLACEMENT_CHAR, '')}\\(\\s*${params.map((param) => param.build()).join('\\s*,\\s*')}\\s*\\)`);
42
+ }
43
+ }
44
+ exports.ConstructorRegexMatcher = ConstructorRegexMatcher;
45
+ class PropertyRegexMatcher extends RegexItem {
46
+ constructor(namespace, ...properties) {
47
+ assertCorrectNamespace(namespace);
48
+ const sections = namespace.toLowerCase().split('.');
49
+ const mainClass = sections.pop() ?? '';
50
+ sections.reverse(); // mutates the actual array
51
+ let regexString = `${BEGIN_OF_STATEMENT_REGEX}(?:\\b(?:(?:(?:${MAGIC_UNICODE_REPLACEMENT_CHAR}${mainClass}\\.)))|(?:(?:\\[${MAGIC_UNICODE_REPLACEMENT_CHAR}${mainClass}\\]::)))?`;
52
+ sections.forEach((section) => regexString = regexString.replaceAll(MAGIC_UNICODE_REPLACEMENT_CHAR, `(?:${MAGIC_UNICODE_REPLACEMENT_CHAR}${section}\\.)?`));
53
+ super(`${regexString.replaceAll(MAGIC_UNICODE_REPLACEMENT_CHAR, '')}(${properties.length > 0 ? `(?<![a-z-.])(?:(?:${properties.join(')|(?:')}))(?![a-z-.])` : '(?:\\b[a-z]+)'}(?![.-]))`.toLowerCase());
54
+ }
55
+ }
56
+ exports.PropertyRegexMatcher = PropertyRegexMatcher;
57
+ class StringRegexMatcher extends RegexItem {
58
+ constructor() {
59
+ super(`('(?:[^']*(?:''[^']*)?)*')`);
60
+ }
61
+ }
62
+ exports.StringRegexMatcher = StringRegexMatcher;
63
+ function assertCorrectNamespace(namespace) {
64
+ if (!/[a-z.()?:]*/i.test(namespace)) {
65
+ throw new base_driver_1.errors.InvalidArgumentError('namespace parameter should consist of only alphabetical latin letters and dots.');
66
+ }
67
+ }
68
+ //# sourceMappingURL=regex.js.map