Skip to content

Commit 10c534e

Browse files
committed
address comments
1 parent 1c78a74 commit 10c534e

2 files changed

Lines changed: 121 additions & 7 deletions

File tree

packages/server-v4/openapi.v4.yaml

Lines changed: 118 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,11 +2517,11 @@ components:
25172517
type: object
25182518
properties:
25192519
x:
2520+
default: 0
25202521
type: number
25212522
y:
25222523
type: number
25232524
required:
2524-
- x
25252525
- y
25262526
additionalProperties: false
25272527
required:
@@ -2535,13 +2535,14 @@ components:
25352535
cursorPosition:
25362536
$ref: "#/components/schemas/Selector"
25372537
pages:
2538+
default: 1
25382539
type: number
2540+
minimum: -100
2541+
maximum: 100
25392542
delayBetweenMs:
25402543
type: integer
25412544
minimum: 0
25422545
maximum: 9007199254740991
2543-
required:
2544-
- pages
25452546
additionalProperties: false
25462547
PageScrollToTargetParams:
25472548
type: object
@@ -2550,6 +2551,13 @@ components:
25502551
$ref: "#/components/schemas/PageId"
25512552
target:
25522553
$ref: "#/components/schemas/Selector"
2554+
position:
2555+
default: center
2556+
type: string
2557+
enum:
2558+
- center
2559+
- top
2560+
- bottom
25532561
required:
25542562
- target
25552563
additionalProperties: false
@@ -4756,7 +4764,7 @@ components:
47564764
error:
47574765
type: "null"
47584766
action:
4759-
$ref: "#/components/schemas/PageScrollAction"
4767+
$ref: "#/components/schemas/PageScrollActionOutput"
47604768
required:
47614769
- success
47624770
- error
@@ -5625,6 +5633,70 @@ components:
56255633
- y
56265634
additionalProperties: false
56275635
additionalProperties: false
5636+
PageScrollByOffsetParamsOutput:
5637+
type: object
5638+
properties:
5639+
pageId:
5640+
$ref: "#/components/schemas/PageId"
5641+
cursorPosition:
5642+
$ref: "#/components/schemas/Selector"
5643+
offset:
5644+
type: object
5645+
properties:
5646+
x:
5647+
default: 0
5648+
type: number
5649+
y:
5650+
type: number
5651+
required:
5652+
- x
5653+
- y
5654+
additionalProperties: false
5655+
required:
5656+
- offset
5657+
additionalProperties: false
5658+
PageScrollByPagesParamsOutput:
5659+
type: object
5660+
properties:
5661+
pageId:
5662+
$ref: "#/components/schemas/PageId"
5663+
cursorPosition:
5664+
$ref: "#/components/schemas/Selector"
5665+
pages:
5666+
default: 1
5667+
type: number
5668+
minimum: -100
5669+
maximum: 100
5670+
delayBetweenMs:
5671+
type: integer
5672+
minimum: 0
5673+
maximum: 9007199254740991
5674+
required:
5675+
- pages
5676+
additionalProperties: false
5677+
PageScrollToTargetParamsOutput:
5678+
type: object
5679+
properties:
5680+
pageId:
5681+
$ref: "#/components/schemas/PageId"
5682+
target:
5683+
$ref: "#/components/schemas/Selector"
5684+
position:
5685+
default: center
5686+
type: string
5687+
enum:
5688+
- center
5689+
- top
5690+
- bottom
5691+
required:
5692+
- target
5693+
- position
5694+
additionalProperties: false
5695+
PageScrollParamsOutput:
5696+
anyOf:
5697+
- $ref: "#/components/schemas/PageScrollByOffsetParamsOutput"
5698+
- $ref: "#/components/schemas/PageScrollByPagesParamsOutput"
5699+
- $ref: "#/components/schemas/PageScrollToTargetParamsOutput"
56285700
PageClickActionOutput:
56295701
type: object
56305702
properties:
@@ -5707,6 +5779,47 @@ components:
57075779
- params
57085780
- result
57095781
additionalProperties: false
5782+
PageScrollActionOutput:
5783+
type: object
5784+
properties:
5785+
id:
5786+
$ref: "#/components/schemas/ActionId"
5787+
method:
5788+
type: string
5789+
const: scroll
5790+
status:
5791+
$ref: "#/components/schemas/PageActionStatus"
5792+
sessionId:
5793+
$ref: "#/components/schemas/SessionId"
5794+
pageId:
5795+
$ref: "#/components/schemas/PageId"
5796+
createdAt:
5797+
$ref: "#/components/schemas/Timestamp"
5798+
updatedAt:
5799+
$ref: "#/components/schemas/Timestamp"
5800+
completedAt:
5801+
$ref: "#/components/schemas/Timestamp"
5802+
error:
5803+
anyOf:
5804+
- $ref: "#/components/schemas/PageError"
5805+
- type: "null"
5806+
params:
5807+
$ref: "#/components/schemas/PageScrollParamsOutput"
5808+
result:
5809+
anyOf:
5810+
- $ref: "#/components/schemas/PageScrollResult"
5811+
- type: "null"
5812+
required:
5813+
- id
5814+
- method
5815+
- status
5816+
- sessionId
5817+
- createdAt
5818+
- updatedAt
5819+
- error
5820+
- params
5821+
- result
5822+
additionalProperties: false
57105823
PageDragAndDropActionOutput:
57115824
type: object
57125825
properties:
@@ -5752,7 +5865,7 @@ components:
57525865
anyOf:
57535866
- $ref: "#/components/schemas/PageClickActionOutput"
57545867
- $ref: "#/components/schemas/PageHoverActionOutput"
5755-
- $ref: "#/components/schemas/PageScrollAction"
5868+
- $ref: "#/components/schemas/PageScrollActionOutput"
57565869
- $ref: "#/components/schemas/PageDragAndDropActionOutput"
57575870
- $ref: "#/components/schemas/PageTypeAction"
57585871
- $ref: "#/components/schemas/PageKeyPressAction"

packages/server-v4/src/schemas/v4/page.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export const PageScrollByOffsetParamsSchema = PageWithPageIdSchema.extend({
286286
cursorPosition: SelectorSchema.optional(),
287287
offset: z
288288
.object({
289-
x: z.number(),
289+
x: z.number().default(0),
290290
y: z.number(),
291291
})
292292
.strict(),
@@ -296,14 +296,15 @@ export const PageScrollByOffsetParamsSchema = PageWithPageIdSchema.extend({
296296

297297
export const PageScrollByPagesParamsSchema = PageWithPageIdSchema.extend({
298298
cursorPosition: SelectorSchema.optional(),
299-
pages: z.number(),
299+
pages: z.number().lte(100).gte(-100).default(1),
300300
delayBetweenMs: z.number().int().min(0).optional(),
301301
})
302302
.strict()
303303
.meta({ id: "PageScrollByPagesParams" });
304304

305305
export const PageScrollToTargetParamsSchema = PageWithPageIdSchema.extend({
306306
target: SelectorSchema,
307+
position: z.enum(["center", "top", "bottom"]).default("center"),
307308
})
308309
.strict()
309310
.meta({ id: "PageScrollToTargetParams" });

0 commit comments

Comments
 (0)