@@ -270,12 +270,14 @@ export const PageClickParamsSchema = PageWithPageIdSchema.extend({
270270 selector : SelectorSchema ,
271271 button : MouseButtonSchema . optional ( ) ,
272272 clickCount : z . number ( ) . int ( ) . min ( 1 ) . optional ( ) ,
273+ returnSelector : z . boolean ( ) . optional ( ) ,
273274} )
274275 . strict ( )
275276 . meta ( { id : "PageClickParams" } ) ;
276277
277278export const PageHoverParamsSchema = PageWithPageIdSchema . extend ( {
278279 selector : SelectorSchema ,
280+ returnSelector : z . boolean ( ) . optional ( ) ,
279281} )
280282 . strict ( )
281283 . meta ( { id : "PageHoverParams" } ) ;
@@ -305,6 +307,7 @@ export const PageDragAndDropParamsSchema = PageWithPageIdSchema.extend({
305307 button : MouseButtonSchema . optional ( ) ,
306308 steps : z . number ( ) . int ( ) . positive ( ) . optional ( ) ,
307309 delay : z . number ( ) . int ( ) . min ( 0 ) . optional ( ) ,
310+ returnSelector : z . boolean ( ) . optional ( ) ,
308311} )
309312 . strict ( )
310313 . meta ( { id : "PageDragAndDropParams" } ) ;
@@ -622,17 +625,47 @@ export const PageCloseRequestSchema = createPageRequestSchema(
622625 PageCloseParamsSchema ,
623626) ;
624627
625- export const PageXPathResultSchema = z
628+ export const PageScrollResultSchema = z
629+ . object ( {
630+ x : z . number ( ) ,
631+ y : z . number ( ) ,
632+ } )
633+ . strict ( )
634+ . meta ( { id : "PageScrollResult" } ) ;
635+
636+ export const ResultSelectorSchema = z
626637 . object ( {
627638 xpath : z . string ( ) . optional ( ) ,
639+ css : z . string ( ) . optional ( ) ,
640+ text : z . string ( ) . optional ( ) ,
641+ coordinates : z
642+ . object ( {
643+ x : z . number ( ) ,
644+ y : z . number ( ) ,
645+ } )
646+ . optional ( ) ,
647+ } )
648+ . strict ( )
649+ . meta ( { id : "ResultSelector" } ) ;
650+
651+ export const PageClickResultSchema = z
652+ . object ( {
653+ selector : ResultSelectorSchema ,
654+ } )
655+ . strict ( )
656+ . meta ( { id : "PageClickResult" } ) ;
657+
658+ export const PageHoverResultSchema = z
659+ . object ( {
660+ selector : ResultSelectorSchema ,
628661 } )
629662 . strict ( )
630- . meta ( { id : "PageXPathResult " } ) ;
663+ . meta ( { id : "PageHoverResult " } ) ;
631664
632665export const PageDragAndDropResultSchema = z
633666 . object ( {
634- fromXpath : z . string ( ) . optional ( ) ,
635- toXpath : z . string ( ) . optional ( ) ,
667+ startSelector : ResultSelectorSchema ,
668+ endSelector : ResultSelectorSchema ,
636669 } )
637670 . strict ( )
638671 . meta ( { id : "PageDragAndDropResult" } ) ;
@@ -821,21 +854,21 @@ export const PageClickActionSchema = createPageActionSchema(
821854 "PageClickAction" ,
822855 "click" ,
823856 PageClickParamsSchema ,
824- PageXPathResultSchema ,
857+ PageClickResultSchema ,
825858) ;
826859
827860export const PageHoverActionSchema = createPageActionSchema (
828861 "PageHoverAction" ,
829862 "hover" ,
830863 PageHoverParamsSchema ,
831- PageXPathResultSchema ,
864+ PageHoverResultSchema ,
832865) ;
833866
834867export const PageScrollActionSchema = createPageActionSchema (
835868 "PageScrollAction" ,
836869 "scroll" ,
837870 PageScrollParamsSchema ,
838- PageXPathResultSchema ,
871+ PageScrollResultSchema ,
839872) ;
840873
841874export const PageDragAndDropActionSchema = createPageActionSchema (
@@ -1280,6 +1313,7 @@ export const pageOpenApiComponents = {
12801313 CoordinateSelector : CoordinateSelectorSchema ,
12811314 Selector : SelectorSchema ,
12821315 ElementSelector : ElementSelectorSchema ,
1316+ ResultSelector : ResultSelectorSchema ,
12831317 PageHeaders : PageHeadersSchema ,
12841318 PageInitScript : PageInitScriptSchema ,
12851319 PageClip : PageClipSchema ,
0 commit comments